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:
-rw-r--r--css/gallerybutton.css7
-rw-r--r--js/gallerybutton.js51
2 files changed, 0 insertions, 58 deletions
diff --git a/css/gallerybutton.css b/css/gallerybutton.css
index 2219fda2..80f3c753 100644
--- a/css/gallerybutton.css
+++ b/css/gallerybutton.css
@@ -12,10 +12,3 @@
filter: alpha(opacity=50);
opacity: .5;
}
-
-#linkSwitchButton {
- height: 18px;
- margin-left: 10px;
- padding: 0 5px;
- font-weight: normal;
-}
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) {