You are not logged in.
Hello!
I want to convert css plug-in to font-size plug-in.
The script as a result should replace class to style inside <span>, it should turn out: <span style = "font-size: *px"> **** </span>
But as a result it inserts inside <span> class and style together (((
Somebody can help me?
I get now such code from source code:
Xinha.Config.prototype.cssPluginConfig={combos:[{label:"font-size",options:{
no:"",
s5px:"font-size: 5px",
s10px:"font-size: 10px",
s15px:"font-size: 15px"
}}]};
function CSS(f,d){this.editor=f;
var g=f.config;var j=this;
var c;if(d&&d.length){c=d[0]}else{c=f.config.cssPluginConfig}var k=c.combos;
for(var e=0;e<k.length;e++){var b=k[e];
var a="CSS-class"+e;
var h={id:a,options:b.options,action:function(i){j.onSelect(i,this,b.context,b.updatecontextclass)},refresh:function(i){j.updateValue(i,this)},context:b.context};g.registerDropdown(h);g.addToolbarElement(["T["+b.label+"]",a,"separator"],"formatblock",-1)}}
CSS._pluginInfo={name:"CSS",version:"1.0",developer:"Mihai Bazon",developer_url:"http://dynarch.com/mishoo/",c_owner:"Mihai Bazon",sponsor:"Miro International",sponsor_url:"http://www.miro.com.au",license:"htmlArea"};
CSS.prototype.onSelect=function(d,c,b,f){
var i=d._toolbarObjects[c.id];var e=i.element.selectedIndex;var g=i.element.value;var k=d.getParentElement();
var j=true;var h=(k&&k.tagName.toLowerCase()=="span");var a=(b&&f&&k&&k.tagName.toLowerCase()==b);
if(a){k.className=g;d.updateToolbar();return}if(h&&e==0&&!/\S/.test(k.style.cssText)){
while(k.firstChild){k.parentNode.insertBefore(k.firstChild,k)}k.parentNode.removeChild(k);d.updateToolbar();return}
if(h){if(k.childNodes.length==1){k.className=g;j=false;d.updateToolbar()}}
if(j){d.surroundHTML(
"<span style='"+g+"'>","</span>"
)}};
CSS.prototype.updateValue=function(f,h){var a=f._toolbarObjects[h.id].element;var e=f.getParentElement();if(typeof e.className!="undefined"&&/\S/.test(e.className)){var b=a.options;var g=e.className;for(var c=b.length;--c>=0;){var d=b[c];if(g==d.value){a.selectedIndex=c;return}}}
a.selectedIndex=0};
Offline
Hi!
Because the majority cms and css styles with which I use, use a font size in pixels, i would want that here again was also. )))
sorry for my bad english )
Offline