|
@@ -240,10 +240,10 @@ var ChannelProvider = /** @class */ (function () {
|
240
|
240
|
};
|
241
|
241
|
ChannelProvider = __decorate([
|
242
|
242
|
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["A" /* Injectable */])(),
|
243
|
|
- __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__["b" /* Http */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__["b" /* Http */]) === "function" && _a || Object, typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_1__user_user__["a" /* UserProvider */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_1__user_user__["a" /* UserProvider */]) === "function" && _b || Object])
|
|
243
|
+ __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2__node_modules_angular_http__["b" /* Http */],
|
|
244
|
+ __WEBPACK_IMPORTED_MODULE_1__user_user__["a" /* UserProvider */]])
|
244
|
245
|
], ChannelProvider);
|
245
|
246
|
return ChannelProvider;
|
246
|
|
- var _a, _b;
|
247
|
247
|
}());
|
248
|
248
|
|
249
|
249
|
//# sourceMappingURL=channel.js.map
|
|
@@ -546,7 +546,7 @@ var MyApp = /** @class */ (function () {
|
546
|
546
|
__metadata("design:type", __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["f" /* Nav */])
|
547
|
547
|
], MyApp.prototype, "nav", void 0);
|
548
|
548
|
MyApp = __decorate([
|
549
|
|
- Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({template:/*ion-inline-start:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/app/app.html"*/'\n\n\n\n\n\n<ion-menu [content]="content">\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 <button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">\n {{p.title}}\n </button>\n </ion-list>\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\n\n\n'/*ion-inline-end:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/app/app.html"*/
|
|
549
|
+ 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 <button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">\n {{p.title}}\n </button>\n </ion-list>\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>'/*ion-inline-end:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/app/app.html"*/
|
550
|
550
|
}),
|
551
|
551
|
__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 */]])
|
552
|
552
|
], MyApp);
|
|
@@ -671,7 +671,7 @@ var ChannelPage = /** @class */ (function () {
|
671
|
671
|
};
|
672
|
672
|
ChannelPage.prototype.start = function () {
|
673
|
673
|
var _this = this;
|
674
|
|
- this.timerToken = setInterval(function () { return _this.runningLoopOfMessages(_this.channelProvider); }, 500);
|
|
674
|
+ this.timerToken = setInterval(function () { return _this.runningLoopOfMessages(_this.channelProvider); }, 5000);
|
675
|
675
|
};
|
676
|
676
|
ChannelPage.prototype.getMessages = function () {
|
677
|
677
|
var _this = this;
|
|
@@ -692,45 +692,54 @@ var ChannelPage = /** @class */ (function () {
|
692
|
692
|
});
|
693
|
693
|
};
|
694
|
694
|
ChannelPage.prototype.deleteMessage = function (messageId) {
|
|
695
|
+ var _this = this;
|
695
|
696
|
this.messageProvider.delete(messageId, function (after) {
|
696
|
|
- //this.getMessages();
|
|
697
|
+ _this.getMessages();
|
697
|
698
|
});
|
698
|
699
|
};
|
|
700
|
+ // sendMessage(){
|
|
701
|
+ // let addTodoAlert = this.alertController.create({
|
|
702
|
+ // title: "Send Message",
|
|
703
|
+ // message: "Enter a message:",
|
|
704
|
+ // inputs: [
|
|
705
|
+ // {
|
|
706
|
+ // type: "text",
|
|
707
|
+ // name: "addTodoInput"
|
|
708
|
+ // }
|
|
709
|
+ // ],
|
|
710
|
+ // buttons: [
|
|
711
|
+ // {
|
|
712
|
+ // text: "Cancel"
|
|
713
|
+ // },
|
|
714
|
+ // {
|
|
715
|
+ // text: "Send",
|
|
716
|
+ // handler: (inputData) => {
|
|
717
|
+ // let todoText;
|
|
718
|
+ // todoText = inputData.addTodoInput;
|
|
719
|
+ // //this.messageProider.getAll();
|
|
720
|
+ // this.messageProvider.post(1, todoText, after => {
|
|
721
|
+ // this.getMessages();
|
|
722
|
+ // });
|
|
723
|
+ // //this.todos.push(todoText);
|
|
724
|
+ // //this.todoProvider.addTodo(todoText);
|
|
725
|
+ // }
|
|
726
|
+ // }
|
|
727
|
+ // ]
|
|
728
|
+ // });
|
|
729
|
+ // addTodoAlert.present();
|
|
730
|
+ // }
|
699
|
731
|
ChannelPage.prototype.sendMessage = function () {
|
700
|
732
|
var _this = this;
|
701
|
|
- var addTodoAlert = this.alertController.create({
|
702
|
|
- title: "Send Message",
|
703
|
|
- message: "Enter a message:",
|
704
|
|
- inputs: [
|
705
|
|
- {
|
706
|
|
- type: "text",
|
707
|
|
- name: "addTodoInput"
|
708
|
|
- }
|
709
|
|
- ],
|
710
|
|
- buttons: [
|
711
|
|
- {
|
712
|
|
- text: "Cancel"
|
713
|
|
- },
|
714
|
|
- {
|
715
|
|
- text: "Send",
|
716
|
|
- handler: function (inputData) {
|
717
|
|
- var todoText;
|
718
|
|
- todoText = inputData.addTodoInput;
|
719
|
|
- //this.messageProider.getAll();
|
720
|
|
- _this.messageProvider.post(1, todoText, function (after) {
|
721
|
|
- _this.getMessages();
|
722
|
|
- });
|
723
|
|
- //this.todos.push(todoText);
|
724
|
|
- //this.todoProvider.addTodo(todoText);
|
725
|
|
- }
|
726
|
|
- }
|
727
|
|
- ]
|
|
733
|
+ if (!this.message.trim())
|
|
734
|
+ return;
|
|
735
|
+ this.messageProvider.post(1, this.message, function (after) {
|
|
736
|
+ _this.message = '';
|
|
737
|
+ _this.getMessages();
|
728
|
738
|
});
|
729
|
|
- addTodoAlert.present();
|
730
|
739
|
};
|
731
|
740
|
ChannelPage = __decorate([
|
732
|
741
|
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
|
733
|
|
- 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 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 <!-- <ion-item>Todo 2</ion-item>\n <ion-item>Todo 3</ion-item> -->\n </ion-list>\n \n </ion-content>\n\n\n'/*ion-inline-end:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/pages/channel/channel.html"*/,
|
|
742
|
+ 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 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 </ion-list>\n\n\n <ion-footer>\n <textarea #chat_input\n placeholder="Text Input"\n [(ngModel)]="message"\n (keyup.enter)="sendMessage()"\n >\n</textarea>\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 </ion-footer>\n \n </ion-content>\n\n\n'/*ion-inline-end:"/Users/nicholasm/Labs/ZipTeamPurple-FrontEnd/src/pages/channel/channel.html"*/,
|
734
|
743
|
}),
|
735
|
744
|
__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])
|
736
|
745
|
], ChannelPage);
|