Skip to content

Instantly share code, notes, and snippets.

@kiarashplusplus
Created January 9, 2016 23:43
Show Gist options
  • Save kiarashplusplus/35ebc22b4627d705810b to your computer and use it in GitHub Desktop.
Save kiarashplusplus/35ebc22b4627d705810b to your computer and use it in GitHub Desktop.
todo
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<meta content="noindex, nofollow" name="robots">
<meta content="noindex, nofollow" name="googlebot">
<script src="https://code.jquery.com/jquery-1.11.3.min.js" type=
"text/javascript">
</script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300'
rel='stylesheet' type='text/css'>
<style type="text/css">
.form-style-8{
font-family: 'Open Sans Condensed', arial, sans;
width: 500px;
padding: 30px;
background: #FFFFFF;
margin: 50px auto;
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.22);
-moz-box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.22);
-webkit-box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.22);
}
.form-style-8 h2{
background: #4D4D4D;
text-transform: uppercase;
font-family: 'Open Sans Condensed', sans-serif;
color: #797979;
font-size: 18px;
font-weight: 100;
padding: 20px;
margin: -30px -30px 30px -30px;
}
.form-style-8 input[type="text"],
.form-style-8 input[type="date"],
.form-style-8 input[type="datetime"],
.form-style-8 input[type="email"],
.form-style-8 input[type="number"],
.form-style-8 input[type="search"],
.form-style-8 input[type="time"],
.form-style-8 input[type="url"],
.form-style-8 input[type="password"],
.form-style-8 textarea,
.form-style-8 select
{
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
outline: none;
display: block;
width: 100%;
padding: 7px;
border: none;
border-bottom: 1px solid #ddd;
background: transparent;
margin-bottom: 10px;
font: 16px Arial, Helvetica, sans-serif;
height: 45px;
}
.form-style-8 textarea{
resize:none;
overflow: hidden;
}
.form-style-8 input[type="button"],
.form-style-8 input[type="submit"]{
-moz-box-shadow: inset 0px 1px 0px 0px #45D6D6;
-webkit-box-shadow: inset 0px 1px 0px 0px #45D6D6;
box-shadow: inset 0px 1px 0px 0px #45D6D6;
background-color: #2CBBBB;
border: 1px solid #27A0A0;
display: inline-block;
cursor: pointer;
color: #FFFFFF;
font-family: 'Open Sans Condensed', sans-serif;
font-size: 14px;
padding: 8px 18px;
text-decoration: none;
text-transform: uppercase;
}
.form-style-8 input[type="button"]:hover,
.form-style-8 input[type="submit"]:hover {
background:linear-gradient(to bottom, #34CACA 5%, #30C9C9 100%);
background-color:#34CACA;
}
</style>
<title>TO DO</title>
<script type="text/javascript">
//auto expand textarea
function adjust_textarea(h) {
h.style.height = "20px";
h.style.height = (h.scrollHeight)+"px";
}
</script>
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function(e) {
$("#trelloform").submit(function(e) {
e.preventDefault();
var trello = $("#trello").val();
if(trello == ''){
alert('Input can not be left blank');
} else {
var todo = "keep_in_cc_" + Date.now().toString(16) + "@todo.kiarash.me";
var formData = JSON.stringify({'from_email': trello, 'forward_to':todo});
console.log(formData);
$.ajax({
type: "POST",
url: "https://t31qjp86nb.execute-api.us-east-1.amazonaws.com/prod/todopython/",
data: formData,
dataType: "json",
success: function (data, text) {
if (data.errorType == "ValueError") {
alert(data.errorMessage);
} else {
console.log(data)
$("#result").show();
$("#todo").val(todo).select();
}
},
error: function (request, status, error) {}
});
}
});
});
//]]>
</script>
</head>
<body>
<div class="form-style-8">
<h3>Paste Trello Url</h3>
<form action="" id="trelloform" method="post" name="trelloform">
<input autocomplete="off" id="trello" name="trello" type="text">
<input type="submit" value="Submit">
</form>
</div>
<div class="form-style-8" hidden="" id="result">
<input id="todo" name="todo" type="text">
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment