includes/clientside/static/enano-lib-basic.js
changeset 588 20484deb89cd
parent 586 234ddd896555
child 589 88d4ed0a2898
equal deleted inserted replaced
587:705ed7162315 588:20484deb89cd
    18 if ( typeof(title) != 'string')
    18 if ( typeof(title) != 'string')
    19 {
    19 {
    20   alert('There was a problem loading the PHP-generated Javascript variables that control parameters for AJAX applets. Most on-page functionality will be very badly broken.\n\nTheme developers, ensure that you are using {JS_DYNAMIC_VARS} *before* you include jsres.php.');
    20   alert('There was a problem loading the PHP-generated Javascript variables that control parameters for AJAX applets. Most on-page functionality will be very badly broken.\n\nTheme developers, ensure that you are using {JS_DYNAMIC_VARS} *before* you include jsres.php.');
    21 }
    21 }
    22 
    22 
       
    23 // placeholder for window.console - used if firebug isn't present
       
    24 // http://getfirebug.com/firebug/firebugx.js
       
    25 if (!window.console || !console.firebug)
       
    26 {
       
    27     var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
       
    28     "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
       
    29 
       
    30     window.console = {};
       
    31     for (var i = 0; i < names.length; ++i)
       
    32         window.console[names[i]] = function() {}
       
    33 }
       
    34 
       
    35 console.info('Enano::JS runtime: starting system init');
       
    36 
    23 if ( typeof(ENANO_JSRES_COMPRESSED) == undefined )
    37 if ( typeof(ENANO_JSRES_COMPRESSED) == undefined )
    24 {
    38 {
    25   var ENANO_JSRES_COMPRESSED = false;
    39   var ENANO_JSRES_COMPRESSED = false;
    26 }
    40 }
    27 
    41 
    66   {
    80   {
    67     KILL_SWITCH = true;
    81     KILL_SWITCH = true;
    68   }
    82   }
    69 }
    83 }
    70 
    84 
    71 // dummy tinyMCE object
    85 var tinymce_initted = false;
    72 var tinyMCE = new Object();
       
    73 
    86 
    74 if ( typeof(DISABLE_MCE) == undefined )
    87 if ( typeof(DISABLE_MCE) == undefined )
    75 {
    88 {
    76   var DISABLE_MCE = false;
    89   var DISABLE_MCE = false;
    77 }
    90 }
   261 }
   274 }
   262 
   275 
   263 function load_hide_win()
   276 function load_hide_win()
   264 {
   277 {
   265   var ld = document.getElementById('_js_load_component');
   278   var ld = document.getElementById('_js_load_component');
       
   279   if ( !ld )
       
   280     return false;
   266   ld.parentNode.removeChild(ld);
   281   ld.parentNode.removeChild(ld);
   267 }
   282 }
   268 
   283 
   269 // evaluate a snippet of code in the global context, used for dynamic component loading
   284 // evaluate a snippet of code in the global context, used for dynamic component loading
   270 // from: http://dean.edwards.name/weblog/2006/11/sandbox/
   285 // from: http://dean.edwards.name/weblog/2006/11/sandbox/
   328   return true;
   343   return true;
   329 }
   344 }
   330 
   345 
   331 var head = document.getElementsByTagName('head')[0];
   346 var head = document.getElementsByTagName('head')[0];
   332 
   347 
   333 // placeholder for window.console - used if firebug isn't present
       
   334 // http://getfirebug.com/firebug/firebugx.js
       
   335 if (!window.console || !console.firebug)
       
   336 {
       
   337     var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
       
   338     "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
       
   339 
       
   340     window.console = {};
       
   341     for (var i = 0; i < names.length; ++i)
       
   342         window.console[names[i]] = function() {}
       
   343 }
       
   344 
       
   345 // safari has window.console but not the .debug() method
   348 // safari has window.console but not the .debug() method
   346 if ( is_Safari && !window.console.debug )
   349 if ( is_Safari && !window.console.debug )
   347 {
   350 {
   348   window.console.debug = function() {};
   351   window.console.debug = function() {};
   349 }
   352 }
   357   'dynano.js',
   360   'dynano.js',
   358   'functions.js',
   361   'functions.js',
   359   'dropdown.js',
   362   'dropdown.js',
   360   'json.js',
   363   'json.js',
   361   'sliders.js',
   364   'sliders.js',
       
   365   'tinymce-init.js',
   362   'loader.js'
   366   'loader.js'
   363 ];
   367 ];
   364 
   368 
   365 for(var f in thefiles)
   369 for(var f in thefiles)
   366 {
   370 {