-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
216 lines (201 loc) · 7.91 KB
/
index.html
File metadata and controls
216 lines (201 loc) · 7.91 KB
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
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript">
var host = "javascripture.org";
if ((host == window.location.host) && (window.location.protocol != "https:"))
window.location.protocol = "https";
</script>
<!-- Favicon code -->
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<!-- End favicon code -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="google" content="notranslate" />
<link rel="canonical" href="https://javascripture.org" />
<link rel="manifest" href="/manifest.json">
<title>Javascripture</title>
<link rel="stylesheet" href="css/layout.css" />
</head>
<body>
<div class="errors">
<h1>Sorry :(</h1>
<br />
<p>If you can see this, something probably went wrong. <a href="javascript:clear()">Clear settings and start over</a>, <a href="https://ben.blog/contact/">Email me</a>.
<br />
<br />
<p>There are also old versions available in case this one is broken:<br />
<br />
<a href="https://javascripture.net">javascripture.net</a> | <a href="https://javascripture.xyz">javascripture.xyz</a><br />
</p>
</div>
<div id="content">
<div class="full-page">
<div id="holder" class="content">
<div class="logo">
<img src="/javascripture.svg" width="179" height="186">
<div class="intro">
<h1>Javascripture</h1>
<p>JavaScripture is a tool to help you understand the bible better.</p>
<script>
if ( localStorage ) {
document.write( '<p class="installation-info"><br />Once the scripts have loaded, they will be cached, so the app will work offline.</p>' );
}
</script>
</div>
</div>
<div class="loading">
<div class="loading-bar" id="loadingJavascripture">
Loading…
</div>
</div>
<div class="features">
<p>Having problems? <a href="http://scruffian.wordpress.com/contact/">Email me</a>, <a href="javascript:clear()">Clear settings and start over</a></p>
<p>There are also old versions available in case this one is broken:<br />
<br />
<a href="https://javascripture.net">javascripture.net</a> | <a href="https://javascripture.xyz">javascripture.xyz</a><br />
</p>
</div>
</div>
</div>
</div>
<div id="notification">A new version of this app is available. <a id="reload">Update now</a></div>
</div>
</body>
<script>
var javascripture = {
data: {},
reactHelpers: {},
};
// so we can import npm modules directly
var module = {};
var worker = new Worker('workers/worker.js');
var loadingDiv = document.getElementById( 'loadingJavascripture' );
var loadingStatus = function( resource, percentage ) {
loadingDiv.innerHTML = 'Loading ' + resource;
loadingDiv.style.width = percentage + '%';
};
var timer = new Date();
function clear() {
localStorage.clear();window.location.href="/";
}
</script>
<!-- libs -->
<script>loadingStatus( 'Libraries', 10 );</script>
<script src="lib/MorphCodes.js"></script>
<script src="lib/MorphParse.js"></script>
<script src="lib/morphgnt-parse.js"></script>
<script>loadingStatus( 'data', 20 );</script>
<script src="data/bible.js"></script>
<script>loadingStatus( 'Dictonary', 23 );</script>
<script src="data/strongs-dictionary.js"></script>
<script>loadingStatus( 'Greek dictonary', 26 );</script>
<script src="data/strongs-greek-dictionary.js"></script>
<script src="data/extra-dictionary.js"></script>
<script>loadingStatus( 'KJV', 30 );</script>
<script src="data/KJV.js"></script>
<script>javascripture.data.kjv=KJV.books</script>
<script>loadingStatus( 'Hebrew', 50 );</script>
<script src="data/morphhb.js"></script>
<script>javascripture.data.hebrew=morphhb</script>
<script>loadingStatus( 'Greek', 60 );</script>
<script src="data/tischendorf.js"></script>
<script>javascripture.data.greek=tischendorf</script>
<script>loadingStatus( 'Strongs', 70 );</script>
<script src="data/strongsObjectWithFamilies2.js"></script>
<script>loadingStatus( 'cross references', 80 );</script>
<script src="data/crossReferences.js"></script>
<script>loadingStatus( 'Literal Consistent', 90 );</script>
<script src="data/LC.js"></script>
<script>
javascripture.data.LC = literalConsistent;
</script>
<script>loadingStatus( 'interface', 95 );</script>
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-51039438-1', 'javascripture.org');
ga('send', 'pageview');
</script>
<script src="build/bundle.js"></script>
<script>
// Attach web workers
// has to come before service worker
worker.addEventListener( 'message', function( e ) {
if( e.data.task === 'search' ) {
javascripture.reactHelpers.dispatch( {
terms: e.data.parameters,
results: e.data.result,
type: 'ADD_SEARCH_RESULTS',
} );
}
if( e.data.task === 'loading' ) {
document.getElementById( 'loading' ).innerHTML = e.data.html;
}
}, false );
// Handler for messages coming from the service worker
const channel = new BroadcastChannel('sw-messages');
channel.addEventListener('message', event => {
javascripture.sw = event.data;
});
let newWorker;
// The click event on the notification
document.getElementById('reload').addEventListener('click', function(){
localStorage.clear();
newWorker.postMessage({ action: 'skipWaiting' });
});
if( 'serviceWorker' in navigator) {
navigator.serviceWorker
.register('/sw.js', { updateViaCache: 'imports' } )
.then( function( reg ) {
reg.addEventListener('updatefound', () => {
// An updated service worker has appeared in reg.installing!
newWorker = reg.installing;
newWorker.addEventListener('statechange', () => {
// Has service worker state changed?
switch (newWorker.state) {
case 'installed':
// There is a new service worker available, show the notification
if (navigator.serviceWorker.controller) {
let notification = document.getElementById('notification');
notification.style.display = 'block';
}
break;
}
});
});
});
// Handler for messages coming from the service worker
navigator.serviceWorker.addEventListener('message', function( event ) {
// Send to react
javascripture.sw = event.data;
} );
let refreshing;
// The event listener that is fired when the service worker updates
// Here we reload the page
navigator.serviceWorker.addEventListener('controllerchange', function () {
if (refreshing) return;
window.location.reload();
refreshing = true;
});
}
</script>
</html>