jivid/akobi — pull request #53 by jivid (2014-06-10 16:33:24+00:00)
Title: JS enhancements

Made quite a few updates to our current JS code

- Instead of using a string of an empty JSON object, just don't add data and it will be auto-filled with an empty JSON object
- Checking for valid JSON uses jQuery's isPlainObject instead of JSON.parse
- Instead of having a wrapper sendMessage, the logic now resides in WebSocket's original send method, so you can just call send() with an object of your data

I think these changes make the overall code a lot cleaner and easier to work with.

NOTE: Right now, I'm loading the akobi_lib.js script from 127.0.0.1 for testing, but I'll change it to our actual domain before this gets merged in