Index: plugins/tags/js/page.js
===================================================================
--- plugins/tags/js/page.js	(revision 1239)
+++ plugins/tags/js/page.js	(revision 1240)
@@ -1,7 +1,70 @@
-
-$(function(){$('#edit-entry').onetabload(function(){var tags_edit=$('#tags-edit');var post_id=$('#id');var meta_field=null;if(tags_edit.length>0){post_id=(post_id.length>0)?post_id.get(0).value:false;if(post_id==false){meta_field=$('<input type="hidden" name="post_tags" />');meta_field.val($('#post_tags').val());}
-var mEdit=new metaEditor(tags_edit,meta_field,'tag');mEdit.meta_url='plugin.php?p=tags&m=tag_posts&amp;tag=';mEdit.displayMeta('tag',post_id);window.dc_tag_editor=mEdit;}});});jsToolBar.prototype.elements.tagSpace={type:'space'};jsToolBar.prototype.elements.tag={type:'button',title:'Keyword',fn:{}};jsToolBar.prototype.elements.tag.context='post';jsToolBar.prototype.elements.tag.icon='index.php?pf=tags/img/tag-add.png';jsToolBar.prototype.elements.tag.fn.wiki=function(){this.encloseSelection('','',function(str){if(str==''){window.alert(dotclear.msg.no_selection);return'';}
-if(str.indexOf(',')!=-1){return str;}else{return'['+str+'|tag:'+str+']';}});};jsToolBar.prototype.elements.tag.fn.xhtml=function(){var url=this.elements.tag.url;this.encloseSelection('','',function(str){if(str==''){window.alert(dotclear.msg.no_selection);return'';}
-if(str.indexOf(',')!=-1){return str;}else{return'<a href="'+this.stripBaseURL(url+'/'+str)+'">'+str+'</a>';}});};jsToolBar.prototype.elements.tag.fn.wysiwyg=function(){var t=this.getSelectedText();if(t==''){window.alert(dotclear.msg.no_selection);return;}
-if(t.indexOf(',')!=-1){return;}
-var n=this.getSelectedNode();var a=document.createElement('a');a.href=this.stripBaseURL(this.elements.tag.url+'/'+t);a.appendChild(n);this.insertNode(a);};
+$(function () {
+    $('#edit-entry').onetabload(function () {
+        var tags_edit = $('#tags-edit');
+        var post_id = $('#id');
+        var meta_field = null;
+        if (tags_edit.length > 0) {
+            post_id = (post_id.length > 0) ? post_id.get(0).value : false;
+            if (post_id == false) {
+                meta_field = $('<input type="hidden" name="post_tags" />');
+                meta_field.val($('#post_tags').val());
+            }
+            var mEdit = new metaEditor(tags_edit, meta_field, 'tag');
+            mEdit.meta_url = 'plugin.php?p=tags&m=tag_posts&amp;tag=';
+            mEdit.displayMeta('tag', post_id);
+            window.dc_tag_editor = mEdit;
+        }
+    });
+});
+jsToolBar.prototype.elements.tagSpace = {
+    type: 'space'
+};
+jsToolBar.prototype.elements.tag = {
+    type: 'button',
+    title: 'Keyword',
+    fn: {}
+};
+jsToolBar.prototype.elements.tag.context = 'post';
+jsToolBar.prototype.elements.tag.icon = 'index.php?pf=tags/img/tag-add.png';
+jsToolBar.prototype.elements.tag.fn.wiki = function () {
+    this.encloseSelection('', '', function (str) {
+        if (str == '') {
+            window.alert(dotclear.msg.no_selection);
+            return '';
+        }
+        if (str.indexOf(',') != -1) {
+            return str;
+        } else {
+            return '[' + str + '|tag:' + str + ']';
+        }
+    });
+};
+jsToolBar.prototype.elements.tag.fn.xhtml = function () {
+    var url = this.elements.tag.url;
+    this.encloseSelection('', '', function (str) {
+        if (str == '') {
+            window.alert(dotclear.msg.no_selection);
+            return '';
+        }
+        if (str.indexOf(',') != -1) {
+            return str;
+        } else {
+            return '<a href="' + this.stripBaseURL(url + '/' + str) + '">' + str + '</a>';
+        }
+    });
+};
+jsToolBar.prototype.elements.tag.fn.wysiwyg = function () {
+    var t = this.getSelectedText();
+    if (t == '') {
+        window.alert(dotclear.msg.no_selection);
+        return;
+    }
+    if (t.indexOf(',') != -1) {
+        return;
+    }
+    var n = this.getSelectedNode();
+    var a = document.createElement('a');
+    a.href = this.stripBaseURL(this.elements.tag.url + '/' + t);
+    a.appendChild(n);
+    this.insertNode(a);
+};
