8 | };
--------------------------------------------------------------------------------
/src/app/app.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { ErrorHandler, NgModule } from '@angular/core';
3 | import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
4 | import { SplashScreen } from '@ionic-native/splash-screen';
5 | import { StatusBar } from '@ionic-native/status-bar';
6 | import { File } from '@ionic-native/file';
7 | import { FileChooser } from '@ionic-native/file-chooser';
8 | import { FilePath } from '@ionic-native/file-path';
9 |
10 | import { config } from './app.firebaseconfig';
11 |
12 | import { AngularFireAuth } from 'angularfire2/auth';
13 | import { AngularFireModule } from 'angularfire2';
14 |
15 | import { MyApp } from './app.component';
16 | import { AuthProvider } from '../providers/auth/auth';
17 | import { UserProvider } from '../providers/user/user';
18 | import { ImghandlerProvider } from '../providers/imghandler/imghandler';
19 | import { RequestsProvider } from '../providers/requests/requests';
20 | import { ChatProvider } from '../providers/chat/chat';
21 | import { GroupsProvider } from '../providers/groups/groups';
22 |
23 |
24 | @NgModule({
25 | declarations: [
26 | MyApp
27 | ],
28 | imports: [
29 | BrowserModule,
30 | IonicModule.forRoot(MyApp, {tabsPlacement: 'top'}),
31 | AngularFireModule.initializeApp(config)
32 | ],
33 | bootstrap: [IonicApp],
34 | entryComponents: [
35 | MyApp
36 | ],
37 | providers: [
38 | StatusBar,
39 | SplashScreen,
40 | File,
41 | FilePath,
42 | FileChooser,
43 | {provide: ErrorHandler, useClass: IonicErrorHandler},
44 | AuthProvider,
45 | AngularFireAuth,
46 | UserProvider,
47 | ImghandlerProvider,
48 | UserProvider,
49 | RequestsProvider,
50 | ChatProvider,
51 | GroupsProvider
52 | ]
53 | })
54 | export class AppModule {}
55 |
--------------------------------------------------------------------------------
/src/app/app.scss:
--------------------------------------------------------------------------------
1 | // http://ionicframework.com/docs/v2/theming/
2 |
3 |
4 | // App Global Sass
5 | // --------------------------------------------------
6 | // Put style rules here that you want to apply globally. These
7 | // styles are for the entire app and not just one component.
8 | // Additionally, this file can be also used as an entry point
9 | // to import other Sass files to be included in the output CSS.
10 | //
11 | // Shared Sass variables, which can be used to adjust Ionic's
12 | // default Sass variables, belong in "theme/variables.scss".
13 | //
14 | // To declare rules for a specific mode, create a child rule
15 | // for the .md, .ios, or .wp mode classes. The mode class is
16 | // automatically applied to the element in the app.
17 | .title.title-md {
18 | position: absolute;
19 | left: 50%;
20 | top: 0;
21 | transform: translateX(-50%);
22 | height: 100%;
23 | width: 70%;
24 | text-align: center;
25 | }
--------------------------------------------------------------------------------
/src/app/main.ts:
--------------------------------------------------------------------------------
1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2 |
3 | import { AppModule } from './app.module';
4 |
5 | platformBrowserDynamic().bootstrapModule(AppModule);
6 |
--------------------------------------------------------------------------------
/src/assets/bgimage.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rajayogan/ionic3chat/dccdd5fc344adc27eaf34963cd98781223a7d826/src/assets/bgimage.jpg
--------------------------------------------------------------------------------
/src/assets/icon/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rajayogan/ionic3chat/dccdd5fc344adc27eaf34963cd98781223a7d826/src/assets/icon/favicon.ico
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Ionic App
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/src/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Ionic",
3 | "short_name": "Ionic",
4 | "start_url": "index.html",
5 | "display": "standalone",
6 | "icons": [{
7 | "src": "assets/imgs/logo.png",
8 | "sizes": "512x512",
9 | "type": "image/png"
10 | }],
11 | "background_color": "#4e8ef7",
12 | "theme_color": "#4e8ef7"
13 | }
--------------------------------------------------------------------------------
/src/models/interfaces/request.ts:
--------------------------------------------------------------------------------
1 | export interface connreq {
2 | sender: string;
3 | recipient: string;
4 | }
--------------------------------------------------------------------------------
/src/models/interfaces/usercreds.ts:
--------------------------------------------------------------------------------
1 | export interface usercreds {
2 | email: string;
3 | password: string;
4 | }
--------------------------------------------------------------------------------
/src/pages/buddies/buddies.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 | Buddies
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | {{key.displayName}}
26 |
27 |
28 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/pages/buddies/buddies.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { BuddiesPage } from './buddies';
4 |
5 | @NgModule({
6 | declarations: [
7 | BuddiesPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(BuddiesPage),
11 | ],
12 | exports: [
13 | BuddiesPage
14 | ]
15 | })
16 | export class BuddiesPageModule {}
17 |
--------------------------------------------------------------------------------
/src/pages/buddies/buddies.scss:
--------------------------------------------------------------------------------
1 | page-buddies {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/pages/buddies/buddies.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { IonicPage, NavController, NavParams, AlertController } from 'ionic-angular';
3 | import { UserProvider } from '../../providers/user/user';
4 | import { RequestsProvider } from '../../providers/requests/requests';
5 | import { connreq } from '../../models/interfaces/request';
6 | import firebase from 'firebase';
7 | /**
8 | * Generated class for the BuddiesPage page.
9 | *
10 | * See http://ionicframework.com/docs/components/#navigation for more info
11 | * on Ionic pages and navigation.
12 | */
13 | @IonicPage()
14 | @Component({
15 | selector: 'page-buddies',
16 | templateUrl: 'buddies.html',
17 | })
18 | export class BuddiesPage {
19 | newrequest = {} as connreq;
20 | temparr = [];
21 | filteredusers = [];
22 | constructor(public navCtrl: NavController, public navParams: NavParams,
23 | public userservice: UserProvider, public alertCtrl: AlertController,
24 | public requestservice: RequestsProvider) {
25 | this.userservice.getallusers().then((res: any) => {
26 | this.filteredusers = res;
27 | this.temparr = res;
28 | })
29 | }
30 |
31 | ionViewDidLoad() {
32 |
33 | }
34 |
35 | searchuser(searchbar) {
36 | this.filteredusers = this.temparr;
37 | var q = searchbar.target.value;
38 | if (q.trim() == '') {
39 | return;
40 | }
41 |
42 | this.filteredusers = this.filteredusers.filter((v) => {
43 | if (v.displayName.toLowerCase().indexOf(q.toLowerCase()) > -1) {
44 | return true;
45 | }
46 | return false;
47 | })
48 | }
49 |
50 | sendreq(recipient) {
51 | this.newrequest.sender = firebase.auth().currentUser.uid;
52 | this.newrequest.recipient = recipient.uid;
53 | if (this.newrequest.sender === this.newrequest.recipient)
54 | alert('You are your friend always');
55 | else {
56 | let successalert = this.alertCtrl.create({
57 | title: 'Request sent',
58 | subTitle: 'Your request was sent to ' + recipient.displayName,
59 | buttons: ['ok']
60 | });
61 |
62 | this.requestservice.sendrequest(this.newrequest).then((res: any) => {
63 | if (res.success) {
64 | successalert.present();
65 | let sentuser = this.filteredusers.indexOf(recipient);
66 | this.filteredusers.splice(sentuser, 1);
67 | }
68 | }).catch((err) => {
69 | alert(err);
70 | })
71 | }
72 | }
73 |
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/src/pages/buddychat/buddychat.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 | {{buddy.displayName}}
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
{{item.message}}
30 |

31 |
32 |
33 |
34 |
35 |
36 |
{{item.message}}
37 |

38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src/pages/buddychat/buddychat.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { BuddychatPage } from './buddychat';
4 |
5 | @NgModule({
6 | declarations: [
7 | BuddychatPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(BuddychatPage),
11 | ],
12 | exports: [
13 | BuddychatPage
14 | ]
15 | })
16 | export class BuddychatPageModule {}
17 |
--------------------------------------------------------------------------------
/src/pages/buddychat/buddychat.scss:
--------------------------------------------------------------------------------
1 | page-buddychat {
2 | .chat {
3 | width: 320px;
4 | }
5 |
6 | .bubble{
7 | background-color: #F2F2F2;
8 | border-radius: 5px;
9 | box-shadow: 0 0 6px #B2B2B2;
10 | display: inline-block;
11 | padding: 10px 18px;
12 | position: relative;
13 | vertical-align: top;
14 | }
15 |
16 | .bubble::before {
17 | background-color: #F2F2F2;
18 | content: "\00a0";
19 | display: block;
20 | height: 16px;
21 | position: absolute;
22 | top: 11px;
23 | transform: rotate( 29deg ) skew( -35deg );
24 | -moz-transform: rotate( 29deg ) skew( -35deg );
25 | -ms-transform: rotate( 29deg ) skew( -35deg );
26 | -o-transform: rotate( 29deg ) skew( -35deg );
27 | -webkit-transform: rotate( 29deg ) skew( -35deg );
28 | width: 20px;
29 | }
30 |
31 | .me {
32 | float: left;
33 | margin: 5px 45px 5px 20px;
34 | }
35 |
36 | .me::before {
37 | box-shadow: -2px 2px 2px 0 rgba( 178, 178, 178, .4 );
38 | left: -9px;
39 | }
40 |
41 | .you {
42 | float: right;
43 | margin: 5px 20px 5px 45px;
44 | }
45 |
46 | .you::before {
47 | box-shadow: 2px -2px 2px 0 rgba( 178, 178, 178, .4 );
48 | right: -9px;
49 | }
50 |
51 | .chatwindow {
52 | padding-bottom: 70px;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/pages/buddychat/buddychat.ts:
--------------------------------------------------------------------------------
1 | import { Component, ViewChild, NgZone } from '@angular/core';
2 | import { IonicPage, NavController, NavParams, Events, Content, LoadingController } from 'ionic-angular';
3 | import { ChatProvider } from '../../providers/chat/chat';
4 | import { ImghandlerProvider } from '../../providers/imghandler/imghandler';
5 | import firebase from 'firebase';
6 | /**
7 | * Generated class for the BuddychatPage page.
8 | *
9 | * See http://ionicframework.com/docs/components/#navigation for more info
10 | * on Ionic pages and navigation.
11 | */
12 | @IonicPage()
13 | @Component({
14 | selector: 'page-buddychat',
15 | templateUrl: 'buddychat.html',
16 | })
17 | export class BuddychatPage {
18 | @ViewChild('content') content: Content;
19 | buddy: any;
20 | newmessage;
21 | allmessages = [];
22 | photoURL;
23 | imgornot;
24 | constructor(public navCtrl: NavController, public navParams: NavParams, public chatservice: ChatProvider,
25 | public events: Events, public zone: NgZone, public loadingCtrl: LoadingController,
26 | public imgstore: ImghandlerProvider) {
27 | this.buddy = this.chatservice.buddy;
28 | this.photoURL = firebase.auth().currentUser.photoURL;
29 | this.scrollto();
30 | this.events.subscribe('newmessage', () => {
31 | this.allmessages = [];
32 | this.imgornot = [];
33 | this.zone.run(() => {
34 | this.allmessages = this.chatservice.buddymessages;
35 | for (var key in this.allmessages) {
36 | if (this.allmessages[key].message.substring(0, 4) == 'http')
37 | this.imgornot.push(true);
38 | else
39 | this.imgornot.push(false);
40 | }
41 | })
42 |
43 |
44 | })
45 | }
46 |
47 | addmessage() {
48 | this.chatservice.addnewmessage(this.newmessage).then(() => {
49 | this.content.scrollToBottom();
50 | this.newmessage = '';
51 | })
52 | }
53 |
54 | ionViewDidEnter() {
55 | this.chatservice.getbuddymessages();
56 | }
57 |
58 | scrollto() {
59 | setTimeout(() => {
60 | this.content.scrollToBottom();
61 | }, 1000);
62 | }
63 |
64 | sendPicMsg() {
65 | let loader = this.loadingCtrl.create({
66 | content: 'Please wait'
67 | });
68 | loader.present();
69 | this.imgstore.picmsgstore().then((imgurl) => {
70 | loader.dismiss();
71 | this.chatservice.addnewmessage(imgurl).then(() => {
72 | this.scrollto();
73 | this.newmessage = '';
74 | })
75 | }).catch((err) => {
76 | alert(err);
77 | loader.dismiss();
78 | })
79 | }
80 |
81 |
82 |
83 |
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/src/pages/chats/chats.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 | Chats
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | Requests
25 |
26 |
27 |
28 |
29 |
30 |
31 | {{item.displayName}}
32 |
33 |
34 |
38 |
42 |
43 |
44 |
45 | Friends
46 |
47 |
48 |
49 |
50 |
51 | {{item.displayName}}
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/src/pages/chats/chats.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { ChatsPage } from './chats';
4 |
5 | @NgModule({
6 | declarations: [
7 | ChatsPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(ChatsPage),
11 | ],
12 | exports: [
13 | ChatsPage
14 | ]
15 | })
16 | export class ChatsPageModule {}
17 |
--------------------------------------------------------------------------------
/src/pages/chats/chats.scss:
--------------------------------------------------------------------------------
1 | page-chats {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/pages/chats/chats.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { IonicPage, NavController, NavParams, Events, AlertController } from 'ionic-angular';
3 | import { RequestsProvider } from '../../providers/requests/requests';
4 | import { ChatProvider } from '../../providers/chat/chat';
5 |
6 | /**
7 | * Generated class for the ChatsPage page.
8 | *
9 | * See http://ionicframework.com/docs/components/#navigation for more info
10 | * on Ionic pages and navigation.
11 | */
12 | @IonicPage()
13 | @Component({
14 | selector: 'page-chats',
15 | templateUrl: 'chats.html',
16 | })
17 | export class ChatsPage {
18 | myrequests;
19 | myfriends;
20 | constructor(public navCtrl: NavController, public navParams: NavParams, public requestservice: RequestsProvider,
21 | public events: Events, public alertCtrl: AlertController, public chatservice: ChatProvider) {
22 | }
23 |
24 |
25 | ionViewWillEnter() {
26 | this.requestservice.getmyrequests();
27 | this.requestservice.getmyfriends();
28 | this.myfriends = [];
29 | this.events.subscribe('gotrequests', () => {
30 | this.myrequests = [];
31 | this.myrequests = this.requestservice.userdetails;
32 | })
33 | this.events.subscribe('friends', () => {
34 | this.myfriends = [];
35 | this.myfriends = this.requestservice.myfriends;
36 | })
37 | }
38 |
39 | ionViewDidLeave() {
40 | this.events.unsubscribe('gotrequests');
41 | this.events.unsubscribe('friends');
42 | }
43 |
44 |
45 | addbuddy() {
46 | this.navCtrl.push('BuddiesPage');
47 | }
48 |
49 | accept(item) {
50 | this.requestservice.acceptrequest(item).then(() => {
51 |
52 | let newalert = this.alertCtrl.create({
53 | title: 'Friend added',
54 | subTitle: 'Tap on the friend to chat with him',
55 | buttons: ['Okay']
56 | });
57 | newalert.present();
58 | })
59 | }
60 |
61 | ignore(item) {
62 | this.requestservice.deleterequest(item).then(() => {
63 |
64 | }).catch((err) => {
65 | alert(err);
66 | })
67 | }
68 |
69 | buddychat(buddy) {
70 | this.chatservice.initializebuddy(buddy);
71 | this.navCtrl.push('BuddychatPage');
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/src/pages/groupbuddies/groupbuddies.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 | Group Buddies
11 |
12 |
13 |
14 |
15 |
16 |
17 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | {{key.displayName}}
27 |
28 |
29 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/src/pages/groupbuddies/groupbuddies.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { GroupbuddiesPage } from './groupbuddies';
4 |
5 | @NgModule({
6 | declarations: [
7 | GroupbuddiesPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(GroupbuddiesPage),
11 | ],
12 | exports: [
13 | GroupbuddiesPage
14 | ]
15 | })
16 | export class GroupbuddiesPageModule {}
17 |
--------------------------------------------------------------------------------
/src/pages/groupbuddies/groupbuddies.scss:
--------------------------------------------------------------------------------
1 | page-groupbuddies {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/pages/groupbuddies/groupbuddies.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { IonicPage, NavController, NavParams, Events } from 'ionic-angular';
3 | import { RequestsProvider } from '../../providers/requests/requests';
4 | import { GroupsProvider } from '../../providers/groups/groups';
5 |
6 | /**
7 | * Generated class for the GroupbuddiesPage page.
8 | *
9 | * See http://ionicframework.com/docs/components/#navigation for more info
10 | * on Ionic pages and navigation.
11 | */
12 | @IonicPage()
13 | @Component({
14 | selector: 'page-groupbuddies',
15 | templateUrl: 'groupbuddies.html',
16 | })
17 | export class GroupbuddiesPage {
18 | myfriends = [];
19 | groupmembers = [];
20 | searchstring;
21 | tempmyfriends = [];
22 | newbuddy;
23 | constructor(public navCtrl: NavController, public navParams: NavParams, public requestservice: RequestsProvider,
24 | public events: Events, public groupservice: GroupsProvider) {
25 | }
26 |
27 | ionViewWillEnter() {
28 | this.requestservice.getmyfriends();
29 | this.events.subscribe('gotintogroup', () => {
30 | this.myfriends.splice(this.myfriends.indexOf(this.newbuddy.uid), 1);
31 | this.tempmyfriends = this.myfriends;
32 | })
33 | this.events.subscribe('friends', () => {
34 |
35 | this.myfriends = [];
36 | this.myfriends = this.requestservice.myfriends;
37 | this.groupmembers = this.groupservice.currentgroup;
38 | for (var key in this.groupmembers)
39 | for (var friend in this.myfriends) {
40 | if (this.groupmembers[key].uid === this.myfriends[friend].uid)
41 | this.myfriends.splice(this.myfriends.indexOf(this.myfriends[friend]), 1);
42 | }
43 | this.tempmyfriends = this.myfriends;
44 | })
45 | }
46 |
47 | searchuser(searchbar) {
48 | let tempfriends = this.tempmyfriends;
49 |
50 | var q = searchbar.target.value;
51 |
52 | if (q.trim() === '') {
53 | this.myfriends = this.tempmyfriends;
54 | return;
55 | }
56 |
57 | tempfriends = tempfriends.filter((v) => {
58 | if (v.displayName.toLowerCase().indexOf(q.toLowerCase()) > -1) {
59 | return true;
60 | }
61 | return false;
62 | })
63 |
64 | this.myfriends = tempfriends;
65 |
66 | }
67 |
68 | addbuddy(buddy) {
69 | this.newbuddy = buddy;
70 | this.groupservice.addmember(buddy);
71 | }
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/src/pages/groupchat/groupchat.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 | {{groupName}}
11 |
12 |
15 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
{{item.displayName}}
36 |
{{item.message}}
37 |

38 |
{{item.timestamp}}
39 |
40 |
41 |
42 |
43 |
44 |
{{item.displayName}}
45 |
{{item.message}}
46 |

47 |
{{item.timestamp}}
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/src/pages/groupchat/groupchat.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { GroupchatPage } from './groupchat';
4 |
5 | @NgModule({
6 | declarations: [
7 | GroupchatPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(GroupchatPage),
11 | ],
12 | exports: [
13 | GroupchatPage
14 | ]
15 | })
16 | export class GroupchatPageModule {}
17 |
--------------------------------------------------------------------------------
/src/pages/groupchat/groupchat.scss:
--------------------------------------------------------------------------------
1 | page-groupchat {
2 | .chat {
3 | width: 320px;
4 | }
5 |
6 | .bubble{
7 | background-color: #F2F2F2;
8 | border-radius: 5px;
9 | box-shadow: 0 0 6px #B2B2B2;
10 | display: inline-block;
11 | padding: 10px 18px;
12 | position: relative;
13 | vertical-align: top;
14 | }
15 |
16 | .bubble::before {
17 | background-color: #F2F2F2;
18 | content: "\00a0";
19 | display: block;
20 | height: 16px;
21 | position: absolute;
22 | top: 11px;
23 | transform: rotate( 29deg ) skew( -35deg );
24 | -moz-transform: rotate( 29deg ) skew( -35deg );
25 | -ms-transform: rotate( 29deg ) skew( -35deg );
26 | -o-transform: rotate( 29deg ) skew( -35deg );
27 | -webkit-transform: rotate( 29deg ) skew( -35deg );
28 | width: 20px;
29 | }
30 |
31 | .me {
32 | float: left;
33 | margin: 5px 45px 5px 20px;
34 | }
35 |
36 | .me::before {
37 | box-shadow: -2px 2px 2px 0 rgba( 178, 178, 178, .4 );
38 | left: -9px;
39 | }
40 |
41 | .you {
42 | float: right;
43 | margin: 5px 20px 5px 45px;
44 | }
45 |
46 | .you::before {
47 | box-shadow: 2px -2px 2px 0 rgba( 178, 178, 178, .4 );
48 | right: -9px;
49 | }
50 |
51 | .chatwindow {
52 | padding-bottom: 70px;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/pages/groupchat/groupchat.ts:
--------------------------------------------------------------------------------
1 | import { Component, ViewChild } from '@angular/core';
2 | import { IonicPage, NavController, NavParams, ActionSheetController, LoadingController, Content, Events } from 'ionic-angular';
3 | import { GroupsProvider } from '../../providers/groups/groups';
4 | import { ImghandlerProvider } from '../../providers/imghandler/imghandler';
5 | import firebase from 'firebase';
6 |
7 | /**
8 | * Generated class for the GroupchatPage page.
9 | *
10 | * See http://ionicframework.com/docs/components/#navigation for more info
11 | * on Ionic pages and navigation.
12 | */
13 | @IonicPage()
14 | @Component({
15 | selector: 'page-groupchat',
16 | templateUrl: 'groupchat.html',
17 | })
18 | export class GroupchatPage {
19 | @ViewChild('content') content: Content;
20 | owner: boolean = false;
21 | groupName;
22 | newmessage;
23 | allgroupmsgs;
24 | alignuid;
25 | photoURL;
26 | imgornot;
27 | constructor(public navCtrl: NavController, public navParams: NavParams, public groupservice: GroupsProvider,
28 | public actionSheet: ActionSheetController, public events: Events, public imgstore: ImghandlerProvider, public loadingCtrl: LoadingController) {
29 | this.alignuid = firebase.auth().currentUser.uid;
30 | this.photoURL = firebase.auth().currentUser.photoURL;
31 | this.groupName = this.navParams.get('groupName');
32 | this.groupservice.getownership(this.groupName).then((res) => {
33 | if (res)
34 | this.owner = true;
35 | }).catch((err) => {
36 | alert(err);
37 | })
38 | this.groupservice.getgroupmsgs(this.groupName);
39 | this.events.subscribe('newgroupmsg', () => {
40 | this.allgroupmsgs = [];
41 | this.imgornot = [];
42 | this.allgroupmsgs = this.groupservice.groupmsgs;
43 | for (var key in this.allgroupmsgs) {
44 | var d = new Date(this.allgroupmsgs[key].timestamp);
45 | var hours = d.getHours();
46 | var minutes = "0" + d.getMinutes();
47 | var month = d.getMonth();
48 | var da = d.getDate();
49 |
50 | var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
51 | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
52 |
53 | var formattedTime = monthNames[month] + "-" + da + "-" + hours + ":" + minutes.substr(-2);
54 |
55 | this.allgroupmsgs[key].timestamp = formattedTime;
56 | if (this.allgroupmsgs[key].message.substring(0, 4) === 'http') {
57 | this.imgornot.push(true);
58 | }
59 | else {
60 | this.imgornot.push(false);
61 | }
62 | }
63 | this.scrollto();
64 | })
65 |
66 | }
67 |
68 | ionViewDidLoad() {
69 | console.log('ionViewDidLoad GroupchatPage');
70 | }
71 |
72 | sendpicmsg() {
73 | let loader = this.loadingCtrl.create({
74 | content: 'Please wait'
75 | });
76 | loader.present();
77 | this.imgstore.picmsgstore().then((imgurl) => {
78 | loader.dismiss();
79 | this.groupservice.addgroupmsg(imgurl).then(() => {
80 | this.scrollto();
81 | this.newmessage = '';
82 | })
83 | }).catch((err) => {
84 | alert(err);
85 | loader.dismiss();
86 | })
87 | }
88 |
89 | presentOwnerSheet() {
90 | let sheet = this.actionSheet.create({
91 | title: 'Group Actions',
92 | buttons: [
93 | {
94 | text: 'Add member',
95 | icon: 'person-add',
96 | handler: () => {
97 | this.navCtrl.push('GroupbuddiesPage');
98 | }
99 | },
100 | {
101 | text: 'Remove member',
102 | icon: 'remove-circle',
103 | handler: () => {
104 | this.navCtrl.push('GroupmembersPage');
105 | }
106 | },
107 | {
108 | text: 'Group Info',
109 | icon: 'person',
110 | handler: () => {
111 | this.navCtrl.push('GroupinfoPage', {groupName: this.groupName});
112 | }
113 | },
114 | {
115 | text: 'Delete Group',
116 | icon: 'trash',
117 | handler: () => {
118 | this.groupservice.deletegroup().then(() => {
119 | this.navCtrl.pop();
120 | }).catch((err) => {
121 | console.log(err);
122 | })
123 | }
124 | },
125 | {
126 | text: 'Cancel',
127 | role: 'cancel',
128 | icon: 'cancel',
129 | handler: () => {
130 | console.log('Cancelled');
131 | }
132 | }
133 | ]
134 | })
135 | sheet.present();
136 | }
137 |
138 | presentMemberSheet() {
139 | let sheet = this.actionSheet.create({
140 | title: 'Group Actions',
141 | buttons: [
142 | {
143 | text: 'Leave Group',
144 | icon: 'log-out',
145 | handler: () => {
146 | this.groupservice.leavegroup().then(() => {
147 | this.navCtrl.pop();
148 | }).catch((err) => {
149 | console.log(err);
150 | })
151 | }
152 | },
153 | {
154 | text: 'Group Info',
155 | icon: 'person',
156 | handler: () => {
157 | this.navCtrl.push('GroupinfoPage', {groupName: this.groupName});
158 | }
159 | },
160 | {
161 | text: 'Cancel',
162 | role: 'cancel',
163 | icon: 'cancel',
164 | handler: () => {
165 | console.log('Cancelled');
166 | }
167 | }
168 | ]
169 | })
170 | sheet.present();
171 | }
172 |
173 | addgroupmsg() {
174 | this.groupservice.addgroupmsg(this.newmessage).then(() => {
175 | this.scrollto();
176 | this.newmessage = '';
177 | })
178 | }
179 |
180 | scrollto() {
181 | setTimeout(() => {
182 | this.content.scrollToBottom();
183 | }, 1000);
184 | }
185 |
186 | }
--------------------------------------------------------------------------------
/src/pages/groupinfo/groupinfo.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 | Group Info
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | Group Members
20 |
21 |
22 |
23 |
24 |
25 | {{item.displayName}}
26 | Member
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/pages/groupinfo/groupinfo.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { GroupinfoPage } from './groupinfo';
4 |
5 | @NgModule({
6 | declarations: [
7 | GroupinfoPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(GroupinfoPage),
11 | ],
12 | exports: [
13 | GroupinfoPage
14 | ]
15 | })
16 | export class GroupinfoPageModule {}
17 |
--------------------------------------------------------------------------------
/src/pages/groupinfo/groupinfo.scss:
--------------------------------------------------------------------------------
1 | page-groupinfo {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/pages/groupinfo/groupinfo.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { IonicPage, NavController, NavParams, Events } from 'ionic-angular';
3 | import { GroupsProvider } from '../../providers/groups/groups';
4 |
5 | /**
6 | * Generated class for the GroupinfoPage page.
7 | *
8 | * See http://ionicframework.com/docs/components/#navigation for more info
9 | * on Ionic pages and navigation.
10 | */
11 | @IonicPage()
12 | @Component({
13 | selector: 'page-groupinfo',
14 | templateUrl: 'groupinfo.html',
15 | })
16 | export class GroupinfoPage {
17 | groupmembers;
18 | constructor(public navCtrl: NavController, public navParams: NavParams, public groupservice: GroupsProvider,
19 | public events: Events) {
20 | }
21 |
22 | ionViewDidLoad() {
23 | this.groupservice.getownership(this.groupservice.currentgroupname).then((res) => {
24 | if (res)
25 | this.groupmembers = this.groupservice.currentgroup;
26 | else {
27 | this.groupservice.getgroupmembers();
28 | }
29 |
30 | })
31 |
32 | this.events.subscribe('gotmembers', () => {
33 | this.groupmembers = this.groupservice.currentgroup;
34 | })
35 |
36 | }
37 |
38 | ionViewWillLeave() {
39 | this.events.unsubscribe('gotmembers');
40 | }
41 |
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/src/pages/groupmembers/groupmembers.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 | Group Members
11 |
12 |
13 |
14 |
15 |
16 |
17 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | {{key.displayName}}
27 |
28 |
29 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/src/pages/groupmembers/groupmembers.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { GroupmembersPage } from './groupmembers';
4 |
5 | @NgModule({
6 | declarations: [
7 | GroupmembersPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(GroupmembersPage),
11 | ],
12 | exports: [
13 | GroupmembersPage
14 | ]
15 | })
16 | export class GroupmembersPageModule {}
17 |
--------------------------------------------------------------------------------
/src/pages/groupmembers/groupmembers.scss:
--------------------------------------------------------------------------------
1 | page-groupmembers {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/pages/groupmembers/groupmembers.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { IonicPage, NavController, NavParams, Events } from 'ionic-angular';
3 | import { GroupsProvider } from '../../providers/groups/groups';
4 |
5 | /**
6 | * Generated class for the GroupmembersPage page.
7 | *
8 | * See http://ionicframework.com/docs/components/#navigation for more info
9 | * on Ionic pages and navigation.
10 | */
11 | @IonicPage()
12 | @Component({
13 | selector: 'page-groupmembers',
14 | templateUrl: 'groupmembers.html',
15 | })
16 | export class GroupmembersPage {
17 | groupmembers;
18 | tempgrpmembers;
19 | constructor(public navCtrl: NavController, public navParams: NavParams, public groupservice: GroupsProvider,
20 | public events: Events) {
21 | }
22 |
23 | ionViewWillEnter() {
24 | this.groupmembers = this.groupservice.currentgroup;
25 | this.tempgrpmembers = this.groupmembers;
26 | this.events.subscribe('gotintogroup', () => {
27 | this.groupmembers = this.groupservice.currentgroup;
28 | this.tempgrpmembers = this.groupmembers;
29 | })
30 |
31 | }
32 |
33 | ionViewWillLeave() {
34 | this.events.unsubscribe('gotintogroups');
35 | }
36 |
37 | searchuser(searchbar) {
38 | let tempmembers = this.tempgrpmembers;
39 |
40 | var q = searchbar.target.value;
41 |
42 | if (q.trim() === '') {
43 | this.groupmembers = this.tempgrpmembers;
44 | return;
45 | }
46 |
47 | tempmembers = tempmembers.filter((v) => {
48 | if (v.displayName.toLowerCase().indexOf(q.toLowerCase()) > -1) {
49 | return true;
50 | }
51 | return false;
52 | })
53 |
54 | this.groupmembers = tempmembers;
55 |
56 | }
57 |
58 | removemember(member) {
59 | this.groupservice.deletemember(member);
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/src/pages/groups/groups.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 | Groups
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | My Groups
25 |
26 |
27 |
28 |
29 |
30 | {{item.groupName}}
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/pages/groups/groups.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { GroupsPage } from './groups';
4 |
5 | @NgModule({
6 | declarations: [
7 | GroupsPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(GroupsPage),
11 | ],
12 | exports: [
13 | GroupsPage
14 | ]
15 | })
16 | export class GroupsPageModule {}
17 |
--------------------------------------------------------------------------------
/src/pages/groups/groups.scss:
--------------------------------------------------------------------------------
1 | page-groups {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/pages/groups/groups.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { IonicPage, NavController, NavParams, Events, LoadingController } from 'ionic-angular';
3 | import { GroupsProvider } from '../../providers/groups/groups';
4 | /**
5 | * Generated class for the GroupsPage page.
6 | *
7 | * See http://ionicframework.com/docs/components/#navigation for more info
8 | * on Ionic pages and navigation.
9 | */
10 | @IonicPage()
11 | @Component({
12 | selector: 'page-groups',
13 | templateUrl: 'groups.html',
14 | })
15 | export class GroupsPage {
16 | allmygroups;
17 | constructor(public navCtrl: NavController, public navParams: NavParams, public events: Events,
18 | public loadingCtrl: LoadingController, public groupservice: GroupsProvider) {
19 | }
20 |
21 | ionViewWillEnter() {
22 | let loader = this.loadingCtrl.create({
23 | content: 'Getting your groups, Please wait...'
24 | });
25 | loader.present();
26 | this.groupservice.getmygroups();
27 | loader.dismiss();
28 | this.events.subscribe('newgroup', () => {
29 | this.allmygroups = this.groupservice.mygroups;
30 | })
31 | }
32 |
33 | ionViewDidLeave() {
34 | this.events.unsubscribe('newgroup');
35 | }
36 |
37 | addgroup() {
38 | this.navCtrl.push('NewgroupPage');
39 | }
40 |
41 | openchat(group) {
42 | this.groupservice.getintogroup(group.groupName);
43 | this.navCtrl.push('GroupchatPage', { groupName: group.groupName });
44 |
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/src/pages/login/login.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | Login
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | Forgot login details ? Get Help
31 |
32 |
33 |
34 | OR
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/src/pages/login/login.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { LoginPage } from './login';
4 |
5 | @NgModule({
6 | declarations: [
7 | LoginPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(LoginPage),
11 | ],
12 | exports: [
13 | LoginPage
14 | ]
15 | })
16 | export class LoginPageModule {}
17 |
--------------------------------------------------------------------------------
/src/pages/login/login.scss:
--------------------------------------------------------------------------------
1 | page-login {
2 | .background {
3 | background-image: url('../assets/bgimage.jpg');
4 | }
5 | .scroll-content {
6 | align-content: center;
7 | display: flex;
8 | flex-direction: column;
9 | justify-content: center;
10 | text-align: center;
11 | }
12 | ion-card.card {
13 | box-shadow: none;
14 | background: rgba(0, 0, 0, 0.5);
15 | border-radius: 5px;
16 | }
17 | a, p,
18 | ion-card-header.card-header {
19 | color: #fff!important;
20 | }
21 |
22 | .list > .item-block:first-child {
23 | border: medium none;
24 | }
25 |
26 | .item {
27 | margin-bottom: 10px;
28 | background: rgba(255, 255, 255, 0.5);
29 | border: medium none;
30 |
31 | .text-input, {
32 | color: #fff;
33 | }
34 |
35 |
36 | input::-moz-placeholder{
37 | color: #fff!important;
38 | }
39 | input:-moz-placeholder {
40 | color: #fff!important;
41 | }
42 | *:-moz-placeholder{
43 | color: #fff!important;
44 | }
45 | *:-ms-input-placeholder{
46 | color: #fff!important;
47 | }
48 | *::-webkit-input-placeholder{
49 | color: #fff!important;
50 | }
51 |
52 | }
53 |
54 | .icon {
55 | padding-right: 10px;
56 | }
57 |
58 | .bottom {
59 | bottom: 0;
60 | }
61 |
62 | .input-cover {
63 | position: static;
64 | }
65 |
66 | }
67 |
68 |
--------------------------------------------------------------------------------
/src/pages/login/login.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { IonicPage, NavController, NavParams } from 'ionic-angular';
3 |
4 | import { usercreds } from '../../models/interfaces/usercreds';
5 |
6 | import { AuthProvider } from '../../providers/auth/auth';
7 |
8 | /**
9 | * Generated class for the LoginPage page.
10 | *
11 | * See http://ionicframework.com/docs/components/#navigation for more info
12 | * on Ionic pages and navigation.
13 | */
14 | @IonicPage()
15 | @Component({
16 | selector: 'page-login',
17 | templateUrl: 'login.html',
18 | })
19 | export class LoginPage {
20 | credentials = {} as usercreds;
21 | constructor(public navCtrl: NavController, public navParams: NavParams, public authservice: AuthProvider) {
22 | }
23 |
24 | ionViewDidLoad() {
25 | console.log('ionViewDidLoad LoginPage');
26 | }
27 |
28 | signin() {
29 | this.authservice.login(this.credentials).then((res: any) => {
30 | if (!res.code)
31 | this.navCtrl.setRoot('TabsPage');
32 | else
33 | alert(res);
34 | })
35 | }
36 |
37 | signup() {
38 | this.navCtrl.push('SignupPage');
39 | }
40 |
41 | passwordreset() {
42 | this.navCtrl.push('PasswordresetPage');
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/pages/newgroup/newgroup.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 | Add a New Group
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |

19 |
20 |
21 |
{{newgroup.groupName}}
22 |
23 |
24 | Tap on the pic or group name to change it.
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/pages/newgroup/newgroup.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { NewgroupPage } from './newgroup';
4 |
5 | @NgModule({
6 | declarations: [
7 | NewgroupPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(NewgroupPage),
11 | ],
12 | exports: [
13 | NewgroupPage
14 | ]
15 | })
16 | export class NewgroupPageModule {}
17 |
--------------------------------------------------------------------------------
/src/pages/newgroup/newgroup.scss:
--------------------------------------------------------------------------------
1 | page-newgroup {
2 | .profile-image{
3 | img{
4 | height: 200px;
5 | width: 200px;
6 | border-radius:50%;
7 | border: 4px solid rgba(255,255,255,0.4);
8 | -webkit-box-shadow: 0px 0px 142px -37px rgba(0,0,0,0.75);
9 | -moz-box-shadow: 0px 0px 142px -37px rgba(0,0,0,0.75);
10 | box-shadow: 0px 0px 142px -37px rgba(0,0,0,0.75);
11 | }
12 | }
13 | .scroll-content {
14 | align-content: center;
15 | display: flex;
16 | flex-direction: column;
17 | justify-content: center;
18 | text-align: center;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/pages/newgroup/newgroup.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { IonicPage, NavController, NavParams, AlertController, LoadingController } from 'ionic-angular';
3 | import { GroupsProvider } from '../../providers/groups/groups';
4 | import { ImghandlerProvider } from '../../providers/imghandler/imghandler';
5 |
6 | /**
7 | * Generated class for the NewgroupPage page.
8 | *
9 | * See http://ionicframework.com/docs/components/#navigation for more info
10 | * on Ionic pages and navigation.
11 | */
12 | @IonicPage()
13 | @Component({
14 | selector: 'page-newgroup',
15 | templateUrl: 'newgroup.html',
16 | })
17 | export class NewgroupPage {
18 | newgroup = {
19 | groupName: 'GroupName',
20 | groupPic: 'https://firebasestorage.googleapis.com/v0/b/myapp-4eadd.appspot.com/o/chatterplace.png?alt=media&token=e51fa887-bfc6-48ff-87c6-e2c61976534e'
21 | }
22 | constructor(public navCtrl: NavController, public navParams: NavParams, public alertCtrl: AlertController,
23 | public groupservice: GroupsProvider, public imghandler: ImghandlerProvider,
24 | public loadingCtrl: LoadingController) {
25 | }
26 |
27 | ionViewDidLoad() {
28 | console.log('ionViewDidLoad NewgroupPage');
29 | }
30 |
31 | chooseimage() {
32 | if (this.newgroup.groupName == 'GroupName') {
33 | let namealert = this.alertCtrl.create({
34 | buttons: ['okay'],
35 | message: 'Please enter the groupname first. Thanks'
36 | });
37 | namealert.present();
38 | }
39 | else {
40 | let loader = this.loadingCtrl.create({
41 | content: 'Loading, please wait..'
42 | });
43 | loader.present();
44 | this.imghandler.grouppicstore(this.newgroup.groupName).then((res: any) => {
45 | loader.dismiss();
46 | if(res)
47 | this.newgroup.groupPic = res;
48 | }).catch((err) => {
49 | alert(err);
50 | })
51 | }
52 |
53 | }
54 |
55 | creategroup() {
56 | this.groupservice.addgroup(this.newgroup).then(() => {
57 | this.navCtrl.pop();
58 | }).catch((err) => {
59 | alert(JSON.stringify(err));
60 | })
61 | }
62 |
63 | editgroupname() {
64 | let alert = this.alertCtrl.create({
65 | title: 'Edit Group Name',
66 | inputs: [{
67 | name: 'groupname',
68 | placeholder: 'Give a new groupname'
69 | }],
70 | buttons: [{
71 | text: 'Cancel',
72 | role: 'cancel',
73 | handler: data => {
74 |
75 | }
76 | },
77 | {
78 | text: 'Set',
79 | handler: data => {
80 | if (data.groupname) {
81 | this.newgroup.groupName = data.groupname
82 | }
83 |
84 | else {
85 | this.newgroup.groupName = 'groupName';
86 | }
87 | }
88 | }
89 | ]
90 | });
91 | alert.present();
92 | }
93 |
94 | }
95 |
--------------------------------------------------------------------------------
/src/pages/passwordreset/passwordreset.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | Password Reset
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/pages/passwordreset/passwordreset.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { PasswordresetPage } from './passwordreset';
4 |
5 | @NgModule({
6 | declarations: [
7 | PasswordresetPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(PasswordresetPage),
11 | ],
12 | exports: [
13 | PasswordresetPage
14 | ]
15 | })
16 | export class PasswordresetPageModule {}
17 |
--------------------------------------------------------------------------------
/src/pages/passwordreset/passwordreset.scss:
--------------------------------------------------------------------------------
1 | page-passwordreset {
2 | .background {
3 | background-image: url('../assets/bgimage.jpg');
4 | }
5 | .scroll-content {
6 | align-content: center;
7 | display: flex;
8 | flex-direction: column;
9 | justify-content: center;
10 | text-align: center;
11 | }
12 | ion-card.card {
13 | box-shadow: none;
14 | background: rgba(0, 0, 0, 0.5);
15 | border-radius: 5px;
16 | }
17 | a, p,
18 | ion-card-header.card-header {
19 | color: #fff!important;
20 | }
21 |
22 | .list > .item-block:first-child {
23 | border: medium none;
24 | }
25 |
26 | .item {
27 | margin-bottom: 10px;
28 | background: rgba(255, 255, 255, 0.5);
29 | border: medium none;
30 |
31 | .text-input, {
32 | color: #fff;
33 | }
34 |
35 |
36 | input::-moz-placeholder{
37 | color: #fff!important;
38 | }
39 | input:-moz-placeholder {
40 | color: #fff!important;
41 | }
42 | *:-moz-placeholder{
43 | color: #fff!important;
44 | }
45 | *:-ms-input-placeholder{
46 | color: #fff!important;
47 | }
48 | *::-webkit-input-placeholder{
49 | color: #fff!important;
50 | }
51 |
52 | }
53 |
54 | .icon {
55 | padding-right: 10px;
56 | }
57 |
58 | .bottom {
59 | bottom: 0;
60 | }
61 |
62 | .input-cover {
63 | position: static;
64 | }
65 |
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/src/pages/passwordreset/passwordreset.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { IonicPage, NavController, NavParams, AlertController } from 'ionic-angular';
3 | import { UserProvider } from '../../providers/user/user';
4 | /**
5 | * Generated class for the PasswordresetPage page.
6 | *
7 | * See http://ionicframework.com/docs/components/#navigation for more info
8 | * on Ionic pages and navigation.
9 | */
10 | @IonicPage()
11 | @Component({
12 | selector: 'page-passwordreset',
13 | templateUrl: 'passwordreset.html',
14 | })
15 | export class PasswordresetPage {
16 | email: string;
17 | constructor(public navCtrl: NavController, public navParams: NavParams,
18 | public userservice: UserProvider, public alertCtrl: AlertController) {
19 | }
20 |
21 | ionViewDidLoad() {
22 | // console.log('ionViewDidLoad PasswordresetPage');
23 | }
24 |
25 | reset() {
26 | let alert = this.alertCtrl.create({
27 | buttons: ['Ok']
28 | });
29 | this.userservice.passwordreset(this.email).then((res: any) => {
30 | if (res.success) {
31 | alert.setTitle('Email Sent');
32 | alert.setSubTitle('Please follow the instructions in the email to reset your password');
33 | }
34 | }).catch((err) => {
35 | alert.setTitle('Failed');
36 | alert.setSubTitle(err);
37 | })
38 | }
39 |
40 | goback() {
41 | this.navCtrl.setRoot('LoginPage');
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/pages/profile/profile.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 | Profile
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |

19 |
20 |
21 |
{{displayName}}
22 |
23 |
24 | Tap on your pic or nick name to change it.
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/pages/profile/profile.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { ProfilePage } from './profile';
4 |
5 | @NgModule({
6 | declarations: [
7 | ProfilePage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(ProfilePage),
11 | ],
12 | exports: [
13 | ProfilePage
14 | ]
15 | })
16 | export class ProfilePageModule {}
17 |
--------------------------------------------------------------------------------
/src/pages/profile/profile.scss:
--------------------------------------------------------------------------------
1 | page-profile {
2 | .profile-image{
3 | img{
4 | height: 200px;
5 | width: 200px;
6 | border-radius:50%;
7 | border: 4px solid rgba(255,255,255,0.4);
8 | -webkit-box-shadow: 0px 0px 142px -37px rgba(0,0,0,0.75);
9 | -moz-box-shadow: 0px 0px 142px -37px rgba(0,0,0,0.75);
10 | box-shadow: 0px 0px 142px -37px rgba(0,0,0,0.75);
11 | }
12 | }
13 | .scroll-content {
14 | align-content: center;
15 | display: flex;
16 | flex-direction: column;
17 | justify-content: center;
18 | text-align: center;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/pages/profile/profile.ts:
--------------------------------------------------------------------------------
1 | import { Component, NgZone } from '@angular/core';
2 | import { IonicPage, NavController, NavParams, AlertController } from 'ionic-angular';
3 | import { ImghandlerProvider } from '../../providers/imghandler/imghandler';
4 | import { UserProvider } from '../../providers/user/user';
5 | import firebase from 'firebase';
6 | /**
7 | * Generated class for the ProfilePage page.
8 | *
9 | * See http://ionicframework.com/docs/components/#navigation for more info
10 | * on Ionic pages and navigation.
11 | */
12 | @IonicPage()
13 | @Component({
14 | selector: 'page-profile',
15 | templateUrl: 'profile.html',
16 | })
17 | export class ProfilePage {
18 | avatar: string;
19 | displayName: string;
20 | constructor(public navCtrl: NavController, public navParams: NavParams,
21 | public userservice: UserProvider, public zone: NgZone, public alertCtrl: AlertController,
22 | public imghandler: ImghandlerProvider) {
23 | }
24 |
25 | ionViewWillEnter() {
26 | this.loaduserdetails();
27 | }
28 |
29 | loaduserdetails() {
30 | this.userservice.getuserdetails().then((res: any) => {
31 | this.displayName = res.displayName;
32 | this.zone.run(() => {
33 | this.avatar = res.photoURL;
34 | })
35 | })
36 | }
37 |
38 | editimage() {
39 | let statusalert = this.alertCtrl.create({
40 | buttons: ['okay']
41 | });
42 | this.imghandler.uploadimage().then((url: any) => {
43 | this.userservice.updateimage(url).then((res: any) => {
44 | if (res.success) {
45 | statusalert.setTitle('Updated');
46 | statusalert.setSubTitle('Your profile pic has been changed successfully!!');
47 | statusalert.present();
48 | this.zone.run(() => {
49 | this.avatar = url;
50 | })
51 | }
52 | }).catch((err) => {
53 | statusalert.setTitle('Failed');
54 | statusalert.setSubTitle('Your profile pic was not changed');
55 | statusalert.present();
56 | })
57 | })
58 | }
59 |
60 | editname() {
61 | let statusalert = this.alertCtrl.create({
62 | buttons: ['okay']
63 | });
64 | let alert = this.alertCtrl.create({
65 | title: 'Edit Nickname',
66 | inputs: [{
67 | name: 'nickname',
68 | placeholder: 'Nickname'
69 | }],
70 | buttons: [{
71 | text: 'Cancel',
72 | role: 'cancel',
73 | handler: data => {
74 |
75 | }
76 | },
77 | {
78 | text: 'Edit',
79 | handler: data => {
80 | if (data.nickname) {
81 | this.userservice.updatedisplayname(data.nickname).then((res: any) => {
82 | if (res.success) {
83 | statusalert.setTitle('Updated');
84 | statusalert.setSubTitle('Your nickname has been changed successfully!!');
85 | statusalert.present();
86 | this.zone.run(() => {
87 | this.displayName = data.nickname;
88 | })
89 | }
90 |
91 | else {
92 | statusalert.setTitle('Failed');
93 | statusalert.setSubTitle('Your nickname was not changed');
94 | statusalert.present();
95 | }
96 |
97 | })
98 | }
99 | }
100 |
101 | }]
102 | });
103 | alert.present();
104 | }
105 |
106 | logout() {
107 | firebase.auth().signOut().then(() => {
108 | this.navCtrl.parent.parent.setRoot('LoginPage');
109 | })
110 | }
111 |
112 |
113 | }
114 |
--------------------------------------------------------------------------------
/src/pages/profilepic/profilepic.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 | Profile Picture
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |

19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/pages/profilepic/profilepic.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { ProfilepicPage } from './profilepic';
4 |
5 | @NgModule({
6 | declarations: [
7 | ProfilepicPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(ProfilepicPage),
11 | ],
12 | exports: [
13 | ProfilepicPage
14 | ]
15 | })
16 | export class ProfilepicPageModule {}
17 |
--------------------------------------------------------------------------------
/src/pages/profilepic/profilepic.scss:
--------------------------------------------------------------------------------
1 | page-profilepic {
2 | .profile-image{
3 | img{
4 | height: 200px;
5 | width: 200px;
6 | border-radius:50%;
7 | border: 4px solid rgba(255,255,255,0.4);
8 | -webkit-box-shadow: 0px 0px 142px -37px rgba(0,0,0,0.75);
9 | -moz-box-shadow: 0px 0px 142px -37px rgba(0,0,0,0.75);
10 | box-shadow: 0px 0px 142px -37px rgba(0,0,0,0.75);
11 | }
12 | }
13 | .scroll-content {
14 | align-content: center;
15 | display: flex;
16 | flex-direction: column;
17 | justify-content: center;
18 | text-align: center;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/pages/profilepic/profilepic.ts:
--------------------------------------------------------------------------------
1 | import { Component, NgZone } from '@angular/core';
2 | import { IonicPage, NavController, NavParams, LoadingController } from 'ionic-angular';
3 | import { ImghandlerProvider } from '../../providers/imghandler/imghandler';
4 | import { UserProvider } from '../../providers/user/user';
5 | /**
6 | * Generated class for the ProfilepicPage page.
7 | *
8 | * See http://ionicframework.com/docs/components/#navigation for more info
9 | * on Ionic pages and navigation.
10 | */
11 | @IonicPage()
12 | @Component({
13 | selector: 'page-profilepic',
14 | templateUrl: 'profilepic.html',
15 | })
16 | export class ProfilepicPage {
17 | imgurl = 'https://firebasestorage.googleapis.com/v0/b/myapp-4eadd.appspot.com/o/chatterplace.png?alt=media&token=e51fa887-bfc6-48ff-87c6-e2c61976534e';
18 | moveon: boolean = true;
19 | constructor(public navCtrl: NavController, public navParams: NavParams, public imgservice: ImghandlerProvider,
20 | public zone: NgZone, public userservice: UserProvider, public loadingCtrl: LoadingController) {
21 | }
22 |
23 | ionViewDidLoad() {
24 | // console.log('ionViewDidLoad ProfilepicPage');
25 | }
26 |
27 | chooseimage() {
28 | let loader = this.loadingCtrl.create({
29 | content: 'Please wait'
30 | })
31 | loader.present();
32 | this.imgservice.uploadimage().then((uploadedurl: any) => {
33 | loader.dismiss();
34 | this.zone.run(() => {
35 | this.imgurl = uploadedurl;
36 | this.moveon = false;
37 | })
38 | })
39 | }
40 |
41 | updateproceed() {
42 | let loader = this.loadingCtrl.create({
43 | content: 'Please wait'
44 | })
45 | loader.present();
46 | this.userservice.updateimage(this.imgurl).then((res: any) => {
47 | loader.dismiss();
48 | if (res.success) {
49 | this.navCtrl.setRoot('TabsPage');
50 | }
51 | else {
52 | alert(res);
53 | }
54 | })
55 | }
56 |
57 | proceed() {
58 | this.navCtrl.setRoot('TabsPage');
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/src/pages/signup/signup.html:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | Signup
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/src/pages/signup/signup.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { SignupPage } from './signup';
4 |
5 | @NgModule({
6 | declarations: [
7 | SignupPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(SignupPage),
11 | ],
12 | exports: [
13 | SignupPage
14 | ]
15 | })
16 | export class SignupPageModule {}
17 |
--------------------------------------------------------------------------------
/src/pages/signup/signup.scss:
--------------------------------------------------------------------------------
1 | page-signup {
2 | .background {
3 | background-image: url('../assets/bgimage.jpg');
4 | }
5 | .scroll-content {
6 | align-content: center;
7 | display: flex;
8 | flex-direction: column;
9 | justify-content: center;
10 | text-align: center;
11 | }
12 | ion-card.card {
13 | box-shadow: none;
14 | background: rgba(0, 0, 0, 0.5);
15 | border-radius: 5px;
16 | }
17 | a, p,
18 | ion-card-header.card-header {
19 | color: #fff!important;
20 | }
21 |
22 | .list > .item-block:first-child {
23 | border: medium none;
24 | }
25 |
26 | .item {
27 | margin-bottom: 10px;
28 | background: rgba(255, 255, 255, 0.5);
29 | border: medium none;
30 |
31 | .text-input, {
32 | color: #fff;
33 | }
34 |
35 |
36 | input::-moz-placeholder{
37 | color: #fff!important;
38 | }
39 | input:-moz-placeholder {
40 | color: #fff!important;
41 | }
42 | *:-moz-placeholder{
43 | color: #fff!important;
44 | }
45 | *:-ms-input-placeholder{
46 | color: #fff!important;
47 | }
48 | *::-webkit-input-placeholder{
49 | color: #fff!important;
50 | }
51 |
52 | }
53 |
54 | .icon {
55 | padding-right: 10px;
56 | }
57 |
58 | .bottom {
59 | bottom: 0;
60 | }
61 |
62 | .input-cover {
63 | position: static;
64 | }
65 |
66 | }
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/src/pages/signup/signup.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { IonicPage, NavController, NavParams, LoadingController, ToastController } from 'ionic-angular';
3 | import { UserProvider } from '../../providers/user/user';
4 | /**
5 | * Generated class for the SignupPage page.
6 | *
7 | * See http://ionicframework.com/docs/components/#navigation for more info
8 | * on Ionic pages and navigation.
9 | */
10 | @IonicPage()
11 | @Component({
12 | selector: 'page-signup',
13 | templateUrl: 'signup.html',
14 | })
15 | export class SignupPage {
16 | newuser = {
17 | email: '',
18 | password: '',
19 | displayName: ''
20 | }
21 | constructor(public navCtrl: NavController, public navParams: NavParams, public userservice: UserProvider,
22 | public loadingCtrl: LoadingController, public toastCtrl: ToastController) {
23 | }
24 |
25 | signup() {
26 | var toaster = this.toastCtrl.create({
27 | duration: 3000,
28 | position: 'bottom'
29 | });
30 | if (this.newuser.email == '' || this.newuser.password == '' || this.newuser.displayName == '') {
31 | toaster.setMessage('All fields are required dude');
32 | toaster.present();
33 | }
34 | else if (this.newuser.password.length < 7) {
35 | toaster.setMessage('Password is not strong. Try giving more than six characters');
36 | toaster.present();
37 | }
38 | else {
39 | let loader = this.loadingCtrl.create({
40 | content: 'Please wait'
41 | });
42 | loader.present();
43 | this.userservice.adduser(this.newuser).then((res: any) => {
44 | loader.dismiss();
45 | if (res.success)
46 | this.navCtrl.push('ProfilepicPage');
47 | else
48 | alert('Error' + res);
49 | })
50 | }
51 | }
52 |
53 | goback() {
54 | this.navCtrl.setRoot('LoginPage');
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/src/pages/tabs/tabs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/pages/tabs/tabs.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { IonicPageModule } from 'ionic-angular';
3 | import { TabsPage } from './tabs';
4 |
5 | @NgModule({
6 | declarations: [
7 | TabsPage,
8 | ],
9 | imports: [
10 | IonicPageModule.forChild(TabsPage),
11 | ],
12 | exports: [
13 | TabsPage
14 | ]
15 | })
16 | export class TabsPageModule {}
17 |
--------------------------------------------------------------------------------
/src/pages/tabs/tabs.scss:
--------------------------------------------------------------------------------
1 | page-tabs {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/pages/tabs/tabs.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { IonicPage, NavController, NavParams } from 'ionic-angular';
3 |
4 | /**
5 | * Generated class for the TabsPage page.
6 | *
7 | * See http://ionicframework.com/docs/components/#navigation for more info
8 | * on Ionic pages and navigation.
9 | */
10 | @IonicPage()
11 | @Component({
12 | selector: 'page-tabs',
13 | templateUrl: 'tabs.html',
14 | })
15 | export class TabsPage {
16 |
17 | tab1: string = "ChatsPage";
18 | tab2: string = "GroupsPage";
19 | tab3: string = "ProfilePage";
20 |
21 | constructor() {
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/providers/auth/auth.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { AngularFireAuth } from 'angularfire2/auth';
3 | import { usercreds } from '../../models/interfaces/usercreds';
4 |
5 | /*
6 | Generated class for the AuthProvider provider.
7 |
8 | See https://angular.io/docs/ts/latest/guide/dependency-injection.html
9 | for more info on providers and Angular 2 DI.
10 | */
11 | @Injectable()
12 | export class AuthProvider {
13 |
14 | constructor(public afireauth: AngularFireAuth) {
15 |
16 | }
17 |
18 | /*
19 | For logging in a particular user. Called from the login.ts file.
20 |
21 | */
22 |
23 | login(credentials: usercreds) {
24 | var promise = new Promise((resolve, reject) => {
25 | this.afireauth.auth.signInWithEmailAndPassword(credentials.email, credentials.password).then(() => {
26 | resolve(true);
27 | }).catch((err) => {
28 | reject(err);
29 | })
30 | })
31 |
32 | return promise;
33 |
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src/providers/chat/chat.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import firebase from 'firebase';
3 | import { Events } from 'ionic-angular';
4 |
5 | /*
6 | Generated class for the ChatProvider provider.
7 |
8 | See https://angular.io/docs/ts/latest/guide/dependency-injection.html
9 | for more info on providers and Angular 2 DI.
10 | */
11 | @Injectable()
12 | export class ChatProvider {
13 | firebuddychats = firebase.database().ref('/buddychats');
14 | buddy: any;
15 | buddymessages = [];
16 | constructor(public events: Events) {
17 |
18 | }
19 |
20 | initializebuddy(buddy) {
21 | this.buddy = buddy;
22 | }
23 |
24 | addnewmessage(msg) {
25 | if (this.buddy) {
26 | var promise = new Promise((resolve, reject) => {
27 | this.firebuddychats.child(firebase.auth().currentUser.uid).child(this.buddy.uid).push({
28 | sentby: firebase.auth().currentUser.uid,
29 | message: msg,
30 | timestamp: firebase.database.ServerValue.TIMESTAMP
31 | }).then(() => {
32 | this.firebuddychats.child(this.buddy.uid).child(firebase.auth().currentUser.uid).push({
33 | sentby: firebase.auth().currentUser.uid,
34 | message: msg,
35 | timestamp: firebase.database.ServerValue.TIMESTAMP
36 | }).then(() => {
37 | resolve(true);
38 | }).catch((err) => {
39 | reject(err);
40 | })
41 | })
42 | })
43 | return promise;
44 | }
45 | }
46 |
47 | getbuddymessages() {
48 |
49 | let temp;
50 | this.firebuddychats.child(firebase.auth().currentUser.uid).child(this.buddy.uid).on('value', (snapshot) => {
51 | this.buddymessages = [];
52 | temp = snapshot.val();
53 | for (var tempkey in temp) {
54 | this.buddymessages.push(temp[tempkey]);
55 | }
56 | this.events.publish('newmessage');
57 | })
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/src/providers/groups/groups.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { Events } from 'ionic-angular';
3 | import firebase from 'firebase';
4 |
5 | /*
6 | Generated class for the GroupsProvider provider.
7 |
8 | See https://angular.io/docs/ts/latest/guide/dependency-injection.html
9 | for more info on providers and Angular 2 DI.
10 | */
11 | @Injectable()
12 | export class GroupsProvider {
13 | firegroup = firebase.database().ref('/groups');
14 | mygroups: Array = [];
15 | currentgroup: Array = [];
16 | currentgroupname;
17 | grouppic;
18 | groupmsgs;
19 | constructor(public events: Events) {
20 |
21 | }
22 |
23 | addgroup(newGroup) {
24 | var promise = new Promise((resolve, reject) => {
25 | this.firegroup.child(firebase.auth().currentUser.uid).child(newGroup.groupName).set({
26 | groupimage: newGroup.groupPic,
27 | msgboard: '',
28 | owner: firebase.auth().currentUser.uid
29 | }).then(() => {
30 | resolve(true);
31 | }).catch((err) => {
32 | reject(err);
33 | })
34 | });
35 | return promise;
36 | }
37 |
38 | getmygroups() {
39 | this.firegroup.child(firebase.auth().currentUser.uid).once('value', (snapshot) => {
40 | this.mygroups = [];
41 | if(snapshot.val() != null) {
42 | var temp = snapshot.val();
43 | for (var key in temp) {
44 | var newgroup = {
45 | groupName: key,
46 | groupimage: temp[key].groupimage
47 | }
48 | this.mygroups.push(newgroup);
49 | }
50 | }
51 | this.events.publish('newgroup');
52 | })
53 |
54 | }
55 |
56 | getintogroup(groupname) {
57 | if (groupname != null) {
58 | this.firegroup.child(firebase.auth().currentUser.uid).child(groupname).once('value', (snapshot) => {
59 | if (snapshot.val() != null) {
60 | var temp = snapshot.val().members;
61 | this.currentgroup = [];
62 | for (var key in temp) {
63 | this.currentgroup.push(temp[key]);
64 | }
65 | this.currentgroupname = groupname;
66 | this.events.publish('gotintogroup');
67 | }
68 | })
69 | }
70 | }
71 |
72 | getownership(groupname) {
73 | var promise = new Promise((resolve, reject) => {
74 | this.firegroup.child(firebase.auth().currentUser.uid).child(groupname).once('value', (snapshot) => {
75 | var temp = snapshot.val().owner;
76 | if (temp == firebase.auth().currentUser.uid) {
77 | resolve(true);
78 | }
79 | else {
80 | resolve(false);
81 | }
82 | }).catch((err) => {
83 | reject(err);
84 | })
85 | })
86 | return promise;
87 | }
88 |
89 | getgroupimage() {
90 | return new Promise((resolve, reject) => {
91 | this.firegroup.child(firebase.auth().currentUser.uid).child(this.currentgroupname).once('value', (snapshot) => {
92 | this.grouppic = snapshot.val().groupimage;
93 | resolve(true);
94 | })
95 | })
96 |
97 | }
98 |
99 | addmember(newmember) {
100 | this.firegroup.child(firebase.auth().currentUser.uid).child(this.currentgroupname).child('members').push(newmember).then(() => {
101 | this.getgroupimage().then(() => {
102 | this.firegroup.child(newmember.uid).child(this.currentgroupname).set({
103 | groupimage: this.grouppic,
104 | owner: firebase.auth().currentUser.uid,
105 | msgboard: ''
106 | }).catch((err) => {
107 | console.log(err);
108 | })
109 | })
110 | this.getintogroup(this.currentgroupname);
111 | })
112 | }
113 |
114 | deletemember(member) {
115 | this.firegroup.child(firebase.auth().currentUser.uid).child(this.currentgroupname)
116 | .child('members').orderByChild('uid').equalTo(member.uid).once('value', (snapshot) => {
117 | snapshot.ref.remove().then(() => {
118 | this.firegroup.child(member.uid).child(this.currentgroupname).remove().then(() => {
119 | this.getintogroup(this.currentgroupname);
120 | })
121 | })
122 | })
123 | }
124 |
125 | getgroupmembers() {
126 | this.firegroup.child(firebase.auth().currentUser.uid).child(this.currentgroupname).once('value', (snapshot) => {
127 | var tempdata = snapshot.val().owner;
128 | this.firegroup.child(tempdata).child(this.currentgroupname).child('members').once('value', (snapshot) => {
129 | var tempvar = snapshot.val();
130 | for (var key in tempvar) {
131 | this.currentgroup.push(tempvar[key]);
132 | }
133 | })
134 | })
135 | this.events.publish('gotmembers');
136 | }
137 |
138 | leavegroup() {
139 | return new Promise((resolve, reject) => {
140 | this.firegroup.child(firebase.auth().currentUser.uid).child(this.currentgroupname).once('value', (snapshot) => {
141 | var tempowner = snapshot.val().owner;
142 | this.firegroup.child(tempowner).child(this.currentgroupname).child('members').orderByChild('uid')
143 | .equalTo(firebase.auth().currentUser.uid).once('value', (snapshot) => {
144 | snapshot.ref.remove().then(() => {
145 | this.firegroup.child(firebase.auth().currentUser.uid).child(this.currentgroupname).remove().then(() => {
146 | resolve(true);
147 | }).catch((err) => {
148 | reject(err);
149 | })
150 | }).catch((err) => {
151 | reject(err);
152 | })
153 | })
154 | })
155 | })
156 | }
157 |
158 | deletegroup() {
159 | return new Promise((resolve, reject) => {
160 | this.firegroup.child(firebase.auth().currentUser.uid).child(this.currentgroupname).child('members').once('value', (snapshot) => {
161 | var tempmembers = snapshot.val();
162 |
163 | for (var key in tempmembers) {
164 | this.firegroup.child(tempmembers[key].uid).child(this.currentgroupname).remove();
165 | }
166 |
167 | this.firegroup.child(firebase.auth().currentUser.uid).child(this.currentgroupname).remove().then(() => {
168 | resolve(true);
169 | }).catch((err) => {
170 | reject(err);
171 | })
172 |
173 | })
174 | })
175 | }
176 |
177 | addgroupmsg(newmessage) {
178 | return new Promise((resolve) => {
179 |
180 |
181 | this.firegroup.child(firebase.auth().currentUser.uid).child(this.currentgroupname).child('owner').once('value', (snapshot) => {
182 | var tempowner = snapshot.val();
183 | this.firegroup.child(firebase.auth().currentUser.uid).child(this.currentgroupname).child('msgboard').push({
184 | sentby: firebase.auth().currentUser.uid,
185 | displayName: firebase.auth().currentUser.displayName,
186 | photoURL: firebase.auth().currentUser.photoURL,
187 | message: newmessage,
188 | timestamp: firebase.database.ServerValue.TIMESTAMP
189 | }).then(() => {
190 | if (tempowner != firebase.auth().currentUser.uid) {
191 | this.firegroup.child(tempowner).child(this.currentgroupname).child('msgboard').push({
192 | sentby: firebase.auth().currentUser.uid,
193 | displayName: firebase.auth().currentUser.displayName,
194 | photoURL: firebase.auth().currentUser.photoURL,
195 | message: newmessage,
196 | timestamp: firebase.database.ServerValue.TIMESTAMP
197 | })
198 | }
199 | var tempmembers = [];
200 | this.firegroup.child(tempowner).child(this.currentgroupname).child('members').once('value', (snapshot) => {
201 | var tempmembersobj = snapshot.val();
202 | for (var key in tempmembersobj)
203 | tempmembers.push(tempmembersobj[key]);
204 | }).then(() => {
205 | let postedmsgs = tempmembers.map((item) => {
206 | if (item.uid != firebase.auth().currentUser.uid) {
207 | return new Promise((resolve) => {
208 | this.postmsgs(item, newmessage, resolve);
209 | })
210 | }
211 | })
212 | Promise.all(postedmsgs).then(() => {
213 | this.getgroupmsgs(this.currentgroupname);
214 | resolve(true);
215 | })
216 | })
217 | })
218 | })
219 | })
220 | }
221 |
222 | postmsgs(member, msg, cb) {
223 | this.firegroup.child(member.uid).child(this.currentgroupname).child('msgboard').push({
224 | sentby: firebase.auth().currentUser.uid,
225 | displayName: firebase.auth().currentUser.displayName,
226 | photoURL: firebase.auth().currentUser.photoURL,
227 | message: msg,
228 | timestamp: firebase.database.ServerValue.TIMESTAMP
229 | }).then(() => {
230 | cb();
231 | })
232 | }
233 |
234 | getgroupmsgs(groupname) {
235 | this.firegroup.child(firebase.auth().currentUser.uid).child(groupname).child('msgboard').on('value', (snapshot) => {
236 | var tempmsgholder = snapshot.val();
237 | this.groupmsgs = [];
238 | for (var key in tempmsgholder)
239 | this.groupmsgs.push(tempmsgholder[key]);
240 | this.events.publish('newgroupmsg');
241 | })
242 | }
243 |
244 | }
--------------------------------------------------------------------------------
/src/providers/imghandler/imghandler.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { File } from '@ionic-native/file';
3 | import { FileChooser } from '@ionic-native/file-chooser';
4 | import { FilePath } from '@ionic-native/file-path';
5 | import firebase from 'firebase';
6 | /*
7 | Generated class for the ImghandlerProvider provider.
8 |
9 | See https://angular.io/docs/ts/latest/guide/dependency-injection.html
10 | for more info on providers and Angular 2 DI.
11 | */
12 | @Injectable()
13 | export class ImghandlerProvider {
14 | nativepath: any;
15 | firestore = firebase.storage();
16 | constructor(public filechooser: FileChooser) {
17 | }
18 |
19 |
20 | /*
21 |
22 | For uploading an image to firebase storage.
23 |
24 | Called from - profilepic.ts
25 | Inputs - None.
26 | Outputs - The image url of the stored image.
27 |
28 | */
29 | uploadimage() {
30 | var promise = new Promise((resolve, reject) => {
31 | this.filechooser.open().then((url) => {
32 | (window).FilePath.resolveNativePath(url, (result) => {
33 | this.nativepath = result;
34 | (window).resolveLocalFileSystemURL(this.nativepath, (res) => {
35 | res.file((resFile) => {
36 | var reader = new FileReader();
37 | reader.readAsArrayBuffer(resFile);
38 | reader.onloadend = (evt: any) => {
39 | var imgBlob = new Blob([evt.target.result], { type: 'image/jpeg' });
40 | var imageStore = this.firestore.ref('/profileimages').child(firebase.auth().currentUser.uid);
41 | imageStore.put(imgBlob).then((res) => {
42 | this.firestore.ref('/profileimages').child(firebase.auth().currentUser.uid).getDownloadURL().then((url) => {
43 | resolve(url);
44 | }).catch((err) => {
45 | reject(err);
46 | })
47 | }).catch((err) => {
48 | reject(err);
49 | })
50 | }
51 | })
52 | })
53 | })
54 | })
55 | })
56 | return promise;
57 | }
58 |
59 | grouppicstore(groupname) {
60 | var promise = new Promise((resolve, reject) => {
61 | this.filechooser.open().then((url) => {
62 | (window).FilePath.resolveNativePath(url, (result) => {
63 | this.nativepath = result;
64 | (window).resolveLocalFileSystemURL(this.nativepath, (res) => {
65 | res.file((resFile) => {
66 | var reader = new FileReader();
67 | reader.readAsArrayBuffer(resFile);
68 | reader.onloadend = (evt: any) => {
69 | var imgBlob = new Blob([evt.target.result], { type: 'image/jpeg' });
70 | var imageStore = this.firestore.ref('/groupimages').child(firebase.auth().currentUser.uid).child(groupname);
71 | imageStore.put(imgBlob).then((res) => {
72 | this.firestore.ref('/profileimages').child(firebase.auth().currentUser.uid).child(groupname).getDownloadURL().then((url) => {
73 | resolve(url);
74 | }).catch((err) => {
75 | reject(err);
76 | })
77 | }).catch((err) => {
78 | reject(err);
79 | })
80 | }
81 | })
82 | })
83 | })
84 | })
85 | })
86 | return promise;
87 | }
88 |
89 | picmsgstore() {
90 | var promise = new Promise((resolve, reject) => {
91 | this.filechooser.open().then((url) => {
92 | (window).FilePath.resolveNativePath(url, (result) => {
93 | this.nativepath = result;
94 | (window).resolveLocalFileSystemURL(this.nativepath, (res) => {
95 | res.file((resFile) => {
96 | var reader = new FileReader();
97 | reader.readAsArrayBuffer(resFile);
98 | reader.onloadend = (evt: any) => {
99 | var imgBlob = new Blob([evt.target.result], { type: 'image/jpeg' });
100 | var uuid = this.guid();
101 | var imageStore = this.firestore.ref('/picmsgs').child(firebase.auth().currentUser.uid).child('picmsg' + uuid);
102 | imageStore.put(imgBlob).then((res) => {
103 | resolve(res.downloadURL);
104 | }).catch((err) => {
105 | reject(err);
106 | })
107 | .catch((err) => {
108 | reject(err);
109 | })
110 | }
111 | })
112 | })
113 | })
114 | })
115 | })
116 | return promise;
117 | }
118 |
119 | guid() {
120 | function s4() {
121 | return Math.floor((1 + Math.random()) * 0x10000)
122 | .toString(16)
123 | .substring(1);
124 | }
125 | return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
126 | s4() + '-' + s4() + s4() + s4();
127 | }
128 |
129 | }
130 |
--------------------------------------------------------------------------------
/src/providers/requests/requests.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { Events } from 'ionic-angular';
3 | import { connreq } from '../../models/interfaces/request';
4 | import { UserProvider } from '../user/user';
5 | import firebase from 'firebase';
6 |
7 | /*
8 | Generated class for the RequestsProvider provider.
9 |
10 | See https://angular.io/docs/ts/latest/guide/dependency-injection.html
11 | for more info on providers and Angular 2 DI.
12 | */
13 | @Injectable()
14 | export class RequestsProvider {
15 | firereq = firebase.database().ref('/requests');
16 | firefriends = firebase.database().ref('/friends');
17 |
18 | userdetails;
19 | myfriends;
20 | constructor(public userservice: UserProvider, public events: Events) {
21 |
22 | }
23 |
24 | sendrequest(req: connreq) {
25 | var promise = new Promise((resolve, reject) => {
26 | this.firereq.child(req.recipient).push({
27 | sender: req.sender
28 | }).then(() => {
29 | resolve({ success: true });
30 | }).catch((err) => {
31 | resolve(err);
32 | })
33 | })
34 | return promise;
35 | }
36 |
37 | getmyrequests() {
38 | let allmyrequests;
39 | var myrequests = [];
40 | this.firereq.child(firebase.auth().currentUser.uid).on('value', (snapshot) => {
41 | allmyrequests = snapshot.val();
42 | myrequests = [];
43 | for (var i in allmyrequests) {
44 | myrequests.push(allmyrequests[i].sender);
45 | }
46 | this.userservice.getallusers().then((res) => {
47 | var allusers = res;
48 | this.userdetails = [];
49 | for (var j in myrequests)
50 | for (var key in allusers) {
51 | if (myrequests[j] === allusers[key].uid) {
52 | this.userdetails.push(allusers[key]);
53 | }
54 | }
55 | this.events.publish('gotrequests');
56 | })
57 |
58 | })
59 | }
60 |
61 | acceptrequest(buddy) {
62 | var promise = new Promise((resolve, reject) => {
63 | this.myfriends = [];
64 | this.firefriends.child(firebase.auth().currentUser.uid).push({
65 | uid: buddy.uid
66 | }).then(() => {
67 | this.firefriends.child(buddy.uid).push({
68 | uid: firebase.auth().currentUser.uid
69 | }).then(() => {
70 | this.deleterequest(buddy).then(() => {
71 | resolve(true);
72 | })
73 |
74 | }).catch((err) => {
75 | reject(err);
76 | })
77 | }).catch((err) => {
78 | reject(err);
79 | })
80 | })
81 | return promise;
82 | }
83 |
84 | deleterequest(buddy) {
85 | var promise = new Promise((resolve, reject) => {
86 | this.firereq.child(firebase.auth().currentUser.uid).orderByChild('sender').equalTo(buddy.uid).once('value', (snapshot) => {
87 | let somekey;
88 | for (var key in snapshot.val())
89 | somekey = key;
90 | this.firereq.child(firebase.auth().currentUser.uid).child(somekey).remove().then(() => {
91 | resolve(true);
92 | })
93 | })
94 | .then(() => {
95 |
96 | }).catch((err) => {
97 | reject(err);
98 | })
99 | })
100 | return promise;
101 | }
102 |
103 | getmyfriends() {
104 | let friendsuid = [];
105 | this.firefriends.child(firebase.auth().currentUser.uid).on('value', (snapshot) => {
106 | let allfriends = snapshot.val();
107 | this.myfriends = [];
108 | for (var i in allfriends)
109 | friendsuid.push(allfriends[i].uid);
110 |
111 | this.userservice.getallusers().then((users) => {
112 | this.myfriends = [];
113 | for (var j in friendsuid)
114 | for (var key in users) {
115 | if (friendsuid[j] === users[key].uid) {
116 | this.myfriends.push(users[key]);
117 | }
118 | }
119 | this.events.publish('friends');
120 | }).catch((err) => {
121 | alert(err);
122 | })
123 |
124 | })
125 | }
126 |
127 | }
128 |
--------------------------------------------------------------------------------
/src/providers/user/user.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { AngularFireAuth } from 'angularfire2/auth';
3 | import firebase from 'firebase';
4 |
5 | /*
6 | Generated class for the UserProvider provider.
7 |
8 | See https://angular.io/docs/ts/latest/guide/dependency-injection.html
9 | for more info on providers and Angular 2 DI.
10 | */
11 | @Injectable()
12 | export class UserProvider {
13 | firedata = firebase.database().ref('/users');
14 | constructor(public afireauth: AngularFireAuth) {
15 |
16 | }
17 |
18 | /*
19 | Adds a new user to the system.
20 | Called from - signup.ts
21 | Inputs - The new user object containing the email, password and displayName.
22 | Outputs - Promise.
23 |
24 | */
25 |
26 | adduser(newuser) {
27 | var promise = new Promise((resolve, reject) => {
28 | this.afireauth.auth.createUserWithEmailAndPassword(newuser.email, newuser.password).then(() => {
29 | this.afireauth.auth.currentUser.updateProfile({
30 | displayName: newuser.displayName,
31 | photoURL: 'https://firebasestorage.googleapis.com/v0/b/myapp-4eadd.appspot.com/o/chatterplace.png?alt=media&token=e51fa887-bfc6-48ff-87c6-e2c61976534e'
32 | }).then(() => {
33 | this.firedata.child(this.afireauth.auth.currentUser.uid).set({
34 | uid: this.afireauth.auth.currentUser.uid,
35 | displayName: newuser.displayName,
36 | photoURL: 'https://firebasestorage.googleapis.com/v0/b/myapp-4eadd.appspot.com/o/chatterplace.png?alt=media&token=e51fa887-bfc6-48ff-87c6-e2c61976534e'
37 | }).then(() => {
38 | resolve({ success: true });
39 | }).catch((err) => {
40 | reject(err);
41 | })
42 | }).catch((err) => {
43 | reject(err);
44 | })
45 | }).catch((err) => {
46 | reject(err);
47 | })
48 | })
49 | return promise;
50 | }
51 |
52 | /*
53 | For resetting the password of the user.
54 | Called from - passwordreset.ts
55 | Inputs - email of the user.
56 | Output - Promise.
57 |
58 | */
59 |
60 | passwordreset(email) {
61 | var promise = new Promise((resolve, reject) => {
62 | firebase.auth().sendPasswordResetEmail(email).then(() => {
63 | resolve({ success: true });
64 | }).catch((err) => {
65 | reject(err);
66 | })
67 | })
68 | return promise;
69 | }
70 |
71 | /*
72 |
73 | For updating the users collection and the firebase users list with
74 | the imageurl of the profile picture stored in firebase storage.
75 | Called from - profilepic.ts
76 | Inputs - Url of the image stored in firebase.
77 | OUtputs - Promise.
78 |
79 | */
80 |
81 | updateimage(imageurl) {
82 | var promise = new Promise((resolve, reject) => {
83 | this.afireauth.auth.currentUser.updateProfile({
84 | displayName: this.afireauth.auth.currentUser.displayName,
85 | photoURL: imageurl
86 | }).then(() => {
87 | firebase.database().ref('/users/' + firebase.auth().currentUser.uid).update({
88 | displayName: this.afireauth.auth.currentUser.displayName,
89 | photoURL: imageurl,
90 | uid: firebase.auth().currentUser.uid
91 | }).then(() => {
92 | resolve({ success: true });
93 | }).catch((err) => {
94 | reject(err);
95 | })
96 | }).catch((err) => {
97 | reject(err);
98 | })
99 | })
100 | return promise;
101 | }
102 |
103 | getuserdetails() {
104 | var promise = new Promise((resolve, reject) => {
105 | this.firedata.child(firebase.auth().currentUser.uid).once('value', (snapshot) => {
106 | resolve(snapshot.val());
107 | }).catch((err) => {
108 | reject(err);
109 | })
110 | })
111 | return promise;
112 | }
113 |
114 | updatedisplayname(newname) {
115 | var promise = new Promise((resolve, reject) => {
116 | this.afireauth.auth.currentUser.updateProfile({
117 | displayName: newname,
118 | photoURL: this.afireauth.auth.currentUser.photoURL
119 | }).then(() => {
120 | this.firedata.child(firebase.auth().currentUser.uid).update({
121 | displayName: newname,
122 | photoURL: this.afireauth.auth.currentUser.photoURL,
123 | uid: this.afireauth.auth.currentUser.uid
124 | }).then(() => {
125 | resolve({ success: true });
126 | }).catch((err) => {
127 | reject(err);
128 | })
129 | }).catch((err) => {
130 | reject(err);
131 | })
132 | })
133 | return promise;
134 | }
135 |
136 | getallusers() {
137 | var promise = new Promise((resolve, reject) => {
138 | this.firedata.orderByChild('uid').once('value', (snapshot) => {
139 | let userdata = snapshot.val();
140 | let temparr = [];
141 | for (var key in userdata) {
142 | temparr.push(userdata[key]);
143 | }
144 | resolve(temparr);
145 | }).catch((err) => {
146 | reject(err);
147 | })
148 | })
149 | return promise;
150 | }
151 |
152 |
153 | }
154 |
--------------------------------------------------------------------------------
/src/service-worker.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Check out https://googlechrome.github.io/sw-toolbox/ for
3 | * more info on how to use sw-toolbox to custom configure your service worker.
4 | */
5 |
6 |
7 | 'use strict';
8 | importScripts('./build/sw-toolbox.js');
9 |
10 | self.toolbox.options.cache = {
11 | name: 'ionic-cache'
12 | };
13 |
14 | // pre-cache our key assets
15 | self.toolbox.precache(
16 | [
17 | './build/main.js',
18 | './build/main.css',
19 | './build/polyfills.js',
20 | 'index.html',
21 | 'manifest.json'
22 | ]
23 | );
24 |
25 | // dynamically cache any other local assets
26 | self.toolbox.router.any('/*', self.toolbox.cacheFirst);
27 |
28 | // for any other requests go to the network, cache,
29 | // and then only use that cached resource if your user goes offline
30 | self.toolbox.router.default = self.toolbox.networkFirst;
31 |
--------------------------------------------------------------------------------
/src/theme/variables.scss:
--------------------------------------------------------------------------------
1 | // Ionic Variables and Theming. For more info, please see:
2 | // http://ionicframework.com/docs/v2/theming/
3 | $font-path: "../assets/fonts";
4 |
5 | @import "ionic.globals";
6 |
7 |
8 | // Shared Variables
9 | // --------------------------------------------------
10 | // To customize the look and feel of this app, you can override
11 | // the Sass variables found in Ionic's source scss files.
12 | // To view all the possible Ionic variables, see:
13 | // http://ionicframework.com/docs/v2/theming/overriding-ionic-variables/
14 |
15 |
16 |
17 |
18 | // Named Color Variables
19 | // --------------------------------------------------
20 | // Named colors makes it easy to reuse colors on various components.
21 | // It's highly recommended to change the default colors
22 | // to match your app's branding. Ionic uses a Sass map of
23 | // colors so you can add, rename and remove colors as needed.
24 | // The "primary" color is the only required color in the map.
25 |
26 | $colors: (
27 | primary: #488aff,
28 | secondary: #32db64,
29 | danger: #f53d3d,
30 | light: #f4f4f4,
31 | dark: #222,
32 | hcolor: #03b6b3,
33 | );
34 |
35 |
36 | // App iOS Variables
37 | // --------------------------------------------------
38 | // iOS only Sass variables can go here
39 |
40 |
41 |
42 |
43 | // App Material Design Variables
44 | // --------------------------------------------------
45 | // Material Design only Sass variables can go here
46 |
47 |
48 |
49 |
50 | // App Windows Variables
51 | // --------------------------------------------------
52 | // Windows only Sass variables can go here
53 |
54 |
55 |
56 |
57 | // App Theme
58 | // --------------------------------------------------
59 | // Ionic apps can have different themes applied, which can
60 | // then be future customized. This import comes last
61 | // so that the above variables are used and Ionic's
62 | // default are overridden.
63 |
64 | @import "ionic.theme.default";
65 |
66 |
67 | // Ionicons
68 | // --------------------------------------------------
69 | // The premium icon font for Ionic. For more info, please see:
70 | // http://ionicframework.com/docs/v2/ionicons/
71 |
72 | @import "ionic.ionicons";
73 |
74 |
75 | // Fonts
76 | // --------------------------------------------------
77 |
78 | @import "roboto";
79 | @import "noto-sans";
80 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowSyntheticDefaultImports": true,
4 | "declaration": false,
5 | "emitDecoratorMetadata": true,
6 | "experimentalDecorators": true,
7 | "lib": [
8 | "dom",
9 | "es2015"
10 | ],
11 | "module": "es2015",
12 | "moduleResolution": "node",
13 | "sourceMap": true,
14 | "target": "es5"
15 | },
16 | "include": [
17 | "src/**/*.ts"
18 | ],
19 | "exclude": [
20 | "node_modules"
21 | ],
22 | "compileOnSave": false,
23 | "atom": {
24 | "rewriteTsconfig": false
25 | }
26 | }
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rules": {
3 | "no-duplicate-variable": true,
4 | "no-unused-variable": [
5 | true
6 | ]
7 | },
8 | "rulesDirectory": [
9 | "node_modules/tslint-eslint-rules/dist/rules"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------