forked from Raynes/refheap
/
refheap.js
43 lines (38 loc) · 1.15 KB
/
refheap.js
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
function hlLine() {
$('a[style]').removeAttr("style")
$('a[href|="' + window.location.hash + '"]').attr("style", "color: #FFE93B;")
}
$(document).ready(function(){
$("#signin").click(function(event) {
navigator.id.getVerifiedEmail(function(assertion) {
if (assertion) {
$.ajax({type: "POST",
url: "/user/verify",
data: { assertion: assertion},
dataType: "json",
success: function(data) {
if (data) {
console.log("Hi there" + data);
$("#useri").html(data["login-html"]);
$("#language").after(data["private-html"])
}
},
});
}
})
})
$("#delete").click(function(event) {
var r = confirm("Are you sure you want to delete this paste? There is no getting it back.")
if (r == false) {
event.preventDefault()
}
})
$("#gentoken").click(function(event) {
$.get('/token/generate',
function(data) { $("#tokentext").html(data) })
})
$(window).bind('hashchange', hlLine)
if (window.location.hash) {
hlLine()
}
});