-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathjijx.ijs
More file actions
184 lines (157 loc) · 4.25 KB
/
jijx.ijs
File metadata and controls
184 lines (157 loc) · 4.25 KB
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
NB. J HTTP Server - jijx app
coclass'jijx'
coinsert'jhs'
termmenu=: 0 : 0
jhmenu'term';'advance'jhb'⇒';'jmenuburger'
'menu0' jhmenugroup ''
'sp' jhmenuitem 'projects';'p'
'spdefault' jhmenuitem 'project default';'o'
'jinputs' jhmenuitem 'inputs';'i'
'jbreak' jhmenuitem 'break';'c'
'dissect' jhmenuitem 'dissect input line';'j'
'jhshelp' jhmenuitem 'help';'h'
'closepages' jhmenuitem 'close pages'
jhmenulink 'jpages';'system pages'
jhmenulink 'options';'options and view'
'close' jhmenuitem 'quit';'q'
jhmenugroupz''
'jpages' jhmenugroup''
'jfile' jhmenuitem 'explore files';'e'
'jfif' jhmenuitem 'find in files';'f'
'jdebug' jhmenuitem 'debug';'d'
'jijs' jhmenuitem 'edit new temp file';'n'
'jpacman' jhmenuitem 'package manager'
'jlocale' jhmenuitem 'locale explorer'
'jhelp' jhmenuitem 'jhshelp texts'
'jdoc' jhmenuitem 'framework docs'
jhmenugroupz''
'options' jhmenugroup''
'wrap' jhmenuitem 'NOWRAP ➜ wrap'
'spa' jhmenuitem 'Tab ➜ term'
'flow' jhmenuitem 'COLUMN ➜ row';'u' NB. see flowset for kludge to preserve shortcut
'cleartemps' jhmenuitem 'remove red boxes';'r'
'clearwindow' jhmenuitem 'clear window'
'clearrefresh' jhmenuitem 'clear refresh'
'clearLS' jhmenuitem 'clear LS'
jhmenugroupz''
)
HBS=: 0 : 0 rplc '<termmenu>';termmenu
<termmenu>
jhdivz NB. flex active
jhresize''
'log' jhec'<LOG>'
'jframes'jhdiva''
jhdivz
jhdiva'' NB. flex inactive - 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''
'term' 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_dissect_click=: 3 : 0
d=. getv'jdata'
d=. quote ('|'={.d)}.d NB. asssume leading | is from error report
9!:27'dissect ',d
9!:29[1
jhtml''
)
ev_clearrefresh_click=: 3 : 'LOG_jhs_=: '''''
ev_jhelp_click=: 3 : 0
'jhelp'jpage''
)
ev_jhshelp_click=: 3 : 0
jhshelp''
)
ev_about_click=: 3 : 0
jhtml'<hr/>'
echo JVERSION
echo' '
echo'Copyright 1994-2025 Jsoftware Inc.'
jhtml'<hr/>'
)
NB. aws server window.close fails (depends on how started)
ev_close_click=: 3 : 0
select. QRULES
case. 0 do. NB. localhost - close pages, exit server, close jterm
jhrajax'666'
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.
)
ev_sp_click=: 3 : 'sp__'''''
ev_spdefault_click=: 3 : 0
SPFILE_z_=: '~temp/sp/spfile.ijs'
load SPFILE
echo' p_default_jsp_'''''
p_default_jsp_''
)
ev_comma_ctrl =: 3 : 'i.0 0'
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 : 'echo''quote'''
ev_doublequote_ctrl =: 3 : 'echo''doublequote'''
load'~addons/ide/jhs/loadx.ijs'
NB. csscore has log css
CSS=: 0 : 0
*{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:1em;margin-left:1em;}
#prompt{background-color:blanchedalmond;border:2px solid black;padding:8px 0 8px 0;}
)
INC=: INC_chartjs NB. include chart js code
JS=: ('var qrules= ',":QRULES),LF,fread JSPATH,'jijx.js'