You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2009/09/27 05:11:43 UTC

svn commit: r819248 [6/8] - in /roller/trunk/apps/weblogger/web/roller-ui/authoring/editors: ./ xinha-0.95/ xinha-0.95/examples/ xinha-0.95/images/ xinha-0.95/images/de/ xinha-0.95/images/fr/ xinha-0.95/lang/ xinha-0.95/modules/ xinha-0.95/modules/Colo...

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Dialogs/panel-dialog.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Dialogs/panel-dialog.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Dialogs/panel-dialog.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Dialogs/panel-dialog.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,51 @@
+/* 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);
+};
+}else{
+this._lc=function(_7){
+return _7;
+};
+}
+}
+_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>(.*?)<\/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;
+

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Dialogs/popupwin.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Dialogs/popupwin.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Dialogs/popupwin.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Dialogs/popupwin.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,123 @@
+/* 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;
+var _5=window.open("","__ha_dialog","toolbar=no,menubar=no,personalbar=no,width=600,height=600,left=20,top=40,scrollbars=no,resizable=yes");
+this.window=_5;
+var _6=_5.document;
+this.doc=_6;
+var _7=this;
+var _8=document.baseURI||document.URL;
+if(_8&&_8.match(/(.*)\/([^\/]+)/)){
+_8=RegExp.$1+"/";
+}
+if(typeof _editor_url!="undefined"&&!(/^\//.test(_editor_url))&&!(/http:\/\//.test(_editor_url))){
+_8+=_editor_url;
+}else{
+_8=_editor_url;
+}
+if(!(/\/$/.test(_8))){
+_8+="/";
+}
+this.baseURL=_8;
+_6.open();
+var _9="<html><head><title>"+_2+"</title>\n";
+_9+="<style type=\"text/css\">@import url("+_editor_url+"Xinha.css);</style>\n";
+if(_editor_skin!=""){
+_9+="<style type=\"text/css\">@import url("+_editor_url+"skins/"+_editor_skin+"/skin.css);</style>\n";
+}
+_9+="</head>\n";
+_9+="<body class=\"dialog popupwin\" id=\"--HA-body\"></body></html>";
+_6.write(_9);
+_6.close();
+function init2(){
+var _a=_6.body;
+if(!_a){
+setTimeout(init2,25);
+return false;
+}
+_5.title=_2;
+_6.documentElement.style.padding="0px";
+_6.documentElement.style.margin="0px";
+var _b=_6.createElement("div");
+_b.className="content";
+_7.content=_b;
+_a.appendChild(_b);
+_7.element=_a;
+_4(_7);
+_5.focus();
+}
+init2();
+}
+PopupWin.prototype.callHandler=function(){
+var _c=["input","textarea","select"];
+var _d={};
+for(var ti=_c.length;--ti>=0;){
+var _f=_c[ti];
+var els=this.content.getElementsByTagName(_f);
+for(var j=0;j<els.length;++j){
+var el=els[j];
+var val=el.value;
+if(el.tagName.toLowerCase()=="input"){
+if(el.type=="checkbox"){
+val=el.checked;
+}
+}
+_d[el.name]=val;
+}
+}
+this.handler(this,_d);
+return false;
+};
+PopupWin.prototype.close=function(){
+this.window.close();
+};
+PopupWin.prototype.addButtons=function(){
+var _14=this;
+var div=this.doc.createElement("div");
+this.content.appendChild(div);
+div.id="buttons";
+div.className="buttons";
+for(var i=0;i<arguments.length;++i){
+var btn=arguments[i];
+var _18=this.doc.createElement("button");
+div.appendChild(_18);
+_18.innerHTML=Xinha._lc(btn,"Xinha");
+switch(btn.toLowerCase()){
+case "ok":
+Xinha.addDom0Event(_18,"click",function(){
+_14.callHandler();
+_14.close();
+return false;
+});
+break;
+case "cancel":
+Xinha.addDom0Event(_18,"click",function(){
+_14.close();
+return false;
+});
+break;
+}
+}
+};
+PopupWin.prototype.showAtElement=function(){
+var _19=this;
+setTimeout(function(){
+var w=_19.content.offsetWidth+4;
+var h=_19.content.offsetHeight+4;
+var el=_19.content;
+var s=el.style;
+s.position="absolute";
+s.left=parseInt((w-el.offsetWidth)/2,10)+"px";
+s.top=parseInt((h-el.offsetHeight)/2,10)+"px";
+if(Xinha.is_gecko){
+_19.window.innerWidth=w;
+_19.window.innerHeight=h;
+}else{
+_19.window.resizeTo(w+8,h+70);
+}
+},25);
+};
+

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/full-screen.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/full-screen.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/full-screen.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/full-screen.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,139 @@
+/* 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;
+cfg=_1.config;
+cfg.registerButton("fullscreen",this._lc("Maximize/Minimize Editor"),[_editor_url+cfg.imgURL+"ed_buttons_main.gif",8,0],true,function(e,_4,_5){
+e._fullScreen();
+});
+cfg.addToolbarElement("fullscreen","popupeditor",0);
+}
+FullScreen._pluginInfo={name:"FullScreen",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/"};
+FullScreen.prototype._lc=function(_6){
+return Xinha._lc(_6,{url:_editor_url+"modules/FullScreen/lang/",context:"FullScreen"});
+};
+Xinha.prototype._fullScreen=function(){
+var e=this;
+function sizeItUp(){
+if(!e._isFullScreen||e._sizing){
+return false;
+}
+e._sizing=true;
+var _8=Xinha.viewportSize();
+var h=_8.y-e.config.fullScreenMargins[0]-e.config.fullScreenMargins[2];
+var w=_8.x-e.config.fullScreenMargins[1]-e.config.fullScreenMargins[3];
+e.sizeEditor(w+"px",h+"px",true,true);
+e._sizing=false;
+if(e._toolbarObjects.fullscreen){
+e._toolbarObjects.fullscreen.swapImage([_editor_url+cfg.imgURL+"ed_buttons_main.gif",9,0]);
+}
+}
+function sizeItDown(){
+if(e._isFullScreen||e._sizing){
+return false;
+}
+e._sizing=true;
+e.initSize();
+e._sizing=false;
+if(e._toolbarObjects.fullscreen){
+e._toolbarObjects.fullscreen.swapImage([_editor_url+cfg.imgURL+"ed_buttons_main.gif",8,0]);
+}
+}
+function resetScroll(){
+if(e._isFullScreen){
+window.scroll(0,0);
+window.setTimeout(resetScroll,150);
+}
+}
+if(typeof this._isFullScreen=="undefined"){
+this._isFullScreen=false;
+if(e.target!=e._iframe){
+Xinha._addEvent(window,"resize",sizeItUp);
+}
+}
+if(Xinha.is_gecko){
+this.deactivateEditor();
+}
+if(this._isFullScreen){
+this._htmlArea.style.position="";
+if(!Xinha.is_ie){
+this._htmlArea.style.border="";
+}
+try{
+if(Xinha.is_ie&&document.compatMode=="CSS1Compat"){
+var _b=document.getElementsByTagName("html");
+}else{
+var _b=document.getElementsByTagName("body");
+}
+_b[0].style.overflow="";
+}
+catch(e){
+}
+this._isFullScreen=false;
+sizeItDown();
+var _c=this._htmlArea;
+while((_c=_c.parentNode)&&_c.style){
+_c.style.position=_c._xinha_fullScreenOldPosition;
+_c._xinha_fullScreenOldPosition=null;
+}
+if(Xinha.ie_version<7){
+var _d=document.getElementsByTagName("select");
+for(var i=0;i<_d.length;++i){
+_d[i].style.visibility="visible";
+}
+}
+window.scroll(this._unScroll.x,this._unScroll.y);
+}else{
+this._unScroll={x:(window.pageXOffset)?(window.pageXOffset):(document.documentElement)?document.documentElement.scrollLeft:document.body.scrollLeft,y:(window.pageYOffset)?(window.pageYOffset):(document.documentElement)?document.documentElement.scrollTop:document.body.scrollTop};
+var _c=this._htmlArea;
+while((_c=_c.parentNode)&&_c.style){
+_c._xinha_fullScreenOldPosition=_c.style.position;
+_c.style.position="static";
+}
+if(Xinha.ie_version<7){
+var _d=document.getElementsByTagName("select");
+var s,currentEditor;
+for(var i=0;i<_d.length;++i){
+s=_d[i];
+currentEditor=false;
+while(s=s.parentNode){
+if(s==this._htmlArea){
+currentEditor=true;
+break;
+}
+}
+if(!currentEditor&&_d[i].style.visibility!="hidden"){
+_d[i].style.visibility="hidden";
+}
+}
+}
+window.scroll(0,0);
+this._htmlArea.style.position="absolute";
+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&&!Xinha.is_webkit){
+this._htmlArea.style.border="none";
+}
+this._isFullScreen=true;
+resetScroll();
+try{
+if(Xinha.is_ie&&document.compatMode=="CSS1Compat"){
+var _b=document.getElementsByTagName("html");
+}else{
+var _b=document.getElementsByTagName("body");
+}
+_b[0].style.overflow="hidden";
+}
+catch(e){
+}
+sizeItUp();
+}
+if(Xinha.is_gecko){
+this.activateEditor();
+}
+this.focusEditor();
+};
+

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/de.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/de.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/de.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/de.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "de", ENCODING: UTF-8
+// translated: Raimund Meyer xinha@ray-of-light.org
+{
+  "Maximize/Minimize Editor": "Editor maximieren/verkleinern"
+};

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/fr.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/fr.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/fr.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/fr.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,5 @@
+// I18N constants
+// LANG: "fr", ENCODING: UTF-8
+{
+  "Maximize/Minimize Editor": "Agrandir/Réduire l'éditeur"
+};
\ No newline at end of file

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/ja.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/ja.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/ja.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/ja.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,5 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Maximize/Minimize Editor": "エディタの最大化/最小化"
+};
\ No newline at end of file

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/nb.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/nb.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/nb.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/nb.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "nb", ENCODING: UTF-8
+// translated: Kim Steinhaug, http://www.steinhaug.com/, kim@steinhaug.com
+{
+  "Maximize/Minimize Editor": "Maksimer/Minimer WYSIWYG vindu"
+};
\ No newline at end of file

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/pl.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/pl.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/pl.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/pl.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "pl", ENCODING: UTF-8
+// translated: Krzysztof Kotowicz, koto1sa@o2.pl, http://www.eskot.krakow.pl/portfolio
+{
+  "Maximize/Minimize Editor": "Maksymalizuj/minimalizuj edytor"
+};

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/pt_br.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/pt_br.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/pt_br.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/pt_br.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,18 @@
+// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <ma...@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Maximize/Minimize Editor": "Maximizar/Minimizar Editor"
+};

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/ru.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/ru.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/ru.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/ru.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "ru", ENCODING: UTF-8
+// Author: Andrei Blagorazumov, a@fnr.ru
+{
+  "Maximize/Minimize Editor": "Развернуть/Свернуть редактор"
+};
\ No newline at end of file

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/sv.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/sv.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/sv.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/FullScreen/lang/sv.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,6 @@
+// I18N constants
+// LANG: "sv" (Swedish), ENCODING: UTF-8
+// translated: Erik Dalén, <da...@jpl.se>
+{
+  "Maximize/Minimize Editor": "Maximera/Minimera WYSIWYG fönster"
+};

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Gecko/Gecko.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Gecko/Gecko.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Gecko/Gecko.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Gecko/Gecko.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,461 @@
+/* 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;
+}
+Gecko.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;
+};
+Gecko.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);
+};
+Gecko.prototype.inwardHtml=function(_25){
+_25=_25.replace(/<(\/?)strong(\s|>|\/)/ig,"<$1b$2");
+_25=_25.replace(/<(\/?)em(\s|>|\/)/ig,"<$1i$2");
+_25=_25.replace(/<(\/?)del(\s|>|\/)/ig,"<$1strike$2");
+return _25;
+};
+Gecko.prototype.outwardHtml=function(_26){
+_26=_26.replace(/<script[\s]*src[\s]*=[\s]*['"]chrome:\/\/.*?["']>[\s]*<\/script>/ig,"");
+return _26;
+};
+Gecko.prototype.onExecCommand=function(_27,UI,_29){
+try{
+this.editor._doc.execCommand("useCSS",false,true);
+this.editor._doc.execCommand("styleWithCSS",false,false);
+}
+catch(ex){
+}
+switch(_27){
+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<els.length;i++){
+el=els[i];
+if(_2d.isPointInRange(el,0)||(els[i]==_2f&&_2d.startOffset==0)){
+el.removeAttribute("style");
+}
+}
+this.editor._doc.execCommand(_27,UI,_29);
+_2a.restoreSelection(_2c);
+return true;
+break;
+}
+return false;
+};
+Gecko.prototype.onMouseDown=function(ev){
+if(ev.target.tagName.toLowerCase()=="hr"){
+var sel=this.editor.getSelection();
+var _33=this.editor.createRange(sel);
+_33.selectNode(ev.target);
+}
+};
+Xinha.prototype.insertNodeAtSelection=function(_34){
+if(_34.ownerDocument!=this._doc){
+try{
+_34=this._doc.adoptNode(_34);
+}
+catch(e){
+}
+}
+var sel=this.getSelection();
+var _36=this.createRange(sel);
+sel.removeAllRanges();
+_36.deleteContents();
+var _37=_36.startContainer;
+var pos=_36.startOffset;
+var _39=_34;
+switch(_37.nodeType){
+case 3:
+if(_34.nodeType==3){
+_37.insertData(pos,_34.data);
+_36=this.createRange();
+_36.setEnd(_37,pos+_34.length);
+_36.setStart(_37,pos+_34.length);
+sel.addRange(_36);
+}else{
+_37=_37.splitText(pos);
+if(_34.nodeType==11){
+_39=_39.firstChild;
+}
+_37.parentNode.insertBefore(_34,_37);
+this.selectNodeContents(_39);
+this.updateToolbar();
+}
+break;
+case 1:
+if(_34.nodeType==11){
+_39=_39.firstChild;
+}
+_37.insertBefore(_34,_37.childNodes[pos]);
+this.selectNodeContents(_39);
+this.updateToolbar();
+break;
+}
+};
+Xinha.prototype.getParentElement=function(sel){
+if(typeof sel=="undefined"){
+sel=this.getSelection();
+}
+var _3b=this.createRange(sel);
+try{
+var p=_3b.commonAncestorContainer;
+if(!_3b.collapsed&&_3b.startContainer==_3b.endContainer&&_3b.startOffset-_3b.endOffset<=1&&_3b.startContainer.hasChildNodes()){
+p=_3b.startContainer.childNodes[_3b.startOffset];
+}
+while(p.nodeType==3){
+p=p.parentNode;
+}
+return p;
+}
+catch(ex){
+return null;
+}
+};
+Xinha.prototype.activeElement=function(sel){
+if((sel===null)||this.selectionEmpty(sel)){
+return null;
+}
+if(!sel.isCollapsed){
+if(sel.anchorNode.childNodes.length>sel.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(!_41){
+sel.removeAllRanges();
+return;
+}
+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);
+return Xinha.getHTML(_4d.cloneContents(),false,this);
+};
+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){
+return String.fromCharCode(_50.charCode);
+};
+Xinha.getOuterHTML=function(_51){
+return (new XMLSerializer()).serializeToString(_51);
+};
+Xinha.prototype.cc=String.fromCharCode(8286);
+Xinha.prototype.setCC=function(_52){
+var cc=this.cc;
+try{
+if(_52=="textarea"){
+var ta=this._textArea;
+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=_56+cc+_57;
+}
+ta.value=ta.value.replace(new RegExp("(&[^"+cc+"]*?)("+cc+")([^"+cc+"]*?;)"),"$1$3$2");
+ta.value=ta.value.replace(new RegExp("(<script[^>]*>[^"+cc+"]*?)("+cc+")([^"+cc+"]*?</script>)"),"$1$3$2");
+ta.value=ta.value.replace(new RegExp("^([^"+cc+"]*)("+cc+")([^"+cc+"]*<body[^>]*>)(.*?)"),"$1$3$2$4");
+}else{
+var sel=this.getSelection();
+sel.getRangeAt(0).insertNode(this._doc.createTextNode(cc));
+}
+}
+catch(e){
+}
+};
+Xinha.prototype.findCC=function(_5a){
+if(_5a=="textarea"){
+var ta=this._textArea;
+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{
+try{
+var doc=this._doc;
+doc.body.innerHTML=doc.body.innerHTML.replace(new RegExp(this.cc),"<span id=\"XinhaEditingPostion\"></span>");
+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 _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 _63;
+};
+Xinha.getDoctype=function(doc){
+var d="";
+if(doc.doctype){
+d+="<!DOCTYPE "+doc.doctype.name+" PUBLIC ";
+d+=doc.doctype.publicId?"\""+doc.doctype.publicId+"\"":"";
+d+=doc.doctype.systemId?" \""+doc.doctype.systemId+"\"":"";
+d+=">";
+}
+return d;
+};
+

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Gecko/paraHandlerBest.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Gecko/paraHandlerBest.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Gecko/paraHandlerBest.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/Gecko/paraHandlerBest.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,296 @@
+/* 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;
+EnterParagraphs.prototype._pContainers=/^(body|del|div|fieldset|form|ins|map|noscript|object|td|th)$/i;
+EnterParagraphs.prototype._pBreak=/^(address|pre|blockquote)$/i;
+EnterParagraphs.prototype._permEmpty=/^(area|base|basefont|br|col|frame|hr|img|input|isindex|link|meta|param)$/i;
+EnterParagraphs.prototype._elemSolid=/^(applet|br|button|hr|img|input|table)$/i;
+EnterParagraphs.prototype._pifySibling=/^(address|blockquote|del|div|dl|fieldset|form|h1|h2|h3|h4|h5|h6|hr|ins|map|noscript|object|ol|p|pre|table|ul|)$/i;
+EnterParagraphs.prototype._pifyForced=/^(ul|ol|dl|table)$/i;
+EnterParagraphs.prototype._pifyParent=/^(dd|dt|li|td|th|tr)$/i;
+function EnterParagraphs(_1){
+this.editor=_1;
+if(Xinha.is_gecko){
+this.onKeyPress=this.__onKeyPress;
+}
+}
+EnterParagraphs.prototype.name="EnterParagraphs";
+EnterParagraphs.prototype.insertAdjacentElement=function(_2,_3,el){
+if(_3=="BeforeBegin"){
+_2.parentNode.insertBefore(el,_2);
+}else{
+if(_3=="AfterEnd"){
+_2.nextSibling?_2.parentNode.insertBefore(el,_2.nextSibling):_2.parentNode.appendChild(el);
+}else{
+if(_3=="AfterBegin"&&_2.firstChild){
+_2.insertBefore(el,_2.firstChild);
+}else{
+if(_3=="BeforeEnd"||_3=="AfterBegin"){
+_2.appendChild(el);
+}
+}
+}
+}
+};
+EnterParagraphs.prototype.forEachNodeUnder=function(_5,_6,_7,_8){
+var _9,end;
+if(_5.nodeType==11&&_5.firstChild){
+_9=_5.firstChild;
+end=_5.lastChild;
+}else{
+_9=end=_5;
+}
+while(end.lastChild){
+end=end.lastChild;
+}
+return this.forEachNode(_9,end,_6,_7,_8);
+};
+EnterParagraphs.prototype.forEachNode=function(_a,_b,_c,_d,_e){
+var _f=function(_10,_11){
+return (_11=="ltr"?_10.nextSibling:_10.previousSibling);
+};
+var _12=function(_13,_14){
+return (_14=="ltr"?_13.firstChild:_13.lastChild);
+};
+var _15,lookup,fnReturnVal;
+var _16=_e;
+var _17=false;
+while(_15!=_d=="ltr"?_b:_a){
+if(!_15){
+_15=_d=="ltr"?_a:_b;
+}else{
+if(_12(_15,_d)){
+_15=_12(_15,_d);
+}else{
+if(_f(_15,_d)){
+_15=_f(_15,_d);
+}else{
+lookup=_15;
+while(!_f(lookup,_d)&&lookup!=(_d=="ltr"?_b:_a)){
+lookup=lookup.parentNode;
+}
+_15=(_f(lookup,_d)?_f(lookup,_d):lookup);
+}
+}
+}
+_17=(_15==(_d=="ltr"?_b:_a));
+switch(_c){
+case "cullids":
+fnReturnVal=this._fenCullIds(_15,_16);
+break;
+case "find_fill":
+fnReturnVal=this._fenEmptySet(_15,_16,_c,_17);
+break;
+case "find_cursorpoint":
+fnReturnVal=this._fenEmptySet(_15,_16,_c,_17);
+break;
+}
+if(fnReturnVal[0]){
+return fnReturnVal[1];
+}
+if(_17){
+break;
+}
+if(fnReturnVal[1]){
+_16=fnReturnVal[1];
+}
+}
+return false;
+};
+EnterParagraphs.prototype._fenEmptySet=function(_18,_19,_1a,_1b){
+if(!_19&&!_18.firstChild){
+_19=_18;
+}
+if((_18.nodeType==1&&this._elemSolid.test(_18.nodeName))||(_18.nodeType==3&&!this._whiteSpace.test(_18.nodeValue))||(_18.nodeType!=1&&_18.nodeType!=3)){
+switch(_1a){
+case "find_fill":
+return new Array(true,false);
+break;
+case "find_cursorpoint":
+return new Array(true,_18);
+break;
+}
+}
+if(_1b){
+return new Array(true,_19);
+}
+return new Array(false,_19);
+};
+EnterParagraphs.prototype._fenCullIds=function(_1c,_1d,_1e){
+if(_1d.id){
+_1e[_1d.id]?_1d.id="":_1e[_1d.id]=true;
+}
+return new Array(false,_1e);
+};
+EnterParagraphs.prototype.processSide=function(rng,_20){
+var _21=function(_22,_23){
+return (_23=="left"?_22.previousSibling:_22.nextSibling);
+};
+var _24=_20=="left"?rng.startContainer:rng.endContainer;
+var _25=_20=="left"?rng.startOffset:rng.endOffset;
+var _26,start=_24;
+while(start.nodeType==1&&!this._permEmpty.test(start.nodeName)){
+start=(_25?start.lastChild:start.firstChild);
+}
+while(_26=_26?(_21(_26,_20)?_21(_26,_20):_26.parentNode):start){
+if(_21(_26,_20)){
+if(this._pExclusions.test(_21(_26,_20).nodeName)){
+return this.processRng(rng,_20,_26,_21(_26,_20),(_20=="left"?"AfterEnd":"BeforeBegin"),true,false);
+}
+}else{
+if(this._pContainers.test(_26.parentNode.nodeName)){
+return this.processRng(rng,_20,_26,_26.parentNode,(_20=="left"?"AfterBegin":"BeforeEnd"),true,false);
+}else{
+if(this._pExclusions.test(_26.parentNode.nodeName)){
+if(this._pBreak.test(_26.parentNode.nodeName)){
+return this.processRng(rng,_20,_26,_26.parentNode,(_20=="left"?"AfterBegin":"BeforeEnd"),false,(_20=="left"?true:false));
+}else{
+return this.processRng(rng,_20,(_26=_26.parentNode),(_21(_26,_20)?_21(_26,_20):_26.parentNode),(_21(_26,_20)?(_20=="left"?"AfterEnd":"BeforeBegin"):(_20=="left"?"AfterBegin":"BeforeEnd")),false,false);
+}
+}
+}
+}
+}
+};
+EnterParagraphs.prototype.processRng=function(rng,_28,_29,_2a,_2b,_2c,_2d){
+var _2e=_28=="left"?rng.startContainer:rng.endContainer;
+var _2f=_28=="left"?rng.startOffset:rng.endOffset;
+var _30=this.editor;
+var _31=_30._doc.createRange();
+_31.selectNode(_29);
+if(_28=="left"){
+_31.setEnd(_2e,_2f);
+rng.setStart(_31.startContainer,_31.startOffset);
+}else{
+if(_28=="right"){
+_31.setStart(_2e,_2f);
+rng.setEnd(_31.endContainer,_31.endOffset);
+}
+}
+var cnt=_31.cloneContents();
+this.forEachNodeUnder(cnt,"cullids","ltr",this.takenIds,false,false);
+var _33,pifyOffset,fill;
+_33=_28=="left"?(_31.endContainer.nodeType==3?true:false):(_31.startContainer.nodeType==3?false:true);
+pifyOffset=_33?_31.startOffset:_31.endOffset;
+_33=_33?_31.startContainer:_31.endContainer;
+if(this._pifyParent.test(_33.nodeName)&&_33.parentNode.childNodes.item(0)==_33){
+while(!this._pifySibling.test(_33.nodeName)){
+_33=_33.parentNode;
+}
+}
+if(cnt.nodeType==11&&!cnt.firstChild){
+if(_33.nodeName!="BODY"||(_33.nodeName=="BODY"&&pifyOffset!=0)){
+cnt.appendChild(_30._doc.createElement(_33.nodeName));
+}
+}
+fill=this.forEachNodeUnder(cnt,"find_fill","ltr",false);
+if(fill&&this._pifySibling.test(_33.nodeName)&&((pifyOffset==0)||(pifyOffset==1&&this._pifyForced.test(_33.nodeName)))){
+_29=_30._doc.createElement("p");
+_29.innerHTML="&nbsp;";
+if((_28=="left")&&_33.previousSibling){
+return new Array(_33.previousSibling,"AfterEnd",_29);
+}else{
+if((_28=="right")&&_33.nextSibling){
+return new Array(_33.nextSibling,"BeforeBegin",_29);
+}else{
+return new Array(_33.parentNode,(_28=="left"?"AfterBegin":"BeforeEnd"),_29);
+}
+}
+}
+if(fill){
+if(fill.nodeType==3){
+fill=_30._doc.createDocumentFragment();
+}
+if((fill.nodeType==1&&!this._elemSolid.test())||fill.nodeType==11){
+var _34=_30._doc.createElement("p");
+_34.innerHTML="&nbsp;";
+fill.appendChild(_34);
+}else{
+var _34=_30._doc.createElement("p");
+_34.innerHTML="&nbsp;";
+fill.parentNode.insertBefore(parentNode,fill);
+}
+}
+if(fill){
+_29=fill;
+}else{
+_29=(_2c||(cnt.nodeType==11&&!cnt.firstChild))?_30._doc.createElement("p"):_30._doc.createDocumentFragment();
+_29.appendChild(cnt);
+}
+if(_2d){
+_29.appendChild(_30._doc.createElement("br"));
+}
+return new Array(_2a,_2b,_29);
+};
+EnterParagraphs.prototype.isNormalListItem=function(rng){
+var _36,listNode;
+_36=rng.startContainer;
+if((typeof _36.nodeName!="undefined")&&(_36.nodeName.toLowerCase()=="li")){
+listNode=_36;
+}else{
+if((typeof _36.parentNode!="undefined")&&(typeof _36.parentNode.nodeName!="undefined")&&(_36.parentNode.nodeName.toLowerCase()=="li")){
+listNode=_36.parentNode;
+}else{
+return false;
+}
+}
+if(!listNode.previousSibling){
+if(rng.startOffset==0){
+return false;
+}
+}
+return true;
+};
+EnterParagraphs.prototype.__onKeyPress=function(ev){
+if(ev.keyCode==13&&!ev.shiftKey&&this.editor._iframe.contentWindow.getSelection){
+return this.handleEnter(ev);
+}
+};
+EnterParagraphs.prototype.handleEnter=function(ev){
+var _39;
+var sel=this.editor.getSelection();
+var rng=this.editor.createRange(sel);
+if(this.isNormalListItem(rng)){
+return true;
+}
+this.takenIds=new Object();
+var _3c=this.processSide(rng,"left");
+var _3d=this.processSide(rng,"right");
+_39=_3d[2];
+sel.removeAllRanges();
+rng.deleteContents();
+var _3e=this.forEachNodeUnder(_39,"find_cursorpoint","ltr",false,true);
+if(!_3e){
+alert("INTERNAL ERROR - could not find place to put cursor after ENTER");
+}
+if(_3c){
+this.insertAdjacentElement(_3c[0],_3c[1],_3c[2]);
+}
+if(_3d&&_3d.nodeType!=1){
+this.insertAdjacentElement(_3d[0],_3d[1],_3d[2]);
+}
+if((_3e)&&(this._permEmpty.test(_3e.nodeName))){
+var _3f=0;
+while(_3e.parentNode.childNodes.item(_3f)!=_3e){
+_3f++;
+}
+sel.collapse(_3e.parentNode,_3f);
+}else{
+try{
+sel.collapse(_3e,0);
+if(_3e.nodeType==3){
+_3e=_3e.parentNode;
+}
+this.editor.scrollToElement(_3e);
+}
+catch(e){
+}
+}
+this.editor.updateToolbar();
+Xinha._stopEvent(ev);
+return true;
+};
+

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/GetHtml/DOMwalk.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/GetHtml/DOMwalk.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/GetHtml/DOMwalk.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/GetHtml/DOMwalk.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,187 @@
+/* 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: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){
+return Xinha.getHTMLWrapper(_2,_3,_4);
+};
+Xinha.emptyAttributes=" checked disabled ismap readonly nowrap compact declare selected defer multiple noresize noshade ";
+Xinha.getHTMLWrapper=function(_5,_6,_7,_8){
+var _9="";
+if(!_8){
+_8="";
+}
+switch(_5.nodeType){
+case 10:
+case 6:
+case 12:
+break;
+case 2:
+break;
+case 4:
+_9+=(Xinha.is_ie?("\n"+_8):"")+"<![CDATA["+_5.data+"]]>";
+break;
+case 5:
+_9+="&"+_5.nodeValue+";";
+break;
+case 7:
+_9+=(Xinha.is_ie?("\n"+_8):"")+"<"+"?"+_5.target+" "+_5.data+" ?>";
+break;
+case 1:
+case 11:
+case 9:
+var _a;
+var i;
+var _c=(_5.nodeType==1)?_5.tagName.toLowerCase():"";
+if((_c=="script"||_c=="noscript")&&_7.config.stripScripts){
+break;
+}
+if(_6){
+_6=!(_7.config.htmlRemoveTags&&_7.config.htmlRemoveTags.test(_c));
+}
+if(Xinha.is_ie&&_c=="head"){
+if(_6){
+_9+=(Xinha.is_ie?("\n"+_8):"")+"<head>";
+}
+var _d=RegExp.multiline;
+RegExp.multiline=true;
+var _e=_5.innerHTML.replace(Xinha.RE_tagName,function(_f,p1,p2){
+return p1+p2.toLowerCase();
+}).replace(/\s*=\s*(([^'"][^>\s]*)([>\s])|"([^"]+)"|'([^']+)')/g,"=\"$2$4$5\"$3").replace(/<(link|meta)((\s*\S*="[^"]*")*)>/g,"<$1$2 />");
+RegExp.multiline=_d;
+_9+=_e+"\n";
+if(_6){
+_9+=(Xinha.is_ie?("\n"+_8):"")+"</head>";
+}
+break;
+}else{
+if(_6){
+_a=(!(_5.hasChildNodes()||Xinha.needsClosingTag(_5)));
+_9+=((Xinha.isBlockElement(_5))?("\n"+_8):"")+"<"+_5.tagName.toLowerCase();
+var _12=_5.attributes;
+for(i=0;i<_12.length;++i){
+var a=_12.item(i);
+if(typeof a.nodeValue=="object"){
+continue;
+}
+if(_5.tagName.toLowerCase()=="input"&&_5.type.toLowerCase()=="checkbox"&&a.nodeName.toLowerCase()=="value"&&a.nodeValue.toLowerCase()=="on"){
+continue;
+}
+if(!a.specified&&!(_5.tagName.toLowerCase().match(/input|option/)&&a.nodeName=="value")&&!(_5.tagName.toLowerCase().match(/area/)&&a.nodeName.match(/shape|coords/i))){
+continue;
+}
+var _14=a.nodeName.toLowerCase();
+if(/_moz_editor_bogus_node/.test(_14)||(_14=="class"&&a.nodeValue=="webkit-block-placeholder")){
+_9="";
+break;
+}
+if(/(_moz)|(contenteditable)|(_msh)/.test(_14)){
+continue;
+}
+var _15;
+if(Xinha.emptyAttributes.indexOf(" "+_14+" ")!=-1){
+_15=_14;
+}else{
+if(_14!="style"){
+if(typeof _5[a.nodeName]!="undefined"&&_14!="href"&&_14!="src"&&!(/^on/.test(_14))){
+_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);
+}
+if(_7.config.only7BitPrintablesInURLs&&(_14=="href"||_14=="src")){
+_15=_15.replace(/([^!-~]+)/g,function(_16){
+return escape(_16);
+});
+}
+}
+}else{
+if(!Xinha.is_ie){
+_15=_5.style.cssText.replace(/rgb\(.*?\)/ig,function(rgb){
+return Xinha._colorToRgb(rgb);
+});
+}
+}
+}
+if(/^(_moz)?$/.test(_15)){
+continue;
+}
+_9+=" "+_14+"=\""+Xinha.htmlEncode(_15)+"\"";
+}
+if(Xinha.is_ie&&_5.style.cssText){
+_9+=" style=\""+_5.style.cssText.toLowerCase()+"\"";
+}
+if(Xinha.is_ie&&_5.tagName.toLowerCase()=="option"&&_5.selected){
+_9+=" selected=\"selected\"";
+}
+if(_9!==""){
+if(_a&&_c=="p"){
+_9+=">&nbsp;</p>";
+}else{
+if(_a){
+_9+=" />";
+}else{
+_9+=">";
+}
+}
+}
+}
+}
+var _18=false;
+if(_c=="script"||_c=="noscript"){
+if(!_7.config.stripScripts){
+if(Xinha.is_ie){
+var _19="\n"+_5.innerHTML.replace(/^[\n\r]*/,"").replace(/\s+$/,"")+"\n"+_8;
+}else{
+var _19=(_5.hasChildNodes())?_5.firstChild.nodeValue:"";
+}
+_9+=_19+"</"+_c+">"+((Xinha.is_ie)?"\n":"");
+}
+}else{
+if(_c=="pre"){
+_9+=((Xinha.is_ie)?"\n":"")+_5.innerHTML.replace(/<br>/g,"\n")+"</"+_c+">";
+}else{
+for(i=_5.firstChild;i;i=i.nextSibling){
+if(!_18&&i.nodeType==1&&Xinha.isBlockElement(i)){
+_18=true;
+}
+_9+=Xinha.getHTMLWrapper(i,true,_7,_8+"  ");
+}
+if(_6&&!_a){
+_9+=(((Xinha.isBlockElement(_5)&&_18)||_c=="head"||_c=="html")?("\n"+_8):"")+"</"+_5.tagName.toLowerCase()+">";
+}
+}
+}
+break;
+case 3:
+if(/^script|noscript|style$/i.test(_5.parentNode.tagName)){
+_9=_5.data;
+}else{
+if(_5.data.trim()==""){
+if(_5.data){
+_9=" ";
+}else{
+_9="";
+}
+}else{
+_9=Xinha.htmlEncode(_5.data);
+}
+}
+break;
+case 8:
+_9="<!--"+_5.data+"-->";
+break;
+}
+return _9;
+};
+

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/GetHtml/TransformInnerHTML.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/GetHtml/TransformInnerHTML.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/GetHtml/TransformInnerHTML.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/GetHtml/TransformInnerHTML.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,151 @@
+/* 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=[/<\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|ti
 tle|area|input|textarea)[^>]*>/g,/(^|<\/(pre|script)>)(\s|[^\s])*?(<(pre|script)[^>]*>|$)/g,/(<pre[^>]*>)([\s\S])*?(<\/pre>)/g,/(^|<!--[\s\S]*?-->)([\s\S]*?)(?=<!--[\s\S]*?-->|$)/g,/\S*=""/g,/<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<\/?\w[^>]*>/g,/(^|<\/script>)[\s\S]*?(<script[^>]*>|$)/g];
+if(typeof RegExp.prototype.compile=="function"){
+for(var i=0;i<Xinha.RegExpCache.length;i++){
+Xinha.RegExpCache[i]=new RegExp().compile(Xinha.RegExpCache[i]);
+}
+}
+Xinha.prototype.cleanHTML=function(_2){
+var c=Xinha.RegExpCache;
+_2=_2.replace(c[0],function(_4){
+return _4.toLowerCase();
+}).replace(c[1]," ").replace(c[12]," ").replace(c[2],"=\"$2$4$5\"$3").replace(c[21]," ").replace(c[11],function(_5,p1,p2){
+return " "+p1.toLowerCase()+p2;
+}).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],"&amp;").replace(c[8],"<").replace(c[10]," ");
+if(Xinha.is_ie&&c[13].test(_2)){
+_2=_2.replace(c[13],"$1"+this.stripBaseURL(RegExp.$3)+"\"");
+}
+if(this.config.only7BitPrintablesInURLs){
+if(Xinha.is_ie){
+c[13].test(_2);
+}
+if(c[13].test(_2)){
+try{
+_2=_2.replace(c[13],"$1"+decodeURIComponent(RegExp.$3).replace(/([^!-~]+)/g,function(_8){
+return escape(_8);
+})+"\"");
+}
+catch(e){
+_2=_2.replace(c[13],"$1"+RegExp.$3.replace(/([^!-~]+)/g,function(_9){
+return escape(_9);
+})+"\"");
+}
+}
+}
+return _2;
+};
+Xinha.indent=function(s,_b){
+Xinha.__nindent=0;
+Xinha.__sindent="";
+Xinha.__sindentChar=(typeof _b=="undefined")?"  ":_b;
+var c=Xinha.RegExpCache;
+if(Xinha.is_gecko){
+s=s.replace(c[19],function(_d){
+return _d.replace(/<br \/>/g,"\n");
+});
+}
+s=s.replace(c[18],function(_e){
+_e=_e.replace(c[20],function(st,$1,$2){
+string=$2.replace(/[\n\r]/gi," ").replace(/\s+/gi," ").replace(c[14],function(str){
+if(str.match(c[16])){
+var s="\n"+Xinha.__sindent+str;
+Xinha.__sindent+=Xinha.__sindentChar;
+++Xinha.__nindent;
+return s;
+}else{
+if(str.match(c[15])){
+--Xinha.__nindent;
+Xinha.__sindent="";
+for(var i=Xinha.__nindent;i>0;--i){
+Xinha.__sindent+=Xinha.__sindentChar;
+}
+return "\n"+Xinha.__sindent+str;
+}else{
+if(str.match(c[17])){
+return "\n"+Xinha.__sindent+str;
+}
+}
+}
+return str;
+});
+return $1+string;
+});
+return _e;
+});
+s=s.replace(/^\s*/,"").replace(/ +\n/g,"\n").replace(/[\r\n]+(\s+)<\/script>/g,"\n$1</script>");
+return s;
+};
+Xinha.getHTML=function(_15,_16,_17){
+var _18="";
+var c=Xinha.RegExpCache;
+if(_15.nodeType==11){
+var div=document.createElement("div");
+var _1b=_15.insertBefore(div,_15.firstChild);
+for(j=_1b.nextSibling;j;j=j.nextSibling){
+_1b.appendChild(j.cloneNode(true));
+}
+_18+=_1b.innerHTML.replace(c[23],function(_1c){
+_1c=_1c.replace(c[22],function(tag){
+if(/^<[!\?]/.test(tag)){
+return tag;
+}else{
+return _17.cleanHTML(tag);
+}
+});
+return _1c;
+});
+}else{
+var _1e=(_15.nodeType==1)?_15.tagName.toLowerCase():"";
+if(_16){
+_18+="<"+_1e;
+var _1f=_15.attributes;
+for(i=0;i<_1f.length;++i){
+var a=_1f.item(i);
+if(!a.specified){
+continue;
+}
+var _21=a.nodeName.toLowerCase();
+var _22=a.nodeValue;
+_18+=" "+_21+"=\""+_22+"\"";
+}
+_18+=">";
+}
+if(_1e=="html"){
+innerhtml=_17._doc.documentElement.innerHTML;
+}else{
+innerhtml=_15.innerHTML;
+}
+_18+=innerhtml.replace(c[23],function(_23){
+_23=_23.replace(c[22],function(tag){
+if(/^<[!\?]/.test(tag)){
+return tag;
+}else{
+if(!(_17.config.htmlRemoveTags&&_17.config.htmlRemoveTags.test(tag.replace(/<([^\s>\/]+)/,"$1")))){
+return _17.cleanHTML(tag);
+}else{
+return "";
+}
+}
+});
+return _23;
+});
+if(Xinha.is_ie){
+_18=_18.replace(/<li( [^>]*)?>/g,"</li><li$1>").replace(/(<(ul|ol)[^>]*>)[\s\n]*<\/li>/g,"$1").replace(/<\/li>([\s\n]*<\/li>)+/g,"</li>");
+}
+if(Xinha.is_gecko){
+_18=_18.replace(/<br \/>\n$/,"");
+}
+if(_16){
+_18+="</"+_1e+">";
+}
+_18=Xinha.indent(_18);
+}
+return _18;
+};
+

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/GetHtml/lang/pt_br.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/GetHtml/lang/pt_br.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/GetHtml/lang/pt_br.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/GetHtml/lang/pt_br.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,18 @@
+// I18N constants
+//
+// LANG: "pt_br", ENCODING: UTF-8
+// Portuguese Brazilian Translation
+//
+// Author: Marcio Barbosa, <ma...@mpg.com.br>
+// MSN: tomarshall@msn.com - ICQ: 69419933
+// Site: http://www.mpg.com.br
+//
+// Last revision: 06 september 2007
+// Please don´t remove this information
+// If you modify any source, please insert a comment with your name and e-mail
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+{
+  "Your Document is not well formed. Check JavaScript console for details.": "Seu documento não está formatado corretamente. Verifique os detalhes no console do Javascript."
+}

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertImage/insert_image.html
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertImage/insert_image.html?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertImage/insert_image.html (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertImage/insert_image.html Sun Sep 27 03:11:38 2009
@@ -0,0 +1,173 @@
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Insert Image</title>
+
+<script type="text/javascript" src="../../popups/popup.js"></script>
+<link rel="stylesheet" type="text/css" href="../../popups/popup.css" />
+
+<script type="text/javascript">
+
+
+Xinha = window.opener.Xinha;
+function i18n(str) {
+  return (Xinha._lc(str, 'Xinha'));
+}
+
+function Init() {
+  __dlg_translate('Xinha');
+  __dlg_init(null,{width:410,height:400});
+  // Make sure the translated string appears in the drop down. (for gecko)
+  document.getElementById("f_align").selectedIndex = 1;
+  document.getElementById("f_align").selectedIndex = 5;
+  var param = window.dialogArguments;
+  if (param["f_base"]) {
+      document.getElementById("f_base").value = param["f_base"];
+  }
+  document.getElementById("f_url").value    = param["f_url"] ? param["f_url"] : "";
+  document.getElementById("f_alt").value    = param["f_alt"] ? param["f_alt"] : "";
+  document.getElementById("f_border").value = (typeof param["f_border"]!="undefined") ? param["f_border"] : "";
+  document.getElementById("f_align").value  = param["f_align"] ? param["f_align"] : "";
+  document.getElementById("f_vert").value   = (typeof param["f_vert"]!="undefined") ? param["f_vert"] : "";
+  document.getElementById("f_horiz").value  = (typeof param["f_horiz"]!="undefined") ? param["f_horiz"] : "";
+  if (param["f_url"]) {
+      window.ipreview.location.replace(Xinha._resolveRelativeUrl(param.f_base, param.f_url));
+  }
+  document.getElementById("f_url").focus();
+}
+
+function onOK() {
+  var required = {
+    "f_url": i18n("You must enter the URL")
+  };
+  for (var i in required) {
+    var el = document.getElementById(i);
+    if (!el.value) {
+      alert(required[i]);
+      el.focus();
+      return false;
+    }
+  }
+  // pass data back to the calling window
+  var fields = ["f_url", "f_alt", "f_align", "f_border",
+                "f_horiz", "f_vert"];
+  var param = new Object();
+  for (var i in fields) {
+    var id = fields[i];
+    var el = document.getElementById(id);
+    param[id] = el.value;
+  }
+  __dlg_close(param);
+  return false;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+
+function onPreview() {
+  var f_url = document.getElementById("f_url");
+  var url = f_url.value;
+  var base = document.getElementById("f_base").value;
+  if (!url) {
+    alert(i18n("You must enter the URL"));
+    f_url.focus();
+    return false;
+  }
+  window.ipreview.location.replace(Xinha._resolveRelativeUrl(base, url));
+  return false;
+}
+</script>
+
+</head>
+
+<body class="dialog" onload="Init()">
+
+<div class="title">Insert Image</div>
+<!--- new stuff --->
+<form action="" method="get">
+<input type="hidden" name="base" id="f_base"/>
+<table border="0" width="100%" style="padding: 0px; margin: 0px">
+  <tbody>
+
+  <tr>
+    <td style="width: 7em; text-align: right">Image URL:</td>
+    <td><input type="text" name="url" id="f_url" style="width:75%"
+      title="Enter the image URL here" />
+      <button name="preview" onclick="return onPreview();"
+      title="Preview the image in a new window">Preview</button>
+    </td>
+  </tr>
+  <tr>
+    <td style="width: 7em; text-align: right">Alternate text:</td>
+    <td><input type="text" name="alt" id="f_alt" style="width:100%"
+      title="For browsers that don't support images" /></td>
+  </tr>
+
+  </tbody>
+</table>
+
+<fieldset style="float: left; margin-left: 5px;">
+<legend>Layout</legend>
+
+<div class="space"></div>
+
+<div class="fl">Alignment:</div>
+<select size="1" name="align" id="f_align"
+  title="Positioning of this image">
+  <option value=""                             >Not set</option>
+  <option value="left"                         >Left</option>
+  <option value="right"                        >Right</option>
+  <option value="texttop"                      >Texttop</option>
+  <option value="absmiddle"                    >Absmiddle</option>
+  <option value="baseline" selected="selected" >Baseline</option>
+  <option value="absbottom"                    >Absbottom</option>
+  <option value="bottom"                       >Bottom</option>
+  <option value="middle"                       >Middle</option>
+  <option value="top"                          >Top</option>
+</select>
+
+<br />
+
+<div class="fl">Border thickness:</div>
+<input type="text" name="border" id="f_border" size="5"
+title="Leave empty for no border" />
+
+<div class="space"></div>
+
+</fieldset>
+
+<fieldset>
+<legend>Spacing</legend>
+
+<div class="space"></div>
+
+<div class="fr">Horizontal:</div>
+<input type="text" name="horiz" id="f_horiz" size="5"
+title="Horizontal padding" />
+
+<br />
+
+<div class="fr">Vertical:</div>
+<input type="text" name="vert" id="f_vert" size="5"
+title="Vertical padding" />
+
+<div class="space"></div>
+
+</fieldset>
+<div class="space" style="clear:all"></div>
+<div>
+Image Preview:<br />
+    <iframe name="ipreview" id="ipreview" frameborder="0" style="border : 1px solid gray;" 
+	height="200" width="100%" src="../../popups/blank.html"></iframe>
+</div>
+<div id="buttons">
+<button type="submit" name="ok" onclick="return onOK();">OK</button>
+<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+</form>
+</body>
+</html>
\ No newline at end of file

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertImage/insert_image.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertImage/insert_image.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertImage/insert_image.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertImage/insert_image.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,119 @@
+/* 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){
+var _3=this;
+var _4;
+if(typeof _2=="undefined"){
+_2=this.getParentElement();
+if(_2&&_2.tagName.toLowerCase()!="img"){
+_2=null;
+}
+}
+var _5;
+if(typeof _3.config.baseHref!="undefined"&&_3.config.baseHref!==null){
+_5=_3.config.baseHref;
+}else{
+var _6=window.location.toString().split("/");
+_6.pop();
+_5=_6.join("/");
+}
+if(_2){
+function getSpecifiedAttribute(_7,_8){
+var a=_7.attributes;
+for(var i=0;i<a.length;i++){
+if(a[i].nodeName==_8&&a[i].specified){
+return a[i].value;
+}
+}
+return "";
+}
+_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:""};
+}
+Dialog(_3.config.URIs.insert_image,function(_b){
+if(!_b){
+return false;
+}
+var _c=_2;
+if(!_c){
+if(Xinha.is_ie){
+var _d=_3.getSelection();
+var _e=_3.createRange(_d);
+_3._doc.execCommand("insertimage",false,_b.f_url);
+_c=_e.parentElement();
+if(_c.tagName.toLowerCase()!="img"){
+_c=_c.previousSibling;
+}
+}else{
+_c=document.createElement("img");
+_c.src=_b.f_url;
+_3.insertNodeAtSelection(_c);
+if(!_c.tagName){
+_c=_e.startContainer.firstChild;
+}
+}
+}else{
+_c.src=_b.f_url;
+}
+for(var _f in _b){
+var _10=_b[_f];
+switch(_f){
+case "f_alt":
+if(_10){
+_c.alt=_10;
+}else{
+_c.removeAttribute("alt");
+}
+break;
+case "f_border":
+if(_10){
+_c.border=parseInt(_10||"0");
+}else{
+_c.removeAttribute("border");
+}
+break;
+case "f_align":
+if(_10){
+_c.align=_10;
+}else{
+_c.removeAttribute("align");
+}
+break;
+case "f_vert":
+if(_10!=""){
+_c.vspace=parseInt(_10||"0");
+}else{
+_c.removeAttribute("vspace");
+}
+break;
+case "f_horiz":
+if(_10!=""){
+_c.hspace=parseInt(_10||"0");
+}else{
+_c.removeAttribute("hspace");
+}
+break;
+case "f_width":
+if(_10){
+_c.width=parseInt(_10||"0");
+}else{
+_c.removeAttribute("width");
+}
+break;
+case "f_height":
+if(_10){
+_c.height=parseInt(_10||"0");
+}else{
+_c.removeAttribute("height");
+}
+break;
+}
+}
+},_4);
+};
+

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertTable/insert_table.html
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertTable/insert_table.html?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertTable/insert_table.html (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertTable/insert_table.html Sun Sep 27 03:11:38 2009
@@ -0,0 +1,157 @@
+<html>
+
+<head>
+  <title>Insert Table</title>
+
+<script type="text/javascript" src="../../popups/popup.js"></script>
+<link rel="stylesheet" type="text/css" href="../../popups/popup.css" />
+
+<script type="text/javascript">
+
+window.resizeTo(425, 250);
+
+Xinha = window.opener.Xinha;
+function i18n(str) {
+  return (Xinha._lc(str, 'Xinha'));
+}
+
+function Init() {
+  Xinha = window.opener.Xinha; // load the Xinha plugin and lang file
+  __dlg_translate('Xinha');
+  __dlg_init(null, Xinha.is_ie ? null : {width:425,height:250});
+  // Make sure the translated string appears in the drop down. (for gecko)
+  document.getElementById("f_unit").selectedIndex = 1;
+  document.getElementById("f_unit").selectedIndex = 0;
+  document.getElementById("f_align").selectedIndex = 1;
+  document.getElementById("f_align").selectedIndex = 0;
+  document.getElementById("f_rows").focus();
+}
+
+function onOK() {
+  var required = {
+    "f_rows": i18n("You must enter a number of rows"),
+    "f_cols": i18n("You must enter a number of columns")
+  };
+  for (var i in required) {
+    var el = document.getElementById(i);
+    if (!el.value) {
+      alert(required[i]);
+      el.focus();
+      return false;
+    }
+  }
+  var fields = ["f_rows", "f_cols", "f_width", "f_unit", "f_fixed",
+                "f_align", "f_border", "f_spacing", "f_padding"];
+  var param = new Object();
+  for (var i in fields) {
+    var id = fields[i];
+    var el = document.getElementById(id);
+    param[id] = (el.type == "checkbox") ? el.checked : el.value;
+  }
+  __dlg_close(param);
+  return false;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+
+</script>
+
+</head>
+
+<body class="dialog" onload="Init()">
+
+<div class="title">Insert Table</div>
+
+<form action="" method="get">
+<table border="0" style="padding: 0px; margin: 0px">
+  <tbody>
+
+  <tr>
+    <td style="width: 4em; text-align: right">Rows:</td>
+    <td><input type="text" name="rows" id="f_rows" size="5" title="Number of rows" value="2" /></td>
+    <td style="width: 4em; text-align: right">Width:</td>
+    <td><input type="text" name="width" id="f_width" size="5" title="Width of the table" value="100" /></td>
+    <td><select size="1" name="unit" id="f_unit" title="Width unit">
+      <option value="%" selected="selected"  >Percent</option>
+      <option value="px"              >Pixels</option>
+      <option value="em"              >Em</option>
+    </select></td>
+  </tr>
+  <tr>
+    <td style="width: 4em; text-align: right">Cols:</td>
+    <td><input type="text" name="cols" id="f_cols" size="5" title="Number of columns" value="4" /></td>
+    <td style="text-align: right"><input type="checkbox" checked="checked" name="fixed" id="f_fixed" /></td>
+    <td colspan="2"><label for="f_fixed"
+    >Fixed width columns</label></td>
+  </tr>
+  </tbody>
+</table>
+
+<p />
+
+<fieldset style="float: left; margin-left: 5px;">
+<legend>Layout</legend>
+
+<div class="space"></div>
+
+<div class="fl">Alignment:</div>
+<select size="1" name="align" id="f_align"
+  title="Positioning of this table">
+  <option value="" selected="selected"         >Not set</option>
+  <option value="left"                         >Left</option>
+  <option value="right"                        >Right</option>
+  <option value="texttop"                      >Texttop</option>
+  <option value="absmiddle"                    >Absmiddle</option>
+  <option value="baseline"                     >Baseline</option>
+  <option value="absbottom"                    >Absbottom</option>
+  <option value="bottom"                       >Bottom</option>
+  <option value="middle"                       >Middle</option>
+  <option value="top"                          >Top</option>
+</select>
+
+<p />
+
+<div class="fl">Border thickness:</div>
+<input type="text" name="border" id="f_border" size="5" value="1"
+title="Leave empty for no border" />
+<!--
+<p />
+
+<div class="fl">Collapse borders:</div>
+<input type="checkbox" name="collapse" id="f_collapse" />
+-->
+<div class="space"></div>
+
+</fieldset>
+
+<fieldset style="float:right; margin-right: 5px;">
+<legend>Spacing</legend>
+
+<div class="space"></div>
+
+<div class="fr">Cell spacing:</div>
+<input type="text" name="spacing" id="f_spacing" size="5" value="1"
+title="Space between adjacent cells" />
+
+<p />
+
+<div class="fr">Cell padding:</div>
+<input type="text" name="padding" id="f_padding" size="5" value="1"
+title="Space between content and border in cell" />
+
+<div class="space"></div>
+
+</fieldset>
+
+<div style="margin-top: 85px; border-top: 1px solid #999; padding: 2px; text-align: right;">
+<button type="button" name="ok" onclick="return onOK();">OK</button>
+<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+
+</form>
+
+</body>
+</html>
\ No newline at end of file

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertTable/insert_table.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertTable/insert_table.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertTable/insert_table.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InsertTable/insert_table.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,66 @@
+/* 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(){
+var _2=this.getSelection();
+var _3=this.createRange(_2);
+var _4=this;
+Dialog(_4.config.URIs.insert_table,function(_5){
+if(!_5){
+return false;
+}
+var _6=_4._doc;
+var _7=_6.createElement("table");
+for(var _8 in _5){
+var _9=_5[_8];
+if(!_9){
+continue;
+}
+switch(_8){
+case "f_width":
+_7.style.width=_9+_5.f_unit;
+break;
+case "f_align":
+_7.align=_9;
+break;
+case "f_border":
+_7.border=parseInt(_9,10);
+break;
+case "f_spacing":
+_7.cellSpacing=parseInt(_9,10);
+break;
+case "f_padding":
+_7.cellPadding=parseInt(_9,10);
+break;
+}
+}
+var _a=0;
+if(_5.f_fixed){
+_a=Math.floor(100/parseInt(_5.f_cols,10));
+}
+var _b=_6.createElement("tbody");
+_7.appendChild(_b);
+for(var i=0;i<_5.f_rows;++i){
+var tr=_6.createElement("tr");
+_b.appendChild(tr);
+for(var j=0;j<_5.f_cols;++j){
+var td=_6.createElement("td");
+if(_a){
+td.style.width=_a+"%";
+}
+tr.appendChild(td);
+td.appendChild(_6.createTextNode("\xa0"));
+}
+}
+if(Xinha.is_ie){
+_3.pasteHTML(_7.outerHTML);
+}else{
+_4.insertNodeAtSelection(_7);
+}
+return true;
+},null);
+};
+

Added: roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InternetExplorer/InternetExplorer.js
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InternetExplorer/InternetExplorer.js?rev=819248&view=auto
==============================================================================
--- roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InternetExplorer/InternetExplorer.js (added)
+++ roller/trunk/apps/weblogger/web/roller-ui/authoring/editors/xinha-0.95/modules/InternetExplorer/InternetExplorer.js Sun Sep 27 03:11:38 2009
@@ -0,0 +1,337 @@
+/* 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;
+}
+InternetExplorer.prototype.onKeyPress=function(ev){
+if(this.editor.isShortCut(ev)){
+switch(this.editor.getKey(ev).toLowerCase()){
+case "n":
+this.editor.execCommand("formatblock",false,"<p>");
+Xinha._stopEvent(ev);
+return true;
+break;
+case "1":
+case "2":
+case "3":
+case "4":
+case "5":
+case "6":
+this.editor.execCommand("formatblock",false,"<h"+this.editor.getKey(ev).toLowerCase()+">");
+Xinha._stopEvent(ev);
+return true;
+break;
+}
+}
+switch(ev.keyCode){
+case 8:
+case 46:
+if(this.handleBackspace()){
+Xinha._stopEvent(ev);
+return true;
+}
+break;
+}
+return false;
+};
+InternetExplorer.prototype.handleBackspace=function(){
+var _3=this.editor;
+var _4=_3.getSelection();
+if(_4.type=="Control"){
+var _5=_3.activeElement(_4);
+Xinha.removeFromParent(_5);
+return true;
+}
+var _6=_3.createRange(_4);
+var r2=_6.duplicate();
+r2.moveStart("character",-1);
+var a=r2.parentElement();
+if(a!=_6.parentElement()&&(/^a$/i.test(a.tagName))){
+r2.collapse(true);
+r2.moveEnd("character",1);
+r2.pasteHTML("");
+r2.select();
+return true;
+}
+};
+InternetExplorer.prototype.inwardHtml=function(_9){
+_9=_9.replace(/<(\/?)del(\s|>|\/)/ig,"<$1strike$2");
+_9=_9.replace(/(<script|<!--)/i,"&nbsp;$1");
+return _9;
+};
+InternetExplorer.prototype.outwardHtml=function(_a){
+_a=_a.replace(/&nbsp;(\s*)(<script|<!--)/i,"$1$2");
+return _a;
+};
+InternetExplorer.prototype.onExecCommand=function(_b,UI,_d){
+switch(_b){
+case "saveas":
+var _e=null;
+var _f=this.editor;
+var _10=document.createElement("iframe");
+_10.src="about:blank";
+_10.style.display="none";
+document.body.appendChild(_10);
+try{
+if(_10.contentDocument){
+_e=_10.contentDocument;
+}else{
+_e=_10.contentWindow.document;
+}
+}
+catch(ex){
+}
+_e.open("text/html","replace");
+var _11="";
+if(_f.config.browserQuirksMode===false){
+var _12="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
+}else{
+if(_f.config.browserQuirksMode===true){
+var _12="";
+}else{
+var _12=Xinha.getDoctype(document);
+}
+}
+if(!_f.config.fullPage){
+_11+=_12+"\n";
+_11+="<html>\n";
+_11+="<head>\n";
+_11+="<meta http-equiv=\"Content-Type\" content=\"text/html; charset="+_f.config.charSet+"\">\n";
+if(typeof _f.config.baseHref!="undefined"&&_f.config.baseHref!==null){
+_11+="<base href=\""+_f.config.baseHref+"\"/>\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+="<link rel=\"stylesheet\" type=\"text/css\" href=\""+_f.config.pageStyleSheets[i]+"\">";
+}
+}
+}
+if(_f.config.pageStyle){
+_11+="<style type=\"text/css\">\n"+_f.config.pageStyle+"\n</style>";
+}
+_11+="</head>\n";
+_11+="<body>\n";
+_11+=_f.getEditorContent();
+_11+="</body>\n";
+_11+="</html>";
+}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<el.childNodes.length;j++){
+clean(el.childNodes[j]);
+}
+if((el.tagName.toLowerCase()=="span"&&!el.attributes.length)||el.tagName.toLowerCase()=="font"){
+el.outerHTML=el.innerHTML;
+}
+}
+if(_f.selectionEmpty(sel)){
+els=_f._doc.body.childNodes;
+for(i=0;i<els.length;i++){
+el=els[i];
+if(el.nodeType!=1){
+continue;
+}
+if(el.tagName.toLowerCase()=="span"){
+newNode=_f.convertNode(el,"div");
+el.parentNode.replaceChild(newNode,el);
+el=newNode;
+}
+clean(el);
+}
+}
+_f._doc.execCommand(_b,UI,_d);
+_f.restoreSelection(_15);
+return true;
+break;
+}
+return false;
+};
+Xinha.prototype.insertNodeAtSelection=function(_18){
+this.insertHTML(_18.outerHTML);
+};
+Xinha.prototype.getParentElement=function(sel){
+if(typeof sel=="undefined"){
+sel=this.getSelection();
+}
+var _1a=this.createRange(sel);
+switch(sel.type){
+case "Text":
+var _1b=_1a.parentElement();
+while(true){
+var _1c=_1a.duplicate();
+_1c.moveToElementText(_1b);
+if(_1c.inRange(_1a)){
+break;
+}
+if((_1b.nodeType!=1)||(_1b.tagName.toLowerCase()=="body")){
+break;
+}
+_1b=_1b.parentElement;
+}
+return _1b;
+case "None":
+return _1a.parentElement();
+case "Control":
+return _1a.item(0);
+default:
+return this._doc.body;
+}
+};
+Xinha.prototype.activeElement=function(sel){
+if((sel===null)||this.selectionEmpty(sel)){
+return null;
+}
+if(sel.type.toLowerCase()=="control"){
+return sel.createRange().item(0);
+}else{
+var _1e=sel.createRange();
+var _1f=this.getParentElement(sel);
+if(_1f.innerHTML==_1e.htmlText){
+return _1f;
+}
+return null;
+}
+};
+Xinha.prototype.selectionEmpty=function(sel){
+if(!sel){
+return true;
+}
+return this.createRange(sel).htmlText==="";
+};
+Xinha.prototype.saveSelection=function(){
+return this.createRange(this.getSelection());
+};
+Xinha.prototype.restoreSelection=function(_21){
+try{
+_21.select();
+}
+catch(e){
+}
+};
+Xinha.prototype.selectNodeContents=function(_22,pos){
+this.focusEditor();
+this.forceRedraw();
+var _24;
+var _25=typeof pos=="undefined"?true:false;
+if(_25&&_22.tagName&&_22.tagName.toLowerCase().match(/table|img|input|select|textarea/)){
+_24=this._doc.body.createControlRange();
+_24.add(_22);
+}else{
+_24=this._doc.body.createTextRange();
+_24.moveToElementText(_22);
+}
+_24.select();
+};
+Xinha.prototype.insertHTML=function(_26){
+this.focusEditor();
+var sel=this.getSelection();
+var _28=this.createRange(sel);
+_28.pasteHTML(_26);
+};
+Xinha.prototype.getSelectedHTML=function(){
+var sel=this.getSelection();
+if(this.selectionEmpty(sel)){
+return "";
+}
+var _2a=this.createRange(sel);
+if(_2a.htmlText){
+return _2a.htmlText;
+}else{
+if(_2a.length>=1){
+return _2a.item(0).outerHTML;
+}
+}
+return "";
+};
+Xinha.prototype.getSelection=function(){
+return this._doc.selection;
+};
+Xinha.prototype.createRange=function(sel){
+if(!sel){
+sel=this.getSelection();
+}
+return sel.createRange();
+};
+Xinha.prototype.isKeyEvent=function(_2c){
+return _2c.type=="keydown";
+};
+Xinha.prototype.getKey=function(_2d){
+return String.fromCharCode(_2d.keyCode);
+};
+Xinha.getOuterHTML=function(_2e){
+return _2e.outerHTML;
+};
+Xinha.prototype.cc=String.fromCharCode(8201);
+Xinha.prototype.setCC=function(_2f){
+var cc=this.cc;
+if(_2f=="textarea"){
+var ta=this._textArea;
+var pos=document.selection.createRange();
+pos.collapse();
+pos.text=cc;
+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=_34+cc+_35;
+}
+ta.value=ta.value.replace(new RegExp("(&[^"+cc+"]*?)("+cc+")([^"+cc+"]*?;)"),"$1$3$2");
+ta.value=ta.value.replace(new RegExp("(<script[^>]*>[^"+cc+"]*?)("+cc+")([^"+cc+"]*?</script>)"),"$1$3$2");
+ta.value=ta.value.replace(new RegExp("^([^"+cc+"]*)("+cc+")([^"+cc+"]*<body[^>]*>)(.*?)"),"$1$3$2$4");
+}else{
+var sel=this.getSelection();
+var r=sel.createRange();
+if(sel.type=="Control"){
+var _39=r.item(0);
+_39.outerHTML+=cc;
+}else{
+r.collapse();
+r.text=cc;
+}
+}
+};
+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="";
+}
+if(range.findText(this.cc)){
+range.select();
+range.text="";
+}
+if(_3a=="textarea"){
+this._textArea.focus();
+}
+};
+Xinha.getDoctype=function(doc){
+return (doc.compatMode=="CSS1Compat"&&Xinha.ie_version<8)?"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">":"";
+};
+