From c30fee9f0bb2d217284e3083385336c3e6022e4f Mon Sep 17 00:00:00 2001 From: Artanis Date: Tue, 2 Oct 2007 22:27:09 +0000 Subject: [PATCH] Tagger 20071002 1526 git-svn-id: file:///home/shish/svn/shimmie2/trunk@513 7f39781d-f577-437e-ae19-be835c7a54ca --- contrib/tagger/main.php | 16 ++++++++++++++++ contrib/tagger/script.js | 5 +---- contrib/tagger/theme.php | 4 ++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/contrib/tagger/main.php b/contrib/tagger/main.php index 8fa492d0..380d1d10 100644 --- a/contrib/tagger/main.php +++ b/contrib/tagger/main.php @@ -41,6 +41,22 @@ class tagger extends Extension { ORDER BY tag",array($tags_min)); $this->theme->build($page, $tags); + global $user; + if($tags->_numOfRows > 100 && $user->is_admin()) { + $page->add_block( new Block ( + "Warning - ext/tagger", + "

It is likely that Tagger will not function

+ Currently the javascript code chokes on large numbers of + tags. The tag list currently numbers + {$tags->_numOfRows}.
+ You can increase the minimum use requirement for the tag + list in the Board Config + to reduce the size of this list.
+ This is a limitation of the method in which Tagger operates. + I am working on a solution, I do not know when such a + solution will be ready.", + "main",0)); + } } if(is_a($event,"PageRequestEvent")) { diff --git a/contrib/tagger/script.js b/contrib/tagger/script.js index f75f20ce..6468b22e 100644 --- a/contrib/tagger/script.js +++ b/contrib/tagger/script.js @@ -10,8 +10,6 @@ var remove_tagme = null; var tags_field = false; var set_button = false; -// TODO: Store tagger's list here? Wouldn't need to get the elements every time, -// but memory overhead? // Put everything in a class? better? @@ -26,7 +24,7 @@ function taggerInit() { c = c ? c.replace(/px/g,"").split(" ") : new Array(null,null); taggerResetPos(c[0],c[1]); - tagger_tagIndicators() + tagger_tagIndicators(); DragHandler.attach(byId("tagger_titlebar")); remove_tagme = byId('tagme'); @@ -69,7 +67,6 @@ function taggerSavePosition() { } function tagger_tagIndicators() { - tags = byId("tags"); arObjTags = getElementsByTagNames('a',byId('tagger_body')); for (i in arObjTags) { diff --git a/contrib/tagger/theme.php b/contrib/tagger/theme.php index bee561a9..b515abf9 100644 --- a/contrib/tagger/theme.php +++ b/contrib/tagger/theme.php @@ -30,8 +30,6 @@ class taggerTheme extends Themelet { } $html = " -
Collapse this block to hide Tagger
@@ -62,6 +60,8 @@ class taggerTheme extends Themelet { class='tagger_js' >Refresh Filter
$h_tags
+ "; $page->add_block( new Block(