aboutsummaryrefslogtreecommitdiff
path: root/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2013-02-21 13:34:49 -0800
committerBrett Profitt <brett.profitt@gmail.com>2013-02-21 13:34:49 -0800
commit556b3f68be6d568e1ab19a6e02a073da8f49ea38 (patch)
tree4d5b09112ec2199ae9008109ba97e1478b915a21 /mod/tinymce/vendor/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js
parent88b7f8a3a32542e8b016c2163f44e1ebce7211fc (diff)
parent4cd91acc35bd1923b9c2bfd5c377c0ac2e157d23 (diff)
downloadelgg-556b3f68be6d568e1ab19a6e02a073da8f49ea38.tar.gz
elgg-556b3f68be6d568e1ab19a6e02a073da8f49ea38.tar.bz2
Merge pull request #5095 from iionly/tinymce_update_3_5_8
Tinymce plugin: update to version 3.5.8 of Tinymce editor
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() {