neatlife / lwrte

Automatically exported from code.google.com/p/lwrte
0 stars 0 forks source link

add elements to style in jquery.rte.tb.js #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi. I am trying to add new options to style selection in jquery.rte.tb.js.
When i upload an img i want to put some div tags (like <div class="left">),
if i put a single <div> tag into an option an add a new position in the
"tags" array (aproximately line 48 of jquery.rte.tb.js), it works, but if
the option is <div class=\'left\'> and the tag div class='left' it's not
working.

I know i am not a javascript guru (and obviously not an english guru), this
is why i need help.

Thank you so much.

PS. this is the code. -> http://pastebin.com/m6c0397e3

Original issue reported on code.google.com by raywo...@gmail.com on 18 Feb 2009 at 3:13

GoogleCodeExporter commented 9 years ago
yeah, right. at tags you must set only 'tag' name, i.e. DIV. to check classes 
of that
tag you must provide a 'compare callback' - arg_cmp (where 'node' is dom object 
еto
check). Something like this.

arg_cmp: 
function(node, arg) {
  return (
     arg.toLowerCase() == node.nodeName.toLowerCase() && (
     node.className.toLowerCase() == 'left' ||
     node.className.toLowerCase() == 'right'
  ));
}

Original comment by plandem on 24 Feb 2009 at 9:05