-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
69 lines (56 loc) · 1.76 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
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Random Quote Generator</title>
<link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta.2/css/bootstrap.css'>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container my-sm-5 my-1">
<div class="row">
<div class="col-10 col-sm-8 mx-auto">
<h1 class="display-4">
Random Quotes!
</h1>
<div id="quote" class="jumbotron quote-text">
</div>
<button id="btn" class="btn btn-success float-left">Generate</button>
<div class="float-right d-inline">
<a id="fbutton" class="btn btn-primary text-light">
FB Status</a>
<a id="tweet" class="btn btn-info"
href="https://twitter.com/intent/tweet?text=" target="_blank">
Tweet</a>
</div>
</div>
</div>
</div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>
<script src="js/index.js"></script>
<script>
var fbutton = document.getElementById('fbutton');
window.fbAsyncInit = function() {
FB.init({
appId : 'your_app_id',
autoLogAppEvents : true,
xfbml : true,
version : 'v2.12'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
fbutton.addEventListener("click",function(){
var text=document.getElementById("quote").innerText;
FB.login(function(){
FB.api('/me/feed', 'post', {message: text});
}, {scope: 'publish_actions'});
});
</script>
</body>
</html>