Comparing version 1.0.5 to 1.0.7
105
aris.js
/*! | ||
* Aris JavaScript Library v1.0.5 | ||
* Aris JavaScript Library v1.0.7 | ||
* @author Benjamin Kang Yue Sheng | ||
@@ -227,2 +227,3 @@ * MIT license | ||
var cssNumber = toSet('column-count,fill-opacity,font-weight,line-height,opacity,orphans,widows,z-index,zoom'); | ||
var emptyTags = toSet('area,base,br,col,embed,hr,img,input,keygen,link,meta,param,source,track,wbr'); | ||
@@ -237,3 +238,3 @@ var cssBracketRe = /((?:\\.|("|')(?:\\.|.)*?\2|[^{}])*)([{}])/g; | ||
var splitWordsRe = /(?:(?:^|[A-Z])[a-z]+|[0-9]+|[A-Za-z]+)/g; | ||
var noop = function (x) { return x; }; | ||
@@ -259,7 +260,8 @@ var head = noBrowser ? noop : document.head; | ||
}; | ||
var ts = Object.prototype.toString; | ||
var ce = function (x) { return document.createElement(x); }; | ||
var hasKey = function (o, k) { return o.hasOwnProperty(k); }; | ||
var isArray = function (x) { return x.constructor == Array; }; | ||
var isObject = function (x) { return x.constructor == Object; }; | ||
var isFunction = function (f) { return f && {}.toString.call(f) == '[object Function]'; }; | ||
var isArray = function (x) { return x && ts.call(x) == '[object Array]' }; | ||
var isObject = function (x) { return x && ts.call(x) == '[object Object]' }; | ||
var isFunction = function (f) { return f && ts.call(f) == '[object Function]'; }; | ||
var lc = function (s) { return s.toLowerCase(); }; | ||
@@ -554,3 +556,29 @@ var uc = function (s) { return s.toUpperCase(); }; | ||
} | ||
ctl.c(); | ||
}; | ||
}; | ||
var imageReadyChecker = function (img, i, urlMatch, ctl) { | ||
return function () { | ||
var x = [i, urlMatch, '']; | ||
if (img.naturalWidth) { | ||
ctl.push(x); | ||
ctl.c(); | ||
} else { | ||
setTimeout(function() { | ||
ctl.push(x); | ||
ctl.c(); | ||
}, 100); | ||
} | ||
}; | ||
}; | ||
var loadFiles = function (urls) { | ||
var required = [], i, r, s, xhr, m, t, img, | ||
ctl = [], ctlWrap = { | ||
done: function (f) { | ||
ctl.d = f; | ||
return ctlWrap; | ||
} | ||
}, imageExtensions = toSet('png,bmp,gif,jpg,jpeg,svg,webp'); | ||
ctl.c = function () { | ||
if (ctl.length == ctl.n && ctl.n > 0) { | ||
@@ -567,3 +595,3 @@ ctl.n = 0; | ||
el.type = 'text/css'; | ||
el.innerText = autoFixCSS(fixCSSRelUrls(url, r[2])); | ||
el.innerText = autoFixCSS(fixCSSRelUrls(url, r[2]).replace(/[\r\n]/g, '')); | ||
head.appendChild(el); | ||
@@ -583,12 +611,2 @@ } | ||
}; | ||
}; | ||
var loadFiles = function (urls) { | ||
var required = [], i, r, s, xhr, m, | ||
ctl = [], ctlWrap = { | ||
done: function (f) { | ||
ctl.d = f; | ||
return ctlWrap; | ||
} | ||
}; | ||
for (i = 0; i < urls.length; ++i) { | ||
@@ -602,8 +620,16 @@ m = filePreExtRe.exec(urls[i]); | ||
for (i = 0; i < ctl.n; ++i) { | ||
xhr = new XMLHttpRequest(), r = required[i]; | ||
xhr.onreadystatechange = fileReadyChecker(xhr, i, r, ctl); | ||
s = r[2].indexOf('?') > -1 ? '&' : '?'; | ||
xhr.open('GET', r[2] + s + Math.random(), true); | ||
xhr.responseType = 'text'; | ||
xhr.send(); | ||
r = required[i]; | ||
if (lc(''+r[1]) == 'img' || | ||
((m = (''+r[2]).match(fileExtRe)) && imageExtensions[lc(m[1])])) { | ||
img = new Image(); | ||
img.onload = img.onerror = imageReadyChecker(img, i, r, ctl); | ||
img.src = r[2]; | ||
} else { | ||
xhr = new XMLHttpRequest(); | ||
xhr.onreadystatechange = fileReadyChecker(xhr, i, r, ctl); | ||
s = r[2].indexOf('?') > -1 ? '&' : '?'; | ||
xhr.open('GET', r[2] + s + Math.random(), true); | ||
xhr.responseType = 'text'; | ||
xhr.send(); | ||
} | ||
} | ||
@@ -640,3 +666,3 @@ if (ctl.n < 1) { | ||
var r, i, obj, k, k2, v, css, mSub, | ||
var r, i, obj, k, k2, t, v, css, mSub, | ||
tag = context[0], content = '', attrs = {}, concats = [];; | ||
@@ -657,3 +683,4 @@ | ||
v = obj[k]; | ||
if (lc(trim(k)) == 'style' && !isObject(v)) { | ||
t = lc(trim(k)); | ||
if (t == 'style' && !isObject(v)) { | ||
v = '' + v; | ||
@@ -672,3 +699,3 @@ css = {}; | ||
} else { | ||
if (!hasKey(attrs, k)) | ||
if (t != 'class' || !hasKey(attrs, k)) | ||
attrs[k] = v; | ||
@@ -680,3 +707,3 @@ else | ||
} | ||
} else content += obj; | ||
} else content += '' + obj; | ||
} | ||
@@ -686,15 +713,31 @@ r = '<' + tag; | ||
for (k in attrs) { | ||
r += ' ' + k + '="'; | ||
t = ''; | ||
if (isObject(attrs[k])) { // css case | ||
css = autoFixCSS(attrs[k]); | ||
for (k2 in css) | ||
r += k2 + ':' + css[k2] + ';'; | ||
t += k2 + ':' + css[k2] + ';'; | ||
} else { | ||
r += attrs[k]; | ||
t += attrs[k]; | ||
} | ||
r += '"'; | ||
r += ' ' + k + '="' + t + '"'; | ||
} | ||
return r + '>' + content + '</' + tag + '>'; | ||
if (emptyTags[lc(trim(tag))] && !content.length) | ||
r += '>'; | ||
else | ||
r += '>' + content + '</' + tag + '>'; | ||
return r; | ||
}; | ||
HTML.escape = function(text) { | ||
var chars = { | ||
'&': '&', | ||
'<': '<', | ||
'>': '>', | ||
'"': '"', | ||
"'": ''' | ||
}; | ||
return text.replace(/[&<>"']/g, function(m) { return chars[m]; }); | ||
}; | ||
HTML.SVG = function(width, height) { | ||
@@ -701,0 +744,0 @@ var a = arguments, s = ['svg', { |
@@ -1,1 +0,1 @@ | ||
!function(n,e){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e(n,!0):e(n)}("undefined"!=typeof window?window:this,function(o,n){"use strict";function a(n){return"undefined"==typeof n}function e(n){for(var e={},r=(n=n.split(",")).length;r--;)e[n[r]]=1;return e}function r(n){return n}function d(n){for(var e,r=[];e=z.exec(n);)r.push(e[0]);return r}function h(n){return i.createElement(n)}function g(n,e){return n.hasOwnProperty(e)}function v(n){return n.constructor==Array}function x(n){return n.constructor==Object}function p(n){return n&&"[object Function]"=={}.toString.call(n)}function t(n){return n.toUpperCase()}function m(n){return String.prototype.trim?n.trim():n.replace(S,"")}var i=o.document,u=o.getComputedStyle,l=a(i)||a(u),s=e("column-count,fill-opacity,font-weight,line-height,opacity,orphans,widows,z-index,zoom"),c=/((?:\\.|("|')(?:\\.|.)*?\2|[^{}])*)([{}])/g,y=/(?:^|\{|\s|;)([A-Za-z0-9\-]+)\s*\:\s*?((?:\\.|("|')(?:\\.|.)*?\3|[^;}])*)/g,f=/url\(\s*?["']?(.*?)["']?\s*?\)/g,b=/\/\*[\s\S]*?\*\//g,w=/\.([A-Za-z0-9]+)(?:[\?#]|$)/,j=/^(?:\s*?(js|css)\s*?\:)?\s*?(\S[\S\s]*)/i,S=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,z=/(?:(?:^|[A-Z])[a-z]+|[0-9]+|[A-Za-z]+)/g,C=l?r:i.head,$=function(n){return n.toLowerCase()},A=l?[]:u(i.documentElement,null),F=l?[]:h("div").style,E=[],T={},G="",L=0,O=e("-webkit-,-moz-,-ms-,-o-");if(l&&(O={}),A&&0<A.length)E=A;else{var k=/[A-Z]/g,V=function(n){return"-"+$(n)};for(M in A)E.push(M.replace(k,V))}for(var Z,M,P,R,H=0;H<2;++H)for(Z=E.length;Z--;)if(M=E[Z].split("-"),H<1&&""!=M[0])for(;1<=M.length;M.pop()){for(P=M[0],R=1;R<M.length;++R)P+=t(M[R][0])+M[R].substring(1);P in F&&(T[M.join("-")]=1)}else if(H<2&&""==M[0]&&(q="-"+M[1]+"-",O[q])){for(M=M.slice(2);1<=M.length;M.pop())delete T[M.join("-")];O[q]++}for(var q in O)O[q]>L&&(L=O[q],G=q);function I(e,n,r,t){var i=RegExp(n+"("+e.join("|")+")"+r,"g");return function(n){return e.length?n.replace(i,t):n}}function U(n){var e,r,t,i,o,u="",l=0;if(x(n)){for(i in o={},n)if(g(n,i)){if(e=n[i],i=m(i),"number"!=typeof e||s[i]||(e+="px"),e=X(e),!T[i])for(var f in O)o[f+i]=e;o[i]=e}return o}for(n=n.replace(b,"");t=c.exec(n);){var a=t[3];if("{"==a)u+=""+t[1]+a,++l;else if("}"==a){for(o={};r=y.exec(t[1]);){if(!T[r[1]])for(f in O)o[f+r[1]]=r[2];o[r[1]]=r[2]}for(i in o)u+=i+":"+o[i]+";";u+=""+a,l=0<l?l-1:0}}return _(X(u))}function B(u,n){return"/"!=(u=m(u))[0]&&(u=o.location.pathname.split("/").slice(0,-1).join("/")+"/"+u),u=u.split("/").slice(0,-1).join("/"),n.replace(f,function(n,e){var r=e.indexOf("//");if(0==e.indexOf("data:")||-1<r&&r<9)return n;var t,i=u.split("/"),o=e.split("/");for(t=0;t<o.length;++t)".."==o[t]?i.pop():i.push(o[t]);return"url('"+i.join("/")+"')"})}function N(f,a,s,c){return function(){if(4==f.readyState){var n=f.status,e="";200!=n&&0!=n||(D[s[0]]=1,e=f.responseText),c.push([a,s,e])}if(c.length==c.n&&0<c.n){var r,t,i,o,u,l;for(c.n=0,c.sort(function(n,e){return n[0]-e[0]}),r=0;r<c.length;++r)u=(t=c[r])[1][1],l=t[1][2],!u&&(i=l.match(w))&&(u=$(i[1])),"css"==u&&((o=h("style")).type="text/css",o.innerText=U(B(l,t[2])),C.appendChild(o)),"js"==u&&((o=h("script")).text="//# sourceURL="+l+"\n"+t[2],C.appendChild(o).parentNode.removeChild(o));p(c.d)&&c.d()}}}var X=l?r:function(){var n,e="backgroundImage",r="-gradient",t="cursor",i="display",o="width",u=[],l=[],f={calc:[o,"1px + 5%"],element:[e,"#foo"],"cross-fade":[e,"url(a.png), url(b.png), 50%"],"image-set":[e,"url(a.png) 1x, url(b.png) 2x"]};function a(n,e){return F[e]="",F[e]=n,!!F[e]}for(n in f["repeating-linear"+r]=f["repeating-radial"+r]=f["radial"+r]=f["linear"+r]=[e,"red, teal"],f){var s=f[n],c=s[0],p=n+"("+s[1]+")";!a(p,c)&&a(G+p,c)&&u.push(n)}var h=I(u,"(\\s|:|,)","\\s*\\(","$1"+G+"$2("),d={initial:"color",grab:t,grabbing:t,"zoom-in":t,"zoom-out":t,box:i,flexbox:i,"inline-flexbox":i,flex:i,"inline-flex":i,grid:i,"inline-grid":i,"max-content":o,"min-content":o,"fit-content":o,"fill-available":o,"contain-floats":o};for(n in d)!a(n,c=d[n])&&a(G+n,c)&&l.push(n);var g=I(l,"(\\s|:)","(\\s|;|\\}|$)","$1"+G+"$2$3");return function(n){return u.length&&-1<u.indexOf("linear-gradient")&&(n=n.replace(/(\s|:|,)(repeating-)?linear-gradient\(\s*(-?\d*\.?\d*)deg/gi,function(n,e,r,t){return e+(r||"")+"linear-gradient("+(90-t)+"deg"})),n=h(n),g(n)}}(),_=l?r:function(){function n(n){return l.textContent=n+"{}",!!l.sheet.cssRules.length}var e,r=[],t=[],i={":any-link":null,"::backdrop":null,":fullscreen":null,":full-screen":":fullscreen","::placeholder":null,":placeholder":":placeholder-shown","::input-placeholder":"::placeholder",":input-placeholder":":placeholder-shown",":read-only":null,":read-write":null,"::selection":null},o={keyframes:"name",viewport:null,document:'regexp(".")'},u={},l=C.appendChild(h("style"));for(e in i){var f=i[e]||e,a=e.replace(/::?/,function(n){return n+G});!n(f)&&n(a)&&(r.push(f),u[f]=a)}for(e in o){var s=e+" "+(o[e]||"");!n("@"+s)&&n("@"+G+s)&&t.push(e)}var c=I(r,"","\\b",function(n){return u[n]||n}),p=I(t,"@","\\b","@"+G+"$1");return C.removeChild(l),function(n){return p(c(n))}}(),D={},J=function(n,e){for(var r=0;r<n.length;r++)v(n[r])?J(n[r],e):e.push(n[r])},K=function(n){var e=arguments,r=n.length;if(1<e.length)return K(e);var t,i,o,u,l,f,a,s,c=n[0],p="",h={};if(!v(n))return""+n;if(v(n[0])&&r){for(t="",i=0;i<r;i++)t+=K(n[i]);return t}for(i=1;i<r;i++)if(n[i])if(v(o=n[i]))p+=K(o);else if(x(o))for(u in o){if(f=o[u],"style"==$(m(u))&&!x(f)){for(f=""+f,a={};s=y.exec(f);)a[s[1]]=s[2];f=a}if(g(o,u)&&null!=f)if(x(f))for(l in g(h,u)&&x(h[u])||(h[u]={}),f)g(f,l)&&(h[u][l]=f[l]);else g(h,u)?h[u]+=" "+f:h[u]=f}else p+=o;for(u in t="<"+c,h=function(n){var e,r,t,i={};for(e in n)r=d(e),t=n[e],1<r.length&&(i[$(r.join("-"))]=t,i[$(r.join("_"))]=t),i[e]=t;return i}(h)){if(t+=" "+u+'="',x(h[u]))for(l in a=U(h[u]))t+=l+":"+a[l]+";";else t+=h[u];t+='"'}return t+">"+p+"</"+c+">"};K.SVG=function(n,e){var r,t=arguments,i=["svg",{width:n+"px",height:e+"px",viewBox:"0 0 "+n+" "+e,xmlns:"http://www.w3.org/2000/svg"}];for(r=2;r<t.length;r++)i.push(t[r]);return i};var Q="mlhvcsqtaz";function W(n){return function(){return K.SVG.Path()[n].apply(null,arguments)}}for(var Y in Q=e((Q+t(Q)).split("").join(",")),K.SVG.Path=function(){function n(r){return function(){i.d+=r;for(var n=arguments,e=0;e<n.length;++e)i.d+=n[e]+", "[1&e];return o}}var e,r,t,i={d:""},o=["path",i],u=arguments;for(e=0;e<u.length;e++)if(x(u[e])){for(t in r={},u[e])"d"==t?i.d+=u[e][t]+" ":r[t]=u[e][t];o.push(r)}else o.push(u[e]);for(t in Q)o[t]=n(t);return o},Q)K.SVG.Path[Y]=W(Y);function nn(n){var e,r,t,i="";for(e=!a(n)&&v(n)?n:ln(n),t=0;t<e.length;++t)t&&(i+="/"),":"==(r=e[t])[0]&&(r=m(r.substring(1)),i in on&&(r=on[i])),i+=on[i]=r;return i in tn&&tn[i](),!1}function en(){return o.location.hash}function rn(){if(!un){tn={},on={},un=!0;var n,e,r=ln(en()),t="";for(e=0;e<r.length;++e)e&&(t+="/"),n=r[e],t+=on[t]=n;if("onhashchange"in o)o.addEventListener("hashchange",function(){nn(en())});else{var i=en();setInterval(function(){var n=en();n!=i&&nn(i=n)},100)}}}var tn,on,un=!1,ln=function(n){if(a(n)||!v(n))return ln((""+n).split("/"));var e,r,t=[];for(e=0;e<n.length;++e)n[e].length&&("#"==(r=m(n[e]))[0]&&(r=r.substring(1)),t.push(r));return t};if(l||(K.autoFixCSS=U,K.load=function(){var n=[];return J(arguments,n),function(n){var e,r,t,i,o,u=[],l=[],f={done:function(n){return l.d=n,f}};for(e=0;e<n.length;++e)(o=j.exec(n[e]))[0]=(a(o[1])?"":o[1])+":"+o[2],o[0]in D||u.push(o);for(l.n=u.length,e=0;e<l.n;++e)i=new XMLHttpRequest,r=u[e],i.onreadystatechange=N(i,e,r,l),t=-1<r[2].indexOf("?")?"&":"?",i.open("GET",r[2]+t+Math.random(),!0),i.responseType="text",i.send();return l.n<1&&setTimeout(function(){p(l.d)&&l.d()},10),f}(n)},K.route=function(n,e){return rn(),p(e)?(tn[ln(n).join("/")]=e,K):ln(en())},K.route.go=function(n){return rn(),a(n)?nn(en()):nn(n)}),!n){a(o.HTML)&&(o.HTML=K);var fn=K;fn.svg=fn.SVG,fn.svg.path=fn.svg.path,o.aris=fn}return K}); | ||
!function(n,e){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e(n,!0):e(n)}("undefined"!=typeof window?window:this,function(o,n){"use strict";function s(n){return"undefined"==typeof n}function p(n){for(var e={},r=(n=n.split(",")).length;r--;)e[n[r]]=1;return e}function e(n){return n}function d(n){for(var e,r=[];e=f.exec(n);)r.push(e[0]);return r}function h(n){return t.createElement(n)}function v(n,e){return n.hasOwnProperty(e)}function m(n){return n&&"[object Array]"==A.call(n)}function x(n){return n&&"[object Object]"==A.call(n)}function g(n){return n&&"[object Function]"==A.call(n)}function r(n){return n.toUpperCase()}function b(n){return String.prototype.trim?n.trim():n.replace(a,"")}function y(n){return n.toLowerCase()}var t=o.document,i=o.getComputedStyle,u=s(t)||s(i),c=p("column-count,fill-opacity,font-weight,line-height,opacity,orphans,widows,z-index,zoom"),w=p("area,base,br,col,embed,hr,img,input,keygen,link,meta,param,source,track,wbr"),j=/((?:\\.|("|')(?:\\.|.)*?\2|[^{}])*)([{}])/g,S=/(?:^|\{|\s|;)([A-Za-z0-9\-]+)\s*\:\s*?((?:\\.|("|')(?:\\.|.)*?\3|[^;}])*)/g,l=/url\(\s*?["']?(.*?)["']?\s*?\)/g,z=/\/\*[\s\S]*?\*\//g,C=/\.([A-Za-z0-9]+)(?:[\?#]|$)/,$=/^(?:\s*?(js|css)\s*?\:)?\s*?(\S[\S\s]*)/i,a=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,f=/(?:(?:^|[A-Z])[a-z]+|[0-9]+|[A-Za-z]+)/g,k=u?e:t.head,A=Object.prototype.toString,F=u?[]:i(t.documentElement,null),T=u?[]:h("div").style,E=[],O={},G="",L=0,V=p("-webkit-,-moz-,-ms-,-o-");if(u&&(V={}),F&&0<F.length)E=F;else{var Z=/[A-Z]/g,M=function(n){return"-"+y(n)};for(R in F)E.push(R.replace(Z,M))}for(var P,R,q,H,I=0;I<2;++I)for(P=E.length;P--;)if(R=E[P].split("-"),I<1&&""!=R[0])for(;1<=R.length;R.pop()){for(q=R[0],H=1;H<R.length;++H)q+=r(R[H][0])+R[H].substring(1);q in T&&(O[R.join("-")]=1)}else if(I<2&&""==R[0]&&(U="-"+R[1]+"-",V[U])){for(R=R.slice(2);1<=R.length;R.pop())delete O[R.join("-")];V[U]++}for(var U in V)V[U]>L&&(L=V[U],G=U);function B(e,n,r,t){var i=RegExp(n+"("+e.join("|")+")"+r,"g");return function(n){return e.length?n.replace(i,t):n}}function N(n){var e,r,t,i,o,u="",l=0;if(x(n)){for(i in o={},n)if(v(n,i)){if(e=n[i],i=b(i),"number"!=typeof e||c[i]||(e+="px"),e=D(e),!O[i])for(var a in V)o[a+i]=e;o[i]=e}return o}for(n=n.replace(z,"");t=j.exec(n);){var f=t[3];if("{"==f)u+=""+t[1]+f,++l;else if("}"==f){for(o={};r=S.exec(t[1]);){if(!O[r[1]])for(a in V)o[a+r[1]]=r[2];o[r[1]]=r[2]}for(i in o)u+=i+":"+o[i]+";";u+=""+f,l=0<l?l-1:0}}return J(D(u))}function W(u,n){return"/"!=(u=b(u))[0]&&(u=o.location.pathname.split("/").slice(0,-1).join("/")+"/"+u),u=u.split("/").slice(0,-1).join("/"),n.replace(l,function(n,e){var r=e.indexOf("//");if(0==e.indexOf("data:")||-1<r&&r<9)return n;var t,i=u.split("/"),o=e.split("/");for(t=0;t<o.length;++t)".."==o[t]?i.pop():i.push(o[t]);return"url('"+i.join("/")+"')"})}function X(r,t,i,o){return function(){if(4==r.readyState){var n=r.status,e="";200!=n&&0!=n||(K[i[0]]=1,e=r.responseText),o.push([t,i,e])}o.c()}}function _(e,r,t,i){return function(){var n=[r,t,""];e.naturalWidth?(i.push(n),i.c()):setTimeout(function(){i.push(n),i.c()},100)}}var D=u?e:function(){var n,e="backgroundImage",r="-gradient",t="cursor",i="display",o="width",u=[],l=[],a={calc:[o,"1px + 5%"],element:[e,"#foo"],"cross-fade":[e,"url(a.png), url(b.png), 50%"],"image-set":[e,"url(a.png) 1x, url(b.png) 2x"]};function f(n,e){return T[e]="",T[e]=n,!!T[e]}for(n in a["repeating-linear"+r]=a["repeating-radial"+r]=a["radial"+r]=a["linear"+r]=[e,"red, teal"],a){var c=a[n],s=c[0],p=n+"("+c[1]+")";!f(p,s)&&f(G+p,s)&&u.push(n)}var h=B(u,"(\\s|:|,)","\\s*\\(","$1"+G+"$2("),g={initial:"color",grab:t,grabbing:t,"zoom-in":t,"zoom-out":t,box:i,flexbox:i,"inline-flexbox":i,flex:i,"inline-flex":i,grid:i,"inline-grid":i,"max-content":o,"min-content":o,"fit-content":o,"fill-available":o,"contain-floats":o};for(n in g)!f(n,s=g[n])&&f(G+n,s)&&l.push(n);var d=B(l,"(\\s|:)","(\\s|;|\\}|$)","$1"+G+"$2$3");return function(n){return u.length&&-1<u.indexOf("linear-gradient")&&(n=n.replace(/(\s|:|,)(repeating-)?linear-gradient\(\s*(-?\d*\.?\d*)deg/gi,function(n,e,r,t){return e+(r||"")+"linear-gradient("+(90-t)+"deg"})),n=h(n),d(n)}}(),J=u?e:function(){function n(n){return l.textContent=n+"{}",!!l.sheet.cssRules.length}var e,r=[],t=[],i={":any-link":null,"::backdrop":null,":fullscreen":null,":full-screen":":fullscreen","::placeholder":null,":placeholder":":placeholder-shown","::input-placeholder":"::placeholder",":input-placeholder":":placeholder-shown",":read-only":null,":read-write":null,"::selection":null},o={keyframes:"name",viewport:null,document:'regexp(".")'},u={},l=k.appendChild(h("style"));for(e in i){var a=i[e]||e,f=e.replace(/::?/,function(n){return n+G});!n(a)&&n(f)&&(r.push(a),u[a]=f)}for(e in o){var c=e+" "+(o[e]||"");!n("@"+c)&&n("@"+G+c)&&t.push(e)}var s=B(r,"","\\b",function(n){return u[n]||n}),p=B(t,"@","\\b","@"+G+"$1");return k.removeChild(l),function(n){return p(s(n))}}(),K={},Q=function(n,e){for(var r=0;r<n.length;r++)m(n[r])?Q(n[r],e):e.push(n[r])},Y=function(n){var e=arguments,r=n.length;if(1<e.length)return Y(e);var t,i,o,u,l,a,f,c,s,p=n[0],h="",g={};if(!m(n))return""+n;if(m(n[0])&&r){for(t="",i=0;i<r;i++)t+=Y(n[i]);return t}for(i=1;i<r;i++)if(n[i])if(m(o=n[i]))h+=Y(o);else if(x(o))for(u in o){if(f=o[u],"style"==(a=y(b(u)))&&!x(f)){for(f=""+f,c={};s=S.exec(f);)c[s[1]]=s[2];f=c}if(v(o,u)&&null!=f)if(x(f))for(l in v(g,u)&&x(g[u])||(g[u]={}),f)v(f,l)&&(g[u][l]=f[l]);else"class"==a&&v(g,u)?g[u]+=" "+f:g[u]=f}else h+=""+o;for(u in t="<"+p,g=function(n){var e,r,t,i={};for(e in n)r=d(e),t=n[e],1<r.length&&(i[y(r.join("-"))]=t,i[y(r.join("_"))]=t),i[e]=t;return i}(g)){if(a="",x(g[u]))for(l in c=N(g[u]))a+=l+":"+c[l]+";";else a+=g[u];t+=" "+u+'="'+a+'"'}return w[y(b(p))]&&!h.length?t+=">":t+=">"+h+"</"+p+">",t};Y.escape=function(n){var e={"&":"&","<":"<",">":">",'"':""","'":"'"};return n.replace(/[&<>"']/g,function(n){return e[n]})},Y.SVG=function(n,e){var r,t=arguments,i=["svg",{width:n+"px",height:e+"px",viewBox:"0 0 "+n+" "+e,xmlns:"http://www.w3.org/2000/svg"}];for(r=2;r<t.length;r++)i.push(t[r]);return i};var nn="mlhvcsqtaz";function en(n){return function(){return Y.SVG.Path()[n].apply(null,arguments)}}for(var rn in nn=p((nn+r(nn)).split("").join(",")),Y.SVG.Path=function(){function n(r){return function(){i.d+=r;for(var n=arguments,e=0;e<n.length;++e)i.d+=n[e]+", "[1&e];return o}}var e,r,t,i={d:""},o=["path",i],u=arguments;for(e=0;e<u.length;e++)if(x(u[e])){for(t in r={},u[e])"d"==t?i.d+=u[e][t]+" ":r[t]=u[e][t];o.push(r)}else o.push(u[e]);for(t in nn)o[t]=n(t);return o},nn)Y.SVG.Path[rn]=en(rn);function tn(n){var e,r,t,i="";for(e=!s(n)&&m(n)?n:cn(n),t=0;t<e.length;++t)t&&(i+="/"),":"==(r=e[t])[0]&&(r=b(r.substring(1)),i in an&&(r=an[i])),i+=an[i]=r;return i in ln&&ln[i](),!1}function on(){return o.location.hash}function un(){if(!fn){ln={},an={},fn=!0;var n,e,r=cn(on()),t="";for(e=0;e<r.length;++e)e&&(t+="/"),n=r[e],t+=an[t]=n;if("onhashchange"in o)o.addEventListener("hashchange",function(){tn(on())});else{var i=on();setInterval(function(){var n=on();n!=i&&tn(i=n)},100)}}}var ln,an,fn=!1,cn=function(n){if(s(n)||!m(n))return cn((""+n).split("/"));var e,r,t=[];for(e=0;e<n.length;++e)n[e].length&&("#"==(r=b(n[e]))[0]&&(r=r.substring(1)),t.push(r));return t};if(u||(Y.autoFixCSS=N,Y.load=function(){var n=[];return Q(arguments,n),function(n){var e,r,t,i,o,u,l=[],a=[],f={done:function(n){return a.d=n,f}},c=p("png,bmp,gif,jpg,jpeg,svg,webp");for(a.c=function(){if(a.length==a.n&&0<a.n){var n,e,r,t,i,o;for(a.n=0,a.sort(function(n,e){return n[0]-e[0]}),n=0;n<a.length;++n)i=(e=a[n])[1][1],o=e[1][2],!i&&(r=o.match(C))&&(i=y(r[1])),"css"==i&&((t=h("style")).type="text/css",t.innerText=N(W(o,e[2]).replace(/[\r\n]/g,"")),k.appendChild(t)),"js"==i&&((t=h("script")).text="//# sourceURL="+o+"\n"+e[2],k.appendChild(t).parentNode.removeChild(t));g(a.d)&&a.d()}},e=0;e<n.length;++e)(o=$.exec(n[e]))[0]=(s(o[1])?"":o[1])+":"+o[2],o[0]in K||l.push(o);for(a.n=l.length,e=0;e<a.n;++e)r=l[e],"img"==y(""+r[1])||(o=(""+r[2]).match(C))&&c[y(o[1])]?((u=new Image).onload=u.onerror=_(u,e,r,a),u.src=r[2]):((i=new XMLHttpRequest).onreadystatechange=X(i,e,r,a),t=-1<r[2].indexOf("?")?"&":"?",i.open("GET",r[2]+t+Math.random(),!0),i.responseType="text",i.send());return a.n<1&&setTimeout(function(){g(a.d)&&a.d()},10),f}(n)},Y.route=function(n,e){return un(),g(e)?(ln[cn(n).join("/")]=e,Y):cn(on())},Y.route.go=function(n){return un(),s(n)?tn(on()):tn(n)}),!n){s(o.HTML)&&(o.HTML=Y);var sn=Y;sn.svg=sn.SVG,sn.svg.path=sn.svg.path,o.aris=sn}return Y}); |
{ | ||
"name": "aris", | ||
"version": "1.0.5", | ||
"version": "1.0.7", | ||
"description": "Write HTML in JS easily.", | ||
@@ -5,0 +5,0 @@ "main": "aris.js", |
@@ -143,2 +143,10 @@ # Aris - Write HTML in JS easily. | ||
### Escaping HTML special characters | ||
- `HTML.escape(text)` | ||
Returns the chunk of text with special HTML characters (`<>?"'`) escaped. | ||
To allow HTML to be used in text, Aris does not auto-escape special HTML characters. | ||
Please use this function to manually escape the characters where intended. | ||
### Lazy Loading | ||
@@ -323,3 +331,5 @@ | ||
We initially want to name our library `html.js`. | ||
Aris stands for "A Revolution In Syntax". | ||
We initially wanted to name our library `html.js`. | ||
However, when we tried to publicize our library on npm, we found that most of the good short names | ||
@@ -338,3 +348,3 @@ have been already taken by name-squatters or poor-quality libraries. | ||
- A simple 3 page web example. | ||
- `HTML.load.images` for preloading images. | ||
- `HTML.load` for preloading images. | ||
@@ -341,0 +351,0 @@ ## License |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47846
821
350