diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-05-07 16:46:35 +0200 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-05-07 16:46:35 +0200 |
commit | f28d71bb9c1142dd979f5837fb15d914b2d4e4d6 (patch) | |
tree | 84f9a64230fd94dc63e0b924a9cfc789aa120698 | |
parent | ef073a148f2dfcefc9f1bd2bd68fcb9c33aba3cf (diff) | |
download | nextcloud-server-f28d71bb9c1142dd979f5837fb15d914b2d4e4d6.tar.gz nextcloud-server-f28d71bb9c1142dd979f5837fb15d914b2d4e4d6.zip |
fix gallery sharing
-rwxr-xr-x | apps/gallery/appinfo/app.php | 1 | ||||
-rw-r--r-- | apps/gallery/js/album_cover.js | 2 | ||||
-rw-r--r-- | apps/gallery/js/sharing.js | 12 |
3 files changed, 8 insertions, 7 deletions
diff --git a/apps/gallery/appinfo/app.php b/apps/gallery/appinfo/app.php index 2501ae7bbd5..333b1581ce1 100755 --- a/apps/gallery/appinfo/app.php +++ b/apps/gallery/appinfo/app.php @@ -56,4 +56,5 @@ class OC_GallerySearchProvider extends OC_Search_Provider{ OC_Search::registerProvider('OC_GallerySearchProvider'); require_once('apps/gallery/lib/hooks_handlers.php'); +OCP\CONFIG::setAppValue('core', 'public_gallery', '/apps/gallery/sharing.php'); ?> diff --git a/apps/gallery/js/album_cover.js b/apps/gallery/js/album_cover.js index d44e7f83d1f..61084c99b29 100644 --- a/apps/gallery/js/album_cover.js +++ b/apps/gallery/js/album_cover.js @@ -31,7 +31,7 @@ function albumClick(title) { } function constructSharingPath() { - return document.location.protocol + '//' + document.location.host + OC.linkTo('gallery', 'sharing.php') + '?token=' + Albums.token; + return document.location.protocol + '//' + document.location.host + OC.linkTo('', 'public.php') + '?service=gallery&token=' + Albums.token; } function shareGallery() { diff --git a/apps/gallery/js/sharing.js b/apps/gallery/js/sharing.js index 340d1b9b274..679e39578aa 100644 --- a/apps/gallery/js/sharing.js +++ b/apps/gallery/js/sharing.js @@ -1,5 +1,5 @@ $(document).ready(function() { - $.getJSON('ajax/sharing.php', {operation: 'get_gallery', token: TOKEN}, albumClickHandler); + $.getJSON(OC.filePath('gallery', 'ajax', 'sharing.php'), {operation: 'get_gallery', token: TOKEN}, albumClickHandler); }); var paths = []; @@ -13,7 +13,7 @@ function returnTo(num) { } path = ''; for (var e in paths) path += '/' + paths[e]; - $.getJSON('ajax/sharing.php', {operation: 'get_gallery', token: TOKEN, path: path}, function(r) { + $.getJSON(OC.filePath('gallery', 'ajax', 'sharing.php'), {operation: 'get_gallery', token: TOKEN, path: path}, function(r) { albumClickHandler(r); }); } @@ -21,7 +21,7 @@ function returnTo(num) { function albumClickHandler(r) { var element = $('div#gallery_list'); element.html(''); - var album_template = '<div class="gallery_box"><div><a rel="images"><img src="ajax/sharing.php?token='+TOKEN+'&operation=get_album_thumbnail&albumname=IMGPATH"></a></div><h1></h1></div>'; + var album_template = '<div class="gallery_box"><div><a rel="images"><img src="' + OC.filePath('gallery', 'ajax', 'sharing.php') + '?token='+TOKEN+'&operation=get_album_thumbnail&albumname=IMGPATH"></a></div><h1></h1></div>'; for (var i in r.albums) { var a = r.albums[i]; @@ -36,7 +36,7 @@ function albumClickHandler(r) { paths.push($(this).attr('title')); path = ''; for (var e in paths) path += '/' + paths[e]; - $.getJSON('ajax/sharing.php', {operation: 'get_gallery', token: TOKEN, path: path}, function(r) { + $.getJSON(OC.filePath('gallery', 'ajax', 'sharing.php'), {operation: 'get_gallery', token: TOKEN, path: path}, function(r) { var name = paths[paths.length-1]; counter++; var d = '<span class="breadcrumbelement" onclick="javascript:returnTo('+counter+');return false;">'+name+'</span>'; @@ -49,9 +49,9 @@ function albumClickHandler(r) { var pat = ''; for (var a in paths) pat += '/'+paths[a]; - var photo_template = '<div class="gallery_box"><div><a rel="images" href="*HREF*" target="_blank"><img src="ajax/sharing.php?token='+TOKEN+'&operation=get_thumbnail&img=IMGPATH"></a></div></div>'; + var photo_template = '<div class="gallery_box"><div><a rel="images" href="*HREF*" target="_blank"><img src="' + OC.filePath('gallery', 'ajax', 'sharing.php') + '?token='+TOKEN+'&operation=get_thumbnail&img=IMGPATH"></a></div></div>'; for (var a in r.photos) { - var local = photo_template.replace('IMGPATH', encodeURIComponent(r.photos[a])).replace('*HREF*', 'ajax/sharing.php?token='+TOKEN+'&operation=get_photo&photo='+encodeURIComponent(r.photos[a])); + var local = photo_template.replace('IMGPATH', encodeURIComponent(r.photos[a])).replace('*HREF*', OC.filePath('gallery', 'ajax', 'sharing.php') + '?token='+TOKEN+'&operation=get_photo&photo='+encodeURIComponent(r.photos[a])); element.append(local); } } |