-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.html
159 lines (140 loc) · 3.65 KB
/
test.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<title>UnderZ library</title>
<script type="text/javascript" src="_z.js" underZ>
_z&&
( _z.$Langs = {
ok: "OK",
styledir: './theme/',
varName: "varValue"
});
// if you have jQuery comment this line
$ = _z;
// _z.f.status(true)
</script>
<script type="text/javascript">
// load plugin: inlineEdit
_z
.declare('inlineEdit', _z.$)
.require({ js: [ './plugins/inlineEdit.jPlugin.js' ] })
.init(fns.true);
// load plugin: hotkey
_z
.declare('hotkey', _z.$)
.hook(_z)
.require({ js: [ './plugins/hotkey.jPlugin.js' ] })
.init(fns.true);
/*
_z.hotkey({
code: "f",
desc: "Shift and F HK",
function: function(event) {
console.log(event);
},
ctrl: false,
shift: true,
alt: false,
target: null
});
_z.hotkey({
code: "shift+f",
desc: "Shift and F HK",
function: function(event) {
console.log(event);
}
});
_z.hotkey({
code: "shift+f",
function: function(event) {
console.log(event);
}
});
_z("#text1").hotkey({
code: "shift+f",
function: function(event) {
console.log(event);
}
});
*/
// when document ready
_z.ready(()=>{
// apply plugin input
_z('.p1t').inlineEdit({
blur: false,
bottons: false
});
// apply plugin textarea
_z('[inlineEdit]').inlineEdit({
blur: true,
allowEmpty: true,
maxLength: 50,
bottons: true,
inputMode: "textarea",
submit: function(element, newValue) {
console.log(newValue);
return newValue.replaceAll("\n", "[LINE]");
}
});
fns.arg( _z.is_z($), _z.isCore($) );
});
</script>
</head>
<body>
<script type="text/javascript">
// notification example
/*var notify = new _z.notification({
tag: "mainNot",
title: 'UnderZ',
body: 'UnderZ Running\nClick To Open GitHub.',
image: undefined,
onclick: ()=>window.open("https://github.com/hlaCk/UnderZ")&¬ify[notify.length-1].close()
}).open();*/
</script>
<button id="button">Show Message & Change Title</button>
<button class="btnCTitle">Change Title</button>
<button class="btnUBEvent">Unbind "Change Title" event</button>
<script>
// bind click event by element id
_z("#button").click(function () {
alert("Button clicked!");
});
// bind click event by element tag - this will bind the event with all elements with "button" tag.
_z("button").click(function () {
// set title as clicked button text
document.title = _z(this).text();
});
// unbind click event by element class.
_z(".btnUBEvent").click(function () {
_z(".btnCTitle").un("click");
});
</script>
<style>
.p1t {
font-size: 16px;
background: red;
}
</style>
<label id="label">Label</label>
<span id="span1">
<input type="text" value="Text" id="text1">
<span id="span2">
<input type="text" value="Text2" id="text2">
<span id="span3">
<textarea id="textarea">Textarea</textarea>
</span>
</span>
</span>
<button id="buttont">Show Message & Change Title</button>
<button class="btnCTitlet">Change Title</button>
<button class="btnUBEventt">Unbind "Change Title" event</button>
<p class="p1t" style="">p1 line</p>
<p class="p2t" inlineEdit>p2 line</p>
<p class="p3t"><a href="#clicked" aa>click</a></p>
<button id="btn1t">Remove first line hover out</button>
<button id="btn2t">Remove second line hover in</button>
<button id="btn3t">Remove third line hover in/out</button>
</body>
</html>