Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InlineStyler/InlineStyler.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InlineStyler/InlineStyler.js,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InlineStyler/InlineStyler.js 16 Jan 2009 09:05:47 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/modules/InlineStyler/InlineStyler.js 27 Mar 2009 08:20:43 -0000 1.2 @@ -1,2 +1,3 @@ -/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ -Xinha.InlineStyler=function(b,c,a,d){this.element=b;this.editor=c;this.dialog=a;this.doc=d?d:document;this.inputs={styles:{},aux:{}};this.styles={};this.auxData={}};Xinha.InlineStyler.getLength=function(b){var a=parseInt(b);if(isNaN(a)){a=""}return a};Xinha.InlineStyler.prototype.applyStyle=function(f){var b=this.element;var d=b.style;for(var a in f){if(typeof f[a]=="function"){continue}if(f[a]!=null){var e=f[a].value||f[a]}switch(a){case"backgroundImage":if(/\S/.test(e)){d.backgroundImage="url("+e+")"}else{d.backgroundImage="none"}break;case"borderCollapse":d.borderCollapse=f[a]=="on"?"collapse":"separate";break;case"width":if(/\S/.test(e)){d.width=e+this.inputs.aux.widthUnit.value}else{d.width=""}break;case"height":if(/\S/.test(e)){d.height=e+this.inputs.aux.heightUnit.value}else{d.height=""}break;case"textAlign":if(e=="char"){var c=this.inputs.aux.textAlignChar.value;if(c=='"'){c='\\"'}d.textAlign='"'+c+'"'}else{if(e=="-"){d.textAlign=""}else{d.textAlign=e}}break;case"verticalAlign":b.vAlign="";if(e=="-"){d.verticalAlign=""}else{d.verticalAlign=e}break;case"float":if(Xinha.is_ie){d.styleFloat=e}else{d.cssFloat=e}break;case"borderWidth":d[a]=e+"px";break;default:d[a]=e;break}}};Xinha.InlineStyler.prototype.createStyleLayoutFieldset=function(){var m=this;var f=this.editor;var u=this.doc;var d=this.element;var l=u.createElement("fieldset");var c=u.createElement("legend");l.appendChild(c);c.innerHTML=Xinha._lc("Layout","TableOperations");var q=u.createElement("table");l.appendChild(q);q.style.width="100%";var a=u.createElement("tbody");q.appendChild(a);var r=d.tagName.toLowerCase();var b,h,j,n,k,e,o;if(r!="td"&&r!="tr"&&r!="th"){b=u.createElement("tr");a.appendChild(b);h=u.createElement("td");h.className="label";b.appendChild(h);h.innerHTML=Xinha._lc("Float","TableOperations")+":";h=u.createElement("td");b.appendChild(h);n=u.createElement("select");n.name=this.dialog.createId("float");h.appendChild(n);this.inputs.styles["float"]=n;e=["None","Left","Right"];for(var o=0;o