bebraw
10/3/2012 - 7:52 PM

Bugira user script (expects jQuery to be found)

Bugira user script (expects jQuery to be found)

// ==UserScript==
// @name       Bugira Script
// @namespace  http://use.i.E.your.homepage/
// @version    0.55
// @description  injects bugira script
// @match      http://jswiki.codegyre.com/*
// @copyright  2012+, You
// ==/UserScript==

// http://stackoverflow.com/questions/2246901/how-can-i-use-jquery-in-greasemonkey-scripts-in-google-chrome

// TODO: style bugira widget better. transparent bg now. doesn't look that good

function main() {
  $('<div />').attr('id', 'bugira_widget').appendTo($('body')).css({
    position: 'fixed',
    bottom: 0,
    right: 0
  });
    
  window.__bugira_config = {"api_key":""};
  (function() {var w = document.createElement('script'); w.type = 'text/javascript'; w.async = true; w.src = 'http://bugiracdn.appspot.com/bugira-widget.js';(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(w);})();
}

// Inject our main script
var script = document.createElement('script');
script.type = "text/javascript";
script.textContent = '(' + main.toString() + ')();';
document.body.appendChild(script);