Skip to content

Instantly share code, notes, and snippets.

@MichaelNahum
Last active May 31, 2018 14:21
Show Gist options
  • Save MichaelNahum/3edcadf64cc48b28356d4a6f68837969 to your computer and use it in GitHub Desktop.
Save MichaelNahum/3edcadf64cc48b28356d4a6f68837969 to your computer and use it in GitHub Desktop.
front end issue
<!DOCTYPE html>
<html>
<head>
<title>Gmail API Quickstart</title>
<meta charset='utf-8' />
<link rel="stylesheet" type="text/css" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<p>Gmail API Quickstart</p>
<p>{{message}}</p>
<!--Add buttons to initiate auth sequence and sign out-->
<button id="authorize-button" style="display: none;">Authorize</button>
<button id="signout-button" style="display: none;">Sign Out</button>
<pre id="content"></pre>
<div id="column">
<div class="topnav">
<input type="text" placeholder="Location..." id="place">
<input type="text" placeholder="Hours back..." id="time">
</div>
<div class="endorsement">
<span class="city">Deir ez-Zur, Syria</span>
<span class="timestamp">08:04pm May 12, 2018 EDT</span>
<div class="headline">Syrian government forces fire on coalition aircraft near SDF controlled village of Mahkan, Syria: Local News Outlet via Twitter.</div><br>
</div>
</div>
<!-- <script async defer src="https://apis.google.com/js/api.js"
onload="this.onload=function(){};handleClientLoad()"
onreadystatechange="if (this.readyState === 'complete') this.onload()">
</script>
<script src="../client_secret.json"></script>
<script src="../quickstart.js"></script> -->
<script>
messages = {{{messages}}}
// lines 40-49 run, but several minutes *after* the server is restarted
// update: messages is now returning as undefined, breaking this code. must be some backend issue, possibly related to why
// jquery isn't loading here either.
let captions = messages.filter(message => {
return message.payload.headers[31].value.match(/Syria/g);
});
let names={};
let dates={};
for(let i=0; i<captions.length;i++){
names[i]=captions[i].payload.headers[31].value;
dates[i]=captions[i].payload.headers[34].value;
}
//this test on line 56 doesn't work at all, either on the browser or in the console.
$(".endorsement").on("click", function() {console.log('hello')})
// $('select').change(function() {
// var num = parseInt($(this).val(), 10);
// var container = $('<div />');
// for(var i = 1; i <= num; i++) {
// container.append('<input id="id'+i+'" name="name'+i+'" />');
// }
// $('somewhere').html(container);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment