Announcement

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

#1 2008-04-23 12:08:56

Ugo
New member
Registered: 2008-04-15
Posts: 5

justify: use style instead of align attribute inside <td> tag

I am trying to replace a very old version of xinha in a site with the latest one.
In the new version, when i change the justify option in a table cell I get this:

<td align="right">

The old behaviour is different. (I don't know if it used to be this way or was modified by the old owner of the site) It's:

<td style="text-align: right;">


Well, I need xinha to use the style attribute.
But even after a long searh I have no idea where to put my hands. sad

Any help would be greatly appreciated!
Thanks!

Last edited by Ugo (2008-04-24 04:27:53)

Offline

#2 2008-04-24 07:17:21

Ugo
New member
Registered: 2008-04-15
Posts: 5

Re: justify: use style instead of align attribute inside <td> tag

Look like I solved the problem. Here's the hack I did in XinhaCore.js , function execCommand

case "justifyleft":
case "justifyright":
_163.match(/^justify(.*)$/);
var ae=this.activeElement(this.getSelection());
var aepnode=this.getSelection().anchorNode.parentNode;
var aeptag='';
if(aepnode) aeptag=aepnode.tagName.toLowerCase();
if(ae&&ae.tagName.toLowerCase()=="img"){
ae.align=ae.align==RegExp.$1?"":RegExp.$1;
}else if(aeptag=="td"){
aepnode.style.textAlign=aepnode.style.textAlign==RegExp.$1?"":RegExp.$1;
}else{
this._doc.execCommand(_163,UI,_165);
}
break;

Offline

#3 2008-04-24 09:07:40

Ugo
New member
Registered: 2008-04-15
Posts: 5

Re: justify: use style instead of align attribute inside <td> tag

...but it doesn't work when there is a selection of cells instead of a single one

Offline

Board footer

Powered by FluxBB