Email Login
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function () {
|
||||
refresh();
|
||||
|
||||
userinfo();
|
||||
@ -13,8 +13,8 @@ $(document).ready(function() {
|
||||
hidden: false
|
||||
}
|
||||
});
|
||||
|
||||
$(".btn_invite").click(function() {
|
||||
|
||||
$(".btn_invite").click(function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/invite",
|
||||
@ -25,11 +25,11 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
|
||||
$(document).on("click", ".btn_detail", function() {
|
||||
$(document).on("click", ".btn_detail", function () {
|
||||
window.location.replace("/shoppinglist_json/" + $(this).closest("tr").attr("id"));
|
||||
});
|
||||
|
||||
$(".btn_add").click(function() {
|
||||
$(".btn_add").click(function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/shoppinglist",
|
||||
@ -37,19 +37,21 @@ $(document).ready(function() {
|
||||
name: $(".name").val(),
|
||||
description: $(".description").val(),
|
||||
color: "red"
|
||||
}, success(result) {
|
||||
},
|
||||
success(result) {
|
||||
refresh();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on("click", ".btn_delete", function() {
|
||||
$(document).on("click", ".btn_delete", function () {
|
||||
$.ajax({
|
||||
type: "DELETE",
|
||||
url: "/shoppinglist",
|
||||
data: {
|
||||
sl_id: $(this).closest("tr").attr("id")
|
||||
}, success(result) {
|
||||
},
|
||||
success(result) {
|
||||
refresh();
|
||||
}
|
||||
});
|
||||
@ -64,10 +66,10 @@ function refresh() {
|
||||
type: "GET",
|
||||
url: "/myshoppinglists",
|
||||
success(data) {
|
||||
for(let item of data) {
|
||||
$(".tb_myshoppinglists").append("<tr id='" + item.sl_id +"'><td>" + item.name + "</td><td>" + item.description +
|
||||
"</td><td> <a class='btn-floating btn-large waves-effect waves-light red btn_detail'><i class='material-icons'>forward</i></a></td>"
|
||||
+ "<td><a class='btn-floating btn-large waves-effect waves-light red btn_delete'><i class='material-icons'>clear</i></a></td></tr>");
|
||||
for (let item of data) {
|
||||
$(".tb_myshoppinglists").append("<tr id='" + item.sl_id + "'><td>" + item.name + "</td><td>" + item.description +
|
||||
"</td><td> <a class='btn-floating btn-large waves-effect waves-light red btn_detail'><i class='material-icons'>forward</i></a></td>" +
|
||||
"<td><a class='btn-floating btn-large waves-effect waves-light red btn_delete'><i class='material-icons'>clear</i></a></td></tr>");
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -76,9 +78,9 @@ function refresh() {
|
||||
type: "GET",
|
||||
url: "/sharedshoppinglists",
|
||||
success(data) {
|
||||
for(let item of data) {
|
||||
$(".tb_sharedshoppinglists").append("<tr id='" + item.sl_id +"'><td>" + item.name + "</td><td>" + item.description +
|
||||
"</td><td> <a class='btn-floating btn-large waves-effect waves-light red btn_detail'><i class='material-icons'>forward</i></a></td></tr>");
|
||||
for (let item of data) {
|
||||
$(".tb_sharedshoppinglists").append("<tr id='" + item.sl_id + "'><td>" + item.name + "</td><td>" + item.description +
|
||||
"</td><td> <a class='btn-floating btn-large waves-effect waves-light red btn_detail'><i class='material-icons'>forward</i></a></td></tr>");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user