Ticket #3673: 3673_4.patch

File 3673_4.patch, 24.2 KB (added by Wiktor Walc, 15 years ago)

added missing language entry

  • _source/core/config.js

     
    149149         * @example
    150150         * config.plugins = 'basicstyles,button,htmldataprocessor,toolbar,wysiwygarea';
    151151         */
    152 
    153         plugins : 'about,basicstyles,blockquote,button,clipboard,colorbutton,contextmenu,elementspath,enterkey,entities,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,maximize,newpage,pagebreak,pastefromword,pastetext,preview,print,removeformat,resize,save,scayt,smiley,showblocks,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',
    154 
     152        plugins : 'about,basicstyles,blockquote,button,clipboard,colorbutton,contextmenu,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,save,smiley,showblocks,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',
    155153        /**
    156154         * List of additional plugins to be loaded. This is a tool setting which
    157155         * makes it easier to add new plugins, whithout having to touch and
  • _source/lang/en.js

     
    545545                panelTitle3 : 'Object Styles'
    546546        },
    547547
     548        filebrowser :
     549        {
     550                browserNotConfigured : 'Unable to open file browser due to missing configuration settings',
     551                fileNotSelected : 'Please select a file from your computer',
     552                uploaderNotConfigured : 'Unable to upload file due to missing configuration settings'
     553        },
     554
    548555        format :
    549556        {
    550557                label : 'Format',
  • _source/plugins/dialog/plugin.js

     
    871871                },
    872872
    873873                /**
     874                 * Gets the name of the dialog.
     875                 * @returns {String} The name of this dialog.
     876                 * @example
     877                 * var dialogName = dialogObj.getName();
     878                 */
     879                getName : function()
     880                {
     881                        return this._.name;
     882                },
     883
     884                /**
    874885                 * Gets a dialog UI element object from a dialog page.
    875886                 * @param {String} pageId id of dialog page.
    876887                 * @param {String} elementId id of UI element.
     
    21772188                },
    21782189
    21792190                /**
     2191                 * Gets the name of the parent tab of this element.
     2192                 * @returns {String} The name of selected tab.
     2193                 * @example
     2194                 * focus : function()
     2195                 * {
     2196                 *              this.getParentTab();
     2197                 *              // do something else.
     2198                 * }
     2199                 */
     2200                getParentTab : function()
     2201                {
     2202                        var element = this.getInputElement(),
     2203                                cursor = element,
     2204                                tabId;
     2205                        while ( ( cursor = cursor.getParent() ) && cursor.$.className.search( 'cke_dialog_page_contents' ) == -1 )
     2206                        { /*jsl:pass*/ }
     2207
     2208                        tabId = cursor.getAttribute( 'name' );
     2209
     2210                        return tabId;
     2211                },
     2212
     2213                /**
    21802214                 * Puts the focus to the UI object. Switches tabs if the UI object isn't in the active tab page.
    21812215                 * @returns {CKEDITOR.dialog.uiElement} The current UI element.
    21822216                 * @example
  • _source/plugins/dialogui/plugin.js

     
    654654                                        this.validate = elementDefinition.validate;
    655655
    656656                                var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition );
     657                                var onClick = myDefinition.onClick;
    657658                                myDefinition.className = ( myDefinition.className ? myDefinition.className + ' ' : '' ) + 'cke_dialog_ui_button';
    658659                                myDefinition.onClick = function( evt )
    659660                                {
    660661                                        var target = elementDefinition[ 'for' ];                // [ pageId, elementId ]
    661                                         dialog.getContentElement( target[0], target[1] ).submit();
    662                                         this.disable();
     662                                        if ( !onClick || onClick.call( this, evt ) !== false )
     663                                        {
     664                                                dialog.getContentElement( target[0], target[1] ).submit();
     665                                                this.disable();
     666                                        }
    663667                                };
    664668
    665669                                dialog.on( 'load', function()
     
    11971201                                },
    11981202
    11991203                                /**
     1204                                 * Get the action assigned to the form.
     1205                                 * @returns {String} The value of the action.
     1206                                 * @example
     1207                                 */
     1208                                getAction : function( action )
     1209                                {
     1210                                        return this.getInputElement().getParent().$.action;
     1211                                },
     1212
     1213                                /**
    12001214                                 * Redraws the file input and resets the file path in the file input.
    12011215                                 * The redraw logic is necessary because non-IE browsers tend to clear
    12021216                                 * the <iframe> containing the file input after closing the dialog.
    12031217                                 * @example
    12041218                                 */
    1205                                 reset : function()
     1219                                reset : function( action )
    12061220                                {
    12071221                                        var frameElement = CKEDITOR.document.getById( this._.frameId ),
    12081222                                                frameDocument = frameElement.getFrameDocument(),
     
    12191233
    12201234                                                frameDocument.$.write( [ '<html><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">',
    12211235                                                                '<form enctype="multipart/form-data" method="POST" action="',
    1222                                                                 CKEDITOR.tools.htmlEncode( elementDefinition.action ),
     1236                                                                CKEDITOR.tools.htmlEncode( action || elementDefinition.action ),
    12231237                                                                '">',
    12241238                                                                '<input type="file" name="',
    12251239                                                                CKEDITOR.tools.htmlEncode( elementDefinition.id || 'cke_upload' ),
  • _source/plugins/filebrowser/plugin.js

     
     1/*
     2Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
     3For licensing, see LICENSE.html or http://ckeditor.com/license
     4*/
     5
     6/**
     7 * @fileOverview The "filebrowser" plugin, it adds support for file uploads and
     8 *               browsing.
     9 *
     10 * When file is selected inside of the file browser or uploaded, its url is
     11 * inserted automatically to a field, which is described in the 'filebrowser'
     12 * attribute. To specify field that should be updated, pass the tab id and
     13 * element id, separated with a colon.
     14 *
     15 * Example 1: (Browse)
     16 *
     17 * <pre>
     18 * {
     19 *      type : 'button',
     20 *      id : 'browse',
     21 *      filebrowser : 'tabId:elementId',
     22 *      label : editor.lang.common.browseServer
     23 * }
     24 * </pre>
     25 *
     26 * If you set the 'filebrowser' attribute on any element other than
     27 * 'fileButton', the 'Browse' action will be triggered.
     28 *
     29 * Example 2: (Quick Upload)
     30 *
     31 * <pre>
     32 * {
     33 *      type : 'fileButton',
     34 *      id : 'uploadButton',
     35 *      filebrowser : 'tabId:elementId',
     36 *      label : editor.lang.common.uploadSubmit,
     37 *      'for' : [ 'upload', 'upload' ]
     38 * }
     39 * </pre>
     40 *
     41 * If you set the 'filebrowser' attribute on a fileButton element, the
     42 * 'QuickUpload' action will be executed.
     43 *
     44 * Filebrowser plugin also supports more advanced configuration (through
     45 * javascript object).
     46 *
     47 * The following settings are supported:
     48 *
     49 * <pre>
     50 *  [action] - Browse or QuickUpload
     51 *  [target] - field to update, tabId:elementId
     52 *  [params] - additional arguments to be passed to the server connector (optional)
     53 *  [onSelect] - function to execute when file is selected/uploaded (optional)
     54 *  [url] - the URL to be called (optional)
     55 * </pre>
     56 *
     57 * Example 3: (Quick Upload)
     58 *
     59 * <pre>
     60 * {
     61 *      type : 'fileButton',
     62 *      label : editor.lang.common.uploadSubmit,
     63 *      id : 'buttonId',
     64 *      filebrowser :
     65 *      {
     66 *              action : 'QuickUpload', //required
     67 *              target : 'tab1:elementId', //required
     68 *              params : //optional
     69 *              {
     70 *                      type : 'Files',
     71 *                      currentFolder : '/folder/'
     72 *              },
     73 *              onSelect : function( fileUrl, errorMessage ) //optional
     74 *              {
     75 *                      // Do not call the built-in selectFuntion
     76 *                      // return false;
     77 *              }
     78 *      },
     79 *      'for' : [ 'tab1', 'myFile' ]
     80 * }
     81 * </pre>
     82 *
     83 * Suppose we have a file element with id 'myFile', text field with id
     84 * 'elementId' and a fileButton. If filebowser.url is not specified explicitly,
     85 * form action will be set to 'filebrowser[DialogName]UploadUrl' or, if not
     86 * specified, to 'filebrowserUploadUrl'. Additional parameters from 'params'
     87 * object will be added to the query string. It is possible to create your own
     88 * uploadHandler and cancel the built-in updateTargetElement command.
     89 *
     90 * Example 4: (Browse)
     91 *
     92 * <pre>
     93 * {
     94 *      type : 'button',
     95 *      id : 'buttonId',
     96 *      label : editor.lang.common.browseServer,
     97 *      filebrowser :
     98 *      {
     99 *              action : 'Browse',
     100 *              url : '/ckfinder/ckfinder.html&amp;type=Images',
     101 *              target : 'tab1:elementId'
     102 *      }
     103 * }
     104 * </pre>
     105 *
     106 * In this example, after pressing a button, file browser will be opened in a
     107 * popup. If we don't specify filebrowser.url attribute,
     108 * 'filebrowser[DialogName]BrowseUrl' or 'filebrowserBrowseUrl' will be used.
     109 * After selecting a file in a file browser, an element with id 'elementId' will
     110 * be updated. Just like in the third example, a custom 'onSelect' function may be
     111 * defined.
     112 */
     113( function()
     114{
     115        /**
     116         * Reference to the editor instance.
     117         *
     118         * @type CKEDITOR
     119         */
     120        var editorInstance;
     121        /**
     122         * Reference to the UI element that started the Browse/QuickUpload action.
     123         *
     124         * @type CKEDITOR.ui.dialog.uiElement
     125         */
     126        var sourceElement;
     127
     128        /**
     129         * Adds (additional) arguments to given url.
     130         *
     131         * @param {String}
     132         *            url The url.
     133         * @param {Object}
     134         *            params Additional parameters.
     135         */
     136        var addQueryString = function( url, params )
     137        {
     138                var queryString = [];
     139
     140                if ( !params )
     141                        return url;
     142                else
     143                {
     144                        for ( var i in params )
     145                                queryString.push( i + "=" + encodeURIComponent( params[ i ] ) );
     146                }
     147
     148                return url + ( ( url.indexOf( "?" ) != -1 ) ? "&" : "?" ) + queryString.join( "&" );
     149        };
     150
     151        /**
     152         * Make a string's first character uppercase.
     153         *
     154         * @param {String}
     155         *            str String.
     156         */
     157        var ucFirst = function( str )
     158        {
     159                str += '';
     160                var f = str.charAt( 0 ).toUpperCase();
     161                return f + str.substr( 1 );
     162        };
     163
     164        /**
     165         * The onlick function assigned to the 'Browse Server' button. Opens the
     166         * file browser and updates target field when file is selected.
     167         *
     168         * @param {CKEDITOR.event}
     169         *            evt The event object.
     170         */
     171        var browseServer = function( evt )
     172        {
     173                sourceElement = this;
     174
     175                var dialog = this.getDialog();
     176                var width = editorInstance.config[ 'filebrowser' + ucFirst( dialog.getName() ) + 'WindowWidth' ]
     177                                || editorInstance.config.filebrowserWindowWidth || '80%';
     178                var height = editorInstance.config[ 'filebrowser' + ucFirst( dialog.getName() ) + 'WindowHeight' ]
     179                                || editorInstance.config.filebrowserWindowHeight || '70%';
     180                var url = this.filebrowser.url || editorInstance.config[ 'filebrowser' + ucFirst( dialog.getName() ) + 'BrowseUrl' ]
     181                                || editorInstance.config.filebrowserBrowseUrl;
     182
     183                if ( !url )
     184                {
     185                        alert( editorInstance.lang.filebrowser.browserNotConfigured );
     186                        return;
     187                }
     188
     189                var params = this.filebrowser.params || {};
     190                params.CKEditor = editorInstance.name;
     191                if ( !params.langCode )
     192                        params.langCode = editorInstance.langCode;
     193
     194                url = addQueryString( url, params );
     195                editorInstance.popup( url, width, height );
     196        };
     197
     198        /**
     199         * The onlick function assigned to the 'Upload' button. Makes the final
     200         * decision whether form is really submitted and updates target field when
     201         * file is uploaded.
     202         *
     203         * @param {CKEDITOR.event}
     204         *            evt The event object.
     205         */
     206        var uploadFile = function( evt )
     207        {
     208                sourceElement = this;
     209
     210                var dialog = this.getDialog();
     211
     212                // If user didn't select the file, stop the upload.
     213                if ( !dialog.getContentElement( this[ 'for' ][ 0 ], this[ 'for' ][ 1 ] ).getInputElement().$.value )
     214                {
     215                        alert( editorInstance.lang.filebrowser.fileNotSelected );
     216                        return false;
     217                }
     218
     219                if ( !dialog.getContentElement( this[ 'for' ][ 0 ], this[ 'for' ][ 1 ] ).getAction() )
     220                {
     221                        alert( editorInstance.lang.filebrowser.uploaderNotConfigured );
     222                        return false;
     223                }
     224
     225                return true;
     226        };
     227
     228        /**
     229         * Setups the file element.
     230         *
     231         * @param {CKEDITOR.ui.dialog.file}
     232         *            fileInput The file element used during file upload.
     233         * @param {Object}
     234         *            filebrowser Object containing filebrowser settings assigned to
     235         *            the fileButton associated with this file element.
     236         */
     237        var setupFileElement = function( dialogName, fileInput, filebrowser )
     238        {
     239                var params = filebrowser.params || {};
     240                params.CKEditor = editorInstance.name;
     241                if ( !params.langCode )
     242                        params.langCode = editorInstance.langCode;
     243
     244                var url = filebrowser.url || editorInstance.config[ 'filebrowser' + ucFirst( dialogName ) + 'UploadUrl' ]
     245                                || editorInstance.config.filebrowserUploadUrl;
     246
     247                fileInput.action = url ? addQueryString( url, params ) : '';
     248                fileInput.filebrowser = filebrowser;
     249        };
     250
     251        /**
     252         * Traverse through the content definition and attach filebrowser to
     253         * elements with 'filebrowser' attribute.
     254         *
     255         * @param {CKEDITOR.dialog.dialogDefinitionObject}
     256         *            definition
     257         * @param {Array}
     258         *            elements Array of {@link CKEDITOR.dialog.contentDefinition}
     259         *            objects.
     260         */
     261        var attachFileBrowser = function( dialogName, definition, elements )
     262        {
     263                var element, fileInput;
     264
     265                for ( var i in elements )
     266                {
     267                        element = elements[ i ];
     268
     269                        if ( element.type == 'hbox' || element.type == 'vbox' )
     270                                attachFileBrowser( dialogName, definition, element.children );
     271
     272                        if ( !element.filebrowser )
     273                                continue;
     274
     275                        if ( typeof element.filebrowser == 'string' )
     276                        {
     277                                var fb =
     278                                {
     279                                        action : ( element.type == 'fileButton' ) ? 'QuickUpload' : 'Browse',
     280                                        target : element.filebrowser
     281                                };
     282                                element.filebrowser = fb;
     283                        }
     284
     285                        if ( element.filebrowser.action == 'Browse' )
     286                        {
     287                                element.onClick = browseServer;
     288                        }
     289                        else if ( element.filebrowser.action == 'QuickUpload' && element[ 'for' ] )
     290                        {
     291                                setupFileElement( dialogName, definition.getContents( element[ 'for' ][ 0 ] ).get( element[ 'for' ][ 1 ] ),
     292                                                element.filebrowser );
     293                                element.onClick = uploadFile;
     294                        }
     295                }
     296        };
     297
     298        /**
     299         * Updates the target element with the url of uploaded/selected file.
     300         *
     301         * @param {String}
     302         *            url The url of a file.
     303         */
     304        var updateTargetElement = function( url )
     305        {
     306                var dialog = sourceElement.getDialog();
     307                var targetElement = sourceElement.filebrowser.target || null;
     308                url = url.replace( /#/g, '%23' );
     309
     310                // If there is a reference to targetElement, update it.
     311                if ( targetElement )
     312                {
     313                        if ( targetElement === true )
     314                                targetElement = 'url';
     315
     316                        if ( targetElement.indexOf( ':' ) == -1 )
     317                        {
     318                                dialog.foreach( function( element )
     319                                {
     320                                        if ( element.id == targetElement )
     321                                        {
     322                                                element.setValue( url );
     323                                                dialog.selectPage( element.getParentTab() );
     324                                        }
     325                                } );
     326                        }
     327                        else
     328                        {
     329                                var target = targetElement.split( ':' );
     330                                var element = dialog.getContentElement( target[ 0 ], target[ 1 ] );
     331                                if ( element )
     332                                {
     333                                        element.setValue( url );
     334                                        dialog.selectPage( target[ 0 ] );
     335                                }
     336                        }
     337                }
     338        };
     339
     340        CKEDITOR.plugins.add( 'filebrowser',
     341        {
     342                init : function( editor, pluginPath )
     343                {
     344                        CKEDITOR.on( 'dialogDefinition', function( evt )
     345                        {
     346                                editorInstance = editor;
     347
     348                                // Associate filebrowser to elements with 'filebrowser' attribute.
     349                                for ( var i in evt.data.definition.contents )
     350                                        attachFileBrowser( evt.data.name, evt.data.definition, evt.data.definition.contents[ i ].elements );
     351                        } );
     352                },
     353
     354                setUrl : function( fileUrl, data )
     355                {
     356                        var dialog = sourceElement.getDialog(),
     357                                targetInput = sourceElement[ 'for' ],
     358                                onSelect = sourceElement.filebrowser.onSelect;
     359
     360                        if ( targetInput )
     361                        {
     362                                var formAction = dialog.getContentElement( targetInput[ 0 ], targetInput[ 1 ] ).getAction();
     363                                dialog.getContentElement( targetInput[ 0 ], targetInput[ 1 ] ).reset( formAction );
     364                        }
     365
     366                        if ( onSelect && onSelect.call( sourceElement, fileUrl, data ) === false )
     367                                return;
     368
     369                        // The "data" argument may be used to pass the error message to the editor.   
     370                        if ( typeof data == 'string' )
     371                                alert( data );
     372
     373                        if ( fileUrl )
     374                                updateTargetElement( fileUrl );
     375                }
     376        } );
     377
     378} )();
  • _source/plugins/flash/dialogs/flash.js

     
    347347                                                                                {
    348348                                                                                        type : 'button',
    349349                                                                                        id : 'browse',
     350                                                                                        filebrowser : 'src',
    350351                                                                                        align : 'center',
    351352                                                                                        label : editor.lang.common.browseServer
    352353                                                                                }
     
    445446                                                        type : 'file',
    446447                                                        id : 'upload',
    447448                                                        label : editor.lang.common.upload,
    448                                                         action : editor.config.image_uploadAction,
    449449                                                        size : 38
    450450                                                },
    451451                                                {
    452452                                                        type : 'fileButton',
    453453                                                        id : 'uploadButton',
    454454                                                        label : editor.lang.common.uploadSubmit,
     455                                                        filebrowser : 'src',
    455456                                                        'for' : [ 'Upload', 'upload' ]
    456457                                                }
    457458                                        ]
  • _source/plugins/flash/plugin.js

     
    143143CKEDITOR.tools.extend( CKEDITOR.config,
    144144{
    145145        flashUploadTab : true,
    146         flashUploadAction : 'nowhere.php',
    147146        flashBrowseServer : true,
    148147
    149148        /**
  • _source/plugins/image/dialogs/image.js

     
    445445                                                                                        id : 'browse',
    446446                                                                                        align : 'center',
    447447                                                                                        label : editor.lang.common.browseServer,
     448                                                                                        filebrowser : 'info:txtUrl',
    448449                                                                                        onLoad : function()
    449450                                                                                        {
    450451                                                                                                var dialog = this.getDialog();
    451452                                                                                                if ( !dialog.getParentEditor().config.image_browseServer )
    452453                                                                                                        dialog.getContentElement( 'info', 'browse' ).getElement().hide();
    453                                                                                         },
    454                                                                                         onClick : function()
    455                                                                                         {
    456 
    457454                                                                                        }
    458455                                                                                }
    459456                                                                        ]
     
    930927                                                {
    931928                                                        type : 'button',
    932929                                                        id : 'browse',
     930                                                        filebrowser : 'Link:txtUrl',
    933931                                                        style : 'float:right',
    934                                                         label : editor.lang.common.browseServer,
    935                                                         onClick : function()
    936                                                         {
    937                                                         }
     932                                                        label : editor.lang.common.browseServer
    938933                                                },
    939934                                                {
    940935                                                        id : 'cmbTarget',
     
    974969                                                        type : 'file',
    975970                                                        id : 'upload',
    976971                                                        label : editor.lang.image.btnUpload,
    977                                                         action : editor.config.image_uploadAction,
    978972                                                        size : 38
    979973                                                },
    980974                                                {
    981975                                                        type : 'fileButton',
    982976                                                        id : 'uploadButton',
     977                                                        filebrowser : 'info:txtUrl',
    983978                                                        label : editor.lang.image.btnUpload,
    984979                                                        'for' : [ 'Upload', 'upload' ]
    985980                                                }
  • _source/plugins/image/plugin.js

     
    6161 */
    6262CKEDITOR.config.image_browseServer = true;
    6363
    64 /**
    65  * Upload action attribute.
    66  * @type URL
    67  */
    68 CKEDITOR.config.image_uploadAction = 'nowhere.php';
    69 
    7064CKEDITOR.config.image_removeLinkByEmptyURL = true;
  • _source/plugins/link/dialogs/link.js

     
    388388                                                        {
    389389                                                                type : 'button',
    390390                                                                id : 'browse',
     391                                                                filebrowser : 'url',
    391392                                                                label : editor.lang.common.browseServer
    392393                                                        }
    393394                                                ]
     
    821822                                                type : 'file',
    822823                                                id : 'upload',
    823824                                                label : editor.lang.common.upload,
    824                                                 action : editor.config.linkUploadAction,
    825825                                                size : 38
    826826                                        },
    827827                                        {
    828828                                                type : 'fileButton',
    829829                                                id : 'uploadButton',
    830830                                                label : editor.lang.common.uploadSubmit,
     831                                                filebrowser : 'url',
    831832                                                'for' : [ 'upload', 'upload' ]
    832833                                        }
    833834                                ]
     
    10391040                                case 'url':
    10401041                                        var protocol = ( data.url && data.url.protocol != undefined ) ? data.url.protocol : 'http://',
    10411042                                                url = ( data.url && data.url.url ) || '';
    1042                                         attributes._cke_saved_href = protocol + url;
     1043                                        attributes._cke_saved_href = ( url.indexOf( '/' ) === 0 ) ? url : protocol + url;
    10431044                                        break;
    10441045                                case 'anchor':
    10451046                                        var name = ( data.anchor && data.anchor.name ),
  • _source/plugins/link/plugin.js

     
    185185{
    186186        linkUploadTab : true,
    187187        linkBrowseServer : true,
    188         linkUploadAction : 'nowhere.php',
    189188        linkShowAdvancedTab : true,
    190189        linkShowTargetTab : true
    191190} );
  • _source/plugins/popup/plugin.js

     
     1/*
     2Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
     3For licensing, see LICENSE.html or http://ckeditor.com/license
     4*/
     5
     6CKEDITOR.plugins.add( 'popup');
     7
     8CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
     9{
     10        /**
     11         * Opens Browser in a popup. The "width" and "height" parameters accept
     12         * numbers (pixels) or percent (of screen size) values.
     13         * @param {String} url The url of the external file browser.
     14         * @param {String} width Popup window width.
     15         * @param {String} height Popup window height.
     16         */
     17        popup : function( url, width, height )
     18        {
     19                width = width || '80%';
     20                height = height || '70%';
     21
     22                if ( typeof width == 'string' && width.length > 1 && width.substr( width.length - 1, 1 ) == '%' )
     23                        width = parseInt( window.screen.width * parseInt( width, 10 ) / 100, 10 );
     24
     25                if ( typeof height == 'string' && height.length > 1 && height.substr( height.length - 1, 1 ) == '%' )
     26                        height = parseInt( window.screen.height * parseInt( height, 10 ) / 100, 10 );
     27
     28                if ( width < 640 )
     29                        width = 640;
     30
     31                if ( height < 420 )
     32                        height = 420;
     33
     34                var top = parseInt( ( window.screen.height - height ) / 2, 10 ),
     35                        left = parseInt( ( window.screen.width  - width ) / 2, 10 ),
     36                        options = 'location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes' +
     37                        ',width='  + width +
     38                        ',height=' + height +
     39                        ',top='  + top +
     40                        ',left=' + left;
     41
     42                var popupWindow = window.open( '', null, options, true );
     43
     44                // Blocked by a popup blocker.
     45                if ( !popupWindow )
     46                        return false;
     47
     48                try
     49                {
     50                        popupWindow.moveTo( left, top );
     51                        popupWindow.resizeTo( width, height );
     52                        popupWindow.focus();
     53                        popupWindow.location.href = url;
     54                }
     55                catch (e)
     56                {
     57                        popupWindow = window.open( url, null, options, true );
     58                }
     59
     60                return true ;
     61        }
     62});
  • ckeditor.pack

     
    153153                                        '_source/plugins/pagebreak/plugin.js',
    154154                                        '_source/plugins/pastefromword/plugin.js',
    155155                                        '_source/plugins/pastetext/plugin.js',
     156                                        '_source/plugins/popup/plugin.js',
    156157                                        '_source/plugins/preview/plugin.js',
    157158                                        '_source/plugins/print/plugin.js',
    158159                                        '_source/plugins/removeformat/plugin.js',
    159160                                        '_source/plugins/resize/plugin.js',
    160161                                        '_source/plugins/save/plugin.js',
     162                                        '_source/plugins/filebrowser/plugin.js',
    161163                                        '_source/plugins/scayt/plugin.js',
    162164                                        '_source/plugins/smiley/plugin.js',
    163165                                        '_source/plugins/showblocks/plugin.js',
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy