Commit 8256f69c by Иван Кубота

react-vanilla first public commit

parents
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.vscode
/.idea
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json
sendgrid.env
/public/p
/public/.well-known
/public/.well-known/*
var NS = window['NS'] = function(cfg) {
if(cfg.consts){
this.consts = NS.apply(NS.apply({}, this.consts), cfg.consts);
delete cfg.consts;
}
NS.apply(this, cfg);
this._update = this._update.bind(this);
this.resize = this.resize.bind(this);
this.init();
};
NS.apply = function(a,b) {
for(var k in b){
a[k] = b[k];
}
return a;
};
(function(NS, glob, document){
var ArraySlice = [].slice;
var svgNS = 'http://www.w3.org/2000/svg';
var setters = {
cls: function(el) {
return function(cls) {
var tagName = el.tagName.toLowerCase();
if( tagName in customElementClassNameSetter ){
customElementClassNameSetter[tagName](el, cls);
}else{
el.className = D.cls.apply(D, arguments);
}
}
},
attr: function(el, attrName) {
return function(val) {
if(val !== void 0 && val !== false){
el.setAttribute( attrName, val );
}else{
el.removeAttribute(attrName)
}
}
},
style: function(s, styleProp) {
return function(val) {
if(val !== void 0 && val !== false){
s[styleProp] = val;
}else{
delete s[styleProp];
}
}
}
};
var used = {
cls: true, className: true, 'class': true, classname: true,
attr: true, style: true, renderTo: true,
prop: true, bind: true,
on: true, renderto: true, el: true
};
// ~jsx h function
var domEl = function( type, cfg ){
var typeOfType = typeof type;
if(typeOfType === 'function'){
// factory passed
return type(cfg, ArraySlice.call(arguments, 2));
}else if(type !== null && typeof type === 'object' && type.hook){
// hooked future element creation
return type.hook(cfg, ArraySlice.call(arguments, 2));
}
cfg = cfg || {};
var cls = cfg.cls || cfg['class'] || cfg.className,
style = cfg.style,
attr = cfg.attr || {},
prop = cfg.prop,
on = cfg.on || {},
renderTo = cfg.renderTo,
el = cfg.el || (type in customElementCreate ? customElementCreate[type](type, cfg) : document.createElement( type )),
classList = el.classList;
var i, _i, name;
for(i in cfg)
if( cfg.hasOwnProperty(i)){
name = i.toLowerCase();
if(name in used)
continue;
if(name.substr(0, 2) === 'on'){
// it is an event
on[ name.substr( 2 ) ] = cfg[ i ];
}else{
// attribute
attr[i] = cfg[i];
}
}
if( cls ){
if(typeof cls === 'function'){
cls(setters.cls(el));
}else if(typeof cls === 'object' && cls.hook){
cls.hook(setters.cls(el));
}else if(typeof cls === 'object'){
var resolvedCls = Array.isArray(cls)?D.cls.apply(D, cls):D.cls(cls);
if(typeof resolvedCls === 'function'){
resolvedCls(setters.cls(el));
}else{
setters.cls(el)(resolvedCls);
}
}else{
setters.cls(el)(cls);
}
}
if( style ){
if(typeof style === 'string'){
el.style = style;
}else{
for( i in style ){
var s = el.style;
if(style.hasOwnProperty( i )){
if( typeof style[ i ] === 'function' ){
style[ i ]( setters.style( s, i ) );
}else if(typeof style[ i ] === 'object'&& style[ i ] !== null && style[ i ].hook){
return style[ i ].hook(setters.style(s, i));
}else{
setters.style( s, i )( style[ i ] );
}
}
}
//NS.apply( el.style, style );
}
}
for( i in attr ){
if(attr.hasOwnProperty( i )){
if( typeof attr[ i ] === 'function' ){
attr[ i ]( setters.attr( el, i ) );
}else if(typeof attr[ i ] === 'object'&& attr[ i ] !== null && attr[ i ].hook){
return attr[ i ].hook(setters.attr(el, i));
}else{
setters.attr( el, i )( attr[ i ] );
}
}
}
for( i in prop ){
prop.hasOwnProperty( i ) && ( el[ i ] = prop[ i ] );
}
for( i in on ){
on.hasOwnProperty( i ) && el.addEventListener( i, on[ i ] );
}
for( i = 2, _i = arguments.length; i < _i; i++ ){
var child = arguments[ i ];
D.appendChild( el, child );
}
if( renderTo ){
D.appendChild( renderTo, el );
}
return el;
};
var D = NS.D = {
svg: null,
label: null,
div: null,
span: null,
path: null,
canvas: null,
input: null,
textarea: null,
tBody: null,
tHead: null,
th: null,
td: null,
tr: null,
Text: function( val ){ return document.createTextNode( val );}
};
'div,template,span,input,label,canvas,span,textarea,table,tr,td,th,tBody,tHead'.split( ',' ).forEach( function( name ){
D[ name ] = function(){
return domEl.apply( null, [ name ].concat(ArraySlice.call(arguments)))
};
} );
var customElementCreate = {};
var customElementClassNameSetter = {};
var createElementSVG = function(name) {
var el = document.createElementNS( svgNS, name );
el.setAttribute( 'xmlns', svgNS );
return el;
},
setClassNameSVG = function(el, cls) {
el.setAttribute( 'class', cls );
};
'svg,path,circle,g,defs,marker,ellipse'.split( ',' ).forEach( function( name ){
customElementCreate[name] = createElementSVG;
customElementClassNameSetter[name] = setClassNameSVG;
D[ name ] = function(cfg){
if( !cfg ){
cfg = {};
}
cfg.el = createElementSVG( name );
return domEl.apply( null, [ null ].concat(ArraySlice.call(arguments)))
};
} );
D.html = function(cfg){
var el = domEl('div', cfg);
el.innerHTML = ArraySlice.call(arguments,1).join('\n');
return el;
};
D.h = domEl;
D.ext = function(el, cfg) {
cfg.el = el;
if(el.className && cfg.cls){
if( typeof cfg.cls === 'string' ){
cfg.cls += ' '+el.className;
}else if(Array.isArray(cfg.cls)){
cfg.cls.push(el.className);
}else{
debugger
}
}
return D.div(cfg);
}
D.f = function(cfg, children) {
return children;
};
D.isInDOM = function(el) {
return document.body.contains(el);
};
D._recursiveCmpCall = function(el, sub, fnName){
if(sub.__cmp)
sub.__cmp[fnName] && sub.__cmp[fnName](el);
for( var i = 0, _i = sub.childNodes.length; i < _i; i++ ){
var childNode = sub.childNodes[ i ];
D._recursiveCmpCall(sub, childNode, fnName);
}
};
D.replaceChildren = function(el) {
D.removeChildren(el);
D.appendChild.apply(D, arguments);
};
D.removeChildren = function(el){
var subEl;
var isInDOM = D.isInDOM(el);
while((subEl = el.lastChild)){
isInDOM && D._recursiveCmpCall(el, subEl, 'beforeRemoveFromDOM');
el.removeChild(subEl);
isInDOM && D._recursiveCmpCall(el, subEl, 'afterRemoveFromDOM');
}
};
var DFragment = DocumentFragment;
D.insertBefore = function(newChild, refChild) {
var f = document.createDocumentFragment();
D.appendChild(f, newChild);
var el = refChild.parentNode,
subEl = newChild;
var isInDOM = D.isInDOM(el);
isInDOM && D._recursiveCmpCall(el, f, 'beforeAddToDOM');
el.insertBefore( f, refChild );
isInDOM && D._recursiveCmpCall(el, {childNodes: newChild}, 'afterAddToDOM');
};
D.insertAfter = function(newChild, refChild) {
var f = document.createDocumentFragment();
D.appendChild(f, newChild);
var el = refChild.parentNode,
subEl = newChild;
var isInDOM = D.isInDOM(el);
isInDOM && D._recursiveCmpCall(el, f, 'beforeAddToDOM');
var next = refChild.nextSibling;
if(next){
el.insertBefore( f, next );
}else{
el.appendChild( f );
}
isInDOM && D._recursiveCmpCall(el, {childNodes: newChild}, 'afterAddToDOM');
};
D.appendChild = function(el, subEl){
var type = typeof subEl;
if(subEl === null){
return ;
}
var notObject = type !== 'object';
var isHook = !notObject && ('hook' in subEl);
if(isHook){
type = 'function'; notObject = true;
}
if( notObject ){
// TODO : add hook
if( type === 'function' ){
var tmp = D.Text('');//( {cls: 'zero-wrapper'} );
el.appendChild( tmp );
var list = [];
el.setAttribute('data-hooked', 'yep');
// maybe do it through outer weak map?
el.__un = el.__un || [];
var hookFn;
if(isHook){
hookFn = function(val){
// TODO: append 2 TextNodes and remove children between them
if(list.length === 1){
list[0].textContent = val;
}else{
if(el instanceof DFragment){
el = tmp.parentNode;
}
if(!el)
return;
for( var i = 0, _i = list.length; i < _i; i++ ){
list[ i ].parentNode === el && el.removeChild( list[ i ] );
}
var fragment = document.createDocumentFragment();
D.appendChild( fragment, ArraySlice.call( arguments ) );
list = ArraySlice.call( fragment.childNodes );
if( !tmp || !tmp.parentNode )
return;
el.insertBefore( fragment, tmp );
}
};
el.__un.push(subEl.hook( hookFn ));
}else{
hookFn = function(){
// TODO: append 2 TextNodes and remove children between them
if(el instanceof DFragment){
el = tmp.parentNode;
}
if(!el)
return;
for( var i = 0, _i = list.length; i < _i; i++ ){
list[ i ].parentNode === el && el.removeChild( list[ i ] );
}
var fragment = document.createDocumentFragment();
D.appendChild( fragment, ArraySlice.call( arguments ) );
list = ArraySlice.call(fragment.childNodes);
if(!tmp || !tmp.parentNode)
return;
el.insertBefore(fragment, tmp);
};
el.__un.push(subEl( hookFn ));
}
}else if( subEl !== void 0 && subEl !== false && subEl !== null ){
el.appendChild( D.Text( subEl ) );
}
}else if('dom' in subEl){
var isInDOM = D.isInDOM(el);
subEl.dom.__cmp = subEl;
isInDOM && D._recursiveCmpCall(el, subEl.dom, 'beforeAddToDOM');
D.appendChild(el, subEl.dom);
//el.appendChild( subEl.dom );
isInDOM && D._recursiveCmpCall(el, subEl.dom, 'afterAddToDOM');
//subEl
}else if( Array.isArray(subEl) ){
subEl.forEach(function(subEl){ D.appendChild( el, subEl ); });
}else{
var isInDOM = D.isInDOM(el);
isInDOM && D._recursiveCmpCall(el, subEl, 'beforeAddToDOM');
el.appendChild( subEl );
isInDOM && D._recursiveCmpCall(el, subEl, 'afterAddToDOM');
}
};
D.join = function(arr, delimiter){
var out = [], isFn = typeof delimiter === 'function';
for( var i = 0, _i = arr.length - 1; i < _i; i++ ){
out.push(arr[i], isFn?delimiter(i):delimiter);
}
if(i < _i+1)
out.push(arr[i]);
return out;
};
var dpID = 1;
var DataPiece = function(id){this.id = id;};
DataPiece.prototype = {value: void 0, update: function(){}};
var DataPieceFactory = function(refs, fn, scope) {
var id = dpID++;
var dp = new DataPiece(id);
refs.push(dp);
fn.call(scope, function(val) {
dp.value = val;
dp.update();
});
return dp;
};
var RefHash = function(){};RefHash.prototype = {any: false};
D.__cls = function(args, refs) {
return function(update) {
var i, _i, lastCls,
constructCls = function() {
var cls = D._cls(args, [], 0);
if(lastCls !== cls)
update(lastCls = cls);
};
for( i = 0, _i = refs.length; i < _i; i++ )
refs[ i ].update = constructCls;
constructCls();
};
};
D._cls = function(args, refs, depth) {
var out = [], i = 0, _i = args.length, token, tmp, key;
for(;i<_i;i++){
token = args[i];
if(typeof token === 'string' && token){
out.push( token );
}else if(typeof token === 'object'){
if(token instanceof DataPiece){
token.value && out.push( token.value );
}else if ( token.hook ){
args[i] = DataPieceFactory(refs, token.hook, token);
}else if(Array.isArray(token)){
tmp = D._cls(token, refs, depth+1);
// TODO check for push tmp
tmp && out.push( token );
}else{
for(key in token){
if(token[key] === null)
continue;
if(token[key] instanceof DataPiece){
token[key].value && out.push(key);
}else if(typeof token[key] === 'function'){
token[ key ] = DataPieceFactory(refs, token[ key ]);
}else if(typeof token[key] === 'object' && token[key].hook){
token[key] = DataPieceFactory(refs, token[ key ].hook, token[key])
}else{
token[ key ] && out.push( key );
}
}
}
}else if(typeof token === 'function'){
args[i] = DataPieceFactory(refs, args[i]);
}
}
return depth === 0 && refs.length ? D.__cls(args, refs): out.join(' ');
};
D.cls = function() {
return D._cls(arguments, [], 0);
};
D.escapeCls = function(cls) {
return (cls+'').replace(/[^a-zA-Z0-9\-_]/g,'');
};
var _construct = function(ctor, cfg, p) {
//if it is not an arrow function
if('prototype' in ctor && ctor.prototype.constructor === ctor){
var cls = new ctor(cfg || {}, p);
return cls;//'dom' in cls ? cls.dom : cls;
}else{
return ctor(cfg || {}, p);
}
};
var usage = {};
var populate = function(name, construct) {
var tokens = name.split('.'),
last = tokens.pop(),
first = tokens.shift();
// ES 6 consts are not in global scope. So we can not just add vars to window
var pointer = first?
new Function('glob', 'return typeof '+first+' !== "undefined"?'+first+':(glob["'+first+'"] = {})')(glob)
:glob;
try{
tokens.reduce( function( pointer, token, i, full ){
return pointer[ token ] || ( pointer[ token ] = {} );
}, pointer )[ last + '' ] = construct;
}catch(e){
console.error('can not populate', name)
}
return construct;
};
D.declare = function(name, ctor) {
var uses;
if(typeof ctor === 'object'){
var original = ctor;
var Factory = function(a,b,c,d){
if(!(this instanceof Factory)){
return new Factory(a,b,c,d);
}
original.ctor && original.ctor.apply(this, arguments);
};
Factory.prototype = ctor;
Factory.constructor = Factory;
ctor = Factory;
}
if(name in usage){
log('updated', `${name} (${usage[name].instances.length})`)
usage[ name ].ctor = ctor;
uses = usage[ name ].instances;
for( var i = 0, _i = uses.length; i < _i; i++ ){
var u = uses[ i ], d = u.dom;
u.dom = _construct(ctor, u.cfg, u.p);
d.dom && (d = d.dom);
if(d.parentNode){
d.parentNode.replaceChild( 'dom' in u.dom ? u.dom.dom : u.dom, d )
}
}
}else{
log('declared', `${name}`);
uses = (usage[ name ] = {ctor: ctor, instances: []}).instances;
}
return populate(name, function construct (cfg, p) {
var dom = _construct(ctor, cfg, p);
uses.push({dom: dom, cfg: cfg, p: p});
return dom;
});
};
var _log = [], later = false,
realLog = function() {
later = false;
var aggregated = _log.reduce(function(s, item) {
(s[item.evt] || (s[item.evt] = [])).push(item);
return s;
}, {});
_log.length = 0;
for(var evt in aggregated){
console.log('DOM:'+evt+' → '+aggregated[evt].map(function(item) {
return item.args.join(' ');
}).join(', '));
}
};
var log = function(evt) {
_log.push({type: 'log', evt: evt, args: ArraySlice.call(arguments, 1)});
if(!later)
later = setTimeout(realLog, 3000);
};
var emptyFn = function() {};
D.Unsubscribe = function(fn) {
this.fn = [];
fn && this.fn.push(fn);
};
D.Unsubscribe.prototype = {
un: function() {
var fn;
while((fn = this.fn.pop()))
fn();
},
add: function(fn) {
typeof fn !== 'function' && (fn = getCallableFunction(fn));
this.fn.push(fn);
}
};
var getCallableFunction = function(obj) {
if(obj instanceof D.Unsubscribe){
return function() {
obj.un();
}
}
};
var unsubscribable = function(name) {
return function(el, fn, arg) {
typeof fn !== 'function' && (fn = getCallableFunction(fn));
el.addEventListener(name, fn, arg);
return new D.Unsubscribe(function() {
el.removeEventListener(name, fn, arg);
});
};
};
D.mouse = {
down: unsubscribable('mousedown'),
up: unsubscribable('mouseup'),
move: unsubscribable('mousemove'),
over: unsubscribable('mouseover'),
};
D.AnimationFrame = function(fn) {
var requested = false,
arg,
update = function() {
fn.call(null, arg);
requested = false;
};
return function(a) {
arg = a;
if(!requested){
requestAnimationFrame(update);
requested = true;
}
};
};
D.overlay = {
inited: false,
show: function() {
this.init();
this.el.style.display = 'block';
},
hide: function() {
this.init();
this.el.style.display = 'none';
},
init: function() {
if(this.inited)
return;
this.inited = true;
this.el = D.div({
renderTo: document.body,
cls: 'D-overlay', style: {display: 'none', position: 'absolute', zIndex:10000, left: 0, right: 0, top: 0, bottom: 0}})
this.el.addEventListener('mousemove', function(e) {
e.preventDefault();
e.stopPropagation();
}, true)
}
};
D.findParent = function(el, fn) {
var test;
while(el){
test = fn(el);
if(test === true)
return el;
el = el.parentNode
}
};
D.s = D.h;
})(window['NS'], typeof window !== "undefined" ? window :
typeof WorkerGlobalScope !== "undefined" ? self :
typeof global !== "undefined" ? global :
typeof GLOBAL !== "undefined" ? GLOBAL :
Function("return this;")(), document);
var D = NS.D,
div = D.div,
span = D.span,
view = {
page: {},
cmp: {}
};
Author: Kubota Ivan
Contact: zibx@quokka.pub
License:
MPL-2.0
Developed in:
2012-2020
Mozilla Public License, version 2.0
# 1. Definitions
1.1. “Contributor” means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software.
1.2. “Contributor Version” means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution.
1.3. “Contribution” means Covered Software of a particular Contributor.
1.4. “Covered Software” means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof.
1.5. “Incompatible With Secondary Licenses” means
that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or
that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License.
1.6. “Executable Form” means any form of the work other than Source Code Form.
1.7. “Larger Work” means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software.
1.8. “License” means this document.
1.9. “Licensable” means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License.
1.10. “Modifications” means any of the following:
any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or
any new file in Source Code Form that contains any Covered Software.
1.11. “Patent Claims” of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version.
1.12. “Secondary License” means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses.
1.13. “Source Code Form” means the form of the work preferred for making modifications.
1.14. “You” (or “Your”) means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
# 2. License Grants and Conditions
2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and
under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version.
2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution.
2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor:
for any code that a Contributor has removed from Covered Software; or
for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or
under Patent Claims infringed by Covered Software in the absence of its Contributions.
This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4).
2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3).
2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents.
2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1.
# 3. Responsibilities
3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form.
3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then:
such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and
You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s).
3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction.
4 . Inability to Comply Due to Statute or Regulation If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
# 5. Termination
5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination.
6 . Disclaimer of Warranty Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer.
7 . Limitation of Liability Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.
8 . Litigation Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims.
# 9. Miscellaneous
This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor.
# 10. Versions of the License
10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number.
10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward.
10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - “Incompatible With Secondary Licenses” Notice This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0.
\ No newline at end of file
async function subscribe() {
if(window.nolive)
return;
let response = {};
try{
response = await fetch( "/[live]" );
}catch( e ){
}
if (response.status === 502) {
} else if (response.status !== 200) {
// An error - let's show it
//debugger
//showMessage(response.statusText);
// Reconnect in one second
} else {
// Get and show the message
try{
let message = await response.text();
let data = JSON.parse( message ),
should = data.filter(live =>
[...document.scripts]
.map((a)=>a.src.replace(location.protocol+'//'+location.host,''))
.indexOf(live.file)>-1
).forEach(a=>{
try{
eval( a.content )
console.log('Reloaded: '+a.file);
}catch(e){
console.error(e)
}
});
}catch(e){
console.error(e)
}
//showMessage(message);
// Call subscribe() again to get the next message
}
setTimeout(subscribe, 1000);
}
setTimeout(subscribe, 10000);
\ No newline at end of file
var Observable = (function(){
'use strict';
var ArraySlice = [].slice;
var Observable = function(){
this._clearListeners();
};
Observable.prototype = {
on: function( k, v ){
( this._listeners[ k ] || ( this._listeners[ k ] = [] ) ).push( v );
var _self = this;
return function ReleaseObservable(){
_self.un( k, v );
};
},
un: function( k, v ){
var list = this._listeners[ k ];
if( list ){
var id = list.indexOf( v );
if( id > -1 ){
list.splice( id, 1 );
}
}
},
fire: function( k ){
//console.log(k)
var listeners = this._listeners[ k ],
listener;
if( listeners === void 0 )
return;
for( var i = 0, _i = listeners.length; i < _i; i++ ){
listener = listeners[ i ];
if( listener ){
listener.apply( this, ArraySlice.call( arguments, 1 ) );
}
}
},
once: function( k, v ){
var _self = this,
wrap = function(){
v.apply( this, arguments );
_self.un( k, wrap )
};
this.on( k, wrap );
},
_clearListeners: function(){
this._listeners = {};
}
};
return Observable;
})();
typeof module === 'object' && (module.exports = Observable);
\ No newline at end of file
function mulberry32(a) {
var out = function() {
var t = a += 0x6D2B79F5;
t = Math.imul(t ^ t >>> 15, t | 1);
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
return ((t ^ t >>> 14) >>> 0) / 4294967296;
};
out.getSeed = function() {
return a;
};
out.setSeed = function(A) {
a = A;
};
out.setStringSeed = function(str) {
str = str.replace(/[^0-9a-z]/g,'').substr(0,12);
if(str.length === 0)str = '1';
a = parseInt(str,36);
};
out.getStringSeed = function() {
return a.toString(36);
};
return out;
}
Math.random.seeded = mulberry32(Math.floor(Math.random()*4294967296));
\ No newline at end of file
/*
Observable Store based in 2016 April by Ivan Kubota
License: MPL 2.0
Contact: zibx@quokka.pub
*/
const isEqual = function(original, fn) {
return function(val) {
fn(val===original);
}
};
const isNotEqual = function(original, fn) {
return function(val) {
fn(val!==original);
}
};
const isContain = function(original, fn) {
return function(val) {
fn((val||[]).indexOf(original)>-1);
}
};
/*
-- DESIGN --
Store MUST notify all subscribers on each change
Store MUST NOT notify subscribers if it does not change
*/
const Store = function(cfg) {
Observable.call(this);
this.events = new Observable();
this._props = cfg || {};
},
isObject = function(obj) {
// null is not an object. treat Date as primitive
return typeof obj === 'object' && obj !== null && !(obj instanceof Date);
};
const recursiveWalk = function(path, pointer, key, list) {
if(typeof pointer[key] === 'object'){
for(let subKey in pointer[key]){
if(typeof pointer[key][subKey] === 'object'){
list.push( [ path.concat( key, subKey ).join('.'), void 0 ] );
}
recursiveWalk(path.concat(key), pointer[key], subKey, list);
}
}else{
list.push( [ path.concat( key ).join('.'), void 0 ] );
}
},
recursiveSet = function(path, pointer, key, val, list){
let subKey,i, originalLength;
if( isObject(val) ){
if(Array.isArray(val)){
if(!Array.isArray(pointer[key])){
pointer[ key ] = [];
list.push([path.concat(key).join( '.' ), pointer[ key ]])
}
originalLength = pointer[ key ].length;
}else{
if(!isObject(pointer[ key ])){
pointer[ key ] = {};
list.push([path.concat(key).join( '.' ), pointer[ key ]])
}
}
for(subKey in val){
recursiveSet( path.concat( key ), pointer[ key ], subKey, val[subKey], list );
}
for( subKey in pointer[ key ] ){
if( !val.hasOwnProperty( subKey ) ){
// remove
recursiveWalk( path.concat( key ), pointer[key], subKey, list );
delete pointer[ key ][ subKey ];
}
}
if(Array.isArray(val)){
if(originalLength !== val.length){
recursiveSet( path.concat( key ), pointer[ key ], 'length', val.length, list );
list.push([path.concat(key).join( '.' ), pointer[ key ]]);
}
}
}else{
if( val !== pointer[ key ] ){
pointer[ key ] = val;
list.push( [ path.concat(key).join( '.' ), pointer[ key ] ] );
}
}
};
var StoreParent = function(parent, key, item) {
this.parent = parent;
this.key = key;
this.item = item;
};
StoreParent.prototype = {
getKey: function() {
if(this.item){
var idx = this.parent._props.indexOf(this.item);
if(idx > -1)
return idx;
console.error('try to write to not existed item');
}else{
return this.key;
}
}
};
Store.prototype = {
parent: null,
setParent: function(parent, key, item){
this.parent = new StoreParent(parent, key, item);
},
bindings: function() {
var out = {};
for(var k in this._props){
out[k] = this.bind(k);
}
return out;
},
item: function(key, item){
let subStore = new Store(item?item:key);
subStore.setParent(this, key, item);
return subStore;
},
array: function(key){
let arrayStore = new ArrayStore(this.get(key));
arrayStore.setParent(this, key);
return arrayStore;
},
experimental: false,
_set: function(keys, val, pointer, changeList) {
changeList = changeList || [];
let parent, i, _i;
for(i=0, _i = keys.length - 1; i < _i; i++){
let key = keys[i];
parent = pointer;
if(key in pointer){
pointer = parent[key];
if(!isObject(pointer)){
pointer = parent[key] = {};
changeList.push([keys.slice(0, i).join( '.' ), parent[key]]);
}
}else{
pointer = parent[key] = {};
changeList.push([keys.slice(0, i+1).join( '.' ), parent[key]]);
}
}
let key = keys[i];
recursiveSet(keys.slice(0, keys.length - 1), pointer, key, val, changeList);
},
clear: function() {
this._props = {};
this.events.fire('change', null, null);
},
/*
key: String, val: any
key: {k: v, ...}
*/
set: function(key, val, changeList) {
var isChangeList = changeList !== void 0;
changeList = changeList || [];
var type = typeof key;
if(type === 'object'){
for(let k in key){
this.set(k, key[k], changeList);
}
this._notify(changeList);
return this;
}
var _key;
if(type === 'string') {
_key = key.split('.');
}else if(type === 'number'){
_key = [key];
}
this._set(
_key,
val,
this._props,
changeList
);
if(!isChangeList)
this._notify(changeList);
return this;
},
reSet: function(key, val, changeList) {
this._props = {};
if(key===void 0)
return this;
return this.set(key, val, changeList);
},
_notify: function(changeList, prefix) {
prefix = prefix || '';
for( let i = changeList.length; i; ){
const changeListElement = changeList[ --i ];
var key = changeListElement[0], val = changeListElement[1],
fullKey = prefix+(key===''?'':(prefix===''?'':'.')+key);
this.events.fire('change', fullKey, changeListElement[1]);
this.fire(fullKey, changeListElement[1]);
}
if(this.parent){
if(prefix) {
this.parent.parent._notify(changeList, this.parent.getKey() + '.' + prefix);
}else{
this.parent.parent._notify(changeList, this.parent.getKey());
}
}
},
get: function(key, returnLastStore) {
if(key === void 0)
return this._props;
let type = typeof key;
if(type === 'string') {
key = key.split('.');
}
if(type === 'number') {
key = [key];
}
let ref = this,
lastStore = ref, i, _i;
for( i = 0, _i = key.length; i < _i; i++ ){
if( ref instanceof Store ){
ref = ref._props[key[i]];
lastStore = ref;
}else{
ref = ref[key[i]];
}
if( !ref && i < key.length - 1 )
return void 0;
}
if( returnLastStore )
return { lastQObject: lastStore, result: ref };
return ref;
},
sub: function(key, fn, suppresFirstCall) {
var un;
if(Array.isArray(key)){
var _self = this;
var args = new Array(key.length);
var caller = function() {
return fn.apply(_self, args);
};
var wrap = function(i){
return function(val) {
args[i] = val;
return caller();
};
};
var uns = [];
for( var i = 0, _i = key.length; i < _i; i++ ){
if(key[i] instanceof StoreBinding){
// TODO add suppresFirstCall
uns.push(key[i].sub(wrap(i)));
args[i] = key[i].get();
}else if(key[i] instanceof HookPrototype){
uns.push(key[i].hook(wrap(i), suppresFirstCall));
args[i] = key[i].get();
}else{
uns.push(this.on( key[ i ], wrap(i) ));
args[i] = this.get(key[ i ]);
}
}
!suppresFirstCall && caller();
return function() {
for( var i = 0, _i = uns.length; i < _i; i++ ){
uns[ i ]();
}
};
}else{
un = this.on( key, fn );
!suppresFirstCall && fn( this.get( key ) );
return un;
}
},
equal: function(key, val, fn) {
const wrap = isEqual(val, fn);
this.on(key, wrap);
wrap(this.get(key));
return this;
},
notEqual: function(key, val, fn) {
const wrap = isNotEqual(val, fn);
this.on(key, wrap);
wrap(this.get(key));
return this;
},
contain: function(key, val, fn) {
const wrap = isContain(val, fn);
this.on(key, wrap);
wrap(this.get(key));
return this;
},
bind: function (key) {
return new StoreBinding(this, key);
},
val: function(key) {
const me = this;
return function backwardCallback(update) {
me.sub(key, val => update(val));
}
},
valEqual: function(key, val) {
const me = this;
return function backwardCallback(update) {
me.equal(key, val, compareResult => {update(compareResult)});
}
},
valNotEqual: function(key, val) {
const me = this;
return function backwardCallback(update) {
me.notEqual(key, val, compareResult => {update(compareResult)});
}
},
valEqualOnly: function(key, val) {
const me = this;
return function backwardCallback(update) {
me.equal(key, val, compareResult => {compareResult && update(compareResult)});
}
},
valContains: function(key, val) {
const me = this;
return function backwardCallback(update) {
me.contain(key, val, compareResult => {compareResult && update(compareResult)});
}
},
valTrue: function(key) {
return this.valEqual(key, true);
},
valFalse: function(key) {
return this.valEqual(key, false);
}
};
const StoreBinding = function(store, key){
this.store = store;
this.key = key;
};
StoreBinding.prototype = {
sub: function (k, fn) {
if(typeof k === 'function'){
fn = k;
return this.un = this.store.sub(this.key, fn);
}else{
return this.un = this.store.sub(
(Array.isArray(k)?k:[k]).map(k=>this.key+'.'+k), fn);
}
},
set: function (val) {
this.store.set(this.key, val);
},
get: function() {
return this.store.get(this.key);
},
bind: function(key) {
return new StoreBinding(this.store, this.key+'.'+key);
},
hook: function(draw) {
return this.sub(function(val){
draw(val);
});
},
array: function() {
return this.store.array(this.key);
}
};
Store.prototype = Object.assign(new Observable, Store.prototype);
Store.StoreBinding = StoreBinding;
Store.AGGREGATE = function(fn) {
return function(...args) {
let composite, _i = args.length,
vals = new Array(_i);
return function(update) {
let check = ()=>{
let result = fn(vals, _i);
if(composite !== result)
update(composite = result);
};
for(let i = 0; i < _i; i++){
// set backward callback
let hook = val => {
// update item corresponding value and check condition
vals[ i ] = val;
check();
};
if(args[i] instanceof HookPrototype){
args[i].hook(hook)
}else{
args[ i ]( hook )
}
}
};
};
};
Store.AND = Store.AGGREGATE(function(values, length) {
let result = true;
for(let i = 0; i < length; i++){
result = result && values[i];
}
return result;
});
Store.OR = Store.AGGREGATE(function(values, length) {
let result = false;
for(let i = 0; i < length; i++){
result = result || values[i];
}
return result;
});
Store.ELSE = function(){if(!( this instanceof Store.ELSE))return new Store.ELSE()};
Store.IF = function(cfg, children){
var holders = {true: [], false: []},
holder = holders.true;
for( var i = 0, _i = children.length; i < _i; i++ ){
var child = children[ i ];
if(child instanceof Store.ELSE){
holder = holders.false;
}else{
holder.push(child);
}
}
holders.true.length === 0 && (holders.true = null);
holders.false.length === 0 && (holders.false = null);
return function( update ){
if( 'condition' in cfg )
var hook = function( cond ){
update( cond ? holders.true : holders.false );
};
if(cfg.condition instanceof HookPrototype){
cfg.condition.hook( hook );
}else if(typeof cfg.condition === 'function'){
cfg.condition( hook );
}else{
// TODO other hooklikes
hook(cfg.condition)
}
}
};
Store.NOT = Store.AGGREGATE(function(values, length) {
return !values[0];
});
Store.debounce = function(fn, dt) {
var timeout = false, args, scope,
realCall = function() {
timeout = false;
fn.apply(scope, args)
};
return function(){
args = [].slice.call(arguments);
scope = this;
if(!timeout){
timeout = setTimeout(realCall, dt);
}
}
};
var HookPrototype = function() {};
HookPrototype.prototype = {
setter: function(val) { return val; },
//getter: function(val) { return val; },
set: function(val) {
val = this.setter(val);
var oldVal = this.get();
if(!this.equal(oldVal, val)){
this.data = val;
this._emit(oldVal, val);
}
},
equal: function(oldVal, newVal){
return newVal === oldVal;
},
get: function() {
return this.data;
},
binding: function() {
var x = new StoreBinding();
x.get = ()=> this.get();
x.set = (a)=> this.set(a);
x.sub = (fn)=> this.hook(fn);
return x;
},
hook: function(fn, suppresFirstCall) {
this.subscribers.push(fn);
!suppresFirstCall && fn(this.get());
var _self = this;
return function() {
var index = _self.subscribers.indexOf(fn);
if(index>-1){
_self.subscribers.splice( index, 1 );
}
}
},
_emit: function(oldVal, val) {
var subscribers = this.subscribers;
for( var i = 0, _i = subscribers.length; i < _i; i++ ){
subscribers[ i ](val);
}
}
};
var HookFactory = function(accessor) {
var Hook = function(cfg) {
if(!(this instanceof Hook))
return new Hook(cfg);
this.data = {};
this.subscribers = [];
this.set(cfg);
};
Hook.prototype = Object.assign( new HookPrototype(), accessor );
return Hook;
};
Store.getValue = function(val) {
if(val instanceof StoreBinding){
return val.hook();
}else{
return val;
}
};
Store.Value = {
Boolean: new HookFactory({
setter: function(val) { return !!val; },
toggle: function() { this.set(!this.get()); }
}),
Number: new HookFactory({
setter: function(val) { return val-0; }
}),
String: new HookFactory({
setter: function(val) { return val+''; }
}),
Integer: new HookFactory({
setter: function(val) { return val|0; }
}),
Any: new HookFactory(),
Function: new HookFactory()
};
Store.HookPrototype = HookPrototype;
/*
-- DESIGN --
Array DOES NOT notify the store when it's item changes
Array MUST notify itself when item is added or removed
Array MUST notify when it is reordered
Array Item MUST be observed itself
*/
var getter = function( i ){ return this[i]; };
var fns = Array.prototype;
const ArrayStore = function(cfg) {
Store.call(this, cfg);
if( !('get' in this._props) ){
Object.defineProperties( this._props, {
get: { value: getter, enumerable: false }
} );
}
this.length = this._props.length;
};
ArrayStore.prototype = {
length: 0,
indexOf: function (a) {
return this._props.indexOf(a);
},
toArray: function () {
return this._props;
},
_fireAdd: function (item, pos) {
var arr = this._props;
this.fire('add', item, pos > 0 ? arr.get(pos-1) : null, pos < this.length - 1 ? arr.get(pos+1) : null, pos)
},
_fireRemove: function (item, pos) {
var arr = this._props;
this.fire('remove', item, pos > 0 ? arr.get(pos-1) : null, pos < this.length ? arr.get(pos) : null, pos)
},
push: function (item) {
// single item push only
var out = this._props.push(item);
this._fireAdd(item, this.length++);
return out;
},
unshift: function (item) {
// single item unshift only
var out = this._props.unshift(item);
this.length++;
this._fireAdd(item, 0);
return out;
},
shift: function(){
var pos = --this.length,
arr = this._props,
item = arr.shift();
this._fireRemove(item, 0);
return item;
},
pop: function () {
var pos = --this.length,
arr = this._props,
item = arr.pop();
this._fireRemove(item, pos);
return item;
},
splice: function(start, count){
var i, _i, newItems = fns.slice.call(arguments,2 ), out = [];
for(i = 0;i<count; i++)
out.push(this.remove(start));
for(i = 0, _i = newItems.length; i < _i; i++)
this.insert(newItems[i], i + start);
return out;
},
/*
set - updates element
@arg pos: position of element. defined on [0..length]
@arg item: element to set
@return element that was in that position before
*/
set: function(pos, item){
if(pos === this.length){
this.push( item );
return void 0; // for same behavior we return empty array
}
return this.splice(pos, 1, item)[0];
},
iterator: function(start){
return new Iterator(this, start);
},
remove: function(pos){
var item = this._props.splice(pos,1)[0];
this.length--;
this._fireRemove(item, pos);
return item;
},
insert: function(item, pos){
this._props.splice(pos, 0, item);
this.length++;
this._fireAdd(item, pos)
},
forEach: function (fn) {
return this._props.forEach(fn);
}
};
ArrayStore.prototype = Object.assign(new Store(), ArrayStore.prototype);
/*
const ArrayStore = function (cfg) {
Store.call(this, cfg);
};
ArrayStore.prototype = {
push: function (val) {
var changeList = [];
changeList.push(['', this._props])
this.set(this.getLength(), val, changeList);
this._notify(changeList);
return this;
},
pop: function () {
var changeList = [];
changeList.push(['', this._props]);
var out = this.get(this.getLength()-1);
this.set(this.getLength()-1, void 0, changeList);
this._props.pop();
this._notify(changeList);
return out;
},
remove: function(item) {
var idx = this._props.indexOf(item);
if(idx>-1){
var changeList = [];
changeList.push(['', this._props]);
this._props.splice(idx,1);
//this.set(this.getLength()-1, void 0, changeList);
this._notify(changeList);
}
return this;
},
slice: function () {},
splice: function () {},
getLength: function () {
return this._props.length;
},
update: function() {
var changeList = [];
changeList.push(['', this._props]);
this._notify(changeList);
return this;
},
'~destructor': function() {
this._listeners = this.events = this._props = null;
}
};
ArrayStore.prototype = Object.assign(new Store(), ArrayStore.prototype);*/
typeof module === 'object' && (module.exports = Store);
(typeof window === 'object') && (window.Store = Store);
\ No newline at end of file
var Transform = (function() {
'use strict';
var hookAndConvert = function(fn) {
return function(hook, a) {
var type = typeof hook;
var notObject = type !== 'object';
var isHook = !notObject && ('hook' in hook);
if(isHook){
type = 'function'; notObject = true;
}
if(notObject){
if( type === 'function' ){
var last, val;
if(isHook){
return {hook: function(draw) {
return hook.hook(function(arg) {
val = fn(arg, a);
if(last === val)
return;
return draw(last = val);
});
}};
}else{
return function(draw) {
return hook(function(arg) {
val = fn(arg, a);
if(last === val)
return;
return draw(last = val);
});
};
}
}
}else{
return hook;
}
}
};
var Transform = {
toFixed: hookAndConvert(function(val, digits) {
return (val-0).toFixed(digits);
}),
concat: hookAndConvert(function(val, val2) {
return val + val2;
}),
toLowerCase: hookAndConvert(function(val) {
return (val+'').toLowerCase();
})
};
return Transform;
})();
typeof module === 'object' && (module.exports = Transform);
(typeof window === 'object') && (window.T = window.Transform = Transform);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment