-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
74 lines (69 loc) · 3.51 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
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<title>Github Reading List</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.3/js/tether.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/css/bootstrap-select.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/js/bootstrap-select.min.js"></script>
<style type="text/css">
.entry-form{
padding:40px;
border:1px solid #ddd;
border-radius:5px;
background-color:#fcfdfd;
margin:0 auto;
margin-top: 40px;
}
.entry-form .form-success{
padding:15px;
}
@media screen and (min-width: 740px){
.entry-form{
width:60%;
}
}
.hidden{
display:none;
}
</style>
</head>
<body style="background-color:rgba(1,1,1,0) !important">
<script>
//Create issue form handler
window.addEventListener("load", function() {
const bookmarkletForm = document.getElementById('bookmarklet-form');
const bookmarkletButton = bookmarkletForm.querySelector('#button');
bookmarkletButton.addEventListener("click", function(event) {
const tok = bookmarkletForm.querySelector('#token').value;
const repo = bookmarkletForm.querySelector('#repo').value;
bookmarklet_url = "javascript:(function () {var jsCode = document.createElement('script');jsCode.setAttribute('src', 'https://gkiar.me/gitmarklet/bookmarklet.js');jsCode.setAttribute('token', 'TOKEN');jsCode.setAttribute('repo', 'REPO');jsCode.setAttribute('id', 'readerBookmarklet');document.body.appendChild(jsCode);}());"
bookmarklet_url = bookmarklet_url.replace(/TOKEN/, tok)
bookmarklet_url = bookmarklet_url.replace(/REPO/, repo)
document.getElementById('bookmark-url').setAttribute('href', bookmarklet_url)
document.getElementById('responseLink').classList.remove("hidden");
})
}, false)
</script>
<div class="row entry-form">
<iframe src="./embedded.html" width="100%", height="795px" style="border:none; border-radius: 0px; margin: -10pt" ></iframe>
<div>
<hr />
<p><em>Psst! Want to do this for your own repo? Enter your repository name and API key, generate your link, and bookmark it to load this as an overlay, anywhere!</em></p>
<form id="bookmarklet-form" autocomplete="off">
<div class="form-group">
<input type="text" class="form-control" id="repo" placeholder="Target Github repository" required>
</div>
<div class="form-group">
<input type="text" class="form-control" id="token" placeholder="OAuth Github API token" required>
</div>
<button type="button" id="button" class="btn btn-info">Generate Link</button>
</form>
<p id="responseLink" class="hidden">Bookmark <a id="bookmark-url" href="">this link</a>!</p>
</div>
</div>
</body>
</html>