profoundjs 7.14.1 → 7.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/htdocs/profoundui/proddata/js/designer.js +3658 -3656
- package/htdocs/profoundui/proddata/js/key_management.js +2 -0
- package/htdocs/profoundui/proddata/js/rich-display-react-component.js +1 -0
- package/htdocs/profoundui/proddata/js/runtime.js +1486 -1486
- package/htdocs/profoundui/userdata/custom/themes/enhanced.js +15 -18
- package/htdocs/profoundui/userdata/custom/themes/hybrid.js +14 -17
- package/htdocs/profoundui/userdata/custom/themes/standard.js +12 -15
- package/htdocs/profoundui/userdata/custom/widgets/googlemaps.js +26 -42
- package/htdocs/profoundui/userdata/custom/widgets/listbox.js +6 -10
- package/htdocs/profoundui/userdata/custom/widgets/panel.js +20 -29
- package/htdocs/profoundui/userdata/custom/widgets/styled_button.js +19 -26
- package/htdocs/profoundui/userdata/custom/widgets/tabpanel.js +23 -30
- package/htdocs/profoundui/userdata/genie skins/Classic/custom.js +3 -3
- package/htdocs/profoundui/userdata/genie skins/Gradient/adjusted columns custom.js +57 -57
- package/htdocs/profoundui/userdata/genie skins/Gradient/custom.js +57 -57
- package/htdocs/profoundui/userdata/genie skins/Hybrid/custom.js +135 -143
- package/htdocs/profoundui/userdata/genie skins/Plain/custom.js +1 -3
- package/htdocs/profoundui/userdata/genie skins/Skyline/adjusted columns custom.js +70 -70
- package/htdocs/profoundui/userdata/genie skins/Skyline/custom.js +69 -69
- package/htdocs/profoundui/userdata/genie skins/Tablet/custom.js +20 -56
- package/htdocs/profoundui/userdata/samples/ordentry/OrdEntry.js +26 -27
- package/htdocs/vlog/rpglog.js +47 -46
- package/htdocs/vlog/vlog.js +50 -50
- package/package.json +1 -2
- package/profound.jse +1 -1
- package/setup/pjsdist.savf +0 -0
|
@@ -1,86 +1,87 @@
|
|
|
1
|
-
|
|
1
|
+
// eslint-disable-next-line no-unused-vars
|
|
2
2
|
function customize() {
|
|
3
|
-
|
|
4
3
|
// Customize Sign-On Screen
|
|
5
|
-
if (detectScreen(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
hideElements(
|
|
10
|
-
|
|
11
|
-
changeElementValue(
|
|
12
|
-
changeElementClass(
|
|
13
|
-
changeElementValue(
|
|
14
|
-
changeElementClass(
|
|
15
|
-
setDOMAttribute("D_7_17", "transparent", true);
|
|
4
|
+
if (detectScreen("D_1_23", " Sign On",
|
|
5
|
+
"D_2_48", "System . . . . . :",
|
|
6
|
+
"D_3_48", "Subsystem . . . . :",
|
|
7
|
+
"D_4_48", "Display . . . . . :")) {
|
|
8
|
+
hideElements("D_1_23", "D_2_48", "D_3_48", "D_4_48", "D_2_70", "D_3_70", "D_4_70", "I_11_53", "I_12_53", "D_11_17", "D_12_17",
|
|
9
|
+
"D_8_17", "D_9_17", "D_10_17", "I_8_53", "I_9_53", "I_10_53", "D_24_40");
|
|
10
|
+
changeElementValue("D_6_17", " User:");
|
|
11
|
+
changeElementClass("D_6_17", "BigText");
|
|
12
|
+
changeElementValue("D_7_17", "Password:");
|
|
13
|
+
changeElementClass("D_7_17", "BigText");
|
|
14
|
+
setDOMAttribute("D_7_17", "transparent", true);
|
|
16
15
|
setDOMAttribute("D_6_17", "transparent", true);
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
loginButton.onclick = function() {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
getObj(
|
|
26
|
-
getObj(
|
|
27
|
-
getObj(
|
|
28
|
-
getObj(
|
|
29
|
-
getObj(
|
|
30
|
-
getObj(
|
|
31
|
-
getObj(
|
|
32
|
-
getObj(
|
|
17
|
+
const loginButton = newElement(11, 42, "button", "Login", "login_button");
|
|
18
|
+
loginButton.onclick = function() {
|
|
19
|
+
pressKey("Enter");
|
|
20
|
+
};
|
|
21
|
+
moveElement("quit_button", 11, 50);
|
|
22
|
+
changeElementValue("quit_button", "Exit");
|
|
23
|
+
|
|
24
|
+
getObj("D_6_17").style.top = "157px"; // User Label
|
|
25
|
+
getObj("D_6_17").style.left = "63px";
|
|
26
|
+
getObj("D_7_17").style.top = "196px"; // Password Label
|
|
27
|
+
getObj("D_7_17").style.left = "63px";
|
|
28
|
+
getObj("I_6_53").style.top = "154px"; // User Textbox
|
|
29
|
+
getObj("I_6_53").style.left = "335px";
|
|
30
|
+
getObj("I_7_53").style.top = "193px"; // Password Textbox
|
|
31
|
+
getObj("I_7_53").style.left = "335px";
|
|
32
|
+
getObj("I_6_53").style.width = "90px";
|
|
33
|
+
getObj("I_7_53").style.width = "90px";
|
|
33
34
|
|
|
34
35
|
// Format signon differently when using 128 char passwords:
|
|
35
|
-
if (getObj("I_7_53")!=null
|
|
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
|
-
|
|
36
|
+
if (getObj("I_7_53") != null &&
|
|
37
|
+
getObj("I_8_1") != null &&
|
|
38
|
+
getObj("I_9_1") != null) {
|
|
39
|
+
let pwlength = 0;
|
|
40
|
+
pwlength = getObj("I_7_53").fieldInfo.size;
|
|
41
|
+
pwlength += getObj("I_8_1").fieldInfo.size;
|
|
42
|
+
pwlength += getObj("I_9_1").fieldInfo.size;
|
|
43
|
+
if (pwlength == 128) {
|
|
44
|
+
getObj("D_6_17").style.top = "137px"; // User Label
|
|
45
|
+
getObj("D_6_17").style.left = "52px";
|
|
46
|
+
getObj("D_7_17").style.top = "183px"; // Password Label
|
|
47
|
+
getObj("D_7_17").style.left = "52px";
|
|
48
|
+
getObj("I_6_53").style.top = "137px"; // User Textbox
|
|
49
|
+
getObj("I_6_53").style.left = "324px";
|
|
50
|
+
getObj("I_7_53").style.top = "183px"; // Password Line 1 Textbox
|
|
51
|
+
getObj("I_7_53").style.left = "324px";
|
|
52
|
+
getObj("I_7_53").style.width = "150px";
|
|
53
|
+
getObj("I_8_1").style.top = "209px"; // Password Line 2 Textbox
|
|
54
|
+
getObj("I_8_1").style.left = "324px";
|
|
55
|
+
getObj("I_8_1").style.width = "150px";
|
|
56
|
+
getObj("I_9_1").style.top = "234px"; // Password Line 3 Textbox
|
|
57
|
+
getObj("I_9_1").style.left = "324px";
|
|
58
|
+
getObj("I_9_1").style.width = "150px";
|
|
59
|
+
getObj("login_button").style.top = "270px"; // Login Button
|
|
60
|
+
getObj("login_button").style.left = "324px";
|
|
61
|
+
if (getObj("quit_button") != null) {
|
|
62
|
+
getObj("quit_button").style.top = "270px"; // Quit Button
|
|
63
|
+
getObj("quit_button").style.left = "400px";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
const backdrop = newElement(5, 15, "img", "/profoundui/userdata/genie skins/skyline/login.jpg", "backdrop_image");
|
|
68
69
|
backdrop.style.zIndex = 5;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (msg!=
|
|
70
|
+
|
|
71
|
+
const msg = get("D_24_1");
|
|
72
|
+
if (msg != "" && pui.genie.alertMsg == "") {
|
|
72
73
|
pui.genie.alertMsg = msg;
|
|
73
|
-
if (pui.genie.alertMsg.substr(0,3) ==
|
|
74
|
-
if (pui.genie.alertMsg.substr(0,1) ==
|
|
74
|
+
if (pui.genie.alertMsg.substr(0, 3) == "CPF") pui.genie.alertMsg = pui.genie.alertMsg.substr(8);
|
|
75
|
+
if (pui.genie.alertMsg.substr(0, 1) == "-") pui.genie.alertMsg = pui.genie.alertMsg.substr(1);
|
|
75
76
|
}
|
|
76
|
-
hideElement(
|
|
77
|
+
hideElement("D_24_1");
|
|
77
78
|
}
|
|
78
|
-
pui["loading animation"]["css"] =
|
|
79
|
+
pui["loading animation"]["css"] = "pui-skyline-animation";
|
|
79
80
|
// Customize 132x27 mode
|
|
80
|
-
if (pui.genie.displaySize==132 && !pui.genie.config.useAjax) {
|
|
81
|
+
if (pui.genie.displaySize == 132 && !pui.genie.config.useAjax) {
|
|
81
82
|
pui.genie.middleDiv.style.height = "640px";
|
|
82
83
|
getObj("5250").style.position = "absolute";
|
|
83
|
-
|
|
84
|
+
let position = (screen.width - 1060) / 2;
|
|
84
85
|
if (position < 0) position = 0;
|
|
85
86
|
getObj("5250").style.left = position + "px";
|
|
86
87
|
}
|
|
@@ -93,5 +94,4 @@ function customize() {
|
|
|
93
94
|
getObj("5250").style.width = "";
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
|
-
|
|
97
97
|
}
|
|
@@ -1,116 +1,88 @@
|
|
|
1
|
-
|
|
2
1
|
pui["close browser text"] = "To complete the log off process, please close your browser.";
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
const Tab = {};
|
|
5
4
|
Tab.autoHideKeypad = true; // Set this to close the keypad (or not) after pressing a key.
|
|
6
5
|
|
|
7
6
|
Tab.rendered = false;
|
|
8
|
-
Tab.container;
|
|
9
|
-
Tab.multX;
|
|
10
|
-
Tab.multY;
|
|
11
7
|
Tab.multXWide = 7.5;
|
|
12
8
|
Tab.multYWide = 20;
|
|
13
9
|
|
|
14
10
|
Tab.sizeDisplay = function() {
|
|
15
|
-
|
|
16
11
|
if (!Tab.rendered) {
|
|
17
|
-
|
|
18
12
|
Tab.container = document.getElementById("main");
|
|
19
13
|
Tab.multX = pui.multX;
|
|
20
14
|
Tab.multY = pui.multY;
|
|
21
15
|
Tab.rendered = true;
|
|
22
|
-
|
|
23
16
|
}
|
|
24
17
|
|
|
25
18
|
// Assign classes and adjust multipliers for screen size and display mode.
|
|
26
|
-
|
|
19
|
+
let cls;
|
|
27
20
|
if (screen.width <= 768) {
|
|
28
|
-
|
|
29
21
|
cls = "lowres-";
|
|
30
|
-
|
|
31
22
|
}
|
|
32
23
|
else {
|
|
33
|
-
|
|
34
24
|
cls = "highres-";
|
|
35
|
-
|
|
36
25
|
}
|
|
37
|
-
|
|
26
|
+
|
|
38
27
|
if (pui.genie.displaySize == 132) {
|
|
39
|
-
|
|
40
28
|
pui.multX = Tab.multXWide;
|
|
41
29
|
pui.multY = Tab.multYWide;
|
|
42
30
|
document.body.className = cls + "wide";
|
|
43
|
-
|
|
44
31
|
}
|
|
45
32
|
else {
|
|
46
|
-
|
|
47
33
|
pui.multX = Tab.multX;
|
|
48
34
|
pui.multY = Tab.multY;
|
|
49
|
-
document.body.className = cls + "normal";
|
|
50
|
-
|
|
35
|
+
document.body.className = cls + "normal";
|
|
51
36
|
}
|
|
52
|
-
|
|
53
|
-
}
|
|
37
|
+
};
|
|
54
38
|
|
|
55
39
|
Tab.showKeypad = function(e) {
|
|
56
|
-
|
|
57
40
|
e = e || window.event;
|
|
58
|
-
|
|
41
|
+
|
|
59
42
|
document.getElementById("keypad").style.display = "block";
|
|
60
|
-
|
|
43
|
+
|
|
61
44
|
if (e.preventDefault) e.preventDefault();
|
|
62
45
|
if (e.stopPropagation) e.stopPropagation();
|
|
63
46
|
e.cancelBubble = true;
|
|
64
47
|
e.returnValue = false;
|
|
65
48
|
return false;
|
|
66
|
-
|
|
67
|
-
}
|
|
49
|
+
};
|
|
68
50
|
|
|
69
51
|
Tab.hideKeypad = function(e) {
|
|
70
|
-
|
|
71
52
|
e = e || window.event;
|
|
72
53
|
|
|
73
54
|
document.getElementById("keypad").style.display = "none";
|
|
74
|
-
|
|
55
|
+
|
|
75
56
|
if (e.preventDefault) e.preventDefault();
|
|
76
57
|
if (e.stopPropagation) e.stopPropagation();
|
|
77
58
|
e.cancelBubble = true;
|
|
78
59
|
e.returnValue = false;
|
|
79
60
|
return false;
|
|
80
|
-
|
|
81
|
-
}
|
|
61
|
+
};
|
|
82
62
|
|
|
83
63
|
Tab.pressKey = function(key, e) {
|
|
84
|
-
|
|
85
64
|
e = e || window.event;
|
|
86
65
|
|
|
87
66
|
if (key == "Help" && pui["5250"]["state"] == "P") {
|
|
88
|
-
|
|
89
67
|
key = "ErrorHelp";
|
|
90
|
-
|
|
91
68
|
}
|
|
92
69
|
|
|
93
70
|
pressKey(key);
|
|
94
|
-
|
|
71
|
+
|
|
95
72
|
if (Tab.autoHideKeypad == true) {
|
|
96
|
-
|
|
97
73
|
Tab.hideKeypad(e);
|
|
98
|
-
|
|
99
74
|
}
|
|
100
75
|
else {
|
|
101
|
-
|
|
102
76
|
if (e.preventDefault) e.preventDefault();
|
|
103
77
|
if (e.stopPropagation) e.stopPropagation();
|
|
104
78
|
e.cancelBubble = true;
|
|
105
79
|
e.returnValue = false;
|
|
106
80
|
return false;
|
|
107
|
-
|
|
108
81
|
}
|
|
109
|
-
|
|
110
|
-
}
|
|
82
|
+
};
|
|
111
83
|
|
|
84
|
+
// eslint-disable-next-line no-unused-vars
|
|
112
85
|
function beforeLoad() {
|
|
113
|
-
|
|
114
86
|
// Hide content area until screen has rendered.
|
|
115
87
|
document.getElementById("5250").style.visibility = "hidden";
|
|
116
88
|
|
|
@@ -118,36 +90,28 @@ function beforeLoad() {
|
|
|
118
90
|
document.getElementById("main").style.display = "block";
|
|
119
91
|
|
|
120
92
|
Tab.sizeDisplay();
|
|
121
|
-
|
|
122
93
|
}
|
|
123
94
|
|
|
95
|
+
// eslint-disable-next-line no-unused-vars
|
|
124
96
|
function customize() {
|
|
125
|
-
pui["loading animation"]["css"] =
|
|
126
|
-
|
|
97
|
+
pui["loading animation"]["css"] = "pui-tablet-animation";
|
|
98
|
+
const userDiv = document.getElementById("user");
|
|
127
99
|
if (userDiv) {
|
|
128
|
-
|
|
129
100
|
if (pui.appJob.user != "") {
|
|
130
|
-
|
|
131
|
-
userDiv.innerHTML = "User: " + pui.appJob.user;
|
|
132
|
-
|
|
101
|
+
userDiv.innerHTML = "User: " + pui.appJob.user;
|
|
133
102
|
}
|
|
134
103
|
else {
|
|
135
|
-
|
|
136
104
|
userDiv.innerHTML = "";
|
|
137
|
-
|
|
138
105
|
}
|
|
139
|
-
|
|
140
106
|
}
|
|
141
|
-
|
|
142
|
-
|
|
107
|
+
|
|
108
|
+
const quitButton = document.getElementById("quit_button");
|
|
143
109
|
if (quitButton) {
|
|
144
|
-
|
|
145
110
|
quitButton.style.width = "75px";
|
|
146
|
-
|
|
147
111
|
}
|
|
148
|
-
|
|
149
112
|
}
|
|
150
113
|
|
|
114
|
+
// eslint-disable-next-line no-unused-vars
|
|
151
115
|
function afterLoad() {
|
|
152
116
|
|
|
153
117
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var oe = {}; // namespace for order entry application
|
|
1
|
+
const oe = {}; // namespace for order entry application
|
|
3
2
|
|
|
4
3
|
oe.forceOffline = false;
|
|
5
4
|
|
|
@@ -13,44 +12,44 @@ oe.headerData = {};
|
|
|
13
12
|
|
|
14
13
|
// show offline order entry screen
|
|
15
14
|
oe.show = function() {
|
|
16
|
-
|
|
17
|
-
for (
|
|
15
|
+
const gridData = [];
|
|
16
|
+
for (let line = 1; line <= 10; line++) {
|
|
18
17
|
gridData.push({ "Line": line });
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"Mode": oe.offlineModeText
|
|
18
|
+
}
|
|
19
|
+
const data = {
|
|
20
|
+
"Mode": oe.offlineModeText
|
|
22
21
|
};
|
|
23
22
|
data[oe.sflName] = gridData;
|
|
24
|
-
for (
|
|
23
|
+
for (const varName in oe.headerData) {
|
|
25
24
|
data[varName] = oe.headerData[varName];
|
|
26
25
|
}
|
|
27
26
|
pui.show({
|
|
28
27
|
path: oe.localDisplayPath,
|
|
29
28
|
format: oe.ctlName,
|
|
30
|
-
data
|
|
29
|
+
data,
|
|
31
30
|
handler: function(response) {
|
|
32
31
|
if (response["btnExit"] == "1") {
|
|
33
32
|
getObj("pui").innerHTML = "Exiting order entry...";
|
|
34
33
|
if (navigator["app"] != null && navigator["app"]["exitApp"] != null) { // Check for exitApp api in PhoneGap
|
|
35
|
-
|
|
34
|
+
navigator["app"]["exitApp"]();
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
else {
|
|
39
|
-
|
|
40
|
-
for (
|
|
38
|
+
const order = {};
|
|
39
|
+
for (let varName in response) {
|
|
41
40
|
if (varName == "aid") continue;
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
let fmt = oe.sflName.toUpperCase();
|
|
42
|
+
const value = response[varName];
|
|
44
43
|
if (varName.indexOf(".") == -1) {
|
|
45
|
-
oe.headerData[varName] = value;
|
|
44
|
+
oe.headerData[varName] = value; // save header data, so it can be redisplayed
|
|
46
45
|
fmt = oe.ctlName.toUpperCase();
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
}
|
|
47
|
+
if (varName.indexOf(".rrn") >= 0) varName = "rrn";
|
|
48
|
+
else varName = varName.toUpperCase();
|
|
49
|
+
order[fmt + "." + varName] = value; // save info to local storage in the same format we post to the RPG program
|
|
51
50
|
}
|
|
52
|
-
order[oe.ctlName.toUpperCase() + ".AUTO"] = "1";
|
|
53
|
-
|
|
51
|
+
order[oe.ctlName.toUpperCase() + ".AUTO"] = "1"; // this flag indicates auto-submitted order
|
|
52
|
+
let orders = localStorage["orders"];
|
|
54
53
|
if (orders == null || orders == "") orders = [];
|
|
55
54
|
else orders = JSON.parse(orders);
|
|
56
55
|
orders.push(order);
|
|
@@ -60,7 +59,7 @@ oe.show = function() {
|
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
});
|
|
63
|
-
}
|
|
62
|
+
};
|
|
64
63
|
|
|
65
64
|
// this function is assigned to the onload event of the order entry screen
|
|
66
65
|
// it will synchrnize any orders stored in local storage when we're reconnected to the server again
|
|
@@ -70,7 +69,7 @@ oe.onload = function() {
|
|
|
70
69
|
oe.show();
|
|
71
70
|
return;
|
|
72
71
|
}
|
|
73
|
-
|
|
72
|
+
let orders = localStorage["orders"];
|
|
74
73
|
if (orders == null || orders == "") orders = [];
|
|
75
74
|
else orders = JSON.parse(orders);
|
|
76
75
|
if (orders.length == 0) {
|
|
@@ -79,15 +78,15 @@ oe.onload = function() {
|
|
|
79
78
|
}
|
|
80
79
|
return;
|
|
81
80
|
}
|
|
82
|
-
|
|
81
|
+
const order = orders.splice(0, 1)[0];
|
|
83
82
|
oe.count++;
|
|
84
83
|
localStorage["orders"] = JSON.stringify(orders);
|
|
85
84
|
pui.submitResponse(order);
|
|
86
85
|
if (orders.length == 0) {
|
|
87
|
-
|
|
86
|
+
alert(oe.count + " locally stored order(s) successfully submitted to server.");
|
|
88
87
|
}
|
|
89
|
-
}
|
|
88
|
+
};
|
|
90
89
|
|
|
91
90
|
pui.onoffline = function() {
|
|
92
91
|
oe.show();
|
|
93
|
-
}
|
|
92
|
+
};
|
package/htdocs/vlog/rpglog.js
CHANGED
|
@@ -3,55 +3,55 @@
|
|
|
3
3
|
|
|
4
4
|
let stepSpan, fileDropdown, codeContainer, PJSCodeButton, diffButton, currentStep, currentStepNumber, stepListDiv;
|
|
5
5
|
|
|
6
|
+
// eslint-disable-next-line no-unused-vars
|
|
6
7
|
function init() {
|
|
7
8
|
stepSpan = document.querySelector("span.step");
|
|
8
9
|
fileDropdown = document.querySelector("select.file-dropdown");
|
|
9
10
|
codeContainer = document.querySelector("div.code-container");
|
|
10
11
|
PJSCodeButton = document.querySelector("button.PJS-code-button");
|
|
11
12
|
diffButton = document.querySelector("button.diff-button");
|
|
12
|
-
stepListDiv = document.querySelector("div.step-list");
|
|
13
|
-
|
|
13
|
+
stepListDiv = document.querySelector("div.step-list");
|
|
14
|
+
|
|
14
15
|
fileDropdown.onchange = function() {
|
|
15
|
-
|
|
16
|
+
const entry = vlog[fileDropdown.value];
|
|
16
17
|
loadCode(entry.lines, entry.map);
|
|
17
|
-
}
|
|
18
|
-
|
|
18
|
+
};
|
|
19
|
+
|
|
19
20
|
PJSCodeButton.onclick = showPJSCodeButtonClick;
|
|
20
21
|
diffButton.onclick = showDiff;
|
|
21
22
|
|
|
22
23
|
loadFiles();
|
|
23
|
-
|
|
24
|
+
const max = vlog.log.length;
|
|
24
25
|
changeStep(max);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
|
|
28
28
|
// This is cloned from vlog.js. "Step" is actually a program name for rpglog.
|
|
29
29
|
function changeStep(stepNumber) {
|
|
30
30
|
stepListDiv.style.display = "none";
|
|
31
31
|
let text = "";
|
|
32
32
|
if (typeof stepNumber !== "number") stepNumber = Number(this.value);
|
|
33
|
-
text = "Program";
|
|
33
|
+
text = "Program";
|
|
34
34
|
stepSpan.innerText = text;
|
|
35
|
-
|
|
35
|
+
const step = vlog.log[stepNumber - 1];
|
|
36
36
|
if (!step) return;
|
|
37
37
|
currentStep = step;
|
|
38
38
|
currentStepNumber = stepNumber;
|
|
39
39
|
setFile(step.file);
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
|
|
41
|
+
const PJSCodeView = (PJSCodeButton.innerText !== "Show PJS Code");
|
|
42
42
|
|
|
43
43
|
// Remove old current-line
|
|
44
|
-
let curLine = codeContainer.querySelector("pre.current-line");
|
|
44
|
+
let curLine = codeContainer.querySelector("pre.current-line"); // get old current line
|
|
45
45
|
if (curLine) {
|
|
46
46
|
let contentEl = curLine.querySelector(".jscode");
|
|
47
47
|
if (!contentEl) contentEl = curLine;
|
|
48
48
|
curLine.classList.remove("current-line");
|
|
49
|
-
|
|
49
|
+
const lineNumberStr = contentEl.innerHTML.split(":")[0] + ": ";
|
|
50
50
|
let lines;
|
|
51
51
|
if (PJSCodeView) lines = vlog[fileDropdown.value].PJSlines;
|
|
52
52
|
else lines = vlog[fileDropdown.value].RPGlines;
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
const lineNumber = Number(lineNumberStr.trim().split(":")[0]);
|
|
54
|
+
const line = lines[lineNumber - 1].split("pjs.logToRpglog(")[0];
|
|
55
55
|
contentEl.innerHTML = lineNumberStr + hiLine(line);
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -60,21 +60,21 @@ function changeStep(stepNumber) {
|
|
|
60
60
|
if (curLine) {
|
|
61
61
|
let contentEl = curLine.querySelector(".jscode");
|
|
62
62
|
if (!contentEl) contentEl = curLine;
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
const lineNumberStr = contentEl.innerHTML.split(":")[0] + ": ";
|
|
64
|
+
// const line = step.line;
|
|
65
65
|
if (!PJSCodeView) contentEl.innerHTML = lineNumberStr + hiLine(step.line);
|
|
66
66
|
curLine.classList.add("current-line");
|
|
67
67
|
setTimeout(function() {
|
|
68
68
|
curLine.scrollIntoView({
|
|
69
|
-
behavior:
|
|
70
|
-
block:
|
|
69
|
+
behavior: "smooth",
|
|
70
|
+
block: "center"
|
|
71
71
|
});
|
|
72
72
|
}, 0);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
function hiLine(line) {
|
|
77
|
-
return "<code>" + hljs.highlight(line, {language:
|
|
77
|
+
return "<code>" + hljs.highlight(line, { language: "JavaScript" }).value + "</code>";
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
function loadFiles() {
|
|
@@ -84,19 +84,19 @@ function loadFiles() {
|
|
|
84
84
|
}
|
|
85
85
|
// Load last file
|
|
86
86
|
fileDropdown.value = file;
|
|
87
|
-
|
|
87
|
+
const entry = vlog[file];
|
|
88
88
|
loadCode(entry.lines, entry.map);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
function setFile(file) {
|
|
92
92
|
if (fileDropdown.value === file) return;
|
|
93
93
|
fileDropdown.value = file;
|
|
94
|
-
|
|
94
|
+
const entry = vlog[file];
|
|
95
95
|
loadCode(entry.lines, entry.map);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
function showPJSCodeButtonClick() {
|
|
99
|
-
|
|
99
|
+
const entry = vlog[fileDropdown.value];
|
|
100
100
|
if (!entry) return;
|
|
101
101
|
if (PJSCodeButton.innerText === "Show PJS Code") {
|
|
102
102
|
loadCode(entry.PJSlines, entry.map, true);
|
|
@@ -113,21 +113,21 @@ function showPJSCodeButtonClick() {
|
|
|
113
113
|
function loadCode(lines, map, PJScode) {
|
|
114
114
|
codeContainer.innerHTML = "";
|
|
115
115
|
if (!lines) return;
|
|
116
|
-
|
|
116
|
+
const lineNumWidth = String(lines.length).length;
|
|
117
117
|
for (let i = 0; i < lines.length; i++) {
|
|
118
118
|
let line = lines[i];
|
|
119
|
-
if (PJScode) line = line.split("pjs.logToRpglog(")[0];
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
if (PJScode) line = line.split("pjs.logToRpglog(")[0];
|
|
120
|
+
const pre = document.createElement("pre");
|
|
121
|
+
const lineNumber = i + 1;
|
|
122
|
+
const lineNumberStr = (" " + lineNumber).substr(-lineNumWidth) + ": ";
|
|
123
123
|
let html = lineNumberStr + hiLine(line);
|
|
124
124
|
if (map) {
|
|
125
125
|
let prevMapEntry = map[i - 1];
|
|
126
126
|
if (!prevMapEntry) prevMapEntry = {};
|
|
127
|
-
|
|
127
|
+
const mapEntry = map[i];
|
|
128
128
|
let rpgLine = "";
|
|
129
129
|
if (mapEntry && mapEntry.lineNum && prevMapEntry.lineNum !== mapEntry.lineNum) {
|
|
130
|
-
|
|
130
|
+
const rpgLineNumberStr = (" " + mapEntry.lineNum).substr(-6) + ": ";
|
|
131
131
|
rpgLine = rpgLineNumberStr + mapEntry.code;
|
|
132
132
|
}
|
|
133
133
|
html = `
|
|
@@ -144,34 +144,35 @@ function loadCode(lines, map, PJScode) {
|
|
|
144
144
|
else {
|
|
145
145
|
PJSCodeButton.innerText = "Show PJS Code";
|
|
146
146
|
}
|
|
147
|
-
|
|
148
147
|
}
|
|
149
148
|
|
|
150
149
|
function showDiff() {
|
|
151
|
-
|
|
150
|
+
const entry = vlog[fileDropdown.value];
|
|
152
151
|
if (!entry) return;
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
const config = { outputFormat: "side-by-side" };
|
|
153
|
+
const diffData = Diff2Html.html(Diff2Html.parse(entry.diff), config);
|
|
155
154
|
codeContainer.innerHTML = diffData;
|
|
156
155
|
codeContainer.classList.remove("hljs");
|
|
157
156
|
}
|
|
158
157
|
|
|
158
|
+
// eslint-disable-next-line no-unused-vars
|
|
159
159
|
function hideCoverage() {
|
|
160
|
-
|
|
160
|
+
const lineEls = codeContainer.children;
|
|
161
161
|
for (let i = 0; i < lineEls.length; i++) {
|
|
162
|
-
|
|
162
|
+
const el = lineEls[i];
|
|
163
163
|
el.classList.remove("covered");
|
|
164
164
|
el.onmouseover = function() {};
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
// eslint-disable-next-line no-unused-vars
|
|
168
169
|
function setupMouseOver(el) {
|
|
169
170
|
el.onmouseover = function(e) {
|
|
170
|
-
|
|
171
|
-
let html = "";
|
|
171
|
+
const steps = el.steps;
|
|
172
|
+
let html = "";
|
|
172
173
|
steps.forEach(step => {
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
const line = step.line;
|
|
175
|
+
const parts = line.split("//");
|
|
175
176
|
html += `<a href="JavaScript:changeStep(${step.stepNumber}); hideCoverage();">
|
|
176
177
|
Step ${step.stepNumber}
|
|
177
178
|
</a>
|
|
@@ -185,11 +186,11 @@ function setupMouseOver(el) {
|
|
|
185
186
|
stepListDiv.style.left = e.clientX + 5 + "px";
|
|
186
187
|
stepListDiv.style.top = e.clientY - 5 + "px";
|
|
187
188
|
stepListDiv.style.display = "";
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
el.onmouseout = stepListDiv.onmouseout = function(e) {
|
|
191
|
-
|
|
192
|
-
if (toElement === stepListDiv || stepListDiv.contains(toElement)) return;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
el.onmouseout = stepListDiv.onmouseout = function(e) {
|
|
192
|
+
const toElement = e.toElement || e.relatedTarget;
|
|
193
|
+
if (toElement === stepListDiv || stepListDiv.contains(toElement)) return;
|
|
193
194
|
stepListDiv.style.display = "none";
|
|
194
|
-
}
|
|
195
|
+
};
|
|
195
196
|
}
|