Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aurbano/backbone-demo

Backbone, Mustache and Underscore demo
https://github.com/aurbano/backbone-demo

backbone demo javascript mustache underscore

Last synced: about 2 hours ago
JSON representation

Backbone, Mustache and Underscore demo

Awesome Lists containing this project

README

        

Backbone, Mustache and Underscore
===========
This demo features a commenting system based on Backbone, Mustache and Underscore. It could easily be extended to load and save comments from a real datastore or API.

It was done as a requirement for a job application, the app structure and some initial coding were provided.

Demo: http://urbanoalvarez.es/backbone-demo/

###Features
* There are initially some comments that are preloaded in the HTML, the backbone collection loads these prerendered comments on initialization.
* You can add new comments using the form or generating blocks of random comments.
* Comments can be edited, reversed and deleted.
* Only one form can be open at any time.
* Uses RequireJS to manage dependencies.
* Whenever you trigger an event that would make you lose your changes there is a confirmation dialog shown.

####Confirmation upon losing changes
It uses a global flag, plus an event aggregator to trigger the remove method on all open instances if necessary. The workflow is as follows:

1. Check the changed flag before initializing. If true, ask for confirmation.
- User accepts, reset global flag and trigger the remove event.
- User declines, stop initialization and disallow rendering on current instance.
2. If there are changes, update the global flag.
3. If this instance is closed, either canceling or submitting, reset the flag.
4. Back to 1.

###Meta
Based on https://github.com/bodnaristvan/backbone-demo

Alejandro U. Álvarez - http://urbanoalvarez.es

[![Analytics](https://ga-beacon.appspot.com/UA-3181088-16/backbone-demo/readme)](https://github.com/aurbano)