found a fixed weird text editor bug

sql-version-freeze
Ro 6 years ago
parent fb7e55369b
commit 59c46f64e2

@ -43,7 +43,8 @@ class TextEditor extends EventEmitter
}
});
this.refresh();
window.scroll(0,0);
//window.scroll(0,0);
//document.execCommand('insertBrOnReturn', false, true);
}
//--------------------------
// methods
@ -58,19 +59,7 @@ class TextEditor extends EventEmitter
}
this.textEditor.addEventListener('input', f =>
{
if (f.inputType == "insertParagraph")
{
var caret = position(self.textEditor).pos + 1;
var spiffed = hljs.highlight('markdown', self.textEditor.innerText).value;
var temp = document.createElement("div");
temp.innerText = spiffed;
self.textEditor.innerHTML = temp.innerText;
position(self.textEditor, caret)
}
else
{
self.refresh()
}
self.refresh();
})
}
refresh()

@ -2224,6 +2224,7 @@ select {
font-size: 1.5em;
color: #f2f1ef;
padding: 5px;
margin: 0 0 5px 0;
}
#post-edit-index #post-edit-index-wrapper #post-header #post-title #post-date {
background: #32414e;
@ -2287,6 +2288,7 @@ select {
height: 140px;
color: #b2cce5;
padding: 5px;
margin: 0 0 5px 0;
}
#post-edit-index #post-edit-index-wrapper #post-header #post-meta #featured-image-upload,
#post-edit-index #post-edit-index-wrapper #post-header #post-meta #post-image-upload {
@ -2338,6 +2340,7 @@ select {
background: #32414e;
}
#post-edit-index #post-edit-index-wrapper #edit-post #edit-post-wrapper pre code {
font-family: 'Apercu-Mono';
padding: 5px;
border-radius: 5px;
line-height: 1.6em;

File diff suppressed because one or more lines are too long

@ -7830,9 +7830,10 @@ function (_EventEmitter) {
}
});
_this.refresh();
_this.refresh(); //window.scroll(0,0);
//document.execCommand('insertBrOnReturn', false, true);
window.scroll(0, 0);
return _this;
} //--------------------------
// methods
@ -7854,16 +7855,7 @@ function (_EventEmitter) {
}
this.textEditor.addEventListener('input', function (f) {
if (f.inputType == "insertParagraph") {
var caret = (0, _caretPos.position)(self.textEditor).pos + 1;
var spiffed = hljs.highlight('markdown', self.textEditor.innerText).value;
var temp = document.createElement("div");
temp.innerText = spiffed;
self.textEditor.innerHTML = temp.innerText;
(0, _caretPos.position)(self.textEditor, caret);
} else {
self.refresh();
}
});
}
}, {
@ -9075,7 +9067,7 @@ var parent = module.bundle.parent;
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
var hostname = "" || location.hostname;
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
var ws = new WebSocket(protocol + '://' + hostname + ':' + "49367" + '/');
var ws = new WebSocket(protocol + '://' + hostname + ':' + "61094" + '/');
ws.onmessage = function (event) {
var data = JSON.parse(event.data);

File diff suppressed because one or more lines are too long

@ -76,7 +76,7 @@
font-size 1.5em
color $white
padding 5px
margin 0 0 5px 0
#post-date
background $primary - 10%
border-radius 0 3px 3px 0
@ -143,6 +143,7 @@
height 140px
color $secondary
padding 5px
margin 0 0 5px 0
#featured-image-upload, #post-image-upload
display none
@ -194,7 +195,7 @@
pre
code
// font-family 'Apercu-Mono'
font-family 'Apercu-Mono'
padding 5px
border-radius 5px
line-height 1.6em
@ -207,7 +208,7 @@
-o-line-break normal
-moz-line-break normal
display inline-block
overflow-wrap break-word
overflow-wrap: break-word
width 100%
max-width 900px

Loading…
Cancel
Save