forked from shatgupt/runmycode.online
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codesheet.html
83 lines (78 loc) · 3.58 KB
/
codesheet.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>CodeSheet</title>
<meta name="description" content="Run code online from the browser">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="favicon.png">
<link rel="stylesheet" type="text/css" href="codemirror/lib/codemirror.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/runmycode-panel.css">
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date
ga('create', 'UA-100606537-1', 'auto')
ga('send', 'pageview')
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
</head>
<body>
<div class="container">
<header class="grid grid--center">
<div class="grid-cell u-1of4">
<h2><a href="/">RunMyCode</a></h2>
</div>
<div class="grid-cell">
<div class="menu">
<ul id="top-menu" class="right">
<li><a href="dashboard.html" class="hide-if-no-user" id="user-name">Dashboard</a></li>
<li><a href="codesheet.html" class="hide-if-no-user">CodeSheet</a></li>
<li><a href="faq.html">FAQ</a></li>
</ul>
</div>
</div>
</header>
<main class="text-center">
<div class="grid grid--center">
<div class="grid-cell" style="text-align: left;">
<select id="language" title="Language">
<option value="nodejs">Nodejs</option>
<option value="python">Python</option>
<option value="python3">Python3</option>
<option value="ruby">Ruby</option>
<option value="php">PHP</option>
<option value="go">Go</option>
</select>
</div>
<div class="grid-cell">
<h3>CodeSheet</h3>
</div>
<div class="grid-cell" style="text-align: right;">
<input id="popup-runner" class="btn" type="button" value="Run" title="Run Code">
</div>
</div>
<div id="code-wrapper"><h4>Loading...</h4></div>
<h4 class="hide-if-no-user">Install the browser extensions [<a target="_blank" href="https://chrome.google.com/webstore/detail/runmycode-online/iidcnkpdmnopbbkdmneglbelcefgfohf">Chrome</a>, <a target="_blank" href="https://addons.mozilla.org/en-US/firefox/addon/runmycode-online">Firefox</a>] to run code directly from <a href="https://github.com/shatgupt/runmycode-test/blob/master/ruby.rb">Github</a> or <a href="https://gitlab.com/shatgupt/runmycode-test/blob/master/ruby.rb">Gitlab</a></h4>
</main>
<footer>
<p>© <a target="_blank" href="https://github.com/shatgupt">Shatrughn Gupta</a></p>
</footer>
</div>
<script>
const $ = s => document.querySelector(s)
const $$ = s => document.querySelectorAll(s)
let user = localStorage.getItem('runmycode')
if (user) {
user = JSON.parse(user)
$('#user-name').textContent = user.name || 'Dashboard'
Array.from($$('.hide-if-no-user')).forEach(el => el.classList.remove('hide-if-no-user'))
} else {
$('#code-wrapper>h4').innerHTML = 'Please get a key by authenticating at <a href="/">homepage</a>'
}
</script>
<script src="codemirror/lib/codemirror.js"></script>
<script src="codemirror/mode/javascript/javascript.js"></script>
<script src="js/codesheet.js"></script>
</body>
</html>