|
@@ -1,12 +1,13 @@
|
1
|
1
|
webpackJsonp([4],{
|
2
|
2
|
|
3
|
|
-/***/ 103:
|
|
3
|
+/***/ 105:
|
4
|
4
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5
|
5
|
|
6
|
6
|
"use strict";
|
7
|
7
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AllChannelsPage; });
|
8
|
8
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
9
|
9
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(20);
|
|
10
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__providers_channel_channel__ = __webpack_require__(30);
|
10
|
11
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
11
|
12
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
12
|
13
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -18,6 +19,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
18
|
19
|
};
|
19
|
20
|
|
20
|
21
|
|
|
22
|
+
|
21
|
23
|
/**
|
22
|
24
|
* Generated class for the AllChannelsPage page.
|
23
|
25
|
*
|
|
@@ -25,18 +27,27 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
25
|
27
|
* Ionic pages and navigation.
|
26
|
28
|
*/
|
27
|
29
|
var AllChannelsPage = /** @class */ (function () {
|
28
|
|
- function AllChannelsPage(navCtrl, navParams) {
|
|
30
|
+ function AllChannelsPage(navCtrl, navParams, channelProvider) {
|
29
|
31
|
this.navCtrl = navCtrl;
|
30
|
32
|
this.navParams = navParams;
|
|
33
|
+ this.channelProvider = channelProvider;
|
31
|
34
|
}
|
32
|
35
|
AllChannelsPage.prototype.ionViewDidLoad = function () {
|
33
|
36
|
console.log('ionViewDidLoad AllChannelsPage');
|
34
|
37
|
};
|
|
38
|
+ AllChannelsPage.prototype.joinChannel = function (channel) {
|
|
39
|
+ var _this = this;
|
|
40
|
+ this.channelProvider.join(channel, function (result) {
|
|
41
|
+ _this.navCtrl.remove(1);
|
|
42
|
+ });
|
|
43
|
+ };
|
35
|
44
|
AllChannelsPage = __decorate([
|
36
|
45
|
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
|
37
|
|
- selector: 'page-all-channels',template:/*ion-inline-start:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/all-channels/all-channels.html"*/'\n\n\n<ion-header>\n\n <ion-navbar>\n <ion-title>All Available Channels</ion-title>\n </ion-navbar>\n\n</ion-header>\n\n\n<ion-content padding>\n\n</ion-content>\n'/*ion-inline-end:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/all-channels/all-channels.html"*/,
|
|
46
|
+ selector: 'page-all-channels',template:/*ion-inline-start:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/pages/all-channels/all-channels.html"*/'\n\n\n<ion-header>\n\n <ion-navbar>\n <ion-title>All Available Channels</ion-title>\n </ion-navbar>\n\n</ion-header>\n\n\n<ion-content padding>\n\n <ion-item menuClose *ngFor="let channel of this.channelProvider.allChannels" (click)="joinChannel(channel)">\n {{ channel.name }}\n </ion-item>\n\n</ion-content>\n'/*ion-inline-end:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/pages/all-channels/all-channels.html"*/,
|
38
|
47
|
}),
|
39
|
|
- __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* NavParams */]])
|
|
48
|
+ __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* NavController */],
|
|
49
|
+ __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* NavParams */],
|
|
50
|
+ __WEBPACK_IMPORTED_MODULE_2__providers_channel_channel__["a" /* ChannelProvider */]])
|
40
|
51
|
], AllChannelsPage);
|
41
|
52
|
return AllChannelsPage;
|
42
|
53
|
}());
|
|
@@ -45,13 +56,14 @@ var AllChannelsPage = /** @class */ (function () {
|
45
|
56
|
|
46
|
57
|
/***/ }),
|
47
|
58
|
|
48
|
|
-/***/ 104:
|
|
59
|
+/***/ 106:
|
49
|
60
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
50
|
61
|
|
51
|
62
|
"use strict";
|
52
|
63
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CreateChannelPage; });
|
53
|
64
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
54
|
65
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(20);
|
|
66
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__providers_channel_channel__ = __webpack_require__(30);
|
55
|
67
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
56
|
68
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
57
|
69
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -63,6 +75,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
63
|
75
|
};
|
64
|
76
|
|
65
|
77
|
|
|
78
|
+
|
66
|
79
|
/**
|
67
|
80
|
* Generated class for the CreateChannelPage page.
|
68
|
81
|
*
|
|
@@ -70,18 +83,30 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
70
|
83
|
* Ionic pages and navigation.
|
71
|
84
|
*/
|
72
|
85
|
var CreateChannelPage = /** @class */ (function () {
|
73
|
|
- function CreateChannelPage(navCtrl, navParams) {
|
|
86
|
+ function CreateChannelPage(navCtrl, navParams, channelProvider) {
|
74
|
87
|
this.navCtrl = navCtrl;
|
75
|
88
|
this.navParams = navParams;
|
|
89
|
+ this.channelProvider = channelProvider;
|
76
|
90
|
}
|
77
|
91
|
CreateChannelPage.prototype.ionViewDidLoad = function () {
|
78
|
92
|
console.log('ionViewDidLoad CreateChannelPage');
|
79
|
93
|
};
|
|
94
|
+ CreateChannelPage.prototype.createChannel = function () {
|
|
95
|
+ var _this = this;
|
|
96
|
+ console.log(this.channel);
|
|
97
|
+ if (this.channel.trim()) {
|
|
98
|
+ this.channelProvider.create(this.channel, function (result) {
|
|
99
|
+ _this.navCtrl.remove(1);
|
|
100
|
+ });
|
|
101
|
+ }
|
|
102
|
+ };
|
80
|
103
|
CreateChannelPage = __decorate([
|
81
|
104
|
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
|
82
|
|
- selector: 'page-create-channel',template:/*ion-inline-start:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/create-channel/create-channel.html"*/'\n\n\n<ion-header>\n\n <ion-navbar>\n <ion-title>createChannel</ion-title>\n </ion-navbar>\n\n</ion-header>\n\n\n<ion-content text-center>\n\n <br><br><br><br>\n\n <h1>Create a channel</h1>\n <br>\n <h3>Channels are where your members communicate.</h3>\n\n <br><br><br>\n <h2>Name</h2>\n <ion-item >\n\n <ion-input\n type="text"\n placeholder="# e.g. ZipTeam Study Session"\n [(ngModel)]="message"\n (keyup.enter)="sendMessage()"\n >\n </ion-input>\n \n\n </ion-item>\n\n\n</ion-content>\n'/*ion-inline-end:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/create-channel/create-channel.html"*/,
|
|
105
|
+ selector: 'page-create-channel',template:/*ion-inline-start:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/pages/create-channel/create-channel.html"*/'\n\n\n<ion-header>\n\n <ion-navbar>\n <ion-title>createChannel</ion-title>\n </ion-navbar>\n\n</ion-header>\n\n\n<ion-content text-center>\n\n <br><br><br><br>\n\n <h1>Create a channel</h1>\n <br>\n <h3>Channels are where your members communicate.</h3>\n\n <br><br><br>\n <h2>Name</h2>\n <ion-item >\n\n <ion-input\n type="text"\n placeholder="# e.g. ZipTeam Study Session"\n [(ngModel)]="channel"\n (keyup.enter)="createChannel()"\n >\n </ion-input>\n \n\n </ion-item>\n\n\n</ion-content>\n'/*ion-inline-end:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/pages/create-channel/create-channel.html"*/,
|
83
|
106
|
}),
|
84
|
|
- __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* NavParams */]])
|
|
107
|
+ __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* NavController */],
|
|
108
|
+ __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* NavParams */],
|
|
109
|
+ __WEBPACK_IMPORTED_MODULE_2__providers_channel_channel__["a" /* ChannelProvider */]])
|
85
|
110
|
], CreateChannelPage);
|
86
|
111
|
return CreateChannelPage;
|
87
|
112
|
}());
|
|
@@ -90,7 +115,7 @@ var CreateChannelPage = /** @class */ (function () {
|
90
|
115
|
|
91
|
116
|
/***/ }),
|
92
|
117
|
|
93
|
|
-/***/ 105:
|
|
118
|
+/***/ 107:
|
94
|
119
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
95
|
120
|
|
96
|
121
|
"use strict";
|
|
@@ -124,7 +149,7 @@ var RegisterPage = /** @class */ (function () {
|
124
|
149
|
};
|
125
|
150
|
RegisterPage = __decorate([
|
126
|
151
|
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
|
127
|
|
- selector: 'page-register',template:/*ion-inline-start:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/register/register.html"*/'<ion-header>\n\n <ion-navbar>\n <ion-title>Register</ion-title>\n </ion-navbar>\n\n</ion-header>\n\n\n<ion-content text-center class="register">\n\n <br><br><br><br><br>\n\n <ion-list>\n <ion-item>\n <ion-label fixed>Username</ion-label>\n <ion-input type="text"></ion-input>\n </ion-item>\n\n\n <ion-item>\n <ion-label fixed>First Name</ion-label>\n <ion-input type="text"></ion-input>\n </ion-item>\n\n\n <ion-item>\n <ion-label fixed>Last Name</ion-label>\n <ion-input type="text"></ion-input>\n </ion-item>\n\n\n <ion-item>\n <ion-label fixed>Password</ion-label>\n <ion-input type="text"></ion-input>\n </ion-item>\n\n\n <ion-item>\n <ion-label fixed>Email</ion-label>\n <ion-input type="text"></ion-input>\n </ion-item>\n </ion-list>\n <button ion-button color="danger" round (click)="register()">Confirm</button>\n <br>\n <button ion-button color="danger" round (click)="cancel()">Cancel</button>\n</ion-content>'/*ion-inline-end:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/register/register.html"*/,
|
|
152
|
+ selector: 'page-register',template:/*ion-inline-start:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/pages/register/register.html"*/'<ion-header>\n\n <ion-navbar>\n <ion-title>Register</ion-title>\n </ion-navbar>\n\n</ion-header>\n\n\n<ion-content text-center class="register">\n\n <br><br><br><br><br>\n\n <ion-list>\n <ion-item>\n <ion-label fixed>Username</ion-label>\n <ion-input type="text"></ion-input>\n </ion-item>\n\n\n <ion-item>\n <ion-label fixed>First Name</ion-label>\n <ion-input type="text"></ion-input>\n </ion-item>\n\n\n <ion-item>\n <ion-label fixed>Last Name</ion-label>\n <ion-input type="text"></ion-input>\n </ion-item>\n\n\n <ion-item>\n <ion-label fixed>Password</ion-label>\n <ion-input type="text"></ion-input>\n </ion-item>\n\n\n <ion-item>\n <ion-label fixed>Email</ion-label>\n <ion-input type="text"></ion-input>\n </ion-item>\n </ion-list>\n <button ion-button color="danger" round (click)="register()">Confirm</button>\n <br>\n <button ion-button color="danger" round (click)="cancel()">Cancel</button>\n</ion-content>'/*ion-inline-end:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/pages/register/register.html"*/,
|
128
|
153
|
}),
|
129
|
154
|
__metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* NavController */],
|
130
|
155
|
__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* NavParams */]])
|
|
@@ -136,7 +161,7 @@ var RegisterPage = /** @class */ (function () {
|
136
|
161
|
|
137
|
162
|
/***/ }),
|
138
|
163
|
|
139
|
|
-/***/ 117:
|
|
164
|
+/***/ 119:
|
140
|
165
|
/***/ (function(module, exports) {
|
141
|
166
|
|
142
|
167
|
function webpackEmptyAsyncContext(req) {
|
|
@@ -149,11 +174,11 @@ function webpackEmptyAsyncContext(req) {
|
149
|
174
|
webpackEmptyAsyncContext.keys = function() { return []; };
|
150
|
175
|
webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
|
151
|
176
|
module.exports = webpackEmptyAsyncContext;
|
152
|
|
-webpackEmptyAsyncContext.id = 117;
|
|
177
|
+webpackEmptyAsyncContext.id = 119;
|
153
|
178
|
|
154
|
179
|
/***/ }),
|
155
|
180
|
|
156
|
|
-/***/ 159:
|
|
181
|
+/***/ 161:
|
157
|
182
|
/***/ (function(module, exports, __webpack_require__) {
|
158
|
183
|
|
159
|
184
|
var map = {
|
|
@@ -162,7 +187,7 @@ var map = {
|
162
|
187
|
3
|
163
|
188
|
],
|
164
|
189
|
"../pages/channel/channel.module": [
|
165
|
|
- 286,
|
|
190
|
+ 287,
|
166
|
191
|
2
|
167
|
192
|
],
|
168
|
193
|
"../pages/create-channel/create-channel.module": [
|
|
@@ -170,7 +195,7 @@ var map = {
|
170
|
195
|
1
|
171
|
196
|
],
|
172
|
197
|
"../pages/register/register.module": [
|
173
|
|
- 287,
|
|
198
|
+ 286,
|
174
|
199
|
0
|
175
|
200
|
]
|
176
|
201
|
};
|
|
@@ -185,169 +210,11 @@ function webpackAsyncContext(req) {
|
185
|
210
|
webpackAsyncContext.keys = function webpackAsyncContextKeys() {
|
186
|
211
|
return Object.keys(map);
|
187
|
212
|
};
|
188
|
|
-webpackAsyncContext.id = 159;
|
|
213
|
+webpackAsyncContext.id = 161;
|
189
|
214
|
module.exports = webpackAsyncContext;
|
190
|
215
|
|
191
|
216
|
/***/ }),
|
192
|
217
|
|
193
|
|
-/***/ 160:
|
194
|
|
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
195
|
|
-
|
196
|
|
-"use strict";
|
197
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MessageProvider; });
|
198
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
199
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_http__ = __webpack_require__(46);
|
200
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__user_user__ = __webpack_require__(47);
|
201
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__url_url__ = __webpack_require__(80);
|
202
|
|
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
203
|
|
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
204
|
|
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
205
|
|
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
206
|
|
- return c > 3 && r && Object.defineProperty(target, key, r), r;
|
207
|
|
-};
|
208
|
|
-var __metadata = (this && this.__metadata) || function (k, v) {
|
209
|
|
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
210
|
|
-};
|
211
|
|
-
|
212
|
|
-
|
213
|
|
-
|
214
|
|
-
|
215
|
|
-/*
|
216
|
|
- Generated class for the MessageProvider provider.
|
217
|
|
-
|
218
|
|
- See https://angular.io/guide/dependency-injection for more info on providers
|
219
|
|
- and Angular DI.
|
220
|
|
-*/
|
221
|
|
-var MessageProvider = /** @class */ (function () {
|
222
|
|
- function MessageProvider(http, userProvider, urlProvider) {
|
223
|
|
- this.http = http;
|
224
|
|
- this.userProvider = userProvider;
|
225
|
|
- this.urlProvider = urlProvider;
|
226
|
|
- console.log('Hello MessageProvider Provider');
|
227
|
|
- }
|
228
|
|
- MessageProvider.prototype.getAll = function () {
|
229
|
|
- var url = this.urlProvider.getBaseUrl() + "/get_messages";
|
230
|
|
- var header = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["a" /* Headers */]({
|
231
|
|
- 'Authorization': this.userProvider.getToken()
|
232
|
|
- });
|
233
|
|
- var options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["d" /* RequestOptions */]({ headers: header });
|
234
|
|
- this.http.get(url, options).subscribe(function (result) {
|
235
|
|
- console.log(result);
|
236
|
|
- });
|
237
|
|
- };
|
238
|
|
- MessageProvider.prototype.post = function (channelId, message, callback) {
|
239
|
|
- var _this = this;
|
240
|
|
- var url = this.urlProvider.getBaseUrl() + "/post";
|
241
|
|
- var header = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["a" /* Headers */]({
|
242
|
|
- 'Authorization': this.userProvider.getToken(),
|
243
|
|
- 'Content-Type': 'application/json'
|
244
|
|
- });
|
245
|
|
- var options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["d" /* RequestOptions */]({ headers: header });
|
246
|
|
- var body = {
|
247
|
|
- "channelId": channelId,
|
248
|
|
- "message": message
|
249
|
|
- };
|
250
|
|
- this.http.post(url, body, options).subscribe(function (result) {
|
251
|
|
- console.log(result);
|
252
|
|
- _this.get(channelId, function (after) {
|
253
|
|
- callback();
|
254
|
|
- });
|
255
|
|
- });
|
256
|
|
- };
|
257
|
|
- MessageProvider.prototype.get = function (channelId, callback) {
|
258
|
|
- var url = this.urlProvider.getBaseUrl() + "/messages?channelid=" + channelId;
|
259
|
|
- var header = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["a" /* Headers */]({
|
260
|
|
- 'Authorization': this.userProvider.getToken(),
|
261
|
|
- 'Content-Type': 'application/json'
|
262
|
|
- });
|
263
|
|
- var options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["d" /* RequestOptions */]({ headers: header });
|
264
|
|
- this.http.get(url, options).subscribe(function (result) {
|
265
|
|
- console.log(result);
|
266
|
|
- callback(result);
|
267
|
|
- });
|
268
|
|
- };
|
269
|
|
- MessageProvider.prototype.delete = function (messageId, callback) {
|
270
|
|
- var url = this.urlProvider.getBaseUrl() + "/delete?messageId=" + messageId;
|
271
|
|
- var header = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["a" /* Headers */]({
|
272
|
|
- 'Authorization': this.userProvider.getToken(),
|
273
|
|
- 'Content-Type': 'application/json'
|
274
|
|
- });
|
275
|
|
- var options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["d" /* RequestOptions */]({ headers: header });
|
276
|
|
- this.http.delete(url, options).subscribe(function (result) {
|
277
|
|
- console.log(result);
|
278
|
|
- callback();
|
279
|
|
- });
|
280
|
|
- };
|
281
|
|
- MessageProvider = __decorate([
|
282
|
|
- Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */])(),
|
283
|
|
- __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1__angular_http__["b" /* Http */],
|
284
|
|
- __WEBPACK_IMPORTED_MODULE_2__user_user__["a" /* UserProvider */],
|
285
|
|
- __WEBPACK_IMPORTED_MODULE_3__url_url__["a" /* UrlProvider */]])
|
286
|
|
- ], MessageProvider);
|
287
|
|
- return MessageProvider;
|
288
|
|
-}());
|
289
|
|
-
|
290
|
|
-//# sourceMappingURL=message.js.map
|
291
|
|
-
|
292
|
|
-/***/ }),
|
293
|
|
-
|
294
|
|
-/***/ 161:
|
295
|
|
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
296
|
|
-
|
297
|
|
-"use strict";
|
298
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ChannelProvider; });
|
299
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
300
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__user_user__ = __webpack_require__(47);
|
301
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__ = __webpack_require__(46);
|
302
|
|
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
303
|
|
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
304
|
|
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
305
|
|
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
306
|
|
- return c > 3 && r && Object.defineProperty(target, key, r), r;
|
307
|
|
-};
|
308
|
|
-var __metadata = (this && this.__metadata) || function (k, v) {
|
309
|
|
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
310
|
|
-};
|
311
|
|
-
|
312
|
|
-
|
313
|
|
-
|
314
|
|
-/*
|
315
|
|
- Generated class for the ChannelProvider provider.
|
316
|
|
-
|
317
|
|
- See https://angular.io/guide/dependency-injection for more info on providers
|
318
|
|
- and Angular DI.
|
319
|
|
-*/
|
320
|
|
-var ChannelProvider = /** @class */ (function () {
|
321
|
|
- function ChannelProvider(http, userProvider) {
|
322
|
|
- this.http = http;
|
323
|
|
- this.userProvider = userProvider;
|
324
|
|
- this.baseUrl = "https://zipteampurple.herokuapp.com";
|
325
|
|
- console.log('Hello ChannelProvider Provider');
|
326
|
|
- }
|
327
|
|
- ChannelProvider.prototype.get = function (callback) {
|
328
|
|
- var url = this.baseUrl + "/user_channels";
|
329
|
|
- var header = new __WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__["a" /* Headers */]({
|
330
|
|
- 'Authorization': this.userProvider.getToken(),
|
331
|
|
- 'Content-Type': 'application/json'
|
332
|
|
- });
|
333
|
|
- var options = new __WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__["d" /* RequestOptions */]({ headers: header });
|
334
|
|
- this.http.get(url, options).subscribe(function (result) {
|
335
|
|
- //console.log(result);
|
336
|
|
- callback(result.json());
|
337
|
|
- });
|
338
|
|
- };
|
339
|
|
- ChannelProvider = __decorate([
|
340
|
|
- Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */])(),
|
341
|
|
- __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__["b" /* Http */],
|
342
|
|
- __WEBPACK_IMPORTED_MODULE_1__user_user__["a" /* UserProvider */]])
|
343
|
|
- ], ChannelProvider);
|
344
|
|
- return ChannelProvider;
|
345
|
|
-}());
|
346
|
|
-
|
347
|
|
-//# sourceMappingURL=channel.js.map
|
348
|
|
-
|
349
|
|
-/***/ }),
|
350
|
|
-
|
351
|
218
|
/***/ 205:
|
352
|
219
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
353
|
220
|
|
|
@@ -355,10 +222,11 @@ var ChannelProvider = /** @class */ (function () {
|
355
|
222
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HomePage; });
|
356
|
223
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
357
|
224
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(20);
|
358
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__channel_channel__ = __webpack_require__(52);
|
|
225
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__channel_channel__ = __webpack_require__(54);
|
359
|
226
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_forms__ = __webpack_require__(15);
|
360
|
227
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__providers_user_user__ = __webpack_require__(47);
|
361
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__register_register__ = __webpack_require__(105);
|
|
228
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__register_register__ = __webpack_require__(107);
|
|
229
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__providers_channel_channel__ = __webpack_require__(30);
|
362
|
230
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
363
|
231
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
364
|
232
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -374,11 +242,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
374
|
242
|
|
375
|
243
|
|
376
|
244
|
|
|
245
|
+
|
377
|
246
|
var HomePage = /** @class */ (function () {
|
378
|
|
- function HomePage(navCtrl, formbuilder, userprovider) {
|
|
247
|
+ function HomePage(navCtrl, formbuilder, userprovider, channeProvder) {
|
379
|
248
|
this.navCtrl = navCtrl;
|
380
|
249
|
this.formbuilder = formbuilder;
|
381
|
250
|
this.userprovider = userprovider;
|
|
251
|
+ this.channeProvder = channeProvder;
|
382
|
252
|
this.formgroup = this.formbuilder.group({
|
383
|
253
|
username: ['', __WEBPACK_IMPORTED_MODULE_3__angular_forms__["f" /* Validators */].required],
|
384
|
254
|
password: ['', __WEBPACK_IMPORTED_MODULE_3__angular_forms__["f" /* Validators */].required]
|
|
@@ -396,6 +266,7 @@ var HomePage = /** @class */ (function () {
|
396
|
266
|
console.log("Success!");
|
397
|
267
|
_this.userprovider.setToken(result.headers.get("authorization"));
|
398
|
268
|
console.log(_this.userprovider.getToken());
|
|
269
|
+ _this.channeProvder.fetch();
|
399
|
270
|
_this.navCtrl.setRoot(__WEBPACK_IMPORTED_MODULE_2__channel_channel__["a" /* ChannelPage */]);
|
400
|
271
|
}
|
401
|
272
|
else {
|
|
@@ -410,9 +281,12 @@ var HomePage = /** @class */ (function () {
|
410
|
281
|
};
|
411
|
282
|
HomePage = __decorate([
|
412
|
283
|
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
|
413
|
|
- selector: 'page-home',template:/*ion-inline-start:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/home/home.html"*/'<ion-header>\n</ion-header>\n\n\n\n<ion-content text-center class = "login">\n\n <br><br><br><br><br>\n <img src="../assets/imgs/fullLogo.png" alt="SLACK" class="rounded-corners">\n\n <br><br><br><br>\n \n\n\n <form [formGroup]="formgroup" (ngSubmit)="sendLogin(formgroup.value)">\n\n<ion-list>\n\n <ion-item text-center>\n\n\n <ion-label fixed>Username</ion-label>\n <ion-input type="text" formControlName="username"></ion-input>\n </ion-item>\n\n <ion-item text-center *ngIf="username.hasError(\'required\') && username.touched">\n <p> *Please enter your username</p>\n </ion-item>\n\n <ion-item text-center>\n <ion-label fixed>Password</ion-label>\n <ion-input type="password" formControlName="password"></ion-input>\n </ion-item>\n\n <ion-item text-center *ngIf="password.hasError(\'required\') && password.touched">\n <p> *Please enter your password</p>\n </ion-item>\n\n\n</ion-list>\n\n\n\n\n<button ion-button color="danger" round type="submit">Login</button>\n\n<!-- line break -->\n<br>\n\n<button ion-button color="danger" (click)="registerPage()" round>Sign Up</button>\n\n\n</form>\n\n\n <form [formGroup]="loginform" (ngSubmit)="sendLogin(loginForm.value)" *ngIf="loginForm">\n\n <ion-label fixed>Username</ion-label>\n <input type="text" name="name" formControlName="username">\n\n <ion-label fixed>Password</ion-label>\n <input type="text" name="name" formControlName="password">\n\n <input type="submit" class="cta-btn filled" value="Submit" [disabled]="!loginForm.valid">\n </form>\n\n\n\n\n\n <!-- Toggle menu button -->\n <!-- <br> -->\n <button ion-button secondary menuToggle>Toggle Menu</button> \n \n</ion-content>\n'/*ion-inline-end:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/home/home.html"*/
|
|
284
|
+ selector: 'page-home',template:/*ion-inline-start:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/pages/home/home.html"*/'<ion-header>\n</ion-header>\n\n\n\n<ion-content text-center class = "login">\n\n <br><br><br><br><br>\n <img src="../assets/imgs/fullLogo.png" alt="SLACK" class="rounded-corners">\n\n <br><br><br><br>\n \n\n\n <form [formGroup]="formgroup" (ngSubmit)="sendLogin(formgroup.value)">\n\n<ion-list>\n\n <ion-item text-center>\n\n\n <ion-label fixed>Username</ion-label>\n <ion-input type="text" formControlName="username"></ion-input>\n </ion-item>\n\n <ion-item text-center *ngIf="username.hasError(\'required\') && username.touched">\n <p> *Please enter your username</p>\n </ion-item>\n\n <ion-item text-center>\n <ion-label fixed>Password</ion-label>\n <ion-input type="password" formControlName="password"></ion-input>\n </ion-item>\n\n <ion-item text-center *ngIf="password.hasError(\'required\') && password.touched">\n <p> *Please enter your password</p>\n </ion-item>\n\n\n</ion-list>\n\n\n\n\n<button ion-button color="danger" round type="submit">Login</button>\n\n<!-- line break -->\n<br>\n\n<button ion-button color="danger" (click)="registerPage()" round>Sign Up</button>\n\n\n</form>\n\n\n <form [formGroup]="loginform" (ngSubmit)="sendLogin(loginForm.value)" *ngIf="loginForm">\n\n <ion-label fixed>Username</ion-label>\n <input type="text" name="name" formControlName="username">\n\n <ion-label fixed>Password</ion-label>\n <input type="text" name="name" formControlName="password">\n\n <input type="submit" class="cta-btn filled" value="Submit" [disabled]="!loginForm.valid">\n </form>\n\n\n\n\n\n <!-- Toggle menu button -->\n <!-- <br> -->\n <!-- <button ion-button secondary menuToggle>Toggle Menu</button> -->\n \n</ion-content>\n'/*ion-inline-end:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/pages/home/home.html"*/
|
414
|
285
|
}),
|
415
|
|
- __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* NavController */], __WEBPACK_IMPORTED_MODULE_3__angular_forms__["a" /* FormBuilder */], __WEBPACK_IMPORTED_MODULE_4__providers_user_user__["a" /* UserProvider */]])
|
|
286
|
+ __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* NavController */],
|
|
287
|
+ __WEBPACK_IMPORTED_MODULE_3__angular_forms__["a" /* FormBuilder */],
|
|
288
|
+ __WEBPACK_IMPORTED_MODULE_4__providers_user_user__["a" /* UserProvider */],
|
|
289
|
+ __WEBPACK_IMPORTED_MODULE_6__providers_channel_channel__["a" /* ChannelProvider */]])
|
416
|
290
|
], HomePage);
|
417
|
291
|
return HomePage;
|
418
|
292
|
}());
|
|
@@ -466,7 +340,7 @@ var ListPage = /** @class */ (function () {
|
466
|
340
|
};
|
467
|
341
|
ListPage = ListPage_1 = __decorate([
|
468
|
342
|
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
|
469
|
|
- selector: 'page-list',template:/*ion-inline-start:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/list/list.html"*/'<ion-header>\n <ion-navbar>\n <button ion-button menuToggle>\n <ion-icon name="menu"></ion-icon>\n </button>\n <ion-title>List</ion-title>\n </ion-navbar>\n</ion-header>\n\n<ion-content>\n <ion-list>\n <button ion-item *ngFor="let item of items" (click)="itemTapped($event, item)">\n <ion-icon [name]="item.icon" item-start></ion-icon>\n {{item.title}}\n <div class="item-note" item-end>\n {{item.note}}\n </div>\n </button>\n </ion-list>\n <div *ngIf="selectedItem" padding>\n You navigated here from <b>{{selectedItem.title}}</b>\n </div>\n</ion-content>\n'/*ion-inline-end:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/list/list.html"*/
|
|
343
|
+ selector: 'page-list',template:/*ion-inline-start:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/pages/list/list.html"*/'<ion-header>\n <ion-navbar>\n <button ion-button menuToggle>\n <ion-icon name="menu"></ion-icon>\n </button>\n <ion-title>List</ion-title>\n </ion-navbar>\n</ion-header>\n\n<ion-content>\n <ion-list>\n <button ion-item *ngFor="let item of items" (click)="itemTapped($event, item)">\n <ion-icon [name]="item.icon" item-start></ion-icon>\n {{item.title}}\n <div class="item-note" item-end>\n {{item.note}}\n </div>\n </button>\n </ion-list>\n <div *ngIf="selectedItem" padding>\n You navigated here from <b>{{selectedItem.title}}</b>\n </div>\n</ion-content>\n'/*ion-inline-end:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/pages/list/list.html"*/
|
470
|
344
|
}),
|
471
|
345
|
__metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* NavParams */]])
|
472
|
346
|
], ListPage);
|
|
@@ -503,18 +377,18 @@ Object(__WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__["a" /* pl
|
503
|
377
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__app_component__ = __webpack_require__(270);
|
504
|
378
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pages_home_home__ = __webpack_require__(205);
|
505
|
379
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__pages_list_list__ = __webpack_require__(206);
|
506
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pages_channel_channel__ = __webpack_require__(52);
|
|
380
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pages_channel_channel__ = __webpack_require__(54);
|
507
|
381
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__ionic_native_status_bar__ = __webpack_require__(201);
|
508
|
382
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ionic_native_splash_screen__ = __webpack_require__(204);
|
509
|
383
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__providers_user_user__ = __webpack_require__(47);
|
510
|
384
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__angular_common_http__ = __webpack_require__(278);
|
511
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__angular_http__ = __webpack_require__(46);
|
512
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__providers_message_message__ = __webpack_require__(160);
|
513
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__providers_channel_channel__ = __webpack_require__(161);
|
514
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__providers_url_url__ = __webpack_require__(80);
|
515
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__pages_register_register__ = __webpack_require__(105);
|
516
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__pages_create_channel_create_channel__ = __webpack_require__(104);
|
517
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__pages_all_channels_all_channels__ = __webpack_require__(103);
|
|
385
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__angular_http__ = __webpack_require__(48);
|
|
386
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__providers_message_message__ = __webpack_require__(82);
|
|
387
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__providers_channel_channel__ = __webpack_require__(30);
|
|
388
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__providers_url_url__ = __webpack_require__(49);
|
|
389
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__pages_register_register__ = __webpack_require__(107);
|
|
390
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__pages_create_channel_create_channel__ = __webpack_require__(106);
|
|
391
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__pages_all_channels_all_channels__ = __webpack_require__(105);
|
518
|
392
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
519
|
393
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
520
|
394
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -559,8 +433,8 @@ var AppModule = /** @class */ (function () {
|
559
|
433
|
links: [
|
560
|
434
|
{ loadChildren: '../pages/all-channels/all-channels.module#AllChannelsPageModule', name: 'AllChannelsPage', segment: 'all-channels', priority: 'low', defaultHistory: [] },
|
561
|
435
|
{ loadChildren: '../pages/create-channel/create-channel.module#CreateChannelPageModule', name: 'CreateChannelPage', segment: 'create-channel', priority: 'low', defaultHistory: [] },
|
562
|
|
- { loadChildren: '../pages/channel/channel.module#ChannelPageModule', name: 'ChannelPage', segment: 'channel', priority: 'low', defaultHistory: [] },
|
563
|
|
- { loadChildren: '../pages/register/register.module#RegisterPageModule', name: 'RegisterPage', segment: 'register', priority: 'low', defaultHistory: [] }
|
|
436
|
+ { loadChildren: '../pages/register/register.module#RegisterPageModule', name: 'RegisterPage', segment: 'register', priority: 'low', defaultHistory: [] },
|
|
437
|
+ { loadChildren: '../pages/channel/channel.module#ChannelPageModule', name: 'ChannelPage', segment: 'channel', priority: 'low', defaultHistory: [] }
|
564
|
438
|
]
|
565
|
439
|
}),
|
566
|
440
|
__WEBPACK_IMPORTED_MODULE_10__angular_common_http__["a" /* HttpClientModule */],
|
|
@@ -605,9 +479,11 @@ var AppModule = /** @class */ (function () {
|
605
|
479
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_native_splash_screen__ = __webpack_require__(204);
|
606
|
480
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__pages_home_home__ = __webpack_require__(205);
|
607
|
481
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__pages_list_list__ = __webpack_require__(206);
|
608
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pages_channel_channel__ = __webpack_require__(52);
|
609
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__pages_create_channel_create_channel__ = __webpack_require__(104);
|
610
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__pages_all_channels_all_channels__ = __webpack_require__(103);
|
|
482
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pages_channel_channel__ = __webpack_require__(54);
|
|
483
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__pages_create_channel_create_channel__ = __webpack_require__(106);
|
|
484
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__pages_all_channels_all_channels__ = __webpack_require__(105);
|
|
485
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__providers_channel_channel__ = __webpack_require__(30);
|
|
486
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__providers_message_message__ = __webpack_require__(82);
|
611
|
487
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
612
|
488
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
613
|
489
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -626,11 +502,15 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
626
|
502
|
|
627
|
503
|
|
628
|
504
|
|
|
505
|
+
|
|
506
|
+
|
629
|
507
|
var MyApp = /** @class */ (function () {
|
630
|
|
- function MyApp(platform, statusBar, splashScreen) {
|
|
508
|
+ function MyApp(platform, statusBar, splashScreen, channelProvider, messageProvider) {
|
631
|
509
|
this.platform = platform;
|
632
|
510
|
this.statusBar = statusBar;
|
633
|
511
|
this.splashScreen = splashScreen;
|
|
512
|
+ this.channelProvider = channelProvider;
|
|
513
|
+ this.messageProvider = messageProvider;
|
634
|
514
|
this.rootPage = __WEBPACK_IMPORTED_MODULE_4__pages_home_home__["a" /* HomePage */];
|
635
|
515
|
this.initializeApp();
|
636
|
516
|
// used for an example of ngFor and navigation
|
|
@@ -648,6 +528,13 @@ var MyApp = /** @class */ (function () {
|
648
|
528
|
_this.statusBar.styleDefault();
|
649
|
529
|
_this.splashScreen.hide();
|
650
|
530
|
});
|
|
531
|
+ this.channelProvider.userChannels;
|
|
532
|
+ };
|
|
533
|
+ MyApp.prototype.setChannel = function (channel) {
|
|
534
|
+ this.channelProvider.channel = channel;
|
|
535
|
+ console.log(this.channelProvider.channel);
|
|
536
|
+ this.messageProvider.get(function (result) {
|
|
537
|
+ });
|
651
|
538
|
};
|
652
|
539
|
MyApp.prototype.openPage = function (page) {
|
653
|
540
|
// Reset the content nav to have just this page
|
|
@@ -671,9 +558,13 @@ var MyApp = /** @class */ (function () {
|
671
|
558
|
__metadata("design:type", __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* Nav */])
|
672
|
559
|
], MyApp.prototype, "nav", void 0);
|
673
|
560
|
MyApp = __decorate([
|
674
|
|
- Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({template:/*ion-inline-start:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/app/app.html"*/'<ion-menu [content]="content">\n\n <ion-header>\n <ion-toolbar>\n <ion-title>Zip-Slack</ion-title>\n </ion-toolbar>\n </ion-header>\n\n <ion-content>\n <ion-list>\n\n \n\n <button menuClose ion-item *ngFor="" (click)="openPage(p)">\n \n </button>\n\n \n\n <ion-list-header>\n <h2>Channels</h2>\n </ion-list-header>\n\n <!-- <ion-item (click)="openPage(ChannelPage)">General Channel</ion-item> -->\n <ion-item menuClose (click)="openChannelPage()">General Channel</ion-item>\n\n <button menuClose ion-button color="light" type="button"(click)="openCreateChannelPage()" round>+ New Channel</button>\n \n\n <!-- View All Channels button -->\n <button menuClose ion-button color="light" type="button"(click)="openAllChannelsPage()" round>\n <div><ion-icon name="eye" style="padding-right: 5px;"></ion-icon> </div> \n View All Channels\n </button>\n\n\n <ion-list-header>\n Direct messages\n </ion-list-header>\n\n <ion-item (click)="openPage(ChannelPage)">nmaidanos</ion-item>\n <ion-item (click)="openPage(ChannelPage)">Small_Wrld</ion-item>\n\n <button ion-button color="light" type="button" (click)="openPage(Channel)">+ New Direct Message</button>\n \n\n\n\n <ion-footer text-center>\n\n <button menuClose ion-button color="danger" type="submit" (click)="backToLoginPage()" round>Logout</button>\n\n </ion-footer>\n\n\n\n \n </ion-list>\n\n\n\n\n\n\n </ion-content>\n\n</ion-menu>\n\n<!-- Disable swipe-to-go-back because it\'s poor UX to combine STGB with side menus -->\n<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>\n'/*ion-inline-end:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/app/app.html"*/
|
|
561
|
+ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({template:/*ion-inline-start:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/app/app.html"*/'<ion-menu [content]="content">\n\n <ion-header>\n <ion-toolbar>\n <ion-title>Zip-Slack</ion-title>\n </ion-toolbar>\n </ion-header>\n\n <ion-content>\n <ion-list>\n\n \n\n <button menuClose ion-item *ngFor="" (click)="openPage(p)">\n \n </button>\n\n \n\n <ion-list-header>\n <h2>Channels</h2>\n </ion-list-header>\n\n <!-- <ion-item (click)="openPage(ChannelPage)">General Channel</ion-item> -->\n <ion-item menuClose *ngFor="let channel of this.channelProvider.userChannels" (click)="setChannel(channel)">\n {{ channel.name }}\n </ion-item>\n\n <button menuClose ion-button color="light" type="button"(click)="openCreateChannelPage()" round>+ New Channel</button>\n \n\n <!-- View All Channels button -->\n <button menuClose ion-button color="light" type="button"(click)="openAllChannelsPage()" round>\n <div><ion-icon name="eye" style="padding-right: 5px;"></ion-icon> </div> \n View All Channels\n </button>\n\n<!-- \n <ion-list-header>\n Direct messages\n </ion-list-header>\n\n <ion-item (click)="openPage(ChannelPage)">nmaidanos</ion-item>\n <ion-item (click)="openPage(ChannelPage)">Small_Wrld</ion-item>\n\n <button ion-button color="light" type="button" (click)="openPage(Channel)">+ New Direct Message</button>\n -->\n\n\n\n <ion-footer text-center>\n\n <button menuClose ion-button color="danger" type="submit" (click)="backToLoginPage()" round>Logout</button>\n\n </ion-footer>\n\n\n\n \n </ion-list>\n\n\n\n\n\n\n </ion-content>\n\n</ion-menu>\n\n<!-- Disable swipe-to-go-back because it\'s poor UX to combine STGB with side menus -->\n<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>\n'/*ion-inline-end:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/app/app.html"*/
|
675
|
562
|
}),
|
676
|
|
- __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["i" /* Platform */], __WEBPACK_IMPORTED_MODULE_2__ionic_native_status_bar__["a" /* StatusBar */], __WEBPACK_IMPORTED_MODULE_3__ionic_native_splash_screen__["a" /* SplashScreen */]])
|
|
563
|
+ __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["i" /* Platform */],
|
|
564
|
+ __WEBPACK_IMPORTED_MODULE_2__ionic_native_status_bar__["a" /* StatusBar */],
|
|
565
|
+ __WEBPACK_IMPORTED_MODULE_3__ionic_native_splash_screen__["a" /* SplashScreen */],
|
|
566
|
+ __WEBPACK_IMPORTED_MODULE_9__providers_channel_channel__["a" /* ChannelProvider */],
|
|
567
|
+ __WEBPACK_IMPORTED_MODULE_10__providers_message_message__["a" /* MessageProvider */]])
|
677
|
568
|
], MyApp);
|
678
|
569
|
return MyApp;
|
679
|
570
|
}());
|
|
@@ -682,14 +573,150 @@ var MyApp = /** @class */ (function () {
|
682
|
573
|
|
683
|
574
|
/***/ }),
|
684
|
575
|
|
|
576
|
+/***/ 30:
|
|
577
|
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
578
|
+
|
|
579
|
+"use strict";
|
|
580
|
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ChannelProvider; });
|
|
581
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
|
582
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__user_user__ = __webpack_require__(47);
|
|
583
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__ = __webpack_require__(48);
|
|
584
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__url_url__ = __webpack_require__(49);
|
|
585
|
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
586
|
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
587
|
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
588
|
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
589
|
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
590
|
+};
|
|
591
|
+var __metadata = (this && this.__metadata) || function (k, v) {
|
|
592
|
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
593
|
+};
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+/*
|
|
599
|
+ Generated class for the ChannelProvider provider.
|
|
600
|
+
|
|
601
|
+ See https://angular.io/guide/dependency-injection for more info on providers
|
|
602
|
+ and Angular DI.
|
|
603
|
+*/
|
|
604
|
+var ChannelProvider = /** @class */ (function () {
|
|
605
|
+ function ChannelProvider(http, userProvider, urlProvider) {
|
|
606
|
+ this.http = http;
|
|
607
|
+ this.userProvider = userProvider;
|
|
608
|
+ this.urlProvider = urlProvider;
|
|
609
|
+ this.channel = { "id": 1 };
|
|
610
|
+ this.userChannels = [];
|
|
611
|
+ this.allChannels = [];
|
|
612
|
+ //console.log('Hello ChannelProvider Provider');
|
|
613
|
+ }
|
|
614
|
+ /////////////////////////////////////
|
|
615
|
+ ChannelProvider.prototype.getUserChannels = function () {
|
|
616
|
+ return this.userChannels;
|
|
617
|
+ };
|
|
618
|
+ ChannelProvider.prototype.setUserChannels = function (userChannels) {
|
|
619
|
+ this.userChannels = userChannels;
|
|
620
|
+ };
|
|
621
|
+ ChannelProvider.prototype.getAllChannels = function () {
|
|
622
|
+ return this.allChannels;
|
|
623
|
+ };
|
|
624
|
+ ChannelProvider.prototype.setAllChannels = function (allChannels) {
|
|
625
|
+ this.allChannels = allChannels;
|
|
626
|
+ };
|
|
627
|
+ ///////////////////////////////////
|
|
628
|
+ ChannelProvider.prototype.create = function (name, callback) {
|
|
629
|
+ var _this = this;
|
|
630
|
+ var url = this.urlProvider.getBaseUrl() + "/post_channel";
|
|
631
|
+ var header = new __WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__["a" /* Headers */]({
|
|
632
|
+ 'Authorization': this.userProvider.getToken(),
|
|
633
|
+ 'Content-Type': 'application/json'
|
|
634
|
+ });
|
|
635
|
+ var options = new __WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__["d" /* RequestOptions */]({ headers: header });
|
|
636
|
+ var body = {
|
|
637
|
+ "purpose": "test",
|
|
638
|
+ "private": true,
|
|
639
|
+ "name": name,
|
|
640
|
+ };
|
|
641
|
+ this.http.post(url, body, options).subscribe(function (result) {
|
|
642
|
+ console.log(result);
|
|
643
|
+ _this.fetch();
|
|
644
|
+ callback(result);
|
|
645
|
+ });
|
|
646
|
+ };
|
|
647
|
+ ChannelProvider.prototype.fetch = function () {
|
|
648
|
+ var _this = this;
|
|
649
|
+ this.fetchUserChannels(function (userChannels) {
|
|
650
|
+ _this.userChannels = userChannels;
|
|
651
|
+ _this.fetchAllChannels(function (allChannels) {
|
|
652
|
+ _this.allChannels = allChannels;
|
|
653
|
+ console.log(allChannels);
|
|
654
|
+ console.log(userChannels);
|
|
655
|
+ });
|
|
656
|
+ });
|
|
657
|
+ };
|
|
658
|
+ ChannelProvider.prototype.fetchUserChannels = function (callback) {
|
|
659
|
+ var url = this.urlProvider.getBaseUrl() + "/user_channels";
|
|
660
|
+ var header = new __WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__["a" /* Headers */]({
|
|
661
|
+ 'Authorization': this.userProvider.getToken(),
|
|
662
|
+ 'Content-Type': 'application/json'
|
|
663
|
+ });
|
|
664
|
+ var options = new __WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__["d" /* RequestOptions */]({ headers: header });
|
|
665
|
+ this.http.get(url, options).subscribe(function (result) {
|
|
666
|
+ //console.log(result);
|
|
667
|
+ callback(result.json());
|
|
668
|
+ });
|
|
669
|
+ };
|
|
670
|
+ ChannelProvider.prototype.fetchAllChannels = function (callback) {
|
|
671
|
+ var url = this.urlProvider.getBaseUrl() + "/get_channels";
|
|
672
|
+ var header = new __WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__["a" /* Headers */]({
|
|
673
|
+ 'Authorization': this.userProvider.getToken(),
|
|
674
|
+ 'Content-Type': 'application/json'
|
|
675
|
+ });
|
|
676
|
+ var options = new __WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__["d" /* RequestOptions */]({ headers: header });
|
|
677
|
+ this.http.get(url, options).subscribe(function (result) {
|
|
678
|
+ //console.log(result);
|
|
679
|
+ callback(result.json());
|
|
680
|
+ });
|
|
681
|
+ };
|
|
682
|
+ ChannelProvider.prototype.join = function (channel, callback) {
|
|
683
|
+ var _this = this;
|
|
684
|
+ var url = this.urlProvider.getBaseUrl() + "/add_user";
|
|
685
|
+ var header = new __WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__["a" /* Headers */]({
|
|
686
|
+ 'Authorization': this.userProvider.getToken(),
|
|
687
|
+ 'Content-Type': 'application/json'
|
|
688
|
+ });
|
|
689
|
+ var options = new __WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__["d" /* RequestOptions */]({ headers: header });
|
|
690
|
+ var body = {
|
|
691
|
+ "id": channel.id,
|
|
692
|
+ };
|
|
693
|
+ this.http.post(url, body, options).subscribe(function (result) {
|
|
694
|
+ console.log(result);
|
|
695
|
+ _this.fetch();
|
|
696
|
+ callback(result);
|
|
697
|
+ });
|
|
698
|
+ };
|
|
699
|
+ ChannelProvider = __decorate([
|
|
700
|
+ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */])(),
|
|
701
|
+ __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__["b" /* Http */],
|
|
702
|
+ __WEBPACK_IMPORTED_MODULE_1__user_user__["a" /* UserProvider */],
|
|
703
|
+ __WEBPACK_IMPORTED_MODULE_3__url_url__["a" /* UrlProvider */]])
|
|
704
|
+ ], ChannelProvider);
|
|
705
|
+ return ChannelProvider;
|
|
706
|
+}());
|
|
707
|
+
|
|
708
|
+//# sourceMappingURL=channel.js.map
|
|
709
|
+
|
|
710
|
+/***/ }),
|
|
711
|
+
|
685
|
712
|
/***/ 47:
|
686
|
713
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
687
|
714
|
|
688
|
715
|
"use strict";
|
689
|
716
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return UserProvider; });
|
690
|
717
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
691
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_http__ = __webpack_require__(46);
|
692
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__url_url__ = __webpack_require__(80);
|
|
718
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_http__ = __webpack_require__(48);
|
|
719
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__url_url__ = __webpack_require__(49);
|
693
|
720
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
694
|
721
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
695
|
722
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -743,15 +770,58 @@ var UserProvider = /** @class */ (function () {
|
743
|
770
|
|
744
|
771
|
/***/ }),
|
745
|
772
|
|
746
|
|
-/***/ 52:
|
|
773
|
+/***/ 49:
|
|
774
|
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
775
|
+
|
|
776
|
+"use strict";
|
|
777
|
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return UrlProvider; });
|
|
778
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
|
779
|
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
780
|
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
781
|
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
782
|
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
783
|
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
784
|
+};
|
|
785
|
+
|
|
786
|
+/*
|
|
787
|
+ Generated class for the UrlProvider provider.
|
|
788
|
+
|
|
789
|
+ See https://angular.io/guide/dependency-injection for more info on providers
|
|
790
|
+ and Angular DI.
|
|
791
|
+*/
|
|
792
|
+var UrlProvider = /** @class */ (function () {
|
|
793
|
+ function UrlProvider() {
|
|
794
|
+ // constructor(public http: HttpClient) {
|
|
795
|
+ // console.log('Hello UrlProvider Provider');
|
|
796
|
+ // }
|
|
797
|
+ this.baseUrl = "http://localhost:8080";
|
|
798
|
+ }
|
|
799
|
+ //private baseUrl = "https://zipteampurple.herokuapp.com";
|
|
800
|
+ UrlProvider.prototype.setBaseUrl = function (baseUrl) {
|
|
801
|
+ this.baseUrl = baseUrl;
|
|
802
|
+ };
|
|
803
|
+ UrlProvider.prototype.getBaseUrl = function () {
|
|
804
|
+ return this.baseUrl;
|
|
805
|
+ };
|
|
806
|
+ UrlProvider = __decorate([
|
|
807
|
+ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */])()
|
|
808
|
+ ], UrlProvider);
|
|
809
|
+ return UrlProvider;
|
|
810
|
+}());
|
|
811
|
+
|
|
812
|
+//# sourceMappingURL=url.js.map
|
|
813
|
+
|
|
814
|
+/***/ }),
|
|
815
|
+
|
|
816
|
+/***/ 54:
|
747
|
817
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
748
|
818
|
|
749
|
819
|
"use strict";
|
750
|
820
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ChannelPage; });
|
751
|
821
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
752
|
822
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(20);
|
753
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__providers_message_message__ = __webpack_require__(160);
|
754
|
|
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__providers_channel_channel__ = __webpack_require__(161);
|
|
823
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__providers_message_message__ = __webpack_require__(82);
|
|
824
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__providers_channel_channel__ = __webpack_require__(30);
|
755
|
825
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
756
|
826
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
757
|
827
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -779,10 +849,11 @@ var ChannelPage = /** @class */ (function () {
|
779
|
849
|
this.messageProvider = messageProvider;
|
780
|
850
|
this.channelProvider = channelProvider;
|
781
|
851
|
this.messages = [];
|
782
|
|
- this.channels = [];
|
783
|
852
|
this.currentChannel = { "id": 1 };
|
784
|
|
- this.getMessages();
|
785
|
|
- this.getChannels();
|
|
853
|
+ //this.getMessages();
|
|
854
|
+ this.messageProvider.get(function (result) {
|
|
855
|
+ });
|
|
856
|
+ //this.getChannels();
|
786
|
857
|
}
|
787
|
858
|
ChannelPage.prototype.setCurrentChannel = function (currentChannel) {
|
788
|
859
|
this.currentChannel = currentChannel;
|
|
@@ -792,34 +863,33 @@ var ChannelPage = /** @class */ (function () {
|
792
|
863
|
};
|
793
|
864
|
ChannelPage.prototype.ionViewDidLoad = function () {
|
794
|
865
|
console.log('ionViewDidLoad ChannelPage');
|
795
|
|
- this.start();
|
|
866
|
+ //this.start();
|
796
|
867
|
};
|
797
|
868
|
ChannelPage.prototype.start = function () {
|
798
|
869
|
var _this = this;
|
799
|
870
|
this.timerToken = setInterval(function () { return _this.runningLoopOfMessages(_this.channelProvider); }, 5000);
|
800
|
871
|
};
|
801
|
872
|
ChannelPage.prototype.getMessages = function () {
|
802
|
|
- var _this = this;
|
803
|
|
- this.messageProvider.get(1, function (after) {
|
804
|
|
- _this.messages = after.json();
|
|
873
|
+ this.messageProvider.get(function (result) {
|
805
|
874
|
});
|
806
|
875
|
};
|
807
|
|
- ChannelPage.prototype.getChannels = function () {
|
808
|
|
- var _this = this;
|
809
|
|
- this.timerToken = setInterval(this.channelProvider.get(function (channels) {
|
810
|
|
- _this.channels = channels;
|
811
|
|
- }), 5000);
|
812
|
|
- };
|
|
876
|
+ // getChannels(){
|
|
877
|
+ // this.timerToken = setInterval(this.channelProvider.getuser(channels => {
|
|
878
|
+ // this.channels = channels;
|
|
879
|
+ // }), 5000);
|
|
880
|
+ // }
|
813
|
881
|
ChannelPage.prototype.runningLoopOfMessages = function (channelProvider) {
|
814
|
882
|
var _this = this;
|
815
|
|
- this.messageProvider.get(1, function (after) {
|
|
883
|
+ this.messageProvider.get(function (after) {
|
816
|
884
|
_this.messages = after.json();
|
817
|
885
|
});
|
818
|
886
|
};
|
819
|
887
|
ChannelPage.prototype.deleteMessage = function (messageId) {
|
820
|
888
|
var _this = this;
|
821
|
889
|
this.messageProvider.delete(messageId, function (after) {
|
822
|
|
- _this.getMessages();
|
|
890
|
+ _this.messageProvider.get(function (callback) {
|
|
891
|
+ console.log(callback);
|
|
892
|
+ });
|
823
|
893
|
});
|
824
|
894
|
};
|
825
|
895
|
// sendMessage(){
|
|
@@ -857,67 +927,129 @@ var ChannelPage = /** @class */ (function () {
|
857
|
927
|
var _this = this;
|
858
|
928
|
if (!this.message.trim())
|
859
|
929
|
return;
|
860
|
|
- this.messageProvider.post(1, this.message, function (after) {
|
|
930
|
+ this.messageProvider.post(this.channelProvider.channel.id, this.message, function (after) {
|
861
|
931
|
_this.message = '';
|
862
|
932
|
_this.getMessages();
|
863
|
933
|
});
|
864
|
934
|
};
|
865
|
935
|
ChannelPage = __decorate([
|
866
|
936
|
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
|
867
|
|
- selector: 'page-channel',template:/*ion-inline-start:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/channel/channel.html"*/'\n\n\n<!-- <ion-buttons start>\n\n <button ion-button icon-only menuToggle>\n\n <ion-icon name="menu"></ion-icon>\n\n </button>\n\n</ion-buttons> -->\n\n<ion-header>\n\n <ion-navbar>\n <ion-title>Channel</ion-title>\n\n <ion-buttons start>\n\n <button ion-button icon-only menuToggle>\n <ion-icon name="menu"></ion-icon>\n </button>\n <!-- <button ion-button (click)="sendMessage()">\n <ion-icon name="add"></ion-icon>\n </button> -->\n <button ion-button (click)="getMessages()">\n <ion-icon name="refresh"></ion-icon>\n </button>\n \n </ion-buttons>\n </ion-navbar>\n\n</ion-header>\n\n\n\n<ion-content padding>\n\n\n <!-- <ion-list padding>\n <h1>Channels</h1>\n <ion-item-sliding *ngFor="let channel of channels">\n <ion-item>{{channel.name}}</ion-item>\n\n <ion-item-options side="right">\n <button ion-button>\n <ion-icon name="settings"></ion-icon>\n </button>\n <button color="danger" ion-button (click)="deleteMessage(message.id)">\n <ion-icon name="trash"></ion-icon>\n </button>\n \n </ion-item-options>\n </ion-item-sliding>\n\n <button>Create new Channel</button>\n \n <ion-item>Todo 2</ion-item>\n <ion-item>Todo 3</ion-item>\n </ion-list> -->\n\n <ion-list padding>\n <ion-item-sliding *ngFor="let message of messages">\n <ion-item>{{message.user.username}} - {{message.message}}</ion-item>\n \n <ion-item-options side="right">\n <button ion-button>\n <ion-icon name="settings"></ion-icon>\n </button>\n <button color="danger" ion-button (click)="deleteMessage(message.id)">\n <ion-icon name="trash"></ion-icon>\n </button>\n \n </ion-item-options>\n </ion-item-sliding>\n\n\n\n\n\n\n <ion-footer>\n\n <ion-item >\n\n <ion-input #chat_input\n type="text"\n placeholder="Text Input"\n [(ngModel)]="message"\n (keyup.enter)="sendMessage()"\n >\n\n </ion-input>\n\n </ion-item>\n\n\n\n <!-- <textarea #chat_input\n placeholder="Text Input"\n [(ngModel)]="message"\n (keyup.enter)="sendMessage()"\n >\n </textarea> -->\n \n\n\n <!-- Do we need to keep this button?\n <button ion-button clear icon-only item-right (click)="sendMessage()">\n <ion-icon name="ios-send" ios="ios-send" md="md-send"></ion-icon>\n </button> -->\n \n </ion-footer>\n\n\n\n\n </ion-list>\n\n\n \n \n </ion-content>\n\n\n'/*ion-inline-end:"/Users/jaehoonp/ZipTeamPurple-FrontEnd/src/pages/channel/channel.html"*/,
|
|
937
|
+ selector: 'page-channel',template:/*ion-inline-start:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/pages/channel/channel.html"*/'\n\n\n<!-- <ion-buttons start>\n\n <button ion-button icon-only menuToggle>\n\n <ion-icon name="menu"></ion-icon>\n\n </button>\n\n</ion-buttons> -->\n\n<ion-header>\n\n <ion-navbar>\n <ion-title>Channel</ion-title>\n\n <ion-buttons start>\n\n <button ion-button icon-only menuToggle>\n <ion-icon name="menu"></ion-icon>\n </button>\n <!-- <button ion-button (click)="sendMessage()">\n <ion-icon name="add"></ion-icon>\n </button> -->\n <button ion-button (click)="getMessages()">\n <ion-icon name="refresh"></ion-icon>\n </button>\n \n </ion-buttons>\n </ion-navbar>\n\n</ion-header>\n\n\n\n<ion-content padding>\n\n\n <!-- <ion-list padding>\n <h1>Channels</h1>\n <ion-item-sliding *ngFor="let channel of channels">\n <ion-item>{{channel.name}}</ion-item>\n\n <ion-item-options side="right">\n <button ion-button>\n <ion-icon name="settings"></ion-icon>\n </button>\n <button color="danger" ion-button (click)="deleteMessage(message.id)">\n <ion-icon name="trash"></ion-icon>\n </button>\n \n </ion-item-options>\n </ion-item-sliding>\n\n <button>Create new Channel</button>\n \n <ion-item>Todo 2</ion-item>\n <ion-item>Todo 3</ion-item>\n </ion-list> -->\n\n <ion-list padding>\n <ion-item-sliding *ngFor="let message of this.messageProvider.messages">\n <ion-item>{{message.user.username}} - {{message.message}}</ion-item>\n \n <ion-item-options side="right">\n <button ion-button>\n <ion-icon name="settings"></ion-icon>\n </button>\n <button color="danger" ion-button (click)="deleteMessage(message.id)">\n <ion-icon name="trash"></ion-icon>\n </button>\n \n </ion-item-options>\n </ion-item-sliding>\n\n\n\n\n\n\n <ion-footer>\n\n <ion-item >\n\n <ion-input #chat_input\n type="text"\n placeholder="Text Input"\n [(ngModel)]="message"\n (keyup.enter)="sendMessage()"\n >\n\n </ion-input>\n\n </ion-item>\n\n\n\n <!-- <textarea #chat_input\n placeholder="Text Input"\n [(ngModel)]="message"\n (keyup.enter)="sendMessage()"\n >\n </textarea> -->\n \n\n\n <!-- Do we need to keep this button?\n <button ion-button clear icon-only item-right (click)="sendMessage()">\n <ion-icon name="ios-send" ios="ios-send" md="md-send"></ion-icon>\n </button> -->\n \n </ion-footer>\n\n\n\n\n </ion-list>\n\n\n \n \n </ion-content>\n\n\n'/*ion-inline-end:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/pages/channel/channel.html"*/,
|
868
|
938
|
}),
|
869
|
|
- __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* NavController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* NavParams */],
|
870
|
|
- __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["a" /* AlertController */],
|
871
|
|
- __WEBPACK_IMPORTED_MODULE_2__providers_message_message__["a" /* MessageProvider */],
|
872
|
|
- __WEBPACK_IMPORTED_MODULE_3__providers_channel_channel__["a" /* ChannelProvider */]])
|
|
939
|
+ __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* NavController */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["g" /* NavController */]) === "function" && _a || Object, typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* NavParams */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* NavParams */]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["a" /* AlertController */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["a" /* AlertController */]) === "function" && _c || Object, typeof (_d = typeof __WEBPACK_IMPORTED_MODULE_2__providers_message_message__["a" /* MessageProvider */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__providers_message_message__["a" /* MessageProvider */]) === "function" && _d || Object, typeof (_e = typeof __WEBPACK_IMPORTED_MODULE_3__providers_channel_channel__["a" /* ChannelProvider */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__providers_channel_channel__["a" /* ChannelProvider */]) === "function" && _e || Object])
|
873
|
940
|
], ChannelPage);
|
874
|
941
|
return ChannelPage;
|
|
942
|
+ var _a, _b, _c, _d, _e;
|
875
|
943
|
}());
|
876
|
944
|
|
877
|
945
|
//# sourceMappingURL=channel.js.map
|
878
|
946
|
|
879
|
947
|
/***/ }),
|
880
|
948
|
|
881
|
|
-/***/ 80:
|
|
949
|
+/***/ 82:
|
882
|
950
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
883
|
951
|
|
884
|
952
|
"use strict";
|
885
|
|
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return UrlProvider; });
|
|
953
|
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MessageProvider; });
|
886
|
954
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
|
|
955
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_http__ = __webpack_require__(48);
|
|
956
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__user_user__ = __webpack_require__(47);
|
|
957
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__url_url__ = __webpack_require__(49);
|
|
958
|
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__channel_channel__ = __webpack_require__(30);
|
887
|
959
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
888
|
960
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
889
|
961
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
890
|
962
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
891
|
963
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
892
|
964
|
};
|
|
965
|
+var __metadata = (this && this.__metadata) || function (k, v) {
|
|
966
|
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
967
|
+};
|
|
968
|
+
|
|
969
|
+
|
|
970
|
+
|
|
971
|
+
|
893
|
972
|
|
894
|
973
|
/*
|
895
|
|
- Generated class for the UrlProvider provider.
|
|
974
|
+ Generated class for the MessageProvider provider.
|
896
|
975
|
|
897
|
976
|
See https://angular.io/guide/dependency-injection for more info on providers
|
898
|
977
|
and Angular DI.
|
899
|
978
|
*/
|
900
|
|
-var UrlProvider = /** @class */ (function () {
|
901
|
|
- function UrlProvider() {
|
902
|
|
- // constructor(public http: HttpClient) {
|
903
|
|
- // console.log('Hello UrlProvider Provider');
|
904
|
|
- // }
|
905
|
|
- //private baseUrl = "http://localhost:8080";
|
906
|
|
- this.baseUrl = "https://zipteampurple.herokuapp.com";
|
|
979
|
+var MessageProvider = /** @class */ (function () {
|
|
980
|
+ function MessageProvider(http, userProvider, urlProvider, channelProvider) {
|
|
981
|
+ this.http = http;
|
|
982
|
+ this.userProvider = userProvider;
|
|
983
|
+ this.urlProvider = urlProvider;
|
|
984
|
+ this.channelProvider = channelProvider;
|
|
985
|
+ this.messages = [];
|
|
986
|
+ console.log('Hello MessageProvider Provider');
|
907
|
987
|
}
|
908
|
|
- UrlProvider.prototype.setBaseUrl = function (baseUrl) {
|
909
|
|
- this.baseUrl = baseUrl;
|
|
988
|
+ MessageProvider.prototype.getAll = function () {
|
|
989
|
+ var url = this.urlProvider.getBaseUrl() + "/get_messages";
|
|
990
|
+ var header = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["a" /* Headers */]({
|
|
991
|
+ 'Authorization': this.userProvider.getToken()
|
|
992
|
+ });
|
|
993
|
+ var options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["d" /* RequestOptions */]({ headers: header });
|
|
994
|
+ this.http.get(url, options).subscribe(function (result) {
|
|
995
|
+ console.log(result);
|
|
996
|
+ });
|
910
|
997
|
};
|
911
|
|
- UrlProvider.prototype.getBaseUrl = function () {
|
912
|
|
- return this.baseUrl;
|
|
998
|
+ MessageProvider.prototype.post = function (channelId, message, callback) {
|
|
999
|
+ var _this = this;
|
|
1000
|
+ var url = this.urlProvider.getBaseUrl() + "/post";
|
|
1001
|
+ var header = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["a" /* Headers */]({
|
|
1002
|
+ 'Authorization': this.userProvider.getToken(),
|
|
1003
|
+ 'Content-Type': 'application/json'
|
|
1004
|
+ });
|
|
1005
|
+ var options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["d" /* RequestOptions */]({ headers: header });
|
|
1006
|
+ var body = {
|
|
1007
|
+ "channelId": channelId,
|
|
1008
|
+ "message": message
|
|
1009
|
+ };
|
|
1010
|
+ this.http.post(url, body, options).subscribe(function (result) {
|
|
1011
|
+ console.log(result);
|
|
1012
|
+ _this.get(function (after) {
|
|
1013
|
+ callback();
|
|
1014
|
+ });
|
|
1015
|
+ });
|
913
|
1016
|
};
|
914
|
|
- UrlProvider = __decorate([
|
915
|
|
- Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */])()
|
916
|
|
- ], UrlProvider);
|
917
|
|
- return UrlProvider;
|
|
1017
|
+ MessageProvider.prototype.get = function (callback) {
|
|
1018
|
+ var _this = this;
|
|
1019
|
+ var url = this.urlProvider.getBaseUrl() + "/messages?channelId=" + this.channelProvider.channel.id;
|
|
1020
|
+ var header = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["a" /* Headers */]({
|
|
1021
|
+ 'Authorization': this.userProvider.getToken(),
|
|
1022
|
+ 'Content-Type': 'application/json'
|
|
1023
|
+ });
|
|
1024
|
+ console.log(url);
|
|
1025
|
+ var options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["d" /* RequestOptions */]({ headers: header });
|
|
1026
|
+ this.http.get(url, options).subscribe(function (result) {
|
|
1027
|
+ console.log(result);
|
|
1028
|
+ _this.messages = result.json();
|
|
1029
|
+ callback(result);
|
|
1030
|
+ });
|
|
1031
|
+ };
|
|
1032
|
+ MessageProvider.prototype.delete = function (messageId, callback) {
|
|
1033
|
+ var url = this.urlProvider.getBaseUrl() + "/delete?messageId=" + messageId;
|
|
1034
|
+ var header = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["a" /* Headers */]({
|
|
1035
|
+ 'Authorization': this.userProvider.getToken(),
|
|
1036
|
+ 'Content-Type': 'application/json'
|
|
1037
|
+ });
|
|
1038
|
+ var options = new __WEBPACK_IMPORTED_MODULE_1__angular_http__["d" /* RequestOptions */]({ headers: header });
|
|
1039
|
+ this.http.delete(url, options).subscribe(function (result) {
|
|
1040
|
+ console.log(result);
|
|
1041
|
+ callback();
|
|
1042
|
+ });
|
|
1043
|
+ };
|
|
1044
|
+ MessageProvider = __decorate([
|
|
1045
|
+ Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */])(),
|
|
1046
|
+ __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__angular_http__["b" /* Http */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__angular_http__["b" /* Http */]) === "function" && _a || Object, typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_2__user_user__["a" /* UserProvider */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__user_user__["a" /* UserProvider */]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_3__url_url__["a" /* UrlProvider */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__url_url__["a" /* UrlProvider */]) === "function" && _c || Object, typeof (_d = typeof __WEBPACK_IMPORTED_MODULE_4__channel_channel__["a" /* ChannelProvider */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_4__channel_channel__["a" /* ChannelProvider */]) === "function" && _d || Object])
|
|
1047
|
+ ], MessageProvider);
|
|
1048
|
+ return MessageProvider;
|
|
1049
|
+ var _a, _b, _c, _d;
|
918
|
1050
|
}());
|
919
|
1051
|
|
920
|
|
-//# sourceMappingURL=url.js.map
|
|
1052
|
+//# sourceMappingURL=message.js.map
|
921
|
1053
|
|
922
|
1054
|
/***/ })
|
923
|
1055
|
|