diff --git a/plugins/FM_Modern/editor.js b/plugins/FM_Modern/editor.js index 3e70873bb..578e1226e 100644 --- a/plugins/FM_Modern/editor.js +++ b/plugins/FM_Modern/editor.js @@ -279,8 +279,8 @@ TTModernEditor.prototype.finalize = function() { } TTModernEditor.prototype.syncTextarea = function() { + this.correctContent(); if (this.editMode == "WYSIWYG") { - this.correctContent(); this.textarea.value = this.html2ttml(); } } @@ -1646,17 +1646,21 @@ TTModernEditor.prototype.eventHandler = function(event) { if(event.keyCode == 13) { if(this.newLineToParagraph) { if(STD.isFirefox && !event.shiftKey) { - // TODO : put a p tag - } else { + // TODO : test
->

test

+ } else if(STD.isWebkit && !event.shiftKey) { + // TODO : test or
test
->

test

} } else { if(STD.isIE && range.parentElement && range.parentElement().tagName != "LI") { + // TODO :

test

->
event.returnValue = false; event.cancelBubble = true; range.pasteHTML("
"); range.collapse(false); range.select(); return false; + } else if(STD.isWebkit && !event.shiftKey) { + // TODO : test or
test
-> test
} } } @@ -1705,6 +1709,7 @@ TTModernEditor.prototype.correctContent = function() { html = html.replaceAll('class="webkit-block-placeholder"',''); html = html.replaceAll('br class="webkit-block-placeholder"','br /'); html = html.replaceAll('

','
'); + html = html.replaceAll('
', '
'); var dmodeExprs = new Array("font-weight: bold;", "font-style: italic;", "text-decoration: underline;", @@ -1999,8 +2004,8 @@ TTModernEditor.prototype.toggleMode = function() { this.iframe.style.display = "none"; this.textarea.style.display = "block"; this.editMode = "TEXTAREA"; + this.textarea.value = this.html2ttml(); this.correctContent(); - this.textarea.value = this.html2ttml(); this.textarea.focus(); this.resizer.target = this.textarea; } @@ -2014,8 +2019,8 @@ TTModernEditor.prototype.toggleMode = function() { return; } this.editMode = "WYSIWYG"; - this.contentDocument.body.innerHTML = this.ttml2html(); this.correctContent(); + this.contentDocument.body.innerHTML = this.ttml2html(); try { this.contentDocument.body.focus(); } catch(e) { } this.resizer.target = this.iframe; } @@ -2023,7 +2028,7 @@ TTModernEditor.prototype.toggleMode = function() { // 위지윅 모드에서의 selection을 리턴한다 TTModernEditor.prototype.getSelectionRange = function() { - if (!STD.isIE) this.contentWindow.focus(); + if (STD.isWebkit) this.contentWindow.focus(); return STD.isIE ? this.contentDocument.selection.createRange() : this.contentWindow.getSelection().getRangeAt(0); }