From 322354d7b63c7fe13dd0685ac11352eaa6bd6d48 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sat, 31 Jan 2009 11:16:21 -0500 Subject: [PATCH] Move the toggle function to panel.inc since we won't necessarily have any tags (so we wouldn't have attached the tagactions). Compress the tagactions.js script --- kronolith/js/src/tagactions.js | 32 ++++++++++++++++++++++++++++++++ kronolith/js/tagactions.js | 40 +--------------------------------------- kronolith/templates/panel.inc | 8 ++++++++ 3 files changed, 41 insertions(+), 39 deletions(-) create mode 100755 kronolith/js/src/tagactions.js mode change 100755 => 100644 kronolith/js/tagactions.js diff --git a/kronolith/js/src/tagactions.js b/kronolith/js/src/tagactions.js new file mode 100755 index 000000000..ed66515d8 --- /dev/null +++ b/kronolith/js/src/tagactions.js @@ -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 diff --git a/kronolith/js/tagactions.js b/kronolith/js/tagactions.js old mode 100755 new mode 100644 index f9fc362a3..9c1fe5217 --- a/kronolith/js/tagactions.js +++ b/kronolith/js/tagactions.js @@ -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 diff --git a/kronolith/templates/panel.inc b/kronolith/templates/panel.inc index 750ce8091..126ca8fb3 100644 --- a/kronolith/templates/panel.inc +++ b/kronolith/templates/panel.inc @@ -1,3 +1,11 @@ +