Permalink
Browse files

added ender.js support

  • Loading branch information...
1 parent 94f6488 commit 6428547681460426a225284802d51f5b569c0f27 @coolaj86 coolaj86 committed Sep 30, 2011
Showing with 84 additions and 1 deletion.
  1. +2 −0 .gitignore
  2. +15 −1 { → lib}/konami.js
  3. +18 −0 lib/package.json
  4. +1 −0 test/README.md
  5. +30 −0 test/test.html
  6. +18 −0 test/test.js
View
@@ -0,0 +1,2 @@
+node_modules
+ender.*
@@ -12,6 +12,12 @@
* Tested in: Safari 4+, Google Chrome 4+, Firefox 3+, IE7+, Mobile Safari 2.2.1 and Dolphin Browser
*/
+(function (){
+ "use strict";
+
+ var global = Function('return this')();
+ // end CommonJS header
+
var Konami = function() {
var konami= {
addEvent:function ( obj, type, fn, ref_obj )
@@ -94,4 +100,12 @@ var Konami = function() {
}
}
return konami;
-}
+}
+
+ // Begin CommonJS Footer
+ if ('undefined' !== typeof module) {
+ module.exports = Konami;
+ } else {
+ global.Konami = Konami;
+ }
+}());
View
@@ -0,0 +1,18 @@
+{
+ "author": "George Mandis <george@snaptortoise.com> (http://georgemandis.com)",
+ "name": "konami",
+ "keywords": ["ender"],
+ "description": "A quick and silly script for adding the konami code easter egg to your site. Works with gestures on iPhone as well.",
+ "version": "1.3.3",
+ "homepage": "http://code.google.com/p/konami-js/",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/georgemandis/konami-js.git"
+ },
+ "main": "konami",
+ "engines": {
+ "node": "~v0.4.8"
+ },
+ "dependencies": {},
+ "devDependencies": {}
+}
View
@@ -0,0 +1 @@
+ ender build konami
View
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Konami JS</title>
+ <script src="ender.js"></script>
+ <script src="node_modules/konami/konami.js"></script>
+ <script src="test.js"></script>
+ </head>
+ <body>
+ <h1>Konami JS</h1>
+ Test Page
+
+ <h2>Keyboard</h2>
+ <p>
+ Hit the arrow keys <kbd>up, up, down, down, left, right, left, right</kbd>
+ </p>
+ <p>
+ Now hit the keys <kbd>b, a, enter</kbd>
+ </p>
+
+ <h2>Touch Gesture</h2>
+ <p>
+ Swipe your thumb (not the screen), up, up, down, down, left, right, left, right, tap, tap, tap.
+ </p>
+ <p>
+ Note: "up" means you drag your thumb from the botton to the top (the screen moves down)
+ while "left" means that you swipe from right to left (the screen moves right).
+ </p>
+ </body>
+</html>
View
@@ -0,0 +1,18 @@
+(function (){
+ "use strict";
+
+ // test that it loads locally with ender.js and globally with vanilla konami.js
+ var Konami = window.Konami && require('konami')
+ , konami = new Konami()
+ ;
+
+ konami.code = function() {
+ alert("Nice keyboarding, friend! +30 lives for you!");
+ };
+
+ konami.iphone.code = function() {
+ alert("Nice gesturing, friend! +30 lives for you and your kin!");
+ };
+
+ konami.load()
+}());

0 comments on commit 6428547

Please sign in to comment.