This commit is contained in:
Arjun Patel
2017-10-07 23:26:31 -07:00
parent 2d726be9e8
commit 9255e1eb3c
7 changed files with 85 additions and 24 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ function makeEvent(information)
});
request.execute(function(event) {
alert('Event created: ' + event.htmlLink);
console.log('Event created!');
});
}
+7 -2
View File
@@ -7,6 +7,11 @@ function directionsURL(inCommand) {
var dest = inCommand.substring(startOfTo+3).replace(" ", "+"); // "14872 Waverly Lane, Irvine, CA" to "14872 Waverly Lane+Irvine+CA"
var link = "https://www.google.com/maps/embed/v1/directions?key=AIzaSyCZCgZY7ZlSMk1DW0NEEoHZ9qwdSL4AR1k&origin="+origin+"&destination="+dest
mapsFrame.src = link;
mapsFrame.style.display = "block";
var d = '';
$('#map').delay(3000).fadeIn();
$('#search-cont').delay(2700).animate({'margin-top' : '-=200px'});
$('#input').mousedown(function() {
$('#map').fadeOut(500);
$('#search-cont').animate({'margin-top' : '+=200px'});
$('#input').unbind();
});
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

+5 -1
View File
@@ -2,10 +2,12 @@
<html>
<head>
<title>DoEverythingBar</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
@@ -20,14 +22,16 @@
<div class="input-group stylish-input-group">
<input type="text" id="input" class="form-control" placeholder="Search" >
<span class="input-group-addon">
<image id="fire" src="images/error.png">
<button type="submit">
<span id="enter" class="glyphicon glyphicon-upload"></span>
</button>
</span>
</div>
</div>
</div>
</div>
</div>
<iframe
height="100%"
width="100%"
+12
View File
@@ -29,6 +29,7 @@ div.main-bg {
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
font-size: 30px;
}
.stylish-input-group .input-group-addon{
@@ -43,3 +44,14 @@ div.main-bg {
border:0;
background:transparent;
}
#fire {
display: none;
position: absolute;
top: 16px;
right: 30px;
transform: translate(-50%, -50%);
z-index: 10;
height: 15px;
width: 15px;
}
+42 -20
View File
@@ -4,17 +4,30 @@ var signoutButton = document.getElementById('signout-button');
var runCommandBtn = document.getElementById('create-event');
enterBtn.addEventListener("click", captureInput);
window.addEventListener("keypress", function(e) {
var key = e.which || e.keycode;
if (key == 13) {
captureInput();
}
});
var actualCommand = '';
var command = '';
function captureInput() {
var dict = {
"gcal": makeEvent,
"googlecalendar": makeEvent,
"mapsd": directionsURL,
"directions": directionsURL
};
var dict = {
"gcal": makeEvent,
"googlecalendar": makeEvent,
"mapsd": directionsURL,
"directions": directionsURL
};
function error() {
$('#fire').slideDown();
$('#input').mousedown(function() {
$('#fire').slideUp();
});
}
function captureInput() {
var input = String(document.getElementById("input").value);
var untilSpace = input.indexOf(' ');
command = input.substring(0, untilSpace);
@@ -23,21 +36,30 @@ function captureInput() {
if (command in dict) {
console.log('isAValidCommmand');
actualCommand = input.substring(untilSpace+1);
runCommandBtn.addEventListener("click", function () {
console.log('successfully ran command');
dict[command](actualCommand);
});
if (gapi.auth2.getAuthInstance().isSignedIn.get()) {
console.log('already signed in');
runCommandBtn.click();
}
else {
authorizeButton.click();
setTimeout(alert("Run Command again!"), 1000);
}
if (actualCommand == '') {
console.log('actualCommand is empty!!');
error();
}
else if (gapi.auth2.getAuthInstance().isSignedIn.get()) {
console.log('already signed in');
runCommandBtn.addEventListener("click", runCommand);
function runCommand() {
console.log('successfully ran command');
dict[command](actualCommand);
}
runCommandBtn.click();
runCommandBtn.removeEventListener("click", runCommand);
}
else {
authorizeButton.click();
setTimeout(console.log("Run Command again!"), 1000);
}
}
else {
alert.log("Not a valid command");
console.log("Not a valid command");
error();
}
}
+18
View File
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head></head>
<body>
<script type="text/javascript" src="https://secure.skypeassets.com/i/scom/js/skype-uri.js"></script>
<div id="SkypeButton_Call_justinkimchi77_1">
<script type="text/javascript">
Skype.ui({
"name": "call",
"element": "SkypeButton_Call_justinkimchi77_1",
"participants": [""]
});
</script>
</div>
</body>
</html>