JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.2.2
[ckeditor.git] / _source / plugins / colordialog / dialogs / colordialog.js
index d99d033..e8e5d31 100644 (file)
@@ -28,8 +28,8 @@ CKEDITOR.dialog.add( 'colordialog', function( editor )
                var cellMouseover = function( event )\r
                {\r
                        var color = new $el( event.data.getTarget() ).getAttribute( 'title' );\r
-                       $doc.getById( 'hicolor' ).setStyle( 'background-color', color );\r
-                       $doc.getById( 'hicolortext' ).setHtml( color );\r
+                       $doc.getById( hicolorId ).setStyle( 'background-color', color );\r
+                       $doc.getById( hicolorTextId ).setHtml( color );\r
                };\r
 \r
                var cellClick = function( event )\r
@@ -97,16 +97,21 @@ CKEDITOR.dialog.add( 'colordialog', function( editor )
 \r
                function clear()\r
                {\r
-                       $doc.getById( 'selhicolor' ).removeStyle( 'background-color' );\r
+                       $doc.getById( selHiColorId ).removeStyle( 'background-color' );\r
                        dialog.getContentElement( 'picker', 'selectedColor' ).setValue( '' );\r
                }\r
 \r
                var clearActual = $tools.addFunction( function()\r
                {\r
-                       $doc.getById( 'hicolor' ).removeStyle( 'background-color' );\r
-                       $doc.getById( 'hicolortext' ).setHtml( ' ' );\r
+                       $doc.getById( hicolorId ).removeStyle( 'background-color' );\r
+                       $doc.getById( hicolorTextId ).setHtml( ' ' );\r
                } );\r
 \r
+               var numbering = function( id ){ return id + CKEDITOR.tools.getNextNumber(); },\r
+                       hicolorId = numbering( 'hicolor' ),\r
+                       hicolorTextId = numbering( 'hicolortext' ),\r
+                       selHiColorId = numbering( 'selhicolor' );\r
+\r
                return {\r
                        title : lang.title,\r
                        minWidth : 360,\r
@@ -149,10 +154,10 @@ CKEDITOR.dialog.add( 'colordialog', function( editor )
                                                                                {\r
                                                                                        type : 'html',\r
                                                                                        html : '<span>' + lang.highlight +'</span>\\r
-                                                                                               <div id="hicolor" style="border: 1px solid; height: 74px; width: 74px;"></div>\\r
-                                                                                               <div id="hicolortext">&nbsp;</div>\\r
+                                                                                               <div id="' + hicolorId + '" style="border: 1px solid; height: 74px; width: 74px;"></div>\\r
+                                                                                               <div id="' + hicolorTextId + '">&nbsp;</div>\\r
                                                                                                <span>' + lang.selected +'</span>\\r
-                                                                                               <div id="selhicolor" style="border: 1px solid; height: 20px; width: 74px;"></div>'\r
+                                                                                               <div id="' + selHiColorId + '" style="border: 1px solid; height: 20px; width: 74px;"></div>'\r
                                                                                },\r
                                                                                {\r
                                                                                        type : 'text',\r
@@ -163,7 +168,7 @@ CKEDITOR.dialog.add( 'colordialog', function( editor )
                                                                                                // Try to update color preview with new value. If fails, then set it no none.\r
                                                                                                try\r
                                                                                                {\r
-                                                                                                       $doc.getById( 'selhicolor' ).setStyle( 'background-color', this.getValue() );\r
+                                                                                                       $doc.getById( selHiColorId ).setStyle( 'background-color', this.getValue() );\r
                                                                                                }\r
                                                                                                catch ( e )\r
                                                                                                {\r