/
externalDialog.html
139 lines (104 loc) · 3.55 KB
/
externalDialog.html
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
<html><!--
Test run from app.js by calling :
showDialogInOwnWindow( 'My title', 'Hej this /n is long /n and spans mult/n iple rows', 'error'); // Type can be 'warning' (yellow) or 'error' (red border)
or
displayLongAlert('My title', 'Hej this /n is long /n and spans mult/n iple rows');
--><head>
<title>Dialog</title>
<link rel="stylesheet" type="text/css" href="color_styles.css">
<style>
html {
margin: 0px;
overflow: hidden;
}
body {
margin: 0;
padding: 0;
height: 100%;
display: grid;
grid-template-rows: 1fr auto;
border: 5px solid;
font-family: Arial;
font-size: 11px;
height: auto;
overflow: auto;
}
label {
font-family: Arial;
font-size: 9px;
}
error{
border-color: var(--err-color);
}
warning{
border-color: var(--warn-color);
}
::-webkit-scrollbar-thumb {
display: none;
}
div#outerContent {
z-index: 100;
app-region: drag;
}
div#content {
overflow-y: auto; /* add scroll bars if content exceeds div size */
overflow-wrap: anywhere;
height: fit-content;
top: 12px;
position: absolute;
left: 12px;
z-index: 200;
margin-right: 12px;
}
#titleDiv {
height: 20px;
overflow: auto;
}
#messageDiv {
height: auto;
margin-bottom: 15px;
margin-top: 10px;
}
#buttonDiv{
position: fixed;
bottom:12px;
right: 15px;
app-region: no-drag;
}
.OK-button {
}
a{
app-region: no-drag;
}
</style>
<script>
const { execSync } = require('child_process');
// Define function so that Windows, Linux, and Mac run command using bash (git-bash for Windows, normal for others)
function multiPlatformExecSync(arg){
if (process.platform === 'win32') {
return execSync( `"%PROGRAMFILES%\\Git\\bin\\sh.exe" -c " ${arg} "` )
}else{
return execSync( arg)
}
}
</script></head>
<body class=" dark error" style="position: relative;">
<div id="outerContent">
<div id="content">
<!-- Dark mode on/off-->
<script>
if (global.localState.dark){
document.body.classList.remove('light');
document.body.classList.add('dark');
}
</script>
<div id="titleDiv">
<b><div id="title">title</div></b>
</div>
<div id="messageDiv">
<div id="messageText"><code><br>
</div>
<div id="buttonDiv"> </div>
</div>
</div>
</body></html>