当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript DotMessageService.getMessages方法代码示例

本文整理汇总了TypeScript中@services/dot-messages-service.DotMessageService.getMessages方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DotMessageService.getMessages方法的具体用法?TypeScript DotMessageService.getMessages怎么用?TypeScript DotMessageService.getMessages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@services/dot-messages-service.DotMessageService的用法示例。


在下文中一共展示了DotMessageService.getMessages方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: addContainerToolbar

    /**
     * Add custom HTML buttons to the containers div
     *
     * @param Document doc
     * @memberof DotEditContentToolbarHtmlService
     */
    addContainerToolbar(doc: Document): void {
        this.dotMessageService
            .getMessages([
                'editpage.content.container.action.add',
                'editpage.content.container.menu.content',
                'editpage.content.container.menu.widget',
                'editpage.content.container.menu.form',
                'dot.common.license.enterprise.only.error'
            ])
            .pipe(
                switchMap(this.dotLicenseService.isEnterprise.bind(this.dotLicenseService)),
                take(1)
            )
            .subscribe((isEnterpriseLicense: boolean) => {
                const containers = Array.from(
                    doc.querySelectorAll('div[data-dot-object="container"]')
                );
                containers.forEach((container: HTMLElement) => {
                    const containerToolbar = document.createElement('div');
                    containerToolbar.classList.add('dotedit-container__toolbar');

                    if (!container.dataset.dotCanAdd.length) {
                        container.classList.add('disabled');
                    }

                    containerToolbar.innerHTML = this.getContainerToolbarHtml(
                        container,
                        isEnterpriseLicense
                    );
                    container.parentNode.insertBefore(containerToolbar, container);
                });
            });
    }
开发者ID:dotCMS,项目名称:core-web,代码行数:39,代码来源:dot-edit-content-toolbar-html.service.ts

示例2: ngOnInit

 ngOnInit() {
     this.dotMessageService
         .getMessages([
             'editpage.toolbar.page.cant.edit',
             'editpage.toolbar.page.locked.by.user'
         ])
         .subscribe();
 }
开发者ID:dotCMS,项目名称:core-web,代码行数:8,代码来源:dot-edit-page-lock-info.component.ts

示例3: constructor

 constructor(
     private dotMenuService: DotMenuService,
     private ngZone: NgZone,
     private dotGlobalMessageService: DotGlobalMessageService,
     private dotMessageService: DotMessageService,
     private dotPageStateService: DotPageStateService
 ) {
     dotMessageService
         .getMessages(['dot.common.message.saved', 'dot.common.message.saving'])
         .subscribe();
 }
开发者ID:dotCMS,项目名称:core-web,代码行数:11,代码来源:dot-edit-layout-advanced.component.ts

示例4: ngAfterViewInit

 ngAfterViewInit(): void {
     this.dotMessageService
         .getMessages(['workflow.task.dialog.header'])
         .pipe(take(1))
         .subscribe(() => {
             this.dotWorkflowTaskDetailService.view({
                 header: this.dotMessageService.get('workflow.task.dialog.header'),
                 id: this.route.snapshot.params.asset
             });
         });
 }
开发者ID:dotCMS,项目名称:core-web,代码行数:11,代码来源:dot-workflow-task.component.ts

示例5: constructor

 constructor(
     public dotMessageService: DotMessageService,
     private dotEventsService: DotEventsService
 ) {
     this.dotMessageService
         .getMessages([
             'dot.common.message.loading',
             'dot.common.message.loaded',
             'dot.common.message.error'
         ])
         .subscribe();
 }
开发者ID:dotCMS,项目名称:core-web,代码行数:12,代码来源:dot-global-message.service.ts

示例6: addContentletMarkup

    /**
     * Edit contentlet html to add button and content
     *
     * @param Document doc
     * @memberof DotEditContentToolbarHtmlService
     */
    addContentletMarkup(doc: Document): void {
        this.dotMessageService
            .getMessages([
                'editpage.content.container.action.edit.vtl',
                'editpage.content.contentlet.menu.drag',
                'editpage.content.contentlet.menu.edit',
                'editpage.content.contentlet.menu.remove'
            ])
            .subscribe(() => {
                const contentletQuery = `div[data-dot-object="contentlet"][data-dot-has-page-lang-version="true"]`;
                const contentlets: HTMLDivElement[] = Array.from(
                    doc.querySelectorAll(contentletQuery)
                );

                contentlets.forEach((contentlet: HTMLDivElement) => {
                    this.addToolbarToContentlet(contentlet);
                });
            });
    }
开发者ID:dotCMS,项目名称:core-web,代码行数:25,代码来源:dot-edit-content-toolbar-html.service.ts

示例7: loadNavItems

 private loadNavItems(): Observable<DotEditPageNavItem[]> {
     return this.dotMessageService
         .getMessages([
             'editpage.toolbar.nav.content',
             'editpage.toolbar.nav.properties',
             'editpage.toolbar.nav.layout',
             'editpage.toolbar.nav.code',
             'editpage.toolbar.nav.license.enterprise.only',
             'editpage.toolbar.nav.layout.advance.disabled'
         ])
         .pipe(
             mergeMap(() => {
                 return this.dotLicenseService.isEnterprise();
             }),
             map((isEnterpriseLicense: boolean) => {
                 this.isEnterpriseLicense = isEnterpriseLicense;
                 return this.getNavItems(this.pageState, isEnterpriseLicense);
             })
         );
 }
开发者ID:dotCMS,项目名称:core-web,代码行数:20,代码来源:dot-edit-page-nav.component.ts

示例8: ngOnInit

    ngOnInit() {
        const keys = [
            'template.action.additional.permissions',
            'template.action.additional.history',
            'template.action.additional.properties'
        ];

        this.dotMessageService.getMessages(keys).subscribe((messages) => {
            this.items = [
                {
                    label: messages['template.action.additional.properties'],
                    routerLink: `template/${this.inode}/properties`
                },
                {
                    label: messages['template.action.additional.permissions'],
                    routerLink: `template/${this.inode}/permissions`
                },
                {
                    label: messages['template.action.additional.history'],
                    routerLink: `template/${this.inode}/history`
                }
            ];
        });
    }
开发者ID:dotCMS,项目名称:core-web,代码行数:24,代码来源:dot-template-additional-actions-menu.component.ts

示例9: ngOnInit

 ngOnInit() {
     this.messages$ = this.dotMessageService.getMessages([
         'editpage.layout.designer.header',
         'editpage.layout.designer.footer'
     ]).pipe(take(1));
 }
开发者ID:dotCMS,项目名称:core-web,代码行数:6,代码来源:dot-layout-designer.component.ts


注:本文中的@services/dot-messages-service.DotMessageService.getMessages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。