-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebdb.min.js
More file actions
7 lines (6 loc) · 1.12 KB
/
webdb.min.js
File metadata and controls
7 lines (6 loc) · 1.12 KB
1
2
3
4
5
6
7
/*
webdb.js v0.2.0 file generated on Tue May 31 2016 19:33:34
(c) 2016 Moin Uddin <me@moin.im> (https://moin.im)
Available under MIT license - http://moin.im/plugins/webdb/index.html
*/
!function(a,b){"use strict";"function"==typeof define&&define.amd?define([],function(){return a.webdb=b(a)}):a.webdb=b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";if(!("openDatabase"in window))throw Error("WebSQL is not supported in this browser/device.");var c={},d={version:.1,dbSize:65536,shortName:"webdbjs",displayName:"WebDB.js Default Database"},e=null,f=null,g=null,h={success:function(a,b){e=b,f(a,b)},error:function(a,b){g(a,b),console.log(a,b)}},i=null;return c.connect=function(a){return a=a||d,i=openDatabase(a.shortName||d.shortName,a.version||d.version,a.displayName||d.displayName,a.dbSize||d.dbSize),this},c.run=function(a,b,c,d){return b=b||[],f=c||function(){},g=d||function(){},i.transaction(function(c){c.executeSql(a,b,h.success,h.error)}),this},c.each=function(a){var b=this;if(null==e)return setTimeout(function(){b.each(a)},100);for(var c=e.rows.length,d=0;c>d;d++)a(e.rows[d]);return this},c});