|
|
@ -7830,9 +7830,7 @@ function (_EventEmitter) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
_this.refresh(); //window.scroll(0,0);
|
|
|
|
_this.refresh();
|
|
|
|
//document.execCommand('insertBrOnReturn', false, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return _this;
|
|
|
|
return _this;
|
|
|
|
} //--------------------------
|
|
|
|
} //--------------------------
|
|
|
@ -7853,21 +7851,15 @@ function (_EventEmitter) {
|
|
|
|
return _this2.handleEditorOption(e);
|
|
|
|
return _this2.handleEditorOption(e);
|
|
|
|
}, false);
|
|
|
|
}, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.textEditor.addEventListener('input', function (f) {
|
|
|
|
|
|
|
|
self.refresh();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
key: "refresh",
|
|
|
|
key: "refresh",
|
|
|
|
value: function refresh() {
|
|
|
|
value: function refresh() {
|
|
|
|
var caret = (0, _caretPos.position)(this.textEditor).pos;
|
|
|
|
|
|
|
|
var spiffed = hljs.highlight('markdown', this.textEditor.innerText).value;
|
|
|
|
var spiffed = hljs.highlight('markdown', this.textEditor.innerText).value;
|
|
|
|
spiffed = spiffed.replace(new RegExp('\r?\n', 'g'), '<br>');
|
|
|
|
spiffed = spiffed.replace(new RegExp('\r?\n', 'g'), '<br>');
|
|
|
|
var temp = document.createElement("div");
|
|
|
|
var temp = document.createElement("div");
|
|
|
|
temp.innerText = spiffed;
|
|
|
|
temp.innerText = spiffed;
|
|
|
|
this.textEditor.innerHTML = temp.innerText;
|
|
|
|
this.textEditor.innerHTML = temp.innerText;
|
|
|
|
(0, _caretPos.position)(this.textEditor, caret);
|
|
|
|
|
|
|
|
this.textEditor.style.maxWidth = '900px';
|
|
|
|
this.textEditor.style.maxWidth = '900px';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
@ -7965,6 +7957,7 @@ function (_EventEmitter) {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case "edit-link":
|
|
|
|
case "edit-link":
|
|
|
|
|
|
|
|
console.log("PULLED", pulled);
|
|
|
|
range.insertNode(document.createTextNode("[" + pulled + "](PASTE URL HERE)"));
|
|
|
|
range.insertNode(document.createTextNode("[" + pulled + "](PASTE URL HERE)"));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|