Skip to content
Browse files

fixes and changes

  • Loading branch information...
1 parent 270f1c9 commit 857c3babafc03142d7e46237bea97af24de03530 @fleeting fleeting committed May 11, 2010
Showing with 21 additions and 86 deletions.
  1. +0 −61 css/screen.css
  2. +4 −4 index.html
  3. +17 −21 scripts/monkeeTime.js
View
61 css/screen.css
@@ -1,16 +1,3 @@
-/*
- *
- * Find more about this app by visiting
- * http://miniapps.co.uk/
- *
- * Copyright (c) 2010 Alex Gibson, http://miniapps.co.uk/
- * Released under MIT license
- * http://miniapps.co.uk/license/
- *
- * Version 1.5 - Last updated: March 24 2010
- *
- */
-
body {
background: rgb(197,204,211);
color: rgb(76,86,108);
@@ -263,52 +250,4 @@ button#closeButton:hover, button#closeButton:focus {
background: -moz-linear-gradient(top, #242424, #777);
}
-/* @end */
-
-/* @group iPhone */
-
-/* iPhone Portrait */
-
-@media screen and (max-width: 320px) {
-
-p {
- width: 300px;
-}
-
-input[type=text] {
- width: 220px;
-}
-
-ul {
- width: 300px;
-}
-
-fieldset {
- width: 320px;
-}
-
-}
-
-/* iPhone Landscape */
-
-@media screen and (min-width: 321px) and (max-width: 480px) {
-
-p {
- width: 460px;
-}
-
-input[type=text] {
- width: 380px;
-}
-
-ul {
- width: 460px;
-}
-
-fieldset {
- width: 480px;
-}
-
-}
-
/* @end */
View
8 index.html
@@ -42,10 +42,10 @@
<button type="button" id="aboutButton">About</button>
<h1>monkeeTime</h1>
- <form id="logForm" method="post">
- <input type="text" name="project"value="Project Name">
- <input type="number" name="hours" value="Hours" class="shortField">
- <input type="text" name="date" value="Date" id="date" class="shortField">
+ <form id="logForm">
+ <input type="text" name="project" value="Project Name" onfocus="if(this.value == 'Project Name') this.value = '';" onblur="if(this.value == '') this.value = 'Project Name';">
+ <input type="number" name="hours" value="Hours" class="shortField" onfocus="if(this.value == 'Hours') this.value = '';" onblur="if(this.value == '') this.value = 'Hours';">
+ <input type="text" name="date" value="Date" id="date" class="shortField" onfocus="if(this.value == 'Date') this.value = '';" onblur="if(this.value == '') this.value = 'Date';">
<input type="submit" value="Log Time">
</form>
</header>
View
38 scripts/monkeeTime.js
@@ -9,7 +9,7 @@
* Developed by James Fleeting <twofivethreetwo@gmail.com>
* Another project from monkeeCreate <http://monkeecreate.com>
*
- * Version 1.0 - Last updated: May 7 2010
+ * Version 1.0 - Last updated: May 11 2010
*
* Inspired by Checklist from http://miniapps.co.uk/
*/
@@ -42,17 +42,7 @@ $(document).ready(function() {
values.push(hours);
values.push(date);
- if (project != "" && hours != "" && date != "") {
- try {
- localStorage.setItem(itemId, values.join(';'));
- } catch (e) {
- if (e == QUOTA_EXCEEDED_ERR) {
- alert('Quota exceeded!');
- }
- }
-
- getAllItems();
- } else {
+ if (project == "" || project == "Project Name" || hours == "" || hours == "Hours" || date == "" || date == "Date") {
$("#emptyFields-message").dialog({
resizable: false,
height:140,
@@ -64,7 +54,17 @@ $(document).ready(function() {
}
}
});
- }
+ } else {
+ try {
+ localStorage.setItem(itemId, values.join(';'));
+ } catch (e) {
+ if (e == QUOTA_EXCEEDED_ERR) {
+ alert('Quota exceeded!');
+ }
+ }
+
+ getAllItems();
+ }
});
$("#clearLog").click(function() {
@@ -104,30 +104,26 @@ $(document).ready(function() {
*/
function getAllItems() {
var timeLog = "";
- var myArray = [];
var i = 0;
var logLength = localStorage.length-1;
var totalHours = 0.0;
//process each item and create a list item
for (i = 0; i <= logLength; i++) {
-
- //var logitem = myArray[j];
- var logitem = localStorage.key(i);
- var values = localStorage.getItem(logitem);
+ var itemKey = localStorage.key(i);
+ var values = localStorage.getItem(itemKey);
values = values.split(";");
var project = values[0];
var hours = values[1];
var date = values[2];
- timeLog += '<li><strong>' + project + '</strong>: ' + hours + ' hours <span class="delete">&times;<span class="hidden" title="Delete Time" id="' + logitem + '">Are you sure you want to delete ' + project + ' from the log?</span></span> <span class="date">' + date + '</span></li>';
+ timeLog += '<li><strong>' + project + '</strong>: ' + hours + ' hours <span class="delete">&times;<span class="hidden" title="Delete Time" id="' + itemKey + '">Are you sure you want to delete ' + project + ' from the log?</span></span> <span class="date">' + date + '</span></li>';
totalHours = totalHours + parseInt(hours);
}
- if (timeLog == "") {
+ if (timeLog == "")
timeLog = '<li class="empty">Log Currently Empty</li>';
- }
//display the total number of hours
$("section header p span").html(totalHours);

0 comments on commit 857c3ba

Please sign in to comment.
Something went wrong with that request. Please try again.