- Wiring up for lifeeeeee
This commit is contained in:
1 parent
33cf657c70
commit
50c7ba87ef
5 files changed
+11
-7
No files matched your search
@@ -27,6 +27,7 @@
|
|||||||
"ionic-angular": "3.9.2",
|
"ionic-angular": "3.9.2",
|
||||||
"ionic-swipe-all": "^1.2.0",
|
"ionic-swipe-all": "^1.2.0",
|
||||||
"ionicons": "3.0.0",
|
"ionicons": "3.0.0",
|
||||||
|
"moment": "^2.21.0",
|
||||||
"rxjs": "5.5.2",
|
"rxjs": "5.5.2",
|
||||||
"sw-toolbox": "3.6.0",
|
"sw-toolbox": "3.6.0",
|
||||||
"zone.js": "0.8.18"
|
"zone.js": "0.8.18"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
[{"_id":"jdhgy3t46dgue","order":0,"details":{"name":"Test User","age":24,"pic":{"thumb":"https://placehold.it/500x500","detail":"https://placehold.it/1920x1280"}},"messages":[{"order":0,"text":"How are you?","image":"","isUser":false},{"order":1,"text":"I am well","image":"","isUser":true},{"order":2,"text":"Bored af","image":"","isUser":true},{"order":3,"text":"Here is one of the pictures I took.","image":"","isUser":false},{"order":4,"text":"","image":"https://placehold.it/1024x768","isUser":false}]},{"_id":"30927rywfhbvsdm","order":0,"details":{"name":"Test User","age":24,"pic":{"thumb":"https://placehold.it/500x500","detail":"https://placehold.it/1920x1280"}},"messages":[{"order":0,"text":"How are you?","image":"","isUser":false},{"order":1,"text":"I am well","image":"","isUser":true},{"order":2,"text":"Bored af","image":"","isUser":true},{"order":3,"text":"Here is one of the pictures I took.","image":"","isUser":false},{"order":4,"text":"","image":"https://placehold.it/1024x768","isUser":false}]},{"_id":"2938yr3gf83798d","order":0,"details":{"name":"Test User","age":24,"pic":{"thumb":"https://placehold.it/500x500","detail":"https://placehold.it/1920x1280"}},"messages":[{"order":0,"text":"How are you?","image":"","isUser":false},{"order":1,"text":"I am well","image":"","isUser":true},{"order":2,"text":"Bored af","image":"","isUser":true},{"order":3,"text":"Here is one of the pictures I took.","image":"","isUser":false},{"order":4,"text":"","image":"https://placehold.it/1024x768","isUser":false}]},{"_id":"uyr37tgf38fb","order":0,"details":{"name":"Test User","age":24,"pic":{"thumb":"https://placehold.it/500x500","detail":"https://placehold.it/1920x1280"}},"messages":[{"order":0,"text":"How are you?","image":"","isUser":false},{"order":1,"text":"I am well","image":"","isUser":true},{"order":2,"text":"Bored af","image":"","isUser":true},{"order":3,"text":"Here is one of the pictures I took.","image":"","isUser":false},{"order":4,"text":"","image":"https://placehold.it/1024x768","isUser":false}]},{"_id":"r3498ryg38yfbrhv","order":0,"details":{"name":"Test User","age":24,"pic":{"thumb":"https://placehold.it/500x500","detail":"https://placehold.it/1920x1280"}},"messages":[{"order":0,"text":"How are you?","image":"","isUser":false},{"order":1,"text":"I am well","image":"","isUser":true},{"order":2,"text":"Bored af","image":"","isUser":true},{"order":3,"text":"Here is one of the pictures I took.","image":"","isUser":false},{"order":4,"text":"","image":"https://placehold.it/1024x768","isUser":false}]},{"_id":"4903ufir34ffr","order":0,"details":{"name":"Test User","age":24,"pic":{"thumb":"https://placehold.it/500x500","detail":"https://placehold.it/1920x1280"}},"messages":[{"order":0,"text":"How are you?","image":"","isUser":false},{"order":1,"text":"I am well","image":"","isUser":true},{"order":2,"text":"Bored af","image":"","isUser":true},{"order":3,"text":"Here is one of the pictures I took.","image":"","isUser":false},{"order":4,"text":"","image":"https://placehold.it/1024x768","isUser":false}]},{"_id":"32ue834fh3u","order":0,"details":{"name":"Test User","age":24,"pic":{"thumb":"https://placehold.it/500x500","detail":"https://placehold.it/1920x1280"}},"messages":[{"order":0,"text":"How are you?","image":"","isUser":false},{"order":1,"text":"I am well","image":"","isUser":true},{"order":2,"text":"Bored af","image":"","isUser":true},{"order":3,"text":"Here is one of the pictures I took.","image":"","isUser":false},{"order":4,"text":"","image":"https://placehold.it/1024x768","isUser":false}]},{"_id":"389rufr9fvu3rv0","order":0,"details":{"name":"Test User","age":24,"pic":{"thumb":"https://placehold.it/500x500","detail":"https://placehold.it/1920x1280"}},"messages":[{"order":0,"text":"How are you?","image":"","isUser":false},{"order":1,"text":"I am well","image":"","isUser":true},{"order":2,"text":"Bored af","image":"","isUser":true},{"order":3,"text":"Here is one of the pictures I took.","image":"","isUser":false},{"order":4,"text":"","image":"https://placehold.it/1024x768","isUser":false}]},{"_id":"4i3jf89hfu9v","order":0,"details":{"name":"Test User","age":24,"pic":{"thumb":"https://placehold.it/500x500","detail":"https://placehold.it/1920x1280"}},"messages":[{"order":0,"text":"How are you?","image":"","isUser":false},{"order":1,"text":"I am well","image":"","isUser":true},{"order":2,"text":"Bored af","image":"","isUser":true},{"order":3,"text":"Here is one of the pictures I took.","image":"","isUser":false},{"order":4,"text":"","image":"https://placehold.it/1024x768","isUser":false}]},{"_id":"903rj89hf9uhruv","order":0,"details":{"name":"Test User","age":24,"pic":{"thumb":"https://placehold.it/500x500","detail":"https://placehold.it/1920x1280"}},"messages":[{"order":0,"text":"How are you?","image":"","isUser":false},{"order":1,"text":"I am well","image":"","isUser":true},{"order":2,"text":"Bored af","image":"","isUser":true},{"order":3,"text":"Here is one of the pictures I took.","image":"","isUser":false},Line truncated
|
[{"order":0,"details":{"name":"Matt","about":"straight / new to gay world / insecure / fleeing Poland for greener pastures","pic":{"detail":"images/profile/profile-m-001_detail.jpg","thumb":"images/profile/profile-m-001_thumbnail.jpg"}},"messages":[{"text":"Disclaimer: Matt and I met while out on the gay club scene in Copenhagen. Matt is from Poland and struggles to be out as bisexual there. When we met it was his first time going to a gay club (or doing anything gay honestly). While we were chatting he created a Grindr account for the first time. He has been learning Danish and is planning on moving to Copenhagen partially because Denmark is known for being more LGBT-friendly than Poland. The following conversation occurred on Facebook Messenger.","isUser":false,"timestamp":"02/10/2018 8:26:00"},{"text":"You are now connected on Messenger.","isUser":false,"timestamp":"02/10/2018 8:27:15"},{"text":"Hey matt - nice meeting you last night - how was the rest of the evening","isUser":false,"timestamp":"02/10/2018 8:28:30"},{"text":"Hi :) I don't remember when have You left.. you were with us in the last bar, right?","isUser":true,"timestamp":"02/10/2018 8:29:45"},{"text":"Also, do You remember names of anyone ? I wanted to add them on facebook, so I can plan to meet them again. or maybe You have already planned something ?","isUser":true,"timestamp":"02/10/2018 10:58:00"},{"text":"Hey sorry I haven't replied","isUser":false,"timestamp":"02/11/2018 6:36:00"},{"text":"Was just packing and such for my flight back to the US","isUser":false,"timestamp":"02/11/2018 6:37:15"},{"text":"But now I've learned my flight is cancelled so I'm at a hotel haha","isUser":false,"timestamp":"02/11/2018 6:38:30"},{"text":"And probably won't be able to leave until Tues…","isUser":false,"timestamp":"02/11/2018 6:39:45"},{"text":"So if you wanted to get together again and maybe I could talk more about my project?","isUser":false,"timestamp":"02/11/2018 6:41:00"},{"text":"oh, you cant stay with Johan anymore ?","isUser":true,"timestamp":"02/11/2018 6:42:15"},{"text":"I can but the airline put me up here at their expense","isUser":false,"timestamp":"02/11/2018 6:43:30"},{"text":"ok :) I have no plans for today to be honest. I just asked at couple facebook groups and couchsurfing about who wants to meet up","isUser":true,"timestamp":"02/11/2018 6:44:45"},{"text":"so we can meet anytime you want :)","isUser":true,"timestamp":"02/11/2018 6:46:00"},{"text":"Haha cool. Tomorrow or later this week could work. I need to get some work done... And see the status of my flight.","isUser":false,"timestamp":"02/11/2018 6:47:15"},{"text":"Where are you staying","isUser":false,"timestamp":"02/11/2018 6:48:30"},{"text":"at rented room in Rodovre","isUser":true,"timestamp":"02/11/2018 6:49:45"},{"text":"15 minutes ride from the city center.","isUser":true,"timestamp":"02/11/2018 6:51:00"},{"text":"Mm ok. Like an Airbnb or?","isUser":false,"timestamp":"02/11/2018 6:52:15"},{"text":"yeah, exactly :)","isUser":true,"timestamp":"02/11/2018 6:53:30"},{"text":"Aahh okay. Yeah maybe we can get together at some point","isUser":false,"timestamp":"02/11/2018 6:54:45"},{"text":"Great. We can go wherever you want, I'm open for everything so, I'll wait for message from You, ok?","isUser":true,"timestamp":"02/11/2018 6:56:00"},{"text":"No yeah I'll reach out. I really want to here more about Poland","isUser":false,"timestamp":"02/11/2018 6:57:15"},{"text":"Ok :) so, I'll be waiting then","isUser":true,"timestamp":"02/11/2018 6:58:30"},{"text":"sigh. still not clear what my plan will be","isUser":false,"timestamp":"02/11/2018 12:06:00"},{"text":"I think I will be here at least until Tuesday…","isUser":false,"timestamp":"02/11/2018 12:07:15"},{"text":"well.. i spent all day here, havent gone anywhere","isUser":true,"timestamp":"02/11/2018 12:08:30"},{"text":"yeah I feel that...","isUser":false,"timestamp":"02/11/2018 12:09:45"},{"text":"now i am just hoping to meet someone .. i wrote on facebook groups, i am using couchsurfing hangouts... i am giving myself an hour. if i dont find anyone by 7 pm, I will go out alone...","isUser":true,"timestamp":"02/11/2018 12:11:00"},{"text":"I've definitely traveled to places and spent way to much time in my room haha","isUser":false,"timestamp":"02/11/2018 12:12:15"},{"text":"ok :) To be honest, sooner or later I would have to overcome my anxiety and go to a bar alone.","isUser":true,"timestamp":"02/11/2018 12:13:30"},{"text":"so why not today ?","isUser":true,"timestamp":"02/11/2018 12:14:45"},{"text":"Haha fair enough but bars aren't so fun alone on a Sunday I think.","isUser":false,"timestamp":"02/11/2018 12:16:00"},{"text":"I see…","isUser":true,"timestamp":"02/11/2018 12:17:15"},{"text":"well, I wrote to couple people on Grindr - downloaded it for the first time","isUser":true,"timestamp":"02/11/2018 12:18:30"},{"text":"nice tell me how it goes!","isUser":false,"timestamp":"02/11/2018 12:19:45"},{"text":"Ok. If I do Line truncated
|
||||||
@@ -24,9 +24,7 @@
|
|||||||
<ion-col>
|
<ion-col>
|
||||||
{{profile.details.name}}
|
{{profile.details.name}}
|
||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col>
|
<ion-col [innerHTML]="getLatestMessageTimestamp(profile.messages)"></ion-col>
|
||||||
23h ago
|
|
||||||
</ion-col>
|
|
||||||
</ion-row>
|
</ion-row>
|
||||||
<ion-row nowrap>
|
<ion-row nowrap>
|
||||||
<ion-col [innerHTML]="getLatestMessage(profile.messages)"></ion-col>
|
<ion-col [innerHTML]="getLatestMessage(profile.messages)"></ion-col>
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import { ProfileService } from '../../services/profiles';
|
|||||||
import { ProfilePage } from '../profile/profile';
|
import { ProfilePage } from '../profile/profile';
|
||||||
import { ChatPage } from '../chat/chat';
|
import { ChatPage } from '../chat/chat';
|
||||||
|
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'page-messages',
|
selector: 'page-messages',
|
||||||
templateUrl: 'messages.html',
|
templateUrl: 'messages.html',
|
||||||
@@ -21,8 +23,11 @@ export class MessagesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getLatestMessage(messages) {
|
getLatestMessage(messages) {
|
||||||
var latest = Math.max.apply(Math, messages.map(function(o){ return o.order; }));
|
return messages[(messages.length - 1)].text != '' ? messages[(messages.length - 1)].text : '<em>Picture</em>';
|
||||||
return messages[latest].text != '' ? messages[latest].text : '<em>Picture</em>';
|
}
|
||||||
|
|
||||||
|
getLatestMessageTimestamp(messages) {
|
||||||
|
return moment(messages[(messages.length - 1)].timestamp).fromNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
interviewTapped(event, profile) {
|
interviewTapped(event, profile) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export class ProfileService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
this.http.get('/assets/data/profiles.json')
|
this.http.get('https://api.fitz.guru/urge/profiles')
|
||||||
.map(res => res.json())
|
.map(res => res.json())
|
||||||
.subscribe(data => {
|
.subscribe(data => {
|
||||||
this.profiles = data;
|
this.profiles = data;
|
||||||
|
|||||||
Reference in new issue
Block a user