X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=inline;f=_source%2Fplugins%2Fcolordialog%2Fdialogs%2Fcolordialog.js;h=61d411be40101bdc047441e68c0315205dbe0e59;hb=refs%2Ftags%2Fv3.6.2;hp=891947e9de1a033f86b9fcec2b5bcaebe1dc6d74;hpb=f8fc585c18d287eb325c575596d183122486b641;p=ckeditor.git diff --git a/_source/plugins/colordialog/dialogs/colordialog.js b/_source/plugins/colordialog/dialogs/colordialog.js index 891947e..61d411b 100644 --- a/_source/plugins/colordialog/dialogs/colordialog.js +++ b/_source/plugins/colordialog/dialogs/colordialog.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -14,13 +14,11 @@ CKEDITOR.dialog.add( 'colordialog', function( editor ) // Reference the dialog. var dialog; - function spacer() + var spacer = { - return { - type : 'html', - html : ' ' - }; - } + type : 'html', + html : ' ' + }; function clearSelected() { @@ -30,11 +28,11 @@ CKEDITOR.dialog.add( 'colordialog', function( editor ) function updateSelected( evt ) { - if ( ! (evt instanceof CKEDITOR.dom.event ) ) + if ( ! ( evt instanceof CKEDITOR.dom.event ) ) evt = new CKEDITOR.dom.event( evt ); var target = evt.getTarget(), - color; + color; if ( target.getName() == 'a' && ( color = target.getChild( 0 ).getHtml() ) ) dialog.getContentElement( 'picker', 'selectedColor' ).setValue( color ); @@ -42,7 +40,7 @@ CKEDITOR.dialog.add( 'colordialog', function( editor ) function updateHighlight( event ) { - if ( ! (event instanceof CKEDITOR.dom.event ) ) + if ( ! ( event instanceof CKEDITOR.dom.event ) ) event = event.data; var target = event.getTarget(), @@ -61,21 +59,19 @@ CKEDITOR.dialog.add( 'colordialog', function( editor ) $doc.getById( hicolorTextId ).setHtml( ' ' ); } - var onMouseout = $tools.addFunction( clearHighlight ); - - var onClick = updateSelected, - onClickHandler = CKEDITOR.tools.addFunction( onClick ); - - var onFocus = updateHighlight, - onBlur = clearHighlight; + var onMouseout = $tools.addFunction( clearHighlight ), + onClick = updateSelected, + onClickHandler = CKEDITOR.tools.addFunction( onClick ), + onFocus = updateHighlight, + onBlur = clearHighlight; var onKeydownHandler = CKEDITOR.tools.addFunction( function( ev ) { ev = new CKEDITOR.dom.event( ev ); var element = ev.getTarget(); var relative, nodeToMove; - var keystroke = ev.getKeystroke(); - var rtl = editor.lang.dir == 'rtl'; + var keystroke = ev.getKeystroke(), + rtl = editor.lang.dir == 'rtl'; switch ( keystroke ) { @@ -177,14 +173,14 @@ CKEDITOR.dialog.add( 'colordialog', function( editor ) function createColorTable() { // Create the base colors array. - var aColors = ['00','33','66','99','cc','ff']; + var aColors = [ '00', '33', '66', '99', 'cc', 'ff' ]; // This function combines two ranges of three values from the color array into a row. function appendColorRow( rangeA, rangeB ) { for ( var i = rangeA ; i < rangeA + 3 ; i++ ) { - var row = table.$.insertRow(-1); + var row = table.$.insertRow( -1 ); for ( var j = rangeB ; j < rangeB + 3 ; j++ ) { @@ -214,7 +210,7 @@ CKEDITOR.dialog.add( 'colordialog', function( editor ) ' style="cursor: pointer;display:block;width:100%;height:100% " title="'+ CKEDITOR.tools.htmlEncode( color )+ '"' + ' onkeydown="CKEDITOR.tools.callFunction( ' + onKeydownHandler + ', event, this )"' + ' onclick="CKEDITOR.tools.callFunction(' + onClickHandler + ', event, this ); return false;"' + - ' tabindex="-1">' + color + '', CKEDITOR.document ) ); + ' tabindex="-1">' + color + ' ', CKEDITOR.document ) ); } appendColorRow( 0, 0 ); @@ -240,14 +236,16 @@ CKEDITOR.dialog.add( 'colordialog', function( editor ) var table = new $el( 'table' ); createColorTable(); + var html = table.getHtml(); var numbering = function( id ) { - return id + CKEDITOR.tools.getNextNumber(); + return CKEDITOR.tools.getNextId() + '_' + id; }, hicolorId = numbering( 'hicolor' ), hicolorTextId = numbering( 'hicolortext' ), - selHiColorId = numbering( 'selhicolor' ); + selHiColorId = numbering( 'selhicolor' ), + tableLabelId = numbering( 'color_table_label' ); return { title : lang.title, @@ -273,12 +271,15 @@ CKEDITOR.dialog.add( 'colordialog', function( editor ) [ { type : 'html', - html : '