-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathindex.html
139 lines (106 loc) · 3.65 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="../dist/ax5core.js"></script>
</head>
<body style="padding: 50px;">
<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>
<div data-ax5combobox-display="label" contenteditable="true" spellcheck="false"> </div>
<script>
(function () {
console.log(ax5.util.color("#ff3300").lighten(10).getHexValue());
console.log(ax5.util.color("#ff3300").darken(10).getHexValue());
console.log(ax5.util.color("#ff3300").isDark());
return;
var rr = ax5.util.filter(
{
a: 1, s: "string", oa: {pickup: true, name: "AXISJ"}, os: {pickup: true, name: "AX5"}
},
function () {
return this.pickup;
}
);
if (window.matchMedia("(min-width: 400px)").matches) {
/* the viewport is at least 400 pixels wide */
console.log("wide");
} else {
/* the viewport is less than 400 pixels wide */
console.log("400");
}
console.log(ax5.util.toJson(rr));
/* 날짜 포멧팅
var today = new Date();
var ppp = ax5.util.date(today, {return:'yyyy-MM-dd'});
console.log(ppp);
*/
//console.log(ax5.info.eventKeys);
/*
var templatel = "{{title}} spends {{calc}}";
var view = {
title: "Joe",
calc: function () {
return 2 + 4;
}
};
var output = ax5.mustache.render(template, view);
console.log(output);
*/
var view = {
"beatles": [
{"firstName": "John", "lastName": "Lennon"},
{"firstName": "Paul", "lastName": "McCartney"},
{"firstName": "George", "lastName": "Harrison"},
{"firstName": "Ringo", "lastName": "Star"}
]
};
/*
var template =
"{{#beatles}} * {{firstName}} {{lastName}} ({{@i}}) ({{@first}}) {{/beatles}}";
var output = ax5.mustache.render(template, view);
console.log(output);
*/
$(document.body).ready(function () {
ax5.util.selectRange($("#select-test-0"), "end");
//ax5.util.selectRange($("#select-test-1").get(0), [1, 5]);
//ax5.util.selectRange($("#select-test-2"), "end");
});
var arr = [
{name: "122", value: 9},
{name: "122", value: 10},
{name: "222", value: 11}
];
var rs = ax5.util.avg(arr, function () {
return this.value;
});
//console.log(rs);
console.log(ax5.util.sum(arr, 10, function () {
return this.value;
}));
var chk_fn = ax5.util.debounce(function (val) {
console.log(val);
}, 300);
$(document.body).click(function () {
chk_fn(new Date());
});
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);
})();
</script>
</body>
</html>