-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstringGen.html
275 lines (256 loc) · 15.5 KB
/
stringGen.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
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<link rel="icon" type="image/png" href="./favicon.png" />
<title>Arma 3 Server Config Generator</title>
<!-- Bootstrap core CSS -->
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous"
/>
<style>
@media screen and (min-width: 1610px) {
.lateralNav {
position: fixed;
/*background-color: rgb(250, 250, 250);*/
width: 230px;
max-width: 230px;
height: auto;
top: 50%;
right: 2%;
/*border-radius: 5px 5px 5px 5px;
border: 1px solid rgb(220, 220, 220);*/
}
}
fieldset {
margin-bottom: 20px;
}
@media screen and (max-width: 1610px) {
.lateralNav {
display: none;
}
}
.badge-danger {
background-color: rgb(255, 87, 87);
}
.disclaimer {
color: rgb(192, 192, 192);
font-size: 11px;
}
</style>
</head>
<body cz-shortcut-listen="true" data-spy="scroll">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="https://byjokese.com">By-Jokese</a>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="index.html">Server Config</a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.html">Presets</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="stringGen.html"
>Mod String
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://ko-fi.com/byjokese">Donate</a>
</li>
</ul>
<ul class="pull-right">
<div id="google_translate_element"></div>
</ul>
</div>
</nav>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h1 class="display-3">Arma 3 Mod String Generator</h1>
<h2>
<span class="badge badge-danger">BETA</span>
</h2>
<p>Generate your mods strings easily.</p>
<p>
<a class="btn btn-primary btn-lg" href="https://github.com/byjokese/Arma-Server-Config-Generator" role="button"
>Learn more »</a
>
</p>
</div>
</div>
<div class="container">
<!-- Example row of columns -->
<div class="row">
<div class="col-sm">
<span id="error" style="color:red"></span>
<form action="javascript:generateModString();">
<fieldset>
<a id="LoadFile" name="LoadFile"></a>
<h2>Load File</h2>
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input" id="fileInput" accept=".html, .htm" required />
<label id="fileInputlabel" class="custom-file-label" for="fileInput">Choose file</label>
</div>
<!--<div class="input-group-append">
<button class="btn btn-primary" type="submit">Generate</button>
</div>-->
</div>
<small id="hostnameHelp" class="form-text text-muted">Load the .html file generated by Arma 3 Launcher.</small>
</fieldset>
<fieldset>
<a id="LoadFile" name="LoadFile"></a>
<h2>Result</h2>
<div class="form-group">
<label for="result">Generated Mod String</label>
<textarea
class="form-control"
rows="4"
name="result"
id="result"
aria-describedby="resultHelp"
placeholder=""
readonly
></textarea>
<small id="resultHelp" class="form-text text-muted">Result generated by our system.</small>
<button class="btn btn-light" style="float:right" onclick="copyText()">Copy Result</button>
</div>
</fieldset>
<button type="submit" class="btn btn-success" onclick="" style="margin-top:10px;">Generate</button>
</form>
</div>
</div>
<hr />
<!--<div class="row">-->
<footer
class="row"
style="display: flex;flex-wrap: nowrap;justify-content:space-between;margin-bottom: 20px;padding-left: 15px;padding-right: 15px;"
>
<span>© By-Jokese 2017-2018</span>
<span>
<small>
<a href="disclaimer.html" class="disclaimer">Read our Disclaimer </a>
</small>
</span>
<a href="https://ko-fi.com/byjokese" target="_blank">
<img
height="36"
style="border:0px;height:36px;"
src="https://az743702.vo.msecnd.net/cdn/kofi2.png?v=0"
border="0"
alt="Buy Me a Coffee at ko-fi.com"
/>
</a>
</footer>
</div>
<!--</div>-->
<!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script
src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"
></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"
></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="js/ie10-viewport-bug-workaround.js"></script>
<script src="https://cdn.rawgit.com/janl/mustache.js/master/mustache.min.js"></script>
<script src="js/generateConfigFile.js"></script>
<script>
var input, file, fr;
function generateModString() {
console.log("Generating Mod String");
if (typeof window.FileReader !== "function") {
console.log("The file API isn't supported on this browser yet.");
return;
}
input = document.getElementById("fileInput");
if (!input) {
console.log("Um, couldn't find the fileinput element.");
} else if (!input.files) {
console.log("This browser doesn't seem to support the `files` property of file inputs.");
} else if (!input.files[0]) {
console.log("Please select a file before clicking 'Generate'");
} else {
file = input.files[0];
fr = new FileReader();
fr.onload = receivedText;
fr.onerror = showError;
fr.readAsText(file);
console.clear();
}
}
function receivedText() {
document.getElementById("error").innerHTML = "";
var modString = "";
doc = new DOMParser().parseFromString(fr.result, "text/xml");
console.log(doc.querySelector("meta"));
if (doc.querySelector("meta") != null) {
if (
doc.querySelector("meta").outerHTML == '<meta name="arma:Type" content="preset"/>' ||
doc.querySelector("meta").outerHTML == '<meta name="arma:Type" content="list"/>'
) {
var rows = doc.querySelector("table").querySelectorAll("tr");
[].forEach.call(rows, function(row) {
modString += "@" + row.children[0].textContent + ";";
});
document.getElementById("result").innerHTML = modString;
//beep();
}
} else {
showError();
}
}
function showError() {
document.getElementById("error").innerHTML =
"The selected document is not a valid Arma 3 Mod Preset/List file. Use a file that has been generated by Arma 3 Launcher.";
console.clear();
}
function copyText() {
document.getElementById("result").select();
document.execCommand("copy");
}
$("#fileInput").change(function(e) {
document.getElementById("fileInputlabel").innerHTML = document.getElementById("fileInput").files[0].name;
generateModString();
});
function beep() {
var snd = new Audio(
"data:audio/wav;base64,//uQRAAAAWMSLwUIYAAsYkXgoQwAEaYLWfkWgAI0wWs/ItAAAGD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iMy7hUVFhIaCrNQsKkTIsLivwKKigsj8XYlwt/WKi2N4d//uQRCSAAjURNIHpMZBGYiaQPSYyAAABLAAAAAAAACWAAAAApUF/Mg+0aohSIRobBAsMlO//Kk4soosy1JSFRYWaLC4qZBYWFRGZdwqKiwkNBVmoWFSJkWFxX4FFRQWR+LsS4W/rFRb/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////VEFHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU291bmRib3kuZGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjAwNGh0dHA6Ly93d3cuc291bmRib3kuZGUAAAAAAAAAACU="
);
snd.play();
}
</script>
</body>
</html>