Lines Matching refs:editor
88 const editor = document.getElementById('wiki__text');
89 if (!editor) {
135 editor.parentNode.insertBefore(toolbar, editor);
165 editor.parentNode.insertBefore(customPromptContainer, editor.nextSibling);
267 const editor = document.getElementById('wiki__text');
268 if (!editor) {
275 start: editor.selectionStart,
276 end: editor.selectionEnd
283 const selectedText = getSelectedText(editor);
284 const fullText = editor.value;
328 editor.readOnly = true;
381 const metadata = extractMetadata(editor.value);
382 const contentWithoutMetadata = editor.value.substring(metadata.length);
383 editor.value = metadata + contentWithoutMetadata + '\n\n' + cleanedResult;
391 const metadata = extractMetadata(editor.value);
392 const contentWithoutMetadata = editor.value.substring(metadata.length);
393 editor.value = metadata + cleanedResult + '\n\n' + contentWithoutMetadata;
400 replaceSelectedText(editor, cleanedResult);
408 const metadata = extractMetadata(editor.value);
409 editor.value = metadata + cleanedResult;
430 editor.readOnly = false;
596 const editor = document.getElementById('wiki__text');
597 if (!editor) {
603 const metadata = extractMetadata(editor.value);
604 const contentWithoutMetadata = editor.value.substring(metadata.length);
607 editor.value = metadata + contentWithoutMetadata + '\n\n' + content;
610 editor.focus();
611 editor.setSelectionRange(editor.value.length, editor.value.length);
642 const editor = document.getElementById('wiki__text');
643 if (!editor) {
650 start: editor.selectionStart,
651 end: editor.selectionEnd
654 const selectedText = getSelectedText(editor);
655 const fullText = editor.value;
678 editor.readOnly = true;
721 replaceSelectedText(editor, cleanedResult);
725 const metadata = extractMetadata(editor.value);
726 editor.value = metadata + cleanedResult;
748 editor.readOnly = false;
922 const editor = document.getElementById('wiki__text');
923 if (!editor) {
956 editor.readOnly = true;
960 const currentText = editor.value;
987 editor.value = insertMetadataAfterTitle(editor.value, metadataLine);
1010 editor.readOnly = false;
1034 const editor = document.getElementById('wiki__text');
1035 if (!editor) {
1044 editor.readOnly = true;
1070 const cursorPos = editor.selectionStart;
1071 const text = editor.value;
1072 … editor.value = text.substring(0, cursorPos) + data.result.content + text.substring(cursorPos);
1076 editor.setSelectionRange(newCursorPos, newCursorPos);
1077 editor.focus();
1086 editor.readOnly = false;