MOBILE-2336 chat: PR fixes
parent
c0b43405b6
commit
4451fe410b
|
@ -13,10 +13,12 @@
|
|||
// limitations under the License.
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CoreContentLinksDelegate } from '@core/contentlinks/providers/delegate';
|
||||
import { CoreCourseModuleDelegate } from '@core/course/providers/module-delegate';
|
||||
import { AddonModChatComponentsModule } from './components/components.module';
|
||||
import { AddonModChatModuleHandler } from './providers/module-handler';
|
||||
import { AddonModChatProvider } from './providers/chat';
|
||||
import { AddonModChatLinkHandler } from './providers/link-handler';
|
||||
import { AddonModChatModuleHandler } from './providers/module-handler';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
|
@ -26,11 +28,14 @@ import { AddonModChatProvider } from './providers/chat';
|
|||
],
|
||||
providers: [
|
||||
AddonModChatProvider,
|
||||
AddonModChatLinkHandler,
|
||||
AddonModChatModuleHandler,
|
||||
]
|
||||
})
|
||||
export class AddonModChatModule {
|
||||
constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModChatModuleHandler) {
|
||||
constructor(moduleDelegate: CoreCourseModuleDelegate, moduleHandler: AddonModChatModuleHandler,
|
||||
contentLinksDelegate: CoreContentLinksDelegate, linkHandler: AddonModChatLinkHandler) {
|
||||
moduleDelegate.registerHandler(moduleHandler);
|
||||
contentLinksDelegate.registerHandler(linkHandler);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
<core-course-module-description [description]="description" [component]="component" [componentId]="componentId"></core-course-module-description>
|
||||
|
||||
<ion-card class="core-info-card" *ngIf="chatInfo">
|
||||
<ion-icon item-start name="time"></ion-icon> {{ 'addon.mod_chat.sessionstart' | translate:{$a: chatInfo} }}
|
||||
<ion-card icon-start class="core-info-card" *ngIf="chatInfo">
|
||||
<ion-icon name="time"></ion-icon> {{ 'addon.mod_chat.sessionstart' | translate:{$a: chatInfo} }}
|
||||
</ion-card>
|
||||
|
||||
<div padding-horizontal>
|
||||
|
|
|
@ -221,6 +221,9 @@ export class AddonModChatChatPage {
|
|||
|
||||
/**
|
||||
* Send a message to the chat.
|
||||
*
|
||||
* @param {string} text Text of the nessage.
|
||||
* @param {number} [beep=0] ID of the user to beep.
|
||||
*/
|
||||
sendMessage(text: string, beep: number = 0): void {
|
||||
if (!this.isOnline) {
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
// (C) Copyright 2015 Martin Dougiamas
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CoreContentLinksModuleIndexHandler } from '@core/contentlinks/classes/module-index-handler';
|
||||
import { CoreCourseHelperProvider } from '@core/course/providers/helper';
|
||||
|
||||
/**
|
||||
* Handler to treat links to chat.
|
||||
*/
|
||||
@Injectable()
|
||||
export class AddonModChatLinkHandler extends CoreContentLinksModuleIndexHandler {
|
||||
name = 'AddonModChatLinkHandler';
|
||||
|
||||
constructor(courseHelper: CoreCourseHelperProvider) {
|
||||
super(courseHelper, 'AddonModChat', 'chat');
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue