diff options
author | Alexander Kampmann <programmer@nurfuerspam.de> | 2012-03-22 12:50:02 +0100 |
---|---|---|
committer | Alexander Kampmann <programmer@nurfuerspam.de> | 2012-03-22 12:50:02 +0100 |
commit | cea7ca1df4fd8065c38a4f43a0f13ba89e8b94e2 (patch) | |
tree | b88556dbafbabac5753bdec9e51fcb24ec4ca3b8 /library/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js | |
parent | 29900febb341cfbec6e4445d4ea1c2dc782a521a (diff) | |
parent | 808180ce5f9471aa36faf8861fb84d04b412f412 (diff) | |
download | volse-hubzilla-cea7ca1df4fd8065c38a4f43a0f13ba89e8b94e2.tar.gz volse-hubzilla-cea7ca1df4fd8065c38a4f43a0f13ba89e8b94e2.tar.bz2 volse-hubzilla-cea7ca1df4fd8065c38a4f43a0f13ba89e8b94e2.zip |
Merge branch 'master' of git://github.com/friendica/friendica
Conflicts:
boot.php
database.sql
include/template_processor.php
update.php
Diffstat (limited to 'library/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js')
-rw-r--r--[-rwxr-xr-x] | library/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js b/library/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js index 279328614..dd5e366fa 100755..100644 --- a/library/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js +++ b/library/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,26 +37,42 @@ function setWrap(val) { }
}
-function toggleWordWrap(elm) {
- if (elm.checked)
- setWrap('soft');
- else
- setWrap('off');
+function setWhiteSpaceCss(value) {
+ var el = document.getElementById('htmlSource');
+ tinymce.DOM.setStyle(el, 'white-space', value);
}
-var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
+function turnWrapOff() {
+ if (tinymce.isWebKit) {
+ setWhiteSpaceCss('pre');
+ } else {
+ setWrap('off');
+ }
+}
-function resizeInputs() {
- var el = document.getElementById('htmlSource');
+function turnWrapOn() {
+ if (tinymce.isWebKit) {
+ setWhiteSpaceCss('pre-wrap');
+ } else {
+ setWrap('soft');
+ }
+}
- if (!tinymce.isIE) {
- wHeight = self.innerHeight - 65;
- wWidth = self.innerWidth - 16;
+function toggleWordWrap(elm) {
+ if (elm.checked) {
+ turnWrapOn();
} else {
- wHeight = document.body.clientHeight - 70;
- wWidth = document.body.clientWidth - 16;
+ turnWrapOff();
}
+}
+
+function resizeInputs() {
+ var vp = tinyMCEPopup.dom.getViewPort(window), el;
- el.style.height = Math.abs(wHeight) + 'px';
- el.style.width = Math.abs(wWidth) + 'px';
+ el = document.getElementById('htmlSource');
+
+ if (el) {
+ el.style.width = (vp.w - 20) + 'px';
+ el.style.height = (vp.h - 65) + 'px';
+ }
}
|