@@ -1485,13 +1487,13 @@ otherwise it will return the value of the current element
diff --git a/docs/$_.event.html b/docs/$_.event.html
index 8726161..5f298e9 100644
--- a/docs/$_.event.html
+++ b/docs/$_.event.html
@@ -90,6 +90,8 @@
+
+
@@ -100,7 +102,7 @@
@@ -873,13 +875,13 @@ Constructor function
diff --git a/docs/$_.store.html b/docs/$_.store.html
index 0efe944..f31f2a5 100644
--- a/docs/$_.store.html
+++ b/docs/$_.store.html
@@ -92,6 +92,8 @@ to use sessionStorage rather than the default localStorage.
+
+
@@ -102,7 +104,7 @@ to use sessionStorage rather than the default localStorage.
-
<static> clear(session)
+
(static) clear(session)
@@ -221,7 +223,7 @@ to use sessionStorage rather than the default localStorage.
-
<static> get(key, session) → {Object}
+
(static) get(key, session) → {Object}
@@ -382,7 +384,7 @@ based on the specified key
-
<static> getAll(session) → {Object}
+
(static) getAll(session) → {Object}
@@ -519,7 +521,7 @@ based on the specified key
-
<static> remove(key, session)
+
(static) remove(key, session)
@@ -661,7 +663,7 @@ based on the specified key
-
<static> set(key, value, session)
+
(static) set(key, value, session)
@@ -840,13 +842,13 @@ and JSON-encodes the value if not a string
diff --git a/docs/DOM.js.html b/docs/DOM.js.html
index c3e5996..6c1548d 100644
--- a/docs/DOM.js.html
+++ b/docs/DOM.js.html
@@ -85,40 +85,20 @@
function _css(sel, prop, val)
{
- var equi;
-
//Camel-case
prop = _toCamel(prop);
- //Equivalent properties for 'special' browsers
- equi = {
- outerHeight: "offsetHeight",
- outerWidth: "offsetWidth",
- top: "posTop"
- };
-
-
//If you don't define a value, try returning the existing value
if(val === undefined && sel.style[prop] !== undefined)
{
return sel.style[prop];
}
- else if(val === undefined && sel.style[equi[prop]] !== undefined)
- {
- return sel.style[equi[prop]];
- }
- //Let's try the easy way first
+ // Let's set a value instead
if(sel.style[prop] !== undefined)
{
sel.style[prop] = val;
- //Short circuit
- return null;
- }
- else if(sel.style[equi[prop]])
- {
- sel.style[equi[prop]] = val;
return null;
}
}
@@ -284,14 +264,11 @@
// If passed an object, recurse!
if($_.type(prop) === 'object')
{
- for (prop_key in prop)
- {
- if ( ! prop.hasOwnProperty(prop_key)) continue;
-
+ Object.keys(prop).forEach(function(prop_key) {
$_.each(function (e){
_css(e, prop_key, prop[prop_key]);
});
- }
+ });
}
//Return the current value if a value is not set
else if(val === undefined && $_.type(prop) !== 'object')
@@ -362,13 +339,13 @@
diff --git a/docs/ajax.js.html b/docs/ajax.js.html
index ccaefbb..0a305b3 100644
--- a/docs/ajax.js.html
+++ b/docs/ajax.js.html
@@ -160,13 +160,13 @@
diff --git a/docs/core.js.html b/docs/core.js.html
index 30ec522..6b45804 100644
--- a/docs/core.js.html
+++ b/docs/core.js.html
@@ -46,9 +46,10 @@
* @constructor
* @namespace $_
* @param {string} selector - The dom selector string
+ * @param {Object} [context] - Context of the dom selector string
* @return {Object}
*/
- $_ = function(s)
+ $_ = function(s, context)
{
// Have documentElement be default selector, just in case
if (s === undefined)
@@ -60,7 +61,7 @@
}
else
{
- sel = $(s);
+ sel = $(s, context);
}
// Add the selector to the prototype
@@ -91,29 +92,29 @@
* @param {Object} [context]
* @return {Object}
*/
- $ = function (a, context)
+ $ = function (selector, context)
{
- var x, c;
+ var elements;
- if (typeof a != "string" || a === undefined){ return a;}
+ if (typeof selector != "string" || selector === undefined){ return selector;}
//Check for a context of a specific element, otherwise, just run on the document
- c = (context != null && context.nodeType === 1)
+ context = (context != null && context.nodeType === 1)
? context
: document;
//Pick the quickest method for each kind of selector
- if (a.match(/^#([\w\-]+$)/))
+ if (selector.match(/^#([\w\-]+$)/))
{
- return document.getElementById(a.split('#')[1]);
+ return document.getElementById(selector.split('#')[1]);
}
else
{
- x = c.querySelectorAll(a);
+ elements = context.querySelectorAll(selector);
}
//Return the single object if applicable
- return (x.length === 1) ? x[0] : x;
+ return (elements.length === 1) ? elements[0] : elements;
};
/**
@@ -179,13 +180,13 @@
diff --git a/docs/event.js.html b/docs/event.js.html
index 596493c..30c5d82 100644
--- a/docs/event.js.html
+++ b/docs/event.js.html
@@ -112,21 +112,13 @@
*/
create: function(name, data)
{
- // Do a terrible browser-sniffic hack because I don't know of a good
- // feature test
- if (/MSIE|Trident/i.test(navigator.userAgent))
- {
+ data = data || {};
+
// Okay, I guess we have to do this the hard way... :(
- // Microsoft, your browser still sucks
var e = document.createEvent('CustomEvent');
e.initCustomEvent(name, true, true, data);
return e;
- }
- else
- {
- return new CustomEvent(name, data);
- }
},
/**
* Adds an event that returns a callback when triggered on the selected
@@ -222,13 +214,13 @@
diff --git a/docs/global.html b/docs/global.html
index 475f6eb..54090dc 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -168,7 +168,7 @@ Module for making ajax requests
diff --git a/docs/index.html b/docs/index.html
index b0abbb1..69f35f9 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -112,6 +112,8 @@
+
+
@@ -131,13 +133,13 @@
diff --git a/docs/polyfill.js.html b/docs/polyfill.js.html
index 3780d75..e89f141 100644
--- a/docs/polyfill.js.html
+++ b/docs/polyfill.js.html
@@ -28,12 +28,7 @@
/**
* A module of various browser polyfills
* @file polyfill.js
- */
-
-/**
- * Promise.prototype.done polyfill
- */
-if (!Promise.prototype.done) { Promise.prototype.done = function (cb, eb) { this.then(cb, eb).then(null, function (err) { setTimeout(function () { throw err; }, 0); }); }; }
+ */
@@ -43,13 +38,13 @@ if (!Promise.prototype.done) { Promise.prototype.done = function (cb, eb) { this
diff --git a/docs/store.js.html b/docs/store.js.html
index 60dadb4..d2186e8 100644
--- a/docs/store.js.html
+++ b/docs/store.js.html
@@ -151,13 +151,13 @@
diff --git a/docs/styles/jsdoc-default.css b/docs/styles/jsdoc-default.css
index bf6b51c..124ef6c 100644
--- a/docs/styles/jsdoc-default.css
+++ b/docs/styles/jsdoc-default.css
@@ -58,8 +58,7 @@ section
display: none;
}
-.optional:after {
- content: "opt";
+.signature-attributes {
font-size: 60%;
color: #aaa;
font-style: italic;
diff --git a/kis-all.js b/kis-all.js
index 0650526..a97e1ec 100755
--- a/kis-all.js
+++ b/kis-all.js
@@ -19,9 +19,10 @@
* @constructor
* @namespace $_
* @param {string} selector - The dom selector string
+ * @param {Object} [context] - Context of the dom selector string
* @return {Object}
*/
- $_ = function(s)
+ $_ = function(s, context)
{
// Have documentElement be default selector, just in case
if (s === undefined)
@@ -33,7 +34,7 @@
}
else
{
- sel = $(s);
+ sel = $(s, context);
}
// Add the selector to the prototype
@@ -64,29 +65,29 @@
* @param {Object} [context]
* @return {Object}
*/
- $ = function (a, context)
+ $ = function (selector, context)
{
- var x, c;
+ var elements;
- if (typeof a != "string" || a === undefined){ return a;}
+ if (typeof selector != "string" || selector === undefined){ return selector;}
//Check for a context of a specific element, otherwise, just run on the document
- c = (context != null && context.nodeType === 1)
+ context = (context != null && context.nodeType === 1)
? context
: document;
//Pick the quickest method for each kind of selector
- if (a.match(/^#([\w\-]+$)/))
+ if (selector.match(/^#([\w\-]+$)/))
{
- return document.getElementById(a.split('#')[1]);
+ return document.getElementById(selector.split('#')[1]);
}
else
{
- x = c.querySelectorAll(a);
+ elements = context.querySelectorAll(selector);
}
//Return the single object if applicable
- return (x.length === 1) ? x[0] : x;
+ return (elements.length === 1) ? elements[0] : elements;
};
/**
@@ -151,11 +152,6 @@
* @file polyfill.js
*/
-/**
- * Promise.prototype.done polyfill
- */
-if (!Promise.prototype.done) { Promise.prototype.done = function (cb, eb) { this.then(cb, eb).then(null, function (err) { setTimeout(function () { throw err; }, 0); }); }; }
-
// --------------------------------------------------------------------------
@@ -224,40 +220,20 @@ if (!Promise.prototype.done) { Promise.prototype.done = function (cb, eb) { this
function _css(sel, prop, val)
{
- var equi;
-
//Camel-case
prop = _toCamel(prop);
- //Equivalent properties for 'special' browsers
- equi = {
- outerHeight: "offsetHeight",
- outerWidth: "offsetWidth",
- top: "posTop"
- };
-
-
//If you don't define a value, try returning the existing value
if(val === undefined && sel.style[prop] !== undefined)
{
return sel.style[prop];
}
- else if(val === undefined && sel.style[equi[prop]] !== undefined)
- {
- return sel.style[equi[prop]];
- }
- //Let's try the easy way first
+ // Let's set a value instead
if(sel.style[prop] !== undefined)
{
sel.style[prop] = val;
- //Short circuit
- return null;
- }
- else if(sel.style[equi[prop]])
- {
- sel.style[equi[prop]] = val;
return null;
}
}
@@ -423,14 +399,11 @@ if (!Promise.prototype.done) { Promise.prototype.done = function (cb, eb) { this
// If passed an object, recurse!
if($_.type(prop) === 'object')
{
- for (prop_key in prop)
- {
- if ( ! prop.hasOwnProperty(prop_key)) continue;
-
+ Object.keys(prop).forEach(function(prop_key) {
$_.each(function (e){
_css(e, prop_key, prop[prop_key]);
});
- }
+ });
}
//Return the current value if a value is not set
else if(val === undefined && $_.type(prop) !== 'object')
@@ -706,21 +679,13 @@ if (!Promise.prototype.done) { Promise.prototype.done = function (cb, eb) { this
*/
create: function(name, data)
{
- // Do a terrible browser-sniffic hack because I don't know of a good
- // feature test
- if (/MSIE|Trident/i.test(navigator.userAgent))
- {
+ data = data || {};
+
// Okay, I guess we have to do this the hard way... :(
- // Microsoft, your browser still sucks
var e = document.createEvent('CustomEvent');
e.initCustomEvent(name, true, true, data);
return e;
- }
- else
- {
- return new CustomEvent(name, data);
- }
},
/**
* Adds an event that returns a callback when triggered on the selected
diff --git a/kis-lite-dom-min.js b/kis-lite-dom-min.js
index 9204be1..aafdbec 100755
--- a/kis-lite-dom-min.js
+++ b/kis-lite-dom-min.js
@@ -1,9 +1,9 @@
-(function(e){var c,h,b;c=function(a){b=a===e?c.el!==e?c.el:document.documentElement:h(a);c.prototype.el=b;a=Object.create(c);for(var d in a)"object"===typeof a[d]&&(a[d].el=b);a.el=b;return a};h=function(a,d){var b;if("string"!=typeof a||a===e)return a;b=null!=d&&1===d.nodeType?d:document;if(a.match(/^#([\w\-]+$)/))return document.getElementById(a.split("#")[1]);b=b.querySelectorAll(a);return 1===b.length?b[0]:b};c.ext=function(a,d){d.el=b;c[a]=d};c.ext("each",function(a){b.length!==e&&b!==window?
-[].forEach.call(b,a):a.call(b,b)});c.type=function(a){return function(){return a&&a!==this}.call(a)?(typeof a).toLowerCase():{}.toString.call(a).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};c=window.$_=window.$_||c;c.$=h})();Promise.prototype.done||(Promise.prototype.done=function(e,c){this.then(e,c).then(null,function(e){setTimeout(function(){throw e;},0)})});
-(function(e){var c={_do:function(c,b,a,d,g){var f=new XMLHttpRequest;a===e&&(a=function(){});g=g?"POST":"GET";"GET"===g&&(c+=c.match(/\?/)?this._serialize(b):"?"+this._serialize(b));f.open(g,c);f.onreadystatechange=function(){4===f.readyState&&(200===f.status?a.call(f.responseText,f.responseText):d!==e&&d.call(f.status,f.status))};"POST"===g?(f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.send(this._serialize(b))):f.send(null)},_serialize:function(c){var b,a,d=[];for(b in c)c.hasOwnProperty(b)&&
-"function"!==$_.type(c[b])&&(a=c[b].toString(),b=encodeURIComponent(b),a=encodeURIComponent(a),d.push(b+"="+a));return d.join("&")}};$_.ext("get",function(e,b,a,d){c._do(e,b,a,d,!1)});$_.ext("post",function(e,b,a,d){c._do(e,b,a,d,!0)})})();
-(function(e){var c,h;c=function(b,a,d,g){var f,e;if(a.match(/^([\w\-]+)$/))!0===g?b.addEventListener(a,d,!1):b.removeEventListener(a,d,!1);else for(a=a.split(" "),e=a.length,f=0;f