Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

Commit f5e579a

Browse files
Merge pull request #717 from tlstyer/master
Make Konami Code example work as expected
2 parents 11412ce + 6ddf45d commit f5e579a

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

examples/konamicode/konamicode.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ <h1 id="result"></h1>
2525
</div>
2626
</div>
2727
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.2.min.js"></script>
28-
<script src="../../rx.js"></script>
29-
<script src="../../rx.aggregates.js"></script>
30-
<script src="../../rx.binding.js"></script>
28+
<script src="../../dist/rx.js"></script>
29+
<script src="../../dist/rx.aggregates.js"></script>
30+
<script src="../../dist/rx.binding.js"></script>
3131
<script src="http://cdnjs.cloudflare.com/ajax/libs/rxjs-jquery/1.1.3/rx.jquery.js"></script>
3232
<script src="konamicode.js"></script>
3333
</body>

examples/konamicode/konamicode.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ $(function () {
1616

1717
$(document).keyupAsObservable()
1818
.map(function (e) { return e.keyCode; }) // get the key code
19-
.windowWithCount(10, 10) // get the last 10 keys
20-
.selectMany(function (x) { // compare to known konmai code sequence
19+
.windowWithCount(10, 1) // get the last 10 keys
20+
.selectMany(function (x) { // compare to known konami code sequence
2121
return x.sequenceEqual(konami);
2222
})
2323
.filter(function (equal) { return equal; }) // where we match
2424
.subscribe(function () {
25-
result.html('KONAMI!').fadeOut(2000); // print the result
25+
result.html('KONAMI!').show().fadeOut(2000); // print the result
2626
});
2727
});

0 commit comments

Comments
 (0)