Comparing version 1.0.6 to 1.0.7
# Type | ||
## ax5.util.getType() | ||
Return argument object type. | ||
Return argument's object type. | ||
- argument : any type of variable. | ||
@@ -20,3 +20,3 @@ - return : The type of argument(number, string, array, object, function, nodelist, fragment). | ||
--- | ||
## ax5.util.is*Type*() | ||
## ax5.util.is`Type`() | ||
Return Boolean value depending on the correspondence of 'does the argument is this type?'. | ||
@@ -56,17 +56,17 @@ - argument : any type of variable. | ||
## ax5.util.filter | ||
You can freely edit filter by anonymous function when use. | ||
the second argument is original data. | ||
it is filtered by your customized filter function. | ||
if the result is True, saved to the first argument. | ||
You can freely edit filter function by anonymous function when use. | ||
The data is filtered by your customized filter function. | ||
> *Argument, Usage, Output* | ||
- Argument 01 : Original Data. | ||
- Argument 02 : Anonymous function(filter function). | ||
- Usage : ax5.util.filter(Argument01, function(){ return }); | ||
- Output | ||
#####//Example 01 | ||
Argument : | ||
**Example 01** | ||
```js | ||
var array = [5, 4, 3, 2, 1]; | ||
var aarray = [5, 4, 3, 2, 1]; | ||
``` | ||
- aaray : original data. | ||
aarray : original data. | ||
Usage : | ||
```js | ||
@@ -77,6 +77,4 @@ var result = ax5.util.filter(array, function () { | ||
``` | ||
- edit annoymous function. it will be a filter. | ||
edit annoymous function. it will be a filter. | ||
Output : | ||
```js | ||
@@ -86,6 +84,6 @@ console.log(result); | ||
``` | ||
- if the return value of filter function is false, the data is filtered. | ||
if the return value of filter function is false, the data is filtered. | ||
#####// Example 02 | ||
Argument : | ||
**Example 02** | ||
```js | ||
@@ -101,3 +99,2 @@ var list = [ | ||
Usgae : | ||
```js | ||
@@ -109,3 +106,2 @@ var result = ax5.util.filter(list, function () { | ||
Output : | ||
```js | ||
@@ -119,4 +115,3 @@ console.log(JSON.stringify(result)); | ||
#####//Example03 | ||
Argument : | ||
**Example03** | ||
```js | ||
@@ -131,3 +126,2 @@ var filObject = { | ||
Usage : | ||
```js | ||
@@ -139,3 +133,2 @@ var result = ax5.util.filter( filObject, function(){ | ||
Output : | ||
```js | ||
@@ -149,572 +142,161 @@ console.log( ax5.util.toJson(result) ); | ||
## ax5.util.search | ||
It returns the first item of the result of the function is True. | ||
```js | ||
var a = ["A", "X", "5"]; | ||
var idx = ax5.util.search(a, function () { | ||
return this == "X"; | ||
}); | ||
console.log(a[idx]); | ||
You can freely edit search function by anonymous function when use. | ||
The search function will return the first item which is correspondent to the function. | ||
idx = ax5.util.search(a, function () { | ||
return this == "B"; | ||
}); | ||
console.log(idx); | ||
// -1 | ||
- Argument 01 : Original Data. | ||
- Argument 02 : Anonymous function(search function). | ||
- Usage : Argument01[ ax5.util.search(Argument01, function(){ return }) ]; | ||
console.log(a[ | ||
ax5.util.search(a, function (idx) { | ||
return idx == 2; | ||
}) | ||
]); | ||
// 5 | ||
var b = {a: "AX5-0", x: "AX5-1", 5: "AX5-2"}; | ||
console.log(b[ | ||
ax5.util.search(b, function (k, v) { | ||
return k == "x"; | ||
}) | ||
]); | ||
// AX5-1 | ||
``` | ||
--- | ||
## ax5.util.map | ||
`"map"` creating a new array features set into an array or object. In the example I've created a simple object array as a numeric array. | ||
**Example 01** | ||
```js | ||
var a = [1, 2, 3, 4, 5]; | ||
a = ax5.util.map(a, function () { | ||
return {id: this}; | ||
}); | ||
console.log(ax5.util.toJson(a)); | ||
console.log( | ||
ax5.util.map({a: 1, b: 2}, function (k, v) { | ||
return {id: k, value: v}; | ||
}) | ||
); | ||
var a = ["A", "X", "5"]; | ||
``` | ||
--- | ||
## ax5.util.merge | ||
`"array like"` the type of object `"concat"`. | ||
```js | ||
var a = [1, 2, 3], b = [7, 8, 9]; | ||
console.log(ax5.util.merge(a, b)); | ||
``` | ||
--- | ||
## ax5.util.reduce | ||
As a result of the process performed in the operation from the left to the right of the array it will be reflected to the left side item. It returns the final value of the item. | ||
```js | ||
var aarray = [5, 4, 3, 2, 1], result; | ||
console.log(ax5.util.reduce(aarray, function (p, n) { | ||
return p * n; | ||
})); | ||
// 120 | ||
console.log(ax5.util.reduce({a: 1, b: 2}, function (p, n) { | ||
// If the "Object" is the first "p" value is "undefined". | ||
return parseInt(p | 0) + parseInt(n); | ||
})); | ||
// 3 | ||
``` | ||
--- | ||
## ax5.util.reduceRight | ||
Same as "reduce" but with a different direction. | ||
```js | ||
var aarray = [5, 4, 3, 2, 1]; | ||
console.log(ax5.util.reduceRight(aarray, function (p, n) { | ||
return p - n; | ||
})); | ||
// -13 | ||
``` | ||
--- | ||
## ax5.util.sum | ||
It returns the sum. The sum of all the values returned by the function. | ||
```js | ||
var arr = [ | ||
{name: "122", value: 9}, | ||
{name: "122", value: 10}, | ||
{name: "123", value: 11} | ||
]; | ||
var rs = ax5.util.sum(arr, function () { | ||
if(this.name == "122") { | ||
return this.value; | ||
} | ||
var idx = ax5.util.search(a, function () { | ||
return this == "X"; | ||
}); | ||
console.log(rs); // 19 | ||
console.log(ax5.util.sum(arr, 10, function () { | ||
return this.value; | ||
})); | ||
// 40 | ||
``` | ||
--- | ||
## ax5.util.avg | ||
It returns the average. The average of all the values returned by the function. | ||
```js | ||
var arr = [ | ||
{name: "122", value: 9}, | ||
{name: "122", value: 10}, | ||
{name: "123", value: 11} | ||
]; | ||
var rs = ax5.util.avg(arr, function () { | ||
return this.value; | ||
}); | ||
console.log(rs); // 10 | ||
console.log(a[idx]); | ||
> X | ||
``` | ||
--- | ||
if there is no correspondont item, it will retrun -1 | ||
## ax5.util.first | ||
It returns the first element in the Array, or Object. However, it is faster to use Array in the "Array [0]" rather than using the "first" method. | ||
**Example 02** | ||
```js | ||
var _arr = ["ax5", "axisj"]; | ||
var _obj = {k: "ax5", z: "axisj"}; | ||
console.log(ax5.util.first(_arr)); | ||
// ax5 | ||
console.log(ax5.util.toJson(ax5.util.first(_obj))); | ||
// {"k": "ax5"} | ||
var a = ["A", "X", "5"]; | ||
``` | ||
--- | ||
## ax5.util.last | ||
It returns the last element in the Array, or Object. | ||
```js | ||
var _arr = ["ax5", "axisj"]; | ||
var _obj = {k: "ax5", z: "axisj"}; | ||
console.log(ax5.util.last(_arr)); | ||
// axisj | ||
console.log(ax5.util.toJson(ax5.util.last(_obj))); | ||
// {"z": "axisj"} | ||
console.log( | ||
a[ | ||
ax5.util.search(a, function (idx){ | ||
return idx == 2; | ||
}) | ||
] | ||
); | ||
> 5 | ||
``` | ||
--- | ||
# String | ||
## ax5.util.left | ||
Returns. Since the beginning of the string to the index, up to a certain character in a string from the beginning of the string. | ||
**Example 03** | ||
```js | ||
console.log(ax5.util.left("abcd.efd", 3)); | ||
// abc | ||
console.log(ax5.util.left("abcd.efd", ".")); | ||
// abcd | ||
var b = {a: "AX5-0", x: "AX5-1", 5: "AX5-2"}; | ||
``` | ||
--- | ||
## ax5.util.right | ||
Returns. Up from the end of the string index, up to a certain character in a string from the end of the string | ||
```js | ||
console.log(ax5.util.right("abcd.efd", 3)); | ||
// efd | ||
console.log(ax5.util.right("abcd.efd", ".")); | ||
// efd | ||
console.log( | ||
b[ | ||
ax5.util.search(b, function (k) { | ||
return k == "x"; | ||
}) | ||
] | ||
); | ||
> AX5-1 | ||
``` | ||
--- | ||
## ax5.util.camelCase | ||
It converts a string to "Camel Case". "a-b", "aB" will be the "aB". | ||
```js | ||
console.log(ax5.util.camelCase("inner-width")); | ||
console.log(ax5.util.camelCase("innerWidth")); | ||
// innerWidth | ||
console.log(ax5.util.camelCase("camelCase")); | ||
// camelCase | ||
console.log(ax5.util.camelCase("aBc")); | ||
// aBc | ||
``` | ||
--- | ||
## ax5.util.map | ||
You can freely edit mapping function by anonymous function when use. | ||
The mapping function will return the array or object which is set by original data. | ||
In the example I've created a simple object array as a numeric array. | ||
## ax5.util.snakeCase | ||
It converts a string to "Snake Case". "aB" will be the "a-b". | ||
```js | ||
console.log(ax5.util.snakeCase("inner-width")); | ||
// inner-width | ||
console.log(ax5.util.snakeCase("camelCase")); | ||
// camel-case | ||
console.log(ax5.util.snakeCase("aBc")); | ||
// a-bc | ||
``` | ||
--- | ||
- Argument 01 : Original Data. | ||
- Argument 02 : Anonymous function(mapping function). | ||
- Usage : ax5.util.map(Argument01, function(){ return }). | ||
- Output | ||
# Number | ||
## ax5.util.number | ||
When the number covers the development, often it requires multiple steps. The syntax is very complex and it is difficult to maintain. "ax5.util.number" command to convert a number that were resolved by passing a JSON format. | ||
```js | ||
console.log('round(1) : ' + ax5.util.number(123456789.678, {round: 1})); | ||
// round(1) : 123456789.7 | ||
console.log('round(1) money() : ' | ||
+ ax5.util.number(123456789.678, {round: 1, money: true})); | ||
// round(1) money() : 123,456,789.7 | ||
console.log('round(2) byte() : ' | ||
+ ax5.util.number(123456789.678, {round: 2, byte: true})); | ||
// round(2) byte() : 117.7MB | ||
console.log('abs() round(2) money() : ' | ||
+ ax5.util.number(-123456789.678, {abs: true, round: 2, money: true})); | ||
// abs() round(2) money() : 123,456,789.68 | ||
console.log('abs() round(2) money() : ' | ||
+ ax5.util.number("A-1234~~56789.8~888PX", {abs: true, round: 2, money: true})); | ||
// abs() round(2) money() : 123,456,789.89 | ||
var a = [1, 2, 3, 4, 5]; | ||
``` | ||
- - - | ||
# Date | ||
## date | ||
`ax5.util.date(date[, cond])` | ||
Usage 01 : | ||
```js | ||
ax5.util.date('2013-01-01'); // Tue Jan 01 2013 23:59:00 GMT+0900 (KST) | ||
ax5.util.date((new Date()), {add:{d:10}, return:'yyyy/MM/dd'}); // "2015/07/01" | ||
ax5.util.date('1919-03-01', {add:{d:10}, return:'yyyy/MM/dd hh:mm:ss'}); // "1919/03/11 23:59:00" | ||
a = ax5.util.map(a, function () { | ||
return {id: this}; | ||
}); | ||
``` | ||
## dday | ||
`ax5.util.dday(date[, cond])` | ||
Output 01 : | ||
```js | ||
ax5.util.dday('2016-01-29'); // 1 | ||
ax5.util.dday('2016-01-29', {today:'2016-01-28'}); // 1 | ||
ax5.util.dday('1977-03-29', {today:'2016-01-28', age:true}); // 39 | ||
console.log(ax5.util.toJson(a)); | ||
> [{"id": 1},{"id": 2},{"id": 3},{"id": 4},{"id": 5}] | ||
``` | ||
## weeksOfMonth | ||
`ax5.util.weeksOfMonth(date)` | ||
Usage 02 : | ||
```js | ||
ax5.util.weeksOfMonth("2015-10-01"); // {year: 2015, month: 10, count: 1} | ||
ax5.util.weeksOfMonth("2015-09-19"); // {year: 2015, month: 9, count: 3} | ||
console.log( | ||
ax5.util.map({a: 1, b: 2}, function (k, v) { | ||
return {id: k, value: v}; | ||
}) | ||
); | ||
``` | ||
## daysOfMonth | ||
`ax5.util.daysOfMonth(year, month)` | ||
Output 02 : | ||
```js | ||
ax5.util.daysOfMonth(2015, 11); // 31 | ||
ax5.util.daysOfMonth(2015, 1); // 28 | ||
> [object, object] | ||
>> object0.id = a | ||
>> object0.value = 1 | ||
>> object1.id = b | ||
>> object1.value = 2 | ||
``` | ||
- - - | ||
# Misc. | ||
## ax5.util.param | ||
The parameter values may in some cases be the "Object" or "String". At this time, useing the "param", it can be the same as verifying the parameter value. | ||
```js | ||
console.log(ax5.util.param({a: 1, b: '123\'"2&'}, "param")); | ||
// a=1&b=123%27%222%26 | ||
console.log(ax5.util.param("a=1&b=12'\"32", "param")); | ||
//a=1&b=12'"32 | ||
console.log(ax5.util.toJson(util.param("a=1&b=1232"))); | ||
// {"a": "1", "b": "1232"} | ||
``` | ||
--- | ||
## ax5.util.parseJson | ||
parsing a little more than the less sensitive the JSON syntax "JSON.parse". | ||
```js | ||
console.log(ax5.util.toJson(ax5.util.parseJson("[{'a':'99'},'2','3']")[0])); | ||
// {"a": "99"} | ||
console.log(ax5.util.parseJson("{a:1}").a); | ||
// 1 | ||
console.log(ax5.util.toJson(ax5.util.parseJson("{'a':1, 'b':function(){return 1;}}", false))); | ||
// {"error": 500, "msg": "syntax error"} | ||
console.log(ax5.util.toJson(ax5.util.parseJson("{'a':1, 'b':function(){return 1;}}", true))); | ||
// {"a": 1, "b": "{Function}"} | ||
``` | ||
--- | ||
## ax5.util.merge | ||
concat the 'array like' objects. | ||
- Argument | ||
- Usage | ||
- Output | ||
## ax5.util.toJson | ||
Argument : | ||
```js | ||
console.log(ax5.util.toJson(1)); | ||
// 1 | ||
console.log(ax5.util.toJson("A")); | ||
// "A" | ||
console.log(ax5.util.toJson([1, 2, 3, 'A'])); | ||
// [1,2,3,"A"] | ||
console.log(ax5.util.toJson({a: 'a', x: 'x'})); | ||
// {"a": "a", "x": "x"} | ||
console.log(ax5.util.toJson([1, {a: 'a', x: 'x'}])); | ||
// [1,{"a": "a", "x": "x"}] | ||
console.log(ax5.util.toJson({a: 'a', x: 'x', list: [1, 2, 3]})); | ||
// {"a": "a", "x": "x", "list": [1,2,3]} | ||
console.log(ax5.util.toJson(function () {})); | ||
// "{Function}" | ||
var a = [1, 2, 3], b = [7, 8, 9]; | ||
``` | ||
--- | ||
## ax5.util.alert | ||
Usage : | ||
```js | ||
ax5.util.alert({a: 1, b: 2}); | ||
var c = ax5.util.merge(a,b); | ||
``` | ||
--- | ||
## ax5.util.toArray | ||
"nodelist" or on the Array Like such "arguments", has properties such as "length", but you can not use functions defined in Array.prototype. With "toArray" because it is easy to convert an array. | ||
```js | ||
function something() { | ||
var arr = ax5.util.toArray(arguments); | ||
console.log(ax5.util.toJson(arr)); | ||
} | ||
something("A", "X", "I", "S", "J"); | ||
``` | ||
--- | ||
## ax5.util.setCookie | ||
Output : | ||
```js | ||
ax5.util.setCookie("ax5-cookie", "abcde"); | ||
ax5.util.setCookie("ax5-cookie-path", "abcde", 2, {path: "/"}); | ||
> [1, 2, 3, 7, 8, 9] | ||
``` | ||
--- | ||
## ax5.util.getCookie | ||
```js | ||
console.log(ax5.util.getCookie("ax5-cookie")); | ||
// abcde | ||
console.log(ax5.util.getCookie("ax5-cookie-path")); | ||
// abcde | ||
``` | ||
--- | ||
## ax5.util.reduce | ||
This method is performed by data argument and anonymous function. the anonymous function has two arguments(result value, index value). the anonymous function excute code using the data argument of index value. return value is saved at result value and index value moves to right. repeat this process for the end of data argument. | ||
## ax5.util.findParentNode | ||
```js | ||
/* | ||
var cond = { | ||
tagname: {String} - tagName (ex. a, div, span..), | ||
clazz: {String} - name of Class | ||
[, attributes] | ||
}; | ||
*/ | ||
- Argument 01 : Original Data. | ||
- Argument 02 : Anonymous function(reduce function). | ||
- Usage : ax5.util.reduce(Argument01, function(result, index){ return }). | ||
- Output | ||
console.log( | ||
ax5.util.findParentNode(e.target, {tagname:"a", clazz:"ax-menu-handel", "data-custom-attr":"attr_value"}) | ||
); | ||
// using cond | ||
jQuery('#id').bind("click.app_expand", function(e){ | ||
var target = ax5.dom.findParentNode(e.target, function(target){ | ||
if($(target).hasClass("aside")){ | ||
return true; | ||
} | ||
else{ | ||
return true; | ||
} | ||
}); | ||
//client-aside | ||
if(target.id !== "client-aside"){ | ||
// some action | ||
} | ||
}); | ||
``` | ||
## ax5.util.cssNumber | ||
**Example 01** | ||
```js | ||
console.log(ax5.util.cssNumber('100px')); | ||
// 100px | ||
console.log(ax5.util.cssNumber(100)); | ||
// 100px | ||
console.log(ax5.util.cssNumber('100%')); | ||
// 100% | ||
console.log(ax5.util.cssNumber('##100@')); | ||
// 100px | ||
var aarray = [5, 4, 3, 2, 1]; | ||
``` | ||
## ax5.util.css | ||
```js | ||
console.log(ax5.util.css({ | ||
background: "#ccc", | ||
padding: "50px", | ||
width: "100px" | ||
console.log(ax5.util.reduce(aarray, function (p, n) { | ||
return p * n; //This sentence is same to <return p = p*n> | ||
})); | ||
// background:#ccc;padding:50px;width:100px; | ||
console.log(ax5.util.css('width:100px;padding: 50px; background: #ccc')); | ||
// {width: "100px", padding: "50px", background: "#ccc"} | ||
> 120 | ||
``` | ||
- p : result variable. The return value is saved at 'p'.(initial value = 5) | ||
- n : 'second to last' located variable. (initial value = 4. auto move left to right) | ||
## ax5.util.stopEvent | ||
**Example 02** | ||
```js | ||
ax5.util.stopEvent(e); | ||
``` | ||
## ax5.util.selectRange | ||
```html | ||
<div id="select-test-0" contentEditable="true">SELECT TEST</div> | ||
<div id="select-test-1" contentEditable="true">SELECT TEST</div> | ||
<div id="select-test-2" contentEditable="true">SELECT TEST</div> | ||
<script> | ||
$(document.body).ready(function () { | ||
ax5.util.selectRange($("#select-test-0"), "end"); // focus on end | ||
ax5.util.selectRange($("#select-test-1").get(0), [1, 5]); // select 1~5 | ||
//ax5.util.selectRange($("#select-test-2"), "start"); // focus on start | ||
//ax5.util.selectRange($("#select-test-2")); // selectAll | ||
//ax5.util.selectRange($("#select-test-2"), "selectAll"); // selectAll | ||
}); | ||
</script> | ||
``` | ||
## ax5.util.debounce | ||
`ax5.util.debounce(func, wait[, immediately])` | ||
```js | ||
var debounceFn = ax5.util.debounce(function( val ) { | ||
console.log(val); | ||
}, 300); | ||
$(document.body).click(function(){ | ||
debounceFn(new Date()); | ||
}); | ||
``` | ||
// return is Object. | ||
ax5.util.isObject({}); | ||
// return is Array. | ||
ax5.util.isArray([]); | ||
// return is Functon. | ||
ax5.util.isFunction(new Function); | ||
// return is String. | ||
ax5.util.isString(''); | ||
// return is Number. | ||
ax5.util.isNumber(1); | ||
// return is nodeList. | ||
ax5.util.isNodelist(document.querySelectorAll(".content")); | ||
// return is undefined. | ||
ax5.util.isUndefined(); | ||
// return is undefined|''|null. | ||
ax5.util.isNothing(); | ||
// return is Date | ||
ax5.util.isDate(); | ||
``` | ||
## ax5.util.isDateFormat | ||
`ax5.util.isDateFormat(String)` | ||
```js | ||
console.log(ax5.util.isDateFormat('20160101')); // true | ||
console.log(ax5.util.isDateFormat('2016*01*01')); // true | ||
console.log(ax5.util.isDateFormat('20161132')); // false | ||
``` | ||
--- | ||
# Object | ||
## ax5.util.filter | ||
The first item is delivered to the second argument of the filter function. The second argument is an anonymous function, the result is True, the items will be collected. | ||
```js | ||
var result, aarray = [5, 4, 3, 2, 1]; | ||
result = ax5.util.filter(aarray, function () { | ||
return this % 2; | ||
}); | ||
console.log(result); | ||
var list = [ | ||
{isdel: 1, name: "ax5-1"}, {name: "ax5-2"}, { | ||
isdel: 1, | ||
name: "ax5-3" | ||
}, {name: "ax5-4"}, {name: "ax5-5"} | ||
]; | ||
result = ax5.util.filter(list, function () { | ||
return (this.isdel != 1); | ||
}); | ||
console.log(JSON.stringify(result)); | ||
var filObject = {a:1, s:"string", oa:{pickup:true, name:"AXISJ"}, os:{pickup:true, name:"AX5"}}; | ||
result = ax5.util.filter( filObject, function(){ | ||
return this.pickup; | ||
}); | ||
console.log( ax5.util.toJson(result) ); | ||
// [{"pickup": , "name": "AXISJ"}, {"pickup": , "name": "AX5"}] | ||
``` | ||
--- | ||
## ax5.util.search | ||
It returns the first item of the result of the function is True. | ||
```js | ||
var a = ["A", "X", "5"]; | ||
var idx = ax5.util.search(a, function () { | ||
return this == "X"; | ||
}); | ||
console.log(a[idx]); | ||
idx = ax5.util.search(a, function () { | ||
return this == "B"; | ||
}); | ||
console.log(idx); | ||
// -1 | ||
console.log(a[ | ||
ax5.util.search(a, function (idx) { | ||
return idx == 2; | ||
}) | ||
]); | ||
// 5 | ||
var b = {a: "AX5-0", x: "AX5-1", 5: "AX5-2"}; | ||
console.log(b[ | ||
ax5.util.search(b, function (k, v) { | ||
return k == "x"; | ||
}) | ||
]); | ||
// AX5-1 | ||
``` | ||
--- | ||
## ax5.util.map | ||
`"map"` creating a new array features set into an array or object. In the example I've created a simple object array as a numeric array. | ||
```js | ||
var a = [1, 2, 3, 4, 5]; | ||
a = ax5.util.map(a, function () { | ||
return {id: this}; | ||
}); | ||
console.log(ax5.util.toJson(a)); | ||
console.log( | ||
ax5.util.map({a: 1, b: 2}, function (k, v) { | ||
return {id: k, value: v}; | ||
}) | ||
); | ||
``` | ||
--- | ||
## ax5.util.merge | ||
`"array like"` the type of object `"concat"`. | ||
```js | ||
var a = [1, 2, 3], b = [7, 8, 9]; | ||
console.log(ax5.util.merge(a, b)); | ||
``` | ||
--- | ||
## ax5.util.reduce | ||
As a result of the process performed in the operation from the left to the right of the array it will be reflected to the left side item. It returns the final value of the item. | ||
```js | ||
var aarray = [5, 4, 3, 2, 1], result; | ||
console.log(ax5.util.reduce(aarray, function (p, n) { | ||
return p * n; | ||
})); | ||
// 120 | ||
console.log(ax5.util.reduce({a: 1, b: 2}, function (p, n) { | ||
// If the "Object" is the first "p" value is "undefined". | ||
return parseInt(p | 0) + parseInt(n); | ||
return parseInt(p || 0) + parseInt(n); | ||
// This sentence is same to (return p=p+n;) | ||
})); | ||
// 3 | ||
> 3 | ||
``` | ||
- if the first 'p' value is object, 'p' will be undefined. So 'n' will point first index. | ||
- p : result variable. The return value is saved at 'p'. (initial value = 0 (undefined || 0)) | ||
- n : the 'value' value of 'first to last' located variable. (initail value = 1) | ||
- parseInt(n) : not necessiry in this example. but parsing is recommended to prevent errors. | ||
--- | ||
@@ -729,3 +311,3 @@ | ||
})); | ||
// -13 | ||
-13 | ||
``` | ||
@@ -735,3 +317,11 @@ --- | ||
## ax5.util.sum | ||
It returns the sum. The sum of all the values returned by the function. | ||
You can freely edit summation function by anonymous function when use. | ||
The summation function will add the values which corresponds to conditions of your summation function. | ||
- Argument 01 : Original Data. | ||
- Argument 02 : Anonymous function(summation function). | ||
- Usage : ax5.util.sum(Argument01, function(){ return }). | ||
- Output | ||
Argument : | ||
```js | ||
@@ -743,3 +333,6 @@ var arr = [ | ||
]; | ||
``` | ||
Usage 01 : | ||
```js | ||
var rs = ax5.util.sum(arr, function () { | ||
@@ -750,13 +343,33 @@ if(this.name == "122") { | ||
}); | ||
console.log(rs); // 19 | ||
``` | ||
Output 01 : | ||
```js | ||
console.log(rs); | ||
> 19 | ||
``` | ||
Usage 02 : | ||
```js | ||
console.log(ax5.util.sum(arr, 10, function () { | ||
return this.value; | ||
})); | ||
// 40 | ||
``` | ||
Output 02 : | ||
```js | ||
> 40 | ||
``` | ||
--- | ||
## ax5.util.avg | ||
It returns the average. The average of all the values returned by the function. | ||
You can freely edit averaging function by anonymous function when use. | ||
The averaging function will get average of values which correspond to conditions of your averaging function. | ||
- Argument 01 : Original Data. | ||
- Argument 02 : Anonymous function(averaging function). | ||
- Usage : ax5.util.avg(Argument01, function(){ return }). | ||
- Output | ||
Argument : | ||
```js | ||
@@ -768,7 +381,14 @@ var arr = [ | ||
]; | ||
``` | ||
Usage : | ||
```js | ||
var rs = ax5.util.avg(arr, function () { | ||
return this.value; | ||
}); | ||
``` | ||
Output : | ||
```js | ||
console.log(rs); // 10 | ||
@@ -780,38 +400,79 @@ ``` | ||
## ax5.util.first | ||
It returns the first element in the Array, or Object. However, it is faster to use Array in the "Array [0]" rather than using the "first" method. | ||
It returns the first element in Array or Object. However, to use Array in the "Array [0]" is faster than using the "first()" method. | ||
- Argument 01 : Original Data. | ||
- Usage : ax5.util.first(Argument01) | ||
- Output | ||
Argument : | ||
```js | ||
var _arr = ["ax5", "axisj"]; | ||
var _obj = {k: "ax5", z: "axisj"}; | ||
``` | ||
Usage : | ||
```js | ||
console.log(ax5.util.first(_arr)); | ||
// ax5 | ||
console.log(ax5.util.toJson(ax5.util.first(_obj))); | ||
// {"k": "ax5"} | ||
``` | ||
Output : | ||
```js | ||
> "ax5" | ||
> {"k": "ax5"} | ||
``` | ||
--- | ||
## ax5.util.last | ||
It returns the last element in the Array, or Object. | ||
It returns the last element in the or Object. | ||
Argument : | ||
```js | ||
var _arr = ["ax5", "axisj"]; | ||
var _obj = {k: "ax5", z: "axisj"}; | ||
``` | ||
Usage : | ||
```js | ||
console.log(ax5.util.last(_arr)); | ||
// axisj | ||
console.log(ax5.util.toJson(ax5.util.last(_obj))); | ||
// {"z": "axisj"} | ||
``` | ||
Output : | ||
```js | ||
> "axisj" | ||
> {"z": "axisj"} | ||
``` | ||
--- | ||
## ax5.util.deepCopy | ||
It returns deep copied Object. | ||
```js | ||
var obj = [ | ||
{name:"A", child:[{name:"a-1"}]}, | ||
{name:"B", child:[{name:"b-1"}], callBack: function(){ console.log('callBack'); }} | ||
]; | ||
var copiedObj = ax5.util.deepCopy(obj); | ||
obj[1].callBack(); | ||
copiedObj[1].callBack(); | ||
copiedObj[1].child[0].name = "c-1"; | ||
console.log(obj[1].child[0].name, copiedObj[1].child[0].name); | ||
``` | ||
# String | ||
## ax5.util.left | ||
Returns. Since the beginning of the string to the index, up to a certain character in a string from the beginning of the string. | ||
Return string from first index to finall index of original data. | ||
- Argument 01 : Original Data. | ||
- Argument 02 : finall index || finall character. | ||
- Usage : ax5.util.left(Argument01, Argument02) | ||
- Output | ||
```js | ||
console.log(ax5.util.left("abcd.efd", 3)); | ||
// abc | ||
> abc | ||
console.log(ax5.util.left("abcd.efd", ".")); | ||
// abcd | ||
> abcd | ||
``` | ||
@@ -821,8 +482,15 @@ --- | ||
## ax5.util.right | ||
Returns. Up from the end of the string index, up to a certain character in a string from the end of the string | ||
Return string from start index to end index of original data. The arrangement is not changing. | ||
- Argument 01 : Original Data. | ||
- Argument 02 : start index || start character. | ||
- Usage : ax5.util.left(Argument01, Argument02) | ||
- Output | ||
```js | ||
console.log(ax5.util.right("abcd.efd", 3)); | ||
// efd | ||
> efd | ||
console.log(ax5.util.right("abcd.efd", ".")); | ||
// efd | ||
> efd | ||
``` | ||
@@ -832,11 +500,12 @@ --- | ||
## ax5.util.camelCase | ||
It converts a string to "Camel Case". "a-b", "aB" will be the "aB". | ||
Converts a string to "Camel Case". "a-b", "aB" will be the "aB". | ||
```js | ||
console.log(ax5.util.camelCase("inner-width")); | ||
> innerWidth | ||
console.log(ax5.util.camelCase("innerWidth")); | ||
// innerWidth | ||
> innerWidth | ||
console.log(ax5.util.camelCase("camelCase")); | ||
// camelCase | ||
> camelCase | ||
console.log(ax5.util.camelCase("aBc")); | ||
// aBc | ||
> aBc | ||
``` | ||
@@ -846,10 +515,10 @@ --- | ||
## ax5.util.snakeCase | ||
It converts a string to "Snake Case". "aB" will be the "a-b". | ||
Converts a string to "Snake Case". "aB" will be the "a-b". | ||
```js | ||
console.log(ax5.util.snakeCase("inner-width")); | ||
// inner-width | ||
> inner-width | ||
console.log(ax5.util.snakeCase("camelCase")); | ||
// camel-case | ||
> camel-case | ||
console.log(ax5.util.snakeCase("aBc")); | ||
// a-bc | ||
> a-bc | ||
``` | ||
@@ -861,22 +530,32 @@ --- | ||
## ax5.util.number | ||
When the number covers the development, often it requires multiple steps. The syntax is very complex and it is difficult to maintain. "ax5.util.number" command to convert a number that were resolved by passing a JSON format. | ||
by this method, you can modify original data to variety number-like types. there are several options such as round, money, byte, abs. | ||
When the number covers the development, it often requires multiple steps. The syntax is very complex and it is difficult to maintain. "ax5.util.number" command to convert a number that were resolved by passing a JSON format. | ||
- Argument 01 : Original Data. | ||
- Option_round : set dcimal place. less than that place value will be rounded. | ||
- Option_money : convert to money type.(shoots comma for every third digit.) | ||
- Option_byte : convert to byte, KB, MB, GB. | ||
- Option_abs : set absolute value option. | ||
- Output | ||
```js | ||
console.log('round(1) : ' + ax5.util.number(123456789.678, {round: 1})); | ||
// round(1) : 123456789.7 | ||
> round(1) : 123456789.7 | ||
console.log('round(1) money() : ' | ||
+ ax5.util.number(123456789.678, {round: 1, money: true})); | ||
// round(1) money() : 123,456,789.7 | ||
> round(1) money() : 123,456,789.7 | ||
console.log('round(2) byte() : ' | ||
+ ax5.util.number(123456789.678, {round: 2, byte: true})); | ||
// round(2) byte() : 117.7MB | ||
> round(2) byte() : 117.7MB | ||
console.log('abs() round(2) money() : ' | ||
+ ax5.util.number(-123456789.678, {abs: true, round: 2, money: true})); | ||
// abs() round(2) money() : 123,456,789.68 | ||
> abs() round(2) money() : 123,456,789.68 | ||
console.log('abs() round(2) money() : ' | ||
+ ax5.util.number("A-1234~~56789.8~888PX", {abs: true, round: 2, money: true})); | ||
// abs() round(2) money() : 123,456,789.89 | ||
> abs() round(2) money() : 123,456,789.89 | ||
``` | ||
@@ -970,3 +649,9 @@ - - - | ||
## ax5.util.toArray | ||
"nodelist" or on the Array Like such "arguments", has properties such as "length", but you can not use functions defined in Array.prototype. With "toArray" because it is easy to convert an array. | ||
It converts 'Array-like objects' to 'Array' such as nodelist, arguments. 'Array-like objects' already have some useful properties such as "length", however they can not applied for functions defined in Array.prototype. So, if you want to use array functions, convert to Array by toArray() method. it's very easy to convert. | ||
- Argument 01 : Original Data. | ||
- Usgae : ax5.util.toArray(Argument); | ||
- Output | ||
Usage : | ||
```js | ||
@@ -979,2 +664,7 @@ function something() { | ||
``` | ||
Output : | ||
```js | ||
> ["A","X","I","S","J"] | ||
``` | ||
--- | ||
@@ -981,0 +671,0 @@ |
{ | ||
"name": "ax5core", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"authors": [ | ||
@@ -5,0 +5,0 @@ "ThomasJ <tom@axisj.com>" |
@@ -1,1 +0,1 @@ | ||
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};(function(){var e,t,n=this,r=window,o=document,i=(document.documentElement,/^(["'](\\.|[^"\\\n\r])*?["']|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/),a=/^-ms-/,u=/[\-_]([\da-z])/gi,s=/([A-Z])/g,f=/\./,l=/[-|+]?[\D]/gi,c=/\D/gi,p=new RegExp("([0-9])([0-9][0-9][0-9][,.])"),d=/&/g,h=/=/,g=/[ ]+/g,y={};y.guid=1,y.getGuid=function(){return y.guid++},y.info=e=function(){function n(e,n){return e={href:r.location.href,param:r.location.search,referrer:o.referrer,pathname:r.location.pathname,hostname:r.location.hostname,port:r.location.port},n=e.href.split(/[\?#]/),e.param=e.param.replace("?",""),e.url=n[0],e.href.search("#")>-1&&(e.hashdata=t.last(n)),n=null,e.baseUrl=t.left(e.href,"?").replace(e.pathname,""),e}function i(t,n,r){return e.errorMsg&&e.errorMsg[t]?{className:t,errorCode:n,methodName:r,msg:e.errorMsg[t][n]}:{className:t,errorCode:n,methodName:r}}var a="0.0.1",u="",s=function(){console.error(t.toArray(arguments).join(":"))},f={BACKSPACE:8,TAB:9,RETURN:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,HOME:36,END:35,PAGEUP:33,PAGEDOWN:34,INSERT:45,SPACE:32},l=[{label:"SUN"},{label:"MON"},{label:"TUE"},{label:"WED"},{label:"THU"},{label:"FRI"},{label:"SAT"}],c=function(e,t,n,r,o,i){return e=navigator.userAgent.toLowerCase(),t=-1!=e.search(/mobile/g),i,-1!=e.search(/iphone/g)?{name:"iphone",version:0,mobile:!0}:-1!=e.search(/ipad/g)?{name:"ipad",version:0,mobile:!0}:-1!=e.search(/android/g)?(r=/(android)[ \/]([\w.]+)/.exec(e)||[],i=r[2]||"0",{name:"android",version:i,mobile:t}):(n="",r=/(opr)[ \/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[],o=r[1]||"",i=r[2]||"0","msie"==o&&(o="ie"),{name:o,version:i,mobile:t})}(),p=!("undefined"==typeof window||"undefined"==typeof navigator||!r.document),d=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel",h={},g="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;return{errorMsg:h,version:a,baseUrl:u,onerror:s,eventKeys:f,weekNames:l,browser:c,isBrowser:p,supportTouch:g,wheelEnm:d,urlUtil:n,getError:i}}(),y.util=t=function(){function t(e,t){if(P(e))return[];var n,r=0,o=e.length,i=void 0===o||"function"==typeof e;if(i){for(n in e)if("undefined"!=typeof e[n]&&t.call(e[n],n,e[n])===!1)break}else for(;o>r&&("undefined"==typeof e[r]||t.call(e[r],r,e[r++])!==!1););return e}function m(e,t){if(P(e))return[];var n,r,o=0,i=e.length,a=[];if(A(e)){for(n in e)if("undefined"!=typeof e[n]){if(r=void 0,(r=t.call(e[n],n,e[n]))===!1)break;a.push(r)}}else for(;i>o;)if("undefined"!=typeof e[o]){if(r=void 0,(r=t.call(e[o],o,e[o++]))===!1)break;a.push(r)}return a}function b(e,t){if(P(e))return-1;var n,r=0,o=e.length;if(A(e))for(n in e){if("undefined"!=typeof e[n]&&j(t)&&t.call(e[n],n,e[n]))return n;if(e[n]==t)return n}else for(;o>r;){if("undefined"!=typeof e[r]&&j(t)&&t.call(e[r],r,e[r]))return r;if(e[r]==t)return r;r++}return-1}function v(e,t,n){var r,o,i;if(j(t)&&"undefined"==typeof n&&(n=t,t=0),"undefined"==typeof t&&(t=0),C(e)){for(r=0,o=e.length;o>r;r++)if("undefined"!=typeof e[r]){if((i=n.call(e[r],e[r]))===!1)break;"undefined"!=typeof i&&(t+=i)}return t}if(A(e)){for(r in e)if("undefined"!=typeof e[r]){if((i=n.call(e[r],e[r]))===!1)break;"undefined"!=typeof i&&(t+=i)}return t}return console.error("argument error : ax5.util.sum - use Array or Object"),t}function w(e,t,n){var r,o,i;if(j(t)&&"undefined"==typeof n&&(n=t,t=0),"undefined"==typeof t&&(t=0),C(e)){for(r=0,o=e.length;o>r;r++)if("undefined"!=typeof e[r]){if((i=n.call(e[r],e[r]))===!1)break;"undefined"!=typeof i&&(t+=i)}return t/o}if(A(e)){for(r in e)if("undefined"!=typeof e[r]){if((i=n.call(e[r],e[r]))===!1)break;"undefined"!=typeof i&&(t+=i)}return t/o}return console.error("argument error : ax5.util.sum - use Array or Object"),t}function x(e,t){var r,o,i;if(C(e)){for(r=0,o=e.length,i=e[r];o-1>r&&("undefined"==typeof e[r]||(i=t.call(n,i,e[++r]))!==!1););return i}if(A(e)){for(r in e)if("undefined"!=typeof e[r]&&(i=t.call(n,i,e[r]))===!1)break;return i}return console.error("argument error : ax5.util.reduce - use Array or Object"),null}function T(e,t){for(var r=e.length-1,o=e[r];r>0&&("undefined"==typeof e[r]||(o=t.call(n,o,e[--r]))!==!1););return o}function E(e,t){if(P(e))return[];var n,r,o=0,i=e.length,a=[];if(A(e))for(n in e)"undefined"!=typeof e[n]&&(r=t.call(e[n],n,e[n]))&&a.push(e[n]);else for(;i>o;)"undefined"!=typeof e[o]&&((r=t.call(e[o],o,e[o]))&&a.push(e[o]),o++);return a}function S(e){var n="";if(y.util.isArray(e)){var r=0,o=e.length;for(n+="[";o>r;r++)r>0&&(n+=","),n+=S(e[r]);n+="]"}else if(y.util.isObject(e)){n+="{";var i=[];t(e,function(e,t){i.push('"'+e+'": '+S(t))}),n+=i.join(", "),n+="}"}else y.util.isString(e)?n='"'+e+'"':y.util.isNumber(e)?n=e:y.util.isUndefined(e)?n="undefined":y.util.isFunction(e)&&(n='"{Function}"');return n}function D(e,t){if(!t&&!i.test(e))return{error:500,msg:"syntax error"};try{return new Function("","return "+e)()}catch(n){return{error:500,msg:"syntax error"}}}function k(e){var t;return null!=e&&e==e.window?t="window":e&&1==e.nodeType?t="element":e&&11==e.nodeType?t="fragment":"undefined"==typeof e?t="undefined":"[object Object]"==le.call(e)?t="object":"[object Array]"==le.call(e)?t="array":"[object String]"==le.call(e)?t="string":"[object Number]"==le.call(e)?t="number":"[object NodeList]"==le.call(e)?t="nodelist":"function"==typeof e&&(t="function"),t}function N(e){return null!=e&&e==e.window}function M(e){return!(!e||1!=e.nodeType&&11!=e.nodeType)}function A(e){return"[object Object]"==le.call(e)}function C(e){return"[object Array]"==le.call(e)}function j(e){return"function"==typeof e}function O(e){return"[object String]"==le.call(e)}function R(e){return"[object Number]"==le.call(e)}function U(e){return"[object NodeList]"==le.call(e)||e&&e[0]&&1==e[0].nodeType}function F(e){return"undefined"==typeof e}function P(e){return"undefined"==typeof e||null===e||""===e}function I(e){return e instanceof Date&&!isNaN(e.valueOf())}function _(e){var t=!1;if(e){if(e instanceof Date&&!isNaN(e.valueOf()))t=!0;else if(e=e.replace(/\D/g,""),e.length>7){var n=e.substr(4,2),r=e.substr(6,2);e=ee(e),e.getMonth()==n-1&&e.getDate()==r&&(t=!0)}}else;return t}function $(e){if(A(e)){var t=Object.keys(e),n={};return n[t[0]]=e[t[0]],n}return C(e)?e[0]:void console.error("ax5.util.object.first","argument type error")}function z(e){if(A(e)){var t=Object.keys(e),n={};return n[t[t.length-1]]=e[t[t.length-1]],n}return C(e)?e[e.length-1]:void console.error("ax5.util.object.last","argument type error")}function W(e,t,n,r){var i;return"number"==typeof n&&(i=new Date,i.setDate(i.getDate()+n)),r=r||{},o.cookie=[escape(e),"=",escape(t),i?"; expires="+i.toUTCString():"",r.path?"; path="+r.path:"",r.domain?"; domain="+r.domain:"",r.secure?"; secure":""].join("")}function Y(e){for(var t=e+"=",n=o.cookie.split(";"),r=0,i=n.length;i>r;r++){for(var a=n[r];" "==a.charAt(0);)a=a.substring(1);if(-1!=a.indexOf(t))return unescape(a.substring(t.length,a.length))}return""}function H(e){return r.alert(S(e)),e}function B(e,t){return"undefined"==typeof e||"undefined"==typeof t?"":O(t)?e.indexOf(t)>-1?e.substr(0,e.indexOf(t)):e:R(t)?e.substr(0,t):""}function L(e,t){return"undefined"==typeof e||"undefined"==typeof t?"":(e=""+e,O(t)?e.lastIndexOf(t)>-1?e.substr(e.lastIndexOf(t)+1):e:R(t)?e.substr(e.length-t):"")}function V(e){return e.replace(a,"ms-").replace(u,function(e,t){return t.toUpperCase()})}function q(e){return V(e).replace(s,function(e,t){return"-"+t.toLowerCase()})}function G(e,n){var r,o=(""+e).split(f),i=Number(o[0])<0||"-0"==o[0],a=0;return o[0]=o[0].replace(l,""),o[1]?(o[1]=o[1].replace(c,""),a=Number(o[0]+"."+o[1])||0):a=Number(o[0])||0,r=i?-a:a,t(n,function(e,t){"round"==e&&(r=R(t)?0>t?+(Math.round(r+"e-"+Math.abs(t))+"e+"+Math.abs(t)):+(Math.round(r+"e+"+t)+"e-"+t):Math.round(r)),"floor"==e&&(r=Math.floor(r)),"ceil"==e?r=Math.ceil(r):"money"==e?r=function(e){var t=""+e;if(isNaN(t)||""==t)return"";var n=t.split(".");n[0]+=".";do n[0]=n[0].replace(p,"$1,$2");while(p.test(n[0]));return n.length>1?n.join(""):n[0].split(".")[0]}(r):"abs"==e?r=Math.abs(Number(r)):"byte"==e&&(r=function(e){e=Number(r);var t="KB",n=e/1024;return n/1024>1&&(t="MB",n/=1024),n/1024>1&&(t="GB",n/=1024),G(n,{round:1})+t}(r))}),r}function J(e){return"undefined"!=typeof e.length?Array.prototype.slice.call(e):[]}function K(e,t){var n=t.length,r=e.length,o=0;if("number"==typeof n)for(;n>o;o++)e[r++]=t[o];else for(;void 0!==t[o];)e[r++]=t[o++];return e.length=r,e}function Q(e,n){var r;return O(e)&&"undefined"!=typeof n&&"param"==n?e:O(e)&&"undefined"!=typeof n&&"object"==n||O(e)&&"undefined"==typeof n?(r={},t(e.split(d),function(){var e=this.split(h);r[e[0]]?(O(r[e[0]])&&(r[e[0]]=[r[e[0]]]),r[e[0]].push(e[1])):r[e[0]]=e[1]}),r):(r=[],t(e,function(e,t){r.push(e+"="+escape(t))}),r.join("&"))}function X(){y.info.onerror.apply(this,arguments)}function Z(e,t,n,r,o,i){var a,u;return u=new Date,"undefined"==typeof r&&(r=23),"undefined"==typeof o&&(o=59),a=new Date(Date.UTC(e,t,n||1,r,o,i||0)),0==t&&1==n&&a.getUTCHours()+a.getTimezoneOffset()/60<0?a.setUTCHours(0):a.setUTCHours(a.getUTCHours()+a.getTimezoneOffset()/60),a}function ee(t,n){var r,o,i,a,u,s,f,l,c,p;if(O(t))if(0==t.length)t=new Date;else if(t.length>15)s=t.split(/ /g),c=s[0].split(/\D/g),r=c[0],o=parseFloat(c[1]),i=parseFloat(c[2]),l=s[1]||"09:00",f=l.substring(0,5).split(":"),a=parseFloat(f[0]),u=parseFloat(f[1]),("AM"===L(l,2)||"PM"===L(l,2))&&(a+=12),t=Z(r,o-1,i,a,u);else if(14==t.length)p=t.replace(/\D/g,""),t=Z(p.substr(0,4),p.substr(4,2)-1,G(p.substr(6,2)),G(p.substr(8,2)),G(p.substr(10,2)),G(p.substr(12,2)));else if(t.length>7)p=t.replace(/\D/g,""),t=Z(p.substr(0,4),p.substr(4,2)-1,G(p.substr(6,2)));else if(t.length>4)p=t.replace(/\D/g,""),t=Z(p.substr(0,4),p.substr(4,2)-1,1);else{if(t.length>2)return p=t.replace(/\D/g,""),Z(p.substr(0,4),p.substr(4,2)-1,1);t=new Date}return"undefined"==typeof n?t:(n.add&&(t=function(e,t){var n,r,o,i,a=864e5;return"undefined"!=typeof t.d?e.setTime(e.getTime()+t.d*a):"undefined"!=typeof t.m?(n=e.getFullYear(),r=e.getMonth(),o=e.getDate(),n+=parseInt(t.m/12),r+=t.m%12,i=re(n,r),o>i&&(o=i),e=new Date(n,r,o,12)):"undefined"!=typeof t.y?e.setTime(e.getTime()+365*t.y*a):e.setTime(e.getTime()+t.y*a),e}(new Date(t),n.add)),n["return"]?function(){var r,o,i,a,u,s,f,l=n["return"];r=t.getUTCFullYear(),o=oe(t.getMonth()+1,2),i=oe(t.getDate(),2),a=oe(t.getHours(),2),u=oe(t.getMinutes(),2),s=oe(t.getSeconds(),2),f=t.getDay();var c=/[^y]*(yyyy)[^y]*/gi;c.exec(l);var p=RegExp.$1,d=/[^m]*(MM)[^m]*/g;d.exec(l);var h=RegExp.$1,g=/[^d]*(dd)[^d]*/gi;g.exec(l);var y=RegExp.$1,m=/[^h]*(hh)[^h]*/gi;m.exec(l);var b=RegExp.$1,v=/[^m]*(mm)[^i]*/g;v.exec(l);var w=RegExp.$1,x=/[^s]*(ss)[^s]*/gi;x.exec(l);var T=RegExp.$1,E=/[^d]*(dw)[^w]*/gi;E.exec(l);var S=RegExp.$1;return"yyyy"===p&&(l=l.replace(p,L(r,p.length))),"MM"===h&&(1==h.length&&(o=t.getMonth()+1),l=l.replace(h,o)),"dd"===y&&(1==y.length&&(i=t.getDate()),l=l.replace(y,i)),"hh"===b&&(l=l.replace(b,a)),"mm"===w&&(l=l.replace(w,u)),"ss"===T&&(l=l.replace(T,s)),"dw"==S&&(l=l.replace(S,e.weekNames[f].label)),l}():t)}function te(e,t){function n(e){return Math.floor(e.getTime()/a)*a}var r,o,i=ee(e),a=864e5,u=new Date;return"undefined"==typeof t?r=G((n(i)-n(u))/a,{floor:!0}):(r=G((n(i)-n(u))/a,{floor:!0}),t.today&&(u=ee(t.today),r=G((n(i)-n(u))/a,{floor:!0})),t.thisYear&&(o=new Date(u.getFullYear(),i.getMonth(),i.getDate()),r=G((n(o)-n(u))/a,{floor:!0}),0>r&&(o=new Date(u.getFullYear()+1,i.getMonth(),i.getDate()),r=G((n(o)-n(u))/a,{floor:!0}))),t.age&&(o=new Date(u.getFullYear(),i.getMonth(),i.getDate()),r=o.getFullYear()-i.getFullYear()),r)}function ne(e){var t=ee(e);return{year:t.getFullYear(),month:t.getMonth()+1,count:parseInt(t.getDate()/7+1)}}function re(e,t){return 3==t||5==t||8==t||10==t?30:1==t?e%4==0&&e%100!=0||e%400==0?29:28:31}function oe(e,t,n,r){var o=e.toString(r||10);return ie(n||"0",t-o.length)+o}function ie(e,t){return 1>t?"":new Array(t+1).join(e)}function ae(e,t){if(e)for(;function(){var n=!0;if("undefined"==typeof t)e=e.parentNode?e.parentNode:!1;else if(j(t))n=t(e);else if(A(t))for(var r in t)if("tagname"===r){if(e.tagName.toLocaleLowerCase()!=t[r]){n=!1;break}}else if("clazz"===r||"class_name"===r){if(!("className"in e)){n=!1;break}for(var o=e.className.split(g),i=!1,a=0;a<o.length;a++)if(o[a]==t[r]){i=!0;break}n=i}else{if(!e.getAttribute){n=!1;break}if(e.getAttribute(r)!=t[r]){n=!1;break}}return!n}();){if(!e.parentNode||!e.parentNode.parentNode){e=!1;break}e=e.parentNode}return e}function ue(e){var t=/\D?(\d+)([a-zA-Z%]*)/i,n=(""+e).match(t),r=n[2]||"px";return n[1]+r}function se(e){var t;if(A(e)){t="";for(var n in e)t+=n+":"+e[n]+";";return t}if(O(e)){t={};var r=e.split(/[ ]*;[ ]*/g);return r.forEach(function(e){if(""!==(e=e.trim())){var n=e.split(/[ ]*:[ ]*/g);t[n[0]]=n[1]}}),t}}function fe(e){if(!e)var e=window.event;return e.cancelBubble=!0,e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),!1}var le=Object.prototype.toString,ce=function(){var e={textRange:{selectAll:function(e,t,n){},arr:function(e,t,n){t.moveStart("character",n[0]),t.collapse(),t.moveEnd("character",n[1])},start:function(e,t,n){t.moveStart("character",0),t.collapse()},end:function(e,t,n){t.moveStart("character",t.text.length),t.collapse()}},range:{selectAll:function(e,t,n){t.selectNodeContents(e)},arr:function(e,t,n){A(n[0])?(t.setStart(n[0].node,n[0].offset),t.setEnd(n[1].node,n[1].offset)):(t.setStart(e.firstChild,n[0]),t.setEnd(e.firstChild,n[1]))},start:function(e,t,n){t.selectNodeContents(e),t.collapse(!0)},end:function(e,t,n){t.selectNodeContents(e),t.collapse(!1)}}};return function(t,n){var r,i,a;if(t instanceof jQuery&&(t=t.get(0)),t){if(o.body.createTextRange?(r=document.body.createTextRange(),r.moveToElementText(t),i="textRange"):window.getSelection&&(a=window.getSelection(),r=document.createRange(),i="range"),"undefined"==typeof n)e[i].selectAll.call(this,t,r,n);else if(C(n))e[i].arr.call(this,t,r,n);else for(var u in e[i])if(n==u){e[i][u].call(this,t,r,n);break}o.body.createTextRange?(r.select(),t.focus()):window.getSelection&&(t.focus(),a.removeAllRanges(),a.addRange(r))}}}(),pe=function(e,t,n){var r,o,i=function(){var i=J(arguments);o&&clearTimeout(o),r?(r&&clearTimeout(r),r=setTimeout(function(t){e.apply(this,t)}.bind(this,i),t)):r=setTimeout(function(t){e.apply(this,t)}.bind(this,i),n?0:t),o=setTimeout(function(){clearTimeout(r),r=null},t)};return i.cancel=function(){clearTimeout(r),clearTimeout(o),r=null},i};return{alert:H,each:t,map:m,search:b,reduce:x,reduceRight:T,filter:E,sum:v,avg:w,toJson:S,parseJson:D,first:$,last:z,left:B,right:L,getType:k,isWindow:N,isElement:M,isObject:A,isArray:C,isFunction:j,isString:O,isNumber:R,isNodelist:U,isUndefined:F,isNothing:P,setCookie:W,getCookie:Y,camelCase:V,snakeCase:q,number:G,toArray:J,merge:K,param:Q,error:X,date:ee,dday:te,daysOfMonth:re,weeksOfMonth:ne,setDigit:oe,times:ie,findParentNode:ae,cssNumber:ue,css:se,isDate:I,isDateFormat:_,stopEvent:fe,selectRange:ce,debounce:pe}}(),n.ax5=function(){return y}()}).call(window),ax5.info.errorMsg.ax5dialog={501:"Duplicate call error"},ax5.info.errorMsg.ax5picker={401:"Can not find target element",402:"Can not find boundID",501:"Can not find content key"},ax5.info.errorMsg["single-uploader"]={460:"There are no files to be uploaded.",461:"There is no uploaded files."},ax5.info.errorMsg.ax5calendar={401:"Can not find target element"},ax5.info.errorMsg.ax5formatter={401:"Can not find target element",402:"Can not find boundID",501:"Can not find pattern"},ax5.info.errorMsg.ax5menu={501:"Can not find menu item"},ax5.info.errorMsg.ax5select={401:"Can not find target element",402:"Can not find boundID",501:"Can not find option"},ax5.info.errorMsg.ax5combobox={401:"Can not find target element",402:"Can not find boundID",501:"Can not find option"},function(){var e=/^\s*|\s*$/g;Object.keys||(Object.keys=function(){var e=Object.prototype.hasOwnProperty,t=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],r=n.length;return function(o){if("object"!==("undefined"==typeof o?"undefined":_typeof(o))&&("function"!=typeof o||null===o))throw new TypeError("type err");var i,a,u=[];for(i in o)e.call(o,i)&&u.push(i);if(t)for(a=0;r>a;a++)e.call(o,n[a])&&u.push(n[a]);return u}}()),Array.prototype.forEach||(Array.prototype.forEach=function(e){if(void 0===this||null===this)throw TypeError();var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw TypeError();var r,o=arguments[1];for(r=0;n>r;r++)r in t&&e.call(o,t[r],r,t)}),Function.prototype.bind||(Function.prototype.bind=function(e){function t(){}if("function"!=typeof this)throw TypeError("function");var n=[].slice,r=n.call(arguments,1),o=this,i=function(){return o.apply(this instanceof t?this:e,r.concat(n.call(arguments)))};return t.prototype=o.prototype,i.prototype=new t,i}),function(){if(!document.querySelectorAll&&!document.querySelector&&document.createStyleSheet){var e=document.createStyleSheet(),t=function(t,n){var r,o=document.all,i=o.length,a=[];for(e.addRule(t,"foo:bar"),r=0;i>r&&!("bar"===o[r].currentStyle.foo&&(a.push(o[r]),a.length>n));r+=1);return e.removeRule(0),a};document.querySelectorAll=function(e){return t(e,1/0)},document.querySelector=function(e){return t(e,1)[0]||null}}}(),String.prototype.trim||!function(){String.prototype.trim=function(){return this.replace(e,"")}}(),window.JSON||(window.JSON={parse:function(e){return new Function("","return "+e)()},stringify:function(){var e,t=/["]/g;return e=function(n){var r,o,i;switch(r="undefined"==typeof n?"undefined":_typeof(n)){case"string":return'"'+n.replace(t,'\\"')+'"';case"number":case"boolean":return n.toString();case"undefined":return"undefined";case"function":return'""';case"object":if(!n)return"null";if(r="",n.splice){for(o=0,i=n.length;i>o;o++)r+=","+e(n[o]);return"["+r.substr(1)+"]"}for(o in n)n.hasOwnProperty(o)&&void 0!==n[o]&&"function"!=typeof n[o]&&(r+=',"'+o+'":'+e(n[o]));return"{"+r.substr(1)+"}"}}}()}),function(){if(!document.documentMode||document.documentMode>=9)return!1;var e=Array.prototype.splice;Array.prototype.splice=function(){var t=Array.prototype.slice.call(arguments);return"undefined"==typeof t[1]&&(t[1]=this.length-t[0]),e.apply(this,t)}}(),function(){var e=Array.prototype.slice;try{e.call(document.documentElement)}catch(t){Array.prototype.slice=function(t,n){if(n="undefined"!=typeof n?n:this.length,"[object Array]"===Object.prototype.toString.call(this))return e.call(this,t,n);var r,o,i=[],a=this.length,u=t||0;u=u>=0?u:Math.max(0,a+u);var s="number"==typeof n?Math.min(n,a):a;if(0>n&&(s=a+n),o=s-u,o>0)if(i=new Array(o),this.charAt)for(r=0;o>r;r++)i[r]=this.charAt(u+r);else for(r=0;o>r;r++)i[r]=this[u+r];return i}}}(),function(e){for(var t,n,r={},o=function(){},i="memory".split(","),a="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");t=i.pop();)e[t]=e[t]||r;for(;n=a.pop();)e[n]=e[n]||o}(window.console||{});var t=document.getElementsByTagName("html")[0];document.getElementsByTagName("body")[0];window.innerWidth||(window.innerWidth=t.clientWidth),window.innerHeight||(window.innerHeight=t.clientHeight),window.scrollX||(window.scrollX=window.pageXOffset||t.scrollLeft),window.scrollY||(window.scrollY=window.pageYOffset||t.scrollTop)}.call(window),ax5.ui=function(e){function t(){this.config={},this.name="root",this.setConfig=function(e,t){return jQuery.extend(!0,this.config,e,!0),("undefined"==typeof t||t===!0)&&this.init(),this},this.init=function(){console.log(this.config)},this.bindWindowResize=function(e){setTimeout(function(){jQuery(window).resize(function(){this.bindWindowResize__&&clearTimeout(this.bindWindowResize__),this.bindWindowResize__=setTimeout(function(){e.call(this)}.bind(this),10)}.bind(this))}.bind(this),100)},this.stopEvent=function(e){return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,!1},this.toString=function(){return this.name+"@"+this.version},this.main=function(){}.apply(this,arguments)}return{root:t}}(ax5),function(e,t){t(e.mustache={})}(window.ax5,function(e){function t(e){return"function"==typeof e}function n(e){return g(e)?"array":"undefined"==typeof e?"undefined":_typeof(e)}function r(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(e,t){return null!=e&&"object"===("undefined"==typeof e?"undefined":_typeof(e))&&t in e}function i(e,t){return y.call(e,t)}function a(e){return!i(m,e)}function u(e){return String(e).replace(/[&<>"'\/]/g,function(e){return b[e]})}function s(t,n){function o(){if(m&&!b)for(;y.length;)delete h[y.pop()];else y=[];m=!1,b=!1}function i(e){if("string"==typeof e&&(e=e.split(w,2)),!g(e)||2!==e.length)throw new Error("Invalid tags: "+e);u=new RegExp(r(e[0])+"\\s*"),s=new RegExp("\\s*"+r(e[1])),p=new RegExp("\\s*"+r("}"+e[1]))}if(!t)return[];var u,s,p,d=[],h=[],y=[],m=!1,b=!1;i(n||e.tags);for(var S,D,k,N,M,A,C=new c(t);!C.eos();){if(S=C.pos,k=C.scanUntil(u))for(var j=0,O=k.length;O>j;++j)N=k.charAt(j),a(N)?y.push(h.length):b=!0,h.push(["text",N,S,S+1]),S+=1,"\n"===N&&o();if(!C.scan(u))break;if(m=!0,D=C.scan(E)||"name",C.scan(v),"="===D?(k=C.scanUntil(x),C.scan(x),C.scanUntil(s)):"{"===D?(k=C.scanUntil(p),C.scan(T),C.scanUntil(s),D="&"):k=C.scanUntil(s),!C.scan(s))throw new Error("Unclosed tag at "+C.pos);if(M=[D,k,S,C.pos],h.push(M),"#"===D||"^"===D)d.push(M);else if("/"===D){if(A=d.pop(),!A)throw new Error('Unopened section "'+k+'" at '+S);if(A[1]!==k)throw new Error('Unclosed section "'+A[1]+'" at '+S)}else"name"===D||"{"===D||"&"===D?b=!0:"="===D&&i(k)}if(A=d.pop())throw new Error('Unclosed section "'+A[1]+'" at '+C.pos);return l(f(h))}function f(e){for(var t,n,r=[],o=0,i=e.length;i>o;++o)t=e[o],t&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}function l(e){for(var t,n,r=[],o=r,i=[],a=0,u=e.length;u>a;++a)switch(t=e[a],t[0]){case"#":case"^":o.push(t),i.push(t),o=t[4]=[];break;case"/":n=i.pop(),n[5]=t[2],o=i.length>0?i[i.length-1][4]:r;break;default:o.push(t)}return r}function c(e){this.string=e,this.tail=e,this.pos=0}function p(e,t){this.view=e,this.cache={".":this.view,"@each":function(){var e=[];for(var t in this)e.push({"@key":t,"@value":this[t]});return e}},this.parent=t}function d(){this.cache={}}var h=Object.prototype.toString,g=Array.isArray||function(e){return"[object Array]"===h.call(e)},y=RegExp.prototype.test,m=/\S/,b={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},v=/\s*/,w=/\s+/,x=/\s*=/,T=/\s*\}/,E=/#|\^|\/|>|\{|&|=|!/;c.prototype.eos=function(){return""===this.tail},c.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},c.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},p.prototype.push=function(e){return new p(e,this)},p.prototype.lookup=function(e){var n,r=this.cache;if(r.hasOwnProperty(e))n=r[e];else{for(var i,a,u=this,s=!1;u;){if(e.indexOf(".")>0)for(n=u.view,i=e.split("."),a=0;null!=n&&a<i.length;)a===i.length-1&&(s=o(n,i[a])),n=n[i[a++]];else n=u.view[e],s=o(u.view,e);if(s)break;u=u.parent}r[e]=n}return t(n)&&(n=n.call(this.view)),n},d.prototype.clearCache=function(){this.cache={}},d.prototype.parse=function(e,t){var n=this.cache,r=n[e];return null==r&&(r=n[e]=s(e,t)),r},d.prototype.render=function(e,t,n){var r=this.parse(e),o=t instanceof p?t:new p(t);return this.renderTokens(r,o,n,e)},d.prototype.renderTokens=function(e,t,n,r){for(var o,i,a,u="",s=0,f=e.length;f>s;++s)a=void 0,o=e[s],i=o[0],"#"===i?a=this.renderSection(o,t,n,r):"^"===i?a=this.renderInverted(o,t,n,r):">"===i?a=this.renderPartial(o,t,n,r):"&"===i?a=this.unescapedValue(o,t):"name"===i?a=this.escapedValue(o,t):"text"===i&&(a=this.rawValue(o)),void 0!==a&&(u+=a);return u},d.prototype.renderSection=function(e,n,r,o){function i(e){return a.render(e,n,r)}var a=this,u="",s=n.lookup(e[1]);if(s){if(g(s))for(var f=0,l=s.length;l>f;++f)s[f]["@i"]=f,s[f]["@first"]=0===f,u+=this.renderTokens(e[4],n.push(s[f]),r,o);else if("object"===("undefined"==typeof s?"undefined":_typeof(s))||"string"==typeof s||"number"==typeof s)u+=this.renderTokens(e[4],n.push(s),r,o);else if(t(s)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");s=s.call(n.view,o.slice(e[3],e[5]),i),null!=s&&(u+=s)}else u+=this.renderTokens(e[4],n,r,o);return u}},d.prototype.renderInverted=function(e,t,n,r){var o=t.lookup(e[1]);return!o||g(o)&&0===o.length?this.renderTokens(e[4],t,n,r):void 0},d.prototype.renderPartial=function(e,n,r){if(r){var o=t(r)?r(e[1]):r[e[1]];return null!=o?this.renderTokens(this.parse(o),n,r,o):void 0}},d.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);return null!=n?n:void 0},d.prototype.escapedValue=function(t,n){var r=n.lookup(t[1]);return null!=r?e.escape(r):void 0},d.prototype.rawValue=function(e){return e[1]},e.name="mustache.js",e.version="2.1.3",e.tags=["{{","}}"];var S=new d;e.clearCache=function(){return S.clearCache()},e.parse=function(e,t){return S.parse(e,t)},e.render=function(e,t,r){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+n(e)+'" was given as the first argument for mustache#render(template, view, partials)');return S.render(e,t,r)},e.to_html=function(n,r,o,i){var a=e.render(n,r,o);return t(i)?void i(a):a},e.escape=u,e.Scanner=c,e.Context=p,e.Writer=d}); | ||
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};(function(){var e,t,n=this,r=window,o=document,i=(document.documentElement,/^(["'](\\.|[^"\\\n\r])*?["']|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/),a=/^-ms-/,u=/[\-_]([\da-z])/gi,s=/([A-Z])/g,f=/\./,l=/[-|+]?[\D]/gi,c=/\D/gi,p=new RegExp("([0-9])([0-9][0-9][0-9][,.])"),d=/&/g,h=/=/,g=/[ ]+/g,y={};y.guid=1,y.getGuid=function(){return y.guid++},y.info=e=function(){function n(e,n){return e={href:r.location.href,param:r.location.search,referrer:o.referrer,pathname:r.location.pathname,hostname:r.location.hostname,port:r.location.port},n=e.href.split(/[\?#]/),e.param=e.param.replace("?",""),e.url=n[0],e.href.search("#")>-1&&(e.hashdata=t.last(n)),n=null,e.baseUrl=t.left(e.href,"?").replace(e.pathname,""),e}function i(t,n,r){return e.errorMsg&&e.errorMsg[t]?{className:t,errorCode:n,methodName:r,msg:e.errorMsg[t][n]}:{className:t,errorCode:n,methodName:r}}var a="0.0.1",u="",s=function(){console.error(t.toArray(arguments).join(":"))},f={BACKSPACE:8,TAB:9,RETURN:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,HOME:36,END:35,PAGEUP:33,PAGEDOWN:34,INSERT:45,SPACE:32},l=[{label:"SUN"},{label:"MON"},{label:"TUE"},{label:"WED"},{label:"THU"},{label:"FRI"},{label:"SAT"}],c=function(e,t,n,r,o,i){return e=navigator.userAgent.toLowerCase(),t=-1!=e.search(/mobile/g),i,-1!=e.search(/iphone/g)?{name:"iphone",version:0,mobile:!0}:-1!=e.search(/ipad/g)?{name:"ipad",version:0,mobile:!0}:-1!=e.search(/android/g)?(r=/(android)[ \/]([\w.]+)/.exec(e)||[],i=r[2]||"0",{name:"android",version:i,mobile:t}):(n="",r=/(opr)[ \/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[],o=r[1]||"",i=r[2]||"0","msie"==o&&(o="ie"),{name:o,version:i,mobile:t})}(),p=!("undefined"==typeof window||"undefined"==typeof navigator||!r.document),d=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel",h={},g="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;return{errorMsg:h,version:a,baseUrl:u,onerror:s,eventKeys:f,weekNames:l,browser:c,isBrowser:p,supportTouch:g,wheelEnm:d,urlUtil:n,getError:i}}(),y.util=t=function(){function m(e,t){if(I(e))return[];var n,r=0,o=e.length,i=void 0===o||"function"==typeof e;if(i){for(n in e)if("undefined"!=typeof e[n]&&t.call(e[n],n,e[n])===!1)break}else for(;o>r&&("undefined"==typeof e[r]||t.call(e[r],r,e[r++])!==!1););return e}function b(e,t){if(I(e))return[];var n,r,o=0,i=e.length,a=[];if(C(e)){for(n in e)if("undefined"!=typeof e[n]){if(r=void 0,(r=t.call(e[n],n,e[n]))===!1)break;a.push(r)}}else for(;i>o;)if("undefined"!=typeof e[o]){if(r=void 0,(r=t.call(e[o],o,e[o++]))===!1)break;a.push(r)}return a}function v(e,t){if(I(e))return-1;var n,r=0,o=e.length;if(C(e))for(n in e){if("undefined"!=typeof e[n]&&O(t)&&t.call(e[n],n,e[n]))return n;if(e[n]==t)return n}else for(;o>r;){if("undefined"!=typeof e[r]&&O(t)&&t.call(e[r],r,e[r]))return r;if(e[r]==t)return r;r++}return-1}function w(e,t,n){var r,o,i;if(O(t)&&"undefined"==typeof n&&(n=t,t=0),"undefined"==typeof t&&(t=0),M(e)){for(r=0,o=e.length;o>r;r++)if("undefined"!=typeof e[r]){if((i=n.call(e[r],e[r]))===!1)break;"undefined"!=typeof i&&(t+=i)}return t}if(C(e)){for(r in e)if("undefined"!=typeof e[r]){if((i=n.call(e[r],e[r]))===!1)break;"undefined"!=typeof i&&(t+=i)}return t}return console.error("argument error : ax5.util.sum - use Array or Object"),t}function x(e,t,n){var r,o,i;if(O(t)&&"undefined"==typeof n&&(n=t,t=0),"undefined"==typeof t&&(t=0),M(e)){for(r=0,o=e.length;o>r;r++)if("undefined"!=typeof e[r]){if((i=n.call(e[r],e[r]))===!1)break;"undefined"!=typeof i&&(t+=i)}return t/o}if(C(e)){for(r in e)if("undefined"!=typeof e[r]){if((i=n.call(e[r],e[r]))===!1)break;"undefined"!=typeof i&&(t+=i)}return t/o}return console.error("argument error : ax5.util.sum - use Array or Object"),t}function T(e,t){var r,o,i;if(M(e)){for(r=0,o=e.length,i=e[r];o-1>r&&("undefined"==typeof e[r]||(i=t.call(n,i,e[++r]))!==!1););return i}if(C(e)){for(r in e)if("undefined"!=typeof e[r]&&(i=t.call(n,i,e[r]))===!1)break;return i}return console.error("argument error : ax5.util.reduce - use Array or Object"),null}function E(e,t){for(var r=e.length-1,o=e[r];r>0&&("undefined"==typeof e[r]||(o=t.call(n,o,e[--r]))!==!1););return o}function S(e,t){if(I(e))return[];var n,r,o=0,i=e.length,a=[];if(C(e))for(n in e)"undefined"!=typeof e[n]&&(r=t.call(e[n],n,e[n]))&&a.push(e[n]);else for(;i>o;)"undefined"!=typeof e[o]&&((r=t.call(e[o],o,e[o]))&&a.push(e[o]),o++);return a}function D(e){var t="";if(y.util.isArray(e)){var n=0,r=e.length;for(t+="[";r>n;n++)n>0&&(t+=","),t+=D(e[n]);t+="]"}else if(y.util.isObject(e)){t+="{";var o=[];m(e,function(e,t){o.push('"'+e+'": '+D(t))}),t+=o.join(", "),t+="}"}else y.util.isString(e)?t='"'+e+'"':y.util.isNumber(e)?t=e:y.util.isUndefined(e)?t="undefined":y.util.isFunction(e)&&(t='"{Function}"');return t}function k(e,t){if(!t&&!i.test(e))return{error:500,msg:"syntax error"};try{return new Function("","return "+e)()}catch(n){return{error:500,msg:"syntax error"}}}function N(e){var t;return null!=e&&e==e.window?t="window":e&&1==e.nodeType?t="element":e&&11==e.nodeType?t="fragment":"undefined"==typeof e?t="undefined":"[object Object]"==pe.call(e)?t="object":"[object Array]"==pe.call(e)?t="array":"[object String]"==pe.call(e)?t="string":"[object Number]"==pe.call(e)?t="number":"[object NodeList]"==pe.call(e)?t="nodelist":"function"==typeof e&&(t="function"),t}function A(e){return null!=e&&e==e.window}function j(e){return!(!e||1!=e.nodeType&&11!=e.nodeType)}function C(e){return"[object Object]"==pe.call(e)}function M(e){return"[object Array]"==pe.call(e)}function O(e){return"function"==typeof e}function R(e){return"[object String]"==pe.call(e)}function U(e){return"[object Number]"==pe.call(e)}function F(e){return"[object NodeList]"==pe.call(e)||e&&e[0]&&1==e[0].nodeType}function P(e){return"undefined"==typeof e}function I(e){return"undefined"==typeof e||null===e||""===e}function _(e){return e instanceof Date&&!isNaN(e.valueOf())}function $(e){var t=!1;if(e){if(e instanceof Date&&!isNaN(e.valueOf()))t=!0;else if(e=e.replace(/\D/g,""),e.length>7){var n=e.substr(4,2),r=e.substr(6,2);e=te(e),e.getMonth()==n-1&&e.getDate()==r&&(t=!0)}}else;return t}function z(e){if(C(e)){var t=Object.keys(e),n={};return n[t[0]]=e[t[0]],n}return M(e)?e[0]:void console.error("ax5.util.object.first","argument type error")}function W(e){if(C(e)){var t=Object.keys(e),n={};return n[t[t.length-1]]=e[t[t.length-1]],n}return M(e)?e[e.length-1]:void console.error("ax5.util.object.last","argument type error")}function Y(e,t,n,r){var i;return"number"==typeof n&&(i=new Date,i.setDate(i.getDate()+n)),r=r||{},o.cookie=[escape(e),"=",escape(t),i?"; expires="+i.toUTCString():"",r.path?"; path="+r.path:"",r.domain?"; domain="+r.domain:"",r.secure?"; secure":""].join("")}function H(e){for(var t=e+"=",n=o.cookie.split(";"),r=0,i=n.length;i>r;r++){for(var a=n[r];" "==a.charAt(0);)a=a.substring(1);if(-1!=a.indexOf(t))return unescape(a.substring(t.length,a.length))}return""}function B(e){return r.alert(D(e)),e}function L(e,t){return"undefined"==typeof e||"undefined"==typeof t?"":R(t)?e.indexOf(t)>-1?e.substr(0,e.indexOf(t)):e:U(t)?e.substr(0,t):""}function V(e,t){return"undefined"==typeof e||"undefined"==typeof t?"":(e=""+e,R(t)?e.lastIndexOf(t)>-1?e.substr(e.lastIndexOf(t)+1):e:U(t)?e.substr(e.length-t):"")}function q(e){return e.replace(a,"ms-").replace(u,function(e,t){return t.toUpperCase()})}function G(e){return q(e).replace(s,function(e,t){return"-"+t.toLowerCase()})}function J(e,t){var n,r=(""+e).split(f),o=Number(r[0])<0||"-0"==r[0],i=0;return r[0]=r[0].replace(l,""),r[1]?(r[1]=r[1].replace(c,""),i=Number(r[0]+"."+r[1])||0):i=Number(r[0])||0,n=o?-i:i,m(t,function(e,t){"round"==e&&(n=U(t)?0>t?+(Math.round(n+"e-"+Math.abs(t))+"e+"+Math.abs(t)):+(Math.round(n+"e+"+t)+"e-"+t):Math.round(n)),"floor"==e&&(n=Math.floor(n)),"ceil"==e?n=Math.ceil(n):"money"==e?n=function(e){var t=""+e;if(isNaN(t)||""==t)return"";var n=t.split(".");n[0]+=".";do n[0]=n[0].replace(p,"$1,$2");while(p.test(n[0]));return n.length>1?n.join(""):n[0].split(".")[0]}(n):"abs"==e?n=Math.abs(Number(n)):"byte"==e&&(n=function(e){e=Number(n);var t="KB",r=e/1024;return r/1024>1&&(t="MB",r/=1024),r/1024>1&&(t="GB",r/=1024),J(r,{round:1})+t}(n))}),n}function Q(e){return"undefined"!=typeof e.length?Array.prototype.slice.call(e):[]}function K(e,t){var n=t.length,r=e.length,o=0;if("number"==typeof n)for(;n>o;o++)e[r++]=t[o];else for(;void 0!==t[o];)e[r++]=t[o++];return e.length=r,e}function X(e,t){var n;return R(e)&&"undefined"!=typeof t&&"param"==t?e:R(e)&&"undefined"!=typeof t&&"object"==t||R(e)&&"undefined"==typeof t?(n={},m(e.split(d),function(){var e=this.split(h);n[e[0]]?(R(n[e[0]])&&(n[e[0]]=[n[e[0]]]),n[e[0]].push(e[1])):n[e[0]]=e[1]}),n):(n=[],m(e,function(e,t){n.push(e+"="+escape(t))}),n.join("&"))}function Z(){y.info.onerror.apply(this,arguments)}function ee(e,t,n,r,o,i){var a,u;return u=new Date,"undefined"==typeof r&&(r=23),"undefined"==typeof o&&(o=59),a=new Date(Date.UTC(e,t,n||1,r,o,i||0)),0==t&&1==n&&a.getUTCHours()+a.getTimezoneOffset()/60<0?a.setUTCHours(0):a.setUTCHours(a.getUTCHours()+a.getTimezoneOffset()/60),a}function te(t,n){var r,o,i,a,u,s,f,l,c,p;if(R(t))if(0==t.length)t=new Date;else if(t.length>15)s=t.split(/ /g),c=s[0].split(/\D/g),r=c[0],o=parseFloat(c[1]),i=parseFloat(c[2]),l=s[1]||"09:00",f=l.substring(0,5).split(":"),a=parseFloat(f[0]),u=parseFloat(f[1]),("AM"===V(l,2)||"PM"===V(l,2))&&(a+=12),t=ee(r,o-1,i,a,u);else if(14==t.length)p=t.replace(/\D/g,""),t=ee(p.substr(0,4),p.substr(4,2)-1,J(p.substr(6,2)),J(p.substr(8,2)),J(p.substr(10,2)),J(p.substr(12,2)));else if(t.length>7)p=t.replace(/\D/g,""),t=ee(p.substr(0,4),p.substr(4,2)-1,J(p.substr(6,2)));else if(t.length>4)p=t.replace(/\D/g,""),t=ee(p.substr(0,4),p.substr(4,2)-1,1);else{if(t.length>2)return p=t.replace(/\D/g,""),ee(p.substr(0,4),p.substr(4,2)-1,1);t=new Date}return"undefined"==typeof n?t:(n.add&&(t=function(e,t){var n,r,o,i,a=864e5;return"undefined"!=typeof t.d?e.setTime(e.getTime()+t.d*a):"undefined"!=typeof t.m?(n=e.getFullYear(),r=e.getMonth(),o=e.getDate(),n+=parseInt(t.m/12),r+=t.m%12,i=oe(n,r),o>i&&(o=i),e=new Date(n,r,o,12)):"undefined"!=typeof t.y?e.setTime(e.getTime()+365*t.y*a):e.setTime(e.getTime()+t.y*a),e}(new Date(t),n.add)),n["return"]?function(){var r,o,i,a,u,s,f,l=n["return"];r=t.getUTCFullYear(),o=ie(t.getMonth()+1,2),i=ie(t.getDate(),2),a=ie(t.getHours(),2),u=ie(t.getMinutes(),2),s=ie(t.getSeconds(),2),f=t.getDay();var c=/[^y]*(yyyy)[^y]*/gi;c.exec(l);var p=RegExp.$1,d=/[^m]*(MM)[^m]*/g;d.exec(l);var h=RegExp.$1,g=/[^d]*(dd)[^d]*/gi;g.exec(l);var y=RegExp.$1,m=/[^h]*(hh)[^h]*/gi;m.exec(l);var b=RegExp.$1,v=/[^m]*(mm)[^i]*/g;v.exec(l);var w=RegExp.$1,x=/[^s]*(ss)[^s]*/gi;x.exec(l);var T=RegExp.$1,E=/[^d]*(dw)[^w]*/gi;E.exec(l);var S=RegExp.$1;return"yyyy"===p&&(l=l.replace(p,V(r,p.length))),"MM"===h&&(1==h.length&&(o=t.getMonth()+1),l=l.replace(h,o)),"dd"===y&&(1==y.length&&(i=t.getDate()),l=l.replace(y,i)),"hh"===b&&(l=l.replace(b,a)),"mm"===w&&(l=l.replace(w,u)),"ss"===T&&(l=l.replace(T,s)),"dw"==S&&(l=l.replace(S,e.weekNames[f].label)),l}():t)}function ne(e,t){function n(e){return Math.floor(e.getTime()/a)*a}var r,o,i=te(e),a=864e5,u=new Date;return"undefined"==typeof t?r=J((n(i)-n(u))/a,{floor:!0}):(r=J((n(i)-n(u))/a,{floor:!0}),t.today&&(u=te(t.today),r=J((n(i)-n(u))/a,{floor:!0})),t.thisYear&&(o=new Date(u.getFullYear(),i.getMonth(),i.getDate()),r=J((n(o)-n(u))/a,{floor:!0}),0>r&&(o=new Date(u.getFullYear()+1,i.getMonth(),i.getDate()),r=J((n(o)-n(u))/a,{floor:!0}))),t.age&&(o=new Date(u.getFullYear(),i.getMonth(),i.getDate()),r=o.getFullYear()-i.getFullYear()),r)}function re(e){var t=te(e);return{year:t.getFullYear(),month:t.getMonth()+1,count:parseInt(t.getDate()/7+1)}}function oe(e,t){return 3==t||5==t||8==t||10==t?30:1==t?e%4==0&&e%100!=0||e%400==0?29:28:31}function ie(e,t,n,r){var o=e.toString(r||10);return ae(n||"0",t-o.length)+o}function ae(e,t){return 1>t?"":new Array(t+1).join(e)}function ue(e,t){if(e)for(;function(){var n=!0;if("undefined"==typeof t)e=e.parentNode?e.parentNode:!1;else if(O(t))n=t(e);else if(C(t))for(var r in t)if("tagname"===r){if(e.tagName.toLocaleLowerCase()!=t[r]){n=!1;break}}else if("clazz"===r||"class_name"===r){if(!("className"in e)){n=!1;break}for(var o=e.className.split(g),i=!1,a=0;a<o.length;a++)if(o[a]==t[r]){i=!0;break}n=i}else{if(!e.getAttribute){n=!1;break}if(e.getAttribute(r)!=t[r]){n=!1;break}}return!n}();){if(!e.parentNode||!e.parentNode.parentNode){e=!1;break}e=e.parentNode}return e}function se(e){var t=/\D?(\d+)([a-zA-Z%]*)/i,n=(""+e).match(t),r=n[2]||"px";return n[1]+r}function fe(e){var t;if(C(e)){t="";for(var n in e)t+=n+":"+e[n]+";";return t}if(R(e)){t={};var r=e.split(/[ ]*;[ ]*/g);return r.forEach(function(e){if(""!==(e=e.trim())){var n=e.split(/[ ]*:[ ]*/g);t[n[0]]=n[1]}}),t}}function le(e){if(!e)var e=window.event;return e.cancelBubble=!0,e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),!1}function ce(e){var n,r;if("object"==("undefined"==typeof e?"undefined":_typeof(e))){if(t.isArray(e)){r=e.length,n=new Array(r);for(var o=0;r>o;o++)n[o]=ce(e[o]);return n}return jQuery.extend({},e)}return e}var pe=Object.prototype.toString,de=function(){var e={textRange:{selectAll:function(e,t,n){},arr:function(e,t,n){t.moveStart("character",n[0]),t.collapse(),t.moveEnd("character",n[1])},start:function(e,t,n){t.moveStart("character",0),t.collapse()},end:function(e,t,n){t.moveStart("character",t.text.length),t.collapse()}},range:{selectAll:function(e,t,n){t.selectNodeContents(e)},arr:function(e,t,n){C(n[0])?(t.setStart(n[0].node,n[0].offset),t.setEnd(n[1].node,n[1].offset)):(t.setStart(e.firstChild,n[0]),t.setEnd(e.firstChild,n[1]))},start:function(e,t,n){t.selectNodeContents(e),t.collapse(!0)},end:function(e,t,n){t.selectNodeContents(e),t.collapse(!1)}}};return function(t,n){var r,i,a;if(t instanceof jQuery&&(t=t.get(0)),t){if(o.body.createTextRange?(r=document.body.createTextRange(),r.moveToElementText(t),i="textRange"):window.getSelection&&(a=window.getSelection(),r=document.createRange(),i="range"),"undefined"==typeof n)e[i].selectAll.call(this,t,r,n);else if(M(n))e[i].arr.call(this,t,r,n);else for(var u in e[i])if(n==u){e[i][u].call(this,t,r,n);break}o.body.createTextRange?(r.select(),t.focus()):window.getSelection&&(t.focus(),a.removeAllRanges(),a.addRange(r))}}}(),he=function(e,t,n){var r,o,i=function(){var i=Q(arguments);o&&clearTimeout(o),r?(r&&clearTimeout(r),r=setTimeout(function(t){e.apply(this,t)}.bind(this,i),t)):r=setTimeout(function(t){e.apply(this,t)}.bind(this,i),n?0:t),o=setTimeout(function(){clearTimeout(r),r=null},t)};return i.cancel=function(){clearTimeout(r),clearTimeout(o),r=null},i};return{alert:B,each:m,map:b,search:v,reduce:T,reduceRight:E,filter:S,sum:w,avg:x,toJson:D,parseJson:k,first:z,last:W,deepCopy:ce,left:L,right:V,getType:N,isWindow:A,isElement:j,isObject:C,isArray:M,isFunction:O,isString:R,isNumber:U,isNodelist:F,isUndefined:P,isNothing:I,setCookie:Y,getCookie:H,camelCase:q,snakeCase:G,number:J,toArray:Q,merge:K,param:X,error:Z,date:te,dday:ne,daysOfMonth:oe,weeksOfMonth:re,setDigit:ie,times:ae,findParentNode:ue,cssNumber:se,css:fe,isDate:_,isDateFormat:$,stopEvent:le,selectRange:de,debounce:he}}(),n.ax5=function(){return y}()}).call(window),ax5.info.errorMsg.ax5dialog={501:"Duplicate call error"},ax5.info.errorMsg.ax5picker={401:"Can not find target element",402:"Can not find boundID",501:"Can not find content key"},ax5.info.errorMsg["single-uploader"]={460:"There are no files to be uploaded.",461:"There is no uploaded files."},ax5.info.errorMsg.ax5calendar={401:"Can not find target element"},ax5.info.errorMsg.ax5formatter={401:"Can not find target element",402:"Can not find boundID",501:"Can not find pattern"},ax5.info.errorMsg.ax5menu={501:"Can not find menu item"},ax5.info.errorMsg.ax5select={401:"Can not find target element",402:"Can not find boundID",501:"Can not find option"},ax5.info.errorMsg.ax5combobox={401:"Can not find target element",402:"Can not find boundID",501:"Can not find option"},function(){var e=/^\s*|\s*$/g;Object.keys||(Object.keys=function(){var e=Object.prototype.hasOwnProperty,t=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],r=n.length;return function(o){if("object"!==("undefined"==typeof o?"undefined":_typeof(o))&&("function"!=typeof o||null===o))throw new TypeError("type err");var i,a,u=[];for(i in o)e.call(o,i)&&u.push(i);if(t)for(a=0;r>a;a++)e.call(o,n[a])&&u.push(n[a]);return u}}()),Array.prototype.forEach||(Array.prototype.forEach=function(e){if(void 0===this||null===this)throw TypeError();var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw TypeError();var r,o=arguments[1];for(r=0;n>r;r++)r in t&&e.call(o,t[r],r,t)}),Function.prototype.bind||(Function.prototype.bind=function(e){function t(){}if("function"!=typeof this)throw TypeError("function");var n=[].slice,r=n.call(arguments,1),o=this,i=function(){return o.apply(this instanceof t?this:e,r.concat(n.call(arguments)))};return t.prototype=o.prototype,i.prototype=new t,i}),function(){if(!document.querySelectorAll&&!document.querySelector&&document.createStyleSheet){var e=document.createStyleSheet(),t=function(t,n){var r,o=document.all,i=o.length,a=[];for(e.addRule(t,"foo:bar"),r=0;i>r&&!("bar"===o[r].currentStyle.foo&&(a.push(o[r]),a.length>n));r+=1);return e.removeRule(0),a};document.querySelectorAll=function(e){return t(e,1/0)},document.querySelector=function(e){return t(e,1)[0]||null}}}(),String.prototype.trim||!function(){String.prototype.trim=function(){return this.replace(e,"")}}(),window.JSON||(window.JSON={parse:function(e){return new Function("","return "+e)()},stringify:function(){var e,t=/["]/g;return e=function(n){var r,o,i;switch(r="undefined"==typeof n?"undefined":_typeof(n)){case"string":return'"'+n.replace(t,'\\"')+'"';case"number":case"boolean":return n.toString();case"undefined":return"undefined";case"function":return'""';case"object":if(!n)return"null";if(r="",n.splice){for(o=0,i=n.length;i>o;o++)r+=","+e(n[o]);return"["+r.substr(1)+"]"}for(o in n)n.hasOwnProperty(o)&&void 0!==n[o]&&"function"!=typeof n[o]&&(r+=',"'+o+'":'+e(n[o]));return"{"+r.substr(1)+"}"}}}()}),function(){if(!document.documentMode||document.documentMode>=9)return!1;var e=Array.prototype.splice;Array.prototype.splice=function(){var t=Array.prototype.slice.call(arguments);return"undefined"==typeof t[1]&&(t[1]=this.length-t[0]),e.apply(this,t)}}(),function(){var e=Array.prototype.slice;try{e.call(document.documentElement)}catch(t){Array.prototype.slice=function(t,n){if(n="undefined"!=typeof n?n:this.length,"[object Array]"===Object.prototype.toString.call(this))return e.call(this,t,n);var r,o,i=[],a=this.length,u=t||0;u=u>=0?u:Math.max(0,a+u);var s="number"==typeof n?Math.min(n,a):a;if(0>n&&(s=a+n),o=s-u,o>0)if(i=new Array(o),this.charAt)for(r=0;o>r;r++)i[r]=this.charAt(u+r);else for(r=0;o>r;r++)i[r]=this[u+r];return i}}}(),function(e){for(var t,n,r={},o=function(){},i="memory".split(","),a="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");t=i.pop();)e[t]=e[t]||r;for(;n=a.pop();)e[n]=e[n]||o}(window.console||{});var t=document.getElementsByTagName("html")[0];document.getElementsByTagName("body")[0];window.innerWidth||(window.innerWidth=t.clientWidth),window.innerHeight||(window.innerHeight=t.clientHeight),window.scrollX||(window.scrollX=window.pageXOffset||t.scrollLeft),window.scrollY||(window.scrollY=window.pageYOffset||t.scrollTop)}.call(window),ax5.ui=function(e){function t(){this.config={},this.name="root",this.setConfig=function(e,t){return jQuery.extend(!0,this.config,e,!0),("undefined"==typeof t||t===!0)&&this.init(),this},this.init=function(){console.log(this.config)},this.bindWindowResize=function(e){setTimeout(function(){jQuery(window).resize(function(){this.bindWindowResize__&&clearTimeout(this.bindWindowResize__),this.bindWindowResize__=setTimeout(function(){e.call(this)}.bind(this),10)}.bind(this))}.bind(this),100)},this.stopEvent=function(e){return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,!1},this.toString=function(){return this.name+"@"+this.version},this.main=function(){}.apply(this,arguments)}return{root:t}}(ax5),function(e,t){t(e.mustache={})}(window.ax5,function(e){function t(e){return"function"==typeof e}function n(e){return g(e)?"array":"undefined"==typeof e?"undefined":_typeof(e)}function r(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(e,t){return null!=e&&"object"===("undefined"==typeof e?"undefined":_typeof(e))&&t in e}function i(e,t){return y.call(e,t)}function a(e){return!i(m,e)}function u(e){return String(e).replace(/[&<>"'\/]/g,function(e){return b[e]})}function s(t,n){function o(){if(m&&!b)for(;y.length;)delete h[y.pop()];else y=[];m=!1,b=!1}function i(e){if("string"==typeof e&&(e=e.split(w,2)),!g(e)||2!==e.length)throw new Error("Invalid tags: "+e);u=new RegExp(r(e[0])+"\\s*"),s=new RegExp("\\s*"+r(e[1])),p=new RegExp("\\s*"+r("}"+e[1]))}if(!t)return[];var u,s,p,d=[],h=[],y=[],m=!1,b=!1;i(n||e.tags);for(var S,D,k,N,A,j,C=new c(t);!C.eos();){if(S=C.pos,k=C.scanUntil(u))for(var M=0,O=k.length;O>M;++M)N=k.charAt(M),a(N)?y.push(h.length):b=!0,h.push(["text",N,S,S+1]),S+=1,"\n"===N&&o();if(!C.scan(u))break;if(m=!0,D=C.scan(E)||"name",C.scan(v),"="===D?(k=C.scanUntil(x),C.scan(x),C.scanUntil(s)):"{"===D?(k=C.scanUntil(p),C.scan(T),C.scanUntil(s),D="&"):k=C.scanUntil(s),!C.scan(s))throw new Error("Unclosed tag at "+C.pos);if(A=[D,k,S,C.pos],h.push(A),"#"===D||"^"===D)d.push(A);else if("/"===D){if(j=d.pop(),!j)throw new Error('Unopened section "'+k+'" at '+S);if(j[1]!==k)throw new Error('Unclosed section "'+j[1]+'" at '+S)}else"name"===D||"{"===D||"&"===D?b=!0:"="===D&&i(k)}if(j=d.pop())throw new Error('Unclosed section "'+j[1]+'" at '+C.pos);return l(f(h))}function f(e){for(var t,n,r=[],o=0,i=e.length;i>o;++o)t=e[o],t&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}function l(e){for(var t,n,r=[],o=r,i=[],a=0,u=e.length;u>a;++a)switch(t=e[a],t[0]){case"#":case"^":o.push(t),i.push(t),o=t[4]=[];break;case"/":n=i.pop(),n[5]=t[2],o=i.length>0?i[i.length-1][4]:r;break;default:o.push(t)}return r}function c(e){this.string=e,this.tail=e,this.pos=0}function p(e,t){this.view=e,this.cache={".":this.view,"@each":function(){var e=[];for(var t in this)e.push({"@key":t,"@value":this[t]});return e}},this.parent=t}function d(){this.cache={}}var h=Object.prototype.toString,g=Array.isArray||function(e){return"[object Array]"===h.call(e)},y=RegExp.prototype.test,m=/\S/,b={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},v=/\s*/,w=/\s+/,x=/\s*=/,T=/\s*\}/,E=/#|\^|\/|>|\{|&|=|!/;c.prototype.eos=function(){return""===this.tail},c.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},c.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},p.prototype.push=function(e){return new p(e,this)},p.prototype.lookup=function(e){var n,r=this.cache;if(r.hasOwnProperty(e))n=r[e];else{for(var i,a,u=this,s=!1;u;){if(e.indexOf(".")>0)for(n=u.view,i=e.split("."),a=0;null!=n&&a<i.length;)a===i.length-1&&(s=o(n,i[a])),n=n[i[a++]];else n=u.view[e],s=o(u.view,e);if(s)break;u=u.parent}r[e]=n}return t(n)&&(n=n.call(this.view)),n},d.prototype.clearCache=function(){this.cache={}},d.prototype.parse=function(e,t){var n=this.cache,r=n[e];return null==r&&(r=n[e]=s(e,t)),r},d.prototype.render=function(e,t,n){var r=this.parse(e),o=t instanceof p?t:new p(t);return this.renderTokens(r,o,n,e)},d.prototype.renderTokens=function(e,t,n,r){for(var o,i,a,u="",s=0,f=e.length;f>s;++s)a=void 0,o=e[s],i=o[0],"#"===i?a=this.renderSection(o,t,n,r):"^"===i?a=this.renderInverted(o,t,n,r):">"===i?a=this.renderPartial(o,t,n,r):"&"===i?a=this.unescapedValue(o,t):"name"===i?a=this.escapedValue(o,t):"text"===i&&(a=this.rawValue(o)),void 0!==a&&(u+=a);return u},d.prototype.renderSection=function(e,n,r,o){function i(e){return a.render(e,n,r)}var a=this,u="",s=n.lookup(e[1]);if(s){if(g(s))for(var f=0,l=s.length;l>f;++f)s[f]["@i"]=f,s[f]["@first"]=0===f,u+=this.renderTokens(e[4],n.push(s[f]),r,o);else if("object"===("undefined"==typeof s?"undefined":_typeof(s))||"string"==typeof s||"number"==typeof s)u+=this.renderTokens(e[4],n.push(s),r,o);else if(t(s)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");s=s.call(n.view,o.slice(e[3],e[5]),i),null!=s&&(u+=s)}else u+=this.renderTokens(e[4],n,r,o);return u}},d.prototype.renderInverted=function(e,t,n,r){var o=t.lookup(e[1]);return!o||g(o)&&0===o.length?this.renderTokens(e[4],t,n,r):void 0},d.prototype.renderPartial=function(e,n,r){if(r){var o=t(r)?r(e[1]):r[e[1]];return null!=o?this.renderTokens(this.parse(o),n,r,o):void 0}},d.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);return null!=n?n:void 0},d.prototype.escapedValue=function(t,n){var r=n.lookup(t[1]);return null!=r?e.escape(r):void 0},d.prototype.rawValue=function(e){return e[1]},e.name="mustache.js",e.version="2.1.3",e.tags=["{{","}}"];var S=new d;e.clearCache=function(){return S.clearCache()},e.parse=function(e,t){return S.parse(e,t)},e.render=function(e,t,r){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+n(e)+'" was given as the first argument for mustache#render(template, view, partials)');return S.render(e,t,r)},e.to_html=function(n,r,o,i){var a=e.render(n,r,o);return t(i)?void i(a):a},e.escape=u,e.Scanner=c,e.Context=p,e.Writer=d}); |
{ | ||
"name": "ax5core", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "`ax5core` is a collection of utility functions that have been designed for use in ax5ui", | ||
@@ -5,0 +5,0 @@ "license": "LGPLv3", |
@@ -1,3 +0,2 @@ | ||
[![axisj-contributed](https://img.shields.io/badge/AXISJ.com-Contributed-green.svg)](https://github.com/axisj) | ||
![](https://img.shields.io/badge/Seowoo-Mondo&Thomas-red.svg) | ||
[![axisj-contributed](https://img.shields.io/badge/AXISJ.com-Contributed-green.svg)](https://github.com/axisj) ![](https://img.shields.io/badge/Seowoo-Mondo&Thomas-red.svg) | ||
@@ -4,0 +3,0 @@ # ax5core |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
5497
268780
72