diff --git a/docs/files.html b/docs/files.html index 3a702c6..4c726cc 100755 --- a/docs/files.html +++ b/docs/files.html @@ -1 +1 @@ -
Global namespace.
Global namespace.
Defined in: DOM.js.
string | class |
string | class |
string?, Default: | type |
string | name | |
string?, Default: | value |
string |
string?, Default: | value |
string |
string | property | |
string?, Default: | value |
string |
$_("ul").dom.append("<li></li>") adds an li element to the end of the selected ul element
string | htm |
Defined in: DOM.js.
string | class |
string | class |
string?, Default: | type |
string | name | |
string?, Default: | value |
string |
string?, Default: | value |
string |
string | property | |
string?, Default: | value |
string |
$_("ul").dom.append("<li></li>") adds an li element to the end of the selected ul element
string | htm |
Defined in: event.js.
Eg. $_("#selector").event.add("click", do_something());
string | event | |
function | callback |
Eg. $_("#selector").event.remove("click", do_something());
string | event | |
string | callback |
Defined in: event.js.
Eg. $_("#selector").event.add("click", do_something());
string | event | |
function | callback |
Eg. $_("#selector").event.remove("click", do_something());
string | event | |
string | callback |
Defined in: core.js.
Defined in: store.js.
string | selector | |
object | context |
object |
string | name | |
object | obj |
function | callback |
mixed | obj |
string |
Defined in: ajax.js.
string | url | |
object | data | |
function | callback |
Defined in: ajax.js.
string | url | |
object | data | |
function | callback |
Defined in: core.js.
Defined in: store.js.
string | selector | |
object | context |
object |
string | name | |
object | obj |
function | callback |
mixed | obj |
string |
Defined in: ajax.js.
string | url | |
object | data | |
function | callback |
Defined in: ajax.js.
string | url | |
object | data | |
function | callback |
Defined in: store.js.
string | key | |
bool | session |
object |
string | key | |
mixed | value | |
bool | session |
string | key | |
bool | session |
Defined in: store.js.
string | key | |
bool | session |
object |
string | key | |
mixed | value | |
bool | session |
string | key | |
bool | session |
Defined in: template.js.
string | template_name | |
object | replace_data |
string |
string | parsed_template/template_name | |
string?, Default: | url | |
object?, Default: | data |
Defined in: template.js.
string | template_name | |
object | replace_data |
string |
string | parsed_template/template_name | |
string?, Default: | url | |
object?, Default: | data |
Defined in: util.js.
object |
array |
object |
array |
array/object | keys | |
array/object | vals |
object |
object | [as many as you wish to combine] |
object |
string | input_string | |
mixed | from (string)/replace pairs (object) | |
string?, Default: |
string |
Defined in: util.js.
object |
array |
object |
array |
array/object | keys | |
array/object | vals |
object |
object | [as many as you wish to combine] |
object |
string | input_string | |
mixed | from (string)/replace pairs (object) | |
string?, Default: |
string |
1 /** + 2 * Module for simplifying Indexed DB access + 3 */ + 4 (function() { + 5 "use strict"; + 6 + 7 var db = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.msIndexedDB, + 8 request = null; + 9 indexedDB = {}; + 10 + 11 /** + 12 * @private + 13 */ + 14 request.onerror = function(event) + 15 { + 16 console.log("IndexedDB disallowed."); + 17 }; + 18 + 19 /** + 20 * @private + 21 */ + 22 request.onsuccess = function(event) + 23 { + 24 // Connect to the specified db + 25 indexedDB.current_db = request.result; + 26 }; + 27 + 28 /** + 29 * Module for simplifying Indexed DB access + 30 * + 31 * @namespace + 32 * @name indexedDB + 33 * @memberOf $_ + 34 */ + 35 indexedDB = { + 36 current_db: null, + 37 /** + 38 * Connects to an indexedDB database + 39 * + 40 * @memberOf $_.indexedDB + 41 * @name connect + 42 * @function + 43 * @param string dbname + 44 * @param [int] version + 45 * @param [function] onupgradeneeded + 46 */ + 47 connect: function(dbname, version, onupgradeneeded) + 48 { + 49 version = version || 0; + 50 + 51 if(typeof onupgradeneeded !== "undefined") + 52 { + 53 request.onupgradeneeded = onupgradeneeded; + 54 } + 55 + 56 // Ask for permission to use db + 57 this.current_db = db.open(dbname, version); + 58 } + 59 }; + 60 + 61 $_.ext('indexedDB', indexedDB); + 62 + 63 }());\ No newline at end of file diff --git a/kis-all.js b/kis-all.js index 362451d..1177a4c 100755 --- a/kis-all.js +++ b/kis-all.js @@ -1044,6 +1044,72 @@ if (typeof document !== "undefined" && !("classList" in document.createElement(" // -------------------------------------------------------------------------- +/** + * Module for simplifying Indexed DB access + */ +(function() { + "use strict"; + + var db = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.msIndexedDB, + request = null; + indexedDB = {}; + + /** + * @private + */ + request.onerror = function(event) + { + console.log("IndexedDB disallowed."); + }; + + /** + * @private + */ + request.onsuccess = function(event) + { + // Connect to the specified db + indexedDB.current_db = request.result; + }; + + /** + * Module for simplifying Indexed DB access + * + * @namespace + * @name indexedDB + * @memberOf $_ + */ + indexedDB = { + current_db: null, + /** + * Connects to an indexedDB database + * + * @memberOf $_.indexedDB + * @name connect + * @function + * @param string dbname + * @param [int] version + * @param [function] onupgradeneeded + */ + connect: function(dbname, version, onupgradeneeded) + { + version = version || 0; + + if(typeof onupgradeneeded !== "undefined") + { + request.onupgradeneeded = onupgradeneeded; + } + + // Ask for permission to use db + this.current_db = db.open(dbname, version); + } + }; + + $_.ext('indexedDB', indexedDB); + +}()); + +// -------------------------------------------------------------------------- + /** * Util Object * diff --git a/kis-lite-min.js b/kis-lite-min.js index 2e91afc..3dddcaf 100755 --- a/kis-lite-min.js +++ b/kis-lite-min.js @@ -1,9 +1,9 @@ -(function(){if("undefined"!==typeof document.querySelector){var e,f,d,c;e=function(a){c="undefined"===typeof a?"undefined"!==typeof e.el?e.el:document.documentElement:"object"!==typeof a?f(a):a;e.prototype.el=c;var a=d(e),b;for(b in a)if("object"===typeof a[b])a[b].el=c;a.el=c;return a};f=function(a,b){var g;if("string"!=typeof a||"undefined"===typeof a)return a;g=null!=b&&1===b.nodeType?b:document;if(a.match(/^#([\w\-]+$)/))return document.getElementById(a.split("#")[1]);g=g.querySelectorAll(a); +(function(){if("undefined"!==typeof document.querySelector){var e,f,d,c;e=function(a){c="undefined"===typeof a?"undefined"!==typeof e.el?e.el:document.documentElement:"object"!==typeof a?f(a):a;e.prototype.el=c;var a=d(e),b;for(b in a)"object"===typeof a[b]&&(a[b].el=c);a.el=c;return a};f=function(a,b){var g;if("string"!=typeof a||"undefined"===typeof a)return a;g=null!=b&&1===b.nodeType?b:document;if(a.match(/^#([\w\-]+$)/))return document.getElementById(a.split("#")[1]);g=g.querySelectorAll(a); return 1===g.length?g[0]:g};d=function(a){var b;if("undefined"!==typeof a){if("undefined"!==typeof Object.create)return Object.create(a);b=typeof a;if(!("object"!==b&&"function"!==b))return b=function(){},b.prototype=a,new b}};e.ext=function(a,b){b.el=c;e[a]=b};e.ext("each",function(a){if("undefined"!==typeof c.length&&c!==window){var b=c.length;if(0!==b)for(var g,d=0;de?1:b