Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2009-11-01 16:13:36

lupus50
New member
Registered: 2009-11-01
Posts: 2

Converting css plug-in to font-size plug-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

#2 2009-11-10 09:51:52

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Converting css plug-in to font-size plug-in

Can you not just use the ordinary font size selector?


James Sleeman

Offline

#3 2009-11-22 17:27:27

lupus50
New member
Registered: 2009-11-01
Posts: 2

Re: Converting css plug-in to font-size plug-in

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

Board footer

Powered by FluxBB