X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=_source%2Fplugins%2Fspecialchar%2Fdialogs%2Fspecialchar.js;h=3c6fd326dbb58c8de9ef687832ab83181b0d7dd9;hb=48b1db88210b4160dce439c6e3e32e14af8c106b;hp=5b6e6225d3b881283c5d8ce99e6100f216a73ab4;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/_source/plugins/specialchar/dialogs/specialchar.js b/_source/plugins/specialchar/dialogs/specialchar.js index 5b6e622..3c6fd32 100644 --- a/_source/plugins/specialchar/dialogs/specialchar.js +++ b/_source/plugins/specialchar/dialogs/specialchar.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, 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 */ @@ -9,7 +9,9 @@ CKEDITOR.dialog.add( 'specialchar', function( editor ) * Simulate "this" of a dialog for non-dialog events. * @type {CKEDITOR.dialog} */ - var dialog; + var dialog, + lang = editor.lang.specialChar; + var onChoice = function( evt ) { var target, value; @@ -22,6 +24,7 @@ CKEDITOR.dialog.add( 'specialchar', function( editor ) { target.removeClass( "cke_light_background" ); dialog.hide(); + editor.insertHtml( value ); } }; @@ -79,37 +82,11 @@ CKEDITOR.dialog.add( 'specialchar', function( editor ) // Get an Anchor element. var element = ev.getTarget(); var relative, nodeToMove; - var keystroke = ev.getKeystroke(); + var keystroke = ev.getKeystroke(), + rtl = editor.lang.dir == 'rtl'; switch ( keystroke ) { - // RIGHT-ARROW - case 39 : - // relative is TD - if ( ( relative = element.getParent().getNext() ) ) - { - nodeToMove = relative.getChild( 0 ); - if ( nodeToMove.type == 1 ) - { - nodeToMove.focus(); - onBlur( null, element ); - onFocus( null, nodeToMove ); - } - } - ev.preventDefault(); - break; - // LEFT-ARROW - case 37 : - // relative is TD - if ( ( relative = element.getParent().getPrevious() ) ) - { - nodeToMove = relative.getChild( 0 ); - nodeToMove.focus(); - onBlur( null, element ); - onFocus( null, nodeToMove ); - } - ev.preventDefault(); - break; // UP-ARROW case 38 : // relative is TR @@ -143,6 +120,9 @@ CKEDITOR.dialog.add( 'specialchar', function( editor ) onChoice( { data: ev } ); ev.preventDefault(); break; + + // RIGHT-ARROW + case rtl ? 37 : 39 : // TAB case 9 : // relative is TD @@ -174,6 +154,9 @@ CKEDITOR.dialog.add( 'specialchar', function( editor ) onBlur( null, element ); } break; + + // LEFT-ARROW + case rtl ? 39 : 37 : // SHIFT + TAB case CKEDITOR.SHIFT + 9 : // relative is TD @@ -204,66 +187,67 @@ CKEDITOR.dialog.add( 'specialchar', function( editor ) }); return { - title : editor.lang.specialChar.title, + title : lang.title, minWidth : 430, minHeight : 280, buttons : [ CKEDITOR.dialog.cancelButton ], charColumns : 17, - chars : - [ - '!','"','#','$','%','&',"'",'(',')','*','+','-','.','/', - '0','1','2','3','4','5','6','7','8','9',':',';', - '<','=','>','?','@', - 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O', - 'P','Q','R','S','T','U','V','W','X','Y','Z', - '[',']','^','_','`', - 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p', - 'q','r','s','t','u','v','w','x','y','z', - '{','|','}','~','€','‘','’','’','“', - '”','–','—','¡','¢','£', - '¤','¥','¦','§','¨','©','ª', - '«','¬','®','¯','°','±','²', - '³','´','µ','¶','·','¸', - '¹','º','»','¼','½','¾', - '¿','À','Á','Â','Ã','Ä', - 'Å','Æ','Ç','È','É','Ê', - 'Ë','Ì','Í','Î','Ï','Ð', - 'Ñ','Ò','Ó','Ô','Õ','Ö', - '×','Ø','Ù','Ú','Û','Ü', - 'Ý','Þ','ß','à','á','â', - 'ã','ä','å','æ','ç','è', - 'é','ê','ë','ì','í','î', - 'ï','ð','ñ','ò','ó','ô', - 'õ','ö','÷','ø','ù','ú', - 'û','ü','ü','ý','þ','ÿ', - 'Œ','œ','Ŵ','Ŷ','ŵ','ŷ','‚', - '‛','„','…','™','►','•', - '→','⇒','⇔','♦','≈' - ], onLoad : function() { var columns = this.definition.charColumns, - chars = this.definition.chars; + extraChars = editor.config.extraSpecialChars, + chars = editor.config.specialChars; + + var charsTableLabel = CKEDITOR.tools.getNextId() + '_specialchar_table_label'; + var html = [ '
' + - '' + + '' + '' + - chars[i] + + character + + '' + + '' + + charDesc + ''); } else @@ -274,7 +258,7 @@ CKEDITOR.dialog.add( 'specialchar', function( editor ) html.push( ' |