Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/gallery.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Paroz <github@oparoz.com>2015-04-02 12:20:38 +0300
committerOlivier Paroz <github@oparoz.com>2015-06-22 03:15:37 +0300
commit09eb545da0212140c546e8f15edfc11dbbe53b93 (patch)
tree28a5b262373e2aeacf9a0801939a114efbf070ef /js/gallerybutton.js
parent6cd1884ce0f2dc75ae149b8f83ad71adb6da6321 (diff)
Move direct Gallery links from Files app to its own app
Diffstat (limited to 'js/gallerybutton.js')
-rw-r--r--js/gallerybutton.js51
1 files changed, 0 insertions, 51 deletions
diff --git a/js/gallerybutton.js b/js/gallerybutton.js
index 966cb602..3f23f7c8 100644
--- a/js/gallerybutton.js
+++ b/js/gallerybutton.js
@@ -3,33 +3,17 @@ var GalleryButton = {};
GalleryButton.isPublic = false;
GalleryButton.button = {};
GalleryButton.url = null;
-GalleryButton.appName = 'galleryplus';
GalleryButton.onFileListUpdated = function () {
- var hasImages = false;
var fileList;
- var files;
if (GalleryButton.isPublic) {
fileList = OCA.Sharing.PublicApp.fileList;
} else {
fileList = FileList;
}
- files = fileList.files;
GalleryButton.buildGalleryUrl(fileList.getCurrentDirectory().replace(/^\//, ''));
-
- for (var i = 0; i < files.length; i++) {
- var file = files[i];
- if (file.isPreviewAvailable) {
- hasImages = true;
- break;
- }
- }
-
- if (hasImages) {
- GalleryButton.hijackShare();
- }
};
GalleryButton.buildGalleryUrl = function (dir) {
@@ -43,41 +27,6 @@ GalleryButton.buildGalleryUrl = function (dir) {
GalleryButton.url = OC.generateUrl('apps/galleryplus/' + tokenPath, params) + '#' + encodeURIComponent(dir);
};
-GalleryButton.hijackShare = function () {
- var target = OC.Share.showLink;
- OC.Share.showLink = function () {
- var r = target.apply(this, arguments);
- if ($('#dropdown.drop.shareDropDown').data('item-type') === "folder") {
-
- if (!$('#linkSwitchButton').length) {
- var linkSwitchButton = '<a class="button" id="linkSwitchButton">' +
- t(GalleryButton.appName, 'Show Gallery link') + '</a>';
- $('#linkCheckbox+label').after(linkSwitchButton);
- }
-
- $("#linkSwitchButton").toggle(function () {
- $(this).text("Show Files link");
- $('#linkText').val($('#linkText').val().replace('index.php/s/', 'index.php/apps/' +
- GalleryButton.appName + '/s/'));
- }, function () {
- $(this).text("Show Gallery link");
- $('#linkText').val($('#linkText').val().replace('index.php/apps/' +
- GalleryButton.appName + '/s/', 'index.php/s/'));
-
- });
-
- $('#linkCheckbox').change(function () {
- if (this.checked) {
- $('#linkSwitchButton').show();
- } else {
- $('#linkSwitchButton').hide();
- }
- });
- }
- return r;
- };
-};
-
$(document).ready(function () {
if ($('#body-login').length > 0) {