Skip to content
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
59 changes: 59 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>Tasky</title>
<link href="https://fonts.googleapis.com/css?family=Oswald|Source+Sans+Pro" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<link href="style.css" rel="stylesheet">
</head>

<body>
<div class="container">
<!-- Landing Screen -->
<div class="row">
<div class="col-xs-12 title header" style="text-align:center">
Tasky
</div>
<div class="row">
<input type="date" id="myDate">
</div>
</div>
<div class="projects">
<div class="row">
<div class="col-xs-12 project">
<div class="projectName">
Project Name
</div>
<button type="button" id="newTask" class="btn btn-lg btn-block">
<span class="glyphicon glyphicon glyphicon-plus" aria-hidden="true"></span>
</button>
</div>
</div>
</div>
<div class="row row-proj">
<div class="col-xs-6">
<button type="button" id="newProj" class="btn btn-primary btn-lg btn-block">
<span class="glyphicon glyphicon glyphicon-plus" aria-hidden="true"></span>
</button>
</div>
<div class="col-xs-6">
<button type="button" id="removeTasks" class="btn btn-primary btn-lg btn-block">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
</button>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://rawgit.com/ngryman/jquery.finger/v0.1.2/dist/jquery.finger.js"></script>
<script src="//code.skygear.io/js/polyfill/latest/polyfill.min.js"></script>
<script src="//code.skygear.io/js/skygear/latest/skygear.min.js"></script>

<script src="script.js"></script>
</body>
</html>
64 changes: 64 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

$("document").ready(function() {

//show Date
var date = new Date();
var day = date.getDate();
var month = date.getMonth() + 1;
var year = date.getFullYear();
if (month < 10) month = "0" + month;
if (day < 10) day = "0" + day;
var today = year + "-" + month + "-" + day;
$("#myDate").attr("value", today);

$("#newProj").on("tap", btnMouseClick);
$(".projects").on("tap", "#newTask", btnNewTask);
$(".projects").on("doubletap", ".projectName", editName);
$(".projects").on("doubletap", ".task", editTask);
// $(".projects").prop("checked", "input[type='checkbox']", checkedTask); //not working
$("#removeTasks").on("tap", checkedTask)
$(".projects").on("drag", ".projectName", removeProj)


function btnMouseClick(evt){
if ($(".project").last().hasClass("col-xs-12")) {
$(".project").last().replaceWith("<div class='col-xs-6 project'><div class='projectName'>Project Name</div><button type='button' id='newTask' class='btn btn-lg btn-block'><span class='glyphicon glyphicon glyphicon-plus' aria-hidden='true'></span></button></div><div class='col-xs-6 project'><div class='projectName'>Project Name</div><button type='button' id='newTask' class='btn btn-lg btn-block'><span class='glyphicon glyphicon glyphicon-plus' aria-hidden='true'></span></button></div>")
} else {
$(".projects").append("<div class='row'><div class='col-xs-12 project'><div class='projectName'>Project Name</div><button type='button' id='newTask' class='btn btn-lg btn-block'><span class='glyphicon glyphicon glyphicon-plus' aria-hidden='true'></span></button></div></div>")
}
}
function btnNewTask(evt){
$(this).before("<div class='checkbox'><span style='padding-left:30px;'><input type='checkbox' value=''></span><span class='task' style='display:inline;'>Add task</span></div>")
}
function editName(evt){
var $div = $(this), isEditable=$div.is('.editable');
$div.prop('contenteditable',!isEditable).toggleClass('editable')
}
function editTask(evt){
var $div = $(this), isEditable=$div.is('.editable');
$div.prop('contenteditable',!isEditable).toggleClass('editable')
}
function checkedTask(evt){
$(".checkbox input:checked").parentsUntil(".project").detach();
// }
}
function removeProj(){
if ($(this).parent().hasClass("col-xs-6")){
console.log($(this).siblings().parent())
$(this).siblings().removeClass("col-xs-6") //this line is not working
$(this).siblings().addClass("col-xs-12") //this line is not working
}
$(this).parent().remove();
}
skygear.config({
'endPoint': 'https://tasky.skygeario.com/', // trailing slash is required
'apiKey': '004f8e16221046a79a827a5040b7547b',
}).then(() => {
console.log('skygear container is now ready for making API calls.');
}, (error) => {
console.error(error);
});
});
// phoneGap (jquery import)
// Full height for rows
// How to store the page
55 changes: 55 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
body {
display: table;
font-family: 'Source Sans Pro', sans-serif;
padding-top: 20px;
padding-bottom: 20px;
height: 100%;
overflow: auto;
}
#myDate{
font-family: 'Source Sans Pro', sans-serif;
background-color: rgb(200,200,200);
padding-left: 50px;
text-align: center;
border-style: none;
}
.container{
height:100%;
}
.projects{
min-height:78vh;
max-height: 78vh;
}
.row{
height: 100%;
}
.project{
height: 100%;
border-style: solid;
border-width: thin;
border-color: rgb(221,221,221);
background-color: rgb(246,246,246);
padding: 10px;
}
.projectName{
font-family: 'Oswald', sans-serif;
padding-bottom: 5px;
font-size: 18px;
text-align: center;
}
.title{
font-family: 'Oswald', sans-serif;
background-color: rgb(200,200,200);
text-align: center;
font-size: 22px;
padding-top: 5px;
}
.ui-btn{
width: 50px;
height: 50px;
text-align: center;
padding: 10px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 25px;
}