-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathindex.html
More file actions
126 lines (117 loc) · 4.73 KB
/
index.html
File metadata and controls
126 lines (117 loc) · 4.73 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Ren Garden</title>
<!-- Comments shouldn't come before DOCTYPE/charset -->
<!-- No HTML comment double-hyphens: https://stackoverflow.com/q/26600092/ -->
<!--
! File: %index.html
! Summary: "Main (and likely only) HTML page for the REPL project"
! Project: "JavaScript REPLpad for Ren-C branch of Rebol 3"
! Homepage: https://github.com/hostilefork/replpad-js/
!
!=============================================================================
!
! Copyright (c) 2018-2019 hostilefork.com
!
! See README.md and CREDITS.md for more information
!
! Licensed under the Lesser GPL, Version 3.0 (the "License");
! you may not use this file except in compliance with the License.
! You may obtain a copy of the License at
!
! https://www.gnu.org/licenses/lgpl-3.0.html
!
!=============================================================================
!
! It's generally the goal of the project to be a "single page", where most
! all interaction happens inside the console widget. It will have tutorials
! and such, but those will be data-driven and content written in something
! friendlier than HTML, such as MarkDown. So this may wind up being the only
! HTML page there is, with all content dynamically inserted into it.
!
! HTML Style Guide (which this should probably follow at some point)
! https://google.github.io/styleguide/htmlcssguide.html
!
!-->
<!-- Two variations for sans serif user input and monospace system output:
https://github.com/hostilefork/replpad-js/issues/13
-->
<link
href="https://fonts.googleapis.com/css?family=Inconsolata|Noto+Sans"
rel="stylesheet"
>
<!-- See https://fonts.google.com/ -->
<!-- !!! CSS for splitter is tied in with ReplPad--review strategy. -->
<!-- https://github.com/nathancahill/Split.js -->
<link rel="stylesheet" type="text/css" href="./watchlist/split.css">
<script>
let filter_stack= (txt, whitelist)=>{
whitelist= whitelist.concat([
'',
'_emscripten_sleep_with_yield',
'abort',
'emterpret',
'stackTrace'
])
txt= txt.replace(/@.*/g, '')
.replace(/_[0-9]+\n/g, '_*\n')
.replace(/\nModule\..*/g, '')
.replace(/\n.*<.*/g, '')
.replace(/\nThis error.*EMTERPRETIFY_WHITELIST.*to save it:.*/, '')
.replace(/uncaught.*/, '')
return [... new Set(txt.split('\n'))]
.filter((v)=>{
return ! whitelist.includes(v)
})
}
window.onerror=function(m,u,r,c) {
if (m.search(/This error.*EMTERPRETIFY_WHITELIST.*to save it:/) >= 0) {
fetch('https://raw.githubusercontent.com/metaeducation/ren-c/master/extensions/javascript/emterpreter.whitelist.json')
.then((res)=>{return res.json()})
.catch((err)=>{
alert('error: '+err)
return []
})
.then((whitelist)=>{
m= filter_stack(m, whitelist)
m= m.join(' ').replace(/ *$/, '')
alert('PUT IN EMTERPRETIFY_WHITELIST: '+m)
fetch(
'http://giuliolunati.altervista.org/r3/log.php?title=EMTERPRETIFY_WHITELIST&text='
+encodeURIComponent(m),
{mode: 'no-cors', method: "POST"}
)
.catch((err)=>{alert(err)})
})
} else {
m= ('{'+m+' [in '+u+ ' @ '+r+','+c+']}')
}
}
</script>
<script src="https://metaeducation.s3.amazonaws.com/travis-builds/load-r3.js"></script>
<script src="./gui.js"></script>
<!-- %load-r3.js looks for all "text/rebol" <script> tags and runs them -->
<script type="text/rebol" src="./replpad.r"></script>
<script type="text/rebol" src="./main.r"></script>
<link rel="stylesheet" type="text/css" href="replpad.css">
</head>
<body>
<div class="container">
<div id="replcontainer" class="split">
<div id="replpad">
<!-- Due to `white-space: pre;` in CSS, these can't line break -->
<!-- Placeholder image, taken from: -->
<!-- https://medium.com/@feldman238/the-quickest-and-easiest-preloader-ever-9efa975e1a50 -->
<div class="line"><img class="center" src="preload.gif"></div>
<div class="line"><b>Note: "Modern" web browser is required!</b></div>
<div class="line">If load fails, check dev console for errors (typically Ctrl-Shift-I). Repository is at <a href="https://github.com/hostilefork/replpad-js">GitHub</a></div>
<div><hr></div>
<div class="line" id="console_out"><p>%index.html fetch complete...</p></div>
</div>
</div>
</div>
</body>
</html>