JavaScript API that defines a browser-consistent content editable interface
Organization: All files of Editable.JS share the same closure. This is in order to allow all classes inside the Editable.JS API to use global objects, but only expose the Editable singleton as the only externally visible variable of Editable.JS. To get a shared closure the files editable.prefix and editable.suffix wrap all code.
JSHint does not know this, so all variables defined directly in this editable.js scope have to be added to the globals in .jshintrc
Setup:
# install PhantomJS with homebrew
brew install phantomjs
# install node dependencies
npm install
Development setup (optional):
# YUIDoc should be installed globally (its not required in packages.json)
npm install -g yuidocjs
Grunt tasks:
# watch and update editable.js and editable-test.js in .tmp/
# (required for grunt server and running tests)
grunt dev
# hands-on browser testing with livereload
grunt server
# run tests with PhantomJS
grunt test
# run tests in Chrome, Firefox and Safari
grunt karma:browsers
# javascript linting (configuration in .jshintrc)
grunt jshint
# run tests, linting and build editable.js
grunt build
YUIDoc:
# build and run the documentation
yuidoc --server src/