You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by so...@apache.org on 2007/09/21 12:37:48 UTC

svn commit: r578051 [7/31] - in /lenya/branches/revolution/1.3.x/src: java/org/apache/lenya/cms/content/flat/ webapp/lenya/modules/xinha/ webapp/lenya/modules/xinha/contrib/ webapp/lenya/modules/xinha/examples/ webapp/lenya/modules/xinha/images/ webapp...

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/ColorPicker/ColorPicker.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/ColorPicker/ColorPicker.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/ColorPicker/ColorPicker.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/ColorPicker/ColorPicker.js Fri Sep 21 03:36:30 2007
@@ -0,0 +1,590 @@
+ColorPicker._pluginInfo={name:"colorPicker",version:"1.0",developer:"James Sleeman",developer_url:"http://www.gogo.co.nz/",c_owner:"Gogo Internet Services",license:"htmlArea",sponsor:"Gogo Internet Services",sponsor_url:"http://www.gogo.co.nz/"};
+function ColorPicker(){
+}
+if(window.opener&&window.opener.Xinha){
+var openerColorPicker=window.opener.Xinha.colorPicker;
+Xinha._addEvent(window,"unload",function(){
+Xinha.colorPicker=openerColorPicker;
+});
+}
+Xinha.colorPicker=function(_1){
+if(Xinha.colorPicker.savedColors.length===0){
+Xinha.colorPicker.loadColors();
+}
+var _2=this;
+var _3=false;
+var _4=false;
+var _5=0;
+var _6=0;
+this.callback=_1.callback?_1.callback:function(_7){
+alert("You picked "+_7);
+};
+this.websafe=_1.websafe?_1.websafe:false;
+this.savecolors=_1.savecolors?_1.savecolors:20;
+this.cellsize=parseInt(_1.cellsize?_1.cellsize:"10px",10);
+this.side=_1.granularity?_1.granularity:18;
+var _8=this.side+1;
+var _9=this.side-1;
+this.value=1;
+this.saved_cells=null;
+this.table=document.createElement("table");
+this.table.className="dialog";
+this.table.cellSpacing=this.table.cellPadding=0;
+this.table.onmouseup=function(){
+_3=false;
+_4=false;
+};
+this.tbody=document.createElement("tbody");
+this.table.appendChild(this.tbody);
+this.table.style.border="1px solid WindowFrame";
+this.table.style.zIndex="1050";
+var tr=document.createElement("tr");
+var td=document.createElement("td");
+td.colSpan=this.side;
+td.className="title";
+td.style.fontFamily="small-caption,caption,sans-serif";
+td.style.fontSize="x-small";
+td.unselectable="on";
+td.style.MozUserSelect="none";
+td.style.cursor="default";
+td.appendChild(document.createTextNode(Xinha._lc("Click a color...")));
+td.style.borderBottom="1px solid WindowFrame";
+tr.appendChild(td);
+td=null;
+var td=document.createElement("td");
+td.className="title";
+td.colSpan=2;
+td.style.fontFamily="Tahoma,Verdana,sans-serif";
+td.style.borderBottom="1px solid WindowFrame";
+td.style.paddingRight="0";
+tr.appendChild(td);
+var _c=document.createElement("div");
+_c.title=Xinha._lc("Close");
+_c.className="buttonColor";
+_c.style.height="11px";
+_c.style.width="11px";
+_c.style.cursor="pointer";
+_c.onclick=function(){
+_2.close();
+};
+_c.appendChild(document.createTextNode("\xd7"));
+_c.align="center";
+_c.style.verticalAlign="top";
+_c.style.position="relative";
+_c.style.cssFloat="right";
+_c.style.styleFloat="right";
+_c.style.padding="0";
+_c.style.margin="2px";
+_c.style.backgroundColor="transparent";
+_c.style.fontSize="11px";
+if(!Xinha.is_ie){
+_c.style.lineHeight="9px";
+}
+_c.style.letterSpacing="0";
+td.appendChild(_c);
+this.tbody.appendChild(tr);
+_c=tr=td=null;
+this.constrain_cb=document.createElement("input");
+this.constrain_cb.type="checkbox";
+this.chosenColor=document.createElement("input");
+this.chosenColor.type="text";
+this.chosenColor.maxLength=7;
+this.chosenColor.style.width="50px";
+this.chosenColor.style.fontSize="11px";
+this.chosenColor.onchange=function(){
+if(/#[0-9a-f]{6,6}/i.test(this.value)){
+_2.backSample.style.backgroundColor=this.value;
+_2.foreSample.style.color=this.value;
+}
+};
+this.backSample=document.createElement("div");
+this.backSample.appendChild(document.createTextNode("\xa0"));
+this.backSample.style.fontWeight="bold";
+this.backSample.style.fontFamily="small-caption,caption,sans-serif";
+this.backSample.fontSize="x-small";
+this.foreSample=document.createElement("div");
+this.foreSample.appendChild(document.createTextNode(Xinha._lc("Sample")));
+this.foreSample.style.fontWeight="bold";
+this.foreSample.style.fontFamily="small-caption,caption,sans-serif";
+this.foreSample.fontSize="x-small";
+function toHex(_d){
+var h=_d.toString(16);
+if(h.length<2){
+h="0"+h;
+}
+return h;
+}
+function tupleToColor(_f){
+return "#"+toHex(_f.red)+toHex(_f.green)+toHex(_f.blue);
+}
+function nearestPowerOf(num,_11){
+return Math.round(Math.round(num/_11)*_11);
+}
+function doubleHexDec(dec){
+return parseInt(dec.toString(16)+dec.toString(16),16);
+}
+function rgbToWebsafe(_13){
+_13.red=doubleHexDec(nearestPowerOf(parseInt(toHex(_13.red).charAt(0),16),3));
+_13.blue=doubleHexDec(nearestPowerOf(parseInt(toHex(_13.blue).charAt(0),16),3));
+_13.green=doubleHexDec(nearestPowerOf(parseInt(toHex(_13.green).charAt(0),16),3));
+return _13;
+}
+function hsvToRGB(h,s,v){
+var _17;
+if(s===0){
+_17={red:v,green:v,blue:v};
+}else{
+h/=60;
+var i=Math.floor(h);
+var f=h-i;
+var p=v*(1-s);
+var q=v*(1-s*f);
+var t=v*(1-s*(1-f));
+switch(i){
+case 0:
+_17={red:v,green:t,blue:p};
+break;
+case 1:
+_17={red:q,green:v,blue:p};
+break;
+case 2:
+_17={red:p,green:v,blue:t};
+break;
+case 3:
+_17={red:p,green:q,blue:v};
+break;
+case 4:
+_17={red:t,green:p,blue:v};
+break;
+default:
+_17={red:v,green:p,blue:q};
+break;
+}
+}
+_17.red=Math.ceil(_17.red*255);
+_17.green=Math.ceil(_17.green*255);
+_17.blue=Math.ceil(_17.blue*255);
+return _17;
+}
+var _1d=this;
+function closeOnBodyClick(ev){
+ev=ev?ev:window.event;
+el=ev.target?ev.target:ev.srcElement;
+do{
+if(el==_1d.table){
+return;
+}
+}while(el=el.parentNode);
+_1d.close();
+}
+this.open=function(_1f,_20,_21){
+this.table.style.display="";
+this.pick_color();
+if(_21&&/#[0-9a-f]{6,6}/i.test(_21)){
+this.chosenColor.value=_21;
+this.backSample.style.backgroundColor=_21;
+this.foreSample.style.color=_21;
+}
+Xinha._addEvent(document.body,"mousedown",closeOnBodyClick);
+this.table.style.position="absolute";
+var e=_20;
+var top=0;
+var _24=0;
+do{
+top+=e.offsetTop;
+_24+=e.offsetLeft;
+e=e.offsetParent;
+}while(e);
+var x,y;
+if(/top/.test(_1f)||(top+this.table.offsetHeight>document.body.offsetHeight)){
+if(top-this.table.offsetHeight>0){
+this.table.style.top=(top-this.table.offsetHeight)+"px";
+}else{
+this.table.style.top=0;
+}
+}else{
+this.table.style.top=(top+_20.offsetHeight)+"px";
+}
+if(/left/.test(_1f)||(_24+this.table.offsetWidth>document.body.offsetWidth)){
+if(_24-(this.table.offsetWidth-_20.offsetWidth)>0){
+this.table.style.left=(_24-(this.table.offsetWidth-_20.offsetWidth))+"px";
+}else{
+this.table.style.left=0;
+}
+}else{
+this.table.style.left=_24+"px";
+}
+};
+function pickCell(_26){
+_2.chosenColor.value=_26.colorCode;
+_2.backSample.style.backgroundColor=_26.colorCode;
+_2.foreSample.style.color=_26.colorCode;
+if((_26.hue>=195&&_26.saturation>0.5)||(_26.hue===0&&_26.saturation===0&&_26.value<0.5)||(_26.hue!==0&&_2.value<0.75)){
+_26.style.borderColor="#fff";
+}else{
+_26.style.borderColor="#000";
+}
+_5=_26.thisrow;
+_6=_26.thiscol;
+}
+function pickValue(_27){
+if(_2.value<0.5){
+_27.style.borderColor="#fff";
+}else{
+_27.style.borderColor="#000";
+}
+_9=_27.thisrow;
+_8=_27.thiscol;
+_2.chosenColor.value=_2.saved_cells[_5][_6].colorCode;
+_2.backSample.style.backgroundColor=_2.saved_cells[_5][_6].colorCode;
+_2.foreSample.style.color=_2.saved_cells[_5][_6].colorCode;
+}
+function unpickCell(row,col){
+_2.saved_cells[row][col].style.borderColor=_2.saved_cells[row][col].colorCode;
+}
+this.pick_color=function(){
+var _2a,cols;
+var _2b=this;
+var _2c=359/(this.side);
+var _2d=1/(this.side-1);
+var _2e=1/(this.side-1);
+var _2f=this.constrain_cb.checked;
+if(this.saved_cells===null){
+this.saved_cells=[];
+for(var row=0;row<this.side;row++){
+var tr=document.createElement("tr");
+this.saved_cells[row]=[];
+for(var col=0;col<this.side;col++){
+var td=document.createElement("td");
+if(_2f){
+td.colorCode=tupleToColor(rgbToWebsafe(hsvToRGB(_2c*row,_2d*col,this.value)));
+}else{
+td.colorCode=tupleToColor(hsvToRGB(_2c*row,_2d*col,this.value));
+}
+this.saved_cells[row][col]=td;
+td.style.height=this.cellsize+"px";
+td.style.width=this.cellsize-2+"px";
+td.style.borderWidth="1px";
+td.style.borderStyle="solid";
+td.style.borderColor=td.colorCode;
+td.style.backgroundColor=td.colorCode;
+if(row==_5&&col==_6){
+td.style.borderColor="#000";
+this.chosenColor.value=td.colorCode;
+this.backSample.style.backgroundColor=td.colorCode;
+this.foreSample.style.color=td.colorCode;
+}
+td.hue=_2c*row;
+td.saturation=_2d*col;
+td.thisrow=row;
+td.thiscol=col;
+td.onmousedown=function(){
+_3=true;
+_2b.saved_cells[_5][_6].style.borderColor=_2b.saved_cells[_5][_6].colorCode;
+pickCell(this);
+};
+td.onmouseover=function(){
+if(_3){
+pickCell(this);
+}
+};
+td.onmouseout=function(){
+if(_3){
+this.style.borderColor=this.colorCode;
+}
+};
+td.ondblclick=function(){
+Xinha.colorPicker.remember(this.colorCode,_2b.savecolors);
+_2b.callback(this.colorCode);
+_2b.close();
+};
+td.appendChild(document.createTextNode(" "));
+td.style.cursor="pointer";
+tr.appendChild(td);
+td=null;
+}
+var td=document.createElement("td");
+td.appendChild(document.createTextNode(" "));
+td.style.width=this.cellsize+"px";
+tr.appendChild(td);
+td=null;
+var td=document.createElement("td");
+this.saved_cells[row][col+1]=td;
+td.appendChild(document.createTextNode(" "));
+td.style.width=this.cellsize-2+"px";
+td.style.height=this.cellsize+"px";
+td.constrainedColorCode=tupleToColor(rgbToWebsafe(hsvToRGB(0,0,_2e*row)));
+td.style.backgroundColor=td.colorCode=tupleToColor(hsvToRGB(0,0,_2e*row));
+td.style.borderWidth="1px";
+td.style.borderStyle="solid";
+td.style.borderColor=td.colorCode;
+if(row==_9){
+td.style.borderColor="black";
+}
+td.hue=_2c*row;
+td.saturation=_2d*col;
+td.hsv_value=_2e*row;
+td.thisrow=row;
+td.thiscol=col+1;
+td.onmousedown=function(){
+_4=true;
+_2b.saved_cells[_9][_8].style.borderColor=_2b.saved_cells[_9][_8].colorCode;
+_2b.value=this.hsv_value;
+_2b.pick_color();
+pickValue(this);
+};
+td.onmouseover=function(){
+if(_4){
+_2b.value=this.hsv_value;
+_2b.pick_color();
+pickValue(this);
+}
+};
+td.onmouseout=function(){
+if(_4){
+this.style.borderColor=this.colorCode;
+}
+};
+td.style.cursor="pointer";
+tr.appendChild(td);
+td=null;
+this.tbody.appendChild(tr);
+tr=null;
+}
+var tr=document.createElement("tr");
+this.saved_cells[row]=[];
+for(var col=0;col<this.side;col++){
+var td=document.createElement("td");
+if(_2f){
+td.colorCode=tupleToColor(rgbToWebsafe(hsvToRGB(0,0,_2e*(this.side-col-1))));
+}else{
+td.colorCode=tupleToColor(hsvToRGB(0,0,_2e*(this.side-col-1)));
+}
+this.saved_cells[row][col]=td;
+td.style.height=this.cellsize+"px";
+td.style.width=this.cellsize-2+"px";
+td.style.borderWidth="1px";
+td.style.borderStyle="solid";
+td.style.borderColor=td.colorCode;
+td.style.backgroundColor=td.colorCode;
+td.hue=0;
+td.saturation=0;
+td.value=_2e*(this.side-col-1);
+td.thisrow=row;
+td.thiscol=col;
+td.onmousedown=function(){
+_3=true;
+_2b.saved_cells[_5][_6].style.borderColor=_2b.saved_cells[_5][_6].colorCode;
+pickCell(this);
+};
+td.onmouseover=function(){
+if(_3){
+pickCell(this);
+}
+};
+td.onmouseout=function(){
+if(_3){
+this.style.borderColor=this.colorCode;
+}
+};
+td.ondblclick=function(){
+Xinha.colorPicker.remember(this.colorCode,_2b.savecolors);
+_2b.callback(this.colorCode);
+_2b.close();
+};
+td.appendChild(document.createTextNode(" "));
+td.style.cursor="pointer";
+tr.appendChild(td);
+td=null;
+}
+this.tbody.appendChild(tr);
+tr=null;
+var tr=document.createElement("tr");
+var td=document.createElement("td");
+tr.appendChild(td);
+td.colSpan=this.side+2;
+td.style.padding="3px";
+if(this.websafe){
+var div=document.createElement("div");
+var _35=document.createElement("label");
+_35.appendChild(document.createTextNode(Xinha._lc("Web Safe: ")));
+this.constrain_cb.onclick=function(){
+_2b.pick_color();
+};
+_35.appendChild(this.constrain_cb);
+_35.style.fontFamily="small-caption,caption,sans-serif";
+_35.style.fontSize="x-small";
+div.appendChild(_35);
+td.appendChild(div);
+div=null;
+}
+var div=document.createElement("div");
+var _35=document.createElement("label");
+_35.style.fontFamily="small-caption,caption,sans-serif";
+_35.style.fontSize="x-small";
+_35.appendChild(document.createTextNode(Xinha._lc("Color: ")));
+_35.appendChild(this.chosenColor);
+div.appendChild(_35);
+var but=document.createElement("span");
+but.className="buttonColor ";
+but.style.fontSize="13px";
+but.style.width="24px";
+but.style.marginLeft="2px";
+but.style.padding="0px 4px";
+but.style.cursor="pointer";
+but.onclick=function(){
+Xinha.colorPicker.remember(_2b.chosenColor.value,_2b.savecolors);
+_2b.callback(_2b.chosenColor.value);
+_2b.close();
+};
+but.appendChild(document.createTextNode("OK"));
+but.align="center";
+div.appendChild(but);
+td.appendChild(div);
+var _37=document.createElement("table");
+_37.style.width="100%";
+var _38=document.createElement("tbody");
+_37.appendChild(_38);
+var _39=document.createElement("tr");
+_38.appendChild(_39);
+var _3a=document.createElement("td");
+_39.appendChild(_3a);
+_3a.appendChild(this.backSample);
+_3a.style.width="50%";
+var _3b=document.createElement("td");
+_39.appendChild(_3b);
+_3b.appendChild(this.foreSample);
+_3b.style.width="50%";
+td.appendChild(_37);
+var _3c=document.createElement("div");
+_3c.style.clear="both";
+function createSavedColors(_3d){
+var _3e=false;
+var div=document.createElement("div");
+div.style.width=_2b.cellsize+"px";
+div.style.height=_2b.cellsize+"px";
+div.style.margin="1px";
+div.style.border="1px solid black";
+div.style.cursor="pointer";
+div.style.backgroundColor=_3d;
+div.style[_3e?"styleFloat":"cssFloat"]="left";
+div.ondblclick=function(){
+_2b.callback(_3d);
+_2b.close();
+};
+div.onclick=function(){
+_2b.chosenColor.value=_3d;
+_2b.backSample.style.backgroundColor=_3d;
+_2b.foreSample.style.color=_3d;
+};
+_3c.appendChild(div);
+}
+for(var _40=0;_40<Xinha.colorPicker.savedColors.length;_40++){
+createSavedColors(Xinha.colorPicker.savedColors[_40]);
+}
+td.appendChild(_3c);
+this.tbody.appendChild(tr);
+document.body.appendChild(this.table);
+}else{
+for(var row=0;row<this.side;row++){
+for(var col=0;col<this.side;col++){
+if(_2f){
+this.saved_cells[row][col].colorCode=tupleToColor(rgbToWebsafe(hsvToRGB(_2c*row,_2d*col,this.value)));
+}else{
+this.saved_cells[row][col].colorCode=tupleToColor(hsvToRGB(_2c*row,_2d*col,this.value));
+}
+this.saved_cells[row][col].style.backgroundColor=this.saved_cells[row][col].colorCode;
+this.saved_cells[row][col].style.borderColor=this.saved_cells[row][col].colorCode;
+}
+}
+var _41=this.saved_cells[_5][_6];
+this.chosenColor.value=_41.colorCode;
+this.backSample.style.backgroundColor=_41.colorCode;
+this.foreSample.style.color=_41.colorCode;
+if((_41.hue>=195&&_41.saturation>0.5)||(_41.hue===0&&_41.saturation===0&&_41.value<0.5)||(_41.hue!==0&&_2b.value<0.75)){
+_41.style.borderColor="#fff";
+}else{
+_41.style.borderColor="#000";
+}
+}
+};
+this.close=function(){
+Xinha._removeEvent(document.body,"mousedown",closeOnBodyClick);
+this.table.style.display="none";
+};
+};
+Xinha.colorPicker.savedColors=[];
+Xinha.colorPicker.remember=function(_42,_43){
+for(var i=Xinha.colorPicker.savedColors.length;i--;){
+if(Xinha.colorPicker.savedColors[i]==_42){
+return false;
+}
+}
+Xinha.colorPicker.savedColors.splice(0,0,_42);
+Xinha.colorPicker.savedColors=Xinha.colorPicker.savedColors.slice(0,_43);
+var _45=new Date();
+_45.setMonth(_45.getMonth()+1);
+document.cookie="XinhaColorPicker="+escape(Xinha.colorPicker.savedColors.join("-"))+";expires="+_45.toGMTString();
+return true;
+};
+Xinha.colorPicker.loadColors=function(){
+var _46=document.cookie.indexOf("XinhaColorPicker");
+if(_46!=-1){
+var _47=(document.cookie.indexOf("=",_46)+1);
+var end=document.cookie.indexOf(";",_46);
+if(end==-1){
+end=document.cookie.length;
+}
+Xinha.colorPicker.savedColors=unescape(document.cookie.substring(_47,end)).split("-");
+}
+};
+Xinha.colorPicker._lc=function(_49){
+return Xinha._lc(_49);
+};
+Xinha.colorPicker.InputBinding=function(_4a,_4b){
+var _4c=document.createElement("span");
+_4c.className="buttonColor";
+var _4d=this.chooser=document.createElement("span");
+_4d.className="chooser";
+if(_4a.value){
+_4d.style.backgroundColor=_4a.value;
+}
+_4d.onmouseover=function(){
+_4d.className="chooser buttonColor-hilite";
+};
+_4d.onmouseout=function(){
+_4d.className="chooser";
+};
+_4d.appendChild(document.createTextNode("\xa0"));
+_4c.appendChild(_4d);
+var _4e=document.createElement("span");
+_4e.className="nocolor";
+_4e.onmouseover=function(){
+_4e.className="nocolor buttonColor-hilite";
+_4e.style.color="#f00";
+};
+_4e.onmouseout=function(){
+_4e.className="nocolor";
+_4e.style.color="#000";
+};
+_4e.onclick=function(){
+_4a.value="";
+_4d.style.backgroundColor="";
+};
+_4e.appendChild(document.createTextNode("\xd7"));
+_4c.appendChild(_4e);
+_4a.parentNode.insertBefore(_4c,_4a.nextSibling);
+Xinha._addEvent(_4a,"change",function(){
+_4d.style.backgroundColor=this.value;
+});
+_4b=(_4b)?Xinha.cloneObject(_4b):{cellsize:"5px"};
+_4b.callback=(_4b.callback)?_4b.callback:function(_4f){
+_4d.style.backgroundColor=_4f;
+_4a.value=_4f;
+};
+_4d.onclick=function(){
+var _50=new Xinha.colorPicker(_4b);
+_50.open("",_4d,_4a.value);
+};
+};
+

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/CreateLink/link.html
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/CreateLink/link.html?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/CreateLink/link.html (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/CreateLink/link.html Fri Sep 21 03:36:30 2007
@@ -0,0 +1,136 @@
+<html>
+
+<head>
+  <title>Insert/Modify Link</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(400, 200);
+
+Xinha = window.opener.Xinha;
+
+function i18n(str) {
+  return (Xinha._lc(str, 'Xinha'));
+}
+
+function onTargetChanged() {
+  var f = document.getElementById("f_other_target");
+  if (this.value == "_other") {
+    f.style.visibility = "visible";
+    f.select();
+    f.focus();
+  } else f.style.visibility = "hidden";
+}
+
+function Init() {
+  __dlg_translate('Xinha');
+  __dlg_init();
+
+  // Make sure the translated string appears in the drop down. (for gecko)
+  document.getElementById("f_target").selectedIndex = 1;
+  document.getElementById("f_target").selectedIndex = 0;
+
+  var param = window.dialogArguments;
+  var target_select = document.getElementById("f_target");
+  var use_target = true;
+  if (param) {
+    if ( typeof param["f_usetarget"] != "undefined" ) {
+      use_target = param["f_usetarget"];
+    }
+    if ( typeof param["f_href"] != "undefined" ) {
+      document.getElementById("f_href").value = param["f_href"];
+      document.getElementById("f_title").value = param["f_title"];
+      comboSelectValue(target_select, param["f_target"]);
+      if (target_select.value != param.f_target) {
+        var opt = document.createElement("option");
+        opt.value = param.f_target;
+        opt.innerHTML = opt.value;
+        target_select.appendChild(opt);
+        opt.selected = true;
+      }
+    }
+  }
+  if (! use_target) {
+    document.getElementById("f_target_label").style.visibility = "hidden";
+    document.getElementById("f_target").style.visibility = "hidden";
+    document.getElementById("f_other_target").style.visibility = "hidden";
+  }
+  var opt = document.createElement("option");
+  opt.value = "_other";
+  opt.innerHTML = i18n("Other");
+  target_select.appendChild(opt);
+  target_select.onchange = onTargetChanged;
+  document.getElementById("f_href").focus();
+  document.getElementById("f_href").select();
+}
+
+function onOK() {
+  var required = {
+    // f_href shouldn't be required or otherwise removing the link by entering an empty
+    // url isn't possible anymore.
+    // "f_href": i18n("You must enter the URL where this link points to")
+  };
+  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_href", "f_title", "f_target" ];
+  var param = new Object();
+  for (var i in fields) {
+    var id = fields[i];
+    var el = document.getElementById(id);
+    param[id] = el.value;
+  }
+  if (param.f_target == "_other")
+    param.f_target = document.getElementById("f_other_target").value;
+  __dlg_close(param);
+  return false;
+}
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+}
+
+</script>
+
+</head>
+
+<body class="dialog" onload="Init()">
+<div class="title">Insert/Modify Link</div>
+<form>
+<table border="0" style="width: 100%;">
+  <tr>
+    <td class="label">URL:</td>
+    <td><input type="text" id="f_href" style="width: 100%" /></td>
+  </tr>
+  <tr>
+    <td class="label">Title (tooltip):</td>
+    <td><input type="text" id="f_title" style="width: 100%" /></td>
+  </tr>
+  <tr>
+    <td class="label"><span id="f_target_label">Target:</span></td>
+    <td><select id="f_target">
+      <option value="">None (use implicit)</option>
+      <option value="_blank">New window (_blank)</option>
+      <option value="_self">Same frame (_self)</option>
+      <option value="_top">Top frame (_top)</option>
+    </select>
+    <input type="text" name="f_other_target" id="f_other_target" size="10" style="visibility: hidden" />
+    </td>
+  </tr>
+</table>
+
+<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: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/CreateLink/link.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/CreateLink/link.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/CreateLink/link.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/CreateLink/link.js Fri Sep 21 03:36:30 2007
@@ -0,0 +1,84 @@
+CreateLink._pluginInfo={name:"CreateLink",origin:"Xinha Core",version:"$LastChangedRevision: 694 $".replace(/^[^:]*: (.*) \$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL: http://svn.xinha.python-hosting.com/trunk/modules/CreateLink/link.js $".replace(/^[^:]*: (.*) \$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"};
+function CreateLink(_1){
+}
+Xinha.prototype._createLink=function(_2){
+var _3=this;
+var _4=null;
+if(typeof _2=="undefined"){
+_2=this.getParentElement();
+if(_2){
+while(_2&&!/^a$/i.test(_2.tagName)){
+_2=_2.parentNode;
+}
+}
+}
+if(!_2){
+var _5=_3.getSelection();
+var _6=_3.createRange(_5);
+var _7=0;
+if(Xinha.is_ie){
+if(_5.type=="Control"){
+_7=_6.length;
+}else{
+_7=_6.compareEndPoints("StartToEnd",_6);
+}
+}else{
+_7=_6.compareBoundaryPoints(_6.START_TO_END,_6);
+}
+if(_7===0){
+alert(Xinha._lc("You need to select some text before creating a link"));
+return;
+}
+_4={f_href:"",f_title:"",f_target:"",f_usetarget:_3.config.makeLinkShowsTarget};
+}else{
+_4={f_href:Xinha.is_ie?_3.stripBaseURL(_2.href):_2.getAttribute("href"),f_title:_2.title,f_target:_2.target,f_usetarget:_3.config.makeLinkShowsTarget};
+}
+Dialog(_3.config.URIs.link,function(_8){
+if(!_8){
+return false;
+}
+var a=_2;
+if(!a){
+try{
+var _a=Xinha.uniq("http://www.example.com/Link");
+_3._doc.execCommand("createlink",false,_a);
+var _b=_3._doc.getElementsByTagName("a");
+for(var i=0;i<_b.length;i++){
+var _d=_b[i];
+if(_d.href==_a){
+if(!a){
+a=_d;
+}
+_d.href=_8.f_href;
+if(_8.f_target){
+_d.target=_8.f_target;
+}
+if(_8.f_title){
+_d.title=_8.f_title;
+}
+}
+}
+}
+catch(ex){
+}
+}else{
+var _e=_8.f_href.trim();
+_3.selectNodeContents(a);
+if(_e===""){
+_3._doc.execCommand("unlink",false,null);
+_3.updateToolbar();
+return false;
+}else{
+a.href=_e;
+}
+}
+if(!(a&&a.tagName.toLowerCase()=="a")){
+return false;
+}
+a.target=_8.f_target.trim();
+a.title=_8.f_title.trim();
+_3.selectNodeContents(a);
+_3.updateToolbar();
+},_4);
+};
+

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/dialog.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/dialog.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/dialog.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/dialog.js Fri Sep 21 03:36:30 2007
@@ -0,0 +1,62 @@
+function Dialog(_1,_2,_3){
+if(typeof _3=="undefined"){
+_3=window;
+}
+Dialog._geckoOpenModal(_1,_2,_3);
+}
+Dialog._parentEvent=function(ev){
+setTimeout(function(){
+if(Dialog._modal&&!Dialog._modal.closed){
+Dialog._modal.focus();
+}
+},50);
+try{
+if(Dialog._modal&&!Dialog._modal.closed){
+Xinha._stopEvent(ev);
+}
+}
+catch(e){
+}
+};
+Dialog._return=null;
+Dialog._modal=null;
+Dialog._arguments=null;
+Dialog._geckoOpenModal=function(_5,_6,_7){
+var _8=window.open(_5,"hadialog","toolbar=no,menubar=no,personalbar=no,width=10,height=10,"+"scrollbars=no,resizable=yes,modal=yes,dependable=yes");
+Dialog._modal=_8;
+Dialog._arguments=_7;
+function capwin(w){
+Xinha._addEvent(w,"click",Dialog._parentEvent);
+Xinha._addEvent(w,"mousedown",Dialog._parentEvent);
+Xinha._addEvent(w,"focus",Dialog._parentEvent);
+}
+function relwin(w){
+Xinha._removeEvent(w,"click",Dialog._parentEvent);
+Xinha._removeEvent(w,"mousedown",Dialog._parentEvent);
+Xinha._removeEvent(w,"focus",Dialog._parentEvent);
+}
+capwin(window);
+for(var i=0;i<window.frames.length;i++){
+try{
+capwin(window.frames[i]);
+}
+catch(e){
+}
+}
+Dialog._return=function(_c){
+if(_c&&_6){
+_6(_c);
+}
+relwin(window);
+for(var i=0;i<window.frames.length;i++){
+try{
+relwin(window.frames[i]);
+}
+catch(e){
+}
+}
+Dialog._modal=null;
+};
+Dialog._modal.focus();
+};
+

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/inline-dialog.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/inline-dialog.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/inline-dialog.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/inline-dialog.js Fri Sep 21 03:36:30 2007
@@ -0,0 +1,204 @@
+Xinha.Dialog=function(_1,_2,_3){
+this.id={};
+this.r_id={};
+this.editor=_1;
+this.document=document;
+this.rootElem=document.createElement("div");
+this.rootElem.className="dialog";
+this.rootElem.style.position="absolute";
+this.rootElem.style.display="none";
+this.editor._framework.ed_cell.insertBefore(this.rootElem,this.editor._framework.ed_cell.firstChild);
+this.rootElem.style.width=this.width=this.editor._framework.ed_cell.offsetWidth+"px";
+this.rootElem.style.height=this.height=this.editor._framework.ed_cell.offsetHeight+"px";
+var _4=this;
+if(typeof _3=="function"){
+this._lc=_3;
+}else{
+if(_3){
+this._lc=function(_5){
+return Xinha._lc(_5,_3);
+};
+}else{
+this._lc=function(_6){
+return _6;
+};
+}
+}
+_2=_2.replace(/\[([a-z0-9_]+)\]/ig,function(_7,id){
+if(typeof _4.id[id]=="undefined"){
+_4.id[id]=Xinha.uniq("Dialog");
+_4.r_id[_4.id[id]]=id;
+}
+return _4.id[id];
+}).replace(/<l10n>(.*?)<\/l10n>/ig,function(_9,_a){
+return _4._lc(_a);
+}).replace(/="_\((.*?)\)"/g,function(_b,_c){
+return "=\""+_4._lc(_c)+"\"";
+});
+this.rootElem.innerHTML=_2;
+this.editor.notifyOn("resize",function(e,_e){
+_4.rootElem.style.width=_4.width=_4.editor._framework.ed_cell.offsetWidth+"px";
+_4.rootElem.style.height=_4.height=_4.editor._framework.ed_cell.offsetHeight+"px";
+_4.onresize();
+});
+};
+Xinha.Dialog.prototype.onresize=function(){
+return true;
+};
+Xinha.Dialog.prototype.show=function(_f){
+if(Xinha.is_ie){
+this._lastRange=this.editor._createRange(this.editor._getSelection());
+}
+if(typeof _f!="undefined"){
+this.setValues(_f);
+}
+this._restoreTo=[this.editor._textArea.style.display,this.editor._iframe.style.visibility,this.editor.hidePanels()];
+this.editor._textArea.style.display="none";
+this.editor._iframe.style.visibility="hidden";
+this.rootElem.style.display="";
+};
+Xinha.Dialog.prototype.hide=function(){
+this.rootElem.style.display="none";
+this.editor._textArea.style.display=this._restoreTo[0];
+this.editor._iframe.style.visibility=this._restoreTo[1];
+this.editor.showPanels(this._restoreTo[2]);
+if(Xinha.is_ie){
+this._lastRange.select();
+}
+this.editor.updateToolbar();
+return this.getValues();
+};
+Xinha.Dialog.prototype.toggle=function(){
+if(this.rootElem.style.display=="none"){
+this.show();
+}else{
+this.hide();
+}
+};
+Xinha.Dialog.prototype.setValues=function(_10){
+for(var i in _10){
+var _12=this.getElementsByName(i);
+if(!_12){
+continue;
+}
+for(var x=0;x<_12.length;x++){
+var e=_12[x];
+switch(e.tagName.toLowerCase()){
+case "select":
+for(var j=0;j<e.options.length;j++){
+if(typeof _10[i]=="object"){
+for(var k=0;k<_10[i].length;k++){
+if(_10[i][k]==e.options[j].value){
+e.options[j].selected=true;
+}
+}
+}else{
+if(_10[i]==e.options[j].value){
+e.options[j].selected=true;
+}
+}
+}
+break;
+case "textarea":
+case "input":
+switch(e.getAttribute("type")){
+case "radio":
+if(e.value==_10[i]){
+e.checked=true;
+}
+break;
+case "checkbox":
+if(typeof _10[i]=="object"){
+for(var j in _10[i]){
+if(_10[i][j]==e.value){
+e.checked=true;
+}
+}
+}else{
+if(_10[i]==e.value){
+e.checked=true;
+}
+}
+break;
+default:
+e.value=_10[i];
+}
+break;
+default:
+break;
+}
+}
+}
+};
+Xinha.Dialog.prototype.getValues=function(){
+var _17=[];
+var _18=Xinha.collectionToArray(this.rootElem.getElementsByTagName("input")).append(Xinha.collectionToArray(this.rootElem.getElementsByTagName("textarea"))).append(Xinha.collectionToArray(this.rootElem.getElementsByTagName("select")));
+for(var x=0;x<_18.length;x++){
+var i=_18[x];
+if(!(i.name&&this.r_id[i.name])){
+continue;
+}
+if(typeof _17[this.r_id[i.name]]=="undefined"){
+_17[this.r_id[i.name]]=null;
+}
+var v=_17[this.r_id[i.name]];
+switch(i.tagName.toLowerCase()){
+case "select":
+if(i.multiple){
+if(!v.push){
+if(v!=null){
+v=[v];
+}else{
+v=new Array();
+}
+}
+for(var j=0;j<i.options.length;j++){
+if(i.options[j].selected){
+v.push(i.options[j].value);
+}
+}
+}else{
+if(i.selectedIndex>=0){
+v=i.options[i.selectedIndex];
+}
+}
+break;
+case "textarea":
+case "input":
+default:
+switch(i.type.toLowerCase()){
+case "radio":
+if(i.checked){
+v=i.value;
+break;
+}
+case "checkbox":
+if(v==null){
+if(this.getElementsByName(this.r_id[i.name]).length>1){
+v=new Array();
+}
+}
+if(i.checked){
+if(v!=null&&typeof v=="object"&&v.push){
+v.push(i.value);
+}else{
+v=i.value;
+}
+}
+break;
+default:
+v=i.value;
+break;
+}
+}
+_17[this.r_id[i.name]]=v;
+}
+return _17;
+};
+Xinha.Dialog.prototype.getElementById=function(id){
+return this.document.getElementById(this.id[id]?this.id[id]:id);
+};
+Xinha.Dialog.prototype.getElementsByName=function(_1e){
+return this.document.getElementsByName(this.id[_1e]?this.id[_1e]:_1e);
+};
+

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/panel-dialog.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/panel-dialog.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/panel-dialog.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/panel-dialog.js Fri Sep 21 03:36:30 2007
@@ -0,0 +1,76 @@
+
+Xinha.PanelDialog = function(editor, side, html, localizer)
+{
+  this.id    = { };
+  this.r_id  = { }; // reverse lookup id
+  this.editor   = editor;
+  this.document = document;
+  this.rootElem = editor.addPanel(side);
+
+  var dialog = this;
+  if(typeof localizer == 'function')
+  {
+    this._lc = localizer;
+  }
+  else if(localizer)
+  {
+    this._lc = function(string)
+    {
+      return Xinha._lc(string,localizer);
+    };
+  }
+  else
+  {
+    this._lc = function(string)
+    {
+      return string;
+    };
+  }
+
+  html = html.replace(/\[([a-z0-9_]+)\]/ig,
+                      function(fullString, id)
+                      {
+                        if(typeof dialog.id[id] == 'undefined')
+                        {
+                          dialog.id[id] = Xinha.uniq('Dialog');
+                          dialog.r_id[dialog.id[id]] = id;
+                        }
+                        return dialog.id[id];
+                      }
+             ).replace(/<l10n>(.*?)<\/l10n>/ig,
+                       function(fullString,translate)
+                       {
+                         return dialog._lc(translate) ;
+                       }
+             ).replace(/="_\((.*?)\)"/g,
+                       function(fullString, translate)
+                       {
+                         return '="' + dialog._lc(translate) + '"';
+                       }
+             );
+
+  this.rootElem.innerHTML = html;
+};
+
+Xinha.PanelDialog.prototype.show = function(values)
+{
+  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;
\ No newline at end of file

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/popupwin.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/popupwin.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/popupwin.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Dialogs/popupwin.js Fri Sep 21 03:36:30 2007
@@ -0,0 +1,120 @@
+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: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/full-screen.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/full-screen.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/full-screen.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/full-screen.js Fri Sep 21 03:36:30 2007
@@ -0,0 +1,136 @@
+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){
+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: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/de.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/de.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/de.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/de.js Fri Sep 21 03:36:30 2007
@@ -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: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/fr.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/fr.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/fr.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/fr.js Fri Sep 21 03:36:30 2007
@@ -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: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/ja.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/ja.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/ja.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/ja.js Fri Sep 21 03:36:30 2007
@@ -0,0 +1,5 @@
+// I18N constants
+// LANG: "ja", ENCODING: UTF-8
+{
+  "Maximize/Minimize Editor": "エディタの最大化/最小化"
+};
\ No newline at end of file

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/nb.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/nb.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/nb.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/nb.js Fri Sep 21 03:36:30 2007
@@ -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: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/pl.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/pl.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/pl.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/pl.js Fri Sep 21 03:36:30 2007
@@ -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: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/ru.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/ru.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/ru.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/ru.js Fri Sep 21 03:36:30 2007
@@ -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: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/sv.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/sv.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/sv.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/FullScreen/lang/sv.js Fri Sep 21 03:36:30 2007
@@ -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: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Gecko/Gecko.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Gecko/Gecko.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Gecko/Gecko.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Gecko/Gecko.js Fri Sep 21 03:36:30 2007
@@ -0,0 +1,413 @@
+Gecko._pluginInfo={name:"Gecko",origin:"Xinha Core",version:"$LastChangedRevision: 808 $".replace(/^[^:]*: (.*) \$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL: http://svn.xinha.python-hosting.com/trunk/modules/Gecko/Gecko.js $".replace(/^[^:]*: (.*) \$$/,"$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)){
+if(!RE_ip.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(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;
+}
+return false;
+};
+Gecko.prototype.onMouseDown=function(ev){
+if(ev.target.tagName.toLowerCase()=="hr"){
+var sel=this.editor.getSelection();
+var _2c=this.editor.createRange(sel);
+_2c.selectNode(ev.target);
+}
+};
+Xinha.prototype.insertNodeAtSelection=function(_2d){
+var sel=this.getSelection();
+var _2f=this.createRange(sel);
+sel.removeAllRanges();
+_2f.deleteContents();
+var _30=_2f.startContainer;
+var pos=_2f.startOffset;
+var _32=_2d;
+switch(_30.nodeType){
+case 3:
+if(_2d.nodeType==3){
+_30.insertData(pos,_2d.data);
+_2f=this.createRange();
+_2f.setEnd(_30,pos+_2d.length);
+_2f.setStart(_30,pos+_2d.length);
+sel.addRange(_2f);
+}else{
+_30=_30.splitText(pos);
+if(_2d.nodeType==11){
+_32=_32.firstChild;
+}
+_30.parentNode.insertBefore(_2d,_30);
+this.selectNodeContents(_32);
+this.updateToolbar();
+}
+break;
+case 1:
+if(_2d.nodeType==11){
+_32=_32.firstChild;
+}
+_30.insertBefore(_2d,_30.childNodes[pos]);
+this.selectNodeContents(_32);
+this.updateToolbar();
+break;
+}
+};
+Xinha.prototype.getParentElement=function(sel){
+if(typeof sel=="undefined"){
+sel=this.getSelection();
+}
+var _34=this.createRange(sel);
+try{
+var p=_34.commonAncestorContainer;
+if(!_34.collapsed&&_34.startContainer==_34.endContainer&&_34.startOffset-_34.endOffset<=1&&_34.startContainer.hasChildNodes()){
+p=_34.startContainer.childNodes[_34.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(_38){
+var sel=this.getSelection();
+sel.removeAllRanges();
+sel.addRange(_38);
+};
+Xinha.prototype.selectNodeContents=function(_3a,pos){
+this.focusEditor();
+this.forceRedraw();
+var _3c;
+var _3d=typeof pos=="undefined"?true:false;
+var sel=this.getSelection();
+_3c=this._doc.createRange();
+if(_3d&&_3a.tagName&&_3a.tagName.toLowerCase().match(/table|img|input|textarea|select/)){
+_3c.selectNode(_3a);
+}else{
+_3c.selectNodeContents(_3a);
+}
+sel.removeAllRanges();
+sel.addRange(_3c);
+};
+Xinha.prototype.insertHTML=function(_3f){
+var sel=this.getSelection();
+var _41=this.createRange(sel);
+this.focusEditor();
+var _42=this._doc.createDocumentFragment();
+var div=this._doc.createElement("div");
+div.innerHTML=_3f;
+while(div.firstChild){
+_42.appendChild(div.firstChild);
+}
+var _44=this.insertNodeAtSelection(_42);
+};
+Xinha.prototype.getSelectedHTML=function(){
+var sel=this.getSelection();
+var _46=this.createRange(sel);
+return Xinha.getHTML(_46.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(_48){
+return _48.type=="keypress";
+};
+Xinha.prototype.getKey=function(_49){
+return String.fromCharCode(_49.charCode);
+};
+Xinha.getOuterHTML=function(_4a){
+return (new XMLSerializer()).serializeToString(_4a);
+};
+Xinha.prototype.cc=String.fromCharCode(173);
+Xinha.prototype.setCC=function(_4b){
+try{
+if(_4b=="textarea"){
+var ta=this._textArea;
+var _4d=ta.selectionStart;
+var _4e=ta.value.substring(0,_4d);
+var _4f=ta.value.substring(_4d,ta.value.length);
+if(_4f.match(/^[^<]*>/)){
+var _50=_4f.indexOf(">")+1;
+ta.value=_4e+_4f.substring(0,_50)+this.cc+_4f.substring(_50,_4f.length);
+}else{
+ta.value=_4e+this.cc+_4f;
+}
+}else{
+var sel=this.getSelection();
+sel.getRangeAt(0).insertNode(document.createTextNode(this.cc));
+}
+}
+catch(e){
+}
+};
+Xinha.prototype.findCC=function(_52){
+try{
+var _53=(_52=="textarea")?window:this._iframe.contentWindow;
+if(_53.find(this.cc)){
+if(_52=="textarea"){
+var ta=this._textArea;
+var _55=pos=ta.selectionStart;
+var end=ta.selectionEnd;
+var _57=ta.scrollTop;
+ta.value=ta.value.substring(0,_55)+ta.value.substring(end,ta.value.length);
+ta.selectionStart=pos;
+ta.selectionEnd=pos;
+ta.scrollTop=_57;
+ta.focus();
+}else{
+var sel=this.getSelection();
+sel.getRangeAt(0).deleteContents();
+this._iframe.contentWindow.focus();
+}
+}
+}
+catch(e){
+}
+};
+Xinha.prototype._standardToggleBorders=Xinha.prototype._toggleBorders;
+Xinha.prototype._toggleBorders=function(){
+var _59=this._standardToggleBorders();
+var _5a=this._doc.getElementsByTagName("TABLE");
+for(var i=0;i<_5a.length;i++){
+_5a[i].style.display="none";
+_5a[i].style.display="table";
+}
+return _59;
+};
+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: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Gecko/paraHandlerBest.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Gecko/paraHandlerBest.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Gecko/paraHandlerBest.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Gecko/paraHandlerBest.js Fri Sep 21 03:36:30 2007
@@ -0,0 +1,293 @@
+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: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Gecko/paraHandlerDirty.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Gecko/paraHandlerDirty.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Gecko/paraHandlerDirty.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/Gecko/paraHandlerDirty.js Fri Sep 21 03:36:30 2007
@@ -0,0 +1,116 @@
+EnterParagraphs._pluginInfo={name:"EnterParagraphs",origin:"Xinha Core",version:"$LastChangedRevision: 688 $".replace(/^[^:]*: (.*) \$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL: http://svn.xinha.python-hosting.com/trunk/modules/Gecko/paraHandlerDirty.js $".replace(/^[^:]*: (.*) \$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"};
+function EnterParagraphs(_1){
+this.editor=_1;
+}
+EnterParagraphs.prototype.onKeyPress=function(ev){
+if(ev.keyCode==13&&!ev.shiftKey){
+this.dom_checkInsertP();
+Xinha._stopEvent(ev);
+}
+};
+EnterParagraphs.prototype.dom_checkInsertP=function(){
+var _3=this.editor;
+var p,body;
+var _5=_3.getSelection();
+var _6=_3.createRange(_5);
+if(!_6.collapsed){
+_6.deleteContents();
+}
+_3.deactivateEditor();
+var SC=_6.startContainer;
+var SO=_6.startOffset;
+var EC=_6.endContainer;
+var EO=_6.endOffset;
+if(SC==EC&&SC==body&&!SO&&!EO){
+p=_3._doc.createTextNode(" ");
+body.insertBefore(p,body.firstChild);
+_6.selectNodeContents(p);
+SC=_6.startContainer;
+SO=_6.startOffset;
+EC=_6.endContainer;
+EO=_6.endOffset;
+}
+p=_3.getAllAncestors();
+var _b=null;
+body=_3._doc.body;
+for(var i=0;i<p.length;++i){
+if(Xinha.isParaContainer(p[i])){
+break;
+}else{
+if(Xinha.isBlockElement(p[i])&&!(/body|html/i.test(p[i].tagName))){
+_b=p[i];
+break;
+}
+}
+}
+if(!_b){
+var _d=_6.startContainer;
+while(_d.parentNode&&!Xinha.isParaContainer(_d.parentNode)){
+_d=_d.parentNode;
+}
+var _e=_d;
+var _f=_d;
+while(_e.previousSibling){
+if(_e.previousSibling.tagName){
+if(!Xinha.isBlockElement(_e.previousSibling)){
+_e=_e.previousSibling;
+}else{
+break;
+}
+}else{
+_e=_e.previousSibling;
+}
+}
+while(_f.nextSibling){
+if(_f.nextSibling.tagName){
+if(!Xinha.isBlockElement(_f.nextSibling)){
+_f=_f.nextSibling;
+}else{
+break;
+}
+}else{
+_f=_f.nextSibling;
+}
+}
+_6.setStartBefore(_e);
+_6.setEndAfter(_f);
+_6.surroundContents(_3._doc.createElement("p"));
+_b=_6.startContainer.firstChild;
+_6.setStart(SC,SO);
+}
+_6.setEndAfter(_b);
+var r2=_6.cloneRange();
+_5.removeRange(_6);
+var df=r2.extractContents();
+if(df.childNodes.length===0){
+df.appendChild(_3._doc.createElement("p"));
+df.firstChild.appendChild(_3._doc.createElement("br"));
+}
+if(df.childNodes.length>1){
+var nb=_3._doc.createElement("p");
+while(df.firstChild){
+var s=df.firstChild;
+df.removeChild(s);
+nb.appendChild(s);
+}
+df.appendChild(nb);
+}
+if(!(/\S/.test(_b.innerHTML))){
+_b.innerHTML="&nbsp;";
+}
+p=df.firstChild;
+if(!(/\S/.test(p.innerHTML))){
+p.innerHTML="<br />";
+}
+if((/^\s*<br\s*\/?>\s*$/.test(p.innerHTML))&&(/^h[1-6]$/i.test(p.tagName))){
+df.appendChild(_3.convertNode(p,"p"));
+df.removeChild(p);
+}
+var _14=_b.parentNode.insertBefore(df.firstChild,_b.nextSibling);
+_3.activateEditor();
+_5=_3.getSelection();
+_5.removeAllRanges();
+_5.collapse(_14,0);
+_3.scrollToElement(_14);
+};
+

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/GetHtml/DOMwalk.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/GetHtml/DOMwalk.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/GetHtml/DOMwalk.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/GetHtml/DOMwalk.js Fri Sep 21 03:36:30 2007
@@ -0,0 +1,183 @@
+function GetHtmlImplementation(_1){
+this.editor=_1;
+}
+GetHtmlImplementation._pluginInfo={name:"GetHtmlImplementation DOMwalk",origin:"Xinha Core",version:"$LastChangedRevision: 821 $".replace(/^[^:]*: (.*) \$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL: http://svn.xinha.python-hosting.com/trunk/modules/GetHtml/DOMwalk.js $".replace(/^[^:]*: (.*) \$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"};
+Xinha.getHTML=function(_2,_3,_4){
+try{
+return Xinha.getHTMLWrapper(_2,_3,_4);
+}
+catch(ex){
+alert(Xinha._lc("Your Document is not well formed. Check JavaScript console for details."));
+return _4._iframe.contentWindow.document.body.innerHTML;
+}
+};
+Xinha.emptyAttributes=" checked disabled ismap readonly nowrap compact declare selected defer multiple noresize noshade ";
+Xinha.elGetsNewLine=function(el){
+return (" br meta link title ".indexOf(" "+el.tagName.toLowerCase()+" ")!=-1);
+};
+Xinha.getHTMLWrapper=function(_6,_7,_8,_9){
+var _a="";
+if(!_9){
+_9="";
+}
+switch(_6.nodeType){
+case 10:
+case 6:
+case 12:
+break;
+case 2:
+break;
+case 4:
+_a+=(Xinha.is_ie?("\n"+_9):"")+"<![CDATA["+_6.data+"]]>";
+break;
+case 5:
+_a+="&"+_6.nodeValue+";";
+break;
+case 7:
+_a+=(Xinha.is_ie?("\n"+_9):"")+"<"+"?"+_6.target+" "+_6.data+" ?>";
+break;
+case 1:
+case 11:
+case 9:
+var _b;
+var i;
+var _d=(_6.nodeType==1)?_6.tagName.toLowerCase():"";
+if((_d=="script"||_d=="noscript")&&_8.config.stripScripts){
+break;
+}
+if(_7){
+_7=!(_8.config.htmlRemoveTags&&_8.config.htmlRemoveTags.test(_d));
+}
+if(Xinha.is_ie&&_d=="head"){
+if(_7){
+_a+=(Xinha.is_ie?("\n"+_9):"")+"<head>";
+}
+var _e=RegExp.multiline;
+RegExp.multiline=true;
+var _f=_6.innerHTML.replace(Xinha.RE_tagName,function(str,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=_e;
+_a+=_f+"\n";
+if(_7){
+_a+=(Xinha.is_ie?("\n"+_9):"")+"</head>";
+}
+break;
+}else{
+if(_7){
+_b=(!(_6.hasChildNodes()||Xinha.needsClosingTag(_6)));
+_a+=((Xinha.isBlockElement(_6)||Xinha.elGetsNewLine(_6))?("\n"+_9):"")+"<"+_6.tagName.toLowerCase();
+var _13=_6.attributes;
+for(i=0;i<_13.length;++i){
+var a=_13.item(i);
+if(typeof a.nodeValue=="object"){
+continue;
+}
+if(_6.tagName.toLowerCase()=="input"&&_6.type.toLowerCase()=="checkbox"&&a.nodeName.toLowerCase()=="value"&&a.nodeValue.toLowerCase()=="on"){
+continue;
+}
+if(!a.specified&&!(_6.tagName.toLowerCase().match(/input|option/)&&a.nodeName=="value")&&!(_6.tagName.toLowerCase().match(/area/)&&a.nodeName.match(/shape|coords/i))){
+continue;
+}
+var _15=a.nodeName.toLowerCase();
+if(/_moz_editor_bogus_node/.test(_15)){
+_a="";
+break;
+}
+if(/(_moz)|(contenteditable)|(_msh)/.test(_15)){
+continue;
+}
+var _16;
+if(Xinha.emptyAttributes.indexOf(" "+_15+" ")!=-1){
+_16=_15;
+}else{
+if(_15!="style"){
+if(typeof _6[a.nodeName]!="undefined"&&_15!="href"&&_15!="src"&&!(/^on/.test(_15))){
+_16=_6[a.nodeName];
+}else{
+_16=a.nodeValue;
+if(Xinha.is_ie&&(_15=="href"||_15=="src")){
+_16=_8.stripBaseURL(_16);
+}
+if(_8.config.only7BitPrintablesInURLs&&(_15=="href"||_15=="src")){
+_16=_16.replace(/([^!-~]+)/g,function(_17){
+return escape(_17);
+});
+}
+}
+}else{
+if(!Xinha.is_ie){
+_16=_6.style.cssText.replace(/rgb\(.*?\)/ig,function(rgb){
+return Xinha._colorToRgb(rgb);
+});
+}
+}
+}
+if(/^(_moz)?$/.test(_16)){
+continue;
+}
+_a+=" "+_15+"=\""+Xinha.htmlEncode(_16)+"\"";
+}
+if(Xinha.is_ie&&_6.style.cssText){
+_a+=" style=\""+_6.style.cssText.toLowerCase()+"\"";
+}
+if(Xinha.is_ie&&_6.tagName.toLowerCase()=="option"&&_6.selected){
+_a+=" selected=\"selected\"";
+}
+if(_a!==""){
+if(_b&&_d=="p"){
+_a+=">&nbsp;</p>";
+}else{
+if(_b){
+_a+=" />";
+}else{
+_a+=">";
+}
+}
+}
+}
+}
+var _19=false;
+if(_d=="script"||_d=="noscript"){
+if(!_8.config.stripScripts){
+if(Xinha.is_ie){
+var _1a="\n"+_6.innerHTML.replace(/^[\n\r]*/,"").replace(/\s+$/,"")+"\n"+_9;
+}else{
+var _1a=(_6.hasChildNodes())?_6.firstChild.nodeValue:"";
+}
+_a+=_1a+"</"+_d+">"+((Xinha.is_ie)?"\n":"");
+}
+}else{
+if(_d=="pre"){
+_a+=((Xinha.is_ie)?"\n":"")+_6.innerHTML.replace(/<br>/g,"\n")+"</"+_d+">";
+}else{
+for(i=_6.firstChild;i;i=i.nextSibling){
+if(!_19&&i.nodeType==1&&Xinha.isBlockElement(i)){
+_19=true;
+}
+_a+=Xinha.getHTMLWrapper(i,true,_8,_9+"  ");
+}
+if(_7&&!_b){
+_a+=(((Xinha.isBlockElement(_6)&&_19)||_d=="head"||_d=="html")?("\n"+_9):"")+"</"+_6.tagName.toLowerCase()+">";
+}
+}
+}
+break;
+case 3:
+if(/^script|noscript|style$/i.test(_6.parentNode.tagName)){
+_a=_6.data;
+}else{
+if(_6.data.trim()==""){
+_a="";
+}else{
+_a=Xinha.htmlEncode(_6.data);
+}
+}
+break;
+case 8:
+_a="<!--"+_6.data+"-->";
+break;
+}
+return _a;
+};
+

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/GetHtml/TransformInnerHTML.js
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/GetHtml/TransformInnerHTML.js?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/GetHtml/TransformInnerHTML.js (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/GetHtml/TransformInnerHTML.js Fri Sep 21 03:36:30 2007
@@ -0,0 +1,143 @@
+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"};
+HTMLArea.RegExpCache=[new RegExp().compile(/<\s*\/?([^\s\/>]+)[\s*\/>]/gi),new RegExp().compile(/(\s+)_moz[^=>]*=[^\s>]*/gi),new RegExp().compile(/\s*=\s*(([^'"][^>\s]*)([>\s])|"([^"]+)"|'([^']+)')/g),new RegExp().compile(/\/>/g),new RegExp().compile(/<(br|hr|img|input|link|meta|param|embed|area)((\s*\S*="[^"]*")*)>/g),new RegExp().compile(/(checked|compact|declare|defer|disabled|ismap|multiple|no(href|resize|shade|wrap)|readonly|selected)([\s>])/gi),new RegExp().compile(/(="[^']*)'([^'"]*")/),new RegExp().compile(/&(?=[^<]*>)/g),new RegExp().compile(/<\s+/g),new RegExp().compile(/\s+(\/)?>/g),new RegExp().compile(/\s{2,}/g),new RegExp().compile(/\s+([^=\s]+)((="[^"]+")|([\s>]))/g),new RegExp().compile(/\s+contenteditable(=[^>\s\/]*)?/gi),new RegExp().compile(/((href|src)=")([^\s]*)"/g),new RegExp().compile(/<\/?(div|p|h[1-6]|table|tr|td|th|ul|ol|li|blockquote|object|br|hr|img|embed|param|pre|script|html|head|body|meta|link|title|area|input|form|textarea|select|option)[^>]*>
 /g),new RegExp().compile(/<\/(div|p|h[1-6]|table|tr|ul|ol|blockquote|object|html|head|body|script|form|select)( [^>]*)?>/g),new RegExp().compile(/<(div|p|h[1-6]|table|tr|ul|ol|blockquote|object|html|head|body|script|form|select)( [^>]*)?>/g),new RegExp().compile(/<(td|th|li|option|br|hr|embed|param|pre|meta|link|title|area|input|textarea)[^>]*>/g),new RegExp().compile(/(^|<\/(pre|script)>)(\s|[^\s])*?(<(pre|script)[^>]*>|$)/g),new RegExp().compile(/(<pre[^>]*>)([\s\S])*?(<\/pre>)/g),new RegExp().compile(/(^|<!--[\s\S]*?-->)([\s\S]*?)(?=<!--[\s\S]*?-->|$)/g),new RegExp().compile(/\S*=""/g),new RegExp().compile(/<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<\/?\w[^>]*>/g),new RegExp().compile(/(^|<\/script>)[\s\S]*?(<script[^>]*>|$)/g)];
+HTMLArea.prototype.cleanHTML=function(_2){
+var c=HTMLArea.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=\"$1\"$3").replace(c[4],"<$1$2 />").replace(c[6],"$1$2").replace(c[8],"<").replace(c[10]," ");
+if(HTMLArea.is_ie&&c[13].test(_2)){
+_2=_2.replace(c[13],"$1"+this.stripBaseURL(RegExp.$3)+"\"");
+}
+if(this.config.only7BitPrintablesInURLs){
+if(HTMLArea.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;
+};
+HTMLArea.indent=function(s,_b){
+HTMLArea.__nindent=0;
+HTMLArea.__sindent="";
+HTMLArea.__sindentChar=(typeof _b=="undefined")?"  ":_b;
+var c=HTMLArea.RegExpCache;
+if(HTMLArea.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"+HTMLArea.__sindent+str;
+HTMLArea.__sindent+=HTMLArea.__sindentChar;
+++HTMLArea.__nindent;
+return s;
+}else{
+if(str.match(c[15])){
+--HTMLArea.__nindent;
+HTMLArea.__sindent="";
+for(var i=HTMLArea.__nindent;i>0;--i){
+HTMLArea.__sindent+=HTMLArea.__sindentChar;
+}
+return "\n"+HTMLArea.__sindent+str;
+}else{
+if(str.match(c[17])){
+return "\n"+HTMLArea.__sindent+str;
+}
+}
+}
+return str;
+});
+return $1+string;
+});
+return _e;
+});
+s=s.replace(/^\s*/,"").replace(/ +\n/g,"\n").replace(/[\r\n]+<\/script>/g,"\n</script>");
+return s;
+};
+HTMLArea.getHTML=function(_15,_16,_17){
+var _18="";
+var c=HTMLArea.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(HTMLArea.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(HTMLArea.is_gecko){
+_18=_18.replace(/<br \/>\n$/,"");
+}
+if(_16){
+_18+="</"+_1e+">";
+}
+_18=HTMLArea.indent(_18);
+}
+return _18;
+};
+

Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/InsertImage/insert_image.html
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/InsertImage/insert_image.html?rev=578051&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/InsertImage/insert_image.html (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/modules/xinha/modules/InsertImage/insert_image.html Fri Sep 21 03:36:30 2007
@@ -0,0 +1,174 @@
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <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>
+
+<br />
+
+<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="1"        >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>
+<br style="clear:all"/>
+<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="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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org