assets/live.js
function () {

      // helper method to assert if a given url is local
      function isLocal(url) {
        var loc = document.location,
            reg = new RegExp("^\\.|^\/(?!\/)|^[\\w]((?!://).)*$|" + loc.protocol + "//" + loc.host);
        return url.match(reg);
      }

      // gather all resources
      var scripts = document.getElementsByTagName("script"),
          links = document.getElementsByTagName("link"),
          uris = [];

      // track local js urls
      for (var i = 0; i < scripts.length; i++) {
        var script = scripts[i], src = script.getAttribute("src");
        if (src && isLocal(src))
          uris.push(src);
        if (src && src.match(/\blive.js#/)) {
          for (var type in active)
            active[type] = src.match("[#,|]" + type) != null
          if (src.match("notify")) 
            alert("Live.js is loaded.");
        }
      }
      if (!active.js) uris = [];
      if (active.html) uris.push(document.location.href);

      // track local css urls
      for (var i = 0; i < links.length && active.css; i++) {
        var link = links[i], rel = link.getAttribute("rel"), href = link.getAttribute("href", 2);
        if (href && rel && rel.match(new RegExp("stylesheet", "i")) && isLocal(href)) {
          uris.push(href);
          currentLinkElements[href] = link;
        }
      }

      // initialize the resources info
      for (var i = 0; i < uris.length; i++) {
        var url = uris[i];
        Live.getHead(url, function (url, info) {
          resources[url] = info;
        });
      }

      // add rule for morphing between old and new css files
      var head = document.getElementsByTagName("head")[0],
          style = document.createElement("style"),
          rule = "transition: all .3s ease-out;"
      css = [".livejs-loading * { ", rule, " -webkit-", rule, "-moz-", rule, "-o-", rule, "}"].join('');
      style.setAttribute("type", "text/css");
      head.appendChild(style);
      style.styleSheet ? style.styleSheet.cssText = css : style.appendChild(document.createTextNode(css));

      // yep
      loaded = true;
    }
function () {

      // helper method to assert if a given url is local
      function isLocal(url) {
        var loc = document.location,
            reg = new RegExp("^\\.|^\/(?!\/)|^[\\w]((?!://).)*$|" + loc.protocol + "//" + loc.host);
        return url.match(reg);
      }

      // gather all resources
      var scripts = document.getElementsByTagName("script"),
          links = document.getElementsByTagName("link"),
          uris = [];

      // track local js urls
      for (var i = 0; i < scripts.length; i++) {
        var script = scripts[i], src = script.getAttribute("src");
        if (src && isLocal(src))
          uris.push(src);
        if (src && src.match(/\blive.js#/)) {
          for (var type in active)
            active[type] = src.match("[#,|]" + type) != null
          if (src.match("notify")) 
            alert("Live.js is loaded.");
        }
      }
      if (!active.js) uris = [];
      if (active.html) uris.push(document.location.href);

      // track local css urls
      for (var i = 0; i < links.length && active.css; i++) {
        var link = links[i], rel = link.getAttribute("rel"), href = link.getAttribute("href", 2);
        if (href && rel && rel.match(new RegExp("stylesheet", "i")) && isLocal(href)) {
          uris.push(href);
          currentLinkElements[href] = link;
        }
      }

      // initialize the resources info
      for (var i = 0; i < uris.length; i++) {
        var url = uris[i];
        Live.getHead(url, function (url, info) {
          resources[url] = info;
        });
      }

      // add rule for morphing between old and new css files
      var head = document.getElementsByTagName("head")[0],
          style = document.createElement("style"),
          rule = "transition: all .3s ease-out;"
      css = [".livejs-loading * { ", rule, " -webkit-", rule, "-moz-", rule, "-o-", rule, "}"].join('');
      style.setAttribute("type", "text/css");
      head.appendChild(style);
      style.styleSheet ? style.styleSheet.cssText = css : style.appendChild(document.createTextNode(css));

      // yep
      loaded = true;
    }
function ( ) { // helper method to assert if a given url is local
 function isLocal ( url ) { var loc = document . location , reg = new RegExp ( "^\\.|^\/(?!\/)|^[\\w]((?!://).)*$|" + loc . protocol + "//" + loc . host ) ; return url . match ( reg ) ; } // gather all resources
 var scripts = document . getElementsByTagName ( "script" ) , links = document . getElementsByTagName ( "link" ) , uris = [ ] ; // track local js urls
 for ( var i = 0 ; i < scripts . length ; i ++ ) { var script = scripts [ i ] , src = script . getAttribute ( "src" ) ; if ( src && isLocal ( src ) ) uris . push ( src ) ; if ( src && src . match ( / \blive.js# / ) ) { for ( var type in active ) active [ type ] = src . match ( "[#,|]" + type ) != null if ( src . match ( "notify" ) ) alert ( "Live.js is loaded." ) ; } } if ( ! active . js ) uris = [ ] ; if ( active . html ) uris . push ( document . location . href ) ; // track local css urls
 for ( var i = 0 ; i < links . length && active . css ; i ++ ) { var link = links [ i ] , rel = link . getAttribute ( "rel" ) , href = link . getAttribute ( "href" , 2 ) ; if ( href && rel && rel . match ( new RegExp ( "stylesheet" , "i" ) ) && isLocal ( href ) ) { uris . push ( href ) ; currentLinkElements [ href ] = link ; } } // initialize the resources info
 for ( var i = 0 ; i < uris . length ; i ++ ) { var url = uris [ i ] ; Live . getHead ( url , function ( url , info ) { resources [ url ] = info ; } ) ; } // add rule for morphing between old and new css files
 var head = document . getElementsByTagName ( "head" ) [ 0 ] , style = document . createElement ( "style" ) , rule = "transition: all .3s ease-out;" css = [ ".livejs-loading * { " , rule , " -webkit-" , rule , "-moz-" , rule , "-o-" , rule , "}" ] . join ( '' ) ; style . setAttribute ( "type" , "text/css" ) ; head . appendChild ( style ) ; style . styleSheet ? style . styleSheet . cssText = css : style . appendChild ( document . createTextNode ( css ) ) ; // yep
 loaded = true ; }
loads all local css and js resources upon first activation
loads all local css and js resources upon first activation