Skip to content

Commit 70672d8

Browse files
save file
1 parent e73c7bc commit 70672d8

1 file changed

Lines changed: 121 additions & 0 deletions

File tree

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
2+
3+
<chat-room-tmp>
4+
5+
<template shadowrootmode=open>
6+
7+
<style>
8+
9+
#user-root
10+
{height:150px;display:flex;gap:20px;border-top:1px solid lightgray;padding-top:10px}
11+
#txt
12+
{height:100%;border:1px solid lightgray;border-radius:5px;padding:10px;flex:1;box-sizing:border-box;resize:none}
13+
#info
14+
{display:flex;flex-direction:column;gap:10px}
15+
#show-password
16+
{cursor:pointer}
17+
#show-password > *
18+
{vertical-align:middle;cursor:pointer}
19+
.label
20+
{display:inline-block;width:100px;text-align:right;margin-right:20px}
21+
22+
[value=send]
23+
{margin-right:20px;min-width:80px}
24+
#pause
25+
{min-width:80px}
26+
27+
</style>
28+
29+
<section id=user-root>
30+
31+
<div id=info>
32+
<div>
33+
<span class=label>
34+
user
35+
</span>
36+
<input id=user value=test>
37+
</div>
38+
<div>
39+
<span class=label>
40+
password
41+
</span>
42+
<input id=password type=password value=abc-123>
43+
</div>
44+
<div id=show-password>
45+
<span class=label>
46+
show
47+
</span>
48+
<input type=checkbox>
49+
</div>
50+
51+
</div>
52+
53+
<textarea id=txt></textarea>
54+
55+
<div id=btns>
56+
<input value=send type=button title=ctrl+enter>
57+
<input id=pause value=pause type=button>
58+
</div>
59+
60+
</section>
61+
62+
</template>
63+
64+
<script>
65+
66+
(function({mod,host}){
67+
68+
var obj = {};
69+
70+
var df=true,did='chat-room-tmp';
71+
72+
73+
var debug
74+
;
75+
76+
obj.initmod = function(params){
77+
78+
debug = mod.rd(params,'debug',debug);
79+
80+
}//initmod
81+
82+
83+
//:
84+
85+
var ui = {};
86+
87+
88+
obj.init = async function(){
89+
debug=eval(debug.mod);
90+
debug('init');
91+
}//init
92+
93+
94+
obj.initdom = async function(){
95+
96+
var info = $(shadow,'#info');
97+
98+
$.chkbox(info,'#show-password',btn.password);
99+
100+
$(shadow,'#txt').onkeydown = kd.user;
101+
$(shadow,'#txt').focus();
102+
103+
$(shadow,'[value=send]').onclick = btn.send;
104+
ui.pause = $(shadow,'[value=pause]');
105+
ui.pause.onclick = btn.pause;
106+
107+
108+
}//initdom
109+
110+
111+
112+
//:
113+
114+
115+
116+
})
117+
118+
</chat-room-tmp>
119+
120+
121+

0 commit comments

Comments
 (0)