-
Notifications
You must be signed in to change notification settings - Fork 6
/
jijx.ijs
249 lines (211 loc) · 6.28 KB
/
jijx.ijs
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
NB. J HTTP Server - jijx app
coclass'jijx'
coinsert'jhs'
HBS=: 0 : 0
jhmenu''
'menu0' jhmenugroup ''
jhmpage''
'jinputs'jhmenuitem 'inputs';'d'
'jfile' jhmenuitem 'file explorer';'e'
'jfif' jhmenuitem 'find in files';'f'
'jijs' jhmenuitem 'jijs';'n'
'jcopy' jhmenuitem 'jcopy'
'jbreak' jhmenuitem 'break';'c'
'jpacman'jhmenuitem 'jpacman'
'jdebug' jhmenuitem 'jdebug'
jhmenulink 'build';'build browser apps'
jhmenulink 'labs';'labs and tools'
jhmenulink 'view';'view'
jhmenulink 'help';'help'
'closepages' jhmenuitem 'close term pages'
jhmenulink 'quit';'quit'
jhmenugroupz''
jhmpagez''
'build' jhmenugroup''
'app' jhmenuitem'app (build gui app)'
'page' jhmenuitem'app examples'
'demo' jhmenuitem'more app examples'
'react' jhmenuitem'react'
jhmenugroupz''
'labs' jhmenugroup''
'tour' jhmenuitem'tour (JHS tutorial)'
'lab' jhmenuitem'lab (tutorial)'
'tool' jhmenuitem'tool'
jhmenugroupz''
'view' jhmenugroup''
'cleartemps' jhmenuitem 'remove red boxes';'s'
'wrap' jhmenuitem 'wrap/unwrap'
'clearwindow' jhmenuitem 'clear window'
'clearrefresh' jhmenuitem 'clear refresh'
'clearLS' jhmenuitem 'clear LS'
jhmenugroupz''
'help' jhmenugroup''
'welcome' jhmenuitem 'welcome'
'guest_rules' jhmenuitem 'guest rules'
'guest_files' jhmenuitem 'guest files'
'mobile' jhmenuitem 'mobile'
'wiki' jhmenuitem 'wiki';'p'
'shortcuts' jhmenuitem 'shortcuts'
'popups' jhmenuitem 'pop-ups'
'closing' jhmenuitem 'close'
'framework' jhmenuitem 'framework'
'about' jhmenuitem 'about'
jhmenugroupz''
'quit' jhmenugroup''
jhhr
'exit' jhmenuitem 'exit server';'z'
jhmenugroupz''
jhdivz NB. base div close - flex active
NB. elements not in main div share remaining space
'log' jhec'<LOG>'
NB. touch screen button on right side
'uarrow' jhb '';'jhtouch'
'darrow' jhb '';'jhtouch'
'advance'jhb '';'jhtouch'
jhdiva'' NB. reopen main div
)
jev_get=: create
NB. move new transaction(s) to log
uplog=: 3 : 0
LOG_jhs_=: LOG,LOGN
LOGN_jhs_=: ''
)
NB. y is J prompt - '' ' ' or ' '
NB. called at start of input
NB. ff/safari/chrome collapse empty div (hence bull)
NB. empty prompt is • which is removed if present from input
urlresponse=: 3 : 0
if. 0=#y do.
t=. JZWSPU8
PROMPT_jhs_=: JZWSPU8
else.
t=. (6*#y)$' '
PROMPT_jhs_=: y
end.
t=. '<div id="prompt" class="log" onpaste="mypaste(event)">',t,'</div>'
d=. LOGN,t
uplog''
if. METHOD-:'post' do.
if. CHUNKY do.
CHUNKY_jhs_=: 0
jhrajax_z d
else.
jhrajax d
end.
else.
create''
end.
)
NB. refresh response - not jajax
create=: 3 : 0
uplog''
'jterm' jhr 'LOG';LOG
)
ev_advance_click=: 3 : 0
select. ADVANCE
case. 'spx' do. spx__''
case. 'lab' do. lab 0
case. 'wiki'do. wikistep_jsp_''
case. do. echo 'no open lab/spx to advance'
end.
)
jloadnoun_z_=: 0!:100
ev_clearrefresh_click=: 3 : 'LOG_jhs_=: '''''
ev_about_click=: 3 : 0
jhtml'<hr/>'
echo JVERSION
echo' '
echo'Copyright 1994-2024 Jsoftware Inc.'
jhtml'<hr/>'
)
NB. aws server window.close fails (depends on how started)
ev_exit_click=: 3 : 0
select. QRULES
case. 0 do. NB. localhost - close pages, exit server, close jterm
jhrajax''
exit''
case. 1 do. NB.server user - close pages, no exit, window.location=juser
jhrajax 'juser>' NB. causes set of window.location
case. 2 do. NB. server guest - close pages, exit server, window.location=jguest
exit'' NB. no jhrajax triggers jguest page
end.
)
vsub=: 4 : 0
d=. 1 dir '~addons/ide/jhs/',y
t=. fread each d
(#d)=+/;+/each(<LF,x,'=:')E.each t
)
NB. validate the system
validate=: 3 : 0
'ev_create not found'assert 'ev_create'vsub'app'
'create found' assert -.'create'vsub'app'
'ev_create not found'assert 'ev_create'vsub'page'
'create found' assert -.'create'vsub'page'
'ev_create found'assert -.'ev_create'vsub'demo'
NB. 'create not found' assert 'create'vsub'demo'
a=. geth1'~addons/ide/jhs/demo/jdemo*.ijs'
if. 0~:+/'no header'E.;{."1 a do.
echo 'demo folder has files without jhh1'
end.
if. -.demo_order-:/:~{:"1 a do.
echo 'demo folder mistatch with order_demo'
end.
a=. geth1'~addons/ide/jhs/app/app*.ijs'
if. 0~:+/'no header'E.;{."1 a do.
echo 'app folder has files without jhh1'
end.
if. -.app_order-:/:~{:"1 a do.
echo 'app folder mistatch with order_app'
end.
i.0 0
)
ev_comma_ctrl =: 3 : 'sp__'''''
ev_dot_ctrl=: ev_advance_click
ev_slash_ctrl =: 3 : 'i.0 0'
ev_less_ctrl =: 3 : 'i.0 0'
ev_larger_ctrl =: 3 : 'i.0 0'
ev_query_ctrl =: 3 : 'i.0 0'
ev_semicolon_ctrl =: 3 : 'loadx__ 0'
ev_colon_ctrl =: 3 : 'echo''colon'''
ev_quote_ctrl_jijx_=: 3 : 'dbover dbxup'''''
ev_doublequote_ctrl =: 3 : 'dbinto dbxup'''''
load'~addons/ide/jhs/loadx.ijs'
NB. #ijs{z-index:2;display:none;width:100%;height:100%;resize:vertical;overflow:auto} /* display:none; */
CSS=: 0 : 0
#log{width:100%;height:100%;resize:vertical;overflow:auto;}
*{font-family:<PC_FONTFIXED>;font-weight:550;}
form{margin-top:0;margin-bottom:0;}
*.fm {color:<PC_FM_COLOR>;}
*.er {color:<PC_ER_COLOR>;}
*.log {color:<PC_LOG_COLOR>;}
*.sys {color:<PC_SYS_COLOR>;}
*.file {color:<PC_FILE_COLOR>;}
.jhb#overview{background-color:<PC_JICON>;font-weight:bold;font-size:2rem;padding:0.2rem;}
#prompt{background-color:blanchedalmond;border:2px solid black;padding:8px 0 8px 0;}
/* touch screen right side buttons */
.jhtouch{background-color:rgba(255,255,255,0);position:fixed;right:0;margin:0px;border-radius:0;
width:4rem;height:3rem;border-width:0 0.5rem 0 0;border-style:solid;} /* border-style ??? */
.jhtouch#advance{border-color:darkseagreen;}
.jhtouch#uarrow {border-color:blue;}
.jhtouch#darrow {border-color:red;}
/* all except mobile - assume no kb movement */
.jhtouch#advance{bottom:13rem;}
.jhtouch#uarrow {bottom:10rem;}
.jhtouch#darrow {bottom:7rem;}
/* tablet */
@media screen and (max-device-width: 992px){
#prompt{padding:10px 0 10px 0;}
.jhtouch#advance{bottom:26rem;}
.jhtouch#uarrow {bottom:23rem;}
.jhtouch#darrow {bottom:20rem;}
}
/* phone */
@media screen and (max-device-width: 640px){
#prompt{padding:36px 0 36px 0;}
.jhtouch#advance{bottom:14rem;}
.jhtouch#uarrow {bottom:11rem;}
.jhtouch#darrow {bottom: 8rem;}
}
)
INC=: INC_chartjs NB. include chart js code
JS=: ('var qrules= ',":QRULES),LF,fread JSPATH,'jijx.js'