Minor code cleanup in behavior.js

Summary: Removed some unnecessary code blocks.

Reviewers: tomo, epriestley

Test Plan: Ensure that JX.behavior still works

Differential Revision: 486
Add Jasmine Unit Test Library

Summary: This adds the Jasmine Unit Test Library for the Javelin unit
tests.

Test Plan: Open specs/ and see All (0) specs pass.

Reviewers: tomo, epriestley

CC:

Differential Revision: 487
Add some Specs for Javelin

Summary: This adds some Specs for Javelin ready to be run through
Jasmine.
Note: Port back the dataPersistence Stratcom test to fbcode
(ensure__DEV__)

Test Plan: Open specs/ in your browser and see the specs pass

Reviewers: tomo, epriestley

CC:

Differential Revision: 488
Add JX.log in non-dev mode to prevent silent fails

Summary: JX.log is part of the public API (it is listed in the @requires
block in util.js). In non-dev mode this method gets stripped out and
could potentially cause errors that the developer overlooked. Adding
JX.log as an empty function in non-dev mode.

Test Plan: Ensure the JX.log is available if __DEV__ is false.

Reviewers: tomo, epriestley

CC:

Differential Revision: 492
Add JX.isArray for reliable array type checks

Summary: instanceof Array is not reliable in cases where Arrays might
come from other contexts. Use the ES5 method Array.isArray or
Object.prototype.toString instead.

Test Plan: Check the included specs

Reviewers: tomo, epriestley

CC:

Differential Revision: 493
Minor code cleanups (= less code)

Summary: Some minor cleanups, nothing serious. Some variables were
defined more than once in the same scope.

Test Plan: Run the specs / examples

Reviewers: tomo, epriestley

CC:

Differential Revision: 494
Simplify JSON code
Make meaingful more meaningful.
Simplify code

- Shortens the code when minified
- Easier to read, because everything is at one
  place
Various minor improvements
Reuse some logic. *untested*
Add two missing semicolons.
Merge pull request #6 from kassens/master

Various minor things.
Merge pull request #7 from cpojer/master

Recent updates to Javelin
Add JX.JSON.parse, update JX.JSON.serialize

Summary: Add functionality to decode a JSON string into an object.
Rename JX.JSON.serialize to stringify to match the ES5 method name. Both
will use their native counterparts if available. They are not spec
compliant, ie. they do not support replacer/receiver j0nx. Cleaned up
some of the stringify code. JX.JSON.parse is intended to never throw, it
will return the parsed object or null. The idea is that if it would
throw in dev but you rely on it to return null to check if the data
contained a value, you would have to cover both the exception and the
null check in your application code.

Test Plan: verify that both methods can properly decode and encode JSON
values.

Reviewers: tomo, epriestley, mroch

CC:

Differential Revision: 510
Throw when alterClass is called without third arg

Summary: If no third argument is provided, this method will behave
differently depending on whether the element has the class or not.
Javelin discourages state management through className. Throwing an
error in DEV can help developers spot this mistakte.

Test Plan: Test that it throws in DEV if anything but true or false are
provided as third argument.

Reviewers: mroch, epriestley, tomo

CC:

Differential Revision: 511
Documentation improvements for Javelin

Summary:
This is not exhaustive because curating documentation is terribly boring, but I
think all of these changes are improvements, at least.

Test Plan:
Generated and read documentation, which is now slightly better
organized/linked/grouped/highlighted.

Reviewed By: mroch
Reviewers: cpojer, tomo, mroch
Commenters: cpojer
CC: aran, cpojer, epriestley, mroch
Differential Revision: 522
Add some articles to Javelin

Summary:
Add a couple of articles to explain Javelin concepts.

Test Plan:
Regenerated documentation, read articles.

Reviewed By: cpojer
Reviewers: cpojer, tomo, mroch
CC: aran, cpojer
Differential Revision: 527
Update Javelin website

Summary:
- Make it look a little less clowny.
  - Overview stuff has moved into proper documentation, see D527. The current
stuff is out of date since we moved to 'data-sigil', etc.
  - Restore the original blurb since it is like 90% of the value of the project.
  - Balance the rest of the intro text so it's clear this isn't actually a joke,
but a legitimate library.
  - Explain where the library is situated in the grand scheme of things.
  - Add some contributors.

This is still not great, but I think it improves things somewhat.

Test Plan:
This is what it looks like now:

https://secure.phabricator.com/file/view/PHID-FILE-1993b07d8a80f2cca6a8/

Reviewed By: cpojer
Reviewers: cpojer, mroch, tomo, fratrik, ashwin, kassens
Commenters: fratrik
CC: aran, epriestley, cpojer, fratrik
Differential Revision: 528
Use native Function.prototype.bind if available

Summary: Make use of the native ES5 method if it is available.

Test Plan: run unit tests

Reviewers: tomo, mroch, epriestley

CC:

Differential Revision: 561