diff --git a/ext/mass_tagger/main.php b/ext/mass_tagger/main.php deleted file mode 100644 index fe91b366..00000000 --- a/ext/mass_tagger/main.php +++ /dev/null @@ -1,74 +0,0 @@ -, contributions by Shish and Agasa - * License: WTFPL - * Description: Tag a bunch of images at once - * Documentation: - * Once enabled, a new "Mass Tagger" box will appear on the left hand side of - * post listings, with a button to enable the mass tagger. Once clicked JS will - * add buttons to each image to mark them for tagging, and a field for - * inputting tags will appear. Once the "Tag" button is clicked, the tags in - * the text field will be added to marked images. - */ - -class MassTagger extends Extension -{ - public function onPostListBuilding(PostListBuildingEvent $event) - { - global $config, $page, $user; - - if ($user->is_admin()) { - $this->theme->display_mass_tagger($page, $event, $config); - } - } - - public function onPageRequest(PageRequestEvent $event) - { - global $page, $user; - if ($event->page_matches("mass_tagger/tag") && $user->is_admin()) { - if (!isset($_POST['ids']) or !isset($_POST['tag'])) { - return; - } - - $tags = Tag::explode($_POST['tag']); - - $pos_tag_array = []; - $neg_tag_array = []; - foreach ($tags as $new_tag) { - if (strpos($new_tag, '-') === 0) { - $neg_tag_array[] = substr($new_tag, 1); - } else { - $pos_tag_array[] = $new_tag; - } - } - - $ids = explode(':', $_POST['ids']); - $ids = array_filter($ids, 'is_numeric'); - - $images = array_map("Image::by_id", $ids); - - if (isset($_POST['setadd']) && $_POST['setadd'] == 'set') { - foreach ($images as $image) { - $image->set_tags($tags); - } - } else { - foreach ($images as $image) { - if (!empty($neg_tag_array)) { - $img_tags = array_merge($pos_tag_array, $image->get_tag_array()); - $img_tags = array_diff($img_tags, $neg_tag_array); - $image->set_tags($img_tags); - } else { - $image->set_tags(array_merge($tags, $image->get_tag_array())); - } - } - } - - $page->set_mode(PageMode::REDIRECT); - if (!isset($_SERVER['HTTP_REFERER'])) { - $_SERVER['HTTP_REFERER'] = make_link(); - } - $page->set_redirect($_SERVER['HTTP_REFERER']); - } - } -} diff --git a/ext/mass_tagger/script.js b/ext/mass_tagger/script.js deleted file mode 100644 index 0e4dbcd9..00000000 --- a/ext/mass_tagger/script.js +++ /dev/null @@ -1,41 +0,0 @@ -/*jshint bitwise:true, curly:true, forin:false, noarg:true, noempty:true, nonew:true, undef:true, strict:false, browser:true, jquery:true */ - -function activate_mass_tagger ( image_link ) { - $(".shm-thumb").each( - function ( index, block ) { - add_mass_tag_button( $(block), image_link ); - } - ); - $('#mass_tagger_controls').show(); - $('#mass_tagger_activate').hide(); -} - -function add_mass_tag_button($block, image_link) { - - var c = function() { toggle_tag(this, $block.data("post-id")); return false; }; - - $block.find("A").click(c); - $block.click(c); // sometimes the thumbs *is* the A -} - -function toggle_tag( button, id ) { - id += ":"; - var list = $('#mass_tagger_ids'); - var string = list.val(); - - if( (string.indexOf(id) == 0) || (string.indexOf(":"+id) > -1) ) { - $(button).removeClass('mass-tagger-selected'); - string = string.replace(id, ''); - list.val(string); - } - else { - $(button).addClass('mass-tagger-selected'); - string += id; - list.val(string); - } -} - -$(function () { - // Clear the selection, in case it was autocompleted by the browser. - $('#mass_tagger_ids').val(""); -}); diff --git a/ext/mass_tagger/style.css b/ext/mass_tagger/style.css deleted file mode 100644 index c0a2ea6c..00000000 --- a/ext/mass_tagger/style.css +++ /dev/null @@ -1,3 +0,0 @@ -.mass-tagger-selected { - border: 3px solid blue; -} \ No newline at end of file diff --git a/ext/mass_tagger/theme.php b/ext/mass_tagger/theme.php deleted file mode 100644 index f5894cbb..00000000 --- a/ext/mass_tagger/theme.php +++ /dev/null @@ -1,25 +0,0 @@ - - - - - "; - $block = new Block("Mass Tagger", $body, "left", 50); - $page->add_block($block); - } -} diff --git a/ext/mass_tagger/toggle.gif b/ext/mass_tagger/toggle.gif deleted file mode 100644 index 64c3c765..00000000 Binary files a/ext/mass_tagger/toggle.gif and /dev/null differ