summaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
authorSimon Rettberg2018-02-09 16:17:03 +0100
committerSimon Rettberg2018-02-09 16:17:03 +0100
commit676bb4aebcbb65f6271f062d03aef2a48346f2e3 (patch)
tree4ebaa48cad5acf9d9087f206018da446cd4a9e62 /script
parentPermissions: Introduce helper functions for common tasks (diff)
downloadslx-admin-676bb4aebcbb65f6271f062d03aef2a48346f2e3.tar.gz
slx-admin-676bb4aebcbb65f6271f062d03aef2a48346f2e3.tar.xz
slx-admin-676bb4aebcbb65f6271f062d03aef2a48346f2e3.zip
[backup] Use permission helpers
Diffstat (limited to 'script')
-rw-r--r--script/slx-fixes.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/script/slx-fixes.js b/script/slx-fixes.js
index 12db9c79..1ed71cb9 100644
--- a/script/slx-fixes.js
+++ b/script/slx-fixes.js
@@ -1,6 +1,8 @@
// Give file select dialogs a modern style and feel
$(document).on('change', '.btn-file :file', function() {
var input = $(this);
+ if (input.parents('.disabled').length !== 0)
+ return;
var numFiles = input.get(0).files ? input.get(0).files.length : 1;
var label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
input.trigger('fileselect', [numFiles, label]);
@@ -15,23 +17,23 @@ $(document).ready(function() {
});
});
$('.upload-ex :text').click(function () {
- $(this).parents('.upload-ex').find(':file').click();
+ var $this = $(this);
+ if ($this.parents('.disabled').length !== 0)
+ return;
+ $this.parents('.upload-ex').find(':file').click();
});
// Replace message query params in URL, so you won't see them again if you bookmark or share the link
if (history && history.replaceState && window && window.location && window.location.search && window.location.search.indexOf('message[]=') !== -1) {
var str = window.location.search;
- console.log('TRUE: ' + str);
do {
var repl = str.match(/([\?&])message\[\]=[^&]+(&|$)/);
- console.log(repl);
if (!repl) break;
if (repl[2].length === 0) {
str = str.replace(repl[0], '');
} else {
str = str.replace(repl[0], repl[1]);
}
- console.log('Replace: ' + str);
} while (1);
history.replaceState(null, null, window.location.pathname + str);
}