Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/Xinha.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/Xinha.css,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/Xinha.css 14 Jun 2007 01:36:53 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/Xinha.css 13 May 2008 18:53:44 -0000 1.4 @@ -1,6 +1,10 @@ .htmlarea { background: #fff; } .htmlarea td { margin:0;padding:0; } +.htmlarea .toolbarRow { + width:1px; +} + .htmlarea .toolbar { cursor: default; background: ButtonFace; @@ -70,10 +74,10 @@ .htmlarea .toolbar select, .htmlarea .toolbar select:hover, .htmlarea .toolbar select:active { - margin-top: 2px; - margin-bottom: 1px; + position:relative; + top:-2px; + margin-bottom:-2px; color: ButtonText; - height: 17px; } .htmlarea iframe.xinha_iframe, .htmlarea textarea.xinha_textarea @@ -245,19 +249,25 @@ .loading { - background-color:#666; + font-family:sans-serif; position:absolute; z-index:998; + text-align:center; + width:212px; + padding: 55px 0 5px 0; + border:2px solid #ccc; + /* border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;*/ + background: url(images/xinha_logo.gif) no-repeat #fff center 5px; } .loading_main { - font-size:1.6em; - color:#ff6; - text-align:center; + font-size:11px; + color:#000; + } .loading_sub { - font-size:1.0em; - color:#fff; + font-size:9px; + color:#666; text-align:center; } Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/XinhaCore.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/XinhaCore.js,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/XinhaCore.js 24 Nov 2007 15:35:28 -0000 1.4 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/XinhaCore.js 13 May 2008 18:53:44 -0000 1.5 @@ -1,21 +1,23 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ +/* 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/XinhaCore.js */ /*-------------------------------------------------------------------------- -- Xinha (is not htmlArea) - http://xinha.org -- -- Use of Xinha is granted by the terms of the htmlArea License (based on -- BSD license) please read license.txt in this package for details. -- - -- Copyright (c) 2005-2007 Xinha Developer Team and contributors + -- Copyright (c) 2005-2008 Xinha Developer Team and contributors -- -- Xinha was originally based on work by Mihai Bazon which is: -- Copyright (c) 2003-2004 dynarch.com. -- Copyright (c) 2002-2003 interactivetools.com, inc. -- This copyright notice MUST stay intact for use. -------------------------------------------------------------------------*/ -Xinha.version={"Release":"0.94","Head":"$HeadURL: http://svn.xinha.webfactional.com/trunk/XinhaCore.js $".replace(/^[^:]*: (.*) \$$/,"$1"),"Date":"18 Oct 2007","Revision":"$LastChangedRevision: 905 $".replace(/^[^:]*: (.*) \$$/,"$1"),"RevisionBy":"$LastChangedBy: ray $".replace(/^[^:]*: (.*) \$$/,"$1")}; +Xinha.version={"Release":"0.95","Head":"$HeadURL:http://svn.xinha.webfactional.com/trunk/XinhaCore.js $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),"Date":"$LastChangedDate:2008-05-01 14:33:36 +0200 (Do, 01 Mai 2008) $".replace(/^[^:]*:\s*([0-9-]*) ([0-9:]*) ([+0-9]*) \((.*)\)\s*\$/,"$4 $2 $3"),"Revision":"$LastChangedRevision:999 $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),"RevisionBy":"$LastChangedBy:ray $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1")}; Xinha._resolveRelativeUrl=function(_1,_2){ -if(_2.match(/^([^:]+\:)?\//)){ +if(_2.match(/^([^:]+\:)?\/\//)){ return _2; }else{ var b=_1.split("/"); @@ -57,29 +59,26 @@ Xinha.is_ie=((Xinha.agt.indexOf("msie")!=-1)&&(Xinha.agt.indexOf("opera")==-1)); Xinha.ie_version=parseFloat(Xinha.agt.substring(Xinha.agt.indexOf("msie")+5)); Xinha.is_opera=(Xinha.agt.indexOf("opera")!=-1); -Xinha.opera_version=navigator.appVersion.substring(0,navigator.appVersion.indexOf(" "))*1; +if(Xinha.is_opera&&Xinha.agt.match(/opera[\/ ]([0-9.]+)/)){ +Xinha.opera_version=parseFloat(RegExp.$1); +}else{ +Xinha.opera_version=0; +} Xinha.is_khtml=(Xinha.agt.indexOf("khtml")!=-1); +Xinha.is_webkit=(Xinha.agt.indexOf("applewebkit")!=-1); +Xinha.webkit_version=parseInt(navigator.appVersion.replace(/.*?AppleWebKit\/([\d]).*?/,"$1")); Xinha.is_safari=(Xinha.agt.indexOf("safari")!=-1); Xinha.is_mac=(Xinha.agt.indexOf("mac")!=-1); Xinha.is_mac_ie=(Xinha.is_ie&&Xinha.is_mac); Xinha.is_win_ie=(Xinha.is_ie&&!Xinha.is_mac); -Xinha.is_gecko=(navigator.product=="Gecko"&&!Xinha.is_safari); +Xinha.is_gecko=(navigator.product=="Gecko")||Xinha.is_opera; +Xinha.is_real_gecko=(navigator.product=="Gecko"&&!Xinha.is_webkit); +Xinha.is_ff3=Xinha.is_real_gecko&&parseInt(navigator.productSub)>=2007121016; +Xinha.is_ff2=Xinha.is_real_gecko&&parseInt(navigator.productSub)<2007121016; Xinha.isRunLocally=document.URL.toLowerCase().search(/^file:/)!=-1; Xinha.is_designMode=(typeof document.designMode!="undefined"&&!Xinha.is_ie); Xinha.checkSupportedBrowser=function(){ -if(Xinha.is_gecko){ -if(navigator.productSub<20021201){ -alert("You need at least Mozilla-1.3 Alpha.\nSorry, your Gecko is not supported."); -return false; -} -if(navigator.productSub<20030210){ -alert("Mozilla < 1.3 Beta is not supported!\nI'll try, though, but it might not work."); -} -} -if(Xinha.is_opera){ -alert("Sorry, Opera is not yet supported by Xinha."); -} -return Xinha.is_gecko||(Xinha.is_opera&&Xinha.opera_version>=9.1)||Xinha.ie_version>=5.5; +return Xinha.is_real_gecko||(Xinha.is_opera&&Xinha.opera_version>=9.2)||Xinha.ie_version>=5.5||Xinha.webkit_version>=522; }; Xinha.isSupportedBrowser=Xinha.checkSupportedBrowser(); if(Xinha.isRunLocally&&Xinha.isSupportedBrowser){ @@ -90,7 +89,7 @@ return; } if(!_5){ -throw ("Tried to create Xinha without textarea specified."); +throw new Error("Tried to create Xinha without textarea specified."); } if(typeof _6=="undefined"){ this.config=new Xinha.Config(); @@ -160,7 +159,6 @@ Xinha.RE_email=/^[_a-z\d\-\.]{3,}@[_a-z\d\-]{2,}(\.[_a-z\d\-]{2,})+$/i; Xinha.RE_url=/(https?:\/\/)?(([a-z0-9_]+:[a-z0-9_]+@)?[a-z0-9_-]{2,}(\.[a-z0-9_-]{2,}){2,}(:[0-9]+)?(\/\S+)*)/i; Xinha.Config=function(){ -var _a=this; this.version=Xinha.version.Revision; this.width="auto"; this.height="auto"; @@ -185,6 +183,12 @@ this.only7BitPrintablesInURLs=true; this.sevenBitClean=false; this.specialReplacements={}; +this.inwardHtml=function(_a){ +return _a; +}; +this.outwardHtml=function(_b){ +return _b; +}; this.killWordOnPaste=true; this.makeLinkShowsTarget=true; this.charSet=(typeof document.characterSet!="undefined")?document.characterSet:document.charset; @@ -314,73 +318,73 @@ btn[0]=Xinha._lc(btn[0]); } }; -Xinha.Config.prototype.registerButton=function(id,_3b,_3c,_3d,_3e,_3f){ -var _40; +Xinha.Config.prototype.registerButton=function(id,_3c,_3d,_3e,_3f,_40){ +var _41; if(typeof id=="string"){ -_40=id; +_41=id; }else{ if(typeof id=="object"){ -_40=id.id; +_41=id.id; }else{ alert("ERROR [Xinha.Config::registerButton]:\ninvalid arguments"); return false; } } switch(typeof id){ case "string": -this.btnList[id]=[_3b,_3c,_3d,_3e,_3f]; +this.btnList[id]=[_3c,_3d,_3e,_3f,_40]; break; case "object": this.btnList[id.id]=[id.tooltip,id.image,id.textMode,id.action,id.context]; break; } }; -Xinha.prototype.registerPanel=function(_41,_42){ -if(!_41){ -_41="right"; +Xinha.prototype.registerPanel=function(_42,_43){ +if(!_42){ +_42="right"; } -this.setLoadingMessage("Register "+_41+" panel "); -var _43=this.addPanel(_41); -if(_42){ -_42.drawPanelIn(_43); +this.setLoadingMessage("Register "+_42+" panel "); +var _44=this.addPanel(_42); +if(_43){ +_43.drawPanelIn(_44); } }; -Xinha.Config.prototype.registerDropdown=function(_44){ -this.customSelects[_44.id]=_44; +Xinha.Config.prototype.registerDropdown=function(_45){ +this.customSelects[_45.id]=_45; }; -Xinha.Config.prototype.hideSomeButtons=function(_45){ -var _46=this.toolbar; -for(var i=_46.length;--i>=0;){ -var _48=_46[i]; -for(var j=_48.length;--j>=0;){ -if(_45.indexOf(" "+_48[j]+" ")>=0){ +Xinha.Config.prototype.hideSomeButtons=function(_46){ +var _47=this.toolbar; +for(var i=_47.length;--i>=0;){ +var _49=_47[i]; +for(var j=_49.length;--j>=0;){ +if(_46.indexOf(" "+_49[j]+" ")>=0){ var len=1; -if(/separator|space/.test(_48[j+1])){ +if(/separator|space/.test(_49[j+1])){ len=2; } -_48.splice(j,len); +_49.splice(j,len); } } } }; -Xinha.Config.prototype.addToolbarElement=function(id,_4c,_4d){ -var _4e=this.toolbar; +Xinha.Config.prototype.addToolbarElement=function(id,_4d,_4e){ +var _4f=this.toolbar; var a,i,j,o,sid; -var _50=false; var _51=false; -var _52=0; +var _52=false; var _53=0; var _54=0; -var _55=false; +var _55=0; var _56=false; +var _57=false; if((id&&typeof id=="object")&&(id.constructor==Array)){ -_50=true; -} -if((_4c&&typeof _4c=="object")&&(_4c.constructor==Array)){ _51=true; -_52=_4c.length; } -if(_50){ +if((_4d&&typeof _4d=="object")&&(_4d.constructor==Array)){ +_52=true; +_53=_4d.length; +} +if(_51){ for(i=0;i=0;){ a.splice(j,0,id[i]); @@ -440,14 +444,14 @@ a[j]=id; } }else{ -if(_4d<0){ -j=j+_4d+1; +if(_4e<0){ +j=j+_4e+1; }else{ -if(_4d>0){ -j=j+_4d; +if(_4e>0){ +j=j+_4e; } } -if(_50){ +if(_51){ for(i=id.length;--i>=0;){ a.splice(j,0,id[i]); } @@ -456,44 +460,45 @@ } } }else{ -_4e[0].splice(0,0,"separator"); -if(_50){ +_4f[0].splice(0,0,"separator"); +if(_51){ for(i=id.length;--i>=0;){ -_4e[0].splice(0,0,id[i]); +_4f[0].splice(0,0,id[i]); } }else{ -_4e[0].splice(0,0,id); +_4f[0].splice(0,0,id); } } }; Xinha.Config.prototype.removeToolbarElement=Xinha.Config.prototype.hideSomeButtons; -Xinha.replaceAll=function(_57){ +Xinha.replaceAll=function(_58){ var tas=document.getElementsByTagName("textarea"); -for(var i=tas.length;i>0;(new Xinha(tas[--i],_57)).generate()){ +for(var i=tas.length;i>0;(new Xinha(tas[--i],_58)).generate()){ } }; -Xinha.replace=function(id,_5b){ +Xinha.replace=function(id,_5c){ var ta=Xinha.getElementById("textarea",id); -return ta?(new Xinha(ta,_5b)).generate():null; +return ta?(new Xinha(ta,_5c)).generate():null; }; Xinha.prototype._createToolbar=function(){ this.setLoadingMessage(Xinha._lc("Create Toolbar")); -var _5d=this; -var _5e=document.createElement("div"); -this._toolBar=this._toolbar=_5e; -_5e.className="toolbar"; -_5e.unselectable="1"; +var _5e=this; +var _5f=document.createElement("div"); +this._toolBar=this._toolbar=_5f; +_5f.className="toolbar"; +_5f.unselectable="1"; +_5f.align=this.config.toolbarAlign; Xinha.freeLater(this,"_toolBar"); Xinha.freeLater(this,"_toolbar"); -var _5f=null; -var _60={}; -this._toolbarObjects=_60; -this._createToolbar1(_5d,_5e,_60); -this._htmlArea.appendChild(_5e); -return _5e; +var _60=null; +var _61={}; +this._toolbarObjects=_61; +this._createToolbar1(_5e,_5f,_61); +this._htmlArea.appendChild(_5f); +return _5f; }; -Xinha.prototype._setConfig=function(_61){ -this.config=_61; +Xinha.prototype._setConfig=function(_62){ +this.config=_62; }; Xinha.prototype._addToolbar=function(){ this._createToolbar1(this,this._toolbar,this._toolbarObjects); @@ -507,41 +512,41 @@ brk.style.clear="both"; return brk; }; -Xinha.prototype._createToolbar1=function(_63,_64,_65){ -var _66; -if(_63.config.flowToolbars){ -_64.appendChild(Xinha._createToolbarBreakingElement()); +Xinha.prototype._createToolbar1=function(_64,_65,_66){ +var _67; +if(_64.config.flowToolbars){ +_65.appendChild(Xinha._createToolbarBreakingElement()); } function newLine(){ -if(typeof _66!="undefined"&&_66.childNodes.length===0){ +if(typeof _67!="undefined"&&_67.childNodes.length===0){ return; } -var _67=document.createElement("table"); -_67.border="0px"; -_67.cellSpacing="0px"; -_67.cellPadding="0px"; -if(_63.config.flowToolbars){ +var _68=document.createElement("table"); +_68.border="0px"; +_68.cellSpacing="0px"; +_68.cellPadding="0px"; +if(_64.config.flowToolbars){ if(Xinha.is_ie){ -_67.style.styleFloat="left"; +_68.style.styleFloat="left"; }else{ -_67.style.cssFloat="left"; +_68.style.cssFloat="left"; } } -_64.appendChild(_67); -var _68=document.createElement("tbody"); -_67.appendChild(_68); -_66=document.createElement("tr"); -_68.appendChild(_66); -_67.className="toolbarRow"; +_65.appendChild(_68); +var _69=document.createElement("tbody"); +_68.appendChild(_69); +_67=document.createElement("tr"); +_69.appendChild(_67); +_68.className="toolbarRow"; } newLine(); -function setButtonStatus(id,_6a){ -var _6b=this[id]; +function setButtonStatus(id,_6b){ +var _6c=this[id]; var el=this.element; -if(_6b!=_6a){ +if(_6c!=_6b){ switch(id){ case "enabled": -if(_6a){ +if(_6b){ Xinha._removeClass(el,"buttonDisabled"); el.disabled=false; }else{ @@ -550,61 +555,61 @@ } break; case "active": -if(_6a){ +if(_6b){ Xinha._addClass(el,"buttonPressed"); }else{ Xinha._removeClass(el,"buttonPressed"); } break; } -this[id]=_6a; +this[id]=_6b; } } function createSelect(txt){ -var _6e=null; +var _6f=null; var el=null; var cmd=null; -var _71=_63.config.customSelects; -var _72=null; -var _73=""; +var _72=_64.config.customSelects; +var _73=null; +var _74=""; switch(txt){ case "fontsize": case "fontname": case "formatblock": -_6e=_63.config[txt]; +_6f=_64.config[txt]; cmd=txt; break; default: cmd=txt; -var _74=_71[cmd]; -if(typeof _74!="undefined"){ -_6e=_74.options; -_72=_74.context; -if(typeof _74.tooltip!="undefined"){ -_73=_74.tooltip; +var _75=_72[cmd]; +if(typeof _75!="undefined"){ +_6f=_75.options; +_73=_75.context; +if(typeof _75.tooltip!="undefined"){ +_74=_75.tooltip; } }else{ alert("ERROR [createSelect]:\nCan't find the requested dropdown definition"); } break; } -if(_6e){ +if(_6f){ el=document.createElement("select"); -el.title=_73; -var obj={name:txt,element:el,enabled:true,text:false,cmd:cmd,state:setButtonStatus,context:_72}; +el.title=_74; +var obj={name:txt,element:el,enabled:true,text:false,cmd:cmd,state:setButtonStatus,context:_73}; Xinha.freeLater(obj); -_65[txt]=obj; -for(var i in _6e){ -if(typeof (_6e[i])!="string"){ +_66[txt]=obj; +for(var i in _6f){ +if(typeof (_6f[i])!="string"){ continue; } var op=document.createElement("option"); op.innerHTML=Xinha._lc(i); -op.value=_6e[i]; +op.value=_6f[i]; el.appendChild(op); } Xinha._addEvent(el,"change",function(){ -_63._comboSelected(el,txt); +_64._comboSelected(el,txt); }); } return el; @@ -613,7 +618,7 @@ var el,btn,obj=null; switch(txt){ case "separator": -if(_63.config.flowToolbars){ +if(_64.config.flowToolbars){ newLine(); } el=document.createElement("div"); @@ -633,10 +638,10 @@ el.title=Xinha._lc("Current style"); obj={name:txt,element:el,enabled:true,active:false,text:false,cmd:"textindicator",state:setButtonStatus}; Xinha.freeLater(obj); -_65[txt]=obj; +_66[txt]=obj; break; default: -btn=_63.config.btnList[txt]; +btn=_64.config.btnList[txt]; } if(!el&&btn){ el=document.createElement("a"); @@ -649,7 +654,7 @@ obj={name:txt,element:el,enabled:true,active:false,text:btn[2],cmd:btn[3],state:setButtonStatus,context:btn[4]||null}; Xinha.freeLater(el); Xinha.freeLater(obj); -_65[txt]=obj; +_66[txt]=obj; el.ondrag=function(){ return false; }; @@ -670,30 +675,30 @@ }); Xinha._addEvent(el,"click",function(ev){ ev=Xinha.is_ie?window.event:ev; -_63.btnClickEvent=ev; +_64.btnClickEvent=ev; if(obj.enabled){ Xinha._removeClass(el,"buttonActive"); if(Xinha.is_gecko){ -_63.activateEditor(); +_64.activateEditor(); } -obj.cmd(_63,obj.name,obj); +obj.cmd(_64,obj.name,obj); Xinha._stopEvent(ev); } }); -var _7d=Xinha.makeBtnImg(btn[1]); -var img=_7d.firstChild; -Xinha.freeLater(_7d); +var _7e=Xinha.makeBtnImg(btn[1]); +var img=_7e.firstChild; +Xinha.freeLater(_7e); Xinha.freeLater(img); -el.appendChild(_7d); +el.appendChild(_7e); obj.imgel=img; -obj.swapImage=function(_7f){ -if(typeof _7f!="string"){ -img.src=_7f[0]; +obj.swapImage=function(_80){ +if(typeof _80!="string"){ +img.src=_80[0]; img.style.position="relative"; -img.style.top=_7f[2]?("-"+(18*(_7f[2]+1))+"px"):"-18px"; -img.style.left=_7f[1]?("-"+(18*(_7f[1]+1))+"px"):"-18px"; +img.style.top=_80[2]?("-"+(18*(_80[2]+1))+"px"):"-18px"; +img.style.left=_80[1]?("-"+(18*(_80[1]+1))+"px"):"-18px"; }else{ -obj.imgel.src=_7f; +obj.imgel.src=_80; img.style.top="0px"; img.style.left="0px"; } @@ -705,106 +710,106 @@ } return el; } -var _80=true; +var _81=true; for(var i=0;i=0;){ -for(var j=_94[i].length;--j>=0;){ -switch(_94[i][j]){ +var _95=_91.config.toolbar; +for(i=_95.length;--i>=0;){ +for(var j=_95[i].length;--j>=0;){ +switch(_95[i][j]){ case "popupeditor": -_90.registerPlugin("FullScreen"); +_91.registerPlugin("FullScreen"); break; case "insertimage": url=_editor_url+"modules/InsertImage/insert_image.js"; -if(typeof Xinha.prototype._insertImage=="undefined"&&!Xinha.loadPlugins(["InsertImage"],function(){ -_90.generate(); -},url)){ +if(typeof Xinha.prototype._insertImage=="undefined"&&!Xinha.loadPlugins([{plugin:"InsertImage",url:url}],function(){ +_91.generate(); +})){ return false; }else{ if(typeof InsertImage!="undefined"){ -_90.registerPlugin("InsertImage"); +_91.registerPlugin("InsertImage"); } } break; case "createlink": url=_editor_url+"modules/CreateLink/link.js"; -if(typeof Linker=="undefined"&&!Xinha.loadPlugins(["CreateLink"],function(){ -_90.generate(); -},url)){ +if(typeof Linker=="undefined"&&!Xinha.loadPlugins([{plugin:"CreateLink",url:url}],function(){ +_91.generate(); +})){ return false; }else{ if(typeof CreateLink!="undefined"){ -_90.registerPlugin("CreateLink"); +_91.registerPlugin("CreateLink"); } } break; case "inserttable": url=_editor_url+"modules/InsertTable/insert_table.js"; -if(!Xinha.loadPlugins(["InsertTable"],function(){ -_90.generate(); -},url)){ +if(!Xinha.loadPlugins([{plugin:"InsertTable",url:url}],function(){ +_91.generate(); +})){ return false; }else{ if(typeof InsertTable!="undefined"){ -_90.registerPlugin("InsertTable"); +_91.registerPlugin("InsertTable"); } } break; } } } -if(Xinha.is_gecko&&(_90.config.mozParaHandler=="best"||_90.config.mozParaHandler=="dirty")){ -switch(this.config.mozParaHandler){ -case "dirty": -var _96=_editor_url+"modules/Gecko/paraHandlerDirty.js"; -break; -default: -var _96=_editor_url+"modules/Gecko/paraHandlerBest.js"; -break; -} -if(!Xinha.loadPlugins(["EnterParagraphs"],function(){ -_90.generate(); -},_96)){ +if(Xinha.is_gecko&&_91.config.mozParaHandler!="built-in"){ +if(!Xinha.loadPlugins([{plugin:"EnterParagraphs",url:_editor_url+"modules/Gecko/paraHandlerBest.js"}],function(){ +_91.generate(); +})){ return false; } -_90.registerPlugin("EnterParagraphs"); +_91.registerPlugin("EnterParagraphs"); } +if(Xinha.ie_version==8){ +this.config.getHtmlMethod="TransformInnerHTML"; +} switch(this.config.getHtmlMethod){ case "TransformInnerHTML": var _97=_editor_url+"modules/GetHtml/TransformInnerHTML.js"; @@ -963,12 +985,12 @@ var _97=_editor_url+"modules/GetHtml/DOMwalk.js"; break; } -if(!Xinha.loadPlugins(["GetHtmlImplementation"],function(){ -_90.generate(); -},_97)){ +if(!Xinha.loadPlugins([{plugin:"GetHtmlImplementation",url:_97}],function(){ +_91.generate(); +})){ return false; }else{ -_90.registerPlugin("GetHtmlImplementation"); +_91.registerPlugin("GetHtmlImplementation"); } this.setLoadingMessage(Xinha._lc("Generate Xinha framework")); this._framework={"table":document.createElement("table"),"tbody":document.createElement("tbody"),"tb_row":document.createElement("tr"),"tb_cell":document.createElement("td"),"tp_row":document.createElement("tr"),"tp_cell":this._panels.top.container,"ler_row":document.createElement("tr"),"lp_cell":this._panels.left.container,"ed_cell":document.createElement("td"),"rp_cell":this._panels.right.container,"bp_row":document.createElement("tr"),"bp_cell":this._panels.bottom.container,"sb_row":document.createElement("tr"),"sb_cell":document.createElement("td")}; @@ -1006,7 +1028,7 @@ _99.className="htmlarea"; this._framework.tb_cell.appendChild(this._createToolbar()); var _9a=document.createElement("iframe"); -_9a.src=this.popupURL(_90.config.URIs.blank); +_9a.src=this.popupURL(_91.config.URIs.blank); _9a.id="XinhaIFrame_"+this._textArea.id; this._framework.ed_cell.appendChild(_9a); this._iframe=_9a; @@ -1021,20 +1043,20 @@ this._framework.ed_cell.appendChild(_9c); Xinha.addDom0Event(this._textArea,"click",function(){ if(Xinha._currentlyActiveEditor!=this){ -_90.updateToolbar(); +_91.updateToolbar(); } return true; }); if(_9c.form){ Xinha.prependDom0Event(this._textArea.form,"submit",function(){ -_90.firePluginEvent("onBeforeSubmit"); -_90._textArea.value=_90.outwardHtml(_90.getHTML()); +_91.firePluginEvent("onBeforeSubmit"); +_91._textArea.value=_91.outwardHtml(_91.getHTML()); return true; }); var _9d=_9c.value; Xinha.prependDom0Event(this._textArea.form,"reset",function(){ -_90.setHTML(_90.inwardHtml(_9d)); -_90.updateToolbar(); +_91.setHTML(_91.inwardHtml(_9d)); +_91.updateToolbar(); return true; }); if(!_9c.form.xinha_submit){ @@ -1050,133 +1072,128 @@ } } Xinha.prependDom0Event(window,"unload",function(){ -_90.firePluginEvent("onBeforeUnload"); -_9c.value=_90.outwardHtml(_90.getHTML()); +_91.firePluginEvent("onBeforeUnload"); +_9c.value=_91.outwardHtml(_91.getHTML()); if(!Xinha.is_ie){ _99.parentNode.replaceChild(_9c,_99); } return true; }); _9c.style.display="none"; -_90.initSize(); +_91.initSize(); this.setLoadingMessage(Xinha._lc("Finishing")); -_90._iframeLoadDone=false; +_91._iframeLoadDone=false; if(Xinha.is_opera){ -Xinha._addEvent(this._iframe.contentWindow,"load",function(e){ -if(!_90._iframeLoadDone){ -_90._iframeLoadDone=true; -_90.initIframe(); -} -return true; -}); +_91.initIframe(); }else{ Xinha._addEvent(this._iframe,"load",function(e){ -if(!_90._iframeLoadDone){ -_90._iframeLoadDone=true; -_90.initIframe(); +if(!_91._iframeLoadDone){ +_91._iframeLoadDone=true; +_91.initIframe(); } return true; }); } }; Xinha.prototype.initSize=function(){ this.setLoadingMessage(Xinha._lc("Init editor size")); -var _a0=this; +var _9f=this; +var _a0=null; var _a1=null; -var _a2=null; switch(this.config.width){ case "auto": -_a1=this._initial_ta_size.w; +_a0=this._initial_ta_size.w; break; case "toolbar": -_a1=this._toolBar.offsetWidth+"px"; +_a0=this._toolBar.offsetWidth+"px"; break; default: -_a1=/[^0-9]/.test(this.config.width)?this.config.width:this.config.width+"px"; +_a0=/[^0-9]/.test(this.config.width)?this.config.width:this.config.width+"px"; break; } switch(this.config.height){ case "auto": -_a2=this._initial_ta_size.h; +_a1=this._initial_ta_size.h; break; default: -_a2=/[^0-9]/.test(this.config.height)?this.config.height:this.config.height+"px"; +_a1=/[^0-9]/.test(this.config.height)?this.config.height:this.config.height+"px"; break; } -this.sizeEditor(_a1,_a2,this.config.sizeIncludesBars,this.config.sizeIncludesPanels); +this.sizeEditor(_a0,_a1,this.config.sizeIncludesBars,this.config.sizeIncludesPanels); this.notifyOn("panel_change",function(){ -_a0.sizeEditor(); +_9f.sizeEditor(); }); }; -Xinha.prototype.sizeEditor=function(_a3,_a4,_a5,_a6){ +Xinha.prototype.sizeEditor=function(_a2,_a3,_a4,_a5){ if(this._risizing){ return; } this._risizing=true; -this.notifyOf("before_resize",{width:_a3,height:_a4}); +this.notifyOf("before_resize",{width:_a2,height:_a3}); +this.firePluginEvent("onBeforeResize",_a2,_a3); this._iframe.style.height="100%"; this._textArea.style.height="100%"; this._iframe.style.width=""; this._textArea.style.width=""; +if(_a4!==null){ +this._htmlArea.sizeIncludesToolbars=_a4; +} if(_a5!==null){ -this._htmlArea.sizeIncludesToolbars=_a5; +this._htmlArea.sizeIncludesPanels=_a5; } -if(_a6!==null){ -this._htmlArea.sizeIncludesPanels=_a6; -} -if(_a3){ -this._htmlArea.style.width=_a3; +if(_a2){ +this._htmlArea.style.width=_a2; if(!this._htmlArea.sizeIncludesPanels){ -var _a7=this._panels.right; -if(_a7.on&&_a7.panels.length&&Xinha.hasDisplayedChildren(_a7.div)){ +var _a6=this._panels.right; +if(_a6.on&&_a6.panels.length&&Xinha.hasDisplayedChildren(_a6.div)){ this._htmlArea.style.width=(this._htmlArea.offsetWidth+parseInt(this.config.panel_dimensions.right,10))+"px"; } -var _a8=this._panels.left; -if(_a8.on&&_a8.panels.length&&Xinha.hasDisplayedChildren(_a8.div)){ +var _a7=this._panels.left; +if(_a7.on&&_a7.panels.length&&Xinha.hasDisplayedChildren(_a7.div)){ this._htmlArea.style.width=(this._htmlArea.offsetWidth+parseInt(this.config.panel_dimensions.left,10))+"px"; } } } -if(_a4){ -this._htmlArea.style.height=_a4; +if(_a3){ +this._htmlArea.style.height=_a3; if(!this._htmlArea.sizeIncludesToolbars){ this._htmlArea.style.height=(this._htmlArea.offsetHeight+this._toolbar.offsetHeight+this._statusBar.offsetHeight)+"px"; } if(!this._htmlArea.sizeIncludesPanels){ -var _a9=this._panels.top; -if(_a9.on&&_a9.panels.length&&Xinha.hasDisplayedChildren(_a9.div)){ +var _a8=this._panels.top; +if(_a8.on&&_a8.panels.length&&Xinha.hasDisplayedChildren(_a8.div)){ this._htmlArea.style.height=(this._htmlArea.offsetHeight+parseInt(this.config.panel_dimensions.top,10))+"px"; } -var _aa=this._panels.bottom; -if(_aa.on&&_aa.panels.length&&Xinha.hasDisplayedChildren(_aa.div)){ +var _a9=this._panels.bottom; +if(_a9.on&&_a9.panels.length&&Xinha.hasDisplayedChildren(_a9.div)){ this._htmlArea.style.height=(this._htmlArea.offsetHeight+parseInt(this.config.panel_dimensions.bottom,10))+"px"; } } } -_a3=this._htmlArea.offsetWidth; -_a4=this._htmlArea.offsetHeight; -var _ab=this._panels; -var _ac=this; -var _ad=1; +_a2=this._htmlArea.offsetWidth; +_a3=this._htmlArea.offsetHeight; +var _aa=this._panels; +var _ab=this; +var _ac=1; function panel_is_alive(pan){ -if(_ab[pan].on&&_ab[pan].panels.length&&Xinha.hasDisplayedChildren(_ab[pan].container)){ -_ab[pan].container.style.display=""; +if(_aa[pan].on&&_aa[pan].panels.length&&Xinha.hasDisplayedChildren(_aa[pan].container)){ +_aa[pan].container.style.display=""; return true; }else{ -_ab[pan].container.style.display="none"; +_aa[pan].container.style.display="none"; return false; } } if(panel_is_alive("left")){ -_ad+=1; +_ac+=1; } if(panel_is_alive("right")){ -_ad+=1; +_ac+=1; } -this._framework.tb_cell.colSpan=_ad; -this._framework.tp_cell.colSpan=_ad; -this._framework.bp_cell.colSpan=_ad; -this._framework.sb_cell.colSpan=_ad; +this._framework.tb_cell.colSpan=_ac; +this._framework.tp_cell.colSpan=_ac; +this._framework.bp_cell.colSpan=_ac; +this._framework.sb_cell.colSpan=_ac; if(!this._framework.tp_row.childNodes.length){ Xinha.removeFromParent(this._framework.tp_row); }else{ @@ -1204,25 +1221,27 @@ this._framework.bp_cell.style.height=this.config.panel_dimensions.bottom; this._framework.tb_cell.style.height=this._toolBar.offsetHeight+"px"; this._framework.sb_cell.style.height=this._statusBar.offsetHeight+"px"; -var _af=_a4-this._toolBar.offsetHeight-this._statusBar.offsetHeight; +var _ae=_a3-this._toolBar.offsetHeight-this._statusBar.offsetHeight; if(panel_is_alive("top")){ -_af-=parseInt(this.config.panel_dimensions.top,10); +_ae-=parseInt(this.config.panel_dimensions.top,10); } if(panel_is_alive("bottom")){ -_af-=parseInt(this.config.panel_dimensions.bottom,10); +_ae-=parseInt(this.config.panel_dimensions.bottom,10); } -this._iframe.style.height=_af+"px"; -var _b0=_a3; +this._iframe.style.height=_ae+"px"; +var _af=_a2; if(panel_is_alive("left")){ -_b0-=parseInt(this.config.panel_dimensions.left,10); +_af-=parseInt(this.config.panel_dimensions.left,10); } if(panel_is_alive("right")){ -_b0-=parseInt(this.config.panel_dimensions.right,10); +_af-=parseInt(this.config.panel_dimensions.right,10); } -this._iframe.style.width=_b0+"px"; +var _b0=(this.config.iframeWidth)?parseInt(this.config.iframeWidth,10):null; +this._iframe.style.width=(_b0&&_b0<_af)?_b0+"px":_af+"px"; this._textArea.style.height=this._iframe.style.height; this._textArea.style.width=this._iframe.style.width; this.notifyOf("resize",{width:this._htmlArea.offsetWidth,height:this._htmlArea.offsetHeight}); +this.firePluginEvent("onResize",this._htmlArea.offsetWidth,this._htmlArea.offsetWidth); this._risizing=false; }; Xinha.prototype.registerPanel=function(_b1,_b2){ @@ -1248,6 +1267,7 @@ this._panels[_b4].panels.push(div); this._panels[_b4].div.appendChild(div); this.notifyOf("panel_change",{"action":"add","panel":div}); +this.firePluginEvent("onPanelChange","add",div); return div; }; Xinha.prototype.removePanel=function(_b6){ @@ -1260,6 +1280,7 @@ } this._panels[_b6.side].panels=_b7; this.notifyOf("panel_change",{"action":"remove","panel":_b6}); +this.firePluginEvent("onPanelChange","remove",_b6); }; Xinha.prototype.hidePanel=function(_b9){ if(_b9&&_b9.style.display!="none"){ @@ -1270,6 +1291,7 @@ } _b9.style.display="none"; this.notifyOf("panel_change",{"action":"hide","panel":_b9}); +this.firePluginEvent("onPanelChange","hide",_b9); try{ this._iframe.contentWindow.scrollTo(pos.x,pos.y); } @@ -1286,6 +1308,7 @@ } _bb.style.display=""; this.notifyOf("panel_change",{"action":"show","panel":_bb}); +this.firePluginEvent("onPanelChange","show",_bb); try{ this._iframe.contentWindow.scrollTo(pos.x,pos.y); } @@ -1305,6 +1328,7 @@ } } this.notifyOf("panel_change",{"action":"multi_hide","sides":_bd}); +this.firePluginEvent("onPanelChange","multi_hide",_bd); }; Xinha.prototype.showPanels=function(_c0){ if(typeof _c0=="undefined"){ @@ -1318,6 +1342,7 @@ } } this.notifyOf("panel_change",{"action":"multi_show","sides":_c0}); +this.firePluginEvent("onPanelChange","multi_show",_c0); }; Xinha.objectProperties=function(obj){ var _c4=[]; @@ -1374,7 +1399,7 @@ catch(ex){ } }else{ -if(!Xinha.is_gecko&&this._doc.body.contentEditable!==false){ +if(!Xinha.is_designMode&&this._doc.body.contentEditable!==false){ this._doc.body.contentEditable=false; } } @@ -1431,18 +1456,18 @@ _c9+="\n"; } _c9+=Xinha.addCoreCSS(); -if(_c8.config.pageStyle){ -_c9+=""; -} if(typeof _c8.config.pageStyleSheets!=="undefined"){ for(var i=0;i<_c8.config.pageStyleSheets.length;i++){ if(_c8.config.pageStyleSheets[i].length>0){ _c9+=""; } } } +if(_c8.config.pageStyle){ +_c9+=""; +} _c9+="\n"; -_c9+="\n"; +_c9+="\n"; _c9+=_c8.inwardHtml(_c8._textArea.value); _c9+="\n"; _c9+=""; @@ -1479,6 +1504,7 @@ } switch(_cf){ case "textmode": +this.firePluginEvent("onBeforeMode","textmode"); this.setCC("iframe"); _d0=this.outwardHtml(this.getHTML()); this.setHTML(_d0); @@ -1489,10 +1515,12 @@ this._statusBarTree.style.display="none"; this._statusBarTextMode.style.display=""; } -this.notifyOf("modechange",{"mode":"text"}); this.findCC("textarea"); +this.notifyOf("modechange",{"mode":"text"}); +this.firePluginEvent("onMode","textmode"); break; case "wysiwyg": +this.firePluginEvent("onBeforeMode","wysiwyg"); this.setCC("textarea"); _d0=this.inwardHtml(this.getHTML()); this.deactivateEditor(); @@ -1504,158 +1532,169 @@ this._statusBarTree.style.display=""; this._statusBarTextMode.style.display="none"; } -this.notifyOf("modechange",{"mode":"wysiwyg"}); this.findCC("iframe"); +this.notifyOf("modechange",{"mode":"wysiwyg"}); +this.firePluginEvent("onMode","wysiwyg"); break; default: alert("Mode <"+_cf+"> not defined!"); return false; } this._editMode=_cf; -for(var i in this.plugins){ -var _d2=this.plugins[i].instance; -if(_d2&&typeof _d2.onMode=="function"){ -_d2.onMode(_cf); -} -} }; -Xinha.prototype.setFullHTML=function(_d3){ -var _d4=RegExp.multiline; +Xinha.prototype.setFullHTML=function(_d1){ +var _d2=RegExp.multiline; RegExp.multiline=true; -if(_d3.match(Xinha.RE_doctype)){ +if(_d1.match(Xinha.RE_doctype)){ this.setDoctype(RegExp.$1); } -RegExp.multiline=_d4; +RegExp.multiline=_d2; if(0){ -if(_d3.match(Xinha.RE_head)){ +if(_d1.match(Xinha.RE_head)){ this._doc.getElementsByTagName("head")[0].innerHTML=RegExp.$1; } -if(_d3.match(Xinha.RE_body)){ +if(_d1.match(Xinha.RE_body)){ this._doc.getElementsByTagName("body")[0].innerHTML=RegExp.$1; } }else{ -var _d5=this.editorIsActivated(); -if(_d5){ +var _d3=this.editorIsActivated(); +if(_d3){ this.deactivateEditor(); } -var _d6=/((.|\n)*?)<\/html>/i; -_d3=_d3.replace(_d6,"$1"); +var _d4=/((.|\n)*?)<\/html>/i; +_d1=_d1.replace(_d4,"$1"); this._doc.open("text/html","replace"); -this._doc.write(_d3); +this._doc.write(_d1); this._doc.close(); -if(_d5){ +if(_d3){ this.activateEditor(); } this.setEditorEvents(); return true; } }; Xinha.prototype.setEditorEvents=function(){ -var _d7=this; +var _d5=this; var doc=this._doc; -_d7.whenDocReady(function(){ +_d5.whenDocReady(function(){ Xinha._addEvents(doc,["mousedown"],function(){ -_d7.activateEditor(); +_d5.activateEditor(); return true; }); if(Xinha.is_ie){ -Xinha._addEvent(_d7._doc.getElementsByTagName("html")[0],"click",function(){ -if(_d7._iframe.contentWindow.event.srcElement.tagName.toLowerCase()=="html"){ -var r=_d7._doc.body.createTextRange(); +Xinha._addEvent(_d5._doc.getElementsByTagName("html")[0],"click",function(){ +if(_d5._iframe.contentWindow.event.srcElement.tagName.toLowerCase()=="html"){ +var r=_d5._doc.body.createTextRange(); r.collapse(); r.select(); } return true; }); } -Xinha._addEvents(doc,["keydown","keypress","mousedown","mouseup","drag"],function(_da){ -return _d7._editorEvent(Xinha.is_ie?_d7._iframe.contentWindow.event:_da); +Xinha._addEvents(doc,["keydown","keypress","mousedown","mouseup","drag"],function(_d8){ +return _d5._editorEvent(Xinha.is_ie?_d5._iframe.contentWindow.event:_d8); }); -for(var i in _d7.plugins){ -var _dc=_d7.plugins[i].instance; -Xinha.refreshPlugin(_dc); +for(var i in _d5.plugins){ +var _da=_d5.plugins[i].instance; +Xinha.refreshPlugin(_da); } -if(typeof _d7._onGenerate=="function"){ -_d7._onGenerate(); +if(typeof _d5._onGenerate=="function"){ +_d5._onGenerate(); } Xinha.addDom0Event(window,"resize",function(e){ -_d7.sizeEditor(); +_d5.sizeEditor(); }); -_d7.removeLoadingMessage(); +_d5.removeLoadingMessage(); }); }; Xinha.prototype.registerPlugin=function(){ if(!Xinha.isSupportedBrowser){ return; } -var _de=arguments[0]; -if(_de===null||typeof _de=="undefined"||(typeof _de=="string"&&eval("typeof "+_de)=="undefined")){ +var _dc=arguments[0]; +if(_dc===null||typeof _dc=="undefined"||(typeof _dc=="string"&&typeof window[_dc]=="undefined")){ return false; } -var _df=[]; +var _dd=[]; for(var i=1;i"; +if(!Xinha.is_gecko||_15b!=="blockquote"){ +_15b="<"+_15b+">"; } -this.execCommand(txt,false,_15a); +this.execCommand(txt,false,_15b); break; default: -var _15b=this.config.customSelects[txt]; -if(typeof _15b!="undefined"){ -_15b.action(this); +var _15c=this.config.customSelects[txt]; +if(typeof _15c!="undefined"){ +_15c.action(this); }else{ alert("FIXME: combo box "+txt+" not implemented"); } break; } }; -Xinha.prototype._colorSelector=function(_15c){ -var _15d=this; +Xinha.prototype._colorSelector=function(_15d){ +var _15e=this; if(Xinha.is_gecko){ try{ -_15d._doc.execCommand("useCSS",false,false); -_15d._doc.execCommand("styleWithCSS",false,true); +_15e._doc.execCommand("useCSS",false,false); +_15e._doc.execCommand("styleWithCSS",false,true); } catch(ex){ } } -var btn=_15d._toolbarObjects[_15c].element; -var _15f; -if(_15c=="hilitecolor"){ +var btn=_15e._toolbarObjects[_15d].element; +var _160; +if(_15d=="hilitecolor"){ if(Xinha.is_ie){ -_15c="backcolor"; -_15f=Xinha._colorToRgb(_15d._doc.queryCommandValue("backcolor")); +_15d="backcolor"; +_160=Xinha._colorToRgb(_15e._doc.queryCommandValue("backcolor")); }else{ -_15f=Xinha._colorToRgb(_15d._doc.queryCommandValue("hilitecolor")); +_160=Xinha._colorToRgb(_15e._doc.queryCommandValue("hilitecolor")); } }else{ -_15f=Xinha._colorToRgb(_15d._doc.queryCommandValue("forecolor")); +_160=Xinha._colorToRgb(_15e._doc.queryCommandValue("forecolor")); } -var _160=function(_161){ -_15d._doc.execCommand(_15c,false,_161); +var _161=function(_162){ +_15e._doc.execCommand(_15d,false,_162); }; if(Xinha.is_ie){ -var _162=_15d.createRange(_15d.getSelection()); -_160=function(_163){ -_162.select(); -_15d._doc.execCommand(_15c,false,_163); +var _163=_15e.createRange(_15e.getSelection()); +_161=function(_164){ +_163.select(); +_15e._doc.execCommand(_15d,false,_164); }; } -var _164=new Xinha.colorPicker({cellsize:_15d.config.colorPickerCellSize,callback:_160,granularity:_15d.config.colorPickerGranularity,websafe:_15d.config.colorPickerWebSafe,savecolors:_15d.config.colorPickerSaveColors}); -_164.open(_15d.config.colorPickerPosition,btn,_15f); +var _165=new Xinha.colorPicker({cellsize:_15e.config.colorPickerCellSize,callback:_161,granularity:_15e.config.colorPickerGranularity,websafe:_15e.config.colorPickerWebSafe,savecolors:_15e.config.colorPickerSaveColors}); +_165.open(_15e.config.colorPickerPosition,btn,_160); }; -Xinha.prototype.execCommand=function(_165,UI,_167){ -var _168=this; +Xinha.prototype.execCommand=function(_166,UI,_168){ +var _169=this; this.focusEditor(); -_165=_165.toLowerCase(); -if(this.firePluginEvent("onExecCommand",_165,UI,_167)){ +_166=_166.toLowerCase(); +if(this.firePluginEvent("onExecCommand",_166,UI,_168)){ this.updateToolbar(); return false; } -switch(_165){ +switch(_166){ case "htmlmode": this.setMode(); break; case "hilitecolor": case "forecolor": -this._colorSelector(_165); +this._colorSelector(_166); break; case "createlink": this._createLink(); break; case "undo": case "redo": if(this._customUndo){ -this[_165](); +this[_166](); }else{ -this._doc.execCommand(_165,UI,_167); +this._doc.execCommand(_166,UI,_168); } break; case "inserttable": @@ -2377,28 +2417,28 @@ this._insertImage(); break; case "about": -this._popupDialog(_168.config.URIs.about,null,this); +this._popupDialog(_169.config.URIs.about,null,this); break; case "showhelp": -this._popupDialog(_168.config.URIs.help,null,this); +this._popupDialog(_169.config.URIs.help,null,this); break; case "killword": this._wordClean(); break; case "cut": case "copy": case "paste": -this._doc.execCommand(_165,UI,_167); +this._doc.execCommand(_166,UI,_168); if(this.config.killWordOnPaste){ this._wordClean(); } break; case "lefttoright": case "righttoleft": if(this.config.changeJustifyWithDirection){ -this._doc.execCommand((_165=="righttoleft")?"justifyright":"justifyleft",UI,_167); +this._doc.execCommand((_166=="righttoleft")?"justifyright":"justifyleft",UI,_168); } -var dir=(_165=="righttoleft")?"rtl":"ltr"; +var dir=(_166=="righttoleft")?"rtl":"ltr"; var el=this.getParentElement(); while(el&&!Xinha.isBlockElement(el)){ el=el.parentNode; @@ -2413,21 +2453,21 @@ break; case "justifyleft": case "justifyright": -_165.match(/^justify(.*)$/); +_166.match(/^justify(.*)$/); var ae=this.activeElement(this.getSelection()); if(ae&&ae.tagName.toLowerCase()=="img"){ ae.align=ae.align==RegExp.$1?"":RegExp.$1; }else{ -this._doc.execCommand(_165,UI,_167); +this._doc.execCommand(_166,UI,_168); } break; default: try{ -this._doc.execCommand(_165,UI,_167); +this._doc.execCommand(_166,UI,_168); } catch(ex){ if(this.config.debug){ -alert(ex+"\n\nby execCommand("+_165+");"); +alert(ex+"\n\nby execCommand("+_166+");"); } } break; @@ -2436,35 +2476,35 @@ return false; }; Xinha.prototype._editorEvent=function(ev){ -var _16d=this; -if(typeof _16d._textArea["on"+ev.type]=="function"){ -_16d._textArea["on"+ev.type](); +var _16e=this; +if(typeof _16e._textArea["on"+ev.type]=="function"){ +_16e._textArea["on"+ev.type](); } if(this.isKeyEvent(ev)){ -if(_16d.firePluginEvent("onKeyPress",ev)){ +if(_16e.firePluginEvent("onKeyPress",ev)){ return false; } if(this.isShortCut(ev)){ this._shortCuts(ev); } } if(ev.type=="mousedown"){ -if(_16d.firePluginEvent("onMouseDown",ev)){ +if(_16e.firePluginEvent("onMouseDown",ev)){ return false; } } -if(_16d._timerToolbar){ -clearTimeout(_16d._timerToolbar); +if(_16e._timerToolbar){ +clearTimeout(_16e._timerToolbar); } -_16d._timerToolbar=setTimeout(function(){ -_16d.updateToolbar(); -_16d._timerToolbar=null; +_16e._timerToolbar=setTimeout(function(){ +_16e.updateToolbar(); +_16e._timerToolbar=null; },250); }; Xinha.prototype._shortCuts=function(ev){ var key=this.getKey(ev).toLowerCase(); var cmd=null; -var _171=null; +var _172=null; switch(key){ case "b": cmd="bold"; @@ -2501,7 +2541,7 @@ break; case "n": cmd="formatblock"; -_171="p"; +_172="p"; break; case "0": cmd="killword"; @@ -2513,20 +2553,20 @@ case "5": case "6": cmd="formatblock"; -_171="h"+key; +_172="h"+key; break; } if(cmd){ -this.execCommand(cmd,false,_171); +this.execCommand(cmd,false,_172); Xinha._stopEvent(ev); } }; -Xinha.prototype.convertNode=function(el,_173){ -var _174=this._doc.createElement(_173); +Xinha.prototype.convertNode=function(el,_174){ +var _175=this._doc.createElement(_174); while(el.firstChild){ -_174.appendChild(el.firstChild); +_175.appendChild(el.firstChild); } -return _174; +return _175; }; Xinha.prototype.scrollToElement=function(e){ if(!e){ @@ -2535,8 +2575,8 @@ return; } } -var _176=Xinha.getElementTopLeft(e); -this._iframe.contentWindow.scrollTo(_176.left,_176.top); +var _177=Xinha.getElementTopLeft(e); +this._iframe.contentWindow.scrollTo(_177.left,_177.top); }; Xinha.prototype.getEditorContent=function(){ return this.outwardHtml(this.getHTML()); @@ -2565,22 +2605,18 @@ }; Xinha.prototype.outwardHtml=function(html){ for(var i in this.plugins){ -var _17b=this.plugins[i].instance; -if(_17b&&typeof _17b.outwardHtml=="function"){ -html=_17b.outwardHtml(html); +var _17c=this.plugins[i].instance; +if(_17c&&typeof _17c.outwardHtml=="function"){ +html=_17c.outwardHtml(html); } } html=html.replace(/<(\/?)b(\s|>|\/)/ig,"<$1strong$2"); html=html.replace(/<(\/?)i(\s|>|\/)/ig,"<$1em$2"); html=html.replace(/<(\/?)strike(\s|>|\/)/ig,"<$1del$2"); -html=html.replace(/(<[^>]*onclick=['"])if\(window\.top && window\.top\.Xinha\)\{return false\}/gi,"$1"); -html=html.replace(/(<[^>]*onmouseover=['"])if\(window\.top && window\.top\.Xinha\)\{return false\}/gi,"$1"); -html=html.replace(/(<[^>]*onmouseout=['"])if\(window\.top && window\.top\.Xinha\)\{return false\}/gi,"$1"); -html=html.replace(/(<[^>]*onmousedown=['"])if\(window\.top && window\.top\.Xinha\)\{return false\}/gi,"$1"); -html=html.replace(/(<[^>]*onmouseup=['"])if\(window\.top && window\.top\.Xinha\)\{return false\}/gi,"$1"); -var _17c=location.href.replace(/(https?:\/\/[^\/]*)\/.*/,"$1")+"/"; -html=html.replace(/https?:\/\/null\//g,_17c); -html=html.replace(/((href|src|background)=[\'\"])\/+/ig,"$1"+_17c); +html=html.replace(/(<[^>]*on(click|mouse(over|out|up|down))=['"])if\(window\.parent && window\.parent\.Xinha\)\{return false\}/gi,"$1"); +var _17d=location.href.replace(/(https?:\/\/[^\/]*)\/.*/,"$1")+"/"; +html=html.replace(/https?:\/\/null\//g,_17d); +html=html.replace(/((href|src|background)=[\'\"])\/+/ig,"$1"+_17d); html=this.outwardSpecialReplacements(html); html=this.fixRelativeLinks(html); if(this.config.sevenBitClean){ @@ -2592,29 +2628,31 @@ if(this.config.fullPage){ html=Xinha.stripCoreCSS(html); } +if(typeof this.config.outwardHtml=="function"){ +html=this.config.outwardHtml(html); +} return html; }; Xinha.prototype.inwardHtml=function(html){ for(var i in this.plugins){ -var _180=this.plugins[i].instance; -if(_180&&typeof _180.inwardHtml=="function"){ -html=_180.inwardHtml(html); +var _181=this.plugins[i].instance; +if(_181&&typeof _181.inwardHtml=="function"){ +html=_181.inwardHtml(html); } } html=html.replace(/<(\/?)del(\s|>|\/)/ig,"<$1strike$2"); -html=html.replace(/(<[^>]*onclick=["'])/gi,"$1if(window.top && window.top.Xinha){return false}"); -html=html.replace(/(<[^>]*onmouseover=["'])/gi,"$1if(window.top && window.top.Xinha){return false}"); -html=html.replace(/(<[^>]*onmouseout=["'])/gi,"$1if(window.top && window.top.Xinha){return false}"); -html=html.replace(/(<[^>]*onmouseodown=["'])/gi,"$1if(window.top && window.top.Xinha){return false}"); -html=html.replace(/(<[^>]*onmouseup=["'])/gi,"$1if(window.top && window.top.Xinha){return false}"); +html=html.replace(/(<[^>]*on(click|mouse(over|out|up|down))=["'])/gi,"$1if(window.parent && window.parent.Xinha){return false}"); html=this.inwardSpecialReplacements(html); html=html.replace(/(]*((type=[\"\']text\/)|(language=[\"\'])))(javascript)/gi,"$1freezescript"); -var _181=new RegExp("((href|src|background)=['\"])/+","gi"); -html=html.replace(_181,"$1"+location.href.replace(/(https?:\/\/[^\/]*)\/.*/,"$1")+"/"); +var _182=new RegExp("((href|src|background)=['\"])/+","gi"); +html=html.replace(_182,"$1"+location.href.replace(/(https?:\/\/[^\/]*)\/.*/,"$1")+"/"); html=this.fixRelativeLinks(html); if(this.config.fullPage){ html=Xinha.addCoreCSS(html); } +if(typeof this.config.inwardHtml=="function"){ +html=this.config.inwardHtml(html); +} return html; }; Xinha.prototype.outwardSpecialReplacements=function(html){ @@ -2660,17 +2698,17 @@ } } if(typeof this.config.stripSelfNamedAnchors!="undefined"&&this.config.stripSelfNamedAnchors){ -var _191=new RegExp("((href|src|background)=\")("+Xinha.escapeStringForRegExp(document.location.href.replace(/&/g,"&"))+")([#?][^'\" ]*)","g"); -html=html.replace(_191,"$1$4"); +var _192=new RegExp("((href|src|background)=\")("+Xinha.escapeStringForRegExp(unescape(document.location.href.replace(/&/g,"&")))+")([#?][^'\" ]*)","g"); +html=html.replace(_192,"$1$4"); } if(typeof this.config.stripBaseHref!="undefined"&&this.config.stripBaseHref){ -var _192=null; +var _193=null; if(typeof this.config.baseHref!="undefined"&&this.config.baseHref!==null){ -_192=new RegExp("((href|src|background)=\")("+Xinha.escapeStringForRegExp(this.config.baseHref)+")","g"); -}else{ -_192=new RegExp("((href|src|background)=\")("+Xinha.escapeStringForRegExp(document.location.href.replace(/^(https?:\/\/[^\/]*)(.*)/,"$1"))+")","g"); +_193=new RegExp("((href|src|background|action)=\")("+Xinha.escapeStringForRegExp(this.config.baseHref.replace(/([^\/]\/)(?=.+\.)[^\/]*$/,"$1"))+")","g"); +html=html.replace(_193,"$1"); } -html=html.replace(_192,"$1"); +_193=new RegExp("((href|src|background|action)=\")("+Xinha.escapeStringForRegExp(document.location.href.replace(/^(https?:\/\/[^\/]*)(.*)/,"$1"))+")","g"); +html=html.replace(_193,"$1"); } return html; }; @@ -2704,31 +2742,34 @@ } this._textArea.value=html; }; -Xinha.prototype.setDoctype=function(_195){ -this.doctype=_195; +Xinha.prototype.setDoctype=function(_196){ +this.doctype=_196; }; Xinha._object=null; +Array.prototype.isArray=true; +RegExp.prototype.isRegExp=true; Xinha.cloneObject=function(obj){ if(!obj){ return null; } -var _197={}; -if(obj.constructor.toString().match(/\s*function Array\(/)){ -_197=obj.constructor(); -} -if(obj.constructor.toString().match(/\s*function Function\(/)){ -_197=obj; +var _198=(obj.isArray)?[]:{}; +if(obj.constructor.toString().match(/\s*function Function\(/)||typeof obj=="function"){ +_198=obj; }else{ +if(obj.isRegExp){ +_198=eval(obj.toString()); +}else{ for(var n in obj){ var node=obj[n]; if(typeof node=="object"){ -_197[n]=Xinha.cloneObject(node); +_198[n]=Xinha.cloneObject(node); }else{ -_197[n]=node; +_198[n]=node; } } } -return _197; +} +return _198; }; Xinha.flushEvents=function(){ var x=0; @@ -2753,25 +2794,25 @@ }; Xinha._eventFlushers=[]; if(document.addEventListener){ -Xinha._addEvent=function(el,_19d,func){ -el.addEventListener(_19d,func,true); -Xinha._eventFlushers.push([el,_19d,func]); +Xinha._addEvent=function(el,_19e,func){ +el.addEventListener(_19e,func,true); +Xinha._eventFlushers.push([el,_19e,func]); }; -Xinha._removeEvent=function(el,_1a0,func){ -el.removeEventListener(_1a0,func,true); +Xinha._removeEvent=function(el,_1a1,func){ +el.removeEventListener(_1a1,func,true); }; Xinha._stopEvent=function(ev){ ev.preventDefault(); ev.stopPropagation(); }; }else{ if(document.attachEvent){ -Xinha._addEvent=function(el,_1a4,func){ -el.attachEvent("on"+_1a4,func); -Xinha._eventFlushers.push([el,_1a4,func]); +Xinha._addEvent=function(el,_1a5,func){ +el.attachEvent("on"+_1a5,func); +Xinha._eventFlushers.push([el,_1a5,func]); }; -Xinha._removeEvent=function(el,_1a7,func){ -el.detachEvent("on"+_1a7,func); +Xinha._removeEvent=function(el,_1a8,func){ +el.detachEvent("on"+_1a8,func); }; Xinha._stopEvent=function(ev){ try{ @@ -2782,10 +2823,10 @@ } }; }else{ -Xinha._addEvent=function(el,_1ab,func){ +Xinha._addEvent=function(el,_1ac,func){ alert("_addEvent is not supported"); }; -Xinha._removeEvent=function(el,_1ae,func){ +Xinha._removeEvent=function(el,_1af,func){ alert("_removeEvent is not supported"); }; Xinha._stopEvent=function(ev){ @@ -2803,6 +2844,40 @@ Xinha._removeEvent(el,evs[i],func); } }; +Xinha.addOnloadHandler=function(func,_1bb){ +_1bb=_1bb?_1bb:window; +var init=function(){ +if(arguments.callee.done){ +return; +} +arguments.callee.done=true; +if(Xinha.onloadTimer){ +clearInterval(Xinha.onloadTimer); +} +func(); +}; +if(Xinha.is_ie){ +_1bb.document.write(""); +var _1bd=_1bb.document.getElementById("__ie_onload"); +_1bd.onreadystatechange=function(){ +if(this.readyState=="loaded"){ +this.parentNode.removeChild(_1bd); +init(); +} +}; +}else{ +if(/applewebkit|KHTML/i.test(navigator.userAgent)){ +Xinha.onloadTimer=_1bb.setInterval(function(){ +if(/loaded|complete/.test(_1bb.document.readyState)){ +init(); +} +},10); +}else{ +_1bb.document.addEventListener("DOMContentLoaded",init,false); +} +} +Xinha._addEvent(_1bb,"load",init); +}; Xinha.addDom0Event=function(el,ev,fn){ Xinha._prepareForDom0Events(el,ev); el._xinha_dom0Events[ev].unshift(fn); @@ -2821,19 +2896,19 @@ if(typeof el["on"+ev]=="function"){ el._xinha_dom0Events[ev].push(el["on"+ev]); } -el["on"+ev]=function(_1c1){ +el["on"+ev]=function(_1c6){ var a=el._xinha_dom0Events[ev]; -var _1c3=true; +var _1c8=true; for(var i=a.length;--i>=0;){ el._xinha_tempEventHandler=a[i]; -if(el._xinha_tempEventHandler(_1c1)===false){ +if(el._xinha_tempEventHandler(_1c6)===false){ el._xinha_tempEventHandler=null; -_1c3=false; +_1c8=false; break; } el._xinha_tempEventHandler=null; } -return _1c3; +return _1c8; }; Xinha._eventFlushers.push([el,ev]); } @@ -2875,13 +2950,13 @@ str=str.replace(/\x22/g,"""); return str; }; -Xinha.prototype.stripBaseURL=function(_1ce){ +Xinha.prototype.stripBaseURL=function(_1d3){ if(this.config.baseHref===null||!this.config.stripBaseHref){ -return _1ce; +return _1d3; } -var _1cf=this.config.baseHref.replace(/^(https?:\/\/[^\/]+)(.*)$/,"$1"); -var _1d0=new RegExp(_1cf); -return _1ce.replace(_1d0,""); +var _1d4=this.config.baseHref.replace(/^(https?:\/\/[^\/]+)(.*)$/,"$1"); +var _1d5=new RegExp(_1d4); +return _1d3.replace(_1d5,""); }; String.prototype.trim=function(){ return this.replace(/^\s+/,"").replace(/\s+$/,""); @@ -2924,25 +2999,25 @@ } return null; }; -Xinha.prototype._popupDialog=function(url,_1da,init){ -Dialog(this.popupURL(url),_1da,init); +Xinha.prototype._popupDialog=function(url,_1df,init){ +Dialog(this.popupURL(url),_1df,init); }; -Xinha.prototype.imgURL=function(file,_1dd){ -if(typeof _1dd=="undefined"){ +Xinha.prototype.imgURL=function(file,_1e2){ +if(typeof _1e2=="undefined"){ return _editor_url+file; }else{ -return _editor_url+"plugins/"+_1dd+"/img/"+file; +return _editor_url+"plugins/"+_1e2+"/img/"+file; } }; Xinha.prototype.popupURL=function(file){ var url=""; if(file.match(/^plugin:\/\/(.*?)\/(.*)/)){ -var _1e0=RegExp.$1; -var _1e1=RegExp.$2; -if(!(/\.html$/.test(_1e1))){ -_1e1+=".html"; +var _1e5=RegExp.$1; +var _1e6=RegExp.$2; +if(!(/\.(html?|php)$/.test(_1e6))){ +_1e6+=".html"; } -url=_editor_url+"plugins/"+_1e0+"/popups/"+_1e1; +url=Xinha.getPluginDir(_1e5)+"/popups/"+_1e6; }else{ if(file.match(/^\/.*?/)||file.match(/^https?:\/\//)){ url=file; @@ -2962,138 +3037,138 @@ return null; }; Xinha.prototype._toggleBorders=function(){ -var _1e5=this._doc.getElementsByTagName("TABLE"); -if(_1e5.length!==0){ +var _1ea=this._doc.getElementsByTagName("TABLE"); +if(_1ea.length!==0){ if(!this.borders){ this.borders=true; }else{ this.borders=false; } -for(var i=0;i<_1e5.length;i++){ +for(var i=0;i<_1ea.length;i++){ if(this.borders){ -Xinha._addClass(_1e5[i],"htmtableborders"); +Xinha._addClass(_1ea[i],"htmtableborders"); }else{ -Xinha._removeClass(_1e5[i],"htmtableborders"); +Xinha._removeClass(_1ea[i],"htmtableborders"); } } } return true; }; Xinha.addCoreCSS=function(html){ -var _1e8="\n"; +var _1ed="\n"; if(html&&//i.test(html)){ -return html.replace(//i,""+_1e8); +return html.replace(//i,""+_1ed); }else{ if(html){ -return _1e8+html; +return _1ed+html; }else{ -return _1e8; +return _1ed; } } }; -Xinha.prototype.addEditorStylesheet=function(_1e9){ -var _1ea=this._doc.createElement("link"); -_1ea.rel="stylesheet"; -_1ea.type="text/css"; -_1ea.title="XinhaInternalCSS"; -_1ea.href=_1e9; -this._doc.getElementsByTagName("HEAD")[0].appendChild(_1ea); +Xinha.prototype.addEditorStylesheet=function(_1ee){ +var _1ef=this._doc.createElement("link"); +_1ef.rel="stylesheet"; +_1ef.type="text/css"; +_1ef.title="XinhaInternalCSS"; +_1ef.href=_1ee; +this._doc.getElementsByTagName("HEAD")[0].appendChild(_1ef); }; Xinha.stripCoreCSS=function(html){ return html.replace(/]+title="XinhaInternalCSS"(.|\n)*?<\/style>/ig,"").replace(/]+title="XinhaInternalCSS"(.|\n)*?>/ig,""); }; -Xinha._removeClass=function(el,_1ed){ +Xinha._removeClass=function(el,_1f2){ if(!(el&&el.className)){ return; } var cls=el.className.split(" "); var ar=[]; for(var i=cls.length;i>0;){ -if(cls[--i]!=_1ed){ +if(cls[--i]!=_1f2){ ar[ar.length]=cls[i]; } } el.className=ar.join(" "); }; -Xinha._addClass=function(el,_1f2){ -Xinha._removeClass(el,_1f2); -el.className+=" "+_1f2; +Xinha._addClass=function(el,_1f7){ +Xinha._removeClass(el,_1f7); +el.className+=" "+_1f7; }; -Xinha.addClasses=function(el,_1f4){ +Xinha.addClasses=function(el,_1f9){ if(el!==null){ -var _1f5=el.className.trim().split(" "); -var ours=_1f4.split(" "); +var _1fa=el.className.trim().split(" "); +var ours=_1f9.split(" "); for(var x=0;x0;){ -if(cls[--i]==_203){ +if(cls[--i]==_208){ return true; } } return false; }; Xinha._postback_send_charset=true; -Xinha._postback=function(url,data,_208){ +Xinha._postback=function(url,data,_20d){ var req=null; req=Xinha.getXMLHTTPRequestObject(); -var _20a=""; +var _20f=""; if(typeof data=="string"){ -_20a=data; +_20f=data; }else{ if(typeof data=="object"){ for(var i in data){ -_20a+=(_20a.length?"&":"")+i+"="+encodeURIComponent(data[i]); +_20f+=(_20f.length?"&":"")+i+"="+encodeURIComponent(data[i]); } } } function callBack(){ if(req.readyState==4){ if(req.status==200||Xinha.isRunLocally&&req.status==0){ -if(typeof _208=="function"){ -_208(req.responseText,req); +if(typeof _20d=="function"){ +_20d(req.responseText,req); } }else{ if(Xinha._postback_send_charset){ Xinha._postback_send_charset=false; -Xinha._postback(url,data,_208); +Xinha._postback(url,data,_20d); }else{ alert("An error has occurred: "+req.statusText+"\nURL: "+url); } @@ -3103,15 +3178,15 @@ req.onreadystatechange=callBack; req.open("POST",url,true); req.setRequestHeader("Content-Type","application/x-www-form-urlencoded"+(Xinha._postback_send_charset?"; charset=UTF-8":"")); -req.send(_20a); +req.send(_20f); }; -Xinha._getback=function(url,_20d){ +Xinha._getback=function(url,_212){ var req=null; req=Xinha.getXMLHTTPRequestObject(); function callBack(){ if(req.readyState==4){ if(req.status==200||Xinha.isRunLocally&&req.status==0){ -_20d(req.responseText,req); +_212(req.responseText,req); }else{ alert("An error has occurred: "+req.statusText+"\nURL: "+url); } @@ -3132,32 +3207,46 @@ return ""; } }; -if(typeof dump=="undefined"){ -function dump(o){ +if(typeof dumpValues=="undefined"){ +function dumpValues(o){ var s=""; for(var prop in o){ +if(window.console&&typeof window.console.log=="function"){ +if(typeof console.firebug!="undefined"){ +console.log(o); +}else{ +console.log(prop+" = "+o[prop]+"\n"); +} +}else{ s+=prop+" = "+o[prop]+"\n"; } +} +if(s){ +if(document.getElementById("errors")){ +document.getElementById("errors").value+=s; +}else{ var x=window.open("","debugger"); x.document.write("
"+s+"
"); } } +} +} if(!Array.prototype.contains){ -Array.prototype.contains=function(_215){ -var _216=this; -for(var i=0;i<_216.length;i++){ -if(_215==_216[i]){ +Array.prototype.contains=function(_21a){ +var _21b=this; +for(var i=0;i<_21b.length;i++){ +if(_21a==_21b[i]){ return true; } } return false; }; } if(!Array.prototype.indexOf){ -Array.prototype.indexOf=function(_218){ -var _219=this; -for(var i=0;i<_219.length;i++){ -if(_218==_219[i]){ +Array.prototype.indexOf=function(_21d){ +var _21e=this; +for(var i=0;i<_21e.length;i++){ +if(_21d==_21e[i]){ return i; } } @@ -3173,62 +3262,62 @@ }; } Xinha.arrayContainsArray=function(a1,a2){ -var _21f=true; +var _224=true; for(var x=0;x>2; enc2=((chr1&3)<<4)|(chr2>>4); enc3=((chr2&15)<<2)|(chr3>>6); @@ -3404,34 +3502,34 @@ enc4=64; } } -_24d=_24d+_24c.charAt(enc1)+_24c.charAt(enc2)+_24c.charAt(enc3)+_24c.charAt(enc4); -}while(i<_24b.length); -return _24d; +_252=_252+_251.charAt(enc1)+_251.charAt(enc2)+_251.charAt(enc3)+_251.charAt(enc4); +}while(i<_250.length); +return _252; }; -Xinha.base64_decode=function(_251){ -var _252="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; -var _253=""; +Xinha.base64_decode=function(_256){ +var _257="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; +var _258=""; var chr1,chr2,chr3; var enc1,enc2,enc3,enc4; var i=0; -_251=_251.replace(/[^A-Za-z0-9\+\/\=]/g,""); +_256=_256.replace(/[^A-Za-z0-9\+\/\=]/g,""); do{ -enc1=_252.indexOf(_251.charAt(i++)); -enc2=_252.indexOf(_251.charAt(i++)); -enc3=_252.indexOf(_251.charAt(i++)); -enc4=_252.indexOf(_251.charAt(i++)); +enc1=_257.indexOf(_256.charAt(i++)); +enc2=_257.indexOf(_256.charAt(i++)); +enc3=_257.indexOf(_256.charAt(i++)); +enc4=_257.indexOf(_256.charAt(i++)); chr1=(enc1<<2)|(enc2>>4); chr2=((enc2&15)<<4)|(enc3>>2); chr3=((enc3&3)<<6)|enc4; -_253=_253+String.fromCharCode(chr1); +_258=_258+String.fromCharCode(chr1); if(enc3!=64){ -_253=_253+String.fromCharCode(chr2); +_258=_258+String.fromCharCode(chr2); } if(enc4!=64){ -_253=_253+String.fromCharCode(chr3); +_258=_258+String.fromCharCode(chr3); } -}while(i<_251.length); -return _253; +}while(i<_256.length); +return _258; }; Xinha.removeFromParent=function(el){ if(!el.parentNode){ @@ -3450,151 +3548,156 @@ } return false; }; -Xinha.viewportSize=function(_25a){ -_25a=(_25a)?_25a:window; +Xinha.viewportSize=function(_25f){ +_25f=(_25f)?_25f:window; var x,y; -if(_25a.innerHeight){ -x=_25a.innerWidth; -y=_25a.innerHeight; +if(_25f.innerHeight){ +x=_25f.innerWidth; +y=_25f.innerHeight; }else{ -if(_25a.document.documentElement&&_25a.document.documentElement.clientHeight){ -x=_25a.document.documentElement.clientWidth; -y=_25a.document.documentElement.clientHeight; +if(_25f.document.documentElement&&_25f.document.documentElement.clientHeight){ +x=_25f.document.documentElement.clientWidth; +y=_25f.document.documentElement.clientHeight; }else{ -if(_25a.document.body){ -x=_25a.document.body.clientWidth; -y=_25a.document.body.clientHeight; +if(_25f.document.body){ +x=_25f.document.body.clientWidth; +y=_25f.document.body.clientHeight; } } } return {"x":x,"y":y}; }; -Xinha.pageSize=function(_25c){ -_25c=(_25c)?_25c:window; +Xinha.pageSize=function(_261){ +_261=(_261)?_261:window; var x,y; -var _25e=_25c.document.body.scrollHeight; -var _25f=_25c.document.documentElement.scrollHeight; -if(_25e>_25f){ -x=_25c.document.body.scrollWidth; -y=_25c.document.body.scrollHeight; +var _263=_261.document.body.scrollHeight; +var _264=_261.document.documentElement.scrollHeight; +if(_263>_264){ +x=_261.document.body.scrollWidth; +y=_261.document.body.scrollHeight; }else{ -x=_25c.document.documentElement.scrollWidth; -y=_25c.document.documentElement.scrollHeight; +x=_261.document.documentElement.scrollWidth; +y=_261.document.documentElement.scrollHeight; } return {"x":x,"y":y}; }; -Xinha.prototype.scrollPos=function(_260){ -_260=(_260)?_260:window; +Xinha.prototype.scrollPos=function(_265){ +_265=(_265)?_265:window; var x,y; -if(_260.pageYOffset){ -x=_260.pageXOffset; -y=_260.pageYOffset; +if(_265.pageYOffset){ +x=_265.pageXOffset; +y=_265.pageYOffset; }else{ -if(_260.document.documentElement&&document.documentElement.scrollTop){ -x=_260.document.documentElement.scrollLeft; -y=_260.document.documentElement.scrollTop; +if(_265.document.documentElement&&document.documentElement.scrollTop){ +x=_265.document.documentElement.scrollLeft; +y=_265.document.documentElement.scrollTop; }else{ -if(_260.document.body){ -x=_260.document.body.scrollLeft; -y=_260.document.body.scrollTop; +if(_265.document.body){ +x=_265.document.body.scrollLeft; +y=_265.document.body.scrollTop; } } } return {"x":x,"y":y}; }; -Xinha.getElementTopLeft=function(_262){ -var _263=curtop=0; -if(_262.offsetParent){ -_263=_262.offsetLeft; -curtop=_262.offsetTop; -while(_262=_262.offsetParent){ -_263+=_262.offsetLeft; -curtop+=_262.offsetTop; +Xinha.getElementTopLeft=function(_267){ +var _268=curtop=0; +if(_267.offsetParent){ +_268=_267.offsetLeft; +curtop=_267.offsetTop; +while(_267=_267.offsetParent){ +_268+=_267.offsetLeft; +curtop+=_267.offsetTop; } } -return {top:curtop,left:_263}; +return {top:curtop,left:_268}; }; Xinha.findPosX=function(obj){ -var _265=0; +var _26a=0; if(obj.offsetParent){ return Xinha.getElementTopLeft(obj).left; }else{ if(obj.x){ -_265+=obj.x; +_26a+=obj.x; } } -return _265; +return _26a; }; Xinha.findPosY=function(obj){ -var _267=0; +var _26c=0; if(obj.offsetParent){ return Xinha.getElementTopLeft(obj).top; }else{ if(obj.y){ -_267+=obj.y; +_26c+=obj.y; } } -return _267; +return _26c; }; -Xinha.createLoadingMessages=function(_268){ +Xinha.createLoadingMessages=function(_26d){ if(Xinha.loadingMessages||!Xinha.isSupportedBrowser){ return; } Xinha.loadingMessages=[]; -for(var i=0;i<_268.length;i++){ -Xinha.loadingMessages.push(Xinha.createLoadingMessage(Xinha.getElementById("textarea",_268[i]))); +for(var i=0;i<_26d.length;i++){ +if(!document.getElementById(_26d[i])){ +continue; } +Xinha.loadingMessages.push(Xinha.createLoadingMessage(Xinha.getElementById("textarea",_26d[i]))); +} }; -Xinha.createLoadingMessage=function(_26a,text){ -if(document.getElementById("loading_"+_26a.id)||!Xinha.isSupportedBrowser){ +Xinha.createLoadingMessage=function(_26f,text){ +if(document.getElementById("loading_"+_26f.id)||!Xinha.isSupportedBrowser){ return; } -var _26c=document.createElement("div"); -_26c.id="loading_"+_26a.id; -_26c.className="loading"; -_26c.style.left=Xinha.findPosX(_26a)+"px"; -_26c.style.top=(Xinha.findPosY(_26a)+_26a.offsetHeight/2)-50+"px"; -_26c.style.width=_26a.offsetWidth+"px"; -var _26d=document.createElement("div"); -_26d.className="loading_main"; -_26d.id="loading_main_"+_26a.id; -_26d.appendChild(document.createTextNode(Xinha._lc("Loading in progress. Please wait!"))); -var _26e=document.createElement("div"); -_26e.className="loading_sub"; -_26e.id="loading_sub_"+_26a.id; -text=text?text:Xinha._lc("Constructing object"); -_26e.appendChild(document.createTextNode(text)); -_26c.appendChild(_26d); -_26c.appendChild(_26e); -document.body.appendChild(_26c); -Xinha.freeLater(_26c); -Xinha.freeLater(_26d); -Xinha.freeLater(_26e); -return _26e; +var _271=document.createElement("div"); +_271.id="loading_"+_26f.id; +_271.className="loading"; +_271.style.left=(Xinha.findPosX(_26f)+_26f.offsetWidth/2)-106+"px"; +_271.style.top=(Xinha.findPosY(_26f)+_26f.offsetHeight/2)-50+"px"; +var _272=document.createElement("div"); +_272.className="loading_main"; +_272.id="loading_main_"+_26f.id; +_272.appendChild(document.createTextNode(Xinha._lc("Loading in progress. Please wait!"))); +var _273=document.createElement("div"); +_273.className="loading_sub"; +_273.id="loading_sub_"+_26f.id; +text=text?text:Xinha._lc("Loading Core"); +_273.appendChild(document.createTextNode(text)); +_271.appendChild(_272); +_271.appendChild(_273); +document.body.appendChild(_271); +Xinha.freeLater(_271); +Xinha.freeLater(_272); +Xinha.freeLater(_273); +return _273; }; -Xinha.prototype.setLoadingMessage=function(_26f,_270){ +Xinha.prototype.setLoadingMessage=function(_274,_275){ if(!document.getElementById("loading_sub_"+this._textArea.id)){ return; } -document.getElementById("loading_main_"+this._textArea.id).innerHTML=_270?_270:Xinha._lc("Loading in progress. Please wait!"); -document.getElementById("loading_sub_"+this._textArea.id).innerHTML=_26f; +document.getElementById("loading_main_"+this._textArea.id).innerHTML=_275?_275:Xinha._lc("Loading in progress. Please wait!"); +document.getElementById("loading_sub_"+this._textArea.id).innerHTML=_274; }; -Xinha.setLoadingMessage=function(_271){ +Xinha.setLoadingMessage=function(_276){ if(!Xinha.loadingMessages){ return; } for(var i=0;i=9.1)||Xinha.ie_version>=5.5||Xinha.is_safari; +Xinha.loadPlugins=function(_1,_2){ +if(!Xinha.isSupportedBrowser){ +return; +} +Xinha.loadStyle(typeof _editor_css=="string"?_editor_css:"Xinha.css","XinhaCoreDesign"); +Xinha.createLoadingMessages(xinha_editors); +var _3=Xinha.loadingMessages; +Xinha._loadback(_editor_url+"XinhaCore.js",function(){ +Xinha.removeLoadingMessages(xinha_editors); +Xinha.createLoadingMessages(xinha_editors); +_2(); +}); +return false; +}; +Xinha._loadback=function(_4,_5,_6,_7){ +var T=!Xinha.is_ie?"onload":"onreadystatechange"; +var S=document.createElement("script"); +S.type="text/javascript"; +S.src=_4; +if(_5){ +S[T]=function(){ +if(Xinha.is_ie&&(!(/loaded|complete/.test(window.event.srcElement.readyState)))){ +return; +} +_5.call(_6?_6:this,_7); +S[T]=null; +}; +} +document.getElementsByTagName("head")[0].appendChild(S); +}; +Xinha.getElementTopLeft=function(_a){ +var _b=curtop=0; +if(_a.offsetParent){ +_b=_a.offsetLeft; +curtop=_a.offsetTop; +while(_a=_a.offsetParent){ +_b+=_a.offsetLeft; +curtop+=_a.offsetTop; +} +} +return {top:curtop,left:_b}; +}; +Xinha.findPosX=function(_c){ +var _d=0; +if(_c.offsetParent){ +return Xinha.getElementTopLeft(_c).left; +}else{ +if(_c.x){ +_d+=_c.x; +} +} +return _d; +}; +Xinha.findPosY=function(_e){ +var _f=0; +if(_e.offsetParent){ +return Xinha.getElementTopLeft(_e).top; +}else{ +if(_e.y){ +_f+=_e.y; +} +} +return _f; +}; +Xinha.createLoadingMessages=function(_10){ +if(Xinha.loadingMessages||!Xinha.isSupportedBrowser){ +return; +} +Xinha.loadingMessages=[]; +for(var i=0;i<_10.length;i++){ +if(!document.getElementById(_10[i])){ +continue; +} +Xinha.loadingMessages.push(Xinha.createLoadingMessage(document.getElementById(_10[i]))); +} +}; +Xinha.createLoadingMessage=function(_12,_13){ +if(document.getElementById("loading_"+_12.id)||!Xinha.isSupportedBrowser){ +return; +} +var _14=document.createElement("div"); +_14.id="loading_"+_12.id; +_14.className="loading"; +_14.style.left=(Xinha.findPosX(_12)+_12.offsetWidth/2)-106+"px"; +_14.style.top=(Xinha.findPosY(_12)+_12.offsetHeight/2)-50+"px"; +var _15=document.createElement("div"); +_15.className="loading_main"; +_15.id="loading_main_"+_12.id; +_15.appendChild(document.createTextNode(Xinha._lc("Loading in progress. Please wait!"))); +var _16=document.createElement("div"); +_16.className="loading_sub"; +_16.id="loading_sub_"+_12.id; +_13=_13?_13:Xinha._lc("Loading Core"); +_16.appendChild(document.createTextNode(_13)); +_14.appendChild(_15); +_14.appendChild(_16); +document.body.appendChild(_14); +return _16; +}; +Xinha.loadStyle=function(_17,id){ +var url=_editor_url||""; +url+=_17; +var _1a=document.getElementsByTagName("head")[0]; +var _1b=document.createElement("link"); +_1b.rel="stylesheet"; +_1b.href=url; +if(id){ +_1b.id=id; +} +_1a.appendChild(_1b); +}; +Xinha._lc=function(_1c){ +return _1c; +}; +Xinha._addEvent=function(el,_1e,_1f){ +if(document.addEventListener){ +el.addEventListener(_1e,_1f,true); +}else{ +el.attachEvent("on"+_1e,_1f); +} +}; +Xinha.addOnloadHandler=function(_20){ +var _21=function(){ +if(arguments.callee.done){ +return; +} +arguments.callee.done=true; +if(Xinha.onloadTimer){ +clearInterval(Xinha.onloadTimer); +} +_20.call(); +}; +if(Xinha.is_ie){ +document.write(""); +var _22=document.getElementById("__ie_onload"); +_22.onreadystatechange=function(){ +if(this.readyState=="loaded"){ +_21(); +} +}; +}else{ +if(/WebKit/i.test(navigator.userAgent)){ +Xinha.onloadTimer=setInterval(function(){ +if(/loaded|complete/.test(document.readyState)){ +_21(); +} +},10); +}else{ +document.addEventListener("DOMContentLoaded",_21,false); +} +} +}; + Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/XinhaLoader_readme.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/XinhaLoader_readme.txt,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/XinhaLoader_readme.txt 13 May 2008 18:53:44 -0000 1.1 @@ -0,0 +1,5 @@ +The XinhaLoader is a subset of Xinha only containing functions to fetch further files from the server and displaying a loading message. +It gives visual feedback to the user quite quickly so they don't have to watch the plain textarea and wonder if anything is happening. + +Usage in short: Follow the NewbieGuide, but load XinhaLoader.js instead of XinhaCore.js. +Make shure you define xinha_editors before calling Xinha.loadPlugins! This is different to earlier versions of the NewbieGuide (steps 1 and 2 reversed) \ No newline at end of file Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/functionsMozilla.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/functionsMozilla.js,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/functionsMozilla.js 13 Aug 2007 06:12:48 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/functionsMozilla.js 13 May 2008 18:53:44 -0000 1.3 @@ -336,7 +336,7 @@ * 5. Reinsert it just after the block element *

The quick

brown fox jumped over the lazy dog.

* - * Along the way, allow inserting blank paragraphs, which will look like


+ * Along the way, allow inserting blank paragraphs, which will look like


*/ Gecko.prototype.dom_checkInsertP = function() @@ -516,7 +516,7 @@ // Select the range (to set the insertion) // collapse to the start of the new block - // (remember the block might be


, so if we collapsed to the end the
would be noticable) + // (remember the block might be


, so if we collapsed to the end the
would be noticable) //range.selectNode(newblock.firstChild); //range.collapse(true); Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/htmlarea.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/htmlarea.js,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/htmlarea.js 24 Nov 2007 15:35:28 -0000 1.9 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/htmlarea.js 13 May 2008 18:53:44 -0000 1.10 @@ -1,23 +1,11 @@ - - /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- - -- COMPATABILITY FILE - -- htmlarea.js is now XinhaCore.js - -- - -- $HeadURL: http://svn.xinha.webfactional.com/trunk/htmlarea.js $ - -- $LastChangedDate: 2007-01-15 15:28:57 +0100 (Mo, 15 Jan 2007) $ - -- $LastChangedRevision: 659 $ - -- $LastChangedBy: gogo $ - --------------------------------------------------------------------------*/ - -if ( typeof _editor_url == "string" ) -{ - // Leave exactly one backslash at the end of _editor_url - _editor_url = _editor_url.replace(/\x2f*$/, '/'); +/* 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/htmlarea.js */ +if(typeof _editor_url=="string"){ +_editor_url=_editor_url.replace(/\x2f*$/,"/"); +}else{ +alert("WARNING: _editor_url is not set! You should set this variable to the editor files path; it should preferably be an absolute path, like in '/htmlarea/', but it can be relative if you prefer. Further we will try to load the editor files correctly but we'll probably fail."); +_editor_url=""; } -else -{ - alert("WARNING: _editor_url is not set! You should set this variable to the editor files path; it should preferably be an absolute path, like in '/htmlarea/', but it can be relative if you prefer. Further we will try to load the editor files correctly but we'll probably fail."); - _editor_url = ''; -} +document.write(""); -document.write(''); \ No newline at end of file Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/release-notes.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/release-notes.txt,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/release-notes.txt 24 Nov 2007 15:35:28 -0000 1.4 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/release-notes.txt 13 May 2008 18:53:44 -0000 1.5 @@ -4,7 +4,73 @@ http://xinha.org Release History +Xinha 0.95 +Bugs Fixed + * fixed #1040 htmlRemoveTags doesn't work in IE + * fixed #645 IE Save as function only saves the original html + * fixed #1136 FF3 Linux select boxes in toolbar are too small + * fixed #1100 Extended File Manager - Error after opening window + * fixed #1103 [TransformInnerHTML] IE breaks singlet attributes starting with "no" + * fixed #1086 Repeated javascript insertion in onclick attributes + * fixed #1094 IE throws error in Xinha.loadStyle function + * fixed #1117 IE returns javascript error -1072896658 + * fixed #993 PageStyle to override styles in PageStylesheets + * #1112 switching between modes leaves strange characters in source + * fixed #1128 loading fails when Fullscreen tried to load as plugin + * fixed #1126 Percent (%) in URL prevent stripSelfNamedAnchors from working + * fixed #1120 HTML select overlaps color picker in IE6 + * #1115 + #1127 fixed compatibility issues with Firefox 3 + * #961 + #1130 changed behaviour of xinha_config.baseHref + * fixed #645 Save as function only saves the original html + * fixed #1040 htmlRemoveTags doesn't work in IE + * fixed #1015 Mozilla shows scrollbars on click in Stylist + * #918 removed mozParaHandler dirty as it had been broken for a long time + * fixed #1015 Mozilla shows scrollbars on click in Stylist + * fixed #1148 HTML entities break when cursor is inside when switching from HTML to WYSIWYG + * fixed #1151 form action always made absolute + * fixed #1155 InsertAnchor broken in IE 7 + * fixed #1158 [ImageManager] in Japanese environment, an error occurs by reading of lang/ja.js in IE6/7 + * fixed #1152 Plugins using surroundHTML (EditTag, LangMarks) no longer work in IE7 + * fixed #1161 permission error from ColorPicker.js + * fixed #1181 [TableOperations] Table Options dialog first entry for border style faulty + * fixed #1185 [TableOperations] IE: style float broken + * fixed #1197 [Linker] IE shows bug in line 262 + * fixed #1200 [Linker] Dialog does not show if scanned folder empty + +Enhancements + * #1143 add Safari support + * #938 add Opera support + * #1138 added API functions Xinha.getEditor(), Xinha.prototype.getPluginInstance(), Xinha.addOnloadHandler() + * #1137 [Equation] FF3 fixes & improved way of avoiding formula changes in editor + * #1150 synchronize "Remove Format" between browsers + * added plugin PreserveScripts for enhanced editing of pages containing PHP and/or JavaScript () + * Loading message facelift + * added XinhaLoader.js for enhanced user experience through early loading message + * made Xinha.makeEditors accept a DOM reference to the textarea instead of the id as part of xinha_editors array (#1105) + * #1123 Allow return of PHP array from xinha_pass_to_php_backend + * [Linker] scan.php: Allow specification of base url to use (so that a subdirectory can be used as $dir and return appropriate urls to the files (prefixing the url + * [ExtendedFileManager] new Version + * #961 + #1130 changed behaviour of xinha_config.baseHref + * #1137 [Equation] improved way of avoiding formula changes in editor + * #442 removed alert "Your Document is not well formed..." + * #1119 disabled Firefox 2 spell check when ContextMenu is enabled + * added a plugin "GenericPlugin" as a democase for plugin event handlers + * #1171 [SmartReplace] now also replaces three dots with an ellipsis + * #1119 [ContextMenu] optionally switch of Firefox Spell check + * #1172 [LangMarks] make available languages configurable + * enhanced behaviour when xinha_config.baseHref is set to another server + * #1195 Allow to specify an external url to load a plugin from + * #1201 Add inwardHtml/outwardHtml functions to Config object + +I18n + * #1109 Spanish language extended + * #1116 [ExtendedFileManager] added French translation + * #853 updated Translation for farsi + * fixed wrong encoding in Spanish language file + * fixed no bold/italic/underline button images in Spanish + * #1194 [ExtendedFileManager] updated French translation + Xinha 0.94 * Ticket #1093 [InsertSmiley] remove smiley gifs from trunk * fixed Ticket #1019 Cusor not jumping to editable part of window when clicked in IE Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/contrib/compression_readme.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/contrib/compression_readme.txt,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/contrib/compression_readme.txt 2 Feb 2007 21:04:45 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/contrib/compression_readme.txt 13 May 2008 18:53:45 -0000 1.2 @@ -1,3 +1,4 @@ +You can use the compress.php to batch-convert the current Xinha snapshot. You can use the compress.bat to compress JavaScript files by drag&drop in Windows. Please be aware that the language files cannot be compressed. Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/contrib/php-xinha.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/contrib/php-xinha.php,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/contrib/php-xinha.php 2 Feb 2007 21:04:45 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/contrib/php-xinha.php 13 May 2008 18:53:45 -0000 1.2 @@ -23,7 +23,7 @@ * */ - function xinha_pass_to_php_backend($Data, $KeyLocation = 'Xinha:BackendKey') + function xinha_pass_to_php_backend($Data, $KeyLocation = 'Xinha:BackendKey', $ReturnPHP = FALSE) { $bk = array(); @@ -57,8 +57,14 @@ // wouldn't have worked. $backend_data[session_name()] = session_id(); - echo 'backend_data = ' . xinha_to_js($backend_data) . "; \n"; - + if($ReturnPHP) + { + return array('backend_data' => $backend_data); + } + else + { + echo 'backend_data = ' . xinha_to_js($backend_data) . "; \n"; + } } /** Convert PHP data structure to Javascript */ @@ -199,4 +205,4 @@ } return $val; } -?> \ No newline at end of file +?> Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/Extended.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/Extended.html,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/Extended.html 24 Nov 2007 15:35:28 -0000 1.4 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/Extended.html 13 May 2008 18:53:45 -0000 1.5 @@ -96,7 +96,10 @@ var pos = getAbsolutePos(bottom); body_height = pos.y + bottom.offsetHeight; } - window.dialogArguments = opener.Dialog._arguments; + if (!window.dialogArguments && opener.Dialog._arguments) + { + window.dialogArguments = opener.Dialog._arguments; + } if (!document.all) { window.sizeToContent(); window.sizeToContent(); // for reasons beyond understanding, Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ExtendedDemo.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ExtendedDemo.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ExtendedDemo.html 13 May 2008 18:53:45 -0000 1.1 @@ -0,0 +1,16 @@ + +Xinha Extended Example + + + + + + + Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/Newbie.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/Newbie.html,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/Newbie.html 24 Nov 2007 15:35:28 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/Newbie.html 13 May 2008 18:53:45 -0000 1.3 @@ -10,14 +10,14 @@ _editor_lang = "en"; // And the language we need to use in the editor. _editor_skin = "silva"; // If you want use skin, add the name here - +
- +
Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/XinhaConfig.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/XinhaConfig.js,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/XinhaConfig.js 24 Nov 2007 15:35:28 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/XinhaConfig.js 13 May 2008 18:53:45 -0000 1.3 @@ -1,11 +1,13 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ +/* 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/examples/XinhaConfig.js */ xinha_editors=null; xinha_init=null; xinha_config=null; xinha_plugins=null; xinha_init=xinha_init?xinha_init:function(){ xinha_editors=xinha_editors?xinha_editors:["myTextArea","anotherOne"]; -xinha_plugins=xinha_plugins?xinha_plugins:["CharacterMap","ContextMenu","ListType","Stylist","Linker","SuperClean","TableOperations"]; +xinha_plugins=xinha_plugins?xinha_plugins:["CharacterMap","ContextMenu","SmartReplace","Stylist","Linker","SuperClean","TableOperations"]; if(!Xinha.loadPlugins(xinha_plugins,xinha_init)){ return; } @@ -14,5 +16,5 @@ xinha_editors=Xinha.makeEditors(xinha_editors,xinha_config,xinha_plugins); Xinha.startEditors(xinha_editors); }; -Xinha._addEvent(window,"load",xinha_init); +Xinha.addOnloadHandler(xinha_init); Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/custom.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/custom.css,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/custom.css 24 Nov 2007 15:35:28 -0000 1.6 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/custom.css 13 May 2008 18:53:45 -0000 1.7 @@ -4,7 +4,7 @@ -- @TODO Make this CSS more useful. -- -- $HeadURL: http://svn.xinha.webfactional.com/trunk/examples/custom.css $ - -- $LastChangedDate: 2007-01-19 23:24:36 +0100 (Fr, 19 Jan 2007) $ + -- $LastChangedDate: 2007-01-20 11:24:36 +1300 (Sat, 20 Jan 2007) $ -- $LastChangedRevision: 677 $ -- $LastChangedBy: ray $ --------------------------------------------------------------------------*/ Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/dynamic.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/dynamic.css,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/dynamic.css 24 Nov 2007 15:35:28 -0000 1.6 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/dynamic.css 13 May 2008 18:53:45 -0000 1.7 @@ -4,7 +4,7 @@ -- @TODO Make this CSS more useful. -- -- $HeadURL: http://svn.xinha.webfactional.com/trunk/examples/dynamic.css $ - -- $LastChangedDate: 2007-01-19 23:24:36 +0100 (Fr, 19 Jan 2007) $ + -- $LastChangedDate: 2007-01-20 11:24:36 +1300 (Sat, 20 Jan 2007) $ -- $LastChangedRevision: 677 $ -- $LastChangedBy: ray $ --------------------------------------------------------------------------*/ Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-body.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-body.html,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-body.html 24 Nov 2007 15:35:28 -0000 1.7 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-body.html 13 May 2008 18:53:45 -0000 1.8 @@ -4,7 +4,7 @@ Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-menu.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-menu.php,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-menu.php 24 Nov 2007 15:35:28 -0000 1.7 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example-menu.php 13 May 2008 18:53:45 -0000 1.8 @@ -11,8 +11,8 @@ -- full_example-body.html, and full_example.js. -- -- $HeadURL: http://svn.xinha.webfactional.com/trunk/examples/ext_example-menu.php $ - -- $LastChangedDate: 2007-10-12 12:00:47 +0200 (Fr, 12 Okt 2007) $ - -- $LastChangedRevision: 901 $ + -- $LastChangedDate: 2008-01-10 10:10:59 +1300 (Thu, 10 Jan 2008) $ + -- $LastChangedRevision: 929 $ -- $LastChangedBy: ray $ ---------------------------------------------------------------------------> @@ -110,10 +110,18 @@ } function Dialog(url, action, init) { - if (typeof init == "undefined") { - init = window; // pass this window object by default - } - Dialog._geckoOpenModal(url, action, init); + if (typeof init == "undefined") { + init = window; // pass this window object by default + } + if (typeof window.showModalDialog == 'function') + { + Dialog._return = action; + var r = window.showModalDialog(url, init, "dialogheight=10;dialogheight=10;scroll=no;resizable=yes"); + } + else + { + Dialog._geckoOpenModal(url, action, init); + } }; Dialog._parentEvent = function(ev) { Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example.html,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example.html 24 Nov 2007 15:35:28 -0000 1.7 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/ext_example.html 13 May 2008 18:53:45 -0000 1.8 @@ -4,7 +4,7 @@ -- Xinha example frameset. -- -- $HeadURL: http://svn.xinha.webfactional.com/trunk/examples/ext_example.html $ - -- $LastChangedDate: 2007-06-03 14:11:44 +0200 (So, 03 Jun 2007) $ + -- $LastChangedDate: 2007-06-04 00:11:44 +1200 (Mon, 04 Jun 2007) $ -- $LastChangedRevision: 845 $ -- $LastChangedBy: gocher $ ---------------------------------------------------------------------------> Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/full_example.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/full_example.css,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/full_example.css 24 Nov 2007 15:35:28 -0000 1.6 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/full_example.css 13 May 2008 18:53:45 -0000 1.7 @@ -2,7 +2,7 @@ -- Xinha example CSS file. This is ripped from Trac ;) -- -- $HeadURL: http://svn.xinha.webfactional.com/trunk/examples/full_example.css $ - -- $LastChangedDate: 2007-01-19 23:24:36 +0100 (Fr, 19 Jan 2007) $ + -- $LastChangedDate: 2007-01-20 11:24:36 +1300 (Sat, 20 Jan 2007) $ -- $LastChangedRevision: 677 $ -- $LastChangedBy: ray $ --------------------------------------------------------------------------*/ Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/full_example.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/full_example.js,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/full_example.js 24 Nov 2007 15:35:28 -0000 1.5 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/full_example.js 13 May 2008 18:53:45 -0000 1.6 @@ -1,98 +1,155 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ -var num=1; -if(window.parent&&window.parent!=window){ -var f=window.parent.menu.document.forms[0]; -_editor_lang=f.lang[f.lang.selectedIndex].value; -_editor_skin=f.skin[f.skin.selectedIndex].value; -num=parseInt(f.num.value); -if(isNaN(num)){ -num=1; -f.num.value=1; -} -xinha_plugins=[]; -for(var x=0;x - - - -Simple example of Xinha - - - - - - - - - - - - - - -
- - - -
- - + + + + +Simple example of Xinha + + + + + + + + + +
+ +
+ \ No newline at end of file Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/stylist.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/stylist.css,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/stylist.css 24 Nov 2007 15:35:28 -0000 1.6 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/stylist.css 13 May 2008 18:53:45 -0000 1.7 @@ -3,7 +3,7 @@ -- when the Stylist plugin is included in an auto-generated example. -- -- $HeadURL: http://svn.xinha.webfactional.com/trunk/examples/stylist.css $ - -- $LastChangedDate: 2007-01-19 23:24:36 +0100 (Fr, 19 Jan 2007) $ + -- $LastChangedDate: 2007-01-20 11:24:36 +1300 (Sat, 20 Jan 2007) $ -- $LastChangedRevision: 677 $ -- $LastChangedBy: ray $ --------------------------------------------------------------------------*/ Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/testbed.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/testbed.html,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/testbed.html 24 Nov 2007 15:35:28 -0000 1.6 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/examples/testbed.html 13 May 2008 18:53:45 -0000 1.7 @@ -13,10 +13,10 @@ -- of the file to remove the auto-example-generating code and allow for the -- use of the file as a boilerplate. -- - -- $HeadURL: http://svn.xinha.webfactional.com/trunk/examples/testbed.html $ - -- $LastChangedDate: 2007-10-10 19:36:21 +0200 (Mi, 10 Okt 2007) $ - -- $LastChangedRevision: 897 $ - -- $LastChangedBy: ray $ + -- $HeadURL:http://svn.xinha.webfactional.com/trunk/examples/testbed.html $ + -- $LastChangedDate:2008-04-12 14:39:04 +0200 (Sa, 12 Apr 2008) $ + -- $LastChangedRevision:987 $ + -- $LastChangedBy:ray $ ---------------------------------------------------------------------------> @@ -152,8 +152,8 @@ li { color:red; } </style> </head> - <body> - <img src="http://xinha.python-hosting.com/trac/logo.jpg" usemap="#m1"> + <body><span style="color:purple"> + <img src="../images/xinha_logo.gif" usemap="#m1"> <map name="m1"> <area shape="rect" coords="137,101,255,124" href="http://www.mydomain.com"> </map> @@ -162,21 +162,21 @@ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis velit semper dolor. Donec gravida tincidunt mi. Curabitur tristique - ante elementum turpis. Aliquam nisl. Nulla posuere neque non - tellus. Morbi vel nibh. Cum sociis natoque penatibus et magnis dis + ante elementum turpis. <span style="color:green">Aliquam </span> nisl. Nulla posuere neque non + tellus. Morbi vel nibh. <font face="Arial"><font color="#009933">Cum sociis natoque</font></font> penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam nec wisi. In wisi. Curabitur pharetra bibendum lectus. </p> <ul> - <li> Phasellus et massa sed diam viverra semper. </li> + <li style="color:green"> Phasellus et massa sed diam viverra semper. </li> <li> Mauris tincidunt felis in odio. </li> <li> Nulla placerat nunc ut pede. </li> <li> Vivamus ultrices mi sit amet urna. </li> <li> Quisque sed augue quis nunc laoreet volutpat.</li> <li> Nunc sit amet metus in tortor semper mattis. </li> </ul> - </body> + </span></body> </html> Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/lang/es.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/lang/es.js,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/lang/es.js 24 Nov 2007 15:35:28 -0000 1.4 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/lang/es.js 13 May 2008 18:53:45 -0000 1.5 @@ -1,40 +1,167 @@ // I18N constants - -// LANG: "es", ENCODING: UTF-8 - +// LANG: "de", ENCODING: UTF-8 { "Bold": "Negrita", "Italic": "Cursiva", "Underline": "Subrayado", "Strikethrough": "Tachado", - "Subscript": "Sub?ndice", - "Superscript": "Super?ndice", - "Justify Left": "Alinear a la Izquierda", - "Justify Center": "Centrar", - "Justify Right": "Alinear a la Derecha", + "Subscript": "Subíndice", + "Superscript": "Superíndice", + "Justify Left": "Alinear a la izquierda", + "Justify Center": "Alinear al centro", + "Justify Right": "Alinear a la derecha", "Justify Full": "Justificar", - "Ordered List": "Lista Ordenada", - "Bulleted List": "Lista No Ordenada", - "Decrease Indent": "Aumentar Sangr?a", - "Increase Indent": "Disminuir Sangr?a", - "Font Color": "Color del Texto", - "Background Color": "Color del Fondo", - "Horizontal Rule": "L?nea Horizontal", - "Insert Web Link": "Insertar Enlace", - "Insert/Modify Image": "Insertar Imagen", - "Insert Table": "Insertar Tabla", - "Toggle HTML Source": "Ver Documento en HTML", - "Enlarge Editor": "Ampliar Editor", - "About this editor": "Acerca del Editor", + "Ordered List": "Lista numerada", + "Bulleted List": "Lista no numerada", + "Decrease Indent": "Reducir sangría", + "Increase Indent": "Aumentar sangría", + "Font Color": "Color de la fuente", + "Background Color": "Color de fondo", + "Horizontal Rule": "Regla horizontal", + "Insert Web Link": "Insertar enlace web", + "Insert/Modify Image": "Insertar/modificar imagen", + "Insert Table": "Insertar una tabla", + "Toggle HTML Source": "Ver HTML", + "Enlarge Editor": "Editor a pantalla completa", + "About this editor": "Sobre este Editor", "Help using editor": "Ayuda", - "Current style": "Estilo Actual", + "Current style": "Estilo actual", "Undoes your last action": "Deshacer", "Redoes your last action": "Rehacer", - "Cut selection": "Cortar selecci?n", - "Copy selection": "Copiar selecci?n", + "Cut selection": "Cortar", + "Copy selection": "Copiar", "Paste from clipboard": "Pegar desde el portapapeles", + "Direction left to right": "Dirección de izquierda a derecha", + "Direction right to left": "Dirección de derecha a izquierda", + "Remove formatting": "Borrar formato", + "Select all": "Seleccionar todo", + "Print document": "Imprimir documento", + "Clear MSOffice tags": "Borrar etiquetas de MSOffice", + "Clear Inline Font Specifications": "Borrar las etiquetas de fuente", + "Would you like to clear font typefaces?": "¿Desea eliminar las definiciaones de tipo de fuente?", + "Would you like to clear font sizes?": "¿Desea eliminar las definiciones de tamaño de fuente?", + "Would you like to clear font colours?": "¿Desea eliminar las definiciones de color de fuente?", + "Split Block": "Dividir el bloque", + "Toggle Borders": "Añadir/Quitar bordes", + "Save as": "Guardar como", + "Insert/Overwrite": "Insertar/Sobreescribir", + "— format —": "— formato —", + "— font —": "— fuente —", + "— size —": "— tamaño —", + "Heading 1": "Cabecera 1", + "Heading 2": "Cabecera 2", + "Heading 3": "Cabecera 3", + "Heading 4": "Cabecera 4", + "Heading 5": "Cabecera 5", + "Heading 6": "Cabecera 6", + "Normal": "Normal", + "Address": "Dirección", + "Formatted": "Formateado", + + //dialogs "OK": "Aceptar", "Cancel": "Cancelar", "Path": "Ruta", - "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Esta en modo TEXTO. Use el boton [<>] para cambiar a WYSIWIG" -} + "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.": "Se encuentra en MODO TEXTO. Use el botón [<>] para cambiar de nuevo al modo WYSIWYG", + "The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.": "El botón de pegar no funciona en los navegadores de Mozilla por motivos de seguridad. Presione CTRL-V en su teclado para pegarlo directamente", + + "You need to select some text before create a link": "Necesita seleccionar algún texto antes de crear un link", + "Your Document is not well formed. Check JavaScript console for details.": "Su documento no está bien formado. Compruebe la consola de JavaScript para obtener más detalles", + + "Alignment:": "Alineación:", + "Not set": "No definido", + "Left": "Izquierda", + "Right": "Derecha", + "Texttop": "Texto Superior", + "Absmiddle": "Medio Absoluto", + "Baseline": "Línea base", + "Absbottom": "Inferior absoluto", + "Bottom": "Inferior", + "Middle": "Medio", + "Top": "Superior", + + "Layout": "Distribución", + "Spacing": "Espaciado", + "Horizontal:": "horizontal:", + "Horizontal padding": "Relleno horizontal", + "Vertical:": "Vertical:", + "Vertical padding": "Relleno Vertical", + "Border thickness:": "Tamaño del borde:", + "Leave empty for no border": "Vacío si no desea ningún borde", + + //Insert Link + "Insert/Modify Link": "Insertar/Modificar un enlace", + "None (use implicit)": "Vacío ( usar implícito )", + "New window (_blank)": "Nueva ventana (_blank)", + "Same frame (_self)": "Mismo marco (_self)", + "Top frame (_top)": "Marco superior (_top)", + "Other": "Otro", + "Target:": "Destino:", + "Title (tooltip):": "Título (Tooltip):", + "URL:": "URL:", + "You must enter the URL where this link points to": "Debe introducir la URL a donde apunta este enlace", + + // Insert Table + "Insert Table": "Añadir una tabla", + "Rows:": "Filas:", + "Number of rows": "Número de filas", + "Cols:": "Columnas:", + "Number of columns": "Número de columnas", + "Width:": "Ancho:", + "Width of the table": "Ancho de la tabla", + "Percent": "Porcentaje", + "Pixels": "Pixels", + "Em": "Em", + "Width unit": "Unidad de anchura", + "Fixed width columns": "Columnas de ancho fijo", + "Positioning of this table": "Posición de esta tabla", + "Cell spacing:": "Espaciado entre celdas:", + "Space between adjacent cells": "Espaciado entre celdas adyacentes", + "Cell padding:": "Relleno de celdas:", + "Space between content and border in cell": "Escapcio entre el contenido y el borde de la celda", + "You must enter a number of rows": "Debe introducir un número de filas", + "You must enter a number of columns": "Debe introducir un número de columnas", + + // Insert Image + "Insert Image": "Insertar una imagen", + "Image URL:": "Imagen URL:", + "Enter the image URL here": "", + "Preview": "Previsualizar", + "Preview the image in a new window": "Previsualizar en una nueva ventana", + "Alternate text:": "Texto alternativo:", + "For browsers that don't support images": "Para navegadores que no soportan imágenes", + "Positioning of this image": "Posición de la imagen", + "Image Preview:": "Previsualización de la imagen:", + "You must enter the URL": "Debe introducir la URL", + + // Editor Help + "Keyboard shortcuts": "Atajos de teclado", + "The editor provides the following key combinations:": "El editor proporciona las siguientes combinaciones:", + "new paragraph": "Nuevo parrafo", + "insert linebreak": "Insertar salto de línea", + "Set format to paragraph": "EStablecer el formato a parrafo", + "Clean content pasted from Word": "Limpiar el contenido pegado desde Word", + "Headings": "Cabeceras", + "Close": "Cerrar", + + // Loading messages + "Loading in progress. Please wait!": "Carga en proceso. Por favor espere.", + "Loading plugin $plugin" : "Cargando el plugin $plugin", + "Register plugin $plugin" : "Registro de plugin $plugin", + "Constructing object": "Construyendo objeto", + "Generate Xinha framework": "Generar Xinha framework", + "Init editor size":"Iniciar el tamaño del editor", + "Create Toolbar": "Crear barra de herramientas", + "Create Statusbar" : "Crear barra de estado", + "Register right panel" : "Registrar panel derecho", + "Register left panel" : "Registrar panel izquierdo", + "Register bottom panel" : "Registar panel inferior", + "Register top panel" : "Registar panel superior", + "Finishing" : "Finalizando", + + // ColorPicker + "Click a color..." : "Seleccione un color...", + "Sample" : "Muestra", + "Web Safe: " : "Color web: ", + "Color: " : "Color: " +} \ No newline at end of file Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/lang/fa.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/lang/fa.js,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/lang/fa.js 2 Feb 2007 21:04:45 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/lang/fa.js 13 May 2008 18:53:45 -0000 1.2 @@ -1,4 +1,4 @@ -// I18N constants +// I18N constants // LANG: "fa", ENCODING: UTF-8 { "Bold": "ضخیم", @@ -132,9 +132,11 @@ "You must enter the URL": "شما باید URL را وارد کنید", // toolbar + /* "button_bold": "fr/bold.gif", "button_underline": "fr/underline.gif", "button_strikethrough": "fr/strikethrough.gif", + */ // Editor Help "Xinha Help": "راهنمای Xinha", Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/ColorPicker/ColorPicker.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/ColorPicker/ColorPicker.js,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/ColorPicker/ColorPicker.js 24 Nov 2007 15:35:29 -0000 1.4 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/ColorPicker/ColorPicker.js 13 May 2008 18:53:45 -0000 1.5 @@ -1,17 +1,24 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ -ColorPicker._pluginInfo={name:"colorPicker",version:"1.0",developer:"James Sleeman",developer_url:"http://www.gogo.co.nz/",c_owner:"Gogo Internet Services",license:"htmlArea",sponsor:"Gogo Internet Services",sponsor_url:"http://www.gogo.co.nz/"}; +/* 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/modules/ColorPicker/ColorPicker.js */ +ColorPicker._pluginInfo={name:"colorPicker",version:"$LastChangedRevision:998 $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),developer:"James Sleeman",developer_url:"http://www.gogo.co.nz/",c_owner:"Gogo Internet Services",license:"htmlArea",sponsor:"Gogo Internet Services",sponsor_url:"http://www.gogo.co.nz/"}; function ColorPicker(){ } +try{ if(window.opener&&window.opener.Xinha){ var openerColorPicker=window.opener.Xinha.colorPicker; Xinha._addEvent(window,"unload",function(){ Xinha.colorPicker=openerColorPicker; }); } +} +catch(e){ +} Xinha.colorPicker=function(_1){ if(Xinha.colorPicker.savedColors.length===0){ Xinha.colorPicker.loadColors(); } +this.is_ie_6=(Xinha.is_ie&&Xinha.ie_version<7); var _2=this; var _3=false; var _4=false; @@ -218,6 +225,10 @@ }else{ this.table.style.left=_24+"px"; } +if(this.is_ie_6){ +this.iframe.style.top=this.table.style.top; +this.iframe.style.left=this.table.style.left; +} }; function pickCell(_26){ _2.chosenColor.value=_26.colorCode; @@ -463,7 +474,7 @@ var _3c=document.createElement("div"); _3c.style.clear="both"; function createSavedColors(_3d){ -var _3e=false; +var _3e=Xinha.is_ie; var div=document.createElement("div"); div.style.width=_2b.cellsize+"px"; div.style.height=_2b.cellsize+"px"; @@ -489,6 +500,18 @@ td.appendChild(_3c); this.tbody.appendChild(tr); document.body.appendChild(this.table); +if(this.is_ie_6){ +if(!this.iframe){ +this.iframe=document.createElement("iframe"); +this.iframe.frameBorder=0; +this.iframe.src="javascript:;"; +this.iframe.style.position="absolute"; +this.iframe.style.width=this.table.offsetWidth; +this.iframe.style.height=this.table.offsetHeight; +document.body.insertBefore(this.iframe,this.table); +} +this.iframe.style.display=""; +} }else{ for(var row=0;row(.*?)<\/l10n>/ig, - function(fullString,translate) - { - return dialog._lc(translate) ; - } - ).replace(/="_\((.*?)\)"/g, - function(fullString, translate) - { - return '="' + dialog._lc(translate) + '"'; - } - ); - - this.rootElem.innerHTML = html; +/* 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/modules/Dialogs/panel-dialog.js */ +Xinha.PanelDialog=function(_1,_2,_3,_4){ +this.id={}; +this.r_id={}; +this.editor=_1; +this.document=document; +this.rootElem=_1.addPanel(_2); +var _5=this; +if(typeof _4=="function"){ +this._lc=_4; +}else{ +if(_4){ +this._lc=function(_6){ +return Xinha._lc(_6,_4); }; - -Xinha.PanelDialog.prototype.show = function(values) -{ - this.setValues(values); - this.editor.showPanel(this.rootElem); +}else{ +this._lc=function(_7){ +return _7; }; - -Xinha.PanelDialog.prototype.hide = function() -{ - this.editor.hidePanel(this.rootElem); - return this.getValues(); +} +} +_3=_3.replace(/\[([a-z0-9_]+)\]/ig,function(_8,id){ +if(typeof _5.id[id]=="undefined"){ +_5.id[id]=Xinha.uniq("Dialog"); +_5.r_id[_5.id[id]]=id; +} +return _5.id[id]; +}).replace(/(.*?)<\/l10n>/ig,function(_a,_b){ +return _5._lc(_b); +}).replace(/="_\((.*?)\)"/g,function(_c,_d){ +return "=\""+_5._lc(_d)+"\""; +}); +this.rootElem.innerHTML=_3; }; +Xinha.PanelDialog.prototype.show=function(_e){ +this.setValues(_e); +this.editor.showPanel(this.rootElem); +}; +Xinha.PanelDialog.prototype.hide=function(){ +this.editor.hidePanel(this.rootElem); +return this.getValues(); +}; +Xinha.PanelDialog.prototype.onresize=Xinha.Dialog.prototype.onresize; +Xinha.PanelDialog.prototype.toggle=Xinha.Dialog.prototype.toggle; +Xinha.PanelDialog.prototype.setValues=Xinha.Dialog.prototype.setValues; +Xinha.PanelDialog.prototype.getValues=Xinha.Dialog.prototype.getValues; +Xinha.PanelDialog.prototype.getElementById=Xinha.Dialog.prototype.getElementById; +Xinha.PanelDialog.prototype.getElementsByName=Xinha.Dialog.prototype.getElementsByName; -Xinha.PanelDialog.prototype.onresize = Xinha.Dialog.prototype.onresize; - -Xinha.PanelDialog.prototype.toggle = Xinha.Dialog.prototype.toggle; - -Xinha.PanelDialog.prototype.setValues = Xinha.Dialog.prototype.setValues; - -Xinha.PanelDialog.prototype.getValues = Xinha.Dialog.prototype.getValues; - -Xinha.PanelDialog.prototype.getElementById = Xinha.Dialog.prototype.getElementById; - -Xinha.PanelDialog.prototype.getElementsByName = Xinha.Dialog.prototype.getElementsByName; \ No newline at end of file Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Dialogs/popupwin.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Dialogs/popupwin.js,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Dialogs/popupwin.js 24 Nov 2007 15:35:29 -0000 1.4 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Dialogs/popupwin.js 13 May 2008 18:53:45 -0000 1.5 @@ -1,4 +1,6 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ +/* 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/modules/Dialogs/popupwin.js */ function PopupWin(_1,_2,_3,_4){ this.editor=_1; this.handler=_3; Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/FullScreen/full-screen.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/FullScreen/full-screen.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/FullScreen/full-screen.js 24 Nov 2007 15:35:29 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/FullScreen/full-screen.js 13 May 2008 18:53:45 -0000 1.4 @@ -1,4 +1,6 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ +/* 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/modules/FullScreen/full-screen.js */ function FullScreen(_1,_2){ this.editor=_1; _1._superclean_on=false; @@ -112,7 +114,7 @@ this._htmlArea.style.zIndex=999; this._htmlArea.style.left=e.config.fullScreenMargins[3]+"px"; this._htmlArea.style.top=e.config.fullScreenMargins[0]+"px"; -if(!Xinha.is_ie){ +if(!Xinha.is_ie&&!Xinha.is_webkit){ this._htmlArea.style.border="none"; } this._isFullScreen=true; Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Gecko/Gecko.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Gecko/Gecko.js,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Gecko/Gecko.js 24 Nov 2007 15:35:30 -0000 1.4 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Gecko/Gecko.js 13 May 2008 18:53:45 -0000 1.5 @@ -1,5 +1,7 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ -Gecko._pluginInfo={name:"Gecko",origin:"Xinha Core",version:"$LastChangedRevision: 901 $".replace(/^[^:]*: (.*) \$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL: http://svn.xinha.webfactional.com/trunk/modules/Gecko/Gecko.js $".replace(/^[^:]*: (.*) \$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"}; +/* 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/modules/Gecko/Gecko.js */ +Gecko._pluginInfo={name:"Gecko",origin:"Xinha Core",version:"$LastChangedRevision:998 $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL:http://svn.xinha.webfactional.com/trunk/modules/Gecko/Gecko.js $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"}; function Gecko(_1){ this.editor=_1; _1.Gecko=this; @@ -187,48 +189,77 @@ case "paste": alert(Xinha._lc("The Paste button does not work in Mozilla based web browsers (technical security reasons). Press CTRL-V on your keyboard to paste directly.")); return true; +break; +case "removeformat": +var _2a=this.editor; +var sel=_2a.getSelection(); +var _2c=_2a.saveSelection(sel); +var _2d=_2a.createRange(sel); +var els=_2a._doc.body.getElementsByTagName("*"); +var _2f=(_2d.startContainer.nodeType==1)?_2d.startContainer:_2d.startContainer.parentNode; +var i,el; +if(sel.isCollapsed){ +_2d.selectNodeContents(_2a._doc.body); } +for(i=0;i/)){ -var _51=_50.indexOf(">")+1; -ta.value=_4f+_50.substring(0,_51)+cc+_50.substring(_51,_50.length); +var _55=ta.selectionStart; +var _56=ta.value.substring(0,_55); +var _57=ta.value.substring(_55,ta.value.length); +if(_57.match(/^[^<]*>/)){ +var _58=_57.indexOf(">")+1; +ta.value=_56+_57.substring(0,_58)+cc+_57.substring(_58,_57.length); }else{ -ta.value=_4f+cc+_50; +ta.value=_56+cc+_57; } +ta.value=ta.value.replace(new RegExp("(&[^"+cc+"]*?)("+cc+")([^"+cc+"]*?;)"),"$1$3$2"); ta.value=ta.value.replace(new RegExp("(]*>[^"+cc+"]*?)("+cc+")([^"+cc+"]*?)"),"$1$3$2"); ta.value=ta.value.replace(new RegExp("^([^"+cc+"]*)("+cc+")([^"+cc+"]*]*>)(.*?)"),"$1$3$2$4"); }else{ var sel=this.getSelection(); -sel.getRangeAt(0).insertNode(document.createTextNode(cc)); +sel.getRangeAt(0).insertNode(this._doc.createTextNode(cc)); } } catch(e){ } }; -Xinha.prototype.findCC=function(_53){ -try{ -var _54=(_53=="textarea")?window:this._iframe.contentWindow; -if(_54.find(this.cc)){ -if(_53=="textarea"){ +Xinha.prototype.findCC=function(_5a){ +if(_5a=="textarea"){ var ta=this._textArea; -var _56=pos=ta.selectionStart; -var end=ta.selectionEnd; -var _58=ta.scrollTop; -ta.value=ta.value.substring(0,_56)+ta.value.substring(end,ta.value.length); -ta.selectionStart=pos; -ta.selectionEnd=pos; -ta.scrollTop=_58; +var pos=ta.value.indexOf(this.cc); +if(pos==-1){ +return; +} +var end=pos+this.cc.length; +var _5e=ta.value.substring(0,pos); +var _5f=ta.value.substring(end,ta.value.length); +ta.value=_5e; +ta.scrollTop=ta.scrollHeight; +var _60=ta.scrollTop; +ta.value+=_5f; +ta.setSelectionRange(pos,pos); ta.focus(); +ta.scrollTop=_60; }else{ -var sel=this.getSelection(); -sel.getRangeAt(0).deleteContents(); +try{ +var doc=this._doc; +doc.body.innerHTML=doc.body.innerHTML.replace(new RegExp(this.cc),""); +var _62=doc.getElementById("XinhaEditingPostion"); +this.selectNodeContents(_62); +_62.scrollIntoView(true); +_62.parentNode.removeChild(_62); this._iframe.contentWindow.focus(); } -} -} catch(e){ } +} }; Xinha.prototype._standardToggleBorders=Xinha.prototype._toggleBorders; Xinha.prototype._toggleBorders=function(){ -var _5a=this._standardToggleBorders(); -var _5b=this._doc.getElementsByTagName("TABLE"); -for(var i=0;i<_5b.length;i++){ -_5b[i].style.display="none"; -_5b[i].style.display="table"; +var _63=this._standardToggleBorders(); +var _64=this._doc.getElementsByTagName("TABLE"); +for(var i=0;i<_64.length;i++){ +_64[i].style.display="none"; +_64[i].style.display="table"; } -return _5a; +return _63; }; Xinha.getDoctype=function(doc){ var d=""; Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Gecko/paraHandlerBest.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Gecko/paraHandlerBest.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Gecko/paraHandlerBest.js 24 Nov 2007 15:35:30 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Gecko/paraHandlerBest.js 13 May 2008 18:53:45 -0000 1.4 @@ -1,4 +1,6 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ +/* 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/modules/Gecko/paraHandlerBest.js */ EnterParagraphs._pluginInfo={name:"EnterParagraphs",version:"1.0",developer:"Adam Wright",developer_url:"http://www.hipikat.org/",sponsor:"The University of Western Australia",sponsor_url:"http://www.uwa.edu.au/",license:"htmlArea"}; EnterParagraphs.prototype._whiteSpace=/^\s*$/; EnterParagraphs.prototype._pExclusions=/^(address|blockquote|body|dd|div|dl|dt|fieldset|form|h1|h2|h3|h4|h5|h6|hr|li|noscript|ol|p|pre|table|ul)$/i; Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Gecko/paraHandlerDirty.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Gecko/paraHandlerDirty.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Gecko/paraHandlerDirty.js 24 Nov 2007 15:35:30 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Gecko/paraHandlerDirty.js 13 May 2008 18:53:45 -0000 1.4 @@ -1,117 +1,257 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ -EnterParagraphs._pluginInfo={name:"EnterParagraphs",origin:"Xinha Core",version:"$LastChangedRevision: 688 $".replace(/^[^:]*: (.*) \$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL: http://svn.xinha.python-hosting.com/trunk/modules/Gecko/paraHandlerDirty.js $".replace(/^[^:]*: (.*) \$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"}; -function EnterParagraphs(_1){ -this.editor=_1; -} -EnterParagraphs.prototype.onKeyPress=function(ev){ -if(ev.keyCode==13&&!ev.shiftKey){ -this.dom_checkInsertP(); -Xinha._stopEvent(ev); -} + + /*--------------------------------------:noTabs=true:tabSize=2:indentSize=2:-- + -- Xinha (is not htmlArea) - http://xinha.gogo.co.nz/ + -- + -- Use of Xinha is granted by the terms of the htmlArea License (based on + -- BSD license) please read license.txt in this package for details. + -- + -- Xinha was originally based on work by Mihai Bazon which is: + -- Copyright (c) 2003-2004 dynarch.com. + -- Copyright (c) 2002-2003 interactivetools.com, inc. + -- This copyright notice MUST stay intact for use. + -- + -- This is the standard implementation of the Xinha.prototype._insertImage method, + -- which provides the functionality to insert an image in the editor. + -- + -- The file is loaded by the Xinha Core when no alternative method (plugin) is loaded. + -- + -- + -- $HeadURL: http://svn.xinha.python-hosting.com/trunk/modules/Gecko/paraHandlerDirty.js $ + -- $LastChangedDate: 2007-01-23 09:22:22 +1300 (Tue, 23 Jan 2007) $ + -- $LastChangedRevision: 688 $ + -- $LastChangedBy: ray $ + --------------------------------------------------------------------------*/ +EnterParagraphs._pluginInfo = { + name : "EnterParagraphs", + origin : "Xinha Core", + version : "$LastChangedRevision: 688 $".replace(/^[^:]*: (.*) \$$/, '$1'), + developer : "The Xinha Core Developer Team", + developer_url : "$HeadURL: http://svn.xinha.python-hosting.com/trunk/modules/Gecko/paraHandlerDirty.js $".replace(/^[^:]*: (.*) \$$/, '$1'), + sponsor : "", + sponsor_url : "", + license : "htmlArea" }; -EnterParagraphs.prototype.dom_checkInsertP=function(){ -var _3=this.editor; -var p,body; -var _5=_3.getSelection(); -var _6=_3.createRange(_5); -if(!_6.collapsed){ -_6.deleteContents(); + +function EnterParagraphs(editor) { + this.editor = editor; +} + +EnterParagraphs.prototype.onKeyPress = function (ev) +{ + if( ev.keyCode == 13 && !ev.shiftKey ) + { + this.dom_checkInsertP(); + Xinha._stopEvent(ev); + } } -_3.deactivateEditor(); -var SC=_6.startContainer; -var SO=_6.startOffset; -var EC=_6.endContainer; -var EO=_6.endOffset; -if(SC==EC&&SC==body&&!SO&&!EO){ -p=_3._doc.createTextNode(" "); -body.insertBefore(p,body.firstChild); -_6.selectNodeContents(p); -SC=_6.startContainer; -SO=_6.startOffset; -EC=_6.endContainer; -EO=_6.endOffset; -} -p=_3.getAllAncestors(); -var _b=null; -body=_3._doc.body; -for(var i=0;i1){ -var nb=_3._doc.createElement("p"); -while(df.firstChild){ -var s=df.firstChild; -df.removeChild(s); -nb.appendChild(s); -} -df.appendChild(nb); -} -if(!(/\S/.test(_b.innerHTML))){ -_b.innerHTML=" "; -} -p=df.firstChild; -if(!(/\S/.test(p.innerHTML))){ -p.innerHTML="
"; -} -if((/^\s*\s*$/.test(p.innerHTML))&&(/^h[1-6]$/i.test(p.tagName))){ -df.appendChild(_3.convertNode(p,"p")); -df.removeChild(p); -} -var _14=_b.parentNode.insertBefore(df.firstChild,_b.nextSibling); -_3.activateEditor(); -_5=_3.getSelection(); -_5.removeAllRanges(); -_5.collapse(_14,0); -_3.scrollToElement(_14); -}; +/** The idea here is + * 1. See if we are in a block element + * 2. If we are not, then wrap the current "block" of text into a paragraph + * 3. Now that we have a block element, select all the text between the insertion point + * and just AFTER the end of the block + * eg

