Permalink
Browse files

Version 0.9.1

Minified and version update
  • Loading branch information...
1 parent 3a9649b commit 63a1fb630a7128149fec2d6515f210e0a83f8bd4 @kylebarrow committed Jul 30, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 README.md
  2. +1 −1 chibi-min.js
  3. +1 −1 chibi.js
View
@@ -1,4 +1,4 @@
-# Chibi v0.9
+# Chibi v0.9.1
#### A tiny JavaScript micro-framework
View
@@ -1 +1 @@
-/*Chibi v0.9, (C)2012 Kyle Barrow, GPLv3 Licensed.*/(function(){"use strict";function Q(){V=t;for(var e=0;e<W[n];e++)W[e]();W=[]}function G(){$=t;V||Q();for(var e=0;e<X[n];e++)X[e]();X=[]}function Y(e,t){var r=t[n];while(r--)e(t[r])}function Z(e){return e[o](/-\w/g,function(e){return e.charAt(1)[u]()})}function et(e,t){return e[a]?e[a][Z(t)]:K[f]?K[f](e,l).getPropertyValue(t):l}function tt(e,t){return encodeURIComponent(e)[o](/%20/g,"+")+"="+encodeURIComponent(t)[o](/%20/g,"+")}function nt(r){var i=[],s=[],o=e;if(r)if(r.nodeType&&r.nodeType===1)i=[r];else if(typeof r===c||typeof r[n]=="number"&&typeof r.item===h){o=t;i=r}else if(typeof r=="string"){J[p]||(J[p]=function(e){var t,r=J[d]("head")[0],i,s=[];t=J[v]("STYLE");t.type="text/css";if(t[m]){t[m][g]=e+" {a:b}";r.appendChild(t);i=J[d]("*");for(var o=0;o<i[n];o++)et(i[o],"a")==="b"?s[y](i[o]):0;r[b](t)}return s});i=J[p](r)}if(o)s=i;else for(var u=0;u<i[n];u++)s[u]=i[u];return s}function rt(e,t,n){try{e[w][Z(t)]=n}catch(r){}}function it(e){e[w][E]="";et(e,E)===S?e[w][E]="block":0}function st(e){e=e.reverse();e[n]===1?e=e[0]:0;return e}function ot(e){var t="",r;if(e[x]===Object){for(r in e)if(e.hasOwnProperty(r))if(e[r][x]===Array)for(var i=0;i<e[r][n];i++)t+=T+tt(r,e[r][i]);else t+=T+tt(r,e[r])}else Y(function(e){if(e[N]==="FORM")for(var i=0;i<e.elements[n];i++){r=e.elements[i];if(!r.disabled)switch(r.type){case"button":case"image":case"file":case"submit":case"reset":break;case"select-one":r[n]>0?t+=T+tt(r[C],r[k]):0;break;case"select-multiple":for(var s=0;s<r[n];s++)r[s][L]?t+=T+tt(r[C],r[s][k]):0;break;case A:case O:r[M]?t+=T+tt(r[C],r[k]):0;break;default:t+=T+tt(r[C],r[k])}}},e);return t[n]>0?t.substring(1):""}function ut(a){var f=nt(a);return{ready:function(e){e&&(V?e():W[y](e))},loaded:function(e){e&&($?e():X[y](e))},loop:function(e){typeof e===h&&Y(function(t){e(t)},f)},find:function(t){if(t){var r=[];switch(t){case"first":f[n]>0?f=[f.shift()]:0;break;case"last":f[n]>0?f=[f.pop()]:0;break;case"odd":case"even":for(var i=t==="odd"?0:1;i<f[n];i+=2)r[y](f[i]);f=r}}return f[n]>0?f[n]===1?f[0]:f:e},hide:function(){Y(function(e){e[w][E]=S},f)},show:function(){Y(function(e){it(e)},f)},toggle:function(){Y(function(e){et(e,E)===S?it(e):e[w][E]=S},f)},remove:function(){var e=f[n];Y(function(e){try{e[_][b](e)}catch(t){}},f);f=[]},css:function(e,t){var r=[];Y(function(n){t?rt(n,e,t):n[w][Z(e)]?r[y](n[w][Z(e)]):et(n,e)?r[y](et(n,e)):r[y](l)},f);if(r[n]>0)return st(r)},cls:function(r,i){var s=[],u,a,l,c;if(r){u=r.split(" ");i=i||o}Y(function(f){a=f[D];if(r)switch(i){case"add":f[D]=a+" "+r;break;case o:f[D]=r;break;case P:case H:case"remove":c=t;for(var h=0;h<u[n];h++){l=new RegExp("\\b"+u[h]+"\\b","g");if(i===P){if(!a.match(l)){c=e;break}}else i===H?f[D]=f[D].match(l)?f[D][o](l,""):f[D]+" "+u[h]:f[D]=f[D][o](l,"")}i===P?s[y](c):0}else s[y](a)},f);if(s[n]>0)return st(s)},html:function(e,t){var r=[],i,s;Y(function(n){if(t){i=J[v]("div");i[B]=e;while(s=i.lastChild)try{t==="before"?n[_][j](s,n):t==="after"&&n[_][j](s,n.nextSibling)}catch(o){break}}else e?n[B]=e:r[y](n[B])},f);if(r[n]>0)return st(r)},attr:function(e,t){var r=[];Y(function(n){if(e){e=e.toLowerCase();switch(e){case w:t?n[w][g]=t:n[w][g]?r[y](n[w][g]):r[y](l);break;case"class":t?n[D]=t:n[D]?r[y](n[D]):r[y](l);break;default:t?n.setAttribute(e,t):n[F](e)?r[y](n[F](e)):r[y](l)}}},f);if(r[n]>0)return st(r)},val:function(r){var i=[],s=[];typeof r!="undefined"&&typeof r!==c&&(r=[r]);Y(function(o){if(r)switch(o[N]){case I:for(var u=0;u<o[n];u++)for(var a=0;a<r[n];a++){o[u][L]="";if(o[u][k]===r[a]){o[u][L]=L;break}}break;case q:switch(o.type){case A:case O:o[M]="";for(var u=0;u<r[n];u++)if(o[k]===r[u]){o[M]=M;break}break;default:o[k]=r[0]}break;case R:case U:o[k]=r[0]}else switch(o[N]){case I:var f=s[n];s[y]([]);for(var u=0;u<o[n];u++)o[u][L]?s[f][y](o[u][k]):0;switch(s[f][n]){case 0:s[f]=l;break;case 1:s[f]=s[f][0]}break;case q:switch(o.type){case A:o[M]?s[y](o[k]):s[y](l);break;case O:var c=e;for(var u=0;u<i[n];u++)if(i[u][0]===o[C]){o[M]?s[i[u][1]]=o[k]:0;c=t}if(!c){i[y]([o[C],s[n]]);o[M]?s[y](o[k]):s[y](l)}break;default:s[y](o[k])}break;case R:case U:s[y](o[k])}},f);if(s[n]>0)return st(s)},on:function(t,n,s){a===K||a===J?f=[a]:0;Y(function(o){J[r]?s?o.removeEventListener(t,n,e):o[r](t,n,e):J[i]&&(s?o.detachEvent("on"+t,n):o[i]("on"+t,n))},f)},ajax:function(e,n,r,i){var o,n=n||"GET",a=ot(f),l=e.indexOf("?")===-1?"?":T,c="_ts="+ +(new Date);K.XMLHttpRequest?o=new XMLHttpRequest:K.ActiveXObject&&(o=new ActiveXObject("Microsoft.XMLHTTP"));if(o){n=n[u]();n==="GET"?e+=l+a:0;i?n===z?e+=l+c:e+=T+c:0;o.open(n,e,t);n===z?o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"):0;o.send(a);o[s]=function(){if(o.readyState===4&&o.status===200&&r)try{r(o.responseText)}catch(e){}}}}}}var e=!1,t=!0,n="length",r="addEventListener",i="attachEvent",s="onreadystatechange",o="replace",u="toUpperCase",a="currentStyle",f="getComputedStyle",l=null,c="object",h="function",p="querySelectorAll",d="getElementsByTagName",v="createElement",m="styleSheet",g="cssText",y="push",b="removeChild",w="style",E="display",S="none",x="constructor",T="&",N="nodeName",C="name",k="value",L="selected",A="checkbox",O="radio",M="checked",_="parentNode",D="className",P="has",H="toggle",B="innerHTML",j="insertBefore",F="getAttribute",I="SELECT",q="INPUT",R="TEXTAREA",U="BUTTON",z="POST",W=[],X=[],V=e,$=e,J=document,K=window;if(J[r]){J[r]("DOMContentLoaded",Q,e);K[r]("load",G,e)}else if(J[i]){J[i](s,Q);K[i]("onload",G)}else K.onload=G;K.$=ut})();
+/*Chibi v0.9.1, (C)2012 Kyle Barrow, GPLv3 Licensed*/(function(){"use strict";function Q(){V=t;for(var e=0;e<W[n];e++)W[e]();W=[]}function G(){$=t;V||Q();for(var e=0;e<X[n];e++)X[e]();X=[]}function Y(e,t){var r=t[n];while(r--)e(t[r])}function Z(e){return e[o](/-\w/g,function(e){return e.charAt(1)[u]()})}function et(e,t){return e[a]?e[a][Z(t)]:K[f]?K[f](e,l).getPropertyValue(t):l}function tt(e,t){return encodeURIComponent(e)[o](/%20/g,"+")+"="+encodeURIComponent(t)[o](/%20/g,"+")}function nt(r){var i=[],s=[],o=e;if(r)if(r.nodeType&&r.nodeType===1)i=[r];else if(typeof r===c||typeof r[n]=="number"&&typeof r.item===h){o=t;i=r}else if(typeof r=="string"){J[p]||(J[p]=function(e){var t,r=J[d]("head")[0],i,s=[];t=J[v]("STYLE");t.type="text/css";if(t[m]){t[m][g]=e+" {a:b}";r.appendChild(t);i=J[d]("*");for(var o=0;o<i[n];o++)et(i[o],"a")==="b"?s[y](i[o]):0;r[b](t)}return s});i=J[p](r)}if(o)s=i;else for(var u=0;u<i[n];u++)s[u]=i[u];return s}function rt(e,t,n){try{e[w][Z(t)]=n}catch(r){}}function it(e){e[w][E]="";et(e,E)===S?e[w][E]="block":0}function st(e){e=e.reverse();e[n]===1?e=e[0]:0;return e}function ot(e){var t="",r;if(e[x]===Object){for(r in e)if(e.hasOwnProperty(r))if(e[r][x]===Array)for(var i=0;i<e[r][n];i++)t+=T+tt(r,e[r][i]);else t+=T+tt(r,e[r])}else Y(function(e){if(e[N]==="FORM")for(var i=0;i<e.elements[n];i++){r=e.elements[i];if(!r.disabled)switch(r.type){case"button":case"image":case"file":case"submit":case"reset":break;case"select-one":r[n]>0?t+=T+tt(r[C],r[k]):0;break;case"select-multiple":for(var s=0;s<r[n];s++)r[s][L]?t+=T+tt(r[C],r[s][k]):0;break;case A:case O:r[M]?t+=T+tt(r[C],r[k]):0;break;default:t+=T+tt(r[C],r[k])}}},e);return t[n]>0?t.substring(1):""}function ut(a){var f=nt(a);return{ready:function(e){e&&(V?e():W[y](e))},loaded:function(e){e&&($?e():X[y](e))},loop:function(e){typeof e===h&&Y(function(t){e(t)},f)},find:function(t){if(t){var r=[];switch(t){case"first":f[n]>0?f=[f.shift()]:0;break;case"last":f[n]>0?f=[f.pop()]:0;break;case"odd":case"even":for(var i=t==="odd"?0:1;i<f[n];i+=2)r[y](f[i]);f=r}}return f[n]>0?f[n]===1?f[0]:f:e},hide:function(){Y(function(e){e[w][E]=S},f)},show:function(){Y(function(e){it(e)},f)},toggle:function(){Y(function(e){et(e,E)===S?it(e):e[w][E]=S},f)},remove:function(){var e=f[n];Y(function(e){try{e[_][b](e)}catch(t){}},f);f=[]},css:function(e,t){var r=[];Y(function(n){t?rt(n,e,t):n[w][Z(e)]?r[y](n[w][Z(e)]):et(n,e)?r[y](et(n,e)):r[y](l)},f);if(r[n]>0)return st(r)},cls:function(r,i){var s=[],u,a,l,c;if(r){u=r.split(/\s+/);i=i||o}Y(function(f){a=f[D];if(r){switch(i){case"add":f[D]=a+" "+r;break;case o:f[D]=r;break;case P:case H:case"remove":c=t;for(var h=0;h<u[n];h++){l=new RegExp("\\b"+u[h]+"\\b","g");if(i===P){if(!a.match(l)){c=e;break}}else i===H?f[D]=f[D].match(l)?f[D][o](l,""):f[D]+" "+u[h]:f[D]=f[D][o](l,"")}i===P?s[y](c):0}f[D]=f[D][o](/^\s+|\s+$/g,"")}else s[y](a)},f);if(s[n]>0)return st(s)},html:function(e,t){var r=[],i,s;Y(function(n){if(t){i=J[v]("div");i[B]=e;while(s=i.lastChild)try{t==="before"?n[_][j](s,n):t==="after"&&n[_][j](s,n.nextSibling)}catch(o){break}}else e?n[B]=e:r[y](n[B])},f);if(r[n]>0)return st(r)},attr:function(e,t){var r=[];Y(function(n){if(e){e=e.toLowerCase();switch(e){case w:t?n[w][g]=t:n[w][g]?r[y](n[w][g]):r[y](l);break;case"class":t?n[D]=t:n[D]?r[y](n[D]):r[y](l);break;default:t?n.setAttribute(e,t):n[F](e)?r[y](n[F](e)):r[y](l)}}},f);if(r[n]>0)return st(r)},val:function(r){var i=[],s=[];typeof r!="undefined"&&typeof r!==c&&(r=[r]);Y(function(o){if(r)switch(o[N]){case I:for(var u=0;u<o[n];u++)for(var a=0;a<r[n];a++){o[u][L]="";if(o[u][k]===r[a]){o[u][L]=L;break}}break;case q:switch(o.type){case A:case O:o[M]="";for(var u=0;u<r[n];u++)if(o[k]===r[u]){o[M]=M;break}break;default:o[k]=r[0]}break;case R:case U:o[k]=r[0]}else switch(o[N]){case I:var f=s[n];s[y]([]);for(var u=0;u<o[n];u++)o[u][L]?s[f][y](o[u][k]):0;switch(s[f][n]){case 0:s[f]=l;break;case 1:s[f]=s[f][0]}break;case q:switch(o.type){case A:o[M]?s[y](o[k]):s[y](l);break;case O:var c=e;for(var u=0;u<i[n];u++)if(i[u][0]===o[C]){o[M]?s[i[u][1]]=o[k]:0;c=t}if(!c){i[y]([o[C],s[n]]);o[M]?s[y](o[k]):s[y](l)}break;default:s[y](o[k])}break;case R:case U:s[y](o[k])}},f);if(s[n]>0)return st(s)},on:function(t,n,s){a===K||a===J?f=[a]:0;Y(function(o){J[r]?s?o.removeEventListener(t,n,e):o[r](t,n,e):J[i]&&(s?o.detachEvent("on"+t,n):o[i]("on"+t,n))},f)},ajax:function(e,n,r,i){var o,n=n||"GET",a=ot(f),l=e.indexOf("?")===-1?"?":T,c="_ts="+ +(new Date);K.XMLHttpRequest?o=new XMLHttpRequest:K.ActiveXObject&&(o=new ActiveXObject("Microsoft.XMLHTTP"));if(o){n=n[u]();n==="GET"?e+=l+a:0;i?n===z?e+=l+c:e+=T+c:0;o.open(n,e,t);n===z?o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"):0;o.send(a);o[s]=function(){if(o.readyState===4&&o.status===200&&r)try{r(o.responseText)}catch(e){}}}}}}var e=!1,t=!0,n="length",r="addEventListener",i="attachEvent",s="onreadystatechange",o="replace",u="toUpperCase",a="currentStyle",f="getComputedStyle",l=null,c="object",h="function",p="querySelectorAll",d="getElementsByTagName",v="createElement",m="styleSheet",g="cssText",y="push",b="removeChild",w="style",E="display",S="none",x="constructor",T="&",N="nodeName",C="name",k="value",L="selected",A="checkbox",O="radio",M="checked",_="parentNode",D="className",P="has",H="toggle",B="innerHTML",j="insertBefore",F="getAttribute",I="SELECT",q="INPUT",R="TEXTAREA",U="BUTTON",z="POST",W=[],X=[],V=e,$=e,J=document,K=window;if(J[r]){J[r]("DOMContentLoaded",Q,e);K[r]("load",G,e)}else if(J[i]){J[i](s,Q);K[i]("onload",G)}else K.onload=G;K.$=ut})();
View
@@ -1,4 +1,4 @@
-/*Chibi v0.9, Copyright (C) 2012 Kyle Barrow
+/*Chibi v0.9.1, Copyright (C) 2012 Kyle Barrow
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

0 comments on commit 63a1fb6

Please sign in to comment.