Skip to content

Commit 1457da0

Browse files
mnemonics support
1 parent 0991637 commit 1457da0

File tree

3 files changed

+87
-36
lines changed

3 files changed

+87
-36
lines changed

classes/%WebTerminal.Engine.cls

Lines changed: 83 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,86 @@ Property WatchesCaret As %Numeric [ MultiDimensional ];
8282
/// Public point entries, using when redirecting i/o
8383
Method redirects() [ Private, ProcedureBlock = 0 ]
8484
{
85+
/// Mnemonics
86+
APC d APC^%X364 q
87+
BEL d BEL^%X364 q
88+
CBT(%1) d CBT^%X364(%1) q
89+
CCH d CCH^%X364 q
90+
CHA(%1) d CHA^%X364(%1) q
91+
CHT(%1) d CHT^%X364(%1) q
92+
CNL(%1) d CNL^%X364(%1) q
93+
CPL(%1) d CPL^%X364(%1) q
94+
CPR d CPR^%X364 q
95+
CTC(%1,%2,%3,%4,%5,%6,%7,%8,%9) d CTC^%X364(%1,%2,%3,%4,%5,%6,%7,%8,%9) q
96+
CUB(%1) d CUB^%X364(%1) q
97+
CUD(%1) d CUD^%X364(%1) q
98+
CUF(%1) d CUF^%X364(%1) q
99+
CUP(%2,%1) d CUP^%X364(%2,%1) q
100+
CUU(%1) d CUU^%X364(%1) q
101+
CVT(%1) d CVT^%X364(%1) q
102+
DA d DA^%X364 q
103+
DAQ(%1,%2,%3,%4,%5,%6,%7,%8,%9) d DAQ^%X364(%1,%2,%3,%4,%5,%6,%7,%8,%9) q
104+
DCH(%1) d DCH^%X364(%1) q
105+
DCS d DCS^%X364 q
106+
DL(%1) d DL^%X364(%1) q
107+
DMI d DMI^%X364 q
108+
DSR(%1) d DSR^%X364(%1) q
109+
EA(%1) d EA^%X364(%1) q
110+
ECH(%1) d ECH^%X364(%1) q
111+
ED(%1) d ED^%X364(%1) q
112+
EF(%1) d EF^%X364(%1) q
113+
EL(%1) d EL^%X364(%1) q
114+
EMI d EMI^%X364 q
115+
EPA d EPA^%X364 q
116+
ESA d ESA^%X364 q
117+
FNT d DNT^%X364 q
118+
GSM d GSM^%X364 q
119+
GSS d GSS^%X364 q
120+
HPA(%1) d HPA^%X364(%1) q
121+
HPR(%1) d HPR^%X364(%1) q
122+
HTJ d HTJ^%X364 q
123+
HTS d HTS^%X364 q
124+
HVP(%1,%2) d HVP^%X364(%1,%2) q
125+
ICH(%1) d ICH^%X364(%1) q
126+
IL(%1) d IL^%X364(%1) q
127+
IND d IND^%X364 q
128+
INT d INT^%X364 q
129+
JFY d JFY^%X364 q
130+
MC d MC^%X364 q
131+
MW d MW^%X364 q
132+
NEL d NEL^%X364 q
133+
NP(%1) d NP^%X364(%1) q
134+
OSC d OSC^%X364 q
135+
PLD d PLD^%X364 q
136+
PLU d PLU^%X364 q
137+
PM d PM^%X364 q
138+
PP(%1) d PP^%X364(%1) q
139+
PU1 d PU1^%X364 q
140+
PU2 d PU2^%X364 q
141+
QUAD d QUAD^%X364 q
142+
REP d REP^%X364 q
143+
RI d RI^%X364 q
144+
RIS d RIS^%X364 q
145+
RM(%1,%2,%3,%4,%5,%6,%7,%8,%9) d RM^%X364(%1,%2,%3,%4,%5,%6,%7,%8,%9) q
146+
SEM d SEM^%X364 q
147+
SGR(%1,%2,%3,%4,%5,%6,%7,%8,%9) d SGR^%X364(%1,%2,%3,%4,%5,%6,%7,%8,%9) q
148+
SL d SL^%X364 q
149+
SM(%1,%2,%3,%4,%5,%6,%7,%8,%9) d SM^%X364(%1,%2,%3,%4,%5,%6,%7,%8,%9) q
150+
SPA d SPA^%X364 q
151+
SPI d SPI^%X364 q
152+
SR d SR^%X364 q
153+
SS2 d SS2^%X364 q
154+
SS3 d SS3^%X364 q
155+
SSA d SSA^%X364 q
156+
ST d ST^%X364 q
157+
STS d STS^%X364 q
158+
SU d SU^%X364 q
159+
TBC d TBC^%X364 q
160+
TSS d TSS^%X364 q
161+
VPA(%1) d VPA^%X364(%1) q
162+
VPR(%1) d VPR^%X364(%1) q
163+
VTS d VTS^%X364 q
164+
85165
PrepareOutput(data)
86166
Try { Set data=$zconvert(data, "O", "UTF8") } Catch { }
87167
quit data
@@ -164,13 +244,15 @@ wstr(s)
164244
do WriteMessage("O#"_s)
165245
do ##class(%Device).ReDirectIO($$$YES)
166246
set $X = $X + $LENGTH(s)
247+
set $Y = $Y - 1
167248
quit
168249

169250
wchr(c)
170251
do ##class(%Device).ReDirectIO($$$NO)
171252
do WriteMessage("O#"_$c(c))
172253
do ##class(%Device).ReDirectIO($$$YES)
173254
set $X = $X + 1
255+
set $Y = $Y - 1
174256
quit
175257

176258
wnl
@@ -861,11 +943,8 @@ Method Server() As %Status
861943

862944
do ..SendData("1", ..ConstClientAuthorizationStatus)
863945
do ..SendData(..CurrentNamespace, ..ConstClientChangeNamespace)
864-
865-
//open $io:(/NOXY:/BREAK):"^" _ ..InitialZName // switch to routine
946+
866947
use $io:(/NOXY:/BREAK):"^" _ ..InitialZName
867-
//OPEN $IO:(80:"BFU":$CHAR(13)) // :"^" _ ..InitialZName
868-
//USE $IO:(80:"BFU":$CHAR(13)):"^" _ ..InitialZName
869948
do ..ClientLoop()
870949

871950
} else {

webSource/js/TerminalController.js

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,7 @@ TerminalController.prototype.internalCommand = function (query) {
363363
});
364364

