summaryrefslogtreecommitdiff
path: root/sitestatic/konami.min.js
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-02-09 13:19:20 -0600
committerDan McGee <dan@archlinux.org>2013-02-09 13:19:20 -0600
commitbec4e798cb2a4c585e01884f06a3c741f1f55b7d (patch)
tree48b3e09472e28e78c43a3a5ce428568e1202022c /sitestatic/konami.min.js
parentca4106a7c0f797ba06e15f777c94cddd5d82a3dc (diff)
Update Konami JS
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'sitestatic/konami.min.js')
-rw-r--r--sitestatic/konami.min.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/sitestatic/konami.min.js b/sitestatic/konami.min.js
new file mode 100644
index 00000000..f69ca4ff
--- /dev/null
+++ b/sitestatic/konami.min.js
@@ -0,0 +1,4 @@
+var Konami=function(t){var e={addEvent:function(t,e,n,i){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&(t["e"+e+n]=n,t[e+n]=function(){t["e"+e+n](window.event,i)},t.attachEvent("on"+e,t[e+n]))},input:"",pattern:"3838404037393739666513",load:function(t){this.addEvent(document,"keydown",function(n,i){return i&&(e=i),e.input+=n?n.keyCode:event.keyCode,e.input.length>e.pattern.length&&(e.input=e.input.substr(e.input.length-e.pattern.length)),e.input==e.pattern?(e.code(t),e.input="",void 0):void 0},this),this.iphone.load(t)},code:function(t){window.location=t},iphone:{start_x:0,start_y:0,stop_x:0,stop_y:0,tap:!1,capture:!1,orig_keys:"",keys:["UP","UP","DOWN","DOWN","LEFT","RIGHT","LEFT","RIGHT","TAP","TAP","TAP"],code:function(t){e.code(t)},load:function(t){this.orig_keys=this.keys,e.addEvent(document,"touchmove",function(t){if(1==t.touches.length&&e.iphone.capture===!0){var n=t.touches[0]
+ e.iphone.stop_x=n.pageX,e.iphone.stop_y=n.pageY,e.iphone.tap=!1,e.iphone.capture=!1,e.iphone.check_direction()}}),e.addEvent(document,"touchend",function(){e.iphone.tap===!0&&e.iphone.check_direction(t)},!1),e.addEvent(document,"touchstart",function(t){e.iphone.start_x=t.changedTouches[0].pageX,e.iphone.start_y=t.changedTouches[0].pageY,e.iphone.tap=!0,e.iphone.capture=!0})},check_direction:function(t){var e=Math.abs(this.start_x-this.stop_x),n=Math.abs(this.start_y-this.stop_y),i=0>this.start_x-this.stop_x?"RIGHT":"LEFT",o=0>this.start_y-this.stop_y?"DOWN":"UP",s=e>n?i:o
+ s=this.tap===!0?"TAP":s,s==this.keys[0]&&(this.keys=this.keys.slice(1,this.keys.length)),0==this.keys.length&&(this.keys=this.orig_keys,this.code(t))}}}
+return"string"==typeof t&&e.load(t),"function"==typeof t&&(e.code=t,e.load()),e}