diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-08-15 12:50:53 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-08-15 12:50:53 +0000 |
commit | 62a85df302a839177400100c6a09813161440ce0 (patch) | |
tree | 1ab9ca1d6a48defe1d6b8cfff402a0ccf23eca7e /wp-includes/js/tinymce | |
parent | 69a120282949dc8a5526a7486751bc07aea44d9d (diff) | |
download | wordpress-mu-62a85df302a839177400100c6a09813161440ce0.tar.gz wordpress-mu-62a85df302a839177400100c6a09813161440ce0.tar.xz wordpress-mu-62a85df302a839177400100c6a09813161440ce0.zip |
WP Merge to rev 4096
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@722 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/js/tinymce')
-rw-r--r-- | wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js index 08529ec..ef5df27 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js @@ -382,3 +382,86 @@ tinyMCE.execCommand = function (command, user_interface, value) { } return re; }; +wpInstTriggerSave = function (skip_cleanup, skip_callback) { + var e, nl = new Array(), i, s; + + this.switchSettings(); + s = tinyMCE.settings; + + // Force hidden tabs visible while serializing + if (tinyMCE.isMSIE && !tinyMCE.isOpera) { + e = this.iframeElement; + + do { + if (e.style && e.style.display == 'none') { + e.style.display = 'block'; + nl[nl.length] = {elm : e, type : 'style'}; + } + + if (e.style && s.hidden_tab_class.length > 0 && e.className.indexOf(s.hidden_tab_class) != -1) { + e.className = s.display_tab_class; + nl[nl.length] = {elm : e, type : 'class'}; + } + } while ((e = e.parentNode) != null) + } + + tinyMCE.settings['preformatted'] = false; + + // Default to false + if (typeof(skip_cleanup) == "undefined") + skip_cleanup = false; + + // Default to false + if (typeof(skip_callback) == "undefined") + skip_callback = false; + +// tinyMCE._setHTML(this.getDoc(), this.getBody().innerHTML); + + // Remove visual aids when cleanup is disabled + if (this.settings['cleanup'] == false) { + tinyMCE.handleVisualAid(this.getBody(), true, false, this); + tinyMCE._setEventsEnabled(this.getBody(), true); + } + + tinyMCE._customCleanup(this, "submit_content_dom", this.contentWindow.document.body); + var htm = skip_cleanup ? this.getBody().innerHTML : tinyMCE._cleanupHTML(this, this.getDoc(), this.settings, this.getBody(), tinyMCE.visualAid, true, true); + htm = tinyMCE._customCleanup(this, "submit_content", htm); + + if (!skip_callback && tinyMCE.settings['save_callback'] != "") + var content = eval(tinyMCE.settings['save_callback'] + "(this.formTargetElementId,htm,this.getBody());"); + + // Use callback content if available + if ((typeof(content) != "undefined") && content != null) + htm = content; + + // Replace some weird entities (Bug: #1056343) + htm = tinyMCE.regexpReplace(htm, "(", "(", "gi"); + htm = tinyMCE.regexpReplace(htm, ")", ")", "gi"); + htm = tinyMCE.regexpReplace(htm, ";", ";", "gi"); + htm = tinyMCE.regexpReplace(htm, """, """, "gi"); + htm = tinyMCE.regexpReplace(htm, "^", "^", "gi"); + + if (this.formElement) + this.formElement.value = htm; + + if (tinyMCE.isSafari && this.formElement) + this.formElement.innerText = htm; + + // Hide them again (tabs in MSIE) + for (i=0; i<nl.length; i++) { + if (nl[i].type == 'style') + nl[i].elm.style.display = 'none'; + else + nl[i].elm.className = s.hidden_tab_class; + } +} +tinyMCE.wpTriggerSave = function () { + var inst, n; + for (n in tinyMCE.instances) { + inst = tinyMCE.instances[n]; + if (!tinyMCE.isInstance(inst)) + continue; + inst.wpTriggerSave = wpInstTriggerSave; + inst.wpTriggerSave(false, false); + } +} |