當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。