Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/SetId/set-id.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/SetId/set-id.js,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/SetId/set-id.js 2 Feb 2007 21:05:04 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/SetId/set-id.js 24 Nov 2007 15:35:46 -0000 1.2 @@ -5,13 +5,13 @@ // register the toolbar buttons provided by this plugin cfg.registerButton({ - id : "setid", - tooltip : this._lc("Set Id and Name"), - image : editor.imgURL("set-id.gif", "SetId"), - textMode : false, - action : function(editor) { - self.buttonPress(editor); - } + id : "setid", + tooltip : this._lc("Set Id and Name"), + image : editor.imgURL("set-id.gif", "SetId"), + textMode : false, + action : function(editor) { + self.buttonPress(editor); + } }); cfg.addToolbarElement("setid", "createlink", 1); } @@ -28,20 +28,12 @@ }; SetId.prototype._lc = function(string) { - return HTMLArea._lc(string, 'SetId'); + return Xinha._lc(string, 'SetId'); }; SetId.prototype.onGenerate = function() { - var style_id = "ID-style"; - var style = this.editor._doc.getElementById(style_id); - if (style == null) { - style = this.editor._doc.createElement("link"); - style.id = style_id; - style.rel = 'stylesheet'; - style.href = _editor_url + 'plugins/SetId/set-id.css'; - this.editor._doc.getElementsByTagName("HEAD")[0].appendChild(style); - } + this.editor.addEditorStylesheet(_editor_url + 'plugins/SetId/set-id.css'); }; SetId.prototype.buttonPress = function(editor) { @@ -78,7 +70,7 @@ node.title = name; node.className = "hasid"; node.innerHTML = html; - if (HTMLArea.is_ie) { + if (Xinha.is_ie) { range.pasteHTML(node.outerHTML); } else { editor.insertNodeAtSelection(node);