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


TypeScript EditorAPI.makeModal方法代码示例

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


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

示例1: getBiblSelectionModal

function getBiblSelectionModal(editor: EditorAPI): Modal {
  let modal = editor.getModeData(BIBL_SELECTION_MODAL_KEY);
  if (modal) {
    return modal;
  }

  modal = editor.makeModal();
  modal.setTitle("Invalid Selection");
  modal.setBody("<p>The selection should contain only text. The current " +
                "selection contains elements.</p>");
  modal.addButton("Ok", true);
  editor.setModeData(BIBL_SELECTION_MODAL_KEY, modal);

  return modal;
}
开发者ID:mangalam-research,项目名称:btw,代码行数:15,代码来源:btw-actions.ts

示例2: getNestingModal

function getNestingModal(editor: EditorAPI): Modal {
  let nestingModal = editor.getModeData(NESTING_MODAL_KEY);
  if (nestingModal) {
    return nestingModal;
  }

  nestingModal = editor.makeModal();
  nestingModal.setTitle("Invalid nesting");
  nestingModal.setBody("<p>In this part of the article, you cannot embed one " +
                       "language into another.</p>");
  nestingModal.addButton("Ok", true);
  editor.setModeData(NESTING_MODAL_KEY, nestingModal);

  return nestingModal;
}
开发者ID:mangalam-research,项目名称:btw,代码行数:15,代码来源:btw-tr.ts

示例3: getEditSemanticFieldModal

function getEditSemanticFieldModal(editor: EditorAPI): Modal {
  let modal = editor.getModeData(EDIT_SF_MODAL_KEY);
  if (modal) {
    return modal;
  }

  modal = editor.makeModal({
    resizable: true,
    draggable: true,
  });
  modal.setTitle("Edit Semantic Fields");
  modal.addButton("Commit", true);
  modal.addButton("Cancel");
  const body = modal.getTopLevel()[0].getElementsByClassName("modal-body")[0];
  body.classList.add("sf-editor-modal-body");
  body.style.overflowY = "hidden";
  editor.setModeData(EDIT_SF_MODAL_KEY, modal);

  return modal;
}
开发者ID:mangalam-research,项目名称:btw,代码行数:20,代码来源:btw-actions.ts


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