From 7b026dd80504238af3f27a5ed8c6a8f7a8bf0ef0 Mon Sep 17 00:00:00 2001 From: Craig Davies Date: Wed, 15 Apr 2015 17:33:10 +0100 Subject: [PATCH 1/9] test commit --- index.html | 80 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 73 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 02574c8..a95383e 100644 --- a/index.html +++ b/index.html @@ -13,16 +13,62 @@ + Title:
+ Description:
+ Completed:
+ +

Click the button to display the values of the value attribute of the text fields.

+ + + +

+

+

+ + }; + + + @@ -87,9 +150,12 @@

Mal's Learning - Project 1

+ + +
Object ID Title Description Completed?
From e7957dc20919835b46b3c6cec27e9efb8de58edb Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Thu, 16 Apr 2015 09:11:42 +0100 Subject: [PATCH 2/9] Corrected indentation and moved elements into body Also removed semi-colons from the end of functions. Semi-colons are only needed on functions, when they are created as variables. E.g.: var myFunction = function(){ }; --- index.html | 132 ++++++++++++++++++++++++++--------------------------- 1 file changed, 64 insertions(+), 68 deletions(-) diff --git a/index.html b/index.html index a95383e..553c4e9 100644 --- a/index.html +++ b/index.html @@ -12,63 +12,49 @@ - - Title:
- Description:
- Completed:
- -

Click the button to display the values of the value attribute of the text fields.

- - - -

-

-

- + } + + @@ -158,9 +142,21 @@

Mal's Learning - Project 1

+ + Title:
+ Description:
+ Completed:
+ +

Click the button to display the values of the value attribute of the text fields.

+ + + +

+

+

Created by Neil Williams on 16th March 2015

#html #javascript #jquery #parse

