commit
617ecb041d
|
@ -53,9 +53,9 @@ export class CoreCompileHtmlComponent implements OnChanges, OnDestroy, DoCheck {
|
||||||
@ViewChild('dynamicComponent', { read: ViewContainerRef }) container: ViewContainerRef;
|
@ViewChild('dynamicComponent', { read: ViewContainerRef }) container: ViewContainerRef;
|
||||||
|
|
||||||
loaded: boolean;
|
loaded: boolean;
|
||||||
|
componentInstance: any;
|
||||||
|
|
||||||
protected componentRef: ComponentRef<any>;
|
protected componentRef: ComponentRef<any>;
|
||||||
protected componentInstance: any;
|
|
||||||
protected element;
|
protected element;
|
||||||
protected differ: any; // To detect changes in the jsData input.
|
protected differ: any; // To detect changes in the jsData input.
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<!-- Buttons to add to the header. -->
|
<!-- Buttons to add to the header. -->
|
||||||
<core-navbar-buttons end>
|
<core-navbar-buttons end>
|
||||||
<core-context-menu>
|
<core-context-menu>
|
||||||
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl" [iconAction]="'open'"></core-context-menu-item>
|
<core-context-menu-item [hidden]="!displayOpenInBrowser || !externalUrl || (content && content.compileComponent && content.compileComponent.componentInstance && content.compileComponent.componentInstance.displayOpenInBrowser === false)" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl" [iconAction]="'open'"></core-context-menu-item>
|
||||||
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" (action)="expandDescription()" [iconAction]="'arrow-forward'"></core-context-menu-item>
|
<core-context-menu-item [hidden]="!displayDescription || !description || (content && content.compileComponent && content.compileComponent.componentInstance && content.compileComponent.componentInstance.displayDescription === false)" [priority]="800" [content]="'core.moduleintro' | translate" (action)="expandDescription()" [iconAction]="'arrow-forward'"></core-context-menu-item>
|
||||||
<core-context-menu-item [priority]="700" [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false"></core-context-menu-item>
|
<core-context-menu-item [hidden]="!displayRefresh || (content && content.compileComponent && content.compileComponent.componentInstance && content.compileComponent.componentInstance.displayRefresh === false)" [priority]="700" [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false"></core-context-menu-item>
|
||||||
<core-context-menu-item *ngIf="prefetchStatusIcon" [priority]="600" [content]="prefetchText" (action)="prefetch()" [iconAction]="prefetchStatusIcon" [closeOnClick]="false"></core-context-menu-item>
|
<core-context-menu-item [hidden]="!displayPrefetch || !prefetchStatusIcon || (content && content.compileComponent && content.compileComponent.componentInstance && content.compileComponent.componentInstance.displayPrefetch === false)" [priority]="600" [content]="prefetchText" (action)="prefetch()" [iconAction]="prefetchStatusIcon" [closeOnClick]="false"></core-context-menu-item>
|
||||||
<core-context-menu-item *ngIf="size" [priority]="500" [content]="size" [iconDescription]="'cube'" (action)="removeFiles()" [iconAction]="'trash'"></core-context-menu-item>
|
<core-context-menu-item [hidden]="!displaySize || !size || (content && content.compileComponent && content.compileComponent.componentInstance && content.compileComponent.componentInstance.displaySize === false)" [priority]="500" [content]="size" [iconDescription]="'cube'" (action)="removeFiles()" [iconAction]="'trash'"></core-context-menu-item>
|
||||||
</core-context-menu>
|
</core-context-menu>
|
||||||
</core-navbar-buttons>
|
</core-navbar-buttons>
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
import { Component, OnInit, OnDestroy, Input, ViewChild } from '@angular/core';
|
import { Component, OnInit, OnDestroy, Input, ViewChild } from '@angular/core';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { CoreTextUtilsProvider } from '@providers/utils/text';
|
import { CoreTextUtilsProvider } from '@providers/utils/text';
|
||||||
|
import { CoreUtilsProvider } from '@providers/utils/utils';
|
||||||
import { CoreSitePluginsProvider } from '../../providers/siteplugins';
|
import { CoreSitePluginsProvider } from '../../providers/siteplugins';
|
||||||
import { CoreCourseModuleMainComponent } from '@core/course/providers/module-delegate';
|
import { CoreCourseModuleMainComponent } from '@core/course/providers/module-delegate';
|
||||||
import { CoreCourseModulePrefetchDelegate } from '@core/course/providers/module-prefetch-delegate';
|
import { CoreCourseModulePrefetchDelegate } from '@core/course/providers/module-prefetch-delegate';
|
||||||
|
@ -46,6 +47,12 @@ export class CoreSitePluginsModuleIndexComponent implements OnInit, OnDestroy, C
|
||||||
prefetchStatusIcon: string;
|
prefetchStatusIcon: string;
|
||||||
prefetchText: string;
|
prefetchText: string;
|
||||||
size: string;
|
size: string;
|
||||||
|
displayOpenInBrowser = true;
|
||||||
|
displayDescription = true;
|
||||||
|
displayRefresh = true;
|
||||||
|
displayPrefetch = true;
|
||||||
|
displaySize = true;
|
||||||
|
|
||||||
jsData: any; // Data to pass to the component.
|
jsData: any; // Data to pass to the component.
|
||||||
|
|
||||||
protected isDestroyed = false;
|
protected isDestroyed = false;
|
||||||
|
@ -53,7 +60,7 @@ export class CoreSitePluginsModuleIndexComponent implements OnInit, OnDestroy, C
|
||||||
|
|
||||||
constructor(protected sitePluginsProvider: CoreSitePluginsProvider, protected courseHelper: CoreCourseHelperProvider,
|
constructor(protected sitePluginsProvider: CoreSitePluginsProvider, protected courseHelper: CoreCourseHelperProvider,
|
||||||
protected prefetchDelegate: CoreCourseModulePrefetchDelegate, protected textUtils: CoreTextUtilsProvider,
|
protected prefetchDelegate: CoreCourseModulePrefetchDelegate, protected textUtils: CoreTextUtilsProvider,
|
||||||
protected translate: TranslateService) { }
|
protected translate: TranslateService, protected utils: CoreUtilsProvider) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component being initialized.
|
* Component being initialized.
|
||||||
|
@ -75,6 +82,12 @@ export class CoreSitePluginsModuleIndexComponent implements OnInit, OnDestroy, C
|
||||||
module: this.module,
|
module: this.module,
|
||||||
courseId: this.courseId
|
courseId: this.courseId
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.displayOpenInBrowser = !this.utils.isFalseOrZero(handler.handlerSchema.displayopeninbrowser);
|
||||||
|
this.displayDescription = !this.utils.isFalseOrZero(handler.handlerSchema.displaydescription);
|
||||||
|
this.displayRefresh = !this.utils.isFalseOrZero(handler.handlerSchema.displayrefresh);
|
||||||
|
this.displayPrefetch = !this.utils.isFalseOrZero(handler.handlerSchema.displayprefetch);
|
||||||
|
this.displaySize = !this.utils.isFalseOrZero(handler.handlerSchema.displaysize);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the data for the context menu.
|
// Get the data for the context menu.
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<core-loading [hideUntil]="dataLoaded">
|
<core-loading [hideUntil]="dataLoaded">
|
||||||
<core-compile-html [text]="content" [javascript]="javascript" [jsData]="jsData" [forceCompile]="forceCompile"></core-compile-html>
|
<core-compile-html [text]="content" [javascript]="javascript" [jsData]="jsData" [forceCompile]="forceCompile" #compile></core-compile-html>
|
||||||
</core-loading>
|
</core-loading>
|
||||||
|
|
|
@ -12,7 +12,9 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component, OnInit, Input, Output, EventEmitter, Optional, DoCheck, KeyValueDiffers } from '@angular/core';
|
import {
|
||||||
|
Component, OnInit, Input, Output, EventEmitter, Optional, DoCheck, KeyValueDiffers, ViewChild, ElementRef
|
||||||
|
} from '@angular/core';
|
||||||
import { NavController } from 'ionic-angular';
|
import { NavController } from 'ionic-angular';
|
||||||
import { CoreDomUtilsProvider } from '@providers/utils/dom';
|
import { CoreDomUtilsProvider } from '@providers/utils/dom';
|
||||||
import { CoreSitePluginsProvider } from '../../providers/siteplugins';
|
import { CoreSitePluginsProvider } from '../../providers/siteplugins';
|
||||||
|
@ -26,6 +28,9 @@ import { Subject } from 'rxjs';
|
||||||
templateUrl: 'core-siteplugins-plugin-content.html',
|
templateUrl: 'core-siteplugins-plugin-content.html',
|
||||||
})
|
})
|
||||||
export class CoreSitePluginsPluginContentComponent implements OnInit, DoCheck {
|
export class CoreSitePluginsPluginContentComponent implements OnInit, DoCheck {
|
||||||
|
// Get the compile element. Don't set the right type to prevent circular dependencies.
|
||||||
|
@ViewChild('compile') compileComponent: ElementRef;
|
||||||
|
|
||||||
@Input() component: string;
|
@Input() component: string;
|
||||||
@Input() method: string;
|
@Input() method: string;
|
||||||
@Input() args: any;
|
@Input() args: any;
|
||||||
|
|
Loading…
Reference in New Issue