diff --git a/contrib/tagger/main.php b/contrib/tagger/main.php index fbad7e1c..82983a1b 100644 --- a/contrib/tagger/main.php +++ b/contrib/tagger/main.php @@ -5,10 +5,14 @@ class tagger extends Extension { public function receive_event ($event) { if(is_null($this->theme)) $this->theme = get_theme_object("tagger", "taggerTheme"); + if(is_a($event,"DisplayingImageEvent")) { //show tagger box global $database; global $page; + global $config; + + $base_href = $config->get_string('base_href'); $tags = $database->Execute(" SELECT tag @@ -16,7 +20,16 @@ class tagger extends Extension { WHERE count > 1 AND substring(tag,1,1) != '.' ORDER BY tag"); - $this->theme->build($page, $tags); + $this->theme->build($page, $tags); + } + + + + if(is_a($event,"PageRequestEvent") && $event->page_name == "about" + && $event->get_arg(0) == "tagger") + { + global $page; + $this->theme->show_about($page); } } } diff --git a/contrib/tagger/script.js b/contrib/tagger/script.js index 364acc67..1cd27ea0 100644 --- a/contrib/tagger/script.js +++ b/contrib/tagger/script.js @@ -29,6 +29,56 @@ function addTagById(id) { addTag(tag.value); } +function tagger_filter(id) { + var filter = byId(id); + var e; + + search = filter.value; + if (search.length == 1) + search = " "+search; + + tag_links = getElementsByTagNames('div',byId('tagger_body')); + + for (x in tag_links) { + tag_id = tag_links[x].id; + tag = " "+tag_id.replace(/tagger_tag_/,""); + e = byId(tag_id); + if (!tag.match(search)) { + e.style.display = 'none'; + } else { + e.style.display = ''; + } + } +} + +// Quirksmode.org // +// http://www.quirksmode.org/dom/getElementsByTagNames.html // +function getElementsByTagNames(list,obj) { + if (!obj) var obj = document; + var tagNames = list.split(','); + var resultArray = new Array(); + for (var i=0;i"; - $html .= "Tagger"; - $html .= ""; - $html .= "
"; - $html .= "
"; + $tag_html = ""; foreach ($tags as $tag) { - $tag_name = $this->trimTag($tag['tag'],32); - $html .= "".$tag_name."
"; + $tag_name = $tag['tag']; + $tag_trunc = $this->trimTag($tag_name,32); + $tag_html .= "
"." + ".$tag_trunc."". + "
"; } - $html .= "
"; - + $url_more = make_link("about/tagger"); + $html = <<Collapse this block to hide Tagger. +
+

Use

+ +
+
+ Tagger +
+
+ +
+ + +
+ $tag_html +
+
+EOD; $page->add_block( new Block("Tagger", - "Collapse this block to hide Tagger.

Use: Click the links to add the tag to the list, when done, press Set to save the tags.".$html, + "".$html, "left", 0)); } @@ -26,5 +48,25 @@ class taggerTheme extends Themelet { } return $s; } + + public function show_about ($event) { + global $page; + $html = <<Author +Erik Youngren (Artanis) artanis.00@gmail.com +

Use

+
    +
  • Click the links to add the tag to the image's tag list, when done, press Set to save the tags.
  • +
  • Type in the filter box to remove tags you aren't looking for.
      +
    • Single letter filters will only match the first letter of the tags.
    • +
    • 2 or more will match that letter combination anywhere in the tag. Starting a + filter with a space (' ') will prevent this behaviour.
    • +
  • +
  • Enter tags not on the list in the second box. Tags must have 2 uses to display in the list.
  • +
+EOD; + + $page->add_block( new Block("About Tagger", $html,"main")); + } } ?>