From 148365a493426c9e25169249aad93c5126f7e90b Mon Sep 17 00:00:00 2001 From: LukasNowy Date: Wed, 20 Mar 2019 15:35:44 +0100 Subject: [PATCH 1/2] a --- express-server/public/test/dash.js | 147 ----------------------------- 1 file changed, 147 deletions(-) delete mode 100644 express-server/public/test/dash.js diff --git a/express-server/public/test/dash.js b/express-server/public/test/dash.js deleted file mode 100644 index dfea80c3..00000000 --- a/express-server/public/test/dash.js +++ /dev/null @@ -1,147 +0,0 @@ -// Initialize Firebase -var config = { - apiKey: "AIzaSyCuvwf78cmSDoZ2yS4XxHZhnjUn7yIHYfw", - authDomain: "test-667ca.firebaseapp.com", - databaseURL: "https://test-667ca.firebaseio.com", - projectId: "test-667ca", - storageBucket: "test-667ca.appspot.com", - messagingSenderId: "221332577314" -}; - -firebase.initializeApp(config); - -var app = new Vue({ - el: ".myapp", - data: { - title: "smartshopper.cf", - myshoppinglists: [], - sharedshoppinglists: [], - currentlist: {} - }, - - methods: { - deleteShoppinglist(sl_id) { - - firebase.auth().onAuthStateChanged(function (user) { - if (user) { - firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) { - axios({ - method: 'delete', - url: "/shoppinglist", - data: { - sl_id: sl_id, - idtoken: idtoken - } - }).then((res) => { - app.myshoppinglists = res.data; - }); - }).catch((error) => console.error("Get id token client error: ", error)); - } else { - console.log("Check Auth error", user) - } - }); - - - }, - - getShoppinglistDetail(sl_id) { - - axios({ - method: 'get', - url: "/shoppinglist_json/" + sl_id, - - }).then((res) => { - app.currentlist = res.data; - console.log(res.data); - }); - - }, - - createShoppinglist(name, description) { - firebase.auth().onAuthStateChanged(function (user) { - if (user) { - firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) { - axios({ - method: 'post', - url: "/shoppinglist", - data: { - name: name, - description: description, - color: "white", - idtoken: idtoken - } - }).then((res) => { - app.myshoppinglists = res.data; - }); - }).catch((error) => console.error("Get id token client error: ", error)); - } else { - console.log("Check Auth error", user) - } - }); - - } - }, - - created() { - - firebase.auth().onAuthStateChanged(function (user) { - if (user) { - firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) { - axios.get('/myshoppinglists?idtoken=' + idtoken) - .then(function (res) { - - app.myshoppinglists = res.data; - console.log(res.data); - }) - .catch(function (error) { - - console.log(error); - }) - .then(function () { - - }); - }).catch((error) => console.error("Get id token client error: ", error)); - } else { - console.log("Check Auth error", user) - } - }); - - - - firebase.auth().onAuthStateChanged(function (user) { - if (user) { - firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) { - axios.get('sharedshoppinglists?idtoken=' + idtoken) - .then(function (res) { - - app.sharedshoppinglists = res.data; - console.log(res.data); - }) - .catch(function (error) { - - console.log(error); - }) - .then(function () { - - }); - }).catch((error) => console.error("Get id token client error: ", error)); - } else { - console.log("Check Auth error", user) - } - }); - } -}); - -$(document).ready(function(){ - $('.collapsible').collapsible(); - $('.modal').modal(); - }); - -$(document).on("click", ".citemL", function () { - $(".activeL").removeClass("activeL"); - $(this).addClass("activeL"); -}); - -$(".nav-createlist").click(function() { - $('#modal1').modal("open"); -}); \ No newline at end of file From e1c3a6864f085a6866cbeaacd0928d57b005d6e4 Mon Sep 17 00:00:00 2001 From: LukasNowy Date: Wed, 20 Mar 2019 15:36:10 +0100 Subject: [PATCH 2/2] s --- express-server/views/dash2.ejs | 124 --------------------------------- 1 file changed, 124 deletions(-) delete mode 100644 express-server/views/dash2.ejs diff --git a/express-server/views/dash2.ejs b/express-server/views/dash2.ejs deleted file mode 100644 index 30a10f3a..00000000 --- a/express-server/views/dash2.ejs +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - Dashboard - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
-
-
    -
  • -

    Your Shoppinglists

    -
  • -
  • -
    {{item.name}}delete edit -
    -
  • - -
- - - - -
- - -
- - -
- -
- - - - - - -
- - - - - - - - \ No newline at end of file