JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.5.1
[ckeditor.git] / _source / plugins / filebrowser / plugin.js
index 176ce05..9af9714 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -261,8 +261,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                        if ( element.filebrowser.action == 'Browse' )\r
                        {\r
-                               var url = element.filebrowser.url || editor.config[ 'filebrowser' + ucFirst( dialogName ) + 'BrowseUrl' ]\r
-                                                       || editor.config.filebrowserBrowseUrl;\r
+                               var url = element.filebrowser.url;\r
+                               if ( url === undefined )\r
+                               {\r
+                                       url = editor.config[ 'filebrowser' + ucFirst( dialogName ) + 'BrowseUrl' ];\r
+                                       if ( url === undefined )\r
+                                               url = editor.config.filebrowserBrowseUrl;\r
+                               }\r
 \r
                                if ( url )\r
                                {\r
@@ -273,8 +278,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        }\r
                        else if ( element.filebrowser.action == 'QuickUpload' && element[ 'for' ] )\r
                        {\r
-                               url =  element.filebrowser.url || editor.config[ 'filebrowser' + ucFirst( dialogName ) + 'UploadUrl' ]\r
-                                                       || editor.config.filebrowserUploadUrl;\r
+                               url = element.filebrowser.url;\r
+                               if ( url === undefined )\r
+                               {\r
+                                       url = editor.config[ 'filebrowser' + ucFirst( dialogName ) + 'UploadUrl' ];\r
+                                       if ( url === undefined )\r
+                                               url = editor.config.filebrowserUploadUrl;\r
+                               }\r
 \r
                                if ( url )\r
                                {\r
@@ -340,7 +350,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        var ids = elementId.split( ";" );\r
                        for ( var i = 0 ; i < ids.length ; i++ )\r
                        {\r
-                               if ( isConfigured( definition, tabId, ids[i]) )\r
+                               if ( isConfigured( definition, tabId, ids[i] ) )\r
                                        return true;\r
                        }\r
                        return false;\r
@@ -378,6 +388,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                init : function( editor, pluginPath )\r
                {\r
                        editor._.filebrowserFn = CKEDITOR.tools.addFunction( setUrl, editor );\r
+                       editor.on( 'destroy', function () { CKEDITOR.tools.removeFunction( this._.filebrowserFn ); } );\r
                }\r
        } );\r
 \r