| 21 | | if ( cfg.CharacterMap.mode == 'panel' ) |
| 22 | | { |
| 23 | | editor._CharacterMap = editor.addPanel( 'right' ); |
| 24 | | Xinha._addClass( editor._CharacterMap, 'CharacterMap' ); |
| 25 | | |
| 26 | | editor.notifyOn( 'modechange', |
| 27 | | function( e, args ) |
| 28 | | { |
| 29 | | if ( args.mode == 'text' ) editor.hidePanel( editor._CharacterMap ); |
| 30 | | } |
| 31 | | ); |
| 32 | | |
| 33 | | var entites = |
| 34 | | [ |
| 35 | | 'Ÿ', 'š', '@', '"', '¡', '¢', '£', '¤', '¥', '¦', |
| 36 | | '§', '¨', '©', 'ª', '«', '¬', '¯', '°', '±', '²', |
| 37 | | '³', '´', 'µ', '¶', '·', '¸', '¹', 'º', '»', '¼', |
| 38 | | '½', '¾', '¿', '×', 'Ø', '÷', 'ø', 'ƒ', 'ˆ', |
| 39 | | '˜', '–', '—', '‘', '’', '‚', '“', '”', '„', |
| 40 | | '†', '‡', '•', '…', '‰', '‹', '›', '€', '™', |
| 41 | | 'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', |
| 42 | | 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', |
| 43 | | 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', '®', '×', 'Ù', 'Ú', |
| 44 | | 'Û', 'Ü', 'Ý', 'Þ', 'ß', 'à', 'á', 'â', 'ã', |
| 45 | | 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', |
| 46 | | 'í', 'î', 'ï', 'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', |
| 47 | | 'ö', '÷', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'þ', |
| 48 | | 'ÿ', 'Œ', 'œ', 'Š' |
| 49 | | ]; |
| 50 | | |
| 51 | | for ( var i=0; i<entites.length; i++ ) |
| 52 | | this.addEntity( entites[i], i ); |
| 53 | | |
| 54 | | editor.hidePanel( editor._CharacterMap ); |
| 55 | | } |
| | 64 | |
| | 65 | CharacterMap.prototype.onGenerateOnce = function() |
| | 66 | { |
| | 67 | this._prepareDialog(); |
| | 68 | }; |
| | 69 | |
| | 70 | CharacterMap.prototype._prepareDialog = function() |
| | 71 | { |
| | 72 | var self = this; |
| | 73 | var editor = this.editor; |
| | 74 | |
| | 75 | var html = '<h1><l10n>Insert special character</l10n></h1>'; |
| | 76 | |
| | 77 | // Now we have everything we need, so we can build the dialog. |
| | 78 | this.dialog = new Xinha.Dialog(editor, html, 'CharacterMap',{width:300},{modal:false}); |
| | 79 | Xinha._addClass( this.dialog.rootElem, 'CharacterMap' ); |
| | 80 | |
| | 81 | if (editor.config.CharacterMap.mode == 'panel') this.dialog.attachToPanel('right'); |
| | 82 | |
| | 83 | var entites = |
| | 84 | [ |
| | 85 | 'Ÿ', 'š', '@', '"', '¡', '¢', '£', '¤', '¥', '¦', |
| | 86 | '§', '¨', '©', 'ª', '«', '¬', '¯', '°', '±', '²', |
| | 87 | '³', '´', 'µ', '¶', '·', '¸', '¹', 'º', '»', '¼', |
| | 88 | '½', '¾', '¿', '×', 'Ø', '÷', 'ø', 'ƒ', 'ˆ', |
| | 89 | '˜', '–', '—', '‘', '’', '‚', '“', '”', '„', |
| | 90 | '†', '‡', '•', '…', '‰', '‹', '›', '€', '™', |
| | 91 | 'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', |
| | 92 | 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', |
| | 93 | 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', '®', '×', 'Ù', 'Ú', |
| | 94 | 'Û', 'Ü', 'Ý', 'Þ', 'ß', 'à', 'á', 'â', 'ã', |
| | 95 | 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', |
| | 96 | 'í', 'î', 'ï', 'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', |
| | 97 | 'ö', '÷', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'þ', |
| | 98 | 'ÿ', 'Œ', 'œ', 'Š' |
| | 99 | ]; |
| | 100 | |
| | 101 | for ( var i=0; i<entites.length; i++ ) |
| | 102 | { |
| | 103 | this.addEntity( entites[i], i ); |
| | 104 | } |
| | 105 | |
| | 106 | this.ready = true; |
| | 107 | //this.hide(); |
| | 108 | }; |
| | 109 | |
| | 110 | CharacterMap.prototype.show = function() |
| | 111 | { |
| | 112 | if(!this.ready) // if the user is too fast clicking the, we have to make them wait |
| | 113 | { |
| | 114 | var self = this; |
| | 115 | window.setTimeout(function() {self.show();},100); |
| | 116 | return; |
| | 117 | } |
| | 118 | this.dialog.toggle(); |
| | 119 | }; |
| | 120 | CharacterMap.prototype.hide = function() |
| | 121 | { |
| | 122 | this.dialog.hide(); |
| | 123 | }; |
| | 124 | |