Skip to content

Instantly share code, notes, and snippets.

@davertron
Last active August 29, 2015 13:56
Show Gist options
  • Save davertron/9197383 to your computer and use it in GitHub Desktop.
Save davertron/9197383 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Jenkins Threes
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description Play Threes in your browser while you wait for stupid jenkins
// @match https://builds.dealer.ddc/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @copyright 2014+, Dave Davis
// ==/UserScript==
$(function(){
var width = 800,
height = 800;
$('body').prepend('<button id="threes">PLAY THREESJS</button>');
$('#threes').on('click', function(){
$('body').prepend('<div id="threes-wrapper" style="position: absolute; top: 50%; left: 50%; margin-left: -' + width / 2 + 'px; margin-top: -' + height / 2 + 'px; z-index: 99999;"><a href="#" style="width: 20px; height: 20px; color: #3a3a3a; display: block; position: absolute; top: 8px; right: 48px; font-weight: bold; text-align: center" onclick="(function(){ $(\'threes-wrapper\').remove(); return false;})();">[x]Close</a><iframe id="threes-game" src="//threesjs.com/" width="' + width + '" height="' + height + '" scrolling="no"></iframe></div>');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment