Index: typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js
===================================================================
--- typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js (révision 8002)
+++ typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js (copie de travail)
@@ -3515,9 +3515,9 @@
return (d < 16) ? ('0' + d.toString(16)) : d.toString(16);
};
if (typeof(v) == 'number') {
- var r = v & 0xFF;
+ var b = v & 0xFF;
var g = (v >> 8) & 0xFF;
- var b = (v >> 16) & 0xFF;
+ var r = (v >> 16) & 0xFF;
return '#' + hex(r) + hex(g) + hex(b);
}
if (v.substr(0, 3) === 'rgb') {
Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Color/typo3color.js
===================================================================
--- typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Color/typo3color.js (révision 8002)
+++ typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Color/typo3color.js (copie de travail)
@@ -258,7 +258,11 @@
*/
showColor: function (color) {
if (color) {
- this.dialog.find('itemId', 'show-color')[0].el.setStyle('backgroundColor', '#' + color);
+ var newColor = color;
+ if (newColor.indexOf('#') == 0) {
+ newColor = newColor.substr(1);
+ }
+ this.dialog.find('itemId', 'show-color')[0].el.setStyle('backgroundColor', HTMLArea.util.Color.colorToHex(parseInt(newColor, 16)));
}
},
/*
@@ -340,7 +344,10 @@
var buttonId = this.dialog.arguments.buttonId;
var color = this.dialog.find('itemId', 'color')[0].getValue();
if (color) {
- color = '#' + color;
+ if (color.indexOf('#') == 0) {
+ color = color.substr(1);
+ }
+ color = HTMLArea.util.Color.colorToHex(parseInt(color, 16));
}
this.editor.focus();
var element,