-
Notifications
You must be signed in to change notification settings - Fork 149
/
Copy pathindex_template.html
117 lines (104 loc) · 4.66 KB
/
index_template.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
<!DOCTYPE html>
<html translate="no">
<head>
<title>Rom Patcher JS - Custom patcher template</title>
<meta http-equiv="content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<!-- Rom Patcher JS needed CSS/JS files -->
<link type="text/css" rel="stylesheet" href="./rom-patcher-js/style.css" media="all" />
<script type="text/javascript" src="./rom-patcher-js/RomPatcher.webapp.js"></script>
<!-- Rom Patcher JS initialization -->
<script type="text/javascript">
window.addEventListener('load', function (evt) {
try {
RomPatcherWeb.initialize({
language: 'en', //default: en
requireValidation: false
}, {
file: './my_patch.zip', //zip containing patches
name: 'Game (English v1.0)',
description: 'English fan translation for Game',
outputName: 'Game (English v1.0)', //patched ROM name
});
} catch (err) {
var message = err.message;
if (/incompatible browser/i.test(message) || /variable RomPatcherWeb/i.test(message))
message = 'Your browser is outdated and it is not compatible with this app.';
document.getElementById('rom-patcher-container').innerHTML = message;
document.getElementById('rom-patcher-container').style.color = 'red';
}
});
</script>
</head>
<body style="font: 15px 'Open Sans', sans-serif; background-color: #31343a; color: #e4e4e6;">
<header style="text-align: center">
<h1>Rom Patcher JS</h1>
<p>
This is a template that shows off Rom Patcher JS embeding capabilities. You can use this template to embed
Rom Patcher JS in your website.<br />
Take a look at the <a
href="https://github.com/marcrobledo/RomPatcher.js/blob/master/custom_patcher_template.html"
target="_blank">sourcecode</a> to see how it's done.
</p>
</header>
<!-- Rom Patcher JS container -->
<!--
The following elements are required for Rom Patcher JS to work:
#rom-patcher-input-file-rom
#rom-patcher-select-patch
#rom-patcher-button-apply
The rest of elements are informative and can be removed, though it's recommended to keep them for a better user experience.
-->
<div id="rom-patcher-container">
<div class="rom-patcher-row margin-bottom" id="rom-patcher-row-file-rom">
<div class="text-right"><label for="rom-patcher-input-file-rom" data-localize="yes">ROM file:</label></div>
<div class="rom-patcher-container-input">
<input type="file" id="rom-patcher-input-file-rom" class="empty" disabled />
</div>
</div>
<div class="margin-bottom text-selectable text-mono text-muted" id="rom-patcher-rom-info">
<div class="rom-patcher-row">
<div class="text-right">CRC32:</div>
<div class="text-truncate"><span id="rom-patcher-span-crc32"></span></div>
</div>
<div class="rom-patcher-row">
<div class="text-right">MD5:</div>
<div class="text-truncate"><span id="rom-patcher-span-md5"></span></div>
</div>
<div class="rom-patcher-row">
<div class="text-right">SHA-1:</div>
<div class="text-truncate"><span id="rom-patcher-span-sha1"></span></div>
</div>
<div class="rom-patcher-row" id="rom-patcher-row-info-rom">
<div class="text-right">ROM:</div>
<div class="text-truncate"><span id="rom-patcher-span-rom-info"></span></div>
</div>
</div>
<div class="rom-patcher-row margin-bottom" id="rom-patcher-row-file-patch">
<div class="text-right"><label for="rom-patcher-input-file-patch" data-localize="yes">Patch file:</label>
</div>
<div class="rom-patcher-container-input">
<select id="rom-patcher-select-patch"></select>
</div>
</div>
<div class="rom-patcher-row margin-bottom" id="rom-patcher-row-patch-description">
<div class="text-right text-mono text-muted" data-localize="yes">Description:</div>
<div class="text-truncate" id="rom-patcher-patch-description"></div>
</div>
<div class="rom-patcher-row margin-bottom text-selectable text-mono text-muted"
id="rom-patcher-row-patch-requirements">
<div class="text-right text-mono" id="rom-patcher-patch-requirements-type">ROM requirements:</div>
<div class="text-truncate" id="rom-patcher-patch-requirements-value"></div>
</div>
<div class="text-center" id="rom-patcher-row-apply">
<div id="rom-patcher-row-error-message" class="margin-bottom"><span id="rom-patcher-error-message"></span>
</div>
<button id="rom-patcher-button-apply" data-localize="yes" disabled>Apply patch</button>
</div>
</div>
<div id="rom-patcher-powered" class="text-center">
<a href="https://github.com/marcrobledo/RomPatcher.js" target="_blank"><img
src="rom-patcher-js/assets/powered_by_rom_patcher_js.png" loading="lazy" />Powered by Rom Patcher JS</a>
</div>
</body>
</html>