Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Saucelabs in CI

  • Loading branch information...
commit 613b6cd3fcc4e7760265a87e9a164e2b85a69171 1 parent d49c5e6
Parashuram authored
View
BIN  .DS_Store
Binary file not shown
View
4 .gitignore
@@ -1,4 +1,6 @@
.project
.settings
node_modules
-.tmp_*
+.tmp_*
+.DS_Store
+sauce_connect.log
View
7 .travis.yml
@@ -1,6 +1,9 @@
language: node_js
node_js:
- - 0.8
+ - 0.6
notifications:
email: false
-
+
+env:
+ global:
+ - secure: "XNNs3CbcdCX25VIaDrUxr3zP5JY+a4Rdgg+yYCg4AkWutzYO1pOD2yni0hSX\nEJRdtL6PWuZ7zGBF8oo2fi/hqfpUiH+Aak0XBf/F1kq9QWPsljuvxUOD+i3l\nJqo0NKJUCN2JTAbmVOzZvuj2GT+gcuC+m3WiLTLpcv0gOjYJ2Mk="
View
8 Readme.md
@@ -1,13 +1,11 @@
-IndexedDB Polyfill
-==================
+IndexedDB Polyfill [![Build Status](https://secure.travis-ci.org/axemclion/IndexedDBShim.png)](https://travis-ci.org/axemclion/IndexedDBShim)
+================================
A polyfill to enable IndexedDB using WebSql.
IndexedBD is not supported on <a href = "http://caniuse.com/#search=IndexedDB" target="_blank">all browsers</a>.
This IndexedDB polyfill exposes the IndexedDB API in unsupported browsers using WebSQL. This shim is basically an IndexedDB-WebSql adapter.
-[![Build Status](https://secure.travis-ci.org/axemclion/IndexedDBShim.png)](https://travis-ci.org/axemclion/IndexedDBShim)
-
<a href = "http://nparashuram.com/IndexedDBShim">More details about the project at gh-pages</a>
Using this polyfill, you can use a single offline storage API across browsers (Opera, Safari, Firefox, Chrome and IE10) and even mobile devices (Phonegap on iOS and Android).
@@ -24,8 +22,6 @@ To use the polyfill, simply add the following line to your HTML files
If IndexedDB is not natively supported (and WebSQL is), the polyfill kicks in and makes a `window.IndexedDB` object available for you to use.
If you want to force the use of this polyfill (on Chrome where both IndexedDB and WebSql are supported), simply use `window.shimIndexedDB.__useShim()`.
-_The branches master and gh-pages are mirror images of each other. Master is required for triggering Travis builds_
-
Building
========
To build `IndexedDBShim.min.js`
View
27 dist/IndexedDBShim.js
@@ -1,7 +1,7 @@
/**
* An initialization file that checks for conditions, removes console.log and warn, etc
*/
-var idbModules = {};
+var idbModules = {};
(function(idbModules){
/**
* A utility method to callback onsuccess, onerror, etc as soon as the calling function's context is over
@@ -62,7 +62,6 @@ var idbModules = {};
this.length = this._items.length;
}
};
-
idbModules.util = {
"throwDOMException": throwDOMException,
"callback": callback,
@@ -72,7 +71,7 @@ var idbModules = {};
"StringList": StringList
};
}(idbModules));
-
+
(function(idbModules){
/**
* A dummy implementation of the Structured Cloning Algorithm
@@ -89,7 +88,7 @@ var idbModules = {};
};
}());
idbModules.Sca = Sca;
-}(idbModules));
+}(idbModules));
(function(idbModules){
/**
* Encodes the keys and values based on their types. This is required to maintain collations
@@ -145,7 +144,7 @@ var idbModules = {};
}());
idbModules.Key = Key;
}(idbModules));
-
+
(function(idbModules, undefined){
// The event interface used for IndexedBD Actions.
var Event = function(type, debug){
@@ -161,7 +160,7 @@ var idbModules = {};
};
};
idbModules.Event = Event;
-}(idbModules));
+}(idbModules));
(function(idbModules){
/**
@@ -184,7 +183,7 @@ var idbModules = {};
idbModules.IDBOpenRequest = IDBOpenRequest;
}(idbModules));
-
+
(function(idbModules, undefined){
/**
* The IndexedDB KeyRange object
@@ -218,7 +217,7 @@ var idbModules = {};
idbModules.IDBKeyRange = IDBKeyRange;
}(idbModules));
-
+
(function(idbModules, undefined){
/**
* The IndexedDB Cursor Object
@@ -371,7 +370,7 @@ var idbModules = {};
idbModules.IDBCursor = IDBCursor;
}(idbModules));
-
+
(function(idbModules, undefined){
/**
* IDB Index
@@ -499,7 +498,7 @@ var idbModules = {};
idbModules.IDBIndex = IDBIndex;
}(idbModules));
-
+
(function(idbModules){
/**
@@ -826,7 +825,7 @@ var idbModules = {};
idbModules.IDBObjectStore = IDBObjectStore;
}(idbModules));
-
+
(function(idbModules){
/**
@@ -969,7 +968,7 @@ var idbModules = {};
idbModules.IDBTransaction = IDBTransaction;
}(idbModules));
-
+
(function(idbModules){
/**
@@ -1058,7 +1057,7 @@ var idbModules = {};
idbModules.IDBDatabase = IDBDatabase;
}(idbModules));
-
+
(function(idbModules){
var DEFAULT_DB_SIZE = 4 * 1024 * 1024;
if (!window.openDatabase) {
@@ -1231,7 +1230,7 @@ var idbModules = {};
idbModules.shimIndexedDB = shimIndexedDB;
}(idbModules));
-
+
(function(window, idbModules){
if (typeof window.openDatabase !== "undefined") {
window.shimIndexedDB = idbModules.shimIndexedDB;
View
2  dist/IndexedDBShim.min.js.map
1 addition, 1 deletion not shown
View
178 grunt.js
@@ -1,100 +1,122 @@
-/*global module:false*/
-module.exports = function(grunt) {
- var srcFiles = [ 'src/Init.js', 'src/util.js', 'src/Sca.js', 'src/Key.js',
- 'src/Event.js', 'src/IDBRequest.js', 'src/IDBKeyRange.js',
- 'src/IDBCursor.js', 'src/IDBIndex.js', 'src/IDBObjectStore.js',
- 'src/IDBTransaction.js', 'src/IDBDatabase.js',
- 'src/shimIndexedDB.js', 'src/globalVars.js' ];
+/* global module:false */
+module.exports = function(grunt){
+ var srcFiles = ['src/Init.js', 'src/util.js', 'src/Sca.js', 'src/Key.js', 'src/Event.js', 'src/IDBRequest.js', 'src/IDBKeyRange.js', 'src/IDBCursor.js', 'src/IDBIndex.js', 'src/IDBObjectStore.js', 'src/IDBTransaction.js', 'src/IDBDatabase.js', 'src/shimIndexedDB.js', 'src/globalVars.js'];
// Project configuration.
+ var saucekey = null;
+ if (process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_SECURE_ENV_VARS) {
+ saucekey = process.env.saucekey;
+ }
grunt.initConfig({
- pkg : '<json:package.json>',
- meta : {
- banner : '/*! <%= pkg.name %> */'
+ pkg: '<json:package.json>',
+ meta: {
+ banner: '/*! <%= pkg.name %> */'
},
- lint : {
- files : [ 'grunt.js', 'src/**/*.js', 'test/**/*.js' ]
+ lint: {
+ files: ['grunt.js', 'src/**/*.js', 'test/**/*.js']
},
- concat : {
- dist : {
- src : srcFiles,
- dest : 'dist/<%= pkg.name %>.js'
+ concat: {
+ dist: {
+ src: srcFiles,
+ dest: 'dist/<%= pkg.name %>.js'
}
},
- 'jsmin-sourcemap' : {
- all : {
- src : srcFiles,
- dest : 'dist/<%= pkg.name %>.min.js',
- srcRoot : '..'
+ 'jsmin-sourcemap': {
+ all: {
+ src: srcFiles,
+ dest: 'dist/<%= pkg.name %>.min.js',
+ srcRoot: '..'
}
},
- watch : {
- files : '<config:lint.files>',
- tasks : 'lint test'
+ watch: {
+ files: '<config:lint.files>',
+ tasks: 'lint test'
},
-
- server : {
- base : '.',
- port : 9999
+
+ server: {
+ base: '.',
+ port: 9999
},
-
- qunit : {
- all : [ 'http://localhost:9999/test/index.html' ]
+
+ qunit: {
+ all: ['http://localhost:9999/test/index.html']
},
-
- jshint : {
- options : {
- camelcase : true,
- nonew : true,
- curly : true,// require { }
- eqeqeq : true,// === instead of ==
- immed : true,// wrap IIFE in parentheses
- latedef : true,// variable declared before usage
- newcap : true,// capitalize class names
- undef : true,// checks for undefined variables
- regexp : true,
- evil : true,
- eqnull : true,// == allowed for undefined/null checking
- expr : true,// allow foo && foo()
- browser : true
- // browser environment
+
+ 'saucelabs-qunit': {
+ all: {
+ username: 'indexeddbshim',
+ key: saucekey,
+ testname: 'IndexedDBShim',
+ tags: ['master'],
+ urls: ['http://127.0.0.1:9999/test/index.html'],
+ browsers: [{
+ browserName: 'safari',
+ platform: 'Windows 2008',
+ version: '5'
+ }]
+ }
+ },
+
+ jshint: {
+ options: {
+ camelcase: true,
+ nonew: true,
+ curly: true,// require { }
+ eqeqeq: true,// === instead of ==
+ immed: true,// wrap IIFE in parentheses
+ latedef: true,// variable declared before usage
+ newcap: true,// capitalize class names
+ undef: true,// checks for undefined variables
+ regexp: true,
+ evil: true,
+ eqnull: true,// == allowed for undefined/null checking
+ expr: true,// allow foo && foo()
+ browser: true
+ // browser environment
},
- globals : {
+ globals: {
// Shim.
- DEBUG : true,
- console : true,
- DOMException : true,
- IDBTransaction : true,
- idbModules : true,
- logger : true,
-
+ DEBUG: true,
+ console: true,
+ DOMException: true,
+ IDBTransaction: true,
+ idbModules: true,
+ logger: true,
+
// Tests.
- _ : true,
- asyncTest : true,
- DB : true,
- dbVersion : true,
- deepEqual : true,
- equal : true,
- expect : true,
- fail : true,
- module : true,
- nextTest : true,
- notEqual : true,
- ok : true,
- sample : true,
- start : true,
- stop : true,
- queuedAsyncTest : true,
- queuedModule : true,
- unescape : true
+ _: true,
+ asyncTest: true,
+ DB: true,
+ dbVersion: true,
+ deepEqual: true,
+ equal: true,
+ expect: true,
+ fail: true,
+ module: true,
+ nextTest: true,
+ notEqual: true,
+ ok: true,
+ sample: true,
+ start: true,
+ stop: true,
+ queuedAsyncTest: true,
+ queuedModule: true,
+ unescape: true,
+ process: true
}
},
- uglify : {}
+ uglify: {}
});
-
+
// Default task.
grunt.loadNpmTasks('grunt-jsmin-sourcemap');
+ grunt.loadNpmTasks('grunt-saucelabs-qunit');
grunt.registerTask('build', 'lint concat jsmin-sourcemap');
- grunt.registerTask('test', 'build server qunit');
-
+
+ var testJobs = ["build", "server", "qunit"];
+ if (saucekey !== null) {
+ testJobs.push("saucelabs-qunit");
+ }
+ grunt.registerTask('test', testJobs.join(" "));
+
grunt.registerTask('default', 'build');
};
View
3  package.json
@@ -15,7 +15,8 @@
"keywords": ["indexedDB", "database", "polyfill", "websql"],
"devDependencies": {
"grunt": "*",
- "grunt-jsmin-sourcemap": "*"
+ "grunt-jsmin-sourcemap": "*",
+ "grunt-saucelabs-qunit": "*"
},
"bundleDependencies": [],
"license": "MIT",
View
1  src/util.js
@@ -58,7 +58,6 @@
this.length = this._items.length;
}
};
-
idbModules.util = {
"throwDOMException": throwDOMException,
"callback": callback,
View
3  test/index.html
@@ -37,7 +37,7 @@
</script>
<script type = "text/javascript" src= "sampleData.js">
</script>
- <script type = "text/javascript" src= "../dist/IndexedDBShim.min.js">
+ <script type = "text/javascript" src= "../dist/IndexedDBShim.js">
</script>
<script type = "text/javascript">
function startTests(){
@@ -143,7 +143,6 @@ <h2 id="qunit-userAgent"></h2>
browser.innerHTML = "Storage technologies supported [" + support.join(", ") + "]"
})();
</script>
- <a href="https://github.com/IndexedDBShim"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-617499-9']);
Please sign in to comment.
Something went wrong with that request. Please try again.