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

PHP Demo Application - Source Code

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



/*
 * Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.html or http://ckeditor.com/license
 */
(function()
{
	    function getListElementeditorlistTag )
	    {
		        var range;
		        try { range  editor.getSelection().getRanges()[ ];
			}
		        catch( ) {
			return null;
			}
		        range.shrinkCKEDITOR.SHRINK_TEXT );
		        return range.getCommonAncestor().getAscendantlistTagtrue );
		    }
	    var mapListStyle = {
		        'a' 'lower-alpha',
		        'A' 'upper-alpha',
		        'i' 'lower-roman',
		        'I' 'upper-roman',
		        '1' 'decimal',
		        'disc' 'disc',
		        'circle''circle',
		        'square' 'square'
		    };
	    function listStyleeditorstartupPage )
	    {
		        if ( startupPage == 'bulletedListStyle' )
		        {
			            return {
				                title editor.lang.list.bulletedTitle,
				                minWidth 300,
				                minHeight 50,
				                contents :
				                [
				                    {
					                        id 'info',
					                        accessKey 'I',
					                        elements :
					                        [
					                            {
						                                type 'select',
						                                label editor.lang.list.type,
						                                id 'type',
						                                style 'width: 150px;
						 margin: auto;
						',
						                                items :
						                                [
						                                    [ editor.lang.list.notset'' ],
						                                    [ editor.lang.list.circle'circle' ],
						                                    [ editor.lang.list.disc,  'disc' ],
						                                    [ editor.lang.list.square'square' ]
						                                ],
						                                setup : function( element )
						                                {
							                                    var value element.getStyle'list-style-type' )
							                                                || mapListStyleelement.getAttribute'type' ) ]
							                                                || element.getAttribute'type' )
							                                                || '';
							                                    this.setValuevalue );
							                                },
						                                commit : function( element )
						                                {
							                                    var value this.getValue();
							                                    if ( value )
							                                        element.setStyle'list-style-type'value );
							                                    else
							                                        element.removeStyle'list-style-type' );
							                                }
						                            }
					                        ]
					                    }
				                ],
				                onShow: function()
				                {
					                    var editor this.getParentEditor(),
					                        element getListElementeditor'ul' );
					                    element && this.setupContentelement );
					                },
				                onOk: function()
				                {
					                    var editor this.getParentEditor(),
					                        element getListElementeditor'ul' );
					                    element && this.commitContentelement );
					                }
				            };
			        }
		        else if ( startupPage == 'numberedListStyle'  )
		        {
			            var listStyleOptions =
			            [
			                [ editor.lang.list.notset'' ],
			                [ editor.lang.list.lowerRoman'lower-roman' ],
			                [ editor.lang.list.upperRoman'upper-roman' ],
			                [ editor.lang.list.lowerAlpha'lower-alpha' ],
			                [ editor.lang.list.upperAlpha'upper-alpha' ],
			                [ editor.lang.list.decimal'decimal' ]
			            ];
			            if ( !CKEDITOR.env.ie || CKEDITOR.env.version )
			            {
				                listStyleOptions.concat( [
				                    [ editor.lang.list.armenian'armenian' ],
				                    [ editor.lang.list.decimalLeadingZero'decimal-leading-zero' ],
				                    [ editor.lang.list.georgian'georgian' ],
				                    [ editor.lang.list.lowerGreek'lower-greek' ]
				                ]);
				            }
			            return {
				                title editor.lang.list.numberedTitle,
				                minWidth 300,
				                minHeight 50,
				                contents :
				                [
				                    {
					                        id 'info',
					                        accessKey 'I',
					                        elements :
					                        [
					                            {
						                                type 'hbox',
						                                widths : [ '25%''75%' ],
						                                children :
						                                [
						                                    {
							                                        label editor.lang.list.start,
							                                        type 'text',
							                                        id 'start',
							                                        validate CKEDITOR.dialog.validate.integereditor.lang.list.validateStartNumber ),
							                                        setup : function( element )
							                                        {
								                                            var value element.getAttribute'start' ) || 1;
								                                            value && this.setValuevalue );
								                                        },
							                                        commit : function( element )
							                                        {
								                                            element.setAttribute'start'this.getValue() );
								                                        }
							                                    },
						                                    {
							                                        type 'select',
							                                        label editor.lang.list.type,
							                                        id 'type',
							                                        style 'width: 100%;
							',
							                                        items listStyleOptions,
							                                        setup : function( element )
							                                        {
								                                            var value element.getStyle'list-style-type' )
								                                                || mapListStyleelement.getAttribute'type' ) ]
								                                                || element.getAttribute'type' )
								                                                || '';
								                                            this.setValuevalue );
								                                        },
							                                        commit : function( element )
							                                        {
								                                            var value this.getValue();
								                                            if ( value )
								                                                element.setStyle'list-style-type'value );
								                                            else
								                                                element.removeStyle'list-style-type' );
								                                        }
							                                    }
						                                ]
						                            }
					                        ]
					                    }
				                ],
				                onShow: function()
				                {
					                    var editor this.getParentEditor(),
					                        element getListElementeditor'ol' );
					                    element && this.setupContentelement );
					                },
				                onOk: function()
				                {
					                    var editor this.getParentEditor(),
					                        element getListElementeditor'ol' );
					                    element && this.commitContentelement );
					                }
				            };
			        }
		    }
	    CKEDITOR.dialog.add'numberedListStyle', function( editor )
	        {
		            return listStyleeditor'numberedListStyle' );
		        });
	    CKEDITOR.dialog.add'bulletedListStyle', function( editor )
	        {
		            return listStyleeditor'bulletedListStyle' );
		        });
	})();





PHP Demo Source Code Index