pip install jsbeautifier

This commit is contained in:
Claude 2016-09-01 21:56:41 +02:00
parent 4049cd4447
commit 366d79e5af

View File

@ -41,7 +41,10 @@ ST.spamadmin = function() {
$('.content .quick_remove').live('click', function(ev) { $('.content .quick_remove').live('click', function(ev) {
var ip = $(ev.target).data('ip'); var ip = $(ev.target).data('ip');
if (confirm('Delete all pastes belonging to ' + ip + '?')) { if (confirm('Delete all pastes belonging to ' + ip + '?')) {
$.post(base_url + 'spamadmin/' + ip, { 'confirm_remove': 'yes', 'block_ip': 1 }, function() { $.post(base_url + 'spamadmin/' + ip, {
'confirm_remove': 'yes',
'block_ip': 1
}, function() {
window.location.reload(); window.location.reload();
}); });
} }
@ -202,12 +205,60 @@ ST.crypto_generate_key = function(len) {
return key; return key;
} }
ST.filereader = function() {
var options = {
// CSS Class to add to the drop element when a drag is active
dragClass: "drag",
// A string to match MIME types, for instance
accept: false,
// An object specifying how to read certain MIME types
// For example: {
// 'image/*': 'DataURL',
// 'data/*': 'ArrayBuffer',
// 'text/*' : 'Text'
// }
readAsMap: {},
// How to read any files not specified by readAsMap
readAsDefault: 'DataURL',
on: {
beforestart: function(e, file) {
// return false if you want to skip this file
},
loadstart: function(e, file) { /* Native ProgressEvent */ },
progress: function(e, file) { /* Native ProgressEvent */ },
load: function(e, file) { /* Native ProgressEvent */ },
error: function(e, file) { /* Native ProgressEvent */ },
loadend: function(e, file) { /* Native ProgressEvent */ },
abort: function(e, file) { /* Native ProgressEvent */ },
skip: function(e, file) {
// Called when a file is skipped. This happens when:
// 1) A file doesn't match the accept option
// 2) false is returned in the beforestart callback
},
groupstart: function(group) {
// Called when a 'group' (a single drop / copy / select that may
// contain multiple files) is receieved.
// You can ignore this event if you don't care about groups
},
groupend: function(group) {
// Called when a 'group' is finished.
// You can ignore this event if you don't care about groups
}
}
};
$("textarea").fileReaderJS(opts);
}
ST.init = function() { ST.init = function() {
ST.expand(); ST.expand();
ST.show_embed(); ST.show_embed();
ST.spamadmin(); ST.spamadmin();
ST.line_highlighter(); ST.line_highlighter();
ST.crypto(); ST.crypto();
ST.filereader();
}; };
$(document).ready(function() { $(document).ready(function() {