fix: remove required attribute from gist source textareas and fix emoji-picker script type
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
class GistEditor {
|
||||
constructor(textareaId, langSelectId) {
|
||||
this.editor = null;
|
||||
this.initialized = false;
|
||||
this.textareaId = textareaId || "gist-source-editor";
|
||||
this.langSelectId = langSelectId || "gist-language";
|
||||
this.init();
|
||||
}
|
||||
|
||||
init() {
|
||||
if (this.initialized) return;
|
||||
if (typeof CodeMirror === "undefined") return;
|
||||
|
||||
const textarea = document.getElementById(this.textareaId);
|
||||
if (!textarea || textarea.dataset.cminit) return;
|
||||
textarea.dataset.cminit = "1";
|
||||
if (!textarea) return;
|
||||
this.initialized = true;
|
||||
|
||||
this.editor = CodeMirror.fromTextArea(textarea, {
|
||||
lineNumbers: true,
|
||||
|
||||
Reference in New Issue
Block a user