Skip to content

Commit d02c7ba

Browse files
committed
Merge branch 'develop'
2 parents 7010d2e + 0e374a5 commit d02c7ba

39 files changed

+5409
-5257
lines changed

3ce/background.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
vm.screenbuffer = ""; // type() to screenbuffer before I/O ready; self-test needs it too.
1414
vm.selftest_visible = true; // Dummy, background page does not have a display.
1515
// vm.type() is the master typing or printing function.
16-
// The type() called in code ... end-code is defined in the kernel jeforth.js.
16+
// The type() called in code ... end-code is defined in the kernel projectk.js.
1717
// type to vm.screenbuffer, although background page has no display.
1818
vm.type = function (s) {
1919
try {
@@ -26,14 +26,14 @@
2626
}
2727

2828
// vm.panic() is the master panic handler. The panic() function defined in
29-
// project-k kernel jeforth.js is the one called in code ... end-code.
29+
// project-k kernel projectk.js is the one called in code ... end-code.
3030
vm.panic = function(state){
3131
vm.type(state.msg);
3232
if (state.serious) debugger;
3333
}
3434

3535
// Even in 3ce background page we still need the panic() function below
36-
// but we can't see the one in jeforth.js so one is defined here for convenience.
36+
// but we can't see the one in projectk.js so one is defined here for convenience.
3737
function panic(msg,level) {
3838
var state = {
3939
msg:msg, level:level

3ce/ce.f

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ function ce3_host_onmessage (message, sender, sendResponse) {
248248
tabid {} js: tos().file="js/jquery-1.11.2.js" inject drop
249249
then
250250
tabid {} js: tos().file="js/version.js" inject drop
251-
tabid {} js: tos().file="project-k/jeforth.js" inject drop
251+
tabid {} js: tos().file="project-k/projectk.js" inject drop
252252

253253
\ Inject the main program of jeforrth.3ce (jeforth.3htm.js equivalent)
254254
<ce>
@@ -259,7 +259,7 @@ function ce3_host_onmessage (message, sender, sendResponse) {
259259
// We need to help it a little as the following example:
260260

261261
(function(){
262-
// vm.minor_version = 204; // 3ce target page minor version. major version is from jeforth.js kernel.204; // 3ce target page minor version. major version is from jeforth.js kernel.
262+
// vm.minor_version = 204; // 3ce target page minor version. major version is from projectk.js kernel.204; // 3ce target page minor version. major version is from projectk.js kernel.
263263
vm.minor_version = jeforth3we_minor_version;
264264
var version = vm.version = parseFloat(vm.major_version+"."+vm.minor_version);
265265
vm.appname = "jeforth.3ce"; // 不要動, jeforth.3we kernel 用來分辨不同 application。
@@ -300,12 +300,12 @@ function target_f7_handler (message, sender, sendResponse) {
300300
};
301301
302302
// vm.panic() is the master panic handler. The panic() function defined in
303-
// project-k kernel jeforth.js is the one called in code ... end-code.
303+
// project-k kernel projectk.js is the one called in code ... end-code.
304304
vm.panic = function(state){
305305
vm.type(state.msg);
306306
if (state.serious) debugger;
307307
}
308-
// We need the panic() function below but we can't see the one in jeforth.js
308+
// We need the panic() function below but we can't see the one in projectk.js
309309
// so one is defined here for convenience.
310310
function panic(msg,level) {
311311
var state = {

3ce/jeforth.3ce.background.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<title>jeforth.3ce background page</title>
55
<script src="js/jquery-1.11.2.js"></script>
6-
<Script src="project-k/jeforth.js"></Script>
6+
<Script src="project-k/projectk.js"></Script>
77
<script src="js/version.js"></script>
88
<Script src="3ce/background.js"></Script>
99
</head>

3ce/jeforth.3ce.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818
</style>
1919
<script src="js/jquery-1.11.2.js"></script>
20-
<script src="project-k/jeforth.js"></script>
20+
<script src="project-k/projectk.js"></script>
2121
<script src="js/version.js"></script>
2222
<script src="3ce/jeforth.3ce.js"></script>
2323
</head>

3ce/jeforth.3ce.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
kvm.selftest_visible = true; // type() refers to it.
1919

2020
// kvm.type() is the master typing or printing function.
21-
// The type() called in code ... end-code is defined in the kernel jeforth.js.
22-
// We need to use type() below, and we can't see the jeforth.js' type() so one
21+
// The type() called in code ... end-code is defined in the kernel projectk.js.
22+
// We need to use type() below, and we can't see the projectk.js' type() so one
2323
// is also defined here, even just for a few convenience. The two type() functions
2424
// are both calling the same kvm.type().
2525
var type = kvm.type = function (s) {
@@ -33,12 +33,12 @@
3333
}
3434

3535
// kvm.panic() is the master panic handler. The panic() function defined in
36-
// project-k kernel jeforth.js is the one called in code ... end-code.
36+
// project-k kernel projectk.js is the one called in code ... end-code.
3737
kvm.panic = function(state){
3838
type(state.msg);
3939
if (state.serious) debugger;
4040
}
41-
// We need the panic() function below but we can't see the one in jeforth.js
41+
// We need the panic() function below but we can't see the one in projectk.js
4242
// so one is defined here for convenience.
4343
function panic(msg,level) {
4444
var state = {

3ce/target.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Program path <span id=location>location</span><br>
9797
// js: $(".console3we")[0].style.visibility="hidden"
9898

9999
// vm.type() is the master typing or printing function.
100-
// The type() called in code ... end-code is defined in the kernel jeforth.js.
100+
// The type() called in code ... end-code is defined in the kernel projectk.js.
101101
// target_type(s) types to the target page outputbox, instead of to the host page
102102
// that may be the popup page or a 3ce extension page.
103103
function target_type(s) {

3hta/f/git.f

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
\ 今利用 jeforth 來管理這些命令跟建議。平時也可以簡化指令、做筆記、為每組命令添加 help
99
\ message。不管 GitHub 再怎麼複雜難用,配合 jeforth 只要 study 一次就永遠不會再忘記了。
1010
\
11+
\ 11:36 2017-09-11 參考本程式寫成的 python multiple line input tool pykb.f
12+
\ 換台電腦跑就有點問題,一度以為 3hta 要 run as administrator 才可以,已證實不必。
13+
\
1114

1215
js> vm.appname char jeforth.3hta != [if] ?abort" Sorry! git.f is for jeforth.3hta only." \s [then]
1316
include vb.f

3hta/f/misc.hta.f

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,51 @@ Math.sign = function sign(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };
5555
( Word array ) (aliases) ;
5656
/// Used in DOS box batch program for jeforth to ignore DOS words.
5757

58+
\ ----- NIC on/off utility -----
59+
60+
19 value officeLAN // ( -- n ) DeviceID of the OA LAN NIC. Change this for your case.
61+
/// "where deviceid = 19" is for my LRV2 OA only
62+
/// Need administrator privilege, run 'dos' check title.
63+
/// Run 3HTA.bat through right click to 'Run as administrator'.
64+
/// Set NIC deviceID : "19 to officeLAN" misc.f
65+
/// Get NIC deviceID : "activeNIC :> deviceid ." wmi.f
66+
/// See all NIC devices : "list-all-nic" wmi.f
67+
68+
: (nicoff) ( -- ) \ Turn off the NIC (the certain where clause is for my LRV2 only)
69+
\ s" where deviceid = 19" getNIC :> disable()
70+
officeLAN s" where deviceid = _id_" :> replace(/_id_/,pop()) getNIC :> disable()
71+
dup if
72+
\ return 5 is failed when not an administrator
73+
." Failed! Error code " . ." . Make sure to run as an administrator." cr
74+
else
75+
drop ." NIC device turned off sucessfully." cr
76+
then ;
77+
last :: comment=tick('officeLAN').comment
78+
79+
: nicon ( -- ) \ Turn on the NIC (the certain where clause is for my LRV2 only)
80+
\ s" where deviceid = 19" getNIC :> enable()
81+
officeLAN s" where deviceid = _id_" :> replace(/_id_/,pop()) getNIC :> enable()
82+
dup if
83+
\ return 5 is failed when not an administrator
84+
." Failed! Error code " . ." . Make sure to run as an administrator." cr
85+
else
86+
drop ." NIC device turned on sucessfully." cr
87+
then ;
88+
last :: comment=tick('officeLAN').comment
89+
90+
: nicoff ( <minutes> -- ) \ Turn off the NIC 1~120 minutes, default 15 minutes
91+
CR word js> parseFloat(pop()) ( min|NaN )
92+
?dup if else 15 then \ default 15 minutes
93+
js> (tos()>=1)&&(tos()<=360) if else
94+
." Error: Given time period must be > 1 and <= 120 (minutes)." cr exit
95+
then (nicoff) ." It'll be back " dup . ." minutes later." cr 60 * 1000 *
96+
nap nicon ;
97+
/// Run (nicoff) to turn off the NIC permanently
98+
last :: comment+=tick('officeLAN').comment
5899

100+
\ : rdlan ( minutes -- ) \ Disable office LAN to use RD LAN through WiFi for a period of time that > 1 minute and <= 120 minutes
101+
\ js> (tos()>=1)&&(tos()<=120) if else ." Error: Given time period must be > 1 and <= 120 (minutes)." cr exit then
102+
\ nicoff 60 * 1000 * nap nicon ;
103+
\ last :: comment=tick('officeLAN').comment
59104

60105

3hta/f/platform.f

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
push(pathname ? pathname : "3hta/localstorage.json");
2020
execute("readTextFile");
2121
var ss = pop();
22+
if (ss=="") return; // file not found
2223
// if is from 3hta then it's utf-8 with BOM (EF BB BF) that bothers NW.js JSON.parse()
2324
// ss.charCodeAt(0)==65279 that's utf-8 BOM
2425
if (ss.charCodeAt(0)==65279) ss = ss.slice(1); // resolve the utf-8 BOM issue

0 commit comments

Comments
 (0)