From 55b1d944c9c0da144867630916bbb35f1ce08684 Mon Sep 17 00:00:00 2001 From: kalvn Date: Sun, 4 Aug 2019 21:47:10 +0200 Subject: [PATCH 1/5] Adds bulk visibility setting. --- src/js/main.js | 65 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/src/js/main.js b/src/js/main.js index adaaa98..28fcce1 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -730,6 +730,7 @@ * - noHtmlEscape {Boolean} Prevent HTML escape of title and body. * - value {String} Value of input field when using type prompt. * - buttonLabelOk {String} Label for OK button. Defaults to 'OK'. + * - buttonClassesOk {String} Classes for OK button. * @return {Void} */ var displayModal = function(title, text, type, callback, options){ @@ -749,11 +750,11 @@ footer += ''; break; case 'confirm': - footer += ''; + footer += ''; break; case 'prompt': body += ''; - footer += ''; + footer += ''; break; default: console.log('Modal type must be alert, confirm or prompt. ' + type + ' isn\'t recognized.'); @@ -925,6 +926,66 @@ buttonLabelOk: 'Delete ' + length + ' links' }); } + }, + { + id: 'set-links-public-button', + label: 'Set public', + classes: 'button button-primary', + callback: function (event) { + var linksIds = ''; + var linksTexts = ''; + linksIds = linksIdTab.join('+'); + var url = '?change_visibility&newVisibility=public&ids='+ linksIds +'&token='+ encodeURIComponent($('#token').val()); + + displayModal('Are you sure to set those ' + length + ' links public?', 'The following links will be set as public: ' + linksTexts, 'confirm', function(accepted){ + if(accepted){ + window.location.href = url; + } + }, { + noHtmlEscape: true, + buttonLabelOk: 'Set ' + length + ' links public', + buttonClassesOk: 'button-primary' + }); + } + }, + { + id: 'set-links-private-button', + label: 'Set private', + classes: 'button button-primary', + callback: function (event) { + var linksIds = ''; + var linksTexts = ''; + linksIds = linksIdTab.join('+'); + var url = '?change_visibility&newVisibility=private&ids='+ linksIds +'&token='+ encodeURIComponent($('#token').val()); + + displayModal('Are you sure to set those ' + length + ' links private?', 'The following links will be set as private: ' + linksTexts, 'confirm', function(accepted){ + if(accepted){ + window.location.href = url; + } + }, { + noHtmlEscape: true, + buttonLabelOk: 'Set ' + length + ' links private', + buttonClassesOk: 'button-primary' + }); + } } ] }); From 64a94a4eb69de7e50767df2f32e0cea48909519e Mon Sep 17 00:00:00 2001 From: kalvn Date: Wed, 18 Mar 2020 15:38:00 +0100 Subject: [PATCH 2/5] Adds select all link for batch mode. --- .gitignore | 2 +- src/js/main.js | 62 ++++++++++++++++++++++++++--- src/scss/components/_actionbar.scss | 5 +++ 3 files changed, 63 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 6cd8cf3..fccd67a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ # Removes some useless build files. material/dist/* -!material/dist +#!material/dist # Removes the user defined template. material/extra.html diff --git a/src/js/main.js b/src/js/main.js index 28fcce1..0fa2bbe 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -115,6 +115,14 @@ } else{ hidePopups(); } + + if ($.inArray('actionbar-selectall-link', event.target.classList) > -1) { + event.preventDefault(); + $('.link-outer').each(function () { + console.log('lol'); + toggleLinkSelection($(this), true); + }); + } }); $('.popup-trigger').on('click', function(){ @@ -798,7 +806,7 @@ } var uid = guid(); - var html = '