//IMPORTANT: please use only double quotes to delimit strings
(function(){
      lib_url = "<%= FactlinkUI::Application.config.static_url %>" + "lib";
      window.FactlinkConfig = {
        modus: "default",
        api: "<%= FactlinkUI::Application.config.api_url %>",
        lib: lib_url,
          getFacts: true
      };

      //load the library
      var script = document.createElement("script");
      var head = document.getElementsByTagName("head")[0];
      script.type = "text/javascript";
      script.async = false;
      script.src = lib_url + "/src/js/load_library.js?" + (new Date()).getTime();
      head.insertBefore(script,head.firstChild);
})();


//IMPORTANT: please use only double quotes to delimit strings
(function(){
  var xhr=new XMLHttpRequest();
  xhr.open("get","<%= abs_url '/site/count/' %>" + "?url="+escape(window.location),true);
  xhr.onload=function(){
    var resp=JSON.parse(this.responseText);
    if(resp.blacklisted!==true){
      lib_url = "<%= FactlinkUI::Application.config.static_url %>" + "lib";
      window.FactlinkConfig = {
        modus: "default",
        api: "<%= FactlinkUI::Application.config.api_url %>",
        lib: lib_url,
          getFacts: true
      };

      //load the library
      var script = document.createElement("script");
      var head = document.getElementsByTagName("head")[0];
      script.type = "text/javascript";
      script.async = false;
      script.src = lib_url + "/src/js/load_library.js?" + (new Date()).getTime();
      head.insertBefore(script,head.firstChild);
    } else {
      error();
    }
  };
  xhr.onerror=function(){
    error();
  };
  xhr.send(null);
  function error(){
    alert("The Factlink bookmarklet does not work on this page.");
  }
})();


Revert "removed blacklistcheck from bookmarklet"
Revert "removed blacklistcheck from bookmarklet"

This reverts commit f48692a5a62f7a1e09b4e1386d7fff6b7cc11107.
