Move the toggle function to panel.inc since we won't necessarily have
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 31 Jan 2009 16:16:21 +0000 (11:16 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 31 Jan 2009 16:16:21 +0000 (11:16 -0500)
any tags (so we wouldn't have attached the tagactions).

Compress the tagactions.js script

kronolith/js/src/tagactions.js [new file with mode: 0755]
kronolith/js/tagactions.js [changed mode: 0755->0644]
kronolith/templates/panel.inc

diff --git a/kronolith/js/src/tagactions.js b/kronolith/js/src/tagactions.js
new file mode 100755 (executable)
index 0000000..ed66515
--- /dev/null
@@ -0,0 +1,32 @@
+function addTag(resource, type, endpoint)
+{
+    if (!$('newtags-input_' + resource).value.blank()) {
+        var params = new Object();
+        params.imple="TagActions/action=add/resource=" + resource + "/type=" + type + "/tags=" + $('newtags-input_' + resource).value;
+        new Ajax.Updater({success:'tags_' + resource},
+                         endpoint,
+                         {
+                             method: 'post',
+                             parameters: params,
+                             onComplete: function() {$('newtags-input_' + resource).value = "";}
+                         }
+        );
+    }
+
+    return true;
+}
+
+function removeTag(resource, type, tagid, endpoint)
+{
+    var params = new Object();
+    params.imple = "TagActions/action=remove/resource=" + resource + "/type=" + type + "/tags=" + tagid;
+    new Ajax.Updater({success:'tags_' + resource},
+                     endpoint,
+                     {
+                         method: 'post',
+                         parameters: params
+                     }
+    );
+    
+    return true;
+}
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index f9fc362..9c1fe52
@@ -1,39 +1 @@
-function addTag(resource, type, endpoint)
-{
-    if (!$('newtags-input_' + resource).value.blank()) {
-        var params = new Object();
-        params.imple="TagActions/action=add/resource=" + resource + "/type=" + type + "/tags=" + $('newtags-input_' + resource).value;
-        new Ajax.Updater({success:'tags_' + resource},
-                         endpoint,
-                         {
-                             method: 'post',
-                             parameters: params,
-                             onComplete: function() {$('newtags-input_' + resource).value = "";}
-                         }
-        );
-    }
-
-    return true;
-}
-
-function removeTag(resource, type, tagid, endpoint)
-{
-    var params = new Object();
-    params.imple = "TagActions/action=remove/resource=" + resource + "/type=" + type + "/tags=" + tagid;
-    new Ajax.Updater({success:'tags_' + resource},
-                     endpoint,
-                     {
-                         method: 'post',
-                         parameters: params
-                     }
-    );
-    
-    return true;
-}
-
-function toggleTags(domid)
-{
-       $('tag-show_' + domid).toggle();
-       $('tag-hide_' + domid).toggle();
-       $('tagnode_' + domid).toggle();
-}
\ No newline at end of file
+function addTag(B,A,D){if(!$("newtags-input_"+B).value.blank()){var C=new Object();C.imple="TagActions/action=add/resource="+B+"/type="+A+"/tags="+$("newtags-input_"+B).value;new Ajax.Updater({success:"tags_"+B},D,{method:"post",parameters:C,onComplete:function(){$("newtags-input_"+B).value=""}})}return true}function removeTag(C,B,A,E){var D=new Object();D.imple="TagActions/action=remove/resource="+C+"/type="+B+"/tags="+A;new Ajax.Updater({success:"tags_"+C},E,{method:"post",parameters:D});return true};
\ No newline at end of file
index 750ce80..126ca8f 100644 (file)
@@ -1,3 +1,11 @@
+<script type="text/javascript">
+    function toggleTags(domid)
+    {
+        $('tag-show_' + domid).toggle();
+        $('tag-hide_' + domid).toggle();
+        $('tagnode_' + domid).toggle();
+    }
+</script>
 <?php
 Horde::addScriptFile('QuickFinder.js', 'horde', true);
 Horde::addScriptFile('redbox.js', 'horde', true);