This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
#YouTubeForm { | |
display: none; | |
} | |
input[readonly] { | |
background-color: lightgray; | |
} | |
p, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- ******************************** CSS STYLING ******************************** --> | |
<style> | |
h1, | |
h2, | |
p { | |
color: RGB(229, 229, 229); | |
font-family: helvetica; | |
margin: 20px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<h1> This is the logged out page.</h1> | |
</head> | |
<body> | |
<button onclick="window.location.href='/home'">Return to Home.</button> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function signOut() { | |
var getUrl = `http://localhost:80/SignOut` | |
try { | |
$.get(getUrl, {}) | |
.done(function (data) { | |
if (data = 'CookieDeleted') { | |
window.location.href = "http://localhost:80/LoggedOutPage" | |
} else { | |
alert('Something went wrong, please try to sign out again.') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GET OWNER REQUEST: DESCRIPTION | |
// FUNCTION: Check whether viewer is also owner of profile | |
// 1) Send GET requst to BacKEnd route Owner with token & profile user id | |
// 2) If token is valid and profile user Id matches stored google id, corresponding to token then; | |
// 3) Show hidden element with ID = YouTubeForm | |
// 4) And insert 'Logged in' text into section with ID tag = 'SessionStatusText' | |
// 5) Else, insert 'Unlogged' text into section with ID tag = 'SessionStatusText' | |
try { | |
$.get('http://localhost:80/Owner', { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<!-- ADD BOOTSTRAP--> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" | |
integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous"> | |
<!-- See here: https://getbootstrap.com/docs/4.2/getting-started/introduction/ --> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LINK TO DATABASE CONNECTION | |
const pool = require('./config.js') | |
var path = require("path"); | |
// google auth | |
const { OAuth2Client } = require('google-auth-library'); | |
const CLIENT_ID = '170958026096-1delfs3g8tg4hoeg6bgs5ickhpe7k5pt.apps.googleusercontent.com' // Given by Google when you set up your Google OAuth client ID: https://developers.google.com/identity/sign-in/web/sign-in | |
//VERIFICATION FUNCTION: The ticket inspector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// ******************************** JAVASCRIPT ******************************** // | |
// GET COOKIE FUNCTION | |
function getCookieValue(cname) { | |
var name = cname + "="; | |
var decodedCookie = decodeURIComponent(document.cookie); | |
var ca = decodedCookie.split(';'); | |
for (var i = 0; i < ca.length; i++) { | |
var c = ca[i]; | |
while (c.charAt(0) == ' ') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Learning Web Dev</title> | |
<script src="https://apis.google.com/js/platform.js" async defer></script> | |
<meta name="google-signin-client_id" | |
content="170958026096-1delfs3g8tg4hoeg6bgs5ickhpe7k5pt.apps.googleusercontent.com"> | |
<!--JQuery--> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" type="text/javascript"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Web dev for absolute beginners</title> | |
<script src="https://apis.google.com/js/platform.js" async defer></script> | |
<meta name="google-signin-client_id" | |
content="170958026096-1delfs3g8tg4hoeg6bgs5ickhpe7k5pt.apps.googleusercontent.com"> | |
<!--JQuery--> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" type="text/javascript"></script> |
NewerOlder