Ticket #3673: 3673.patch

File 3673.patch, 25.1 KB (added by Wiktor Walc, 15 years ago)
  • _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,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

     
    542542                panelTitle3 : 'Object Styles'
    543543        },
    544544
     545        filebrowser :
     546        {
     547                errors :
     548                {
     549                        10 : 'Invalid command.',
     550                        11 : 'The resource type was not specified in the request.',
     551                        12 : 'The requested resource type is not valid.',
     552                        102 : 'Invalid file or folder name.',
     553                        103 : 'It was not possible to complete the request due to authorization restrictions.',
     554                        104 : 'It was not possible to complete the request due to file system permission restrictions.',
     555                        105 : 'Invalid file extension.',
     556                        109 : 'Invalid request.',
     557                        110 : 'Unknown error.',
     558                        115 : 'A file or folder with the same name already exists.',
     559                        116 : 'Folder not found. Please refresh and try again.',
     560                        117 : 'File not found. Please refresh the files list and try again.',
     561                        201 : 'A file with the same name is already available. The uploaded file has been renamed to "%filename"',
     562                        202 : 'Invalid file',
     563                        203 : 'Invalid file. The file size is too big.',
     564                        204 : 'The uploaded file is corrupt.',
     565                        205 : 'No temporary folder is available for upload in the server.',
     566                        206 : 'Upload cancelled for security reasons. The file contains HTML like data.',
     567                        500 : 'The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file.',
     568                        501 : 'The thumbnails support is disabled.'     
     569                },
     570                errorUnknown : 'Unknown error: %1',
     571                browserNotConfigured : 'Unable to open file browser due to missing configuration settings',
     572                uploaderNotConfigured : 'Unable to upload file due to missing configuration settings',
     573        },
     574       
    545575        format :
    546576        {
    547577                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.
     
    21752186                },
    21762187
    21772188                /**
     2189                 * Gets the name of the parent tab of this element.
     2190                 * @returns {String} The name of selected tab.
     2191                 * @example
     2192                 * focus : function()
     2193                 * {
     2194                 *              this.getParentTab();
     2195                 *              // do something else.
     2196                 * }
     2197                 */
     2198                getParentTab : function()
     2199                {
     2200                        var element = this.getInputElement(),
     2201                                cursor = element,
     2202                                tabId;
     2203                        while ( ( cursor = cursor.getParent() ) && cursor.$.className.search( 'cke_dialog_page_contents' ) == -1 )
     2204                        { /*jsl:pass*/ }
     2205
     2206                        tabId = cursor.getAttribute( 'name' );
     2207
     2208                        return tabId;
     2209                },
     2210
     2211                /**
    21782212                 * Puts the focus to the UI object. Switches tabs if the UI object isn't in the active tab page.
    21792213                 * @returns {CKEDITOR.dialog.uiElement} The current UI element.
    21802214                 * @example
  • _source/plugins/dialogui/plugin.js

     
    653653                                        this.validate = elementDefinition.validate;
    654654
    655655                                var myDefinition = CKEDITOR.tools.extend( {}, elementDefinition );
     656                                var onClick = myDefinition.onClick;
    656657                                myDefinition.className = ( myDefinition.className ? myDefinition.className + ' ' : '' ) + 'cke_dialog_ui_button';
    657658                                myDefinition.onClick = function( evt )
    658659                                {
    659660                                        var target = elementDefinition[ 'for' ];                // [ pageId, elementId ]
    660                                         dialog.getContentElement( target[0], target[1] ).submit();
    661                                         this.disable();
     661                                        if ( !onClick || onClick.call( this, evt ) !== false )
     662                                        {
     663                                                dialog.getContentElement( target[0], target[1] ).submit();
     664                                                this.disable();
     665                                        }
    662666                                };
    663667
    664668                                dialog.on( 'load', function()
     
    11961200                                },
    11971201
    11981202                                /**
     1203                                 * Get the action assigned to the form.
     1204                                 * @returns {String} The value of the action.
     1205                                 * @example
     1206                                 */
     1207                                getAction : function( action )
     1208                                {
     1209                                        return this.getInputElement().getParent().$.action;
     1210                                },
     1211
     1212                                /**
    11991213                                 * Redraws the file input and resets the file path in the file input.
    12001214                                 * The redraw logic is necessary because non-IE browsers tend to clear
    12011215                                 * the <iframe> containing the file input after closing the dialog.
    12021216                                 * @example
    12031217                                 */
    1204                                 reset : function()
     1218                                reset : function( action )
    12051219                                {
    12061220                                        var frameElement = CKEDITOR.document.getById( this._.frameId ),
    12071221                                                frameDocument = frameElement.getFrameDocument(),
     
    12181232
    12191233                                                frameDocument.$.write( [ '<html><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">',
    12201234                                                                '<form enctype="multipart/form-data" method="POST" action="',
    1221                                                                 CKEDITOR.tools.htmlEncode( elementDefinition.action ),
     1235                                                                CKEDITOR.tools.htmlEncode( action || elementDefinition.action ),
    12221236                                                                '">',
    12231237                                                                '<input type="file" name="',
    12241238                                                                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 browsing.
     8 *
     9 * File Browser attaches itself automatically to elements with id: 'browse' and 'uploadButton'.
     10 * When file is selected inside of file browser or uploaded, its url is inserted automatically to
     11 * a field with id 'txtUrl'.
     12 *
     13 * Example 1: (Browse)
     14 *      {
     15 *              type : 'button',
     16 *              id : 'browse',
     17 *              label : editor.lang.common.browseServer
     18 *      }
     19 * Because of the special id: 'browse' given to this button, file browser will be opened after pressing it.
     20 *
     21 * Example 2: (Quick Upload)
     22 *      {
     23 *              type : 'fileButton',
     24 *              id : 'uploadButton',
     25 *              label : editor.lang.common.uploadSubmit,
     26 *              'for' : [ 'upload', 'upload' ]
     27 *      }
     28 * Because of the special id: 'uploadButton' given to this button, file browser will handle the file upload.
     29 *
     30 *
     31 * It is possible to attach filebrowser to any element inside of a plugin, regardless of assigned id.
     32 * Two actions are supported: 'Browse' and 'QuickUpload'. 
     33 *
     34 * Example 3: (Quick Upload)
     35 *  {
     36 *      type : 'fileButton',
     37 *      label : editor.lang.common.uploadSubmit,
     38 *      id : 'buttonId',
     39 *      filebrowser :
     40 *      {
     41 *              action : 'QuickUpload', //required
     42 *              updateOnUpload : ['tab1', 'someTextFieldId'], //required
     43 *              params : { type : 'Files', currentFolder : '/folder/' }, //optional
     44 *              onUpload : function( error, fileUrl ) //optional
     45 *              {
     46 *                      // Do not call the built-in onUpload command
     47 *                      // return false;
     48 *              }
     49 *      },
     50 *      'for' : ['tab1', 'myFile']
     51 *      }
     52 *
     53 * Suppose we have a file element with id 'myFile', text field with id 'someTextFieldId' and a fileButton.
     54 * If filebowser.url is not specified explicitly, form action will be set to 'filebrowser_upload_url',
     55 * additional parameters from 'params' object will be added to the query string.
     56 * File uploader expects to receive error message/number from the server connector and fileUrl.
     57 * It is possible to create your own uploadHandler and call the built-in onUpload command.
     58 *
     59 * Example 4: (Browse)
     60 *      {
     61 *              type : 'button',
     62 *              id : 'buttonId',
     63 *              label : editor.lang.common.browseServer,
     64 *              filebrowser :
     65 *              {
     66 *                      action : 'Browse',
     67 *                      url : '/ckfinder/ckfinder.html?action=js&func=SetUrl&thumbFunc=SetUrl&type=Images',
     68 *                      updateOnSelect : ['tab1', 'textFieldId']
     69 *              }
     70 *      }
     71 * 
     72 *  In this example, after pressing a button, file browser will be opened in a popup.
     73 *  If we don't specify filebrowser.url attribute, 'filebrowser_browse_url' setting will be used.
     74 *  After selecting a file in a file browser, an element with id 'textFieldId' will be updated.
     75 */
     76CKEDITOR.plugins.add( 'filebrowser',
     77{
     78        /**
     79         * Reference to the last opened dialog. Required by 'selectFunction' and 'uploadCompletedFunction'.
     80         * @type {CKEDITOR.dialog}
     81         */
     82        _dialog : null,
     83        /**
     84         * The "action" attribute that will be passed to the {@see CKEDITOR.ui.dialog.file#reset} function.
     85         * The "action" attribute is generated automatically in some cases.
     86         * @type String
     87         */
     88        _formAction : null,
     89        /**
     90         * Holds the reference to the file input element to reset after file is uploaded.
     91         * Syntax: [ pageId, elementId ]
     92         * @type Array
     93         */
     94        _targetInput : null,
     95        /**
     96         * Holds the reference to the UI element that will be updated when file is selected/uploaded.
     97         * Syntax: [ pageId, elementId ]
     98         * @type Array
     99         */
     100        _targetElement : null,
     101        /**
     102         * The user defined function (if defined) that will be called when file is uploaded.
     103         * @type Function
     104         */
     105        _onUpload : null,
     106       
     107        init : function( editor, pluginPath )
     108        {
     109                /**
     110                 * Updates the target element with the url of uploaded/selected file.
     111                 * @param {String} url The url of a file.
     112                 */
     113                var updateTargetElement = function( url )
     114                {
     115                        url = url.replace( /#/g, '%23' );
     116                        var plugin = editor.plugins.filebrowser;
     117
     118                        // If there is a reference to targetElement, update it.
     119                        if ( plugin._targetElement )
     120                        {
     121                                var element = plugin._dialog.getContentElement( plugin._targetElement[0], plugin._targetElement[1] );
     122                                if ( element )
     123                                        element.setValue( url );
     124                        }
     125                        // If targetElement is empty, find the first element with id 'txtUrl' and update it.
     126                        else
     127                        {
     128                                var widgetFound = false;
     129                                plugin._dialog.foreach( function( widget )
     130                                                {
     131                                                        if ( !widgetFound && widget.id == 'txtUrl' )
     132                                                        {
     133                                                                widget.setValue( url );
     134                                                                widget.getDialog().selectPage( widget.getParentTab() );
     135                                                                widgetFound = true;
     136                                                        }
     137                                                });
     138                        }
     139                };
     140
     141                /**
     142                 * Opens Browser in a popup. The "width" and "height" parameters accept
     143                 * numbers (pixels) or percent (of screen size) values.
     144                 * @param {String} url The url of the external file browser.
     145                 * @param {String} width Popup window width.
     146                 * @param {String} height Popup window height.
     147                 */
     148                var popup = function( url, width, height )
     149                {
     150                        width = width || '80%';
     151                        height = height || '70%';
     152
     153                        if ( typeof width == 'string' && width.length > 1 && width.substr( width.length - 1, 1 ) == '%' )
     154                                width = parseInt( window.screen.width * parseInt( width, 10 ) / 100, 10 );
     155
     156                        if ( typeof height == 'string' && height.length > 1 && height.substr( height.length - 1, 1 ) == '%' )
     157                                height = parseInt( window.screen.height * parseInt( height, 10 ) / 100, 10 );
     158
     159                        if ( width < 640 )
     160                                width = 640;
     161
     162                        if ( height < 420 )
     163                                height = 420;
     164
     165                        var top = parseInt( ( window.screen.height - height ) / 2, 10 ),
     166                                left = parseInt( ( window.screen.width  - width ) / 2, 10 ),
     167                                options = 'location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes' +
     168                                ',width='  + width +
     169                                ',height=' + height +
     170                                ',top='  + top +
     171                                ',left=' + left;
     172
     173                        var popupWindow = window.open( '', null, options, true );
     174
     175                        // Blocked by a popup blocker.
     176                        if ( !popupWindow )
     177                                return false;
     178
     179                        try
     180                        {
     181                                popupWindow.moveTo( left, top );
     182                                popupWindow.resizeTo( width, height );
     183                                popupWindow.focus();
     184                                popupWindow.location.href = url;
     185                        }
     186                        catch (e)
     187                        {
     188                                popupWindow = window.open( url, null, options, true );
     189                        }
     190
     191                        return true ;
     192                };
     193
     194                /**
     195                 * The onlick function assigned to the 'Browse Server' button.
     196                 * Opens the file browser and updates target field when file is selected.
     197                 * @param {CKEDITOR.event} evt The event object.
     198                 */
     199                var browseServer = function( evt )
     200                {
     201                        var dialog = this.getDialog();
     202                        var editor = dialog.getParentEditor();
     203                        var plugin = editor.plugins.filebrowser;
     204                        var params = this.filebrowser.params || {};
     205                        var url;
     206
     207                        // Save references to fields required by the 'selectFunction'.
     208                        plugin._dialog = dialog;
     209
     210                        if ( this.filebrowser.updateOnSelect )
     211                        {
     212                                plugin._targetElement = this.filebrowser.updateOnSelect;
     213                        }
     214                        else
     215                        {
     216                                var parentTab = this.getParentTab();
     217                                if ( dialog.getContentElement( parentTab, 'txtUrl' ) )
     218                                        plugin._targetElement = [ parentTab, 'txtUrl' ];
     219                                else
     220                                        plugin._targetElement = null;
     221                        }
     222
     223                        // Function that is called when the user selects a file in external file browser.
     224                        var selectFunction = this.filebrowser.selectFunction || 'SetUrl';
     225
     226                        this.getElement().getWindow().$[selectFunction] = function( fileUrl, data )
     227                        {
     228                                updateTargetElement( fileUrl );
     229                        };
     230
     231                        var width = editor.config['filebrowser_' + dialog.getName() + '_window_width'] || editor.config.filebrowser_window_width;
     232                        var height = editor.config['filebrowser_' + dialog.getName() + '_window_height'] || editor.config.filebrowser_window_height;
     233
     234                        if ( this.filebrowser.url )
     235                                url = this.filebrowser.url;
     236                        else
     237                                url = editor.config['filebrowser_' + dialog.getName() + '_browse_url'] || editor.config.filebrowser_browse_url;
     238
     239                        if ( !url )
     240                        {
     241                                alert( editor.lang.filebrowser.browserNotConfigured );
     242                                return;
     243                        }
     244
     245                        if ( !params.langCode )
     246                                params.langCode = editor.langCode;
     247
     248                        url = addQueryString( url, params );
     249
     250                        popup( url, width, height );
     251                };
     252
     253                /**
     254                 * The onlick function assigned to the 'Upload' button.
     255                 * Makes the final decision whether form is really submitted and updates target field when file is uploaded.
     256                 * @param {CKEDITOR.event} evt The event object.
     257                 */
     258                var uploadFile = function( evt )
     259                {
     260                        var dialog = this.getDialog();
     261                        var editor = dialog.getParentEditor();
     262                        var plugin = editor.plugins.filebrowser;
     263
     264                        // Update variables that will be used by the 'OnUploadCompleted' function.
     265                        plugin._onUpload = this.filebrowser.onUpload;
     266                        plugin._dialog = dialog;
     267                        plugin._targetInput = this['for'];
     268                        plugin._formAction = dialog.getContentElement( this['for'][0], this['for'][1] ).getAction();
     269
     270                        // If user didn't select the file, stop the upload.
     271                        if ( !dialog.getContentElement( this['for'][0], this['for'][1] ).getInputElement().$.value )
     272                        {
     273                                alert( editor.lang.filebrowser.fileNotSelected );
     274                                return;
     275                        }
     276
     277                        if ( !plugin._formAction )
     278                        {
     279                                alert( editor.lang.filebrowser.uploaderNotConfigured );
     280                                return;
     281                        }
     282                       
     283                        // targetElement will be updated with the url of uploaded file.
     284                        if ( this.filebrowser.updateOnUpload )
     285                                plugin._targetElement = this.filebrowser.updateOnUpload;
     286                        else
     287                        {
     288                                var parentTab = this.getParentTab();
     289                                if ( dialog.getContentElement( parentTab, 'url' ) )
     290                                        plugin._targetElement = [ parentTab, 'url' ];
     291                                else
     292                                        plugin._targetElement = null;
     293                        }
     294
     295                        // Function to be called by the server connector after file is uploaded.
     296                        var uploadCompletedFunction = this.filebrowser.uploadCompletedFunction || 'OnUploadCompleted';
     297
     298                        this.getElement().getWindow().$[uploadCompletedFunction] = function( errorMessage, fileUrl )
     299                        {
     300                                var errorNumberRegex = /^[0-9]+$/;     
     301
     302                                plugin._dialog.getContentElement( plugin._targetInput[0], plugin._targetInput[1] ).reset( plugin._formAction );
     303
     304                                if ( plugin._onUpload && plugin._onUpload( errorMessage, fileUrl ) === false )
     305                                        return;
     306                               
     307                                if ( errorMessage )
     308                                {
     309                                        if ( errorNumberRegex.test( errorMessage ) )
     310                                        {
     311                                                if ( editor.lang.filebrowser.errors[errorMessage] )
     312                                                {
     313                                                        var fileName = fileUrl.replace( /^.*[\/\\]/g, '' );
     314                                                        alert( editor.lang.filebrowser.errors[errorMessage].replace( '%filename', fileName ) );
     315                                                }
     316                                                else
     317                                                        alert( editor.lang.filebrowser.errorUnknown.replace( /%1/, errorMessage ) );
     318                                        }
     319                                        else
     320                                                alert( errorMessage );
     321                                }
     322                               
     323                                if ( fileUrl )
     324                                        updateTargetElement( fileUrl );
     325                        };
     326                };
     327
     328                /**
     329                 * Adds (additional) arguments to given url.
     330                 * @param {String} url The url.
     331                 * @param {Object} params Additional parameters.
     332                 */     
     333                var addQueryString = function( url, params )
     334                {
     335                        var queryString = [];
     336
     337                        if ( !params )
     338                                return url;
     339                        else
     340                        {
     341                                for ( var i in params )
     342                                        queryString.push( i + "=" + encodeURIComponent( params[i] ) );
     343                        }
     344
     345                        return url + ( ( url.indexOf( "?" ) != -1 ) ? "&" : "?" ) + queryString.join( "&" );
     346                };
     347
     348                /**
     349                 * Setups the file element.
     350                 * @param {CKEDITOR.ui.dialog.file} fileInput The file element used during file upload.
     351                 * @param {Object} filebrowser Object containing filebrowser settings assigned to the fileButton
     352                 * associated with this file element.
     353                 */
     354                var setupFileElement = function( dialogName, fileInput, filebrowser )
     355                {
     356                        var params = filebrowser.params || {};
     357                        var url;
     358
     359                        if ( !params.langCode )
     360                                params.langCode = editor.langCode;
     361
     362                        if ( filebrowser.url )
     363                                url = filebrowser.url;
     364                        else
     365                                url = editor.config['filebrowser_' + dialogName + '_upload_url'] || editor.config.filebrowser_upload_url;
     366
     367                        if ( url )
     368                                fileInput.action = addQueryString( url, params );
     369                        else
     370                                fileInput.action = '';
     371
     372                        fileInput.filebrowser = filebrowser;
     373                };
     374
     375                /**
     376                 * Traverse through the content definition and attach filebrowser
     377                 * to elements with 'filebrowser' attribute.
     378                 * @param {CKEDITOR.dialog.dialogDefinitionObject} definition
     379                 * @param {Array} elements Array of {@link CKEDITOR.dialog.contentDefinition} objects.
     380                 */
     381                var attachFileBrowser = function( dialogName, definition, elements )
     382                {
     383                        var element, fileInput;
     384
     385                        for ( var i in elements )
     386                        {
     387                                element = elements[i];
     388
     389                                if ( element.type == 'hbox' || element.type == 'vbox' )
     390                                        attachFileBrowser( dialogName, definition, element.children );
     391
     392                                if ( !element.filebrowser )
     393                                        continue;
     394
     395                                if ( element.filebrowser.action == 'Browse' )
     396                                {
     397                                        element.onClick = browseServer;
     398                                }
     399                                else if ( element.filebrowser.action == 'QuickUpload' && element['for'] )
     400                                {
     401                                        setupFileElement( dialogName, definition.getContents( element['for'][0] ).get( element['for'][1] ), element.filebrowser );
     402                                        element.onClick = uploadFile;
     403                                }
     404                        }
     405                };
     406
     407                CKEDITOR.on( 'dialogDefinition', function( evt )
     408                                {
     409                                        var i, browseButton, fileButton;
     410
     411                                        // Attach 'filebrowser' attributes to elements with special id.
     412                                        for ( i in evt.data.definition.contents )
     413                                        {
     414                                                browseButton = evt.data.definition.contents[i].get( 'browse' );
     415                                                if ( browseButton )
     416                                                        browseButton.filebrowser = { action : 'Browse', params : {} };
     417
     418                                                fileButton = evt.data.definition.contents[i].get( 'uploadButton' );
     419                                                if ( fileButton && evt.data.definition.getContents( fileButton['for'][0] ).get( fileButton['for'][1] ).action == 'filebrowser' )
     420                                                        fileButton.filebrowser = { action : 'QuickUpload', params : {} };
     421                                        }
     422
     423                                        // Associate filebrowser to elements with 'filebrowser' attribute.
     424                                        for ( i in evt.data.definition.contents )
     425                                                attachFileBrowser( evt.data.name, evt.data.definition, evt.data.definition.contents[i].elements );
     426                                });
     427        }
     428} );
     429
     430CKEDITOR.tools.extend( CKEDITOR.config, {
     431        /**
     432         * File Browser window width.
     433         * @type String
     434         */
     435        filebrowser_window_width : '80%',
     436        /**
     437         * File Browser window height.
     438         * @type String
     439         */
     440        filebrowser_window_height : '70%',
     441        /**
     442         * Default File Browser url.
     443         * @type String
     444         */
     445        filebrowser_browse_url : '',
     446        /**
     447         * File Browser url (Image dialog).
     448         * @type String
     449         */
     450        filebrowser_image_browse_url : '',
     451        /**
     452         * File Browser url (Flash dialog).
     453         * @type String
     454         */
     455        filebrowser_flash_browse_url : '',
     456        /**
     457         * Default upload action.
     458         * @type String
     459         */
     460        filebrowser_upload_url : '',
     461        /**
     462         * Upload action (Image dialog).
     463         * @type String
     464         */
     465        filebrowser_image_upload_url : '',
     466        /**
     467         * Upload action (Flash dialog).
     468         * @type String
     469         */
     470        filebrowser_flash_upload_url : ''
     471} );
  • _source/plugins/flash/dialogs/flash.js

     
    313313                                                                        children :
    314314                                                                        [
    315315                                                                                {
    316                                                                                         id : 'src',
     316                                                                                        id : 'txtUrl',
    317317                                                                                        type : 'text',
    318318                                                                                        label : '',
    319319                                                                                        validate : CKEDITOR.dialog.validate.notEmpty( editor.lang.flash.validateSrc ),
  • _source/plugins/flash/plugin.js

     
    143143CKEDITOR.tools.extend( CKEDITOR.config,
    144144{
    145145        flashUploadTab : true,
    146         flashUploadAction : 'nowhere.php',
     146        flashUploadAction : 'filebrowser',
    147147        flashBrowseServer : true,
    148148
    149149        /**
  • _source/plugins/image/plugin.js

     
    6565 * Upload action attribute.
    6666 * @type URL
    6767 */
    68 CKEDITOR.config.image_uploadAction = 'nowhere.php';
     68CKEDITOR.config.image_uploadAction = 'filebrowser';
    6969
    7070CKEDITOR.config.image_removeLinkByEmptyURL = true;
  • _source/plugins/link/dialogs/link.js

     
    313313                                                                        },
    314314                                                                        {
    315315                                                                                type : 'text',
    316                                                                                 id : 'url',
     316                                                                                id : 'txtUrl',
    317317                                                                                label : editor.lang.common.url,
    318318                                                                                onLoad : function ()
    319319                                                                                {
     
    10391039                                case 'url':
    10401040                                        var protocol = ( data.url && data.url.protocol != undefined ) ? data.url.protocol : 'http://',
    10411041                                                url = ( data.url && data.url.url ) || '';
    1042                                         attributes._cke_saved_href = protocol + url;
     1042                                        attributes._cke_saved_href = ( url.indexOf( '/' ) === 0 ) ? url : protocol + url;
    10431043                                        break;
    10441044                                case 'anchor':
    10451045                                        var name = ( data.anchor && data.anchor.name ),
  • _source/plugins/link/plugin.js

     
    185185{
    186186        linkUploadTab : true,
    187187        linkBrowseServer : true,
    188         linkUploadAction : 'nowhere.php',
     188        linkUploadAction : 'filebrowser',
    189189        linkShowAdvancedTab : true,
    190190        linkShowTargetTab : true
    191191} );
  • ckeditor.pack

     
    155155                                        '_source/plugins/print/plugin.js',
    156156                                        '_source/plugins/removeformat/plugin.js',
    157157                                        '_source/plugins/save/plugin.js',
     158                                        '_source/plugins/filebrowser/plugin.js',
    158159                                        '_source/plugins/smiley/plugin.js',
    159160                                        '_source/plugins/showblocks/plugin.js',
    160161                                        '_source/plugins/sourcearea/plugin.js',
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy