aboutsummaryrefslogtreecommitdiff
path: root/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js
diff options
context:
space:
mode:
Diffstat (limited to 'mod/tinymce/vendor/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js')
-rw-r--r--mod/tinymce/vendor/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js32
1 files changed, 27 insertions, 5 deletions
diff --git a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js
index 84546ad52..dd5e366fa 100644
--- a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js
+++ b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js
@@ -16,7 +16,7 @@ function onLoadInit() {
document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true});
if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) {
- setWrap('soft');
+ turnWrapOn();
document.getElementById('wraped').checked = true;
}
@@ -37,11 +37,33 @@ function setWrap(val) {
}
}
-function toggleWordWrap(elm) {
- if (elm.checked)
- setWrap('soft');
- else
+function setWhiteSpaceCss(value) {
+ var el = document.getElementById('htmlSource');
+ tinymce.DOM.setStyle(el, 'white-space', value);
+}
+
+function turnWrapOff() {
+ if (tinymce.isWebKit) {
+ setWhiteSpaceCss('pre');
+ } else {
setWrap('off');
+ }
+}
+
+function turnWrapOn() {
+ if (tinymce.isWebKit) {
+ setWhiteSpaceCss('pre-wrap');
+ } else {
+ setWrap('soft');
+ }
+}
+
+function toggleWordWrap(elm) {
+ if (elm.checked) {
+ turnWrapOn();
+ } else {
+ turnWrapOff();
+ }
}
function resizeInputs() {