From b2f7fc9e7e6cfeca7554eb415aff83b0f7b6f150 Mon Sep 17 00:00:00 2001 From: LukasNowy Date: Wed, 20 Mar 2019 18:46:59 +0100 Subject: [PATCH] testen --- express-server/public/test/dash.js | 318 --------------------------- express-server/public/test/style.css | 24 -- express-server/views/dash2.ejs | 229 ------------------- 3 files changed, 571 deletions(-) delete mode 100644 express-server/public/test/dash.js delete mode 100644 express-server/public/test/style.css delete mode 100644 express-server/views/dash2.ejs diff --git a/express-server/public/test/dash.js b/express-server/public/test/dash.js deleted file mode 100644 index f8a2c4b0..00000000 --- a/express-server/public/test/dash.js +++ /dev/null @@ -1,318 +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: {}, - currentGroup: String, - users: [], - done_purchases: [] - }, - - 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: "#00a1ff", - 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) - } - }); - - }, - - deleteGroup(group_id, sl_id) { - axios({ - method: 'delete', - url: "/group", - data: { - sl_id: sl_id, - group_id: group_id - } - }).then((res) => { - console.log(res.data); - app.currentlist = res.data; - }); - }, - - addGroup(sl_id, name) { - - axios({ - method: 'post', - url: "/group", - data: { - sl_id: sl_id, - name: name, - color: "#00a1ff", - hidden: false - } - }).then((res) => { - console.log(res.data); - app.currentlist = res.data; - }); - }, - - addItem(group_id, sl_id, name, count) { - - console.log("AAA" + group_id + " ddd, " + sl_id) - - axios({ - method: 'post', - url: "/item", - data: { - sl_id: sl_id, - group_id: group_id, - name: name, - count: count - } - }).then((res) => { - console.log(res.data); - app.currentlist = res.data; - }); - }, - - setCurrentGroup(group_id) { - app.currentGroup = group_id; - console.log(group_id); - }, - - delItem(item_id, group_id, sl_id) { - - console.log(item_id + " d " + group_id + " " + sl_id) - - axios({ - method: 'delete', - url: "/item", - data: { - sl_id: sl_id, - group_id: group_id, - item_id: item_id - } - }).then((res) => { - console.log(res.data); - app.currentlist = res.data; - }); - }, - - removeMember(sl_id) { - firebase.auth().onAuthStateChanged(function (user) { - if (user) { - firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) { - axios({ - method: 'delete', - url: "/exitinvite", - data: { - sl_id: sl_id, - idtoken: idtoken - } - }).then((res) => { - app.sharedshoppinglists = res.data; - }); - }).catch((error) => console.error("Get id token client error: ", error)); - } else { - console.log("Check Auth error", user) - } - }); - }, - - createInvite(sl_id) { - axios({ - method: 'post', - url: "/invite", - data: { - sl_id: sl_id - } - }).then((res) => { - M.toast({html: 'Invite Link created'}); - }); - }, - - searchUsers(search) { - axios({ - method: 'get', - url: "/users?search=" + search - }).then((res) => { - app.users = res.data - }); - }, - - inviteMan(sl_id, user_id) { - axios({ - method: 'post', - url: "/maninvite", - data : { - uid: user_id, - sl_id: sl_id - } - }).then((res) => { - M.toast({html: 'User invited'}); - }); - } - - }, - - 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) - } - - firebase.auth().onAuthStateChanged(function (user) { - if (user) { - firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) { - axios.get('/donepurchases?idtoken=' + idtoken) - .then(function (res) { - - app.done_purchases = 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"); -}); - -$(".crtList").click(function() { - $('#modal1').modal("open"); -}); - -$(document).on("click", ".modlGR", function () { - $('#modalGR').modal("open"); -}); - - -$(document).on("click", ".modlIT", function () { - $('#modalIT').modal("open"); -}); - -$(".modlINV").click(function() { - $('#modalINV').modal("open"); -}); - -$(".modlINVM").click(function() { - $('#modalINVM').modal("open"); -}); \ No newline at end of file diff --git a/express-server/public/test/style.css b/express-server/public/test/style.css deleted file mode 100644 index 01993518..00000000 --- a/express-server/public/test/style.css +++ /dev/null @@ -1,24 +0,0 @@ -body { - background-color: rgb(240, 240, 240) !important; -} - -.msl { - color: rgb(56, 56, 56) !important; -} - -.activeL { - background-color: #e53935 !important; - color: #f0f0f0 !important; -} - -.ico { - color: #bdbdbd !important; -} - -.brand-logo { - margin-left: 30px !important; -} - -.icoR { - color: #e53935; -} \ No newline at end of file diff --git a/express-server/views/dash2.ejs b/express-server/views/dash2.ejs deleted file mode 100644 index 359df736..00000000 --- a/express-server/views/dash2.ejs +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - - - Dashboard - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
-
- - - - - - -
    -
  • -

    Your Done Purchases

    -
  • -
  • -
    {{item.count}}x {{item.name}} ({{item.date}})
    -
  • - -
- -
- - -
- -
    -
  • -
    deleteeditadd{{group.name}}
    -
    - -
      -
    • -
      {{item.name}} {{item.count}}x - delete -
      -
    • -
    - -
    -
  • -
-
- -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - \ No newline at end of file