From 553bfa1e8d2d9ac3a7ac202065e7adea1fe3142d Mon Sep 17 00:00:00 2001 From: clsr Date: Fri, 11 Nov 2016 17:35:39 +0100 Subject: Initial commit; forked from installgen2/Flup --- static/script.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 static/script.js (limited to 'static/script.js') diff --git a/static/script.js b/static/script.js new file mode 100644 index 0000000..ee3260d --- /dev/null +++ b/static/script.js @@ -0,0 +1,38 @@ +function loadImage(url, callback) { + var img = new Image(); + img.src = url; + + img.onload = callback; +} + +(function() { + var animeGrill = document.getElementById("anime"); + var animeEngineTimer = null; + + animeGrill.onmouseover = function() { + animeEngineTimer = setTimeout(function() { + loadImage("/static/animeengine.png", function() { + animeGrill.src = "/static/animeengine.png"; + }); + }, 5000); + } + + animeGrill.onmouseout = function() { + clearTimeout(animeEngineTimer); + } +})(); + +function uploadPage() { + (function() { + Array.prototype.forEach.call(document.querySelectorAll(".upload"), (upload) => { + var url = upload.querySelector("a").innerHTML; + + upload.innerHTML += ' -- Copy to clipboard'; + }); + })(); + + (function() { + var btns = document.querySelectorAll(".clipboard-copy"); + new Clipboard(btns); + })(); +} -- cgit