From 537ae6de18c4359bab13f117f25e5e5c2322d486 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 15 Mar 2012 05:49:24 +0000 Subject: [PATCH] remove jquery deletion jquery deletion was deleting the wrong image if there were multiple delete buttons on one page (eg, on the report image page); also it stands out awkwardly being the only bit of jquery UI on the site. Moving to jquery UI across the site might happen later, but for now I just want to get a release out... --- ext/image/main.php | 2 -- ext/image/theme.php | 21 ++++++--------------- lib/shimmie.js | 25 ------------------------- 3 files changed, 6 insertions(+), 42 deletions(-) diff --git a/ext/image/main.php b/ext/image/main.php index f435cd97..ffaecc5a 100644 --- a/ext/image/main.php +++ b/ext/image/main.php @@ -142,7 +142,6 @@ class ImageIO extends Extension { if(function_exists("exif_read_data")) { $config->set_default_bool('image_show_meta', false); } - $config->set_default_bool('image_jquery_confirm', true); $config->set_default_string('image_ilink', ''); $config->set_default_string('image_tlink', ''); $config->set_default_string('image_tip', '$tags // $size // $filesize'); @@ -252,7 +251,6 @@ class ImageIO extends Extension { if(function_exists("exif_read_data")) { $sb->add_bool_option("image_show_meta", "
Show metadata: "); } - $sb->add_bool_option("image_jquery_confirm", "
Confirm Delete with jQuery: "); $expires = array(); $expires['1 Minute'] = 60; diff --git a/ext/image/theme.php b/ext/image/theme.php index c21a7390..02dddc8e 100644 --- a/ext/image/theme.php +++ b/ext/image/theme.php @@ -9,21 +9,12 @@ class ImageIOTheme { public function get_deleter_html(/*int*/ $image_id) { global $config; - if($config->get_bool("image_jquery_confirm")) { - $html = " - ".make_form(make_link("image_admin/delete"),'POST',false,'delete_image')." - - - - "; - } else { - $html = " - ".make_form(make_link("image_admin/delete"))." - - - - "; - } + $html = " + ".make_form(make_link("image_admin/delete"))." + + + + "; return $html; } diff --git a/lib/shimmie.js b/lib/shimmie.js index 7b5ef6f3..4243f6df 100644 --- a/lib/shimmie.js +++ b/lib/shimmie.js @@ -1,31 +1,6 @@ // Adding jQuery ui stuff $(document).ready(function() { - - var $confirm = $('
') - .html('

This image will be permanently deleted and cannot be recovered. Are you sure?

') - .dialog({ - resizable: false, - height:220, - modal: true, - autoOpen: false, - title: 'Delete Image?', - buttons: { - "Delete Image": function() { - $( this ).dialog( "close" ); - $('form#delete_image').submit(); - }, - Cancel: function() { - $( this ).dialog( "close" ); - } - } - }); - - $('form#delete_image #delete_image_submit').click(function(e){ - e.preventDefault(); - $confirm.dialog('open'); - }); - $("time").timeago(); $('.autocomplete_tags').autocomplete(base_href + '/api/internal/tag_list/complete', {