The quick |brown fox jumped over the lazy dog.

| + * --------------------------------------- + * 4. Extract that from the document, making + *

The quick

+ * and a document fragment with + *

brown fox jumped over the lazy dog.

+ * 5. Reinsert it just after the block element + *

The quick

brown fox jumped over the lazy dog.

+ * + * Along the way, allow inserting blank paragraphs, which will look like


+ */ +EnterParagraphs.prototype.dom_checkInsertP = function() +{ + var editor = this.editor; + var p, body; + // Get the insertion point, we'll scrub any highlighted text the user wants rid of while we are there. + var sel = editor.getSelection(); + var range = editor.createRange(sel); + if ( !range.collapsed ) + { + range.deleteContents(); + } + editor.deactivateEditor(); + //sel.removeAllRanges(); + //sel.addRange(range); + + var SC = range.startContainer; + var SO = range.startOffset; + var EC = range.endContainer; + var EO = range.endOffset; + + // If the insertion point is character 0 of the + // document, then insert a space character that we will wrap into a paragraph + // in a bit. + if ( SC == EC && SC == body && !SO && !EO ) + { + p = editor._doc.createTextNode(" "); + body.insertBefore(p, body.firstChild); + range.selectNodeContents(p); + SC = range.startContainer; + SO = range.startOffset; + EC = range.endContainer; + EO = range.endOffset; + } + + // See if we are in a block element, if so, great. + p = editor.getAllAncestors(); + + var block = null; + body = editor._doc.body; + for ( var i = 0; i < p.length; ++i ) + { + if ( Xinha.isParaContainer(p[i]) ) + { + break; + } + else if ( Xinha.isBlockElement(p[i]) && ! ( /body|html/i.test(p[i].tagName) ) ) + { + block = p[i]; + break; + } + } + + // If not in a block element, we'll have to turn some stuff into a paragraph + if ( !block ) + { + // We want to wrap as much stuff as possible into the paragraph in both directions + // from the insertion point. We start with the start container and walk back up to the + // node just before any of the paragraph containers. + var wrap = range.startContainer; + while ( wrap.parentNode && !Xinha.isParaContainer(wrap.parentNode) ) + { + wrap = wrap.parentNode; + } + var start = wrap; + var end = wrap; + + // Now we walk up the sibling list until we hit the top of the document + // or an element that we shouldn't put in a p (eg other p, div, ul, ol, table) + while ( start.previousSibling ) + { + if ( start.previousSibling.tagName ) + { + if ( !Xinha.isBlockElement(start.previousSibling) ) + { + start = start.previousSibling; + } + else + { + break; + } + } + else + { + start = start.previousSibling; + } + } + + // Same down the list + while ( end.nextSibling ) + { + if ( end.nextSibling.tagName ) + { + if ( !Xinha.isBlockElement(end.nextSibling) ) + { + end = end.nextSibling; + } + else + { + break; + } + } + else + { + end = end.nextSibling; + } + } + + // Select the entire block + range.setStartBefore(start); + range.setEndAfter(end); + + // Make it a paragraph + range.surroundContents(editor._doc.createElement('p')); + + // Which becomes the block element + block = range.startContainer.firstChild; + + // And finally reset the insertion point to where it was originally + range.setStart(SC, SO); + } + + // The start point is the insertion point, so just move the end point to immediatly + // after the block + range.setEndAfter(block); + + // Extract the range, to split the block + // If we just did range.extractContents() then Mozilla does wierd stuff + // with selections, but if we clone, then remove the original range and extract + // the clone, it's quite happy. + var r2 = range.cloneRange(); + sel.removeRange(range); + var df = r2.extractContents(); + + if ( df.childNodes.length === 0 ) + { + df.appendChild(editor._doc.createElement('p')); + df.firstChild.appendChild(editor._doc.createElement('br')); + } + + if ( df.childNodes.length > 1 ) + { + var nb = editor._doc.createElement('p'); + while ( df.firstChild ) + { + var s = df.firstChild; + df.removeChild(s); + nb.appendChild(s); + } + df.appendChild(nb); + } + + // If the original block is empty, put a &nsbp; in it. + // @fixme: why using a regex instead of : if (block.innerHTML.trim() == '') ? + if ( ! ( /\S/.test(block.innerHTML) ) ) + { + block.innerHTML = " "; + } + + p = df.firstChild; + // @fixme: why using a regex instead of : if (p.innerHTML.trim() == '') ? + if ( ! ( /\S/.test(p.innerHTML) ) ) + { + p.innerHTML = "
"; + } + + // If the new block is empty and it's a heading, make it a paragraph + // note, the new block is empty when you are hitting enter at the end of the existing block + if ( ( /^\s*\s*$/.test(p.innerHTML) ) && ( /^h[1-6]$/i.test(p.tagName) ) ) + { + df.appendChild(editor.convertNode(p, "p")); + df.removeChild(p); + } + + var newblock = block.parentNode.insertBefore(df.firstChild, block.nextSibling); + + // Select the range (to set the insertion) + // collapse to the start of the new block + // (remember the block might be


, so if we collapsed to the end the
would be noticable) + + //range.selectNode(newblock.firstChild); + //range.collapse(true); + + editor.activateEditor(); + + sel = editor.getSelection(); + sel.removeAllRanges(); + sel.collapse(newblock,0); + + // scroll into view + editor.scrollToElement(newblock); + + //editor.forceRedraw(); + +}; Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/GetHtml/DOMwalk.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/GetHtml/DOMwalk.js,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/GetHtml/DOMwalk.js 24 Nov 2007 15:35:30 -0000 1.4 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/GetHtml/DOMwalk.js 13 May 2008 18:53:46 -0000 1.5 @@ -1,16 +1,12 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ +/* 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/modules/GetHtml/DOMwalk.js */ function GetHtmlImplementation(_1){ this.editor=_1; } -GetHtmlImplementation._pluginInfo={name:"GetHtmlImplementation DOMwalk",origin:"Xinha Core",version:"$LastChangedRevision: 871 $".replace(/^[^:]*: (.*) \$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL: http://svn.xinha.webfactional.com/trunk/modules/GetHtml/DOMwalk.js $".replace(/^[^:]*: (.*) \$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"}; +GetHtmlImplementation._pluginInfo={name:"GetHtmlImplementation DOMwalk",origin:"Xinha Core",version:"$LastChangedRevision:961 $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL:http://svn.xinha.webfactional.com/trunk/modules/GetHtml/DOMwalk.js $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"}; Xinha.getHTML=function(_2,_3,_4){ -try{ return Xinha.getHTMLWrapper(_2,_3,_4); -} -catch(ex){ -alert(Xinha._lc("Your Document is not well formed. Check JavaScript console for details.")); -return _4._iframe.contentWindow.document.body.innerHTML; -} }; Xinha.emptyAttributes=" checked disabled ismap readonly nowrap compact declare selected defer multiple noresize noshade "; Xinha.getHTMLWrapper=function(_5,_6,_7,_8){ @@ -78,7 +74,7 @@ continue; } var _14=a.nodeName.toLowerCase(); -if(/_moz_editor_bogus_node/.test(_14)){ +if(/_moz_editor_bogus_node/.test(_14)||(_14=="class"&&a.nodeValue=="webkit-block-placeholder")){ _9=""; break; } @@ -94,6 +90,12 @@ _15=_5[a.nodeName]; }else{ _15=a.nodeValue; +if(_14=="class"){ +_15=_15.replace(/Apple-style-span/,""); +if(!_15){ +continue; +} +} if(Xinha.is_ie&&(_14=="href"||_14=="src")){ _15=_7.stripBaseURL(_15); } Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/GetHtml/TransformInnerHTML.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/GetHtml/TransformInnerHTML.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/GetHtml/TransformInnerHTML.js 24 Nov 2007 15:35:30 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/GetHtml/TransformInnerHTML.js 13 May 2008 18:53:46 -0000 1.4 @@ -1,16 +1,23 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ +/* 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/modules/GetHtml/TransformInnerHTML.js */ function GetHtmlImplementation(_1){ this.editor=_1; } GetHtmlImplementation._pluginInfo={name:"GetHtmlImplementation TransformInnerHTML",version:"1.0",developer:"Nelson Bright",developer_url:"http://www.brightworkweb.com/",sponsor:"",sponsor_url:"",license:"htmlArea"}; -Xinha.RegExpCache=[new RegExp().compile(/<\s*\/?([^\s\/>]+)[\s*\/>]/gi),new RegExp().compile(/(\s+)_moz[^=>]*=[^\s>]*/gi),new RegExp().compile(/\s*=\s*(([^'"][^>\s]*)([>\s])|"([^"]+)"|'([^']+)')/g),new RegExp().compile(/\/>/g),new RegExp().compile(/<(br|hr|img|input|link|meta|param|embed|area)((\s*\S*="[^"]*")*)>/g),new RegExp().compile(/(<\w+\s+(\w*="[^"]*"\s+)*)(checked|compact|declare|defer|disabled|ismap|multiple|no(href|resize|shade|wrap)|readonly|selected)([\s>])/gi),new RegExp().compile(/(="[^']*)'([^'"]*")/),new RegExp().compile(/&(?=[^<]*>)/g),new RegExp().compile(/<\s+/g),new RegExp().compile(/\s+(\/)?>/g),new RegExp().compile(/\s{2,}/g),new RegExp().compile(/\s+([^=\s]+)((="[^"]+")|([\s>]))/g),new RegExp().compile(/\s+contenteditable(=[^>\s\/]*)?/gi),new RegExp().compile(/((href|src)=")([^\s]*)"/g),new RegExp().compile(/<\/?(div|p|h[1-6]|table|tr|td|th|ul|ol|li|blockquote|object|br|hr|img|embed|param|pre|script|html|head|body|meta|link|title|area|input|form|textarea|select|option)[^>]*>/g),new RegExp().compile(/<\/(div|p|h[1-6]|table|tr|ul|ol|blockquote|object|html|head|body|script|form|select)( [^>]*)?>/g),new RegExp().compile(/<(div|p|h[1-6]|table|tr|ul|ol|blockquote|object|html|head|body|script|form|select)( [^>]*)?>/g),new RegExp().compile(/<(td|th|li|option|br|hr|embed|param|pre|meta|link|title|area|input|textarea)[^>]*>/g),new RegExp().compile(/(^|<\/(pre|script)>)(\s|[^\s])*?(<(pre|script)[^>]*>|$)/g),new RegExp().compile(/(]*>)([\s\S])*?(<\/pre>)/g),new RegExp().compile(/(^|)([\s\S]*?)(?=|$)/g),new RegExp().compile(/\S*=""/g),new RegExp().compile(/|<\?[\s\S]*?\?>|<\/?\w[^>]*>/g),new RegExp().compile(/(^|<\/script>)[\s\S]*?(]*>|$)/g)]; +Xinha.RegExpCache=[/<\s*\/?([^\s\/>]+)[\s*\/>]/gi,/(\s+)_moz[^=>]*=[^\s>]*/gi,/\s*=\s*(([^'"][^>\s]*)([>\s])|"([^"]+)"|'([^']+)')/g,/\/>/g,/<(br|hr|img|input|link|meta|param|embed|area)((\s*\S*="[^"]*")*)>/g,/(<\w+\s+(\w*="[^"]*"\s+)*)(checked|compact|declare|defer|disabled|ismap|multiple|no(href|resize|shade|wrap)|readonly|selected)([\s>])/gi,/(="[^']*)'([^'"]*")/,/&(?=(?!(#[0-9]{2,5};|[a-zA-Z0-9]{2,6};|#x[0-9a-fA-F]{2,4};))[^<]*>)/g,/<\s+/g,/\s+(\/)?>/g,/\s{2,}/g,/\s+([^=\s]+)((="[^"]+")|([\s>]))/g,/\s+contenteditable(=[^>\s\/]*)?/gi,/((href|src)=")([^\s]*)"/g,/<\/?(div|p|h[1-6]|table|tr|td|th|ul|ol|li|blockquote|object|br|hr|img|embed|param|pre|script|html|head|body|meta|link|title|area|input|form|textarea|select|option)[^>]*>/g,/<\/(div|p|h[1-6]|table|tr|ul|ol|blockquote|object|html|head|body|script|form|select)( [^>]*)?>/g,/<(div|p|h[1-6]|table|tr|ul|ol|blockquote|object|html|head|body|script|form|select)( [^>]*)?>/g,/<(td|th|li|option|br|hr|embed|param|pre|meta|link|title|area|input|textarea)[^>]*>/g,/(^|<\/(pre|script)>)(\s|[^\s])*?(<(pre|script)[^>]*>|$)/g,/(]*>)([\s\S])*?(<\/pre>)/g,/(^|)([\s\S]*?)(?=|$)/g,/\S*=""/g,/|<\?[\s\S]*?\?>|<\/?\w[^>]*>/g,/(^|<\/script>)[\s\S]*?(]*>|$)/g]; +if(typeof RegExp.prototype.compile=="function"){ +for(var i=0;i").replace(c[9],"$1>").replace(c[5],"$1$3=\"$3\"$4").replace(c[4],"<$1$2 />").replace(c[6],"$1$2").replace(c[8],"<").replace(c[10]," "); +}).replace(c[3],">").replace(c[9],"$1>").replace(c[5],"$1$3=\"$3\"$5").replace(c[4],"<$1$2 />").replace(c[6],"$1$2").replace(c[7],"&").replace(c[8],"<").replace(c[10]," "); if(Xinha.is_ie&&c[13].test(_2)){ _2=_2.replace(c[13],"$1"+this.stripBaseURL(RegExp.$3)+"\""); } Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InsertImage/insert_image.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InsertImage/insert_image.html,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InsertImage/insert_image.html 24 Nov 2007 15:35:31 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InsertImage/insert_image.html 13 May 2008 18:53:46 -0000 1.4 @@ -165,7 +165,7 @@ height="200" width="100%" src="../../popups/blank.html">
- +
Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InsertImage/insert_image.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InsertImage/insert_image.js,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InsertImage/insert_image.js 24 Nov 2007 15:35:31 -0000 1.4 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InsertImage/insert_image.js 13 May 2008 18:53:46 -0000 1.5 @@ -1,5 +1,7 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ -InsertImage._pluginInfo={name:"InsertImage",origin:"Xinha Core",version:"$LastChangedRevision: 900 $".replace(/^[^:]*: (.*) \$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL: http://svn.xinha.webfactional.com/trunk/modules/InsertImage/insert_image.js $".replace(/^[^:]*: (.*) \$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"}; +/* 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/modules/InsertImage/insert_image.js */ +InsertImage._pluginInfo={name:"InsertImage",origin:"Xinha Core",version:"$LastChangedRevision:992 $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL:http://svn.xinha.webfactional.com/trunk/modules/InsertImage/insert_image.js $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"}; function InsertImage(_1){ } Xinha.prototype._insertImage=function(_2){ @@ -29,7 +31,7 @@ } return ""; } -_4={f_base:_5,f_url:_2.getAttribute("src",2),f_alt:_2.alt,f_border:_2.border,f_align:_2.align,f_vert:getSpecifiedAttribute(_2,"vspace"),f_horiz:getSpecifiedAttribute(_2,"hspace"),f_width:_2.width,f_height:_2.height}; +_4={f_base:_5,f_url:this.stripBaseURL(_2.getAttribute("src",2)),f_alt:_2.alt,f_border:_2.border,f_align:_2.align,f_vert:getSpecifiedAttribute(_2,"vspace"),f_horiz:getSpecifiedAttribute(_2,"hspace"),f_width:_2.width,f_height:_2.height}; }else{ _4={f_base:_5,f_url:""}; } Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InsertTable/insert_table.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InsertTable/insert_table.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InsertTable/insert_table.js 24 Nov 2007 15:35:31 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InsertTable/insert_table.js 13 May 2008 18:53:46 -0000 1.4 @@ -1,5 +1,7 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ -InsertTable._pluginInfo={name:"InsertTable",origin:"Xinha Core",version:"$LastChangedRevision: 688 $".replace(/^[^:]*: (.*) \$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL: http://svn.xinha.python-hosting.com/trunk/modules/InsertTable/insert_table.js $".replace(/^[^:]*: (.*) \$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"}; +/* 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/modules/InsertTable/insert_table.js */ +InsertTable._pluginInfo={name:"InsertTable",origin:"Xinha Core",version:"$LastChangedRevision: 688 $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL: http://svn.xinha.python-hosting.com/trunk/modules/InsertTable/insert_table.js $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"}; function InsertTable(_1){ } Xinha.prototype._insertTable=function(){ Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InternetExplorer/InternetExplorer.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InternetExplorer/InternetExplorer.js,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InternetExplorer/InternetExplorer.js 24 Nov 2007 15:35:31 -0000 1.4 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InternetExplorer/InternetExplorer.js 13 May 2008 18:53:46 -0000 1.5 @@ -1,5 +1,7 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ -InternetExplorer._pluginInfo={name:"Internet Explorer",origin:"Xinha Core",version:"$LastChangedRevision: 901 $".replace(/^[^:]*: (.*) \$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL: http://svn.xinha.webfactional.com/trunk/modules/InternetExplorer/InternetExplorer.js $".replace(/^[^:]*: (.*) \$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"}; +/* 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/modules/InternetExplorer/InternetExplorer.js */ +InternetExplorer._pluginInfo={name:"Internet Explorer",origin:"Xinha Core",version:"$LastChangedRevision:980 $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL:http://svn.xinha.webfactional.com/trunk/modules/InternetExplorer/InternetExplorer.js $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"}; function InternetExplorer(_1){ this.editor=_1; _1.InternetExplorer=this; @@ -64,33 +66,136 @@ _a=_a.replace(/ (\s*)("; +}else{ +if(_f.config.browserQuirksMode===true){ +var _12=""; +}else{ +var _12=Xinha.getDoctype(document); +} +} +if(!_f.config.fullPage){ +_11+=_12+"\n"; +_11+="\n"; +_11+="\n"; +_11+="\n"; +if(typeof _f.config.baseHref!="undefined"&&_f.config.baseHref!==null){ +_11+="\n"; +} +if(typeof _f.config.pageStyleSheets!=="undefined"){ +for(var i=0;i<_f.config.pageStyleSheets.length;i++){ +if(_f.config.pageStyleSheets[i].length>0){ +_11+=""; +} +} +} +if(_f.config.pageStyle){ +_11+=""; +} +_11+="\n"; +_11+="\n"; +_11+=_f.getEditorContent(); +_11+="\n"; +_11+=""; +}else{ +_11=_f.getEditorContent(); +if(_11.match(Xinha.RE_doctype)){ +_f.setDoctype(RegExp.$1); +} +} +_e.write(_11); +_e.close(); +_e.execCommand(_b,UI,_d); +document.body.removeChild(_10); +return true; +break; +case "removeformat": +var _f=this.editor; +var sel=_f.getSelection(); +var _15=_f.saveSelection(sel); +var i,el,els; +function clean(el){ +if(el.nodeType!=1){ +return; +} +el.removeAttribute("style"); +for(var j=0;j=1){ -return _1d.item(0).outerHTML; +if(_2a.length>=1){ +return _2a.item(0).outerHTML; } } return ""; @@ -162,51 +270,55 @@ return this._doc.selection; }; Xinha.prototype.createRange=function(sel){ +if(!sel){ +sel=this.getSelection(); +} return sel.createRange(); }; -Xinha.prototype.isKeyEvent=function(_1f){ -return _1f.type=="keydown"; +Xinha.prototype.isKeyEvent=function(_2c){ +return _2c.type=="keydown"; }; -Xinha.prototype.getKey=function(_20){ -return String.fromCharCode(_20.keyCode); +Xinha.prototype.getKey=function(_2d){ +return String.fromCharCode(_2d.keyCode); }; -Xinha.getOuterHTML=function(_21){ -return _21.outerHTML; +Xinha.getOuterHTML=function(_2e){ +return _2e.outerHTML; }; Xinha.prototype.cc=String.fromCharCode(8201); -Xinha.prototype.setCC=function(_22){ +Xinha.prototype.setCC=function(_2f){ var cc=this.cc; -if(_22=="textarea"){ +if(_2f=="textarea"){ var ta=this._textArea; var pos=document.selection.createRange(); pos.collapse(); pos.text=cc; -var _26=ta.value.indexOf(cc); -var _27=ta.value.substring(0,_26); -var _28=ta.value.substring(_26+cc.length,ta.value.length); -if(_28.match(/^[^<]*>/)){ -var _29=_28.indexOf(">")+1; -ta.value=_27+_28.substring(0,_29)+cc+_28.substring(_29,_28.length); +var _33=ta.value.indexOf(cc); +var _34=ta.value.substring(0,_33); +var _35=ta.value.substring(_33+cc.length,ta.value.length); +if(_35.match(/^[^<]*>/)){ +var _36=_35.indexOf(">")+1; +ta.value=_34+_35.substring(0,_36)+cc+_35.substring(_36,_35.length); }else{ -ta.value=_27+cc+_28; +ta.value=_34+cc+_35; } +ta.value=ta.value.replace(new RegExp("(&[^"+cc+"]*?)("+cc+")([^"+cc+"]*?;)"),"$1$3$2"); ta.value=ta.value.replace(new RegExp("(]*>[^"+cc+"]*?)("+cc+")([^"+cc+"]*?)"),"$1$3$2"); ta.value=ta.value.replace(new RegExp("^([^"+cc+"]*)("+cc+")([^"+cc+"]*]*>)(.*?)"),"$1$3$2$4"); }else{ var sel=this.getSelection(); var r=sel.createRange(); if(sel.type=="Control"){ -var _2c=r.item(0); -_2c.outerHTML+=cc; +var _39=r.item(0); +_39.outerHTML+=cc; }else{ r.collapse(); r.text=cc; } } }; -Xinha.prototype.findCC=function(_2d){ -var _2e=(_2d=="textarea")?this._textArea:this._doc.body; -range=_2e.createTextRange(); +Xinha.prototype.findCC=function(_3a){ +var _3b=(_3a=="textarea")?this._textArea:this._doc.body; +range=_3b.createTextRange(); if(range.findText(escape(this.cc))){ range.select(); range.text=""; @@ -215,11 +327,11 @@ range.select(); range.text=""; } -if(_2d=="textarea"){ +if(_3a=="textarea"){ this._textArea.focus(); } }; Xinha.getDoctype=function(doc){ -return (doc.compatMode=="CSS1Compat")?"":""; +return (doc.compatMode=="CSS1Compat"&&Xinha.ie_version<8)?"":""; }; Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Opera/Opera.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Opera/Opera.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/Opera/Opera.js 13 May 2008 18:53:46 -0000 1.1 @@ -0,0 +1,464 @@ +/* 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/modules/Opera/Opera.js */ +Opera._pluginInfo={name:"Opera",origin:"Xinha Core",version:"$LastChangedRevision:970 $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL:http://svn.xinha.webfactional.com/trunk/modules/Opera/Opera.js $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),sponsor:"Gogo Internet Services Limited",sponsor_url:"http://www.gogo.co.nz/",license:"htmlArea"}; +function Opera(_1){ +this.editor=_1; +_1.Opera=this; +} +Opera.prototype.onKeyPress=function(ev){ +var _3=this.editor; +var s=_3.getSelection(); +if(_3.isShortCut(ev)){ +switch(_3.getKey(ev).toLowerCase()){ +case "z": +if(_3._unLink&&_3._unlinkOnUndo){ +Xinha._stopEvent(ev); +_3._unLink(); +_3.updateToolbar(); +return true; +} +break; +case "a": +sel=_3.getSelection(); +sel.removeAllRanges(); +range=_3.createRange(); +range.selectNodeContents(_3._doc.body); +sel.addRange(range); +Xinha._stopEvent(ev); +return true; +break; +case "v": +if(!_3.config.htmlareaPaste){ +return true; +} +break; +} +} +switch(_3.getKey(ev)){ +case " ": +var _5=function(_6,_7){ +var _8=_6.nextSibling; +if(typeof _7=="string"){ +_7=_3._doc.createElement(_7); +} +var a=_6.parentNode.insertBefore(_7,_8); +Xinha.removeFromParent(_6); +a.appendChild(_6); +_8.data=" "+_8.data; +s.collapse(_8,1); +_3._unLink=function(){ +var t=a.firstChild; +a.removeChild(t); +a.parentNode.insertBefore(t,a); +Xinha.removeFromParent(a); +_3._unLink=null; +_3._unlinkOnUndo=false; +}; +_3._unlinkOnUndo=true; +return a; +}; +if(_3.config.convertUrlsToLinks&&s&&s.isCollapsed&&s.anchorNode.nodeType==3&&s.anchorNode.data.length>3&&s.anchorNode.data.indexOf(".")>=0){ +var _b=s.anchorNode.data.substring(0,s.anchorOffset).search(/\S{4,}$/); +if(_b==-1){ +break; +} +if(_3._getFirstAncestor(s,"a")){ +break; +} +var _c=s.anchorNode.data.substring(0,s.anchorOffset).replace(/^.*?(\S*)$/,"$1"); +var _d=_c.match(Xinha.RE_email); +if(_d){ +var _e=s.anchorNode; +var _f=_e.splitText(s.anchorOffset); +var _10=_e.splitText(_b); +_5(_10,"a").href="mailto:"+_d[0]; +break; +} +RE_date=/([0-9]+\.)+/; +RE_ip=/(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/; +var _11=_c.match(Xinha.RE_url); +if(_11){ +if(RE_date.test(_c)){ +break; +} +var _12=s.anchorNode; +var _13=_12.splitText(s.anchorOffset); +var _14=_12.splitText(_b); +_5(_14,"a").href=(_11[1]?_11[1]:"http://")+_11[2]; +break; +} +} +break; +} +switch(ev.keyCode){ +case 27: +if(_3._unLink){ +_3._unLink(); +Xinha._stopEvent(ev); +} +break; +break; +case 8: +case 46: +if(!ev.shiftKey&&this.handleBackspace()){ +Xinha._stopEvent(ev); +} +default: +_3._unlinkOnUndo=false; +if(s.anchorNode&&s.anchorNode.nodeType==3){ +var a=_3._getFirstAncestor(s,"a"); +if(!a){ +break; +} +if(!a._updateAnchTimeout){ +if(s.anchorNode.data.match(Xinha.RE_email)&&a.href.match("mailto:"+s.anchorNode.data.trim())){ +var _16=s.anchorNode; +var _17=function(){ +a.href="mailto:"+_16.data.trim(); +a._updateAnchTimeout=setTimeout(_17,250); +}; +a._updateAnchTimeout=setTimeout(_17,1000); +break; +} +var m=s.anchorNode.data.match(Xinha.RE_url); +if(m&&a.href.match(new RegExp("http(s)?://"+Xinha.escapeStringForRegExp(s.anchorNode.data.trim())))){ +var _19=s.anchorNode; +var _1a=function(){ +m=_19.data.match(Xinha.RE_url); +if(m){ +a.href=(m[1]?m[1]:"http://")+m[2]; +} +a._updateAnchTimeout=setTimeout(_1a,250); +}; +a._updateAnchTimeout=setTimeout(_1a,1000); +} +} +} +break; +} +return false; +}; +Opera.prototype.handleBackspace=function(){ +var _1b=this.editor; +setTimeout(function(){ +var sel=_1b.getSelection(); +var _1d=_1b.createRange(sel); +var SC=_1d.startContainer; +var SO=_1d.startOffset; +var EC=_1d.endContainer; +var EO=_1d.endOffset; +var _22=SC.nextSibling; +if(SC.nodeType==3){ +SC=SC.parentNode; +} +if(!(/\S/.test(SC.tagName))){ +var p=document.createElement("p"); +while(SC.firstChild){ +p.appendChild(SC.firstChild); +} +SC.parentNode.insertBefore(p,SC); +Xinha.removeFromParent(SC); +var r=_1d.cloneRange(); +r.setStartBefore(_22); +r.setEndAfter(_22); +r.extractContents(); +sel.removeAllRanges(); +sel.addRange(r); +} +},10); +}; +Opera.prototype.inwardHtml=function(_25){ +_25=_25.replace(/<(\/?)del(\s|>|\/)/ig,"<$1strike$2"); +return _25; +}; +Opera.prototype.outwardHtml=function(_26){ +return _26; +}; +Opera.prototype.onExecCommand=function(_27,UI,_29){ +switch(_27){ +case "removeformat": +var _2a=this.editor; +var sel=_2a.getSelection(); +var _2c=_2a.saveSelection(sel); +var _2d=_2a.createRange(sel); +var els=_2a._doc.body.getElementsByTagName("*"); +var _2f=(_2d.startContainer.nodeType==1)?_2d.startContainer:_2d.startContainer.parentNode; +var i,el; +if(sel.isCollapsed){ +_2d.selectNodeContents(_2a._doc.body); +} +for(i=0;isel.anchorOffset&&sel.anchorNode.childNodes[sel.anchorOffset].nodeType==1){ +return sel.anchorNode.childNodes[sel.anchorOffset]; +}else{ +if(sel.anchorNode.nodeType==1){ +return sel.anchorNode; +}else{ +return null; +} +} +} +return null; +}; +Xinha.prototype.selectionEmpty=function(sel){ +if(!sel){ +return true; +} +if(typeof sel.isCollapsed!="undefined"){ +return sel.isCollapsed; +} +return true; +}; +Xinha.prototype.saveSelection=function(){ +return this.createRange(this.getSelection()).cloneRange(); +}; +Xinha.prototype.restoreSelection=function(_3d){ +var sel=this.getSelection(); +sel.removeAllRanges(); +sel.addRange(_3d); +}; +Xinha.prototype.selectNodeContents=function(_3f,pos){ +this.focusEditor(); +this.forceRedraw(); +var _41; +var _42=typeof pos=="undefined"?true:false; +var sel=this.getSelection(); +_41=this._doc.createRange(); +if(_42&&_3f.tagName&&_3f.tagName.toLowerCase().match(/table|img|input|textarea|select/)){ +_41.selectNode(_3f); +}else{ +_41.selectNodeContents(_3f); +} +sel.removeAllRanges(); +sel.addRange(_41); +}; +Xinha.prototype.insertHTML=function(_44){ +var sel=this.getSelection(); +var _46=this.createRange(sel); +this.focusEditor(); +var _47=this._doc.createDocumentFragment(); +var div=this._doc.createElement("div"); +div.innerHTML=_44; +while(div.firstChild){ +_47.appendChild(div.firstChild); +} +var _49=this.insertNodeAtSelection(_47); +}; +Xinha.prototype.getSelectedHTML=function(){ +var sel=this.getSelection(); +if(sel.isCollapsed){ +return ""; +} +var _4b=this.createRange(sel); +return Xinha.getHTML(_4b.cloneContents(),false,this); +}; +Xinha.prototype.getSelection=function(){ +var sel=this._iframe.contentWindow.getSelection(); +if(sel&&sel.focusNode&&sel.focusNode.tagName&&sel.focusNode.tagName=="HTML"){ +var bod=this._doc.getElementsByTagName("body")[0]; +var rng=this.createRange(); +rng.selectNodeContents(bod); +sel.removeAllRanges(); +sel.addRange(rng); +sel.collapseToEnd(); +} +return sel; +}; +Xinha.prototype.createRange=function(sel){ +this.activateEditor(); +if(typeof sel!="undefined"){ +try{ +return sel.getRangeAt(0); +} +catch(ex){ +return this._doc.createRange(); +} +}else{ +return this._doc.createRange(); +} +}; +Xinha.prototype.isKeyEvent=function(_50){ +return _50.type=="keypress"; +}; +Xinha.prototype.getKey=function(_51){ +return String.fromCharCode(_51.charCode); +}; +Xinha.getOuterHTML=function(_52){ +return (new XMLSerializer()).serializeToString(_52); +}; +Xinha.prototype.setCC=function(_53){ +var cc=String.fromCharCode(8286); +try{ +if(_53=="textarea"){ +var ta=this._textArea; +var _56=ta.selectionStart; +var _57=ta.value.substring(0,_56); +var _58=ta.value.substring(_56,ta.value.length); +if(_58.match(/^[^<]*>/)){ +var _59=_58.indexOf(">")+1; +ta.value=_57+_58.substring(0,_59)+cc+_58.substring(_59,_58.length); +}else{ +ta.value=_57+cc+_58; +} +ta.value=ta.value.replace(new RegExp("(&[^"+cc+"]*?)("+cc+")([^"+cc+"]*?;)"),"$1$3$2"); +ta.value=ta.value.replace(new RegExp("(]*>[^"+cc+"]*?)("+cc+")([^"+cc+"]*?)"),"$1$3$2"); +ta.value=ta.value.replace(new RegExp("^([^"+cc+"]*)("+cc+")([^"+cc+"]*]*>)(.*?)"),"$1$3$2$4"); +ta.value=ta.value.replace(cc,"MARK"); +}else{ +var sel=this.getSelection(); +var _5b=this._doc.createElement("span"); +_5b.id="XinhaOperaCaretMarker"; +sel.getRangeAt(0).insertNode(_5b); +} +} +catch(e){ +} +}; +Xinha.prototype.findCC=function(_5c){ +if(_5c=="textarea"){ +var ta=this._textArea; +var pos=ta.value.search(/(((\s|(MARK))*<\/span>)?)/); +if(pos==-1){ +return; +} +var cc=RegExp.$1; +var end=pos+cc.length; +var _61=ta.value.substring(0,pos); +var _62=ta.value.substring(end,ta.value.length); +ta.value=_61; +ta.scrollTop=ta.scrollHeight; +var _63=ta.scrollTop; +ta.value+=_62; +ta.setSelectionRange(pos,pos); +ta.focus(); +ta.scrollTop=_63; +}else{ +var _64=this._doc.getElementById("XinhaOperaCaretMarker"); +if(_64){ +this.focusEditor(); +var rng=this.createRange(); +rng.selectNode(_64); +var sel=this.getSelection(); +sel.addRange(rng); +sel.collapseToStart(); +this.scrollToElement(_64); +_64.parentNode.removeChild(_64); +return; +} +} +}; +Xinha.getDoctype=function(doc){ +var d=""; +if(doc.doctype){ +d+=""; +} +return d; +}; +Xinha.prototype._standardInitIframe=Xinha.prototype.initIframe; +Xinha.prototype.initIframe=function(){ +if(!this._iframeLoadDone){ +if(this._iframe.contentWindow&&this._iframe.contentWindow.xinhaReadyToRoll){ +this._iframeLoadDone=true; +this._standardInitIframe(); +}else{ +var _69=this; +setTimeout(function(){ +_69.initIframe(); +},5); +} +} +}; +Xinha._addEventOperaOrig=Xinha._addEvent; +Xinha._addEvent=function(el,_6b,_6c){ +if(el.tagName&&el.tagName.toLowerCase()=="select"&&_6b=="change"){ +return Xinha.addDom0Event(el,_6b,_6c); +} +return Xinha._addEventOperaOrig(el,_6b,_6c); +}; + Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/WebKit/WebKit.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/WebKit/WebKit.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/WebKit/WebKit.js 13 May 2008 18:53:46 -0000 1.1 @@ -0,0 +1,478 @@ +/* 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/modules/WebKit/WebKit.js */ +WebKit._pluginInfo={name:"WebKit",origin:"Xinha Core",version:"$LastChangedRevision:998 $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL:http://svn.xinha.webfactional.com/trunk/modules/WebKit/WebKit.js $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"}; +function WebKit(_1){ +this.editor=_1; +_1.WebKit=this; +} +WebKit.prototype.onKeyPress=function(ev){ +var _3=this.editor; +var s=_3.getSelection(); +if(_3.isShortCut(ev)){ +switch(_3.getKey(ev).toLowerCase()){ +case "z": +if(_3._unLink&&_3._unlinkOnUndo){ +Xinha._stopEvent(ev); +_3._unLink(); +_3.updateToolbar(); +return true; +} +break; +case "a": +break; +case "v": +if(!_3.config.htmlareaPaste){ +return true; +} +break; +} +} +switch(_3.getKey(ev)){ +case " ": +var _5=function(_6,_7){ +var _8=_6.nextSibling; +if(typeof _7=="string"){ +_7=_3._doc.createElement(_7); +} +var a=_6.parentNode.insertBefore(_7,_8); +Xinha.removeFromParent(_6); +a.appendChild(_6); +_8.data=" "+_8.data; +s.collapse(_8,1); +_3._unLink=function(){ +var t=a.firstChild; +a.removeChild(t); +a.parentNode.insertBefore(t,a); +Xinha.removeFromParent(a); +_3._unLink=null; +_3._unlinkOnUndo=false; +}; +_3._unlinkOnUndo=true; +return a; +}; +if(_3.config.convertUrlsToLinks&&s&&s.isCollapsed&&s.anchorNode.nodeType==3&&s.anchorNode.data.length>3&&s.anchorNode.data.indexOf(".")>=0){ +var _b=s.anchorNode.data.substring(0,s.anchorOffset).search(/\S{4,}$/); +if(_b==-1){ +break; +} +if(_3._getFirstAncestor(s,"a")){ +break; +} +var _c=s.anchorNode.data.substring(0,s.anchorOffset).replace(/^.*?(\S*)$/,"$1"); +var _d=_c.match(Xinha.RE_email); +if(_d){ +var _e=s.anchorNode; +var _f=_e.splitText(s.anchorOffset); +var _10=_e.splitText(_b); +_5(_10,"a").href="mailto:"+_d[0]; +break; +} +RE_date=/([0-9]+\.)+/; +RE_ip=/(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/; +var _11=_c.match(Xinha.RE_url); +if(_11){ +if(RE_date.test(_c)){ +break; +} +var _12=s.anchorNode; +var _13=_12.splitText(s.anchorOffset); +var _14=_12.splitText(_b); +_5(_14,"a").href=(_11[1]?_11[1]:"http://")+_11[2]; +break; +} +} +break; +} +switch(ev.keyCode){ +case 13: +if(ev.shiftKey){ +} +break; +case 27: +if(_3._unLink){ +_3._unLink(); +Xinha._stopEvent(ev); +} +break; +case 8: +case 46: +if(!ev.shiftKey&&this.handleBackspace()){ +Xinha._stopEvent(ev); +} +break; +default: +_3._unlinkOnUndo=false; +if(s.anchorNode&&s.anchorNode.nodeType==3){ +var a=_3._getFirstAncestor(s,"a"); +if(!a){ +break; +} +if(!a._updateAnchTimeout){ +if(s.anchorNode.data.match(Xinha.RE_email)&&a.href.match("mailto:"+s.anchorNode.data.trim())){ +var _16=s.anchorNode; +var _17=function(){ +a.href="mailto:"+_16.data.trim(); +a._updateAnchTimeout=setTimeout(_17,250); +}; +a._updateAnchTimeout=setTimeout(_17,1000); +break; +} +var m=s.anchorNode.data.match(Xinha.RE_url); +if(m&&a.href.match(new RegExp("http(s)?://"+Xinha.escapeStringForRegExp(s.anchorNode.data.trim())))){ +var _19=s.anchorNode; +var _1a=function(){ +m=_19.data.match(Xinha.RE_url); +if(m){ +a.href=(m[1]?m[1]:"http://")+m[2]; +} +a._updateAnchTimeout=setTimeout(_1a,250); +}; +a._updateAnchTimeout=setTimeout(_1a,1000); +} +} +} +break; +} +return false; +}; +WebKit.prototype.handleBackspace=function(){ +var _1b=this.editor; +setTimeout(function(){ +var sel=_1b.getSelection(); +var _1d=_1b.createRange(sel); +var SC=_1d.startContainer; +var SO=_1d.startOffset; +var EC=_1d.endContainer; +var EO=_1d.endOffset; +var _22=SC.nextSibling; +if(SC.nodeType==3){ +SC=SC.parentNode; +} +if(!(/\S/.test(SC.tagName))){ +var p=document.createElement("p"); +while(SC.firstChild){ +p.appendChild(SC.firstChild); +} +SC.parentNode.insertBefore(p,SC); +Xinha.removeFromParent(SC); +var r=_1d.cloneRange(); +r.setStartBefore(_22); +r.setEndAfter(_22); +r.extractContents(); +sel.removeAllRanges(); +sel.addRange(r); +} +},10); +}; +WebKit.prototype.inwardHtml=function(_25){ +return _25; +}; +WebKit.prototype.outwardHtml=function(_26){ +return _26; +}; +WebKit.prototype.onExecCommand=function(_27,UI,_29){ +this.editor._doc.execCommand("styleWithCSS",false,false); +switch(_27){ +case "paste": +alert(Xinha._lc("The Paste button does not work in the Safari browser for security reasons. Press CTRL-V on your keyboard to paste directly.")); +return true; +break; +case "removeformat": +var _2a=this.editor; +var sel=_2a.getSelection(); +var _2c=_2a.saveSelection(sel); +var _2d=_2a.createRange(sel); +var els=_2a._doc.getElementsByTagName("*"); +els=Xinha.collectionToArray(els); +var _2f=(_2d.startContainer.nodeType==1)?_2d.startContainer:_2d.startContainer.parentNode; +var i,el,newNode,fragment,child,r2=_2a._doc.createRange(); +function clean(el){ +if(el.nodeType!=1){ +return; +} +el.removeAttribute("style"); +for(var j=0;jsel.anchorOffset&&sel.anchorNode.childNodes[sel.anchorOffset].nodeType==1){ +return sel.anchorNode.childNodes[sel.anchorOffset]; +}else{ +if(sel.anchorNode.nodeType==1){ +return sel.anchorNode; +}else{ +return null; +} +} +} +return null; +}; +Xinha.prototype.selectionEmpty=function(sel){ +if(!sel){ +return true; +} +if(typeof sel.isCollapsed!="undefined"){ +return sel.isCollapsed; +} +return true; +}; +Xinha.prototype.saveSelection=function(){ +return this.createRange(this.getSelection()).cloneRange(); +}; +Xinha.prototype.restoreSelection=function(_3f){ +var sel=this.getSelection(); +sel.removeAllRanges(); +sel.addRange(_3f); +}; +Xinha.prototype.selectNodeContents=function(_41,pos){ +this.focusEditor(); +this.forceRedraw(); +var _43; +var _44=typeof pos=="undefined"?true:false; +var sel=this.getSelection(); +_43=this._doc.createRange(); +if(_44&&_41.tagName&&_41.tagName.toLowerCase().match(/table|img|input|textarea|select/)){ +_43.selectNode(_41); +}else{ +_43.selectNodeContents(_41); +} +sel.removeAllRanges(); +sel.addRange(_43); +}; +Xinha.prototype.insertHTML=function(_46){ +var sel=this.getSelection(); +var _48=this.createRange(sel); +this.focusEditor(); +var _49=this._doc.createDocumentFragment(); +var div=this._doc.createElement("div"); +div.innerHTML=_46; +while(div.firstChild){ +_49.appendChild(div.firstChild); +} +var _4b=this.insertNodeAtSelection(_49); +}; +Xinha.prototype.getSelectedHTML=function(){ +var sel=this.getSelection(); +if(sel.isCollapsed){ +return ""; +} +var _4d=this.createRange(sel); +if(_4d){ +return Xinha.getHTML(_4d.cloneContents(),false,this); +}else{ +return ""; +} +}; +Xinha.prototype.getSelection=function(){ +return this._iframe.contentWindow.getSelection(); +}; +Xinha.prototype.createRange=function(sel){ +this.activateEditor(); +if(typeof sel!="undefined"){ +try{ +return sel.getRangeAt(0); +} +catch(ex){ +return this._doc.createRange(); +} +}else{ +return this._doc.createRange(); +} +}; +Xinha.prototype.isKeyEvent=function(_4f){ +return _4f.type=="keypress"; +}; +Xinha.prototype.getKey=function(_50){ +var key=String.fromCharCode(parseInt(_50.keyIdentifier.replace(/^U\+/,""),16)); +if(_50.shiftKey){ +return key; +}else{ +return key.toLowerCase(); +} +}; +Xinha.getOuterHTML=function(_52){ +return (new XMLSerializer()).serializeToString(_52); +}; +Xinha.prototype.cc=String.fromCharCode(8286); +Xinha.prototype.setCC=function(_53){ +var cc=this.cc; +try{ +if(_53=="textarea"){ +var ta=this._textArea; +var _56=ta.selectionStart; +var _57=ta.value.substring(0,_56); +var _58=ta.value.substring(_56,ta.value.length); +if(_58.match(/^[^<]*>/)){ +var _59=_58.indexOf(">")+1; +ta.value=_57+_58.substring(0,_59)+cc+_58.substring(_59,_58.length); +}else{ +ta.value=_57+cc+_58; +} +ta.value=ta.value.replace(new RegExp("(&[^"+cc+"]*?)("+cc+")([^"+cc+"]*?;)"),"$1$3$2"); +ta.value=ta.value.replace(new RegExp("(]*>[^"+cc+"]*?)("+cc+")([^"+cc+"]*?)"),"$1$3$2"); +ta.value=ta.value.replace(new RegExp("^([^"+cc+"]*)("+cc+")([^"+cc+"]*]*>)(.*?)"),"$1$3$2$4"); +}else{ +var sel=this.getSelection(); +sel.getRangeAt(0).insertNode(this._doc.createTextNode(cc)); +} +} +catch(e){ +} +}; +Xinha.prototype.findCC=function(_5b){ +if(_5b=="textarea"){ +var ta=this._textArea; +var pos=ta.value.indexOf(this.cc); +if(pos==-1){ +return; +} +var end=pos+this.cc.length; +var _5f=ta.value.substring(0,pos); +var _60=ta.value.substring(end,ta.value.length); +ta.value=_5f; +ta.scrollTop=ta.scrollHeight; +var _61=ta.scrollTop; +ta.value+=_60; +ta.setSelectionRange(pos,pos); +ta.focus(); +ta.scrollTop=_61; +}else{ +var _62=this; +try{ +var doc=this._doc; +doc.body.innerHTML=doc.body.innerHTML.replace(new RegExp(this.cc),""); +var _64=doc.getElementById("XinhaEditingPostion"); +this.selectNodeContents(_64); +this.scrollToElement(_64); +_64.parentNode.removeChild(_64); +this._iframe.contentWindow.focus(); +} +catch(e){ +} +} +}; +Xinha.prototype._standardToggleBorders=Xinha.prototype._toggleBorders; +Xinha.prototype._toggleBorders=function(){ +var _65=this._standardToggleBorders(); +var _66=this._doc.getElementsByTagName("TABLE"); +for(var i=0;i<_66.length;i++){ +_66[i].style.display="none"; +_66[i].style.display="table"; +} +return _65; +}; +Xinha.getDoctype=function(doc){ +var d=""; +if(doc.doctype){ +d+=""; +} +return d; +}; + 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.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Abbreviation/abbreviation.js 24 Nov 2007 15:35:31 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Abbreviation/abbreviation.js 13 May 2008 18:53:46 -0000 1.4 @@ -1,91 +1,65 @@ -// Abbreviation plugin for Xinha -// Implementation by Udo Schmal & Schaffrath NeueMedien -// Original Author - Udo Schmal -// -// (c) Udo Schmal & Schaffrath NeueMedien 2004 -// Distributed under the same terms as HTMLArea itself. -// This notice MUST stay intact for use (see license.txt). - -function Abbreviation(editor) { - this.editor = editor; - var cfg = editor.config; - var self = this; - - // register the toolbar buttons provided by this plugin - cfg.registerButton({ - id : "abbreviation", - tooltip : this._lc("Abbreviation"), - image : editor.imgURL("ed_abbreviation.gif", "Abbreviation"), - textMode : false, - action : function(editor) { - self.buttonPress(editor); - } - }) - cfg.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(string) { - return Xinha._lc(string, 'Abbreviation'); -}; - -Abbreviation.prototype.onGenerate = function() { - this.editor.addEditorStylesheet(_editor_url + 'plugins/Abbreviation/abbreviation.css'); -}; - -Abbreviation.prototype.buttonPress = function(editor, context, updatecontextclass) { - var outparam = null; - var html = editor.getSelectedHTML(); - var sel = editor._getSelection(); - var range = editor._createRange(sel); - var abbr = editor._activeElement(sel); - if(!(abbr != null && abbr.tagName.toLowerCase() == "abbr")) { - abbr = editor._getFirstAncestor(sel, 'abbr'); - } - if (abbr != null && abbr.tagName.toLowerCase() == "abbr") - outparam = { title : abbr.title, - text : abbr.innerHTML}; - else - outparam = { title : '', - text : html}; - - editor._popupDialog( "plugin://Abbreviation/abbreviation", function( param ) { - if ( param ) { - var title = param["title"]; - if (title == "" || title == null) { - if (abbr) { - var child = abbr.innerHTML; - abbr.parentNode.removeChild(abbr); - editor.insertHTML(child); - } - return; - } - try { - var doc = editor._doc; - if (!abbr) { - abbr = doc.createElement("abbr"); - abbr.title = title; - abbr.innerHTML = html; - if (Xinha.is_ie) { - range.pasteHTML(abbr.outerHTML); - } else { - editor.insertNodeAtSelection(abbr); - } - } else { - abbr.title = title; - } - } - catch (e) { } - } - }, outparam); -}; \ No newline at end of file +/* 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); +}; + Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/background-image.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/background-image.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/background-image.js 24 Nov 2007 15:35:32 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/background-image.js 13 May 2008 18:53:46 -0000 1.4 @@ -1,52 +1,31 @@ -// BackgroundImage plugin for Xinha -// Sponsored by http://www.schaffrath-neuemedien.de -// Implementation by Udo Schmal -// based on TinyMCE (http://tinymce.moxiecode.com/) Distributed under LGPL by Moxiecode Systems AB -// -// Distributed under the same terms as Xinha itself. -// This notice MUST stay intact for use (see license.txt). - -function BackgroundImage(editor) { - this.editor = editor; - var cfg = editor.config; - var self = this; - cfg.registerButton({ - id : "bgImage", - tooltip : this._lc("Set page background image"), - image : editor.imgURL("ed_bgimage.gif", "BackgroundImage"), - textMode : false, - action : function(editor) { - self.buttonPress(editor); - } - }) - cfg.addToolbarElement("bgImage", "inserthorizontalrule", 1); -} - -BackgroundImage._pluginInfo = { - name : "BackgroundImage", - version : "1.0", - developer : "Udo Schmal", - developer_url : "http://www.schaffrath-neuemedien.de/", - c_owner : "Udo Schmal & Schaffrath NeueMedien", - sponsor : "L.N.Schaffrath NeueMedien", - sponsor_url : "http://www.schaffrath-neuemedien.de.de/", - license : "htmlArea" -}; - -BackgroundImage.prototype._lc = function(string) { - return Xinha._lc(string, 'BackgroundImage'); -}; - -BackgroundImage.prototype.buttonPress = function(editor) { - //var doc = this.editor._doc; - editor._popupDialog( "plugin://BackgroundImage/bgimage", function( bgImage ) { - if(bgImage) { - if(Xinha.is_ie) editor.focusEditor(); - if(bgImage=="*") { - editor._doc.body.background = ""; - } else { - editor._doc.body.background = bgImage; - } - } - }, null); -}; \ No newline at end of file +/* 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/BackgroundImage/background-image.js */ +function BackgroundImage(_1){ +this.editor=_1; +var _2=_1.config; +var _3=this; +_2.registerButton({id:"bgImage",tooltip:this._lc("Set page background image"),image:_1.imgURL("ed_bgimage.gif","BackgroundImage"),textMode:false,action:function(_4){ +_3.buttonPress(_4); +}}); +_2.addToolbarElement("bgImage","inserthorizontalrule",1); +} +BackgroundImage._pluginInfo={name:"BackgroundImage",version:"1.0",developer:"Udo Schmal",developer_url:"http://www.schaffrath-neuemedien.de/",c_owner:"Udo Schmal & Schaffrath NeueMedien",sponsor:"L.N.Schaffrath NeueMedien",sponsor_url:"http://www.schaffrath-neuemedien.de.de/",license:"htmlArea"}; +BackgroundImage.prototype._lc=function(_5){ +return Xinha._lc(_5,"BackgroundImage"); +}; +BackgroundImage.prototype.buttonPress=function(_6){ +_6._popupDialog("plugin://BackgroundImage/bgimage",function(_7){ +if(_7){ +if(Xinha.is_ie){ +_6.focusEditor(); +} +if(_7=="*"){ +_6._doc.body.background=""; +}else{ +_6._doc.body.background=_7; +} +} +},null); +}; + Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/popups/bgimage.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/popups/bgimage.html,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/popups/bgimage.html 24 Nov 2007 15:35:32 -0000 1.4 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/BackgroundImage/popups/bgimage.html 13 May 2008 18:53:47 -0000 1.5 @@ -1,50 +1,49 @@ - - - -Set Page Background Image - - - - - -
-
Set Page Background Image
- - - - - - - -
-
-
- - + + + +Set Page Background Image + + + + + + +
Set Page Background Image
+ + + + + + + +
+
+
+ +
- - + + \ No newline at end of file Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/CSS/css.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/CSS/Attic/css.js,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/CSS/css.js 24 Nov 2007 15:35:32 -0000 1.6 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/CSS/css.js 13 May 2008 18:53:47 -0000 1.7 @@ -1,4 +1,6 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ +/* 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/CSS/css.js */ Xinha.Config.prototype.cssPluginConfig={combos:[{label:"Syntax",options:{"None":"","Code":"code","String":"string","Comment":"comment","Variable name":"variable-name","Type":"type","Reference":"reference","Preprocessor":"preprocessor","Keyword":"keyword","Function name":"function-name","Html tag":"html-tag","Html italic":"html-helper-italic","Warning":"warning","Html bold":"html-helper-bold"},context:"pre"},{label:"Info",options:{"None":"","Quote":"quote","Highlight":"highlight","Deprecated":"deprecated"}}]}; function CSS(_1,_2){ this.editor=_1; Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/CharCounter/char-counter.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/CharCounter/char-counter.js,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/CharCounter/char-counter.js 24 Nov 2007 15:35:32 -0000 1.7 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/CharCounter/char-counter.js 13 May 2008 18:53:47 -0000 1.8 @@ -1,4 +1,6 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ +/* 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/CharCounter/char-counter.js */ function CharCounter(_1){ this.editor=_1; this._Chars=0; Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/CharacterMap/character-map.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/CharacterMap/character-map.js,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/CharacterMap/character-map.js 24 Nov 2007 15:35:33 -0000 1.7 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/CharacterMap/character-map.js 13 May 2008 18:53:47 -0000 1.8 @@ -1,4 +1,6 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ +/* 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/CharacterMap/character-map.js */ Xinha.loadStyle("CharacterMap.css","CharacterMap"); function CharacterMap(_1){ this.editor=_1; Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/clientside-spellcheck.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/clientside-spellcheck.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/clientside-spellcheck.js 24 Nov 2007 15:35:33 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ClientsideSpellcheck/clientside-spellcheck.js 13 May 2008 18:53:47 -0000 1.4 @@ -1,62 +1,36 @@ -// IE Spell Implementation for XINHA -//Client-side spell check plugin -//This implements the API for ieSpell, which is owned by Red Egg Software -//For more info about ieSpell, go to http://www.iespell.com/index.htm -// Distributed under the same terms as Xinha itself. -// This notice MUST stay intact for use (see license.txt). - - -function ClientsideSpellcheck(editor) { - this.editor = editor; - - var cfg = editor.config; - var bl = ClientsideSpellcheck.btnList; - var self = this; - - // see if we can find the mode switch button, insert this before that - var id = "clientsidespellcheck"; - - - cfg.registerButton(id, this._lc("Spell Check using ieSpell"), editor.imgURL("clientside-spellcheck.gif", "ClientsideSpellcheck"), false, - function(editor, id) { - // dispatch button press event - self.buttonPress(editor, id); - }); - - if(Xinha.is_ie) { - cfg.addToolbarElement("clientsidespellcheck", "print", 1); -} - -} - -ClientsideSpellcheck._pluginInfo = { - name : "ClientsideSpellcheck", - version : "1.0", - developer : "Michael Harris", - developer_url : "http://www.jonesinternational.edu", - c_owner : "Red Egg Software", - sponsor : "Jones International University", - sponsor_url : "http://www.jonesinternational.edu", - license : "htmlArea" -}; - - -ClientsideSpellcheck.prototype._lc = function(string) { - return Xinha._lc(string, 'ClientsideSpellcheck'); -}; - -ClientsideSpellcheck.prototype.buttonPress = function(editor) { - - try { - var tmpis = new ActiveXObject("ieSpell.ieSpellExtension"); - tmpis.CheckAllLinkedDocuments(document); - } - catch(exception) { - if(exception.number==-2146827859) { - if (confirm(this.lc("ieSpell not detected. Click Ok to go to download page."))) - window.open("http://www.iespell.com/download.php","DownLoad"); - } else { - alert(this.lc("ieSpell can only be used in Internet Explorer")); - } - } -}; \ No newline at end of file +/* 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/ClientsideSpellcheck/clientside-spellcheck.js */ +function ClientsideSpellcheck(_1){ +this.editor=_1; +var _2=_1.config; +var bl=ClientsideSpellcheck.btnList; +var _4=this; +var id="clientsidespellcheck"; +_2.registerButton(id,this._lc("Spell Check using ieSpell"),_1.imgURL("clientside-spellcheck.gif","ClientsideSpellcheck"),false,function(_6,id){ +_4.buttonPress(_6,id); +}); +if(Xinha.is_ie){ +_2.addToolbarElement("clientsidespellcheck","print",1); +} +} +ClientsideSpellcheck._pluginInfo={name:"ClientsideSpellcheck",version:"1.0",developer:"Michael Harris",developer_url:"http://www.jonesinternational.edu",c_owner:"Red Egg Software",sponsor:"Jones International University",sponsor_url:"http://www.jonesinternational.edu",license:"htmlArea"}; +ClientsideSpellcheck.prototype._lc=function(_8){ +return Xinha._lc(_8,"ClientsideSpellcheck"); +}; +ClientsideSpellcheck.prototype.buttonPress=function(_9){ +try{ +var _a=new ActiveXObject("ieSpell.ieSpellExtension"); +_a.CheckAllLinkedDocuments(document); +} +catch(exception){ +if(exception.number==-2146827859){ +if(confirm(this.lc("ieSpell not detected. Click Ok to go to download page."))){ +window.open("http://www.iespell.com/download.php","DownLoad"); +} +}else{ +alert(this.lc("ieSpell can only be used in Internet Explorer")); +} +} +}; + Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ContextMenu/context-menu.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ContextMenu/context-menu.js,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ContextMenu/context-menu.js 24 Nov 2007 15:35:33 -0000 1.6 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ContextMenu/context-menu.js 13 May 2008 18:53:47 -0000 1.7 @@ -1,16 +1,22 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ +/* 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/ContextMenu/context-menu.js */ Xinha.loadStyle("menu.css","ContextMenu"); function ContextMenu(_1){ this.editor=_1; } ContextMenu._pluginInfo={name:"ContextMenu",version:"1.0",developer:"Mihai Bazon",developer_url:"http://dynarch.com/mishoo/",c_owner:"dynarch.com",sponsor:"American Bible Society",sponsor_url:"http://www.americanbible.org",license:"htmlArea"}; +Xinha.Config.prototype.ContextMenu={disableMozillaSpellCheck:false}; ContextMenu.prototype.onGenerate=function(){ var _2=this; var _3=this.editordoc=this.editor._iframe.contentWindow.document; Xinha._addEvents(_3,["contextmenu"],function(_4){ return _2.popupMenu(Xinha.is_ie?_2.editor._iframe.contentWindow.event:_4); }); this.currentMenu=null; +if(this.editor.config.ContextMenu.disableMozillaSpellCheck){ +this.editordoc.body.spellcheck=false; +} }; ContextMenu.prototype.getContextMenu=function(_5){ var _6=this; @@ -258,7 +264,7 @@ var _31=this.iePopup=window.createPopup(); doc=_31.document; doc.open(); -doc.write(""); +doc.write(""); doc.close(); } div=doc.createElement("div"); Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/DefinitionList/definition-list.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/DefinitionList/definition-list.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/DefinitionList/definition-list.js 24 Nov 2007 15:35:34 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/DefinitionList/definition-list.js 13 May 2008 18:53:47 -0000 1.4 @@ -1,91 +1,74 @@ -// DefinitionList plugin for Xinha -// Distributed under the same terms as Xinha itself. -// This notice MUST stay intact for use (see license.txt). - - -function DefinitionList(editor) { - this.editor = editor; - var cfg = editor.config; - var bl = DefinitionList.btnList; - var self = this; - // register the toolbar buttons provided by this plugin - var toolbar = ["linebreak"]; - for (var i = 0; i < bl.length; ++i) { - var btn = bl[i]; - if (!btn) { - toolbar.push("separator"); - } else { - var id = btn[0]; - cfg.registerButton(id, this._lc(btn[1]), editor.imgURL("ed_" + btn[0] + ".gif", "DefinitionList"), false, - function(editor, id) { - // dispatch button press event - self.buttonPress(editor, id); - }); - toolbar.push(id); - } - } - // add a new line in the toolbar - cfg.toolbar.push(toolbar); +/* 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/DefinitionList/definition-list.js */ +function DefinitionList(_1){ +this.editor=_1; +var _2=_1.config; +var bl=DefinitionList.btnList; +var _4=this; +var _5=["linebreak"]; +for(var i=0;i"+_1c+""); +this.editor.insertHTML(""+_1b+""); } } } -if(!Xinha.is_ie){ -AMprocessNode(this.editor._doc.body,false); +if(this.enabled){ +this.parse(); } } }; Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/example.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/example.html,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/example.html 24 Nov 2007 15:35:35 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/example.html 13 May 2008 18:53:48 -0000 1.4 @@ -36,8 +36,8 @@

`int_a^bf(x)dx`

`[[a,b],[c,d]]`

- ASCIIMathML by Peter Jipsen, -Chapman University
+ ASCIIMathML by Peter Jipsen, +Chapman University
For more information on AsciiMathML visit this page: http://www1.chapman.edu/~jipsen/mathml/asciimath.html

Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/readme.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/readme.txt,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/readme.txt 2 Feb 2007 21:04:51 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/readme.txt 13 May 2008 18:53:48 -0000 1.2 @@ -8,15 +8,14 @@ Usage The formmulae are stored in their ASCII representation, so you have to include the - ASCIIMathML library which can be found in the plugin folder in order render the MathML output in your pages. + ASCIIMathML library which can be found in the plugin folder in order to render the MathML output in your pages. Example (also see example.html): var mathcolor = "black"; // You may change the color of the formulae (default: red) var mathfontfamily = "Arial"; //and the font (default: serif, which is good I think) var showasciiformulaonhover = false; // if true helps students learn ASCIIMath (default:true) - The recommended browser for using this plugin is Mozilla/Firefox. At the moment showing the MathML output inside the editor is not supported in Internet Explorer. Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/lang/de.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/lang/de.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/lang/de.js 24 Nov 2007 15:35:35 -0000 1.3 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/lang/de.js 13 May 2008 18:53:48 -0000 1.4 @@ -18,6 +18,6 @@ "Preview":"Vorschau", "Based on ASCIIMathML by ": "Basiert auf ASCIIMathML von ", "For more information on AsciiMathML visit this page: ":"Für weitere Informationen besuchen Sie bitte diese Seite: ", - 'Attention Internet Explorer users: Please note that there is no WYSIWYG representation of the formula in the editor!
You might wish to use Mozilla Firefox instead.' : 'Achtung Internet Explorer-Benutzer: Die Formel wird im Editor nicht als WYSIWYG dargestellt.
Benutzen Sie Mozilla Firefox als Alternative.', + 'Attention Internet Explorer users: Please note that there is no WYSIWYG representation of the formula in the editor!
You might wish to use Mozilla Firefox instead.' : 'Achtung Internet Explorer-Benutzer: Die Formel wird im Editor nicht als WYSIWYG dargestellt.
Benutzen Sie Mozilla Firefox als Alternative.', "Show MathML" : "Zeige MathML" } Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/popups/dialog.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/popups/dialog.html,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/popups/dialog.html 24 Nov 2007 15:35:35 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/Equation/popups/dialog.html 13 May 2008 18:53:48 -0000 1.3 @@ -79,6 +79,7 @@ mathcolor = cfg.Equation.mathcolor; mathfontfamily = cfg.Equation.mathfontfamily; + translate(); var inputField = document.getElementById("inputText"); if (param["editedNode"] && param["editedNode"].tagName.toLowerCase() == 'span') @@ -346,7 +347,7 @@ Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/config.inc.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/config.inc.php,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/config.inc.php 25 Feb 2007 19:06:13 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/config.inc.php 13 May 2008 18:53:49 -0000 1.3 @@ -25,8 +25,8 @@ * Getting the mode for further differentiation */ -if(empty($insertMode)) - $insertMode="image"; +if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; + if(!isset($insertMode)) $insertMode="image"; /** * Default backend URL @@ -64,16 +64,18 @@ /* The URL to the above path, the web browser needs to be able to see it. - It can be protected via .htaccess on apache or directory permissions on IIS, - check you web server documentation for futher information on directory protection - If this directory needs to be publicly accessiable, remove scripting capabilities - for this directory (i.e. disable PHP, Perl, CGI). We only want to store assets - in this directory and its subdirectories. + Please remove scripting capabilities in this directory + for this directory (i.e. disable PHP, Perl, CGI; see .htaccess file in demo_images folder). */ $IMConfig['images_url'] = str_replace( array("backend.php","manager.php"), "", $_SERVER["PHP_SELF"] ) . $IMConfig['images_dir']; //$IMConfig['files_url'] = 'url/to/files_dir'; /* + Format of the Date Modified in list view. + It has to be a string understood by the PHP date() function (for possible values see http://http://php.net/manual/en/function.date.php) +*/ +$IMConfig['date_format'] = "d.m.y H:i"; +/* Possible values: true, false TRUE - If PHP on the web server is in safe mode, set this to true. @@ -122,7 +124,8 @@ your server and PHP must be able to execute them (i.e. safe mode is OFF). GD does not require the following definition. */ -define('IMAGE_TRANSFORM_LIB_PATH', 'C:/"Program Files"/ImageMagick-5.5.7-Q16/'); +define('IMAGE_TRANSFORM_LIB_PATH', '/usr/bin/'); +//define('IMAGE_TRANSFORM_LIB_PATH', 'C:/"Program Files"/ImageMagick-5.5.7-Q16/'); /* @@ -287,7 +290,7 @@ "max" - the maximum allowed by the server (the value is retrieved from the server configuration). */ -$IMConfig['max_filesize_kb_image'] = 2000000; +$IMConfig['max_filesize_kb_image'] = 200; $IMConfig['max_filesize_kb_link'] = 5000; Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/editor.php =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/editor.php,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/editor.php 14 Jun 2007 01:36:55 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/editor.php 13 May 2008 18:53:49 -0000 1.3 @@ -4,7 +4,8 @@ * Authors: Wei Zhuo, Afru, Krzysztof Kotowicz * Version: Updated on 08-01-2005 by Afru * Version: Updated on 21-06-2006 by Krzysztof Kotowicz - * Package: ExtendedFileManager (EFM 1.1.1) + * Version: Updated on 20-01-2008 by Raimund Meyer + * Package: ExtendedFileManager (EFM 1.4) * http://www.afrusoft.com/htmlarea */ if(isset($_REQUEST['mode'])) $insertMode=$_REQUEST['mode']; @@ -22,7 +23,7 @@ - + Xinha Image Editor @@ -40,111 +41,132 @@ -
- -
-
-