365365
if (!this.internalCommands.hasOwnProperty(command)) {
366-
this.TERMINAL.output.print(this._lc.get(17, command) + "\r\n");
367-
return true;
366+
return false;
368367
}
369368

370369
if (this.internalCommands[command].call(this, args) === false) {
@@ -422,10 +421,7 @@ TerminalController.prototype.terminalQuery = function (query) {
422421
*/
423422
TerminalController.prototype.mergeAutocompleteFile = function (namespace) {
424423

425-
var autocomplete = this.TERMINAL.autocomplete,
426-
_this = this,
427-
p, sp,
428-
i = 0;
424+
var _this = this;
429425

430426
_this.TERMINAL.output.printSync(this._lc.get(18, namespace) + "\r\n");
431427

@@ -434,36 +430,12 @@ TerminalController.prototype.mergeAutocompleteFile = function (namespace) {
434430
if (data) {
435431

436432
_this.autocompleteController.registerObject(namespace, data);
437-
438-
// if (data["class"]) {
439-
// for (p in data["class"]) {
440-
// autocomplete.register(autocomplete.TYPES.class, p, namespace);
441-
// for (sp in data["class"][p]) {
442-
// autocomplete.register(autocomplete.TYPES.subclass, sp, namespace, [p]);
443-
// }
444-
// ++i;
445-
// }
446-
// }
447-
//
448-
// _this.TERMINAL.output.print(_this._lc.get(19, i) + "\r\n");
449-
// i = 0;
450-
//
451-
// if (data["global"]) {
452-
// for (p in data["global"]) {
453-
// autocomplete.register(autocomplete.TYPES.globals, p, namespace);
454-
// ++i;
455-
// }
456-
// }
457-
//
458-
// _this.TERMINAL.output.print(_this._lc.get(20, i) + "\r\n");
459-
460433
_this.clientAction["PROMPT"].call(_this, _this.NAMESPACE);
461434

462435
} else {
463436

464437
_this.TERMINAL.output.print(_this._lc.get(21) + "\r\n");
465438
_this.clientAction["PROMPT"].call(_this, _this.NAMESPACE);
466-
//_this.server.send(_this.SERVER_ACTION.AUTOCOMPLETE);
467439

468440
}
469441

webSource/js/TerminalLocalization.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ var TerminalLocalization = function (TERMINAL) {
178178
ru: "Caché WEB Terminal v%s\r\nПроверка обновлений..."
179179
},
180180
17: {
181-
en: "Unknown internal command \"%s\".",
182-
ru: "Неизвестная внутренняя комманда \"%s\"."
181+
en: "",
182+
ru: ""
183183
},
184184
18: {
185185
en: "Merging autocomplete database for %s...",

0 commit comments

Comments
 (0)