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