Comments (11)
My pleasure to see you here. This library was extracted from my project Saveidea and you can try the demo: https://saveideanow.com/demo_app
from backbone-offline.
I think the request was more for a demo app with source code that shows the usage. Saveidea is a great demo app but as far as I can tell the source code is not public and the js is minified on the site and not readable.
I would also love to see a demo. I'm hoping to put together something extremely simple and will post a link to the code if I do.
from backbone-offline.
I have a very simple solution, and can push it soon. At first I should prepare it for opening. Stay tuned.
from backbone-offline.
Great! That would be much appreciated! Thanks!
On Mon, May 14, 2012 at 12:54 PM, Aleksey Kulikov <
[email protected]
wrote:
I have a very simple solution, and can push it soon. At first I should
prepare it for opening. Stay tuned.
Reply to this email directly or view it on GitHub:
#5 (comment)
from backbone-offline.
This worked for me. In the todos example from https://github.com/addyosmani/todomvc/blob/master/architecture-examples/backbone/js/todos.js
In todos.js, comment out line 51:
// localStorage: new Store("todos-backbone"),
and then add:
initialize: function() {
return this.storage = new Offline.Storage('todos-backbone', this);
},
line 180, add/replace
Todos.url = 'api/todos';
Todos.fetch();
'/api/todos' being the REST handler
I'm using this for a proof of concept for using Backbone on a mobile app, so far so good. My .url atm though being on a local server:
Todos.url = 'http://api.dev/todos';
CORS not an issue when browsing via file, I'm using Apache Cordova, so far it's working out.
I need to check out the data syncing algorithm though. Browsing via file, on refresh it seems to immediately sync all, but browsing via server, it doesn't sync changes on refresh.
EDIT
nevermind, syncing works fine, was CORS, temp work around on REST handler (I'm using Rails), from ( http://www.codeodor.com/index.cfm/2011/7/26/Responding-to-the-OPTIONS-HTTP-method-request-in-Rails-Getting-around-the-Same-Origin-Policy/3387 ):
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Request-Method'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS, DELETE, PUT'
headers['Access-Control-Max-Age'] = '1000'
headers['Access-Control-Allow-Headers'] = '*,x-requested-with, content-type'
from backbone-offline.
Thanks @EthanEtienne for your experience, nice idea! For auto-sync (without push()
and refresh page) you can use option autoPush: true
@storage = new Offline.Storage('dreams', this, autoPush: true)
from backbone-offline.
I think some demonstration code would be great too, the examples in the readme are broken, or at least not clear, or both. Please explain the pattern of how you intended things to work.
from backbone-offline.
Sure. Sorry that I have not done it before. I'm too busy now, but I'm going to pull example at the next weekend.
from backbone-offline.
Hi guys. I've added an open source example Dreamer. It very simple web-application for your dreams. Also added some information to Readme. I hope it will enough for a start.
from backbone-offline.
awesome work. thanks much for the app!
On Tue, Jul 10, 2012 at 4:30 AM, Aleksey Kulikov <
[email protected]
wrote:
Hi guys. I've added an open source example Dreamer. It very simple web-application for
your dreams. Also added
some information to Readme. I hope it will enough for a start.
Reply to this email directly or view it on GitHub:
#5 (comment)
from backbone-offline.
You're welcome!
from backbone-offline.
Related Issues (20)
- Fetch a simple Model ? HOT 4
- Fetch Local dont work with Backbone 1.0 HOT 4
- Bug with Storage#clear
- Collection is empty on fetching. Errors on POST request. HOT 5
- "Record Not Found" when fetching a model HOT 2
- Backbone.js offline not saving to local storage after fetch HOT 1
- error on fetch/pull HOT 3
- Backbone 1.0 and Backbone 0.9.10 compatibility difference
- Server implementation HOT 3
- Creates duplicate records if id is string HOT 1
- Option to use mongo objectid generator
- sync.push error
- collection.storage.sync.push() issue
- id not sent with this.model.save() HOT 1
- want to track the count of un-synced HTTP CRUD events
- Duplicate Add Event HOT 2
- delete que is never empty HOT 1
- Need help with updating related keys in multiple collections
- .storage.sync.full() alle Model data gets dirty HOT 1
- Using backbone-offline in conjuction with backbone.iobind?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from backbone-offline.