From 999c2c025cf22b92880183f4b43abee5453c3cb6 Mon Sep 17 00:00:00 2001 From: idoctnef Date: Fri, 7 Oct 2016 19:46:01 +0200 Subject: [PATCH] fav icons --- www/img/like.png | Bin 0 -> 722 bytes www/img/unlike.png | Bin 0 -> 793 bytes www/js/controllers.js | 18 +++++++++++++----- www/templates/signup.html | 4 ++++ www/templates/travel.html | 2 +- www/templates/user.html | 12 ++++++++---- 6 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 www/img/like.png create mode 100644 www/img/unlike.png diff --git a/www/img/like.png b/www/img/like.png new file mode 100644 index 0000000000000000000000000000000000000000..8b30fdad7fc7f67d465b0b6309c5e76b229a5323 GIT binary patch literal 722 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dy%*9TgAsieWw;%dH0CG7CJR*x3 z7&z{LFys6e@iss~$r9IylHmNblJdl&REF~Ma=pyF?Be9af>gcyqV(DCY@~pSeg^o2 zxc&zM28REkq5B;i&ZHUNPjGk~8hR$p_hPKu-B6dSq3*XsJugT4U5jzQ5#e_`+Vgg} z=dEz>Ycampqr9(2`rL^0x)$YeBgXqilowD0#Etg629ol+76}poGrX?>WurZBM1dGU z1t67Cp4TJ2uY+^}O#mYAYcTHhXfL2jpg4pCF+jF>1I0n+01?P!u;CCc$TWx`&}4`d zoP=6|A?~&FgXC#oAOw{J`2{mDGPAI9aB^|;3yF$LO35f|8W~%9c=`DUg@s2%rlh53 z6*e|Cx3qTj^!81dHh2D-En9c)*>~X3;iD%{UATDV>W$lvo;-c_^6ke@pTB*?YcA|W~TAb0e^1PQhW#}`iNo#nDbYVrvxphjVy-2~Xd? zN#6Hq{v6!$yWjWEJ@>o2=TgquUbcOWf+?k!F^pI73jW5=xQxp==SLgh_TeoY!;3h8 zAMpd`a?XqOm|7h{TS{pfH}D}I;0t^oxfijVQhL3C_?!3zU*aKV1N$JjZlsi^Q%Y@* z0dvk`8G3LXe_&)SUhe3`xghU zRx#QHt}`^QAe9YF;4eJC6-kL~8h_$Hyw?Km1>D6)Ya8HD1U_h%B!CC-8|GWV1@`06 zJVa5kw^6G=^ch~OfUDsSjwPJOOF8G`^_9Iz&LaAeKE5(f6bz(8mlRGi&Ct!}5PU2*I`#9%Gw zd<}~j-^JOFV=?D^t$Y;!j{UnZ`~9IcQN9Zf#(G@Z1p}8t>)^V980b@6NRvA#J{cN) z>#@3oQN>+9wgcj0!Ts2^-6-+2;);EH8^zxZ&eKnfZ2JII&^g79?-r9xmXS7R1}}jp9FJXw%##$odt(Uf(ryPM`yG__bW^l??=G zui{;>fR0V_x^XLdcT?OgeAc6i_rgsaZ7|*!v!2_`WMu=T&pRJqqqh_viuL{)?JaS( zl3XgVZ=){yaUv>xM*QpVsDUt1Q#`>|V~?My!jp53*Ga{eQkud~Ip?n`b3BcK?P&i4 X8>=_AhPkOT00000NkvXXu0mjf+_`6X literal 0 HcmV?d00001 diff --git a/www/js/controllers.js b/www/js/controllers.js index cfe4f4d..1cdc19a 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -73,13 +73,16 @@ angular.module('starter.controllers', ['pascalprecht.translate']) localStorage.setItem("c_avatar", response.data.avatar); localStorage.setItem("c_userdata", JSON.stringify(response.data.userdata)); + + $timeout(function() { + $scope.closeLogin(); + $window.location.reload(true); + }, 1000); }else{ console.log("login failed"); + $ionicLoading.show({ template: 'Login failed, user or password error.', noBackdrop: true, duration: 2000 }); } - $timeout(function() { - $scope.closeLogin(); - $window.location.reload(true); - }, 1000); + }, function(response) { // optional @@ -101,6 +104,7 @@ angular.module('starter.controllers', ['pascalprecht.translate']) // success console.log("response: "); console.log(response.data); + $scope.loginData.username=$scope.signupData.username; $timeout(function() { $scope.closeSignup(); $scope.login(); @@ -202,7 +206,6 @@ angular.module('starter.controllers', ['pascalprecht.translate']) }*/ $scope.travels=""; - $scope.travels=JSON.parse(localStorage.getItem('c_travels')); $scope.userdata=JSON.parse(localStorage.getItem('c_userdata')); console.log($scope.userdata); @@ -467,6 +470,10 @@ angular.module('starter.controllers', ['pascalprecht.translate']) }) .then(function(response) { console.log(response); + $scope.travels=response.data; + localStorage.setItem('c_travels', JSON.stringify($scope.travels)); + localStorage.setItem('c_travelsLastDate', JSON.stringify(new Date())); + }, function(response) { // optional // failed @@ -685,6 +692,7 @@ console.log($scope.newComment); username: localStorage.getItem("c_username"), avatar: localStorage.getItem("c_avatar") }; + $scope.user.favs.push($scope.newfav);//al unfav no cal fer aquest simulacre pq ja no existeix a l'array i no el resta dos cops en cas de que cliquin dos cops $http({ //url: urlapi + 'users/'+ $stateParams.username+'/fav', url: urlapi + 'users/'+ $scope.user._id+'/fav', diff --git a/www/templates/signup.html b/www/templates/signup.html index 6598678..e414ebc 100644 --- a/www/templates/signup.html +++ b/www/templates/signup.html @@ -28,6 +28,10 @@ {{'Telegram' | translate }} +