includes/clientside/static/loader.js
changeset 581 5e8fd89c02ea
parent 520 4c16e87cfeae
child 582 a38876c0793c
equal deleted inserted replaced
580:41c45314ac27 581:5e8fd89c02ea
     1 // Some final stuff - loader routines, etc.
     1 // Some final stuff - loader routines, etc.
       
     2 
       
     3 var onload_complete = false;
     2 
     4 
     3 function mdgInnerLoader(e)
     5 function mdgInnerLoader(e)
     4 {
     6 {
     5   if(window.location.hash == '#comments') ajaxComments();
     7   window.onkeydown = isKeyPressed;
     6   window.onkeydown=isKeyPressed;
     8   window.onkeyup = function(e) { isKeyPressed(e); };
     7   window.onkeyup=function(e) { isKeyPressed(e); };
       
     8   Fat.fade_all();
     9   Fat.fade_all();
     9   fadeInfoBoxes();
    10   fadeInfoBoxes();
    10   //initTextareas();
       
    11   //buildSearchBoxes();
       
    12   jBoxInit();
    11   jBoxInit();
    13   if(typeof (dbx_set_key) == 'function')
    12   if(typeof (dbx_set_key) == 'function')
    14   {
    13   {
    15     dbx_set_key();
    14     dbx_set_key();
    16   }
    15   }
    17   initSliders();
    16   initSliders();
    18   runOnloadHooks(e);
    17   runOnloadHooks(e);
    19 }
    18 }
       
    19 
       
    20 // if some dumb plugin set an onload function, preserve it 
    20 var ld;
    21 var ld;
    21 if(window.onload) ld = window.onload;
    22 if ( window.onload)
    22 else ld = function() {return;};
    23 {
    23 function enano_init(e) {
    24   ld = window.onload;
       
    25 }
       
    26 else
       
    27 {
       
    28   ld = function() {return;};
       
    29 }
       
    30 
       
    31 // Enano's main init function.
       
    32 function enano_init(e)
       
    33 {
    24   if ( typeof(ld) == 'function' )
    34   if ( typeof(ld) == 'function' )
    25   {
    35   {
    26     ld(e);
    36     ld(e);
    27   }
    37   }
    28   mdgInnerLoader(e);
    38   mdgInnerLoader(e);
       
    39   
       
    40   // we're loaded; set flags to true
       
    41   onload_complete = true;
    29 }
    42 }
    30 
    43 
       
    44 // don't init the page if less than IE6
    31 if ( typeof(KILL_SWITCH) == 'boolean' && !KILL_SWITCH )
    45 if ( typeof(KILL_SWITCH) == 'boolean' && !KILL_SWITCH )
    32 {
    46 {
    33   window.onload = enano_init;
    47   window.onload = enano_init;
    34 }
    48 }
    35 
    49