Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixing some git inconsistency

  • Loading branch information...
commit 6a99e4c759cdca4467b3c582b39465b31266425d 1 parent bb30e95
@rsaccon authored
Showing with 12 additions and 7 deletions.
  1. +3 −2 demo/jquerymobile/index.html
  2. +9 −5 lib/jquery.persistence.js
View
5 demo/jquerymobile/index.html
@@ -3,8 +3,9 @@
<head>
<title>jQuery mobile / persistencejs integration</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link rel="stylesheet" href="http://jquerymobile.com/test/themes/default" />
- <script src="http://jquerymobile.com/test/js/all"></script>
+ <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" />
+ <script src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
+ <script src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script>
<script src="http://code.google.com/apis/gears/gears_init.js"></script>
<script src="../../lib/persistence.js"></script>
<script src="../../lib/persistence.store.sql.js"></script>
View
14 lib/jquery.persistence.js
@@ -105,7 +105,7 @@ persistence.get = function(arg1, arg2) {
name = parts[0].charAt(0).toUpperCase() + parts[0].substring(1);
if (persistence.isDefined(name)) {
if ((settings.type == "post") || ((settings.type == "get") && (arr.length > 1))) {
- // ajax form submission
+ // form submission
var data = {}, qs = (settings.type == "post") ? settings.data : arr[1] ;
qs.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function ( $0, $1, $2 ) {
if ($1) {
@@ -119,7 +119,7 @@ persistence.get = function(arg1, arg2) {
data: data
};
} else {
- // ajax page
+ // html page
return {
name: name,
templateKey: parts.slice(1).join('/')
@@ -161,10 +161,11 @@ persistence.get = function(arg1, arg2) {
} else {
persist(info.data);
}
- } else { // ajax html page
+ } else { // html page
Entity.findBy(persistence.jqmTemplateKeyField, info.templateKey, function(hit){
if (hit) {
- if (settings.success)
+ if (settings.success)
+ // TODO: replace images src with data URl'
settings.success(hit[persistence.jqmDataField]());
} else {
originalAjaxMethod({
@@ -174,8 +175,11 @@ persistence.get = function(arg1, arg2) {
var obj = {};
obj[persistence.jqmTemplateKeyField] = info.templateKey;
obj[persistence.jqmDataField] = data;
- var entity = new Entity(obj);
+ var entity = new Entity(obj);
+ // TODO: start transaction
persistence.add(entity);
+ // TODO: scan images
+ // TODO: add images as dataurlified
persistence.flush();
},
error: settings.error
Please sign in to comment.
Something went wrong with that request. Please try again.