Blame view

sources/apps/gallery/js/public.js 986 Bytes
d1bafeea1   Kload   [fix] Upgrade to ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  $(document).ready(function () {
  	if ($('#body-login').length > 0) {
  		return true; //deactivate on login page
  	}
  	if ($('#filesApp').val() && $('#isPublic').val()) {
  		images = $("#fileList").find("tr[data-mime^='image']").length;
  		if (images > 0) {
  			// toggle for opening shared file list as picture view
  			// TODO find a way to not need to use inline CSS
  			button = $('<div class="button"'
  				+'style="position: absolute; right: 0; top: 0; font-weight: normal;">'
  					+'<img class="svg" src="' + OC.filePath('core', 'img/actions', 'toggle-pictures.svg') + '"'
  					+'alt="' + t('gallery', 'Picture view') + '"'
  					+'style="vertical-align: text-top; '
  					+'-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); '
  					+'filter: alpha(opacity=50); opacity: .5;" />'
  				+'</div>');
  			$('#controls').append(button);
  
  			button.click( function (event) {
  				window.location.href = window.location.href.replace('service=files', 'service=gallery');
  			});
  		}
  	}
  });