Skip to content

Instantly share code, notes, and snippets.

@bebraw
Created October 3, 2012 19:52
Show Gist options
  • Save bebraw/3829418 to your computer and use it in GitHub Desktop.
Save bebraw/3829418 to your computer and use it in GitHub Desktop.
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment