Ignore:
Timestamp:
02/18/10 14:00:38 (10 years ago)
Author:
gogo
Message:

Fix for Internet Explorer with MootoolsFileManager?
Using loadScript and loadStyle is asynchronous in Internet Explorer which meant that the dependancies of MootoolsFileManager? were not being included.
Added a Xinha.includeAssets method to handle this by making it possible to synchronously load these items.

 * Example Usage:
 *
 * Xinha.includeAssets( 'foo.css', 'bar.js', [ 'foo.css', 'MyPlugin' ], { type: 'text/css', url: 'foo.php', plugin: 'MyPlugin } );
 *
 * Alternative usage, use Xinha.includeAssets() to make a loader, then use loadScript, loadStyle and whenReady methods
 * on your loader object as and when you wish, you can chain the calls if you like.
 *
 * Note whenReady can only have one active callback at a time, but once it's been called you can
 * issue another whenReady(), if there is nothing waiting to be loaded, it will be executed immediately.
 *
 *   var myAssetLoader = Xinha.includeAssets();
 *       myAssetLoader.loadScript('foo.js', 'MyPlugin')
 *                    .loadStyle('foo.css', 'MyPlugin'); 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/MootoolsFileManager/MootoolsFileManager.js

    r1241 r1243  
    3535}; 
    3636 
     37MootoolsFileManager.AssetLoader = Xinha.includeAssets(); 
     38 
    3739// In case you want to use your own version of Mootools, you can load it first. 
    3840if(typeof MooTools == 'undefined') 
    3941{ 
    40   Xinha.loadScript('mootools-filemanager/Demos/mootools-core.js', 'MootoolsFileManager'); 
    41   Xinha.loadScript('mootools-filemanager/Demos/mootools-more.js', 'MootoolsFileManager'); 
     42  MootoolsFileManager.AssetLoader 
     43    .loadScript('mootools-filemanager/Demos/mootools-core.js', 'MootoolsFileManager') 
     44    .loadScript('mootools-filemanager/Demos/mootools-more.js', 'MootoolsFileManager'); 
    4245} 
    4346 
     
    4649if(typeof FileManager == 'undefined') 
    4750{ 
    48   Xinha.loadStyle('mootools-filemanager/Css/FileManager.css', 'MootoolsFileManager'); 
    49   Xinha.loadStyle('mootools-filemanager/Css/Additions.css', 'MootoolsFileManager'); 
    50   Xinha.loadScript('mootools-filemanager/Source/FileManager.js', 'MootoolsFileManager'); 
    51   Xinha.loadScript('mootools-filemanager/Language/Language.en.js', 'MootoolsFileManager'); 
    52   Xinha.loadScript('mootools-filemanager/Source/Additions.js', 'MootoolsFileManager'); 
    53   Xinha.loadScript('mootools-filemanager/Source/Uploader/Fx.ProgressBar.js', 'MootoolsFileManager'); 
    54   Xinha.loadScript('mootools-filemanager/Source/Uploader/Swiff.Uploader.js', 'MootoolsFileManager'); 
    55   Xinha.loadScript('mootools-filemanager/Source/Uploader.js', 'MootoolsFileManager'); 
     51  MootoolsFileManager.AssetLoader 
     52    .loadStyle('mootools-filemanager/Css/FileManager.css', 'MootoolsFileManager') 
     53    .loadStyle('mootools-filemanager/Css/Additions.css', 'MootoolsFileManager') 
     54    .loadScript('mootools-filemanager/Source/FileManager.js', 'MootoolsFileManager') 
     55    .loadScript('mootools-filemanager/Language/Language.en.js', 'MootoolsFileManager') 
     56    .loadScript('mootools-filemanager/Source/Additions.js', 'MootoolsFileManager') 
     57    .loadScript('mootools-filemanager/Source/Uploader/Fx.ProgressBar.js', 'MootoolsFileManager') 
     58    .loadScript('mootools-filemanager/Source/Uploader/Swiff.Uploader.js', 'MootoolsFileManager') 
     59    .loadScript('mootools-filemanager/Source/Uploader.js', 'MootoolsFileManager'); 
    5660} 
    57 Xinha.loadStyle('MootoolsFileManager.css', 'MootoolsFileManager'); 
     61MootoolsFileManager.AssetLoader.loadStyle('MootoolsFileManager.css', 'MootoolsFileManager'); 
    5862 
    5963// Initialise the plugin for an editor instance. 
     
    290294      selectable:     true, 
    291295      uploadAuthData: this.editor.config.MootoolsFileManager.backend_data, 
    292       onComplete:     function(path, file, params) { self.ImageManagerReturn(path,file,params); } 
     296      onComplete:     function(path, file, params) { self.ImageManagerReturn(path,file,params); }, 
     297      extendedAttributes: outparam 
    293298      // @TODO : Add support to pass in the existing src, alt etc... 
    294299    });      
Note: See TracChangeset for help on using the changeset viewer.