Skip to content

Instantly share code, notes, and snippets.

@fazen
Last active April 5, 2016 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fazen/6265ffbffdfce3e4cf8b08aa5af86c6d to your computer and use it in GitHub Desktop.
Save fazen/6265ffbffdfce3e4cf8b08aa5af86c6d to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name OTRS
// @namespace otrsunict
// @include https://otrs.unict.it/otrs/index.pl*
// @version 1.2
// @grant none
// ==/UserScript==
// Anonymous "self-invoking" function
(function() {
// Load the script
//var script = document.createElement("SCRIPT");
//script.src = 'https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js';
//script.type = 'text/javascript';
//document.getElementsByTagName("head")[0].appendChild(script);
// Poll for jQuery to come into existance
var checkReady = function(callback) {
if (window.jQuery) {
callback(jQuery);
}
else {
window.setTimeout(function() { checkReady(callback); }, 100);
}
};
// Start polling...
checkReady(function($) {
$.ajax({
url:"https://gist.githubusercontent.com/fazen/642114215ff441ee508b9278c6b5a69e/raw/e71fc1dad697b3dcaad620ccef7b80f95dc85923/otrs-unict.css",
success:function(data){
$("<style></style>").appendTo("head").html(data);
}
});
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment