Giter VIP home page Giter VIP logo

Comments (11)

alekseykulikov avatar alekseykulikov commented on July 1, 2024

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.

benbest86 avatar benbest86 commented on July 1, 2024

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.

alekseykulikov avatar alekseykulikov commented on July 1, 2024

I have a very simple solution, and can push it soon. At first I should prepare it for opening. Stay tuned.

from backbone-offline.

benbest86 avatar benbest86 commented on July 1, 2024

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.

buddye avatar buddye commented on July 1, 2024

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.

alekseykulikov avatar alekseykulikov commented on July 1, 2024

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.

abuisman avatar abuisman commented on July 1, 2024

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.

alekseykulikov avatar alekseykulikov commented on July 1, 2024

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.

alekseykulikov avatar alekseykulikov commented on July 1, 2024

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.

paulirish avatar paulirish commented on July 1, 2024

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.

alekseykulikov avatar alekseykulikov commented on July 1, 2024

You're welcome!

from backbone-offline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.