# What is this? ## Developing ### Development dependencies Developing with the NDS reader requires node.js, and the npm package manager. Install these first, and then run: npm install Which will read package.json, and install the development packages to compile all the dependencies to one JS file. #### Brunch The core application files are compiled using [brunch](http://brunch.io), the core files will run within the test html files without further compilation steps. It is not enough however, to compile the core files. Brunch will watch files and recompile as needed. #### Targets Further build targets beyond the core files are handled with Make. ##### Bookmarklet / Reader plugin make bookmarklet make bookmarklet-install The bookmarklet has some specific requirements which justify separate build targets. In order to not conflict with most modern, javascript-heavy websites, the core code is wrapped within its own closure to provide a separate namespace, and isolate from JavaScript library managers that may be running on the site (like requirejs, or amd; Brunch itself uses commonjs-require). This wrapper is defined in the following files: * src/wrapper_start.js * src/wrapper_end.js **Bookmark.js** In addition to the code compiled for the bookmarklet, there is the bookmarklet itself. This is contained in `src/bookmark.js`. It is important to note that `src/bookmark.js` and `src/jquery.neahttadigisanit.coffee` may both specify version numbers, with which one can provide a message to end users to "upgrade" (delete, and reinstall) their bookmark for the NDS Reader. As is, the bookmark.js file is now at maximum complexity: it contains one exception for skuvla.info to ensure that the plugin javascript and CSS is included in the right frame, since most websites now do not use frames; not much more should be needed here; however a note to future developers: find some other way of handling exceptional sites like this to keep bookmark.js small. This file must also be compiled: which means, compressed and URL encoded. This is also handled as part of the bookmarklet make targets. ##### Standalone make standalone make standalone-install This version is one that developers may include in their sites, simply by linking to the compiled files and including them in pages. #### Make Contains expected targets such as: make clean make all make install Also some specific ones: make standalone make wordpress make bookmarklet make standalone-install make bookmarklet-install ### Additional development tools #### Twitter Bootstrap Twitter Bootstrap is in use for CSS and JavaScript conveniences like popups, tooltips, and form elements. There is also a little custom code to handle dropdown buttons in forms. If this needs to be included in a place where Bootstrap's CSS reset (and basically its full install) would mess with local stylesheets too much, it is necessary to use a subset of Bootstrap which is downloadable from their website. However, note that the sample HTML file here includes the full bootstrap CSS, which can be disabled for testing, but also note that the JS utilities from Bootstrap and jQuery are compiled in to the final .js file, with one exception: the base jQuery library is not included (yet?). These dependencies are clearly listed in the HTML file to show how installation of the module works. So... If you need to make changes and require more parts of Twitter Bootstrap, here is the list of things that are in use here. Unfortunately Bootstrap provides no easy way to check off everything you need http://twitter.github.com/bootstrap/customize.html#variables Uncheck everything, and select: Base CSS * Labels and badges * Forms * Buttons * Icons Components * Button groups and dropdowns * Navs, tabs, and pills * Navbar * Alerts Miscellaneous * Wells * Close icon JS Components * Tooltips * Popovers * Dropdowns 2 jQuery Plugins * Modals * Dropdowns * Tooltips * Popovers * Buttons * Typeahead #### Gotchas * PHP: make sure there are no spaces or newlines after the `?>` in any of the PHP files, or wordpress will freak out and nothing will load.