Comparing version 1.0.7 to 1.0.8
448
aris.js
/*! | ||
* Aris JavaScript Library v1.0.7 | ||
* Aris JavaScript Library v1.0.8 | ||
* @author Benjamin Kang Yue Sheng | ||
@@ -186,6 +186,6 @@ * MIT license | ||
* ['circle', {class:'frame', cx:15, cy:15, r:12}], | ||
* ['path' {class:'hand hour', d:'M15,15 L20,15'}], | ||
* ['path' {class:'hand minute', d:'M15,15 L15,2'}], | ||
* ['path' {d:'M0,0 L1,1'}], | ||
* ['path' {d:'M0,0 L1,1'}], | ||
* ['path', {class:'hand hour', d:'M15,15 L20,15'}], | ||
* ['path', {class:'hand minute', d:'M15,15 L15,2'}], | ||
* ['path', {d:'M0,0 L1,1'}], | ||
* ['path', {d:'M0,0 L1,1'}], | ||
* ]) | ||
@@ -208,5 +208,5 @@ * => | ||
if ( typeof module === "object" && typeof module.exports === "object" ) { | ||
module.exports = factory(global, true); | ||
module.exports = factory(global, 1); | ||
} else { | ||
factory( global ); | ||
factory(global); | ||
} | ||
@@ -234,2 +234,3 @@ | ||
var cssUrlRe = /url\(\s*?["']?(.*?)["']?\s*?\)/g; | ||
var cssAbsUrlRe = /^\s*?(data\:|.{1,6}\:\/\/)/; | ||
var cssCommentRe = /\/\*[\s\S]*?\*\//g; | ||
@@ -241,2 +242,8 @@ var fileExtRe = /\.([A-Za-z0-9]+)(?:[\?#]|$)/; | ||
var hashPopRe = /(?:(^\/)|\/)[^\/]+[\/]*$/; // $1 | ||
var hashResolveRe = /^#\/?|(\/)(?:\.?\/)+|(?:(?!\.\.?)[^\/])+\/\.\.(?:\/|$)|([^\^])\/+$/; | ||
var hashCompsRe = /(?:(^|\/)(:?)([^\/]+))/g; | ||
var locationPathPopRe = /((^|\/)[^\/]*)$/; | ||
var htmlTagRe = /^[\w]+$/; | ||
var noop = function (x) { return x; }; | ||
@@ -246,4 +253,3 @@ var head = noBrowser ? noop : document.head; | ||
var splitWords = function (s) { | ||
var a = [], m; | ||
while (m = splitWordsRe.exec(s)) a.push(m[0]); | ||
for (var a = [], m; m = splitWordsRe.exec(s);) a.push(m[0]); | ||
return a; | ||
@@ -254,6 +260,5 @@ }; | ||
for (k in o) { | ||
w = splitWords(k), v = o[k]; | ||
if (w.length > 1) { | ||
d[lc(w.join('-'))] = v; | ||
d[lc(w.join('_'))] = v; | ||
v = o[k]; | ||
if ((w = splitWords(k)).length > 1) { | ||
d[w.join('-').toLowerCase()] = d[w.join('_').toLowerCase()] = v; | ||
} | ||
@@ -264,10 +269,7 @@ d[k] = v; | ||
}; | ||
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 && 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(); }; | ||
var uc = function (s) { return s.toUpperCase(); }; | ||
var isT = function (s) { return (function (x) { | ||
return x && Object.prototype.toString.call(x) == '[object '+s+']' }) }; | ||
var isArray = isT('Array'); | ||
var isObject = isT('Object'); | ||
var isFunction = isT('Function'); | ||
var trim = function (s) { return String.prototype.trim ? s.trim() : s.replace(stringTrimRe, ''); }; | ||
@@ -277,3 +279,3 @@ | ||
var styles = noBrowser ? [] : gcs(document.documentElement, null); | ||
var cssTester = noBrowser ? [] : ce('div').style; | ||
var cssTester = noBrowser ? [] : document.createElement('div').style; | ||
var cssPropsList = []; | ||
@@ -308,3 +310,3 @@ var cssProps = {}, bestPrefix = '', bestPrefixCount = 0; | ||
} else { | ||
var re = /[A-Z]/g, p, f = function(x) { return '-' + lc(x) }; | ||
var re = /[A-Z]/g, p, f = function(x) { return '-' + x.toLowerCase() }; | ||
for (p in styles) cssPropsList.push(p.replace(re, f)); | ||
@@ -318,3 +320,3 @@ } | ||
for (s = p[0], o = 1; o < p.length; ++o) | ||
s += uc(p[o][0]) + p[o].substring(1); | ||
s += p[o][0].toUpperCase() + p[o].substring(1); | ||
if (s in cssTester) cssProps[p.join('-')] = 1; | ||
@@ -407,10 +409,9 @@ } | ||
return function (css) { | ||
if (functions.length) { | ||
if (functions.indexOf('linear-gradient') > -1) { | ||
// Gradients are supported with a prefix, convert angles to legacy | ||
css = css.replace(/(\s|:|,)(repeating-)?linear-gradient\(\s*(-?\d*\.?\d*)deg/ig, | ||
function ($0, delim, repeating, deg) { | ||
return delim + (repeating || '') + 'linear-gradient(' + (90-deg) + 'deg'; | ||
}); | ||
} | ||
for (var i = functions.length, lg = 'linear-gradient'; i--; ) if (functions[i] == lg) { | ||
// Gradients are supported with a prefix, convert angles to legacy | ||
css = css.replace(/(\s|:|,)(repeating-)?linear-gradient\(\s*(-?\d*\.?\d*)deg/ig, | ||
function ($0, delim, repeating, deg) { | ||
return delim + (repeating || '') + lg + '(' + (90-deg) + 'deg'; | ||
}); | ||
i = 0; | ||
} | ||
@@ -425,25 +426,25 @@ css = functionsFix(css); | ||
var selectors = [], atrules = []; | ||
var pl = ':placeholder'; | ||
var selectorsTests = { | ||
':any-link': null, | ||
'::backdrop': null, | ||
':fullscreen': null, | ||
':any-link': 0, | ||
'::backdrop': 0, | ||
':fullscreen': 0, | ||
':full-screen': ':fullscreen', | ||
//sigh | ||
'::placeholder': null, | ||
':placeholder': ':placeholder-shown', | ||
'::input-placeholder': '::placeholder', | ||
':input-placeholder': ':placeholder-shown', | ||
':read-only': null, | ||
':read-write': null, | ||
'::selection': null | ||
'::placeholder': 0, | ||
':placeholder': pl + '-shown', | ||
'::input-placeholder': ':' + pl, | ||
':input-placeholder': pl + '-shown', | ||
':read-only': 0, | ||
':read-write': 0, | ||
'::selection': 0 | ||
}; | ||
var atrulesTests = { | ||
'keyframes': 'name', | ||
'viewport': null, | ||
'viewport': 0, | ||
'document': 'regexp(".")' | ||
}; | ||
var selectorMap = {}, t; | ||
var style = head.appendChild(ce('style')); | ||
var selectorMap = {}, t, test; | ||
var style = head.appendChild(document.createElement('style')); | ||
@@ -466,3 +467,3 @@ var supported = function (selector) { | ||
for (t in atrulesTests) { | ||
var test = t + ' ' + (atrulesTests[t] || ''); | ||
test = t + ' ' + (atrulesTests[t] || ''); | ||
if(!supported('@' + test) && supported('@' + bestPrefix + test)) { | ||
@@ -489,3 +490,3 @@ atrules.push(t); | ||
af = {}; | ||
for (k in css) if (hasKey(css, k)) { | ||
for (k in css) if (css.hasOwnProperty(k)) { | ||
v = css[k]; | ||
@@ -498,3 +499,3 @@ k = trim(k); | ||
if (!(cssProps[k])) { | ||
for (var pf in cssPrefixes) { | ||
for (pf in cssPrefixes) { | ||
af[pf + k] = v; | ||
@@ -542,9 +543,7 @@ } | ||
if (url[0] != '/') { | ||
url = window.location.pathname.split('/').slice(0,-1).join('/') + '/' + url; | ||
url = window.location.pathname.replace(locationPathPopRe, '') + '/' + url; | ||
} | ||
url = url.split('/').slice(0,-1).join('/'); | ||
url = url.replace(locationPathPopRe, ''); | ||
return css.replace(cssUrlRe, function (x, g) { | ||
var p = g.indexOf('//'); | ||
if (g.indexOf('data:') == 0 || (p > -1 && p < 9)) return x; | ||
if (g.match(cssAbsUrlRe)) return x; | ||
var urlComps = url.split('/'), cssURLComps = g.split('/'), i; | ||
@@ -561,8 +560,14 @@ for (i = 0; i < cssURLComps.length; ++i) { | ||
return function() { | ||
if (xhr.readyState == 4) { | ||
var status = xhr.status, responseText = ''; | ||
if (status == 200 || status == 0) { | ||
loadedFiles[urlMatch[0]] = 1; | ||
responseText = xhr.responseText; | ||
} | ||
var lastModified = xhr.getResponseHeader('Last-Modified'); | ||
if (status >= 200 && status < 300) { | ||
loadedFiles[urlMatch[0]] = [ | ||
lastModified, | ||
responseText = xhr.responseText | ||
]; | ||
} else if (status == 304) { | ||
responseText = loadedFiles[urlMatch[0]][1] | ||
} | ||
ctl.push([i, urlMatch, responseText]); | ||
@@ -575,11 +580,10 @@ } | ||
return function () { | ||
var x = [i, urlMatch, '']; | ||
if (img.naturalWidth) { | ||
var x = [i, urlMatch, ''], p = function () { | ||
ctl.push(x); | ||
ctl.c(); | ||
}; | ||
if (img.naturalWidth) { | ||
p(); | ||
} else { | ||
setTimeout(function() { | ||
ctl.push(x); | ||
ctl.c(); | ||
}, 100); | ||
setTimeout(p, 100); | ||
} | ||
@@ -593,3 +597,3 @@ }; | ||
done: function (f) { | ||
ctl.d = f; | ||
ctl.d = isFunction(f) ? f : noop; | ||
return ctlWrap; | ||
@@ -599,3 +603,3 @@ } | ||
ctl.c = function () { | ||
if (ctl.length == ctl.n && ctl.n > 0) { | ||
if (ctl.length == ctl.n && ctl.n) { | ||
ctl.n = 0; | ||
@@ -607,5 +611,5 @@ ctl.sort(function (a, b) { return a[0] - b[0]; }); | ||
if (!t && (m = url.match(fileExtRe))) | ||
t = lc(m[1]); | ||
t = m[1].toLowerCase(); | ||
if (t == 'css') { | ||
el = ce('style'); | ||
el = document.createElement('style'); | ||
el.type = 'text/css'; | ||
@@ -616,3 +620,3 @@ el.innerText = autoFixCSS(fixCSSRelUrls(url, r[2]).replace(/[\r\n]/g, '')); | ||
if (t == 'js') { | ||
el = ce('script'); | ||
el = document.createElement('script'); | ||
// Allows easier debugging. | ||
@@ -624,11 +628,10 @@ el.text = '//# sourceURL=' + url + '\n' + r[2]; | ||
if (isFunction(ctl.d)) | ||
ctl.d(); | ||
ctl.d(); | ||
} | ||
}; | ||
ctl.d = noop; | ||
for (i = 0; i < urls.length; ++i) { | ||
m = filePreExtRe.exec(urls[i]); | ||
m[0] = (isUndefined(m[1]) ? '' : m[1]) + ':' + m[2]; | ||
if (!(m[0] in loadedFiles)) | ||
required.push(m); | ||
required.push(m); | ||
} | ||
@@ -638,4 +641,4 @@ ctl.n = required.length; | ||
r = required[i]; | ||
if (lc(''+r[1]) == 'img' || | ||
((m = (''+r[2]).match(fileExtRe)) && imageExtensions[lc(m[1])])) { | ||
if ((''+r[1]).toLowerCase() == 'img' || | ||
((m = (''+r[2]).match(fileExtRe)) && imageExtensions[m[1].toLowerCase()])) { | ||
img = new Image(); | ||
@@ -648,3 +651,6 @@ img.onload = img.onerror = imageReadyChecker(img, i, r, ctl); | ||
s = r[2].indexOf('?') > -1 ? '&' : '?'; | ||
xhr.open('GET', r[2] + s + Math.random(), true); | ||
xhr.open('GET', r[2] + s + Math.random(), 1); | ||
if (s = loadedFiles[r[0]]) { | ||
xhr.setRequestHeader('If-Modified-Since', s[0]); | ||
} | ||
xhr.responseType = 'text'; | ||
@@ -654,7 +660,4 @@ xhr.send(); | ||
} | ||
if (ctl.n < 1) { | ||
setTimeout(function() { | ||
if (isFunction(ctl.d)) | ||
ctl.d(); | ||
}, 10); | ||
if (!ctl.n) { | ||
setTimeout(ctl.d, 10); | ||
} | ||
@@ -680,26 +683,63 @@ return ctlWrap; | ||
var mapNext = function (context, i) { | ||
var v = context[i].slice(), j, o = i + 1, n = v.length, r = ''; | ||
for (o = i + 1; isFunction(context[o]); ++o) | ||
for (j = 0; j < n; ++j) | ||
v[j] = context[o](v[j]); | ||
for (j = 0; j < n; ++j) | ||
r += HTML(v[j]); | ||
return {r: r, i: o - 1}; | ||
}; | ||
var isUndefinedOrNull = function (x) { return isUndefined(x) || x === null; }; | ||
var HTML = function(context) { | ||
var a = arguments, n = context.length; | ||
if (a.length > 1) return HTML(a); | ||
if (isUndefinedOrNull(context)) return ''; | ||
var r, i, obj, k, k2, t, v, css, mSub, | ||
tag = context[0], content = '', attrs = {}, concats = [];; | ||
var a = arguments, r, i, obj, k, k2, t, v, css, mSub, j, mn, sk, skk, f, | ||
content = '', attrs = {}; | ||
if (a.length > 1) { | ||
for (content = [], i = 0; i < a.length; ++i) | ||
content.push(a[i]); | ||
return HTML(content); | ||
} | ||
if (!isArray(context)) return '' + context; | ||
if (isArray(context[0]) && n) { | ||
for (r = '', i = 0; i < n; i++) r += HTML(context[i]); | ||
var n = context.length, tag = context[0] + ''; | ||
if (!n) return ''; | ||
if (n && (isArray(context[0]) || context[0] === null || !tag.match(htmlTagRe))) { | ||
for (r = '', i = 0; i < n; i++) { | ||
if (isFunction(context[i+1])) { | ||
mn = mapNext(context, i); | ||
r += mn.r; | ||
i = mn.i; | ||
} else { | ||
r += HTML(context[i]); | ||
} | ||
} | ||
return r; | ||
} | ||
for (i = 1; i < n; i++) if (context[i]) { | ||
for (i = 1; i < n; i++) if (context[i] !== null) { | ||
obj = context[i]; | ||
if (isArray(obj)) { | ||
content += HTML(obj); | ||
if (isFunction(context[i+1])) { | ||
mn = mapNext(context, i); | ||
content += mn.r; | ||
i = mn.i; | ||
} else { | ||
content += HTML(obj); | ||
} | ||
} else if (isObject(obj)) { | ||
for (k in obj) { | ||
v = obj[k]; | ||
t = lc(trim(k)); | ||
t = trim(k).toLowerCase(); | ||
if (t == 'style' && !isObject(v)) { | ||
v = '' + v; | ||
v += ''; | ||
css = {}; | ||
@@ -710,10 +750,10 @@ while (mSub = cssPropRe.exec(v)) | ||
} | ||
if (hasKey(obj, k) && v != null) { | ||
if (obj.hasOwnProperty(k) && v !== null) { | ||
if (isObject(v)) { | ||
if (!hasKey(attrs, k) || !isObject(attrs[k])) | ||
if (!attrs.hasOwnProperty(k) || !isObject(attrs[k])) | ||
attrs[k] = {}; | ||
for (k2 in v) if (hasKey(v, k2)) | ||
for (k2 in v) if (v.hasOwnProperty(k2)) | ||
attrs[k][k2] = v[k2]; | ||
} else { | ||
if (t != 'class' || !hasKey(attrs, k)) | ||
if (t != 'class' || !attrs.hasOwnProperty(k)) | ||
attrs[k] = v; | ||
@@ -725,19 +765,37 @@ else | ||
} | ||
} else content += '' + obj; | ||
} else if (!isUndefinedOrNull(obj)) { | ||
content += obj; | ||
} | ||
} | ||
r = '<' + tag; | ||
attrs = populateCaseVariations(attrs); | ||
for (k in attrs) { | ||
v = Object.keys; | ||
sk = v(attrs).sort(); | ||
for (i = 0; i < sk.length; ++i) { | ||
k = sk[i]; | ||
t = ''; | ||
f = 1; | ||
if (isObject(attrs[k])) { // css case | ||
css = autoFixCSS(attrs[k]); | ||
for (k2 in css) | ||
skk = v(css).sort(); | ||
for (j = 0; j < skk.length; ++j) { | ||
k2 = skk[j] | ||
t += k2 + ':' + css[k2] + ';'; | ||
} | ||
} else if (isArray(attrs[k])) { | ||
for (j = 0; f && j < attrs[k].length; ++j) { | ||
if (attrs[k][j]) { | ||
r += ' ' + k; | ||
f = 0; | ||
} | ||
} | ||
f = 0; | ||
} else { | ||
t += attrs[k]; | ||
} | ||
r += ' ' + k + '="' + t + '"'; | ||
if (f) | ||
r += ' ' + k + '="' + HTML.escape(t) + '"'; | ||
} | ||
if (emptyTags[lc(trim(tag))] && !content.length) | ||
if (emptyTags[trim(tag).toLowerCase()] && !content) | ||
r += '>'; | ||
@@ -749,11 +807,30 @@ else | ||
HTML.bool = function (name, isTrue) { | ||
var attrs = {}; | ||
if (isTrue) attrs[name] = name; | ||
return attrs; | ||
}; | ||
HTML.hash = function () { | ||
var s, a = arguments, h = 0, i, j; | ||
for (j = 0; j < a.length; ++j) { | ||
for (s = HTML(a[j]), i = 0; i < s.length; ++i) { | ||
h = (((h << 5) - h) + s.charCodeAt(i)) | 0; | ||
} | ||
} | ||
return h; | ||
}; | ||
var htmlEscapeChars = { | ||
'&': '&', | ||
'<': '<', | ||
'>': '>', | ||
'"': '"', | ||
"'": ''' | ||
}, | ||
htmlEscapeRe = /[&<>"']/g, | ||
htmlEscapeFunc = function(m) { return htmlEscapeChars[m] }; | ||
HTML.escape = function(text) { | ||
var chars = { | ||
'&': '&', | ||
'<': '<', | ||
'>': '>', | ||
'"': '"', | ||
"'": ''' | ||
}; | ||
return text.replace(/[&<>"']/g, function(m) { return chars[m]; }); | ||
return text.replace(htmlEscapeRe, htmlEscapeFunc); | ||
}; | ||
@@ -774,5 +851,5 @@ | ||
var svgCmds = 'mlhvcsqtaz'; | ||
svgCmds = toSet((svgCmds + uc(svgCmds)).split('').join(',')); | ||
svgCmds = toSet((svgCmds + svgCmds.toUpperCase()).split('').join(',')); | ||
HTML.SVG.Path = function () { | ||
var svgPath = function () { | ||
var attrs = {d:''}, path = ['path', attrs], a = arguments, i, p, k, | ||
@@ -788,3 +865,3 @@ P = function (command) { | ||
for (i = 0; i < a.length; i++) { | ||
if (isObject(a[i])) { | ||
if (isObject(p = a[i])) { | ||
p = {}; | ||
@@ -798,6 +875,4 @@ for (k in a[i]) { | ||
} | ||
path.push(p); | ||
} else { | ||
path.push(a[i]); | ||
} | ||
} | ||
path.push(p); | ||
} | ||
@@ -809,46 +884,38 @@ for (k in svgCmds) | ||
var svgPathAppender = function (c) { | ||
return function () { return HTML.SVG.Path()[c].apply(null, arguments); }; | ||
return function () { return svgPath()[c].apply(null, arguments); }; | ||
}; | ||
for (var c in svgCmds) | ||
HTML.SVG.Path[c] = svgPathAppender(c); | ||
svgPath[c] = svgPathAppender(c); | ||
HTML.SVG.Path = svgPath; | ||
var routes, savedRoutes, routesInited = false; | ||
var routes = {}, savedRoutes = {}, routesInited = 0, refreshable = 0; | ||
var hashComps = function (h) { | ||
if (!isUndefined(h) && isArray(h)) { | ||
var comps = [], i, s; | ||
for (i = 0; i < h.length; ++i) { | ||
if (h[i].length) { | ||
s = trim(h[i]); | ||
if (s[0] == '#') s = s.substring(1); | ||
comps.push(s); | ||
} | ||
} | ||
return comps; | ||
} else { | ||
return hashComps(('' + h).split('/')); | ||
var hashResolve = function (h) { | ||
for (var p, t = 1; t; ) { | ||
p = h; | ||
h = h.replace(hashResolveRe, '$1$2'); | ||
t = p != h; | ||
} | ||
return h; | ||
}; | ||
var execRoute = function (h) { | ||
var comps, p = '', e, c, i; | ||
if (!isUndefined(h) && isArray(h)) { | ||
comps = h; | ||
} else { | ||
comps = hashComps(h); | ||
//HTML.hashResolve = hashResolve; | ||
var execRoute = function (h, s) { | ||
var p = '', j, c, m, a = hashResolve(h); | ||
while (m = hashCompsRe.exec(a)) { | ||
p += m[1]; | ||
c = m[3]; | ||
if (m[2] && (j = savedRoutes[p])) | ||
c = j; | ||
if (!s) savedRoutes[p] = c; | ||
p += c; | ||
} | ||
for (i = 0; i < comps.length; ++i) { | ||
if (i) p += '/'; | ||
c = comps[i]; | ||
if (c[0] == ':') { | ||
c = trim(c.substring(1)); | ||
if (p in savedRoutes) { | ||
c = savedRoutes[p]; | ||
} | ||
for (j = p; j; j = j.replace(hashPopRe, '$1')) { | ||
if (routes[j]) { | ||
p = j; | ||
j = ''; | ||
} | ||
savedRoutes[p] = c; | ||
p += c; | ||
} | ||
if (p in routes) routes[p](); | ||
return false; | ||
if (!s && isFunction(c = routes[p])) c(); | ||
return p; | ||
}; | ||
@@ -860,21 +927,25 @@ | ||
if (routesInited) return; | ||
routes = {}; | ||
savedRoutes = {}; | ||
routesInited = true; | ||
var comps = hashComps(wlh()), p = '', c, i; | ||
for (i = 0; i < comps.length; ++i) { | ||
if (i) p += '/'; | ||
c = comps[i]; | ||
savedRoutes[p] = c; | ||
p += c; | ||
routesInited = 1; | ||
var a = hashResolve(wlh()), p = '', t, r, m, | ||
c, i, storedHash, h, ael = 'addEventListener', | ||
clickCallback = function (e) { | ||
for (t = refreshable && e.target; t; t = t.parentElement) | ||
if (t.tagName.toUpperCase()=='A' && | ||
(r=t.getAttribute('href')) && | ||
(r=(''+r).match('#(.*)')) && | ||
(r=execRoute(r[1],1)) == execRoute(wlh(),1) && | ||
(r=routes[r])) { r(); return; } | ||
}; | ||
while (m = hashCompsRe.exec(a)) { | ||
p += m[1] + (savedRoutes[p] = m[3]); | ||
} | ||
if ('onhashchange' in window) { | ||
window.addEventListener('hashchange', function () { | ||
window[ael]('hashchange', function () { | ||
execRoute(wlh()); | ||
}); | ||
} else { | ||
var storedHash = wlh(); | ||
storedHash = wlh(); | ||
setInterval(function () { | ||
var h = wlh(); | ||
h = wlh(); | ||
if (h != storedHash) { | ||
@@ -885,27 +956,44 @@ storedHash = h; | ||
}, 100); | ||
} | ||
} | ||
if (document[ael]) { | ||
document[ael]('click', clickCallback, false); | ||
} else { | ||
document.attachEvent('onclick', clickCallback); | ||
} | ||
}; | ||
if (!noBrowser) { | ||
HTML.autoFixCSS = autoFixCSS; | ||
HTML.load = load; | ||
HTML.route = function (r, fn) { | ||
var rx = function (r, fn) { | ||
setupHashChange(); | ||
if (isFunction(fn)) { | ||
routes[hashComps(r).join('/')] = fn; | ||
return HTML; | ||
} else { | ||
return hashComps(wlh()); | ||
} | ||
if (isUndefined(r)) return hashResolve(wlh()); | ||
if (fn) { | ||
routes[hashResolve(r)] = fn; | ||
// return HTML so that we can chain | ||
// HTML.route('a', fn).route('b', fn) | ||
return HTML; | ||
} | ||
// If no args are provided, | ||
// return the window.location.hash splitted. | ||
return routes[execRoute(hashResolve(r), 1)]; | ||
}; | ||
HTML.route.go = function (r) { | ||
rx.path = function (r) { | ||
return isUndefined(r) ? hashResolve(wlh()): execRoute(r, 1); | ||
} | ||
rx.go = function (r) { | ||
setupHashChange(); | ||
if (!isUndefined(r)) { | ||
return execRoute(r); | ||
} else { | ||
return execRoute(wlh()); | ||
} | ||
return false; | ||
r = execRoute(isUndefined(r) ? wlh() : r); | ||
return routes[r] ? r : !!0; | ||
}; | ||
rx.refreshable = function (v) { | ||
setupHashChange(); | ||
if (isUndefined(v)) return !!refreshable; | ||
refreshable = v; | ||
return HTML; | ||
}; | ||
HTML.route = rx; | ||
} | ||
@@ -918,3 +1006,3 @@ | ||
aris.svg = aris.SVG; | ||
aris.svg.path = aris.svg.path; | ||
aris.svg.path = aris.svg.Path; | ||
window.aris = aris; | ||
@@ -921,0 +1009,0 @@ } |
@@ -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 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}); | ||
!function(n,r){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=r(n,1):r(n)}("undefined"!=typeof window?window:this,function(c,n){"use strict";function l(n){return"undefined"==typeof n}function p(n){for(var r={},e=(n=n[u](","))[j];e--;)r[n[e]]=1;return r}function d(n){return n}function y(n){for(var r,e=[];r=a.exec(n);)e.push(r[0]);return e}function r(r){return function(n){return n&&Object.prototype.toString.call(n)=="[object "+r+"]"}}function w(n){return String.prototype.trim?n.trim():n[v](i,"")}var g=c.document,u="split",j="length",$="toLowerCase",v="replace",h="createElement",s="toUpperCase",m="appendChild",S="hasOwnProperty",k="match",e=c.getComputedStyle,t=l(g)||l(e),x=p("column-count,fill-opacity,font-weight,line-height,opacity,orphans,widows,z-index,zoom"),A=p("area,base,br,col,embed,hr,img,input,keygen,link,meta,param,source,track,wbr"),b=/((?:\\.|("|')(?:\\.|.)*?\2|[^{}])*)([{}])/g,z=/(?:^|\{|\s|;)([A-Za-z0-9\-]+)\s*\:\s*?((?:\\.|("|')(?:\\.|.)*?\3|[^;}])*)/g,o=/url\(\s*?["']?(.*?)["']?\s*?\)/g,f=/^\s*?(data\:|.{1,6}\:\/\/)/,C=/\/\*[\s\S]*?\*\//g,E=/\.([A-Za-z0-9]+)(?:[\?#]|$)/,F=/^(?:\s*?(js|css)\s*?\:)?\s*?(\S[\S\s]*)/i,i=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,a=/(?:(?:^|[A-Z])[a-z]+|[0-9]+|[A-Za-z]+)/g,T=/(?:(^\/)|\/)[^\/]+[\/]*$/,L=/^#\/?|(\/)(?:\.?\/)+|(?:(?!\.\.?)[^\/])+\/\.\.(?:\/|$)|([^\^])\/+$/,M=/(?:(^|\/)(:?)([^\/]+))/g,R=/((^|\/)[^\/]*)$/,H=/^[\w]+$/,O=t?d:g.head,Z=r("Array"),q=r("Object"),G=r("Function"),I=t?[]:e(g.documentElement,null),P=t?[]:g[h]("div").style,V=[],N={},U="",B=0,W=p("-webkit-,-moz-,-ms-,-o-");if(t&&(W={}),I&&0<I[j])V=I;else{var X=/[A-Z]/g,_=function(n){return"-"+n[$]()};for(J in I)V.push(J[v](X,_))}for(var D,J,K,Q,Y=0;Y<2;++Y)for(D=V[j];D--;)if(J=V[D][u]("-"),Y<1&&""!=J[0])for(;1<=J[j];J.pop()){for(K=J[0],Q=1;Q<J[j];++Q)K+=J[Q][0][s]()+J[Q].substring(1);K in P&&(N[J.join("-")]=1)}else if(Y<2&&""==J[0]&&(nn="-"+J[1]+"-",W[nn])){for(J=J.slice(2);1<=J[j];J.pop())delete N[J.join("-")];W[nn]++}for(var nn in W)W[nn]>B&&(B=W[nn],U=nn);function rn(r,n,e,t){var o=RegExp(n+"("+r.join("|")+")"+e,"g");return function(n){return r[j]?n[v](o,t):n}}function en(n){var r,e,t,o,i,u,f="",a=0;if(q(n)){for(i in u={},n)if(n[S](i)){if(r=n[i],i=w(i),"number"!=typeof r||x[i]||(r+="px"),r=cn(r),!N[i])for(o in W)u[o+i]=r;u[i]=r}return u}for(n=n[v](C,"");t=b.exec(n);){var c=t[3];if("{"==c)f+=""+t[1]+c,++a;else if("}"==c){for(u={};e=z.exec(t[1]);){if(!N[e[1]])for(o in W)u[o+e[1]]=e[2];u[e[1]]=e[2]}for(i in u)f+=i+":"+u[i]+";";f+=""+c,a=0<a?a-1:0}}return sn(cn(f))}function tn(i,n){return"/"!=(i=w(i))[0]&&(i=c.location.pathname[v](R,"")+"/"+i),i=i[v](R,""),n[v](o,function(n,r){if(r[k](f))return n;var e,t=i[u]("/"),o=r[u]("/");for(e=0;e<o[j];++e)".."==o[e]?t.pop():t.push(o[e]);return"url('"+t.join("/")+"')"})}function on(t,o,i,u){return function(){if(4==t.readyState){var n=t.status,r="",e=t.getResponseHeader("Last-Modified");200<=n&&n<300?ln[i[0]]=[e,r=t.responseText]:304==n&&(r=ln[i[0]][1]),u.push([o,i,r])}u.c()}}function un(e,t,o,i){return function(){function n(){i.push(r),i.c()}var r=[t,o,""];e.naturalWidth?n():setTimeout(n,100)}}function fn(n,r){var e,t=n[r].slice(),o=r+1,i=t[j],u="";for(o=r+1;G(n[o]);++o)for(e=0;e<i;++e)t[e]=n[o](t[e]);for(e=0;e<i;++e)u+=dn(t[e]);return{r:u,i:o-1}}function an(n){return l(n)||null===n}var cn=t?d:function(){var n,r="backgroundImage",e="-gradient",t="cursor",o="display",i="width",u=[],f=[],a={calc:[i,"1px + 5%"],element:[r,"#foo"],"cross-fade":[r,"url(a.png), url(b.png), 50%"],"image-set":[r,"url(a.png) 1x, url(b.png) 2x"]};function c(n,r){return P[r]="",P[r]=n,!!P[r]}for(n in a["repeating-linear"+e]=a["repeating-radial"+e]=a["radial"+e]=a["linear"+e]=[r,"red, teal"],a){var s=a[n],l=s[0],p=n+"("+s[1]+")";!c(p,l)&&c(U+p,l)&&u.push(n)}var d=rn(u,"(\\s|:|,)","\\s*\\(","$1"+U+"$2("),g={initial:"color",grab:t,grabbing:t,"zoom-in":t,"zoom-out":t,box:o,flexbox:o,"inline-flexbox":o,flex:o,"inline-flex":o,grid:o,"inline-grid":o,"max-content":i,"min-content":i,"fit-content":i,"fill-available":i,"contain-floats":i};for(n in g)!c(n,l=g[n])&&c(U+n,l)&&f.push(n);var h=rn(f,"(\\s|:)","(\\s|;|\\}|$)","$1"+U+"$2$3");return function(n){for(var r=u[j],o="linear-gradient";r--;)u[r]==o&&(n=n[v](/(\s|:|,)(repeating-)?linear-gradient\(\s*(-?\d*\.?\d*)deg/gi,function(n,r,e,t){return r+(e||"")+o+"("+(90-t)+"deg"}),r=0);return n=d(n),h(n)}}(),sn=t?d:function(){function n(n){return c.textContent=n+"{}",!!c.sheet.cssRules[j]}var r,e,t=[],o=[],i=":placeholder",u={":any-link":0,"::backdrop":0,":fullscreen":0,":full-screen":":fullscreen","::placeholder":0,":placeholder":i+"-shown","::input-placeholder":":"+i,":input-placeholder":i+"-shown",":read-only":0,":read-write":0,"::selection":0},f={keyframes:"name",viewport:0,document:'regexp(".")'},a={},c=O[m](g[h]("style"));for(r in u){var s=u[r]||r,l=r[v](/::?/,function(n){return n+U});!n(s)&&n(l)&&(t.push(s),a[s]=l)}for(r in f)!n("@"+(e=r+" "+(f[r]||"")))&&n("@"+U+e)&&o.push(r);var p=rn(t,"","\\b",function(n){return a[n]||n}),d=rn(o,"@","\\b","@"+U+"$1");return O.removeChild(c),function(n){return d(p(n))}}(),ln={},pn=function(n,r){for(var e=0;e<n[j];e++)Z(n[e])?pn(n[e],r):r.push(n[e])},dn=function(n){if(an(n))return"";var r,e,t,o,i,u,f,a,c,s,l,p,d,g,h=arguments,v="",m={};if(1<h[j]){for(v=[],e=0;e<h[j];++e)v.push(h[e]);return dn(v)}if(!Z(n))return""+n;var x=n[j],b=n[0]+"";if(!x)return"";if(x&&(Z(n[0])||null===n[0]||!b[k](H))){for(r="",e=0;e<x;e++)G(n[e+1])?(r+=(l=fn(n,e)).r,e=l.i):r+=dn(n[e]);return r}for(e=1;e<x;e++)if(null!==n[e])if(t=n[e],Z(t))G(n[e+1])?(v+=(l=fn(n,e)).r,e=l.i):v+=dn(t);else if(q(t))for(o in t){if(f=t[o],"style"==(u=w(o)[$]())&&!q(f)){for(f+="",a={};c=z.exec(f);)a[c[1]]=c[2];f=a}if(t[S](o)&&null!==f)if(q(f))for(i in m[S](o)&&q(m[o])||(m[o]={}),f)f[S](i)&&(m[o][i]=f[i]);else"class"==u&&m[S](o)?m[o]+=" "+f:m[o]=f}else an(t)||(v+=t);for(r="<"+b,m=function(n){var r,e,t,o={};for(r in n)t=n[r],1<(e=y(r))[j]&&(o[e.join("-")[$]()]=o[e.join("_")[$]()]=t),o[r]=t;return o}(m),p=(f=Object.keys)(m).sort(),e=0;e<p[j];++e){if(o=p[e],u="",g=1,q(m[o]))for(d=f(a=en(m[o])).sort(),s=0;s<d[j];++s)u+=(i=d[s])+":"+a[i]+";";else if(Z(m[o])){for(s=0;g&&s<m[o][j];++s)m[o][s]&&(r+=" "+o,g=0);g=0}else u+=m[o];g&&(r+=" "+o+'="'+dn.escape(u)+'"')}return A[w(b)[$]()]&&!v?r+=">":r+=">"+v+"</"+b+">",r};function gn(n){return hn[n]}dn.bool=function(n,r){var e={};return r&&(e[n]=n),e},dn.hash=function(){var n,r,e,t=arguments,o=0;for(e=0;e<t[j];++e)for(n=dn(t[e]),r=0;r<n[j];++r)o=(o<<5)-o+n.charCodeAt(r)|0;return o};var hn={"&":"&","<":"<",">":">",'"':""","'":"'"},vn=/[&<>"']/g;dn.escape=function(n){return n[v](vn,gn)},dn.SVG=function(n,r){var e,t=arguments,o=["svg",{width:n+"px",height:r+"px",viewBox:"0 0 "+n+" "+r,xmlns:"http://www.w3.org/2000/svg"}];for(e=2;e<t[j];e++)o.push(t[e]);return o};var mn="mlhvcsqtaz";function xn(){function n(e){return function(){o.d+=e;for(var n=arguments,r=0;r<n[j];++r)o.d+=n[r]+", "[1&r];return i}}var r,e,t,o={d:""},i=["path",o],u=arguments;for(r=0;r<u[j];r++){if(q(e=u[r]))for(t in e={},u[r])"d"==t?o.d+=u[r][t]+" ":e[t]=u[r][t];i.push(e)}for(t in mn)i[t]=n(t);return i}function bn(n){return function(){return xn()[n].apply(null,arguments)}}for(var yn in mn=p((mn+mn[s]())[u]("").join(",")))xn[yn]=bn(yn);function wn(n){for(var r=1;r;)r=n!=(n=n[v](L,"$1$2"));return n}function jn(n,r){for(var e,t,o,i="",u=wn(n);o=M.exec(u);)i+=o[1],t=o[3],o[2]&&(e=An[i])&&(t=e),r||(An[i]=t),i+=t;for(e=i;e;e=e[v](T,"$1"))kn[e]&&(i=e,e="");return!r&&G(t=kn[i])&&t(),i}function $n(){return c.location.hash}function Sn(){if(!zn){zn=1;for(var r,e,n,t,o,i=wn($n()),u="",f="addEventListener",a=function(n){for(r=Cn&&n.target;r;r=r.parentElement)if("A"==r.tagName[s]()&&(e=r.getAttribute("href"))&&(e=(""+e)[k]("#(.*)"))&&(e=jn(e[1],1))==jn($n(),1)&&(e=kn[e]))return void e()};n=M.exec(i);)u+=n[1]+(An[u]=n[3]);"onhashchange"in c?c[f]("hashchange",function(){jn($n())}):(t=$n(),setInterval(function(){(o=$n())!=t&&jn(t=o)},100)),g[f]?g[f]("click",a,!1):g.attachEvent("onclick",a)}}dn.SVG.Path=xn;var kn={},An={},zn=0,Cn=0;if(!t){dn.autoFixCSS=en,dn.load=function(){var n=[];return pn(arguments,n),function(n){var r,e,t,o,i,u,f=[],a=[],c={done:function(n){return a.d=G(n)?n:d,c}},s=p("png,bmp,gif,jpg,jpeg,svg,webp");for(a.c=function(){if(a[j]==a.n&&a.n){var n,r,e,t,o,i;for(a.n=0,a.sort(function(n,r){return n[0]-r[0]}),n=0;n<a[j];++n)o=(r=a[n])[1][1],i=r[1][2],!o&&(e=i[k](E))&&(o=e[1][$]()),"css"==o&&((t=g[h]("style")).type="text/css",t.innerText=en(tn(i,r[2])[v](/[\r\n]/g,"")),O[m](t)),"js"==o&&((t=g[h]("script")).text="//# sourceURL="+i+"\n"+r[2],O[m](t).parentNode.removeChild(t));a.d()}},a.d=d,r=0;r<n[j];++r)(i=F.exec(n[r]))[0]=(l(i[1])?"":i[1])+":"+i[2],f.push(i);for(a.n=f[j],r=0;r<a.n;++r)"img"==(""+(e=f[r])[1])[$]()||(i=(""+e[2])[k](E))&&s[i[1][$]()]?((u=new Image).onload=u.onerror=un(u,r,e,a),u.src=e[2]):((o=new XMLHttpRequest).onreadystatechange=on(o,r,e,a),t=-1<e[2].indexOf("?")?"&":"?",o.open("GET",e[2]+t+Math.random(),1),(t=ln[e[0]])&&o.setRequestHeader("If-Modified-Since",t[0]),o.responseType="text",o.send());return a.n||setTimeout(a.d,10),c}(n)};var En=function(n,r){return Sn(),l(n)?wn($n()):r?(kn[wn(n)]=r,dn):kn[jn(wn(n),1)]};En.path=function(n){return l(n)?wn($n()):jn(n,1)},En.go=function(n){return Sn(),n=jn(l(n)?$n():n),!!kn[n]&&n},En.refreshable=function(n){return Sn(),l(n)?!!Cn:(Cn=n,dn)},dn.route=En}if(!n){l(c.HTML)&&(c.HTML=dn);var Fn=dn;Fn.svg=Fn.SVG,Fn.svg.path=Fn.svg.Path,c.aris=Fn}return dn}); |
{ | ||
"name": "aris", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Write HTML in JS easily.", | ||
@@ -5,0 +5,0 @@ "main": "aris.js", |
322
README.md
# Aris - Write HTML in JS easily. | ||
Aris is a simple library \(\< 5kb minified + gzipped\) that: | ||
Aris is a simple library \(\< 5kb minified + gzipped\) that allows you to write HTML in JS easily. | ||
- Allows you to write HTML in JS in a clean, powerful and extensible manner | ||
\(contrary to what many people believe is impossible\). | ||
- Lazily load JS and CSS files \(it also auto-prefixes your CSS\). | ||
- Does routing with page anchor tags (hash routing, e.g. `href="#path/to/page"`) | ||
If you know JS and HTML, you already know Aris. | ||
**Just these 3 functions alone** will allow you to easily build frontend web-apps | ||
(e.g. Single page applications, Progressive web apps) that are [performant and scalable](#Advantages). | ||
## Usage | ||
## Download | ||
**Browser / CDN:** | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/aris/aris.min.js"></script> | ||
``` | ||
Just copy and paste the `aris.min.js` from this repository. | ||
If you want to read the entire file (it's less than 1k lines), you can look at `aris.js`. | ||
**NPM:** | ||
```bash | ||
npm i aris | ||
``` | ||
## The Problem | ||
Or you can clone/download this github. | ||
Writing HTML in JS is a traditionally *messy* experience. | ||
## Converter | ||
You'll have to carefully fiddle with quotes, double quotes, string concatenation, escaping characters, etc. | ||
This breaks syntax highlighting, causes mistakes, and a LOT of stress. | ||
[Convert HTML to Aris.](https://bkys.io/aris/converter.html) | ||
It is little wonder why most people resort to backend templating solutions, or use frontend templating frameworks/libraries/transpilers. | ||
## Overview | ||
Unfortunately, these solutions are not good enough (even JSX is not good enough by our standards, seriously). | ||
Their are usually either too complex, clunky, slow, obscure, incomplete, bloated, or inflexible. | ||
## The Solution | ||
Imagine you want to write the following shit: | ||
```ruby | ||
$('.page').html(['<div class="dropdown">', | ||
'<button class="btn dropdown-toggle"', | ||
'type="button"', | ||
'id="dropdownMenuButton"', | ||
'data-toggle="dropdown"', | ||
'aria-haspopup="true"', | ||
'aria-expanded="false">', | ||
dropdown.text, | ||
'</button>', | ||
'<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">', | ||
$.map(dropdown.values, function (x) { | ||
return ['<a class="dropdown-item">', x ,'</a>'].join('') | ||
}).join(''), | ||
'</div>', | ||
'</div>'].join('')); | ||
```javascript | ||
var dropdownHTML = ''; | ||
for (var i = 0; i < dropdownValues.length; ++i) { | ||
dropdownHTML += '<a class="dropdown-item">' + dropdownValues[i] + '</a>'; | ||
} | ||
el.innerHTML = '<div class="dropdown">' + | ||
'<button class="btn dropdown-toggle" ' + | ||
'type="button" ' + | ||
'id="dropdownMenuButton" ' + | ||
'data-toggle="dropdown" ' + | ||
'aria-haspopup="true" ' + | ||
'aria-expanded="false" ' + | ||
(dropdownDisabled ? 'disabled' : '') + | ||
'>' + | ||
dropdown.text + | ||
'</button>' + | ||
'<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">' + | ||
dropdownHTML + | ||
'</div>' + | ||
'</div>'; | ||
``` | ||
@@ -54,4 +53,4 @@ | ||
```ruby | ||
$('.page').html(HTML(['div', {class: 'dropdown'}, | ||
```javascript | ||
el.innerHTML = HTML(['div', {class: 'dropdown'}, | ||
['button', dropdown.text, { | ||
@@ -63,19 +62,15 @@ class: 'btn dropdown-toggle', | ||
ariaHaspopup: true, | ||
ariaExpanded: false | ||
ariaExpanded: false, | ||
disabled: [dropdownDisabled] | ||
}], | ||
['div', {class: 'dropdown-menu', ariaLabelledby: 'dropdownMenuButton'}, | ||
$.map(dropdown.values, function (x) { | ||
dropdownValues, function (x) { | ||
return ['a', {class: 'dropdown-item'}, x] | ||
}) | ||
} | ||
] | ||
])); | ||
]); | ||
``` | ||
Wow! Such syntax. Much highlighting. | ||
Wow! Such syntax. Much clean. | ||
Notice how the HTML is being expressed in an intermediate form with native JS objects and arrays. | ||
\(We call this intermediate form a HTML *context*\). | ||
This simple change makes **all** the difference, and opens up [a whole new world of possibilities](#Advantages). | ||
## Functions | ||
@@ -90,3 +85,3 @@ | ||
```ruby | ||
```javascript | ||
HTML(["div", {id: "y", class: "a b", style: {color: "red"}, ariaLabel: "x"}, | ||
@@ -96,3 +91,4 @@ "Text", | ||
{style: {width: 1, opacity: 0.5}, class: "c", pos: 1}, | ||
[["div", 0], ["div", 1]] | ||
['A', 'B', 'C'], function (x) { return ["div", x] }, | ||
[ [0, 1, 2], function (x) { return ["span", x] } ] | ||
]) | ||
@@ -108,8 +104,11 @@ ``` | ||
<a href="example.com" target="_blank">link</a> | ||
<div>0</div><div>1</div> | ||
<div>A</div><div>B</div><div>C</div> | ||
<span>0</span><span>1</span><span>2</span> | ||
</div> | ||
``` | ||
Explanation (skip if you can figure out from the example): | ||
- If the starting element is a string, it is treated as a tag name. | ||
`['div', 'Text']` => `<div>Text</div>` | ||
`['div', 'Text']` → `<div>Text</div>` | ||
@@ -126,7 +125,7 @@ - Attributes are added via objects. | ||
This is so that you can avoid using quotes on the keys. | ||
`{ariaLabel: "x"}` => `aria-label="x"` | ||
`{ariaLabel: "x"}` → `aria-label="x"` | ||
- If the starting element is an array, the contents of the entire | ||
array will be converted to HTML and joined. | ||
`[['div', 0], ['div', 1]]` => `<div>0</div><div>1</div>` | ||
`[['div', 0], ['div', 1]]` → `<div>0</div><div>1</div>` | ||
@@ -138,11 +137,16 @@ - Inline CSS can be defined via objects or strings. | ||
For numerical properties, `px` will be automatically added if where applicable. (similar to jQuery). | ||
`['div', {style: {opacity: 0, width: 2}}, 'x', {style: "opacity: 1; filter: grayscale(100%)"}]` => | ||
`['div', {style: {opacity: 0, width: 2}}, 'x', {style: "opacity: 1; filter: grayscale(100%)"}]` → | ||
`<div style="opacity: 1; width: 2px; -webkit-filter: grayscale(100%); filter: grayscale(100%)">x</div>` | ||
- Classes are joined with spaces if repeated in an object. | ||
`['div', {class: 'a'}, 'x', {class: 'b'}]` => `<div class="a b">x</div>` | ||
`['div', {class: 'a'}, 'x', {class: 'b'}]` → `<div class="a b">x</div>` | ||
- Other attributes are replaced if repeated in an object. | ||
`['div', {id: 'a'}, 'x', {id: 'b'}]` => `<div id="b">x</div>` | ||
`['div', {id: 'a'}, 'x', {id: 'b'}]` → `<div id="b">x</div>` | ||
- If an element is an array, and the next element is a function, | ||
the array will be automatically mapped to the function. | ||
`['div', [1,2,3], function (x) { return x*2 }]` → `<div>246</div>` | ||
`['div', [[1,2,3], function (x) { return x*2 }] ]` → `<div>246</div>` | ||
## Other Functions | ||
@@ -158,43 +162,25 @@ | ||
### Lazy Loading | ||
### HTML Boolean Attributes | ||
- `HTML.load(file0, file1, ...).done(fn)` | ||
Loads (.js, .css) files, then execute the done function `fn` (optionally). | ||
The files are downloaded asynchronously in parallel, but attached to the webpage in the specified order. | ||
Each file will be only loaded **once**. | ||
The done function is **always executed once per load call**, | ||
*irregardless* of whether the files have been loaded previously. | ||
- `['button', {disabled: [true]}]` → `<button disabled></button>` | ||
`['button', {disabled: [false]}]` → `<button></button>` | ||
For a boolean attribute, wrap it in an array. | ||
A truthy value denotes its presence. | ||
The files are treated accordingly with their file extension. | ||
To force a file to be treated as a JS or CSS file, prefix the url with (`js:` or `css:`): | ||
`js: js/main` (whitespace around the `:` is ignored) | ||
### HTML Output Key Order and Hash | ||
CSS files will be **auto-magically** prefixed. | ||
- `HTML(['a', {href: 'x.com', id: 'link'}, 'x'])` → `<a href="x.com" id="link">x</a>` | ||
`HTML(['a', 'x', {id: 'link', href: 'x.com'}])` → `<a href="x.com" id="link">x</a>` | ||
The HTML output is deterministic, with attribute keys sorted in ascending order. | ||
Lazily loaded JS can be [debugged easily](https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Debug_eval_sources) in modern browsers, | ||
as we auto-prepend the sourceURL directive to the JS files. | ||
- `HTML.hash(['a', {href: 'x.com', id: 'link'}, 'x'])` → `841135124` | ||
`HTML.hash(['a', 'x', {id: 'link', href: 'x.com'}])` → `841135124` | ||
`HTML.hash(HTML(['a', 'x', {id: 'link', href: 'x.com'}]))` → `841135124` | ||
`HTML.hash('some string')` → `-984100687` | ||
HTML contexts and strings can be hashed to 32-bit integers for compact storage and quick comparison. | ||
### Hash Routing | ||
### SVG | ||
- `HTML.route("#path/to/page/anchor", fn)` | ||
Attaches the function `fn` to `#path/to/page/anchor`. | ||
For the artsy coders. | ||
- `HTML.route.go(#path/to/page/anchor")` | ||
Executes the function attached to `#path/to/page/anchor`. | ||
- `HTML.route.go(#path/to/page/:anchor")` | ||
Attemps to execute the function attached to the path. | ||
The prefix `:` on the path component denotes that it is is default option. | ||
If the visitor has visited `#path/to/page/one`, or if the address bar points to `#path/to/page/one`, it will execute the function attached to `#path/to/page/one`. | ||
Otherwise, it will execute the function attached to `#path/to/page/anchor`. | ||
- `HTML.route.go("#:path/:to/:page")` | ||
You can prefix any path component with ":" to mark it as the default option. | ||
- `HTML.route.go()` | ||
Attempts to execute the function attached to the path in the address bar. | ||
(i.e. `window.location.hash`) | ||
### SVG (for the artsy coders) | ||
- `HTML.SVG(width, height, ...context)` | ||
@@ -210,3 +196,3 @@ Creates a SVG string, with common boilerplate attributes automatically-filled. | ||
```ruby | ||
```javascript | ||
var SVG = HTML.SVG, P = HTML.SVG.Path; | ||
@@ -218,4 +204,3 @@ HTML(SVG(30, 30, | ||
P().M(0,0).L(1,1), | ||
P.M(0,0).L(1,1), | ||
['text', {x: 0, y: 0}, 'Path can be also be called without args!'] | ||
P.M(0,0).L(1,1), // Path can be also be called without args! | ||
)) | ||
@@ -226,11 +211,10 @@ ``` | ||
```ruby | ||
```javascript | ||
HTML(['svg', {xmlns: 'http://www.w3.org/2000/svg', | ||
width: '30px', height: '30px', viewBox: '0 0 30 30'}, | ||
['circle', {class: 'frame', cx: 15, cy: 15, r: 12}], | ||
['path' {class: 'hand hour', d: 'M15,15 L20,15'}], | ||
['path' {class: 'hand minute', d: 'M15,15 L15,2'}], | ||
['path' {d: 'M0,0 L1,1'}], | ||
['path' {d: 'M0,0 L1,1'}], | ||
['text', {x: 0, y: 0}, 'Path can be also be called without args!'] | ||
['path', {class: 'hand hour', d: 'M15,15 L20,15'}], | ||
['path', {class: 'hand minute', d: 'M15,15 L15,2'}], | ||
['path', {d: 'M0,0 L1,1'}], | ||
['path', {d: 'M0,0 L1,1'}], | ||
]) | ||
@@ -249,3 +233,2 @@ ``` | ||
<path d="M0,0 L1,1"></path> | ||
<text x="0" y="0">Path can be also be called without args!</text> | ||
</svg> | ||
@@ -256,87 +239,81 @@ ``` | ||
## Advantages | ||
### Lazy Loading | ||
- You can make functions to return HTML contexts, enabling you to reuse common HTML. | ||
*"Write less, do more!" - jQuery* | ||
- You can use loops to create contexts (a context is essentially an array). | ||
- You can add attributes or children to contexts to specialize contexts for different use cases. | ||
- Because our contexts are simply good ol' JS arrays and objects, | ||
you can use your favourite utility libraries (e.g. Lodash, Rambda) to create contexts! | ||
(other libraries which use prototyped objects or templates do not offer this flexibility) | ||
- Syntax errors are detected by the JS parser when the code is executed. | ||
You can check the browser console for the exact line of the error if your page has display errors. | ||
- No more incorrect HTML closing tags! | ||
- Inline and loaded CSS styles are *auto-magically* prefixed. | ||
- You can easily create complex DOM updates in a single call, resulting in buttery smooth performance. | ||
- Code is automatically syntax highlighted in most text editors without special plugins. | ||
- Code is autocompleted in most text editors (e.g. SublimeText will auto-close braces for you). | ||
- No need for transpilers and complicated build tools. A browser and text editor is all you need. | ||
Get up to speed quick! | ||
- Makes debugging much easier (it's just plain ol' JS). | ||
- Greatly reduce developer onboarding times (again, it's just plain ol' vanilla JS). | ||
- Zero dependencies. | ||
- Thoroughly battle-tested for over a decade. | ||
- Compatible with IE 9+, and practically every other major browser. | ||
- Compatible with other JS frameworks/libraries out of the box. | ||
- You can do **ALL** your HTML generation on the frontend now, resulting in **MUCH** lower server load. | ||
- Naturally, you'll also have better seperation between data and UX logic. | ||
- For teams, frontend and backend coders can work in parallel better. | ||
- A happier life. | ||
This is just a bonus feature to make making single-page-apps easier. | ||
We challenge you to find an alternative that gives you all of the above. | ||
- `HTML.load(file0, file1, ...).done(fn)` | ||
Loads (.js, .css) files, then execute the done function `fn` (optionally). | ||
The files are downloaded asynchronously in parallel, but attached to the webpage in the specified order. | ||
Each file will be only loaded **once**. | ||
The done function is **always executed once per load call**, | ||
*irregardless* of whether the files have been loaded previously. | ||
## Performance | ||
The files are treated accordingly with their file extension. | ||
To force a file to be treated as a JS or CSS file, prefix the url with (`js:` or `css:`): | ||
`js: js/main` (whitespace around the `:` is ignored) | ||
Don't worry about it! | ||
CSS files will be **auto-magically** prefixed. | ||
We have heavily optimized and profiled Aris. | ||
It performs with *so* little overhead, it's *as if* you have written that HTML and CSS in plain text. | ||
Even tens of megabytes can be processed in a tiny fraction of a second on slow machines. | ||
You'll hardly notice a thing. | ||
Lazily loaded JS can be [debugged easily](https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Debug_eval_sources) in modern browsers, | ||
as we auto-prepend the sourceURL directive to the JS files. | ||
You should *probably be worried* about performance, if you are *not* using Aris. ;) | ||
### Hash Routing | ||
## Support | ||
This is just a bonus feature to make making single-page-apps easier. | ||
Aris is actively maintained and constantly tested against all major browsers. | ||
If you have any suggestions, questions, or bug reports, we will be very glad to help. | ||
- `HTML.route("path/to/page/anchor", fn)` | ||
Attaches the function `fn` to `#path/to/page/anchor`. | ||
## FAQ | ||
- `HTML.route.go("path/to/page/anchor")` | ||
Executes the function attached to `#path/to/page/anchor`. | ||
- **How does Aris help me create high-performance user interfaces?** | ||
- `HTML.route.go("path/to/page/:anchor")` | ||
Attemps to execute the function attached to the path. | ||
The prefix `:` on the path component denotes that it is is default option. | ||
If the visitor has visited `#path/to/page/one`, or if the address bar points to `#path/to/page/one`, it will execute the function attached to `#path/to/page/one`. | ||
Otherwise, it will execute the function attached to `#path/to/page/anchor`. | ||
Aris does not do DOM diffing like React. | ||
Its approach to blazing-fast speed is very dead simple: | ||
by enabling you to create complex HTML easily, with minimal processing overhead. | ||
Instead of changing the contents of many DOM elements, one after another, | ||
you can simply update them with the combined HTML in one go. | ||
This minimizes reflows, and if done properly, can be as fast, if not faster than DOM diffing. | ||
- `HTML.route.go(":path/:to/:page")` | ||
You can prefix any path component with ":" to mark it as the default option. | ||
You must however, know which DOM elements you need to update. | ||
This should be easy if you are used to VanillaJS or jQuery. | ||
- `HTML.route.go()` | ||
Attempts to execute the function attached to the path in the address bar. | ||
(i.e. `window.location.hash`) | ||
Our choice of using plain arrays and objects allows us to leverage the parser of the JS engine, | ||
which is already in the form of highly-optimized, compiled, native machine code. | ||
## Why use Aris? | ||
This is way faster than using templates based on regex or loop based parsing implemented in JS. | ||
Aris saves you time, effort, and brain space. | ||
- **Why another JS library/framework? How does this compare to \<insert name here\>?** | ||
If you think something else is better, feel free to use them and do your own comparisons. | ||
The existing solutions in the JS community are simply **not** good enough. | ||
Many of them require you to call functions everywhere and remember to provide the correct arguments in order. | ||
Some of them pollute the namespace of short variable names unnecessarily. | ||
You also cannot pass around intermediate HTML contexts and specialize them. | ||
## Advantages | ||
There are many similar libraries out there. | ||
But they all have some areas that could be done better. | ||
They are just not as concise, flexible, performant, lightweight and complete as Aris. | ||
- Just plain old JS. | ||
- Zero dependencies. | ||
- Zero tooling. | ||
- Learn once, use forever. | ||
- Automagic CSS prefixing. | ||
- Fast. | ||
We adopt a no-compromise approach for Aris. Every part is meticulously and purposefully crafted. | ||
We aim for a minimal code size, but not at the cost of completeness and ease of use. | ||
Most tiny frameworks out there do not provide CSS prefixing, but Aris does. | ||
Because Aris cares for your convenience! | ||
(Aris is actually only < 0.2kb minified + gzipped if you only include the core HTML writing function). | ||
## Performance | ||
Very fast. If anything lags, it is probably something else. | ||
## Support | ||
Aris is actively maintained and constantly tested against all major browsers (even IE). | ||
If you have any suggestions, questions, or bug reports, raise an issue. | ||
## FAQ | ||
- **How does Aris help me create high-performance user interfaces?** | ||
Aris is just plain old Javascript, all HTML generation is close to the metal. | ||
Use Aris to generate complex HTML and update the only the elements you need. | ||
This minimizes reflows and you will have a snappy user interface. | ||
- **Why the name Aris?** | ||
- **What does Aris stands for?** | ||
@@ -352,13 +329,8 @@ Aris stands for "A Revolution In Syntax". | ||
If there is a namespace collision, you can use `aris` instead of `HTML`. | ||
`HTML` => `aris` | ||
`HTML.SVG` => `aris.svg` | ||
`HTML.SVG.Path` => `aris.svg.path` | ||
`HTML` → `aris` | ||
`HTML.SVG` → `aris.svg` | ||
`HTML.SVG.Path` → `aris.svg.path` | ||
## Coming Soon | ||
- A simple 3 page web example. | ||
- `HTML.load` for preloading images. | ||
## License | ||
MIT |
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
62248
5
897
322