asmblah / jemul8

An object-oriented JavaScript x86 Emulator for Node.js and the browser
http://jemul8.com
Other
132 stars 19 forks source link

removed dependency from jquery in std.keyboard.js #8

Closed coderaiser closed 11 years ago

coderaiser commented 11 years ago

Changed

$(util.global.document).[keydown, keyup, keypress]

to

util.global.document.addEventListener(['keydown','keyup', 'keypress']);
asmblah commented 11 years ago

Thanks!

asmblah commented 11 years ago

Hi Coderaiser,

Unfortunately, I've had to revert this pull - it breaks the unit tests for the keyboard plugin (you can run them via /tests/bdd/index.htm.) I could refactor/rewrite the tests to use the DOM methods, but I think it makes sense to leave it alone for the time being until the public API has been redesigned (which would mean a rethink of the current plugins system anyway.)

Thanks

coderaiser commented 11 years ago

Hi Dan,

Everything works fine, I checked this out, some of tests should be corrected little bit, I think. Byt the way, in tests object util.global.document it's empty object. In std.keyboardTest.js:

    var document,
            util;

        beforeEach(function (done) {
            document = {};

            util = {
                global: {
                    document: document
                }
            };

Thank you, anyway.