Misc cleanup
This commit is contained in:
parent
e3f79c3fa2
commit
3f3956a345
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -57,7 +57,7 @@
|
||||
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="COMM">// Add the selector to the prototype</span><span class="WHIT">
|
||||
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="NAME">$_.prototype.el</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 52</span>
|
||||
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="COMM">// Make a copy before adding properties</span><span class="WHIT">
|
||||
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="COMM">// Use the $_ object as it's own prototype</span><span class="WHIT">
|
||||
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dcopy</span><span class="PUNC">(</span><span class="NAME">$_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 55</span>
|
||||
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="COMM">// Give sel to each extension.</span><span class="WHIT">
|
||||
|
@ -146,8 +146,8 @@
|
||||
<span class='line'>139</span> </span><span class="WHIT">
|
||||
<span class='line'>140</span> </span><span class="NAME">setInterval</span><span class="PUNC">(</span><span class="NAME">$_.get</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">poll_rate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">url</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">res</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>141</span> </span><span class="WHIT"> </span><span class="NAME">res.trim</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">replace</span><span class="PUNC">(</span><span class="REGX">/data:/gim</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>142</span> </span><span class="WHIT"> </span><span class="NAME">res.replace</span><span class="PUNC">(</span><span class="REGX">/^event|id|retry?:(.*)$/gim</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">res</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>142</span> </span><span class="WHIT"> </span><span class="NAME">res.replace</span><span class="PUNC">(</span><span class="REGX">/^(event|id|retry)?\:(.*)$/gim</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="NAME">callback.call</span><span class="PUNC">(</span><span class="NAME">res</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>146</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
|
122
kis-all.js
122
kis-all.js
@ -50,7 +50,7 @@
|
||||
// Add the selector to the prototype
|
||||
$_.prototype.el = sel;
|
||||
|
||||
// Make a copy before adding properties
|
||||
// Use the $_ object as it's own prototype
|
||||
var self = dcopy($_);
|
||||
|
||||
// Give sel to each extension.
|
||||
@ -969,8 +969,8 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
|
||||
setInterval($_.get, poll_rate, url, {}, function(res){
|
||||
res.trim().replace(/data:/gim, '');
|
||||
res.replace(/^event|id|retry?:(.*)$/gim, '');
|
||||
callback(res);
|
||||
res.replace(/^(event|id|retry)?\:(.*)$/gim, '');
|
||||
callback.call(res, res);
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -1233,122 +1233,6 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Module for simplifying Indexed DB access
|
||||
*/
|
||||
|
||||
var db = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.msIndexedDB,
|
||||
indexedDB = {};
|
||||
|
||||
//Well, some browsers don't support it yet
|
||||
if(typeof db === "undefined")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
var request = {};
|
||||
|
||||
version = version || 1;
|
||||
|
||||
// Ask for permission to use db
|
||||
request = db.open(dbname, version);
|
||||
|
||||
// Assign onupgradeneeded callback
|
||||
if(typeof onupgradeneeded !== "undefined")
|
||||
{
|
||||
request.onupgradeneeded = onupgradeneeded;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
request.onerror = function(event)
|
||||
{
|
||||
console.log("IndexedDB disallowed.");
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
request.onsuccess = function(event)
|
||||
{
|
||||
// Connect to the specified db
|
||||
indexedDB.current_db = request.result;
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Helper function to create a new object store
|
||||
*
|
||||
* @memberOf $_.indexedDB
|
||||
* @name create_store
|
||||
* @function
|
||||
* @param string name
|
||||
* @param [string] key
|
||||
* @param [bool] generator
|
||||
* @return IDBDataStore object
|
||||
*/
|
||||
create_store: function(name, key, generator)
|
||||
{
|
||||
var params = {};
|
||||
|
||||
if(typeof key !== "undefined")
|
||||
{
|
||||
params.keyPath = key;
|
||||
}
|
||||
|
||||
if(typeof generator !== "undefined")
|
||||
{
|
||||
// Cast to a boolean value
|
||||
params.autoIncrement = !! generator;
|
||||
}
|
||||
|
||||
return db.createObjectStore(name, params);
|
||||
},
|
||||
/**
|
||||
* Delete an object store
|
||||
*
|
||||
* @memberOf $_.indexedDB
|
||||
* @name delete_store
|
||||
* @function
|
||||
* @param string name
|
||||
*/
|
||||
delete_store: function(name)
|
||||
{
|
||||
var request = db.deleteObjectStore();
|
||||
|
||||
// Pass the error up
|
||||
request.onerror = db.onerror;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$_.ext('indexedDB', indexedDB);
|
||||
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
|
2
kis-lite-dom-min.js
vendored
2
kis-lite-dom-min.js
vendored
@ -3,7 +3,7 @@ return 1===b.length?b[0]:b};e=function(a){var d;if("undefined"!==typeof a){if("u
|
||||
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.$=g}})();"undefined"===typeof window.console&&(window.console={log:function(){}});"undefined"===typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")});
|
||||
"undefined"===typeof Event.preventDefault&&"undefined"!==typeof window.event&&(Event.prototype.preventDefault=function(){window.event.returnValue=false},Event.prototype.stopPropagation=function(){window.event.cancelBubble=true});"undefined"===typeof Array.isArray&&(Array.isArray=function(c){return Object.prototype.toString.apply(c)==="[object Array]"});
|
||||
(function(){if(typeof window.XMLHttpRequest!=="undefined"){var c={_do:function(g,c,b,a){var d=new XMLHttpRequest;typeof b==="undefined"&&(b=function(){});a=a?"POST":"GET";g=g+(a==="GET"?"?"+this._serialize(c):"");d.open(a,g);d.onreadystatechange=function(){d.readyState===4&&b(d.responseText)};if(a==="POST"){d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.send(this._serialize(c))}else d.send(null)},_serialize:function(c){var e,b,a=[];for(e in c)if(c.hasOwnProperty(e)&&typeof c[e]!==
|
||||
"function"){b=c[e].toString();e=encodeURIComponent(e);b=encodeURIComponent(b);a.push(e+"="+b)}return a.join("&")}};$_.ext("get",function(g,e,b){c._do(g,e,b,false)});$_.ext("post",function(g,e,b){c._do(g,e,b,true)});$_.ext("sse",function(c,e,b){if(typeof EventSource!=="undefined"){c=new EventSource(c);c.onmessage=function(a){e(a.data)}}else setInterval($_.get,b||3E4,c,{},function(a){a.trim().replace(/data:/gim,"");a.replace(/^event|id|retry?:(.*)$/gim,"");e(a)})})}})();
|
||||
"function"){b=c[e].toString();e=encodeURIComponent(e);b=encodeURIComponent(b);a.push(e+"="+b)}return a.join("&")}};$_.ext("get",function(g,e,b){c._do(g,e,b,false)});$_.ext("post",function(g,e,b){c._do(g,e,b,true)});$_.ext("sse",function(c,e,b){if(typeof EventSource!=="undefined"){c=new EventSource(c);c.onmessage=function(a){e(a.data)}}else setInterval($_.get,b||3E4,c,{},function(a){a.trim().replace(/data:/gim,"");a.replace(/^(event|id|retry)?\:(.*)$/gim,"");e.call(a,a)})})}})();
|
||||
(function(){var c,g,e,b;if(typeof document.addEventListener!=="undefined"){c=function(a,d,b){typeof a.addEventListener!=="undefined"&&a.addEventListener(d,b,false)};g=function(a,d,b){typeof a.removeEventListener!=="undefined"&&a.removeEventListener(d,b,false)}}else if(typeof document.attachEvent!=="undefined"){c=function(a,b,h){function c(a){h.apply(a)}if(typeof a.attachEvent!=="undefined"){g(b,h);a.attachEvent("on"+b,c);a=a.KIS_0_6_0=a.KIS_0_6_0||{};a.listeners=a.listeners||{};a.listeners[b]=a.listeners[b]||
|
||||
[];a.listeners[b].push({callback:h,_listener:c})}else console.log("Failed to _attach event:"+b+" on "+a)};g=function(a,b,c){if(typeof a.detachEvent!=="undefined"){var f=a.KIS_0_6_0;if(f&&f.listeners&&f.listeners[b])for(var e=f.listeners[b],g=e.length,i=0;i<g;i++)if(e[i].callback===c){a.detachEvent("on"+b,e[i]._listener);e.splice(i,1);e.length===0&&delete f.listeners[b];break}}}}e=function(a,b,h,f){var j,k;if(typeof a==="undefined"){console.log(arguments);console.log(b);return false}if(b.match(/^([\w\-]+)$/))f===
|
||||
true?c(a,b,h):g(a,b,h);else{b=b.split(" ");k=b.length;for(j=0;j<k;j++)e(a,b[j],h,f)}};b=function(a,b,c,f){e(a,c,function(c){var h,i,e,c=c||window.event;i=$_.$(b,a);for(h in i){e=c.target||c.srcElement;if(e==i[h]){f.call(i[h],c);c.stopPropagation()}}},true)};$_.ext("event",{add:function(a,b){$_.each(function(c){e(c,a,b,true)})},remove:function(a,b){$_.each(function(c){e(c,a,b,false)})},live:function(a,d,c){b(document.documentElement,a,d,c)},delegate:function(a,d,c){$_.each(function(e){b(e,a,d,c)})}})})();
|
||||
|
@ -50,7 +50,7 @@
|
||||
// Add the selector to the prototype
|
||||
$_.prototype.el = sel;
|
||||
|
||||
// Make a copy before adding properties
|
||||
// Use the $_ object as it's own prototype
|
||||
var self = dcopy($_);
|
||||
|
||||
// Give sel to each extension.
|
||||
@ -422,8 +422,8 @@ if (typeof Array.isArray === "undefined")
|
||||
|
||||
setInterval($_.get, poll_rate, url, {}, function(res){
|
||||
res.trim().replace(/data:/gim, '');
|
||||
res.replace(/^event|id|retry?:(.*)$/gim, '');
|
||||
callback(res);
|
||||
res.replace(/^(event|id|retry)?\:(.*)$/gim, '');
|
||||
callback.call(res, res);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
2
kis-lite-min.js
vendored
2
kis-lite-min.js
vendored
@ -3,7 +3,7 @@ return 1===g.length?g[0]:g};e=function(a){var b;if("undefined"!==typeof a){if("u
|
||||
c)});f.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()};f=window.$_=window.$_||f;f.$=d}})();"undefined"===typeof window.console&&(window.console={log:function(){}});"undefined"===typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")});
|
||||
"undefined"===typeof Event.preventDefault&&"undefined"!==typeof window.event&&(Event.prototype.preventDefault=function(){window.event.returnValue=false},Event.prototype.stopPropagation=function(){window.event.cancelBubble=true});"undefined"===typeof Array.isArray&&(Array.isArray=function(f){return Object.prototype.toString.apply(f)==="[object Array]"});
|
||||
(function(){if(typeof window.XMLHttpRequest!=="undefined"){var f={_do:function(d,e,c,a){var b=new XMLHttpRequest;typeof c==="undefined"&&(c=function(){});a=a?"POST":"GET";d=d+(a==="GET"?"?"+this._serialize(e):"");b.open(a,d);b.onreadystatechange=function(){b.readyState===4&&c(b.responseText)};if(a==="POST"){b.setRequestHeader("Content-Type","application/x-www-form-urlencoded");b.send(this._serialize(e))}else b.send(null)},_serialize:function(d){var e,c,a=[];for(e in d)if(d.hasOwnProperty(e)&&typeof d[e]!==
|
||||
"function"){c=d[e].toString();e=encodeURIComponent(e);c=encodeURIComponent(c);a.push(e+"="+c)}return a.join("&")}};$_.ext("get",function(d,e,c){f._do(d,e,c,false)});$_.ext("post",function(d,e,c){f._do(d,e,c,true)});$_.ext("sse",function(d,e,c){if(typeof EventSource!=="undefined"){d=new EventSource(d);d.onmessage=function(a){e(a.data)}}else setInterval($_.get,c||3E4,d,{},function(a){a.trim().replace(/data:/gim,"");a.replace(/^event|id|retry?:(.*)$/gim,"");e(a)})})}})();
|
||||
"function"){c=d[e].toString();e=encodeURIComponent(e);c=encodeURIComponent(c);a.push(e+"="+c)}return a.join("&")}};$_.ext("get",function(d,e,c){f._do(d,e,c,false)});$_.ext("post",function(d,e,c){f._do(d,e,c,true)});$_.ext("sse",function(d,e,c){if(typeof EventSource!=="undefined"){d=new EventSource(d);d.onmessage=function(a){e(a.data)}}else setInterval($_.get,c||3E4,d,{},function(a){a.trim().replace(/data:/gim,"");a.replace(/^(event|id|retry)?\:(.*)$/gim,"");e.call(a,a)})})}})();
|
||||
(function(){var f,d,e,c;if(typeof document.addEventListener!=="undefined"){f=function(a,b,g){typeof a.addEventListener!=="undefined"&&a.addEventListener(b,g,false)};d=function(a,b,g){typeof a.removeEventListener!=="undefined"&&a.removeEventListener(b,g,false)}}else if(typeof document.attachEvent!=="undefined"){f=function(a,b,g){function c(a){g.apply(a)}if(typeof a.attachEvent!=="undefined"){d(b,g);a.attachEvent("on"+b,c);a=a.KIS_0_6_0=a.KIS_0_6_0||{};a.listeners=a.listeners||{};a.listeners[b]=a.listeners[b]||
|
||||
[];a.listeners[b].push({callback:g,_listener:c})}else console.log("Failed to _attach event:"+b+" on "+a)};d=function(a,b,c){if(typeof a.detachEvent!=="undefined"){var d=a.KIS_0_6_0;if(d&&d.listeners&&d.listeners[b])for(var e=d.listeners[b],f=e.length,h=0;h<f;h++)if(e[h].callback===c){a.detachEvent("on"+b,e[h]._listener);e.splice(h,1);e.length===0&&delete d.listeners[b];break}}}}e=function(a,b,c,j){var i,k;if(typeof a==="undefined"){console.log(arguments);console.log(b);return false}if(b.match(/^([\w\-]+)$/))j===
|
||||
true?f(a,b,c):d(a,b,c);else{b=b.split(" ");k=b.length;for(i=0;i<k;i++)e(a,b[i],c,j)}};c=function(a,b,c,d){e(a,c,function(c){var e,g,f,c=c||window.event;g=$_.$(b,a);for(e in g){f=c.target||c.srcElement;if(f==g[e]){d.call(g[e],c);c.stopPropagation()}}},true)};$_.ext("event",{add:function(a,b){$_.each(function(c){e(c,a,b,true)})},remove:function(a,b){$_.each(function(c){e(c,a,b,false)})},live:function(a,b,d){c(document.documentElement,a,b,d)},delegate:function(a,b,d){$_.each(function(e){c(e,a,b,d)})}})})();
|
||||
|
@ -50,7 +50,7 @@
|
||||
// Add the selector to the prototype
|
||||
$_.prototype.el = sel;
|
||||
|
||||
// Make a copy before adding properties
|
||||
// Use the $_ object as it's own prototype
|
||||
var self = dcopy($_);
|
||||
|
||||
// Give sel to each extension.
|
||||
@ -422,8 +422,8 @@ if (typeof Array.isArray === "undefined")
|
||||
|
||||
setInterval($_.get, poll_rate, url, {}, function(res){
|
||||
res.trim().replace(/data:/gim, '');
|
||||
res.replace(/^event|id|retry?:(.*)$/gim, '');
|
||||
callback(res);
|
||||
res.replace(/^(event|id|retry)?\:(.*)$/gim, '');
|
||||
callback.call(res, res);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
41
kis-min.js
vendored
41
kis-min.js
vendored
@ -1,22 +1,21 @@
|
||||
(function(){if("undefined"!==typeof document.querySelector){var e,n,q,f;e=function(g){f="undefined"===typeof g?"undefined"!==typeof e.el?e.el:document.documentElement:"object"!==typeof g?n(g):g;e.prototype.el=f;var g=q(e),i;for(i in g)"object"===typeof g[i]&&(g[i].el=f);g.el=f;return g};n=function(g,e){var f;if("string"!=typeof g||"undefined"===typeof g)return g;f=null!=e&&1===e.nodeType?e:document;if(g.match(/^#([\w\-]+$)/))return document.getElementById(g.split("#")[1]);f=f.querySelectorAll(g);
|
||||
return 1===f.length?f[0]:f};q=function(e){var f;if("undefined"!==typeof e){if("undefined"!==typeof Object.create)return Object.create(e);f=typeof e;if(!("object"!==f&&"function"!==f))return f=function(){},f.prototype=e,new f}};e.ext=function(g,i){i.el=f;e[g]=i};e.ext("each",function(e){if("undefined"!==typeof f.length&&f!==window)if("undefined"!==typeof Array.prototype.forEach)[].forEach.call(f,e);else{var i=f.length;if(0!==i)for(var k,j=0;j<i;j++)k=f.item(j)?f.item(j):f[j],e.call(k,k)}else e.call(f,
|
||||
f)});e.type=function(e){return function(){return e&&e!==this}.call(e)?(typeof e).toLowerCase():{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};e=window.$_=window.$_||e;e.$=n}})();"undefined"===typeof window.console&&(window.console={log:function(){}});"undefined"===typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")});
|
||||
(function(){if("undefined"!==typeof document.querySelector){var e,k,p,f;e=function(h){f="undefined"===typeof h?"undefined"!==typeof e.el?e.el:document.documentElement:"object"!==typeof h?k(h):h;e.prototype.el=f;var h=p(e),i;for(i in h)"object"===typeof h[i]&&(h[i].el=f);h.el=f;return h};k=function(h,e){var f;if("string"!=typeof h||"undefined"===typeof h)return h;f=null!=e&&1===e.nodeType?e:document;if(h.match(/^#([\w\-]+$)/))return document.getElementById(h.split("#")[1]);f=f.querySelectorAll(h);
|
||||
return 1===f.length?f[0]:f};p=function(e){var f;if("undefined"!==typeof e){if("undefined"!==typeof Object.create)return Object.create(e);f=typeof e;if(!("object"!==f&&"function"!==f))return f=function(){},f.prototype=e,new f}};e.ext=function(h,i){i.el=f;e[h]=i};e.ext("each",function(e){if("undefined"!==typeof f.length&&f!==window)if("undefined"!==typeof Array.prototype.forEach)[].forEach.call(f,e);else{var i=f.length;if(0!==i)for(var l,j=0;j<i;j++)l=f.item(j)?f.item(j):f[j],e.call(l,l)}else e.call(f,
|
||||
f)});e.type=function(e){return function(){return e&&e!==this}.call(e)?(typeof e).toLowerCase():{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};e=window.$_=window.$_||e;e.$=k}})();"undefined"===typeof window.console&&(window.console={log:function(){}});"undefined"===typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")});
|
||||
"undefined"===typeof Event.preventDefault&&"undefined"!==typeof window.event&&(Event.prototype.preventDefault=function(){window.event.returnValue=false},Event.prototype.stopPropagation=function(){window.event.cancelBubble=true});"undefined"===typeof Array.isArray&&(Array.isArray=function(e){return Object.prototype.toString.apply(e)==="[object Array]"});
|
||||
(function(e){function n(a,b,c){var d,h;if(typeof a.hasAttribute!=="undefined"){a.hasAttribute(b)&&(d=a.getAttribute(b));h=true}else if(typeof a[b]!=="undefined"){d=a[b];h=false}else if(b==="class"&&typeof a.className!=="undefined"){b="className";d=a.className;h=false}if(typeof d==="undefined"&&(typeof c==="undefined"||c===null)){console.log(c);console.log(a);console.log("Element does not have the selected attribute");return null}if(typeof c==="undefined")return d;typeof c!=="undefined"&&c!==null?
|
||||
h===true?a.setAttribute(b,c):a[b]=c:c===null&&(h===true?a.removeAttribute(b):delete a[b]);return typeof c!=="undefined"?c:d}function q(a){return a.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")})}function f(a,b,c){var d,b=q(b);d={outerHeight:"offsetHeight",outerWidth:"offsetWidth",top:"posTop"};if(typeof c==="undefined"&&a.style[b]!=="undefined")return a.style[b];if(typeof c==="undefined"&&a.style[d[b]]!=="undefined")return a.style[d[b]];if(typeof a.style[b]!=="undefined"){a.style[b]=
|
||||
c;return null}if(a.style[d[b]]){a.style[d[b]]=c;return null}console.log("Property "+b+" nor an equivalent seems to exist")}typeof document!=="undefined"&&!("classList"in document.createElement("a"))&&function(a){var a=(a.HTMLElement||a.Element).prototype,b=Object,c=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},d=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1},h=function(a,b){this.name=a;this.code=DOMException[a];
|
||||
this.message=b},e=function(a,b){if(b==="")throw new h("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(b))throw new h("INVALID_CHARACTER_ERR","String contains an invalid character");return d.call(a,b)},o=function(a){for(var b=c.call(a.className),b=b?b.split(/\s+/):[],d=0,h=b.length;d<h;d++)this.push(b[d]);this._updateClassName=function(){a.className=this.toString()}},f=o.prototype=[],g=function(){return new o(this)};h.prototype=Error.prototype;f.item=function(a){return this[a]||
|
||||
null};f.contains=function(a){return e(this,a+"")!==-1};f.add=function(a){a=a+"";if(e(this,a)===-1){this.push(a);this._updateClassName()}};f.remove=function(a){a=e(this,a+"");if(a!==-1){this.splice(a,1);this._updateClassName()}};f.toggle=function(a){a=a+"";e(this,a)===-1?this.add(a):this.remove(a)};f.toString=function(){return this.join(" ")};if(b.defineProperty){f={get:g,enumerable:true,configurable:true};try{b.defineProperty(a,"classList",f)}catch(i){if(i.number===-2146823252){f.enumerable=false;
|
||||
b.defineProperty(a,"classList",f)}}}else b.prototype.__defineGetter__&&a.__defineGetter__("classList",g)}(self);e.ext("dom",{addClass:function(a){e.each(function(b){b.classList.add(a)})},removeClass:function(a){e.each(function(b){b.classList.remove(a)})},hide:function(){this.css("display","none")},show:function(a){typeof a==="undefined"&&(a="block");this.css("display",a)},attr:function(a,b){var c=this.el;if(c.length>1&&typeof b==="undefined"){console.log(c);console.log("Must be a singular element")}else if(c.length>
|
||||
1&&typeof b!=="undefined")e.each(function(c){return n(c,a,b)});else return n(c,a,b)},text:function(a){var b,c,d;d=this.el;c=typeof d.textContent!=="undefined"?"textContent":typeof d.innerText!=="undefined"?"innerText":"innerHTML";b=d[c];if(typeof a!=="undefined")return d[c]=a;return b},css:function(a,b){if(typeof b==="undefined")return f(this.el,a);e.each(function(c){f(c,a,b)})},append:function(a){typeof document.insertAdjacentHTML!=="undefined"?this.el.insertAdjacentHTML("beforeend",a):this.el.innerHTML=
|
||||
this.el.innerHTML+a},prepend:function(a){typeof document.insertAdjacentHTML!=="undefined"?this.el.insertAdjacentHTML("afterbegin",a):this.el.innerHTML=a+this.el.innerHTML},html:function(a){if(typeof a!=="undefined")this.el.innerHTML=a;return this.el.innerHTML}});if(typeof window.XMLHttpRequest!=="undefined"){var g={_do:function(a,b,c,d){var h=new XMLHttpRequest;typeof c==="undefined"&&(c=function(){});d=d?"POST":"GET";a=a+(d==="GET"?"?"+this._serialize(b):"");h.open(d,a);h.onreadystatechange=function(){h.readyState===
|
||||
4&&c(h.responseText)};if(d==="POST"){h.setRequestHeader("Content-Type","application/x-www-form-urlencoded");h.send(this._serialize(b))}else h.send(null)},_serialize:function(a){var b,c,d=[];for(b in a)if(a.hasOwnProperty(b)&&typeof a[b]!=="function"){c=a[b].toString();b=encodeURIComponent(b);c=encodeURIComponent(c);d.push(b+"="+c)}return d.join("&")}};e.ext("get",function(a,b,c){g._do(a,b,c,false)});e.ext("post",function(a,b,c){g._do(a,b,c,true)});e.ext("sse",function(a,b,c){if(typeof EventSource!==
|
||||
"undefined"){a=new EventSource(a);a.onmessage=function(a){b(a.data)}}else setInterval(e.get,c||3E4,a,{},function(a){a.trim().replace(/data:/gim,"");a.replace(/^event|id|retry?:(.*)$/gim,"");b(a)})});var i,k,j,r;if(typeof document.addEventListener!=="undefined"){i=function(a,b,c){typeof a.addEventListener!=="undefined"&&a.addEventListener(b,c,false)};k=function(a,b,c){typeof a.removeEventListener!=="undefined"&&a.removeEventListener(b,c,false)}}else if(typeof document.attachEvent!=="undefined"){i=
|
||||
function(a,b,c){function d(a){c.apply(a)}if(typeof a.attachEvent!=="undefined"){k(b,c);a.attachEvent("on"+b,d);a=a.KIS_0_6_0=a.KIS_0_6_0||{};a.listeners=a.listeners||{};a.listeners[b]=a.listeners[b]||[];a.listeners[b].push({callback:c,_listener:d})}else console.log("Failed to _attach event:"+b+" on "+a)};k=function(a,b,c){if(typeof a.detachEvent!=="undefined"){var d=a.KIS_0_6_0;if(d&&d.listeners&&d.listeners[b])for(var h=d.listeners[b],e=h.length,f=0;f<e;f++)if(h[f].callback===c){a.detachEvent("on"+
|
||||
b,h[f]._listener);h.splice(f,1);h.length===0&&delete d.listeners[b];break}}}}j=function(a,b,c,d){var h,e;if(typeof a==="undefined"){console.log(arguments);console.log(b);return false}if(b.match(/^([\w\-]+)$/))d===true?i(a,b,c):k(a,b,c);else{b=b.split(" ");e=b.length;for(h=0;h<e;h++)j(a,b[h],c,d)}};r=function(a,b,c,d){j(a,c,function(c){var f,o,g,c=c||window.event;o=e.$(b,a);for(f in o){g=c.target||c.srcElement;if(g==o[f]){d.call(o[f],c);c.stopPropagation()}}},true)};e.ext("event",{add:function(a,b){e.each(function(c){j(c,
|
||||
a,b,true)})},remove:function(a,b){e.each(function(c){j(c,a,b,false)})},live:function(a,b,c){r(document.documentElement,a,b,c)},delegate:function(a,b,c){e.each(function(d){r(d,a,b,c)})}});var l=window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.msIndexedDB,s={};if(typeof l!=="undefined"){s={current_db:null,connect:function(a,b,c){var d={},d=l.open(a,b||1);if(typeof c!=="undefined")d.onupgradeneeded=c;d.onerror=function(){console.log("IndexedDB disallowed.")};d.onsuccess=function(){s.current_db=
|
||||
d.result}},create_store:function(a,b,c){var d={};if(typeof b!=="undefined")d.keyPath=b;if(typeof c!=="undefined")d.autoIncrement=!!c;return l.createObjectStore(a,d)},delete_store:function(){l.deleteObjectStore().onerror=l.onerror}};e.ext("indexedDB",s);if(typeof localStorage==="undefined"||typeof JSON==="undefined")return null;var m=localStorage,p=sessionStorage;e.ext("store",{get:function(a,b){var c=b?p.getItem(a):m.getItem(a);return JSON.parse(c)},set:function(a,b,c){b=JSON.stringify(b);c?p.setItem(a,
|
||||
b):m.setItem(a,b)},remove:function(a,b){b?p.removeItem(a):m.removeItem(a)},getAll:function(a){var b,c={},d,e;e=a?m:p;b=e.length;for(a=0;a<b;a++){d=e.key(a);c[d]=e.getItem(d)}return c},clear:function(a){a?p.clear():m.clear()}});var u=function(a){var b=[],c=0,d={},e,b=t.object_keys(a);b.sort(function(a,b){var c=parseFloat(b),d=parseFloat(a),e=c+""===b,h=d+""===a;return e&&h?c>d?1:c<d?-1:0:e&&!h?1:!e&&h?-1:b>a?1:b<a?-1:0});c=b.length;for(e=0;e<c;e++)d[b[e]]=a[b[e]];return d},t={object_keys:function(a){var b=
|
||||
[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b},object_values:function(a){var b=[],c;for(c in a)b.push(a[c]);return b},array_combine:function(a,b){var c={},d,h=0;e.type(a)!=="array"&&(a=this.object_values(a));e.type(b)!=="array"&&(b=this.object_values(b));d=a.length;if(d!==b.length){console.log("Object combine requires two arrays of the same size");return false}for(h=0;h<d;h++)c[a[h]]=b[h];return c},object_merge:function(){var a=Array.prototype.slice.call(arguments),b=a.length,c={},d,h=0,
|
||||
f,g,i;d=true;for(f=0;f<b;f++)if(e.type(a[f])!=="array"){d=false;break}if(d){c=[];for(f=0;f<b;f++)c=c.contact(a[f]);return c}for(i=f=0;f<b;f++){d=a[f];if(e.type(d)=="array"){g=0;for(h=d.length;g<h;g++)c[i++]=d[g]}else for(g in d)d.hasOwnProperty(g)&&(parseInt(g,10)+""===g?c[i++]=d[g]:c[g]=d[g])}return c},str_trans:function(a,b,c){var d=[],e=[],f=false,g=0,i=0,j="",k="",n="",l="",m;if(typeof b==="object"){b=u(b);for(m in b)if(b.hasOwnProperty(m)){d.push(m);e.push(b[m])}b=d;c=e}i=a.length;g=b.length;
|
||||
j=typeof c==="string";k=typeof b==="string";for(d=0;d<i;d++){f=false;if(k){a.charAt(d-1);n=a.charAt(d);a.charAt(d+1);for(e=0;e<g;e++)if(n==b.charAt(e)){f=true;break}}else for(e=0;e<g;e++)if(a.substr(d,b[e].length)==b[e]){f=true;d=d+b[e].length-1;break}l=f?l+(j?c.charAt(e):c[e]):l+a.charAt(d)}return l}};e.ext("util",t)}}})($_);
|
||||
(function(e){function k(a,b,c){var d,g;if(typeof a.hasAttribute!=="undefined"){a.hasAttribute(b)&&(d=a.getAttribute(b));g=true}else if(typeof a[b]!=="undefined"){d=a[b];g=false}else if(b==="class"&&typeof a.className!=="undefined"){b="className";d=a.className;g=false}if(typeof d==="undefined"&&(typeof c==="undefined"||c===null)){console.log(c);console.log(a);console.log("Element does not have the selected attribute");return null}if(typeof c==="undefined")return d;typeof c!=="undefined"&&c!==null?
|
||||
g===true?a.setAttribute(b,c):a[b]=c:c===null&&(g===true?a.removeAttribute(b):delete a[b]);return typeof c!=="undefined"?c:d}function p(a){return a.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")})}function f(a,b,c){var d,b=p(b);d={outerHeight:"offsetHeight",outerWidth:"offsetWidth",top:"posTop"};if(typeof c==="undefined"&&a.style[b]!=="undefined")return a.style[b];if(typeof c==="undefined"&&a.style[d[b]]!=="undefined")return a.style[d[b]];if(typeof a.style[b]!=="undefined"){a.style[b]=
|
||||
c;return null}if(a.style[d[b]]){a.style[d[b]]=c;return null}console.log("Property "+b+" nor an equivalent seems to exist")}typeof document!=="undefined"&&!("classList"in document.createElement("a"))&&function(a){var a=(a.HTMLElement||a.Element).prototype,b=Object,c=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},d=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1},g=function(a,b){this.name=a;this.code=DOMException[a];
|
||||
this.message=b},e=function(a,b){if(b==="")throw new g("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(b))throw new g("INVALID_CHARACTER_ERR","String contains an invalid character");return d.call(a,b)},n=function(a){for(var b=c.call(a.className),b=b?b.split(/\s+/):[],d=0,g=b.length;d<g;d++)this.push(b[d]);this._updateClassName=function(){a.className=this.toString()}},f=n.prototype=[],h=function(){return new n(this)};g.prototype=Error.prototype;f.item=function(a){return this[a]||
|
||||
null};f.contains=function(a){return e(this,a+"")!==-1};f.add=function(a){a=a+"";if(e(this,a)===-1){this.push(a);this._updateClassName()}};f.remove=function(a){a=e(this,a+"");if(a!==-1){this.splice(a,1);this._updateClassName()}};f.toggle=function(a){a=a+"";e(this,a)===-1?this.add(a):this.remove(a)};f.toString=function(){return this.join(" ")};if(b.defineProperty){f={get:h,enumerable:true,configurable:true};try{b.defineProperty(a,"classList",f)}catch(i){if(i.number===-2146823252){f.enumerable=false;
|
||||
b.defineProperty(a,"classList",f)}}}else b.prototype.__defineGetter__&&a.__defineGetter__("classList",h)}(self);e.ext("dom",{addClass:function(a){e.each(function(b){b.classList.add(a)})},removeClass:function(a){e.each(function(b){b.classList.remove(a)})},hide:function(){this.css("display","none")},show:function(a){typeof a==="undefined"&&(a="block");this.css("display",a)},attr:function(a,b){var c=this.el;if(c.length>1&&typeof b==="undefined"){console.log(c);console.log("Must be a singular element")}else if(c.length>
|
||||
1&&typeof b!=="undefined")e.each(function(c){return k(c,a,b)});else return k(c,a,b)},text:function(a){var b,c,d;d=this.el;c=typeof d.textContent!=="undefined"?"textContent":typeof d.innerText!=="undefined"?"innerText":"innerHTML";b=d[c];if(typeof a!=="undefined")return d[c]=a;return b},css:function(a,b){if(typeof b==="undefined")return f(this.el,a);e.each(function(c){f(c,a,b)})},append:function(a){typeof document.insertAdjacentHTML!=="undefined"?this.el.insertAdjacentHTML("beforeend",a):this.el.innerHTML=
|
||||
this.el.innerHTML+a},prepend:function(a){typeof document.insertAdjacentHTML!=="undefined"?this.el.insertAdjacentHTML("afterbegin",a):this.el.innerHTML=a+this.el.innerHTML},html:function(a){if(typeof a!=="undefined")this.el.innerHTML=a;return this.el.innerHTML}});if(typeof window.XMLHttpRequest!=="undefined"){var h={_do:function(a,b,c,d){var g=new XMLHttpRequest;typeof c==="undefined"&&(c=function(){});d=d?"POST":"GET";a=a+(d==="GET"?"?"+this._serialize(b):"");g.open(d,a);g.onreadystatechange=function(){g.readyState===
|
||||
4&&c(g.responseText)};if(d==="POST"){g.setRequestHeader("Content-Type","application/x-www-form-urlencoded");g.send(this._serialize(b))}else g.send(null)},_serialize:function(a){var b,c,d=[];for(b in a)if(a.hasOwnProperty(b)&&typeof a[b]!=="function"){c=a[b].toString();b=encodeURIComponent(b);c=encodeURIComponent(c);d.push(b+"="+c)}return d.join("&")}};e.ext("get",function(a,b,c){h._do(a,b,c,false)});e.ext("post",function(a,b,c){h._do(a,b,c,true)});e.ext("sse",function(a,b,c){if(typeof EventSource!==
|
||||
"undefined"){a=new EventSource(a);a.onmessage=function(a){b(a.data)}}else setInterval(e.get,c||3E4,a,{},function(a){a.trim().replace(/data:/gim,"");a.replace(/^(event|id|retry)?\:(.*)$/gim,"");b.call(a,a)})});var i,l,j,q;if(typeof document.addEventListener!=="undefined"){i=function(a,b,c){typeof a.addEventListener!=="undefined"&&a.addEventListener(b,c,false)};l=function(a,b,c){typeof a.removeEventListener!=="undefined"&&a.removeEventListener(b,c,false)}}else if(typeof document.attachEvent!=="undefined"){i=
|
||||
function(a,b,c){function d(a){c.apply(a)}if(typeof a.attachEvent!=="undefined"){l(b,c);a.attachEvent("on"+b,d);a=a.KIS_0_6_0=a.KIS_0_6_0||{};a.listeners=a.listeners||{};a.listeners[b]=a.listeners[b]||[];a.listeners[b].push({callback:c,_listener:d})}else console.log("Failed to _attach event:"+b+" on "+a)};l=function(a,b,c){if(typeof a.detachEvent!=="undefined"){var d=a.KIS_0_6_0;if(d&&d.listeners&&d.listeners[b])for(var g=d.listeners[b],e=g.length,f=0;f<e;f++)if(g[f].callback===c){a.detachEvent("on"+
|
||||
b,g[f]._listener);g.splice(f,1);g.length===0&&delete d.listeners[b];break}}}}j=function(a,b,c,d){var g,e;if(typeof a==="undefined"){console.log(arguments);console.log(b);return false}if(b.match(/^([\w\-]+)$/))d===true?i(a,b,c):l(a,b,c);else{b=b.split(" ");e=b.length;for(g=0;g<e;g++)j(a,b[g],c,d)}};q=function(a,b,c,d){j(a,c,function(c){var f,n,h,c=c||window.event;n=e.$(b,a);for(f in n){h=c.target||c.srcElement;if(h==n[f]){d.call(n[f],c);c.stopPropagation()}}},true)};e.ext("event",{add:function(a,b){e.each(function(c){j(c,
|
||||
a,b,true)})},remove:function(a,b){e.each(function(c){j(c,a,b,false)})},live:function(a,b,c){q(document.documentElement,a,b,c)},delegate:function(a,b,c){e.each(function(d){q(d,a,b,c)})}});if(typeof localStorage==="undefined"||typeof JSON==="undefined")return null;var m=localStorage,o=sessionStorage;e.ext("store",{get:function(a,b){var c=b?o.getItem(a):m.getItem(a);return JSON.parse(c)},set:function(a,b,c){b=JSON.stringify(b);c?o.setItem(a,b):m.setItem(a,b)},remove:function(a,b){b?o.removeItem(a):m.removeItem(a)},
|
||||
getAll:function(a){var b,c={},d,g;g=a?m:o;b=g.length;for(a=0;a<b;a++){d=g.key(a);c[d]=g.getItem(d)}return c},clear:function(a){a?o.clear():m.clear()}});var s=function(a){var b=[],c=0,d={},g,b=r.object_keys(a);b.sort(function(a,b){var c=parseFloat(b),d=parseFloat(a),g=c+""===b,e=d+""===a;return g&&e?c>d?1:c<d?-1:0:g&&!e?1:!g&&e?-1:b>a?1:b<a?-1:0});c=b.length;for(g=0;g<c;g++)d[b[g]]=a[b[g]];return d},r={object_keys:function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b},object_values:function(a){var b=
|
||||
[],c;for(c in a)b.push(a[c]);return b},array_combine:function(a,b){var c={},d,g=0;e.type(a)!=="array"&&(a=this.object_values(a));e.type(b)!=="array"&&(b=this.object_values(b));d=a.length;if(d!==b.length){console.log("Object combine requires two arrays of the same size");return false}for(g=0;g<d;g++)c[a[g]]=b[g];return c},object_merge:function(){var a=Array.prototype.slice.call(arguments),b=a.length,c={},d,g=0,f,h,i;d=true;for(f=0;f<b;f++)if(e.type(a[f])!=="array"){d=false;break}if(d){c=[];for(f=0;f<
|
||||
b;f++)c=c.contact(a[f]);return c}for(i=f=0;f<b;f++){d=a[f];if(e.type(d)=="array"){h=0;for(g=d.length;h<g;h++)c[i++]=d[h]}else for(h in d)d.hasOwnProperty(h)&&(parseInt(h,10)+""===h?c[i++]=d[h]:c[h]=d[h])}return c},str_trans:function(a,b,c){var d=[],g=[],e=false,f=0,h=0,i="",j="",l="",k="",m;if(typeof b==="object"){b=s(b);for(m in b)if(b.hasOwnProperty(m)){d.push(m);g.push(b[m])}b=d;c=g}h=a.length;f=b.length;i=typeof c==="string";j=typeof b==="string";for(d=0;d<h;d++){e=false;if(j){a.charAt(d-1);l=
|
||||
a.charAt(d);a.charAt(d+1);for(g=0;g<f;g++)if(l==b.charAt(g)){e=true;break}}else for(g=0;g<f;g++)if(a.substr(d,b[g].length)==b[g]){e=true;d=d+b[g].length-1;break}k=e?k+(i?c.charAt(g):c[g]):k+a.charAt(d)}return k}};e.ext("util",r)}})($_);
|
||||
|
@ -50,7 +50,7 @@
|
||||
// Add the selector to the prototype
|
||||
$_.prototype.el = sel;
|
||||
|
||||
// Make a copy before adding properties
|
||||
// Use the $_ object as it's own prototype
|
||||
var self = dcopy($_);
|
||||
|
||||
// Give sel to each extension.
|
||||
|
@ -139,8 +139,8 @@
|
||||
|
||||
setInterval($_.get, poll_rate, url, {}, function(res){
|
||||
res.trim().replace(/data:/gim, '');
|
||||
res.replace(/^event|id|retry?:(.*)$/gim, '');
|
||||
callback(res);
|
||||
res.replace(/^(event|id|retry)?\:(.*)$/gim, '');
|
||||
callback.call(res, res);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -32,7 +32,7 @@ for (var i = 0, tagName; tagName = HTML5[i]; i++) document.createElement(tagName
|
||||
<div class="nephew"></div>
|
||||
</aside>
|
||||
</section>
|
||||
<script src="../kis-all.js"></script>
|
||||
<script src="../kis-min.js"></script>
|
||||
<script src="qunit/qunit.js"></script>
|
||||
<script type="text/javascript">
|
||||
//Selector test function
|
||||
|
Loading…
Reference in New Issue
Block a user