Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Abbreviation/abbreviation.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Abbreviation/Attic/abbreviation.js,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Abbreviation/abbreviation.js 13 May 2008 18:53:46 -0000 1.4 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Abbreviation/abbreviation.js 16 Jan 2009 09:05:47 -0000 1.5 @@ -1,65 +1,2 @@ -/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ -/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ -/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/Abbreviation/abbreviation.js */ -function Abbreviation(_1){ -this.editor=_1; -var _2=_1.config; -var _3=this; -_2.registerButton({id:"abbreviation",tooltip:this._lc("Abbreviation"),image:_1.imgURL("ed_abbreviation.gif","Abbreviation"),textMode:false,action:function(_4){ -_3.buttonPress(_4); -}}); -_2.addToolbarElement("abbreviation","inserthorizontalrule",1); -} -Abbreviation._pluginInfo={name:"Abbreviation",version:"1.0",developer:"Udo Schmal",developer_url:"",sponsor:"L.N.Schaffrath NeueMedien",sponsor_url:"http://www.schaffrath-neuemedien.de/",c_owner:"Udo Schmal & Schaffrath-NeueMedien",license:"htmlArea"}; -Abbreviation.prototype._lc=function(_5){ -return Xinha._lc(_5,"Abbreviation"); -}; -Abbreviation.prototype.onGenerate=function(){ -this.editor.addEditorStylesheet(Xinha.getPluginDir("Abbreviation")+"/abbreviation.css"); -}; -Abbreviation.prototype.buttonPress=function(_6,_7,_8){ -var _9=null; -var _a=_6.getSelectedHTML(); -var _b=_6._getSelection(); -var _c=_6._createRange(_b); -var _d=_6._activeElement(_b); -if(!(_d!=null&&_d.tagName.toLowerCase()=="abbr")){ -_d=_6._getFirstAncestor(_b,"abbr"); -} -if(_d!=null&&_d.tagName.toLowerCase()=="abbr"){ -_9={title:_d.title,text:_d.innerHTML}; -}else{ -_9={title:"",text:_a}; -} -_6._popupDialog("plugin://Abbreviation/abbreviation",function(_e){ -if(_e){ -var _f=_e["title"]; -if(_f==""||_f==null){ -if(_d){ -var _10=_d.innerHTML; -_d.parentNode.removeChild(_d); -_6.insertHTML(_10); -} -return; -} -try{ -var doc=_6._doc; -if(!_d){ -_d=doc.createElement("abbr"); -_d.title=_f; -_d.innerHTML=_a; -if(Xinha.is_ie){ -_c.pasteHTML(_d.outerHTML); -}else{ -_6.insertNodeAtSelection(_d); -} -}else{ -_d.title=_f; -} -} -catch(e){ -} -} -},_9); -}; - +/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ +function Abbreviation(c){this.editor=c;var a=c.config;var b=this;a.registerButton({id:"abbreviation",tooltip:Xinha._lc("Abbreviation","Abbreviation"),image:c.imgURL("ed_abbreviation.gif","Abbreviation"),textMode:false,action:function(d){b.show()}});a.addToolbarElement("abbreviation","inserthorizontalrule",1)}Abbreviation._pluginInfo={name:"Abbreviation",version:"1.0",developer:"Udo Schmal",developer_url:"",sponsor:"L.N.Schaffrath NeueMedien",sponsor_url:"http://www.schaffrath-neuemedien.de/",c_owner:"Udo Schmal & Schaffrath-NeueMedien",license:"htmlArea"};Abbreviation.prototype.fillText=function(){var editor=this.editor;var text=this.html.toUpperCase();var abbr=Xinha.getPluginDir(this.constructor.name)+"/abbr/"+_editor_lang+".js";var abbrData=Xinha._geturlcontent(abbr);if(abbrData){eval("abbrObj = "+abbrData);if(abbrObj!=""){var dest=this.dialog.getElementById("title");dest.value=this.title||"";for(var i in abbrObj){same=(i.toUpperCase()==text);if(same){dest.value=abbrObj[i]}}}}};Abbreviation.prototype.onGenerateOnce=function(b){this.editor.addEditorStylesheet(Xinha.getPluginDir("Abbreviation")+"/abbreviation.css");this.methodsReady=true;var a=Abbreviation;Xinha._getback(Xinha.getPluginDir("Abbreviation")+"/dialog.html",function(c){a.html=c;a.dialogReady=true})};Abbreviation.prototype.OnUpdateToolbar=function(a){if(!(Abbreviation.dialogReady&&Abbreviation.methodsReady)){this.editor._toolbarObjects.Abbreviation.state("enabled",false)}else{this.onUpdateToolbar=null}};Abbreviation.prototype.prepareDialog=function(c){var a=this;var d=this.editor;var b=this.dialog=new Xinha.Dialog(d,Abbreviation.html,"Xinha",{width:260,height:140});b.getElementById("ok").onclick=function(){a.apply()};b.getElementById("delete").onclick=function(){a.ondelete()};b.getElementById("cancel").onclick=function(){a.dialog.hide()};this.dialogReady=true};Abbreviation.prototype.show=function(d){var d=this.editor;this.html=d.getSelectedHTML();if(!this.dialog){this.prepareDialog()}var b=this;var f=d._doc;var e=d._getSelection();var a=d._createRange(e);var c=d._activeElement(e);if(!(c!=null&&c.tagName.toLowerCase()=="abbr")){c=d._getFirstAncestor(e,"abbr")}this.abbr=c;if(c){this.title=c.title}this.fillText();this.dialog.getElementById("inputs").onsubmit=function(){b.apply();return false};this.dialog.show();this.dialog.getElementById("title").select()};Abbreviation.prototype.apply=function(){var c=this.editor;var f=c._doc;var a=this.abbr;var b=this.html;var h=this.dialog.hide();if(h){var g=h.title;if(g==""||g==null){if(a){var i=a.innerHTML;a.parentNode.removeChild(a);c.insertHTML(i)}return}try{if(!a){a=f.createElement("abbr");a.title=g;a.innerHTML=b;if(Xinha.is_ie){range.pasteHTML(a.outerHTML)}else{c.insertNodeAtSelection(a)}}else{a.title=g}}catch(d){}}};Abbreviation.prototype.ondelete=function(){this.dialog.getElementById("title").value="";this.apply()}; \ No newline at end of file