summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/css/style.css8
-rw-r--r--data/js/script.js35
2 files changed, 43 insertions, 0 deletions
diff --git a/data/css/style.css b/data/css/style.css
index ad956c57f..bcbcaafc5 100644
--- a/data/css/style.css
+++ b/data/css/style.css
@@ -238,6 +238,14 @@ body {
display: inline-block;
}
+.upload_history_thumbnails .marked {
+ background: red;
+}
+
+.upload_history_thumbnails .marked img {
+ opacity: 0.4;
+}
+
/* highlighting theme */
.hll { background-color: #ffffcc }
diff --git a/data/js/script.js b/data/js/script.js
index f747941e5..ec5da9a2b 100644
--- a/data/js/script.js
+++ b/data/js/script.js
@@ -68,6 +68,41 @@ function fixedEncodeURIComponent (str) {
html: true,
});
+ $('#toggle_delete_mode').on("click", function() {
+ switch (window.page_mode) {
+ case "delete":
+ window.page_mode = "normal";
+ $('#delete_button').hide();
+ $("#delete_form input[id^='delete_']").remove();
+ $(".upload_history_thumbnails .marked").removeClass("marked");
+ break;
+ default:
+ window.page_mode = "delete";
+ $('#delete_button').show();
+ break;
+ }
+ });
+
+ $('.upload_history_thumbnails a').on("click", function(event) {
+ if (window.page_mode == "delete") {
+ event.preventDefault();
+ var data_id = $(event.target).parent().attr("data-id");
+
+ if ($('#delete_'+data_id).length == 0) {
+ $('<input>').attr({
+ type: "hidden",
+ name: "ids["+data_id+"]",
+ value: data_id,
+ id: "delete_"+data_id,
+ }).appendTo('#delete_form');
+ $(event.target).parent().addClass("marked");
+ } else {
+ $('#delete_'+data_id).remove();
+ $(event.target).parent().removeClass("marked");
+ }
+ }
+ });
+
function handle_resize() {
var div = $('.upload_history_thumbnails');
div.width(div.parent().width() - (div.parent().width() % div.find('a').outerWidth(true)));