Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 7c9960f

Browse files
committed
Added some content to the deployed README.
1 parent a711910 commit 7c9960f

File tree

1 file changed

+92
-2
lines changed

1 file changed

+92
-2
lines changed

deployment-files/end-user/README.html

Lines changed: 92 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,99 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>Chat Overflow README</title>
6+
<script crossorigin="anonymous"
7+
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
8+
src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
9+
10+
<!-- IMPORTANT: Only update the end-user README.file. Then plugin-dev README has to be overwritten with changed styling. -->
11+
<style>
12+
.onlyEndUser {
13+
display: block;
14+
}
15+
16+
.onlyPluginDev {
17+
display: none;
18+
}
19+
</style>
20+
21+
<!-- IMPORTANT: UPDATE THE VERSION NUMBERS HERE, FOLLOWING THE DISPLAYED VERSIONS ON STARTUP -->
22+
<script>
23+
const versions = {
24+
framework: "3.0.0",
25+
api: "3.0.0",
26+
rest: "3.0.0-3",
27+
npm: "3.0.0-3",
28+
gui: "3.0.0"
29+
};
30+
31+
const releasesEndpoint = "https://api.github.com/repos/codeoverflow-org/chatoverflow/releases";
32+
33+
function updateVersions() {
34+
$('#frameworkVersion').html(versions.framework);
35+
$('#apiVersion').html(versions.api);
36+
$('#restVersion').html(versions.rest);
37+
$('#npmVersion').html(versions.npm);
38+
$('#guiVersion').html(versions.gui);
39+
40+
$.get(releasesEndpoint, function (result) {
41+
const tag_name = result[0].tag_name;
42+
const newestVersion = tag_name.split("-")[0].split(".").map(value => parseInt(value));
43+
const currentVersion = versions.framework.split(".").map(value => parseInt(value));
44+
45+
if (newestVersion[0] > currentVersion[0] ||
46+
(newestVersion[0] === currentVersion[0] && newestVersion[1] > currentVersion[1]) ||
47+
(newestVersion[0] === currentVersion[0] && newestVersion[1] === currentVersion[1] && newestVersion[2] > currentVersion[2])) {
48+
$('#newerVersion').html(tag_name);
49+
$('#newVersionAvailable').show();
50+
}
51+
});
52+
}
53+
</script>
54+
55+
<style>
56+
#newVersionAvailable {
57+
display: none;
58+
}
59+
</style>
660
</head>
761
<body>
8-
<p>Thank you for downloading Chat Overflow! For more information, please visit <a href="http://codeoverflow.org">codeoverflow.org</a>!
9-
</p>
62+
<div class="header">
63+
<div><img alt="Chat Overflow logo"
64+
src="https://raw.githubusercontent.com/codeoverflow-org/chatoverflow/master/chatoverflow-logo.png"
65+
width="100px"></div>
66+
<div class="smallTitle">Hi, welcome to</div>
67+
<div class="bigTitle">Chat Overflow</div>
68+
<div class="deploymentType onlyEndUser" id="deploymentEndUser">END-USER-VERSION</div>
69+
<div class="deploymentType onlyPluginDev" id="deploymentPluginDev">PLUGIN-DEV-VERSION</div>
70+
</div>
71+
72+
<div class="divider"></div>
73+
74+
<div class="version">
75+
<div class="mainVersion">You have downloaded version <span id="frameworkVersion"></span></div>
76+
<div class="smallVersions">
77+
API: <span id="apiVersion"></span>
78+
REST: <span id="restVersion"></span>
79+
NPM: <span id="npmVersion"></span>
80+
GUI: <span id="guiVersion"></span>
81+
</div>
82+
<div id="newVersionAvailable">A newer version (<span id="newerVersion"></span>) is available. Please visit: TODO
83+
</div>
84+
</div>
85+
86+
<div class="divider"></div>
87+
88+
<div id="downloadInfo">Thank you for downloading Chat Overflow! For more information, please visit <a
89+
href="http://codeoverflow.org">codeoverflow.org</a> or join our <a href="https://discord.gg/p2HDsme">discord
90+
server</a>.
91+
</div>
92+
<div id="description">Code Overflow Motivation / Description</div>
93+
<div class="onlyEndUser" id="shortTutorialEndUser">TODO</div>
94+
<div class="onlyPluginDev" id="shortTutorialPluginDev">TODO</div>
95+
<div class="onlyEndUser" id="helpfulLinksEndUser">TODO</div>
96+
<div class="onlyPluginDev" id="helpfulLinksPluginDev">TODO</div>
97+
<script type="text/javascript">
98+
updateVersions();
99+
</script>
10100
</body>
11101
</html>

0 commit comments

Comments
 (0)