Changeset 1384 for trunk/plugins


Ignore:
Timestamp:
02/08/18 09:00:39 (20 months ago)
Author:
gogo
Message:

Add FancySelects? plugin to resolve #1365, along the way move jQuery and MooTools? into libraries/ improve AssetLoader? and add Xinha.loadLibrary.

The loadScript and loadStyle functions of Asset Loaders have been changed to load the given script/style only once, this was the most common situation. loadScriptAlways and loadStyleAlways have been added with which you can force one to be reloaded.

loadLibrary presently just accepts a library name, jquery or mootools and loads the latest version in the libraries folder (hard coded), eventually we may need to have some sort of version-requesting, but cross that bridge if we come to it.

Location:
trunk/plugins
Files:
68 added
2 edited

Legend:

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

    r1371 r1384  
    3535}; 
    3636 
    37 MootoolsFileManager.AssetLoader = Xinha.includeAssets(); 
    38  
    3937// In case you want to use your own version of Mootools, you can load it first. 
    40 if(typeof MooTools == 'undefined') 
    41 { 
    42   MootoolsFileManager.AssetLoader 
    43     .loadScript('MooTools-Core-1.6.0.js', 'MootoolsFileManager') 
    44     .loadScript('MooTools-More-1.6.0.js', 'MootoolsFileManager'); 
    45 } 
     38MootoolsFileManager.AssetLoader = Xinha.loadLibrary('MooTools'); 
    4639 
    4740// In case you want to use your own version of FileManager, you can load it first. 
     
    142135  if (phpcfg.files_dir)  
    143136  { 
    144     MootoolsFileManager.AssetLoader.loadScriptOnce('MootoolsFileManager.FileManager.js', 'MootoolsFileManager'); 
     137    MootoolsFileManager.AssetLoader.loadScript('MootoolsFileManager.FileManager.js', 'MootoolsFileManager'); 
    145138     
    146139    this.editor.config.registerButton({ 
     
    157150  if(phpcfg.images_dir) 
    158151  {      
    159     MootoolsFileManager.AssetLoader.loadScriptOnce('MootoolsFileManager.ImageManager.js', 'MootoolsFileManager'); 
     152    MootoolsFileManager.AssetLoader.loadScript('MootoolsFileManager.ImageManager.js', 'MootoolsFileManager'); 
    160153     
    161154    // Override our Editors insert image button action.   
  • trunk/plugins/WebKitResize/WebKitResize.js

    r1379 r1384  
    4141}; 
    4242 
    43 WebKitResize.AssetLoader = Xinha.includeAssets(); 
    44  
    4543if(Xinha.is_webkit) 
    4644{ 
    47   // In case you want to use your own version of jQuery, you can load it first 
    48   if(typeof jQuery == 'undefined') 
    49   { 
    50     // We seem to be able to use jQuery 3.3.1 with no issue which is the latest 
    51     // version at time of writing, so make that the defauilt. 
    52     WebKitResize.AssetLoader 
    53       //.loadScript('jquery-1.12.4.js', 'WebKitResize') 
    54       //.loadScript('jquery-2.2.4.js', 'WebKitResize') 
    55       .loadScript('jquery-3.3.1.js', 'WebKitResize') 
    56       .loadScript('jquery.mb.browser.min.js', 'WebKitResize'); 
    57   } 
    58  
    59   WebKitResize.AssetLoader 
    60     .loadScript('jquery.webkitresize.js', 'WebKitResize'); 
     45  Xinha.loadLibrary('jQuery') 
     46       .loadScriptOnce('jquery.mb.browser.min.js', 'WebKitResize') 
     47       .loadScriptOnce('jquery.webkitresize.js',   'WebKitResize'); 
    6148} 
    6249 
     
    6855WebKitResize.prototype.onGenerateOnce = function() 
    6956{ 
     57  // jQuery not loaded yet? 
     58  if(!(jQuery && jQuery.fn && jQuery.fn.webkitimageresize)) 
     59  { 
     60    var self = this; 
     61    window.setTimeout(function(){self.onGenerateOnce()}, 500); 
     62    return; 
     63  } 
     64   
    7065  if(Xinha.is_webkit) 
    7166  { 
     
    8176WebKitResize.prototype.onBeforeMode = function(mode) 
    8277{ 
    83   console.log("B CHANGE"); 
    8478  if(Xinha.is_webkit) 
    8579  { 
     
    10094WebKitResize.prototype.onMode = function(mode) 
    10195{ 
    102   console.log("CHANGE"); 
    10396  if(Xinha.is_webkit) 
    10497  { 
Note: See TracChangeset for help on using the changeset viewer.