forked from whole-cell-tutors/meeting-report
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
113 lines (94 loc) · 4.28 KB
/
index.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
<html>
<!-- index.html file for Vireo (VIewer for REfreshed Output) -->
<head>
<script type="text/javascript">
/* ------------------------------------------------------------------------
* IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
* Vireo must be configured by setting the variables below.
* --------------------------------------------------------------------- */
/* The name of the PDF file. Put the file name in double quotes.
*/
var vireo_pdf_file = "report.pdf";
/* The name of the log file. Put the file name in double quotes. Note:
* if you are running vireo-server.py in combination with LaTeX, you will
* want to make this the LaTeX output log for the document, not Vireo's log.
*/
var vireo_log_file = "make.log";
/* Refresh interval, in seconds. BEWARE! Every window open on this page
* will repeatedly contact the server after this many seconds elapses.
* The shorter this interval, the greater the load on the server.
*/
var vireo_interval = 10;
/* ------------------------------------------------------------------------
* No configurable code below this point.
* --------------------------------------------------------------------- */
</script>
<title>Viewer for Refreshed Output</title>
<meta http-equiv="Cache-Control" content="max-age=0" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-store" />
<meta http-equiv="Cache-Control" content="must-revalidate" />
<meta http-equiv="Vary" content="*" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<script src="https://code.jquery.com/jquery-1.8.3.min.js"></script>
<script>
window.jQuery || document.write("<script " + "src='js/jquery.min.js'>" + "<" + "/script>")
</script>
<script type="text/javascript" src="js/vireo.js"></script>
<link rel="stylesheet" type="text/css" href="css/vireo.css"/>
</head>
<body id="body">
<div id="info-bar">
<span id="left-half">
<input type="submit" value="Reload"/>
</span>
<span id="right-half">
<span id="timestamp"></span><input type="button" value="View Log"/>
</span>
</div>
<iframe id="contentiframe" src="main.pdf"
style="width: 100%; height: 98%; margin: 0">
</iframe>
<script type="text/javascript">
/* Vireo JS code. I can't get things to work properly if I put this in a
separate js file. That's why it's inlined here. */
/* Set the file to be shown. */
$('#contentiframe').attr('src', vireo_pdf_file);
/* Set the initial state of the reload button */
$('input:submit').attr('disabled', true);
/* Tell the user when we last refreshed the file. */
$('#timestamp').text(timeStamp('Last reloaded at '));
/* Start watching the file for changes */
$(startCheck(vireo_pdf_file, vireo_interval, function() {
/* When the file changes, enable the button & give visual indication. */
$('input:submit').attr('disabled', false);
$('#body').css('background', 'darkred');
$('#timestamp').text(timeStamp('File change detected at '));
$('#timestamp').css('color', 'white');
}));
/* Reload the content when the button is clicked. */
$('input:submit').click(function() {
var iframe = getIframeWindow(document.getElementById('contentiframe'));
try {
/* Turns out this fails in Firefox, but works in Safari and Chrome. */
iframe.location.reload();
} catch (e) {
/* This succeeds in Firefox. It also succeeds in other browsers,
but in them, it won't cause the content of the frame to be
reloaded. (That's why we try it the other way first.) */
$('#contentiframe').attr("src", $('#contentiframe').attr("src"));
}
$('input:submit').attr('disabled', true);
$('#body').css('background-color', 'white');
$('#timestamp').text(timeStamp('Last reloaded at '));
$('#timestamp').css('color', 'black');
$(enableCheck(true));
});
/* Show the log in another window. */
$('input:button').click(function() {
openLog(window.location.href, vireo_log_file);
});
</script>
</body>
</html>