Вход Регистрация
Файл: public/js/3rd_party/ckeditor/plugins/iframe/dialogs/iframe.js
Строк: 148
<?php

/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/

(function()
{
    
// Map 'true' and 'false' values to match W3C's specifications
    // http://www.w3.org/TR/REC-html40/present/frames.html#h-16.5
    
var checkboxValues =
    {
        
scrolling : { 'true' 'yes''false' 'no' },
        
frameborder : { 'true' '1''false' '0' }
    };

    function 
loadValueiframeNode )
    {
        var 
isCheckbox this instanceof CKEDITOR.ui.dialog.checkbox;
        if ( 
iframeNode.hasAttributethis.id ) )
        {
            var 
value iframeNode.getAttributethis.id );
            if ( 
isCheckbox )
                
this.setValuecheckboxValuesthis.id ][ 'true' ] == value.toLowerCase() );
            else
                
this.setValuevalue );
        }
    }

    function 
commitValueiframeNode )
    {
        var 
isRemove this.getValue() === '',
            
isCheckbox this instanceof CKEDITOR.ui.dialog.checkbox,
            
value this.getValue();
        if ( 
isRemove )
            
iframeNode.removeAttributethis.att || this.id );
        else if ( 
isCheckbox )
            
iframeNode.setAttributethis.idcheckboxValuesthis.id ][ value ] );
        else
            
iframeNode.setAttributethis.att || this.idvalue );
    }

    
CKEDITOR.dialog.add'iframe', function( editor )
    {
        var 
iframeLang editor.lang.iframe,
            
commonLang editor.lang.common,
            
dialogadvtab editor.plugins.dialogadvtab;
        return {
            
title iframeLang.title,
            
minWidth 350,
            
minHeight 260,
            
onShow : function()
            {
                
// Clear previously saved elements.
                
this.fakeImage this.iframeNode null;

                var 
fakeImage this.getSelectedElement();
                if ( 
fakeImage && fakeImage.data'cke-real-element-type' ) && fakeImage.data'cke-real-element-type' ) == 'iframe' )
                {
                    
this.fakeImage fakeImage;

                    var 
iframeNode editor.restoreRealElementfakeImage );
                    
this.iframeNode iframeNode;

                    
this.setupContentiframeNode );
                }
            },
            
onOk : function()
            {
                var 
iframeNode;
                if ( !
this.fakeImage )
                    
iframeNode = new CKEDITOR.dom.element'iframe' );
                else
                    
iframeNode this.iframeNode;

                
// A subset of the specified attributes/styles
                // should also be applied on the fake element to
                // have better visual effect. (#5240)
                
var extraStyles = {}, extraAttributes = {};
                
this.commitContentiframeNodeextraStylesextraAttributes );

                
// Refresh the fake image.
                
var newFakeImage editor.createFakeElementiframeNode'cke_iframe''iframe'true );
                
newFakeImage.setAttributesextraAttributes );
                
newFakeImage.setStylesextraStyles );
                if ( 
this.fakeImage )
                {
                    
newFakeImage.replacethis.fakeImage );
                    
editor.getSelection().selectElementnewFakeImage );
                }
                else
                    
editor.insertElementnewFakeImage );
            },
            
contents : [
                {
                    
id 'info',
                    
label commonLang.generalTab,
                    
accessKey 'I',
                    
elements :
                    [
                        {
                            
type 'vbox',
                            
padding 0,
                            
children :
                            [
                                {
                                    
id 'src',
                                    
type 'text',
                                    
label commonLang.url,
                                    
required true,
                                    
validate CKEDITOR.dialog.validate.notEmptyiframeLang.noUrl ),
                                    
setup loadValue,
                                    
commit commitValue
                                
}
                            ]
                        },
                        {
                            
type 'hbox',
                            
children :
                            [
                                {
                                    
id 'width',
                                    
type 'text',
                                    
style 'width:100%',
                                    
labelLayout 'vertical',
                                    
label commonLang.width,
                                    
validate CKEDITOR.dialog.validate.htmlLengthcommonLang.invalidHtmlLength.replace'%1'commonLang.width ) ),
                                    
setup loadValue,
                                    
commit commitValue
                                
},
                                {
                                    
id 'height',
                                    
type 'text',
                                    
style 'width:100%',
                                    
labelLayout 'vertical',
                                    
label commonLang.height,
                                    
validate CKEDITOR.dialog.validate.htmlLengthcommonLang.invalidHtmlLength.replace'%1'commonLang.height ) ),
                                    
setup loadValue,
                                    
commit commitValue
                                
},
                                {
                                    
id 'align',
                                    
type 'select',
                                    
'default' '',
                                    
items :
                                    [
                                        [ 
commonLang.notSet '' ],
                                        [ 
commonLang.alignLeft 'left' ],
                                        [ 
commonLang.alignRight 'right' ],
                                        [ 
commonLang.alignTop 'top' ],
                                        [ 
commonLang.alignMiddle 'middle' ],
                                        [ 
commonLang.alignBottom 'bottom' ]
                                    ],
                                    
style 'width:100%',
                                    
labelLayout 'vertical',
                                    
label commonLang.align,
                                    
setup : function( iframeNodefakeImage )
                                    {
                                        
loadValue.applythisarguments );
                                        if ( 
fakeImage )
                                        {
                                            var 
fakeImageAlign fakeImage.getAttribute'align' );
                                            
this.setValuefakeImageAlign && fakeImageAlign.toLowerCase() || '' );
                                        }
                                    },
                                    
commit : function( iframeNodeextraStylesextraAttributes )
                                    {
                                        
commitValue.applythisarguments );
                                        if ( 
this.getValue() )
                                            
extraAttributes.align this.getValue();
                                    }
                                }
                            ]
                        },
                        {
                            
type 'hbox',
                            
widths : [ '50%''50%' ],
                            
children :
                            [
                                {
                                    
id 'scrolling',
                                    
type 'checkbox',
                                    
label iframeLang.scrolling,
                                    
setup loadValue,
                                    
commit commitValue
                                
},
                                {
                                    
id 'frameborder',
                                    
type 'checkbox',
                                    
label iframeLang.border,
                                    
setup loadValue,
                                    
commit commitValue
                                
}
                            ]
                        },
                        {
                            
type 'hbox',
                            
widths : [ '50%''50%' ],
                            
children :
                            [
                                {
                                    
id 'name',
                                    
type 'text',
                                    
label commonLang.name,
                                    
setup loadValue,
                                    
commit commitValue
                                
},
                                {
                                    
id 'title',
                                    
type 'text',
                                    
label commonLang.advisoryTitle,
                                    
setup loadValue,
                                    
commit commitValue
                                
}
                            ]
                        },
                        {
                            
id 'longdesc',
                            
type 'text',
                            
label commonLang.longDescr,
                            
setup loadValue,
                            
commit commitValue
                        
}
                    ]
                },
                
dialogadvtab && dialogadvtab.createAdvancedTabeditor, { id:1classes:1styles:})
            ]
        };
    });
})();
?>
Онлайн: 1
Реклама