diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php
index 882f149d08..c4bd95c8ce 100644
--- a/wp-admin/admin-header.php
+++ b/wp-admin/admin-header.php
@@ -79,46 +79,8 @@ addLoadEvent(blurry);
-
-
-
+
+
diff --git a/wp-includes/js/tinymce/tiny_mce_gzip.php b/wp-includes/js/tinymce/tiny_mce_gzip.php
index 12bedc2b39..3feee3b891 100644
--- a/wp-includes/js/tinymce/tiny_mce_gzip.php
+++ b/wp-includes/js/tinymce/tiny_mce_gzip.php
@@ -16,7 +16,8 @@
* - Add local file cache for the GZip:ed version.
*/
- @ include('../../../wp-config.php');
+ /* Heavily edited to add flexibilty in WordPress */
+ @ require('../../../wp-config.php');
function wp_translate_tinymce_lang($text) {
if ( ! function_exists('__') ) {
@@ -53,15 +54,7 @@
}
// General options
- $suffix = ""; // Set to "_src" to use source version
- $expiresOffset = 3600 * 24 * 10; // 10 days util client cache expires
-
- // Get data to load
- $theme = isset($_REQUEST['theme']) ? $_REQUEST['theme'] : "";
- $language = isset($_REQUEST['language']) ? $_REQUEST['language'] : "";
- $plugins = isset($_REQUEST['plugins']) ? $_REQUEST['plugins'] : "";
- $lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : "en";
- $index = isset($_REQUEST['index']) ? $_REQUEST['index'] : -1;
+ $expiresOffset = 3600 * 24 * 30; // 30 days util client cache expires
// Only gzip the contents if clients and server support it
$encodings = explode(',', strtolower($_SERVER['HTTP_ACCEPT_ENCODING']));
@@ -70,112 +63,87 @@
// Output rest of headers
header("Content-type: text/javascript; charset: UTF-8");
- // header("Cache-Control: must-revalidate");
header("Vary: Accept-Encoding"); // Handle proxies
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $expiresOffset) . " GMT");
- if ($index > -1) {
- // Write main script and patch some things
- if ($index == 0) {
-// WP echo file_get_contents(realpath("tiny_mce" . $suffix . ".js"));
- $tinymce = file_get_contents(realpath("tiny_mce.js"));
- echo wp_compact_tinymce_js($tinymce);
- echo "\n\n";
- echo "TinyMCE.prototype.loadScript = function() {};\n";
- }
+ // Write main script
+ $tinymce = file_get_contents(realpath("tiny_mce.js"));
+ echo wp_compact_tinymce_js($tinymce);
+ echo "\n\n";
- // WP
- $lang = $language = 'en';
- echo "\n/* WP Cancels all TinyMCE language handling */\n";
- echo "TinyMCE.prototype.importThemeLanguagePack = function() {};\n";
- echo "TinyMCE.prototype.importPluginLanguagePack = function() {};\n\n";
+ // Remove some functions
+ echo "\n/* WP cancels all TinyMCE language and import handling */\n";
+ echo "TinyMCE.prototype.importThemeLanguagePack = function() {};\n";
+ echo "TinyMCE.prototype.importPluginLanguagePack = function() {};\n\n";
+ echo "TinyMCE.prototype.loadScript = function() {};\n";
- // Do init based on index
-// WP echo "tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);\n\n";
+ // Load theme, language pack and theme language packs
+ $theme = apply_filters('mce_theme', 'advanced');
+ echo wp_compact_tinymce_js(file_get_contents(realpath("themes/" . $theme . "/editor_template.js")));
+ echo wp_translate_tinymce_lang(file_get_contents(realpath("themes/" . $theme . "/langs/en.js")));
+ echo wp_translate_tinymce_lang(file_get_contents(realpath("langs/en.js")));
- // Load theme, language pack and theme language packs
- if ($theme) {
- echo file_get_contents(realpath("themes/" . $theme . "/editor_template" . $suffix . ".js"));
- echo wp_translate_tinymce_lang(file_get_contents(realpath("themes/" . $theme . "/langs/" . $lang . ".js")));
- }
+ // Load all plugins and their language packs
+ $plugins = apply_filters('mce_plugins', array('wordpress', 'autosave', 'wphelp'));
+ foreach ($plugins as $plugin) {
+ $pluginFile = realpath("plugins/" . $plugin . "/editor_plugin.js");
+ $languageFile = realpath("plugins/" . $plugin . "/langs/en.js");
- if ($language)
- echo wp_translate_tinymce_lang(file_get_contents(realpath("langs/" . $language . ".js")));
+ if ($pluginFile)
+ echo file_get_contents($pluginFile);
- // Load all plugins and their language packs
- $plugins = explode(",", $plugins);
- foreach ($plugins as $plugin) {
- $pluginFile = realpath("plugins/" . $plugin . "/editor_plugin" . $suffix . ".js");
- $languageFile = realpath("plugins/" . $plugin . "/langs/" . $lang . ".js");
-
- if ($pluginFile)
- echo file_get_contents($pluginFile);
-
- if ($languageFile)
- echo wp_translate_tinymce_lang(file_get_contents($languageFile));
- }
-
- die;
+ if ($languageFile)
+ echo wp_translate_tinymce_lang(file_get_contents($languageFile));
}
+
+ // Set up init variables
+ if ( current_user_can('unfiltered_html') ) // Use the full XHTML set provided in the docs
+ $valid_elements = 'a[accesskey|charset|class|coords|dir
+tinyMCE.init({
+ mode : "specific_textareas",
+ textarea_trigger : "title",
+ width : "100%",
+ theme : "advanced",
+ theme_advanced_buttons1 : "",
+ theme_advanced_buttons2 : "",
+ theme_advanced_buttons3 : "",
+ theme_advanced_toolbar_location : "top",
+ theme_advanced_toolbar_align : "left",
+ theme_advanced_path_location : "bottom",
+ theme_advanced_resizing : true,
+ browsers : "",
+ dialog_type : "modal",
+ theme_advanced_resize_horizontal : false,
+ entity_encoding : "raw",
+ relative_urls : false,
+ remove_script_host : false,
+ force_p_newlines : true,
+ force_br_newlines : false,
+ convert_newlines_to_brs : false,
+ remove_linebreaks : true,
+ save_callback : "wp_save_callback",
+ valid_elements : "",
+
+ plugins : ""
+});
-function TinyMCECompressed() {
- this.configs = new Array();
- this.loadedFiles = new Array();
-}
-
-TinyMCECompressed.prototype.init = function(settings) {
- var elements = document.getElementsByTagName('script');
- var scriptURL = "";
-
- for (var i=0; i');
-}
-
-TinyMCECompressed.prototype.getOnce = function(str) {
- var ar = str.split(',');
-
- for (var i=0; i