coresmart / persistencejs

persistence.js is an asynchronous Javascript database mapper library. You can use it in the browser, as well on the server (and you can share data models between them).
http://persistencejs.org
1.73k stars 240 forks source link

Added jquery-mobile integration (page caching) + demo #17

Closed rsaccon closed 13 years ago

rsaccon commented 13 years ago

The jquery extension now does overwrite the jquery-mobile AJAX call for page loading. First time the page gets loaded, the plugin persists page content on local DB, following page requests are read from local DB.

At this time, page caching it is only implemented for HTML content, media content via data-URL's comes next !

Important: The demo must be run from a server, because of the AJAX calls.

rsaccon commented 13 years ago

My latest commit (7a5fab3) reverted the jquery-mobile patch (so the demo uses jquery-mobile from CDN). We overwrite &.ajax and decide based on URL analysis, whether to route the request to persistencejs.

zefhemel commented 13 years ago

Hi Roberto, because some of your commits contained the entire jquery mobile framework I decided it would be cleaner to just copy your changed files into the current master. Advantage is that we don't have jQuery mobile in the repo forever, drawback is that it looks like I'm taking the credit for your work because I committed it. I tried to be clear about who authored the jquery plug-in in the commit message however.

Thanks!