Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fadhilmch #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added client/27.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/Twitter-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9,389 changes: 9,389 additions & 0 deletions client/css/materialize.css

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions client/css/materialize.min.css

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions client/facebook.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
window.fbAsyncInit = function() {
FB.init({
appId : '201452943945327',
cookie : true,
xfbml : true,
version : 'v2.12' //version of graph api
});
// FB.AppEvents.logPageView();
FB.getLoginStatus(function(response) {
statusChangeCallback(response);
});
};

(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'));


function statusChangeCallback(response) {
console.log(response);
if (response.status === 'connected') {
FB.api('/me', {fields:['name','email']} , function(response) {
$.ajax({
method:"POST",
url:"http://localhost:3000/twatt/login",
data: {
idFB: response.id,
email: response.email,
fbToken: sCCResponse.authResponse.accessToken
}
})
.then(function (response_login) {
console.log(sCCResponse)
localStorage.setItem('token', response_login.data.token);
window.location.href = 'index.html'
})
.catch(function (error) {

});
}
})
}

//
//
// const token = response.authResponse.accessToken;
// $.post('http://localhost:3000/api/facebook/request-token',{token: token },(data,status) => {
// if (status == 'success') {
// $('#text-login-as').text(`Welcome, ${data.name}`);
// $('#fb-btn-login').hide();
// }
// }
// }
Binary file added client/fonts/roboto/Roboto-Bold.woff
Binary file not shown.
Binary file added client/fonts/roboto/Roboto-Bold.woff2
Binary file not shown.
Binary file added client/fonts/roboto/Roboto-Light.woff
Binary file not shown.
Binary file added client/fonts/roboto/Roboto-Light.woff2
Binary file not shown.
Binary file added client/fonts/roboto/Roboto-Medium.woff
Binary file not shown.
Binary file added client/fonts/roboto/Roboto-Medium.woff2
Binary file not shown.
Binary file added client/fonts/roboto/Roboto-Regular.woff
Binary file not shown.
Binary file added client/fonts/roboto/Roboto-Regular.woff2
Binary file not shown.
Binary file added client/fonts/roboto/Roboto-Thin.woff
Binary file not shown.
Binary file added client/fonts/roboto/Roboto-Thin.woff2
Binary file not shown.
115 changes: 115 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Twitt</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection"/>
<link type="text/css" rel="stylesheet" href="style.css"/>

<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>


<body>
<div class="navbar-fixed">
<nav>
<div class="nav-wrapper blue">
<div class="row">
<div class="col s2">
<a href="#" onclick='loadTweets()' class="brand-logo left ">
<div class="row">
<div class="col s3">
<img class="logo-image" src=Twitter-256.png></img>
</div>
<div class="col s9">
<span>Twitt</span>
</div>
</div>
</a>
</div>

<div class="col s10">
<ul id="nav-mobile" class="right">
<li>
<div class="center row">
<div class="col s12 " >
<div class="row" id="topbarsearch">
<div class="input-field col s6 s12 white-text">
<i class="white-text material-icons prefix">search</i>
<input type="text" placeholder="search" id="search" class=" white-text " >
</div>
</div>
</div>
</div>
</li>
<li><a onclick='loadUserTweets()' href="#">Profile</a></li>
</ul>
</div>
</div>
</div>
</nav>
</div>
<main>
<div class="container text-center">
<div class="row">
<div class="col s10 offset-s2">
<div class="row">
<div class="col s10">
<form>
<div class="input-field">
<div class="col s12">
<input id='status' type="text" class="input white " placeholder="What is on your mind?">
</div>
</div>

<div class="row">
<div class=" col s12">
<div class=" col s12">
<button onclick="postTweet()"
type="submit" class="btn ">Update</button>
</div>
</div>
</div>

</form>
</div>
<div id="tweet" class='tweet col s10' >



</div>


</div>

</div>
</div>
</div>
</main>
<footer class="blue page-footer">
<!-- <div class="row"> -->
<!-- <div class="col s12"> -->
<div class="footer-copyright center">
<div class='container'>
<p class='small'>copyright: fadhilmch 2018</p>
</div>
</div>

<!-- </div> -->
<!-- </div> -->

</footer>


<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script type="text/javascript" src="js/materialize.min.js"></script>
<script src='script.js'></script>
</body>
</html>
Loading