Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ==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
You can’t perform that action at this time.