- \ No newline at end of file + From cad89127dcf46b150c8904ccdc293cb9ab921ae9 Mon Sep 17 00:00:00 2001 From: Craig Davies Date: Wed, 20 May 2015 20:05:06 +0100 Subject: [PATCH 3/9] Added edit functionality, started working on delete --- .DS_Store | Bin 0 -> 6148 bytes README.md | 0 assets/js/jquery.min.js | 0 assets/js/parse-1.3.5.min.js | 0 index.html | 148 ++++++++++++++++++++++++----------- 5 files changed, 101 insertions(+), 47 deletions(-) create mode 100644 .DS_Store mode change 100644 => 100755 README.md mode change 100644 => 100755 assets/js/jquery.min.js mode change 100644 => 100755 assets/js/parse-1.3.5.min.js mode change 100644 => 100755 index.html diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..de86f13759d5f6fed9575a26fe349afb5e09cf16 GIT binary patch literal 6148 zcmeHKyH3ME5S&dclt7b`^2$_^_yZF;NGWLI4*-HAfn=~mK%(>q@&WvfnY~*O1{YKa zq1|YA&UZWa7%BGvAj_xf1egJs&=o}s1E$r3O(RRrh!XoK@rVWw*sbeI>u57@0BRP##*qbuMF zxB?#v=>8Dsin(E%Fm4?T@d-fGYjiZ0^}?*2V3-@W3E4uEL?tGw*b_q%o%O-;a>F)Z zqC@QQAvW^+<3-}=>_5bGNS@H6E8q(B6&R<_nV$bE{$&Oq`F)CixdN`hKT|-mqAZqN zl%1{LmZxWJpkLC}G_TbHjpg1YfFHV#9LL7g9<"); - var btn = document.createElement("button"); - var t = document.createTextNode("Edit Item"); - btn.appendChild(t); - row.append(document.body.appendChild(btn)); - - // objectId + var btn = $(" - -

-

-

- + Completed:
+ + +

Created by Neil Williams on 16th March 2015

#html #javascript #jquery #parse

From 7af71b1cb9a9dae49381d1a31e38b32581f8796e Mon Sep 17 00:00:00 2001 From: Craig Davies Date: Mon, 25 May 2015 14:15:38 +0100 Subject: [PATCH 4/9] delete function added --- .DS_Store | Bin 6148 -> 0 bytes .gitignore | 1 + index.html | 28 ++++++++++++++++------------ 3 files changed, 17 insertions(+), 12 deletions(-) delete mode 100644 .DS_Store create mode 100644 .gitignore diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index de86f13759d5f6fed9575a26fe349afb5e09cf16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKyH3ME5S&dclt7b`^2$_^_yZF;NGWLI4*-HAfn=~mK%(>q@&WvfnY~*O1{YKa zq1|YA&UZWa7%BGvAj_xf1egJs&=o}s1E$r3O(RRrh!XoK@rVWw*sbeI>u57@0BRP##*qbuMF zxB?#v=>8Dsin(E%Fm4?T@d-fGYjiZ0^}?*2V3-@W3E4uEL?tGw*b_q%o%O-;a>F)Z zqC@QQAvW^+<3-}=>_5bGNS@H6E8q(B6&R<_nV$bE{$&Oq`F)CixdN`hKT|-mqAZqN zl%1{LmZxWJpkLC}G_TbHjpg1YfFHV#9LL7g9< Date: Mon, 25 May 2015 14:34:25 +0100 Subject: [PATCH 5/9] Fixed issue with the page refreshing on click of buttons. Also fixed the bit that is supposed to reset the form on refresh --- index.html | 186 ++++++++++++++++++++++++++--------------------------- 1 file changed, 93 insertions(+), 93 deletions(-) diff --git a/index.html b/index.html index b9e1893..83a83b7 100755 --- a/index.html +++ b/index.html @@ -19,57 +19,57 @@ Parse.initialize("nVVTfcLwuU5OgI6zB1E72KQGvwKJex8XRzvNZWJ0", "exGizwFvu9fQkU2tYQaOSQvhpW9ck6imTQQtC6go"); refreshTable(); $("#saveButton").on("click", editItem); - $("#deleteButton").on("click", deleteItem); + $("#deleteButton").on("click", deleteItem); }); - - function deleteItem() { - var Todo = Parse.Object.extend("Todo"); - var delItem = new Todo(); - var objectId = $(this).data("objectId"); - delItem.set("objectId", objectId); + function deleteItem() { + var Todo = Parse.Object.extend("Todo"); + var delItem = new Todo(); + var objectId = $(this).data("objectId"); + delItem.set("objectId", objectId); - delItem.destroy({ - success: function(delItem) { - alert("Item Deleted"); - }, + delItem.destroy({ + success: function(delItem) { + refreshTable(); + alert("Item Deleted"); + }, - error: function(delItem, error) { - alert("Item not deleted"); - refreshTable(); - } - }) - } + error: function(delItem, error) { + alert("Item not deleted"); + } + }) + } - function editItem() { - var Todo = Parse.Object.extend("Todo"); - var saveItem = new Todo(); - var objectId = $(this).data("objectId"); - saveItem.set("objectId", objectId); + function editItem() { + var Todo = Parse.Object.extend("Todo"); + var saveItem = new Todo(); + var objectId = $(this).data("objectId"); + saveItem.set("objectId", objectId); - var x = $("#titleNew").val(); - saveItem.set("title", x); - var y = $("#descriptionNew").val(); - saveItem.set("description", y); - /* var z = $("#completedNew").val(); - // saveItem.set("completed", z);*/ + var x = $("#titleNew").val(); + saveItem.set("title", x); + var y = $("#descriptionNew").val(); + saveItem.set("description", y); + /* var z = $("#completedNew").val(); + // saveItem.set("completed", z);*/ - saveItem.save(null, { - success: function(saveItem) { - alert("Item Successfully edited"); - }, + saveItem.save(null, { + success: function(saveItem) { + refreshTable(); + alert("Item Successfully edited"); + }, - error: function(saveItem, error) { - alert("Item not edited"); - refreshTable(); - } - }) - } + error: function(saveItem, error) { + alert("Item not edited"); + } + }) + } function refreshTable() { $("#table").empty(); - $("#form").empty(); + $("#form")[0].reset(); + var Todo = Parse.Object.extend("Todo"); var query = new Parse.Query(Todo); query.ascending("createdAt"); @@ -104,53 +104,53 @@ // edit button column = $(""); var btn = $(" - + + Title:
+ Description:
+ Completed:
+ + -

Created by Neil Williams on 16th March 2015

+

Created by Craig Davies

#html #javascript #jquery #parse

From 22aa13ec4d04d09d491015d880e40102f6f1830e Mon Sep 17 00:00:00 2001 From: Craig Davies Date: Sun, 31 May 2015 12:05:29 +0100 Subject: [PATCH 6/9] added a comment --- index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 83a83b7..a601d2b 100755 --- a/index.html +++ b/index.html @@ -16,7 +16,7 @@