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

PHP Demo Application - Source Code

/Framework/Model/Vendor/CkEditor/_source/plugins/dialogadvtab/plugin.js



/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
(function()
{
	function setupAdvParamselement )
	{
		    var attrName this.att;
		    var value element && element.hasAttributeattrName ) && element.getAttributeattrName ) || '';
		    if ( value !== undefined )
		        this.setValuevalue );
		}
	function commitAdvParams()
	{
		    // Dialogs may use different parameters in the commit list, so, by
		    // definition, we take the first CKEDITOR.dom.element available.
		    var element;
		    for ( var ;
		 arguments.length ;
		 i++ )
		    {
			        if ( arguments] instanceof CKEDITOR.dom.element )
			        {
				            element arguments];
				            break;
				        }
			    }
		    if ( element )
		    {
			        var attrName this.att,
			            value this.getValue();
			        if ( value )
			            element.setAttributeattrNamevalue );
			        else
			            element.removeAttributeattrNamevalue );
			    }
		}
	CKEDITOR.plugins.add'dialogadvtab',
	{
		    /**
		     *
		     * @param tabConfig
		     * id, dir, classes, styles
		     */
		    createAdvancedTab : function( editortabConfig )
		    {
			        if ( !tabConfig )
			            tabConfig = { id:1dir:1classes:1styles:1
				};
			        var lang editor.lang.common;
			        var result =
			        {
				            id 'advanced',
				            label lang.advancedTab,
				            title lang.advancedTab,
				            elements :
				                [
				                    {
					                        type 'vbox',
					                        padding 1,
					                        children []
					                    }
				                ]
				        };
			        var contents [];
			        if ( tabConfig.id || tabConfig.dir )
			        {
				            if ( tabConfig.id )
				            {
					                contents.push(
					                    {
						                        id 'advId',
						                        att 'id',
						                        type 'text',
						                        label lang.id,
						                        setup setupAdvParams,
						                        commit commitAdvParams
						                    });
					            }
				            if ( tabConfig.dir )
				            {
					                contents.push(
					                    {
						                        id 'advLangDir',
						                        att 'dir',
						                        type 'select',
						                        label lang.langDir,
						                        'default' '',
						                        style 'width:100%',
						                        items :
						                        [
						                            [ lang.notSet'' ],
						                            [ lang.langDirLTR'ltr' ],
						                            [ lang.langDirRTL'rtl' ]
						                        ],
						                        setup setupAdvParams,
						                        commit commitAdvParams
						                    });
					            }
				            result.elements].children.push(
				                {
					                    type 'hbox',
					                    widths : [ '50%''50%' ],
					                    children [].concatcontents )
					                });
				        }
			        if ( tabConfig.styles || tabConfig.classes )
			        {
				            contents [];
				            if ( tabConfig.styles )
				            {
					                contents.push(
					                    {
						                        id 'advStyles',
						                        att 'style',
						                        type 'text',
						                        label lang.styles,
						                        'default' '',
						                        onChange : function(){},
						                        getStyle : function( namedefaultValue )
						                        {
							                            var match this.getValue().match( new RegExpname '\\s*:\s*([^;
							]*)''i') );
							                            return match match] : defaultValue;
							                        },
						                        updateStyle : function( namevalue )
						                        {
							                            var styles this.getValue();
							                            // Remove the current value.
							                            if ( styles )
							                            {
								                                styles styles
								                                    .replace( new RegExp'\\s*' name '\s*:[^;
								]*(?:$|;
								\s*)''i' ), '' )
								                                    .replace( /^[;
								\s]+/, '' )
								                                    .replace( /\s+$/, '' );
								                            }
							                            if ( value )
							                            {
								                                styles && !(/;
								\s*$/).teststyles ) && ( styles += ';
								 ' );
								                                styles += name ': ' value;
								                            }
							                            this.setValuestylestrue );
							                        },
						                        setup setupAdvParams,
						                        commit commitAdvParams
						                    });
					            }
				            if ( tabConfig.classes )
				            {
					                contents.push(
					                    {
						                        type 'hbox',
						                        widths : [ '45%''55%' ],
						                        children :
						                        [
						                            {
							                                id 'advCSSClasses',
							                                att 'class',
							                                type 'text',
							                                label lang.cssClasses,
							                                'default' '',
							                                setup setupAdvParams,
							                                commit commitAdvParams
							                            }
						                        ]
						                    });
					            }
				            result.elements].children.push(
				                {
					                    type 'hbox',
					                    widths : [ '50%''50%' ],
					                    children [].concatcontents )
					                });
				        }
			        return result;
			    }
		});
	})();





PHP Demo Source Code Index