Revert the changes for the konami code
This commit is contained in:
parent
80b3e291d6
commit
d6dc8c49fe
|
@ -3,7 +3,6 @@
|
|||
<head>
|
||||
<link rel="stylesheet" href="/content/css/page_style.css">
|
||||
<title>PirateBox - Share Freely!</title>
|
||||
<script src="/content/js/konami.js"></script>
|
||||
<script src="/content/js/jquery.min.js"></script>
|
||||
<script src="/content/js/scripts.js"></script>
|
||||
<link rel="stylesheet" href="/css/jquery-ui.min.css">
|
||||
|
@ -95,12 +94,6 @@
|
|||
</div>
|
||||
</section>
|
||||
|
||||
<script type="text/javascript">
|
||||
konamiCode(function () {
|
||||
window.location = 'nothing.html';
|
||||
}).start();
|
||||
</script>
|
||||
|
||||
<footer id="about">
|
||||
<div class="container">
|
||||
<div id="details">
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
* Konami Code in Javascript
|
||||
* Andreas Grech
|
||||
* http://knowledge-aholic.blogspot.com/
|
||||
* v 1.1 (20091119)
|
||||
|
||||
Keycodes for the Konami Code
|
||||
UP : 38
|
||||
DOWN : 40
|
||||
LEFT : 37
|
||||
RIGHT : 39
|
||||
B : 66
|
||||
A : 65
|
||||
*/
|
||||
|
||||
var konamiCode = function (combination, callback) {
|
||||
var lastCorrectInput = -1,
|
||||
isActive = 0,
|
||||
o = {};
|
||||
if (typeof combination === "function") {
|
||||
callback = combination;
|
||||
}
|
||||
if (Object.prototype.toString.call(combination) !== "[object Array]") {
|
||||
combination = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65];
|
||||
}
|
||||
o.start = function () {
|
||||
if (isActive) {
|
||||
return;
|
||||
}
|
||||
isActive = 1;
|
||||
document.onkeyup = function (e) {
|
||||
var code;
|
||||
if (!isActive) {
|
||||
return;
|
||||
}
|
||||
code = window.event ? window.event.keyCode : e.which;
|
||||
if (combination[++lastCorrectInput] === code) {
|
||||
if (lastCorrectInput === combination.length - 1) {
|
||||
if (callback && typeof(callback) === "function") {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
lastCorrectInput = -1;
|
||||
};
|
||||
return o;
|
||||
};
|
||||
o.stop = function () {
|
||||
isActive = 0;
|
||||
return o;
|
||||
};
|
||||
return o;
|
||||
};
|
|
@ -1,9 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<p>Goes Nowhere, Does Nothing</p>
|
||||
<p>Read more <a href="http://blog.dreasgrech.com/2009/11/konami-code-in-javascript.html">Here</a></p>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue