moalex
3/30/2014 - 5:53 PM

remote.let.js

/** Bookmarklet
* https://gist.github.com/moalex/9876802
* https://j.mp/P7aVXq
* javascript: (function(){ var c = document.createElement("script"); c.type = "text/javascript"; c.src = '//j.mp/P7aVXq'; document.documentElement.childNodes[0].appendChild(c) })();
**/
var let = {
  /*lib: [],
  script: function (file) {
                console.group('lib.script');
                var script      = document.createElement('script');
                    script.src  = file;
                    script.type = 'text/javascript';
                document.getElementsByTagName('head')[0].appendChild(script);
                console.dirxml(script);
                console.groupEnd();
             }*/
};
(function (e, a, g, h, f, c, b, d) {
    if (!(f = e.jQuery) || g > f.fn.jquery || h(f)) {
        c = a.createElement("script");
        c.type = "text/javascript";
        c.src = "//ajax.googleapis.com/ajax/libs/jquery/" + g + "/jquery.min.js";
        c.onload = c.onreadystatechange = function () {
            if (!b && (!(d = this.readyState) || d == "loaded" || d == "complete")) {
                h((f = e.jQuery).noConflict(1), b = 1);
                f(c
                  ).remove()
            }
        };
        a.documentElement.childNodes[0].appendChild(c)
    }
})(window, document, "1.3.2", function ($, L) {
  console.clear();
  console.group('remote.let');
  /*if (!window.jQuery) {
    let.script('//code.jquery.com/jquery-2.1.0.min.js');
  } else {
    console.log(jQuery.fn.jquery);
  }*/
  var page = {
    url: window.location.href,
    host: window.location.host,
    title: document.title
  }
  page['vid'] = false;
  if (page.vid = page.url.match(/video(\-\d+\_\d+)/i)) page.vid = page.vid[1];

  console.log(page);
  console.groupEnd();
});