ddd
This commit is contained in:
		@@ -21,6 +21,7 @@ var config = {
 | 
			
		||||
 | 
			
		||||
  //verifyInvite(last_segment);
 | 
			
		||||
  getList(last_segment);
 | 
			
		||||
  verifyInvite(last_segment);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  function verifyInvite(link) {
 | 
			
		||||
@@ -34,12 +35,13 @@ var config = {
 | 
			
		||||
                link: link
 | 
			
		||||
            },
 | 
			
		||||
            success(){
 | 
			
		||||
               // window.location.href = "/dash/" + idtoken
 | 
			
		||||
               alert("Success");
 | 
			
		||||
               window.location.href = "/dash/" + idtoken
 | 
			
		||||
               //alert("Success");
 | 
			
		||||
            },
 | 
			
		||||
            error(err){
 | 
			
		||||
                console.error("Error: " + err);
 | 
			
		||||
                alert("Error");
 | 
			
		||||
                //alert("Error");
 | 
			
		||||
                window.location.href = "/dash/" + idtoken
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
    }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								express-server/public/invite/style.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								express-server/public/invite/style.css
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
body {
 | 
			
		||||
    background-color: #121212;
 | 
			
		||||
    display:none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.cont {
 | 
			
		||||
    background-color: #f5f5f5;
 | 
			
		||||
}
 | 
			
		||||
@@ -15,26 +15,35 @@
 | 
			
		||||
var msg = firebase.messaging();
 | 
			
		||||
msg.requestPermission()
 | 
			
		||||
.then(function(){
 | 
			
		||||
    console.log("Zugriff auf msg")
 | 
			
		||||
    console.log("Zugriff auf msg");
 | 
			
		||||
    return msg.getToken();
 | 
			
		||||
})
 | 
			
		||||
.then(token => {
 | 
			
		||||
    console.log("MSG TOKEN: ", token)
 | 
			
		||||
    updateUser(token);
 | 
			
		||||
    
 | 
			
		||||
})
 | 
			
		||||
.catch(err => {
 | 
			
		||||
    console.error("Msg Error: ", err)
 | 
			
		||||
    console.error("Msg Error: ", err);
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
axios.post('/user', {
 | 
			
		||||
    message_id: 'test',
 | 
			
		||||
  })
 | 
			
		||||
  .then(function (response) {
 | 
			
		||||
    console.log(response);
 | 
			
		||||
  })
 | 
			
		||||
  .catch(function (error) {
 | 
			
		||||
    console.log(error);
 | 
			
		||||
});
 | 
			
		||||
function updateUser(token) {
 | 
			
		||||
  firebase.auth().onAuthStateChanged(function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
			
		||||
      $.ajax({
 | 
			
		||||
          type: "POST",
 | 
			
		||||
          url: "/user",
 | 
			
		||||
          data:{
 | 
			
		||||
              idtoken: idtoken,
 | 
			
		||||
              message_id: token
 | 
			
		||||
          },
 | 
			
		||||
          success(){
 | 
			
		||||
              console.log("User updated");
 | 
			
		||||
          },
 | 
			
		||||
          error(err){
 | 
			
		||||
              console.error("Error: " + err);
 | 
			
		||||
          }
 | 
			
		||||
      });
 | 
			
		||||
  }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
msg.onMessage(payload => {
 | 
			
		||||
    const title = payload.data.title
 | 
			
		||||
 
 | 
			
		||||
@@ -18,6 +18,7 @@ function checkAuth(){
 | 
			
		||||
            try{
 | 
			
		||||
            firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idToken) {
 | 
			
		||||
                console.log("Vor Replace");
 | 
			
		||||
 | 
			
		||||
                window.location.replace("/dash/" + idToken);
 | 
			
		||||
              }).catch(function(error) {
 | 
			
		||||
                console.error("Get id token client error: ", error)
 | 
			
		||||
@@ -40,6 +41,7 @@ window.onload = function(){
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
var vue = new Vue({
 | 
			
		||||
    el: '#vue-app',
 | 
			
		||||
    data:{
 | 
			
		||||
@@ -71,6 +73,7 @@ var vue = new Vue({
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
    mounted() {
 | 
			
		||||
        /*axios.post('/user', {
 | 
			
		||||
            message_id: 'test',
 | 
			
		||||
@@ -82,4 +85,17 @@ var vue = new Vue({
 | 
			
		||||
            console.log(error);
 | 
			
		||||
          });*/
 | 
			
		||||
    }
 | 
			
		||||
=======
 | 
			
		||||
    // mounted() {
 | 
			
		||||
    //     axios.post('/user', {
 | 
			
		||||
    //         message_id: 'test',
 | 
			
		||||
    //       })
 | 
			
		||||
    //       .then(function (response) {
 | 
			
		||||
    //         console.log(response);
 | 
			
		||||
    //       })
 | 
			
		||||
    //       .catch(function (error) {
 | 
			
		||||
    //         console.log(error);
 | 
			
		||||
    //       });
 | 
			
		||||
    // }
 | 
			
		||||
>>>>>>> 51e8fe7ad3886f317cd447a9b70b535cd6668806
 | 
			
		||||
});
 | 
			
		||||
@@ -44,8 +44,11 @@ var config = {
 | 
			
		||||
  firebase.initializeApp(config);
 | 
			
		||||
 | 
			
		||||
  getAllShoppinglists();
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
  updateUser();
 | 
			
		||||
  displayShoppinglist();
 | 
			
		||||
=======
 | 
			
		||||
>>>>>>> 51e8fe7ad3886f317cd447a9b70b535cd6668806
 | 
			
		||||
 | 
			
		||||
function movePurchases(text) {
 | 
			
		||||
    firebase.auth().onAuthStateChanged(function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
			
		||||
@@ -189,58 +192,3 @@ var loading = false;
 | 
			
		||||
}
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
function updateUser() {
 | 
			
		||||
    firebase.auth().onAuthStateChanged(function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
			
		||||
        $.ajax({
 | 
			
		||||
            type: "POST",
 | 
			
		||||
            url: "/user",
 | 
			
		||||
            data:{
 | 
			
		||||
                idtoken: idtoken,
 | 
			
		||||
                message_id: "msgtest"
 | 
			
		||||
            },
 | 
			
		||||
            success(){
 | 
			
		||||
                console.log("USer updated");
 | 
			
		||||
            },
 | 
			
		||||
            error(err){
 | 
			
		||||
                console.error("Error: " + err);
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
    }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function updateUser() {
 | 
			
		||||
    firebase.auth().onAuthStateChanged(function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
			
		||||
        $.ajax({
 | 
			
		||||
            type: "POST",
 | 
			
		||||
            url: "/user",
 | 
			
		||||
            data:{
 | 
			
		||||
                idtoken: idtoken,
 | 
			
		||||
                message_id: "msgtest"
 | 
			
		||||
            },
 | 
			
		||||
            success(){
 | 
			
		||||
                console.log("USer updated");
 | 
			
		||||
            },
 | 
			
		||||
            error(err){
 | 
			
		||||
                console.error("Error: " + err);
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
    }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function displayShoppinglist() {
 | 
			
		||||
    firebase.auth().onAuthStateChanged(function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
			
		||||
        $.ajax({
 | 
			
		||||
            type: "GET",
 | 
			
		||||
            url: "/shoppinglist_json/4tezJYMK",
 | 
			
		||||
            data:{
 | 
			
		||||
                idtoken: idtoken
 | 
			
		||||
            },
 | 
			
		||||
            success(data){
 | 
			
		||||
                console.log("Result: ", data.sl_id);
 | 
			
		||||
            },
 | 
			
		||||
            error(err){
 | 
			
		||||
                console.error("Error: " + err);
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
    }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
			
		||||
}
 | 
			
		||||
@@ -10,29 +10,46 @@
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.opt2 {
 | 
			
		||||
    background-color: #039be5 ;
 | 
			
		||||
    background-color: #039be5 !important;
 | 
			
		||||
    height: 100%;
 | 
			
		||||
    max-height: 100%;
 | 
			
		||||
    transition: 1s;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.opt2:hover {
 | 
			
		||||
    background-color: #4fc3f7;
 | 
			
		||||
    background-color: #4fc3f7 !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.r1 {
 | 
			
		||||
    height: 100%;
 | 
			
		||||
    max-height: 100%;
 | 
			
		||||
    margin-top: 100%;
 | 
			
		||||
    transform: translateY(100%);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.r2 {
 | 
			
		||||
    height: 100%;
 | 
			
		||||
    max-height: 100%;
 | 
			
		||||
    transform: translateY(100%);
 | 
			
		||||
    background-color: #242424;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.row {
 | 
			
		||||
    margin-bottom: 0px !important;
 | 
			
		||||
    margin-top: 0px !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.container {
 | 
			
		||||
    margin-bottom: 0px !important;
 | 
			
		||||
    margin-top: 0px !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
html, body {
 | 
			
		||||
    height: 100%;
 | 
			
		||||
    margin: 0;
 | 
			
		||||
    max-height: 100%;
 | 
			
		||||
    overflow: hidden;
 | 
			
		||||
    background-color: #161616;
 | 
			
		||||
    background-color: #242424;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
.ico {
 | 
			
		||||
@@ -44,5 +61,30 @@ html, body {
 | 
			
		||||
 | 
			
		||||
.collection .collection-item.active {
 | 
			
		||||
    /* background-color: #00c853; */
 | 
			
		||||
    background-color: rgb(0, 195, 255);
 | 
			
		||||
    color: rgb(24, 24, 24);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.collection .collection-item.active {
 | 
			
		||||
    /* background-color: #00c853; */
 | 
			
		||||
    background-color: rgb(0, 195, 255);
 | 
			
		||||
    color: rgb(24, 24, 24);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.collection-item {
 | 
			
		||||
    /* background-color: #00c853; */
 | 
			
		||||
    color: rgb(24, 24, 24) !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.btn-choose {
 | 
			
		||||
    width: 100%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.progress .indeterminate {
 | 
			
		||||
    background-color: #f4511e;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.progress {
 | 
			
		||||
    background-color: #f8cfc3;
 | 
			
		||||
} 
 | 
			
		||||
@@ -6,16 +6,52 @@
 | 
			
		||||
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
 | 
			
		||||
    <title>Document</title>
 | 
			
		||||
 | 
			
		||||
    <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
 | 
			
		||||
 | 
			
		||||
    <script src="https://www.gstatic.com/firebasejs/5.7.0/firebase.js"></script>
 | 
			
		||||
    
 | 
			
		||||
    <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
 | 
			
		||||
    <script src="/invite/inv.js"></script>
 | 
			
		||||
 | 
			
		||||
    <link rel="stylesheet" href="/invite/style.css">
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    <!--Import Google Icon Font-->
 | 
			
		||||
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    <!--Let browser know website is optimized for mobile-->
 | 
			
		||||
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
 | 
			
		||||
 | 
			
		||||
    <!-- Compiled and minified CSS -->
 | 
			
		||||
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
 | 
			
		||||
 | 
			
		||||
    <!-- Compiled and minified JavaScript -->
 | 
			
		||||
    <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    <div class="container cont z-depth-4">
 | 
			
		||||
        <div class="col s12 head">
 | 
			
		||||
            <p class="s_name">Name: </p>
 | 
			
		||||
            <p class="s_desc">Description: </p>
 | 
			
		||||
            <p class="s_link">Invite Link: </p>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="row col s12 foot">
 | 
			
		||||
            <div class="col s12 m6 cancelinvite waves-effect waves-light deep-orange darken-1">
 | 
			
		||||
                Cancel Invite
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div class="col s12 m6 confirminvite waves-effect waves-light light-blue darken-1 btn_verify">
 | 
			
		||||
                Confirm Invite
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
            
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <button class="btn_verify">Join to this Shoppinglist</button>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
@@ -65,7 +65,7 @@
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
<div class="fixed-action-btn">
 | 
			
		||||
    <a class="btn-floating btn-large red btndash">
 | 
			
		||||
    <a class="btn-floating btn-large btndash">
 | 
			
		||||
      <i class="large material-icons blue-grey darken-4">arrow_back</i>
 | 
			
		||||
    </a>
 | 
			
		||||
  </div>
 | 
			
		||||
@@ -94,7 +94,7 @@
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="modal-footer">
 | 
			
		||||
            <a class="modal-close waves-effect waves-red btn-flat btndash">Return to Dashboard</a>
 | 
			
		||||
      <a href="#!" class="modal-close waves-effect waves-green btn-flat btncont">Continue</a>
 | 
			
		||||
      <a class="modal-close waves-effect waves-green btn-flat btncont">Continue</a>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user