MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / initCodeEditor

Function initCodeEditor

examples/js/editor.js:60–78  ·  view source on GitHub ↗
(showCode)

Source from the content-addressed store, hash-verified

58
59//初始化编辑器
60function initCodeEditor(showCode) {
61 const codeBtn = document.getElementById("showCodeBtn");
62 if(showCode === false){
63 codeBtn.classList.add('hide');
64 return
65 }
66 codeBtn.classList.remove('hide');
67 if (!aceEditor) {
68 aceEditor = ace.edit("editor");
69 aceEditor.setTheme("ace/theme/textmate");
70 aceEditor.getSession().setMode("ace/mode/html");
71 aceEditor.getSession().setUseWrapMode(true);
72 aceEditor.setShowPrintMargin(false);
73 aceEditor.$blockScrolling = Infinity;
74 }
75 aceEditor.setValue($('#editor').val());
76 aceEditor.clearSelection();
77 aceEditor.moveCursorTo(0, 0);
78}
79
80//初始化编辑器以及预览内容
81function initEditor() {

Callers 1

initEditorFunction · 0.85

Calls 3

$Function · 0.50
addMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected