From: Michael J. Rubinsky Date: Sat, 31 Jan 2009 01:57:29 +0000 (-0500) Subject: Some initial work on putting an autocomplete text field for adding X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f56a5dc106979233105bade9d4e5a4f6e444fbdd;p=horde.git Some initial work on putting an autocomplete text field for adding tags in the calendar panel. Obviously needs work, but it's a start. (Autocomplete works, but 'add' button does nothing yet). --- diff --git a/kronolith/js/tagactions.js b/kronolith/js/tagactions.js index 2963adce5..6c5cb4c90 100755 --- a/kronolith/js/tagactions.js +++ b/kronolith/js/tagactions.js @@ -30,9 +30,9 @@ function removeTag(resource, type, tagid, endpoint) return true; } -// Since onsubmit is never called when submitting programatically we -// can use this function to add tags when we press enter on the tag form. -function submitcheck() +function toggleNewTags(domid) { - return !addTag(); + $('tag-show-' + domid).toggle(); + $('tag-hide-' + domid).toggle(); + $('newtags-' + domid).toggle(); } \ No newline at end of file diff --git a/kronolith/lib/Imple/TagActions.php b/kronolith/lib/Imple/TagActions.php index 1c7015130..ea58180d0 100644 --- a/kronolith/lib/Imple/TagActions.php +++ b/kronolith/lib/Imple/TagActions.php @@ -90,6 +90,7 @@ class Kronolith_Imple_TagActions extends Kronolith_Imple { $tags = $tagger->getTags($id, 'calendar'); $js = ''; + $html = ''; if ($type == 'calendar') { $cal = $GLOBALS['kronolith_shares']->getShare($id); @@ -102,13 +103,11 @@ class Kronolith_Imple_TagActions extends Kronolith_Imple $hasEdit = $event->hasPermission(PERMS_EDIT, Auth::getAuth()); } - $html = count($tags) ? '
' . _("Tags") . '
': ''; - $html .= '
 
'; + return $html; } } diff --git a/kronolith/lib/Tagger.php b/kronolith/lib/Tagger.php index 969a0c79e..7c254cb11 100644 --- a/kronolith/lib/Tagger.php +++ b/kronolith/lib/Tagger.php @@ -190,4 +190,9 @@ class Kronolith_Tagger //TODO } + public function listTags($token) + { + return self::$_tagger->getTags(array('q' => $token)); + } + } diff --git a/kronolith/templates/panel.inc b/kronolith/templates/panel.inc index 7a0e1cd53..f5ff4c579 100644 --- a/kronolith/templates/panel.inc +++ b/kronolith/templates/panel.inc @@ -44,22 +44,31 @@ $tagger = new Kronolith_Tagger();