X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fuicolor%2Fdialogs%2Fuicolor.js;fp=_source%2Fplugins%2Fuicolor%2Fdialogs%2Fuicolor.js;h=0000000000000000000000000000000000000000;hb=4625dba05116026713fee9008dd93306be0d1553;hp=8c01f29fc850eb275e6ed70477ed372d31680fb6;hpb=3fe9cac293e090ea459a3ee10d78cbe9e1dd0e03;p=ckeditor.git diff --git a/_source/plugins/uicolor/dialogs/uicolor.js b/_source/plugins/uicolor/dialogs/uicolor.js deleted file mode 100644 index 8c01f29..0000000 --- a/_source/plugins/uicolor/dialogs/uicolor.js +++ /dev/null @@ -1,205 +0,0 @@ -/* -Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -CKEDITOR.dialog.add( 'uicolor', function( editor ) -{ - var dialog, picker, pickerContents, - // Actual UI color value. - uiColor = editor.getUiColor(), - pickerId = 'cke_uicolor_picker' + CKEDITOR.tools.getNextNumber(); - - function setNewPickerColor( color ) - { - // Convert HEX representation to RGB, stripping # char. - if ( /^#/.test( color ) ) - color = window.YAHOO.util.Color.hex2rgb( color.substr( 1 ) ); - picker.setValue( color, true ); - // Refresh picker UI. - picker.refresh( pickerId ); - } - - function setNewUiColor( color, force ) - { - if ( force || dialog._.contents.tab1.livePeview.getValue() ) - editor.setUiColor( color ); - // Write new config string into textbox. - dialog._.contents.tab1.configBox.setValue( - 'config.uiColor = "#' + picker.get( "hex" ) + '"' - ); - } - - pickerContents = - { - id : 'yuiColorPicker', - type : 'html', - html : "
", - onLoad : function( event ) - { - var url = CKEDITOR.getUrl( - '_source/' + // @Packager.RemoveLine - 'plugins/uicolor/yui/' - ); - - // Create new color picker widget. - picker = new window.YAHOO.widget.ColorPicker( pickerId, - { - showhsvcontrols : true, - showhexcontrols : true, - images : - { - PICKER_THUMB : url + "assets/picker_thumb.png", - HUE_THUMB : url + "assets/hue_thumb.png" - } - }); - - // Set actual UI color to the picker. - if ( uiColor ) - setNewPickerColor( uiColor ); - - // Subscribe to the rgbChange event. - picker.on( "rgbChange", function() - { - // Reset predefined box. - dialog._.contents.tab1.predefined.setValue( '' ); - setNewUiColor( '#' + picker.get( 'hex' ) ); - }); - - // Fix input class names. - var inputs = new CKEDITOR.dom.nodeList( picker.getElementsByTagName( 'input' ) ); - for ( var i = 0; i < inputs.count() ; i++ ) - inputs.getItem( i ).addClass( 'cke_dialog_ui_input_text' ); - } - }; - - var skipPreviewChange = true; - - return { - title : editor.lang.uicolor.title, - minWidth : 360, - minHeight : 320, - onLoad : function() - { - dialog = this; - this.setupContent(); - - // #3808 - if ( CKEDITOR.env.ie7Compat ) - dialog.parts.contents.setStyle( 'overflow', 'hidden' ); - }, - contents : [ - { - id : 'tab1', - label : '', - title : '', - expand : true, - padding : 0, - elements : [ - pickerContents, - { - id : 'tab1', - type : 'vbox', - children : - [ - { - id : 'livePeview', - type : 'checkbox', - label : editor.lang.uicolor.preview, - 'default' : 1, - onLoad : function() - { - skipPreviewChange = true; - }, - onChange : function() - { - if ( skipPreviewChange ) - return; - var on = this.getValue(), - color = on ? '#' + picker.get( 'hex' ) : uiColor; - setNewUiColor( color, true ); - } - }, - { - type : 'hbox', - children : - [ - { - id : 'predefined', - type : 'select', - 'default' : '', - label : editor.lang.uicolor.predefined, - items : - [ - [ '' ], - [ 'Light blue', '#9AB8F3' ], - [ 'Sand', '#D2B48C' ], - [ 'Metallic', '#949AAA' ], - [ 'Purple', '#C2A3C7' ], - [ 'Olive', '#A2C980' ], - [ 'Happy green', '#9BD446' ], - [ 'Jezebel Blue', '#14B8C4' ], - [ 'Burn', '#FF893A' ], - [ 'Easy red', '#FF6969' ], - [ 'Pisces 3', '#48B4F2' ], - [ 'Aquarius 5', '#487ED4' ], - [ 'Absinthe', '#A8CF76' ], - [ 'Scrambled Egg', '#C7A622' ], - [ 'Hello monday', '#8E8D80' ], - [ 'Lovely sunshine', '#F1E8B1' ], - [ 'Recycled air', '#B3C593' ], - [ 'Down', '#BCBCA4' ], - [ 'Mark Twain', '#CFE91D' ], - [ 'Specks of dust', '#D1B596' ], - [ 'Lollipop', '#F6CE23' ] - ], - onChange : function() - { - var color = this.getValue(); - if ( color ) - { - setNewPickerColor( color ); - setNewUiColor( color ); - // Refresh predefined preview box. - CKEDITOR.document.getById( 'predefinedPreview' ).setStyle( 'background', color ); - } - else - CKEDITOR.document.getById( 'predefinedPreview' ).setStyle( 'background', '' ); - }, - onShow : function() - { - var color = editor.getUiColor(); - if ( color ) - this.setValue( color ); - } - }, - { - id : 'predefinedPreview', - type : 'html', - html : '
' + - '
 
' + - '
' - } - ] - }, - { - id : 'configBox', - type : 'text', - label : editor.lang.uicolor.config, - onShow : function() - { - var color = editor.getUiColor(); - if ( color ) - this.setValue( - 'config.uiColor = "' + color + '"' - ); - } - } - ] - } - ] - } - ], - buttons : [ CKEDITOR.dialog.okButton ] - }; -} );