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 -N -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/Xinha.css 2 Feb 2007 21:04:44 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/Xinha.css 25 Feb 2007 19:06:05 -0000 1.2 @@ -1,4 +1,4 @@ -.htmlarea { background: #fff; margin:2px; } +.htmlarea { background: #fff; } .htmlarea .toolbar { cursor: default; @@ -86,6 +86,7 @@ background-color: ButtonFace; color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; + height:16px; } .htmlarea .statusBar .statusBarTree a { 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 -N -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/XinhaCore.js 2 Feb 2007 21:04:44 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/XinhaCore.js 25 Feb 2007 19:06:05 -0000 1.2 @@ -1,5758 +1,3473 @@ - - /*--------------------------------------: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. - -- - -- Developers - Coding Style: - -- For the sake of not committing needlessly conflicting changes, - -- - -- * New code to be indented with 2 spaces ("soft tab"). - -- * New code preferably uses BSD-Style Bracing - -- if ( foo ) - -- { - -- bar(); - -- } - -- * Don't change brace styles unless you're working on the non BSD-Style - -- area (so we don't get spurious changes in line numbering). - -- * Don't change indentation unless you're working on the badly indented - -- area (so we don't get spurious changes of large blocks of code). - -- * Jedit is the recommended editor, a comment of this format should be - -- included in the top 10 lines of the file (see the embedded edit mode) - -- - -- $HeadURL: http://svn.xinha.python-hosting.com/trunk/XinhaCore.js $ - -- $LastChangedDate: 2007-01-31 02:09:44 +1300 (Wed, 31 Jan 2007) $ - -- $LastChangedRevision: 707 $ - -- $LastChangedBy: ray $ - --------------------------------------------------------------------------*/ +Xinha.version={"Release":"Trunk","Head":"$HeadURL: http://svn.xinha.python-hosting.com/tags/0.92beta/XinhaCore.js $".replace(/^[^:]*: (.*) \$$/,"$1"),"Date":"$LastChangedDate: 2007-02-22 02:11:56 +0100 (Do, 22 Feb 2007) $".replace(/^[^:]*: ([0-9-]*) ([0-9:]*) ([+0-9]*) \((.*)\) \$/,"$4 $2 $3"),"Revision":"$LastChangedRevision: 757 $".replace(/^[^:]*: (.*) \$$/,"$1"),"RevisionBy":"$LastChangedBy: ray $".replace(/^[^:]*: (.*) \$$/,"$1")}; +Xinha._resolveRelativeUrl=function(_1,_2){ +if(_2.match(/^([^:]+\:)?\//)){ +return _2; +}else{ +var b=_1.split("/"); +if(b[b.length-1]==""){ +b.pop(); +} +var p=_2.split("/"); +if(p[0]=="."){ +p.shift(); +} +while(p[0]==".."){ +b.pop(); +p.shift(); +} +return b.join("/")+"/"+p.join("/"); +} +}; +if(typeof _editor_url=="string"){ +_editor_url=_editor_url.replace(/\x2f*$/,"/"); +if(!_editor_url.match(/^([^:]+\:)?\//)){ +var path=window.location.toString().split("/"); +path.pop(); +_editor_url=Xinha._resolveRelativeUrl(path.join("/"),_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=""; +} +if(typeof _editor_lang=="string"){ +_editor_lang=_editor_lang.toLowerCase(); +}else{ +_editor_lang="en"; +} +if(typeof _editor_skin!=="string"){ +_editor_skin=""; +} +var __xinhas=[]; +Xinha.agt=navigator.userAgent.toLowerCase(); +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.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.isRunLocally=document.URL.toLowerCase().search(/^file:/)!=-1; +if(Xinha.isRunLocally){ +alert("Xinha *must* be installed on a web server. Locally opened files (those that use the \"file://\" protocol) cannot properly function. Xinha will try to initialize but may not be correctly loaded."); +} +function Xinha(_5,_6){ +if(!_5){ +throw ("Tried to create Xinha without textarea specified."); +} +if(Xinha.checkSupportedBrowser()){ +if(typeof _6=="undefined"){ +this.config=new Xinha.Config(); +}else{ +this.config=_6; +} +this._htmlArea=null; +if(typeof _5!="object"){ +_5=Xinha.getElementById("textarea",_5); +} +this._textArea=_5; +this._textArea.spellcheck=false; +this._initial_ta_size={w:_5.style.width?_5.style.width:(_5.offsetWidth?(_5.offsetWidth+"px"):(_5.cols+"em")),h:_5.style.height?_5.style.height:(_5.offsetHeight?(_5.offsetHeight+"px"):(_5.rows+"em"))}; +if(this.config.showLoading){ +var _7=document.createElement("div"); +_7.id="loading_"+_5.name; +_7.className="loading"; +try{ +_7.style.width=_5.offsetWidth+"px"; +} +catch(ex){ +_7.style.width=this._initial_ta_size.w; +} +_7.style.left=Xinha.findPosX(_5)+"px"; +_7.style.top=(Xinha.findPosY(_5)+parseInt(this._initial_ta_size.h,10)/2)+"px"; +var _8=document.createElement("div"); +_8.className="loading_main"; +_8.id="loading_main_"+_5.name; +_8.appendChild(document.createTextNode(Xinha._lc("Loading in progress. Please wait !"))); +var _9=document.createElement("div"); +_9.className="loading_sub"; +_9.id="loading_sub_"+_5.name; +_9.appendChild(document.createTextNode(Xinha._lc("Constructing main object"))); +_7.appendChild(_8); +_7.appendChild(_9); +document.body.appendChild(_7); +this.setLoadingMessage("Constructing object"); +} +this._editMode="wysiwyg"; +this.plugins={}; +this._timerToolbar=null; +this._timerUndo=null; +this._undoQueue=[this.config.undoSteps]; +this._undoPos=-1; +this._customUndo=true; +this._mdoc=document; +this.doctype=""; +this.__htmlarea_id_num=__xinhas.length; +__xinhas[this.__htmlarea_id_num]=this; +this._notifyListeners={}; +var _a={right:{on:true,container:document.createElement("td"),panels:[]},left:{on:true,container:document.createElement("td"),panels:[]},top:{on:true,container:document.createElement("td"),panels:[]},bottom:{on:true,container:document.createElement("td"),panels:[]}}; +for(var i in _a){ +if(!_a[i].container){ +continue; +} +_a[i].div=_a[i].container; +_a[i].container.className="panels "+i; +Xinha.freeLater(_a[i],"container"); +Xinha.freeLater(_a[i],"div"); +} +this._panels=_a; +Xinha.freeLater(this,"_textArea"); +} +} +Xinha.onload=function(){ +}; +Xinha.init=function(){ +Xinha.onload(); +}; +Xinha.RE_tagName=/(<\/|<)\s*([^ \t\n>]+)/ig; +Xinha.RE_doctype=/()\n?/i; +Xinha.RE_head=/
((.|\n)*?)<\/head>/i; +Xinha.RE_body=/]*>((.|\n|\r|\t)*?)<\/body>/i; +Xinha.RE_Specials=/([\/\^$*+?.()|{}[\]])/g; +Xinha.RE_email=/[_a-zA-Z\d\-\.]{3,}@[_a-zA-Z\d\-]{2,}(\.[_a-zA-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 _c=this; +this.version=Xinha.version.Revision; +this.width="auto"; +this.height="auto"; +this.sizeIncludesBars=true; +this.sizeIncludesPanels=true; +this.panel_dimensions={left:"200px",right:"200px",top:"100px",bottom:"100px"}; +this.statusBar=true; +this.htmlareaPaste=false; +this.mozParaHandler="best"; +this.getHtmlMethod="DOMwalk"; +this.undoSteps=20; +this.undoTimeout=500; +this.changeJustifyWithDirection=false; +this.fullPage=false; +this.pageStyle=""; +this.pageStyleSheets=[]; +this.baseHref=null; +this.expandRelativeUrl=true; +this.stripBaseHref=true; +this.stripSelfNamedAnchors=true; +this.only7BitPrintablesInURLs=true; +this.sevenBitClean=false; +this.specialReplacements={}; +this.killWordOnPaste=true; +this.makeLinkShowsTarget=true; +this.charSet=Xinha.is_gecko?document.characterSet:document.charset; +this.imgURL="images/"; +this.popupURL="popups/"; +this.htmlRemoveTags=null; +this.flowToolbars=true; +this.showLoading=false; +this.stripScripts=true; +this.convertUrlsToLinks=true; +this.colorPickerCellSize="6px"; +this.colorPickerGranularity=18; +this.colorPickerPosition="bottom,right"; +this.colorPickerWebSafe=false; +this.colorPickerSaveColors=20; +this.fullScreen=false; +this.fullScreenMargins=[0,0,0,0]; +this.toolbar=[["popupeditor"],["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"],["separator","forecolor","hilitecolor","textindicator"],["separator","subscript","superscript"],["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],["separator","insertorderedlist","insertunorderedlist","outdent","indent"],["separator","inserthorizontalrule","createlink","insertimage","inserttable"],["linebreak","separator","undo","redo","selectall","print"],(Xinha.is_gecko?[]:["cut","copy","paste","overwrite","saveas"]),["separator","killword","clearfonts","removeformat","toggleborders","splitblock","lefttoright","righttoleft"],["separator","htmlmode","showhelp","about"]]; +this.fontname={"— font —":"","Arial":"arial,helvetica,sans-serif","Courier New":"courier new,courier,monospace","Georgia":"georgia,times new roman,times,serif","Tahoma":"tahoma,arial,helvetica,sans-serif","Times New Roman":"times new roman,times,serif","Verdana":"verdana,arial,helvetica,sans-serif","impact":"impact","WingDings":"wingdings"}; +this.fontsize={"— size —":"","1 (8 pt)":"1","2 (10 pt)":"2","3 (12 pt)":"3","4 (14 pt)":"4","5 (18 pt)":"5","6 (24 pt)":"6","7 (36 pt)":"7"}; +this.formatblock={"— format —":"","Heading 1":"h1","Heading 2":"h2","Heading 3":"h3","Heading 4":"h4","Heading 5":"h5","Heading 6":"h6","Normal":"p","Address":"address","Formatted":"pre"}; +this.customSelects={}; +function cut_copy_paste(e,_e,_f){ +e.execCommand(_e); +} +this.debug=true; +this.URIs={"blank":"popups/blank.html","link":_editor_url+"modules/CreateLink/link.html","insert_image":_editor_url+"modules/InsertImage/insert_image.html","insert_table":_editor_url+"modules/InsertTable/insert_table.html","select_color":"select_color.html","about":"about.html","help":"editor_help.html"}; +this.btnList={bold:["Bold",Xinha._lc({key:"button_bold",string:["ed_buttons_main.gif",3,2]},"Xinha"),false,function(e){ +e.execCommand("bold"); +}],italic:["Italic",Xinha._lc({key:"button_italic",string:["ed_buttons_main.gif",2,2]},"Xinha"),false,function(e){ +e.execCommand("italic"); +}],underline:["Underline",Xinha._lc({key:"button_underline",string:["ed_buttons_main.gif",2,0]},"Xinha"),false,function(e){ +e.execCommand("underline"); +}],strikethrough:["Strikethrough",Xinha._lc({key:"button_strikethrough",string:["ed_buttons_main.gif",3,0]},"Xinha"),false,function(e){ +e.execCommand("strikethrough"); +}],subscript:["Subscript",Xinha._lc({key:"button_subscript",string:["ed_buttons_main.gif",3,1]},"Xinha"),false,function(e){ +e.execCommand("subscript"); +}],superscript:["Superscript",Xinha._lc({key:"button_superscript",string:["ed_buttons_main.gif",2,1]},"Xinha"),false,function(e){ +e.execCommand("superscript"); +}],justifyleft:["Justify Left",["ed_buttons_main.gif",0,0],false,function(e){ +e.execCommand("justifyleft"); +}],justifycenter:["Justify Center",["ed_buttons_main.gif",1,1],false,function(e){ +e.execCommand("justifycenter"); +}],justifyright:["Justify Right",["ed_buttons_main.gif",1,0],false,function(e){ +e.execCommand("justifyright"); +}],justifyfull:["Justify Full",["ed_buttons_main.gif",0,1],false,function(e){ +e.execCommand("justifyfull"); +}],orderedlist:["Ordered List",["ed_buttons_main.gif",0,3],false,function(e){ +e.execCommand("insertorderedlist"); +}],unorderedlist:["Bulleted List",["ed_buttons_main.gif",1,3],false,function(e){ +e.execCommand("insertunorderedlist"); +}],insertorderedlist:["Ordered List",["ed_buttons_main.gif",0,3],false,function(e){ +e.execCommand("insertorderedlist"); +}],insertunorderedlist:["Bulleted List",["ed_buttons_main.gif",1,3],false,function(e){ +e.execCommand("insertunorderedlist"); +}],outdent:["Decrease Indent",["ed_buttons_main.gif",1,2],false,function(e){ +e.execCommand("outdent"); +}],indent:["Increase Indent",["ed_buttons_main.gif",0,2],false,function(e){ +e.execCommand("indent"); +}],forecolor:["Font Color",["ed_buttons_main.gif",3,3],false,function(e){ +e.execCommand("forecolor"); +}],hilitecolor:["Background Color",["ed_buttons_main.gif",2,3],false,function(e){ +e.execCommand("hilitecolor"); +}],undo:["Undoes your last action",["ed_buttons_main.gif",4,2],false,function(e){ +e.execCommand("undo"); +}],redo:["Redoes your last action",["ed_buttons_main.gif",5,2],false,function(e){ +e.execCommand("redo"); +}],cut:["Cut selection",["ed_buttons_main.gif",5,0],false,cut_copy_paste],copy:["Copy selection",["ed_buttons_main.gif",4,0],false,cut_copy_paste],paste:["Paste from clipboard",["ed_buttons_main.gif",4,1],false,cut_copy_paste],selectall:["Select all","ed_selectall.gif",false,function(e){ +e.execCommand("selectall"); +}],inserthorizontalrule:["Horizontal Rule",["ed_buttons_main.gif",6,0],false,function(e){ +e.execCommand("inserthorizontalrule"); +}],createlink:["Insert Web Link",["ed_buttons_main.gif",6,1],false,function(e){ +e._createLink(); +}],insertimage:["Insert/Modify Image",["ed_buttons_main.gif",6,3],false,function(e){ +e.execCommand("insertimage"); +}],inserttable:["Insert Table",["ed_buttons_main.gif",6,2],false,function(e){ +e.execCommand("inserttable"); +}],htmlmode:["Toggle HTML Source",["ed_buttons_main.gif",7,0],true,function(e){ +e.execCommand("htmlmode"); +}],toggleborders:["Toggle Borders",["ed_buttons_main.gif",7,2],false,function(e){ +e._toggleBorders(); +}],print:["Print document",["ed_buttons_main.gif",8,1],false,function(e){ +if(Xinha.is_gecko){ +e._iframe.contentWindow.print(); +}else{ +e.focusEditor(); +print(); +} +}],saveas:["Save as","ed_saveas.gif",false,function(e){ +e.execCommand("saveas",false,"noname.htm"); +}],about:["About this editor",["ed_buttons_main.gif",8,2],true,function(e){ +e.execCommand("about"); +}],showhelp:["Help using editor",["ed_buttons_main.gif",9,2],true,function(e){ +e.execCommand("showhelp"); +}],splitblock:["Split Block","ed_splitblock.gif",false,function(e){ +e._splitBlock(); +}],lefttoright:["Direction left to right",["ed_buttons_main.gif",0,4],false,function(e){ +e.execCommand("lefttoright"); +}],righttoleft:["Direction right to left",["ed_buttons_main.gif",1,4],false,function(e){ +e.execCommand("righttoleft"); +}],overwrite:["Insert/Overwrite","ed_overwrite.gif",false,function(e){ +e.execCommand("overwrite"); +}],wordclean:["MS Word Cleaner",["ed_buttons_main.gif",5,3],false,function(e){ +e._wordClean(); +}],clearfonts:["Clear Inline Font Specifications",["ed_buttons_main.gif",5,4],true,function(e){ +e._clearFonts(); +}],removeformat:["Remove formatting",["ed_buttons_main.gif",4,4],false,function(e){ +e.execCommand("removeformat"); +}],killword:["Clear MSOffice tags",["ed_buttons_main.gif",4,3],false,function(e){ +e.execCommand("killword"); +}]}; +for(var i in this.btnList){ +var btn=this.btnList[i]; +if(typeof btn!="object"){ +continue; +} +if(typeof btn[1]!="string"){ +btn[1][0]=_editor_url+this.imgURL+btn[1][0]; +}else{ +btn[1]=_editor_url+this.imgURL+btn[1]; +} +btn[0]=Xinha._lc(btn[0]); +} +}; +Xinha.Config.prototype.registerButton=function(id,_3a,_3b,_3c,_3d,_3e){ +var _3f; +if(typeof id=="string"){ +_3f=id; +}else{ +if(typeof id=="object"){ +_3f=id.id; +}else{ +alert("ERROR [Xinha.Config::registerButton]:\ninvalid arguments"); +return false; +} +} +switch(typeof id){ +case "string": +this.btnList[id]=[_3a,_3b,_3c,_3d,_3e]; +break; +case "object": +this.btnList[id.id]=[id.tooltip,id.image,id.textMode,id.action,id.context]; +break; +} +}; +Xinha.prototype.registerPanel=function(_40,_41){ +if(!_40){ +_40="right"; +} +this.setLoadingMessage("Register panel "+_40); +var _42=this.addPanel(_40); +if(_41){ +_41.drawPanelIn(_42); +} +}; +Xinha.Config.prototype.registerDropdown=function(_43){ +this.customSelects[_43.id]=_43; +}; +Xinha.Config.prototype.hideSomeButtons=function(_44){ +var _45=this.toolbar; +for(var i=_45.length;--i>=0;){ +var _47=_45[i]; +for(var j=_47.length;--j>=0;){ +if(_44.indexOf(" "+_47[j]+" ")>=0){ +var len=1; +if(/separator|space/.test(_47[j+1])){ +len=2; +} +_47.splice(j,len); +} +} +} +}; +Xinha.Config.prototype.addToolbarElement=function(id,_4b,_4c){ +var _4d=this.toolbar; +var a,i,j,o,sid; +var _4f=false; +var _50=false; +var _51=0; +var _52=0; +var _53=0; +var _54=false; +var _55=false; +if((id&&typeof id=="object")&&(id.constructor==Array)){ +_4f=true; +} +if((_4b&&typeof _4b=="object")&&(_4b.constructor==Array)){ +_50=true; +_51=_4b.length; +} +if(_4f){ +for(i=0;i