CLICK HERE TO BUY IT TODAY! OR GET IT FREE VIA TRIALPAY  

PHP Demo Application - Source Code

/Framework/Model/Vendor/CkEditor/_source/plugins/specialchar/dialogs/specialchar.js



/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.dialog.add'specialchar', function( editor )
{
	    /**
	     * Simulate "this" of a dialog for non-dialog events.
	     * @type {CKEDITOR.dialog}
	     */
	    var dialog,
	        lang editor.lang.specialChar;
	    var insertSpecialChar = function ( specialChar )
	    {
		        var selection editor.getSelection(),
		            ranges selection.getRangestrue ),
		            rangetextNode;
		        editor.fire'saveSnapshot' );
		        for ( var ranges.length 1;
		 >= ;
		 i-- )
		        {
			            range ranges];
			            range.deleteContents();
			            textNode CKEDITOR.dom.element.createFromHtmlspecialChar );
			            range.insertNodetextNode );
			        }
		        if ( range )
		        {
			            range.moveToPositiontextNodeCKEDITOR.POSITION_AFTER_END );
			            range.select();
			        }
		        editor.fire'saveSnapshot' );
		    };
	    var onChoice = function( evt )
	    {
		        var targetvalue;
		        if ( evt.data )
		            target evt.data.getTarget();
		        else
		            target = new CKEDITOR.dom.elementevt );
		        if ( target.getName() == 'a' && ( value target.getChild).getHtml() ) )
		        {
			            target.removeClass"cke_light_background" );
			            dialog.hide();
			            // Firefox has bug on insert chars into a element use its own API. (#5170)
			            if ( CKEDITOR.env.gecko )
			                insertSpecialCharvalue );
			            else
			                editor.insertHtmlvalue );
			        }
		    };
	    var onClick CKEDITOR.tools.addFunctiononChoice );
	    var focusedNode;
	    var onFocus = function( evttarget )
	    {
		        var value;
		        target target || evt.data.getTarget();
		        if ( target.getName() == 'span' )
		            target target.getParent();
		        if ( target.getName() == 'a' && ( value target.getChild).getHtml() ) )
		        {
			            // Trigger blur manually if there is focused node.
			            if ( focusedNode )
			                onBlurnullfocusedNode );
			            var htmlPreview dialog.getContentElement'info''htmlPreview' ).getElement();
			            dialog.getContentElement'info''charPreview' ).getElement().setHtmlvalue );
			            htmlPreview.setHtmlCKEDITOR.tools.htmlEncodevalue ) );
			            target.getParent().addClass"cke_light_background" );
			            // Memorize focused node.
			            focusedNode target;
			        }
		    };
	    var onBlur = function( evttarget )
	    {
		        target target || evt.data.getTarget();
		        if ( target.getName() == 'span' )
		            target target.getParent();
		        if ( target.getName() == 'a' )
		        {
			            dialog.getContentElement'info''charPreview' ).getElement().setHtml' 
			' );
			            dialog.getContentElement'info''htmlPreview' ).getElement().setHtml' 
			' );
			            target.getParent().removeClass"cke_light_background" );
			            focusedNode undefined;
			        }
		    };
	    var onKeydown CKEDITOR.tools.addFunction( function( ev )
	    {
		        ev = new CKEDITOR.dom.eventev );
		        // Get an Anchor element.
		        var element ev.getTarget();
		        var relativenodeToMove;
		        var keystroke ev.getKeystroke();
		        var rtl editor.lang.dir == 'rtl';
		        switch ( keystroke )
		        {
			            // UP-ARROW
			            case 38 :
			                // relative is TR
			                if ( ( relative element.getParent().getParent().getPrevious() ) )
			                {
				                    nodeToMove relative.getChild( [element.getParent().getIndex(), 0] );
				                    nodeToMove.focus();
				                    onBlurnullelement );
				                    onFocusnullnodeToMove );
				                }
			                ev.preventDefault();
			                break;
			            // DOWN-ARROW
			            case 40 :
			                // relative is TR
			                if ( ( relative element.getParent().getParent().getNext() ) )
			                {
				                    nodeToMove relative.getChild( [ element.getParent().getIndex(), ] );
				                    if ( nodeToMove && nodeToMove.type == )
				                    {
					                        nodeToMove.focus();
					                        onBlurnullelement );
					                        onFocusnullnodeToMove );
					                    }
				                }
			                ev.preventDefault();
			                break;
			            // SPACE
			            // ENTER is already handled as onClick
			            case 32 :
			                onChoice( { dataev
				} );
			                ev.preventDefault();
			                break;
			            // RIGHT-ARROW
			            case rtl 37 39 :
			            // TAB
			            case :
			                // relative is TD
			                if ( ( relative element.getParent().getNext() ) )
			                {
				                    nodeToMove relative.getChild);
				                    if ( nodeToMove.type == )
				                    {
					                        nodeToMove.focus();
					                        onBlurnullelement );
					                        onFocusnullnodeToMove );
					                        ev.preventDefaulttrue );
					                    }
				                    else
				                        onBlurnullelement );
				                }
			                // relative is TR
			                else if ( ( relative element.getParent().getParent().getNext() ) )
			                {
				                    nodeToMove relative.getChild( [ 0] );
				                    if ( nodeToMove && nodeToMove.type == )
				                    {
					                        nodeToMove.focus();
					                        onBlurnullelement );
					                        onFocusnullnodeToMove );
					                        ev.preventDefaulttrue );
					                    }
				                    else
				                        onBlurnullelement );
				                }
			                break;
			            // LEFT-ARROW
			            case rtl 39 37 :
			            // SHIFT + TAB
			            case CKEDITOR.SHIFT :
			                // relative is TD
			                if ( ( relative element.getParent().getPrevious() ) )
			                {
				                    nodeToMove relative.getChild);
				                    nodeToMove.focus();
				                    onBlurnullelement );
				                    onFocusnullnodeToMove );
				                    ev.preventDefaulttrue );
				                }
			                // relative is TR
			                else if ( ( relative element.getParent().getParent().getPrevious() ) )
			                {
				                    nodeToMove relative.getLast().getChild);
				                    nodeToMove.focus();
				                    onBlurnullelement );
				                    onFocusnullnodeToMove );
				                    ev.preventDefaulttrue );
				                }
			                else
			                    onBlurnullelement );
			                break;
			            default :
			                // Do not stop not handled events.
			                return;
			        }
		    });
	    return {
		        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',
		                '{','|','}','~','€
		(EURO SIGN)','‘
		(LEFT SINGLE QUOTATION MARK)','’
		(RIGHT SINGLE QUOTATION MARK)','“
		(LEFT DOUBLE QUOTATION MARK)',
		                '”
		(RIGHT DOUBLE QUOTATION MARK)','–
		(EN DASH)','—
		(EM DASH)','¡
		(INVERTED EXCLAMATION MARK)','¢
		(CENT SIGN)','£
		(POUND SIGN)',
		                '¤
		(CURRENCY SIGN)','¥
		(YEN SIGN)','¦
		(BROKEN BAR)','§
		(SECTION SIGN)','¨
		(DIAERESIS)','©
		(COPYRIGHT SIGN)','ª
		(FEMININE ORDINAL INDICATOR)',
		                '«
		(LEFT-POINTING DOUBLE ANGLE QUOTATION MARK)','¬
		(NOT SIGN)','®
		(REGISTERED SIGN)','¯
		(MACRON)','°
		(DEGREE SIGN)','±
		(PLUS-MINUS SIGN)','²
		(SUPERSCRIPT TWO)',
		                '³
		(SUPERSCRIPT THREE)','´
		(ACUTE ACCENT)','µ
		(MICRO SIGN)','¶
		(PILCROW SIGN)','·
		(MIDDLE DOT)','¸
		(CEDILLA)',
		                '¹
		(SUPERSCRIPT ONE)','º
		(MASCULINE ORDINAL INDICATOR)','»
		(RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK)','¼
		(VULGAR FRACTION ONE QUARTER)','½
		(VULGAR FRACTION ONE HALF)','¾
		(VULGAR FRACTION THREE QUARTERS)',
		                '¿
		(INVERTED QUESTION MARK)','À
		(LATIN CAPITAL LETTER A WITH GRAVE)','Á
		(LATIN CAPITAL LETTER A WITH ACUTE)','Â
		(LATIN CAPITAL LETTER A WITH CIRCUMFLEX)','Ã
		(LATIN CAPITAL LETTER A WITH TILDE)','Ä
		(LATIN CAPITAL LETTER A WITH DIAERESIS)',
		                'Å
		(LATIN CAPITAL LETTER A WITH RING ABOVE)','Æ
		(LATIN CAPITAL LETTER AE)','Ç
		(LATIN CAPITAL LETTER C WITH CEDILLA)','È
		(LATIN CAPITAL LETTER E WITH GRAVE)','É
		(LATIN CAPITAL LETTER E WITH ACUTE)','Ê
		(LATIN CAPITAL LETTER E WITH CIRCUMFLEX)',
		                'Ë
		(LATIN CAPITAL LETTER E WITH DIAERESIS)','Ì
		(LATIN CAPITAL LETTER I WITH GRAVE)','Í
		(LATIN CAPITAL LETTER I WITH ACUTE)','Î
		(LATIN CAPITAL LETTER I WITH CIRCUMFLEX)','Ï
		(LATIN CAPITAL LETTER I WITH DIAERESIS)','Ð
		(LATIN CAPITAL LETTER ETH)',
		                'Ñ
		(LATIN CAPITAL LETTER N WITH TILDE)','Ò
		(LATIN CAPITAL LETTER O WITH GRAVE)','Ó
		(LATIN CAPITAL LETTER O WITH ACUTE)','Ô
		(LATIN CAPITAL LETTER O WITH CIRCUMFLEX)','Õ
		(LATIN CAPITAL LETTER O WITH TILDE)','Ö
		(LATIN CAPITAL LETTER O WITH DIAERESIS)',
		                '×
		(MULTIPLICATION SIGN)','Ø
		(LATIN CAPITAL LETTER O WITH STROKE)','Ù
		(LATIN CAPITAL LETTER U WITH GRAVE)','Ú
		(LATIN CAPITAL LETTER U WITH ACUTE)','Û
		(LATIN CAPITAL LETTER U WITH CIRCUMFLEX)','Ü
		(LATIN CAPITAL LETTER U WITH DIAERESIS)',
		                'Ý
		(LATIN CAPITAL LETTER Y WITH ACUTE)','Þ
		(LATIN CAPITAL LETTER THORN)','ß
		(LATIN SMALL LETTER SHARP S)','à
		(LATIN SMALL LETTER A WITH GRAVE)','á
		(LATIN SMALL LETTER A WITH ACUTE)','â
		(LATIN SMALL LETTER A WITH CIRCUMFLEX)',
		                'ã
		(LATIN SMALL LETTER A WITH TILDE)','ä
		(LATIN SMALL LETTER A WITH DIAERESIS)','å
		(LATIN SMALL LETTER A WITH RING ABOVE)','æ
		(LATIN SMALL LETTER AE)','ç
		(LATIN SMALL LETTER C WITH CEDILLA)','è
		(LATIN SMALL LETTER E WITH GRAVE)',
		                'é
		(LATIN SMALL LETTER E WITH ACUTE)','ê
		(LATIN SMALL LETTER E WITH CIRCUMFLEX)','ë
		(LATIN SMALL LETTER E WITH DIAERESIS)','ì
		(LATIN SMALL LETTER I WITH GRAVE)','í
		(LATIN SMALL LETTER I WITH ACUTE)','î
		(LATIN SMALL LETTER I WITH CIRCUMFLEX)',
		                'ï
		(LATIN SMALL LETTER I WITH DIAERESIS)','ð
		(LATIN SMALL LETTER ETH)','ñ
		(LATIN SMALL LETTER N WITH TILDE)','ò
		(LATIN SMALL LETTER O WITH GRAVE)','ó
		(LATIN SMALL LETTER O WITH ACUTE)','ô
		(LATIN SMALL LETTER O WITH CIRCUMFLEX)',
		                'õ
		(LATIN SMALL LETTER O WITH TILDE)','ö
		(LATIN SMALL LETTER O WITH DIAERESIS)',
		                '÷
		(DIVISION SIGN)','ø
		(LATIN SMALL LETTER O WITH STROKE)',
		                'ù
		(LATIN SMALL LETTER U WITH GRAVE)','ú
		(LATIN SMALL LETTER U WITH ACUTE)',
		                'û
		(LATIN SMALL LETTER U WITH CIRCUMFLEX)','ü
		(LATIN SMALL LETTER U WITH DIAERESIS)',
		                'ü
		(LATIN SMALL LETTER U WITH DIAERESIS)','ý
		(LATIN SMALL LETTER Y WITH ACUTE)','þ
		(LATIN SMALL LETTER THORN)','ÿ
		(LATIN SMALL LETTER Y WITH DIAERESIS)',
		                'Œ
		(LATIN CAPITAL LIGATURE OE)',
		                'œ
		(LATIN SMALL LIGATURE OE)','Ŵ
		(LATIN CAPITAL LETTER W WITH CIRCUMFLEX)',
		                '&#374(LATIN CAPITAL LETTER Y WITH CIRCUMFLEX)','&#373(LATIN SMALL LETTER W WITH CIRCUMFLEX)',
		                'ŷ
		(LATIN SMALL LETTER Y WITH CIRCUMFLEX)','‚
		(SINGLE LOW-9 QUOTATION MARK)',
		                '‛
		(SINGLE HIGH-REVERSED-9 QUOTATION MARK)','„
		(DOUBLE LOW-9 QUOTATION MARK)','…
		(HORIZONTAL ELLIPSIS)',
		                '™
		(TRADE MARK SIGN)','►
		(BLACK RIGHT-POINTING POINTER)','•
		(BULLET)',
		                '→
		(RIGHTWARDS ARROW)','⇒
		(RIGHTWARDS DOUBLE ARROW)','⇔
		(LEFT RIGHT DOUBLE ARROW)','♦
		(BLACK DIAMOND SUIT)','≈
		(ALMOST EQUAL TO)'
		            ],
		        onLoad :  function()
		        {
			            var columns this.definition.charColumns,
			                chars this.definition.chars;
			            var charsTableLabel =  CKEDITOR.tools.getNextId() + '_specialchar_table_label';
			            var html = [ '<table role="listbox" aria-labelledby="' charsTableLabel '"' +
			                                     ' style="width: 320px;
			 height: 100%;
			 border-collapse: separate;
			"' +
			                                     ' align="center" cellspacing="2" cellpadding="2" border="0">' ];
			            var 0,
			                size chars.length,
			                character,
			                charDesc;
			            while ( size )
			            {
				                html.push'<tr>' ) ;
				                for ( var ;
				 columns ;
				 j++, i++ )
				                {
					                    if ( ( character chars] ) )
					                    {
						                        charDesc '';
						                        character character.replace( /\((.*?)\)/, function( matchdesc )
						                            {
							                                charDesc desc;
							                                return '';
							                            } );
						                        // Use character in case description unavailable.
						                        charDesc charDesc || character;
						                        var charLabelId =  'cke_specialchar_label_' '_' CKEDITOR.tools.getNextNumber();
						                        html.push(
						                            '<td class="cke_dark_background" style="cursor: default" role="presentation">' +
						                            '<a href="javascript: void(0);
						" role="option"' +
						                            ' aria-posinset="' + ( +) + '"',
						                            ' aria-setsize="' size '"',
						                            ' aria-labelledby="' charLabelId '"',
						                            ' style="cursor: inherit;
						 display: block;
						 height: 1.25em;
						 margin-top: 0.25em;
						 text-align: center;
						" title="'CKEDITOR.tools.htmlEncodecharDesc ), '"' +
						                            ' onkeydown="CKEDITOR.tools.callFunction( ' onKeydown ', event, this )"' +
						                            ' onclick="CKEDITOR.tools.callFunction(' onClick ', this);
						 return false;
						"' +
						                            ' tabindex="-1">' +
						                            '<span style="margin: 0 auto;
						cursor: inherit">' +
						                            character +
						                            '</span>' +
						                            '<span class="cke_voice_label" id="' charLabelId '">' +
						                            charDesc +
						                            '</span></a>');
						                    }
					                    else
					                        html.push'<td class="cke_dark_background">&nbsp;
					' );
					                    html.push'</td>' );
					                }
				                html.push'</tr>' );
				            }
			            html.push'</tbody></table>''<span id="' charsTableLabel '" class="cke_voice_label">' lang.options +'</span>' );
			            this.getContentElement'info''charContainer' ).getElement().setHtmlhtml.join'' ) );
			        },
		        contents : [
		            {
			                id 'info',
			                label editor.lang.common.generalTab,
			                title editor.lang.common.generalTab,
			                padding 0,
			                align 'top',
			                elements : [
			                    {
				                        type 'hbox',
				                        align 'top',
				                        widths : [ '320px''90px' ],
				                        children :
				                        [
				                            {
					                                type 'html',
					                                id 'charContainer',
					                                html '',
					                                onMouseover onFocus,
					                                onMouseout onBlur,
					                                focus : function()
					                                {
						                                    var firstChar this.getElement().getElementsByTag'a' ).getItem);
						                                    setTimeout(function()
						                                    {
							                                        firstChar.focus();
							                                        onFocusnullfirstChar );
							                                    }, );
						                                },
					                                onShow : function()
					                                {
						                                    var firstChar this.getElement().getChild( [ 0000] );
						                                    setTimeout( function()
						                                        {
							                                            firstChar.focus();
							                                            onFocusnullfirstChar );
							                                        }, );
						                                },
					                                onLoad : function( event )
					                                {
						                                    dialog event.sender;
						                                }
					                            },
				                            {
					                                type 'hbox',
					                                align 'top',
					                                widths : [ '100%' ],
					                                children :
					                                [
					                                    {
						                                        type 'vbox',
						                                        align 'top',
						                                        children :
						                                        [
						                                            {
							                                                type 'html',
							                                                html '<div></div>'
							                                            },
						                                            {
							                                                type 'html',
							                                                id 'charPreview',
							                                                className 'cke_dark_background',
							                                                style 'border:1px solid #eeeeee;
							font-size:28px;
							height:40px;
							width:70px;
							padding-top:9px;
							font-family:\'Microsoft Sans Serif\',Arial,Helvetica,Verdana;
							text-align:center;
							',
							                                                html '<div>&nbsp;
							</div>'
							                                            },
						                                            {
							                                                type 'html',
							                                                id 'htmlPreview',
							                                                className 'cke_dark_background',
							                                                style 'border:1px solid #eeeeee;
							font-size:14px;
							height:20px;
							width:70px;
							padding-top:2px;
							font-family:\'Microsoft Sans Serif\',Arial,Helvetica,Verdana;
							text-align:center;
							',
							                                                html '<div>&nbsp;
							</div>'
							                                            }
						                                        ]
						                                    }
					                                ]
					                            }
				                        ]
				                    }
			                ]
			            }
		        ]
		    };
	} );





PHP Demo Source Code Index