Project:BUEditor
Version:6.x-1.x-dev
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

What's wrong with this code? It does not work

js:
editor.G.getColor=function(txt) {
editor.active.tagSelection(\'<color=\' + txt+ \'>\',\'</color>\',\'end\');
editor.dialog.close();
}
var colors = new Array(
\"#000000\",
\"#993300\",
\"#333300\",
\"#003300\",
\"#003366\",
\"#000080\",
\"#333399\",
\"#333333\",
\"#800000\",
\"#FF6600\",
\"#808000\",
\"#008000\",
\"#008080\",
\"#0000FF\",
\"#666699\",
\"#808080\",
\"#FF0000\",
\"#FF9900\",
\"#99CC00\",
\"#339966\",
\"#33CCCC\",
\"#3366FF\",
\"#800080\",
\"#999999\",
\"#FF00FF\",
\"#FFCC00\",
\"#FFFF00\",
\"#00FF00\",
\"#00FFFF\",
\"#00CCFF\",
\"#993366\",
\"#C0C0C0\",
\"#FF99CC\",
\"#FFCC99\",
\"#FFFF99\",
\"#CCFFCC\",
\"#CCFFFF\",
\"#99CCFF\",
\"#CC99FF\",
\"#FFFFFF\"
);
var colorForm= \'<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"color\"><tr>\';
for (i=0; i<colors.length; i++) {
colorForm+= \'<td bgcolor=\"\' + colors[i] + \'\">\'
+ \'<a href=\"javascript:editor.G.getColor(\\\'\' + colors[i] +  \'\\\');\">\'
+ \'<img border=\"0\" src=\"/sites/all/modules/bueditor/icons/spacer.gif\" width=\"10\" height=\"10\" title=\"\' + colors[i] +  \'\" alt=\"\' + colors[i] +  \'\" /><a></td>\';
if ((i+1) % 8 == 0)
colorForm+= \'<tr></tr>\';
}
colorForm+= \'</tr></table>\';
editor.dialog.open(\'Цвет\', colorForm);

Comments

#1

There are lots of unneeded escape characters before quote characters.
editor.G is undefined.
For bueditor 6.x use BUE instead of editor, e.g BUE.dialog.open...

And also have look at your browsers error console for other possible js errors.

#2

Status:active» closed (duplicate)

#176064: Text color button