From 58a933b9069200e3a6e7764ee3fe5ab1d3ad9e14 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 22 Sep 2006 19:35:37 +0000 Subject: [PATCH] Tabbed editor and autosave fixes. Props skeltoac and westi. #2829 git-svn-id: https://develop.svn.wordpress.org/trunk@4209 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/autosave.js.php | 2 +- wp-includes/js/tinymce/tiny_mce_gzip.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-includes/js/autosave.js.php b/wp-includes/js/autosave.js.php index 6dc1bac5a7..a8648f0118 100644 --- a/wp-includes/js/autosave.js.php +++ b/wp-includes/js/autosave.js.php @@ -72,7 +72,7 @@ function autosave_saved() { function autosave() { var form = $('post'); - var rich = tinyMCE.getInstanceById('content') ? true : false; + var rich = ((typeof tinyMCE != "undefined") && tinyMCE.getInstanceById('content')) ? true : false; autosaveAjax = new sack(); diff --git a/wp-includes/js/tinymce/tiny_mce_gzip.php b/wp-includes/js/tinymce/tiny_mce_gzip.php index d92e08e031..686fb6122b 100644 --- a/wp-includes/js/tinymce/tiny_mce_gzip.php +++ b/wp-includes/js/tinymce/tiny_mce_gzip.php @@ -35,8 +35,9 @@ function wp_tinymce_lang($path) { // Fall back on en.js - if ( empty($text) ) - $text = file_get_contents(realpath(sprintf($path, 'en'))); + $file = realpath(sprintf($path, 'en')); + if ( empty($text) && file_exists($file) ) + $text = file_get_contents($file); // Send lang file through gettext if ( function_exists('__') && strtolower(substr($language, 0, 2)) != 'en' ) {