Changeset 76819 in spip-zone


Ignore:
Timestamp:
Oct 1, 2013, 12:05:12 PM (6 years ago)
Author:
brunobergot@…
Message:

indentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _galaxie_/boussole.spip.net/squelettes/spipnav.js.html

    r76818 r76819  
    22[(#REM)<script>
    33](function() {
    4 function onload(callback){
    5         var done = false;
    6         var do_callback_once = function(){if (done) return;done = true;callback();}
    7         if (document.readyState==="complete"){return setTimeout(do_callback_once, 1 );}
    8         if (document.addEventListener){document.addEventListener( "DOMContentLoaded", do_callback_once, false );window.addEventListener( "load", do_callback_once, false );}
    9         else if ( document.attachEvent ){document.attachEvent( "onreadystatechange", do_callback_once );window.attachEvent( "onload", do_callback_once );}
    10         else setTimeout(do_callback_once, 300);
    11 };
    12 function init_widget() {
    13   // insertion du html et de la css en inline
    14   var topnav = [(#INCLURE{fond=inclure/boussole_topnav_spip}|json_encode)];
    15   topnav += '<style type="text/css">'+[(#INCLURE{css/boussole_topnav.css}|liens_absolus|json_encode)]+'</style>';
    16         var t = document.createElement('div');t.className = "spipnav";t.innerHTML = topnav;
    17   var s = document.body.firstChild;s.parentNode.insertBefore(t, s);
    18 }
    19 onload(init_widget);
     4        function onload(callback){
     5                var done = false;
     6                var do_callback_once = function(){if (done) return;done = true;callback();}
     7                if (document.readyState==="complete"){return setTimeout(do_callback_once, 1 );}
     8                if (document.addEventListener){document.addEventListener( "DOMContentLoaded", do_callback_once, false );window.addEventListener( "load", do_callback_once, false );}
     9                else if ( document.attachEvent ){document.attachEvent( "onreadystatechange", do_callback_once );window.attachEvent( "onload", do_callback_once );}
     10                else setTimeout(do_callback_once, 300);
     11        };
     12        function init_widget() {
     13                // insertion du html et de la css en inline
     14                var topnav = [(#INCLURE{fond=inclure/boussole_topnav_spip}|json_encode)];
     15                topnav += '<style type="text/css">'+[(#INCLURE{css/boussole_topnav.css}|liens_absolus|json_encode)]+'</style>';
     16                var t = document.createElement('div');t.className = "spipnav";t.innerHTML = topnav;
     17                var s = document.body.firstChild;s.parentNode.insertBefore(t, s);
     18        }
     19        onload(init_widget);
    2020})();
Note: See TracChangeset for help on using the changeset viewer.