harvard-lil/stackview — pull request #3 by imakewebthings (2012-02-23 10:29:03+00:00)
Title: Plugin rework

- Plugin now split into separate functional modules.
- stackview.base creates the StackView class used by the plugin and exposes the methods `init`, `next_page`, and `prev_page`. `prev_page` is only useful for the loc_sort_order style searches and I don't have tests in place for this yet, but the code is there. `init` is the same as before. Any other method is called by passing the method name as a string to the `stackView` method. (`$('.some-stack-elem').stackView('next_page'))
- stackview.infinite looks at the stack scrolling and calls next/prev when appropriate
- stackview.navigation handles the navigation up/down arrows + item count
- Uses a [modified version of John Resig's microtemplating](http://www.west-wind.com/weblog/posts/2008/Oct/13/Client-Templating-with-jQuery) for rendering client side templates. This can be found in `/src/js/microtemplating.js` and the templates themselves are in `jquery.stackview.templates.js`
- Jasmine tests are in. You can run them by opening `/test/index.html` in a browser (preferably using a local web server and not file://, if you want the AJAX to work in Chrome.)
- The test directory also has a `preview.html` that just holds a couple stacks to play around with and do sanity checks. Automated tests are great, but it's always nice to actually use the thing and see if it works.
- I've added the example HTML back in under the `/demo` directory.