diff --git a/examples/simple.html b/examples/simple.html new file mode 100644 index 00000000..0f4f9b82 --- /dev/null +++ b/examples/simple.html @@ -0,0 +1,16 @@ + + + + Lawnchair Spec + + + + + + + + diff --git a/makefile b/makefile index 94e1e8fb..1e867783 100644 --- a/makefile +++ b/makefile @@ -8,7 +8,7 @@ clean: build: mkdir -p ./lib && touch ./lib/lawnchair.js cat ./src/lawnchair.js > ./lib/lawnchair.js - cat ./src/adapters/window-name.js >> ./lib/lawnchair.js + cat ./src/adapters/webkit-sqlite.js >> ./lib/lawnchair.js # plugins being build here w/ dom adapter only for testing purposes build-plugins: @@ -28,9 +28,9 @@ dist: test: open ./tests/index.html - open ./tests/plugins/aggregation.html - open ./tests/plugins/callbacks.html - open ./tests/plugins/pagination.html - open ./tests/plugins/query.html + #open ./tests/plugins/aggregation.html + #open ./tests/plugins/callbacks.html +# open ./tests/plugins/pagination.html +# open ./tests/plugins/query.html .PHONY: all diff --git a/src/adapters/webkit-sqlite.js b/src/adapters/webkit-sqlite.js index b3b7d06a..db49bb67 100644 --- a/src/adapters/webkit-sqlite.js +++ b/src/adapters/webkit-sqlite.js @@ -1,239 +1,191 @@ -Lawnchair.prototype.allKeys = function(callback) {this.adaptor.allKeys(callback)}, - -WebkitSQLiteAdaptor.prototype.allKeys = function(callback) { - var cb = this.terseToVerboseCallback(callback); - var that = this; - this.db.transaction(function(t) { - var sql = "SELECT id FROM " + that.table + " ORDER BY timestamp DESC"; - - t.executeSql(sql, [], function(tx, results) { - if (results.rows.length == 0 ) { - cb([]); - } else { - var r = []; - for (var i = 0, l = results.rows.length; i < l; i++) { - r.push(results.rows.item(i).id); - } - cb(r); - } - }, - that.onError); - }); -}; - -Lawnchair.prototype.multiget = function(keys, callback) {this.adaptor.multiget(keys, callback)}, - -WebkitSQLiteAdaptor.prototype.multiget = function(keys, callback) { - var cb = this.terseToVerboseCallback(callback); - var that = this; - this.db.transaction(function(t) { - var v = []; - for(var i=0; i