summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--index.php15
-rw-r--r--wp-activate.php5
-rw-r--r--wp-admin/admin-ajax.php24
-rw-r--r--wp-admin/admin-header.php76
-rw-r--r--wp-admin/admin.php8
-rw-r--r--wp-admin/async-upload.php4
-rw-r--r--wp-admin/categories.php3
-rw-r--r--wp-admin/comment.php10
-rw-r--r--wp-admin/css/colors-classic.css47
-rw-r--r--wp-admin/css/colors-fresh.css38
-rw-r--r--wp-admin/css/global-rtl.css28
-rw-r--r--wp-admin/css/global.css4
-rw-r--r--wp-admin/css/ie.css3
-rw-r--r--wp-admin/css/media.css16
-rw-r--r--wp-admin/css/press-this.css451
-rw-r--r--wp-admin/css/widgets-rtl.css8
-rw-r--r--wp-admin/css/widgets.css24
-rw-r--r--wp-admin/custom-header.php2
-rw-r--r--wp-admin/edit-category-form.php2
-rw-r--r--wp-admin/edit-comments.php18
-rw-r--r--wp-admin/edit-form-advanced.php206
-rw-r--r--wp-admin/edit-form-comment.php12
-rw-r--r--wp-admin/edit-link-categories.php3
-rw-r--r--wp-admin/edit-link-category-form.php2
-rw-r--r--wp-admin/edit-link-form.php88
-rw-r--r--wp-admin/edit-page-form.php160
-rw-r--r--wp-admin/edit-pages.php7
-rw-r--r--wp-admin/edit-tag-form.php4
-rw-r--r--wp-admin/edit-tags.php3
-rw-r--r--wp-admin/edit.php7
-rw-r--r--wp-admin/export.php4
-rw-r--r--wp-admin/gears-manifest.php217
-rw-r--r--wp-admin/images/gear.pngbin0 -> 16742 bytes
-rw-r--r--wp-admin/images/loading.gifbin0 -> 2530 bytes
-rw-r--r--wp-admin/images/logo.gifbin0 -> 1238 bytes
-rw-r--r--wp-admin/images/tab.pngbin0 -> 1006 bytes
-rw-r--r--wp-admin/import/blogger.php4
-rw-r--r--wp-admin/import/dotclear.php4
-rw-r--r--wp-admin/import/greymatter.php12
-rw-r--r--wp-admin/import/mt.php4
-rw-r--r--wp-admin/import/textpattern.php4
-rw-r--r--wp-admin/import/wordpress.php9
-rw-r--r--wp-admin/import/wp-cat2tag.php301
-rw-r--r--wp-admin/includes/bookmark.php19
-rw-r--r--wp-admin/includes/class-wp-filesystem-base.php158
-rw-r--r--wp-admin/includes/class-wp-filesystem-direct.php190
-rw-r--r--wp-admin/includes/class-wp-filesystem-ftpext.php248
-rw-r--r--wp-admin/includes/class-wp-filesystem-ftpsockets.php270
-rw-r--r--wp-admin/includes/comment.php4
-rw-r--r--wp-admin/includes/dashboard.php7
-rw-r--r--wp-admin/includes/export.php7
-rw-r--r--wp-admin/includes/file.php159
-rw-r--r--wp-admin/includes/media.php173
-rw-r--r--wp-admin/includes/plugin.php122
-rw-r--r--wp-admin/includes/post.php265
-rw-r--r--wp-admin/includes/schema.php26
-rw-r--r--wp-admin/includes/taxonomy.php2
-rw-r--r--wp-admin/includes/template.php100
-rw-r--r--wp-admin/includes/theme.php2
-rw-r--r--wp-admin/includes/update.php70
-rw-r--r--wp-admin/includes/upgrade.php95
-rw-r--r--wp-admin/includes/user.php37
-rw-r--r--wp-admin/includes/widgets.php14
-rw-r--r--wp-admin/index.php9
-rw-r--r--wp-admin/install-helper.php3
-rw-r--r--wp-admin/js/forms.js51
-rw-r--r--wp-admin/js/gallery.js20
-rw-r--r--wp-admin/js/media-upload.js6
-rw-r--r--wp-admin/js/post.js2
-rw-r--r--wp-admin/js/theme-preview.js44
-rw-r--r--wp-admin/js/word-count.js39
-rw-r--r--wp-admin/js/wp-gears.js83
-rw-r--r--wp-admin/link-add.php1
-rw-r--r--wp-admin/link-import.php10
-rw-r--r--wp-admin/link-manager.php3
-rw-r--r--wp-admin/link-parse-opml.php2
-rw-r--r--wp-admin/link.php1
-rw-r--r--wp-admin/media.php9
-rw-r--r--wp-admin/menu-header.php2
-rw-r--r--wp-admin/moderation.php2
-rw-r--r--wp-admin/options-discussion.php78
-rw-r--r--wp-admin/options-general.php29
-rw-r--r--wp-admin/options-misc.php8
-rw-r--r--wp-admin/options-permalink.php6
-rw-r--r--wp-admin/options-privacy.php4
-rw-r--r--wp-admin/options-reading.php18
-rw-r--r--wp-admin/options-writing.php10
-rw-r--r--wp-admin/page-new.php3
-rw-r--r--wp-admin/page.php11
-rw-r--r--wp-admin/plugin-editor.php9
-rw-r--r--wp-admin/plugins.php318
-rw-r--r--wp-admin/post-new.php3
-rw-r--r--wp-admin/post.php11
-rw-r--r--wp-admin/press-this.php503
-rw-r--r--wp-admin/revision.php209
-rw-r--r--wp-admin/setup-config.php24
-rw-r--r--wp-admin/sidebar.php18
-rw-r--r--wp-admin/themes.php106
-rw-r--r--wp-admin/update-links.php8
-rw-r--r--wp-admin/update.php25
-rw-r--r--wp-admin/upgrade.php6
-rw-r--r--wp-admin/upload.php3
-rw-r--r--wp-admin/user-edit.php4
-rw-r--r--wp-admin/users.php15
-rw-r--r--wp-admin/widgets.php8
-rw-r--r--wp-admin/wp-admin.css238
-rw-r--r--wp-app.php89
-rw-r--r--wp-atom.php13
-rw-r--r--wp-blog-header.php29
-rw-r--r--wp-comments-post.php12
-rw-r--r--wp-commentsrss2.php15
-rw-r--r--wp-config-sample.php5
-rw-r--r--wp-content/themes/default/comments.php4
-rw-r--r--wp-content/themes/default/searchform.php1
-rw-r--r--wp-content/themes/default/single.php2
-rw-r--r--wp-content/themes/default/style.css4
-rw-r--r--wp-cron.php22
-rw-r--r--wp-feed.php14
-rw-r--r--wp-includes/Text/Diff.php413
-rw-r--r--wp-includes/Text/Diff/Engine/native.php437
-rw-r--r--wp-includes/Text/Diff/Engine/shell.php164
-rw-r--r--wp-includes/Text/Diff/Engine/string.php234
-rw-r--r--wp-includes/Text/Diff/Engine/xdiff.php63
-rw-r--r--wp-includes/Text/Diff/Renderer.php237
-rw-r--r--wp-includes/Text/Diff/Renderer/inline.php170
-rw-r--r--wp-includes/author-template.php115
-rw-r--r--wp-includes/bookmark-template.php107
-rw-r--r--wp-includes/bookmark.php67
-rw-r--r--wp-includes/cache.php152
-rw-r--r--wp-includes/canonical.php38
-rw-r--r--wp-includes/capabilities.php4
-rw-r--r--wp-includes/category-template.php13
-rw-r--r--wp-includes/class.wp-dependencies.php193
-rw-r--r--wp-includes/class.wp-scripts.php89
-rw-r--r--wp-includes/class.wp-styles.php71
-rw-r--r--wp-includes/classes.php12
-rw-r--r--wp-includes/comment-template.php4
-rw-r--r--wp-includes/comment.php92
-rw-r--r--wp-includes/default-filters.php2
-rw-r--r--wp-includes/formatting.php7
-rw-r--r--wp-includes/functions.php46
-rw-r--r--wp-includes/functions.wp-scripts.php77
-rw-r--r--wp-includes/functions.wp-styles.php45
-rw-r--r--wp-includes/general-template.php103
-rw-r--r--wp-includes/js/autosave.js15
-rw-r--r--wp-includes/js/jquery/jquery.form.js1744
-rw-r--r--wp-includes/js/jquery/jquery.js8
-rw-r--r--wp-includes/js/jquery/suggest.js2
-rw-r--r--wp-includes/js/jquery/ui.core.js2
-rw-r--r--wp-includes/js/jquery/ui.sortable.js2
-rw-r--r--wp-includes/js/jquery/ui.tabs.js529
-rw-r--r--wp-includes/js/prototype.js2
-rw-r--r--wp-includes/js/quicktags.js50
-rw-r--r--wp-includes/js/scriptaculous/MIT-LICENSE40
-rw-r--r--wp-includes/js/scriptaculous/prototype.js2
-rw-r--r--wp-includes/js/scriptaculous/scriptaculous.js2
-rw-r--r--wp-includes/js/scriptaculous/unittest.js2
-rw-r--r--wp-includes/js/thickbox/thickbox.css16
-rw-r--r--wp-includes/js/tinymce/langs/wp-langs.php2
-rw-r--r--wp-includes/js/tinymce/plugins/autosave/editor_plugin.js2
-rw-r--r--wp-includes/js/tinymce/plugins/directionality/editor_plugin.js2
-rw-r--r--wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js2
-rw-r--r--wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm2
-rw-r--r--wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js2
-rw-r--r--wp-includes/js/tinymce/plugins/inlinepopups/template.htm2
-rw-r--r--wp-includes/js/tinymce/plugins/media/css/media.css84
-rw-r--r--wp-includes/js/tinymce/plugins/media/editor_plugin.js2
-rw-r--r--wp-includes/js/tinymce/plugins/media/js/media.js21
-rw-r--r--wp-includes/js/tinymce/plugins/media/media.htm14
-rw-r--r--wp-includes/js/tinymce/plugins/paste/blank.htm44
-rw-r--r--wp-includes/js/tinymce/plugins/paste/css/blank.css28
-rw-r--r--wp-includes/js/tinymce/plugins/paste/css/pasteword.css6
-rw-r--r--wp-includes/js/tinymce/plugins/paste/editor_plugin.js2
-rw-r--r--wp-includes/js/tinymce/plugins/paste/pastetext.htm68
-rw-r--r--wp-includes/js/tinymce/plugins/paste/pasteword.htm58
-rw-r--r--wp-includes/js/tinymce/plugins/safari/editor_plugin.js2
-rwxr-xr-xwp-includes/js/tinymce/plugins/spellchecker/config.php42
-rwxr-xr-xwp-includes/js/tinymce/plugins/spellchecker/css/content.css2
-rwxr-xr-xwp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js2
-rw-r--r--wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js12
-rw-r--r--wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css167
-rw-r--r--wp-includes/js/tinymce/plugins/wpeditimage/editimage.html262
-rw-r--r--wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js138
-rw-r--r--wp-includes/js/tinymce/plugins/wpeditimage/img/delete.pngbin0 -> 1638 bytes
-rw-r--r--wp-includes/js/tinymce/plugins/wpeditimage/img/image.pngbin0 -> 3701 bytes
-rw-r--r--wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js471
-rw-r--r--wp-includes/js/tinymce/themes/advanced/about.htm6
-rw-r--r--wp-includes/js/tinymce/themes/advanced/anchor.htm4
-rw-r--r--wp-includes/js/tinymce/themes/advanced/charmap.htm4
-rw-r--r--wp-includes/js/tinymce/themes/advanced/color_picker.htm6
-rw-r--r--wp-includes/js/tinymce/themes/advanced/editor_template.js2
-rw-r--r--wp-includes/js/tinymce/themes/advanced/image.htm8
-rw-r--r--wp-includes/js/tinymce/themes/advanced/img/icons.gifbin11532 -> 11505 bytes
-rw-r--r--wp-includes/js/tinymce/themes/advanced/js/color_picker.js12
-rw-r--r--wp-includes/js/tinymce/themes/advanced/js/image.js2
-rw-r--r--wp-includes/js/tinymce/themes/advanced/link.htm10
-rw-r--r--wp-includes/js/tinymce/themes/advanced/skins/default/content.css5
-rw-r--r--wp-includes/js/tinymce/themes/advanced/skins/o2k7/content.css5
-rw-r--r--wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css2
-rw-r--r--wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css2
-rw-r--r--wp-includes/js/tinymce/themes/advanced/source_editor.htm4
-rw-r--r--wp-includes/js/tinymce/tiny_mce.js2
-rw-r--r--wp-includes/js/tinymce/tiny_mce_config.php18
-rw-r--r--wp-includes/js/tinymce/tiny_mce_ext.js3
-rw-r--r--wp-includes/js/tinymce/tiny_mce_popup.js4
-rw-r--r--wp-includes/js/tinymce/utils/editable_selects.js122
-rw-r--r--wp-includes/js/tinymce/utils/form_utils.js398
-rw-r--r--wp-includes/js/tinymce/utils/mclayer.js420
-rw-r--r--wp-includes/js/tinymce/utils/mctabs.js150
-rw-r--r--wp-includes/js/tinymce/utils/validate.js438
-rw-r--r--wp-includes/js/tinymce/wp-mce-help.php8
-rw-r--r--wp-includes/kses.php4
-rw-r--r--wp-includes/l10n.php32
-rw-r--r--wp-includes/link-template.php92
-rw-r--r--wp-includes/media.php9
-rw-r--r--wp-includes/pluggable.php274
-rw-r--r--wp-includes/plugin.php7
-rw-r--r--wp-includes/post-template.php169
-rw-r--r--wp-includes/post.php505
-rw-r--r--wp-includes/query.php86
-rw-r--r--wp-includes/rss.php19
-rw-r--r--wp-includes/script-loader.php688
-rw-r--r--wp-includes/shortcodes.php17
-rw-r--r--wp-includes/taxonomy.php19
-rw-r--r--wp-includes/template-loader.php6
-rw-r--r--wp-includes/theme.php50
-rw-r--r--wp-includes/user.php31
-rw-r--r--wp-includes/version.php4
-rw-r--r--wp-includes/widgets.php51
-rw-r--r--wp-includes/wp-db.php17
-rw-r--r--wp-includes/wp-diff.php318
-rw-r--r--wp-links-opml.php14
-rw-r--r--wp-load.php50
-rw-r--r--wp-login.php104
-rw-r--r--wp-mail.php12
-rw-r--r--wp-pass.php10
-rw-r--r--wp-rdf.php17
-rw-r--r--wp-rss.php15
-rw-r--r--wp-rss2.php13
-rw-r--r--wp-settings.php142
-rw-r--r--wp-trackback.php15
-rw-r--r--xmlrpc.php189
242 files changed, 12120 insertions, 5281 deletions
diff --git a/index.php b/index.php
index e5076a8..7028fe8 100644
--- a/index.php
+++ b/index.php
@@ -1,5 +1,18 @@
<?php
-/* Short and sweet */
+/**
+ * Front to the WordPress application. This file doesn't do anything, but loads
+ * wp-blog-header.php which does and tells WordPress to load the theme.
+ *
+ * @package WordPress
+ */
+
+/**
+ * Tells WordPress to load the WordPress theme and output it.
+ *
+ * @var bool
+ */
define('WP_USE_THEMES', true);
+
+/** Loads the WordPress Environment and Template */
require('./wp-blog-header.php');
?>
diff --git a/wp-activate.php b/wp-activate.php
index e8c7dc1..2623dbb 100644
--- a/wp-activate.php
+++ b/wp-activate.php
@@ -1,6 +1,9 @@
<?php
define( "WP_INSTALLING", true );
-require ('wp-config.php');
+
+/** Sets up the WordPress Environment. */
+require( dirname(__FILE__) . '/wp-load.php' );
+
require( 'wp-blog-header.php' );
require_once( ABSPATH . WPINC . '/registration.php');
diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php
index 663880e..aef321f 100644
--- a/wp-admin/admin-ajax.php
+++ b/wp-admin/admin-ajax.php
@@ -1,7 +1,7 @@
<?php
define('DOING_AJAX', true);
-require_once('../wp-config.php');
+require_once('../wp-load.php');
require_once('includes/admin.php');
if ( !is_user_logged_in() )
@@ -15,7 +15,7 @@ if ( isset($_GET['action']) && 'ajax-tag-search' == $_GET['action'] ) {
if ( strstr( $s, ',' ) )
die; // it's a multiple tag insert, we won't find anything
- $results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%$s%')" );
+ $results = $wpdb->get_col( $wpdb->prepare("SELECT name FROM $wpdb->terms WHERE name LIKE (%s)", '%' . $s . '%') );
echo join( $results, "\n" );
die;
}
@@ -462,10 +462,11 @@ case 'add-user' :
$x->send();
break;
case 'autosave' : // The name of this action is hardcoded in edit_post()
- $nonce_age = check_ajax_referer( 'autosave', 'autosavenonce');
+ define( 'DOING_AUTOSAVE', true );
+
+ $nonce_age = check_ajax_referer( 'autosave', 'autosavenonce' );
global $current_user;
- $_POST['post_status'] = 'draft';
$_POST['post_category'] = explode(",", $_POST['catslist']);
$_POST['tags_input'] = explode(",", $_POST['tags_input']);
if($_POST['post_type'] == 'page' || empty($_POST['post_category']))
@@ -479,8 +480,9 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
$supplemental = array();
- $id = 0;
+ $id = $revision_id = 0;
if($_POST['post_ID'] < 0) {
+ $_POST['post_status'] = 'draft';
$_POST['temp_ID'] = $_POST['post_ID'];
if ( $do_autosave ) {
$id = wp_write_post();
@@ -511,8 +513,18 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
if ( !current_user_can('edit_post', $post_ID) )
die(__('You are not allowed to edit this post.'));
}
+
if ( $do_autosave ) {
- $id = edit_post();
+ // Drafts are just overwritten by autosave
+ if ( 'draft' == $post->post_status ) {
+ $id = edit_post();
+ } else { // Non drafts are not overwritten. The autosave is stored in a special post revision.
+ $revision_id = wp_create_post_autosave( $post->ID );
+ if ( is_wp_error($revision_id) )
+ $id = $revision_id;
+ else
+ $id = $post->ID;
+ }
$data = $message;
} else {
$id = $post->ID;
diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php
index 0185a98..7073e2f 100644
--- a/wp-admin/admin-header.php
+++ b/wp-admin/admin-header.php
@@ -5,6 +5,7 @@ if ( $editing ) {
if ( user_can_richedit() )
wp_enqueue_script( 'wp_tiny_mce' );
}
+wp_enqueue_script( 'wp-gears' );
$min_width_pages = array( 'post.php', 'post-new.php', 'page.php', 'page-new.php', 'widgets.php', 'comment.php', 'link.php' );
$the_current_page = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
@@ -28,14 +29,13 @@ get_admin_page_title();
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
<title><?php bloginfo('name') ?> &rsaquo; <?php echo wp_specialchars( strip_tags( $title ) ); ?> &#8212; WordPress</title>
<?php
+
wp_admin_css( 'css/global' );
wp_admin_css();
wp_admin_css( 'css/colors' );
+wp_admin_css( 'css/ie' );
+
?>
-<!--[if gte IE 6]>
-<?php wp_admin_css( 'css/ie' );
-?>
-<![endif]-->
<script type="text/javascript">
//<![CDATA[
addLoadEvent = function(func) {if (typeof jQuery != "undefined") jQuery(document).ready(func); else if (typeof wpOnload!='function'){wpOnload=func;} else {var oldonload=wpOnload; wpOnload=function(){oldonload();func();}}};
@@ -44,26 +44,74 @@ addLoadEvent = function(func) {if (typeof jQuery != "undefined") jQuery(document
<?php if ( ($parent_file != 'link-manager.php') && ($parent_file != 'options-general.php') && $ie6_no_scrollbar ) : ?>
<style type="text/css">* html { overflow-x: hidden; }</style>
<?php endif;
-if ( isset($page_hook) )
- do_action('admin_print_scripts-' . $page_hook);
-else if ( isset($plugin_page) )
- do_action('admin_print_scripts-' . $plugin_page);
-do_action('admin_print_scripts');
+
+$hook_suffixes = array();
if ( isset($page_hook) )
- do_action('admin_head-' . $page_hook);
+ $hook_suffixes[] = "-$page_hook";
else if ( isset($plugin_page) )
- do_action('admin_head-' . $plugin_page);
-do_action('admin_head');
+ $hook_suffixes[] = "-$plugin_page";
+else if ( isset($pagenow) )
+ $hook_suffixes[] = "-$pagenow";
+
+$hook_suffixes[] = '';
+
+foreach ( $hook_suffixes as $hook_suffix )
+ do_action("admin_print_styles$hook_suffix"); // do_action( 'admin_print_styles-XXX' ); do_action( 'admin_print_styles' );
+foreach ( $hook_suffixes as $hook_suffix )
+ do_action("admin_print_scripts$hook_suffix"); // do_action( 'admin_print_scripts-XXX' ); do_action( 'admin_print_scripts' );
+foreach ( $hook_suffixes as $hook_suffix )
+ do_action("admin_head$hook_suffix"); // do_action( 'admin_head-XXX' ); do_action( 'admin_head' );
+unset($hook_suffixes, $hook_suffix);
+
?>
</head>
<body class="wp-admin <?php echo apply_filters( 'admin_body_class', '' ); ?>">
<div id="wpwrap">
<div id="wpcontent">
<div id="wphead">
-<h1><?php bloginfo('name'); ?><span id="viewsite"><a href="<?php echo trailingslashit( get_option('home') ); ?>"><?php _e('Visit Site') ?></a></span></h1>
+<h1><?php if ( '' == get_bloginfo('name') ) echo '&nbsp;'; else echo get_bloginfo('name'); ?><span id="viewsite"><a href="<?php echo trailingslashit( get_option('home') ); ?>"><?php _e('Visit Site') ?></a></span></h1>
</div>
-<div id="user_info"><p><?php printf(__('Howdy, <a href="%1$s">%2$s</a>!'), 'profile.php', $user_identity) ?> | <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a> | <?php _e('<a href="http://codex.wordpress.org/">Help</a>') ?> | <?php _e('<a href="http://wordpress.org/support/">Forums</a>') ?></p></div>
+
+<?php
+$gears_compat = false;
+
+if ( ($is_gecko || $is_winIE) && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'webkit') === false ) {
+ $gears_compat = true;
+?>
+ <div id="gears-info-box" class="info-box" style="display:none;">
+ <img src="images/gear.png" title="Gear" alt="" class="gears-img" />
+ <div id="gears-msg1">
+ <h3 class="info-box-title"><?php _e('Speed up WordPress'); ?></h3>
+ <p><?php _e('WordPress has support for Gears that adds new features to your web browser.'); ?><br />
+ <a href="http://gears.google.com/" target="_blank" style="font-weight:normal;"><?php _e('More information...'); ?></a></p>
+ <p><?php _e('After installing and enabling it, most of the WordPress images, scripts and CSS files will be stored on this computer. This will speed up page loading.'); ?></p>
+ <p><strong><?php _e('Please make sure you are not using a public or shared computer.'); ?></strong></p>
+ <div class="submit"><button onclick="window.location = 'http://gears.google.com/?action=install&amp;return=<?php echo urlencode( admin_url() ); ?>';" class="button"><?php _e('Install Now'); ?></button>
+ <button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';">Cancel</button></div>
+ </div>
+
+ <div id="gears-msg2" style="display:none;">
+ <h3 class="info-box-title"><?php _e('Gears Status'); ?></h3>
+ <p><?php _e('Gears is installed on this computer but is not enabled for use with WordPress.'); ?></p>
+ <p><?php _e('To enable it, make sure this web site is not on the denied list in Gears Settings under your browser\'s Tools menu, then click the button below.'); ?></p>
+ <p><strong><?php _e('However if this is a public or shared computer, Gears should not be enabled.'); ?></strong></p>
+ <div class="submit"><button class="button" onclick="wpGears.getPermission();"><?php _e('Enable Gears'); ?></button>
+ <button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';">Cancel</button></div>
+ </div>
+
+ <div id="gears-msg3" style="display:none;">
+ <h3 class="info-box-title"><?php _e('Gears Status'); ?></h3>
+ <p><?php _e('Gears is installed and enabled on this computer. You can disable it from your browser Tools menu.'); ?></p>
+ <p><?php _e('If there are any errors, try disabling Gears, then reload the page and enable it again.'); ?></p>
+ <p><?php _e('Local storage status:'); ?> <span id="gears-wait"><span style="color:#f00;"><?php _e('Please wait! Updating files:'); ?></span> <span id="gears-upd-number"></span></span></p>
+ <div class="submit"><button class="button" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Close'); ?></button></div>
+ </div>
+ </div>
+
+<?php } ?>
+
+<div id="user_info"><p><?php printf(__('Howdy, <a href="%1$s">%2$s</a>!'), 'profile.php', $user_identity) ?> | <a href="<?php echo site_url('wp-login.php?action=logout', 'login') ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a> | <?php _e('<a href="http://codex.wordpress.org/">Help</a>') ?> | <?php _e('<a href="http://wordpress.org/support/">Forums</a>') ?> | <?php if ( $gears_compat ) { ?><span id="gears-menu"><a href="#" onclick="wpGears.message(1);return false;"><?php _e('Speed up!') ?></a></span><?php } ?></p></div>
<?php
require(ABSPATH . 'wp-admin/menu-header.php');
diff --git a/wp-admin/admin.php b/wp-admin/admin.php
index 1385e87..e9591e8 100644
--- a/wp-admin/admin.php
+++ b/wp-admin/admin.php
@@ -2,9 +2,9 @@
define('WP_ADMIN', TRUE);
if ( defined('ABSPATH') )
- require_once( ABSPATH . 'wp-config.php');
+ require_once(ABSPATH . 'wp-load.php');
else
- require_once('../wp-config.php');
+ require_once('../wp-load.php');
if ( get_option('db_version') != $wp_db_version ) {
require_once('../wp-includes/class-snoopy.php');
@@ -27,8 +27,8 @@ $time_format = get_option('time_format');
wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'popuptitle', 'popupurl', 'text', 'trackback', 'pingback'));
-wp_admin_css_color('classic', __('Classic'), get_option( 'siteurl' ) . "/wp-admin/css/colors-classic.css", array('#07273E', '#14568A', '#D54E21', '#2683AE'));
-wp_admin_css_color('fresh', __('Fresh'), get_option( 'siteurl' ) . "/wp-admin/css/colors-fresh.css", array('#464646', '#CEE1EF', '#D54E21', '#2683AE'));
+wp_admin_css_color('classic', __('Classic'), admin_url("css/colors-classic.css"), array('#07273E', '#14568A', '#D54E21', '#2683AE'));
+wp_admin_css_color('fresh', __('Fresh'), admin_url("css/colors-fresh.css"), array('#464646', '#CEE1EF', '#D54E21', '#2683AE'));
wp_enqueue_script( 'common' );
wp_enqueue_script( 'jquery-color' );
diff --git a/wp-admin/async-upload.php b/wp-admin/async-upload.php
index c1c0f0d..59feb8c 100644
--- a/wp-admin/async-upload.php
+++ b/wp-admin/async-upload.php
@@ -5,9 +5,9 @@
*/
if ( defined('ABSPATH') )
- require_once( ABSPATH . 'wp-config.php');
+ require_once(ABSPATH . 'wp-load.php');
else
- require_once('../wp-config.php');
+ require_once('../wp-load.php');
// Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead
if ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
diff --git a/wp-admin/categories.php b/wp-admin/categories.php
index 945da0c..473a3a4 100644
--- a/wp-admin/categories.php
+++ b/wp-admin/categories.php
@@ -126,6 +126,7 @@ endif; ?>
<?php endif; ?>
<p id="post-search">
+ <label class="hidden" for="post-search-input"><?php _e('Search Categories'); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
<input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
</p>
@@ -147,7 +148,7 @@ endif; ?>
<table class="widefat">
<thead>
<tr>
- <th scope="col" class="check-column"><input type="checkbox" onclick="checkAll(document.getElementById('posts-filter'));" /></th>
+ <th scope="col" class="check-column"><input type="checkbox" /></th>
<th scope="col"><?php _e('Name') ?></th>
<th scope="col"><?php _e('Description') ?></th>
<th scope="col" class="num"><?php _e('Posts') ?></th>
diff --git a/wp-admin/comment.php b/wp-admin/comment.php
index 4aa9749..d1e394e 100644
--- a/wp-admin/comment.php
+++ b/wp-admin/comment.php
@@ -21,7 +21,7 @@ case 'editcomment' :
$title = __('Edit Comment');
wp_enqueue_script('comment');
- //wp_enqueue_script('thickbox');
+
require_once('admin-header.php');
$comment_id = absint( $_GET['c'] );
@@ -78,7 +78,7 @@ if ( 'spam' == $_GET['dt'] ) {
<table width="100%">
<tr>
-<td><input type='button' class="button" value='<?php _e('No'); ?>' onclick="self.location='<?php echo get_option('siteurl'); ?>/wp-admin/edit-comments.php';" /></td>
+<td><input type='button' class="button" value='<?php _e('No'); ?>' onclick="self.location='<?php echo admin_url('edit-comments.php'); ?>" /></td>
<td class="textright"><input type='submit' class="button" value='<?php echo $button; ?>' /></td>
</tr>
</table>
@@ -146,7 +146,7 @@ case 'deletecomment' :
else if ( '' != wp_get_original_referer() && false == $noredir )
wp_redirect( wp_get_original_referer() );
else
- wp_redirect( get_option('siteurl') . '/wp-admin/edit-comments.php' );
+ wp_redirect( admin_url('edit-comments.php') );
die;
break;
@@ -171,7 +171,7 @@ case 'unapprovecomment' :
if ( '' != wp_get_referer() && false == $noredir )
wp_redirect( wp_get_referer() );
else
- wp_redirect( get_option('siteurl') . '/wp-admin/edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments' );
+ wp_redirect( admin_url('edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
exit();
break;
@@ -196,7 +196,7 @@ case 'approvecomment' :
if ( '' != wp_get_referer() && false == $noredir )
wp_redirect( wp_get_referer() );
else
- wp_redirect( get_option('siteurl') . '/wp-admin/edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments' );
+ wp_redirect( admin_url('edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
exit();
break;
diff --git a/wp-admin/css/colors-classic.css b/wp-admin/css/colors-classic.css
index 6f83c66..83a1141 100644
--- a/wp-admin/css/colors-classic.css
+++ b/wp-admin/css/colors-classic.css
@@ -2,7 +2,7 @@ a.page-numbers:hover {
border-color: #999;
}
-body {
+body, .form-table .pre {
background-color: #fff;
color: #333;
}
@@ -37,7 +37,7 @@ input.disabled, textarea.disabled {
color: #fff;
}
-ul#category-tabs li.ui-tabs-selected, li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form {
+ul#category-tabs li.ui-tabs-selected, li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form, h3.info-box-title {
background-color: #cfebf7;
}
@@ -63,7 +63,7 @@ ul#widget-list li.widget-list-item h4.widget-title {
color: #000;
}
-ul.widget-control-list .sorthelper {
+.sorthelper {
background-color: #ccf3fa;
}
@@ -204,11 +204,11 @@ ul.widget-control-list .sorthelper {
border-color: #535353;
}
-.submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover {
+.submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover, #media-upload a.del-link:hover {
color: #d54e21;
}
-#adminmenu a:hover, #sidemenu a:hover {
+#adminmenu a:hover, #sidemenu a:hover, .ui-tabs-nav a:hover {
color: #97c4d8;
}
@@ -239,7 +239,8 @@ ul.widget-control-list .sorthelper {
border-bottom-color: #999;
}
-.submitbox .submitdelete:hover {
+.submitbox .submitdelete:hover,
+#media-upload a.delete:hover {
color: #fff;
background-color: #f00;
border-bottom-color: #f00;
@@ -291,11 +292,11 @@ ul.widget-control-list .sorthelper {
color: #5a5a5a;
}
-#poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, a {
+#poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, #media-upload a.del-link, #media-upload a.delete, a {
color: #2e7ca0;
}
-#adminmenu a {
+#adminmenu a, .ui-tabs-nav a {
color: #cfebf6;
}
@@ -303,7 +304,7 @@ ul.widget-control-list .sorthelper {
color: #2782af
}
/* Because we don't want visited on these links */
-#adminmenu a.current, #sidemenu a.current {
+#adminmenu a.current, #sidemenu a.current, body.press-this .ui-tabs-selected a, body.press-this .ui-tabs-selected a:hover {
background-color: #fff;
border-color: #07273e;
border-bottom-color: #fff;
@@ -414,11 +415,11 @@ input.readonly {
background-color: #fff;
}
-#plugins .active {
+.plugins .active {
background-color: #BBEEBB;
}
-#plugins .togl {
+.plugins .togl {
border-right-color: #ccc;
}
@@ -426,7 +427,7 @@ input.readonly {
background-color: #ffffe0;
}
-#plugins tr {
+.plugins tr {
background-color: #fff;
}
@@ -550,11 +551,6 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
color: #f00;
}
-#media-upload a.delete {
- color: #888;
-}
-
-
/* TinyMCE */
.wp_themeSkin *,
.wp_themeSkin a:hover,
@@ -565,7 +561,7 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
}
/* Containers */
-.wp_themeSkin table {
+.wp_themeSkin table, #wp_editbtns {
background: #83B4D5;
}
@@ -717,3 +713,18 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
background-color: #ddd;
color: #333;
}
+
+/* Diff */
+
+table.diff .diff-deletedline {
+ background-color: #ffdddd;
+}
+table.diff .diff-deletedline del {
+ background-color: #ff9999;
+}
+table.diff .diff-addedline {
+ background-color: #ddffdd;
+}
+table.diff .diff-addedline ins {
+ background-color: #99ff99;
+}
diff --git a/wp-admin/css/colors-fresh.css b/wp-admin/css/colors-fresh.css
index 1332c37..1d59940 100644
--- a/wp-admin/css/colors-fresh.css
+++ b/wp-admin/css/colors-fresh.css
@@ -2,7 +2,7 @@ a.page-numbers:hover {
border-color: #999;
}
-body {
+body, .form-table .pre {
background-color: #fff;
color: #333;
}
@@ -41,7 +41,7 @@ input.disabled, textarea.disabled {
color: #fff;
}
-li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form {
+li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form, h3.info-box-title {
background-color: #eaf3fa;
}
@@ -63,7 +63,7 @@ ul#widget-list li.widget-list-item h4.widget-title {
color: #000;
}
-ul.widget-control-list .sorthelper {
+.sorthelper {
background-color: #ccf3fa;
}
@@ -196,7 +196,7 @@ ul.widget-control-list .sorthelper {
border-color: #535353;
}
-.submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #adminmenu a:hover, #sidemenu a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover, #media-upload a.delete:hover {
+.submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #adminmenu a:hover, #sidemenu a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover, #media-upload a.delete:hover, #media-upload a.del-link:hover, .ui-tabs-nav a:hover {
color: #d54e21;
}
@@ -226,7 +226,8 @@ ul.widget-control-list .sorthelper {
border-bottom-color: #999;
}
-.submitbox .submitdelete:hover {
+.submitbox .submitdelete:hover,
+#media-upload a.delete:hover {
color: #fff;
background-color: #f00;
border-bottom-color: #f00;
@@ -278,12 +279,12 @@ ul.widget-control-list .sorthelper {
color: #666;
}
-#adminmenu a, #submenu a, #poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, a {
+#adminmenu a, #submenu a, #poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, #media-upload a.del-link, #media-upload a.delete, .ui-tabs-nav a, a {
color: #2583ad;
}
/* Because we don't want visited on these links */
-#adminmenu a.current, #sidemenu a.current {
+#adminmenu a.current, #sidemenu a.current, body.press-this .ui-tabs-selected a, body.press-this .ui-tabs-selected a:hover {
background-color: #fff;
border-color: #c6d9e9;
border-bottom-color: #fff;
@@ -383,11 +384,11 @@ input.readonly {
background-color: #fff;
}
-#plugins .active {
+.plugins .active {
background-color: #e7f7d3;
}
-#plugins .togl {
+.plugins .togl {
border-right-color: #ccc;
}
@@ -395,7 +396,7 @@ input.readonly {
background-color: #ffffe0;
}
-#plugins tr {
+.plugins tr {
background-color: #fff;
}
@@ -532,7 +533,7 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
}
/* Containers */
-.wp_themeSkin table {
+.wp_themeSkin table, #wp_editbtns {
background: #cee1ef;
}
@@ -688,3 +689,18 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
background-color: #ddd;
color: #333;
}
+
+/* Diff */
+
+table.diff .diff-deletedline {
+ background-color: #ffdddd;
+}
+table.diff .diff-deletedline del {
+ background-color: #ff9999;
+}
+table.diff .diff-addedline {
+ background-color: #ddffdd;
+}
+table.diff .diff-addedline ins {
+ background-color: #99ff99;
+}
diff --git a/wp-admin/css/global-rtl.css b/wp-admin/css/global-rtl.css
new file mode 100644
index 0000000..a34f7ad
--- /dev/null
+++ b/wp-admin/css/global-rtl.css
@@ -0,0 +1,28 @@
+/* styles for use by people extending the WordPress interface */
+.alignleft { float: right; }
+.alignright { float: left; }
+
+.textleft { text-align: right; }
+.textright { text-align: left; }
+
+.widefat td {
+ padding: 7px 10px 9px 15px;
+}
+
+.widefat th {
+ padding: 9px 10px 6px 15px;
+ text-align: right;
+}
+
+.widefat th input {
+ margin: 0 8px 0 0;
+}
+
+.widefat .check-column {
+ text-align: left;
+}
+
+.wrap h2 {
+ margin: 5px -4px 0 0;
+ padding: 0 0 7px 280px;
+}
diff --git a/wp-admin/css/global.css b/wp-admin/css/global.css
index 926aa88..295adea 100644
--- a/wp-admin/css/global.css
+++ b/wp-admin/css/global.css
@@ -194,3 +194,7 @@ th.check-column + th, th.check-column + td {
padding-bottom: 7px;
padding-right: 280px;
}
+
+.wrap h2.long-header {
+ padding-right: 0;
+}
diff --git a/wp-admin/css/ie.css b/wp-admin/css/ie.css
index 39ef254..e4d0355 100644
--- a/wp-admin/css/ie.css
+++ b/wp-admin/css/ie.css
@@ -111,7 +111,10 @@ div#dashboard-widgets {
.tablenav-pages {
display: block;
margin-top: -3px;
+}
+table.ie-fixed {
+ table-layout: fixed;
}
#post-search .button, #widget-search .button {
diff --git a/wp-admin/css/media.css b/wp-admin/css/media.css
index 7d46c1c..225fa84 100644
--- a/wp-admin/css/media.css
+++ b/wp-admin/css/media.css
@@ -222,6 +222,11 @@ abbr.required {
min-height: 36px;
width: 100%;
}
+
+#media-upload .ui-sortable .media-item {
+ cursor: move;
+}
+
.filename {
line-height: 36px;
margin-left: 10px;
@@ -233,6 +238,7 @@ abbr.required {
padding: 5px;
width: 100%;
clear: both;
+ cursor: default;
}
#media-upload .describe th.label {
padding-top: .5em;
@@ -260,3 +266,13 @@ abbr.required {
padding:2px;
vertical-align:top;
}
+
+#media-upload a.delete,
+#media-upload a.del-link {
+ padding: 0 3px 1px;
+}
+
+#media-upload .del-attachment {
+ display: none;
+ margin: 5px 0;
+}
diff --git a/wp-admin/css/press-this.css b/wp-admin/css/press-this.css
new file mode 100644
index 0000000..7a01f9a
--- /dev/null
+++ b/wp-admin/css/press-this.css
@@ -0,0 +1,451 @@
+body {
+ font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
+ color: #333;
+ margin: 0px;
+ padding: 0px;
+}
+/* Tabs */
+@media projection , screen {
+ .ui-tabs-hide {
+ display: none;
+ }
+}
+
+@media print {
+ .ui-tabs-nav {
+ display: none;
+ }
+}
+
+.ui-tabs-nav {
+ list-style: none;
+ border-bottom: 1px solid #C6D9E9;
+ padding-left: 8px;
+ margin-bottom: .5em;
+ margin-top: -2em;
+}
+
+/* Additional IE specific bug fixes... */
+* html .ui-tabs-nav { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
+ display: inline-block;
+}
+
+* :first-child+html .ui-tabs-nav {
+ /* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */
+ display: inline-block;
+}
+
+.ui-tabs-nav:after {
+ /* clearing without presentational markup, IE gets extra treatment */
+ display: block;
+ clear: both;
+ content: " ";
+}
+
+.ui-tabs-nav li {
+ float: left;
+ margin: 0;
+ height: 2em;
+ line-height: 2em;
+}
+
+.ui-tabs-nav a,.ui-tabs-nav a span {
+ display: block;
+}
+
+.ui-tabs-nav a {
+ margin: 1px 0 0;
+ /* position: relative makes opacity fail for disabled tab in IE */
+ padding-left: 0;
+ color: #27537a;
+ font-weight: bold;
+ line-height: 2em;
+ text-align: center;
+ text-decoration: none;
+ white-space: nowrap; /* required in IE 6 */
+ outline: 0; /* prevent dotted border in Firefox */
+ padding: 0 1em;
+}
+
+.ui-tabs-nav .ui-tabs-selected a {
+ position: relative;
+ top: 1px;
+ z-index: 2;
+ margin-top: 0;
+ -moz-border-radius-topleft: 4px;
+ -moz-border-radius-topright: 4px;
+ -webkit-border-top-left-radius: 4px;
+ -webkit-border-top-right-radius: 4px;
+ border-style: solid;
+ border-width: 1px;
+ background: white;
+ border-bottom-width: 2px;
+ margin-top: -2px;
+}
+
+.ui-tabs-nav a:hover,.ui-tabs-nav a:focus,.ui-tabs-nav a:active,
+.ui-tabs-nav .ui-tabs-selected a:link,.ui-tabs-nav .ui-tabs-selected a:visited {
+ cursor: pointer;
+}
+
+#wphead {
+ border-top: none;
+}
+
+.button {
+font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
+padding: 3px 5px;
+font-size: 12px;
+line-height: 1.5em;
+border-width: 1px;
+border-style: solid;
+-moz-border-radius: 3px;
+-khtml-border-radius: 3px;
+-webkit-border-radius: 3px;
+border-radius: 3px;
+cursor: pointer;
+margin-left: 5px;
+text-decoration: none;
+}
+
+.howto {
+font-size: 11px;
+}
+#newtag { padding: 3px; }
+
+#wphead {
+ height: 2em;
+ padding-top: 8px;
+}
+
+#wphead #viewsite {
+ position: absolute;
+ margin-top: 12px;
+ margin-left: 10px;
+}
+
+#viewsite {
+ position: relative;
+ right: 8px;
+ top: 6px;
+ margin: 0 !important;
+}
+
+#wphead #viewsite a {
+ font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana,
+ sans-serif;
+ padding: 3px 4px;
+ display: block;
+ letter-spacing: normal;
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 3px;
+ -khtml-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ text-decoration: none;
+}
+
+#previewview {
+ padding-top: 8px !important;
+ padding-bottom: 8px !important;
+}
+
+h1 {
+ font-size: .75em;
+ line-height: 2.666em;
+ top: .5em;
+ right: 0;
+ margin: 0 !important;
+ padding: 0 !important;
+ width: 236px;
+ background: none;
+}
+
+input.text {
+ border: 0pt none;
+ outline-color: -moz-use-text-color;
+ outline-style: none;
+ outline-width: medium;
+ padding: 0pt;
+ width: 100%;
+ border-style: solid;
+ color: #333333;
+}
+
+.titlewrap {
+ border-style: solid;
+ border-width: 1px;
+ padding: 2px 3px;
+ border-color: #CCCCCC;
+}
+
+div#container {
+ margin: 0;
+ min-width: 500px;
+}
+
+div#posting {
+ padding-left: 16px;
+ position: absolute;
+ z-index: 1;
+ width: 66%;
+}
+
+div#posting h2 {
+ margin: .5em 0 .25em 0;
+ font-size: 12px;
+ padding: 3px;
+ background: ;
+}
+
+div#container form {
+ margin: 0px;
+ padding: 0px;
+}
+
+div#categories {
+ font-size: 85%;
+ position: absolute;
+ top: 50px;
+ right: 16px;
+ width: 27%;
+ z-index: 2;
+}
+
+div#categories h2 {
+ color: #333;
+ font-size: 12px;
+ margin: .5em 0 0 1em;
+ padding: 0;
+}
+
+#categories-all {
+ overflow: auto;
+ padding: 1em;
+ height: 15em;
+}
+
+#categories ul {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+}
+
+.editor-container {
+ border-width: 1px;
+ border-color: #ccc;
+ border-style: solid;
+ margin-bottom: 1em;
+}
+
+#tagsdiv #newtag {
+ margin-right: 5px;
+ width: 16em;
+}
+
+#tagchecklist {
+ padding-left: 1em;
+ margin-bottom: 1em;
+ font-size: 12px;
+ overflow: auto;
+}
+
+#tagchecklist strong {
+ position: absolute;
+ font-size: .75em;
+}
+
+#tagchecklist span {
+ margin-right: .5em;
+ margin-left: 10px;
+ display: block;
+ float: left;
+ font-size: 11px;
+ line-height: 1.8em;
+ white-space: nowrap;
+ cursor: default;
+}
+
+#tagchecklist span a {
+ margin: 6px 0pt 0pt -9px;
+ cursor: pointer;
+ width: 10px;
+ height: 10px;
+ display: block;
+ float: left;
+ text-indent: -9999px;
+ overflow: hidden;
+ position: absolute;
+}
+
+.howto {
+ font-style: italic;
+ display: block;
+}
+
+#post_title {
+ width: 99%;
+}
+
+#img_container {
+ background-color: #fff;
+ overflow: auto;
+ height: 100px;
+}
+
+#img_container img {
+ width: 75px;
+ height: 75px;
+ padding: 2px;
+ background-color: #f4f4f4;
+ margin-right: 7px;
+ margin-bottom: 7px;
+ cursor: pointer;
+}
+.submit {
+-moz-border-radius-bottomleft: 3px;
+-khtml-border-bottom-left-radius: 3px;
+-webkit-border-bottom-left-radius: 3px;
+border-bottom-left-radius: 3px;
+-moz-border-radius-bottomright: 3px;
+-khtml-border-bottom-right-radius: 3px;
+-webkit-border-bottom-right-radius: 3px;
+border-bottom-right-radius: 3px;
+margin: 0;
+padding: 0;
+}
+.submitbox {
+ width: 100%;
+ float: right;
+}
+
+.submitbox .submit a:hover {
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+}
+
+.submitbox .submit input {
+ border: none;
+ text-align: left;
+ padding: 12px 10px 10px 10px;
+ font-size: 12px;
+ margin: 10px;
+
+ -moz-border-radius: 3px;
+ -khtml-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+
+.submitbox #previewview {
+ padding: 15px 10px;
+ -moz-border-radius-topleft: 3px;
+ -khtml-border-top-left-radius: 3px;
+ -webkit-border-top-left-radius: 3px;
+ border-top-left-radius: 3px;
+ -moz-border-radius-topright: 3px;
+ -khtml-border-top-right-radius: 3px;
+ -webkit-border-top-right-radius: 3px;
+ border-top-right-radius: 3px;
+}
+
+.hidden {
+ display: none;
+}
+
+.video_split #extra_fields {
+ width: 27%;
+ height: 300px;
+ float: left;
+}
+
+#embed_code {
+ border: 0;
+ width: 99%;
+ height: 200px;
+}
+.video_split .editor_area {
+ width: 70%;
+ float: right;
+}
+
+#jaxtag {
+ clear: both;
+ padding-left: 1em;
+}
+
+.ac_results {
+ padding: 0;
+ margin: 0;
+ list-style: none;
+ position: absolute;
+ z-index: 10000;
+ display: none;
+ border-width: 1px;
+ border-style: solid;
+}
+
+.ac_results li {
+ padding: 2px 5px;
+ white-space: nowrap;
+ text-align: left;
+}
+
+.ac_over {
+ cursor: pointer;
+}
+
+.ac_match {
+ text-decoration: underline;
+}
+
+
+.photolist {
+display: none;
+}
+
+#extra_fields small {
+display: block;
+margin-top: .5em;
+padding-bottom: .25em;
+}
+
+#TB_ajaxContent #options {
+position: absolute;
+top: 20px;
+right: 25px;
+background: white;
+padding: 5px;
+}
+#TB_ajaxContent h3 {
+margin-bottom: .25em;
+}
+
+.updated {
+ margin: 0;
+ margin-left: 15px;
+ margin-right: 15px;
+ padding: 0;
+ max-width: 980px;
+ border-width: 1px;
+ border-style: solid;
+ padding: 0 0.6em;
+ max-width: 950px;
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+
+.updated p, .error p {
+ margin: 0.6em 0;
+}
+
+.updated a, .error a {
+ text-decoration: underline;
+}
+
+.updated a {
+ text-decoration: none;
+ padding-bottom: 2px;
+}
diff --git a/wp-admin/css/widgets-rtl.css b/wp-admin/css/widgets-rtl.css
index ece02b5..8dd3994 100644
--- a/wp-admin/css/widgets-rtl.css
+++ b/wp-admin/css/widgets-rtl.css
@@ -29,9 +29,12 @@ ul#widget-list li.widget-list-item div.widget-description {
margin-right:0;
margin-left:8px;
}
+h4.widget-title span {
+ float: right;
+}
h4.widget-title a {
- right:auto;
- left:1em;
+ float: left;
+ margin: 0 1em 0 0;
}
li.widget-list-control-item h4.widget-title a, #dragHelper li.widget-list-control-item h4.widget-title a, #draghelper li.widget-list-control-item h4.widget-title a:visited {
right:auto;
@@ -45,5 +48,4 @@ ul.widget-control-list div.widget-control-actions {
ul.widget-control-list h4.widget-title,
#dragHelper h4.widget-title {
text-align: right;
- padding: 0.4em 0.8em 0.4em 2.5em;
}
diff --git a/wp-admin/css/widgets.css b/wp-admin/css/widgets.css
index baeb851..f21f22a 100644
--- a/wp-admin/css/widgets.css
+++ b/wp-admin/css/widgets.css
@@ -45,10 +45,20 @@ ul#widget-list li.widget-list-item {
margin: 0;
border-bottom-width: 1px;
border-bottom-style: solid;
- background-color: transparent;
line-height: 1;
}
+h4.widget-title span {
+ float: left;
+}
+
+h4.widget-title a {
+ float: right;
+ text-decoration: underline;
+ border-bottom: none;
+ margin-left: 1em;
+}
+
ul#widget-list li.widget-list-item h4.widget-title {
position: relative;
margin: 0;
@@ -59,7 +69,7 @@ ul#widget-list li.widget-list-item h4.widget-title {
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
- border-radius: 3px;;
+ border-radius: 3px;
}
#dragHelper h4.widget-title {
@@ -108,7 +118,7 @@ li.widget-sortable h4 {
margin: 0;
cursor: move;
font-size: 13px;
- padding: 0.4em 2.5em 0.4em 0.8em;
+ padding: 0.4em 0.8em;
position: relative;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
@@ -127,13 +137,6 @@ li.widget-sortable h4 {
text-decoration: none;
}
-h4.widget-title a {
- position: absolute;
- right: 1em;
- text-decoration: underline;
- border-bottom: none;
-}
-
li.widget-list-control-item h4.widget-title a,
#dragHelper li.widget-list-control-item h4.widget-title a,
#draghelper li.widget-list-control-item h4.widget-title a:visited {
@@ -150,7 +153,6 @@ li.widget-list-control-item div.widget-control {
padding: 15px;
font-size: 11px;
position: relative;
- background-color: #CFEBF7;
}
li.widget-list-control-item div.widget-control p {
diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php
index c54d9a9..b1f583d 100644
--- a/wp-admin/custom-header.php
+++ b/wp-admin/custom-header.php
@@ -189,7 +189,7 @@ Event.observe( window, 'load', hide_text );
<div id="desc"><?php bloginfo('description');?></div>
</div>
<?php if ( !defined( 'NO_HEADER_TEXT' ) ) { ?>
-<form method="post" action="<?php echo get_option('siteurl') ?>/wp-admin/themes.php?page=custom-header&amp;updated=true">
+<form method="post" action="<?php echo admin_url('themes.php?page=custom-header&amp;updated=true') ?>">
<input type="button" value="<?php _e('Hide Text'); ?>" onclick="hide_text()" id="hidetext" />
<input type="button" value="<?php _e('Select a Text Color'); ?>" onclick="colorSelect($('textcolor'), 'pickcolor')" id="pickcolor" /><input type="button" value="<?php _e('Use Original Color'); ?>" onclick="colorDefault()" id="defaultcolor" />
<?php wp_nonce_field('custom-header') ?>
diff --git a/wp-admin/edit-category-form.php b/wp-admin/edit-category-form.php
index 6e32bda..a77d56e 100644
--- a/wp-admin/edit-category-form.php
+++ b/wp-admin/edit-category-form.php
@@ -26,7 +26,7 @@ if ( ! empty($cat_ID) ) {
<table class="form-table">
<tr class="form-field form-required">
<th scope="row" valign="top"><label for="cat_name"><?php _e('Category Name') ?></label></th>
- <td><input name="cat_name" id="cat_name" type="text" value="<?php echo attribute_escape($category->name); ?>" size="40" /><br />
+ <td><input name="cat_name" id="cat_name" type="text" value="<?php echo attribute_escape($category->name); ?>" size="40" aria-required="true" /><br />
<?php _e('The name is used to identify the category almost everywhere, for example under the post or in the category widget.'); ?></td>
</tr>
<tr class="form-field">
diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php
index c756efe..6bb04aa 100644
--- a/wp-admin/edit-comments.php
+++ b/wp-admin/edit-comments.php
@@ -12,8 +12,7 @@ if ( !empty( $_REQUEST['delete_comments'] ) ) {
$comments_deleted = $comments_approved = $comments_unapproved = $comments_spammed = 0;
foreach ($_REQUEST['delete_comments'] as $comment) : // Check the permissions on each
$comment = (int) $comment;
- $post_id = (int) $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment");
- // $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") );
+ $post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment) );
if ( !current_user_can('edit_post', $post_id) )
continue;
if ( !empty( $_REQUEST['spamit'] ) ) {
@@ -117,6 +116,7 @@ unset($status_links);
</ul>
<p id="post-search">
+ <label class="hidden" for="post-search-input"><?php _e( 'Search Comments' ); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php echo $search; ?>" />
<input type="submit" value="<?php _e( 'Search Comments' ); ?>" class="button" />
</p>
@@ -132,22 +132,24 @@ unset($status_links);
<?php
+$comments_per_page = apply_filters('comments_per_page', 20, $comment_status);
+
if ( isset( $_GET['apage'] ) )
$page = abs( (int) $_GET['apage'] );
else
$page = 1;
-$start = $offset = ( $page - 1 ) * 20;
+$start = $offset = ( $page - 1 ) * $comments_per_page;
-list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, 25 ); // Grab a few extra
+list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5 ); // Grab a few extra
-$comments = array_slice($_comments, 0, 20);
-$extra_comments = array_slice($_comments, 20);
+$comments = array_slice($_comments, 0, $comments_per_page);
+$extra_comments = array_slice($_comments, $comments_per_page);
$page_links = paginate_links( array(
'base' => add_query_arg( 'apage', '%#%' ),
'format' => '',
- 'total' => ceil($total / 20),
+ 'total' => ceil($total / $comments_per_page),
'current' => $page
));
@@ -186,7 +188,7 @@ if ($comments) {
<table class="widefat">
<thead>
<tr>
- <th scope="col" class="check-column"><input type="checkbox" onclick="checkAll(document.getElementById('comments-form'));" /></th>
+ <th scope="col" class="check-column"><input type="checkbox" /></th>
<th scope="col"><?php _e('Comment') ?></th>
<th scope="col"><?php _e('Date') ?></th>
<th scope="col" class="action-links"><?php _e('Actions') ?></th>
diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php
index 7d1ff7d..e87945e 100644
--- a/wp-admin/edit-form-advanced.php
+++ b/wp-admin/edit-form-advanced.php
@@ -1,12 +1,35 @@
<?php
-$action = isset($action)? $action : '';
+
+$action = isset($action) ? $action : '';
if ( isset($_GET['message']) )
$_GET['message'] = absint( $_GET['message'] );
$messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer'] ) ) );
$messages[2] = __('Custom field updated.');
$messages[3] = __('Custom field deleted.');
$messages[4] = __('Post updated.');
+$messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( $_GET['revision'], false ) );
+
+$notice = false;
+$notices[1] = __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>.' );
+
+if ( !isset($post_ID) || 0 == $post_ID ) {
+ $form_action = 'post';
+ $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
+ $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
+ $autosave = false;
+} else {
+ $post_ID = (int) $post_ID;
+ $form_action = 'editpost';
+ $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
+ $autosave = wp_get_post_autosave( $post_id );
+ if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) )
+ $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
+}
+
?>
+<?php if ( $notice ) : ?>
+<div id="notice" class="error"><p><?php echo $notice ?></p></div>
+<?php endif; ?>
<?php if (isset($_GET['message'])) : ?>
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
<?php endif; ?>
@@ -20,33 +43,15 @@ $messages[4] = __('Post updated.');
<h2><?php _e('Write Post') ?></h2>
<?php
-if (!isset($post_ID) || 0 == $post_ID) {
- $form_action = 'post';
- $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
- $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
+if ( !isset($post_ID) || 0 == $post_ID)
wp_nonce_field('add-post');
-} else {
- $post_ID = (int) $post_ID;
- $form_action = 'editpost';
- $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
+else
wp_nonce_field('update-post_' . $post_ID);
-}
$form_pingback = '<input type="hidden" name="post_pingback" value="' . (int) get_option('default_pingback_flag') . '" id="post_pingback" />';
$form_prevstatus = '<input type="hidden" name="prev_status" value="' . attribute_escape( $post->post_status ) . '" />';
-$form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />';
-
-if ('' != $post->pinged) {
- $pings = '<p>'. __('Already pinged:') . '</p><ul>';
- $already_pinged = explode("\n", trim($post->pinged));
- foreach ($already_pinged as $pinged_url) {
- $pings .= "\n\t<li>" . wp_specialchars($pinged_url) . "</li>";
- }
- $pings .= '</ul>';
-}
-
$saveasdraft = '<input name="save" type="submit" id="save" class="button" tabindex="3" value="' . attribute_escape( __('Save and Continue Editing') ) . '" />';
?>
@@ -83,10 +88,13 @@ else
<div class="inside">
-<p><strong><?php _e('Publish Status') ?></strong></p>
+<p><strong><label for='post_status'><?php _e('Publish Status') ?></label></strong></p>
<p>
-<select name='post_status' tabindex='4'>
-<?php if ( current_user_can('publish_posts') ) : // Contributors only get "Unpublished" and "Pending Review" ?>
+<select name='post_status' id='post_status' tabindex='4'>
+<?php
+// only show the publish menu item if they are allowed to publish posts or they are allowed to edit this post (accounts for 'edit_published_posts' capability)
+if ( current_user_can('publish_posts') OR ( $post->post_status == 'publish' AND current_user_can('edit_post', $post->ID) ) ) :
+?>
<option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option>
<?php if ( 'future' == $post->post_status ) : ?>
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
@@ -156,6 +164,7 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
<br class="clear" />
<?php endif; ?>
<span id="autosave"></span>
+<span id="wp-word-count"></span>
</p>
<div class="side-info">
@@ -172,6 +181,9 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
<li><a href="edit.php?post_status=draft"><?php _e('View Drafts'); ?></a></li>
<?php do_action('post_relatedlinks_list'); ?>
</ul>
+
+<h5><?php _e('Shortcuts') ?></h5>
+<p><?php _e('Drag-and-drop the following link to your bookmarks bar or right click it and add it to your favorites for a posting shortcut.') ?> <a href="<?php echo get_shortcut_link(); ?>" title="<?php echo attribute_escape(__('Press This')) ?>"><?php _e('Press This') ?></a></p>
</div>
<?php do_action('submitpost_box'); ?>
@@ -179,7 +191,7 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
<div id="post-body">
<div id="titlediv">
-<h3><?php _e('Title') ?></h3>
+<h3><label for="title"><?php _e('Title') ?></label></h3>
<div id="titlewrap">
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" autocomplete="off" />
</div>
@@ -194,7 +206,7 @@ endif; ?>
</div>
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
-<h3><?php _e('Post') ?></h3>
+<h3><label for="content"><?php _e('Post') ?></label></h3>
<?php the_editor($post->post_content); ?>
<?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
@@ -205,23 +217,22 @@ endif; ?>
<?php echo $form_pingback ?>
<?php echo $form_prevstatus ?>
-<div id="tagsdiv" class="postbox <?php echo postbox_classes('tagsdiv', 'post'); ?>">
-<h3><?php _e('Tags'); ?></h3>
-<div class="inside">
-<p id="jaxtag"><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post_ID ); ?>" /></p>
+<?php
+function post_tags_meta_box($post) {
+?>
+<p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p>
<div id="tagchecklist"></div>
-</div>
-</div>
-
-<div id="categorydiv" class="postbox <?php echo postbox_classes('categorydiv', 'post'); ?>">
-<h3><?php _e('Categories') ?></h3>
-<div class="inside">
+<?php
+}
+add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', 'post', 'normal', 'core');
+function post_categories_meta_box($post) {
+?>
<div id="category-adder" class="wp-hidden-children">
<h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
<p id="category-add" class="wp-hidden-child">
- <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" tabindex="3" />
- <?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
+ <label class="hidden" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" tabindex="3" aria-required="true"/>
+ <label class="hidden" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
<input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php _e( 'Add' ); ?>" tabindex="3" />
<?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>
<span id="category-ajax-response"></span>
@@ -244,9 +255,10 @@ endif; ?>
<?php wp_category_checklist($post->ID, false, false, $popular_ids) ?>
</ul>
</div>
-
-</div>
-</div>
+<?php
+}
+add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'normal', 'core');
+?>
<?php do_meta_boxes('post', 'normal', $post); ?>
@@ -254,32 +266,41 @@ endif; ?>
<h2><?php _e('Advanced Options'); ?></h2>
-<div id="postexcerpt" class="postbox <?php echo postbox_classes('postexcerpt', 'post'); ?>">
-<h3><?php _e('Excerpt') ?></h3>
-<div class="inside"><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea>
+<?php
+function post_excerpt_meta_box($post) {
+?>
+<label class="hidden" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea>
<p><?php _e('Excerpts are optional hand-crafted summaries of your content. You can <a href="http://codex.wordpress.org/Template_Tags/the_excerpt" target="_blank">use them in your template</a>'); ?></p>
-</div>
-</div>
+<?php
+}
+add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'advanced', 'core');
+
+function post_trackback_meta_box($post) {
+ $form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />';
+ if ('' != $post->pinged) {
+ $pings = '<p>'. __('Already pinged:') . '</p><ul>';
+ $already_pinged = explode("\n", trim($post->pinged));
+ foreach ($already_pinged as $pinged_url) {
+ $pings .= "\n\t<li>" . wp_specialchars($pinged_url) . "</li>";
+ }
+ $pings .= '</ul>';
+ }
-<div id="trackbacksdiv" class="postbox <?php echo postbox_classes('trackbacksdiv', 'post'); ?>">
-<h3><?php _e('Trackbacks') ?></h3>
-<div class="inside">
-<p><?php _e('Send trackbacks to:'); ?> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
+?>
+<p><label for="trackback"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
<p><?php _e('Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. If you link other WordPress blogs they&#8217;ll be notified automatically using <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>
<?php
if ( ! empty($pings) )
echo $pings;
-?>
-</div>
-</div>
+}
+add_meta_box('trackbacksdiv', __('Trackbacks'), 'post_trackback_meta_box', 'post', 'advanced', 'core');
-<div id="postcustom" class="postbox <?php echo postbox_classes('postcustom', 'post'); ?>">
-<h3><?php _e('Custom Fields') ?></h3>
-<div class="inside">
+function post_custom_meta_box($post) {
+?>
<div id="postcustomstuff">
<table cellpadding="3">
<?php
-$metadata = has_meta($post_ID);
+$metadata = has_meta($post->ID);
list_meta($metadata);
?>
@@ -290,55 +311,66 @@ list_meta($metadata);
<div id="ajax-response"></div>
</div>
<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
-</div>
-</div>
+<?php
+}
+add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'post', 'advanced', 'core');
-<?php do_action('dbx_post_advanced'); ?>
+do_action('dbx_post_advanced');
-<div id="commentstatusdiv" class="postbox <?php echo postbox_classes('commentstatusdiv', 'post'); ?>">
-<h3><?php _e('Comments &amp; Pings') ?></h3>
-<div class="inside">
+function post_comment_status_meta_box($post) {
+?>
<input name="advanced_view" type="hidden" value="1" />
<p><label for="comment_status" class="selectit">
<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
<?php _e('Allow Comments') ?></label></p>
<p><label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label></p>
<p><?php _e('These settings apply to this post only. &#8220;Pings&#8221; are <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a>.'); ?></p>
-</div>
-</div>
+<?php
+}
+add_meta_box('commentstatusdiv', __('Comments &amp; Pings'), 'post_comment_status_meta_box', 'post', 'advanced', 'core');
-<div id="passworddiv" class="postbox <?php echo postbox_classes('passworddiv', 'post'); ?>">
-<h3><?php _e('Password Protect This Post') ?></h3>
-<div class="inside">
-<p><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>
+function post_password_meta_box($post) {
+?>
+<p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p>
-</div>
-</div>
-
-<div id="slugdiv" class="postbox <?php echo postbox_classes('slugdiv', 'post'); ?>">
-<h3><?php _e('Post Slug') ?></h3>
-<div class="inside">
-<input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
-</div>
-</div>
+<?php
+}
+add_meta_box('passworddiv', __('Password Protect This Post'), 'post_password_meta_box', 'post', 'advanced', 'core');
+function post_slug_meta_box($post) {
+?>
+<label class="hidden" for="post_name"><?php _e('Post Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
<?php
+}
+add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'advanced', 'core');
+
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
if ( $post->post_author && !in_array($post->post_author, $authors) )
$authors[] = $post->post_author;
if ( $authors && count( $authors ) > 1 ) :
+function post_author_meta_box($post) {
+ global $current_user, $user_ID;
+ $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
+ if ( $post->post_author && !in_array($post->post_author, $authors) )
+ $authors[] = $post->post_author;
?>
-<div id="authordiv" class="postbox <?php echo postbox_classes('authordiv', 'post'); ?>">
-<h3><?php _e('Post Author'); ?></h3>
-<div class="inside">
-<?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post_ID) ? $user_ID : $post->post_author) ); ?>
-</div>
-</div>
-<?php endif; ?>
+<label class="hidden" for="post_author_override"><?php _e('Post Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
+<?php
+}
+add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'advanced', 'core');
+endif;
-<?php do_meta_boxes('post', 'advanced', $post); ?>
+if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
+function post_revisions_meta_box($post) {
+ wp_list_post_revisions();
+}
+add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'advanced', 'core');
+endif;
-<?php do_action('dbx_post_sidebar'); ?>
+do_meta_boxes('post', 'advanced', $post);
+
+do_action('dbx_post_sidebar');
+?>
</div>
</div>
diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php
index dfef0a7..601f4cb 100644
--- a/wp-admin/edit-form-comment.php
+++ b/wp-admin/edit-form-comment.php
@@ -22,9 +22,9 @@ $form_extra = "' />\n<input type='hidden' name='comment_ID' value='" . $comment-
<div class="inside">
-<p><strong><?php _e('Approval Status') ?></strong></p>
+<p><strong><label for='comment_status'><?php _e('Approval Status') ?></label></strong></p>
<p>
-<select name='comment_status'>
+<select name='comment_status' id='comment_status'>
<option<?php selected( $comment->comment_approved, '1' ); ?> value='1'><?php _e('Approved') ?></option>
<option<?php selected( $comment->comment_approved, '0' ); ?> value='0'><?php _e('Moderated') ?></option>
<option<?php selected( $comment->comment_approved, 'spam' ); ?> value='spam'><?php _e('Spam') ?></option>
@@ -64,28 +64,28 @@ echo "<a class='submitdelete' href='" . wp_nonce_url("comment.php?action=deletec
<div id="post-body">
<div id="namediv" class="stuffbox">
-<h3><?php _e('Name') ?></h3>
+<h3><label for="name"><?php _e('Name') ?></label></h3>
<div class="inside">
<input type="text" name="newcomment_author" size="30" value="<?php echo attribute_escape( $comment->comment_author ); ?>" tabindex="1" id="name" />
</div>
</div>
<div id="emaildiv" class="stuffbox">
-<h3><?php _e('E-mail') ?></h3>
+<h3><label for="email"><?php _e('E-mail') ?></label></h3>
<div class="inside">
<input type="text" name="newcomment_author_email" size="30" value="<?php echo attribute_escape( $comment->comment_author_email ); ?>" tabindex="2" id="email" />
</div>
</div>
<div id="uridiv" class="stuffbox">
-<h3><?php _e('URL') ?></h3>
+<h3><label for="newcomment_author_url"><?php _e('URL') ?></label></h3>
<div class="inside">
<input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" value="<?php echo attribute_escape( $comment->comment_author_url ); ?>" tabindex="3" />
</div>
</div>
<div id="postdiv" class="postarea">
-<h3><?php _e('Comment') ?></h3>
+<h3><label for="content"><?php _e('Comment') ?></label></h3>
<?php the_editor($comment->comment_content, 'content', 'newcomment_author_url', false, 4); ?>
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
</div>
diff --git a/wp-admin/edit-link-categories.php b/wp-admin/edit-link-categories.php
index b8dfebc..da5b415 100644
--- a/wp-admin/edit-link-categories.php
+++ b/wp-admin/edit-link-categories.php
@@ -62,6 +62,7 @@ endif; ?>
<?php endif; ?>
<p id="post-search">
+ <label class="hidden" for="post-search-input"><?php _e( 'Search Categories' ); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
<input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
</p>
@@ -101,7 +102,7 @@ if ( $page_links )
<table class="widefat">
<thead>
<tr>
- <th scope="col" class="check-column"><input type="checkbox" onclick="checkAll(document.getElementById('posts-filter'));" /></th>
+ <th scope="col" class="check-column"><input type="checkbox" /></th>
<th scope="col"><?php _e('Name') ?></th>
<th scope="col"><?php _e('Description') ?></th>
<th scope="col" class="num" style="width: 90px;"><?php _e('Links') ?></th>
diff --git a/wp-admin/edit-link-category-form.php b/wp-admin/edit-link-category-form.php
index 517f574..f55a4c0 100644
--- a/wp-admin/edit-link-category-form.php
+++ b/wp-admin/edit-link-category-form.php
@@ -26,7 +26,7 @@ if ( ! empty($cat_ID) ) {
<table class="form-table">
<tr class="form-field form-required">
<th scope="row" valign="top"><label for="name"><?php _e('Category name') ?></label></th>
- <td><input name="name" id="name" type="text" value="<?php echo $category->name; ?>" size="40" /></td>
+ <td><input name="name" id="name" type="text" value="<?php echo $category->name; ?>" size="40" aria-required="true" /></td>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="description"><?php _e('Description (optional)') ?></label></th>
diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php
index 15c3fb5..48b95cc 100644
--- a/wp-admin/edit-link-form.php
+++ b/wp-admin/edit-link-form.php
@@ -74,7 +74,7 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<div id="post-body">
<div id="namediv" class="stuffbox">
-<h3><?php _e('Name') ?></h3>
+<h3><label for="link_name"><?php _e('Name') ?></label></h3>
<div class="inside">
<input type="text" name="link_name" size="30" tabindex="1" value="<?php echo $link->link_name; ?>" id="link_name" /><br />
<?php _e('Example: Nifty blogging software'); ?>
@@ -82,7 +82,7 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
</div>
<div id="addressdiv" class="stuffbox">
-<h3><?php _e('Web Address') ?></h3>
+<h3><label for="link_url"><?php _e('Web Address') ?></label></h3>
<div class="inside">
<input type="text" name="link_url" size="30" tabindex="1" value="<?php echo $link->link_url; ?>" id="link_url" /><br />
<?php _e('Example: <code>http://wordpress.org/</code> &#8212; don&#8217;t forget the <code>http://</code>'); ?>
@@ -90,21 +90,19 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
</div>
<div id="descriptiondiv" class="stuffbox">
-<h3><?php _e('Description') ?></h3>
+<h3><label for="link_description"><?php _e('Description') ?></label></h3>
<div class="inside">
<input type="text" name="link_description" size="30" tabindex="1" value="<?php echo $link->link_description; ?>" id="link_description" /><br />
<?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?>
</div>
</div>
-<div id="linkcategorydiv" class="postbox <?php echo postbox_classes('linkcategorydiv', 'link'); ?>">
-<h3><?php _e('Categories') ?></h3>
-<div class="inside">
-
+<?php function link_categories_meta_box($link) { ?>
<div id="category-adder" class="wp-hidden-children">
<h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>
<p id="link-category-add" class="wp-hidden-child">
- <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" />
+ <label class="hidden" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
+ <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" aria-required="true" />
<input type="button" id="category-add-sumbit" class="add:categorychecklist:linkcategorydiv button" value="<?php _e( 'Add' ); ?>" />
<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
<span id="category-ajax-response"></span>
@@ -118,7 +116,7 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<div id="categories-all" class="ui-tabs-panel">
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
- <?php wp_link_category_checklist($link_id); ?>
+ <?php wp_link_category_checklist($link->link_id); ?>
</ul>
</div>
@@ -127,17 +125,17 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<?php wp_popular_terms_checklist('link_category'); ?>
</ul>
</div>
-
-</div>
-</div>
+<?php
+}
+add_meta_box('linkcategorydiv', __('Categories'), 'link_categories_meta_box', 'link', 'normal', 'core');
+?>
<?php do_meta_boxes('link', 'normal', $link); ?>
<h2><?php _e('Advanced Options'); ?></h2>
-<div id="linktargetdiv" class="postbox <?php echo postbox_classes('linktargetdiv', 'link'); ?>">
-<h3><?php _e('Target') ?></h3>
-<div class="inside">
+<?php function link_target_meta_box($link) { ?>
+<fieldset><legend class="hidden"><?php _e('Target') ?></legend>
<label for="link_target_blank" class="selectit">
<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo(($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
<code>_blank</code></label><br />
@@ -147,16 +145,17 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<label for="link_target_none" class="selectit">
<input id="link_target_none" type="radio" name="link_target" value="" <?php echo(($link->link_target == '') ? 'checked="checked"' : ''); ?> />
<?php _e('none') ?></label>
+</fieldset>
<p><?php _e('Choose the frame your link targets. Essentially this means if you choose <code>_blank</code> your link will open in a new window.'); ?></p>
-</div>
-</div>
+<?php
+}
+add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', 'link', 'advanced', 'core');
-<div id="linkxfndiv" class="postbox <?php echo postbox_classes('linkxfndiv', 'link'); ?>">
-<h3><?php _e('Link Relationship (XFN)') ?></h3>
-<div class="inside">
+function link_xfn_meta_box($link) {
+?>
<table class="editform" style="width: 100%;" cellspacing="2" cellpadding="5">
<tr>
- <th style="width: 20%;" scope="row"><?php _e('rel:') ?></th>
+ <th style="width: 20%;" scope="row"><label for="link_rel"><?php _e('rel:') ?></label></th>
<td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo $link->link_rel; ?>" /></td>
</tr>
<tr>
@@ -164,15 +163,15 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<table cellpadding="3" cellspacing="5" class="form-table">
<tr>
<th scope="row"> <?php _e('identity') ?> </th>
- <td>
+ <td><fieldset><legend class="hidden"> <?php _e('identity') ?> </legend>
<label for="me">
<input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
<?php _e('another web address of mine') ?></label>
- </td>
+ </fieldset></td>
</tr>
<tr>
<th scope="row"> <?php _e('friendship') ?> </th>
- <td>
+ <td><fieldset><legend class="hidden"> <?php _e('friendship') ?> </legend>
<label for="contact">
<input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php _e('contact') ?></label>
<label for="acquaintance">
@@ -181,30 +180,30 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php _e('friend') ?></label>
<label for="friendship">
<input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php _e('none') ?></label>
- </td>
+ </fieldset></td>
</tr>
<tr>
<th scope="row"> <?php _e('physical') ?> </th>
- <td>
+ <td><fieldset><legend class="hidden"> <?php _e('physical') ?> </legend>
<label for="met">
<input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
<?php _e('met') ?></label>
- </td>
+ </fieldset></td>
</tr>
<tr>
<th scope="row"> <?php _e('professional') ?> </th>
- <td>
+ <td><fieldset><legend class="hidden"> <?php _e('professional') ?> </legend>
<label for="co-worker">
<input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
<?php _e('co-worker') ?></label>
<label for="colleague">
<input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
<?php _e('colleague') ?></label>
- </td>
+ </fieldset></td>
</tr>
<tr>
<th scope="row"> <?php _e('geographical') ?> </th>
- <td>
+ <td><fieldset><legend class="hidden"> <?php _e('geographical') ?> </legend>
<label for="co-resident">
<input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
<?php _e('co-resident') ?></label>
@@ -214,11 +213,11 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<label for="geographical">
<input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
<?php _e('none') ?></label>
- </td>
+ </fieldset></td>
</tr>
<tr>
<th scope="row"> <?php _e('family') ?> </th>
- <td>
+ <td><fieldset><legend class="hidden"> <?php _e('family') ?> </legend>
<label for="child">
<input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> />
<?php _e('child') ?></label>
@@ -237,11 +236,11 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<label for="family">
<input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
<?php _e('none') ?></label>
- </td>
+ </fieldset></td>
</tr>
<tr>
<th scope="row"> <?php _e('romantic') ?> </th>
- <td>
+ <td><fieldset><legend class="hidden"> <?php _e('romantic') ?> </legend>
<label for="muse">
<input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
<?php _e('muse') ?></label>
@@ -254,19 +253,19 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
<label for="romantic">
<input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
<?php _e('sweetheart') ?></label>
- </td>
+ </fieldset></td>
</tr>
</table>
</td>
</tr>
</table>
<p><?php _e('If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.'); ?></p>
-</div>
-</div>
+<?php
+}
+add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', 'link', 'advanced', 'core');
-<div id="linkadvanceddiv" class="postbox <?php echo postbox_classes('linkadvanceddiv', 'link'); ?>">
-<h3><?php _e('Advanced') ?></h3>
-<div class="inside">
+function link_advanced_meta_box($link) {
+?>
<table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">
<tr class="form-field">
<th valign="top" scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>
@@ -294,12 +293,13 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
</td>
</tr>
</table>
-</div>
-</div>
+<?php
+}
+add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'advanced', 'core');
-<?php do_meta_boxes('link', 'advanced', $link); ?>
+do_meta_boxes('link', 'advanced', $link);
-<?php if ( $link_id ) : ?>
+if ( $link_id ) : ?>
<input type="hidden" name="action" value="save" />
<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
<input type="hidden" name="order_by" value="<?php echo attribute_escape($order_by); ?>" />
diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php
index e800a46..89ac2b2 100644
--- a/wp-admin/edit-page-form.php
+++ b/wp-admin/edit-page-form.php
@@ -5,10 +5,9 @@ $messages[1] = sprintf( __( 'Page updated. Continue editing below or <a href="%s
$messages[2] = __('Custom field updated.');
$messages[3] = __('Custom field deleted.');
$messages[4] = __('Page updated.');
-?>
-<?php if (isset($_GET['message'])) : ?>
-<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
-<?php endif;
+
+$notice = false;
+$notices[1] = __( 'There is an autosave of this page that is more recent than the version below. <a href="%s">View the autosave</a>.' );
if (!isset($post_ID) || 0 == $post_ID) {
$form_action = 'post';
@@ -20,6 +19,9 @@ if (!isset($post_ID) || 0 == $post_ID) {
$form_action = 'editpost';
$nonce_action = 'update-page_' . $post_ID;
$form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
+ $autosave = wp_get_post_autosave( $post_id );
+ if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) )
+ $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
}
$temp_ID = (int) $temp_ID;
@@ -31,6 +33,13 @@ if ( 0 != $post_ID && $sendto == get_permalink($post_ID) )
$sendto = 'redo';
?>
+<?php if ( $notice ) : ?>
+<div id="notice" class="error"><p><?php echo $notice ?></p></div>
+<?php endif; ?>
+<?php if (isset($_GET['message'])) : ?>
+<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
+<?php endif; ?>
+
<form name="post" action="page.php" method="post" id="post">
<div class="wrap">
<h2><?php _e('Write Page') ?></h2>
@@ -44,6 +53,7 @@ if (isset($mode) && 'bookmarklet' == $mode)
<input type="hidden" id="user-id" name="user_ID" value="<?php echo $user_ID ?>" />
<input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' />
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
+<input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
<?php echo $form_extra ?>
<input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
@@ -68,14 +78,14 @@ else
</div>
<div class="inside">
-
-<p><strong><?php _e('Publish Status') ?></strong></p>
+<p><strong><label for='post_status'><?php _e('Publish Status') ?></label></strong></p>
<p>
-<select name='post_status' tabindex='4'>
-<?php if ( current_user_can('publish_pages') ) : ?>
+<select name='post_status' tabindex='4' id='post_status'>
+<?php // Show publish in dropdown if user can publish or if they can re-publish this page ('edit_published_pages')
+// 'publish' option will be selected for published AND private posts (checkbox overrides dropdown)
+if ( current_user_can('publish_pages') OR ( $post->post_status == 'publish' AND current_user_can('edit_page', $post->ID) ) ) :
+?>
<option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option>
-<?php else: ?>
-<option<?php selected( $post->post_status, 'private' ); ?> value='private'><?php _e('Published') ?></option>
<?php endif; ?>
<?php if ( 'future' == $post->post_status ) : ?>
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Pending') ?></option>
@@ -84,8 +94,10 @@ else
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Unpublished') ?></option>
</select>
</p>
-
+<?php if ( current_user_can( 'publish_posts' ) ) : ?>
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p>
+<?php endif; ?>
+
<?php
if ($post_ID) {
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
@@ -140,6 +152,7 @@ if ( ('edit' == $action) && current_user_can('delete_page', $post_ID) )
<br class="clear" />
<?php endif; ?>
<span id="autosave"></span>
+<span id="wp-word-count"></span>
</p>
<div class="side-info">
@@ -159,7 +172,7 @@ if ( ('edit' == $action) && current_user_can('delete_page', $post_ID) )
<div id="post-body">
<div id="titlediv">
-<h3><?php _e('Title') ?></h3>
+<h3><label for="title"><?php _e('Title') ?></label></h3>
<div id="titlewrap">
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" autocomplete="off" />
</div>
@@ -174,7 +187,7 @@ endif; ?>
</div>
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
-<h3><?php _e('Page') ?></h3>
+<h3><label for="content"><?php _e('Page') ?></label></h3>
<?php the_editor($post->post_content); ?>
<?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
@@ -188,13 +201,14 @@ endif; ?>
<h2><?php _e('Advanced Options'); ?></h2>
-<div id="pagepostcustom" class="postbox <?php echo postbox_classes('pagepostcustom', 'page'); ?>">
-<h3><?php _e('Custom Fields') ?></h3>
-<div class="inside">
+
+<?php
+function page_custom_meta_box($post){
+?>
<div id="postcustomstuff">
<table cellpadding="3">
<?php
-$metadata = has_meta($post_ID);
+$metadata = has_meta($post->ID);
list_meta($metadata);
?>
@@ -205,83 +219,97 @@ list_meta($metadata);
<div id="ajax-response"></div>
</div>
<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
-</div>
-</div>
+<?php
+}
+add_meta_box('pagecustomdiv', __('Custom Fields'), 'page_custom_meta_box', 'page', 'advanced', 'core');
-<div id="pagecommentstatusdiv" class="postbox <?php echo postbox_classes('pagecommentstatusdiv', 'page'); ?>">
-<h3><?php _e('Comments &amp; Pings') ?></h3>
-<div class="inside">
+function page_comments_status_meta_box($post){
+?>
<input name="advanced_view" type="hidden" value="1" />
<p><label for="comment_status" class="selectit">
<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
<?php _e('Allow Comments') ?></label></p>
<p><label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label></p>
<p><?php _e('These settings apply to this page only. &#8220;Pings&#8221; are <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a>.'); ?></p>
-</div>
-</div>
+<?php
+}
+add_meta_box('pagecommentstatusdiv', __('Comments &amp; Pings'), 'page_comments_status_meta_box', 'page', 'advanced', 'core');
-<div id="pagepassworddiv" class="postbox <?php echo postbox_classes('pagepassworddiv', 'page'); ?>">
-<h3><?php _e('Password Protect This Page') ?></h3>
-<div class="inside">
-<p><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>
+function page_password_meta_box($post){
+?>
+<p><label class="hidden" for="post_password"><?php _e('Password Protect This Page') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this page and its comments.'); ?></p>
-</div>
-</div>
+<?php
+}
+add_meta_box('pagepassworddiv', __('Password Protect This Page'), 'page_password_meta_box', 'page', 'advanced', 'core');
-<div id="pageslugdiv" class="postbox <?php echo postbox_classes('pageslugdiv', 'page'); ?>">
-<h3><?php _e('Page Slug') ?></h3>
-<div class="inside">
-<input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
-</div>
-</div>
+function page_slug_meta_box($post){
+?>
+<label class="hidden" for="post_name"><?php _e('Page Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
+<?php
+}
+add_meta_box('pageslugdiv', __('Page Slug'), 'page_slug_meta_box', 'page', 'advanced', 'core');
-<div id="pageparentdiv" class="postbox <?php echo postbox_classes('pageparentdiv', 'page'); ?>">
-<h3><?php _e('Page Parent') ?></h3>
-<div class="inside">
-<select name="parent_id">
+function page_parent_meta_box($post){
+?>
+<label class="hidden" for="parent_id"><?php _e('Page Parent') ?></label>
+<select name="parent_id" id="parent_id">
<option value='0'><?php _e('Main Page (no parent)'); ?></option>
<?php parent_dropdown($post->post_parent); ?>
</select>
<p><?php _e('You can arrange your pages in hierarchies, for example you could have an &#8220;About&#8221; page that has &#8220;Life Story&#8221; and &#8220;My Dog&#8221; pages under it. There are no limits to how deeply nested you can make pages.'); ?></p>
-</div>
-</div>
+<?php
+}
+add_meta_box('pageparentdiv', __('Page Parent'), 'page_parent_meta_box', 'page', 'advanced', 'core');
-<?php if ( 0 != count( get_page_templates() ) ) { ?>
-<div id="pagetemplatediv" class="postbox <?php echo postbox_classes('pagetemplatediv', 'page'); ?>">
-<h3><?php _e('Page Template') ?></h3>
-<div class="inside">
-<select name="page_template">
+if ( 0 != count( get_page_templates() ) ) {
+ function page_template_meta_box($post){
+?>
+<label class="hidden" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
<option value='default'><?php _e('Default Template'); ?></option>
<?php page_template_dropdown($post->page_template); ?>
</select>
<p><?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you&#8217;ll see them above.'); ?></p>
-</div>
-</div>
-<?php } ?>
+<?php
+ }
+ add_meta_box('pagetemplatediv', __('Page Template'), 'page_template_meta_box', 'page', 'advanced', 'core');
+}
-<div id="pageorderdiv" class="postbox <?php echo postbox_classes('pageorderdiv', 'page'); ?>">
-<h3><?php _e('Page Order') ?></h3>
-<div class="inside">
-<p><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p>
+function page_order_meta_box($post){
+?>
+<p><label class="hidden" for="menu_order"><?php _e('Page Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p>
<p><?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it&#8217;ll be better in future releases.)'); ?></p>
-</div>
-</div>
-
<?php
+}
+add_meta_box('pageorderdiv', __('Page Order'), 'page_order_meta_box', 'page', 'advanced', 'core');
+
+
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
if ( $post->post_author && !in_array($post->post_author, $authors) )
$authors[] = $post->post_author;
-if ( $authors && count( $authors ) > 1 ) :
+if ( $authors && count( $authors ) > 1 ) {
+ function page_author_meta_box($post){
+ global $current_user, $user_ID;
+ $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
+ if ( $post->post_author && !in_array($post->post_author, $authors) )
+ $authors[] = $post->post_author;
?>
-<div id="pageauthordiv" class="postbox <?php echo postbox_classes('pageauthordiv', 'page'); ?>">
-<h3><?php _e('Page Author'); ?></h3>
-<div class="inside">
-<?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post_ID) ? $user_ID : $post->post_author) ); ?>
-</div>
-</div>
-<?php endif; ?>
+<label class="hidden" for="post_author_override"><?php _e('Page Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
+<?php
+ }
+ add_meta_box('pageauthordiv', __('Page Author'), 'page_author_meta_box', 'page', 'advanced', 'core');
+}
-<?php do_meta_boxes('page', 'advanced', $post); ?>
+
+if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
+function page_revisions_meta_box($post) {
+ wp_list_post_revisions();
+}
+add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'page', 'advanced', 'core');
+endif;
+
+do_meta_boxes('page', 'advanced', $post);
+?>
</div>
</div>
diff --git a/wp-admin/edit-pages.php b/wp-admin/edit-pages.php
index ee4bee2..0f93d97 100644
--- a/wp-admin/edit-pages.php
+++ b/wp-admin/edit-pages.php
@@ -20,8 +20,8 @@ if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
}
$sendback = wp_get_referer();
- if (strpos($sendback, 'page.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/page-new.php';
- elseif (strpos($sendback, 'attachments.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/attachments.php';
+ if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page-new.php');
+ elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
$sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);
wp_redirect($sendback);
@@ -111,6 +111,7 @@ endif;
?>
<p id="post-search">
+ <label class="hidden" for="post-search-input"><?php _e( 'Search Pages' ); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
<input type="submit" value="<?php _e( 'Search Pages' ); ?>" class="button" />
</p>
@@ -175,7 +176,7 @@ if ($posts) {
if ( 1 == count($posts) && is_singular() ) :
- $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date");
+ $comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) );
if ( $comments ) :
// Make sure comments, post, and post_author are cached
update_comment_cache($comments);
diff --git a/wp-admin/edit-tag-form.php b/wp-admin/edit-tag-form.php
index 62a8e2b..de0f6c8 100644
--- a/wp-admin/edit-tag-form.php
+++ b/wp-admin/edit-tag-form.php
@@ -26,12 +26,12 @@ if ( ! empty($tag_ID) ) {
<table class="form-table">
<tr class="form-field form-required">
<th scope="row" valign="top"><label for="name"><?php _e('Tag name') ?></label></th>
- <td><input name="name" id="name" type="text" value="<?php echo attribute_escape($tag->name); ?>" size="40" />
+ <td><input name="name" id="name" type="text" value="<?php echo attribute_escape($tag->name); ?>" size="40" aria-required="true" />
<p><?php _e('The name is how the tag appears on your site.'); ?></p></td>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="slug"><?php _e('Tag slug') ?></label></th>
- <td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape($tag->slug); ?>" size="40" />
+ <td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
<p><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td>
</tr>
</table>
diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php
index b50269b..fffe7ca 100644
--- a/wp-admin/edit-tags.php
+++ b/wp-admin/edit-tags.php
@@ -133,6 +133,7 @@ endif; ?>
<?php endif; ?>
<p id="post-search">
+ <label class="hidden" for="post-search-input"><?php _e( 'Search Tags' ); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
<input type="submit" value="<?php _e( 'Search Tags' ); ?>" class="button" />
</p>
@@ -172,7 +173,7 @@ if ( $page_links )
<table class="widefat">
<thead>
<tr>
- <th scope="col" class="check-column"><input type="checkbox" onclick="checkAll(document.getElementById('posts-filter'));" /></th>
+ <th scope="col" class="check-column"><input type="checkbox" /></th>
<th scope="col"><?php _e('Name') ?></th>
<th scope="col" class="num" style="width: 90px"><?php _e('Posts') ?></th>
</tr>
diff --git a/wp-admin/edit.php b/wp-admin/edit.php
index b7cdcf4..467a9bb 100644
--- a/wp-admin/edit.php
+++ b/wp-admin/edit.php
@@ -20,8 +20,8 @@ if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
}
$sendback = wp_get_referer();
- if (strpos($sendback, 'post.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/post-new.php';
- elseif (strpos($sendback, 'attachments.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/attachments.php';
+ if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('post-new.php');
+ elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
$sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);
wp_redirect($sendback);
@@ -116,6 +116,7 @@ endif;
?>
<p id="post-search">
+ <label class="hidden" for="post-search-input"><?php _e( 'Search Posts' ); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Posts' ); ?>" class="button" />
</p>
@@ -205,7 +206,7 @@ if ( $page_links )
if ( 1 == count($posts) && is_singular() ) :
- $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date");
+ $comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) );
if ( $comments ) :
// Make sure comments, post, and post_author are cached
update_comment_cache($comments);
diff --git a/wp-admin/export.php b/wp-admin/export.php
index e36b8bb..2c147f8 100644
--- a/wp-admin/export.php
+++ b/wp-admin/export.php
@@ -22,9 +22,9 @@ require_once ('admin-header.php');
<table class="form-table">
<tr>
-<th><?php _e('Restrict Author'); ?></th>
+<th><label for="author"><?php _e('Restrict Author'); ?></label></th>
<td>
-<select name="author">
+<select name="author" id="author">
<option value="all" selected="selected"><?php _e('All Authors'); ?></option>
<?php
$authors = $wpdb->get_col( "SELECT post_author FROM $wpdb->posts GROUP BY post_author" );
diff --git a/wp-admin/gears-manifest.php b/wp-admin/gears-manifest.php
new file mode 100644
index 0000000..6fc01da
--- /dev/null
+++ b/wp-admin/gears-manifest.php
@@ -0,0 +1,217 @@
+<?php
+
+define( 'ABSPATH', dirname(dirname(__FILE__)) );
+define( 'WPINC', '/wp-includes' );
+
+function __() {}
+function add_filter() {}
+function attribute_escape() {}
+function apply_filters() {}
+function get_option() {}
+function is_lighttpd_before_150() {}
+function add_action() {}
+function do_action_ref_array() {}
+function get_bloginfo() {}
+function is_admin() {return true;}
+function site_url() {}
+function admin_url() {}
+
+require(ABSPATH . '/wp-includes/script-loader.php');
+require(ABSPATH . '/wp-includes/version.php');
+
+$wp_scripts = new WP_Scripts();
+wp_default_scripts($wp_scripts);
+
+$wp_styles = new WP_Styles();
+wp_default_styles($wp_styles);
+
+$get_lang = file_exists( ABSPATH . '/wp-config.php') ? file( ABSPATH . '/wp-config.php' ) : file( dirname(ABSPATH) . '/wp-config.php' );
+
+if ( is_array($get_lang) ) {
+ foreach ( $get_lang as $val ) {
+ if ( strpos( $val, "'WPLANG'" ) !== false ) {
+ eval( $val );
+ break;
+ }
+ }
+}
+
+if ( defined('WPLANG') && '' != WPLANG ) {
+ if ( file_exists(ABSPATH . '/wp-content/languages') && @is_dir(ABSPATH . '/wp-content/languages') )
+ $langdir = '/wp-content/languages/';
+ else
+ $langdir = '/wp-includes/languages/';
+
+ $locale_file = ABSPATH . $langdir . WPLANG . '.php';
+ if ( is_readable($locale_file) )
+ include_once($locale_file);
+}
+
+$rtl = ( isset($text_direction) && 'rtl' == $text_direction ) ? true : false;
+
+$defaults = $man_version = '';
+foreach ( $wp_scripts->registered as $script ) {
+ if ( empty($script->src) || strpos($script->src, 'tiny_mce_config.php') ) continue;
+ $ver = empty($script->ver) ? $wp_version : $script->ver;
+ $src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $script->src );
+ $defaults .= '{ "url" : "' . $src . '?ver=' . $ver . '" },' . "\n";
+ $man_version .= $ver;
+}
+
+foreach ( $wp_styles->registered as $style ) {
+ if ( empty($style->src) ) continue;
+
+ $ver = empty($style->ver) ? $wp_version : $style->ver;
+ $src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->src );
+ if ( 'colors' == $style->handle ) $src = 'css/colors-classic.css';
+ $defaults .= '{ "url" : "' . $src . '?ver=' . $ver . '" },' . "\n";
+
+ if ( $rtl && isset($style->extra['rtl']) && $style->extra['rtl'] ) {
+ if ( is_bool( $style->extra['rtl'] ) )
+ $rtl_href = str_replace( '.css', '-rtl.css', $src );
+ else
+ $rtl_href = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->extra['rtl'] );
+
+ $defaults .= '{ "url" : "' . $rtl_href . '?ver=' . $ver . '" },' . "\n";
+ }
+ $man_version .= $ver;
+}
+
+$man_version = md5($man_version);
+
+header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
+header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
+header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
+header( 'Pragma: no-cache' );
+header( 'Content-Type: application/x-javascript; charset=UTF-8' );
+?>
+{
+"betaManifestVersion" : 1,
+"version" : "<?php echo $man_version; ?>_20080606",
+"entries" : [
+<?php echo $defaults; ?>
+
+{ "url" : "images/align-center.png" },
+{ "url" : "images/align-left.png" },
+{ "url" : "images/align-none.png" },
+{ "url" : "images/align-right.png" },
+{ "url" : "images/browse-happy.gif" },
+{ "url" : "images/bubble_bg.gif" },
+{ "url" : "images/comment-grey-bubble.png" },
+{ "url" : "images/comment-pill.gif" },
+{ "url" : "images/comment-stalk-classic.gif" },
+{ "url" : "images/comment-stalk-fresh.gif" },
+{ "url" : "images/comment-stalk-rtl.gif" },
+{ "url" : "images/date-button.gif" },
+{ "url" : "images/fade-butt.png" },
+{ "url" : "images/gear.png" },
+{ "url" : "images/logo-ghost.png" },
+{ "url" : "images/logo-login.gif" },
+{ "url" : "images/logo.gif" },
+{ "url" : "images/media-button-gallery.gif" },
+{ "url" : "images/media-button-image.gif" },
+{ "url" : "images/media-button-music.gif" },
+{ "url" : "images/media-button-other.gif" },
+{ "url" : "images/media-button-video.gif" },
+{ "url" : "images/media-buttons.gif" },
+{ "url" : "images/tab.png" },
+{ "url" : "images/tail.gif" },
+{ "url" : "images/toggle-arrow-rtl.gif" },
+{ "url" : "images/toggle-arrow.gif" },
+{ "url" : "images/wordpress-logo.png" },
+{ "url" : "images/xit.gif" },
+
+{ "url" : "../wp-includes/images/crystal/archive.png" },
+{ "url" : "../wp-includes/images/crystal/audio.png" },
+{ "url" : "../wp-includes/images/crystal/code.png" },
+{ "url" : "../wp-includes/images/crystal/default.png" },
+{ "url" : "../wp-includes/images/crystal/document.png" },
+{ "url" : "../wp-includes/images/crystal/interactive.png" },
+{ "url" : "../wp-includes/images/crystal/text.png" },
+{ "url" : "../wp-includes/images/crystal/video.png" },
+{ "url" : "../wp-includes/images/crystal/spreadsheet.png" },
+{ "url" : "../wp-includes/images/rss.png" },
+{ "url" : "../wp-includes/js/thickbox/loadingAnimation.gif" },
+{ "url" : "../wp-includes/js/thickbox/tb-close.png" },
+{ "url" : "../wp-includes/js/swfupload/swfupload_f9.swf" },
+
+{ "url" : "../wp-includes/js/tinymce/tiny_mce_popup.js?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/utils/mctabs.js?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/utils/validate.js?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/utils/form_utils.js?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/utils/editable_selects.js?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/paste/js/pasteword.js?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/paste/js/pastetext.js?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/media/js/media.js?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/color_picker.js?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/charmap.js?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/image.js?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=3091" },
+
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/image.htm?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/link.htm?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/color_picker.htm?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/charmap.htm?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/media/media.htm?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/paste/blank.htm?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=3091" },
+
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/spellchecker/css/content.css?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/css/content.css?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/media/css/content.css?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/wordpress.css?ver=3091" },
+
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/icons.gif" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/colorpicker.jpg" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/fm.gif" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/gotmoxie.png" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/sflogo.png" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/butt2.png" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/fade-butt.png" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/tabs.gif" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/down_arrow.gif" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/default/img/progress.gif" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/default/img/menu_check.gif" },
+{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/default/img/menu_arrow.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/drag.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/button.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/media/img/flash.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/media/img/flv_player.swf" },
+{ "url" : "../wp-includes/js/tinymce/plugins/media/img/quicktime.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/media/img/realmedia.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/media/img/shockwave.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/media/img/windowsmedia.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/media/img/trans.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/more.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/page.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/image.png" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/help.gif" }
+]}
diff --git a/wp-admin/images/gear.png b/wp-admin/images/gear.png
new file mode 100644
index 0000000..f7ac7f4
--- /dev/null
+++ b/wp-admin/images/gear.png
Binary files differ
diff --git a/wp-admin/images/loading.gif b/wp-admin/images/loading.gif
new file mode 100644
index 0000000..85b99d4
--- /dev/null
+++ b/wp-admin/images/loading.gif
Binary files differ
diff --git a/wp-admin/images/logo.gif b/wp-admin/images/logo.gif
new file mode 100644
index 0000000..cd49514
--- /dev/null
+++ b/wp-admin/images/logo.gif
Binary files differ
diff --git a/wp-admin/images/tab.png b/wp-admin/images/tab.png
new file mode 100644
index 0000000..413c755
--- /dev/null
+++ b/wp-admin/images/tab.png
Binary files differ
diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php
index 27f7c87..1fdbf35 100644
--- a/wp-admin/import/blogger.php
+++ b/wp-admin/import/blogger.php
@@ -641,7 +641,7 @@ class Blogger_Import {
$host = $this->blogs[$importing_blog]['host'];
// Get an array of posts => authors
- $post_ids = (array) $wpdb->get_col("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'blogger_blog' AND meta_value = '$host'");
+ $post_ids = (array) $wpdb->get_col( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'blogger_blog' AND meta_value = %s", $host) );
$post_ids = join( ',', $post_ids );
$results = (array) $wpdb->get_results("SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'blogger_author' AND post_id IN ($post_ids)");
foreach ( $results as $row )
@@ -658,7 +658,7 @@ class Blogger_Import {
$post_ids = (array) array_keys( $authors_posts, $this->blogs[$importing_blog]['authors'][$author][0] );
$post_ids = join( ',', $post_ids);
- $wpdb->query("UPDATE $wpdb->posts SET post_author = $user_id WHERE id IN ($post_ids)");
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE id IN ($post_ids)", $user_id) );
$this->blogs[$importing_blog]['authors'][$author][1] = $user_id;
}
$this->save_vars();
diff --git a/wp-admin/import/dotclear.php b/wp-admin/import/dotclear.php
index 16df934..da1047f 100644
--- a/wp-admin/import/dotclear.php
+++ b/wp-admin/import/dotclear.php
@@ -13,7 +13,7 @@ if(!function_exists('get_comment_count'))
function get_comment_count($post_ID)
{
global $wpdb;
- return $wpdb->get_var('SELECT count(*) FROM '.$wpdb->comments.' WHERE comment_post_ID = '.$post_ID);
+ return $wpdb->get_var( $wpdb->prepare("SELECT count(*) FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) );
}
}
@@ -22,7 +22,7 @@ if(!function_exists('link_exists'))
function link_exists($linkname)
{
global $wpdb;
- return $wpdb->get_var('SELECT link_id FROM '.$wpdb->links.' WHERE link_name = "'.$linkname.'"');
+ return $wpdb->get_var( $wpdb->prepare("SELECT link_id FROM $wpdb->links WHERE link_name = %s", $linkname) );
}
}
diff --git a/wp-admin/import/greymatter.php b/wp-admin/import/greymatter.php
index 92abc48..58aa757 100644
--- a/wp-admin/import/greymatter.php
+++ b/wp-admin/import/greymatter.php
@@ -38,16 +38,16 @@ class GM_Import {
<h3><?php _e('Second step: GreyMatter details:') ?></h3>
<table class="form-table">
<tr>
-<td><?php _e('Path to GM files:') ?></td>
-<td><input type="text" style="width:300px" name="gmpath" value="/home/my/site/cgi-bin/greymatter/" /></td>
+<td><label for="gmpath"><?php _e('Path to GM files:') ?></label></td>
+<td><input type="text" style="width:300px" name="gmpath" id="gmpath" value="/home/my/site/cgi-bin/greymatter/" /></td>
</tr>
<tr>
-<td><?php _e('Path to GM entries:') ?></td>
-<td><input type="text" style="width:300px" name="archivespath" value="/home/my/site/cgi-bin/greymatter/archives/" /></td>
+<td><label for="archivespath"><?php _e('Path to GM entries:') ?></label></td>
+<td><input type="text" style="width:300px" name="archivespath" id="archivespath" value="/home/my/site/cgi-bin/greymatter/archives/" /></td>
</tr>
<tr>
-<td><?php _e("Last entry's number:") ?></td>
-<td><input type="text" name="lastentry" value="00000001" /><br />
+<td><label for="lastentry"><?php _e("Last entry's number:") ?></label></td>
+<td><input type="text" name="lastentry" id="lastentry" value="00000001" /><br />
<?php _e("This importer will search for files 00000001.cgi to 000-whatever.cgi,<br />so you need to enter the number of the last GM post here.<br />(if you don't know that number, just log into your FTP and look it out<br />in the entries' folder)") ?></td>
</tr>
</table>
diff --git a/wp-admin/import/mt.php b/wp-admin/import/mt.php
index dcf5892..53ca091 100644
--- a/wp-admin/import/mt.php
+++ b/wp-admin/import/mt.php
@@ -149,9 +149,9 @@ class MT_Import {
$j = -1;
foreach ($authors as $author) {
++ $j;
- echo '<li>'.__('Current author:').' <strong>'.$author.'</strong><br />'.'<input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30">';
+ echo '<li><label>'.__('Current author:').' <strong>'.$author.'</strong><br />'.'<input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30">';
$this->users_form($j);
- echo '</li>';
+ echo '</label></li>';
}
echo '<input type="submit" value="'.__('Submit').'">'.'<br />';
diff --git a/wp-admin/import/textpattern.php b/wp-admin/import/textpattern.php
index 1c10015..c3fb1d7 100644
--- a/wp-admin/import/textpattern.php
+++ b/wp-admin/import/textpattern.php
@@ -8,7 +8,7 @@ if(!function_exists('get_comment_count'))
function get_comment_count($post_ID)
{
global $wpdb;
- return $wpdb->get_var('SELECT count(*) FROM '.$wpdb->comments.' WHERE comment_post_ID = '.$post_ID);
+ return $wpdb->get_var( $wpdb->prepare("SELECT count(*) FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) );
}
}
@@ -17,7 +17,7 @@ if(!function_exists('link_exists'))
function link_exists($linkname)
{
global $wpdb;
- return $wpdb->get_var('SELECT link_id FROM '.$wpdb->links.' WHERE link_name = "'.$wpdb->escape($linkname).'"');
+ return $wpdb->get_var( $wpdb->prepare("SELECT link_id FROM $wpdb->links WHERE link_name = %s", $linkname) );
}
}
diff --git a/wp-admin/import/wordpress.php b/wp-admin/import/wordpress.php
index 03395bd..5271abe 100644
--- a/wp-admin/import/wordpress.php
+++ b/wp-admin/import/wordpress.php
@@ -218,7 +218,7 @@ class WP_Import {
function users_form($n, $author) {
if ( $this->allow_create_users() ) {
- printf(__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user_create['.intval($n).']'.'" maxlength="30"> <br />');
+ printf('<label>'.__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user_create['.intval($n).']'.'" maxlength="30"></label> <br />');
}
else {
echo __('Map to existing').'<br />';
@@ -357,6 +357,11 @@ class WP_Import {
$guid = $this->get_tag( $post, 'guid' );
$post_author = $this->get_tag( $post, 'dc:creator' );
+ $post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
+ $post_excerpt = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_excerpt);
+ $post_excerpt = str_replace('<br>', '<br />', $post_excerpt);
+ $post_excerpt = str_replace('<hr>', '<hr />', $post_excerpt);
+
$post_content = $this->get_tag( $post, 'content:encoded' );
$post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
$post_content = str_replace('<br>', '<br />', $post_content);
@@ -404,7 +409,7 @@ class WP_Import {
$post_author = $this->checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor
- $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent', 'menu_order', 'post_type', 'post_password');
+ $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_excerpt', 'post_title', 'post_status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent', 'menu_order', 'post_type', 'post_password');
if ($post_type == 'attachment') {
$remote_url = $this->get_tag( $post, 'wp:attachment_url' );
if ( !$remote_url )
diff --git a/wp-admin/import/wp-cat2tag.php b/wp-admin/import/wp-cat2tag.php
index 246125e..3176fa4 100644
--- a/wp-admin/import/wp-cat2tag.php
+++ b/wp-admin/import/wp-cat2tag.php
@@ -3,50 +3,75 @@
class WP_Categories_to_Tags {
var $categories_to_convert = array();
var $all_categories = array();
+ var $tags_to_convert = array();
+ var $all_tags = array();
+ var $hybrids_ids = array();
function header() {
echo '<div class="wrap">';
- echo '<h2>' . __('Convert Categories to Tags') . '</h2>';
+ if ( ! current_user_can('manage_categories') ) {
+ echo '<div class="narrow">';
+ echo '<p>' . __('Cheatin&#8217; uh?') . '</p>';
+ echo '</div>';
+ } else { ?>
+ <div class="tablenav"><p style="margin:4px"><a style="display:inline;" class="button-secondary" href="admin.php?import=wp-cat2tag">Categories to Tags</a>
+ <a style="display:inline;" class="button-secondary" href="admin.php?import=wp-cat2tag&amp;step=3">Tags to Categories</a></p></div>
+<?php }
}
function footer() {
echo '</div>';
}
- function populate_all_categories() {
+ function populate_cats() {
global $wpdb;
$categories = get_categories('get=all');
foreach ( $categories as $category ) {
- if ( !tag_exists($wpdb->escape($category->name)) )
- $this->all_categories[] = $category;
+ $this->all_categories[] = $category;
+ if ( tag_exists( $wpdb->escape($category->name) ) )
+ $this->hybrids_ids[] = $category->term_id;
+ }
+ }
+
+ function populate_tags() {
+ global $wpdb;
+
+ $tags = get_terms( array('post_tag'), 'get=all' );
+ foreach ( $tags as $tag ) {
+ $this->all_tags[] = $tag;
+ if ( $this->_category_exists($tag->term_id) )
+ $this->hybrids_ids[] = $tag->term_id;
}
}
- function welcome() {
- $this->populate_all_categories();
+ function categories_tab() {
+ $this->populate_cats();
+ $cat_num = count($this->all_categories);
- echo '<div class="narrow">';
+ echo '<br class="clear" />';
- if (count($this->all_categories) > 0) {
+ if ( $cat_num > 0 ) {
+ echo '<h2>Convert Categories (' . $cat_num . ') to Tags.</h2>';
+ echo '<div class="narrow">';
echo '<p>' . __('Hey there. Here you can selectively converts existing categories to tags. To get started, check the categories you wish to be converted, then click the Convert button.') . '</p>';
- echo '<p>' . __('Keep in mind that if you convert a category with child categories, the children become top-level orphans.') . '</p>';
+ echo '<p>' . __('Keep in mind that if you convert a category with child categories, the children become top-level orphans.') . '</p></div>';
$this->categories_form();
+ } elseif ( $hyb_num > 0 ) {
+ echo '<p>' . __('You have no categories that can be converted. However some of your categories are both a tag and a category.') . '</p>';
} else {
echo '<p>'.__('You have no categories to convert!').'</p>';
}
-
- echo '</div>';
}
- function categories_form() {
-?>
+ function categories_form() { ?>
+
<script type="text/javascript">
-<!--
+/* <![CDATA[ */
var checkflag = "false";
function check_all_rows() {
- field = document.formlist;
+ field = document.catlist;
if ( 'false' == checkflag ) {
for ( i = 0; i < field.length; i++ ) {
if ( 'cats_to_convert[]' == field[i].name )
@@ -63,54 +88,153 @@ function check_all_rows() {
return '<?php _e('Check All') ?>';
}
}
-
-// -->
+/* ]]> */
</script>
-<?php
- echo '<form name="formlist" id="formlist" action="admin.php?import=wp-cat2tag&amp;step=2" method="post">
- <p><input type="button" class="button-secondary" value="' . __('Check All') . '"' . ' onClick="this.value=check_all_rows()"></p>';
- wp_nonce_field('import-cat2tag');
- echo '<ul style="list-style:none">';
+<form name="catlist" id="catlist" action="admin.php?import=wp-cat2tag&amp;step=2" method="post">
+<p><input type="button" class="button-secondary" value="<?php _e('Check All'); ?>" onclick="this.value=check_all_rows()">
+<?php wp_nonce_field('import-cat2tag'); ?></p>
+<ul style="list-style:none">
+<?php
$hier = _get_term_hierarchy('category');
foreach ($this->all_categories as $category) {
$category = sanitize_term( $category, 'category', 'display' );
- if ((int) $category->parent == 0) {
- echo '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($category->term_id) . '" /> ' . $category->name . ' (' . $category->count . ')</label>';
+ if ( (int) $category->parent == 0 ) {
+ if ( in_array( intval($category->term_id), $this->hybrids_ids ) ) {
+?>
+ <li style="color:#777;padding-left:1.3em;"><?php echo $category->name . ' (' . $category->count . ') *'; ?></li>
+<?php
+ } else {
+?>
+ <li><label><input type="checkbox" name="cats_to_convert[]" value="<?php echo intval($category->term_id); ?>" /> <?php echo $category->name . ' (' . $category->count . ')'; ?></label><?php
- if (isset($hier[$category->term_id])) {
- $this->_category_children($category, $hier);
+ if ( isset($hier[$category->term_id]) )
+ $this->_category_children($category, $hier);
+?></li>
+<?php
}
+ }
+ }
+?>
+</ul>
+
+<?php
+ if ( ! empty($this->hybrids_ids) ) {
+ echo '<p>' . __('* This category is also a tag. It cannot be convert again.') . '</p>';
+ }
+?>
+<p class="submit"><input type="submit" name="submit" class="button" value="<?php _e('Convert Categories to Tags'); ?>" /></p>
+</form>
+
+<?php
+ }
- echo '</li>';
+ function tags_tab() {
+ $this->populate_tags();
+ $tags_num = count($this->all_tags);
+
+ echo '<br class="clear" />';
+
+ if ( $tags_num > 0 ) {
+ echo '<h2>Convert Tags (' . $tags_num . ') to Categories.</h2>';
+ echo '<div class="narrow">';
+ echo '<p>' . __('Here you can selectively converts existing tags to categories. To get started, check the tags you wish to be converted, then click the Convert button.') . '</p>';
+ echo '<p>' . __('The newly created categories will still be associated with the same posts.') . '</p></div>';
+
+
+ $this->tags_form();
+ } elseif ( $hyb_num > 0 ) {
+ echo '<p>' . __('You have no tags that can be converted. However some of your tags are both a tag and a category.') . '</p>';
+ } else {
+ echo '<p>'.__('You have no tags to convert!').'</p>';
+ }
+ }
+
+ function tags_form() { ?>
+
+<script type="text/javascript">
+/* <![CDATA[ */
+var checktags = "false";
+function check_all_tagrows() {
+ field = document.taglist;
+ if ( 'false' == checktags ) {
+ for ( i = 0; i < field.length; i++ ) {
+ if ( 'tags_to_convert[]' == field[i].name )
+ field[i].checked = true;
+ }
+ checktags = 'true';
+ return '<?php _e('Uncheck All') ?>';
+ } else {
+ for ( i = 0; i < field.length; i++ ) {
+ if ( 'tags_to_convert[]' == field[i].name )
+ field[i].checked = false;
+ }
+ checktags = 'false';
+ return '<?php _e('Check All') ?>';
+ }
+}
+/* ]]> */
+</script>
+
+<form name="taglist" id="taglist" action="admin.php?import=wp-cat2tag&amp;step=4" method="post">
+<p><input type="button" class="button-secondary" value="<?php _e('Check All'); ?>" onclick="this.value=check_all_tagrows()">
+<?php wp_nonce_field('import-cat2tag'); ?></p>
+<ul style="list-style:none">
+<?php
+ foreach ( $this->all_tags as $tag ) {
+ if ( in_array( intval($tag->term_id), $this->hybrids_ids ) ) {
+?>
+ <li style="color:#777;padding-left:1.3em;"><?php echo attribute_escape($tag->name) . ' (' . $tag->count . ') *'; ?></li>
+<?php
+ } else {
+?>
+ <li><label><input type="checkbox" name="tags_to_convert[]" value="<?php echo intval($tag->term_id); ?>" /> <?php echo attribute_escape($tag->name) . ' (' . $tag->count . ')'; ?></label></li>
+
+<?php
}
}
+?>
+</ul>
- echo '</ul>';
+<?php
+ if ( ! empty($this->hybrids_ids) )
+ echo '<p>' . __('* This tag is also a category. It cannot be converted again.') . '</p>';
+?>
- echo '<p class="submit"><input type="submit" name="submit" class="button" value="' . __('Convert Tags') . '" /></p>';
+<p class="submit"><input type="submit" name="submit_tags" class="button" value="<?php _e('Convert Tags to Categories'); ?>" /></p>
+</form>
- echo '</form>';
+<?php
}
function _category_children($parent, $hier) {
- echo '<ul style="list-style:none">';
+?>
+ <ul style="list-style:none">
+<?php
foreach ($hier[$parent->term_id] as $child_id) {
$child =& get_category($child_id);
+
+ if ( in_array( intval($child->term_id), $this->hybrids_ids ) ) {
+?>
+ <li style="color:#777;padding-left:1.3em;"><?php echo $child->name . ' (' . $child->count . ') *'; ?></li>
+<?php
+ } else {
+?>
+ <li><label><input type="checkbox" name="cats_to_convert[]" value="<?php echo intval($child->term_id); ?>" /> <?php echo $child->name . ' (' . $child->count . ')'; ?></label>
+<?php
- echo '<li><label><input type="checkbox" name="cats_to_convert[]" value="' . intval($child->term_id) . '" /> ' . $child->name . ' (' . $child->count . ')</label>';
-
- if (isset($hier[$child->term_id])) {
+ if ( isset($hier[$child->term_id]) )
$this->_category_children($child, $hier);
+?> </li>
+<?php
}
-
- echo '</li>';
}
-
- echo '</ul>';
+?>
+ </ul>
+<?php
}
function _category_exists($cat_id) {
@@ -125,7 +249,7 @@ function check_all_rows() {
}
}
- function convert_them() {
+ function convert_categories() {
global $wpdb;
if ( (!isset($_POST['cats_to_convert']) || !is_array($_POST['cats_to_convert'])) && empty($this->categories_to_convert)) {
@@ -135,7 +259,6 @@ function check_all_rows() {
return;
}
-
if ( empty($this->categories_to_convert) )
$this->categories_to_convert = $_POST['cats_to_convert'];
$hier = _get_term_hierarchy('category');
@@ -164,12 +287,12 @@ function check_all_rows() {
$id = $id['term_taxonomy_id'];
$posts = get_objects_in_term($category->term_id, 'category');
foreach ( $posts as $post ) {
- if ( !$wpdb->get_var("SELECT object_id FROM $wpdb->term_relationships WHERE object_id = '$post' AND term_taxonomy_id = '$id'") )
- $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$post', '$id')");
+ if ( !$wpdb->get_var( $wpdb->prepare("SELECT object_id FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id = %d", $post, $id) ) )
+ $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES (%d, %d)", $post, $id) );
clean_post_cache($post);
}
} else {
- $tt_ids = $wpdb->get_col("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = '{$category->term_id}' AND taxonomy = 'category'");
+ $tt_ids = $wpdb->get_col( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'category'", $category->term_id) );
if ( $tt_ids ) {
$posts = $wpdb->get_col("SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id IN (" . join(',', $tt_ids) . ") GROUP BY object_id");
foreach ( (array) $posts as $post )
@@ -177,14 +300,14 @@ function check_all_rows() {
}
// Change the category to a tag.
- $wpdb->query("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag' WHERE term_id = '{$category->term_id}' AND taxonomy = 'category'");
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag' WHERE term_id = %d AND taxonomy = 'category'", $category->term_id) );
- $terms = $wpdb->get_col("SELECT term_id FROM $wpdb->term_taxonomy WHERE parent = '{$category->term_id}' AND taxonomy = 'category'");
+ $terms = $wpdb->get_col( $wpdb->prepare("SELECT term_id FROM $wpdb->term_taxonomy WHERE parent = %d AND taxonomy = 'category'", $category->term_id) );
foreach ( (array) $terms as $term )
clean_category_cache($term);
// Set all parents to 0 (root-level) if their parent was the converted tag
- $wpdb->query("UPDATE $wpdb->term_taxonomy SET parent = 0 WHERE parent = '{$category->term_id}' AND taxonomy = 'category'");
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET parent = 0 WHERE parent = %d AND taxonomy = 'category'", $category->term_id) );
}
// Clean the cache
clean_category_cache($category->term_id);
@@ -199,27 +322,93 @@ function check_all_rows() {
echo '<p>' . sprintf( __('We&#8217;re all done here, but you can always <a href="%s">convert more</a>.'), 'admin.php?import=wp-cat2tag' ) . '</p>';
}
+ function convert_tags() {
+ global $wpdb;
+
+ if ( (!isset($_POST['tags_to_convert']) || !is_array($_POST['tags_to_convert'])) && empty($this->tags_to_convert)) {
+ echo '<div class="narrow">';
+ echo '<p>' . sprintf(__('Uh, oh. Something didn&#8217;t work. Please <a href="%s">try again</a>.'), 'admin.php?import=wp-cat2tag&amp;step=3') . '</p>';
+ echo '</div>';
+ return;
+ }
+
+ if ( empty($this->categories_to_convert) )
+ $this->tags_to_convert = $_POST['tags_to_convert'];
+
+ $clean_cache = array();
+ echo '<ul>';
+
+ foreach ( (array) $this->tags_to_convert as $tag_id) {
+ $tag_id = (int) $tag_id;
+
+ echo '<li>' . sprintf(__('Converting tag #%s ... '), $tag_id);
+
+ if ( ! is_term($tag_id, 'post_tag') ) {
+ _e('Tag doesn\'t exist!');
+ } else {
+
+ if ( is_term($tag_id, 'category') ) {
+ _e('This Tag is already a Category.');
+ echo '</li>';
+ continue;
+ }
+
+ $tt_ids = $wpdb->get_col( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'post_tag'", $tag_id) );
+ if ( $tt_ids ) {
+ $posts = $wpdb->get_col("SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id IN (" . join(',', $tt_ids) . ") GROUP BY object_id");
+ foreach ( (array) $posts as $post )
+ clean_post_cache($post);
+ }
+
+ // Change the tag to a category.
+ $parent = $wpdb->get_var( $wpdb->prepare("SELECT parent FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'post_tag'", $tag_id) );
+ if ( 0 == $parent || (0 < (int) $parent && $this->_category_exists($parent)) )
+ $reset_parent = '';
+ else $reset_parent = ", parent = '0'";
+
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET taxonomy = 'category' $reset_parent WHERE term_id = %d AND taxonomy = 'post_tag'", $tag_id) );
+
+ // Clean the cache
+ $clean_cache[] = $tag_id;
+
+ _e('Converted successfully.');
+ }
+
+ echo '</li>';
+ }
+
+ clean_term_cache( $clean_cache, 'post_tag' );
+ delete_option('category_children');
+
+ echo '</ul>';
+ echo '<p>' . sprintf( __('We&#8217;re all done here, but you can always <a href="%s">convert more</a>.'), 'admin.php?import=wp-cat2tag&amp;step=3' ) . '</p>';
+ }
+
function init() {
$step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1;
$this->header();
- if (!current_user_can('manage_categories')) {
- echo '<div class="narrow">';
- echo '<p>' . __('Cheatin&#8217; uh?') . '</p>';
- echo '</div>';
- } else {
- if ( $step > 1 )
- check_admin_referer('import-cat2tag');
+ if ( current_user_can('manage_categories') ) {
switch ($step) {
case 1 :
- $this->welcome();
+ $this->categories_tab();
break;
case 2 :
- $this->convert_them();
+ check_admin_referer('import-cat2tag');
+ $this->convert_categories();
+ break;
+
+ case 3 :
+ $this->tags_tab();
+ break;
+
+ case 4 :
+ check_admin_referer('import-cat2tag');
+ $this->convert_tags();
break;
}
}
@@ -234,6 +423,6 @@ function check_all_rows() {
$wp_cat2tag_importer = new WP_Categories_to_Tags();
-register_importer('wp-cat2tag', __('Categories to Tags Converter'), __('Convert existing categories to tags, selectively.'), array(&$wp_cat2tag_importer, 'init'));
+register_importer('wp-cat2tag', __('Categories and Tags Converter'), __('Convert existing categories to tags or tags to categories, selectively.'), array(&$wp_cat2tag_importer, 'init'));
?>
diff --git a/wp-admin/includes/bookmark.php b/wp-admin/includes/bookmark.php
index 2cae3b5..b48d313 100644
--- a/wp-admin/includes/bookmark.php
+++ b/wp-admin/includes/bookmark.php
@@ -47,7 +47,7 @@ function wp_delete_link($link_id) {
wp_delete_object_term_relationships($link_id, 'link_category');
- $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'");
+ $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->links WHERE link_id = %d", $link_id) );
do_action('deleted_link', $link_id);
@@ -73,7 +73,7 @@ function wp_insert_link($linkdata) {
$linkdata = wp_parse_args($linkdata, $defaults);
$linkdata = sanitize_bookmark($linkdata, 'db');
- extract($linkdata, EXTR_SKIP);
+ extract(stripslashes_deep($linkdata), EXTR_SKIP);
$update = false;
@@ -119,15 +119,14 @@ function wp_insert_link($linkdata) {
}
if ( $update ) {
- $wpdb->query("UPDATE $wpdb->links SET link_url='$link_url',
- link_name='$link_name', link_image='$link_image',
- link_target='$link_target',
- link_visible='$link_visible', link_description='$link_description',
- link_rating='$link_rating', link_rel='$link_rel',
- link_notes='$link_notes', link_rss = '$link_rss'
- WHERE link_id='$link_id'");
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_url = %s,
+ link_name = %s, link_image = %s, link_target = %s,
+ link_visible = %s, link_description = %s, link_rating = %s,
+ link_rel = %s, link_notes = %s, link_rss = %s
+ WHERE link_id = %s", $link_url, $link_name, $link_image, $link_target, $link_visible, $link_description, $link_rating, $link_rel, $link_notes, $link_rss, $link_id) );
} else {
- $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES('$link_url','$link_name', '$link_image', '$link_target', '$link_description', '$link_visible', '$link_owner', '$link_rating', '$link_rel', '$link_notes', '$link_rss')");
+ $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
+ $link_url,$link_name, $link_image, $link_target, $link_description, $link_visible, $link_owner, $link_rating, $link_rel, $link_notes, $link_rss) );
$link_id = (int) $wpdb->insert_id;
}
diff --git a/wp-admin/includes/class-wp-filesystem-base.php b/wp-admin/includes/class-wp-filesystem-base.php
new file mode 100644
index 0000000..7bb6217
--- /dev/null
+++ b/wp-admin/includes/class-wp-filesystem-base.php
@@ -0,0 +1,158 @@
+<?php
+class WP_Filesystem_Base{
+ var $verbose = true;
+ var $cache = array();
+
+ var $method = '';
+
+ function abspath() {
+ if ( defined('FTP_BASE') && strpos($this->method, 'ftp') !== false )
+ return FTP_BASE;
+ return $this->find_folder(ABSPATH);
+ }
+ function wp_content_dir() {
+ if ( defined('FTP_CONTENT_DIR') && strpos($this->method, 'ftp') !== false )
+ return FTP_CONTENT_DIR;
+ return $this->find_folder(WP_CONTENT_DIR);
+ }
+ function wp_plugins_dir() {
+ if ( defined('FTP_PLUGIN_DIR') && strpos($this->method, 'ftp') !== false )
+ return FTP_PLUGIN_DIR;
+ return $this->find_folder(WP_PLUGIN_DIR);
+ }
+ function wp_themes_dir() {
+ return $this->wp_content_dir() . '/themes';
+ }
+ //Back compat: use abspath() or wp_*_dir
+ function find_base_dir($base = '.', $echo = false) {
+ $this->verbose = $echo;
+ return $this->abspath();
+ }
+ //Back compat: use ::abspath() or ::wp_*_dir
+ function get_base_dir($base = '.', $echo = false) {
+ $this->verbose = $echo;
+ return $this->abspath();
+ }
+
+ function find_folder($folder) {
+ $folder = str_replace('\\', '/', $folder); //Windows Sanitiation
+ if ( isset($this->cache[ $folder ] ) )
+ return $this->cache[ $folder ];
+
+ if ( $this->exists($folder) ) { //Folder exists at that absolute path.
+ $this->cache[ $folder ] = $folder;
+ return $folder;
+ }
+ if( $return = $this->search_for_folder($folder) )
+ $this->cache[ $folder ] = $return;
+ return $return;
+ }
+
+ // Assumes $folder is windows sanitized;
+ // Assumes that the drive letter is safe to be stripped off, Should not be a problem for windows servers.
+ function search_for_folder($folder, $base = '.', $loop = false ) {
+ if ( empty( $base ) || '.' == $base )
+ $base = trailingslashit($this->cwd());
+
+ $folder = preg_replace('|^([a-z]{1}):|i', '', $folder); //Strip out windows driveletter if its there.
+
+ $folder_parts = explode('/', $folder);
+ $last_path = $folder_parts[ count($folder_parts) - 1 ];
+
+ $files = $this->dirlist( $base );
+
+ foreach ( $folder_parts as $key ) {
+ if ( $key == $last_path )
+ continue; //We want this to be caught by the next code block.
+
+ //Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder,
+ // If its found, change into it and follow through looking for it.
+ // If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on.
+ // If it reaches the end, and still cant find it, it'll return false for the entire function.
+ if( isset($files[ $key ]) ){
+ //Lets try that folder:
+ $newdir = trailingslashit(path_join($base, $key));
+ if( $this->verbose )
+ printf( __('Changing to %s') . '<br/>', $newdir );
+ if( $ret = $this->search_for_folder( $folder, $newdir, $loop) )
+ return $ret;
+ }
+ }
+
+ //Only check this as a last resort, to prevent locating the incorrect install. All above proceeedures will fail quickly if this is the right branch to take.
+ if(isset( $files[ $last_path ] ) ) {
+ if( $this->verbose )
+ printf( __('Found %s') . '<br/>', $base . $last_path );
+ return $base . $last_path;
+ }
+ if( $loop )
+ return false;//Prevent tihs function looping again.
+ //As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups.
+ return $this->search_for_folder($folder, '/', true);
+
+ }
+
+ //Common Helper functions.
+ function gethchmod($file){
+ //From the PHP.net page for ...?
+ $perms = $this->getchmod($file);
+ if (($perms & 0xC000) == 0xC000) // Socket
+ $info = 's';
+ elseif (($perms & 0xA000) == 0xA000) // Symbolic Link
+ $info = 'l';
+ elseif (($perms & 0x8000) == 0x8000) // Regular
+ $info = '-';
+ elseif (($perms & 0x6000) == 0x6000) // Block special
+ $info = 'b';
+ elseif (($perms & 0x4000) == 0x4000) // Directory
+ $info = 'd';
+ elseif (($perms & 0x2000) == 0x2000) // Character special
+ $info = 'c';
+ elseif (($perms & 0x1000) == 0x1000)// FIFO pipe
+ $info = 'p';
+ else // Unknown
+ $info = 'u';
+
+ // Owner
+ $info .= (($perms & 0x0100) ? 'r' : '-');
+ $info .= (($perms & 0x0080) ? 'w' : '-');
+ $info .= (($perms & 0x0040) ?
+ (($perms & 0x0800) ? 's' : 'x' ) :
+ (($perms & 0x0800) ? 'S' : '-'));
+
+ // Group
+ $info .= (($perms & 0x0020) ? 'r' : '-');
+ $info .= (($perms & 0x0010) ? 'w' : '-');
+ $info .= (($perms & 0x0008) ?
+ (($perms & 0x0400) ? 's' : 'x' ) :
+ (($perms & 0x0400) ? 'S' : '-'));
+
+ // World
+ $info .= (($perms & 0x0004) ? 'r' : '-');
+ $info .= (($perms & 0x0002) ? 'w' : '-');
+ $info .= (($perms & 0x0001) ?
+ (($perms & 0x0200) ? 't' : 'x' ) :
+ (($perms & 0x0200) ? 'T' : '-'));
+ return $info;
+ }
+ function getnumchmodfromh($mode) {
+ $realmode = "";
+ $legal = array("", "w", "r", "x", "-");
+ $attarray = preg_split("//", $mode);
+
+ for($i=0; $i < count($attarray); $i++)
+ if($key = array_search($attarray[$i], $legal))
+ $realmode .= $legal[$key];
+
+ $mode = str_pad($realmode, 9, '-');
+ $trans = array('-'=>'0', 'r'=>'4', 'w'=>'2', 'x'=>'1');
+ $mode = strtr($mode,$trans);
+
+ $newmode = '';
+ $newmode .= $mode[0] + $mode[1] + $mode[2];
+ $newmode .= $mode[3] + $mode[4] + $mode[5];
+ $newmode .= $mode[6] + $mode[7] + $mode[8];
+ return $newmode;
+ }
+}
+?> \ No newline at end of file
diff --git a/wp-admin/includes/class-wp-filesystem-direct.php b/wp-admin/includes/class-wp-filesystem-direct.php
index 45972a3..77a7582 100644
--- a/wp-admin/includes/class-wp-filesystem-direct.php
+++ b/wp-admin/includes/class-wp-filesystem-direct.php
@@ -1,51 +1,46 @@
<?php
-class WP_Filesystem_Direct{
+class WP_Filesystem_Direct extends WP_Filesystem_Base {
var $permission = null;
var $errors = array();
- function WP_Filesystem_Direct($arg){
+ function WP_Filesystem_Direct($arg) {
+ $this->method = 'direct';
$this->errors = new WP_Error();
$this->permission = umask();
}
- function connect(){
+ function connect() {
return true;
}
- function setDefaultPermissions($perm){
+ function setDefaultPermissions($perm) {
$this->permission = $perm;
}
- function find_base_dir($base = '.', $echo = false){
- return str_replace('\\','/',ABSPATH);
- }
- function get_base_dir($base = '.', $echo = false){
- return $this->find_base_dir($base, $echo);
- }
- function get_contents($file){
+ function get_contents($file) {
return @file_get_contents($file);
}
- function get_contents_array($file){
+ function get_contents_array($file) {
return @file($file);
}
- function put_contents($file,$contents,$mode=false,$type=''){
- if ( ! ($fp = @fopen($file,'w'.$type)) )
+ function put_contents($file, $contents, $mode = false, $type = '') {
+ if ( ! ($fp = @fopen($file, 'w' . $type)) )
return false;
- @fwrite($fp,$contents);
+ @fwrite($fp, $contents);
@fclose($fp);
$this->chmod($file,$mode);
return true;
}
- function cwd(){
+ function cwd() {
return @getcwd();
}
- function chdir($dir){
+ function chdir($dir) {
return @chdir($dir);
}
- function chgrp($file,$group,$recursive=false){
+ function chgrp($file, $group, $recursive = false) {
if( ! $this->exists($file) )
return false;
if( ! $recursive )
- return @chgrp($file,$group);
+ return @chgrp($file, $group);
if( ! $this->is_dir($file) )
- return @chgrp($file,$group);
+ return @chgrp($file, $group);
//Is a directory, and we want recursive
$file = trailingslashit($file);
$filelist = $this->dirlist($file);
@@ -54,7 +49,7 @@ class WP_Filesystem_Direct{
return true;
}
- function chmod($file,$mode=false,$recursive=false){
+ function chmod($file, $mode = false, $recursive = false) {
if( ! $mode )
$mode = $this->permission;
if( ! $this->exists($file) )
@@ -62,7 +57,7 @@ class WP_Filesystem_Direct{
if( ! $recursive )
return @chmod($file,$mode);
if( ! $this->is_dir($file) )
- return @chmod($file,$mode);
+ return @chmod($file, $mode);
//Is a directory, and we want recursive
$file = trailingslashit($file);
$filelist = $this->dirlist($file);
@@ -71,120 +66,51 @@ class WP_Filesystem_Direct{
return true;
}
- function chown($file,$owner,$recursive=false){
+ function chown($file, $owner, $recursive = false) {
if( ! $this->exists($file) )
return false;
if( ! $recursive )
- return @chown($file,$owner);
+ return @chown($file, $owner);
if( ! $this->is_dir($file) )
- return @chown($file,$owner);
+ return @chown($file, $owner);
//Is a directory, and we want recursive
$filelist = $this->dirlist($file);
foreach($filelist as $filename){
- $this->chown($file.'/'.$filename,$owner,$recursive);
+ $this->chown($file . '/' . $filename, $owner, $recursive);
}
return true;
}
- function owner($file){
+ function owner($file) {
$owneruid = @fileowner($file);
if( ! $owneruid )
return false;
- if( !function_exists('posix_getpwuid') )
+ if( ! function_exists('posix_getpwuid') )
return $owneruid;
$ownerarray = posix_getpwuid($owneruid);
return $ownerarray['name'];
}
- function getchmod($file){
+ function getchmod($file) {
return @fileperms($file);
}
- function gethchmod($file){
- //From the PHP.net page for ...?
- $perms = $this->getchmod($file);
- if (($perms & 0xC000) == 0xC000) {
- // Socket
- $info = 's';
- } elseif (($perms & 0xA000) == 0xA000) {
- // Symbolic Link
- $info = 'l';
- } elseif (($perms & 0x8000) == 0x8000) {
- // Regular
- $info = '-';
- } elseif (($perms & 0x6000) == 0x6000) {
- // Block special
- $info = 'b';
- } elseif (($perms & 0x4000) == 0x4000) {
- // Directory
- $info = 'd';
- } elseif (($perms & 0x2000) == 0x2000) {
- // Character special
- $info = 'c';
- } elseif (($perms & 0x1000) == 0x1000) {
- // FIFO pipe
- $info = 'p';
- } else {
- // Unknown
- $info = 'u';
- }
-
- // Owner
- $info .= (($perms & 0x0100) ? 'r' : '-');
- $info .= (($perms & 0x0080) ? 'w' : '-');
- $info .= (($perms & 0x0040) ?
- (($perms & 0x0800) ? 's' : 'x' ) :
- (($perms & 0x0800) ? 'S' : '-'));
-
- // Group
- $info .= (($perms & 0x0020) ? 'r' : '-');
- $info .= (($perms & 0x0010) ? 'w' : '-');
- $info .= (($perms & 0x0008) ?
- (($perms & 0x0400) ? 's' : 'x' ) :
- (($perms & 0x0400) ? 'S' : '-'));
-
- // World
- $info .= (($perms & 0x0004) ? 'r' : '-');
- $info .= (($perms & 0x0002) ? 'w' : '-');
- $info .= (($perms & 0x0001) ?
- (($perms & 0x0200) ? 't' : 'x' ) :
- (($perms & 0x0200) ? 'T' : '-'));
- return $info;
- }
- function getnumchmodfromh($mode) {
- $realmode = "";
- $legal = array("","w","r","x","-");
- $attarray = preg_split("//",$mode);
- for($i=0;$i<count($attarray);$i++){
- if($key = array_search($attarray[$i],$legal)){
- $realmode .= $legal[$key];
- }
- }
- $mode = str_pad($realmode,9,'-');
- $trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');
- $mode = strtr($mode,$trans);
- $newmode = '';
- $newmode .= $mode[0]+$mode[1]+$mode[2];
- $newmode .= $mode[3]+$mode[4]+$mode[5];
- $newmode .= $mode[6]+$mode[7]+$mode[8];
- return $newmode;
- }
- function group($file){
+ function group($file) {
$gid = @filegroup($file);
if( ! $gid )
return false;
- if( !function_exists('posix_getgrgid') )
+ if( ! function_exists('posix_getgrgid') )
return $gid;
$grouparray = posix_getgrgid($gid);
return $grouparray['name'];
}
- function copy($source,$destination,$overwrite=false){
+ function copy($source, $destination, $overwrite = false) {
if( ! $overwrite && $this->exists($destination) )
return false;
- return copy($source,$destination);
+ return copy($source, $destination);
}
- function move($source,$destination,$overwrite=false){
+ function move($source, $destination, $overwrite = false) {
//Possible to use rename()?
- if( $this->copy($source,$destination,$overwrite) && $this->exists($destination) ){
+ if( $this->copy($source, $destination, $overwrite) && $this->exists($destination) ){
$this->delete($source);
return true;
} else {
@@ -192,12 +118,12 @@ class WP_Filesystem_Direct{
}
}
- function delete($file, $recursive=false){
- $file = str_replace('\\','/',$file); //for win32, occasional problems deleteing files otherwise
+ function delete($file, $recursive = false) {
+ $file = str_replace('\\', '/', $file); //for win32, occasional problems deleteing files otherwise
if( $this->is_file($file) )
return @unlink($file);
- if( !$recursive && $this->is_dir($file) )
+ if( ! $recursive && $this->is_dir($file) )
return @rmdir($file);
//At this point its a folder, and we're in recursive mode
@@ -206,7 +132,7 @@ class WP_Filesystem_Direct{
$retval = true;
if( is_array($filelist) ) //false if no files, So check first.
- foreach($filelist as $filename=>$fileinfo)
+ foreach($filelist as $filename => $fileinfo)
if( ! $this->delete($file . $filename, $recursive) )
$retval = false;
@@ -215,34 +141,34 @@ class WP_Filesystem_Direct{
return $retval;
}
- function exists($file){
+ function exists($file) {
return @file_exists($file);
}
- function is_file($file){
+ function is_file($file) {
return @is_file($file);
}
- function is_dir($path){
+ function is_dir($path) {
return @is_dir($path);
}
- function is_readable($file){
+ function is_readable($file) {
return @is_readable($file);
}
- function is_writable($file){
+ function is_writable($file) {
return @is_writable($file);
}
- function atime($file){
+ function atime($file) {
return @fileatime($file);
}
- function mtime($file){
+ function mtime($file) {
return @filemtime($file);
}
- function size($file){
+ function size($file) {
return @filesize($file);
}
@@ -251,38 +177,38 @@ class WP_Filesystem_Direct{
$time = time();
if($atime == 0)
$atime = time();
- return @touch($file,$time,$atime);
+ return @touch($file, $time, $atime);
}
function mkdir($path, $chmod = false, $chown = false, $chgrp = false){
if( ! $chmod)
$chmod = $this->permission;
- if( !@mkdir($path,$chmod) )
+ if( ! @mkdir($path, $chmod) )
return false;
if( $chown )
- $this->chown($path,$chown);
+ $this->chown($path, $chown);
if( $chgrp )
- $this->chgrp($path,$chgrp);
+ $this->chgrp($path, $chgrp);
return true;
}
- function rmdir($path,$recursive=false){
+ function rmdir($path, $recursive = false) {
//Currently unused and untested, Use delete() instead.
if( ! $recursive )
return @rmdir($path);
//recursive:
$filelist = $this->dirlist($path);
- foreach($filelist as $filename=>$det){
- if ( '/' == substr($filename,-1,1) )
- $this->rmdir($path.'/'.$filename,$recursive);
+ foreach($filelist as $filename => $det) {
+ if ( '/' == substr($filename, -1, 1) )
+ $this->rmdir($path . '/' . $filename, $recursive);
@rmdir($filename);
}
return @rmdir($path);
}
- function dirlist($path,$incdot=false,$recursive=false){
- if( $this->is_file($path) ){
+ function dirlist($path, $incdot = false, $recursive = false) {
+ if( $this->is_file($path) ) {
$limitFile = basename($path);
$path = dirname($path);
} else {
@@ -293,9 +219,9 @@ class WP_Filesystem_Direct{
$ret = array();
$dir = dir($path);
- while (false !== ($entry = $dir->read())) {
+ while (false !== ($entry = $dir->read()) ) {
$struc = array();
- $struc['name'] = $entry;
+ $struc['name'] = $entry;
if( '.' == $struc['name'] || '..' == $struc['name'] )
continue; //Do not care about these folders.
@@ -315,9 +241,9 @@ class WP_Filesystem_Direct{
$struc['time'] = date('h:i:s',$struc['lastmodunix']);
$struc['type'] = $this->is_dir($path.'/'.$entry) ? 'd' : 'f';
- if ('d' == $struc['type'] ){
+ if ( 'd' == $struc['type'] ) {
if( $recursive )
- $struc['files'] = $this->dirlist($path.'/'.$struc['name'], $incdot, $recursive);
+ $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
else
$struc['files'] = array();
}
@@ -328,9 +254,5 @@ class WP_Filesystem_Direct{
unset($dir);
return $ret;
}
-
- function __destruct(){
- return;
- }
}
?>
diff --git a/wp-admin/includes/class-wp-filesystem-ftpext.php b/wp-admin/includes/class-wp-filesystem-ftpext.php
index 32ccd07..2069935 100644
--- a/wp-admin/includes/class-wp-filesystem-ftpext.php
+++ b/wp-admin/includes/class-wp-filesystem-ftpext.php
@@ -1,11 +1,10 @@
<?php
-class WP_Filesystem_FTPext{
+class WP_Filesystem_FTPext extends WP_Filesystem_Base{
var $link;
var $timeout = 5;
var $errors = array();
var $options = array();
- var $wp_base = '';
var $permission = null;
var $filetypes = array(
@@ -24,6 +23,7 @@ class WP_Filesystem_FTPext{
);
function WP_Filesystem_FTPext($opt='') {
+ $this->method = 'ftpext';
$this->errors = new WP_Error();
//Check if possible to use ftp functions.
@@ -60,12 +60,11 @@ class WP_Filesystem_FTPext{
$this->options['ssl'] = ( !empty($opt['ssl']) );
}
- function connect(){
- if ( $this->options['ssl'] && function_exists('ftp_ssl_connect') ) {
+ function connect() {
+ if ( $this->options['ssl'] && function_exists('ftp_ssl_connect') )
$this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'],$this->timeout);
- } else {
+ else
$this->link = @ftp_connect($this->options['hostname'], $this->options['port'],$this->timeout);
- }
if ( ! $this->link ) {
$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
@@ -80,76 +79,11 @@ class WP_Filesystem_FTPext{
return true;
}
- function setDefaultPermissions($perm){
+ function setDefaultPermissions($perm) {
$this->permission = $perm;
}
-
- function find_base_dir($base = '.',$echo = false, $loop = false) {
- //Sanitize the Windows path formats, This allows easier conparison and aligns it to FTP output.
- $abspath = str_replace('\\','/',ABSPATH); //windows: Straighten up the paths..
- if( strpos($abspath, ':') ){ //Windows, Strip out the driveletter
- if( preg_match("|.{1}\:(.+)|i", $abspath, $mat) )
- $abspath = $mat[1];
- }
- //Set up the base directory (Which unless specified, is the current one)
- if( empty( $base ) || '.' == $base ) $base = $this->cwd();
- $base = trailingslashit($base);
-
- //Can we see the Current directory as part of the ABSPATH?
- $location = strpos($abspath, $base);
- if( false !== $location ) {
- $newbase = path_join($base, substr($abspath, $location + strlen($base)));
-
- if( false !== $this->chdir($newbase) ){ //chdir sometimes returns null under certain circumstances, even when its changed correctly, FALSE will be returned if it doesnt change correctly.
- if($echo) printf( __('Changing to %s') . '<br/>', $newbase );
- //Check to see if it exists in that folder.
- if( $this->exists($newbase . 'wp-settings.php') ){
- if($echo) printf( __('Found %s'), $newbase . 'wp-settings.php<br/>' );
- return $newbase;
- }
- }
- }
-
- //Ok, Couldnt do a magic location from that particular folder level
-
- //Get a list of the files in the current directory, See if we can locate where we are in the folder stucture.
- $files = $this->dirlist($base);
-
- $arrPath = explode('/', $abspath);
- foreach($arrPath as $key){
- //Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder,
- // If its found, change into it and follow through looking for it.
- // If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on.
- // If it reaches the end, and still cant find it, it'll return false for the entire function.
- if( isset($files[ $key ]) ){
- //Lets try that folder:
- $folder = path_join($base, $key);
- if($echo) printf( __('Changing to %s') . '<br/>', $folder );
- $ret = $this->find_base_dir( $folder, $echo, $loop);
- if( $ret )
- return $ret;
- }
- }
- //Only check this as a last resort, to prevent locating the incorrect install. All above proceeedures will fail quickly if this is the right branch to take.
- if(isset( $files[ 'wp-settings.php' ]) ){
- if($echo) printf( __('Found %s'), $base . 'wp-settings.php<br/>' );
- return $base;
- }
- if( $loop )
- return false;//Prevent tihs function looping again.
- //As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups.
- return $this->find_base_dir('/', $echo, true);
- }
-
- function get_base_dir($base = '.', $echo = false){
- if( defined('FTP_BASE') )
- $this->wp_base = FTP_BASE;
- if( empty($this->wp_base) )
- $this->wp_base = $this->find_base_dir($base,$echo);
- return $this->wp_base;
- }
- function get_contents($file,$type='',$resumepos=0){
+ function get_contents($file, $type = '', $resumepos = 0 ){
if( empty($type) ){
$extension = substr(strrchr($file, "."), 1);
$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII;
@@ -157,7 +91,7 @@ class WP_Filesystem_FTPext{
$temp = tmpfile();
if ( ! $temp )
return false;
- if( ! @ftp_fget($this->link,$temp,$file,$type,$resumepos) )
+ if( ! @ftp_fget($this->link, $temp, $file, $type, $resumepos) )
return false;
fseek($temp, 0); //Skip back to the start of the file being written to
$contents = '';
@@ -167,202 +101,132 @@ class WP_Filesystem_FTPext{
fclose($temp);
return $contents;
}
- function get_contents_array($file){
- return explode("\n",$this->get_contents($file));
+ function get_contents_array($file) {
+ return explode("\n", $this->get_contents($file));
}
- function put_contents($file,$contents,$type=''){
- if( empty($type) ){
+ function put_contents($file, $contents, $type = '' ) {
+ if( empty($type) ) {
$extension = substr(strrchr($file, "."), 1);
$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII;
}
$temp = tmpfile();
if ( ! $temp )
return false;
- fwrite($temp,$contents);
+ fwrite($temp, $contents);
fseek($temp, 0); //Skip back to the start of the file being written to
- $ret = @ftp_fput($this->link,$file,$temp,$type);
+ $ret = @ftp_fput($this->link, $file, $temp, $type);
fclose($temp);
return $ret;
}
- function cwd(){
+ function cwd() {
$cwd = ftp_pwd($this->link);
if( $cwd )
$cwd = trailingslashit($cwd);
return $cwd;
}
- function chdir($dir){
+ function chdir($dir) {
return @ftp_chdir($dir);
}
- function chgrp($file,$group,$recursive=false){
+ function chgrp($file, $group, $recursive = false ) {
return false;
}
- function chmod($file,$mode=false,$recursive=false){
+ function chmod($file, $mode = false, $recursive = false) {
if( ! $mode )
$mode = $this->permission;
if( ! $mode )
return false;
if ( ! $this->exists($file) )
return false;
- if ( ! $recursive || ! $this->is_dir($file) ){
- if (!function_exists('ftp_chmod'))
+ if ( ! $recursive || ! $this->is_dir($file) ) {
+ if ( ! function_exists('ftp_chmod') )
return @ftp_site($this->link, sprintf('CHMOD %o %s', $mode, $file));
- return @ftp_chmod($this->link,$mode,$file);
+ return @ftp_chmod($this->link, $mode, $file);
}
//Is a directory, and we want recursive
$filelist = $this->dirlist($file);
foreach($filelist as $filename){
- $this->chmod($file.'/'.$filename,$mode,$recursive);
+ $this->chmod($file . '/' . $filename, $mode, $recursive);
}
return true;
}
- function chown($file,$owner,$recursive=false){
+ function chown($file, $owner, $recursive = false ) {
return false;
}
- function owner($file){
+ function owner($file) {
$dir = $this->dirlist($file);
return $dir[$file]['owner'];
}
- function getchmod($file){
+ function getchmod($file) {
$dir = $this->dirlist($file);
return $dir[$file]['permsn'];
}
- function gethchmod($file){
- //From the PHP.net page for ...?
- $perms = $this->getchmod($file);
- if (($perms & 0xC000) == 0xC000) {
- // Socket
- $info = 's';
- } elseif (($perms & 0xA000) == 0xA000) {
- // Symbolic Link
- $info = 'l';
- } elseif (($perms & 0x8000) == 0x8000) {
- // Regular
- $info = '-';
- } elseif (($perms & 0x6000) == 0x6000) {
- // Block special
- $info = 'b';
- } elseif (($perms & 0x4000) == 0x4000) {
- // Directory
- $info = 'd';
- } elseif (($perms & 0x2000) == 0x2000) {
- // Character special
- $info = 'c';
- } elseif (($perms & 0x1000) == 0x1000) {
- // FIFO pipe
- $info = 'p';
- } else {
- // Unknown
- $info = 'u';
- }
-
- // Owner
- $info .= (($perms & 0x0100) ? 'r' : '-');
- $info .= (($perms & 0x0080) ? 'w' : '-');
- $info .= (($perms & 0x0040) ?
- (($perms & 0x0800) ? 's' : 'x' ) :
- (($perms & 0x0800) ? 'S' : '-'));
-
- // Group
- $info .= (($perms & 0x0020) ? 'r' : '-');
- $info .= (($perms & 0x0010) ? 'w' : '-');
- $info .= (($perms & 0x0008) ?
- (($perms & 0x0400) ? 's' : 'x' ) :
- (($perms & 0x0400) ? 'S' : '-'));
-
- // World
- $info .= (($perms & 0x0004) ? 'r' : '-');
- $info .= (($perms & 0x0002) ? 'w' : '-');
- $info .= (($perms & 0x0001) ?
- (($perms & 0x0200) ? 't' : 'x' ) :
- (($perms & 0x0200) ? 'T' : '-'));
- return $info;
- }
- function getnumchmodfromh($mode) {
- $realmode = "";
- $legal = array("","w","r","x","-");
- $attarray = preg_split("//",$mode);
- for($i=0;$i<count($attarray);$i++){
- if($key = array_search($attarray[$i],$legal)){
- $realmode .= $legal[$key];
- }
- }
- $mode = str_pad($realmode,9,'-');
- $trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');
- $mode = strtr($mode,$trans);
- $newmode = '';
- $newmode .= $mode[0]+$mode[1]+$mode[2];
- $newmode .= $mode[3]+$mode[4]+$mode[5];
- $newmode .= $mode[6]+$mode[7]+$mode[8];
- return $newmode;
- }
- function group($file){
+ function group($file) {
$dir = $this->dirlist($file);
return $dir[$file]['group'];
}
- function copy($source,$destination,$overwrite=false){
+ function copy($source, $destination, $overwrite = false ) {
if( ! $overwrite && $this->exists($destination) )
return false;
$content = $this->get_contents($source);
if( false === $content)
return false;
- return $this->put_contents($destination,$content);
+ return $this->put_contents($destination, $content);
}
- function move($source,$destination,$overwrite=false){
- return ftp_rename($this->link,$source,$destination);
+ function move($source, $destination, $overwrite = false) {
+ return ftp_rename($this->link, $source, $destination);
}
function delete($file,$recursive=false) {
if ( $this->is_file($file) )
- return @ftp_delete($this->link,$file);
+ return @ftp_delete($this->link, $file);
if ( !$recursive )
- return @ftp_rmdir($this->link,$file);
+ return @ftp_rmdir($this->link, $file);
$filelist = $this->dirlist($file);
foreach ((array) $filelist as $filename => $fileinfo) {
- $this->delete($file.'/'.$filename,$recursive);
+ $this->delete($file . '/' . $filename, $recursive);
}
- return @ftp_rmdir($this->link,$file);
+ return @ftp_rmdir($this->link, $file);
}
- function exists($file){
- $list = ftp_rawlist($this->link,$file,false);
+ function exists($file) {
+ $list = ftp_rawlist($this->link, $file, false);
if( ! $list )
return false;
return count($list) == 1 ? true : false;
}
- function is_file($file){
+ function is_file($file) {
return $this->is_dir($file) ? false : true;
}
- function is_dir($path){
+ function is_dir($path) {
$cwd = $this->cwd();
$result = @ftp_chdir($this->link, $path);
- if( $result && $path == $this->cwd() ||
- $this->cwd() != $cwd ) {
+ if( $result && $path == $this->cwd() || $this->cwd() != $cwd ) {
@ftp_chdir($this->link, $cwd);
return true;
}
return false;
}
- function is_readable($file){
+ function is_readable($file) {
//Get dir list, Check if the file is writable by the current user??
return true;
}
- function is_writable($file){
+ function is_writable($file) {
//Get dir list, Check if the file is writable by the current user??
return true;
}
- function atime($file){
+ function atime($file) {
return false;
}
- function mtime($file){
+ function mtime($file) {
return ftp_mdtm($this->link, $file);
}
- function size($file){
+ function size($file) {
return ftp_size($this->link, $file);
}
- function touch($file,$time=0,$atime=0){
+ function touch($file, $time = 0, $atime = 0) {
return false;
}
- function mkdir($path,$chmod=false,$chown=false,$chgrp=false){
+ function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
if( !@ftp_mkdir($this->link, $path) )
return false;
if( $chmod )
@@ -373,7 +237,7 @@ class WP_Filesystem_FTPext{
$this->chgrp($path, $chgrp);
return true;
}
- function rmdir($path,$recursive=false){
+ function rmdir($path, $recursive = false) {
if( ! $recursive )
return @ftp_rmdir($this->link, $path);
@@ -385,9 +249,9 @@ class WP_Filesystem_FTPext{
function parselisting($line) {
$is_windows = ($this->OS_remote == FTP_OS_Windows);
- if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/",$line,$lucifer)) {
+ if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/", $line, $lucifer)) {
$b = array();
- if ($lucifer[3]<70) { $lucifer[3]+=2000; } else { $lucifer[3]+=1900; } // 4digit year fix
+ if ($lucifer[3]<70) { $lucifer[3] +=2000; } else { $lucifer[3]+=1900; } // 4digit year fix
$b['isdir'] = ($lucifer[7]=="<DIR>");
if ( $b['isdir'] )
$b['type'] = 'd';
@@ -445,15 +309,15 @@ class WP_Filesystem_FTPext{
return $b;
}
- function dirlist($path='.',$incdot=false,$recursive=false){
- if( $this->is_file($path) ){
+ function dirlist($path = '.', $incdot = false, $recursive = false) {
+ if( $this->is_file($path) ) {
$limitFile = basename($path);
$path = dirname($path) . '/';
} else {
$limitFile = false;
}
- $list = @ftp_rawlist($this->link , '-a ' . $path, false);
+ $list = @ftp_rawlist($this->link, '-a ' . $path, false);
if ( $list === false )
return false;
@@ -464,10 +328,10 @@ class WP_Filesystem_FTPext{
if ( empty($entry) )
continue;
- if ( $entry["name"]=="." or $entry["name"]==".." )
+ if ( '.' == $entry["name"] || '..' == $entry["name"] )
continue;
- $dirlist[$entry['name']] = $entry;
+ $dirlist[ $entry['name'] ] = $entry;
}
if ( ! $dirlist )
@@ -485,11 +349,11 @@ class WP_Filesystem_FTPext{
//We're including the doted starts
if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder
if ($recursive)
- $struc['files'] = $this->dirlist($path.'/'.$struc['name'],$incdot,$recursive);
+ $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
}
} else { //No dots
if ($recursive)
- $struc['files'] = $this->dirlist($path.'/'.$struc['name'],$incdot,$recursive);
+ $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
}
}
//File
diff --git a/wp-admin/includes/class-wp-filesystem-ftpsockets.php b/wp-admin/includes/class-wp-filesystem-ftpsockets.php
index 5365623..3b6cdcc 100644
--- a/wp-admin/includes/class-wp-filesystem-ftpsockets.php
+++ b/wp-admin/includes/class-wp-filesystem-ftpsockets.php
@@ -1,29 +1,29 @@
<?php
-class WP_Filesystem_ftpsockets{
+class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
var $ftp = false;
var $timeout = 5;
var $errors;
var $options = array();
- var $wp_base = '';
var $permission = null;
var $filetypes = array(
- 'php'=>FTP_ASCII,
- 'css'=>FTP_ASCII,
- 'txt'=>FTP_ASCII,
- 'js'=>FTP_ASCII,
- 'html'=>FTP_ASCII,
- 'htm'=>FTP_ASCII,
- 'xml'=>FTP_ASCII,
-
- 'jpg'=>FTP_BINARY,
- 'png'=>FTP_BINARY,
- 'gif'=>FTP_BINARY,
- 'bmp'=>FTP_BINARY
+ 'php' => FTP_ASCII,
+ 'css' => FTP_ASCII,
+ 'txt' => FTP_ASCII,
+ 'js' => FTP_ASCII,
+ 'html'=> FTP_ASCII,
+ 'htm' => FTP_ASCII,
+ 'xml' => FTP_ASCII,
+
+ 'jpg' => FTP_BINARY,
+ 'png' => FTP_BINARY,
+ 'gif' => FTP_BINARY,
+ 'bmp' => FTP_BINARY
);
function WP_Filesystem_ftpsockets($opt='') {
+ $this->method = 'ftpsockets';
$this->errors = new WP_Error();
//Check if possible to use ftp functions.
@@ -86,241 +86,109 @@ class WP_Filesystem_ftpsockets{
$this->permission = $perm;
}
- function find_base_dir($base = '.',$echo = false, $loop = false) {
- //Sanitize the Windows path formats, This allows easier conparison and aligns it to FTP output.
- $abspath = str_replace('\\','/',ABSPATH); //windows: Straighten up the paths..
- if( strpos($abspath, ':') ){ //Windows, Strip out the driveletter
- if( preg_match("|.{1}\:(.+)|i", $abspath, $mat) )
- $abspath = $mat[1];
- }
-
- //Set up the base directory (Which unless specified, is the current one)
- if( empty( $base ) || '.' == $base ) $base = $this->cwd();
- $base = trailingslashit($base);
-
- //Can we see the Current directory as part of the ABSPATH?
- $location = strpos($abspath, $base);
- if( false !== $location ) {
- $newbase = path_join($base, substr($abspath, $location + strlen($base)));
-
- if( false !== $this->chdir($newbase) ){ //chdir sometimes returns null under certain circumstances, even when its changed correctly, FALSE will be returned if it doesnt change correctly.
- if($echo) printf( __('Changing to %s') . '<br/>', $newbase );
- //Check to see if it exists in that folder.
- if( $this->exists($newbase . 'wp-settings.php') ){
- if($echo) printf( __('Found %s'), $newbase . 'wp-settings.php<br/>' );
- return $newbase;
- }
- }
- }
-
- //Ok, Couldnt do a magic location from that particular folder level
-
- //Get a list of the files in the current directory, See if we can locate where we are in the folder stucture.
- $files = $this->dirlist($base);
-
- $arrPath = explode('/', $abspath);
- foreach($arrPath as $key){
- //Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder,
- // If its found, change into it and follow through looking for it.
- // If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on.
- // If it reaches the end, and still cant find it, it'll return false for the entire function.
- if( isset($files[ $key ]) ){
- //Lets try that folder:
- $folder = path_join($base, $key);
- if($echo) printf( __('Changing to %s') . '<br/>', $folder );
- $ret = $this->find_base_dir( $folder, $echo, $loop);
- if( $ret )
- return $ret;
- }
- }
- //Only check this as a last resort, to prevent locating the incorrect install. All above proceeedures will fail quickly if this is the right branch to take.
- if(isset( $files[ 'wp-settings.php' ]) ){
- if($echo) printf( __('Found %s'), $base . 'wp-settings.php<br/>' );
- return $base;
- }
- if( $loop )
- return false;//Prevent tihs function looping again.
- //As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups.
- return $this->find_base_dir('/', $echo, true);
- }
-
- function get_base_dir($base = '.', $echo = false){
- if( defined('FTP_BASE') )
- $this->wp_base = FTP_BASE;
- if( empty($this->wp_base) )
- $this->wp_base = $this->find_base_dir($base, $echo);
- return $this->wp_base;
- }
-
- function get_contents($file,$type='',$resumepos=0){
+ function get_contents($file, $type = '', $resumepos = 0){
if( ! $this->exists($file) )
return false;
if( empty($type) ){
- $extension = substr(strrchr($file, "."), 1);
+ $extension = substr(strrchr($file, '.'), 1);
$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_AUTOASCII;
}
$this->ftp->SetType($type);
- $temp = tmpfile();
- if ( ! $temp )
+ $temp = wp_tempnam( $file );
+ if ( ! $temphandle = fopen($temp, 'w+') )
return false;
- if ( ! $this->ftp->fget($temp, $file) ) {
- fclose($temp);
+ if ( ! $this->ftp->fget($temphandle, $file) ) {
+ fclose($temphandle);
+ unlink($temp);
return ''; //Blank document, File does exist, Its just blank.
}
- fseek($temp, 0); //Skip back to the start of the file being written to
+ fseek($temphandle, 0); //Skip back to the start of the file being written to
$contents = '';
- while ( !feof($temp) )
- $contents .= fread($temp, 8192);
- fclose($temp);
+ while ( ! feof($temphandle) )
+ $contents .= fread($temphandle, 8192);
+ fclose($temphandle);
+ unlink($temp);
return $contents;
}
function get_contents_array($file){
- return explode("\n",$this->get_contents($file));
+ return explode("\n", $this->get_contents($file) );
}
- function put_contents($file,$contents,$type=''){
+ function put_contents($file, $contents, $type = '' ) {
if( empty($type) ){
- $extension = substr(strrchr($file, "."), 1);
- $type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII;
+ $extension = substr(strrchr($file, '.'), 1);
+ $type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_AUTOASCII;
}
$this->ftp->SetType($type);
- $temp = tmpfile();
- if ( ! $temp )
+ $temp = wp_tempnam( $file );
+ if ( ! $temphandle = fopen($temp, 'w+') ){
+ unlink($temp);
return false;
- fwrite($temp,$contents);
- fseek($temp, 0); //Skip back to the start of the file being written to
- $ret = $this->ftp->fput($file, $temp);
- fclose($temp);
+ }
+ fwrite($temphandle, $contents);
+ fseek($temphandle, 0); //Skip back to the start of the file being written to
+ $ret = $this->ftp->fput($file, $temphandle);
+ fclose($temphandle);
+ unlink($temp);
return $ret;
}
- function cwd(){
+ function cwd() {
$cwd = $this->ftp->pwd();
if( $cwd )
$cwd = trailingslashit($cwd);
return $cwd;
}
- function chdir($file){
+ function chdir($file) {
return $this->ftp->chdir($file);
}
- function chgrp($file,$group,$recursive=false){
+ function chgrp($file, $group, $recursive = false ) {
return false;
}
- function chmod($file,$mode=false,$recursive=false){
+ function chmod($file, $mode = false, $recursive = false ){
if( ! $mode )
$mode = $this->permission;
if( ! $mode )
return false;
//if( ! $this->exists($file) )
// return false;
- if( ! $recursive || ! $this->is_dir($file) ){
+ if( ! $recursive || ! $this->is_dir($file) ) {
return $this->ftp->chmod($file,$mode);
}
//Is a directory, and we want recursive
$filelist = $this->dirlist($file);
foreach($filelist as $filename){
- $this->chmod($file.'/'.$filename,$mode,$recursive);
+ $this->chmod($file . '/' . $filename, $mode, $recursive);
}
return true;
}
- function chown($file,$owner,$recursive=false){
+ function chown($file, $owner, $recursive = false ) {
return false;
}
- function owner($file){
+ function owner($file) {
$dir = $this->dirlist($file);
return $dir[$file]['owner'];
}
- function getchmod($file){
+ function getchmod($file) {
$dir = $this->dirlist($file);
return $dir[$file]['permsn'];
}
- function gethchmod($file){
- //From the PHP.net page for ...?
- $perms = $this->getchmod($file);
- if (($perms & 0xC000) == 0xC000) {
- // Socket
- $info = 's';
- } elseif (($perms & 0xA000) == 0xA000) {
- // Symbolic Link
- $info = 'l';
- } elseif (($perms & 0x8000) == 0x8000) {
- // Regular
- $info = '-';
- } elseif (($perms & 0x6000) == 0x6000) {
- // Block special
- $info = 'b';
- } elseif (($perms & 0x4000) == 0x4000) {
- // Directory
- $info = 'd';
- } elseif (($perms & 0x2000) == 0x2000) {
- // Character special
- $info = 'c';
- } elseif (($perms & 0x1000) == 0x1000) {
- // FIFO pipe
- $info = 'p';
- } else {
- // Unknown
- $info = 'u';
- }
-
- // Owner
- $info .= (($perms & 0x0100) ? 'r' : '-');
- $info .= (($perms & 0x0080) ? 'w' : '-');
- $info .= (($perms & 0x0040) ?
- (($perms & 0x0800) ? 's' : 'x' ) :
- (($perms & 0x0800) ? 'S' : '-'));
-
- // Group
- $info .= (($perms & 0x0020) ? 'r' : '-');
- $info .= (($perms & 0x0010) ? 'w' : '-');
- $info .= (($perms & 0x0008) ?
- (($perms & 0x0400) ? 's' : 'x' ) :
- (($perms & 0x0400) ? 'S' : '-'));
-
- // World
- $info .= (($perms & 0x0004) ? 'r' : '-');
- $info .= (($perms & 0x0002) ? 'w' : '-');
- $info .= (($perms & 0x0001) ?
- (($perms & 0x0200) ? 't' : 'x' ) :
- (($perms & 0x0200) ? 'T' : '-'));
- return $info;
- }
-
- function getnumchmodfromh($mode) {
- $realmode = "";
- $legal = array("","w","r","x","-");
- $attarray = preg_split("//",$mode);
- for($i=0;$i<count($attarray);$i++){
- if($key = array_search($attarray[$i],$legal)){
- $realmode .= $legal[$key];
- }
- }
- $mode = str_pad($realmode,9,'-');
- $trans = array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');
- $mode = strtr($mode,$trans);
- $newmode = '';
- $newmode .= $mode[0]+$mode[1]+$mode[2];
- $newmode .= $mode[3]+$mode[4]+$mode[5];
- $newmode .= $mode[6]+$mode[7]+$mode[8];
- return $newmode;
- }
-
- function group($file){
+ function group($file) {
$dir = $this->dirlist($file);
return $dir[$file]['group'];
}
- function copy($source,$destination,$overwrite=false){
+ function copy($source, $destination, $overwrite = false ) {
if( ! $overwrite && $this->exists($destination) )
return false;
@@ -328,14 +196,14 @@ class WP_Filesystem_ftpsockets{
if ( false === $content )
return false;
- return $this->put_contents($destination,$content);
+ return $this->put_contents($destination, $content);
}
- function move($source,$destination,$overwrite=false){
- return $this->ftp->rename($source,$destination);
+ function move($source, $destination, $overwrite = false ) {
+ return $this->ftp->rename($source, $destination);
}
- function delete($file,$recursive=false) {
+ function delete($file, $recursive = false ) {
if ( $this->is_file($file) )
return $this->ftp->delete($file);
if ( !$recursive )
@@ -344,15 +212,15 @@ class WP_Filesystem_ftpsockets{
return $this->ftp->mdel($file);
}
- function exists($file){
+ function exists($file) {
return $this->ftp->is_exists($file);
}
- function is_file($file){
+ function is_file($file) {
return $this->is_dir($file) ? false : true;
}
- function is_dir($path){
+ function is_dir($path) {
$cwd = $this->cwd();
if ( $this->chdir($path) ) {
$this->chdir($cwd);
@@ -361,33 +229,33 @@ class WP_Filesystem_ftpsockets{
return false;
}
- function is_readable($file){
+ function is_readable($file) {
//Get dir list, Check if the file is writable by the current user??
return true;
}
- function is_writable($file){
+ function is_writable($file) {
//Get dir list, Check if the file is writable by the current user??
return true;
}
- function atime($file){
+ function atime($file) {
return false;
}
- function mtime($file){
+ function mtime($file) {
return $this->ftp->mdtm($file);
}
- function size($file){
+ function size($file) {
return $this->ftp->filesize($file);
}
- function touch($file,$time=0,$atime=0){
+ function touch($file, $time = 0, $atime = 0 ){
return false;
}
- function mkdir($path,$chmod=false,$chown=false,$chgrp=false){
+ function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) {
if( ! $this->ftp->mkdir($path) )
return false;
if( $chmod )
@@ -399,15 +267,15 @@ class WP_Filesystem_ftpsockets{
return true;
}
- function rmdir($path,$recursive=false){
+ function rmdir($path, $recursive = false ) {
if( ! $recursive )
return $this->ftp->rmdir($path);
return $this->ftp->mdel($path);
}
- function dirlist($path='.',$incdot=false,$recursive=false){
- if( $this->is_file($path) ){
+ function dirlist($path = '.', $incdot = false, $recursive = false ) {
+ if( $this->is_file($path) ) {
$limitFile = basename($path);
$path = dirname($path) . '/';
} else {
@@ -430,11 +298,11 @@ class WP_Filesystem_ftpsockets{
//We're including the doted starts
if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder
if ($recursive)
- $struc['files'] = $this->dirlist($path.'/'.$struc['name'],$incdot,$recursive);
+ $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
}
} else { //No dots
if ($recursive)
- $struc['files'] = $this->dirlist($path.'/'.$struc['name'],$incdot,$recursive);
+ $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
}
}
//File
diff --git a/wp-admin/includes/comment.php b/wp-admin/includes/comment.php
index 0f2aa61..8a47fe6 100644
--- a/wp-admin/includes/comment.php
+++ b/wp-admin/includes/comment.php
@@ -3,8 +3,8 @@
function comment_exists($comment_author, $comment_date) {
global $wpdb;
- return $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments
- WHERE comment_author = '$comment_author' AND comment_date = '$comment_date'");
+ return $wpdb->get_var( $wpdb->prepare("SELECT comment_post_ID FROM $wpdb->comments
+ WHERE comment_author = %s AND comment_date = %s", $comment_author, $comment_date) );
}
function edit_comment() {
diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php
index 97fd26a..1b4f86e 100644
--- a/wp-admin/includes/dashboard.php
+++ b/wp-admin/includes/dashboard.php
@@ -225,7 +225,7 @@ function wp_dashboard_dynamic_sidebar_params( $params ) {
}
if ( $widget_feed_link )
- $links[] = '<img class="rss-icon" src="' . get_option( 'siteurl' ) . '/' . WPINC . '/images/rss.png" alt="' . __( 'rss icon' ) . '" /> <a href="' . clean_url( $widget_feed_link ) . '">' . __( 'RSS' ) . '</a>';
+ $links[] = '<img class="rss-icon" src="' . includes_url('images/rss.png') . '" alt="' . __( 'rss icon' ) . '" /> <a href="' . clean_url( $widget_feed_link ) . '">' . __( 'RSS' ) . '</a>';
$links = apply_filters( "wp_dashboard_widget_links_$widget_id", $links );
@@ -269,7 +269,7 @@ function wp_dashboard_recent_comments( $sidebar_args ) {
$lambda = create_function( '', 'return 5;' );
add_filter( 'option_posts_per_rss', $lambda ); // hack - comments query doesn't accept per_page parameter
- $comments_query = new WP_Query('feed=rss2&withcomments=1');
+ $comments_query = new WP_Query(array('feed' => 'rss2', 'withcomments' => 1));
remove_filter( 'option_posts_per_rss', $lambda );
$is_first = true;
@@ -389,8 +389,7 @@ function wp_dashboard_secondary_output() {
$rss->items = array_slice($rss->items, 0, $items);
foreach ($rss->items as $item ) {
$title = wp_specialchars($item['title']);
- $author = preg_replace( '|(.+?):.+|s', '$1', $item['title'] );
- $post = preg_replace( '|.+?:(.+)|s', '$1', $item['title'] );
+ list($author,$post) = explode( ':', $title, 2 );
$link = clean_url($item['link']);
echo "\t<li><a href='$link'><span class='post'>$post</span><span class='hidden'> - </span><cite>$author</cite></a></li>\n";
diff --git a/wp-admin/includes/export.php b/wp-admin/includes/export.php
index 5590826..00201fa 100644
--- a/wp-admin/includes/export.php
+++ b/wp-admin/includes/export.php
@@ -17,7 +17,7 @@ header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
$where = '';
if ( $author and $author != 'all' ) {
$author_id = (int) $author;
- $where = " WHERE post_author = '$author_id' ";
+ $where = $wpdb->prepare(" WHERE post_author = %d ", $author_id);
}
// grab a snapshot of post IDs, just in case it changes during the export
@@ -201,6 +201,7 @@ echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
<guid isPermaLink="false"><?php the_guid(); ?></guid>
<description></description>
<content:encoded><?php echo wxr_cdata( apply_filters('the_content_export', $post->post_content) ); ?></content:encoded>
+<excerpt:encoded><?php echo wxr_cdata( apply_filters('the_excerpt_export', $post->post_excerpt) ); ?></excerpt:encoded>
<wp:post_id><?php echo $post->ID; ?></wp:post_id>
<wp:post_date><?php echo $post->post_date; ?></wp:post_date>
<wp:post_date_gmt><?php echo $post->post_date_gmt; ?></wp:post_date_gmt>
@@ -217,7 +218,7 @@ if ($post->post_type == 'attachment') { ?>
<wp:attachment_url><?php echo wp_get_attachment_url($post->ID); ?></wp:attachment_url>
<?php } ?>
<?php
-$postmeta = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE post_id = $post->ID");
+$postmeta = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID) );
if ( $postmeta ) {
?>
<?php foreach( $postmeta as $meta ) { ?>
@@ -228,7 +229,7 @@ if ( $postmeta ) {
<?php } ?>
<?php } ?>
<?php
-$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $post->ID");
+$comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d", $post->ID) );
if ( $comments ) { foreach ( $comments as $c ) { ?>
<wp:comment>
<wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php
index 01da1d0..29609b2 100644
--- a/wp-admin/includes/file.php
+++ b/wp-admin/includes/file.php
@@ -34,9 +34,9 @@ function get_home_path() {
function get_real_file_to_edit( $file ) {
if ('index.php' == $file || '.htaccess' == $file ) {
- $real_file = get_home_path().$file;
+ $real_file = get_home_path() . $file;
} else {
- $real_file = ABSPATH.$file;
+ $real_file = WP_CONTENT_DIR . $file;
}
return $real_file;
@@ -46,7 +46,7 @@ function get_temp_dir() {
if ( defined('WP_TEMP_DIR') )
return trailingslashit(WP_TEMP_DIR);
- $temp = ABSPATH . 'wp-content/';
+ $temp = WP_CONTENT_DIR . '/';
if ( is_dir($temp) && is_writable($temp) )
return $temp;
@@ -56,6 +56,18 @@ function get_temp_dir() {
return '/tmp/';
}
+function wp_tempnam($filename = '', $dir = ''){
+ if ( empty($dir) )
+ $dir = get_temp_dir();
+ $filename = basename($filename);
+ if ( empty($filename) )
+ $filename = time();
+
+ $filename = $dir . wp_unique_filename($dir, $filename);
+ touch($filename);
+ return $filename;
+}
+
function validate_file_to_edit( $file, $allowed_files = '' ) {
$file = stripslashes( $file );
@@ -174,6 +186,98 @@ function wp_handle_upload( &$file, $overrides = false ) {
return $return;
}
+// Pass this function an array similar to that of a $_FILES POST array.
+function wp_handle_sideload( &$file, $overrides = false ) {
+ // The default error handler.
+ if (! function_exists( 'wp_handle_upload_error' ) ) {
+ function wp_handle_upload_error( &$file, $message ) {
+ return array( 'error'=>$message );
+ }
+ }
+
+ // You may define your own function and pass the name in $overrides['upload_error_handler']
+ $upload_error_handler = 'wp_handle_upload_error';
+
+ // $_POST['action'] must be set and its value must equal $overrides['action'] or this:
+ $action = 'wp_handle_sideload';
+
+ // Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error'].
+ $upload_error_strings = array( false,
+ __( "The file exceeds the <code>upload_max_filesize</code> directive in <code>php.ini</code>." ),
+ __( "The file exceeds the <em>MAX_FILE_SIZE</em> directive that was specified in the HTML form." ),
+ __( "The file was only partially uploaded." ),
+ __( "No file was sent." ),
+ __( "Missing a temporary folder." ),
+ __( "Failed to write file to disk." ));
+
+ // All tests are on by default. Most can be turned off by $override[{test_name}] = false;
+ $test_form = true;
+ $test_size = true;
+
+ // If you override this, you must provide $ext and $type!!!!
+ $test_type = true;
+ $mimes = false;
+
+ // Install user overrides. Did we mention that this voids your warranty?
+ if ( is_array( $overrides ) )
+ extract( $overrides, EXTR_OVERWRITE );
+
+ // A correct form post will pass this test.
+ if ( $test_form && (!isset( $_POST['action'] ) || ($_POST['action'] != $action ) ) )
+ return $upload_error_handler( $file, __( 'Invalid form submission.' ));
+
+ // A successful upload will pass this test. It makes no sense to override this one.
+ if ( $file['error'] > 0 )
+ return $upload_error_handler( $file, $upload_error_strings[$file['error']] );
+
+ // A non-empty file will pass this test.
+ if ( $test_size && !(filesize($file['tmp_name']) > 0 ) )
+ return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.' ));
+
+ // A properly uploaded file will pass this test. There should be no reason to override this one.
+ if (! @ is_file( $file['tmp_name'] ) )
+ return $upload_error_handler( $file, __( 'Specified file does not exist.' ));
+
+ // A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter.
+ if ( $test_type ) {
+ $wp_filetype = wp_check_filetype( $file['name'], $mimes );
+
+ extract( $wp_filetype );
+
+ if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
+ return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' ));
+
+ if ( !$ext )
+ $ext = ltrim(strrchr($file['name'], '.'), '.');
+
+ if ( !$type )
+ $type = $file['type'];
+ }
+
+ // A writable uploads dir will pass this test. Again, there's no point overriding this one.
+ if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) )
+ return $upload_error_handler( $file, $uploads['error'] );
+
+ $filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback );
+
+ // Move the file to the uploads dir
+ $new_file = $uploads['path'] . "/$filename";
+ if ( false === @ rename( $file['tmp_name'], $new_file ) ) {
+ return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) );
+ }
+
+ // Set correct file permissions
+ $stat = stat( dirname( $new_file ));
+ $perms = $stat['mode'] & 0000666;
+ @ chmod( $new_file, $perms );
+
+ // Compute the URL
+ $url = $uploads['url'] . "/$filename";
+
+ $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
+
+ return $return;
+}
/**
* Downloads a url to a local file using the Snoopy HTTP Class
@@ -186,7 +290,7 @@ function download_url( $url ) {
if( ! $url )
return new WP_Error('http_no_url', __('Invalid URL Provided'));
- $tmpfname = tempnam(get_temp_dir(), 'wpupdate');
+ $tmpfname = wp_tempnam($url);
if( ! $tmpfname )
return new WP_Error('http_no_file', __('Could not create Temporary file'));
@@ -246,13 +350,13 @@ function unzip_file($file, $to) {
$tmppath .= $path[$j] . '/';
if ( ! $fs->is_dir($to . $tmppath) )
if ( !$fs->mkdir($to . $tmppath, 0755) )
- return new WP_Error('mkdir_failed', __('Could not create directory'));
+ return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $tmppath);
}
// We've made sure the folders are there, so let's extract the file now:
if ( ! $file['folder'] )
if ( !$fs->put_contents( $to . $file['filename'], $file['content']) )
- return new WP_Error('copy_failed', __('Could not copy file'));
+ return new WP_Error('copy_failed', __('Could not copy file'), $to . $file['filename']);
$fs->chmod($to . $file['filename'], 0644);
}
@@ -270,27 +374,33 @@ function copy_dir($from, $to) {
foreach ( (array) $dirlist as $filename => $fileinfo ) {
if ( 'f' == $fileinfo['type'] ) {
if ( ! $wp_filesystem->copy($from . $filename, $to . $filename, true) )
- return false;
+ return new WP_Error('copy_failed', __('Could not copy file'), $to . $filename);
$wp_filesystem->chmod($to . $filename, 0644);
} elseif ( 'd' == $fileinfo['type'] ) {
if ( !$wp_filesystem->mkdir($to . $filename, 0755) )
- return false;
- if ( !copy_dir($from . $filename, $to . $filename) )
- return false;
+ return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $filename);
+ $result = copy_dir($from . $filename, $to . $filename);
+ if ( is_wp_error($result) )
+ return $result;
}
}
-
- return true;
}
-function WP_Filesystem( $args = false, $preference = false ) {
+function WP_Filesystem( $args = false ) {
global $wp_filesystem;
- $method = get_filesystem_method($preference);
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php');
+
+ $method = get_filesystem_method();
+
if ( ! $method )
return false;
- require_once('class-wp-filesystem-'.$method.'.php');
+ $abstraction_file = apply_filters('filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-'.$method.'.php', $method);
+ if( ! file_exists($abstraction_file) )
+ return;
+
+ require_once($abstraction_file);
$method = "WP_Filesystem_$method";
$wp_filesystem = new $method($args);
@@ -305,18 +415,17 @@ function WP_Filesystem( $args = false, $preference = false ) {
}
function get_filesystem_method() {
- $tempFile = tempnam(get_temp_dir(), 'WPU');
-
- if ( getmyuid() == fileowner($tempFile) ) {
- unlink($tempFile);
- return 'direct';
- } else {
- unlink($tempFile);
+ $method = false;
+ if( function_exists('getmyuid') && function_exists('fileowner') ){
+ $temp_file = wp_tempnam();
+ if ( getmyuid() == fileowner($temp_file) )
+ $method = 'direct';
+ unlink($temp_file);
}
- if ( extension_loaded('ftp') ) return 'ftpext';
- if ( extension_loaded('sockets') || function_exists('fsockopen') ) return 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread
- return false;
+ if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext';
+ if ( ! $method && ( extension_loaded('sockets') || function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread
+ return apply_filters('filesystem_method', $method);
}
?>
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index 0fb84bb..4d42def 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -116,6 +116,83 @@ function media_handle_upload($file_id, $post_id, $post_data = array()) {
}
+function media_sideload_image($file, $post_id, $desc = null) {
+
+ if (!empty($file) ) {
+ // Upload File button was clicked
+
+ $file_array['name'] = basename($file);
+ $file_array['tmp_name'] = download_url($file);
+ $desc = @$desc;
+
+ $sideload = media_handle_sideload($file_array, $post_id, $desc);
+
+ $id = $sideload['id'];
+ $src = $sideload['src'];
+
+ unset($file_array['tmp_name']);
+ unset($file_array);
+
+ if ( is_wp_error($id) ) {
+ $errors['upload_error'] = $id;
+ $id = false;
+ }
+ }
+
+ if ( !empty($src) && !strpos($src, '://') )
+
+ $src = "http://$src";
+ $alt = @$desc;
+
+ if ( !empty($src) )
+ $html = "<img src='$src' alt='$alt' />";
+ return $html;
+
+}
+
+function media_handle_sideload($file_array, $post_id, $desc = null, $post_data = array()) {
+ $overrides = array('test_form'=>false);
+ $file = wp_handle_sideload($file_array, $overrides);
+
+ if ( isset($file['error']) )
+ return new wp_error( 'upload_error', $file['error'] );
+
+ $url = $file['url'];
+ $type = $file['type'];
+ $file = $file['file'];
+ $title = preg_replace('/\.[^.]+$/', '', basename($file));
+ $content = '';
+
+ // use image exif/iptc data for title and caption defaults if possible
+ if ( $image_meta = @wp_read_image_metadata($file) ) {
+ if ( trim($image_meta['title']) )
+ $title = $image_meta['title'];
+ if ( trim($image_meta['caption']) )
+ $content = $image_meta['caption'];
+ }
+
+ $title = @$desc;
+
+ // Construct the attachment array
+ $attachment = array_merge( array(
+ 'post_mime_type' => $type,
+ 'guid' => $url,
+ 'post_parent' => $post_id,
+ 'post_title' => $title,
+ 'post_content' => $content,
+ ), $post_data );
+
+ // Save the data
+ $id = wp_insert_attachment($attachment, $file, $post_parent);
+ if ( !is_wp_error($id) ) {
+ wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
+ }
+
+ return array('id' => $id, 'src' => $url);
+
+}
+
+
// wrap iframe content (produced by $content_func) in a doctype, html head/body etc
// any additional function args will be passed to content_func
function wp_iframe($content_func /* ... */) {
@@ -126,9 +203,12 @@ function wp_iframe($content_func /* ... */) {
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
<title><?php bloginfo('name') ?> &rsaquo; <?php _e('Uploads'); ?> &#8212; <?php _e('WordPress'); ?></title>
<?php
-wp_admin_css( 'css/global' );
-wp_admin_css();
-wp_admin_css( 'css/colors' );
+wp_enqueue_style( 'global' );
+wp_enqueue_style( 'wp-admin' );
+wp_enqueue_style( 'colors' );
+if ( 0 === strpos( $content_func, 'media' ) )
+ wp_enqueue_style( 'media' );
+
?>
<script type="text/javascript">
//<![CDATA[
@@ -136,6 +216,7 @@ function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}el
//]]>
</script>
<?php
+do_action('admin_print_styles');
do_action('admin_print_scripts');
do_action('admin_head');
if ( is_string($content_func) )
@@ -167,39 +248,15 @@ function media_buttons() {
$audio_title = __('Add Audio');
$out = <<<EOF
- <a href="{$image_upload_iframe_src}&amp;TB_iframe=true&amp;height=500&amp;width=640" class="thickbox" title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a>
- <a href="{$video_upload_iframe_src}&amp;TB_iframe=true&amp;height=500&amp;width=640" class="thickbox" title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a>
- <a href="{$audio_upload_iframe_src}&amp;TB_iframe=true&amp;height=500&amp;width=640" class="thickbox" title='$audio_title'><img src='images/media-button-music.gif' alt='$audio_title' /></a>
- <a href="{$media_upload_iframe_src}&amp;TB_iframe=true&amp;height=500&amp;width=640" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a>
+ <a href="{$image_upload_iframe_src}&amp;TB_iframe=true" class="thickbox" title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a>
+ <a href="{$video_upload_iframe_src}&amp;TB_iframe=true" class="thickbox" title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a>
+ <a href="{$audio_upload_iframe_src}&amp;TB_iframe=true" class="thickbox" title='$audio_title'><img src='images/media-button-music.gif' alt='$audio_title' /></a>
+ <a href="{$media_upload_iframe_src}&amp;TB_iframe=true" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a>
EOF;
printf($context, $out);
}
add_action( 'media_buttons', 'media_buttons' );
-
-function media_buttons_head() {
-$siteurl = get_option('siteurl');
-echo "<style type='text/css' media='all'>
- @import '{$siteurl}/wp-includes/js/thickbox/thickbox.css?ver=20080430';
- div#TB_title {
- background-color: #222222;
- color: #cfcfcf;
- }
- div#TB_title a, div#TB_title a:visited {
- color: #cfcfcf;
- }
- #TB_window {
- top: 20px;
- }
-</style>\n";
-}
-
-add_action( 'admin_print_scripts', 'media_buttons_head' );
-
-function media_admin_css() {
- wp_admin_css('css/media');
-}
-
add_action('media_upload_media', 'media_upload_handler');
function media_upload_form_handler() {
@@ -213,6 +270,8 @@ function media_upload_form_handler() {
$post['post_title'] = $attachment['post_title'];
if ( isset($attachment['post_excerpt']) )
$post['post_excerpt'] = $attachment['post_excerpt'];
+ if ( isset($attachment['menu_order']) )
+ $post['menu_order'] = $attachment['menu_order'];
$post = apply_filters('attachment_fields_to_save', $post, $attachment);
@@ -413,6 +472,7 @@ function media_upload_gallery() {
$errors = $return;
}
+ wp_enqueue_script('admin-gallery');
return wp_iframe( 'media_upload_gallery_form', $errors );
}
@@ -549,6 +609,10 @@ function get_attachment_fields_to_edit($post, $errors = null) {
</script>\n",
'helps' => __('Enter a link URL or click above for presets.'),
),
+ 'menu_order' => array(
+ 'label' => __('Order'),
+ 'value' => $edit_post->menu_order
+ ),
);
foreach ( get_attachment_taxonomies($post) as $taxonomy ) {
@@ -586,7 +650,7 @@ function get_media_items( $post_id, $errors ) {
if ( $post && $post->post_type == 'attachment' )
$attachments = array($post->ID => $post);
else
- $attachments = get_children("post_parent=$post_id&post_type=attachment&orderby=menu_order ASC, ID&order=DESC");
+ $attachments = get_children( array( 'post_parent' => $post_id, 'post_type' => 'attachment', 'orderby' => 'menu_order ASC, ID', 'order' => 'DESC') );
} else {
if ( is_array($GLOBALS['wp_the_query']->posts) )
foreach ( $GLOBALS['wp_the_query']->posts as $attachment )
@@ -679,9 +743,11 @@ function get_media_item( $attachment_id, $args = null ) {
if ( $send )
$send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . attribute_escape( __( 'Insert into Post' ) ) . "' />";
if ( $delete )
- $delete = "<a href='$delete_href' id='del[$attachment_id]' disabled='disabled' class='delete'>" . __('Delete') . "</button>";
+ $delete = "<a href=\"#\" class=\"del-link\" onclick=\"document.getElementById('del_attachment_$attachment_id').style.display='block';return false;\">" . __('Delete') . "</a>";
if ( ( $send || $delete ) && !isset($form_fields['buttons']) )
- $form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>$send $delete</td></tr>\n");
+ $form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>$send $delete
+ <div id=\"del_attachment_$attachment_id\" class=\"del-attachment\" style=\"display:none;\">" . sprintf(__("You are about to delete <strong>%s</strong>."), $filename) . " <a href=\"$delete_href\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Continue') . "</a>
+ <a href=\"#\" class=\"del-link\" onclick=\"this.parentNode.style.display='none';return false;\">" . __('Cancel') . "</a></div></td></tr>\n");
$hidden_fields = array();
@@ -703,6 +769,7 @@ function get_media_item( $attachment_id, $args = null ) {
}
$required = $field['required'] ? '<abbr title="required" class="required">*</abbr>' : '';
+ $aria_required = $field['required'] ? " aria-required='true' " : '';
$class = $id;
$class .= $field['required'] ? ' form-required' : '';
@@ -710,9 +777,9 @@ function get_media_item( $attachment_id, $args = null ) {
if ( !empty($field[$field['input']]) )
$item .= $field[$field['input']];
elseif ( $field['input'] == 'textarea' ) {
- $item .= "<textarea type='text' id='$name' name='$name'>" . attribute_escape( $field['value'] ) . "</textarea>";
+ $item .= "<textarea type='text' id='$name' name='$name'>" . attribute_escape( $field['value'] ) . $aria_required . "</textarea>";
} else {
- $item .= "<input type='text' id='$name' name='$name' value='" . attribute_escape( $field['value'] ) . "' />";
+ $item .= "<input type='text' id='$name' name='$name' value='" . attribute_escape( $field['value'] ) . "'" . $aria_required . "/>";
}
if ( !empty($field['helps']) )
$item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique((array) $field['helps']) ) . '</p>';
@@ -757,7 +824,7 @@ function media_upload_header() {
function media_upload_form( $errors = null ) {
global $type, $tab;
- $flash_action_url = get_option('siteurl') . "/wp-admin/async-upload.php";
+ $flash_action_url = admin_url('async-upload.php');
// If Mac and mod_security, no Flash. :(
$flash = true;
@@ -788,7 +855,7 @@ function media_upload_form( $errors = null ) {
jQuery(function($){
swfu = new SWFUpload({
upload_url : "<?php echo attribute_escape( $flash_action_url ); ?>",
- flash_url : "<?php echo get_option('siteurl').'/wp-includes/js/swfupload/swfupload_f9.swf'; ?>",
+ flash_url : "<?php echo includes_url('js/swfupload/swfupload_f9.swf'); ?>",
file_post_name: "async-upload",
file_types: "<?php echo apply_filters('upload_file_glob', '*.*'); ?>",
post_params : {
@@ -819,12 +886,11 @@ jQuery(function($){
//-->
</script>
-
<div id="flash-upload-ui">
<?php do_action('pre-flash-upload-ui'); ?>
<p><input id="flash-browse-button" type="button" value="<?php echo attribute_escape( __( 'Choose files to upload' ) ); ?>" class="button" /></p>
<?php do_action('post-flash-upload-ui'); ?>
- <p><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></p>
+ <p class="howto"><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></p>
</div>
<?php endif; // $flash ?>
@@ -850,7 +916,8 @@ function media_upload_type_form($type = 'file', $errors = null, $id = null) {
$post_id = intval($_REQUEST['post_id']);
- $form_action_url = get_option('siteurl') . "/wp-admin/media-upload.php?type=$type&tab=type&post_id=$post_id";
+ $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
+ $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
$callback = "type_form_$type";
?>
@@ -900,7 +967,7 @@ function media_upload_gallery_form($errors) {
$post_id = intval($_REQUEST['post_id']);
- $form_action_url = get_option('siteurl') . "/wp-admin/media-upload.php?type={$GLOBALS['type']}&tab=gallery&post_id=$post_id";
+ $form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=gallery&post_id=$post_id");
?>
@@ -939,7 +1006,7 @@ function media_upload_library_form($errors) {
$post_id = intval($_REQUEST['post_id']);
- $form_action_url = get_option('siteurl') . "/wp-admin/media-upload.php?type={$GLOBALS['type']}&tab=library&post_id=$post_id";
+ $form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=library&post_id=$post_id");
$_GET['paged'] = intval($_GET['paged']);
if ( $_GET['paged'] < 1 )
@@ -960,6 +1027,7 @@ function media_upload_library_form($errors) {
<input type="hidden" name="post_mime_type" value="<?php echo attribute_escape( $_GET['post_mime_type'] ); ?>" />
<div id="search-filter">
+ <label class="hidden" for="post-search-input"><?php _e('Search Media');?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php echo attribute_escape( __( 'Search Media' ) ); ?>" class="button" />
</div>
@@ -1085,14 +1153,14 @@ function type_form_image() {
<span class="alignleft"><label for="insertonly[src]">' . __('Image URL') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
- <td class="field"><input id="insertonly[src]" name="insertonly[src]" value="" type="text"></td>
+ <td class="field"><input id="insertonly[src]" name="insertonly[src]" value="" type="text" aria-required="true"></td>
</tr>
<tr>
<th valign="top" scope="row" class="label">
<span class="alignleft"><label for="insertonly[alt]">' . __('Description') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
- <td class="field"><input id="insertonly[alt]" name="insertonly[alt]" value="" type="text"></td>
+ <td class="field"><input id="insertonly[alt]" name="insertonly[alt]" value="" type="text" aria-required="true"></td>
</tr>
<tr><td></td><td class="help">' . __('Alternate text, e.g. "The Mona Lisa"') . '</td></tr>
<tr class="align">
@@ -1126,14 +1194,14 @@ function type_form_audio() {
<span class="alignleft"><label for="insertonly[href]">' . __('Audio File URL') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
- <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text"></td>
+ <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>
</tr>
<tr>
<th valign="top" scope="row" class="label">
<span class="alignleft"><label for="insertonly[title]">' . __('Title') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
- <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text"></td>
+ <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>
</tr>
<tr><td></td><td class="help">' . __('Link text, e.g. "Still Alive by Jonathan Coulton"') . '</td></tr>
<tr>
@@ -1154,14 +1222,14 @@ function type_form_video() {
<span class="alignleft"><label for="insertonly[href]">' . __('Video URL') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
- <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text"></td>
+ <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>
</tr>
<tr>
<th valign="top" scope="row" class="label">
<span class="alignleft"><label for="insertonly[title]">' . __('Title') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
- <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text"></td>
+ <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>
</tr>
<tr><td></td><td class="help">' . __('Link text, e.g. "Lucy on YouTube"') . '</td></tr>
<tr>
@@ -1182,14 +1250,14 @@ function type_form_file() {
<span class="alignleft"><label for="insertonly[href]">' . __('URL') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
- <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text"></td>
+ <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>
</tr>
<tr>
<th valign="top" scope="row" class="label">
<span class="alignleft"><label for="insertonly[title]">' . __('Title') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
- <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text"></td>
+ <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>
</tr>
<tr><td></td><td class="help">' . __('Link text, e.g. "Ransom Demands (PDF)"') . '</td></tr>
<tr>
@@ -1211,12 +1279,9 @@ add_action('media_upload_image', 'media_upload_image');
add_action('media_upload_audio', 'media_upload_audio');
add_action('media_upload_video', 'media_upload_video');
add_action('media_upload_file', 'media_upload_file');
-add_action('admin_head_media_upload_type_form', 'media_admin_css');
add_filter('media_upload_gallery', 'media_upload_gallery');
-add_action('admin_head_media_upload_gallery_form', 'media_admin_css');
add_filter('media_upload_library', 'media_upload_library');
-add_action('admin_head_media_upload_library_form', 'media_admin_css');
?>
diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php
index a862c51..3afaed9 100644
--- a/wp-admin/includes/plugin.php
+++ b/wp-admin/includes/plugin.php
@@ -32,14 +32,15 @@ function get_plugin_data( $plugin_file ) {
}
function get_plugins($plugin_folder = '') {
- global $wp_plugins;
-
- if ( isset( $wp_plugins ) ) {
- return $wp_plugins;
- }
-
+
+ if ( ! $cache_plugins = wp_cache_get('plugins', 'plugins') )
+ $cached_plugins = array();
+
+ if ( isset($cache_plugins[ $plugin_folder ]) )
+ return $cache_plugins[ $plugin_folder ];
+
$wp_plugins = array ();
- $plugin_root = ABSPATH . PLUGINDIR;
+ $plugin_root = WP_PLUGIN_DIR;
if( !empty($plugin_folder) )
$plugin_root .= $plugin_folder;
@@ -85,6 +86,9 @@ function get_plugins($plugin_folder = '') {
uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' ));
+ $cache_plugins[ $plugin_folder ] = $wp_plugins;
+ wp_cache_set('plugins', $cache_plugins, 'plugins');
+
return $wp_plugins;
}
@@ -104,7 +108,7 @@ function activate_plugin($plugin, $redirect = '') {
if ( !empty($redirect) )
wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); // we'll override this later if the plugin can be included without fatal error
ob_start();
- @include(ABSPATH . PLUGINDIR . '/' . $plugin);
+ @include(WP_PLUGIN_DIR . '/' . $plugin);
$current[] = $plugin;
sort($current);
update_option('active_plugins', $current);
@@ -132,37 +136,97 @@ function deactivate_plugins($plugins, $silent= false) {
update_option('active_plugins', $current);
}
-function deactivate_all_plugins() {
- $current = get_option('active_plugins');
- if ( empty($current) )
- return;
+//Replaces reactivate_all_plugins() / deactivate_all_plugins() = 'deactivated_plugins' is now useless
+function activate_plugins($plugins, $redirect = '') {
+ if ( !is_array($plugins) )
+ $plugins = array($plugins);
- deactivate_plugins($current);
+ $errors = array();
+ foreach ( (array) $plugins as $plugin ) {
+ if ( !empty($redirect) )
+ $redirect = add_query_arg('plugin', $plugin, $redirect);
+ $result = activate_plugin($plugin, $redirect);
+ if ( is_wp_error($result) )
+ $errors[$plugin] = $result;
+ }
- update_option('deactivated_plugins', $current);
+ if ( !empty($errors) )
+ return new WP_Error('plugins_invalid', __('One of the plugins is invalid.'), $errors);
+
+ return true;
}
-function reactivate_all_plugins($redirect = '') {
- $plugins = get_option('deactivated_plugins');
+function delete_plugins($plugins, $redirect = '' ) {
+ global $wp_filesystem;
- if ( empty($plugins) )
+ if( empty($plugins) )
+ return false;
+
+ $checked = array();
+ foreach( $plugins as $plugin )
+ $checked[] = 'checked[]=' . $plugin;
+
+ ob_start();
+ $url = wp_nonce_url('plugins.php?action=delete-selected&' . implode('&', $checked), 'mass-manage-plugins');
+ if ( false === ($credentials = request_filesystem_credentials($url)) ) {
+ $data = ob_get_contents();
+ ob_end_clean();
+ if( ! empty($data) ){
+ include_once( ABSPATH . 'wp-admin/admin-header.php');
+ echo $data;
+ include( ABSPATH . 'wp-admin/admin-footer.php');
+ exit;
+ }
return;
+ }
- if ( !empty($redirect) )
- wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect));
+ if ( ! WP_Filesystem($credentials) ) {
+ request_filesystem_credentials($url, '', true); //Failed to connect, Error and request again
+ $data = ob_get_contents();
+ ob_end_clean();
+ if( ! empty($data) ){
+ include_once( ABSPATH . 'wp-admin/admin-header.php');
+ echo $data;
+ include( ABSPATH . 'wp-admin/admin-footer.php');
+ exit;
+ }
+ return;
+ }
- $errors = array();
- foreach ( (array) $plugins as $plugin ) {
- $result = activate_plugin($plugin);
- if ( is_wp_error($result) )
- $errors[$plugin] = $result;
+ if ( $wp_filesystem->errors->get_error_code() ) {
+ return $wp_filesystem->errors;
}
- delete_option('deactivated_plugins');
+ if ( ! is_object($wp_filesystem) )
+ return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
- if ( !empty($errors) )
- return new WP_Error('plugins_invalid', __('One of the plugins is invalid.'), $errors);
+ if ( $wp_filesystem->errors->get_error_code() )
+ return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors);
+
+ //Get the base plugin folder
+ $plugins_dir = $wp_filesystem->wp_plugins_dir();
+ if ( empty($plugins_dir) )
+ return new WP_Error('fs_no_plugins_dir', __('Unable to locate WordPress Plugin directory.'));
+
+ $plugins_dir = trailingslashit( $plugins_dir );
+ $errors = array();
+
+ foreach( $plugins as $plugin_file ) {
+ $this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin_file) );
+ // If plugin is in its own directory, recursively delete the directory.
+ if ( strpos($plugin_file, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory seperator AND that its not the root plugin folder
+ $deleted = $wp_filesystem->delete($this_plugin_dir, true);
+ else
+ $deleted = $wp_filesystem->delete($plugins_dir . $plugin_file);
+
+ if ( ! $deleted )
+ $errors[] = $plugin_file;
+ }
+
+ if( ! empty($errors) )
+ return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s'), implode(', ', $errors)) );
+
return true;
}
@@ -179,7 +243,7 @@ function validate_active_plugins() {
// If a plugin file does not exist, remove it from the list of active
// plugins.
foreach ( $check_plugins as $check_plugin ) {
- if ( !file_exists(ABSPATH . PLUGINDIR . '/' . $check_plugin) ) {
+ if ( !file_exists(WP_PLUGIN_DIR . '/' . $check_plugin) ) {
$current = get_option('active_plugins');
$key = array_search($check_plugin, $current);
if ( false !== $key && NULL !== $key ) {
@@ -193,7 +257,7 @@ function validate_active_plugins() {
function validate_plugin($plugin) {
if ( validate_file($plugin) )
return new WP_Error('plugin_invalid', __('Invalid plugin.'));
- if ( ! file_exists(ABSPATH . PLUGINDIR . '/' . $plugin) )
+ if ( ! file_exists(WP_PLUGIN_DIR . '/' . $plugin) )
return new WP_Error('plugin_not_found', __('Plugin file does not exist.'));
return 0;
diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php
index aa1e833..f98b9de 100644
--- a/wp-admin/includes/post.php
+++ b/wp-admin/includes/post.php
@@ -1,30 +1,19 @@
<?php
-// Update an existing post with values provided in $_POST.
-function edit_post() {
-
- $post_ID = (int) $_POST['post_ID'];
-
- if ( 'page' == $_POST['post_type'] ) {
- if ( !current_user_can( 'edit_page', $post_ID ) )
- wp_die( __('You are not allowed to edit this page.' ));
- } else {
- if ( !current_user_can( 'edit_post', $post_ID ) )
- wp_die( __('You are not allowed to edit this post.' ));
- }
-
- // Autosave shouldn't save too soon after a real save
- if ( 'autosave' == $_POST['action'] ) {
- $post =& get_post( $post_ID );
- $now = time();
- $then = strtotime($post->post_date_gmt . ' +0000');
- $delta = AUTOSAVE_INTERVAL / 2;
- if ( ($now - $then) < $delta )
- return $post_ID;
- }
-
- // Rename.
- $_POST['ID'] = (int) $_POST['post_ID'];
+/**
+ * _wp_translate_postdata() - Rename $_POST data from form names to DB post columns.
+ *
+ * Manipulates $_POST directly.
+ *
+ * @package WordPress
+ * @since 2.6
+ *
+ * @param bool $update Are we updating a pre-existing post?
+ * @return object|bool WP_Error on failure, true on success.
+ */
+function _wp_translate_postdata( $update = false ) {
+ if ( $update )
+ $_POST['ID'] = (int) $_POST['post_ID'];
$_POST['post_content'] = $_POST['content'];
$_POST['post_excerpt'] = $_POST['excerpt'];
$_POST['post_parent'] = isset($_POST['parent_id'])? $_POST['parent_id'] : '';
@@ -32,21 +21,29 @@ function edit_post() {
if (!empty ( $_POST['post_author_override'] ) ) {
$_POST['post_author'] = (int) $_POST['post_author_override'];
- } else
+ } else {
if (!empty ( $_POST['post_author'] ) ) {
$_POST['post_author'] = (int) $_POST['post_author'];
} else {
$_POST['post_author'] = (int) $_POST['user_ID'];
}
+ }
if ( $_POST['post_author'] != $_POST['user_ID'] ) {
if ( 'page' == $_POST['post_type'] ) {
- if ( !current_user_can( 'edit_others_pages' ) )
- wp_die( __('You are not allowed to edit pages as this user.' ));
+ if ( !current_user_can( 'edit_others_pages' ) ) {
+ return new WP_Error( 'edit_others_pages', $update ?
+ __( 'You are not allowed to edit pages as this user.' ) :
+ __( 'You are not allowed to create pages as this user.' )
+ );
+ }
} else {
- if ( !current_user_can( 'edit_others_posts' ) )
- wp_die( __('You are not allowed to edit posts as this user.' ));
-
+ if ( !current_user_can( 'edit_others_posts' ) ) {
+ return new WP_Error( 'edit_others_posts', $update ?
+ __( 'You are not allowed to edit posts as this user.' ) :
+ __( 'You are not allowed to post as this user.' )
+ );
+ }
}
}
@@ -60,12 +57,20 @@ function edit_post() {
if ( isset($_POST['advanced']) && '' != $_POST['advanced'] )
$_POST['post_status'] = 'draft';
+ $previous_status = get_post_field('post_status', $_POST['ID']);
+
+ // Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published.
+ // Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts.
if ( 'page' == $_POST['post_type'] ) {
- if ('publish' == $_POST['post_status'] && !current_user_can( 'publish_pages' ))
- $_POST['post_status'] = 'pending';
+ if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_pages' ) )
+ if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_pages') )
+ $_POST['post_status'] = 'pending';
} else {
- if ('publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ))
- $_POST['post_status'] = 'pending';
+ if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ) ) :
+ // Stop attempts to publish new posts, but allow already published posts to be saved if appropriate.
+ if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_posts') )
+ $_POST['post_status'] = 'pending';
+ endif;
}
if (!isset( $_POST['comment_status'] ))
@@ -74,14 +79,14 @@ function edit_post() {
if (!isset( $_POST['ping_status'] ))
$_POST['ping_status'] = 'closed';
- foreach ( array ('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) {
+ foreach ( array('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) {
if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) {
$_POST['edit_date'] = '1';
break;
}
}
- if (!empty ( $_POST['edit_date'] ) ) {
+ if ( !empty( $_POST['edit_date'] ) ) {
$aa = $_POST['aa'];
$mm = $_POST['mm'];
$jj = $_POST['jj'];
@@ -92,10 +97,41 @@ function edit_post() {
$hh = ($hh > 23 ) ? $hh -24 : $hh;
$mn = ($mn > 59 ) ? $mn -60 : $mn;
$ss = ($ss > 59 ) ? $ss -60 : $ss;
- $_POST['post_date'] = "$aa-$mm-$jj $hh:$mn:$ss";
- $_POST['post_date_gmt'] = get_gmt_from_date( "$aa-$mm-$jj $hh:$mn:$ss" );
+ $_POST['post_date'] = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss );
+ $_POST['post_date_gmt'] = get_gmt_from_date( $_POST['post_date'] );
+ }
+
+ return true;
+}
+
+
+// Update an existing post with values provided in $_POST.
+function edit_post() {
+
+ $post_ID = (int) $_POST['post_ID'];
+
+ if ( 'page' == $_POST['post_type'] ) {
+ if ( !current_user_can( 'edit_page', $post_ID ) )
+ wp_die( __('You are not allowed to edit this page.' ));
+ } else {
+ if ( !current_user_can( 'edit_post', $post_ID ) )
+ wp_die( __('You are not allowed to edit this post.' ));
}
+ // Autosave shouldn't save too soon after a real save
+ if ( 'autosave' == $_POST['action'] ) {
+ $post =& get_post( $post_ID );
+ $now = time();
+ $then = strtotime($post->post_date_gmt . ' +0000');
+ $delta = AUTOSAVE_INTERVAL / 2;
+ if ( ($now - $then) < $delta )
+ return $post_ID;
+ }
+
+ $translated = _wp_translate_postdata( true );
+ if ( is_wp_error($translated) )
+ wp_die( $translated->get_error_message() );
+
// Meta Stuff
if ( isset($_POST['meta']) && $_POST['meta'] ) {
foreach ( $_POST['meta'] as $key => $value )
@@ -194,13 +230,13 @@ function post_exists($title, $content = '', $post_date = '') {
global $wpdb;
if (!empty ($post_date))
- $post_date = "AND post_date = '$post_date'";
+ $post_date = $wpdb->prepare("AND post_date = %s", $post_date);
if (!empty ($title))
- return $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = '$title' $post_date");
+ return $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_title = %s $post_date", $title) );
else
if (!empty ($content))
- return $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_content = '$content' $post_date");
+ return $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_content = %s $post_date", $content) );
return 0;
}
@@ -236,79 +272,9 @@ function wp_write_post() {
}
}
- // Rename.
- $_POST['post_content'] = $_POST['content'];
- $_POST['post_excerpt'] = $_POST['excerpt'];
- $_POST['post_parent'] = isset($_POST['parent_id'])? $_POST['parent_id'] : '';
- $_POST['to_ping'] = $_POST['trackback_url'];
-
- if (!empty ( $_POST['post_author_override'] ) ) {
- $_POST['post_author'] = (int) $_POST['post_author_override'];
- } else {
- if (!empty ( $_POST['post_author'] ) ) {
- $_POST['post_author'] = (int) $_POST['post_author'];
- } else {
- $_POST['post_author'] = (int) $_POST['user_ID'];
- }
-
- }
-
- if ( $_POST['post_author'] != $_POST['user_ID'] ) {
- if ( 'page' == $_POST['post_type'] ) {
- if ( !current_user_can( 'edit_others_pages' ) )
- return new WP_Error( 'edit_others_pages', __( 'You are not allowed to create pages as this user.' ) );
- } else {
- if ( !current_user_can( 'edit_others_posts' ) )
- return new WP_Error( 'edit_others_posts', __( 'You are not allowed to post as this user.' ) );
-
- }
- }
-
- // What to do based on which button they pressed
- if ( isset($_POST['saveasdraft']) && '' != $_POST['saveasdraft'] )
- $_POST['post_status'] = 'draft';
- if ( isset($_POST['saveasprivate']) && '' != $_POST['saveasprivate'] )
- $_POST['post_status'] = 'private';
- if ( isset($_POST['publish']) && ( '' != $_POST['publish'] ) && ( $_POST['post_status'] != 'private' ) )
- $_POST['post_status'] = 'publish';
- if ( isset($_POST['advanced']) && '' != $_POST['advanced'] )
- $_POST['post_status'] = 'draft';
-
- if ( 'page' == $_POST['post_type'] ) {
- if ('publish' == $_POST['post_status'] && !current_user_can( 'publish_pages' ) )
- $_POST['post_status'] = 'pending';
- } else {
- if ('publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ) )
- $_POST['post_status'] = 'pending';
- }
-
- if (!isset( $_POST['comment_status'] ))
- $_POST['comment_status'] = 'closed';
-
- if (!isset( $_POST['ping_status'] ))
- $_POST['ping_status'] = 'closed';
-
- foreach ( array ('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) {
- if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) {
- $_POST['edit_date'] = '1';
- break;
- }
- }
-
- if (!empty ( $_POST['edit_date'] ) ) {
- $aa = $_POST['aa'];
- $mm = $_POST['mm'];
- $jj = $_POST['jj'];
- $hh = $_POST['hh'];
- $mn = $_POST['mn'];
- $ss = $_POST['ss'];
- $jj = ($jj > 31 ) ? 31 : $jj;
- $hh = ($hh > 23 ) ? $hh -24 : $hh;
- $mn = ($mn > 59 ) ? $mn -60 : $mn;
- $ss = ($ss > 59 ) ? $ss -60 : $ss;
- $_POST['post_date'] = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss );
- $_POST['post_date_gmt'] = get_gmt_from_date( $_POST['post_date'] );
- }
+ $translated = _wp_translate_postdata( false );
+ if ( is_wp_error($translated) )
+ return $translated;
// Create the post.
$post_ID = wp_insert_post( $_POST );
@@ -380,11 +346,9 @@ function add_meta( $post_ID ) {
wp_cache_delete($post_ID, 'post_meta');
- $wpdb->query( "
- INSERT INTO $wpdb->postmeta
- (post_id,meta_key,meta_value )
- VALUES ('$post_ID','$metakey','$metavalue' )
- " );
+ $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->postmeta
+ (post_id,meta_key,meta_value ) VALUES (%s, %s, %s)",
+ $post_ID, $metakey, $metavalue) );
return $wpdb->insert_id;
}
return false;
@@ -394,10 +358,10 @@ function delete_meta( $mid ) {
global $wpdb;
$mid = (int) $mid;
- $post_id = $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = '$mid'");
+ $post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
wp_cache_delete($post_id, 'post_meta');
- return $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_id = '$mid'" );
+ return $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
}
// Get a list of previously defined keys
@@ -417,7 +381,7 @@ function get_post_meta_by_id( $mid ) {
global $wpdb;
$mid = (int) $mid;
- $meta = $wpdb->get_row( "SELECT * FROM $wpdb->postmeta WHERE meta_id = '$mid'" );
+ $meta = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
if ( is_serialized_string( $meta->meta_value ) )
$meta->meta_value = maybe_unserialize( $meta->meta_value );
return $meta;
@@ -427,29 +391,30 @@ function get_post_meta_by_id( $mid ) {
function has_meta( $postid ) {
global $wpdb;
- return $wpdb->get_results( "
- SELECT meta_key, meta_value, meta_id, post_id
- FROM $wpdb->postmeta
- WHERE post_id = '$postid'
- ORDER BY meta_key,meta_id", ARRAY_A );
+ return $wpdb->get_results( $wpdb->prepare("SELECT meta_key, meta_value, meta_id, post_id
+ FROM $wpdb->postmeta WHERE post_id = %d
+ ORDER BY meta_key,meta_id", $postid), ARRAY_A );
}
-function update_meta( $mid, $mkey, $mvalue ) {
+function update_meta( $meta_id, $meta_key, $meta_value ) {
global $wpdb;
$protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' );
- if ( in_array($mkey, $protected) )
+ if ( in_array($meta_key, $protected) )
return false;
- $post_id = $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = '$mid'");
+ $post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $meta_id) );
wp_cache_delete($post_id, 'post_meta');
- $mvalue = maybe_serialize( stripslashes( $mvalue ));
- $mvalue = $wpdb->escape( $mvalue );
- $mid = (int) $mid;
- return $wpdb->query( "UPDATE $wpdb->postmeta SET meta_key = '$mkey', meta_value = '$mvalue' WHERE meta_id = '$mid'" );
+ $meta_value = maybe_serialize( stripslashes( $meta_value ));
+ $meta_id = (int) $meta_id;
+
+ $data = compact( 'meta_key', 'meta_value' );
+ $where = compact( 'meta_id' );
+
+ return $wpdb->update( $wpdb->postmeta, $data, $where );
}
//
@@ -502,7 +467,7 @@ function _relocate_children( $old_ID, $new_ID ) {
global $wpdb;
$old_ID = (int) $old_ID;
$new_ID = (int) $new_ID;
- return $wpdb->query( "UPDATE $wpdb->posts SET post_parent = $new_ID WHERE post_parent = $old_ID" );
+ return $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = %d WHERE post_parent = %d", $new_ID, $old_ID) );
}
function get_available_post_statuses($type = 'post') {
@@ -631,7 +596,7 @@ function get_sample_permalink($id, $title=null, $name = null) {
$permalink = str_replace('%pagename%', "${uri}%pagename%", $permalink);
}
- $permalink = array($permalink, $post->post_name);
+ $permalink = array($permalink, apply_filters('editable_slug', $post->post_name));
$post->post_status = $original_status;
$post->post_date = $original_date;
$post->post_name = $original_name;
@@ -691,4 +656,28 @@ function wp_set_post_lock( $post_id ) {
update_post_meta( $post->ID, '_edit_last', $current_user->ID );
}
-?>
+/**
+ * wp_create_post_autosave() - creates autosave data for the specified post from $_POST data
+ *
+ * @package WordPress
+ * @subpackage Post Revisions
+ * @since 2.6
+ *
+ * @uses _wp_translate_postdata()
+ * @uses _wp_post_revision_fields()
+ */
+function wp_create_post_autosave( $post_id ) {
+ $translated = _wp_translate_postdata( true );
+ if ( is_wp_error( $translated ) )
+ return $translated;
+
+ // Only store one autosave. If there is already an autosave, overwrite it.
+ if ( $old_autosave = wp_get_post_autosave( $post_id ) ) {
+ $new_autosave = _wp_post_revision_fields( $_POST, true );
+ $new_autosave['ID'] = $old_autosave->ID;
+ return wp_update_post( $new_autosave );
+ }
+
+ // Otherwise create the new autosave as a special post revision
+ return _wp_put_post_revision( $_POST, true );
+}
diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php
index 2d5ddcf..1e59f0e 100644
--- a/wp-admin/includes/schema.php
+++ b/wp-admin/includes/schema.php
@@ -227,10 +227,13 @@ CREATE TABLE IF NOT EXISTS $wpdb->signups (
";
function populate_options() {
- global $wpdb, $wp_db_version, $wpblog, $current_site;
+ global $wpdb, $wp_db_version, $current_site;
$schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
$guessurl = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
+
+ do_action('populate_options');
+
add_option('siteurl', $guessurl);
add_option('blogname', __('My Blog'));
add_option('blogdescription', sprintf(__('Just another %s weblog'), $current_site->site_name ) );
@@ -299,10 +302,10 @@ function populate_options() {
if ( ini_get('safe_mode') ) {
// Safe mode screws up mkdir(), so we must use a flat structure.
add_option('uploads_use_yearmonth_folders', 0);
- add_option('upload_path', 'wp-content');
+ add_option('upload_path', WP_CONTENT_DIR);
} else {
add_option('uploads_use_yearmonth_folders', 1);
- add_option('upload_path', 'wp-content/uploads');
+ add_option('upload_path', WP_CONTENT_DIR . '/uploads');
}
// 2.0.3
@@ -326,8 +329,11 @@ function populate_options() {
add_option('medium_size_w', 300);
add_option('medium_size_h', 300);
+ // 2.6
+ add_option('avatar_default', 'mystery');
+
// Delete unused options
- $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval');
+ $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins');
foreach ($unusedoptions as $option) :
delete_option($option);
endforeach;
@@ -344,6 +350,7 @@ function populate_roles() {
populate_roles_210();
populate_roles_230();
populate_roles_250();
+ populate_roles_260();
}
function populate_roles_160() {
@@ -499,4 +506,15 @@ function populate_roles_250() {
}
}
+function populate_roles_260() {
+ /*
+ $role = get_role( 'administrator' );
+
+ if ( !empty( $role ) ) {
+ $role->add_cap( 'update_plugins' );
+ $role->add_cap( 'delete_plugins' );
+ }
+ */
+}
+
?>
diff --git a/wp-admin/includes/taxonomy.php b/wp-admin/includes/taxonomy.php
index b490ed6..f3c5fcf 100644
--- a/wp-admin/includes/taxonomy.php
+++ b/wp-admin/includes/taxonomy.php
@@ -47,7 +47,7 @@ function wp_delete_category($cat_ID) {
if ( $cat_ID == $default )
return 0;
- return wp_delete_term($cat_ID, 'category', "default=$default");
+ return wp_delete_term($cat_ID, 'category', array('default' => $default));
}
function wp_insert_category($catarr, $wp_error = false) {
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index 19f11f6..c348e7f 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -302,7 +302,7 @@ function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) {
// define the columns to display, the syntax is 'internal name' => 'display name'
function wp_manage_posts_columns() {
$posts_columns = array();
- $posts_columns['cb'] = '<input type="checkbox" onclick="checkAll(document.getElementById(\'posts-filter\'));" />';
+ $posts_columns['cb'] = '<input type="checkbox" />';
if ( 'draft' === $_GET['post_status'] )
$posts_columns['modified'] = __('Modified');
elseif ( 'pending' === $_GET['post_status'] )
@@ -324,7 +324,7 @@ function wp_manage_posts_columns() {
// define the columns to display, the syntax is 'internal name' => 'display name'
function wp_manage_media_columns() {
$posts_columns = array();
- $posts_columns['cb'] = '<input type="checkbox" onclick="checkAll(document.getElementById(\'posts-filter\'));" />';
+ $posts_columns['cb'] = '<input type="checkbox" />';
$posts_columns['icon'] = '';
$posts_columns['media'] = _c('Media|media column header');
$posts_columns['desc'] = _c('Description|media column header');
@@ -339,7 +339,7 @@ function wp_manage_media_columns() {
function wp_manage_pages_columns() {
$posts_columns = array();
- $posts_columns['cb'] = '<input type="checkbox" onclick="checkAll(document.getElementById(\'posts-filter\'));" />';
+ $posts_columns['cb'] = '<input type="checkbox" />';
if ( 'draft' === $_GET['post_status'] )
$posts_columns['modified'] = __('Modified');
elseif ( 'pending' === $_GET['post_status'] )
@@ -505,7 +505,7 @@ foreach ($posts_columns as $column_name=>$column_display_name) {
*/
function page_rows( $pages ) {
if ( ! $pages )
- $pages = get_pages( 'sort_column=menu_order' );
+ $pages = get_pages( array('sort_column' => 'menu_order') );
if ( ! $pages )
return false;
@@ -717,7 +717,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true
function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
if (!$categories )
- $categories = get_categories( 'hide_empty=0' );
+ $categories = get_categories( array('hide_empty' => 0) );
if ( $categories ) {
foreach ( $categories as $category ) {
@@ -790,8 +790,8 @@ function _list_meta_row( $entry, &$count ) {
$delete_nonce = wp_create_nonce( 'delete-meta_' . $entry['meta_id'] );
$r .= "\n\t<tr id='meta-{$entry['meta_id']}' class='$style'>";
- $r .= "\n\t\t<td valign='top'><input name='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td>";
- $r .= "\n\t\t<td><textarea name='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>";
+ $r .= "\n\t\t<td valign='top'><label class='hidden' for='meta[{$entry['meta_id']}][key]'>" . __( 'Key' ) . "</label><input name='meta[{$entry['meta_id']}][key]' id='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td>";
+ $r .= "\n\t\t<td><label class='hidden' for='meta[{$entry['meta_id']}][value]'>" . __( 'Value' ) . "</label><textarea name='meta[{$entry['meta_id']}][value]' id='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>";
$r .= "\n\t\t<td style='text-align: center;'><input name='updatemeta' type='submit' tabindex='6' value='".attribute_escape(__( 'Update' ))."' class='add:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$update_nonce updatemeta' /><br />";
$r .= "\n\t\t<input name='deletemeta[{$entry['meta_id']}]' type='submit' ";
$r .= "class='delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce deletemeta' tabindex='6' value='".attribute_escape(__( 'Delete' ))."' />";
@@ -816,8 +816,8 @@ function meta_form() {
<p><strong><?php _e( 'Add a new custom field:' ) ?></strong></p>
<table id="newmeta" cellspacing="3" cellpadding="3">
<tr>
-<th colspan="2"><?php _e( 'Key' ) ?></th>
-<th><?php _e( 'Value' ) ?></th>
+<th colspan="2"><label <?php if ( $keys ) : ?> for="metakeyselect" <?php else : ?> for="metakeyinput" <?php endif; ?>><?php _e( 'Key' ) ?></label></th>
+<th><label for="metavalue"><?php _e( 'Value' ) ?></label></th>
</tr>
<tr valign="top">
<td style="width: 18%;" class="textright">
@@ -831,7 +831,7 @@ function meta_form() {
echo "\n\t<option value='$key'>$key</option>";
}
?>
-</select> <?php _e( 'or' ); ?>
+</select> <label for="metakeyinput"><?php _e( 'or' ); ?></label>
<?php endif; ?>
</td>
<td><input type="text" id="metakeyinput" name="metakeyinput" tabindex="7" /></td>
@@ -904,7 +904,7 @@ function page_template_dropdown( $default = '' ) {
function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
global $wpdb, $post_ID;
- $items = $wpdb->get_results( "SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = $parent AND post_type = 'page' ORDER BY menu_order" );
+ $items = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent) );
if ( $items ) {
foreach ( $items as $item ) {
@@ -1057,10 +1057,12 @@ function wp_remember_old_slug() {
* @param string $callback Function that fills the box with the desired content. The function should echo its output.
* @param string $page The type of edit page on which to show the box (post, page, link)
* @param string $context The context within the page where the boxes should show ('normal', 'advanced')
+ * @param string $priority The priority within the context where the boxes should show ('high', 'low')
*/
-function add_meta_box($id, $title, $callback, $page, $context = 'advanced') {
+function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default') {
global $wp_meta_boxes;
+
if ( !isset($wp_meta_boxes) )
$wp_meta_boxes = array();
if ( !isset($wp_meta_boxes[$page]) )
@@ -1068,23 +1070,81 @@ function add_meta_box($id, $title, $callback, $page, $context = 'advanced') {
if ( !isset($wp_meta_boxes[$page][$context]) )
$wp_meta_boxes[$page][$context] = array();
- $wp_meta_boxes[$page][$context][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback);
+ foreach ( array('high', 'core', 'default', 'low') as $a_priority ) {
+ if ( !isset($wp_meta_boxes[$page][$context][$a_priority][$id]) )
+ continue;
+ // If a core box was previously added or removed by a plugin, don't add.
+ if ( 'core' == $priority ) {
+ // If core box previously deleted, don't add
+ if ( false === $wp_meta_boxes[$page][$context][$a_priority][$id] )
+ return;
+ // If box was added with default priority, give it core priority to maintain sort order
+ if ( 'default' == $a_priority ) {
+ $wp_meta_boxes[$page][$context]['core'][$id] = $wp_meta_boxes[$page][$context]['default'][$id];
+ unset($wp_meta_boxes[$page][$context]['default'][$id]);
+ }
+ return;
+ }
+ // If no priority given and id already present, use existing priority
+ if ( empty($priority) )
+ $priority = $a_priority;
+ // An id can be in only one priority
+ if ( $priority != $a_priority )
+ unset($wp_meta_boxes[$page][$context][$a_priority][$id]);
+ }
+
+ if ( empty($priority) )
+ $priority = low;
+
+ if ( !isset($wp_meta_boxes[$page][$context][$priority]) )
+ $wp_meta_boxes[$page][$context][$priority] = array();
+
+ $wp_meta_boxes[$page][$context][$priority][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback);
}
function do_meta_boxes($page, $context, $object) {
global $wp_meta_boxes;
+ do_action('do_meta_boxes', $page, $context, $object);
+
if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) )
return;
- foreach ( (array) $wp_meta_boxes[$page][$context] as $box ) {
- echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . '">' . "\n";
- echo "<h3>{$box['title']}</h3>\n";
- echo '<div class="inside">' . "\n";
- call_user_func($box['callback'], $object, $box);
- echo "</div>\n";
- echo "</div>\n";
+ foreach ( array('high', 'core', 'default', 'low') as $priority ) {
+ foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) {
+ if ( false === $box )
+ continue;
+ echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . '">' . "\n";
+ echo "<h3>{$box['title']}</h3>\n";
+ echo '<div class="inside">' . "\n";
+ call_user_func($box['callback'], $object, $box);
+ echo "</div>\n";
+ echo "</div>\n";
+ }
}
}
+/**
+ * remove_meta_box() - Remove a meta box from an edit form
+ *
+ * @since 2.6
+ *
+ * @param string $id String for use in the 'id' attribute of tags.
+ * @param string $page The type of edit page on which to show the box (post, page, link)
+ * @param string $context The context within the page where the boxes should show ('normal', 'advanced')
+ */
+function remove_meta_box($id, $page, $context) {
+ global $wp_meta_boxes;
+
+ if ( !isset($wp_meta_boxes) )
+ $wp_meta_boxes = array();
+ if ( !isset($wp_meta_boxes[$page]) )
+ $wp_meta_boxes[$page] = array();
+ if ( !isset($wp_meta_boxes[$page][$context]) )
+ $wp_meta_boxes[$page][$context] = array();
+
+ foreach ( array('high', 'core', 'default', 'low') as $priority )
+ $wp_meta_boxes[$page][$context][$priority][$id] = false;
+}
+
?>
diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php
index 7dae5be..ec670ce 100644
--- a/wp-admin/includes/theme.php
+++ b/wp-admin/includes/theme.php
@@ -33,7 +33,7 @@ function get_page_templates() {
if ( is_array( $templates ) ) {
foreach ( $templates as $template ) {
- $template_data = implode( '', file( ABSPATH.$template ));
+ $template_data = implode( '', file( WP_CONTENT_DIR.$template ));
preg_match( '|Template Name:(.*)$|mi', $template_data, $name );
preg_match( '|Description:(.*)$|mi', $template_data, $description );
diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php
index 70d1441..d17298f 100644
--- a/wp-admin/includes/update.php
+++ b/wp-admin/includes/update.php
@@ -119,25 +119,24 @@ function wp_update_plugins() {
}
add_action( 'load-plugins.php', 'wp_update_plugins' );
-function wp_plugin_update_row( $file ) {
- global $plugin_data;
+function wp_plugin_update_row( $file, $plugin_data ) {
$current = get_option( 'update_plugins' );
if ( !isset( $current->response[ $file ] ) )
return false;
$r = $current->response[ $file ];
- echo "<tr><td colspan='5' class='plugin-update'>";
- if ( !current_user_can('edit_plugins') )
+ echo '<tr><td colspan="5" class="plugin-update">';
+ if ( ! current_user_can('update_plugins') )
printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a>.'), $plugin_data['Name'], $r->url, $r->new_version);
else if ( empty($r->package) )
printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> <em>automatic upgrade unavailable for this plugin</em>.'), $plugin_data['Name'], $r->url, $r->new_version);
else
- printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> or <a href="%4$s">upgrade automatically</a>.'), $plugin_data['Name'], $r->url, $r->new_version, wp_nonce_url("update.php?action=upgrade-plugin&amp;plugin=$file", 'upgrade-plugin_' . $file) );
+ printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> or <a href="%4$s">upgrade automatically</a>.'), $plugin_data['Name'], $r->url, $r->new_version, wp_nonce_url('update.php?action=upgrade-plugin&amp;plugin=' . $file, 'upgrade-plugin_' . $file) );
- echo "</td></tr>";
+ echo '</td></tr>';
}
-add_action( 'after_plugin_row', 'wp_plugin_update_row' );
+add_action( 'after_plugin_row', 'wp_plugin_update_row', 10, 2 );
function wp_update_plugin($plugin, $feedback = '') {
global $wp_filesystem;
@@ -151,7 +150,7 @@ function wp_update_plugin($plugin, $feedback = '') {
return new WP_Error('up_to_date', __('The plugin is at the latest version.'));
// Is a filesystem accessor setup?
- if ( ! $wp_filesystem || !is_object($wp_filesystem) )
+ if ( ! $wp_filesystem || ! is_object($wp_filesystem) )
WP_Filesystem();
if ( ! is_object($wp_filesystem) )
@@ -160,11 +159,18 @@ function wp_update_plugin($plugin, $feedback = '') {
if ( $wp_filesystem->errors->get_error_code() )
return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors);
- //Get the Base folder
- $base = $wp_filesystem->get_base_dir();
+ //Get the base plugin folder
+ $plugins_dir = $wp_filesystem->wp_plugins_dir();
+ if ( empty($plugins_dir) )
+ return new WP_Error('fs_no_plugins_dir', __('Unable to locate WordPress Plugin directory.'));
+
+ //And the same for the Content directory.
+ $content_dir = $wp_filesystem->wp_content_dir();
+ if( empty($content_dir) )
+ return new WP_Error('fs_no_content_dir', __('Unable to locate WordPress Content directory (wp-content).'));
- if ( empty($base) )
- return new WP_Error('fs_nowordpress', __('Unable to locate WordPress directory.'));
+ $plugins_dir = trailingslashit( $plugins_dir );
+ $content_dir = trailingslashit( $content_dir );
// Get the URL to the zip file
$r = $current->response[ $plugin ];
@@ -175,12 +181,12 @@ function wp_update_plugin($plugin, $feedback = '') {
// Download the package
$package = $r->package;
apply_filters('update_feedback', sprintf(__('Downloading update from %s'), $package));
- $file = download_url($package);
+ $download_file = download_url($package);
- if ( is_wp_error($file) )
- return new WP_Error('download_failed', __('Download failed.'), $file->get_error_message());
+ if ( is_wp_error($download_file) )
+ return new WP_Error('download_failed', __('Download failed.'), $download_file->get_error_message());
- $working_dir = $base . 'wp-content/upgrade/' . basename($plugin, '.php');
+ $working_dir = $content_dir . 'upgrade/' . basename($plugin, '.php');
// Clean up working directory
if ( $wp_filesystem->is_dir($working_dir) )
@@ -188,16 +194,16 @@ function wp_update_plugin($plugin, $feedback = '') {
apply_filters('update_feedback', __('Unpacking the update'));
// Unzip package to working directory
- $result = unzip_file($file, $working_dir);
+ $result = unzip_file($download_file, $working_dir);
+
+ // Once extracted, delete the package
+ unlink($download_file);
+
if ( is_wp_error($result) ) {
- unlink($file);
$wp_filesystem->delete($working_dir, true);
return $result;
}
- // Once extracted, delete the package
- unlink($file);
-
if ( is_plugin_active($plugin) ) {
//Deactivate the plugin silently, Prevent deactivation hooks from running.
apply_filters('update_feedback', __('Deactivating the plugin'));
@@ -206,25 +212,25 @@ function wp_update_plugin($plugin, $feedback = '') {
// Remove the existing plugin.
apply_filters('update_feedback', __('Removing the old version of the plugin'));
- $plugin_dir = dirname($base . PLUGINDIR . "/$plugin");
- $plugin_dir = trailingslashit($plugin_dir);
+ $this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin) );
// If plugin is in its own directory, recursively delete the directory.
- if ( strpos($plugin, '/') && $plugin_dir != $base . PLUGINDIR . '/' ) //base check on if plugin includes directory seperator AND that its not the root plugin folder
- $deleted = $wp_filesystem->delete($plugin_dir, true);
+ if ( strpos($plugin, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory seperator AND that its not the root plugin folder
+ $deleted = $wp_filesystem->delete($this_plugin_dir, true);
else
- $deleted = $wp_filesystem->delete($base . PLUGINDIR . "/$plugin");
+ $deleted = $wp_filesystem->delete($plugins_dir . $plugin);
- if ( !$deleted ) {
+ if ( ! $deleted ) {
$wp_filesystem->delete($working_dir, true);
return new WP_Error('delete_failed', __('Could not remove the old plugin'));
}
apply_filters('update_feedback', __('Installing the latest version'));
// Copy new version of plugin into place.
- if ( !copy_dir($working_dir, $base . PLUGINDIR) ) {
+ $result = copy_dir($working_dir, $plugins_dir);
+ if ( is_wp_error($result) ) {
//$wp_filesystem->delete($working_dir, true); //TODO: Uncomment? This DOES mean that the new files are available in the upgrade folder if it fails.
- return new WP_Error('install_failed', __('Installation failed'));
+ return $result;
}
//Get a list of the directories in the working directory before we delete it, We need to know the new folder for the plugin
@@ -237,13 +243,13 @@ function wp_update_plugin($plugin, $feedback = '') {
delete_option('update_plugins');
if( empty($filelist) )
- return false; //We couldnt find any files in the working dir
+ return false; //We couldnt find any files in the working dir, therefor no plugin installed? Failsafe backup.
$folder = $filelist[0];
- $plugin = get_plugins('/' . $folder); //Pass it with a leading slash, search out the plugins in the folder,
+ $plugin = get_plugins('/' . $folder); //Ensure to pass with leading slash
$pluginfiles = array_keys($plugin); //Assume the requested plugin is the first in the list
- return $folder . '/' . $pluginfiles[0]; //Pass it without a leading slash as WP requires
+ return $folder . '/' . $pluginfiles[0];
}
*/
diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php
index 800a86d..1b15aae 100644
--- a/wp-admin/includes/upgrade.php
+++ b/wp-admin/includes/upgrade.php
@@ -1,7 +1,7 @@
<?php
-if ( file_exists(ABSPATH . 'wp-content/install.php') )
- require (ABSPATH . 'wp-content/install.php');
+if ( file_exists(WP_CONTENT_DIR . '/install.php') )
+ require (WP_CONTENT_DIR . '/install.php');
require_once(ABSPATH . 'wp-admin/includes/admin.php');
require_once(ABSPATH . 'wp-admin/includes/schema.php');
@@ -208,6 +208,9 @@ function upgrade_all() {
if ( $wp_current_db_version < 7935 )
upgrade_252();
+ if ( $wp_current_db_version < 8000 )
+ upgrade_260();
+
maybe_disable_automattic_widgets();
$wp_rewrite->flush_rules();
@@ -224,7 +227,7 @@ function upgrade_100() {
foreach($posts as $post) {
if ('' == $post->post_name) {
$newtitle = sanitize_title($post->post_title);
- $wpdb->query("UPDATE $wpdb->posts SET post_name = '$newtitle' WHERE ID = '$post->ID'");
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_name = %s WHERE ID = %d", $newtitle, $post->ID) );
}
}
}
@@ -233,7 +236,7 @@ function upgrade_100() {
foreach ($categories as $category) {
if ('' == $category->category_nicename) {
$newtitle = sanitize_title($category->cat_name);
- $wpdb->query("UPDATE $wpdb->categories SET category_nicename = '$newtitle' WHERE cat_ID = '$category->cat_ID'");
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->categories SET category_nicename = %s WHERE cat_ID = %d", $newtitle, $category->cat_ID) );
}
}
@@ -256,14 +259,12 @@ function upgrade_100() {
if ($allposts) :
foreach ($allposts as $post) {
// Check to see if it's already been imported
- $cat = $wpdb->get_row("SELECT * FROM $wpdb->post2cat WHERE post_id = $post->ID AND category_id = $post->post_category");
+ $cat = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->post2cat WHERE post_id = %d AND category_id = %d", $post->ID, $post->post_category) );
if (!$cat && 0 != $post->post_category) { // If there's no result
- $wpdb->query("
- INSERT INTO $wpdb->post2cat
+ $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->post2cat
(post_id, category_id)
- VALUES
- ('$post->ID', '$post->post_category')
- ");
+ VALUES (%s, %s)
+ ", $post->ID, $post->post_category) );
}
}
endif;
@@ -291,7 +292,7 @@ function upgrade_110() {
foreach ($users as $user) {
if ('' == $user->user_nicename) {
$newname = sanitize_title($user->user_nickname);
- $wpdb->query("UPDATE $wpdb->users SET user_nicename = '$newname' WHERE ID = '$user->ID'");
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->users SET user_nicename = %s WHERE ID = %d", $newname, $user->ID) );
}
}
@@ -407,7 +408,7 @@ function upgrade_130() {
foreach ( $options as $option ) {
if ( 1 != $option->dupes ) { // Could this be done in the query?
$limit = $option->dupes - 1;
- $dupe_ids = $wpdb->get_col("SELECT option_id FROM $wpdb->options WHERE option_name = '$option->option_name' LIMIT $limit");
+ $dupe_ids = $wpdb->get_col( $wpdb->prepare("SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d", $option->option_name, $limit) );
$dupe_ids = join($dupe_ids, ',');
$wpdb->query("DELETE FROM $wpdb->options WHERE option_id IN ($dupe_ids)");
}
@@ -451,8 +452,7 @@ function upgrade_160_helper( $users ) {
if ($idmode == 'namefl') $id = $user->user_firstname.' '.$user->user_lastname;
if ($idmode == 'namelf') $id = $user->user_lastname.' '.$user->user_firstname;
if (!$idmode) $id = $user->user_nickname;
- $id = $wpdb->escape( $id );
- $wpdb->query("UPDATE $wpdb->users SET display_name = '$id' WHERE ID = '$user->ID'");
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->users SET display_name = %s WHERE ID = %d", $id, $user->ID) );
endif;
// FIXME: RESET_CAPS is temporary code to reset roles and caps if flag is set.
@@ -482,7 +482,7 @@ function upgrade_160() {
$comments = $wpdb->get_results( "SELECT comment_post_ID, COUNT(*) as c FROM $wpdb->comments WHERE comment_approved = '1' GROUP BY comment_post_ID" );
if( is_array( $comments ) ) {
foreach ($comments as $comment) {
- $wpdb->query( "UPDATE $wpdb->posts SET comment_count = $comment->c WHERE ID = '$comment->comment_post_ID'" );
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET comment_count = %d WHERE ID = %d", $comment->c, $comment->comment_post_ID) );
}
}
@@ -491,10 +491,10 @@ function upgrade_160() {
if ( $wp_current_db_version > 2541 && $wp_current_db_version <= 3091 ) {
$objects = $wpdb->get_results("SELECT ID, post_type FROM $wpdb->posts WHERE post_status = 'object'");
foreach ($objects as $object) {
- $wpdb->query("UPDATE $wpdb->posts SET post_status = 'attachment',
- post_mime_type = '$object->post_type',
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_status = 'attachment',
+ post_mime_type = %s,
post_type = ''
- WHERE ID = $object->ID");
+ WHERE ID = %d", $object->post_type, $object->ID) );
$meta = get_post_meta($object->ID, 'imagedata', true);
if ( ! empty($meta['file']) )
@@ -522,7 +522,7 @@ function upgrade_210() {
$type = 'attachment';
}
- $wpdb->query("UPDATE $wpdb->posts SET post_status = '$status', post_type = '$type' WHERE ID = '$post->ID'");
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_status = %s, post_type = %s WHERE ID = %d", $status, $type, $post->ID) );
}
}
@@ -555,45 +555,42 @@ function upgrade_230() {
$categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_ID");
foreach ($categories as $category) {
$term_id = (int) $category->cat_ID;
- $name = $wpdb->escape($category->cat_name);
- $description = $wpdb->escape($category->category_description);
- $slug = $wpdb->escape($category->category_nicename);
- $parent = $wpdb->escape($category->category_parent);
$term_group = 0;
// Associate terms with the same slug in a term group and make slugs unique.
- if ( $exists = $wpdb->get_results("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = '$slug'") ) {
+ if ( $exists = $wpdb->get_results( $wpdb->prepare("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug) ) ) {
$term_group = $exists[0]->term_group;
$id = $exists[0]->term_id;
$num = 2;
do {
$alt_slug = $slug . "-$num";
$num++;
- $slug_check = $wpdb->get_var("SELECT slug FROM $wpdb->terms WHERE slug = '$alt_slug'");
+ $slug_check = $wpdb->get_var( $wpdb->prepare("SELECT slug FROM $wpdb->terms WHERE slug = %s", $alt_slug) );
} while ( $slug_check );
$slug = $alt_slug;
if ( empty( $term_group ) ) {
$term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms GROUP BY term_group") + 1;
- $wpdb->query("UPDATE $wpdb->terms SET term_group = '$term_group' WHERE term_id = '$id'");
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->terms SET term_group = %d WHERE term_id = %d", $term_group, $id) );
}
}
- $wpdb->query("INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES ('$term_id', '$name', '$slug', '$term_group')");
+ $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES
+ (%d, %s, %s, %d)", $term_id, $name, $slug, $term_group) );
$count = 0;
if ( !empty($category->category_count) ) {
$count = (int) $category->category_count;
$taxonomy = 'category';
- $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')");
+ $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) );
$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
}
if ( !empty($category->link_count) ) {
$count = (int) $category->link_count;
$taxonomy = 'link_category';
- $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')");
+ $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) );
$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
}
@@ -601,14 +598,14 @@ function upgrade_230() {
$have_tags = true;
$count = (int) $category->tag_count;
$taxonomy = 'post_tag';
- $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')");
+ $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) );
$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
}
if ( empty($count) ) {
$count = 0;
$taxonomy = 'category';
- $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '$count')");
+ $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) );
$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
}
}
@@ -628,7 +625,7 @@ function upgrade_230() {
if ( empty($tt_id) )
continue;
- $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$post_id', '$tt_id')");
+ $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ( %d, %d)", $post_id, $tt_id) );
}
// < 3570 we used linkcategories. >= 3570 we used categories and link2cat.
@@ -647,20 +644,20 @@ function upgrade_230() {
$term_group = 0;
// Associate terms with the same slug in a term group and make slugs unique.
- if ( $exists = $wpdb->get_results("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = '$slug'") ) {
+ if ( $exists = $wpdb->get_results( $wpdb->prepare("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug) ) ) {
$term_group = $exists[0]->term_group;
$term_id = $exists[0]->term_id;
}
if ( empty($term_id) ) {
- $wpdb->query("INSERT INTO $wpdb->terms (name, slug, term_group) VALUES ('$name', '$slug', '$term_group')");
+ $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->terms (name, slug, term_group) VALUES (%s, %s, %d)", $name, $slug, $term_group) );
$term_id = (int) $wpdb->insert_id;
}
$link_cat_id_map[$cat_id] = $term_id;
$default_link_cat = $term_id;
- $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', 'link_category', '', '0', '0')");
+ $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES (%d, 'link_category', '', '0', '0')", $term_id) );
$tt_ids[$term_id] = (int) $wpdb->insert_id;
}
@@ -676,7 +673,7 @@ function upgrade_230() {
if ( empty($tt_id) )
continue;
- $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$link->link_id', '$tt_id')");
+ $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ( %d, %d)", $link->link_id, $tt_id) );
}
// Set default to the last category we grabbed during the upgrade loop.
@@ -691,7 +688,7 @@ function upgrade_230() {
if ( empty($tt_id) )
continue;
- $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ('$link_id', '$tt_id')");
+ $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ( %d, %d)", $link_id, $tt_id) );
}
}
@@ -704,10 +701,10 @@ function upgrade_230() {
$terms = $wpdb->get_results("SELECT term_taxonomy_id, taxonomy FROM $wpdb->term_taxonomy");
foreach ( (array) $terms as $term ) {
if ( ('post_tag' == $term->taxonomy) || ('category' == $term->taxonomy) )
- $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type = 'post' AND term_taxonomy_id = '$term->term_taxonomy_id'");
+ $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type = 'post' AND term_taxonomy_id = %d", $term->term_taxonomy_id) );
else
- $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = '$term->term_taxonomy_id'");
- $wpdb->query("UPDATE $wpdb->term_taxonomy SET count = '$count' WHERE term_taxonomy_id = '$term->term_taxonomy_id'");
+ $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $term->term_taxonomy_id) );
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_taxonomy_id = %d", $count, $term->term_taxonomy_id) );
}
}
@@ -756,6 +753,10 @@ function upgrade_252() {
$wpdb->query("UPDATE $wpdb->users SET user_activation_key = ''");
}
+function upgrade_260() {
+ populate_roles_260();
+}
+
// The functions we use to actually do stuff
// General
@@ -850,7 +851,7 @@ function __get_option($setting) {
return preg_replace( '|/+$|', '', constant( 'WP_SITEURL' ) );
}
- $option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'");
+ $option = $wpdb->get_var( $wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = %s", $setting) );
if ( 'home' == $setting && '' == $option )
return __get_option('siteurl');
@@ -1100,7 +1101,7 @@ function make_db_current_silent() {
function make_site_theme_from_oldschool($theme_name, $template) {
$home_path = get_home_path();
- $site_dir = ABSPATH . "wp-content/themes/$template";
+ $site_dir = WP_CONTENT_DIR . "/themes/$template";
if (! file_exists("$home_path/index.php"))
return false;
@@ -1119,7 +1120,7 @@ function make_site_theme_from_oldschool($theme_name, $template) {
if ($oldfile == 'index.php') { // Check to make sure it's not a new index
$index = implode('', file("$oldpath/$oldfile"));
if (strpos($index, 'WP_USE_THEMES') !== false) {
- if (! @copy(ABSPATH . 'wp-content/themes/default/index.php', "$site_dir/$newfile"))
+ if (! @copy(WP_CONTENT_DIR . '/themes/default/index.php', "$site_dir/$newfile"))
return false;
continue; // Don't copy anything
}
@@ -1167,8 +1168,8 @@ function make_site_theme_from_oldschool($theme_name, $template) {
}
function make_site_theme_from_default($theme_name, $template) {
- $site_dir = ABSPATH . "wp-content/themes/$template";
- $default_dir = ABSPATH . 'wp-content/themes/default';
+ $site_dir = WP_CONTENT_DIR . "/themes/$template";
+ $default_dir = WP_CONTENT_DIR . '/themes/default';
// Copy files from the default theme to the site theme.
//$files = array('index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css');
@@ -1226,7 +1227,7 @@ function make_site_theme() {
// Name the theme after the blog.
$theme_name = __get_option('blogname');
$template = sanitize_title($theme_name);
- $site_dir = ABSPATH . "wp-content/themes/$template";
+ $site_dir = WP_CONTENT_DIR . "/themes/$template";
// If the theme already exists, nothing to do.
if ( is_dir($site_dir)) {
@@ -1234,7 +1235,7 @@ function make_site_theme() {
}
// We must be able to write to the themes dir.
- if (! is_writable(ABSPATH . "wp-content/themes")) {
+ if (! is_writable(WP_CONTENT_DIR . "/themes")) {
return false;
}
diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php
index d25404f..4c02592 100644
--- a/wp-admin/includes/user.php
+++ b/wp-admin/includes/user.php
@@ -140,12 +140,8 @@ function edit_user( $user_id = 0 ) {
function get_author_user_ids() {
global $wpdb;
- // wpmu site admins don't have user_levels
- $level_key = $wpdb->prefix . 'capabilities';
-
- $query = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$level_key' AND meta_value != '0'";
-
- return $wpdb->get_col( $query );
+ $level_key = $wpdb->prefix . 'capabilities'; // wpmu site admins don't have user_levels
+ return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
}
function get_editable_authors( $user_id ) {
@@ -175,10 +171,9 @@ function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
return false;
}
- // wpmu site admins don't have user_levels
- $level_key = $wpdb->prefix . 'capabilities';
+ $level_key = $wpdb->prefix . 'capabilities'; // wpmu site admins don't have user_levels
- $query = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$level_key'";
+ $query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
if ( $exclude_zeros )
$query .= " AND meta_value != 'a:1:{s:10:\"subscriber\";b:1;}'";
@@ -187,12 +182,9 @@ function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
function get_nonauthor_user_ids() {
global $wpdb;
- // wpmu site admins don't have user_levels
- $level_key = $wpdb->prefix . 'capabilities';
+ $level_key = $wpdb->prefix . 'capabilities'; // wpmu site admins don't have user_levels
- $query = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$level_key' AND meta_value = '0'";
-
- return $wpdb->get_col( $query );
+ return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
}
function get_others_unpublished_posts($user_id, $type='any') {
@@ -211,7 +203,7 @@ function get_others_unpublished_posts($user_id, $type='any') {
$other_unpubs = '';
} else {
$editable = join(',', $editable);
- $other_unpubs = $wpdb->get_results("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != '$user_id' ORDER BY post_modified $dir");
+ $other_unpubs = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != %d ORDER BY post_modified $dir", $user_id) );
}
return apply_filters('get_others_drafts', $other_unpubs);
@@ -244,8 +236,7 @@ function get_user_to_edit( $user_id ) {
function get_users_drafts( $user_id ) {
global $wpdb;
- $user_id = (int) $user_id;
- $query = "SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = $user_id ORDER BY post_modified DESC";
+ $query = $wpdb->prepare("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = %d ORDER BY post_modified DESC", $user_id);
$query = apply_filters('get_users_drafts', $query);
return $wpdb->get_results( $query );
}
@@ -256,7 +247,7 @@ function wp_delete_user($id, $reassign = 'novalue') {
$id = (int) $id;
if ($reassign == 'novalue') {
- $post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_author = $id");
+ $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) );
if ($post_ids) {
foreach ($post_ids as $post_id)
@@ -264,11 +255,11 @@ function wp_delete_user($id, $reassign = 'novalue') {
}
// Clean links
- $wpdb->query("DELETE FROM $wpdb->links WHERE link_owner = $id");
+ $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->links WHERE link_owner = %d", $id) );
} else {
$reassign = (int) $reassign;
- $wpdb->query("UPDATE $wpdb->posts SET post_author = {$reassign} WHERE post_author = {$id}");
- $wpdb->query("UPDATE $wpdb->links SET link_owner = {$reassign} WHERE link_owner = {$id}");
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE post_author = %d", $reassign, $id) );
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_owner = %d WHERE link_owner = %d}", $reassign, $id) );
}
// FINALLY, delete user
@@ -325,7 +316,7 @@ class WP_User_Search {
function prepare_query() {
global $wpdb;
$this->first_user = ($this->page - 1) * $this->users_per_page;
- $this->query_limit = ' LIMIT ' . $this->first_user . ',' . $this->users_per_page;
+ $this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page);
$this->query_sort = ' ORDER BY user_login';
$search_sql = '';
if ( $this->search_term ) {
@@ -339,7 +330,7 @@ class WP_User_Search {
$this->query_from_where = "FROM $wpdb->users";
if ( $this->role )
- $this->query_from_where .= " INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE '%$this->role%'";
+ $this->query_from_where .= $wpdb->prepare(" INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%');
else
$this->query_from_where .= ", $wpdb->usermeta WHERE $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$wpdb->prefix}capabilities'";
$this->query_from_where .= " $search_sql";
diff --git a/wp-admin/includes/widgets.php b/wp-admin/includes/widgets.php
index 09936b7..79a4f1a 100644
--- a/wp-admin/includes/widgets.php
+++ b/wp-admin/includes/widgets.php
@@ -102,7 +102,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
<li id="widget-list-item-<?php echo attribute_escape( $widget['id'] ); ?>" class="widget-list-item">
<h4 class="widget-title widget-draggable">
- <?php echo $widget_title; ?>
+ <span><?php echo $widget_title; ?></span>
<?php if ( 'add' == $action ) : ?>
@@ -116,6 +116,8 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
<?php endif; ?>
+ <br class="clear" />
+
</h4>
@@ -228,7 +230,7 @@ function wp_widget_control( $sidebar_args ) {
echo $sidebar_args['before_widget'];
?>
<div class="widget-top">
- <h4 class="widget-title"><?php echo $widget_title ?>
+ <h4 class="widget-title"><span><?php echo $widget_title ?></span>
<?php if ( $edit ) : ?>
@@ -240,6 +242,8 @@ function wp_widget_control( $sidebar_args ) {
<?php endif; ?>
+ <br class="clear" />
+
</h4></div>
<div class="widget-control"<?php if ( $edit ) echo ' style="display: block;"'; ?>>
@@ -282,10 +286,4 @@ function wp_widget_control_ob_filter( $string ) {
return trim( wp_specialchars( strip_tags( $string ) ) );
}
-function widget_css() {
- wp_admin_css( 'css/widgets' );
-}
-
-add_action( 'admin_head', 'widget_css' );
-
?>
diff --git a/wp-admin/index.php b/wp-admin/index.php
index 15bc950..3a10bcf 100644
--- a/wp-admin/index.php
+++ b/wp-admin/index.php
@@ -26,12 +26,8 @@ jQuery(function($) {
}
add_action( 'admin_head', 'index_js' );
-function index_css() {
- wp_admin_css( 'css/dashboard' );
-}
-add_action( 'admin_head', 'index_css' );
-
wp_enqueue_script( 'jquery' );
+wp_admin_css( 'dashboard' );
$title = __('Dashboard');
$parent_file = 'index.php';
@@ -110,13 +106,12 @@ if ( $can_switch_themes = current_user_can( 'switch_themes' ) )
$widgets_text = "<a href='widgets.php'>$widgets_text</a>";
?>
<p class="youare">
- <?php printf( __( 'You are using %1$s theme with %2$s.' ), $ct->title, $widgets_text ); ?>
+ <?php printf( __( 'You are using the %1$s theme with %2$s.' ), $ct->title, $widgets_text ); ?>
<?php if ( $can_switch_themes ) : ?>
<a href="themes.php" class="rbutton"><?php _e('Change Theme'); ?></a>
<?php endif; ?>
<?php update_right_now_message(); ?>
</p>
-
<?php do_action( 'rightnow_end' ); ?>
<?php do_action( 'activity_box_end' ); ?>
</div><!-- rightnow -->
diff --git a/wp-admin/install-helper.php b/wp-admin/install-helper.php
index d124b1a..8f04418 100644
--- a/wp-admin/install-helper.php
+++ b/wp-admin/install-helper.php
@@ -1,5 +1,6 @@
<?php
-require_once(dirname(dirname(__FILE__)).'/wp-config.php');
+$wp_only_load_config = true;
+require_once(dirname(dirname(__FILE__)).'/wp-load.php');
$debug = 0;
/**
diff --git a/wp-admin/js/forms.js b/wp-admin/js/forms.js
index 6cb2cb7..39ec66b 100644
--- a/wp-admin/js/forms.js
+++ b/wp-admin/js/forms.js
@@ -1,31 +1,26 @@
-function checkAll(form) {
- for (i = 0, n = form.elements.length; i < n; i++) {
- if(form.elements[i].type == "checkbox" && !(form.elements[i].getAttribute('onclick',2))) {
- if(form.elements[i].checked == true)
- form.elements[i].checked = false;
- else
- form.elements[i].checked = true;
- }
- }
+function checkAll(jQ) { // use attr( checked, fn )
+ jQuery(jQ).find( 'tbody :checkbox' ).attr( 'checked', function() {
+ return jQuery(this).attr( 'checked' ) ? '' : 'checked';
+ } );
}
-function getNumChecked(form) {
- var num = 0;
- for (i = 0, n = form.elements.length; i < n; i++) {
- if (form.elements[i].type == "checkbox") {
- if (form.elements[i].checked == true)
- num++;
+jQuery( function($) {
+ var lastClicked = false;
+ $( 'tbody :checkbox' ).click( function(e) {
+ if ( 'undefined' == e.shiftKey ) { return true; }
+ if ( e.shiftKey ) {
+ if ( !lastClicked ) { return true; }
+ var checks = $( lastClicked ).parents( 'form:first' ).find( ':checkbox' );
+ var first = checks.index( lastClicked );
+ var last = checks.index( this );
+ if ( 0 < first && 0 < last && first != last ) {
+ checks.slice( first, last ).attr( 'checked', $( this ).is( ':checked' ) ? 'checked' : '' );
+ }
}
- }
- return num;
-}
-
-function checkAllUsers(role) {
- var checkboxs = document.getElementsByTagName('input');
- for(var i = 0, inp; inp = checkboxs[i]; i++)
- if(inp.type.toLowerCase() == 'checkbox' && inp.className == role)
- if(inp.checked == false)
- inp.checked = true;
- else
- inp.checked = false;
-}
+ lastClicked = this;
+ return true;
+ } );
+ $( 'thead :checkbox' ).click( function() {
+ checkAll( $(this).parents( 'form:first' ) );
+ } );
+} );
diff --git a/wp-admin/js/gallery.js b/wp-admin/js/gallery.js
new file mode 100644
index 0000000..aae0221
--- /dev/null
+++ b/wp-admin/js/gallery.js
@@ -0,0 +1,20 @@
+jQuery(function($) {
+ var gallerySortable;
+ var gallerySortableInit = function() {
+ gallerySortable = $('#media-items').sortable( {
+ items: '.media-item',
+ placeholder: 'sorthelper',
+ update: galleryReorder
+ } );
+ }
+
+ // When an update has occurred, adjust the order for each item
+ var galleryReorder = function(e, sort) {
+ jQuery.each(sort['instance'].toArray(), function(i, id) {
+ jQuery('#' + id + ' .menu_order input')[0].value = i;
+ });
+ }
+
+ // initialize sortable
+ gallerySortableInit();
+});
diff --git a/wp-admin/js/media-upload.js b/wp-admin/js/media-upload.js
index 506faf8..8c88270 100644
--- a/wp-admin/js/media-upload.js
+++ b/wp-admin/js/media-upload.js
@@ -21,7 +21,10 @@ jQuery(function($) {
if ( tbWindow.size() ) {
tbWindow.width( W - 50 ).height( H - 45 );
$('#TB_iframeContent').width( W - 50 ).height( H - 75 );
- tbWindow.css({marginLeft: '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
+ tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
+ if ( ! ( $.browser.msie && $.browser.version.substr(0,1) < 7 ) )
+ tbWindow.css({'top':'20px','margin-top':'0'});
+ $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
};
return $('a.thickbox').each( function() {
@@ -34,6 +37,5 @@ jQuery(function($) {
};
$(window).resize( function() { tb_position() } );
- $(document).ready( function() { tb_position() } );
});
diff --git a/wp-admin/js/post.js b/wp-admin/js/post.js
index 9b3313c..a81fc81 100644
--- a/wp-admin/js/post.js
+++ b/wp-admin/js/post.js
@@ -18,6 +18,8 @@ function new_tag_remove_tag() {
}
function tag_update_quickclicks() {
+ if ( jQuery( '#tags-input' ).length == 0 )
+ return;
var current_tags = jQuery( '#tags-input' ).val().split(',');
jQuery( '#tagchecklist' ).empty();
shown = false;
diff --git a/wp-admin/js/theme-preview.js b/wp-admin/js/theme-preview.js
new file mode 100644
index 0000000..43b01cd
--- /dev/null
+++ b/wp-admin/js/theme-preview.js
@@ -0,0 +1,44 @@
+
+jQuery(function($) {
+ if ( 'undefined' == typeof $.fn.pngFix )
+ $.fn.pngFix = function() { return this; }
+
+ var thickDims = function() {
+ var tbWindow = $('#TB_window');
+ var H = $(window).height();
+ var W = $(window).width();
+
+ if ( tbWindow.size() ) {
+ tbWindow.width( W - 90 ).height( H - 60 );
+ $('#TB_iframeContent').width( W - 90 ).height( H - 90 );
+ tbWindow.css({'margin-left': '-' + parseInt((( W - 90 ) / 2),10) + 'px'});
+ if ( ! ( $.browser.msie && $.browser.version.substr(0,1) < 7 ) )
+ tbWindow.css({'top':'30px','margin-top':'0'});
+ };
+
+ return $('a.thickbox').each( function() {
+ var href = $(this).parents('.available-theme').find('.previewlink').attr('href');
+ if ( ! href ) return;
+ href = href.replace(/&width=[0-9]+/g, '');
+ href = href.replace(/&height=[0-9]+/g, '');
+ $(this).attr( 'href', href + '&width=' + ( W - 110 ) + '&height=' + ( H - 100 ) );
+ });
+ };
+
+ thickDims()
+ .click( function() {
+ var alink = $(this).parents('.available-theme').find('.activatelink');
+ var url = alink.attr('href');
+ var text = alink.html();
+
+ $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
+ $('#TB_closeAjaxWindow').css({'float':'left'});
+ $('#TB_ajaxWindowTitle').css({'float':'right'})
+ .append('&nbsp;<a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>');
+
+ $('#TB_iframeContent').width('100%');
+ return false;
+ } );
+
+ $(window).resize( function() { thickDims() } );
+});
diff --git a/wp-admin/js/word-count.js b/wp-admin/js/word-count.js
new file mode 100644
index 0000000..9e3c1df
--- /dev/null
+++ b/wp-admin/js/word-count.js
@@ -0,0 +1,39 @@
+// Word count
+(function(JQ) {
+ wpWordCount = {
+
+ init : function() {
+ var t = this, last = 0, co = JQ('#content');
+
+ JQ('#wp-word-count').html( wordCountL10n.count.replace( /%d/, '<span id="word-count">0</span>' ) );
+ t.block = 0;
+ t.wc(co.val());
+ co.keyup( function(e) {
+ if ( e.keyCode == last ) return true;
+ if ( 13 == e.keyCode || 8 == last || 46 == last ) t.wc(co.val());
+ last = e.keyCode;
+ return true;
+ });
+ },
+
+ wc : function(tx) {
+ var t = this, w = JQ('#word-count'), tc = 0;
+
+ if ( t.block ) return;
+ t.block = 1;
+
+ setTimeout( function() {
+ if ( tx ) {
+ tx = tx.replace( /<.[^<>]*?>/g, ' ' ).replace( /&nbsp;/gi, ' ' );
+ tx = tx.replace( /[0-9.(),;:!?%#$¿'"_+=\\/-]*/g, '' );
+ tx.replace( /\S\s+/g, function(){tc++;} );
+ }
+ w.html(tc.toString());
+
+ setTimeout( function() { t.block = 0; }, 2000 );
+ }, 1 );
+ }
+ }
+}(jQuery));
+
+jQuery(document).ready( function(){ wpWordCount.init(); } );
diff --git a/wp-admin/js/wp-gears.js b/wp-admin/js/wp-gears.js
new file mode 100644
index 0000000..22b5c00
--- /dev/null
+++ b/wp-admin/js/wp-gears.js
@@ -0,0 +1,83 @@
+
+wpGears = {
+
+ createStore : function() {
+ if ( 'undefined' == typeof google || ! google.gears ) return;
+
+ if ( 'undefined' == typeof localServer )
+ localServer = google.gears.factory.create("beta.localserver");
+
+ store = localServer.createManagedStore(this.storeName());
+ store.manifestUrl = "gears-manifest.php";
+ store.checkForUpdate();
+ this.message();
+ },
+
+ getPermission : function() {
+ if ( 'undefined' != typeof google && google.gears ) {
+ if ( ! google.gears.factory.hasPermission )
+ google.gears.factory.getPermission( 'WordPress', 'images/logo.gif' );
+
+ try {
+ this.createStore();
+ } catch(e) {} // silence if canceled
+ }
+ },
+
+ storeName : function() {
+ var name = window.location.protocol + window.location.host;
+
+ name = name.replace(/[\/\\:*"?<>|;,]+/g, '_'); // gears beta doesn't allow certain chars in the store name
+ name = 'wp_' + name.substring(0, 60); // max length of name is 64 chars
+
+ return name;
+ },
+
+ message : function(show) {
+ var t = this, msg1 = t.I('gears-msg1'), msg2 = t.I('gears-msg2'), msg3 = t.I('gears-msg3'), num = t.I('gears-upd-number'), wait = t.I('gears-wait');
+
+ if ( ! msg1 ) return;
+
+ if ( 'undefined' != typeof google && google.gears ) {
+ if ( google.gears.factory.hasPermission ) {
+ msg1.style.display = msg2.style.display = 'none';
+ msg3.style.display = 'block';
+
+ if ( 'undefined' == typeof store )
+ t.createStore();
+
+ store.oncomplete = function(){wait.innerHTML = (' ' + wpGearsL10n.updateCompleted);};
+ store.onerror = function(){wait.innerHTML = (' ' + wpGearsL10n.error + ' ' + store.lastErrorMessage);};
+ store.onprogress = function(e){if(num) num.innerHTML = (' ' + e.filesComplete + ' / ' + e.filesTotal);};
+ } else {
+ msg1.style.display = msg3.style.display = 'none';
+ msg2.style.display = 'block';
+ }
+ }
+
+ if ( show ) t.I('gears-info-box').style.display = 'block';
+ },
+
+ I : function(id) {
+ return document.getElementById(id);
+ }
+}
+
+function gearsInit() {
+ if ( 'undefined' != typeof google && google.gears ) return;
+
+ var gf = false;
+ if ( 'undefined' != typeof GearsFactory ) { // Firefox
+ gf = new GearsFactory();
+ } else { // IE
+ try {
+ gf = new ActiveXObject('Gears.Factory');
+ } catch (e) {}
+ }
+
+ if ( ! gf ) return;
+ if ( 'undefined' == typeof google ) google = {};
+ if ( ! google.gears ) google.gears = { factory : gf };
+}
+
+gearsInit();
diff --git a/wp-admin/link-add.php b/wp-admin/link-add.php
index 20e60fd..c99fe4e 100644
--- a/wp-admin/link-add.php
+++ b/wp-admin/link-add.php
@@ -13,7 +13,6 @@ wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image',
wp_enqueue_script('link');
wp_enqueue_script('xfn');
-wp_enqueue_script('thickbox');
require('admin-header.php');
?>
diff --git a/wp-admin/link-import.php b/wp-admin/link-import.php
index 741a4dd..cefca95 100644
--- a/wp-admin/link-import.php
+++ b/wp-admin/link-import.php
@@ -30,19 +30,19 @@ switch ($step) {
<input type="hidden" name="step" value="1" />
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
<div style="width: 48%;" class="alignleft">
-<h3><?php _e('Specify an OPML URL:'); ?></h3>
-<input type="text" name="opml_url" size="50" style="width: 90%;" value="http://" />
+<h3><label for="opml_url"><?php _e('Specify an OPML URL:'); ?></label></h3>
+<input type="text" name="opml_url" id="opml_url" size="50" style="width: 90%;" value="http://" />
</div>
<div style="width: 48%;" class="alignleft">
-<h3><?php _e('Or choose from your local disk:'); ?></h3>
+<h3><label for="userfile"><?php _e('Or choose from your local disk:'); ?></label></h3>
<input id="userfile" name="userfile" type="file" size="30" />
</div>
</div>
-<p style="clear: both; margin-top: 1em;"><?php _e('Now select a category you want to put these links in.') ?><br />
-<?php _e('Category:') ?> <select name="cat_id">
+<p style="clear: both; margin-top: 1em;"><label for="cat_id"><?php _e('Now select a category you want to put these links in.') ?></label><br />
+<?php _e('Category:') ?> <select name="cat_id" id="cat_id">
<?php
$categories = get_terms('link_category', 'get=all');
foreach ($categories as $category) {
diff --git a/wp-admin/link-manager.php b/wp-admin/link-manager.php
index 42ec201..48f59f2 100644
--- a/wp-admin/link-manager.php
+++ b/wp-admin/link-manager.php
@@ -78,6 +78,7 @@ if ( isset($_GET['deleted']) ) {
<h2><?php printf( __( 'Manage Links (<a href="%s">add new</a>)' ), 'link-add.php' ); ?></h2>
<p id="post-search">
+ <label class="hidden" for="post-search-input"><?php _e( 'Search Links' ); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
<input type="submit" value="<?php _e( 'Search Links' ); ?>" class="button" />
</p>
@@ -141,7 +142,7 @@ if ( $links ) {
<table class="widefat">
<thead>
<tr>
- <th scope="col" class="check-column"><input type="checkbox" onclick="checkAll(document.getElementById('posts-filter'));" /></th>
+ <th scope="col" class="check-column"><input type="checkbox" /></th>
<?php foreach($link_columns as $column_display_name) {
echo $column_display_name;
} ?>
diff --git a/wp-admin/link-parse-opml.php b/wp-admin/link-parse-opml.php
index 0e5edf0..1cd27d0 100644
--- a/wp-admin/link-parse-opml.php
+++ b/wp-admin/link-parse-opml.php
@@ -1,5 +1,5 @@
<?php
-require_once('../wp-config.php');
+require_once('../wp-load.php');
// columns we wish to find are: link_url, link_name, link_target, link_description
// we need to map XML attribute names to our columns
diff --git a/wp-admin/link.php b/wp-admin/link.php
index 8766a71..eda242b 100644
--- a/wp-admin/link.php
+++ b/wp-admin/link.php
@@ -85,7 +85,6 @@ switch ($action) {
case 'edit' :
wp_enqueue_script('link');
wp_enqueue_script('xfn');
- wp_enqueue_script('thickbox');
$parent_file = 'edit.php';
$submenu_file = 'link-manager.php';
diff --git a/wp-admin/media.php b/wp-admin/media.php
index 03b3749..150dea7 100644
--- a/wp-admin/media.php
+++ b/wp-admin/media.php
@@ -17,6 +17,12 @@ case 'editattachment' :
$errors = media_upload_form_handler();
+
+ check_admin_referer('media-form');
+
+ if ( !current_user_can('edit_post', $attachment_id) )
+ wp_die ( __('You are not allowed to edit this attachment.') );
+
if ( empty($errors) ) {
$location = 'media.php';
if ( $referer = wp_get_original_referer() ) {
@@ -54,7 +60,8 @@ case 'edit' :
add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2);
wp_enqueue_script( 'wp-ajax-response' );
- add_action('admin_head', 'media_admin_css');
+ wp_admin_css( 'media' );
+
require( 'admin-header.php' );
diff --git a/wp-admin/menu-header.php b/wp-admin/menu-header.php
index 4c0ca13..8179fef 100644
--- a/wp-admin/menu-header.php
+++ b/wp-admin/menu-header.php
@@ -3,6 +3,8 @@ $self = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
$self = preg_replace('|^.*/plugins/|i', '', $self);
$self = preg_replace('|^.*/mu-plugins/|i', '', $self);
+global $menu, $submenu, $parent_file; //For when admin-header is included from within a function.
+
get_admin_page_parent();
// We're going to do this loop three times
diff --git a/wp-admin/moderation.php b/wp-admin/moderation.php
index 6750ac3..46cda95 100644
--- a/wp-admin/moderation.php
+++ b/wp-admin/moderation.php
@@ -1,4 +1,4 @@
<?php
-require_once('../wp-config.php');
+require_once('../wp-load.php');
wp_redirect('edit-comments.php?comment_status=moderated');
?>
diff --git a/wp-admin/options-discussion.php b/wp-admin/options-discussion.php
index 09f380e..ce524f6 100644
--- a/wp-admin/options-discussion.php
+++ b/wp-admin/options-discussion.php
@@ -15,7 +15,7 @@ include('admin-header.php');
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Default article settings') ?></th>
-<td>
+<td><fieldset><legend class="hidden"><?php _e('Default article settings') ?></legend>
<label for="default_pingback_flag">
<input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked('1', get_option('default_pingback_flag')); ?> />
<?php _e('Attempt to notify any blogs linked to from the article (slows down posting.)') ?></label>
@@ -29,11 +29,11 @@ include('admin-header.php');
<?php _e('Allow people to post comments on the article') ?></label>
<br />
<small><em><?php echo '(' . __('These settings may be overridden for individual articles.') . ')'; ?></em></small>
-</td>
+</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('E-mail me whenever') ?></th>
-<td>
+<td><fieldset><legend class="hidden"><?php _e('E-mail me whenever') ?></legend>
<label for="comments_notify">
<input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked('1', get_option('comments_notify')); ?> />
<?php _e('Anyone posts a comment') ?> </label>
@@ -41,11 +41,11 @@ include('admin-header.php');
<label for="moderation_notify">
<input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked('1', get_option('moderation_notify')); ?> />
<?php _e('A comment is held for moderation') ?> </label>
-</td>
+</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Before a comment appears') ?></th>
-<td>
+<td><fieldset><legend class="hidden"><?php _e('Before a comment appears') ?></legend>
<label for="comment_moderation">
<input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_option('comment_moderation')); ?> />
<?php _e('An administrator must always approve the comment') ?> </label>
@@ -53,62 +53,98 @@ include('admin-header.php');
<label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked('1', get_option('require_name_email')); ?> /> <?php _e('Comment author must fill out name and e-mail') ?></label>
<br />
<label for="comment_whitelist"><input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php checked('1', get_option('comment_whitelist')); ?> /> <?php _e('Comment author must have a previously approved comment') ?></label>
-</td>
+</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Comment Moderation') ?></th>
-<td>
-<p><?php printf(__('Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="text" id="comment_max_links" size="3" value="' . get_option('comment_max_links'). '" />' ) ?></p>
+<td><fieldset><legend class="hidden"><?php _e('Comment Moderation') ?></legend>
+<p><label for="comment_max_links"><?php printf(__('Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="text" id="comment_max_links" size="3" value="' . get_option('comment_max_links'). '" />' ) ?></label></p>
-<p><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be held in the <a href="edit-comments.php?comment_status=moderated">moderation queue</a>. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?></p>
+<p><label for="moderation_keys"><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be held in the <a href="edit-comments.php?comment_status=moderated">moderation queue</a>. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?></label></p>
<p>
<textarea name="moderation_keys" cols="60" rows="10" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('moderation_keys'); ?></textarea>
</p>
-</td>
+</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Comment Blacklist') ?></th>
-<td>
-<p><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be marked as spam. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?></p>
+<td><fieldset><legend class="hidden"><?php _e('Comment Blacklist') ?></legend>
+<p><label for="blacklist_keys"><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be marked as spam. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?></label></p>
<p>
<textarea name="blacklist_keys" cols="60" rows="10" id="blacklist_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('blacklist_keys'); ?></textarea>
</p>
-</td>
+</fieldset></td>
</tr>
</table>
<h3><?php _e('Avatars') ?></h3>
-<p><?php _e('By default WordPress uses <a href="http://gravatar.com/">Gravatars</a> &#8212; short for Globally Recognized Avatars &#8212; for the pictures that show up next to comments. Plugins may override this.'); ?></p>
+<p><?php _e('An avatar is an image that follows you from weblog to weblog appearing beside your name when you comment on avatar enabled sites. Here you can enable the display of avatars for people who comment on your blog.'); ?></p>
<?php // the above would be a good place to link to codex documentation on the gravatar functions, for putting it in themes. anything like that? ?>
<table class="form-table">
<tr valign="top">
-<th scope="row"><?php _e('Avatar display') ?></th>
-<td>
+<th scope="row"><?php _e('Avatar Display') ?></th>
+<td><fieldset><legend class="hidden"><?php _e('Avatar display') ?></legend>
<?php
$yesorno = array(0 => __("Don&#8217;t show Avatars"), 1 => __('Show Avatars'));
foreach ( $yesorno as $key => $value) {
$selected = (get_option('show_avatars') == $key) ? 'checked="checked"' : '';
- echo "\n\t<label><input type='radio' name='show_avatars' value='$key' $selected> $value</label><br />";
+ echo "\n\t<label><input type='radio' name='show_avatars' value='$key' $selected/> $value</label><br />";
}
?>
-</td>
+</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Maximum Rating') ?></th>
-<td>
+<td><fieldset><legend class="hidden"><?php _e('Maximum Rating') ?></legend>
<?php
$ratings = array( 'G' => __('G &#8212; Suitable for all audiences'), 'PG' => __('PG &#8212; Possibly offensive, usually for audiences 13 and above'), 'R' => __('R &#8212; Intended for adult audiences above 17'), 'X' => __('X &#8212; Even more mature than above'));
foreach ($ratings as $key => $rating) :
$selected = (get_option('avatar_rating') == $key) ? 'checked="checked"' : '';
- echo "\n\t<label><input type='radio' name='avatar_rating' value='$key' $selected> $rating</label><br />";
+ echo "\n\t<label><input type='radio' name='avatar_rating' value='$key' $selected/> $rating</label><br />";
endforeach;
?>
-</td>
+</fieldset></td>
+</tr>
+<tr valign="top">
+<th scope="row"><?php _e('Default Avatar') ?></th>
+<td class="defaultavatarpicker"><fieldset><legend class="hidden"><?php _e('Default Avatar') ?></legend>
+
+<?php _e('For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their e-mail address.'); ?><br />
+
+<?php
+$avatar_defaults = array(
+ 'mystery' => __('Mystery Man'),
+ 'blank' => __('Blank'),
+ 'gravatar_default' => __('Gravatar Logo'),
+ 'identicon' => __('Identicon (Generated)'),
+ 'wavatar' => __('Wavatar (Generated)'),
+ 'monsterid' => __('MonsterID (Generated)')
+);
+$avatar_defaults = apply_filters('avatar_defaults', $avatar_defaults);
+$default = get_option('avatar_default');
+if ( empty($default) )
+ $default = 'mystery';
+$size = 32;
+$avatar_list = '';
+foreach ( $avatar_defaults as $default_key => $default_name ) {
+ $selected = ($default == $default_key) ? 'checked="checked" ' : '';
+ $avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='{$default_key}' {$selected}/> ";
+
+ $avatar = get_avatar( $user_email, $size, $default_key );
+ $avatar_list .= preg_replace("/src='(.+?)'/", "src='\$1&amp;forcedefault=1'", $avatar);
+
+ $avatar_list .= ' ' . $default_name . '</label>';
+ $avatar_list .= '<br />';
+}
+echo apply_filters('default_avatar_select', $avatar_list);
+?>
+
+</fieldset></td>
</tr>
</table>
diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php
index 8fdf3ef..d37bcee 100644
--- a/wp-admin/options-general.php
+++ b/wp-admin/options-general.php
@@ -14,33 +14,35 @@ include('./admin-header.php');
<input type='hidden' name='option_page' value='general' />
<table class="form-table">
<tr valign="top">
-<th scope="row"><?php _e('Blog Title') ?></th>
+<th scope="row"><label for="blogname"><?php _e('Blog Title') ?></label></th>
<td><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" size="40" /></td>
</tr>
<tr valign="top">
-<th scope="row"><?php _e('Tagline') ?></th>
+<th scope="row"><label for="blogdescription"><?php _e('Tagline') ?></label></th>
<td><input name="blogdescription" type="text" id="blogdescription" style="width: 95%" value="<?php form_option('blogdescription'); ?>" size="45" />
<br />
<?php _e('In a few words, explain what this blog is about.') ?></td>
</tr>
<tr valign="top">
-<th scope="row"><?php _e('E-mail address') ?> </th>
-<td><input name="new_admin_email" type="text" id="new_admin_email" value="<?php form_option('admin_email'); ?>" size="40" class="code" />
+<tr valign="top">
+<th scope="row"><label for="admin_email"><?php _e('E-mail address') ?> </label></th>
+<td><input name="admin_email" type="text" id="admin_email" value="<?php form_option('admin_email'); ?>" size="40" class="code" />
<br />
-<?php _e('This address is used only for admin purposes.') ?> <?php _e('If you change this we will send you an email at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>') ?></td>
+<?php _e('This address is used for admin purposes.') ?> <?php _e('If you change this we will send you an email at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>') ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Membership') ?></th>
-<td> <label for="comment_registration">
-<input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_option('comment_registration')); ?> />
+<td>
+<label for="comment_registration">
+<input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_option('comment_registration')); ?> />
<?php _e('Users must be registered and logged in to comment') ?>
</label>
</td>
</tr>
<tr>
-<th scope="row"><?php _e('Timezone') ?> </th>
+<th scope="row"><label for="gmt_offset"><?php _e('Timezone') ?> </label></th>
<td>
-<select name="gmt_offset">
+<select name="gmt_offset" id="gmt_offset">
<?php
$current_offset = get_option('gmt_offset');
$offset_range = array (-12, -11.5, -11, -10.5, -10, -9.5, -9, -8.5, -8, -7.5, -7, -6.5, -6, -5.5, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.5, -1, -0.5,
@@ -66,22 +68,23 @@ foreach ( $offset_range as $offset ) {
</select>
<?php _e('hours') ?><br />
<?php printf(__('<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>'), gmdate(__('Y-m-d G:i:s'))); ?><br />
-<?php if ($current_offset) printf(__('UTC %1$s is <code>%2$s</code>'), $current_offset_name, gmdate(__('Y-m-d G:i:s'), current_time('timestamp'))); ?>
+<?php if ($current_offset) printf(__('UTC %1$s is <code>%2$s</code>'), $current_offset_name, gmdate(__('Y-m-d G:i:s'), current_time('timestamp'))); ?><br />
+<?php _e('Unfortunately, you have to manually update this for Daylight Savings Time.'); ?>
</td>
</tr>
<tr>
-<th scope="row"><?php _e('Date Format') ?></th>
+<th scope="row"><label for="date_format"><?php _e('Date Format') ?></label></th>
<td><input name="date_format" type="text" id="date_format" size="30" value="<?php form_option('date_format'); ?>" /><br />
<?php _e('Output:') ?> <strong><?php echo mysql2date(get_option('date_format'), current_time('mysql')); ?></strong></td>
</tr>
<tr>
-<th scope="row"><?php _e('Time Format') ?></th>
+<th scope="row"><label for="time_format"><?php _e('Time Format') ?></label></th>
<td><input name="time_format" type="text" id="time_format" size="30" value="<?php form_option('time_format'); ?>" /><br />
<?php _e('Output:') ?> <strong><?php echo gmdate(get_option('time_format'), current_time('timestamp')); ?></strong><br />
<?php _e('<a href="http://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date formatting</a>. Click "Save Changes" to update sample output.') ?></td>
</tr>
<tr>
-<th scope="row"><?php _e('Week Starts On') ?></th>
+<th scope="row"><label for="start_of_week"><?php _e('Week Starts On') ?></label></th>
<td><select name="start_of_week" id="start_of_week">
<?php
for ($day_index = 0; $day_index <= 6; $day_index++) :
diff --git a/wp-admin/options-misc.php b/wp-admin/options-misc.php
index 711e61e..7afd299 100644
--- a/wp-admin/options-misc.php
+++ b/wp-admin/options-misc.php
@@ -20,23 +20,23 @@ include('admin-header.php');
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Thumbnail size') ?></th>
-<td>
+<td><fieldset><legend class="hidden"><?php _e('Thumbnail size') ?></legend>
<label for="thumbnail_size_w"><?php _e('Width'); ?></label>
<input name="thumbnail_size_w" type="text" id="thumbnail_size_w" value="<?php form_option('thumbnail_size_w'); ?>" size="6" />
<label for="thumbnail_size_h"><?php _e('Height'); ?></label>
<input name="thumbnail_size_h" type="text" id="thumbnail_size_h" value="<?php form_option('thumbnail_size_h'); ?>" size="6" /><br />
<input name="thumbnail_crop" type="checkbox" id="thumbnail_crop" value="1" <?php checked('1', get_option('thumbnail_crop')); ?>/>
<label for="thumbnail_crop"><?php _e('Crop thumbnail to exact dimensions (normally thumbnails are proportional)'); ?></label>
-</td>
+</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Medium size') ?></th>
-<td>
+<td><fieldset><legend class="hidden"><?php _e('Medium size') ?></legend>
<label for="medium_size_w"><?php _e('Max Width'); ?></label>
<input name="medium_size_w" type="text" id="medium_size_w" value="<?php form_option('medium_size_w'); ?>" size="6" />
<label for="medium_size_h"><?php _e('Max Height'); ?></label>
<input name="medium_size_h" type="text" id="medium_size_h" value="<?php form_option('medium_size_h'); ?>" size="6" />
-</td>
+</fieldset></td>
</tr>
</table>
diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php
index 5b4b6b2..06ad149 100644
--- a/wp-admin/options-permalink.php
+++ b/wp-admin/options-permalink.php
@@ -180,11 +180,11 @@ $structures = array(
<table class="form-table">
<tr>
- <th><?php _e('Category base'); ?></th>
- <td><?php if( constant( 'VHOST' ) == 'no' && $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) { echo "/blog"; $category_base = str_replace( "/blog", "", $category_base ); }?> <input name="category_base" type="text" class="code" value="<?php echo attribute_escape( $category_base ); ?>" size="30" /></td>
+ <th><label for="category_base"><?php _e('Category base'); ?></label></th>
+ <td><?php if( constant( 'VHOST' ) == 'no' && $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) { echo "/blog"; $category_base = str_replace( "/blog", "", $category_base ); }?> <input name="category_base" id='category_base' type="text" class="code" value="<?php echo attribute_escape( $category_base ); ?>" size="30" /></td>
</tr>
<tr>
- <th><?php _e('Tag base'); ?></th>
+ <th><label for="tag_base"><?php _e('Tag base'); ?></label></th>
<td><?php if( constant( 'VHOST' ) == 'no' && $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) { echo "/blog"; $tag_base = str_replace( "/blog", "", $tag_base ); }?> <input name="tag_base" id="tag_base" type="text" class="code" value="<?php echo attribute_escape($tag_base); ?>" size="30" /></td>
</tr>
</table>
diff --git a/wp-admin/options-privacy.php b/wp-admin/options-privacy.php
index c3f68dc..6cd927d 100644
--- a/wp-admin/options-privacy.php
+++ b/wp-admin/options-privacy.php
@@ -18,13 +18,13 @@ if( trim( get_option('blog_public') ) == '' )
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Blog Visibility') ?> </th>
-<td>
+<td><fieldset><legend class="hidden"><?php _e('Blog Visibility') ?> </legend>
<p><input id="blog-public" type="radio" name="blog_public" value="1" <?php checked('1', get_option('blog_public')); ?> />
<label for="blog-public"><?php _e('I would like my blog to be visible to everyone, including search engines (like Google, Sphere, Technorati) and archivers and in public listings around this site.') ?></label></p>
<p><input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> />
<label for="blog-norobots"><?php _e('I would like to block search engines, but allow normal visitors'); ?></label></p>
<?php do_action('blog_privacy_selector'); ?>
-</td>
+</fieldset></td>
</tr>
</table>
diff --git a/wp-admin/options-reading.php b/wp-admin/options-reading.php
index 147841a..18181ff 100644
--- a/wp-admin/options-reading.php
+++ b/wp-admin/options-reading.php
@@ -16,7 +16,7 @@ include('admin-header.php');
<?php if ( get_pages() ): ?>
<tr valign="top">
<th scope="row"><?php _e('Front page displays')?></th>
-<td>
+<td><fieldset><legend class="hidden"><?php _e('Front page displays')?></legend>
<p><label>
<input name="show_on_front" type="radio" value="posts" class="tog" <?php checked('posts', get_option('show_on_front')); ?> />
<?php _e('Your latest posts'); ?>
@@ -28,8 +28,8 @@ include('admin-header.php');
</label>
</p>
<ul>
- <li><?php printf(__('Front page: %s'), wp_dropdown_pages("name=page_on_front&echo=0&show_option_none=".__('- Select -')."&selected=" . get_option('page_on_front'))); ?></li>
- <li><?php printf(__('Posts page: %s'), wp_dropdown_pages("name=page_for_posts&echo=0&show_option_none=".__('- Select -')."&selected=" . get_option('page_for_posts'))); ?></li>
+ <li><?php printf("<label for='page_on_front'>".__('Front page: %s')."</label>", wp_dropdown_pages("name=page_on_front&echo=0&show_option_none=".__('- Select -')."&selected=" . get_option('page_on_front'))); ?></li>
+ <li><?php printf("<label for='page_for_posts'>".__('Posts page: %s')."</label>", wp_dropdown_pages("name=page_for_posts&echo=0&show_option_none=".__('- Select -')."&selected=" . get_option('page_for_posts'))); ?></li>
</ul>
<?php if ( 'page' == get_option('show_on_front') && get_option('page_for_posts') == get_option('page_on_front') ) : ?>
<div id="front-page-warning" class="updated fade-ff0000">
@@ -38,29 +38,29 @@ include('admin-header.php');
</p>
</div>
<?php endif; ?>
-</td>
+</fieldset></td>
</tr>
<?php endif; ?>
<tr valign="top">
-<th scope="row"><?php _e('Blog pages show at most') ?></th>
+<th scope="row"><label for="posts_per_page"><?php _e('Blog pages show at most') ?></label></th>
<td>
<input name="posts_per_page" type="text" id="posts_per_page" value="<?php form_option('posts_per_page'); ?>" size="3" /> <?php _e('posts') ?>
</td>
</tr>
<tr valign="top">
-<th scope="row"><?php _e('Syndication feeds show the most recent') ?></th>
+<th scope="row"><label for="posts_per_rss"><?php _e('Syndication feeds show the most recent') ?></label></th>
<td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php form_option('posts_per_rss'); ?>" size="3" /> <?php _e('posts') ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('For each article in a feed, show') ?> </th>
-<td>
+<td><fieldset><legend class="hidden"><?php _e('For each article in a feed, show') ?> </legend>
<p><label><input name="rss_use_excerpt" type="radio" value="0" <?php checked(0, get_option('rss_use_excerpt')); ?> /> <?php _e('Full text') ?></label><br />
<label><input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_option('rss_use_excerpt')); ?> /> <?php _e('Summary') ?></label></p>
-</td>
+</fieldset></td>
</tr>
<tr valign="top">
-<th scope="row"><?php _e('Encoding for pages and feeds') ?></th>
+<th scope="row"><label for="blog_charset"><?php _e('Encoding for pages and feeds') ?></label></th>
<td><input name="blog_charset" type="text" id="blog_charset" value="<?php form_option('blog_charset'); ?>" size="20" class="code" /><br />
<?php _e('The character encoding you write your blog in (UTF-8 is <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td>
</tr>
diff --git a/wp-admin/options-writing.php b/wp-admin/options-writing.php
index 5734415..83c2d6f 100644
--- a/wp-admin/options-writing.php
+++ b/wp-admin/options-writing.php
@@ -14,21 +14,21 @@ include('admin-header.php');
<input type='hidden' name='option_page' value='writing' />
<table class="form-table">
<tr valign="top">
-<th scope="row"> <?php _e('Size of the post box') ?></th>
+<th scope="row"><label for="default_post_edit_rows"> <?php _e('Size of the post box') ?></label></th>
<td><input name="default_post_edit_rows" type="text" id="default_post_edit_rows" value="<?php form_option('default_post_edit_rows'); ?>" size="2" style="width: 1.5em;" />
<?php _e('lines') ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Formatting') ?></th>
-<td>
+<td><fieldset><legend class="hidden"><?php _e('Formatting') ?></legend>
<label for="use_smilies">
<input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked('1', get_option('use_smilies')); ?> />
<?php _e('Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display') ?></label><br />
<label for="use_balanceTags"><input name="use_balanceTags" type="checkbox" id="use_balanceTags" value="1" <?php checked('1', get_option('use_balanceTags')); ?> /> <?php _e('WordPress should correct invalidly nested XHTML automatically') ?></label>
-</td>
+</fieldset></td>
</tr>
<tr valign="top">
-<th scope="row"><?php _e('Default Post Category') ?></th>
+<th scope="row"><label for="default_category"><?php _e('Default Post Category') ?></label></th>
<td><select name="default_category" id="default_category">
<?php
$categories = get_categories('get=all');
@@ -42,7 +42,7 @@ endforeach;
</select></td>
</tr>
<tr valign="top">
-<th scope="row"><?php _e('Default Link Category') ?></th>
+<th scope="row"><label for="default_link_category"><?php _e('Default Link Category') ?></label></th>
<td><select name="default_link_category" id="default_link_category">
<?php
$link_categories = get_terms('link_category', 'get=all');
diff --git a/wp-admin/page-new.php b/wp-admin/page-new.php
index f09d657..f324c3d 100644
--- a/wp-admin/page-new.php
+++ b/wp-admin/page-new.php
@@ -7,8 +7,9 @@ wp_enqueue_script('autosave');
wp_enqueue_script('page');
if ( user_can_richedit() )
wp_enqueue_script('editor');
-wp_enqueue_script('thickbox');
+add_thickbox();
wp_enqueue_script('media-upload');
+wp_enqueue_script('word-count');
require_once('admin-header.php');
?>
diff --git a/wp-admin/page.php b/wp-admin/page.php
index a314e5d..7e030d1 100644
--- a/wp-admin/page.php
+++ b/wp-admin/page.php
@@ -74,16 +74,17 @@ case 'edit':
if ( empty($post->ID) ) wp_die( __("You attempted to edit a page that doesn't exist. Perhaps it was deleted?") );
- if ( 'post' == $post->post_type ) {
- wp_redirect("post.php?action=edit&post=$post_ID");
+ if ( 'page' != $post->post_type ) {
+ wp_redirect( get_edit_post_link( $post_ID, 'url' ) );
exit();
}
wp_enqueue_script('page');
if ( user_can_richedit() )
wp_enqueue_script('editor');
- wp_enqueue_script('thickbox');
+ add_thickbox();
wp_enqueue_script('media-upload');
+ wp_enqueue_script('word-count');
if ( current_user_can('edit_page', $page_ID) ) {
if ( $last = wp_check_post_lock( $post->ID ) ) {
@@ -149,8 +150,8 @@ case 'delete':
}
$sendback = wp_get_referer();
- if (strpos($sendback, 'page.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/page.php';
- elseif (strpos($sendback, 'attachments.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/attachments.php';
+ if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page.php');
+ elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
$sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);
wp_redirect($sendback);
exit();
diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php
index f84daa1..dec6569 100644
--- a/wp-admin/plugin-editor.php
+++ b/wp-admin/plugin-editor.php
@@ -7,10 +7,7 @@ $parent_file = 'plugins.php';
wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file'));
-add_action( 'admin_head', 'theme_editor_css' );
-function theme_editor_css(){
- wp_admin_css( 'css/theme-editor' );
-}
+wp_admin_css( 'theme-editor' );
$plugins = get_plugins();
$plugin_files = array_keys($plugins);
@@ -19,7 +16,7 @@ if (empty($file))
$file = $plugin_files[0];
$file = validate_file_to_edit($file, $plugin_files);
-$real_file = get_real_file_to_edit( PLUGINDIR . "/$file");
+$real_file = WP_PLUGIN_DIR . '/' . $file;
switch($action) {
@@ -72,7 +69,7 @@ default:
require_once('admin-header.php');
- update_recently_edited(PLUGINDIR . "/$file");
+ update_recently_edited(WP_PLUGIN_DIR . '/' . $file);
if ( ! is_file($real_file) )
$error = 1;
diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php
index 8e6b707..2353275 100644
--- a/wp-admin/plugins.php
+++ b/wp-admin/plugins.php
@@ -8,41 +8,98 @@ if( is_array( $menu_perms ) == false )
if( $menu_perms[ 'plugins' ] != 1 )
return;
-if ( isset($_GET['action']) ) {
- if ( isset($_GET['plugin']) )
- $plugin = trim($_GET['plugin']);
-
- if ( 'activate' == $_GET['action'] ) {
- check_admin_referer('activate-plugin_' . $_GET['plugin']);
- $result = activate_plugin($_GET['plugin'], 'plugins.php?error=true&plugin=' . $plugin);
- if ( is_wp_error( $result ) )
- wp_die( $result->get_error_message() );
- wp_redirect('plugins.php?activate=true'); // overrides the ?error=true one above
- } elseif ( 'error_scrape' == $_GET['action'] ) {
- check_admin_referer('plugin-activation-error_' . $plugin);
- $valid = validate_plugin($plugin);
- if ( is_wp_error($valid) )
- wp_die($valid);
- error_reporting( E_ALL ^ E_NOTICE );
- @ini_set('display_errors', true); //Ensure that Fatal errors are displayed.
- include(ABSPATH . PLUGINDIR . '/' . $plugin);
- } elseif ( 'deactivate' == $_GET['action'] ) {
- check_admin_referer('deactivate-plugin_' . $_GET['plugin']);
- deactivate_plugins($_GET['plugin']);
- wp_redirect('plugins.php?deactivate=true');
- } elseif ( 'deactivate-all' == $_GET['action'] ) {
- check_admin_referer('deactivate-all');
- deactivate_all_plugins();
- wp_redirect('plugins.php?deactivate-all=true');
- } elseif ('reactivate-all' == $_GET['action']) {
- check_admin_referer('reactivate-all');
- reactivate_all_plugins('plugins.php?errors=true');
- wp_redirect('plugins.php?reactivate-all=true'); // overrides the ?error=true one above
+$action = '';
+foreach( array('activate-selected', 'deactivate-selected', 'delete-selected') as $action_key ) {
+ if( isset($_POST[$action_key]) ) {
+ $action = $action_key;
+ break;
}
+}
+
+if( isset($_GET['action']) )
+ $action = $_GET['action'];
+
+$plugin = $_REQUEST['plugin'];
+
+if( !empty($action) ) {
+ switch( $action ) {
+ case 'activate':
+ check_admin_referer('activate-plugin_' . $plugin);
+ $result = activate_plugin($plugin, 'plugins.php?error=true&plugin=' . $plugin);
+ if ( is_wp_error( $result ) )
+ wp_die( $result->get_error_message() );
+ $recent = (array)get_option('recently_activated');
+ if( isset($recent[ $plugin ]) ){
+ unset($recent[ $plugin ]);
+ update_option('recently_activated', $recent);
+ }
+ wp_redirect('plugins.php?activate=true'); // overrides the ?error=true one above
+ exit;
+ break;
+ case 'activate-selected':
+ check_admin_referer('mass-manage-plugins');
+ activate_plugins($_POST['checked'], 'plugins.php?error=true');
+
+ $recent = (array)get_option('recently_activated');
+ foreach( (array)$_POST['checked'] as $plugin => $time) {
+ if( isset($recent[ $plugin ]) )
+ unset($recent[ $plugin ]);
+ }
+ if( $recent != get_option('recently_activated') ) //If array changed, update it.
+ update_option('recently_activated', $recent);
+
+ wp_redirect('plugins.php?activate-multi=true');
+ exit;
+ break;
+ case 'error_scrape':
+ check_admin_referer('plugin-activation-error_' . $plugin);
+ $valid = validate_plugin($plugin);
+ if ( is_wp_error($valid) )
+ wp_die($valid);
+ error_reporting( E_ALL ^ E_NOTICE );
+ @ini_set('display_errors', true); //Ensure that Fatal errors are displayed.
+ include(WP_PLUGIN_DIR . '/' . $plugin);
+ exit;
+ break;
+ case 'deactivate':
+ check_admin_referer('deactivate-plugin_' . $plugin);
+ deactivate_plugins($plugin);
+ update_option('recently_activated', array($plugin => time()) + (array)get_option('recently_activated'));
+ wp_redirect('plugins.php?deactivate=true');
+ exit;
+ break;
+ case 'deactivate-selected':
+ check_admin_referer('mass-manage-plugins');
+ deactivate_plugins($_POST['checked']);
+ $deactivated = array();
+ foreach( (array)$_POST['checked'] as $plugin )
+ $deactivated[ $plugin ] = time();
+ update_option('recently_activated', $deactivated + (array)get_option('recently_activated'));
+ wp_redirect('plugins.php?deactivate-multi=true');
+ exit;
+ break;
+ case 'delete-selected':
+ if( ! current_user_can('delete_plugins') )
+ wp_die(__('You do not have sufficient permissions to delete plugins for this blog.'));
+ check_admin_referer('mass-manage-plugins');
+ $plugins = $_REQUEST['checked'];
+ include(ABSPATH . 'wp-admin/update.php');
+
+ $title = __('Delete Plugin');
+ $parent_file = 'plugins.php';
+
+ $delete_result = delete_plugins($plugins);
- exit;
+ wp_cache_delete('plugins', 'plugins');
+
+ break;
+ default:
+ var_dump("Unknown Action $action");
+ }
}
+wp_enqueue_script('admin-forms');
+
$title = __('Manage Plugins');
require_once('admin-header.php');
@@ -53,23 +110,26 @@ validate_active_plugins();
<?php if ( isset($_GET['error']) ) : ?>
<div id="message" class="updated fade"><p><?php _e('Plugin could not be activated because it triggered a <strong>fatal error</strong>.') ?></p>
<?php
- $plugin = trim($_GET['plugin']);
if ( wp_verify_nonce($_GET['_error_nonce'], 'plugin-activation-error_' . $plugin) ) { ?>
- <iframe style="border:0" width="100%" height="70px" src="<?php bloginfo('wpurl'); ?>/wp-admin/plugins.php?action=error_scrape&amp;plugin=<?php echo attribute_escape($plugin); ?>&amp;_wpnonce=<?php echo attribute_escape($_GET['_error_nonce']); ?>"></iframe>
+ <iframe style="border:0" width="100%" height="70px" src="<?php echo admin_url('plugins.php?action=error_scrape&amp;plugin=' . attribute_escape($plugin) . '&amp;_wpnonce=' . attribute_escape($_GET['_error_nonce'])); ?>"></iframe>
<?php
}
?>
</div>
-<?php elseif ( isset($_GET['errors']) ) : ?>
- <div id="message" class="updated fade"><p><?php _e('Some plugins could not be reactivated because they triggered a <strong>fatal error</strong>.') ?></p></div>
+<?php elseif ( 'delete-selected' == $action ) :
+ if ( is_wp_error($delete_result) ) : ?>
+ <div id="message" class="updated fade"><p><?php printf( __('Plugin could not be deleted due to an error: %s'), $delete_result->get_error_message() ); ?></p></div>
+ <?php else : ?>
+ <div id="message" class="updated fade"><p><?php _e('The selected plugins have been <strong>deleted</strong>.'); ?></p></div>
+ <?php endif; ?>
<?php elseif ( isset($_GET['activate']) ) : ?>
<div id="message" class="updated fade"><p><?php _e('Plugin <strong>activated</strong>.') ?></p></div>
+<?php elseif (isset($_GET['activate-multi'])) : ?>
+ <div id="message" class="updated fade"><p><?php _e('Selected plugins <strong>activated</strong>.'); ?></p></div>
<?php elseif ( isset($_GET['deactivate']) ) : ?>
<div id="message" class="updated fade"><p><?php _e('Plugin <strong>deactivated</strong>.') ?></p></div>
-<?php elseif (isset($_GET['deactivate-all'])) : ?>
- <div id="message" class="updated fade"><p><?php _e('All plugins <strong>deactivated</strong>.'); ?></p></div>
-<?php elseif (isset($_GET['reactivate-all'])) : ?>
- <div id="message" class="updated fade"><p><?php _e('Plugins <strong>reactivated</strong>.'); ?></p></div>
+<?php elseif (isset($_GET['deactivate-multi'])) : ?>
+ <div id="message" class="updated fade"><p><?php _e('Selected plugins <strong>deactivated</strong>.'); ?></p></div>
<?php endif; ?>
<div class="wrap">
@@ -77,106 +137,146 @@ validate_active_plugins();
<p><?php _e('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.'); ?></p>
<?php
-$plugins = get_plugins();
+$active_plugins = array();
+$available_plugins = array();
+$recent_plugins = array();
+$recently_activated = (array)get_option('recently_activated');
-if (empty($plugins)) {
- echo '<p>';
- _e("Couldn&#8217;t open plugins directory or there are no plugins available."); // TODO: make more helpful
- echo '</p>';
-} else {
-?>
+//Clean out any plugins which were deactivated over a week ago.
+foreach( $recently_activated as $key => $time )
+ if( $time + (7*24*60*60) < time() ) //1 week
+ unset($recently_activated[ $key ]);
+if( $recently_activated != get_option('recently_activated') ) //If array changed, update it.
+ update_option('recently_activated', $recently_activated);
-<div class="tablenav">
- <div class="alignleft">
- <?php
- $active = get_option('active_plugins');
- $inactive = get_option('deactivated_plugins');
- if ( !empty($active) ) {
- ?>
- <a class="button-secondary delete" href="<?php echo wp_nonce_url('plugins.php?action=deactivate-all', 'deactivate-all'); ?>"><?php _e('Deactivate All Plugins'); ?></a>
- <?php
- } elseif ( empty($active) && !empty($inactive) ) {
- ?>
- <a class="button-secondary delete" href="<?php echo wp_nonce_url('plugins.php?action=reactivate-all', 'reactivate-all'); ?>"><?php _e('Reactivate Plugins'); ?></a>
- <?php
- } // endif active/inactive plugin check
- ?>
- </div>
- <br class="clear" />
-</div>
+$all_plugins = get_plugins();
-<br class="clear" />
+$plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array());
+
+foreach( (array)$all_plugins as $plugin_file => $plugin_data) {
-<table class="widefat">
+ // Sanitize all displayed data
+ $plugin_data['Title'] = wp_kses($plugin_data['Title'], $plugins_allowedtags);
+ $plugin_data['Version'] = wp_kses($plugin_data['Version'], $plugins_allowedtags);
+ $plugin_data['Description'] = wp_kses($plugin_data['Description'], $plugins_allowedtags);
+ $plugin_data['Author'] = wp_kses($plugin_data['Author'], $plugins_allowedtags);
+ if( ! empty($plugin_data['Author']) )
+ $plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>';
+
+ if ( is_plugin_active($plugin_file) ) {
+ $active_plugins[ $plugin_file ] = $plugin_data;
+ } else {
+ if ( isset( $recently_activated[ $plugin_file ] ) ) //Was the plugin recently activated?
+ $recent_plugins[ $plugin_file ] = $plugin_data;
+ else
+ $available_plugins[ $plugin_file ] = $plugin_data;
+ }
+}
+
+?>
+
+<?php
+function print_plugins_table($plugins, $context = '') {
+?>
+<table class="widefat" id="<?php echo $context ?>-plugins-table">
<thead>
<tr>
- <th><?php _e('Plugin'); ?></th>
- <th class="num"><?php _e('Version'); ?></th>
- <th><?php _e('Description'); ?></th>
- <th class="status"><?php _e('Status') ?></th>
- <th class="action-links"><?php _e('Action'); ?></th>
+ <th scope="col" class="check-column"><input type="checkbox" /></th>
+ <th scope="col"><?php _e('Plugin'); ?></th>
+ <th scope="col" class="num"><?php _e('Version'); ?></th>
+ <th scope="col"><?php _e('Description'); ?></th>
+ <th scope="col" class="action-links"><?php _e('Action'); ?></th>
</tr>
</thead>
- <tbody id="plugins">
+ <tbody class="plugins">
<?php
- foreach($plugins as $plugin_file => $plugin_data) {
- $action_links = array();
-
- $style = '';
-
- if ( is_plugin_active($plugin_file) ) {
- $action_links[] = "<a href='" . wp_nonce_url("plugins.php?action=deactivate&amp;plugin=$plugin_file", 'deactivate-plugin_' . $plugin_file) . "' title='".__('Deactivate this plugin')."' class='delete'>".__('Deactivate')."</a>";
- $style = 'active';
- } else {
- $action_links[] = "<a href='" . wp_nonce_url("plugins.php?action=activate&amp;plugin=$plugin_file", 'activate-plugin_' . $plugin_file) . "' title='".__('Activate this plugin')."' class='edit'>".__('Activate')."</a>";
- }
- $plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array());
+ if( empty($plugins) ) {
+ echo '<tr>
+ <td colspan="6">' . __('No plugins to show') . '</td>
+ </tr>';
+ }
+ foreach( (array)$plugins as $plugin_file => $plugin_data) {
+ $action_links = array();
- // Sanitize all displayed data
- $plugin_data['Title'] = wp_kses($plugin_data['Title'], $plugins_allowedtags);
- $plugin_data['Version'] = wp_kses($plugin_data['Version'], $plugins_allowedtags);
- $plugin_data['Description'] = wp_kses($plugin_data['Description'], $plugins_allowedtags);
- $plugin_data['Author'] = wp_kses($plugin_data['Author'], $plugins_allowedtags);
- $author = ( empty($plugin_data['Author']) ) ? '' : ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>';
+ if( 'active' == $context )
+ $action_links[] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '" class="delete">' . __('Deactivate') . '</a>';
+ else //Available or Recently deactivated
+ $action_links[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
- if ( $style != '' )
- $style = ' class="' . $style . '"';
+ if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
+ $action_links[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
- $action_links = apply_filters('plugin_action_links', $action_links, $plugin_file, $plugin_info);
+ $action_links = apply_filters('plugin_action_links', $action_links, $plugin_file, $plugin_data, $context);
echo "
- <tr$style>
+ <tr class='$context'>
+ <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . attribute_escape($plugin_file) . "' /></th>
<td class='name'>{$plugin_data['Title']}</td>
<td class='vers'>{$plugin_data['Version']}</td>
- <td class='desc'><p>{$plugin_data['Description']}$author</p></td>
- <td class='status'>";
- if ( is_plugin_active($plugin_file) )
- echo __('<span class="active">Active</span>');
- else
- _e('<span class="inactive">Inactive</span>');
- echo "</td>
- <td class='togl action-links'>$toggle";
+ <td class='desc'><p>{$plugin_data['Description']}</p></td>
+ <td class='togl action-links'>";
if ( !empty($action_links) )
echo implode(' | ', $action_links);
- echo "</td>
- </tr>";
- do_action( 'after_plugin_row', $plugin_file );
+ echo '</td>
+ </tr>';
+ do_action( 'after_plugin_row', $plugin_file, $plugin_data, $context );
}
?>
</tbody>
</table>
-
-<?php
-}
+<?php
+} //End print_plugins_table()
?>
+<h3 id="currently-active"><?php _e('Currently Active Plugins') ?></h3>
+<form method="post" action="<?php echo admin_url('plugins.php') ?>">
+<?php wp_nonce_field('mass-manage-plugins') ?>
+
+<div class="tablenav">
+ <div class="alignleft">
+ <input type="submit" name="deactivate-selected" value="<?php _e('Deactivate') ?>" class="button-secondary" />
+ </div>
+</div>
+<br class="clear" />
+<?php print_plugins_table($active_plugins, 'active') ?>
+</form>
+
+<p><?php printf(__('If something goes wrong with a plugin and you can&#8217;t use WordPress, delete or rename that file in the <code>%s</code> directory and it will be automatically deactivated.'), WP_PLUGIN_DIR); ?></p>
+
+<?php if ( ! empty($recent_plugins) ) : ?>
+<h3 id="recent-plugins"><?php _e('Recently Active Plugins') ?></h3>
+<form method="post" action="<?php echo admin_url('plugins.php') ?>">
+<?php wp_nonce_field('mass-manage-plugins') ?>
+
+<div class="tablenav">
+ <div class="alignleft">
+ <input type="submit" name="activate-selected" value="<?php _e('Activate') ?>" class="button-secondary" />
+ </div>
+</div>
+<br class="clear" />
+<?php print_plugins_table($recent_plugins, 'recent') ?>
+</form>
+<?php endif; ?>
+
+<h3 id="available-plugins"><?php _e('Available Plugins') ?></h3>
+<form method="post" action="<?php echo admin_url('plugins.php') ?>">
+<?php wp_nonce_field('mass-manage-plugins') ?>
+
+<div class="tablenav">
+ <div class="alignleft">
+ <input type="submit" name="activate-selected" value="<?php _e('Activate') ?>" class="button-secondary" />
+ </div>
+</div>
+<br class="clear" />
+<?php print_plugins_table($available_plugins, 'available') ?>
+</form>
<?php if( is_site_admin() ) { ?>
<p><?php printf(__('If something goes wrong with a plugin and you can&#8217;t use WordPress, delete or rename that file in the <code>%s</code> directory and it will be automatically deactivated.'), PLUGINDIR); ?></p>
<h2><?php _e('Get More Plugins'); ?></h2>
<p><?php _e('You can find additional plugins for your site in the <a href="http://wordpress.org/extend/plugins/">WordPress plugin directory</a>.'); ?></p>
-<p><?php printf(__('To install a plugin you generally just need to upload the plugin file into your <code>%s</code> directory. Once a plugin is uploaded, you may activate it here.'), PLUGINDIR); ?></p>
+<p><?php printf(__('To install a plugin you generally just need to upload the plugin file into your <code>%s</code> directory. Once a plugin is uploaded, you may activate it here.'), WP_PLUGIN_DIR); ?></p>
<?php } // is_site_admin() ?>
</div>
diff --git a/wp-admin/post-new.php b/wp-admin/post-new.php
index 263783a..f1f2da5 100644
--- a/wp-admin/post-new.php
+++ b/wp-admin/post-new.php
@@ -7,8 +7,9 @@ wp_enqueue_script('autosave');
wp_enqueue_script('post');
if ( user_can_richedit() )
wp_enqueue_script('editor');
-wp_enqueue_script('thickbox');
+add_thickbox();
wp_enqueue_script('media-upload');
+wp_enqueue_script('word-count');
require_once ('./admin-header.php');
diff --git a/wp-admin/post.php b/wp-admin/post.php
index b9400b7..f6daec9 100644
--- a/wp-admin/post.php
+++ b/wp-admin/post.php
@@ -80,16 +80,17 @@ case 'edit':
if ( empty($post->ID) ) wp_die( __("You attempted to edit a post that doesn't exist. Perhaps it was deleted?") );
- if ( 'page' == $post->post_type ) {
- wp_redirect("page.php?action=edit&post=$post_ID");
+ if ( 'post' != $post->post_type ) {
+ wp_redirect( get_edit_post_link( $post->ID, 'url' ) );
exit();
}
wp_enqueue_script('post');
if ( user_can_richedit() )
wp_enqueue_script('editor');
- wp_enqueue_script('thickbox');
+ add_thickbox();
wp_enqueue_script('media-upload');
+ wp_enqueue_script('word-count');
if ( current_user_can('edit_post', $post_ID) ) {
if ( $last = wp_check_post_lock( $post->ID ) ) {
@@ -159,8 +160,8 @@ case 'delete':
}
$sendback = wp_get_referer();
- if (strpos($sendback, 'post.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/post-new.php';
- elseif (strpos($sendback, 'attachments.php') !== false) $sendback = get_option('siteurl') .'/wp-admin/attachments.php';
+ if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('post-new.php');
+ elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
$sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);
wp_redirect($sendback);
exit();
diff --git a/wp-admin/press-this.php b/wp-admin/press-this.php
new file mode 100644
index 0000000..a0bfd1c
--- /dev/null
+++ b/wp-admin/press-this.php
@@ -0,0 +1,503 @@
+<?php
+require_once('admin.php');
+
+if ( ! current_user_can('publish_posts') ) wp_die( __( 'Cheatin&#8217; uh?' )); ?>
+
+<?php
+function press_it() {
+ #define some basic variables
+ $quick['post_status'] = 'publish';
+ $quick['post_category'] = $_REQUEST['post_category'];
+ $quick['tags_input'] = $_REQUEST['tags_input'];
+ $quick['post_title'] = $_REQUEST['post_title'];
+ $quick['post_content'] = '';
+
+ # insert the post with nothing in it, to get an ID
+ $post_ID = wp_insert_post($quick, true);
+
+ $content = '';
+ switch ( $_REQUEST['post_type'] ) {
+ case 'text':
+ case 'quote':
+ $content .= $_REQUEST['content'];
+ break;
+
+ case 'photo':
+ foreach($_REQUEST['photo_src'] as $key => $data) {
+ #quote for matching
+ $quoted = str_replace('/', '\/', preg_quote($data));
+
+ # see if files exist in content - we don't want to upload non-used selected files.
+ preg_match('/'.$quoted.'/', $_REQUEST['content'], $matches[0]);
+ if($matches[0])
+ media_sideload_image($data, $post_ID, $_REQUEST['photo_description'][$key]);
+ }
+ $content = $_REQUEST['content'];
+ break;
+
+ case "video":
+ if($_REQUEST['embed_code'])
+ $content .= $_REQUEST['embed_code']."\n\n";
+ $content .= $_REQUEST['content'];
+ break;
+ }
+ # set the post_content
+ $quick['post_content'] = $content;
+
+ #error handling for $post
+ if ( is_wp_error($post_ID) ) {
+ wp_die($id);
+ wp_delete_post($post_ID);
+
+ #error handling for media_sideload
+ } else {
+ $quick['ID'] = $post_ID;
+ wp_update_post($quick);
+ }
+ return $post_ID;
+}
+
+
+function category_div() { ?>
+ <div id="categories">
+ <div class="submitbox" id="submitpost">
+ <div id="previewview"></div>
+ <div class="inside">
+ <h2><?php _e('Categories') ?></h2>
+ <div id="categories-all">
+ <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
+ <?php wp_category_checklist() ?>
+ </ul>
+ </div>
+ <h2><?php _e('Tags') ?></h2>
+ <p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p>
+ <div id="tagchecklist"></div>
+
+ </div>
+ <p class="submit">
+ <input type="submit" value="<?php _e('Publish') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/>
+ <img src="images/loading.gif" alt="" id="photo_saving" style="width:16px; height:16px; vertical-align:-4px; display:none;"/>
+ </p>
+ </div>
+<?php }
+
+# For submitted posts.
+if ( 'post' == $_REQUEST['action'] ) {
+ check_admin_referer('press-this'); $post_ID = press_it(); ?>
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
+ <head>
+ <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
+ <title><?php _e('Press This') ?></title>
+ <?php
+ add_thickbox();
+ wp_enqueue_style('press-this');
+ wp_enqueue_style( 'colors' );
+ wp_enqueue_script('post');
+
+ do_action('admin_print_styles');
+ do_action('admin_print_scripts');
+ do_action('admin_head');
+ ?>
+ </head>
+ <body class="press-this">
+ <div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_permalink( $post_ID); ?>"><?php _e('View post'); ?></a> | <a href="post.php?action=edit&amp;post=<?php echo $post_ID; ?>" onclick="window.opener.location.replace(this.href); window.close();"><?php _e('Edit post'); ?></a> | <a href="#" onclick="window.close();">Close Window</a></p></div>
+ </body>
+ </html>
+ <?php die;
+}
+
+// Ajax Requests
+$title = wp_specialchars(stripslashes($_GET['t']));
+$selection = trim(wp_specialchars(str_replace("\n", ' ',stripslashes($_GET['s']))));
+$url = $_GET['u'];
+$image = $_GET['i'];
+if($_REQUEST['ajax'] == 'thickbox') { ?>
+ <script type="text/javascript" charset="utf-8">
+ jQuery('.cancel').click(function() {
+ tb_remove();
+ });
+
+ function image_selector() {
+ desc = jQuery('#this_photo_description').val();
+ src = jQuery('#this_photo').val();
+ pick(src, desc);
+ tb_remove();
+ return false;
+ }
+
+ jQuery('.select').click(function() {
+ image_selector();
+ });
+
+ </script>
+ <h3 id="title"><label for="post_title"><?php _e('Description') ?></label></h3>
+ <div class="titlewrap">
+ <input id="this_photo_description" name="photo_description" class="text" onkeypress="if(event.keyCode==13) image_selector();" value="<?php echo attribute_escape($title);?>"/>
+ </div>
+
+ <p><input type="hidden" name="this_photo" value="<?php echo $image; ?>" id="this_photo" />
+ <a href="#" class="select" rel="<?php echo $image; ?>"><img src="<?php echo $image; ?>" width="475" alt="Click to insert." title="Click to insert." /></a></p>
+
+ <p id="options"><a href="#" class="select" rel="<?php echo $image; ?>">Insert Image</a> | <a href="#" class="cancel">Cancel</a></p>
+<?php die;
+}
+
+
+if($_REQUEST['ajax'] == 'video') { ?>
+ <h2 id="embededcode"><label for="embed_code"><?php _e('Embed Code') ?></label></h2>
+ <div class="titlewrap" >
+ <textarea name="embed_code" id="embed_code" rows="8" cols="40"><?php echo $selection; ?></textarea>
+ </div>
+<?php die;
+}
+
+if($_REQUEST['ajax'] == 'photo_images') {
+$url = urldecode($url);
+$url = str_replace(' ', '%20', $url);
+
+ function get_images_from_uri($uri) {
+ if(preg_match('/\.(jpg|png|gif)/', $uri)) return "'".$uri."'";
+ $content = wp_remote_fopen($uri);
+ $host = parse_url($uri);
+ if ( false === $content ) return '';
+
+ $pattern = '/<img[^>]+src=[\'"]([^\'" >]+?)[\'" >]/is';
+ preg_match_all($pattern, $content, $matches);
+ if ( empty($matches[1]) ) return '';
+
+ $sources = array();
+
+ foreach ($matches[1] as $src) {
+ if ( false !== strpos($src, '&') ) continue;
+ if(strpos($src, 'http') === false) {
+ if(strpos($src, '../') === false && strpos($src, './') === false) {
+ $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src);
+ } else {
+ $src = 'http://'.str_replace('//','/', $host['host'].'/'.$host['path'].'/'.$src);
+ }
+ }
+ $sources[] = $src;
+ }
+ return "'" . implode("','", $sources) . "'";
+ }
+
+
+ echo 'new Array('.get_images_from_uri($url).')';
+die;
+}
+
+if($_REQUEST['ajax'] == 'photo_js') { ?>
+
+ var last = null
+
+ function pick(img, desc) {
+ if (img) {
+ length = jQuery('.photolist input').length;
+ if(length == 0) length = 1;
+ jQuery('.photolist').append('<input name="photo_src[' + length + ']" value="' + img +'" type="hidden"/>');
+ jQuery('.photolist').append('<input name="photo_description[' + length + ']" value="' + desc +'" type="hidden"/>');
+ append_editor('<img src="' + img +'" alt="' + desc + '" />'); }
+ return false;
+ }
+
+ var my_src, img, img_tag, aspect, w, h, skip, i, strtoappend = "";
+
+ var my_src = eval(
+ jQuery.ajax({
+ type: "GET",
+ url: "<?php echo clean_url($_SERVER['PHP_SELF']); ?>",
+ cache : false,
+ async : false,
+ data: "ajax=photo_images&u=<?php echo urlencode($url); ?>",
+ dataType : "script"
+ }).responseText);
+
+ for (i = 0; i < my_src.length; i++) {
+ img = new Image();
+ img.src = my_src[i];
+ img_attr = 'id="img' + i;
+ skip = false;
+
+ if (img.width && img.height) {
+ if (img.width * img.height < 2500) skip = true;
+ aspect = img.width / img.height;
+ if (aspect > 1) { // Image is wide
+ scale = 75 / img.width;
+ } else { // Image is tall or square
+ scale = 75 / img.height;
+ }
+ if (scale < 1) {
+ w = parseInt(img.width * scale);
+ h = parseInt(img.height * scale);
+ } else {
+ w = img.width;
+ h = img.height;
+ }
+ img_attr += ' style="width: ' + w + 'px; height: ' + h + 'px;"';
+ }
+
+ if (!skip) strtoappend += '<a href="?ajax=thickbox&amp;i=' + img.src + '&amp;u=<?php echo $url; ?>&amp;height=400&amp;width=500" title="" class="thickbox"><img src="' + img.src + '" ' + img_attr + '/></a>';
+
+ }
+
+ jQuery('#img_container').html(strtoappend);
+
+ tb_init('a.thickbox, area.thickbox, input.thickbox'); //pass where to apply thickbox
+
+<?php die; }
+
+if($_REQUEST['ajax'] == 'photo') { ?>
+
+ <div class="photolist"></div>
+
+ <small><?php _e('Click images to select:') ?></small>
+ <div class="titlewrap">
+ <div id="img_container"></div>
+ </div>
+<?php die; }
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
+<head>
+ <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
+ <title><?php _e('Press This') ?></title>
+
+ <script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce.js"></script>
+<?php
+ add_thickbox();
+ wp_enqueue_style('press-this');
+ wp_enqueue_style( 'colors' );
+ wp_enqueue_script('post');
+
+ do_action('admin_print_styles');
+ do_action('admin_print_scripts');
+ do_action('admin_head');
+?>
+ <script type="text/javascript">
+ <?php if ( user_can_richedit() ) {
+ $language = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) );
+ // Add TinyMCE languages
+ @include_once( dirname(__FILE__).'/../wp-includes/js/tinymce/langs/wp-langs.php' );
+ if ( isset($strings) ) echo $strings; ?>
+ (function() {
+ var base = tinymce.baseURL, sl = tinymce.ScriptLoader, ln = "<?php echo $language; ?>";
+
+ sl.markDone(base + '/langs/' + ln + '.js');
+ sl.markDone(base + '/themes/advanced/langs/' + ln + '.js');
+ sl.markDone(base + '/themes/advanced/langs/' + ln + '_dlg.js');
+ })();
+
+ tinyMCE.init({
+ mode: "textareas",
+ editor_selector: "mceEditor",
+ language : "<?php echo $language; ?>",
+ width: "100%",
+ theme : "advanced",
+ theme_advanced_buttons1 : "bold,italic,underline,blockquote,separator,strikethrough,bullist,numlist,undo,redo,link,unlink",
+ theme_advanced_buttons2 : "",
+ theme_advanced_buttons3 : "",
+ theme_advanced_toolbar_location : "top",
+ theme_advanced_toolbar_align : "left",
+ theme_advanced_statusbar_location : "bottom",
+ theme_advanced_resizing : true,
+ theme_advanced_resize_horizontal : false,
+ skin : "wp_theme",
+ dialog_type : "modal",
+ relative_urls : false,
+ remove_script_host : false,
+ convert_urls : false,
+ apply_source_formatting : false,
+ remove_linebreaks : false,
+ accessibility_focus : false,
+ tab_focus : ":next",
+ plugins : "safari,inlinepopups",
+ entities : "38,amp,60,lt,62,gt"
+ });
+ <?php } ?>
+
+ jQuery('#tags-input').hide();
+
+ tag_update_quickclicks();
+
+ // add the quickadd form
+ jQuery('#jaxtag').prepend('<span id="ajaxtag"><input type="text" name="newtag" id="newtag" class="form-input-tip" size="16" autocomplete="off" value="'+postL10n.addTag+'" /><input type="submit" class="button" id="tagadd" value="' + postL10n.add + '" tabindex="3" onclick="return false;" /><input type="hidden"/><input type="hidden"/><span class="howto">'+postL10n.separate+'</span></span>');
+
+ jQuery('#tagadd').click( tag_flush_to_text );
+ jQuery('#newtag').focus(function() {
+ if ( this.value == postL10n.addTag )
+ jQuery(this).val( '' ).removeClass( 'form-input-tip' );
+ });
+ jQuery('#newtag').blur(function() {
+ if ( this.value == '' )
+ jQuery(this).val( postL10n.addTag ).addClass( 'form-input-tip' );
+ });
+
+ // auto-save tags on post save/publish
+ jQuery('#publish').click( tag_save_on_publish );
+ jQuery('#save-post').click( tag_save_on_publish );
+
+ function set_menu(type) {
+ jQuery('#text_button').removeClass('ui-tabs-selected');
+ jQuery('#menu li').removeClass('ui-tabs-selected');
+ jQuery('#' + type + '_button').addClass('ui-tabs-selected');
+ jQuery("#post_type").val(type);
+ }
+ function set_editor(text) {
+ if(tinyMCE.activeEditor) tinyMCE.activeEditor.setContent('');
+ if(tinyMCE.activeEditor) tinyMCE.execCommand('mceInsertContent' ,false, text);
+ }
+ function append_editor(text) {
+ if(tinyMCE.activeEditor) tinyMCE.execCommand('mceInsertContent' ,false, text);
+ }
+ function set_title(title) { jQuery("#content_type").text(title); }
+ function reset_height() {
+ tinyMCE.height = '170px';
+ }
+ function show(tab_name) {
+ jQuery('body').removeClass('video_split');
+ jQuery('#extra_fields').hide();
+ switch(tab_name) {
+ case 'text' :
+ reset_height();
+ jQuery('.editor-container').show();
+ jQuery('#content_type').show();
+ set_menu('text');
+ set_title('<?php _e('Text') ?>');
+ set_editor("<?php echo $selection; ?>");
+ return false;
+ break;
+ case 'quote' :
+ reset_height();
+ jQuery('.editor-container').show();
+ jQuery('#content_type').show();
+ set_menu('quote');
+ set_title('<?php _e('Quote') ?>');
+ set_editor("<blockquote><p><?php echo $selection; ?> </p><p><cite><a href='<?php echo ''; ?>'><?php echo ''; ?></a></cite> </p></blockquote>");
+
+ return false;
+ break;
+ case 'video' :
+ reset_height();
+ jQuery('.editor-container').show();
+ jQuery('#content_type').show();
+ set_menu('video');
+ set_title('<?php _e('Caption') ?>');
+
+ jQuery('#extra_fields').show();
+ jQuery('body').addClass('video_split');
+
+
+ jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s: '<?php echo attribute_escape($selection); ?>'}, function() {
+
+ <?php
+ if ( preg_match("/youtube\.com\/watch/i", $url) ) {
+ list($domain, $video_id) = split("v=", $url);
+ $content = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/' . $video_id . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' . $video_id . '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>'; ?>
+
+ <?php } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) {
+
+ list($domain, $video_id) = split(".com/", $url);
+ $content = '<object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /> <embed src="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>';
+
+ if(trim($selection) == '') $selection = '<a href="http://www.vimeo.com/' . $video_id . '?pg=embed&sec=' . $video_id . '">' . $title . '</a> on <a href="http://vimeo.com?pg=embed&sec=' . $video_id . '">Vimeo</a>';
+ }else {
+ $content = $selection;
+ } ?>
+ jQuery('#embed_code').prepend('<?php echo htmlentities($content); ?>');
+ set_editor("<?php echo $title; ?>");
+
+ });
+
+
+ return false;
+ break;
+
+ case 'photo' :
+ reset_height();
+ set_menu('photo');
+ set_title('Post');
+ <?php if($selection) { ?>
+ set_editor("<?php echo $selection; ?>");
+ <?php } else { ?>
+ set_editor('')
+ <?php } ?>
+ jQuery('#extra_fields').show();
+ jQuery('#extra_fields').prepend('<h2 id="waiting"><img src="images/loading.gif" alt="" /> Loading...</h2>');
+ jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']).'/?ajax=photo&u='.attribute_escape($url); ?>');
+ jQuery.ajax({
+ type: "GET",
+ cache : false,
+ url: "<?php echo clean_url($_SERVER['PHP_SELF']); ?>",
+ data: "ajax=photo_js&u=<?php echo urlencode($url)?>",
+ dataType : "script",
+ success : function() {
+ jQuery('#waiting').innerHTML('');
+ }
+ });
+
+ return false;
+ break;
+
+ }
+
+ }
+
+ jQuery(document).ready(function() {
+ jQuery('#menu li').click(function (){
+ tab_name = this.id.split('_');
+ tab_name = tab_name[0];
+ show(tab_name);
+ });
+
+ <?php if ( preg_match("/youtube\.com\/watch/i", $url) ) { ?>
+ show('video');
+ <?php } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) { ?>
+ show('video');
+ <?php } elseif ( preg_match("/flickr\.com/i", $url) ) { ?>
+ show('photo');
+ <?php } ?>
+ });
+</script>
+</head>
+<body class="press-this">
+<div id="wphead">
+<h1><span id="viewsite"><a href="<?php echo get_option('home'); ?>/"><?php _e('Visit:') ?> <?php bloginfo('name'); ?></a></span></h1>
+</div>
+
+ <ul id="menu" class="ui-tabs-nav">
+ <li id="text_button" class="ui-tabs-selected"><a href="#"><?php _e('Text') ?></a></li>
+ <li id="photo_button"><a href="#"><?php _e('Photo') ?></a></li>
+ <li id="quote_button"><a href="#"><?php _e('Quote') ?></a></li>
+ <li id="video_button"><a href="#"><?php _e('Video') ?></a></li>
+ </ul>
+
+ <form action="press-this.php?action=post" method="post">
+
+ <?php wp_nonce_field('press-this') ?>
+ <input type="hidden" name="post_type" id="post_type" value="text"/>
+ <div id="posting">
+
+ <h2 id="title"><label for="post_title"><?php _e('Title') ?></label></h2>
+ <div class="titlewrap">
+ <input name="post_title" id="post_title" class="text" value="<?php echo attribute_escape($title);?>"/>
+ </div>
+
+ <div id="extra_fields" style="display: none"></div>
+ <div class="editor_area">
+ <h2 id="content_type"><label for="content"><?php _e('Post') ?></label></h2>
+ <div class="editor-container">
+ <textarea name="content" id="content" style="width:100%;" class="mceEditor">
+ <?php echo $selection; ?>
+ </textarea>
+ </div>
+ </div>
+
+ </div>
+ <?php category_div(); ?>
+ </form>
+
+</body>
+</html>
diff --git a/wp-admin/revision.php b/wp-admin/revision.php
new file mode 100644
index 0000000..a00fa81
--- /dev/null
+++ b/wp-admin/revision.php
@@ -0,0 +1,209 @@
+<?php
+
+require_once('admin.php');
+
+wp_reset_vars(array('revision', 'left', 'right', 'action'));
+$revision_id = absint($revision);
+$diff = absint($diff);
+$left = absint($left);
+$right = absint($right);
+
+$parent_file = $redirect = 'edit.php';
+
+switch ( $action ) :
+case 'delete' : // stubs
+case 'edit' :
+ if ( constant('WP_POST_REVISIONS') ) // stub
+ $redirect = remove_query_arg( 'action' );
+ else // Revisions disabled
+ $redirect = 'edit.php';
+ break;
+case 'restore' :
+ if ( !$revision = wp_get_post_revision( $revision_id ) )
+ break;
+ if ( !current_user_can( 'edit_post', $revision->post_parent ) )
+ break;
+ if ( !$post = get_post( $revision->post_parent ) )
+ break;
+
+ if ( !constant('WP_POST_REVISIONS') && !wp_is_post_autosave( $revision ) ) // Revisions disabled and we're not looking at an autosave
+ break;
+
+ check_admin_referer( "restore-post_$post->ID|$revision->ID" );
+
+ wp_restore_post_revision( $revision->ID );
+ $redirect = add_query_arg( array( 'message' => 5, 'revision' => $revision->ID ), get_edit_post_link( $post->ID, 'url' ) );
+ break;
+case 'diff' :
+ if ( !$left_revision = get_post( $left ) )
+ break;
+ if ( !$right_revision = get_post( $right ) )
+ break;
+
+ if ( !current_user_can( 'read_post', $left_revision->ID ) || !current_user_can( 'read_post', $right_revision->ID ) )
+ break;
+
+ // Don't allow reverse diffs?
+ if ( strtotime($right_revision->post_modified_gmt) < strtotime($left_revision->post_modified_gmt) ) {
+ $redirect = add_query_arg( array( 'left' => $right, 'right' => $left ) );
+ break;
+ }
+
+ if ( $left_revision->ID == $right_revision->post_parent ) // right is a revision of left
+ $post =& $left_revision;
+ elseif ( $left_revision->post_parent == $right_revision->ID ) // left is a revision of right
+ $post =& $right_revision;
+ elseif ( $left_revision->post_parent == $right_revision->post_parent ) // both are revisions of common parent
+ $post = get_post( $left_revision->post_parent );
+ else
+ break; // Don't diff two unrelated revisions
+
+ if ( !constant('WP_POST_REVISIONS') ) { // Revisions disabled
+ if (
+ // we're not looking at an autosave
+ ( !wp_is_post_autosave( $left_revision ) && !wp_is_post_autosave( $right_revision ) )
+ ||
+ // we're not comparing an autosave to the current post
+ ( $post->ID !== $left_revision->ID && $post->ID !== $right_revision->ID )
+ )
+ break;
+ }
+
+ if (
+ // They're the same
+ $left_revision->ID == $right_revision->ID
+ ||
+ // Neither is a revision
+ ( !wp_get_post_revision( $left_revision->ID ) && !wp_get_post_revision( $right_revision->ID ) )
+ )
+ break;
+
+ $post_title = '<a href="' . get_edit_post_link() . '">' . get_the_title() . '</a>';
+ $h2 = sprintf( __( 'Compare Revisions of &#8220;%1$s&#8221;' ), $post_title );
+
+ $left = $left_revision->ID;
+ $right = $right_revision->ID;
+
+ $redirect = false;
+ break;
+case 'view' :
+default :
+ if ( !$revision = wp_get_post_revision( $revision_id ) )
+ break;
+ if ( !$post = get_post( $revision->post_parent ) )
+ break;
+
+ if ( !current_user_can( 'read_post', $revision->ID ) || !current_user_can( 'read_post', $post->ID ) )
+ break;
+
+ if ( !constant('WP_POST_REVISIONS') && !wp_is_post_autosave( $revision ) ) // Revisions disabled and we're not looking at an autosave
+ break;
+
+ $post_title = '<a href="' . get_edit_post_link() . '">' . get_the_title() . '</a>';
+ $revision_title = wp_post_revision_title( $revision, false );
+ $h2 = sprintf( __( 'Post Revision for &#8220;%1$s&#8221; created on %2$s' ), $post_title, $revision_title );
+
+ // Sets up the diff radio buttons
+ $left = $revision->ID;
+ $right = $post->ID;
+
+ $redirect = false;
+ break;
+endswitch;
+
+if ( !$redirect && !in_array( $post->post_type, array( 'post', 'page' ) ) )
+ $redirect = 'edit.php';
+
+if ( $redirect ) {
+ wp_redirect( $redirect );
+ exit;
+}
+
+if ( 'page' == $post->post_type ) {
+ $submenu_file = 'edit-pages.php';
+ $title = __( 'Page Revisions' );
+} else {
+ $submenu_file = 'edit.php';
+ $title = __( 'Post Revisions' );
+}
+
+// Converts post_author ID# into name
+add_filter( '_wp_post_revision_field_post_author', 'get_author_name' );
+
+require_once( 'admin-header.php' );
+
+?>
+
+<div class="wrap">
+
+<h2 class="long-header"><?php echo $h2; ?></h2>
+
+<table class="form-table ie-fixed">
+ <col class="th" />
+<?php if ( 'diff' == $action ) : ?>
+<tr id="revision">
+ <th scope="row"></th>
+ <th scope="col" class="th-full">
+ <span class="alignleft"><?php printf( __('Older: %s'), wp_post_revision_title( $left_revision ) ); ?></span>
+ <span class="alignright"><?php printf( __('Newer: %s'), wp_post_revision_title( $right_revision ) ); ?></span>
+ </th>
+</tr>
+<?php endif;
+
+// use get_post_to_edit filters?
+$identical = true;
+foreach ( _wp_post_revision_fields() as $field => $field_title ) :
+ if ( 'diff' == $action ) {
+ $left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field );
+ $right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field );
+ if ( !$content = wp_text_diff( $left_content, $right_content ) )
+ continue; // There is no difference between left and right
+ $identical = false;
+ } else {
+ add_filter( "_wp_post_revision_field_$field", 'htmlspecialchars' );
+ $content = apply_filters( "_wp_post_revision_field_$field", $revision->$field, $field );
+ }
+ ?>
+
+ <tr id="revision-field-<?php echo $field; ?>">
+ <th scope="row"><?php echo wp_specialchars( $field_title ); ?></th>
+ <td><div class="pre"><?php echo $content; ?></div></td>
+ </tr>
+
+ <?php
+
+endforeach;
+
+if ( 'diff' == $action && $identical ) :
+
+ ?>
+
+ <tr><td colspan="2"><div class="updated"><p><?php _e( 'These revisions are identical.' ); ?></p></div></td></tr>
+
+ <?php
+
+endif;
+
+?>
+
+</table>
+
+<br class="clear" />
+
+<h2><?php echo $title; ?></h2>
+
+<?php
+
+$args = array( 'format' => 'form-table', 'parent' => true, 'right' => $right, 'left' => $left );
+if ( !constant( 'WP_POST_REVISIONS' ) )
+ $args['type'] = 'autosave';
+
+wp_list_post_revisions( $post, $args );
+
+?>
+
+</div>
+
+<?php
+
+require_once( 'admin-footer.php' );
diff --git a/wp-admin/setup-config.php b/wp-admin/setup-config.php
index 796ca07..a5c78c2 100644
--- a/wp-admin/setup-config.php
+++ b/wp-admin/setup-config.php
@@ -21,6 +21,10 @@ if ( !is_writable('../'))
if (file_exists('../wp-config.php'))
wp_die("<p>The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");
+// Check if wp-config.php exists above the root directory
+if (file_exists('../../wp-config.php'))
+ wp_die("<p>The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");
+
if (isset($_GET['step']))
$step = $_GET['step'];
else
@@ -69,28 +73,28 @@ switch($step) {
<p>Below you should enter your database connection details. If you're not sure about these, contact your host. </p>
<table class="form-table">
<tr>
- <th scope="row">Database Name</th>
- <td><input name="dbname" type="text" size="25" value="wordpress" /></td>
+ <th scope="row"><label for="dbname">Database Name</label></th>
+ <td><input name="dbname" id="dbname" type="text" size="25" value="wordpress" /></td>
<td>The name of the database you want to run WP in. </td>
</tr>
<tr>
- <th scope="row">User Name</th>
- <td><input name="uname" type="text" size="25" value="username" /></td>
+ <th scope="row"><label for="uname">User Name</label></th>
+ <td><input name="uname" id="uname" type="text" size="25" value="username" /></td>
<td>Your MySQL username</td>
</tr>
<tr>
- <th scope="row">Password</th>
- <td><input name="pwd" type="text" size="25" value="password" /></td>
+ <th scope="row"><label for="pwd">Password</label></th>
+ <td><input name="pwd" id="pwd" type="text" size="25" value="password" /></td>
<td>...and MySQL password.</td>
</tr>
<tr>
- <th scope="row">Database Host</th>
- <td><input name="dbhost" type="text" size="25" value="localhost" /></td>
+ <th scope="row"><label for="dbhost">Database Host</label></th>
+ <td><input name="dbhost" id="dbhost" type="text" size="25" value="localhost" /></td>
<td>99% chance you won't need to change this value.</td>
</tr>
<tr>
- <th scope="row">Table Prefix</th>
- <td><input name="prefix" type="text" id="prefix" value="wp_" size="25" /></td>
+ <th scope="row"><label for="prefix">Table Prefix</label></th>
+ <td><input name="prefix" id="prefix" type="text" id="prefix" value="wp_" size="25" /></td>
<td>If you want to run multiple WordPress installations in a single database, change this.</td>
</tr>
</table>
diff --git a/wp-admin/sidebar.php b/wp-admin/sidebar.php
index 9287285..43465ab 100644
--- a/wp-admin/sidebar.php
+++ b/wp-admin/sidebar.php
@@ -14,8 +14,9 @@ if ('b' == $_GET['a']) {
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=UTF-8" />
<title><?php _e('WordPress &#8250; Posted'); ?></title>
<?php
-wp_admin_css( 'css/global' );
-wp_admin_css();
+wp_admin_css( 'global', true );
+wp_admin_css( 'wp-admin', true );
+wp_admin_css( 'colors', true );
?>
</head>
<body>
@@ -32,8 +33,9 @@ wp_admin_css();
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('blog_charset'); ?>" />
<title><?php _e('WordPress &#8250; Sidebar'); ?></title>
<?php
-wp_admin_css( 'css/global' );
-wp_admin_css();
+wp_admin_css( 'global', true );
+wp_admin_css( 'wp-admin', true );
+wp_admin_css( 'colors', true );
?>
<style type="text/css" media="screen">
form {
@@ -60,8 +62,8 @@ form {
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
<input type="hidden" name="mode" value="sidebar" />
<?php wp_nonce_field('add-post'); ?>
-<p><?php _e('Title:'); ?>
-<input type="text" name="post_title" size="20" tabindex="1" style="width: 100%;" />
+<p><label for="post_title"><?php _e('Title:'); ?></label>
+<input type="text" name="post_title" id="post_title" size="20" tabindex="1" style="width: 100%;" />
</p>
<p><?php _e('Categories:'); ?>
<span class="sidebar-categories">
@@ -69,8 +71,8 @@ form {
</span>
</p>
<p>
-Post:
-<textarea rows="8" cols="12" style="width: 100%" name="content" tabindex="2"></textarea>
+<label for="content">Post:</label>
+<textarea rows="8" cols="12" style="width: 100%" name="content" id="content" tabindex="2"></textarea>
</p>
<p>
<input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft'); ?>" />
diff --git a/wp-admin/themes.php b/wp-admin/themes.php
index 3b4103b..e09d8e8 100644
--- a/wp-admin/themes.php
+++ b/wp-admin/themes.php
@@ -36,6 +36,10 @@ if ( isset($_GET['action']) ) {
$title = __('Manage Themes');
$parent_file = 'themes.php';
+
+add_thickbox();
+wp_enqueue_script( 'theme-preview' );
+
require_once('admin-header.php');
if( is_site_admin() ) {
?><div id="message0" class="updated fade"><p><?php _e('Administrator: new themes must be activated in the <a href="wpmu-themes.php">Themes Admin</a> page before they appear here.'); ?></p></div><?php
@@ -48,32 +52,80 @@ if( is_site_admin() ) {
<div id="message2" class="updated fade"><p><?php printf(__('New theme activated. <a href="%s">Visit site</a>'), get_bloginfo('url') . '/'); ?></p></div>
<?php endif; ?>
+<?php
+ksort( $themes );
+$theme_total = count( $themes );
+$per_page = 15;
+
+if ( isset( $_GET['pagenum'] ) )
+ $page = absint( $_GET['pagenum'] );
+
+if ( empty($page) )
+ $page = 1;
+
+$start = $offset = ( $page - 1 ) * $per_page;
+
+$page_links = paginate_links( array(
+ 'base' => add_query_arg( 'pagenum', '%#%' ) . '#themenav',
+ 'format' => '',
+ 'total' => ceil($theme_total / $per_page),
+ 'current' => $page
+));
+
+$themes = array_slice( $themes, $start, $per_page );
+
+?>
<div class="wrap">
<h2><?php _e('Current Theme'); ?></h2>
-<div id="currenttheme">
+<div id="current-theme">
<?php if ( $ct->screenshot ) : ?>
-<img src="<?php echo get_option('siteurl') . '/' . $ct->stylesheet_dir . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" />
+<img src="<?php echo WP_CONTENT_URL . $ct->stylesheet_dir . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" />
<?php endif; ?>
<h3><?php printf(_c('%1$s %2$s by %3$s|1: theme title, 2: theme version, 3: theme author'), $ct->title, $ct->version, $ct->author) ; ?></h3>
-<p><?php echo $ct->description; ?></p>
+<p class="description"><?php echo $ct->description; ?></p>
<?php if ( $ct->tags ) : ?>
<p><?php _e('Tags:'); ?> <?php echo join(', ', $ct->tags); ?></p>
<?php endif; ?>
</div>
<h2><?php _e('Available Themes'); ?></h2>
-<?php if ( 1 < count($themes) ) { ?>
+<br class="clear" />
+
+<?php if ( $page_links ) : ?>
+<div class="tablenav">
+<?php echo "<div class='tablenav-pages'>$page_links</div>"; ?>
+<br class="clear" />
+</div>
+<br class="clear" />
+<?php endif; ?>
+<?php if ( 1 < $theme_total ) { ?>
+<table id="availablethemes" cellspacing="0" cellpadding="0">
<?php
$style = '';
$theme_names = array_keys($themes);
natcasesort($theme_names);
-foreach ($theme_names as $theme_name) {
- if ( $theme_name == $ct->name )
- continue;
+$rows = ceil(count($theme_names) / 3);
+for ( $row = 1; $row <= $rows; $row++ )
+ for ( $col = 1; $col <= 3; $col++ )
+ $table[$row][$col] = array_shift($theme_names);
+
+foreach ( $table as $row => $cols ) {
+?>
+<tr>
+<?php
+foreach ( $cols as $col => $theme_name ) {
+ $class = array('available-theme');
+ if ( $row == 1 ) $class[] = 'top';
+ if ( $col == 1 ) $class[] = 'left';
+ if ( $row == $rows ) $class[] = 'bottom';
+ if ( $col == 3 ) $class[] = 'right';
+?>
+ <td class="<?php echo join(' ', $class); ?>">
+<?php if ( !empty($theme_name) ) :
$template = $themes[$theme_name]['Template'];
$stylesheet = $themes[$theme_name]['Stylesheet'];
$title = $themes[$theme_name]['Title'];
@@ -82,26 +134,44 @@ foreach ($theme_names as $theme_name) {
$author = $themes[$theme_name]['Author'];
$screenshot = $themes[$theme_name]['Screenshot'];
$stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
+ $preview_link = clean_url( get_option('home') . '/');
+ $preview_link = add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true', 'width' => 600, 'height' => 400 ), $preview_link );
+ $preview_text = attribute_escape( sprintf( __('Preview of "%s"'), $title ) );
$tags = $themes[$theme_name]['Tags'];
+ $thickbox_class = 'thickbox';
$activate_link = wp_nonce_url("themes.php?action=activate&amp;template=".urlencode($template)."&amp;stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template);
+ $activate_text = attribute_escape( sprintf( __('Activate "%s"'), $title ) );
?>
-<div class="available-theme">
-<h3><a href="<?php echo $activate_link; ?>"><?php echo $title; ?></a></h3>
-
-<a href="<?php echo $activate_link; ?>" class="screenshot">
+ <a href="<?php echo $activate_link; ?>" class="<?php echo $thickbox_class; ?> screenshot">
<?php if ( $screenshot ) : ?>
-<img src="<?php echo get_option('siteurl') . '/' . $stylesheet_dir . '/' . $screenshot; ?>" alt="" />
+ <img src="<?php echo WP_CONTENT_URL . $stylesheet_dir . '/' . $screenshot; ?>" alt="" />
<?php endif; ?>
-</a>
-
-<p><?php echo $description; ?></p>
+ </a>
+ <h3><a class="<?php echo $thickbox_class; ?>" href="<?php echo $activate_link; ?>"><?php echo $title; ?></a></h3>
+ <p><?php echo $description; ?></p>
<?php if ( $tags ) : ?>
-<p><?php _e('Tags:'); ?> <?php echo join(', ', $tags); ?></p>
+ <p><?php _e('Tags:'); ?> <?php echo join(', ', $tags); ?></p>
+ <noscript><p class="themeactions"><a href="<?php echo $preview_link; ?>" title="<?php echo $preview_text; ?>"><?php _e('Preview'); ?></a> <a href="<?php echo $activate_link; ?>" title="<?php echo $activate_text; ?>"><?php _e('Activate'); ?></a></p></noscript>
<?php endif; ?>
+ <div style="display:none;"><a class="previewlink" href="<?php echo $preview_link; ?>"><?php echo $preview_text; ?></a> <a class="activatelink" href="<?php echo $activate_link; ?>"><?php echo $activate_text; ?></a></div>
+<?php endif; // end if not empty theme_name ?>
+ </td>
+<?php } // end foreach $cols ?>
+</tr>
+<?php } // end foreach $table ?>
+</table>
+<?php } ?>
+
+<br class="clear" />
+
+<?php if ( $page_links ) : ?>
+<div class="tablenav">
+<?php echo "<div class='tablenav-pages'>$page_links</div>"; ?>
+<br class="clear" />
</div>
-<?php } // end foreach theme_names ?>
+<?php endif; ?>
-<?php } ?>
+<br class="clear" />
<?php
// List broken themes, if any.
diff --git a/wp-admin/update-links.php b/wp-admin/update-links.php
index 6641279..5fd02e0 100644
--- a/wp-admin/update-links.php
+++ b/wp-admin/update-links.php
@@ -1,5 +1,5 @@
<?php
-require_once('../wp-config.php');
+require_once('../wp-load.php');
require_once( ABSPATH . 'wp-includes/class-snoopy.php');
if ( !get_option('use_linksupdate') )
@@ -36,9 +36,9 @@ if ( false !== ( $fs = @fsockopen('api.pingomatic.com', 80, $errno, $errstr, 5)
$returns = explode("\n", $body);
foreach ($returns as $return) :
- $time = $wpdb->escape( substr($return, 0, 19) );
- $uri = $wpdb->escape( preg_replace('/(.*?) | (.*?)/', '$2', $return) );
- $wpdb->query("UPDATE $wpdb->links SET link_updated = '$time' WHERE link_url = '$uri'");
+ $time = substr($return, 0, 19);
+ $uri = preg_replace('/(.*?) | (.*?)/', '$2', $return);
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_updated = %s WHERE link_url = %s", $time, $uri) );
endforeach;
}
?>
diff --git a/wp-admin/update.php b/wp-admin/update.php
index be95102..c3cd289 100644
--- a/wp-admin/update.php
+++ b/wp-admin/update.php
@@ -2,8 +2,8 @@
require_once('admin.php');
-if ( !current_user_can('edit_plugins') )
- wp_die('<p>'.__('You do not have sufficient permissions to update plugins for this blog.').'</p>');
+if ( ! current_user_can('update_plugins') )
+ wp_die(__('You do not have sufficient permissions to update plugins for this blog.'));
function request_filesystem_credentials($form_post, $type = '', $error = false) {
$req_cred = apply_filters('request_filesystem_credentials', '', $form_post, $type, $error);
@@ -45,19 +45,19 @@ function request_filesystem_credentials($form_post, $type = '', $error = false)
<p><?php _e('To perform the requested update, FTP connection information is required.') ?></p>
<table class="form-table">
<tr valign="top">
-<th scope="row"><?php _e('Hostname:') ?></th>
+<th scope="row"><label for="hostname"><?php _e('Hostname:') ?></label></th>
<td><input name="hostname" type="text" id="hostname" value="<?php echo attribute_escape($hostname) ?>"<?php if( defined('FTP_HOST') ) echo ' disabled="disabled"' ?> size="40" /></td>
</tr>
<tr valign="top">
-<th scope="row"><?php _e('Username:') ?></th>
+<th scope="row"><label for="username"><?php _e('Username:') ?></label></th>
<td><input name="username" type="text" id="username" value="<?php echo attribute_escape($username) ?>"<?php if( defined('FTP_USER') ) echo ' disabled="disabled"' ?> size="40" /></td>
</tr>
<tr valign="top">
-<th scope="row"><?php _e('Password:') ?></th>
+<th scope="row"><label for="password"><?php _e('Password:') ?></label></th>
<td><input name="password" type="password" id="password" value=""<?php if( defined('FTP_PASS') ) echo ' disabled="disabled"' ?> size="40" /><?php if( defined('FTP_PASS') && !empty($password) ) echo '<em>'.__('(Password not shown)').'</em>'; ?></td>
</tr>
<tr valign="top">
-<th scope="row"><?php _e('Use SSL:') ?></th>
+<th scope="row"><label for="ssl"><?php _e('Use SSL:') ?></label></th>
<td>
<select name="ssl" id="ssl"<?php if( defined('FTP_SSL') ) echo ' disabled="disabled"' ?>>
<?php
@@ -110,15 +110,16 @@ function do_plugin_upgrade($plugin) {
return;
}
- $was_activated = is_plugin_active($plugin); //Check now, It'll be deactivated by the next line if it is,
+ $was_activated = is_plugin_active($plugin); //Check now, It'll be deactivated by the next line if it is
$result = wp_update_plugin($plugin, 'show_message');
if ( is_wp_error($result) ) {
show_message($result);
+ show_message( __('Installation Failed') );
} else {
- //Result is the new plugin file relative to PLUGINDIR
- show_message(__('Plugin upgraded successfully'));
+ //Result is the new plugin file relative to WP_PLUGIN_DIR
+ show_message( __('Plugin upgraded successfully') );
if( $result && $was_activated ){
show_message(__('Attempting reactivation of the plugin'));
echo '<iframe style="border:0" width="100%" height="170px" src="' . wp_nonce_url('update.php?action=activate-plugin&plugin=' . $result, 'activate-plugin_' . $result) .'"></iframe>';
@@ -151,8 +152,8 @@ if ( isset($_GET['action']) ) {
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
<title><?php bloginfo('name') ?> &rsaquo; <?php _e('Plugin Reactivation'); ?> &#8212; <?php _e('WordPress'); ?></title>
<?php
-wp_admin_css( 'css/global' );
-wp_admin_css( 'css/colors' );
+wp_admin_css( 'global', true );
+wp_admin_css( 'colors', true );
?>
</head>
<body>
@@ -164,7 +165,7 @@ wp_admin_css( 'css/colors' );
echo '<p>' . __('Plugin failed to reactivate due to a fatal error.') . '</p>';
error_reporting( E_ALL ^ E_NOTICE );
@ini_set('display_errors', true); //Ensure that Fatal errors are displayed.
- include(ABSPATH . PLUGINDIR . '/' . $plugin);
+ include(WP_PLUGIN_DIR . '/' . $plugin);
}
echo "</body></html>";
}
diff --git a/wp-admin/upgrade.php b/wp-admin/upgrade.php
index a831abd..dc7ec4b 100644
--- a/wp-admin/upgrade.php
+++ b/wp-admin/upgrade.php
@@ -1,9 +1,7 @@
<?php
define('WP_INSTALLING', true);
-if (!file_exists('../wp-config.php'))
- die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://codex.wordpress.org/Installing_WordPress#Step_3:_Set_up_wp-config.php'>We got it</a>. You can create a <code>wp-config.php</code> file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.</p><p><a href='setup-config.php' class='button'>Create a Configuration File</a>");
-require('../wp-config.php');
+require('../wp-load.php');
timer_start();
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
@@ -18,7 +16,7 @@ else
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
<title><?php _e('WordPress &rsaquo; Upgrade'); ?></title>
- <?php wp_admin_css( 'css/install' ); ?>
+ <?php wp_admin_css( 'install', true ); ?>
</head>
<body>
<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
diff --git a/wp-admin/upload.php b/wp-admin/upload.php
index 0f7412d..cf6c191 100644
--- a/wp-admin/upload.php
+++ b/wp-admin/upload.php
@@ -125,6 +125,7 @@ endif;
?>
<p id="post-search">
+ <label class="hidden" for="post-search-input"><?php _e( 'Search Media' ); ?>:</label>
<input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Media' ); ?>" class="button" />
</p>
@@ -211,7 +212,7 @@ if ( $page_links )
if ( 1 == count($posts) && is_singular() ) :
- $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date");
+ $comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) );
if ( $comments ) :
// Make sure comments, post, and post_author are cached
update_comment_cache($comments);
diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php
index b01c3a8..76979f6 100644
--- a/wp-admin/user-edit.php
+++ b/wp-admin/user-edit.php
@@ -169,7 +169,7 @@ include ('admin-header.php');
<?php endif; ?>
<tr>
<th scope="row"><?php _e('Admin Color Scheme')?></th>
-<td>
+<td><fieldset><legend class="hidden"><?php _e('Admin Color Scheme')?></legend>
<?php
$current_color = get_user_option('admin_color', $user_id);
if ( empty($current_color) )
@@ -188,7 +188,7 @@ foreach ( $_wp_admin_css_colors as $color => $color_info ): ?>
<label for="admin_color_<?php echo $color; ?>"><?php echo $color_info->name ?></label>
</div>
<?php endforeach; ?>
-</td>
+</fieldset></td>
</tr>
</table>
diff --git a/wp-admin/users.php b/wp-admin/users.php
index b4b2e9d..4faf5ce 100644
--- a/wp-admin/users.php
+++ b/wp-admin/users.php
@@ -145,13 +145,13 @@ case 'delete':
?>
</ul>
<?php if ( $go_delete ) : ?>
- <p><?php _e('What should be done with posts and links owned by this user?'); ?></p>
+ <fieldset><p><legend><?php _e('What should be done with posts and links owned by this user?'); ?></legend></p>
<ul style="list-style:none;">
<li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" checked="checked" />
<?php _e('Delete all posts and links.'); ?></label></li>
<li><input type="radio" id="delete_option1" name="delete_option" value="reassign" />
<?php echo '<label for="delete_option1">'.__('Attribute all posts and links to:')."</label> $user_dropdown"; ?></li>
- </ul>
+ </ul></fieldset>
<input type="hidden" name="action" value="dodelete" />
<p class="submit"><input type="submit" name="submit" value="<?php _e('Confirm Deletion'); ?>" class="button-secondary" /></p>
<?php else : ?>
@@ -412,6 +412,7 @@ unset($role_links);
?>
</ul>
<p id="post-search">
+ <label class="hidden" for="post-search-input"><?php _e( 'Search Users' ); ?>:</label>
<input type="text" id="post-search-input" name="usersearch" value="<?php echo attribute_escape($wp_user_search->search_term); ?>" />
<input type="submit" value="<?php _e( 'Search Users' ); ?>" class="button" />
</p>
@@ -424,7 +425,7 @@ unset($role_links);
<div class="alignleft">
<input type="submit" value="<?php _e('Remove'); ?>" name="removeit" class="button-secondary delete" />
-<select name="new_role"><option value=''><?php _e('Change role to&hellip;') ?></option>"<?php wp_dropdown_roles(); ?></select>
+<label class="hidden" for="new_role"><?php _e('Change role to&hellip;') ?></label><select name="new_role" id="new_role"><option value=''><?php _e('Change role to&hellip;') ?></option>"<?php wp_dropdown_roles(); ?></select>
<input type="submit" value="<?php _e('Change'); ?>" name="changeit" class="button-secondary" />
<?php wp_nonce_field('bulk-users'); ?>
</div>
@@ -455,7 +456,7 @@ unset($role_links);
<table class="widefat">
<thead>
<tr class="thead">
- <th scope="col" class="check-column"><input type="checkbox" onclick="checkAll(document.getElementById('posts-filter'));" /> </th>
+ <th scope="col" class="check-column"><input type="checkbox" /></th>
<th><?php _e('Username') ?></th>
<th><?php _e('Name') ?></th>
<th><?php _e('E-mail') ?></th>
@@ -487,9 +488,9 @@ foreach ( $wp_user_search->get_results() as $userid ) {
<br class="clear" />
</div>
-</form>
<?php endif; ?>
+</form>
</div>
<?php
@@ -503,6 +504,7 @@ foreach ( $wp_user_search->get_results() as $userid ) {
?>
<br class="clear" />
+<?php if ( current_user_can('create_users') ) { ?>
<?php if( apply_filters('show_adduser_fields', true) ) {?>
<div class="wrap">
@@ -529,7 +531,7 @@ foreach ( $wp_user_search->get_results() as $userid ) {
</table>
<p class="submit">
<?php echo $referer; ?>
- <input name="adduser" type="submit" id="addusersub" value="<?php _e('Add User &raquo;') ?>" />
+ <input name="adduser" type="submit" id="addusersub" value="<?php _e('Add User') ?>" />
</p>
</form>
</div>
@@ -547,6 +549,7 @@ foreach ( $wp_user_search->get_results() as $userid ) {
</div>
<?php
+}
break;
} // end of the $action switch
diff --git a/wp-admin/widgets.php b/wp-admin/widgets.php
index 5e4659e..7492276 100644
--- a/wp-admin/widgets.php
+++ b/wp-admin/widgets.php
@@ -7,6 +7,7 @@ if ( ! current_user_can('switch_themes') )
wp_die( __( 'Cheatin&#8217; uh?' ));
wp_enqueue_script( array( 'wp-lists', 'admin-widgets' ) );
+wp_admin_css( 'widgets' );
do_action( 'sidebar_admin_setup' );
@@ -234,15 +235,16 @@ if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) : ?>
<h2><?php _e( 'Widgets' ); ?></h2>
<p id="widget-search">
+ <label class="hidden" for="widget-search-input"><?php _e( 'Search Widgets' ); ?>:</label>
<input type="text" id="widget-search-input" name="s" value="<?php echo attribute_escape( $widget_search ); ?>" />
<input type="submit" class="button" value="<?php _e( 'Search Widgets' ); ?>" />
</p>
<div class="widget-liquid-left-holder">
<div id="available-widgets-filter" class="widget-liquid-left">
- <h3><?php _e('Available Widgets'); ?></h3>
+ <h3><label for="show"><?php _e('Available Widgets'); ?></label></h3>
<div class="nav">
- <select name="show">
+ <select name="show" id="show">
<?php foreach ( $show_values as $show_value => $show_text ) : $show_value = attribute_escape( $show_value ); ?>
<option value='<?php echo $show_value; ?>'<?php selected( $show_value, $show ); ?>><?php echo wp_specialchars( $show_text ); ?></option>
<?php endforeach; ?>
@@ -256,7 +258,7 @@ if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) : ?>
</div>
<div id="available-sidebars" class="widget-liquid-right">
- <h3><?php _e('Current Widgets'); ?></h3>
+ <h3><label for="sidebar-selector"><?php _e('Current Widgets'); ?></label></h3>
<div class="nav">
<select id="sidebar-selector" name="sidebar">
diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css
index 7a9283c..f61932b 100644
--- a/wp-admin/wp-admin.css
+++ b/wp-admin/wp-admin.css
@@ -1,13 +1,13 @@
-#plugins .name {
+.plugins .name {
font-weight: bold;
}
-#plugins p {
+.plugins p {
margin: 0 4px;
padding: 0;
}
-#plugins .togl {
+.plugins .togl {
width: 150px;
border-right-width: 1px;
border-right-style: solid;
@@ -52,28 +52,90 @@ form#upload #post_content {
margin: 10px 20px 10px 20px;
}
-.available-theme {
- width: 30%;
- margin: 0 1em;
- float: left;
- text-align: center;
- height: 28em;
- overflow: hidden;
+table#availablethemes {
+ border-spacing: 0px;
+ border: none;
+ border-top: 1px solid #ccc;
+ border-bottom: 1px solid #ccc;
+ margin: 10px auto;
+}
+td.available-theme {
+ vertical-align: top;
+ width: 240px;
+ margin: 0;
+ padding: 20px;
+ text-align: left;
+}
+table#availablethemes td {
+ border: 1px solid #eee;
+ border-top: none;
+}
+table#availablethemes td.top {
+ border-top: none;
+}
+table#availablethemes td.right {
+ border-right: none;
+ border-left: none;
+}
+table#availablethemes td.bottom {
+ border-bottom: none;
+}
+table#availablethemes td.left {
+ border-right: none;
+ border-left: none;
}
.available-theme a.screenshot {
- width: 250px;
- height: 200px;
+ width: 240px;
+ height: 180px;
display: block;
- margin: auto;
+ border: 1px solid #efefef;
margin-bottom: 10px;
overflow: hidden;
- border-width: 1px;
- border-style: solid;
}
-
.available-theme img {
- width: 100%;
+ width: 240px;
+}
+.available-theme h3 {
+ margin: 15px 0 5px;
+}
+
+#current-theme {
+ margin-top: 1em;
+}
+
+#current-theme a {
+ border-bottom: none;
+}
+
+#current-theme h3 {
+ font-size: 17px;
+ font-weight: normal;
+ margin: 0;
+}
+
+#current-theme .description {
+ margin-top: 5px;
+}
+
+#current-theme img {
+ float: left;
+ border: 1px solid #666;
+ margin-right: 1em;
+ margin-bottom: 1.5em;
+ width: 150px;
+}
+
+#TB_window #TB_title a.tb-theme-preview-link,
+#TB_window #TB_title a.tb-theme-preview-link:visited {
+ font-weight: bold;
+ color: #999;
+ text-decoration: none;
+}
+
+#TB_window #TB_title a.tb-theme-preview-link:hover,
+#TB_window #TB_title a.tb-theme-preview-link:focus {
+ color: #ccc;
}
.checkbox {
@@ -249,15 +311,6 @@ textarea.all-options, input.all-options {
border-collapse: separate;
}
-#currenttheme img {
- float: left;
- margin-right: 1em;
- margin-bottom: 1.5em;
- width: 300px;
- border-width: 1px;
- border-style: solid;
-}
-
#quicktags {
padding: 0;
border: 0 none;
@@ -394,26 +447,6 @@ set display:none; */
height: 22px;
}
-#your-profile fieldset {
- border-width: 1px;
- border-style: solid;
- float: left;
- width: 40%;
- padding: .5em 2em 1em;
- margin: 1em 1em 1em 0;
-}
-
-#your-profile fieldset input {
- width: 100%;
- font-size: 20px;
- padding: 2px;
-}
-
-#your-profile fieldset textarea {
- width: 100%;
- padding: 2px;
-}
-
#your-profile legend {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 22px;
@@ -894,6 +927,24 @@ html, body {
margin-right: 5px
}
+.form-table .pre {
+ padding: 8px;
+ margin: 0;
+}
+
+.pre {
+ /* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */
+ white-space: pre-wrap; /* css-3 */
+ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
+ white-space: -pre-wrap; /* Opera 4-6 */
+ white-space: -o-pre-wrap; /* Opera 7 */
+ word-wrap: break-word; /* Internet Explorer 5.5+ */
+}
+
+table.form-table td .updated {
+ font-size: 13px;
+}
+
/* Post Screen */
#tagsdiv #newtag {
@@ -970,6 +1021,7 @@ html, body {
font-size: 1.5em;
margin-bottom: 15px;
padding: 0 0 3px;
+ clear: left;
}
#poststuff h3 {
@@ -1341,6 +1393,11 @@ p#post-search {
vertical-align:text-top;
}
+.defaultavatarpicker .avatar {
+ margin: 2px 0;
+ vertical-align: middle;
+}
+
body.minwidth {
min-width: 808px;
}
@@ -1464,3 +1521,92 @@ td.action-links, th.action-links {
.hide-if-no-js {
display: none;
}
+
+/* Diff */
+
+table.diff {
+ width: 100%;
+}
+
+table.diff col.content {
+ width: 50%;
+}
+
+table.diff tr {
+ background-color: transparent;
+}
+
+table.diff td, table.diff th {
+ padding: .5em;
+ font-family: monospace;
+ border: none;
+}
+
+table.diff .diff-deletedline del, table.diff .diff-addedline ins {
+ text-decoration: none;
+}
+
+#wp-word-count {
+ display: block;
+}
+
+fieldset {
+ border: 0;
+ padding: 0;
+ margin: 0;
+}
+
+.info-box {
+ top: 100px;
+ left: 50%;
+ margin-left: -225px;
+ height: 300px;
+ width: 450px;
+ border: 5px solid #ddd;
+ background: #f8f8f8;
+ position: absolute;
+ padding: 15px 15px 10px;
+ z-index: 1000;
+ display: none;
+}
+
+.info-box .submit {
+ position: absolute;
+ bottom: 15px;
+ width: 450px;
+ padding: 15px 0 0;
+}
+
+.info-box .gears-img {
+ float: right;
+ margin: 10px;
+}
+
+.info-box-title {
+ line-height: 2;
+ margin: 0;
+ padding: 0 7px;
+}
+
+#wp_editbtns {
+ padding: 2px;
+ position: absolute;
+ display: none;
+ z-index: 999998;
+}
+
+#wp_editimgbtn, #wp_delimgbtn {
+ margin: 2px;
+ padding: 2px;
+ border: 1px solid #999;
+ background-color: #eee;
+ -moz-border-radius: 3px;
+ -khtml-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+}
+
+#wp_editimgbtn:hover, #wp_delimgbtn:hover {
+ border-color: #555;
+ background-color: #ccc;
+}
diff --git a/wp-app.php b/wp-app.php
index 52ce7b7..607bed3 100644
--- a/wp-app.php
+++ b/wp-app.php
@@ -1,26 +1,60 @@
<?php
-/*
- * wp-app.php - Atom Publishing Protocol support for WordPress
- * Original code by: Elias Torres, http://torrez.us/archives/2006/08/31/491/
- * Modified by: Dougal Campbell, http://dougal.gunters.org/
+/**
+ * Atom Publishing Protocol support for WordPress
*
- * Version: 1.0.5-dc
+ * @author Original by Elias Torres <http://torrez.us/archives/2006/08/31/491/>
+ * @author Modified by Dougal Campbell <http://dougal.gunters.org/>
+ * @version 1.0.5-dc
*/
+/**
+ * WordPress is handling an Atom Publishing Protocol request.
+ *
+ * @var bool
+ */
define('APP_REQUEST', true);
-require_once('./wp-config.php');
+/** Set up WordPress environment */
+require_once('./wp-load.php');
+
+/** Post Template API */
require_once(ABSPATH . WPINC . '/post-template.php');
+
+/** Atom Publishing Protocol Class */
require_once(ABSPATH . WPINC . '/atomlib.php');
+
+/** Feed Handling API */
require_once(ABSPATH . WPINC . '/feed.php');
$_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] );
+/**
+ * Whether to enable Atom Publishing Protocol Logging.
+ *
+ * @name app_logging
+ * @var int|bool
+ */
$app_logging = 0;
-// TODO: Should be an option somewhere
+/**
+ * Whether to always authenticate user. Permanently set to true.
+ *
+ * @name always_authenticate
+ * @var int|bool
+ * @todo Should be an option somewhere
+ */
$always_authenticate = 1;
+/**
+ * log_app() - Writes logging info to a file.
+ *
+ * @uses $app_logging
+ * @package WordPress
+ * @subpackage Logging
+ *
+ * @param string $label Type of logging
+ * @param string $msg Information describing logging reason.
+ */
function log_app($label,$msg) {
global $app_logging;
if ($app_logging) {
@@ -32,6 +66,18 @@ function log_app($label,$msg) {
}
if ( !function_exists('wp_set_current_user') ) :
+/**
+ * wp_set_current_user() - Sets the current WordPress User
+ *
+ * Pluggable function which is also found in pluggable.php.
+ *
+ * @see wp-includes/pluggable.php Documentation for this function.
+ * @uses $current_user Global of current user to test whether $id is the same.
+ *
+ * @param int $id The user's ID
+ * @param string $name Optional. The username of the user.
+ * @return WP_User Current user's User object
+ */
function wp_set_current_user($id, $name = '') {
global $current_user;
@@ -44,13 +90,26 @@ function wp_set_current_user($id, $name = '') {
}
endif;
+/**
+ * wa_posts_where_include_drafts_filter() - Filter to add more post statuses
+ *
+ * @param string $where SQL statement to filter
+ * @return string Filtered SQL statement with added post_status for where clause
+ */
function wa_posts_where_include_drafts_filter($where) {
- $where = str_replace("post_status = 'publish'","post_status = 'publish' OR post_status = 'future' OR post_status = 'draft' OR post_status = 'inherit'", $where);
- return $where;
+ $where = str_replace("post_status = 'publish'","post_status = 'publish' OR post_status = 'future' OR post_status = 'draft' OR post_status = 'inherit'", $where);
+ return $where;
}
add_filter('posts_where', 'wa_posts_where_include_drafts_filter');
+/**
+ * @internal
+ * Left undocumented to work on later. If you want to finish, then please do so.
+ *
+ * @package WordPress
+ * @subpackage Publishing
+ */
class AtomServer {
var $ATOM_CONTENT_TYPE = 'application/atom+xml';
@@ -113,7 +172,11 @@ class AtomServer {
function handle_request() {
global $always_authenticate;
- $path = $_SERVER['PATH_INFO'];
+ if( !empty( $_SERVER['ORIG_PATH_INFO'] ) )
+ $path = $_SERVER['ORIG_PATH_INFO'];
+ else
+ $path = $_SERVER['PATH_INFO'];
+
$method = $_SERVER['REQUEST_METHOD'];
log_app('REQUEST',"$method $path\n================");
@@ -170,9 +233,9 @@ class AtomServer {
$entries_url = attribute_escape($this->get_entries_url());
$categories_url = attribute_escape($this->get_categories_url());
$media_url = attribute_escape($this->get_attachments_url());
- foreach ($this->media_content_types as $med) {
- $accepted_media_types = $accepted_media_types . "<accept>" . $med . "</accept>";
- }
+ foreach ($this->media_content_types as $med) {
+ $accepted_media_types = $accepted_media_types . "<accept>" . $med . "</accept>";
+ }
$atom_prefix="atom";
$atom_blogname=get_bloginfo('name');
$service_doc = <<<EOD
diff --git a/wp-atom.php b/wp-atom.php
index 9ff49e6..136ee0e 100644
--- a/wp-atom.php
+++ b/wp-atom.php
@@ -1,7 +1,18 @@
<?php
+/**
+ * Outputs the Atom feed XML format using the feed-atom.php file in wp-includes
+ * folder. This file only sets the feed format and includes the feed-atom.php.
+ *
+ * This file is no longer used in WordPress and while it is not deprecated now.
+ * This file will most likely be deprecated or removed in a later version.
+ *
+ * The link for the atom feed is /index.php?feed=atom with permalinks off.
+ *
+ * @package WordPress
+ */
if (empty($wp)) {
- require_once('./wp-config.php');
+ require_once('./wp-load.php');
wp('feed=atom');
}
diff --git a/wp-blog-header.php b/wp-blog-header.php
index 49681f6..213ba2d 100644
--- a/wp-blog-header.php
+++ b/wp-blog-header.php
@@ -1,21 +1,26 @@
<?php
+/**
+ * Loads the WordPress environment and template.
+ *
+ * @package WordPress
+ */
-if (! isset($wp_did_header)):
-if ( !file_exists( dirname(__FILE__) . '/wp-config.php') ) {
- if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = '';
- else $path = 'wp-admin/';
- include( "index-install.php" ); // install WPMU!
- die();
-}
+if ( !isset($wp_did_header) ) {
+ if ( !file_exists( dirname(__FILE__) . '/wp-config.php') ) {
+ if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = '';
+ else $path = 'wp-admin/';
+ include( "index-install.php" ); // install WPMU!
+ die();
+ }
-$wp_did_header = true;
+ $wp_did_header = true;
-require_once( dirname(__FILE__) . '/wp-config.php');
+ require_once( dirname(__FILE__) . '/wp-load.php' );
-wp();
+ wp();
-require_once(ABSPATH . WPINC . '/template-loader.php');
+ require_once( ABSPATH . WPINC . '/template-loader.php' );
-endif;
+}
?>
diff --git a/wp-comments-post.php b/wp-comments-post.php
index f7d7c4f..6ce16fa 100644
--- a/wp-comments-post.php
+++ b/wp-comments-post.php
@@ -1,17 +1,25 @@
<?php
+/**
+ * Handles Comment Post to WordPress and prevents duplicate comment posting.
+ *
+ * @package @WordPress
+ */
+
if ( 'POST' != $_SERVER['REQUEST_METHOD'] ) {
header('Allow: POST');
header('HTTP/1.1 405 Method Not Allowed');
header('Content-Type: text/plain');
exit;
}
-require( dirname(__FILE__) . '/wp-config.php' );
+
+/** Sets up the WordPress Environment. */
+require( dirname(__FILE__) . '/wp-load.php' );
nocache_headers();
$comment_post_ID = (int) $_POST['comment_post_ID'];
-$status = $wpdb->get_row("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'");
+$status = $wpdb->get_row( $wpdb->prepare("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = %d", $comment_post_ID) );
if ( empty($status->comment_status) ) {
do_action('comment_id_not_found', $comment_post_ID);
diff --git a/wp-commentsrss2.php b/wp-commentsrss2.php
index 5f5f8b4..f3bfce5 100644
--- a/wp-commentsrss2.php
+++ b/wp-commentsrss2.php
@@ -1,7 +1,20 @@
<?php
+/**
+ * Outputs the RSS2 XML format comment feed using the feed-rss2.php file in
+ * wp-includes folder. This file only sets the feed format and includes the
+ * feed-rss2-comments.php.
+ *
+ * This file is no longer used in WordPress and while it is not deprecated now.
+ * This file will most likely be deprecated or removed in a later version.
+ *
+ * The link for the rss2 comment feed is /index.php?feed=rss2&withcomments=1
+ * with permalinks off.
+ *
+ * @package WordPress
+ */
if (empty($wp)) {
- require_once('./wp-config.php');
+ require_once('./wp-load.php');
wp('feed=rss2&withcomments=1');
}
diff --git a/wp-config-sample.php b/wp-config-sample.php
index 57540e5..11a4d30 100644
--- a/wp-config-sample.php
+++ b/wp-config-sample.php
@@ -39,6 +39,7 @@ define( "WP_USE_MULTIPLE_DB", false );
/* That's all, stop editing! Happy blogging. */
-define('ABSPATH', dirname(__FILE__).'/');
-require_once(ABSPATH.'wp-settings.php');
+if ( !defined('ABSPATH') )
+ define('ABSPATH', dirname(__FILE__) . '/');
+require_once(ABSPATH . 'wp-settings.php');
?>
diff --git a/wp-content/themes/default/comments.php b/wp-content/themes/default/comments.php
index 08b1be1..ec2f6c4 100644
--- a/wp-content/themes/default/comments.php
+++ b/wp-content/themes/default/comments.php
@@ -78,10 +78,10 @@
<?php else : ?>
-<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
+<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>
-<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
+<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
<label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>
<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
diff --git a/wp-content/themes/default/searchform.php b/wp-content/themes/default/searchform.php
index 2282083..300a1c4 100644
--- a/wp-content/themes/default/searchform.php
+++ b/wp-content/themes/default/searchform.php
@@ -1,4 +1,5 @@
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
+<label class="hidden" for="s"><?php _e('Search for:'); ?></label>
<div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
diff --git a/wp-content/themes/default/single.php b/wp-content/themes/default/single.php
index 313b52e..b3bf786 100644
--- a/wp-content/themes/default/single.php
+++ b/wp-content/themes/default/single.php
@@ -45,7 +45,7 @@
// Neither Comments, nor Pings are open ?>
Both comments and pings are currently closed.
- <?php } edit_post_link('Edit this entry.','',''); ?>
+ <?php } edit_post_link('Edit this entry','','.'); ?>
</small>
</p>
diff --git a/wp-content/themes/default/style.css b/wp-content/themes/default/style.css
index 3641f37..b927278 100644
--- a/wp-content/themes/default/style.css
+++ b/wp-content/themes/default/style.css
@@ -616,6 +616,10 @@ blockquote cite {
text-align: center;
}
+.hidden {
+ display: none;
+ }
+
hr {
display: none;
}
diff --git a/wp-cron.php b/wp-cron.php
index f60ac56..e8ac0d3 100644
--- a/wp-cron.php
+++ b/wp-cron.php
@@ -1,7 +1,24 @@
<?php
+/**
+ * WordPress Cron Implementation for hosts, which do not offer CRON or for which
+ * the user has not setup a CRON job pointing to this file.
+ *
+ * The HTTP request to this file will not slow down the visitor who happens to
+ * visit when the cron job is needed to run.
+ *
+ * @package WordPress
+ */
+
ignore_user_abort(true);
-define('DOING_CRON', TRUE);
-require_once('./wp-config.php');
+
+/**
+ * Tell WordPress we are doing the CRON task.
+ *
+ * @var bool
+ */
+define('DOING_CRON', true);
+/** Setup WordPress environment */
+require_once('./wp-load.php');
if ( $_GET['check'] != wp_hash('187425') )
exit;
@@ -15,6 +32,7 @@ $crons = _get_cron_array();
$keys = array_keys($crons);
if (!is_array($crons) || $keys[0] > time())
return;
+
foreach ($crons as $timestamp => $cronhooks) {
if ($timestamp > time()) break;
foreach ($cronhooks as $hook => $keys) {
diff --git a/wp-feed.php b/wp-feed.php
index 260ddd4..d4f1a5b 100644
--- a/wp-feed.php
+++ b/wp-feed.php
@@ -1,4 +1,18 @@
<?php
+/**
+ * Outputs the RSS2 feed XML format. This file is a shortcut or compatibility
+ * layer for easily finding the RSS feed for the site. It loads WordPress using
+ * the wp-blog-header.php file and running do_feed() function.
+ *
+ * @see do_feed() Used to display the RSS2 feed
+ *
+ * This file is no longer used in WordPress and while it is not deprecated now.
+ * This file will most likely be deprecated or removed in a later version.
+ *
+ * The link for the rss2 feed is /index.php?feed=rss2 with permalinks off.
+ *
+ * @package WordPress
+ */
if (empty($doing_rss)) {
$doing_rss = 1;
diff --git a/wp-includes/Text/Diff.php b/wp-includes/Text/Diff.php
new file mode 100644
index 0000000..f8a974c
--- /dev/null
+++ b/wp-includes/Text/Diff.php
@@ -0,0 +1,413 @@
+<?php
+/**
+ * General API for generating and formatting diffs - the differences between
+ * two sequences of strings.
+ *
+ * The original PHP version of this code was written by Geoffrey T. Dairiki
+ * <dairiki@dairiki.org>, and is used/adapted with his permission.
+ *
+ * $Horde: framework/Text_Diff/Diff.php,v 1.26 2008/01/04 10:07:49 jan Exp $
+ *
+ * Copyright 2004 Geoffrey T. Dairiki <dairiki@dairiki.org>
+ * Copyright 2004-2008 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you did
+ * not receive this file, see http://opensource.org/licenses/lgpl-license.php.
+ *
+ * @package Text_Diff
+ * @author Geoffrey T. Dairiki <dairiki@dairiki.org>
+ */
+class Text_Diff {
+
+ /**
+ * Array of changes.
+ *
+ * @var array
+ */
+ var $_edits;
+
+ /**
+ * Computes diffs between sequences of strings.
+ *
+ * @param string $engine Name of the diffing engine to use. 'auto'
+ * will automatically select the best.
+ * @param array $params Parameters to pass to the diffing engine.
+ * Normally an array of two arrays, each
+ * containing the lines from a file.
+ */
+ function Text_Diff($engine, $params)
+ {
+ // Backward compatibility workaround.
+ if (!is_string($engine)) {
+ $params = array($engine, $params);
+ $engine = 'auto';
+ }
+
+ if ($engine == 'auto') {
+ $engine = extension_loaded('xdiff') ? 'xdiff' : 'native';
+ } else {
+ $engine = basename($engine);
+ }
+
+ require_once 'Text/Diff/Engine/' . $engine . '.php';
+ $class = 'Text_Diff_Engine_' . $engine;
+ $diff_engine = new $class();
+
+ $this->_edits = call_user_func_array(array($diff_engine, 'diff'), $params);
+ }
+
+ /**
+ * Returns the array of differences.
+ */
+ function getDiff()
+ {
+ return $this->_edits;
+ }
+
+ /**
+ * Computes a reversed diff.
+ *
+ * Example:
+ * <code>
+ * $diff = new Text_Diff($lines1, $lines2);
+ * $rev = $diff->reverse();
+ * </code>
+ *
+ * @return Text_Diff A Diff object representing the inverse of the
+ * original diff. Note that we purposely don't return a
+ * reference here, since this essentially is a clone()
+ * method.
+ */
+ function reverse()
+ {
+ if (version_compare(zend_version(), '2', '>')) {
+ $rev = clone($this);
+ } else {
+ $rev = $this;
+ }
+ $rev->_edits = array();
+ foreach ($this->_edits as $edit) {
+ $rev->_edits[] = $edit->reverse();
+ }
+ return $rev;
+ }
+
+ /**
+ * Checks for an empty diff.
+ *
+ * @return boolean True if two sequences were identical.
+ */
+ function isEmpty()
+ {
+ foreach ($this->_edits as $edit) {
+ if (!is_a($edit, 'Text_Diff_Op_copy')) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Computes the length of the Longest Common Subsequence (LCS).
+ *
+ * This is mostly for diagnostic purposes.
+ *
+ * @return integer The length of the LCS.
+ */
+ function lcs()
+ {
+ $lcs = 0;
+ foreach ($this->_edits as $edit) {
+ if (is_a($edit, 'Text_Diff_Op_copy')) {
+ $lcs += count($edit->orig);
+ }
+ }
+ return $lcs;
+ }
+
+ /**
+ * Gets the original set of lines.
+ *
+ * This reconstructs the $from_lines parameter passed to the constructor.
+ *
+ * @return array The original sequence of strings.
+ */
+ function getOriginal()
+ {
+ $lines = array();
+ foreach ($this->_edits as $edit) {
+ if ($edit->orig) {
+ array_splice($lines, count($lines), 0, $edit->orig);
+ }
+ }
+ return $lines;
+ }
+
+ /**
+ * Gets the final set of lines.
+ *
+ * This reconstructs the $to_lines parameter passed to the constructor.
+ *
+ * @return array The sequence of strings.
+ */
+ function getFinal()
+ {
+ $lines = array();
+ foreach ($this->_edits as $edit) {
+ if ($edit->final) {
+ array_splice($lines, count($lines), 0, $edit->final);
+ }
+ }
+ return $lines;
+ }
+
+ /**
+ * Removes trailing newlines from a line of text. This is meant to be used
+ * with array_walk().
+ *
+ * @param string $line The line to trim.
+ * @param integer $key The index of the line in the array. Not used.
+ */
+ function trimNewlines(&$line, $key)
+ {
+ $line = str_replace(array("\n", "\r"), '', $line);
+ }
+
+ /**
+ * Determines the location of the system temporary directory.
+ *
+ * @static
+ *
+ * @access protected
+ *
+ * @return string A directory name which can be used for temp files.
+ * Returns false if one could not be found.
+ */
+ function _getTempDir()
+ {
+ $tmp_locations = array('/tmp', '/var/tmp', 'c:\WUTemp', 'c:\temp',
+ 'c:\windows\temp', 'c:\winnt\temp');
+
+ /* Try PHP's upload_tmp_dir directive. */
+ $tmp = ini_get('upload_tmp_dir');
+
+ /* Otherwise, try to determine the TMPDIR environment variable. */
+ if (!strlen($tmp)) {
+ $tmp = getenv('TMPDIR');
+ }
+
+ /* If we still cannot determine a value, then cycle through a list of
+ * preset possibilities. */
+ while (!strlen($tmp) && count($tmp_locations)) {
+ $tmp_check = array_shift($tmp_locations);
+ if (@is_dir($tmp_check)) {
+ $tmp = $tmp_check;
+ }
+ }
+
+ /* If it is still empty, we have failed, so return false; otherwise
+ * return the directory determined. */
+ return strlen($tmp) ? $tmp : false;
+ }
+
+ /**
+ * Checks a diff for validity.
+ *
+ * This is here only for debugging purposes.
+ */
+ function _check($from_lines, $to_lines)
+ {
+ if (serialize($from_lines) != serialize($this->getOriginal())) {
+ trigger_error("Reconstructed original doesn't match", E_USER_ERROR);
+ }
+ if (serialize($to_lines) != serialize($this->getFinal())) {
+ trigger_error("Reconstructed final doesn't match", E_USER_ERROR);
+ }
+
+ $rev = $this->reverse();
+ if (serialize($to_lines) != serialize($rev->getOriginal())) {
+ trigger_error("Reversed original doesn't match", E_USER_ERROR);
+ }
+ if (serialize($from_lines) != serialize($rev->getFinal())) {
+ trigger_error("Reversed final doesn't match", E_USER_ERROR);
+ }
+
+ $prevtype = null;
+ foreach ($this->_edits as $edit) {
+ if ($prevtype == get_class($edit)) {
+ trigger_error("Edit sequence is non-optimal", E_USER_ERROR);
+ }
+ $prevtype = get_class($edit);
+ }
+
+ return true;
+ }
+
+}
+
+/**
+ * @package Text_Diff
+ * @author Geoffrey T. Dairiki <dairiki@dairiki.org>
+ */
+class Text_MappedDiff extends Text_Diff {
+
+ /**
+ * Computes a diff between sequences of strings.
+ *
+ * This can be used to compute things like case-insensitve diffs, or diffs
+ * which ignore changes in white-space.
+ *
+ * @param array $from_lines An array of strings.
+ * @param array $to_lines An array of strings.
+ * @param array $mapped_from_lines This array should have the same size
+ * number of elements as $from_lines. The
+ * elements in $mapped_from_lines and
+ * $mapped_to_lines are what is actually
+ * compared when computing the diff.
+ * @param array $mapped_to_lines This array should have the same number
+ * of elements as $to_lines.
+ */
+ function Text_MappedDiff($from_lines, $to_lines,
+ $mapped_from_lines, $mapped_to_lines)
+ {
+ assert(count($from_lines) == count($mapped_from_lines));
+ assert(count($to_lines) == count($mapped_to_lines));
+
+ parent::Text_Diff($mapped_from_lines, $mapped_to_lines);
+
+ $xi = $yi = 0;
+ for ($i = 0; $i < count($this->_edits); $i++) {
+ $orig = &$this->_edits[$i]->orig;
+ if (is_array($orig)) {
+ $orig = array_slice($from_lines, $xi, count($orig));
+ $xi += count($orig);
+ }
+
+ $final = &$this->_edits[$i]->final;
+ if (is_array($final)) {
+ $final = array_slice($to_lines, $yi, count($final));
+ $yi += count($final);
+ }
+ }
+ }
+
+}
+
+/**
+ * @package Text_Diff
+ * @author Geoffrey T. Dairiki <dairiki@dairiki.org>
+ *
+ * @access private
+ */
+class Text_Diff_Op {
+
+ var $orig;
+ var $final;
+
+ function &reverse()
+ {
+ trigger_error('Abstract method', E_USER_ERROR);
+ }
+
+ function norig()
+ {
+ return $this->orig ? count($this->orig) : 0;
+ }
+
+ function nfinal()
+ {
+ return $this->final ? count($this->final) : 0;
+ }
+
+}
+
+/**
+ * @package Text_Diff
+ * @author Geoffrey T. Dairiki <dairiki@dairiki.org>
+ *
+ * @access private
+ */
+class Text_Diff_Op_copy extends Text_Diff_Op {
+
+ function Text_Diff_Op_copy($orig, $final = false)
+ {
+ if (!is_array($final)) {
+ $final = $orig;
+ }
+ $this->orig = $orig;
+ $this->final = $final;
+ }
+
+ function &reverse()
+ {
+ $reverse = &new Text_Diff_Op_copy($this->final, $this->orig);
+ return $reverse;
+ }
+
+}
+
+/**
+ * @package Text_Diff
+ * @author Geoffrey T. Dairiki <dairiki@dairiki.org>
+ *
+ * @access private
+ */
+class Text_Diff_Op_delete extends Text_Diff_Op {
+
+ function Text_Diff_Op_delete($lines)
+ {
+ $this->orig = $lines;
+ $this->final = false;
+ }
+
+ function &reverse()
+ {
+ $reverse = &new Text_Diff_Op_add($this->orig);
+ return $reverse;
+ }
+
+}
+
+/**
+ * @package Text_Diff
+ * @author Geoffrey T. Dairiki <dairiki@dairiki.org>
+ *
+ * @access private
+ */
+class Text_Diff_Op_add extends Text_Diff_Op {
+
+ function Text_Diff_Op_add($lines)
+ {
+ $this->final = $lines;
+ $this->orig = false;
+ }
+
+ function &reverse()
+ {
+ $reverse = &new Text_Diff_Op_delete($this->final);
+ return $reverse;
+ }
+
+}
+
+/**
+ * @package Text_Diff
+ * @author Geoffrey T. Dairiki <dairiki@dairiki.org>
+ *
+ * @access private
+ */
+class Text_Diff_Op_change extends Text_Diff_Op {
+
+ function Text_Diff_Op_change($orig, $final)
+ {
+ $this->orig = $orig;
+ $this->final = $final;
+ }
+
+ function &reverse()
+ {
+ $reverse = &new Text_Diff_Op_change($this->final, $this->orig);
+ return $reverse;
+ }
+
+}
diff --git a/wp-includes/Text/Diff/Engine/native.php b/wp-includes/Text/Diff/Engine/native.php
new file mode 100644
index 0000000..aa5bca5
--- /dev/null
+++ b/wp-includes/Text/Diff/Engine/native.php
@@ -0,0 +1,437 @@
+<?php
+/**
+ * $Horde: framework/Text_Diff/Diff/Engine/native.php,v 1.10 2008/01/04 10:27:53 jan Exp $
+ *
+ * Class used internally by Text_Diff to actually compute the diffs. This
+ * class is implemented using native PHP code.
+ *
+ * The algorithm used here is mostly lifted from the perl module
+ * Algorithm::Diff (version 1.06) by Ned Konz, which is available at:
+ * http://www.perl.com/CPAN/authors/id/N/NE/NEDKONZ/Algorithm-Diff-1.06.zip
+ *
+ * More ideas are taken from: http://www.ics.uci.edu/~eppstein/161/960229.html
+ *
+ * Some ideas (and a bit of code) are taken from analyze.c, of GNU
+ * diffutils-2.7, which can be found at:
+ * ftp://gnudist.gnu.org/pub/gnu/diffutils/diffutils-2.7.tar.gz
+ *
+ * Some ideas (subdivision by NCHUNKS > 2, and some optimizations) are from
+ * Geoffrey T. Dairiki <dairiki@dairiki.org>. The original PHP version of this
+ * code was written by him, and is used/adapted with his permission.
+ *
+ * Copyright 2004-2008 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you did
+ * not receive this file, see http://opensource.org/licenses/lgpl-license.php.
+ *
+ * @author Geoffrey T. Dairiki <dairiki@dairiki.org>
+ * @package Text_Diff
+ */
+class Text_Diff_Engine_native {
+
+ function diff($from_lines, $to_lines)
+ {
+ array_walk($from_lines, array('Text_Diff', 'trimNewlines'));
+ array_walk($to_lines, array('Text_Diff', 'trimNewlines'));
+
+ $n_from = count($from_lines);
+ $n_to = count($to_lines);
+
+ $this->xchanged = $this->ychanged = array();
+ $this->xv = $this->yv = array();
+ $this->xind = $this->yind = array();
+ unset($this->seq);
+ unset($this->in_seq);
+ unset($this->lcs);
+
+ // Skip leading common lines.
+ for ($skip = 0; $skip < $n_from && $skip < $n_to; $skip++) {
+ if ($from_lines[$skip] !== $to_lines[$skip]) {
+ break;
+ }
+ $this->xchanged[$skip] = $this->ychanged[$skip] = false;
+ }
+
+ // Skip trailing common lines.
+ $xi = $n_from; $yi = $n_to;
+ for ($endskip = 0; --$xi > $skip && --$yi > $skip; $endskip++) {
+ if ($from_lines[$xi] !== $to_lines[$yi]) {
+ break;
+ }
+ $this->xchanged[$xi] = $this->ychanged[$yi] = false;
+ }
+
+ // Ignore lines which do not exist in both files.
+ for ($xi = $skip; $xi < $n_from - $endskip; $xi++) {
+ $xhash[$from_lines[$xi]] = 1;
+ }
+ for ($yi = $skip; $yi < $n_to - $endskip; $yi++) {
+ $line = $to_lines[$yi];
+ if (($this->ychanged[$yi] = empty($xhash[$line]))) {
+ continue;
+ }
+ $yhash[$line] = 1;
+ $this->yv[] = $line;
+ $this->yind[] = $yi;
+ }
+ for ($xi = $skip; $xi < $n_from - $endskip; $xi++) {
+ $line = $from_lines[$xi];
+ if (($this->xchanged[$xi] = empty($yhash[$line]))) {
+ continue;
+ }
+ $this->xv[] = $line;
+ $this->xind[] = $xi;
+ }
+
+ // Find the LCS.
+ $this->_compareseq(0, count($this->xv), 0, count($this->yv));
+
+ // Merge edits when possible.
+ $this->_shiftBoundaries($from_lines, $this->xchanged, $this->ychanged);
+ $this->_shiftBoundaries($to_lines, $this->ychanged, $this->xchanged);
+
+ // Compute the edit operations.
+ $edits = array();
+ $xi = $yi = 0;
+ while ($xi < $n_from || $yi < $n_to) {
+ assert($yi < $n_to || $this->xchanged[$xi]);
+ assert($xi < $n_from || $this->ychanged[$yi]);
+
+ // Skip matching "snake".
+ $copy = array();
+ while ($xi < $n_from && $yi < $n_to
+ && !$this->xchanged[$xi] && !$this->ychanged[$yi]) {
+ $copy[] = $from_lines[$xi++];
+ ++$yi;
+ }
+ if ($copy) {
+ $edits[] = &new Text_Diff_Op_copy($copy);
+ }
+
+ // Find deletes & adds.
+ $delete = array();
+ while ($xi < $n_from && $this->xchanged[$xi]) {
+ $delete[] = $from_lines[$xi++];
+ }
+
+ $add = array();
+ while ($yi < $n_to && $this->ychanged[$yi]) {
+ $add[] = $to_lines[$yi++];
+ }
+
+ if ($delete && $add) {
+ $edits[] = &new Text_Diff_Op_change($delete, $add);
+ } elseif ($delete) {
+ $edits[] = &new Text_Diff_Op_delete($delete);
+ } elseif ($add) {
+ $edits[] = &new Text_Diff_Op_add($add);
+ }
+ }
+
+ return $edits;
+ }
+
+ /**
+ * Divides the Largest Common Subsequence (LCS) of the sequences (XOFF,
+ * XLIM) and (YOFF, YLIM) into NCHUNKS approximately equally sized
+ * segments.
+ *
+ * Returns (LCS, PTS). LCS is the length of the LCS. PTS is an array of
+ * NCHUNKS+1 (X, Y) indexes giving the diving points between sub
+ * sequences. The first sub-sequence is contained in (X0, X1), (Y0, Y1),
+ * the second in (X1, X2), (Y1, Y2) and so on. Note that (X0, Y0) ==
+ * (XOFF, YOFF) and (X[NCHUNKS], Y[NCHUNKS]) == (XLIM, YLIM).
+ *
+ * This function assumes that the first lines of the specified portions of
+ * the two files do not match, and likewise that the last lines do not
+ * match. The caller must trim matching lines from the beginning and end
+ * of the portions it is going to specify.
+ */
+ function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks)
+ {
+ $flip = false;
+
+ if ($xlim - $xoff > $ylim - $yoff) {
+ /* Things seems faster (I'm not sure I understand why) when the
+ * shortest sequence is in X. */
+ $flip = true;
+ list ($xoff, $xlim, $yoff, $ylim)
+ = array($yoff, $ylim, $xoff, $xlim);
+ }
+
+ if ($flip) {
+ for ($i = $ylim - 1; $i >= $yoff; $i--) {
+ $ymatches[$this->xv[$i]][] = $i;
+ }
+ } else {
+ for ($i = $ylim - 1; $i >= $yoff; $i--) {
+ $ymatches[$this->yv[$i]][] = $i;
+ }
+ }
+
+ $this->lcs = 0;
+ $this->seq[0]= $yoff - 1;
+ $this->in_seq = array();
+ $ymids[0] = array();
+
+ $numer = $xlim - $xoff + $nchunks - 1;
+ $x = $xoff;
+ for ($chunk = 0; $chunk < $nchunks; $chunk++) {
+ if ($chunk > 0) {
+ for ($i = 0; $i <= $this->lcs; $i++) {
+ $ymids[$i][$chunk - 1] = $this->seq[$i];
+ }
+ }
+
+ $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $chunk) / $nchunks);
+ for (; $x < $x1; $x++) {
+ $line = $flip ? $this->yv[$x] : $this->xv[$x];
+ if (empty($ymatches[$line])) {
+ continue;
+ }
+ $matches = $ymatches[$line];
+ reset($matches);
+ while (list(, $y) = each($matches)) {
+ if (empty($this->in_seq[$y])) {
+ $k = $this->_lcsPos($y);
+ assert($k > 0);
+ $ymids[$k] = $ymids[$k - 1];
+ break;
+ }
+ }
+ while (list(, $y) = each($matches)) {
+ if ($y > $this->seq[$k - 1]) {
+ assert($y <= $this->seq[$k]);
+ /* Optimization: this is a common case: next match is
+ * just replacing previous match. */
+ $this->in_seq[$this->seq[$k]] = false;
+ $this->seq[$k] = $y;
+ $this->in_seq[$y] = 1;
+ } elseif (empty($this->in_seq[$y])) {
+ $k = $this->_lcsPos($y);
+ assert($k > 0);
+ $ymids[$k] = $ymids[$k - 1];
+ }
+ }
+ }
+ }
+
+ $seps[] = $flip ? array($yoff, $xoff) : array($xoff, $yoff);
+ $ymid = $ymids[$this->lcs];
+ for ($n = 0; $n < $nchunks - 1; $n++) {
+ $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $n) / $nchunks);
+ $y1 = $ymid[$n] + 1;
+ $seps[] = $flip ? array($y1, $x1) : array($x1, $y1);
+ }
+ $seps[] = $flip ? array($ylim, $xlim) : array($xlim, $ylim);
+
+ return array($this->lcs, $seps);
+ }
+
+ function _lcsPos($ypos)
+ {
+ $end = $this->lcs;
+ if ($end == 0 || $ypos > $this->seq[$end]) {
+ $this->seq[++$this->lcs] = $ypos;
+ $this->in_seq[$ypos] = 1;
+ return $this->lcs;
+ }
+
+ $beg = 1;
+ while ($beg < $end) {
+ $mid = (int)(($beg + $end) / 2);
+ if ($ypos > $this->seq[$mid]) {
+ $beg = $mid + 1;
+ } else {
+ $end = $mid;
+ }
+ }
+
+ assert($ypos != $this->seq[$end]);
+
+ $this->in_seq[$this->seq[$end]] = false;
+ $this->seq[$end] = $ypos;
+ $this->in_seq[$ypos] = 1;
+ return $end;
+ }
+
+ /**
+ * Finds LCS of two sequences.
+ *
+ * The results are recorded in the vectors $this->{x,y}changed[], by
+ * storing a 1 in the element for each line that is an insertion or
+ * deletion (ie. is not in the LCS).
+ *
+ * The subsequence of file 0 is (XOFF, XLIM) and likewise for file 1.
+ *
+ * Note that XLIM, YLIM are exclusive bounds. All line numbers are
+ * origin-0 and discarded lines are not counted.
+ */
+ function _compareseq ($xoff, $xlim, $yoff, $ylim)
+ {
+ /* Slide down the bottom initial diagonal. */
+ while ($xoff < $xlim && $yoff < $ylim
+ && $this->xv[$xoff] == $this->yv[$yoff]) {
+ ++$xoff;
+ ++$yoff;
+ }
+
+ /* Slide up the top initial diagonal. */
+ while ($xlim > $xoff && $ylim > $yoff
+ && $this->xv[$xlim - 1] == $this->yv[$ylim - 1]) {
+ --$xlim;
+ --$ylim;
+ }
+
+ if ($xoff == $xlim || $yoff == $ylim) {
+ $lcs = 0;
+ } else {
+ /* This is ad hoc but seems to work well. $nchunks =
+ * sqrt(min($xlim - $xoff, $ylim - $yoff) / 2.5); $nchunks =
+ * max(2,min(8,(int)$nchunks)); */
+ $nchunks = min(7, $xlim - $xoff, $ylim - $yoff) + 1;
+ list($lcs, $seps)
+ = $this->_diag($xoff, $xlim, $yoff, $ylim, $nchunks);
+ }
+
+ if ($lcs == 0) {
+ /* X and Y sequences have no common subsequence: mark all
+ * changed. */
+ while ($yoff < $ylim) {
+ $this->ychanged[$this->yind[$yoff++]] = 1;
+ }
+ while ($xoff < $xlim) {
+ $this->xchanged[$this->xind[$xoff++]] = 1;
+ }
+ } else {
+ /* Use the partitions to split this problem into subproblems. */
+ reset($seps);
+ $pt1 = $seps[0];
+ while ($pt2 = next($seps)) {
+ $this->_compareseq ($pt1[0], $pt2[0], $pt1[1], $pt2[1]);
+ $pt1 = $pt2;
+ }
+ }
+ }
+
+ /**
+ * Adjusts inserts/deletes of identical lines to join changes as much as
+ * possible.
+ *
+ * We do something when a run of changed lines include a line at one end
+ * and has an excluded, identical line at the other. We are free to
+ * choose which identical line is included. `compareseq' usually chooses
+ * the one at the beginning, but usually it is cleaner to consider the
+ * following identical line to be the "change".
+ *
+ * This is extracted verbatim from analyze.c (GNU diffutils-2.7).
+ */
+ function _shiftBoundaries($lines, &$changed, $other_changed)
+ {
+ $i = 0;
+ $j = 0;
+
+ assert('count($lines) == count($changed)');
+ $len = count($lines);
+ $other_len = count($other_changed);
+
+ while (1) {
+ /* Scan forward to find the beginning of another run of
+ * changes. Also keep track of the corresponding point in the
+ * other file.
+ *
+ * Throughout this code, $i and $j are adjusted together so that
+ * the first $i elements of $changed and the first $j elements of
+ * $other_changed both contain the same number of zeros (unchanged
+ * lines).
+ *
+ * Furthermore, $j is always kept so that $j == $other_len or
+ * $other_changed[$j] == false. */
+ while ($j < $other_len && $other_changed[$j]) {
+ $j++;
+ }
+
+ while ($i < $len && ! $changed[$i]) {
+ assert('$j < $other_len && ! $other_changed[$j]');
+ $i++; $j++;
+ while ($j < $other_len && $other_changed[$j]) {
+ $j++;
+ }
+ }
+
+ if ($i == $len) {
+ break;
+ }
+
+ $start = $i;
+
+ /* Find the end of this run of changes. */
+ while (++$i < $len && $changed[$i]) {
+ continue;
+ }
+
+ do {
+ /* Record the length of this run of changes, so that we can
+ * later determine whether the run has grown. */
+ $runlength = $i - $start;
+
+ /* Move the changed region back, so long as the previous
+ * unchanged line matches the last changed one. This merges
+ * with previous changed regions. */
+ while ($start > 0 && $lines[$start - 1] == $lines[$i - 1]) {
+ $changed[--$start] = 1;
+ $changed[--$i] = false;
+ while ($start > 0 && $changed[$start - 1]) {
+ $start--;
+ }
+ assert('$j > 0');
+ while ($other_changed[--$j]) {
+ continue;
+ }
+ assert('$j >= 0 && !$other_changed[$j]');
+ }
+
+ /* Set CORRESPONDING to the end of the changed run, at the
+ * last point where it corresponds to a changed run in the
+ * other file. CORRESPONDING == LEN means no such point has
+ * been found. */
+ $corresponding = $j < $other_len ? $i : $len;
+
+ /* Move the changed region forward, so long as the first
+ * changed line matches the following unchanged one. This
+ * merges with following changed regions. Do this second, so
+ * that if there are no merges, the changed region is moved
+ * forward as far as possible. */
+ while ($i < $len && $lines[$start] == $lines[$i]) {
+ $changed[$start++] = false;
+ $changed[$i++] = 1;
+ while ($i < $len && $changed[$i]) {
+ $i++;
+ }
+
+ assert('$j < $other_len && ! $other_changed[$j]');
+ $j++;
+ if ($j < $other_len && $other_changed[$j]) {
+ $corresponding = $i;
+ while ($j < $other_len && $other_changed[$j]) {
+ $j++;
+ }
+ }
+ }
+ } while ($runlength != $i - $start);
+
+ /* If possible, move the fully-merged run of changes back to a
+ * corresponding run in the other file. */
+ while ($corresponding < $i) {
+ $changed[--$start] = 1;
+ $changed[--$i] = 0;
+ assert('$j > 0');
+ while ($other_changed[--$j]) {
+ continue;
+ }
+ assert('$j >= 0 && !$other_changed[$j]');
+ }
+ }
+ }
+
+}
diff --git a/wp-includes/Text/Diff/Engine/shell.php b/wp-includes/Text/Diff/Engine/shell.php
new file mode 100644
index 0000000..7e9629f
--- /dev/null
+++ b/wp-includes/Text/Diff/Engine/shell.php
@@ -0,0 +1,164 @@
+<?php
+/**
+ * Class used internally by Diff to actually compute the diffs.
+ *
+ * This class uses the Unix `diff` program via shell_exec to compute the
+ * differences between the two input arrays.
+ *
+ * $Horde: framework/Text_Diff/Diff/Engine/shell.php,v 1.8 2008/01/04 10:07:50 jan Exp $
+ *
+ * Copyright 2007-2008 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you did
+ * not receive this file, see http://opensource.org/licenses/lgpl-license.php.
+ *
+ * @author Milian Wolff <mail@milianw.de>
+ * @package Text_Diff
+ * @since 0.3.0
+ */
+class Text_Diff_Engine_shell {
+
+ /**
+ * Path to the diff executable
+ *
+ * @var string
+ */
+ var $_diffCommand = 'diff';
+
+ /**
+ * Returns the array of differences.
+ *
+ * @param array $from_lines lines of text from old file
+ * @param array $to_lines lines of text from new file
+ *
+ * @return array all changes made (array with Text_Diff_Op_* objects)
+ */
+ function diff($from_lines, $to_lines)
+ {
+ array_walk($from_lines, array('Text_Diff', 'trimNewlines'));
+ array_walk($to_lines, array('Text_Diff', 'trimNewlines'));
+
+ $temp_dir = Text_Diff::_getTempDir();
+
+ // Execute gnu diff or similar to get a standard diff file.
+ $from_file = tempnam($temp_dir, 'Text_Diff');
+ $to_file = tempnam($temp_dir, 'Text_Diff');
+ $fp = fopen($from_file, 'w');
+ fwrite($fp, implode("\n", $from_lines));
+ fclose($fp);
+ $fp = fopen($to_file, 'w');
+ fwrite($fp, implode("\n", $to_lines));
+ fclose($fp);
+ $diff = shell_exec($this->_diffCommand . ' ' . $from_file . ' ' . $to_file);
+ unlink($from_file);
+ unlink($to_file);
+
+ if (is_null($diff)) {
+ // No changes were made
+ return array(new Text_Diff_Op_copy($from_lines));
+ }
+
+ $from_line_no = 1;
+ $to_line_no = 1;
+ $edits = array();
+
+ // Get changed lines by parsing something like:
+ // 0a1,2
+ // 1,2c4,6
+ // 1,5d6
+ preg_match_all('#^(\d+)(?:,(\d+))?([adc])(\d+)(?:,(\d+))?$#m', $diff,
+ $matches, PREG_SET_ORDER);
+
+ foreach ($matches as $match) {
+ if (!isset($match[5])) {
+ // This paren is not set every time (see regex).
+ $match[5] = false;
+ }
+
+ if ($match[3] == 'a') {
+ $from_line_no--;
+ }
+
+ if ($match[3] == 'd') {
+ $to_line_no--;
+ }
+
+ if ($from_line_no < $match[1] || $to_line_no < $match[4]) {
+ // copied lines
+ assert('$match[1] - $from_line_no == $match[4] - $to_line_no');
+ array_push($edits,
+ new Text_Diff_Op_copy(
+ $this->_getLines($from_lines, $from_line_no, $match[1] - 1),
+ $this->_getLines($to_lines, $to_line_no, $match[4] - 1)));
+ }
+
+ switch ($match[3]) {
+ case 'd':
+ // deleted lines
+ array_push($edits,
+ new Text_Diff_Op_delete(
+ $this->_getLines($from_lines, $from_line_no, $match[2])));
+ $to_line_no++;
+ break;
+
+ case 'c':
+ // changed lines
+ array_push($edits,
+ new Text_Diff_Op_change(
+ $this->_getLines($from_lines, $from_line_no, $match[2]),
+ $this->_getLines($to_lines, $to_line_no, $match[5])));
+ break;
+
+ case 'a':
+ // added lines
+ array_push($edits,
+ new Text_Diff_Op_add(
+ $this->_getLines($to_lines, $to_line_no, $match[5])));
+ $from_line_no++;
+ break;
+ }
+ }
+
+ if (!empty($from_lines)) {
+ // Some lines might still be pending. Add them as copied
+ array_push($edits,
+ new Text_Diff_Op_copy(
+ $this->_getLines($from_lines, $from_line_no,
+ $from_line_no + count($from_lines) - 1),
+ $this->_getLines($to_lines, $to_line_no,
+ $to_line_no + count($to_lines) - 1)));
+ }
+
+ return $edits;
+ }
+
+ /**
+ * Get lines from either the old or new text
+ *
+ * @access private
+ *
+ * @param array &$text_lines Either $from_lines or $to_lines
+ * @param int &$line_no Current line number
+ * @param int $end Optional end line, when we want to chop more
+ * than one line.
+ *
+ * @return array The chopped lines
+ */
+ function _getLines(&$text_lines, &$line_no, $end = false)
+ {
+ if (!empty($end)) {
+ $lines = array();
+ // We can shift even more
+ while ($line_no <= $end) {
+ array_push($lines, array_shift($text_lines));
+ $line_no++;
+ }
+ } else {
+ $lines = array(array_shift($text_lines));
+ $line_no++;
+ }
+
+ return $lines;
+ }
+
+}
diff --git a/wp-includes/Text/Diff/Engine/string.php b/wp-includes/Text/Diff/Engine/string.php
new file mode 100644
index 0000000..1a0bd3f
--- /dev/null
+++ b/wp-includes/Text/Diff/Engine/string.php
@@ -0,0 +1,234 @@
+<?php
+/**
+ * Parses unified or context diffs output from eg. the diff utility.
+ *
+ * Example:
+ * <code>
+ * $patch = file_get_contents('example.patch');
+ * $diff = new Text_Diff('string', array($patch));
+ * $renderer = new Text_Diff_Renderer_inline();
+ * echo $renderer->render($diff);
+ * </code>
+ *
+ * $Horde: framework/Text_Diff/Diff/Engine/string.php,v 1.7 2008/01/04 10:07:50 jan Exp $
+ *
+ * Copyright 2005 Örjan Persson <o@42mm.org>
+ * Copyright 2005-2008 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you did
+ * not receive this file, see http://opensource.org/licenses/lgpl-license.php.
+ *
+ * @author Örjan Persson <o@42mm.org>
+ * @package Text_Diff
+ * @since 0.2.0
+ */
+class Text_Diff_Engine_string {
+
+ /**
+ * Parses a unified or context diff.
+ *
+ * First param contains the whole diff and the second can be used to force
+ * a specific diff type. If the second parameter is 'autodetect', the
+ * diff will be examined to find out which type of diff this is.
+ *
+ * @param string $diff The diff content.
+ * @param string $mode The diff mode of the content in $diff. One of
+ * 'context', 'unified', or 'autodetect'.
+ *
+ * @return array List of all diff operations.
+ */
+ function diff($diff, $mode = 'autodetect')
+ {
+ if ($mode != 'autodetect' && $mode != 'context' && $mode != 'unified') {
+ return PEAR::raiseError('Type of diff is unsupported');
+ }
+
+ if ($mode == 'autodetect') {
+ $context = strpos($diff, '***');
+ $unified = strpos($diff, '---');
+ if ($context === $unified) {
+ return PEAR::raiseError('Type of diff could not be detected');
+ } elseif ($context === false || $context === false) {
+ $mode = $context !== false ? 'context' : 'unified';
+ } else {
+ $mode = $context < $unified ? 'context' : 'unified';
+ }
+ }
+
+ // split by new line and remove the diff header
+ $diff = explode("\n", $diff);
+ array_shift($diff);
+ array_shift($diff);
+
+ if ($mode == 'context') {
+ return $this->parseContextDiff($diff);
+ } else {
+ return $this->parseUnifiedDiff($diff);
+ }
+ }
+
+ /**
+ * Parses an array containing the unified diff.
+ *
+ * @param array $diff Array of lines.
+ *
+ * @return array List of all diff operations.
+ */
+ function parseUnifiedDiff($diff)
+ {
+ $edits = array();
+ $end = count($diff) - 1;
+ for ($i = 0; $i < $end;) {
+ $diff1 = array();
+ switch (substr($diff[$i], 0, 1)) {
+ case ' ':
+ do {
+ $diff1[] = substr($diff[$i], 1);
+ } while (++$i < $end && substr($diff[$i], 0, 1) == ' ');
+ $edits[] = &new Text_Diff_Op_copy($diff1);
+ break;
+
+ case '+':
+ // get all new lines
+ do {
+ $diff1[] = substr($diff[$i], 1);
+ } while (++$i < $end && substr($diff[$i], 0, 1) == '+');
+ $edits[] = &new Text_Diff_Op_add($diff1);
+ break;
+
+ case '-':
+ // get changed or removed lines
+ $diff2 = array();
+ do {
+ $diff1[] = substr($diff[$i], 1);
+ } while (++$i < $end && substr($diff[$i], 0, 1) == '-');
+
+ while ($i < $end && substr($diff[$i], 0, 1) == '+') {
+ $diff2[] = substr($diff[$i++], 1);
+ }
+ if (count($diff2) == 0) {
+ $edits[] = &new Text_Diff_Op_delete($diff1);
+ } else {
+ $edits[] = &new Text_Diff_Op_change($diff1, $diff2);
+ }
+ break;
+
+ default:
+ $i++;
+ break;
+ }
+ }
+
+ return $edits;
+ }
+
+ /**
+ * Parses an array containing the context diff.
+ *
+ * @param array $diff Array of lines.
+ *
+ * @return array List of all diff operations.
+ */
+ function parseContextDiff(&$diff)
+ {
+ $edits = array();
+ $i = $max_i = $j = $max_j = 0;
+ $end = count($diff) - 1;
+ while ($i < $end && $j < $end) {
+ while ($i >= $max_i && $j >= $max_j) {
+ // Find the boundaries of the diff output of the two files
+ for ($i = $j;
+ $i < $end && substr($diff[$i], 0, 3) == '***';
+ $i++);
+ for ($max_i = $i;
+ $max_i < $end && substr($diff[$max_i], 0, 3) != '---';
+ $max_i++);
+ for ($j = $max_i;
+ $j < $end && substr($diff[$j], 0, 3) == '---';
+ $j++);
+ for ($max_j = $j;
+ $max_j < $end && substr($diff[$max_j], 0, 3) != '***';
+ $max_j++);
+ }
+
+ // find what hasn't been changed
+ $array = array();
+ while ($i < $max_i &&
+ $j < $max_j &&
+ strcmp($diff[$i], $diff[$j]) == 0) {
+ $array[] = substr($diff[$i], 2);
+ $i++;
+ $j++;
+ }
+
+ while ($i < $max_i && ($max_j-$j) <= 1) {
+ if ($diff[$i] != '' && substr($diff[$i], 0, 1) != ' ') {
+ break;
+ }
+ $array[] = substr($diff[$i++], 2);
+ }
+
+ while ($j < $max_j && ($max_i-$i) <= 1) {
+ if ($diff[$j] != '' && substr($diff[$j], 0, 1) != ' ') {
+ break;
+ }
+ $array[] = substr($diff[$j++], 2);
+ }
+ if (count($array) > 0) {
+ $edits[] = &new Text_Diff_Op_copy($array);
+ }
+
+ if ($i < $max_i) {
+ $diff1 = array();
+ switch (substr($diff[$i], 0, 1)) {
+ case '!':
+ $diff2 = array();
+ do {
+ $diff1[] = substr($diff[$i], 2);
+ if ($j < $max_j && substr($diff[$j], 0, 1) == '!') {
+ $diff2[] = substr($diff[$j++], 2);
+ }
+ } while (++$i < $max_i && substr($diff[$i], 0, 1) == '!');
+ $edits[] = &new Text_Diff_Op_change($diff1, $diff2);
+ break;
+
+ case '+':
+ do {
+ $diff1[] = substr($diff[$i], 2);
+ } while (++$i < $max_i && substr($diff[$i], 0, 1) == '+');
+ $edits[] = &new Text_Diff_Op_add($diff1);
+ break;
+
+ case '-':
+ do {
+ $diff1[] = substr($diff[$i], 2);
+ } while (++$i < $max_i && substr($diff[$i], 0, 1) == '-');
+ $edits[] = &new Text_Diff_Op_delete($diff1);
+ break;
+ }
+ }
+
+ if ($j < $max_j) {
+ $diff2 = array();
+ switch (substr($diff[$j], 0, 1)) {
+ case '+':
+ do {
+ $diff2[] = substr($diff[$j++], 2);
+ } while ($j < $max_j && substr($diff[$j], 0, 1) == '+');
+ $edits[] = &new Text_Diff_Op_add($diff2);
+ break;
+
+ case '-':
+ do {
+ $diff2[] = substr($diff[$j++], 2);
+ } while ($j < $max_j && substr($diff[$j], 0, 1) == '-');
+ $edits[] = &new Text_Diff_Op_delete($diff2);
+ break;
+ }
+ }
+ }
+
+ return $edits;
+ }
+
+}
diff --git a/wp-includes/Text/Diff/Engine/xdiff.php b/wp-includes/Text/Diff/Engine/xdiff.php
new file mode 100644
index 0000000..a39a4be
--- /dev/null
+++ b/wp-includes/Text/Diff/Engine/xdiff.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Class used internally by Diff to actually compute the diffs.
+ *
+ * This class uses the xdiff PECL package (http://pecl.php.net/package/xdiff)
+ * to compute the differences between the two input arrays.
+ *
+ * $Horde: framework/Text_Diff/Diff/Engine/xdiff.php,v 1.6 2008/01/04 10:07:50 jan Exp $
+ *
+ * Copyright 2004-2008 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you did
+ * not receive this file, see http://opensource.org/licenses/lgpl-license.php.
+ *
+ * @author Jon Parise <jon@horde.org>
+ * @package Text_Diff
+ */
+class Text_Diff_Engine_xdiff {
+
+ /**
+ */
+ function diff($from_lines, $to_lines)
+ {
+ array_walk($from_lines, array('Text_Diff', 'trimNewlines'));
+ array_walk($to_lines, array('Text_Diff', 'trimNewlines'));
+
+ /* Convert the two input arrays into strings for xdiff processing. */
+ $from_string = implode("\n", $from_lines);
+ $to_string = implode("\n", $to_lines);
+
+ /* Diff the two strings and convert the result to an array. */
+ $diff = xdiff_string_diff($from_string, $to_string, count($to_lines));
+ $diff = explode("\n", $diff);
+
+ /* Walk through the diff one line at a time. We build the $edits
+ * array of diff operations by reading the first character of the
+ * xdiff output (which is in the "unified diff" format).
+ *
+ * Note that we don't have enough information to detect "changed"
+ * lines using this approach, so we can't add Text_Diff_Op_changed
+ * instances to the $edits array. The result is still perfectly
+ * valid, albeit a little less descriptive and efficient. */
+ $edits = array();
+ foreach ($diff as $line) {
+ switch ($line[0]) {
+ case ' ':
+ $edits[] = &new Text_Diff_Op_copy(array(substr($line, 1)));
+ break;
+
+ case '+':
+ $edits[] = &new Text_Diff_Op_add(array(substr($line, 1)));
+ break;
+
+ case '-':
+ $edits[] = &new Text_Diff_Op_delete(array(substr($line, 1)));
+ break;
+ }
+ }
+
+ return $edits;
+ }
+
+}
diff --git a/wp-includes/Text/Diff/Renderer.php b/wp-includes/Text/Diff/Renderer.php
new file mode 100644
index 0000000..5d226b4
--- /dev/null
+++ b/wp-includes/Text/Diff/Renderer.php
@@ -0,0 +1,237 @@
+<?php
+/**
+ * A class to render Diffs in different formats.
+ *
+ * This class renders the diff in classic diff format. It is intended that
+ * this class be customized via inheritance, to obtain fancier outputs.
+ *
+ * $Horde: framework/Text_Diff/Diff/Renderer.php,v 1.21 2008/01/04 10:07:50 jan Exp $
+ *
+ * Copyright 2004-2008 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you did
+ * not receive this file, see http://opensource.org/licenses/lgpl-license.php.
+ *
+ * @package Text_Diff
+ */
+class Text_Diff_Renderer {
+
+ /**
+ * Number of leading context "lines" to preserve.
+ *
+ * This should be left at zero for this class, but subclasses may want to
+ * set this to other values.
+ */
+ var $_leading_context_lines = 0;
+
+ /**
+ * Number of trailing context "lines" to preserve.
+ *
+ * This should be left at zero for this class, but subclasses may want to
+ * set this to other values.
+ */
+ var $_trailing_context_lines = 0;
+
+ /**
+ * Constructor.
+ */
+ function Text_Diff_Renderer($params = array())
+ {
+ foreach ($params as $param => $value) {
+ $v = '_' . $param;
+ if (isset($this->$v)) {
+ $this->$v = $value;
+ }
+ }
+ }
+
+ /**
+ * Get any renderer parameters.
+ *
+ * @return array All parameters of this renderer object.
+ */
+ function getParams()
+ {
+ $params = array();
+ foreach (get_object_vars($this) as $k => $v) {
+ if ($k[0] == '_') {
+ $params[substr($k, 1)] = $v;
+ }
+ }
+
+ return $params;
+ }
+
+ /**
+ * Renders a diff.
+ *
+ * @param Text_Diff $diff A Text_Diff object.
+ *
+ * @return string The formatted output.
+ */
+ function render($diff)
+ {
+ $xi = $yi = 1;
+ $block = false;
+ $context = array();
+
+ $nlead = $this->_leading_context_lines;
+ $ntrail = $this->_trailing_context_lines;
+
+ $output = $this->_startDiff();
+
+ $diffs = $diff->getDiff();
+ foreach ($diffs as $i => $edit) {
+ /* If these are unchanged (copied) lines, and we want to keep
+ * leading or trailing context lines, extract them from the copy
+ * block. */
+ if (is_a($edit, 'Text_Diff_Op_copy')) {
+ /* Do we have any diff blocks yet? */
+ if (is_array($block)) {
+ /* How many lines to keep as context from the copy
+ * block. */
+ $keep = $i == count($diffs) - 1 ? $ntrail : $nlead + $ntrail;
+ if (count($edit->orig) <= $keep) {
+ /* We have less lines in the block than we want for
+ * context => keep the whole block. */
+ $block[] = $edit;
+ } else {
+ if ($ntrail) {
+ /* Create a new block with as many lines as we need
+ * for the trailing context. */
+ $context = array_slice($edit->orig, 0, $ntrail);
+ $block[] = &new Text_Diff_Op_copy($context);
+ }
+ /* @todo */
+ $output .= $this->_block($x0, $ntrail + $xi - $x0,
+ $y0, $ntrail + $yi - $y0,
+ $block);
+ $block = false;
+ }
+ }
+ /* Keep the copy block as the context for the next block. */
+ $context = $edit->orig;
+ } else {
+ /* Don't we have any diff blocks yet? */
+ if (!is_array($block)) {
+ /* Extract context lines from the preceding copy block. */
+ $context = array_slice($context, count($context) - $nlead);
+ $x0 = $xi - count($context);
+ $y0 = $yi - count($context);
+ $block = array();
+ if ($context) {
+ $block[] = &new Text_Diff_Op_copy($context);
+ }
+ }
+ $block[] = $edit;
+ }
+
+ if ($edit->orig) {
+ $xi += count($edit->orig);
+ }
+ if ($edit->final) {
+ $yi += count($edit->final);
+ }
+ }
+
+ if (is_array($block)) {
+ $output .= $this->_block($x0, $xi - $x0,
+ $y0, $yi - $y0,
+ $block);
+ }
+
+ return $output . $this->_endDiff();
+ }
+
+ function _block($xbeg, $xlen, $ybeg, $ylen, &$edits)
+ {
+ $output = $this->_startBlock($this->_blockHeader($xbeg, $xlen, $ybeg, $ylen));
+
+ foreach ($edits as $edit) {
+ switch (strtolower(get_class($edit))) {
+ case 'text_diff_op_copy':
+ $output .= $this->_context($edit->orig);
+ break;
+
+ case 'text_diff_op_add':
+ $output .= $this->_added($edit->final);
+ break;
+
+ case 'text_diff_op_delete':
+ $output .= $this->_deleted($edit->orig);
+ break;
+
+ case 'text_diff_op_change':
+ $output .= $this->_changed($edit->orig, $edit->final);
+ break;
+ }
+ }
+
+ return $output . $this->_endBlock();
+ }
+
+ function _startDiff()
+ {
+ return '';
+ }
+
+ function _endDiff()
+ {
+ return '';
+ }
+
+ function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
+ {
+ if ($xlen > 1) {
+ $xbeg .= ',' . ($xbeg + $xlen - 1);
+ }
+ if ($ylen > 1) {
+ $ybeg .= ',' . ($ybeg + $ylen - 1);
+ }
+
+ // this matches the GNU Diff behaviour
+ if ($xlen && !$ylen) {
+ $ybeg--;
+ } elseif (!$xlen) {
+ $xbeg--;
+ }
+
+ return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg;
+ }
+
+ function _startBlock($header)
+ {
+ return $header . "\n";
+ }
+
+ function _endBlock()
+ {
+ return '';
+ }
+
+ function _lines($lines, $prefix = ' ')
+ {
+ return $prefix . implode("\n$prefix", $lines) . "\n";
+ }
+
+ function _context($lines)
+ {
+ return $this->_lines($lines, ' ');
+ }
+
+ function _added($lines)
+ {
+ return $this->_lines($lines, '> ');
+ }
+
+ function _deleted($lines)
+ {
+ return $this->_lines($lines, '< ');
+ }
+
+ function _changed($orig, $final)
+ {
+ return $this->_deleted($orig) . "---\n" . $this->_added($final);
+ }
+
+}
diff --git a/wp-includes/Text/Diff/Renderer/inline.php b/wp-includes/Text/Diff/Renderer/inline.php
new file mode 100644
index 0000000..b547ff2
--- /dev/null
+++ b/wp-includes/Text/Diff/Renderer/inline.php
@@ -0,0 +1,170 @@
+<?php
+/**
+ * "Inline" diff renderer.
+ *
+ * $Horde: framework/Text_Diff/Diff/Renderer/inline.php,v 1.21 2008/01/04 10:07:51 jan Exp $
+ *
+ * Copyright 2004-2008 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you did
+ * not receive this file, see http://opensource.org/licenses/lgpl-license.php.
+ *
+ * @author Ciprian Popovici
+ * @package Text_Diff
+ */
+
+/** Text_Diff_Renderer */
+require_once 'Text/Diff/Renderer.php';
+
+/**
+ * "Inline" diff renderer.
+ *
+ * This class renders diffs in the Wiki-style "inline" format.
+ *
+ * @author Ciprian Popovici
+ * @package Text_Diff
+ */
+class Text_Diff_Renderer_inline extends Text_Diff_Renderer {
+
+ /**
+ * Number of leading context "lines" to preserve.
+ */
+ var $_leading_context_lines = 10000;
+
+ /**
+ * Number of trailing context "lines" to preserve.
+ */
+ var $_trailing_context_lines = 10000;
+
+ /**
+ * Prefix for inserted text.
+ */
+ var $_ins_prefix = '<ins>';
+
+ /**
+ * Suffix for inserted text.
+ */
+ var $_ins_suffix = '</ins>';
+
+ /**
+ * Prefix for deleted text.
+ */
+ var $_del_prefix = '<del>';
+
+ /**
+ * Suffix for deleted text.
+ */
+ var $_del_suffix = '</del>';
+
+ /**
+ * Header for each change block.
+ */
+ var $_block_header = '';
+
+ /**
+ * What are we currently splitting on? Used to recurse to show word-level
+ * changes.
+ */
+ var $_split_level = 'lines';
+
+ function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
+ {
+ return $this->_block_header;
+ }
+
+ function _startBlock($header)
+ {
+ return $header;
+ }
+
+ function _lines($lines, $prefix = ' ', $encode = true)
+ {
+ if ($encode) {
+ array_walk($lines, array(&$this, '_encode'));
+ }
+
+ if ($this->_split_level == 'words') {
+ return implode('', $lines);
+ } else {
+ return implode("\n", $lines) . "\n";
+ }
+ }
+
+ function _added($lines)
+ {
+ array_walk($lines, array(&$this, '_encode'));
+ $lines[0] = $this->_ins_prefix . $lines[0];
+ $lines[count($lines) - 1] .= $this->_ins_suffix;
+ return $this->_lines($lines, ' ', false);
+ }
+
+ function _deleted($lines, $words = false)
+ {
+ array_walk($lines, array(&$this, '_encode'));
+ $lines[0] = $this->_del_prefix . $lines[0];
+ $lines[count($lines) - 1] .= $this->_del_suffix;
+ return $this->_lines($lines, ' ', false);
+ }
+
+ function _changed($orig, $final)
+ {
+ /* If we've already split on words, don't try to do so again - just
+ * display. */
+ if ($this->_split_level == 'words') {
+ $prefix = '';
+ while ($orig[0] !== false && $final[0] !== false &&
+ substr($orig[0], 0, 1) == ' ' &&
+ substr($final[0], 0, 1) == ' ') {
+ $prefix .= substr($orig[0], 0, 1);
+ $orig[0] = substr($orig[0], 1);
+ $final[0] = substr($final[0], 1);
+ }
+ return $prefix . $this->_deleted($orig) . $this->_added($final);
+ }
+
+ $text1 = implode("\n", $orig);
+ $text2 = implode("\n", $final);
+
+ /* Non-printing newline marker. */
+ $nl = "\0";
+
+ /* We want to split on word boundaries, but we need to
+ * preserve whitespace as well. Therefore we split on words,
+ * but include all blocks of whitespace in the wordlist. */
+ $diff = new Text_Diff($this->_splitOnWords($text1, $nl),
+ $this->_splitOnWords($text2, $nl));
+
+ /* Get the diff in inline format. */
+ $renderer = new Text_Diff_Renderer_inline(array_merge($this->getParams(),
+ array('split_level' => 'words')));
+
+ /* Run the diff and get the output. */
+ return str_replace($nl, "\n", $renderer->render($diff)) . "\n";
+ }
+
+ function _splitOnWords($string, $newlineEscape = "\n")
+ {
+ // Ignore \0; otherwise the while loop will never finish.
+ $string = str_replace("\0", '', $string);
+
+ $words = array();
+ $length = strlen($string);
+ $pos = 0;
+
+ while ($pos < $length) {
+ // Eat a word with any preceding whitespace.
+ $spaces = strspn(substr($string, $pos), " \n");
+ $nextpos = strcspn(substr($string, $pos + $spaces), " \n");
+ $words[] = str_replace("\n", $newlineEscape, substr($string, $pos, $spaces + $nextpos));
+ $pos += $spaces + $nextpos;
+ }
+
+ return $words;
+ }
+
+ function _encode(&$string)
+ {
+ $string = htmlspecialchars($string);
+ }
+
+}
diff --git a/wp-includes/author-template.php b/wp-includes/author-template.php
index bcc9290..f78e046 100644
--- a/wp-includes/author-template.php
+++ b/wp-includes/author-template.php
@@ -2,12 +2,16 @@
/**
* Author Template functions for use in themes.
*
+ * These functions must be used within the WordPress Loop.
+ *
+ * @link http://codex.wordpress.org/Author_Templates
+ *
* @package WordPress
* @subpackage Template
*/
/**
- * get_the_author() - Get the author of the current post in the Loop.
+ * Retrieve the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@@ -22,21 +26,22 @@ function get_the_author($deprecated = '') {
}
/**
- * the_author() - Echo the name of the author of the current post in the Loop.
+ * Display the name of the author of the current post.
*
- * The behavior of this function is based off of old functionality predating get_the_author().
- * This function is not deprecated, but is designed to echo the value from get_the_author()
- * and as an result of any old theme that might still use the old behavior will also
- * pass the value from get_the_author().
+ * The behavior of this function is based off of old functionality predating
+ * get_the_author(). This function is not deprecated, but is designed to echo
+ * the value from get_the_author() and as an result of any old theme that might
+ * still use the old behavior will also pass the value from get_the_author().
*
- * The normal, expected behavior of this function is to echo the author and not return it.
- * However, backwards compatiability has to be maintained.
+ * The normal, expected behavior of this function is to echo the author and not
+ * return it. However, backwards compatiability has to be maintained.
*
* @since 0.71
* @see get_the_author()
+ * @link http://codex.wordpress.org/Template_Tags/the_author
*
* @param string $deprecated Deprecated.
- * @param string $deprecated_echo Echo the string or return it. Deprecated, use get_the_author().
+ * @param string $deprecated_echo Echo the string or return it.
* @return string The author's display name, from get_the_author().
*/
function the_author($deprecated = '', $deprecated_echo = true) {
@@ -46,7 +51,7 @@ function the_author($deprecated = '', $deprecated_echo = true) {
}
/**
- * get_the_author_description() - Get the description of the author of the current post in the Loop.
+ * Retrieve the description of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@@ -58,8 +63,9 @@ function get_the_author_description() {
}
/**
- * the_author_description() - Echo the description of the author of the current post in the Loop.
+ * Display the description of the author of the current post.
*
+ * @link http://codex.wordpress.org/Template_Tags/the_author_description
* @since 1.0.0
* @see get_the_author_description()
*/
@@ -68,7 +74,7 @@ function the_author_description() {
}
/**
- * get_the_author_login() - Get the login name of the author of the current post in the Loop.
+ * Retrieve the login name of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@@ -80,8 +86,9 @@ function get_the_author_login() {
}
/**
- * the_author_login() - Echo the login name of the author of the current post in the Loop.
+ * Display the login name of the author of the current post.
*
+ * @link http://codex.wordpress.org/Template_Tags/the_author_login
* @since 0.71
* @see get_the_author_login()
*/
@@ -90,7 +97,7 @@ function the_author_login() {
}
/**
- * get_the_author_firstname() - Get the first name of the author of the current post in the Loop.
+ * Retrieve the first name of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@@ -102,8 +109,9 @@ function get_the_author_firstname() {
}
/**
- * the_author_firstname() - Echo the first name of the author of the current post in the Loop.
+ * Display the first name of the author of the current post.
*
+ * @link http://codex.wordpress.org/Template_Tags/the_author_firstname
* @since 0.71
* @uses get_the_author_firstname()
*/
@@ -112,7 +120,7 @@ function the_author_firstname() {
}
/**
- * get_the_author_lastname() - Get the last name of the author of the current post in the Loop.
+ * Retrieve the last name of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@@ -124,8 +132,9 @@ function get_the_author_lastname() {
}
/**
- * the_author_lastname() - Echo the last name of the author of the current post in the Loop.
+ * Display the last name of the author of the current post.
*
+ * @link http://codex.wordpress.org/Template_Tags/the_author_lastname
* @since 0.71
* @uses get_the_author_lastname()
*/
@@ -134,7 +143,7 @@ function the_author_lastname() {
}
/**
- * get_the_author_nickname() - Get the nickname of the author of the current post in the Loop.
+ * Retrieve the nickname of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@@ -146,8 +155,9 @@ function get_the_author_nickname() {
}
/**
- * the_author_nickname() - Echo the nickname of the author of the current post in the Loop.
+ * Display the nickname of the author of the current post.
*
+ * @link http://codex.wordpress.org/Template_Tags/the_author_nickname
* @since 0.71
* @uses get_the_author_nickname()
*/
@@ -156,7 +166,7 @@ function the_author_nickname() {
}
/**
- * get_the_author_ID() - Get the ID of the author of the current post in the Loop.
+ * Retrieve the ID of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@@ -168,8 +178,9 @@ function get_the_author_ID() {
}
/**
- * the_author_ID() - Echo the ID of the author of the current post in the Loop.
+ * Display the ID of the author of the current post.
*
+ * @http://codex.wordpress.org/Template_Tags/the_author_ID
* @since 0.71
* @uses get_the_author_ID()
*/
@@ -178,7 +189,7 @@ function the_author_ID() {
}
/**
- * get_the_author_email() - Get the email of the author of the current post in the Loop.
+ * Retrieve the email of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@@ -190,8 +201,9 @@ function get_the_author_email() {
}
/**
- * the_author_email() - Echo the email of the author of the current post in the Loop.
+ * Display the email of the author of the current post.
*
+ * @link http://codex.wordpress.org/Template_Tags/the_author_email
* @since 0.71
* @uses get_the_author_email()
*/
@@ -200,7 +212,7 @@ function the_author_email() {
}
/**
- * get_the_author_url() - Get the URL to the home page of the author of the current post in the Loop.
+ * Retrieve the URL to the home page of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@@ -216,8 +228,9 @@ function get_the_author_url() {
}
/**
- * the_author_url() - Echo the URL to the home page of the author of the current post in the Loop.
+ * Display the URL to the home page of the author of the current post.
*
+ * @link http://codex.wordpress.org/Template_Tags/the_author_url
* @since 0.71
* @uses get_the_author_url()
*/
@@ -226,8 +239,12 @@ function the_author_url() {
}
/**
- * the_author_link() - If the author has a home page set, echo an HTML link, otherwise just echo the author's name.
+ * Display either author's link or author's name.
+ *
+ * If the author has a home page set, echo an HTML link, otherwise just echo the
+ * author's name.
*
+ * @link http://codex.wordpress.org/Template_Tags/the_author_link
* @since 2.1
* @uses get_the_author_url()
* @uses the_author()
@@ -241,7 +258,7 @@ function the_author_link() {
}
/**
- * get_the_author_icq() - Get the ICQ number of the author of the current post in the Loop.
+ * Retrieve the ICQ number of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@@ -253,8 +270,9 @@ function get_the_author_icq() {
}
/**
- * the_author_icq() - Echo the ICQ number of the author of the current post in the Loop.
+ * Display the ICQ number of the author of the current post.
*
+ * @link http://codex.wordpress.org/Template_Tags/the_author_icq
* @since 0.71
* @see get_the_author_icq()
*/
@@ -263,7 +281,7 @@ function the_author_icq() {
}
/**
- * get_the_author_aim() - Get the AIM name of the author of the current post in the Loop.
+ * Retrieve the AIM name of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@@ -275,8 +293,9 @@ function get_the_author_aim() {
}
/**
- * the_author_aim() - Echo the AIM name of the author of the current post in the Loop.
+ * Display the AIM name of the author of the current post.
*
+ * @link http://codex.wordpress.org/Template_Tags/the_author_aim
* @since 0.71
* @see get_the_author_aim()
*/
@@ -285,7 +304,7 @@ function the_author_aim() {
}
/**
- * get_the_author_yim() - Get the Yahoo! IM name of the author of the current post in the Loop.
+ * Retrieve the Yahoo! IM name of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@@ -297,8 +316,9 @@ function get_the_author_yim() {
}
/**
- * the_author_yim() - Echo the Yahoo! IM name of the author of the current post in the Loop.
+ * Display the Yahoo! IM name of the author of the current post.
*
+ * @link http://codex.wordpress.org/Template_Tags/the_author_yim
* @since 0.71
* @see get_the_author_yim()
*/
@@ -307,7 +327,7 @@ function the_author_yim() {
}
/**
- * get_the_author_msn() - Get the MSN address of the author of the current post in the Loop.
+ * Retrieve the MSN address of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@@ -319,8 +339,9 @@ function get_the_author_msn() {
}
/**
- * the_author_msn() - Echo the MSN address of the author of the current post in the Loop.
+ * Display the MSN address of the author of the current post.
*
+ * @link http://codex.wordpress.org/Template_Tags/the_author_msn
* @since 0.71
* @see get_the_author_msn()
*/
@@ -329,7 +350,7 @@ function the_author_msn() {
}
/**
- * get_the_author_posts() - Get the number of posts by the author of the current post in the Loop.
+ * Retrieve the number of posts by the author of the current post.
*
* @since 1.5
* @uses $post The current post in the Loop's DB object.
@@ -342,8 +363,9 @@ function get_the_author_posts() {
}
/**
- * the_author_posts() - Echo the number of posts by the author of the current post in the Loop.
+ * Display the number of posts by the author of the current post.
*
+ * @link http://codex.wordpress.org/Template_Tags/the_author_posts
* @since 0.71
* @uses get_the_author_posts() Echos returned value from function.
*/
@@ -352,11 +374,13 @@ function the_author_posts() {
}
/**
- * the_author_posts_link() - Echo an HTML link to the author page of the author of the current post in the Loop.
+ * Display an HTML link to the author page of the author of the current post.
*
- * Does just echo get_author_posts_url() function, like the others do. The reason for this,
- * is that another function is used to help in printing the link to the author's posts.
+ * Does just echo get_author_posts_url() function, like the others do. The
+ * reason for this, is that another function is used to help in printing the
+ * link to the author's posts.
*
+ * @link http://codex.wordpress.org/Template_Tags/the_author_posts_link
* @since 1.2
* @uses $authordata The current author's DB object.
* @uses get_author_posts_url()
@@ -374,7 +398,7 @@ function the_author_posts_link($deprecated = '') {
}
/**
- * get_author_posts_url() - Get the URL to the author page of the author of the current post in the Loop.
+ * Retrieve the URL to the author page of the author of the current post.
*
* @since 2.1
* @uses $wp_rewrite WP_Rewrite
@@ -404,7 +428,7 @@ function get_author_posts_url($author_id, $author_nicename = '') {
}
/**
- * get_author_name() - Get the specified author's preferred display name.
+ * Retrieve the specified author's preferred display name.
*
* @since 1.0.0
* @param int $auth_id The ID of the author.
@@ -416,16 +440,19 @@ function get_author_name( $auth_id ) {
}
/**
- * wp_list_authors() - List all the authors of the blog, with several options available.
+ * List all the authors of the blog, with several options available.
*
- * optioncount (boolean) (false): Show the count in parenthesis next to the author's name.
- * exclude_admin (boolean) (true): Exclude the 'admin' user that is installed by default.
+ * optioncount (boolean) (false): Show the count in parenthesis next to the
+ * author's name.
+ * exclude_admin (boolean) (true): Exclude the 'admin' user that is installed by
+ * default.
* show_fullname (boolean) (false): Show their full names.
* hide_empty (boolean) (true): Don't show authors without any posts.
* feed (string) (''): If isn't empty, show links to author's feeds.
* feed_image (string) (''): If isn't empty, use this image to link to feeds.
* echo (boolean) (true): Set to false to return the output, instead of echoing.
*
+ * @link http://codex.wordpress.org/Template_Tags/wp_list_authors
* @since 1.2
* @param array $args The argument array.
* @return null|string The output, if echo is set to false.
diff --git a/wp-includes/bookmark-template.php b/wp-includes/bookmark-template.php
index f85d5c4..13f1f2e 100644
--- a/wp-includes/bookmark-template.php
+++ b/wp-includes/bookmark-template.php
@@ -7,24 +7,31 @@
*/
/**
- * _walk_bookmarks() - The formatted output of a list of bookmarks
+ * The formatted output of a list of bookmarks
*
* The $bookmarks array must contain bookmark objects and will be iterated over
* to retrieve the bookmark to be used in the output.
*
- * The output is formatted as HTML with no way to change that format. However, what
- * is between, before, and after can be changed. The link itself will be HTML.
+ * The output is formatted as HTML with no way to change that format. However,
+ * what is between, before, and after can be changed. The link itself will be
+ * HTML.
*
- * This function is used internally by wp_list_bookmarks() and should not be used by
- * themes.
+ * This function is used internally by wp_list_bookmarks() and should not be
+ * used by themes.
*
* The defaults for overwriting are:
- * 'show_updated' - Default is 0 (integer). Will show the time of when the bookmark was last updated.
- * 'show_description' - Default is 0 (integer). Whether to show the description of the bookmark.
- * 'show_images' - Default is 1 (integer). Whether to show link image if available.
- * 'before' - Default is '<li>' (string). The html or text to prepend to each bookmarks.
- * 'after' - Default is '</li>' (string). The html or text to append to each bookmarks.
- * 'between' - Default is '\n' (string). The string for use in between the link, description, and image.
+ * 'show_updated' - Default is 0 (integer). Will show the time of when the
+ * bookmark was last updated.
+ * 'show_description' - Default is 0 (integer). Whether to show the description
+ * of the bookmark.
+ * 'show_images' - Default is 1 (integer). Whether to show link image if
+ * available.
+ * 'before' - Default is '<li>' (string). The html or text to prepend to each
+ * bookmarks.
+ * 'after' - Default is '</li>' (string). The html or text to append to each
+ * bookmarks.
+ * 'between' - Default is '\n' (string). The string for use in between the link,
+ * description, and image.
* 'show_rating' - Default is 0 (integer). Whether to show the link rating.
*
* @since 2.1
@@ -113,44 +120,68 @@ function _walk_bookmarks($bookmarks, $args = '' ) {
}
/**
- * wp_list_bookmarks() - Retrieve or echo all of the bookmarks
+ * Retrieve or echo all of the bookmarks
*
* List of default arguments are as follows:
- * 'orderby' - Default is 'name' (string). How to order the links by. String is based off of the bookmark scheme.
- * 'order' - Default is 'ASC' (string). Either 'ASC' or 'DESC'. Orders in either ascending or descending order.
- * 'limit' - Default is -1 (integer) or show all. The amount of bookmarks to display.
- * 'category' - Default is empty string (string). Include the links in what category ID(s).
- * 'category_name' - Default is empty string (string). Get links by category name.
- * 'hide_invisible' - Default is 1 (integer). Whether to show (default) or hide links marked as 'invisible'.
- * 'show_updated' - Default is 0 (integer). Will show the time of when the bookmark was last updated.
- * 'echo' - Default is 1 (integer). Whether to echo (default) or return the formatted bookmarks.
- * 'categorize' - Default is 1 (integer). Whether to show links listed by category (default) or show links in one column.
+ * 'orderby' - Default is 'name' (string). How to order the links by. String is
+ * based off of the bookmark scheme.
+ * 'order' - Default is 'ASC' (string). Either 'ASC' or 'DESC'. Orders in either
+ * ascending or descending order.
+ * 'limit' - Default is -1 (integer) or show all. The amount of bookmarks to
+ * display.
+ * 'category' - Default is empty string (string). Include the links in what
+ * category ID(s).
+ * 'category_name' - Default is empty string (string). Get links by category
+ * name.
+ * 'hide_invisible' - Default is 1 (integer). Whether to show (default) or hide
+ * links marked as 'invisible'.
+ * 'show_updated' - Default is 0 (integer). Will show the time of when the
+ * bookmark was last updated.
+ * 'echo' - Default is 1 (integer). Whether to echo (default) or return the
+ * formatted bookmarks.
+ * 'categorize' - Default is 1 (integer). Whether to show links listed by
+ * category (default) or show links in one column.
*
- * These options define how the Category name will appear before the category links are displayed, if 'categorize' is 1.
- * If 'categorize' is 0, then it will display for only the 'title_li' string and only if 'title_li' is not empty.
- * 'title_li' - Default is 'Bookmarks' (translatable string). What to show before the links appear.
- * 'title_before' - Default is '<h2>' (string). The HTML or text to show before the 'title_li' string.
- * 'title_after' - Default is '</h2>' (string). The HTML or text to show after the 'title_li' string.
- * 'class' - Default is 'linkcat' (string). The CSS class to use for the 'title_li'.
+ * These options define how the Category name will appear before the category
+ * links are displayed, if 'categorize' is 1. If 'categorize' is 0, then it will
+ * display for only the 'title_li' string and only if 'title_li' is not empty.
+ * 'title_li' - Default is 'Bookmarks' (translatable string). What to show
+ * before the links appear.
+ * 'title_before' - Default is '<h2>' (string). The HTML or text to show before
+ * the 'title_li' string.
+ * 'title_after' - Default is '</h2>' (string). The HTML or text to show after
+ * the 'title_li' string.
+ * 'class' - Default is 'linkcat' (string). The CSS class to use for the
+ * 'title_li'.
*
- * 'category_before' - Default is '<li id="%id" class="%class">'. String must contain '%id' and '%class' to get
- * the id of the category and the 'class' argument. These are used for formatting in themes. Argument will be displayed
- * before the 'title_before' argument.
- * 'category_after' - Default is '</li>' (string). The HTML or text that will appear after the list of links.
+ * 'category_before' - Default is '<li id="%id" class="%class">'. String must
+ * contain '%id' and '%class' to get
+ * the id of the category and the 'class' argument. These are used for
+ * formatting in themes.
+ * Argument will be displayed before the 'title_before' argument.
+ * 'category_after' - Default is '</li>' (string). The HTML or text that will
+ * appear after the list of links.
*
* These are only used if 'categorize' is set to 1 or true.
- * 'category_orderby' - Default is 'name'. How to order the bookmark category based on term scheme.
- * 'category_order' - Default is 'ASC'. Set the order by either ASC (ascending) or DESC (descending).
+ * 'category_orderby' - Default is 'name'. How to order the bookmark category
+ * based on term scheme.
+ * 'category_order' - Default is 'ASC'. Set the order by either ASC (ascending)
+ * or DESC (descending).
*
- * @see _walk_bookmarks() For other arguments that can be set in this function and passed to _walk_bookmarks().
- * @see get_bookmarks() For other arguments that can be set in this function and passed to get_bookmarks().
+ * @see _walk_bookmarks() For other arguments that can be set in this function
+ * and passed to _walk_bookmarks().
+ * @see get_bookmarks() For other arguments that can be set in this function and
+ * passed to get_bookmarks().
+ * @link http://codex.wordpress.org/Template_Tags/wp_list_bookmarks
*
* @since 2.1
- * @uses _list_bookmarks() Used to iterate over all of the bookmarks and return the html
+ * @uses _list_bookmarks() Used to iterate over all of the bookmarks and return
+ * the html
* @uses get_terms() Gets all of the categories that are for links.
*
* @param string|array $args Optional. Overwrite the defaults of the function
- * @return string|null Will only return if echo option is set to not echo. Default is not return anything.
+ * @return string|null Will only return if echo option is set to not echo.
+ * Default is not return anything.
*/
function wp_list_bookmarks($args = '') {
$defaults = array(
@@ -172,7 +203,7 @@ function wp_list_bookmarks($args = '') {
if ( $categorize ) {
//Split the bookmarks into ul's for each category
- $cats = get_terms('link_category', "category_name=$category_name&include=$category&orderby=$category_orderby&order=$category_order&hierarchical=0");
+ $cats = get_terms('link_category', array('category_name' => $category_name, 'include' => $category, 'orderby' => $category_orderby, 'order' => $category_order, 'hierarchical' => 0));
foreach ( (array) $cats as $cat ) {
$params = array_merge($r, array('category'=>$cat->term_id));
diff --git a/wp-includes/bookmark.php b/wp-includes/bookmark.php
index 776d519..260dbaf 100644
--- a/wp-includes/bookmark.php
+++ b/wp-includes/bookmark.php
@@ -7,7 +7,7 @@
*/
/**
- * get_bookmark() - Get Bookmark data based on ID
+ * Retrieve Bookmark data based on ID
*
* @since 2.1
* @uses $wpdb Database Object
@@ -37,7 +37,7 @@ function get_bookmark($bookmark_id, $output = OBJECT, $filter = 'raw') {
}
/**
- * get_bookmark_field() - Gets single bookmark data item or field.
+ * Retrieve single bookmark data item or field.
*
* @since 2.3
* @uses get_bookmark() Gets bookmark object using $bookmark as ID
@@ -65,7 +65,7 @@ function get_bookmark_field( $field, $bookmark, $context = 'display' ) {
}
/**
- * get_link() - Returns bookmark data based on ID.
+ * Retrieve bookmark data based on ID.
*
* @since 2.0
* @deprecated Use get_bookmark()
@@ -80,25 +80,35 @@ function get_link($bookmark_id, $output = OBJECT, $filter = 'raw') {
}
/**
- * get_bookmarks() - Retrieves the list of bookmarks
+ * Retrieves the list of bookmarks
*
* Attempts to retrieve from the cache first based on MD5 hash of arguments. If
* that fails, then the query will be built from the arguments and executed. The
* results will be stored to the cache.
*
* List of default arguments are as follows:
- * 'orderby' - Default is 'name' (string). How to order the links by. String is based off of the bookmark scheme.
- * 'order' - Default is 'ASC' (string). Either 'ASC' or 'DESC'. Orders in either ascending or descending order.
- * 'limit' - Default is -1 (integer) or show all. The amount of bookmarks to display.
- * 'category' - Default is empty string (string). Include the links in what category ID(s).
- * 'category_name' - Default is empty string (string). Get links by category name.
- * 'hide_invisible' - Default is 1 (integer). Whether to show (default) or hide links marked as 'invisible'.
- * 'show_updated' - Default is 0 (integer). Will show the time of when the bookmark was last updated.
- * 'include' - Default is empty string (string). Include other categories separated by commas.
- * 'exclude' - Default is empty string (string). Exclude other categories separated by commas.
+ * 'orderby' - Default is 'name' (string). How to order the links by. String is
+ * based off of the bookmark scheme.
+ * 'order' - Default is 'ASC' (string). Either 'ASC' or 'DESC'. Orders in either
+ * ascending or descending order.
+ * 'limit' - Default is -1 (integer) or show all. The amount of bookmarks to
+ * display.
+ * 'category' - Default is empty string (string). Include the links in what
+ * category ID(s).
+ * 'category_name' - Default is empty string (string). Get links by category
+ * name.
+ * 'hide_invisible' - Default is 1 (integer). Whether to show (default) or hide
+ * links marked as 'invisible'.
+ * 'show_updated' - Default is 0 (integer). Will show the time of when the
+ * bookmark was last updated.
+ * 'include' - Default is empty string (string). Include other categories
+ * separated by commas.
+ * 'exclude' - Default is empty string (string). Exclude other categories
+ * separated by commas.
*
* @since 2.1
* @uses $wpdb Database Object
+ * @link http://codex.wordpress.org/Template_Tags/get_bookmarks
*
* @param string|array $args List of arguments to overwrite the defaults
* @return array List of bookmark row objects
@@ -226,12 +236,13 @@ function get_bookmarks($args = '') {
}
/**
- * sanitize_bookmark() - Sanitizes all bookmark fields
+ * Sanitizes all bookmark fields
*
* @since 2.3
*
* @param object|array $bookmark Bookmark row
- * @param string $context Optional, default is 'display'. How to filter the fields
+ * @param string $context Optional, default is 'display'. How to filter the
+ * fields
* @return object|array Same type as $bookmark but with fields sanitized.
*/
function sanitize_bookmark($bookmark, $context = 'display') {
@@ -254,25 +265,27 @@ function sanitize_bookmark($bookmark, $context = 'display') {
}
/**
- * sanitize_bookmark_field() - Sanitizes a bookmark field
+ * Sanitizes a bookmark field
*
- * Sanitizes the bookmark fields based on what the field name is. If the field has a
- * strict value set, then it will be tested for that, else a more generic filtering is
- * applied. After the more strict filter is applied, if the $context is 'raw' then the
- * value is immediately return.
+ * Sanitizes the bookmark fields based on what the field name is. If the field
+ * has a strict value set, then it will be tested for that, else a more generic
+ * filtering is applied. After the more strict filter is applied, if the
+ * $context is 'raw' then the value is immediately return.
*
- * Hooks exist for the more generic cases. With the 'edit' context, the 'edit_$field'
- * filter will be called and passed the $value and $bookmark_id respectively. With the
- * 'db' context, the 'pre_$field' filter is called and passed the value. The 'display'
- * context is the final context and has the $field has the filter name and is passed the
- * $value, $bookmark_id, and $context respectively.
+ * Hooks exist for the more generic cases. With the 'edit' context, the
+ * 'edit_$field' filter will be called and passed the $value and $bookmark_id
+ * respectively. With the 'db' context, the 'pre_$field' filter is called and
+ * passed the value. The 'display' context is the final context and has the
+ * $field has the filter name and is passed the $value, $bookmark_id, and
+ * $context respectively.
*
* @since 2.3
*
* @param string $field The bookmark field
* @param mixed $value The bookmark field value
* @param int $bookmark_id Bookmark ID
- * @param string $context How to filter the field value. Either 'raw', 'edit', 'attribute', 'js', 'db', or 'display'
+ * @param string $context How to filter the field value. Either 'raw', 'edit',
+ * 'attribute', 'js', 'db', or 'display'
* @return mixed The filtered value
*/
function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
@@ -318,7 +331,7 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
}
/**
- * delete_get_bookmark_cache() - Deletes entire bookmark cache
+ * Deletes entire bookmark cache
*
* @since 2.1
* @uses wp_cache_delete() Deletes the contents of 'get_bookmarks'
diff --git a/wp-includes/cache.php b/wp-includes/cache.php
index 9736da4..cfdab82 100644
--- a/wp-includes/cache.php
+++ b/wp-includes/cache.php
@@ -2,12 +2,14 @@
/**
* Object Cache API
*
+ * @link http://codex.wordpress.org/Function_Reference/WP_Cache
+ *
* @package WordPress
* @subpackage Cache
*/
/**
- * wp_cache_add() - Adds data to the cache, if the cache key doesn't aleady exist
+ * Adds data to the cache, if the cache key doesn't aleady exist.
*
* @since 2.0
* @uses $wp_object_cache Object Cache Class
@@ -26,11 +28,12 @@ function wp_cache_add($key, $data, $flag = '', $expire = 0) {
}
/**
- * wp_cache_close() - Closes the cache
+ * Closes the cache.
*
- * This function has ceased to do anything since WordPress 2.5.
- * The functionality was removed along with the rest of the
- * persistant cache.
+ * This function has ceased to do anything since WordPress 2.5. The
+ * functionality was removed along with the rest of the persistant cache. This
+ * does not mean that plugins can't implement this function when they need to
+ * make sure that the cache is cleaned up after WordPress no longer needs it.
*
* @since 2.0
*
@@ -41,7 +44,7 @@ function wp_cache_close() {
}
/**
- * wp_cache_delete() - Removes the cache contents matching ID and flag
+ * Removes the cache contents matching ID and flag.
*
* @since 2.0
* @uses $wp_object_cache Object Cache Class
@@ -58,7 +61,7 @@ function wp_cache_delete($id, $flag = '') {
}
/**
- * wp_cache_flush() - Removes all cache items
+ * Removes all cache items.
*
* @since 2.0
* @uses $wp_object_cache Object Cache Class
@@ -73,7 +76,7 @@ function wp_cache_flush() {
}
/**
- * wp_cache_get() - Retrieves the cache contents from the cache by ID and flag
+ * Retrieves the cache contents from the cache by ID and flag.
*
* @since 2.0
* @uses $wp_object_cache Object Cache Class
@@ -81,7 +84,8 @@ function wp_cache_flush() {
*
* @param int|string $id What the contents in the cache are called
* @param string $flag Where the cache contents are grouped
- * @return bool|mixed False on failure to retrieve contents or the cache contents on success
+ * @return bool|mixed False on failure to retrieve contents or the cache
+ * contents on success
*/
function wp_cache_get($id, $flag = '') {
global $wp_object_cache;
@@ -90,7 +94,7 @@ function wp_cache_get($id, $flag = '') {
}
/**
- * wp_cache_init() - Sets up Object Cache Global and assigns it
+ * Sets up Object Cache Global and assigns it.
*
* @since 2.0
* @global WP_Object_Cache $wp_object_cache WordPress Object Cache
@@ -100,7 +104,7 @@ function wp_cache_init() {
}
/**
- * wp_cache_replace() - Replaces the contents of the cache with new data
+ * Replaces the contents of the cache with new data.
*
* @since 2.0
* @uses $wp_object_cache Object Cache Class
@@ -119,7 +123,7 @@ function wp_cache_replace($key, $data, $flag = '', $expire = 0) {
}
/**
- * wp_cache_set() - Saves the data to the cache
+ * Saves the data to the cache.
*
* @since 2.0
* @uses $wp_object_cache Object Cache Class
@@ -138,16 +142,40 @@ function wp_cache_set($key, $data, $flag = '', $expire = 0) {
}
/**
+ * Adds a group or set of groups to the list of global groups.
+ *
+ * @since 2.6
+ *
+ * @param string|array $groups A group or an array of groups to add
+ */
+function wp_cache_add_global_groups( $groups ) {
+ // Default cache doesn't persist so nothing to do here.
+ return;
+}
+
+/**
+ * Adds a group or set of groups to the list of non-persistent groups.
+ *
+ * @since 2.6
+ *
+ * @param string|array $groups A group or an array of groups to add
+ */
+function wp_cache_add_non_persistent_groups( $groups ) {
+ // Default cache doesn't persist so nothing to do here.
+ return;
+}
+
+/**
* WordPress Object Cache
*
- * The WordPress Object Cache is used to save on trips to the database.
- * The Object Cache stores all of the cache data to memory and makes the
- * cache contents available by using a key, which is used to name and
- * later retrieve the cache contents.
+ * The WordPress Object Cache is used to save on trips to the database. The
+ * Object Cache stores all of the cache data to memory and makes the cache
+ * contents available by using a key, which is used to name and later retrieve
+ * the cache contents.
*
- * The Object Cache can be replaced by other caching mechanisms by placing
- * files in the wp-content folder which is looked at in wp-settings. If
- * that file exists, then this file will not be included.
+ * The Object Cache can be replaced by other caching mechanisms by placing files
+ * in the wp-content folder which is looked at in wp-settings. If that file
+ * exists, then this file will not be included.
*
* @package WordPress
* @subpackage Cache
@@ -174,15 +202,6 @@ class WP_Object_Cache {
var $non_existant_objects = array ();
/**
- * Object caches that are global
- *
- * @var array
- * @access private
- * @since 2.0
- */
- var $global_groups = array ('users', 'userlogins', 'usermeta', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details');
-
- /**
* The amount of times the cache data was already stored in the cache.
*
* @since 2.5
@@ -200,27 +219,12 @@ class WP_Object_Cache {
*/
var $cache_misses = 0;
- function maybe_localize_group( $group ) {
- global $wpdb;
-
- if ( empty($group) )
- $group = 'default';
-
- $pre_test = substr( $group, 0, strpos( $group, '-' ) );
- if( $pre_test != '' && $pre_test == intval( $pre_test ) )
- return $group; // already localized.
- $prefix = '';
- if (true !== array_search($group, $this->global_groups))
- $prefix = $wpdb->blogid . '-';
-
- return "$prefix$group";
- }
-
/**
* Adds data to the cache if it doesn't already exist.
*
* @uses WP_Object_Cache::get Checks to see if the cache already has data.
- * @uses WP_Object_Cache::set Sets the data after the checking the cache contents existance.
+ * @uses WP_Object_Cache::set Sets the data after the checking the cache
+ * contents existance.
*
* @since 2.0
*
@@ -243,24 +247,24 @@ class WP_Object_Cache {
/**
* Remove the contents of the cache ID in the group
*
- * If the cache ID does not exist in the group and $force parameter
- * is set to false, then nothing will happen. The $force parameter
- * is set to false by default.
+ * If the cache ID does not exist in the group and $force parameter is set
+ * to false, then nothing will happen. The $force parameter is set to false
+ * by default.
*
- * On success the group and the id will be added to the
+ * On success the group and the id will be added to the
* $non_existant_objects property in the class.
*
* @since 2.0
*
* @param int|string $id What the contents in the cache are called
* @param string $group Where the cache contents are grouped
- * @param bool $force Optional. Whether to force the unsetting of the cache ID in the group
+ * @param bool $force Optional. Whether to force the unsetting of the cache
+ * ID in the group
* @return bool False if the contents weren't deleted and true on success
*/
function delete($id, $group = 'default', $force = false) {
if (empty ($group))
$group = 'default';
- $group = $this->maybe_localize_group( $group );
if (!$force && false === $this->get($id, $group, false))
return false;
@@ -286,26 +290,26 @@ class WP_Object_Cache {
/**
* Retrieves the cache contents, if it exists
*
- * The contents will be first attempted to be retrieved by searching
- * by the ID in the cache group. If the cache is hit (success) then
- * the contents are returned.
+ * The contents will be first attempted to be retrieved by searching by the
+ * ID in the cache group. If the cache is hit (success) then the contents
+ * are returned.
*
- * On failure, the $non_existant_objects property is checked and if
- * the cache group and ID exist in there the cache misses will not be
- * incremented. If not in the nonexistant objects property, then the
- * cache misses will be incremented and the cache group and ID will
- * be added to the nonexistant objects.
+ * On failure, the $non_existant_objects property is checked and if the
+ * cache group and ID exist in there the cache misses will not be
+ * incremented. If not in the nonexistant objects property, then the cache
+ * misses will be incremented and the cache group and ID will be added to
+ * the nonexistant objects.
*
* @since 2.0
*
* @param int|string $id What the contents in the cache are called
* @param string $group Where the cache contents are grouped
- * @return bool|mixed False on failure to retrieve contents or the cache contents on success
+ * @return bool|mixed False on failure to retrieve contents or the cache
+ * contents on success
*/
function get($id, $group = 'default') {
if (empty ($group))
$group = 'default';
- $group = $this->maybe_localize_group( $group );
if (isset ($this->cache[$group][$id])) {
$this->cache_hits += 1;
@@ -345,15 +349,14 @@ class WP_Object_Cache {
/**
* Sets the data contents into the cache
*
- * The cache contents is grouped by the $group parameter followed
- * by the $id. This allows for duplicate ids in unique groups.
- * Therefore, naming of the group should be used with care and
- * should follow normal function naming guidelines outside of
- * core WordPress usage.
+ * The cache contents is grouped by the $group parameter followed by the
+ * $id. This allows for duplicate ids in unique groups. Therefore, naming of
+ * the group should be used with care and should follow normal function
+ * naming guidelines outside of core WordPress usage.
*
- * The $expire parameter is not used, because the cache will
- * automatically expire for each time a page is accessed and PHP
- * finishes. The method is more for cache plugins which use files.
+ * The $expire parameter is not used, because the cache will automatically
+ * expire for each time a page is accessed and PHP finishes. The method is
+ * more for cache plugins which use files.
*
* @since 2.0
*
@@ -366,7 +369,6 @@ class WP_Object_Cache {
function set($id, $data, $group = 'default', $expire = '') {
if (empty ($group))
$group = 'default';
- $group = $this->maybe_localize_group( $group );
if (NULL === $data)
$data = '';
@@ -382,8 +384,8 @@ class WP_Object_Cache {
/**
* Echos the stats of the caching.
*
- * Gives the cache hits, and cache misses. Also prints every cached
- * group, key and the data.
+ * Gives the cache hits, and cache misses. Also prints every cached group,
+ * key and the data.
*
* @since 2.0
*/
@@ -421,7 +423,11 @@ class WP_Object_Cache {
* @return null|WP_Object_Cache If cache is disabled, returns null.
*/
function __construct() {
- register_shutdown_function(array(&$this, "__destruct")); /** @todo This should be moved to the PHP4 style constructor, PHP5 already calls __destruct() */
+ /**
+ * @todo This should be moved to the PHP4 style constructor, PHP5
+ * already calls __destruct()
+ */
+ register_shutdown_function(array(&$this, "__destruct"));
}
/**
diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php
index 5ad4457..4c58027 100644
--- a/wp-includes/canonical.php
+++ b/wp-includes/canonical.php
@@ -2,7 +2,8 @@
/**
* Canonical API to handle WordPress Redirecting
*
- * Based on "Permalink Redirect" from Scott Yang and "Enforce www. Preference" by Mark Jaquith
+ * Based on "Permalink Redirect" from Scott Yang and "Enforce www. Preference"
+ * by Mark Jaquith
*
* @author Scott Yang
* @author Mark Jaquith
@@ -11,31 +12,34 @@
*/
/**
- * redirect_canonical() - Redirects incoming links to the proper URL based on the site url
+ * Redirects incoming links to the proper URL based on the site url
*
- * Search engines consider www.somedomain.com and somedomain.com to be two different URLs
- * when they both go to the same location. This SEO enhancement prevents penality for
- * duplicate content by redirecting all incoming links to one or the other.
+ * Search engines consider www.somedomain.com and somedomain.com to be two
+ * different URLs when they both go to the same location. This SEO enhancement
+ * prevents penality for duplicate content by redirecting all incoming links to
+ * one or the other.
*
- * Prevents redirection for feeds, trackbacks, searches, comment popup, and admin URLs.
- * Does not redirect on IIS, page/post previews, and on form data.
+ * Prevents redirection for feeds, trackbacks, searches, comment popup, and
+ * admin URLs. Does not redirect on IIS, page/post previews, and on form data.
*
- * Will also attempt to find the correct link when a user enters a URL that does not exist
- * based on exact WordPress query. Will instead try to parse the URL or query in an attempt
- * to figure the correct page to go to.
+ * Will also attempt to find the correct link when a user enters a URL that does
+ * not exist based on exact WordPress query. Will instead try to parse the URL
+ * or query in an attempt to figure the correct page to go to.
*
* @since 2.3
* @uses $wp_rewrite
* @uses $is_IIS
*
- * @param string $requested_url Optional. The URL that was requested, used to figure if redirect is needed.
+ * @param string $requested_url Optional. The URL that was requested, used to
+ * figure if redirect is needed.
* @param bool $do_redirect Optional. Redirect to the new URL.
- * @return null|false|string Null, if redirect not needed. False, if redirect not needed or the string of the URL
+ * @return null|false|string Null, if redirect not needed. False, if redirect
+ * not needed or the string of the URL
*/
function redirect_canonical($requested_url=null, $do_redirect=true) {
global $wp_rewrite, $is_IIS;
- if ( is_feed() || is_trackback() || is_search() || is_comments_popup() || is_admin() || $is_IIS || ( isset($_POST) && count($_POST) ) || is_preview() )
+ if ( is_feed() || is_trackback() || is_search() || is_comments_popup() || is_admin() || $is_IIS || ( isset($_POST) && count($_POST) ) || is_preview() || is_robots() )
return;
if ( !$requested_url ) {
@@ -137,7 +141,8 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
// www.example.com vs example.com
$user_home = @parse_url(get_option('home'));
- $redirect['host'] = $user_home['host'];
+ if ( isset($user_home['host']) )
+ $redirect['host'] = $user_home['host'];
// Handle ports
if ( isset($user_home['port']) )
@@ -210,12 +215,13 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
}
/**
- * redirect_guess_404_permalink() - Tries to guess correct post based on query vars
+ * Attempts to guess correct post based on query vars
*
* @since 2.3
* @uses $wpdb
*
- * @return bool|string Returns False, if it can't find post, returns correct location on success.
+ * @return bool|string Returns False, if it can't find post, returns correct
+ * location on success.
*/
function redirect_guess_404_permalink() {
global $wpdb;
diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php
index 85eaa77..875173d 100644
--- a/wp-includes/capabilities.php
+++ b/wp-includes/capabilities.php
@@ -34,7 +34,7 @@ class WP_Roles {
}
}
- function add_role($role, $display_name, $capabilities = '') {
+ function add_role($role, $display_name, $capabilities = array()) {
if ( isset($this->roles[$role]) )
return;
@@ -465,7 +465,7 @@ function get_role($role) {
return $wp_roles->get_role($role);
}
-function add_role($role, $display_name, $capabilities = '') {
+function add_role($role, $display_name, $capabilities = array()) {
global $wp_roles;
if ( ! isset($wp_roles) )
diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php
index ba24302..1217276 100644
--- a/wp-includes/category-template.php
+++ b/wp-includes/category-template.php
@@ -185,9 +185,12 @@ function in_category( $category ) { // Check if the current post is in the given
if ( empty($category) )
return false;
- $cat_ID = get_cat_ID($category);
- if ( $cat_ID )
- $category = $cat_ID;
+ // If category is not an int, check to see if it's a name
+ if ( ! is_int($category) ) {
+ $cat_ID = get_cat_ID($category);
+ if ( $cat_ID )
+ $category = $cat_ID;
+ }
$categories = get_object_term_cache($post->ID, 'category');
if ( false === $categories )
@@ -272,7 +275,7 @@ function wp_list_categories($args = '') {
'style' => 'list', 'show_count' => 0,
'hide_empty' => 1, 'use_desc_for_title' => 1,
'child_of' => 0, 'feed' => '', 'feed_type' => '',
- 'feed_image' => '', 'exclude' => '',
+ 'feed_image' => '', 'exclude' => '', 'current_category' => 0,
'hierarchical' => true, 'title_li' => __('Categories'),
'echo' => 1, 'depth' => 0
);
@@ -309,7 +312,7 @@ function wp_list_categories($args = '') {
else
$output .= '<a href="' . get_bloginfo('url') . '">' . $show_option_all . '</a>';
- if ( is_category() )
+ if ( empty( $r['current_category'] ) && is_category() )
$r['current_category'] = $wp_query->get_queried_object_id();
if ( $hierarchical )
diff --git a/wp-includes/class.wp-dependencies.php b/wp-includes/class.wp-dependencies.php
new file mode 100644
index 0000000..1f7bb8d
--- /dev/null
+++ b/wp-includes/class.wp-dependencies.php
@@ -0,0 +1,193 @@
+<?php
+
+class WP_Dependencies {
+ var $registered = array();
+ var $queue = array();
+ var $to_do = array();
+ var $done = array();
+ var $args = array();
+
+ function WP_Dependencies() {
+ $args = func_get_args();
+ call_user_func_array( array(&$this, '__construct'), $args );
+ }
+
+ function __construct() {}
+
+ /**
+ * Do the dependencies
+ *
+ * Process the items passed to it or the queue. Processes all dependencies.
+ *
+ * @param mixed handles (optional) items to be processed. (void) processes queue, (string) process that item, (array of strings) process those items
+ * @return array Items that have been processed
+ */
+ function do_items( $handles = false ) {
+ // Print the queue if nothing is passed. If a string is passed, print that script. If an array is passed, print those scripts.
+ $handles = false === $handles ? $this->queue : (array) $handles;
+ $this->all_deps( $handles );
+
+ foreach( $this->to_do as $handle ) {
+ if ( !in_array($handle, $this->done) && isset($this->registered[$handle]) ) {
+ if ( $this->registered[$handle]->src ) { // Else it defines a group.
+ $this->do_item( $handle );
+ }
+ $this->done[] = $handle;
+ }
+ }
+
+ $this->to_do = array();
+ return $this->done;
+ }
+
+ function do_item( $handle ) {
+ return isset($this->registered[$handle]);
+ }
+
+ /**
+ * Determines dependencies
+ *
+ * Recursively builds array of items to process taking dependencies into account. Does NOT catch infinite loops.
+ *
+
+ * @param mixed handles Accepts (string) dep name or (array of strings) dep names
+ * @param bool recursion Used internally when function calls itself
+ */
+ function all_deps( $handles, $recursion = false ) {
+ if ( !$handles = (array) $handles )
+ return false;
+
+ foreach ( $handles as $handle ) {
+ $handle = explode('?', $handle);
+ if ( isset($handle[1]) )
+ $this->args[$handle[0]] = $handle[1];
+ $handle = $handle[0];
+
+ if ( isset($this->to_do[$handle]) ) // Already grobbed it and its deps
+ continue;
+
+ $keep_going = true;
+ if ( !isset($this->registered[$handle]) )
+ $keep_going = false; // Script doesn't exist
+ elseif ( $this->registered[$handle]->deps && array_diff($this->registered[$handle]->deps, array_keys($this->registered)) )
+ $keep_going = false; // Script requires deps which don't exist (not a necessary check. efficiency?)
+ elseif ( $this->registered[$handle]->deps && !$this->all_deps( $this->registered[$handle]->deps, true ) )
+ $keep_going = false; // Script requires deps which don't exist
+
+ if ( !$keep_going ) { // Either script or its deps don't exist.
+ if ( $recursion )
+ return false; // Abort this branch.
+ else
+ continue; // We're at the top level. Move on to the next one.
+ }
+
+ $this->to_do[$handle] = true;
+ }
+
+ if ( !$recursion ) // at the end
+ $this->to_do = array_keys( $this->to_do );
+ return true;
+ }
+
+ /**
+ * Adds item
+ *
+ * Adds the item only if no item of that name already exists
+ *
+ * @param string handle Script name
+ * @param string src Script url
+ * @param array deps (optional) Array of script names on which this script depends
+ * @param string ver (optional) Script version (used for cache busting)
+ * @return array Hierarchical array of dependencies
+ */
+ function add( $handle, $src, $deps = array(), $ver = false, $args = null ) {
+ if ( isset($this->registered[$handle]) )
+ return false;
+ $this->registered[$handle] = new _WP_Dependency( $handle, $src, $deps, $ver, $args );
+ return true;
+ }
+
+ /**
+ * Adds extra data
+ *
+ * Adds data only if script has already been added
+ *
+ * @param string handle Script name
+ * @param string data_name Name of object in which to store extra data
+ * @param array data Array of extra data
+ * @return bool success
+ */
+ function add_data( $handle, $data_name, $data ) {
+ if ( !isset($this->registered[$handle]) )
+ return false;
+ return $this->registered[$handle]->add_data( $data_name, $data );
+ }
+
+ function remove( $handles ) {
+ foreach ( (array) $handles as $handle )
+ unset($this->registered[$handle]);
+ }
+
+ function enqueue( $handles ) {
+ foreach ( (array) $handles as $handle ) {
+ $handle = explode('?', $handle);
+ if ( !in_array($handle[0], $this->queue) && isset($this->registered[$handle[0]]) ) {
+ $this->queue[] = $handle[0];
+ if ( isset($handle[1]) )
+ $this->args[$handle[0]] = $handle[1];
+ }
+ }
+ }
+
+ function dequeue( $handles ) {
+ foreach ( (array) $handles as $handle )
+ unset( $this->queue[$handle] );
+ }
+
+ function query( $handle, $list = 'registered' ) { // registered, queue, done, to_do
+ switch ( $list ) :
+ case 'registered':
+ case 'scripts': // back compat
+ if ( isset($this->registered[$handle]) )
+ return $this->registered[$handle];
+ break;
+ case 'to_print': // back compat
+ case 'printed': // back compat
+ if ( 'to_print' == $list )
+ $list = 'to_do';
+ else
+ $list = 'printed';
+ default:
+ if ( in_array($handle, $this->$list) )
+ return true;
+ break;
+ endswitch;
+ return false;
+ }
+
+}
+
+class _WP_Dependency {
+ var $handle;
+ var $src;
+ var $deps = array();
+ var $ver = false;
+ var $args = null;
+
+ var $extra = array();
+
+ function _WP_Dependency() {
+ @list($this->handle, $this->src, $this->deps, $this->ver, $this->args) = func_get_args();
+ if ( !is_array($this->deps) )
+ $this->deps = array();
+ if ( !$this->ver )
+ $this->ver = false;
+ }
+
+ function add_data( $name, $data ) {
+ if ( !is_scalar($name) )
+ return false;
+ $this->extra[$name] = $data;
+ return true;
+ }
+}
diff --git a/wp-includes/class.wp-scripts.php b/wp-includes/class.wp-scripts.php
new file mode 100644
index 0000000..d829c8e
--- /dev/null
+++ b/wp-includes/class.wp-scripts.php
@@ -0,0 +1,89 @@
+<?php
+
+class WP_Scripts extends WP_Dependencies {
+ var $base_url; // Full URL with trailing slash
+ var $default_version;
+
+ function __construct() {
+ do_action_ref_array( 'wp_default_scripts', array(&$this) );
+ }
+
+ /**
+ * Prints scripts
+ *
+ * Prints the scripts passed to it or the print queue. Also prints all necessary dependencies.
+ *
+ * @param mixed handles (optional) Scripts to be printed. (void) prints queue, (string) prints that script, (array of strings) prints those scripts.
+ * @return array Scripts that have been printed
+ */
+ function print_scripts( $handles = false ) {
+ return $this->do_items( $handles );
+ }
+
+ function print_scripts_l10n( $handle ) {
+ if ( empty($this->registered[$handle]->extra['l10n']) || empty($this->registered[$handle]->extra['l10n'][0]) || !is_array($this->registered[$handle]->extra['l10n'][1]) )
+ return false;
+
+ $object_name = $this->registered[$handle]->extra['l10n'][0];
+
+ echo "<script type='text/javascript'>\n";
+ echo "/* <![CDATA[ */\n";
+ echo "\t$object_name = {\n";
+ $eol = '';
+ foreach ( $this->registered[$handle]->extra['l10n'][1] as $var => $val ) {
+ echo "$eol\t\t$var: \"" . js_escape( $val ) . '"';
+ $eol = ",\n";
+ }
+ echo "\n\t}\n";
+ echo "/* ]]> */\n";
+ echo "</script>\n";
+
+ return true;
+ }
+
+ function do_item( $handle ) {
+ if ( !parent::do_item($handle) )
+ return false;
+
+ $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version;
+ if ( isset($this->args[$handle]) )
+ $ver .= '&amp;' . $this->args[$handle];
+
+ $src = $this->registered[$handle]->src;
+ if ( !preg_match('|^https?://|', $src) ) {
+ $src = $this->base_url . $src;
+ }
+
+ $src = add_query_arg('ver', $ver, $src);
+ $src = clean_url(apply_filters( 'script_loader_src', $src, $handle ));
+
+ $this->print_scripts_l10n( $handle );
+
+ echo "<script type='text/javascript' src='$src'></script>\n";
+
+ return true;
+ }
+
+ /**
+ * Localizes a script
+ *
+ * Localizes only if script has already been added
+ *
+ * @param string handle Script name
+ * @param string object_name Name of JS object to hold l10n info
+ * @param array l10n Array of JS var name => localized string
+ * @return bool Successful localization
+ */
+ function localize( $handle, $object_name, $l10n ) {
+ if ( !$object_name || !$l10n )
+ return false;
+ return $this->add_data( $handle, 'l10n', array( $object_name, $l10n ) );
+ }
+
+ function all_deps( $handles, $recursion = false ) {
+ $r = parent::all_deps( $handles, $recursion );
+ if ( !$recursion )
+ $this->to_do = apply_filters( 'print_scripts_array', $this->to_do );
+ return $r;
+ }
+}
diff --git a/wp-includes/class.wp-styles.php b/wp-includes/class.wp-styles.php
new file mode 100644
index 0000000..f6a6d79
--- /dev/null
+++ b/wp-includes/class.wp-styles.php
@@ -0,0 +1,71 @@
+<?php
+
+class WP_Styles extends WP_Dependencies {
+ var $base_url;
+ var $default_version;
+ var $text_direction = 'ltr';
+
+ function __construct() {
+ do_action_ref_array( 'wp_default_styles', array(&$this) );
+ }
+
+ function do_item( $handle ) {
+ if ( !parent::do_item($handle) )
+ return false;
+
+ $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version;
+ if ( isset($this->args[$handle]) )
+ $ver .= '&amp;' . $this->args[$handle];
+
+ if ( isset($this->registered[$handle]->args) )
+ $media = attribute_escape( $this->registered[$handle]->args );
+ else
+ $media = 'all';
+
+ $href = $this->_css_href( $this->registered[$handle]->src, $ver, $handle );
+
+ $end_cond = '';
+ if ( isset($this->registered[$handle]->extra['conditional']) && $this->registered[$handle]->extra['conditional'] ) {
+ echo "<!--[if {$this->registered[$handle]->extra['conditional']}]>\n";
+ $end_cond = "<![endif]-->\n";
+ }
+
+ echo apply_filters( 'style_loader_tag', "<link rel='stylesheet' href='$href' type='text/css' media='$media' />\n", $handle );
+ if ( 'rtl' === $this->text_direction && isset($this->registered[$handle]->extra['rtl']) && $this->registered[$handle]->extra['rtl'] ) {
+ if ( is_bool( $this->registered[$handle]->extra['rtl'] ) )
+ $rtl_href = str_replace( '.css', '-rtl.css', $href );
+ else
+ $rtl_href = $this->_css_href( $this->registered[$handle]->extra['rtl'], $ver, "$handle-rtl" );
+
+ echo apply_filters( 'style_loader_tag', "<link rel='stylesheet' href='$rtl_href' type='text/css' media='$media' />\n", $handle );
+ }
+
+ echo $end_cond;
+
+ // Could do something with $this->registered[$handle]->extra here to print out extra CSS rules
+// echo "<style type='text/css'>\n";
+// echo "/* <![CDATA[ */\n";
+// echo "/* ]]> */\n";
+// echo "</style>\n";
+
+ return true;
+ }
+
+ function all_deps( $handles, $recursion = false ) {
+ $r = parent::all_deps( $handles, $recursion );
+ if ( !$recursion )
+ $this->to_do = apply_filters( 'print_styles_array', $this->to_do );
+ return $r;
+ }
+
+ function _css_href( $src, $ver, $handle ) {
+ if ( !preg_match('|^https?://|', $src) ) {
+ $src = $this->base_url . $src;
+ }
+
+ $src = add_query_arg('ver', $ver, $src);
+ $src = apply_filters( 'style_loader_src', $src, $handle );
+ return clean_url( $src );
+ }
+
+}
diff --git a/wp-includes/classes.php b/wp-includes/classes.php
index 0d866fa..a454bef 100644
--- a/wp-includes/classes.php
+++ b/wp-includes/classes.php
@@ -26,6 +26,7 @@ class WP {
global $wp_rewrite;
$this->query_vars = array();
+ $taxonomy_query_vars = array();
if ( is_array($extra_query_vars) )
$this->extra_query_vars = & $extra_query_vars;
@@ -140,6 +141,10 @@ class WP {
$this->public_query_vars = apply_filters('query_vars', $this->public_query_vars);
+ foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t )
+ if ( isset($t->query_var) )
+ $taxonomy_query_vars[$t->query_var] = $taxonomy;
+
for ($i=0; $i<count($this->public_query_vars); $i += 1) {
$wpvar = $this->public_query_vars[$i];
if (isset($this->extra_query_vars[$wpvar]))
@@ -153,8 +158,13 @@ class WP {
elseif (!empty($perma_query_vars[$wpvar]))
$this->query_vars[$wpvar] = $perma_query_vars[$wpvar];
- if ( !empty( $this->query_vars[$wpvar] ) )
+ if ( !empty( $this->query_vars[$wpvar] ) ) {
$this->query_vars[$wpvar] = (string) $this->query_vars[$wpvar];
+ if ( in_array( $wpvar, $taxonomy_query_vars ) ) {
+ $this->query_vars['taxonomy'] = $taxonomy_query_vars[$wpvar];
+ $this->query_vars['term'] = $this->query_vars[$wpvar];
+ }
+ }
}
foreach ($this->private_query_vars as $var) {
diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php
index 1354ca4..6e605a7 100644
--- a/wp-includes/comment-template.php
+++ b/wp-includes/comment-template.php
@@ -389,7 +389,7 @@ function comments_number( $zero = false, $one = false, $more = false, $deprecate
$number = get_comments_number($id);
if ( $number > 1 )
- $output = str_replace('%', $number, ( false === $more ) ? __('% Comments') : $more);
+ $output = str_replace('%', number_format_i18n($number), ( false === $more ) ? __('% Comments') : $more);
elseif ( $number == 0 )
$output = ( false === $zero ) ? __('No Comments') : $zero;
else // must be one
@@ -665,7 +665,7 @@ function comments_template( $file = '/comments.php' ) {
if ( file_exists( $include ) )
require( $include );
else
- require( ABSPATH . 'wp-content/themes/default/comments.php');
+ require( WP_CONTENT_DIR . '/themes/default/comments.php');
}
/**
diff --git a/wp-includes/comment.php b/wp-includes/comment.php
index 57af654..944fe00 100644
--- a/wp-includes/comment.php
+++ b/wp-includes/comment.php
@@ -241,7 +241,7 @@ function get_comment_count( $post_id = 0 ) {
$where = '';
if ( $post_id > 0 ) {
- $where = "WHERE comment_post_ID = {$post_id}";
+ $where = $wpdb->prepare("WHERE comment_post_ID = %d", $post_id);
}
$totals = (array) $wpdb->get_results("
@@ -344,7 +344,7 @@ function wp_allow_comment($commentdata) {
$post_author = $wpdb->get_var($wpdb->prepare("SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1", $comment_post_ID));
}
- if ( $userdata && ( $user_id == $post_author || $user->has_cap('level_9') ) ) {
+ if ( $userdata && ( $user_id == $post_author || $user->has_cap('moderate_comments') ) ) {
// The author and the admins get respect.
$approved = 1;
} else {
@@ -379,7 +379,7 @@ function check_comment_flood_db( $ip, $email, $date ) {
global $wpdb;
if ( current_user_can( 'manage_options' ) )
return; // don't throttle admins
- if ( $lasttime = $wpdb->get_var("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_author_IP = '$ip' OR comment_author_email = '$email' ORDER BY comment_date DESC LIMIT 1") ) {
+ if ( $lasttime = $wpdb->get_var( $wpdb->prepare("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_author_IP = %s OR comment_author_email = %s ORDER BY comment_date DESC LIMIT 1", $ip, $email) ) ) {
$time_lastcomment = mysql2date('U', $lasttime);
$time_newcomment = mysql2date('U', $date);
$flood_die = apply_filters('comment_flood_filter', false, $time_lastcomment, $time_newcomment);
@@ -448,29 +448,38 @@ function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_age
return false;
}
-function wp_count_comments() {
+function wp_count_comments( $post_id = 0 ) {
global $wpdb;
- $count = wp_cache_get('comments', 'counts');
+ $post_id = (int) $post_id;
+
+ $count = wp_cache_get("comments-{$post_id}", 'counts');
if ( false !== $count )
return $count;
- $count = $wpdb->get_results( "SELECT comment_approved, COUNT( * ) AS num_comments FROM {$wpdb->comments} GROUP BY comment_approved", ARRAY_A );
+ $where = '';
+ if( $post_id > 0 )
+ $where = $wpdb->prepare( "WHERE comment_post_ID = %d", $post_id );
+
+ $count = $wpdb->get_results( "SELECT comment_approved, COUNT( * ) AS num_comments FROM {$wpdb->comments} {$where} GROUP BY comment_approved", ARRAY_A );
+ $total = 0;
$stats = array( );
$approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam');
foreach( (array) $count as $row_num => $row ) {
+ $total += $row['num_comments'];
$stats[$approved[$row['comment_approved']]] = $row['num_comments'];
}
+ $stats['total_comments'] = $total;
foreach ( $approved as $key ) {
if ( empty($stats[$key]) )
$stats[$key] = 0;
}
$stats = (object) $stats;
- wp_cache_set('comments', $stats, 'counts');
+ wp_cache_set("comments-{$post_id}", $stats, 'counts');
return $stats;
}
@@ -495,7 +504,7 @@ function wp_delete_comment($comment_id) {
$comment = get_comment($comment_id);
- if ( ! $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1") )
+ if ( ! $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment_id) ) )
return false;
$post_id = $comment->comment_post_ID;
@@ -578,7 +587,7 @@ function wp_get_current_commenter() {
*/
function wp_insert_comment($commentdata) {
global $wpdb;
- extract($commentdata, EXTR_SKIP);
+ extract(stripslashes_deep($commentdata), EXTR_SKIP);
if ( ! isset($comment_author_IP) )
$comment_author_IP = '';
@@ -593,11 +602,10 @@ function wp_insert_comment($commentdata) {
if ( ! isset($user_id) )
$user_id = 0;
- $result = $wpdb->query("INSERT INTO $wpdb->comments
+ $result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->comments
(comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved, comment_agent, comment_type, comment_parent, user_id)
- VALUES
- ('$comment_post_ID', '$comment_author', '$comment_author_email', '$comment_author_url', '$comment_author_IP', '$comment_date', '$comment_date_gmt', '$comment_content', '$comment_approved', '$comment_agent', '$comment_type', '$comment_parent', '$user_id')
- ");
+ VALUES (%d, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, %d)",
+ $comment_post_ID, $comment_author, $comment_author_email, $comment_author_url, $comment_author_IP, $comment_date, $comment_date_gmt, $comment_content, $comment_approved, $comment_agent, $comment_type, $comment_parent, $user_id) );
$id = (int) $wpdb->insert_id;
@@ -722,18 +730,17 @@ function wp_set_comment_status($comment_id, $comment_status) {
switch ( $comment_status ) {
case 'hold':
- $query = "UPDATE $wpdb->comments SET comment_approved='0' WHERE comment_ID='$comment_id' LIMIT 1";
+ $query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='0' WHERE comment_ID = %d LIMIT 1", $comment_id);
break;
case 'approve':
- $query = "UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID='$comment_id' LIMIT 1";
+ $query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID = %d LIMIT 1", $comment_id);
if ( get_option('comments_notify') ) {
$comment = get_comment($comment_id);
wp_notify_postauthor($comment_id, $comment->comment_type);
}
-
break;
case 'spam':
- $query = "UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID='$comment_id' LIMIT 1";
+ $query = $wpdb->prepare("UPDATE $wpdb->comments SET comment_approved='spam' WHERE comment_ID = %d LIMIT 1", $comment_id);
break;
case 'delete':
return wp_delete_comment($comment_id);
@@ -781,22 +788,29 @@ function wp_update_comment($commentarr) {
$commentarr = wp_filter_comment( $commentarr );
// Now extract the merged array.
- extract($commentarr, EXTR_SKIP);
+ extract(stripslashes_deep($commentarr), EXTR_SKIP);
$comment_content = apply_filters('comment_save_pre', $comment_content);
$comment_date_gmt = get_gmt_from_date($comment_date);
- $wpdb->query(
- "UPDATE $wpdb->comments SET
- comment_content = '$comment_content',
- comment_author = '$comment_author',
- comment_author_email = '$comment_author_email',
- comment_approved = '$comment_approved',
- comment_author_url = '$comment_author_url',
- comment_date = '$comment_date',
- comment_date_gmt = '$comment_date_gmt'
- WHERE comment_ID = $comment_ID" );
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->comments SET
+ comment_content = %s,
+ comment_author = %s,
+ comment_author_email = %s,
+ comment_approved = %s,
+ comment_author_url = %s,
+ comment_date = %s,
+ comment_date_gmt = %s
+ WHERE comment_ID = %d",
+ $comment_content,
+ $comment_author,
+ $comment_author_email,
+ $comment_approved,
+ $comment_author_url,
+ $comment_date,
+ $comment_date_gmt,
+ $comment_ID) );
$rval = $wpdb->rows_affected;
@@ -892,8 +906,8 @@ function wp_update_comment_count_now($post_id) {
return false;
$old = (int) $post->comment_count;
- $new = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = '$post_id' AND comment_approved = '1'");
- $wpdb->query("UPDATE $wpdb->posts SET comment_count = '$new' WHERE ID = '$post_id'");
+ $new = (int) $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1'", $post_id) );
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET comment_count = %d WHERE ID = %d", $new, $post_id) );
if ( 'page' == $post->post_type )
clean_page_cache( $post_id );
@@ -987,18 +1001,22 @@ function discover_pingback_server_uri($url, $timeout_bytes = 2048) {
$pingback_server_url_len = $pingback_href_end - $pingback_href_start;
$pingback_server_url = substr($contents, $pingback_href_start, $pingback_server_url_len);
// We may find rel="pingback" but an incomplete pingback URL
- if ( $pingback_server_url_len > 0 ) // We got it!
+ if ( $pingback_server_url_len > 0 ) { // We got it!
+ fclose($fp);
return $pingback_server_url;
+ }
}
$byte_count += strlen($line);
if ( $byte_count > $timeout_bytes ) {
// It's no use going further, there probably isn't any pingback
// server to find in this file. (Prevents loading large files.)
+ fclose($fp);
return false;
}
}
// We didn't find anything.
+ fclose($fp);
return false;
}
@@ -1021,7 +1039,7 @@ function do_all_pings() {
// Do Enclosures
while ($enclosure = $wpdb->get_row("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme' LIMIT 1")) {
- $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$enclosure->ID} AND meta_key = '_encloseme';");
+ $wpdb->query( $wpdb->prepare("DELETE FROM {$wpdb->postmeta} WHERE post_id = %d AND meta_key = '_encloseme';", $enclosure->ID) );
do_enclose($enclosure->post_content, $enclosure->ID);
}
@@ -1048,11 +1066,11 @@ function do_all_pings() {
function do_trackbacks($post_id) {
global $wpdb;
- $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = $post_id");
+ $post = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d", $post_id) );
$to_ping = get_to_ping($post_id);
$pinged = get_pung($post_id);
if ( empty($to_ping) ) {
- $wpdb->query("UPDATE $wpdb->posts SET to_ping = '' WHERE ID = '$post_id'");
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET to_ping = '' WHERE ID = %d", $post_id) );
return;
}
@@ -1073,7 +1091,7 @@ function do_trackbacks($post_id) {
trackback($tb_ping, $post_title, $excerpt, $post_id);
$pinged[] = $tb_ping;
} else {
- $wpdb->query("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, '$tb_ping', '')) WHERE ID = '$post_id'");
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, '$tb_ping', '')) WHERE ID = %d", $post_id) );
}
}
}
@@ -1238,8 +1256,8 @@ function trackback($trackback_url, $title, $excerpt, $ID) {
@fclose($fs);
$tb_url = addslashes( $tb_url );
- $wpdb->query("UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', '$tb_url') WHERE ID = '$ID'");
- return $wpdb->query("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, '$tb_url', '')) WHERE ID = '$ID'");
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', '$tb_url') WHERE ID = %d", $ID) );
+ return $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, '$tb_url', '')) WHERE ID = %d", $ID) );
}
/**
diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php
index 857de94..bba6608 100644
--- a/wp-includes/default-filters.php
+++ b/wp-includes/default-filters.php
@@ -175,9 +175,11 @@ add_action('do_pings', 'do_all_pings', 10, 1);
add_action('do_robots', 'do_robots');
add_action('sanitize_comment_cookies', 'sanitize_comment_cookies');
add_action('admin_print_scripts', 'wp_print_scripts', 20);
+add_action('admin_print_styles', 'wp_print_styles', 20);
add_action('init', 'smilies_init', 5);
add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 );
add_action( 'shutdown', 'wp_ob_end_flush_all', 1);
+add_action( 'pre_post_update', 'wp_save_post_revision' );
add_action('publish_post', '_publish_post_hook', 5, 1);
add_action('future_post', '_future_post_hook', 5, 2);
add_action('future_page', '_future_post_hook', 5, 2);
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 052445d..c49b663 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -839,6 +839,9 @@ function human_time_diff( $from, $to = '' ) {
function wp_trim_excerpt($text) { // Fakes an excerpt if needed
if ( '' == $text ) {
$text = get_the_content('');
+
+ $text = strip_shortcodes( $text );
+
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]&gt;', $text);
$text = strip_tags($text);
@@ -1129,6 +1132,10 @@ function wp_richedit_pre($text) {
$output = str_replace('&lt;', '&amp;lt;', $output);
$output = str_replace('&gt;', '&amp;gt;', $output);
+ // These should be entities too
+ $output = str_replace('<', '&lt;', $output);
+ $output = str_replace('>', '&gt;', $output);
+
return apply_filters('richedit_pre', $output);
}
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 89b4333..a4a5914 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -1071,7 +1071,7 @@ function wp_upload_dir( $time = NULL ) {
$siteurl = get_option( 'siteurl' );
$upload_path = get_option( 'upload_path' );
if ( trim($upload_path) === '' )
- $upload_path = 'wp-content/uploads';
+ $upload_path = WP_CONTENT_DIR . '/uploads';
$dir = $upload_path;
// $dir is absolute, $path is (maybe) relative to ABSPATH
@@ -1556,8 +1556,8 @@ function wp_ob_end_flush_all() {
*/
function require_wp_db() {
global $wpdb;
- if ( file_exists( ABSPATH . 'wp-content/db.php' ) )
- require_once( ABSPATH . 'wp-content/db.php' );
+ if ( file_exists( WP_CONTENT_DIR . '/db.php' ) )
+ require_once( WP_CONTENT_DIR . '/db.php' );
else
require_once( ABSPATH . WPINC . '/wp-db.php' );
}
@@ -1566,8 +1566,8 @@ function dead_db() {
global $wpdb;
// Load custom DB error template, if present.
- if ( file_exists( ABSPATH . 'wp-content/db-error.php' ) ) {
- require_once( ABSPATH . 'wp-content/db-error.php' );
+ if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) {
+ require_once( WP_CONTENT_DIR . '/db-error.php' );
die();
}
@@ -1668,9 +1668,9 @@ function _deprecated_function($function, $version, $replacement=null) {
// Allow plugin to filter the output error trigger
if( defined('WP_DEBUG') && ( true === WP_DEBUG ) && apply_filters( 'deprecated_function_trigger_error', true )) {
if( !is_null($replacement) )
- trigger_error( printf( __("%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead."), $function, $version, $replacement ) );
+ trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
else
- trigger_error( printf( __("%1$s is <strong>deprecated</strong> since version %2$s with no alternative available."), $function, $version ) );
+ trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
}
}
@@ -1703,9 +1703,9 @@ function _deprecated_file($file, $version, $replacement=null) {
// Allow plugin to filter the output error trigger
if( defined('WP_DEBUG') && ( true === WP_DEBUG ) && apply_filters( 'deprecated_file_trigger_error', true )) {
if( !is_null($replacement) )
- trigger_error( printf( __("%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead."), $file, $version, $replacement ) );
+ trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) );
else
- trigger_error( printf( __("%1$s is <strong>deprecated</strong> since version %2$s with no alternative available."), $file, $version ) );
+ trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version ) );
}
}
@@ -1763,4 +1763,32 @@ function validate_file( $file, $allowed_files = '' ) {
return 0;
}
+function is_ssl() {
+ return ( 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false;
+}
+
+function force_ssl_login($force = '') {
+ static $forced;
+
+ if ( '' != $force ) {
+ $old_forcded = $forced;
+ $forced = $force;
+ return $old_forced;
+ }
+
+ return $forced;
+}
+
+function force_ssl_admin($force = '') {
+ static $forced;
+
+ if ( '' != $force ) {
+ $old_forcded = $forced;
+ $forced = $force;
+ return $old_forced;
+ }
+
+ return $forced;
+}
+
?>
diff --git a/wp-includes/functions.wp-scripts.php b/wp-includes/functions.wp-scripts.php
new file mode 100644
index 0000000..87995a4
--- /dev/null
+++ b/wp-includes/functions.wp-scripts.php
@@ -0,0 +1,77 @@
+<?php
+
+/**
+ * Prints script tags in document head
+ *
+ * Called by admin-header.php and by wp_head hook. Since it is called by wp_head on every page load,
+ * the function does not instantiate the WP_Scripts object unless script names are explicitly passed.
+ * Does make use of already instantiated $wp_scripts if present.
+ * Use provided wp_print_scripts hook to register/enqueue new scripts.
+ *
+ * @see WP_Scripts::print_scripts()
+ */
+function wp_print_scripts( $handles = false ) {
+ do_action( 'wp_print_scripts' );
+ if ( '' === $handles ) // for wp_head
+ $handles = false;
+
+ global $wp_scripts;
+ if ( !is_a($wp_scripts, 'WP_Scripts') ) {
+ if ( !$handles )
+ return array(); // No need to instantiate if nothing's there.
+ else
+ $wp_scripts = new WP_Scripts();
+ }
+
+ return $wp_scripts->do_items( $handles );
+}
+
+function wp_register_script( $handle, $src, $deps = array(), $ver = false ) {
+ global $wp_scripts;
+ if ( !is_a($wp_scripts, 'WP_Scripts') )
+ $wp_scripts = new WP_Scripts();
+
+ $wp_scripts->add( $handle, $src, $deps, $ver );
+}
+
+/**
+ * Localizes a script
+ *
+ * Localizes only if script has already been added
+ *
+ * @see WP_Script::localize()
+ */
+function wp_localize_script( $handle, $object_name, $l10n ) {
+ global $wp_scripts;
+ if ( !is_a($wp_scripts, 'WP_Scripts') )
+ return false;
+
+ return $wp_scripts->localize( $handle, $object_name, $l10n );
+}
+
+function wp_deregister_script( $handle ) {
+ global $wp_scripts;
+ if ( !is_a($wp_scripts, 'WP_Scripts') )
+ $wp_scripts = new WP_Scripts();
+
+ $wp_scripts->remove( $handle );
+}
+
+/**
+ * Equeues script
+ *
+ * Registers the script if src provided (does NOT overwrite) and enqueues.
+ *
+ * @see WP_Script::add(), WP_Script::enqueue()
+*/
+function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false ) {
+ global $wp_scripts;
+ if ( !is_a($wp_scripts, 'WP_Scripts') )
+ $wp_scripts = new WP_Scripts();
+
+ if ( $src ) {
+ $_handle = explode('?', $handle);
+ $wp_scripts->add( $_handle[0], $src, $deps, $ver );
+ }
+ $wp_scripts->enqueue( $handle );
+}
diff --git a/wp-includes/functions.wp-styles.php b/wp-includes/functions.wp-styles.php
new file mode 100644
index 0000000..8a38282
--- /dev/null
+++ b/wp-includes/functions.wp-styles.php
@@ -0,0 +1,45 @@
+<?php
+
+function wp_print_styles( $handles = false ) {
+ do_action( 'wp_print_styles' );
+ if ( '' === $handles ) // for wp_head
+ $handles = false;
+
+ global $wp_styles;
+ if ( !is_a($wp_styles, 'WP_Styles') ) {
+ if ( !$handles )
+ return array(); // No need to instantiate if nothing's there.
+ else
+ $wp_styles = new WP_Styles();
+ }
+
+ return $wp_styles->do_items( $handles );
+}
+
+function wp_register_style( $handle, $src, $deps = array(), $ver = false, $media = false ) {
+ global $wp_styles;
+ if ( !is_a($wp_styles, 'WP_Styles') )
+ $wp_styles = new WP_Styles();
+
+ $wp_styles->add( $handle, $src, $deps, $ver, $media );
+}
+
+function wp_deregister_style( $handle ) {
+ global $wp_styles;
+ if ( !is_a($wp_styles, 'WP_Styles') )
+ $wp_styles = new WP_Styles();
+
+ $wp_styles->remove( $handle );
+}
+
+function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = false ) {
+ global $wp_styles;
+ if ( !is_a($wp_styles, 'WP_Styles') )
+ $wp_styles = new WP_Styles();
+
+ if ( $src ) {
+ $_handle = explode('?', $handle);
+ $wp_styles->add( $_handle[0], $src, $deps, $ver, $media );
+ }
+ $wp_styles->enqueue( $handle );
+}
diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
index 4a7f1bb..afc6c56 100644
--- a/wp-includes/general-template.php
+++ b/wp-includes/general-template.php
@@ -7,7 +7,7 @@ function get_header() {
if ( file_exists( TEMPLATEPATH . '/header.php') )
load_template( TEMPLATEPATH . '/header.php');
else
- load_template( ABSPATH . 'wp-content/themes/default/header.php');
+ load_template( WP_CONTENT_DIR . '/themes/default/header.php');
}
@@ -16,7 +16,7 @@ function get_footer() {
if ( file_exists( TEMPLATEPATH . '/footer.php') )
load_template( TEMPLATEPATH . '/footer.php');
else
- load_template( ABSPATH . 'wp-content/themes/default/footer.php');
+ load_template( WP_CONTENT_DIR . '/themes/default/footer.php');
}
@@ -27,15 +27,15 @@ function get_sidebar( $name = null ) {
elseif ( file_exists( TEMPLATEPATH . '/sidebar.php') )
load_template( TEMPLATEPATH . '/sidebar.php');
else
- load_template( ABSPATH . 'wp-content/themes/default/sidebar.php');
+ load_template( WP_CONTENT_DIR . '/themes/default/sidebar.php');
}
function wp_loginout() {
if ( ! is_user_logged_in() )
- $link = '<a href="' . get_option('siteurl') . '/wp-login.php">' . __('Log in') . '</a>';
+ $link = '<a href="' . site_url('wp-login.php', 'login') . '">' . __('Log in') . '</a>';
else
- $link = '<a href="' . get_option('siteurl') . '/wp-login.php?action=logout">' . __('Log out') . '</a>';
+ $link = '<a href="' . site_url('wp-login.php?action=logout', 'login') . '">' . __('Log out') . '</a>';
echo apply_filters('loginout', $link);
}
@@ -45,11 +45,11 @@ function wp_register( $before = '<li>', $after = '</li>' ) {
if ( ! is_user_logged_in() ) {
if ( get_option('users_can_register') )
- $link = $before . '<a href="' . get_option('siteurl') . '/wp-login.php?action=register">' . __('Register') . '</a>' . $after;
+ $link = $before . '<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>' . $after;
else
$link = '';
} else {
- $link = $before . '<a href="' . get_option('siteurl') . '/wp-admin/">' . __('Site Admin') . '</a>' . $after;
+ $link = $before . '<a href="' . admin_url() . '">' . __('Site Admin') . '</a>' . $after;
}
echo apply_filters('register', $link);
@@ -233,6 +233,19 @@ function wp_title($sep = '&raquo;', $display = true, $seplocation = '') {
$title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) );
}
+ // If there's a taxonomy
+ if ( is_tax() ) {
+ $taxonomy = get_query_var( 'taxonomy' );
+ $tax = get_taxonomy( $taxonomy );
+ $tax = $tax->label;
+ $term = $wp_query->get_queried_object();
+ $term = $term->name;
+ if ( 'right' == $seplocation )
+ $title = "$term $sep $tax";
+ else
+ $title = "$tax $sep $term";
+ }
+
$prefix = '';
if ( !empty($title) )
$prefix = " $sep ";
@@ -814,7 +827,7 @@ function get_post_time( $d = 'U', $gmt = false ) { // returns timestamp
$time = $post->post_date;
$time = mysql2date($d, $time);
- return apply_filters('get_the_time', $time, $d, $gmt);
+ return apply_filters('get_post_time', $time, $d, $gmt);
}
@@ -1115,34 +1128,76 @@ function wp_admin_css_color($key, $name, $url, $colors = array()) {
$_wp_admin_css_colors[$key] = (object) array('name' => $name, 'url' => $url, 'colors' => $colors);
}
+/**
+ * wp_admin_css_uri() - Outputs the URL of a WordPress admin CSS file
+ *
+ * @see WP_Styles::_css_href and its style_loader_src filter.
+ *
+ * @param string $file file relative to wp-admin/ without its ".css" extension.
+ */
+
function wp_admin_css_uri( $file = 'wp-admin' ) {
if ( defined('WP_INSTALLING') ) {
$_file = "./$file.css";
} else {
- if ( 'css/colors' == $file || 'css/colors-rtl' == $file ) {
- global $_wp_admin_css_colors;
- $color = get_user_option('admin_color');
- if ( empty($color) || !isset($_wp_admin_css_colors[$color]) )
- $color = 'fresh';
- $color = $_wp_admin_css_colors[$color];
- $_file = $color->url;
- $_file = ('css/colors-rtl' == $file) ? str_replace('.css','-rtl.css',$_file) : $_file;
- } else {
- $_file = get_option( 'siteurl' ) . "/wp-admin/$file.css";
- }
+ $_file = admin_url("$file.css");
}
$_file = add_query_arg( 'version', get_bloginfo( 'version' ), $_file );
return apply_filters( 'wp_admin_css_uri', $_file, $file );
}
-function wp_admin_css( $file = 'wp-admin' ) {
+/**
+ * wp_admin_css() - Enqueues or directly prints a stylesheet link to the specified CSS file.
+ *
+ * "Intelligently" decides to enqueue or to print the CSS file.
+ * If the wp_print_styles action has *not* yet been called, the CSS file will be enqueued.
+ * If the wp_print_styles action *has* been called, the CSS link will be printed.
+ * Printing may be forced by passing TRUE as the $force_echo (second) parameter.
+ *
+ * For backward compatibility with WordPress 2.3 calling method:
+ * If the $file (first) parameter does not correspond to a registered CSS file, we assume $file is a
+ * file relative to wp-admin/ without its ".css" extension. A stylesheet link to that generated URL is printed.
+ *
+ * @package WordPress
+ * @since 2.3
+ *
+ * @uses $wp_styles WordPress Styles Object
+ *
+ * @param string $file Style handle name or file name (without ".css" extension) relative to wp-admin/
+ * @param bool $force_echo Optional. Force the stylesheet link to be printed rather than enqueued.
+ */
+
+function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {
+ global $wp_styles;
+ if ( !is_a($wp_styles, 'WP_Styles') )
+ $wp_styles = new WP_Styles();
+
+ // For backward compatibility
+ $handle = 0 === strpos( $file, 'css/' ) ? substr( $file, 4 ) : $file;
- echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . wp_admin_css_uri( $file ) . "' type='text/css' />\n", $file );
- if ( 'rtl' == get_bloginfo( 'text_direction' ) ) {
- $rtl = ( 'wp-admin' == $file ) ? 'rtl' : "$file-rtl";
- echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . wp_admin_css_uri( $rtl ) . "' type='text/css' />\n", $rtl );
+ if ( $wp_styles->query( $handle ) ) {
+ if ( $force_echo || did_action( 'wp_print_styles' ) ) // we already printed the style queue. Print this one immediately
+ wp_print_styles( $handle );
+ else // Add to style queue
+ wp_enqueue_style( $handle );
+ return;
}
+
+ echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . clean_url( wp_admin_css_uri( $file ) ) . "' type='text/css' />\n", $file );
+ if ( 'rtl' == get_bloginfo( 'text_direction' ) )
+ echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . clean_url( wp_admin_css_uri( "$file-rtl" ) ) . "' type='text/css' />\n", "$file-rtl" );
+}
+
+/**
+ * Enqueues the default ThickBox js and css.
+ * If any of the settings need to be changed, this can be done with another js file
+ * similar to media-upload.js and theme-preview.js. That file should require array('thickbox')
+ * to ensure it is loaded after.
+ */
+function add_thickbox() {
+ wp_enqueue_script( 'thickbox' );
+ wp_enqueue_style( 'thickbox' );
}
/**
diff --git a/wp-includes/js/autosave.js b/wp-includes/js/autosave.js
index b0a2fa5..2f77920 100644
--- a/wp-includes/js/autosave.js
+++ b/wp-includes/js/autosave.js
@@ -154,8 +154,13 @@ var autosave = function() {
doAutoSave = false;
/* Gotta do this up here so we can check the length when tinyMCE is in use */
- if ( rich ) { tinyMCE.triggerSave(); }
-
+ if ( rich ) {
+ var ed = tinyMCE.activeEditor;
+ if ( 'mce_fullscreen' == ed.id )
+ tinyMCE.get('content').setContent(ed.getContent({format : 'raw'}), {format : 'raw'});
+ tinyMCE.get('content').save();
+ }
+
post_data["content"] = jQuery("#content").val();
if ( jQuery('#post_name').val() )
post_data["post_name"] = jQuery('#post_name').val();
@@ -168,8 +173,6 @@ var autosave = function() {
autosave_disable_buttons();
var origStatus = jQuery('#original_post_status').val();
- if ( 'draft' != origStatus ) // autosave currently only turned on for drafts
- doAutoSave = false;
autosaveLast = jQuery("#title").val()+jQuery("#content").val();
goodcats = ([]);
@@ -182,9 +185,9 @@ var autosave = function() {
post_data["comment_status"] = 'open';
if ( jQuery("#ping_status").attr("checked") )
post_data["ping_status"] = 'open';
- if ( jQuery("#excerpt") )
+ if ( jQuery("#excerpt").size() )
post_data["excerpt"] = jQuery("#excerpt").val();
- if ( jQuery("#post_author") )
+ if ( jQuery("#post_author").size() )
post_data["post_author"] = jQuery("#post_author").val();
// Don't run while the TinyMCE spellcheck is on. Why? Who knows.
diff --git a/wp-includes/js/jquery/jquery.form.js b/wp-includes/js/jquery/jquery.form.js
index 9b10cab..2ee5c96 100644
--- a/wp-includes/js/jquery/jquery.form.js
+++ b/wp-includes/js/jquery/jquery.form.js
@@ -1,872 +1,872 @@
-/*
- * jQuery Form Plugin
- * version: 2.02 (12/16/2007)
- * @requires jQuery v1.1 or later
- *
- * Examples at: http://malsup.com/jquery/form/
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- * Revision: $Id$
- */
- (function($) {
-/**
- * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.
- *
- * ajaxSubmit accepts a single argument which can be either a success callback function
- * or an options Object. If a function is provided it will be invoked upon successful
- * completion of the submit and will be passed the response from the server.
- * If an options Object is provided, the following attributes are supported:
- *
- * target: Identifies the element(s) in the page to be updated with the server response.
- * This value may be specified as a jQuery selection string, a jQuery object,
- * or a DOM element.
- * default value: null
- *
- * url: URL to which the form data will be submitted.
- * default value: value of form's 'action' attribute
- *
- * type: The method in which the form data should be submitted, 'GET' or 'POST'.
- * default value: value of form's 'method' attribute (or 'GET' if none found)
- *
- * data: Additional data to add to the request, specified as key/value pairs (see $.ajax).
- *
- * beforeSubmit: Callback method to be invoked before the form is submitted.
- * default value: null
- *
- * success: Callback method to be invoked after the form has been successfully submitted
- * and the response has been returned from the server
- * default value: null
- *
- * dataType: Expected dataType of the response. One of: null, 'xml', 'script', or 'json'
- * default value: null
- *
- * semantic: Boolean flag indicating whether data must be submitted in semantic order (slower).
- * default value: false
- *
- * resetForm: Boolean flag indicating whether the form should be reset if the submit is successful
- *
- * clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful
- *
- *
- * The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for
- * validating the form data. If the 'beforeSubmit' callback returns false then the form will
- * not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data
- * in array format, the jQuery object, and the options object passed into ajaxSubmit.
- * The form data array takes the following form:
- *
- * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * If a 'success' callback method is provided it is invoked after the response has been returned
- * from the server. It is passed the responseText or responseXML value (depending on dataType).
- * See jQuery.ajax for further details.
- *
- *
- * The dataType option provides a means for specifying how the server response should be handled.
- * This maps directly to the jQuery.httpData method. The following values are supported:
- *
- * 'xml': if dataType == 'xml' the server response is treated as XML and the 'success'
- * callback method, if specified, will be passed the responseXML value
- * 'json': if dataType == 'json' the server response will be evaluted and passed to
- * the 'success' callback, if specified
- * 'script': if dataType == 'script' the server response is evaluated in the global context
- *
- *
- * Note that it does not make sense to use both the 'target' and 'dataType' options. If both
- * are provided the target will be ignored.
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * This is normally true anyway, unless the form contains input elements of type='image'.
- * If your form must be submitted with name/value pairs in semantic order and your form
- * contains an input of type='image" then pass true for this arg, otherwise pass false
- * (or nothing) to avoid the overhead for this logic.
- *
- *
- * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this:
- *
- * $("#form-id").submit(function() {
- * $(this).ajaxSubmit(options);
- * return false; // cancel conventional submit
- * });
- *
- * When using ajaxForm(), however, this is done for you.
- *
- * @example
- * $('#myForm').ajaxSubmit(function(data) {
- * alert('Form submit succeeded! Server returned: ' + data);
- * });
- * @desc Submit form and alert server response
- *
- *
- * @example
- * var options = {
- * target: '#myTargetDiv'
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Submit form and update page element with server response
- *
- *
- * @example
- * var options = {
- * success: function(responseText) {
- * alert(responseText);
- * }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Submit form and alert the server response
- *
- *
- * @example
- * var options = {
- * beforeSubmit: function(formArray, jqForm) {
- * if (formArray.length == 0) {
- * alert('Please enter data.');
- * return false;
- * }
- * }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Pre-submit validation which aborts the submit operation if form data is empty
- *
- *
- * @example
- * var options = {
- * url: myJsonUrl.php,
- * dataType: 'json',
- * success: function(data) {
- * // 'data' is an object representing the the evaluated json data
- * }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc json data returned and evaluated
- *
- *
- * @example
- * var options = {
- * url: myXmlUrl.php,
- * dataType: 'xml',
- * success: function(responseXML) {
- * // responseXML is XML document object
- * var data = $('myElement', responseXML).text();
- * }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc XML data returned from server
- *
- *
- * @example
- * var options = {
- * resetForm: true
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc submit form and reset it if successful
- *
- * @example
- * $('#myForm).submit(function() {
- * $(this).ajaxSubmit();
- * return false;
- * });
- * @desc Bind form's submit event to use ajaxSubmit
- *
- *
- * @name ajaxSubmit
- * @type jQuery
- * @param options object literal containing options which control the form submission process
- * @cat Plugins/Form
- * @return jQuery
- */
-$.fn.ajaxSubmit = function(options) {
- if (typeof options == 'function')
- options = { success: options };
-
- options = $.extend({
- url: this.attr('action') || window.location.toString(),
- type: this.attr('method') || 'GET'
- }, options || {});
-
- // hook for manipulating the form data before it is extracted;
- // convenient for use with rich editors like tinyMCE or FCKEditor
- var veto = {};
- $.event.trigger('form.pre.serialize', [this, options, veto]);
- if (veto.veto) return this;
-
- var a = this.formToArray(options.semantic);
- if (options.data) {
- for (var n in options.data)
- a.push( { name: n, value: options.data[n] } );
- }
-
- // give pre-submit callback an opportunity to abort the submit
- if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this;
-
- // fire vetoable 'validate' event
- $.event.trigger('form.submit.validate', [a, this, options, veto]);
- if (veto.veto) return this;
-
- var q = $.param(a);//.replace(/%20/g,'+');
-
- if (options.type.toUpperCase() == 'GET') {
- options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
- options.data = null; // data is null for 'get'
- }
- else
- options.data = q; // data is the query string for 'post'
-
- var $form = this, callbacks = [];
- if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
- if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
-
- // perform a load on the target only if dataType is not provided
- if (!options.dataType && options.target) {
- var oldSuccess = options.success || function(){};
- callbacks.push(function(data) {
- if (this.evalScripts)
- $(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments);
- else // jQuery v1.1.4
- $(options.target).html(data).each(oldSuccess, arguments);
- });
- }
- else if (options.success)
- callbacks.push(options.success);
-
- options.success = function(data, status) {
- for (var i=0, max=callbacks.length; i < max; i++)
- callbacks[i](data, status, $form);
- };
-
- // are there files to upload?
- var files = $('input:file', this).fieldValue();
- var found = false;
- for (var j=0; j < files.length; j++)
- if (files[j])
- found = true;
-
- // options.iframe allows user to force iframe mode
- if (options.iframe || found) {
- // hack to fix Safari hang (thanks to Tim Molendijk for this)
- // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
- if ($.browser.safari && options.closeKeepAlive)
- $.get(options.closeKeepAlive, fileUpload);
- else
- fileUpload();
- }
- else
- $.ajax(options);
-
- // fire 'notify' event
- $.event.trigger('form.submit.notify', [this, options]);
- return this;
-
-
- // private function for handling file uploads (hat tip to YAHOO!)
- function fileUpload() {
- var form = $form[0];
- var opts = $.extend({}, $.ajaxSettings, options);
-
- var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++;
- var $io = $('<iframe id="' + id + '" name="' + id + '" />');
- var io = $io[0];
- var op8 = $.browser.opera && window.opera.version() < 9;
- if ($.browser.msie || op8) io.src = 'javascript:false;document.write("");';
- $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
-
- var xhr = { // mock object
- responseText: null,
- responseXML: null,
- status: 0,
- statusText: 'n/a',
- getAllResponseHeaders: function() {},
- getResponseHeader: function() {},
- setRequestHeader: function() {}
- };
-
- var g = opts.global;
- // trigger ajax global events so that activity/block indicators work like normal
- if (g && ! $.active++) $.event.trigger("ajaxStart");
- if (g) $.event.trigger("ajaxSend", [xhr, opts]);
-
- var cbInvoked = 0;
- var timedOut = 0;
-
- // take a breath so that pending repaints get some cpu time before the upload starts
- setTimeout(function() {
- // make sure form attrs are set
- var encAttr = form.encoding ? 'encoding' : 'enctype';
- var t = $form.attr('target');
- $form.attr({
- target: id,
- method: 'POST',
- action: opts.url
- });
- form[encAttr] = 'multipart/form-data';
-
- // support timout
- if (opts.timeout)
- setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
-
- // add iframe to doc and submit the form
- $io.appendTo('body');
- io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
- form.submit();
- $form.attr('target', t); // reset target
- }, 10);
-
- function cb() {
- if (cbInvoked++) return;
-
- io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
-
- var ok = true;
- try {
- if (timedOut) throw 'timeout';
- // extract the server response from the iframe
- var data, doc;
- doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
- xhr.responseText = doc.body ? doc.body.innerHTML : null;
- xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
-
- if (opts.dataType == 'json' || opts.dataType == 'script') {
- var ta = doc.getElementsByTagName('textarea')[0];
- data = ta ? ta.value : xhr.responseText;
- if (opts.dataType == 'json')
- eval("data = " + data);
- else
- $.globalEval(data);
- }
- else if (opts.dataType == 'xml') {
- data = xhr.responseXML;
- if (!data && xhr.responseText != null)
- data = toXml(xhr.responseText);
- }
- else {
- data = xhr.responseText;
- }
- }
- catch(e){
- ok = false;
- $.handleError(opts, xhr, 'error', e);
- }
-
- // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
- if (ok) {
- opts.success(data, 'success');
- if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
- }
- if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
- if (g && ! --$.active) $.event.trigger("ajaxStop");
- if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
-
- // clean up
- setTimeout(function() {
- $io.remove();
- xhr.responseXML = null;
- }, 100);
- };
-
- function toXml(s, doc) {
- if (window.ActiveXObject) {
- doc = new ActiveXObject('Microsoft.XMLDOM');
- doc.async = 'false';
- doc.loadXML(s);
- }
- else
- doc = (new DOMParser()).parseFromString(s, 'text/xml');
- return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
- };
- };
-};
-$.fn.ajaxSubmit.counter = 0; // used to create unique iframe ids
-
-/**
- * ajaxForm() provides a mechanism for fully automating form submission.
- *
- * The advantages of using this method instead of ajaxSubmit() are:
- *
- * 1: This method will include coordinates for <input type="image" /> elements (if the element
- * is used to submit the form).
- * 2. This method will include the submit element's name/value data (for the element that was
- * used to submit the form).
- * 3. This method binds the submit() method to the form for you.
- *
- * Note that for accurate x/y coordinates of image submit elements in all browsers
- * you need to also use the "dimensions" plugin (this method will auto-detect its presence).
- *
- * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
- * passes the options argument along after properly binding events for submit elements and
- * the form itself. See ajaxSubmit for a full description of the options argument.
- *
- *
- * @example
- * var options = {
- * target: '#myTargetDiv'
- * };
- * $('#myForm').ajaxSForm(options);
- * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response
- * when the form is submitted.
- *
- *
- * @example
- * var options = {
- * success: function(responseText) {
- * alert(responseText);
- * }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Bind form's submit event so that server response is alerted after the form is submitted.
- *
- *
- * @example
- * var options = {
- * beforeSubmit: function(formArray, jqForm) {
- * if (formArray.length == 0) {
- * alert('Please enter data.');
- * return false;
- * }
- * }
- * };
- * $('#myForm').ajaxSubmit(options);
- * @desc Bind form's submit event so that pre-submit callback is invoked before the form
- * is submitted.
- *
- *
- * @name ajaxForm
- * @param options object literal containing options which control the form submission process
- * @return jQuery
- * @cat Plugins/Form
- * @type jQuery
- */
-$.fn.ajaxForm = function(options) {
- return this.ajaxFormUnbind().submit(submitHandler).each(function() {
- // store options in hash
- this.formPluginId = $.fn.ajaxForm.counter++;
- $.fn.ajaxForm.optionHash[this.formPluginId] = options;
- $(":submit,input:image", this).click(clickHandler);
- });
-};
-
-$.fn.ajaxForm.counter = 1;
-$.fn.ajaxForm.optionHash = {};
-
-function clickHandler(e) {
- var $form = this.form;
- $form.clk = this;
- if (this.type == 'image') {
- if (e.offsetX != undefined) {
- $form.clk_x = e.offsetX;
- $form.clk_y = e.offsetY;
- } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
- var offset = $(this).offset();
- $form.clk_x = e.pageX - offset.left;
- $form.clk_y = e.pageY - offset.top;
- } else {
- $form.clk_x = e.pageX - this.offsetLeft;
- $form.clk_y = e.pageY - this.offsetTop;
- }
- }
- // clear form vars
- setTimeout(function() { $form.clk = $form.clk_x = $form.clk_y = null; }, 10);
-};
-
-function submitHandler() {
- // retrieve options from hash
- var id = this.formPluginId;
- var options = $.fn.ajaxForm.optionHash[id];
- $(this).ajaxSubmit(options);
- return false;
-};
-
-/**
- * ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
- *
- * @name ajaxFormUnbind
- * @return jQuery
- * @cat Plugins/Form
- * @type jQuery
- */
-$.fn.ajaxFormUnbind = function() {
- this.unbind('submit', submitHandler);
- return this.each(function() {
- $(":submit,input:image", this).unbind('click', clickHandler);
- });
-
-};
-
-/**
- * formToArray() gathers form element data into an array of objects that can
- * be passed to any of the following ajax functions: $.get, $.post, or load.
- * Each object in the array has both a 'name' and 'value' property. An example of
- * an array for a simple login form might be:
- *
- * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * It is this array that is passed to pre-submit callback functions provided to the
- * ajaxSubmit() and ajaxForm() methods.
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * This is normally true anyway, unless the form contains input elements of type='image'.
- * If your form must be submitted with name/value pairs in semantic order and your form
- * contains an input of type='image" then pass true for this arg, otherwise pass false
- * (or nothing) to avoid the overhead for this logic.
- *
- * @example var data = $("#myForm").formToArray();
- * $.post( "myscript.cgi", data );
- * @desc Collect all the data from a form and submit it to the server.
- *
- * @name formToArray
- * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
- * @type Array<Object>
- * @cat Plugins/Form
- */
-$.fn.formToArray = function(semantic) {
- var a = [];
- if (this.length == 0) return a;
-
- var form = this[0];
- var els = semantic ? form.getElementsByTagName('*') : form.elements;
- if (!els) return a;
- for(var i=0, max=els.length; i < max; i++) {
- var el = els[i];
- var n = el.name;
- if (!n) continue;
-
- if (semantic && form.clk && el.type == "image") {
- // handle image inputs on the fly when semantic == true
- if(!el.disabled && form.clk == el)
- a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
- continue;
- }
-
- var v = $.fieldValue(el, true);
- if (v && v.constructor == Array) {
- for(var j=0, jmax=v.length; j < jmax; j++)
- a.push({name: n, value: v[j]});
- }
- else if (v !== null && typeof v != 'undefined')
- a.push({name: n, value: v});
- }
-
- if (!semantic && form.clk) {
- // input type=='image' are not found in elements array! handle them here
- var inputs = form.getElementsByTagName("input");
- for(var i=0, max=inputs.length; i < max; i++) {
- var input = inputs[i];
- var n = input.name;
- if(n && !input.disabled && input.type == "image" && form.clk == input)
- a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
- }
- }
- return a;
-};
-
-
-/**
- * Serializes form data into a 'submittable' string. This method will return a string
- * in the format: name1=value1&amp;name2=value2
- *
- * The semantic argument can be used to force form serialization in semantic order.
- * If your form must be submitted with name/value pairs in semantic order then pass
- * true for this arg, otherwise pass false (or nothing) to avoid the overhead for
- * this logic (which can be significant for very large forms).
- *
- * @example var data = $("#myForm").formSerialize();
- * $.ajax('POST', "myscript.cgi", data);
- * @desc Collect all the data from a form into a single string
- *
- * @name formSerialize
- * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
- * @type String
- * @cat Plugins/Form
- */
-$.fn.formSerialize = function(semantic) {
- //hand off to jQuery.param for proper encoding
- return $.param(this.formToArray(semantic));
-};
-
-
-/**
- * Serializes all field elements in the jQuery object into a query string.
- * This method will return a string in the format: name1=value1&amp;name2=value2
- *
- * The successful argument controls whether or not serialization is limited to
- * 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.
- *
- * @example var data = $("input").formSerialize();
- * @desc Collect the data from all successful input elements into a query string
- *
- * @example var data = $(":radio").formSerialize();
- * @desc Collect the data from all successful radio input elements into a query string
- *
- * @example var data = $("#myForm :checkbox").formSerialize();
- * @desc Collect the data from all successful checkbox input elements in myForm into a query string
- *
- * @example var data = $("#myForm :checkbox").formSerialize(false);
- * @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string
- *
- * @example var data = $(":input").formSerialize();
- * @desc Collect the data from all successful input, select, textarea and button elements into a query string
- *
- * @name fieldSerialize
- * @param successful true if only successful controls should be serialized (default is true)
- * @type String
- * @cat Plugins/Form
- */
-$.fn.fieldSerialize = function(successful) {
- var a = [];
- this.each(function() {
- var n = this.name;
- if (!n) return;
- var v = $.fieldValue(this, successful);
- if (v && v.constructor == Array) {
- for (var i=0,max=v.length; i < max; i++)
- a.push({name: n, value: v[i]});
- }
- else if (v !== null && typeof v != 'undefined')
- a.push({name: this.name, value: v});
- });
- //hand off to jQuery.param for proper encoding
- return $.param(a);
-};
-
-
-/**
- * Returns the value(s) of the element in the matched set. For example, consider the following form:
- *
- * <form><fieldset>
- * <input name="A" type="text" />
- * <input name="A" type="text" />
- * <input name="B" type="checkbox" value="B1" />
- * <input name="B" type="checkbox" value="B2"/>
- * <input name="C" type="radio" value="C1" />
- * <input name="C" type="radio" value="C2" />
- * </fieldset></form>
- *
- * var v = $(':text').fieldValue();
- * // if no values are entered into the text inputs
- * v == ['','']
- * // if values entered into the text inputs are 'foo' and 'bar'
- * v == ['foo','bar']
- *
- * var v = $(':checkbox').fieldValue();
- * // if neither checkbox is checked
- * v === undefined
- * // if both checkboxes are checked
- * v == ['B1', 'B2']
- *
- * var v = $(':radio').fieldValue();
- * // if neither radio is checked
- * v === undefined
- * // if first radio is checked
- * v == ['C1']
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true. If this value is false the value(s)
- * for each element is returned.
- *
- * Note: This method *always* returns an array. If no valid value can be determined the
- * array will be empty, otherwise it will contain one or more values.
- *
- * @example var data = $("#myPasswordElement").fieldValue();
- * alert(data[0]);
- * @desc Alerts the current value of the myPasswordElement element
- *
- * @example var data = $("#myForm :input").fieldValue();
- * @desc Get the value(s) of the form elements in myForm
- *
- * @example var data = $("#myForm :checkbox").fieldValue();
- * @desc Get the value(s) for the successful checkbox element(s) in the jQuery object.
- *
- * @example var data = $("#mySingleSelect").fieldValue();
- * @desc Get the value(s) of the select control
- *
- * @example var data = $(':text').fieldValue();
- * @desc Get the value(s) of the text input or textarea elements
- *
- * @example var data = $("#myMultiSelect").fieldValue();
- * @desc Get the values for the select-multiple control
- *
- * @name fieldValue
- * @param Boolean successful true if only the values for successful controls should be returned (default is true)
- * @type Array<String>
- * @cat Plugins/Form
- */
-$.fn.fieldValue = function(successful) {
- for (var val=[], i=0, max=this.length; i < max; i++) {
- var el = this[i];
- var v = $.fieldValue(el, successful);
- if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
- continue;
- v.constructor == Array ? $.merge(val, v) : val.push(v);
- }
- return val;
-};
-
-/**
- * Returns the value of the field element.
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true. If the given element is not
- * successful and the successful arg is not false then the returned value will be null.
- *
- * Note: If the successful flag is true (default) but the element is not successful, the return will be null
- * Note: The value returned for a successful select-multiple element will always be an array.
- * Note: If the element has no value the return value will be undefined.
- *
- * @example var data = jQuery.fieldValue($("#myPasswordElement")[0]);
- * @desc Gets the current value of the myPasswordElement element
- *
- * @name fieldValue
- * @param Element el The DOM element for which the value will be returned
- * @param Boolean successful true if value returned must be for a successful controls (default is true)
- * @type String or Array<String> or null or undefined
- * @cat Plugins/Form
- */
-$.fieldValue = function(el, successful) {
- var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
- if (typeof successful == 'undefined') successful = true;
-
- if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
- (t == 'checkbox' || t == 'radio') && !el.checked ||
- (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
- tag == 'select' && el.selectedIndex == -1))
- return null;
-
- if (tag == 'select') {
- var index = el.selectedIndex;
- if (index < 0) return null;
- var a = [], ops = el.options;
- var one = (t == 'select-one');
- var max = (one ? index+1 : ops.length);
- for(var i=(one ? index : 0); i < max; i++) {
- var op = ops[i];
- if (op.selected) {
- // extra pain for IE...
- var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
- if (one) return v;
- a.push(v);
- }
- }
- return a;
- }
- return el.value;
-};
-
-
-/**
- * Clears the form data. Takes the following actions on the form's input fields:
- * - input text fields will have their 'value' property set to the empty string
- * - select elements will have their 'selectedIndex' property set to -1
- * - checkbox and radio inputs will have their 'checked' property set to false
- * - inputs of type submit, button, reset, and hidden will *not* be effected
- * - button elements will *not* be effected
- *
- * @example $('form').clearForm();
- * @desc Clears all forms on the page.
- *
- * @name clearForm
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.clearForm = function() {
- return this.each(function() {
- $('input,select,textarea', this).clearFields();
- });
-};
-
-/**
- * Clears the selected form elements. Takes the following actions on the matched elements:
- * - input text fields will have their 'value' property set to the empty string
- * - select elements will have their 'selectedIndex' property set to -1
- * - checkbox and radio inputs will have their 'checked' property set to false
- * - inputs of type submit, button, reset, and hidden will *not* be effected
- * - button elements will *not* be effected
- *
- * @example $('.myInputs').clearFields();
- * @desc Clears all inputs with class myInputs
- *
- * @name clearFields
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.clearFields = $.fn.clearInputs = function() {
- return this.each(function() {
- var t = this.type, tag = this.tagName.toLowerCase();
- if (t == 'text' || t == 'password' || tag == 'textarea')
- this.value = '';
- else if (t == 'checkbox' || t == 'radio')
- this.checked = false;
- else if (tag == 'select')
- this.selectedIndex = -1;
- });
-};
-
-
-/**
- * Resets the form data. Causes all form elements to be reset to their original value.
- *
- * @example $('form').resetForm();
- * @desc Resets all forms on the page.
- *
- * @name resetForm
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.resetForm = function() {
- return this.each(function() {
- // guard against an input with the name of 'reset'
- // note that IE reports the reset function as an 'object'
- if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
- this.reset();
- });
-};
-
-
-/**
- * Enables or disables any matching elements.
- *
- * @example $(':radio').enabled(false);
- * @desc Disables all radio buttons
- *
- * @name select
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.enable = function(b) {
- if (b == undefined) b = true;
- return this.each(function() {
- this.disabled = !b
- });
-};
-
-/**
- * Checks/unchecks any matching checkboxes or radio buttons and
- * selects/deselects and matching option elements.
- *
- * @example $(':checkbox').selected();
- * @desc Checks all checkboxes
- *
- * @name select
- * @type jQuery
- * @cat Plugins/Form
- */
-$.fn.select = function(select) {
- if (select == undefined) select = true;
- return this.each(function() {
- var t = this.type;
- if (t == 'checkbox' || t == 'radio')
- this.checked = select;
- else if (this.tagName.toLowerCase() == 'option') {
- var $sel = $(this).parent('select');
- if (select && $sel[0] && $sel[0].type == 'select-one') {
- // deselect all other options
- $sel.find('option').select(false);
- }
- this.selected = select;
- }
- });
-};
-
-})(jQuery);
+/*
+ * jQuery Form Plugin
+ * version: 2.02 (12/16/2007)
+ * @requires jQuery v1.1 or later
+ *
+ * Examples at: http://malsup.com/jquery/form/
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * Revision: $Id$
+ */
+ (function($) {
+/**
+ * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.
+ *
+ * ajaxSubmit accepts a single argument which can be either a success callback function
+ * or an options Object. If a function is provided it will be invoked upon successful
+ * completion of the submit and will be passed the response from the server.
+ * If an options Object is provided, the following attributes are supported:
+ *
+ * target: Identifies the element(s) in the page to be updated with the server response.
+ * This value may be specified as a jQuery selection string, a jQuery object,
+ * or a DOM element.
+ * default value: null
+ *
+ * url: URL to which the form data will be submitted.
+ * default value: value of form's 'action' attribute
+ *
+ * type: The method in which the form data should be submitted, 'GET' or 'POST'.
+ * default value: value of form's 'method' attribute (or 'GET' if none found)
+ *
+ * data: Additional data to add to the request, specified as key/value pairs (see $.ajax).
+ *
+ * beforeSubmit: Callback method to be invoked before the form is submitted.
+ * default value: null
+ *
+ * success: Callback method to be invoked after the form has been successfully submitted
+ * and the response has been returned from the server
+ * default value: null
+ *
+ * dataType: Expected dataType of the response. One of: null, 'xml', 'script', or 'json'
+ * default value: null
+ *
+ * semantic: Boolean flag indicating whether data must be submitted in semantic order (slower).
+ * default value: false
+ *
+ * resetForm: Boolean flag indicating whether the form should be reset if the submit is successful
+ *
+ * clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful
+ *
+ *
+ * The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for
+ * validating the form data. If the 'beforeSubmit' callback returns false then the form will
+ * not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data
+ * in array format, the jQuery object, and the options object passed into ajaxSubmit.
+ * The form data array takes the following form:
+ *
+ * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * If a 'success' callback method is provided it is invoked after the response has been returned
+ * from the server. It is passed the responseText or responseXML value (depending on dataType).
+ * See jQuery.ajax for further details.
+ *
+ *
+ * The dataType option provides a means for specifying how the server response should be handled.
+ * This maps directly to the jQuery.httpData method. The following values are supported:
+ *
+ * 'xml': if dataType == 'xml' the server response is treated as XML and the 'success'
+ * callback method, if specified, will be passed the responseXML value
+ * 'json': if dataType == 'json' the server response will be evaluted and passed to
+ * the 'success' callback, if specified
+ * 'script': if dataType == 'script' the server response is evaluated in the global context
+ *
+ *
+ * Note that it does not make sense to use both the 'target' and 'dataType' options. If both
+ * are provided the target will be ignored.
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * This is normally true anyway, unless the form contains input elements of type='image'.
+ * If your form must be submitted with name/value pairs in semantic order and your form
+ * contains an input of type='image" then pass true for this arg, otherwise pass false
+ * (or nothing) to avoid the overhead for this logic.
+ *
+ *
+ * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this:
+ *
+ * $("#form-id").submit(function() {
+ * $(this).ajaxSubmit(options);
+ * return false; // cancel conventional submit
+ * });
+ *
+ * When using ajaxForm(), however, this is done for you.
+ *
+ * @example
+ * $('#myForm').ajaxSubmit(function(data) {
+ * alert('Form submit succeeded! Server returned: ' + data);
+ * });
+ * @desc Submit form and alert server response
+ *
+ *
+ * @example
+ * var options = {
+ * target: '#myTargetDiv'
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Submit form and update page element with server response
+ *
+ *
+ * @example
+ * var options = {
+ * success: function(responseText) {
+ * alert(responseText);
+ * }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Submit form and alert the server response
+ *
+ *
+ * @example
+ * var options = {
+ * beforeSubmit: function(formArray, jqForm) {
+ * if (formArray.length == 0) {
+ * alert('Please enter data.');
+ * return false;
+ * }
+ * }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Pre-submit validation which aborts the submit operation if form data is empty
+ *
+ *
+ * @example
+ * var options = {
+ * url: myJsonUrl.php,
+ * dataType: 'json',
+ * success: function(data) {
+ * // 'data' is an object representing the the evaluated json data
+ * }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc json data returned and evaluated
+ *
+ *
+ * @example
+ * var options = {
+ * url: myXmlUrl.php,
+ * dataType: 'xml',
+ * success: function(responseXML) {
+ * // responseXML is XML document object
+ * var data = $('myElement', responseXML).text();
+ * }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc XML data returned from server
+ *
+ *
+ * @example
+ * var options = {
+ * resetForm: true
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc submit form and reset it if successful
+ *
+ * @example
+ * $('#myForm).submit(function() {
+ * $(this).ajaxSubmit();
+ * return false;
+ * });
+ * @desc Bind form's submit event to use ajaxSubmit
+ *
+ *
+ * @name ajaxSubmit
+ * @type jQuery
+ * @param options object literal containing options which control the form submission process
+ * @cat Plugins/Form
+ * @return jQuery
+ */
+$.fn.ajaxSubmit = function(options) {
+ if (typeof options == 'function')
+ options = { success: options };
+
+ options = $.extend({
+ url: this.attr('action') || window.location.toString(),
+ type: this.attr('method') || 'GET'
+ }, options || {});
+
+ // hook for manipulating the form data before it is extracted;
+ // convenient for use with rich editors like tinyMCE or FCKEditor
+ var veto = {};
+ $.event.trigger('form.pre.serialize', [this, options, veto]);
+ if (veto.veto) return this;
+
+ var a = this.formToArray(options.semantic);
+ if (options.data) {
+ for (var n in options.data)
+ a.push( { name: n, value: options.data[n] } );
+ }
+
+ // give pre-submit callback an opportunity to abort the submit
+ if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this;
+
+ // fire vetoable 'validate' event
+ $.event.trigger('form.submit.validate', [a, this, options, veto]);
+ if (veto.veto) return this;
+
+ var q = $.param(a);//.replace(/%20/g,'+');
+
+ if (options.type.toUpperCase() == 'GET') {
+ options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
+ options.data = null; // data is null for 'get'
+ }
+ else
+ options.data = q; // data is the query string for 'post'
+
+ var $form = this, callbacks = [];
+ if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
+ if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
+
+ // perform a load on the target only if dataType is not provided
+ if (!options.dataType && options.target) {
+ var oldSuccess = options.success || function(){};
+ callbacks.push(function(data) {
+ if (this.evalScripts)
+ $(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments);
+ else // jQuery v1.1.4
+ $(options.target).html(data).each(oldSuccess, arguments);
+ });
+ }
+ else if (options.success)
+ callbacks.push(options.success);
+
+ options.success = function(data, status) {
+ for (var i=0, max=callbacks.length; i < max; i++)
+ callbacks[i](data, status, $form);
+ };
+
+ // are there files to upload?
+ var files = $('input:file', this).fieldValue();
+ var found = false;
+ for (var j=0; j < files.length; j++)
+ if (files[j])
+ found = true;
+
+ // options.iframe allows user to force iframe mode
+ if (options.iframe || found) {
+ // hack to fix Safari hang (thanks to Tim Molendijk for this)
+ // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
+ if ($.browser.safari && options.closeKeepAlive)
+ $.get(options.closeKeepAlive, fileUpload);
+ else
+ fileUpload();
+ }
+ else
+ $.ajax(options);
+
+ // fire 'notify' event
+ $.event.trigger('form.submit.notify', [this, options]);
+ return this;
+
+
+ // private function for handling file uploads (hat tip to YAHOO!)
+ function fileUpload() {
+ var form = $form[0];
+ var opts = $.extend({}, $.ajaxSettings, options);
+
+ var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++;
+ var $io = $('<iframe id="' + id + '" name="' + id + '" />');
+ var io = $io[0];
+ var op8 = $.browser.opera && window.opera.version() < 9;
+ if ($.browser.msie || op8) io.src = 'javascript:false;document.write("");';
+ $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
+
+ var xhr = { // mock object
+ responseText: null,
+ responseXML: null,
+ status: 0,
+ statusText: 'n/a',
+ getAllResponseHeaders: function() {},
+ getResponseHeader: function() {},
+ setRequestHeader: function() {}
+ };
+
+ var g = opts.global;
+ // trigger ajax global events so that activity/block indicators work like normal
+ if (g && ! $.active++) $.event.trigger("ajaxStart");
+ if (g) $.event.trigger("ajaxSend", [xhr, opts]);
+
+ var cbInvoked = 0;
+ var timedOut = 0;
+
+ // take a breath so that pending repaints get some cpu time before the upload starts
+ setTimeout(function() {
+ // make sure form attrs are set
+ var encAttr = form.encoding ? 'encoding' : 'enctype';
+ var t = $form.attr('target');
+ $form.attr({
+ target: id,
+ method: 'POST',
+ action: opts.url
+ });
+ form[encAttr] = 'multipart/form-data';
+
+ // support timout
+ if (opts.timeout)
+ setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
+
+ // add iframe to doc and submit the form
+ $io.appendTo('body');
+ io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
+ form.submit();
+ $form.attr('target', t); // reset target
+ }, 10);
+
+ function cb() {
+ if (cbInvoked++) return;
+
+ io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
+
+ var ok = true;
+ try {
+ if (timedOut) throw 'timeout';
+ // extract the server response from the iframe
+ var data, doc;
+ doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
+ xhr.responseText = doc.body ? doc.body.innerHTML : null;
+ xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
+
+ if (opts.dataType == 'json' || opts.dataType == 'script') {
+ var ta = doc.getElementsByTagName('textarea')[0];
+ data = ta ? ta.value : xhr.responseText;
+ if (opts.dataType == 'json')
+ eval("data = " + data);
+ else
+ $.globalEval(data);
+ }
+ else if (opts.dataType == 'xml') {
+ data = xhr.responseXML;
+ if (!data && xhr.responseText != null)
+ data = toXml(xhr.responseText);
+ }
+ else {
+ data = xhr.responseText;
+ }
+ }
+ catch(e){
+ ok = false;
+ $.handleError(opts, xhr, 'error', e);
+ }
+
+ // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
+ if (ok) {
+ opts.success(data, 'success');
+ if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
+ }
+ if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
+ if (g && ! --$.active) $.event.trigger("ajaxStop");
+ if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
+
+ // clean up
+ setTimeout(function() {
+ $io.remove();
+ xhr.responseXML = null;
+ }, 100);
+ };
+
+ function toXml(s, doc) {
+ if (window.ActiveXObject) {
+ doc = new ActiveXObject('Microsoft.XMLDOM');
+ doc.async = 'false';
+ doc.loadXML(s);
+ }
+ else
+ doc = (new DOMParser()).parseFromString(s, 'text/xml');
+ return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
+ };
+ };
+};
+$.fn.ajaxSubmit.counter = 0; // used to create unique iframe ids
+
+/**
+ * ajaxForm() provides a mechanism for fully automating form submission.
+ *
+ * The advantages of using this method instead of ajaxSubmit() are:
+ *
+ * 1: This method will include coordinates for <input type="image" /> elements (if the element
+ * is used to submit the form).
+ * 2. This method will include the submit element's name/value data (for the element that was
+ * used to submit the form).
+ * 3. This method binds the submit() method to the form for you.
+ *
+ * Note that for accurate x/y coordinates of image submit elements in all browsers
+ * you need to also use the "dimensions" plugin (this method will auto-detect its presence).
+ *
+ * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
+ * passes the options argument along after properly binding events for submit elements and
+ * the form itself. See ajaxSubmit for a full description of the options argument.
+ *
+ *
+ * @example
+ * var options = {
+ * target: '#myTargetDiv'
+ * };
+ * $('#myForm').ajaxSForm(options);
+ * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response
+ * when the form is submitted.
+ *
+ *
+ * @example
+ * var options = {
+ * success: function(responseText) {
+ * alert(responseText);
+ * }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Bind form's submit event so that server response is alerted after the form is submitted.
+ *
+ *
+ * @example
+ * var options = {
+ * beforeSubmit: function(formArray, jqForm) {
+ * if (formArray.length == 0) {
+ * alert('Please enter data.');
+ * return false;
+ * }
+ * }
+ * };
+ * $('#myForm').ajaxSubmit(options);
+ * @desc Bind form's submit event so that pre-submit callback is invoked before the form
+ * is submitted.
+ *
+ *
+ * @name ajaxForm
+ * @param options object literal containing options which control the form submission process
+ * @return jQuery
+ * @cat Plugins/Form
+ * @type jQuery
+ */
+$.fn.ajaxForm = function(options) {
+ return this.ajaxFormUnbind().submit(submitHandler).each(function() {
+ // store options in hash
+ this.formPluginId = $.fn.ajaxForm.counter++;
+ $.fn.ajaxForm.optionHash[this.formPluginId] = options;
+ $(":submit,input:image", this).click(clickHandler);
+ });
+};
+
+$.fn.ajaxForm.counter = 1;
+$.fn.ajaxForm.optionHash = {};
+
+function clickHandler(e) {
+ var $form = this.form;
+ $form.clk = this;
+ if (this.type == 'image') {
+ if (e.offsetX != undefined) {
+ $form.clk_x = e.offsetX;
+ $form.clk_y = e.offsetY;
+ } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
+ var offset = $(this).offset();
+ $form.clk_x = e.pageX - offset.left;
+ $form.clk_y = e.pageY - offset.top;
+ } else {
+ $form.clk_x = e.pageX - this.offsetLeft;
+ $form.clk_y = e.pageY - this.offsetTop;
+ }
+ }
+ // clear form vars
+ setTimeout(function() { $form.clk = $form.clk_x = $form.clk_y = null; }, 10);
+};
+
+function submitHandler() {
+ // retrieve options from hash
+ var id = this.formPluginId;
+ var options = $.fn.ajaxForm.optionHash[id];
+ $(this).ajaxSubmit(options);
+ return false;
+};
+
+/**
+ * ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
+ *
+ * @name ajaxFormUnbind
+ * @return jQuery
+ * @cat Plugins/Form
+ * @type jQuery
+ */
+$.fn.ajaxFormUnbind = function() {
+ this.unbind('submit', submitHandler);
+ return this.each(function() {
+ $(":submit,input:image", this).unbind('click', clickHandler);
+ });
+
+};
+
+/**
+ * formToArray() gathers form element data into an array of objects that can
+ * be passed to any of the following ajax functions: $.get, $.post, or load.
+ * Each object in the array has both a 'name' and 'value' property. An example of
+ * an array for a simple login form might be:
+ *
+ * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * It is this array that is passed to pre-submit callback functions provided to the
+ * ajaxSubmit() and ajaxForm() methods.
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * This is normally true anyway, unless the form contains input elements of type='image'.
+ * If your form must be submitted with name/value pairs in semantic order and your form
+ * contains an input of type='image" then pass true for this arg, otherwise pass false
+ * (or nothing) to avoid the overhead for this logic.
+ *
+ * @example var data = $("#myForm").formToArray();
+ * $.post( "myscript.cgi", data );
+ * @desc Collect all the data from a form and submit it to the server.
+ *
+ * @name formToArray
+ * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
+ * @type Array<Object>
+ * @cat Plugins/Form
+ */
+$.fn.formToArray = function(semantic) {
+ var a = [];
+ if (this.length == 0) return a;
+
+ var form = this[0];
+ var els = semantic ? form.getElementsByTagName('*') : form.elements;
+ if (!els) return a;
+ for(var i=0, max=els.length; i < max; i++) {
+ var el = els[i];
+ var n = el.name;
+ if (!n) continue;
+
+ if (semantic && form.clk && el.type == "image") {
+ // handle image inputs on the fly when semantic == true
+ if(!el.disabled && form.clk == el)
+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+ continue;
+ }
+
+ var v = $.fieldValue(el, true);
+ if (v && v.constructor == Array) {
+ for(var j=0, jmax=v.length; j < jmax; j++)
+ a.push({name: n, value: v[j]});
+ }
+ else if (v !== null && typeof v != 'undefined')
+ a.push({name: n, value: v});
+ }
+
+ if (!semantic && form.clk) {
+ // input type=='image' are not found in elements array! handle them here
+ var inputs = form.getElementsByTagName("input");
+ for(var i=0, max=inputs.length; i < max; i++) {
+ var input = inputs[i];
+ var n = input.name;
+ if(n && !input.disabled && input.type == "image" && form.clk == input)
+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+ }
+ }
+ return a;
+};
+
+
+/**
+ * Serializes form data into a 'submittable' string. This method will return a string
+ * in the format: name1=value1&amp;name2=value2
+ *
+ * The semantic argument can be used to force form serialization in semantic order.
+ * If your form must be submitted with name/value pairs in semantic order then pass
+ * true for this arg, otherwise pass false (or nothing) to avoid the overhead for
+ * this logic (which can be significant for very large forms).
+ *
+ * @example var data = $("#myForm").formSerialize();
+ * $.ajax('POST', "myscript.cgi", data);
+ * @desc Collect all the data from a form into a single string
+ *
+ * @name formSerialize
+ * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
+ * @type String
+ * @cat Plugins/Form
+ */
+$.fn.formSerialize = function(semantic) {
+ //hand off to jQuery.param for proper encoding
+ return $.param(this.formToArray(semantic));
+};
+
+
+/**
+ * Serializes all field elements in the jQuery object into a query string.
+ * This method will return a string in the format: name1=value1&amp;name2=value2
+ *
+ * The successful argument controls whether or not serialization is limited to
+ * 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.
+ *
+ * @example var data = $("input").formSerialize();
+ * @desc Collect the data from all successful input elements into a query string
+ *
+ * @example var data = $(":radio").formSerialize();
+ * @desc Collect the data from all successful radio input elements into a query string
+ *
+ * @example var data = $("#myForm :checkbox").formSerialize();
+ * @desc Collect the data from all successful checkbox input elements in myForm into a query string
+ *
+ * @example var data = $("#myForm :checkbox").formSerialize(false);
+ * @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string
+ *
+ * @example var data = $(":input").formSerialize();
+ * @desc Collect the data from all successful input, select, textarea and button elements into a query string
+ *
+ * @name fieldSerialize
+ * @param successful true if only successful controls should be serialized (default is true)
+ * @type String
+ * @cat Plugins/Form
+ */
+$.fn.fieldSerialize = function(successful) {
+ var a = [];
+ this.each(function() {
+ var n = this.name;
+ if (!n) return;
+ var v = $.fieldValue(this, successful);
+ if (v && v.constructor == Array) {
+ for (var i=0,max=v.length; i < max; i++)
+ a.push({name: n, value: v[i]});
+ }
+ else if (v !== null && typeof v != 'undefined')
+ a.push({name: this.name, value: v});
+ });
+ //hand off to jQuery.param for proper encoding
+ return $.param(a);
+};
+
+
+/**
+ * Returns the value(s) of the element in the matched set. For example, consider the following form:
+ *
+ * <form><fieldset>
+ * <input name="A" type="text" />
+ * <input name="A" type="text" />
+ * <input name="B" type="checkbox" value="B1" />
+ * <input name="B" type="checkbox" value="B2"/>
+ * <input name="C" type="radio" value="C1" />
+ * <input name="C" type="radio" value="C2" />
+ * </fieldset></form>
+ *
+ * var v = $(':text').fieldValue();
+ * // if no values are entered into the text inputs
+ * v == ['','']
+ * // if values entered into the text inputs are 'foo' and 'bar'
+ * v == ['foo','bar']
+ *
+ * var v = $(':checkbox').fieldValue();
+ * // if neither checkbox is checked
+ * v === undefined
+ * // if both checkboxes are checked
+ * v == ['B1', 'B2']
+ *
+ * var v = $(':radio').fieldValue();
+ * // if neither radio is checked
+ * v === undefined
+ * // if first radio is checked
+ * v == ['C1']
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true. If this value is false the value(s)
+ * for each element is returned.
+ *
+ * Note: This method *always* returns an array. If no valid value can be determined the
+ * array will be empty, otherwise it will contain one or more values.
+ *
+ * @example var data = $("#myPasswordElement").fieldValue();
+ * alert(data[0]);
+ * @desc Alerts the current value of the myPasswordElement element
+ *
+ * @example var data = $("#myForm :input").fieldValue();
+ * @desc Get the value(s) of the form elements in myForm
+ *
+ * @example var data = $("#myForm :checkbox").fieldValue();
+ * @desc Get the value(s) for the successful checkbox element(s) in the jQuery object.
+ *
+ * @example var data = $("#mySingleSelect").fieldValue();
+ * @desc Get the value(s) of the select control
+ *
+ * @example var data = $(':text').fieldValue();
+ * @desc Get the value(s) of the text input or textarea elements
+ *
+ * @example var data = $("#myMultiSelect").fieldValue();
+ * @desc Get the values for the select-multiple control
+ *
+ * @name fieldValue
+ * @param Boolean successful true if only the values for successful controls should be returned (default is true)
+ * @type Array<String>
+ * @cat Plugins/Form
+ */
+$.fn.fieldValue = function(successful) {
+ for (var val=[], i=0, max=this.length; i < max; i++) {
+ var el = this[i];
+ var v = $.fieldValue(el, successful);
+ if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
+ continue;
+ v.constructor == Array ? $.merge(val, v) : val.push(v);
+ }
+ return val;
+};
+
+/**
+ * Returns the value of the field element.
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true. If the given element is not
+ * successful and the successful arg is not false then the returned value will be null.
+ *
+ * Note: If the successful flag is true (default) but the element is not successful, the return will be null
+ * Note: The value returned for a successful select-multiple element will always be an array.
+ * Note: If the element has no value the return value will be undefined.
+ *
+ * @example var data = jQuery.fieldValue($("#myPasswordElement")[0]);
+ * @desc Gets the current value of the myPasswordElement element
+ *
+ * @name fieldValue
+ * @param Element el The DOM element for which the value will be returned
+ * @param Boolean successful true if value returned must be for a successful controls (default is true)
+ * @type String or Array<String> or null or undefined
+ * @cat Plugins/Form
+ */
+$.fieldValue = function(el, successful) {
+ var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
+ if (typeof successful == 'undefined') successful = true;
+
+ if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
+ (t == 'checkbox' || t == 'radio') && !el.checked ||
+ (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
+ tag == 'select' && el.selectedIndex == -1))
+ return null;
+
+ if (tag == 'select') {
+ var index = el.selectedIndex;
+ if (index < 0) return null;
+ var a = [], ops = el.options;
+ var one = (t == 'select-one');
+ var max = (one ? index+1 : ops.length);
+ for(var i=(one ? index : 0); i < max; i++) {
+ var op = ops[i];
+ if (op.selected) {
+ // extra pain for IE...
+ var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
+ if (one) return v;
+ a.push(v);
+ }
+ }
+ return a;
+ }
+ return el.value;
+};
+
+
+/**
+ * Clears the form data. Takes the following actions on the form's input fields:
+ * - input text fields will have their 'value' property set to the empty string
+ * - select elements will have their 'selectedIndex' property set to -1
+ * - checkbox and radio inputs will have their 'checked' property set to false
+ * - inputs of type submit, button, reset, and hidden will *not* be effected
+ * - button elements will *not* be effected
+ *
+ * @example $('form').clearForm();
+ * @desc Clears all forms on the page.
+ *
+ * @name clearForm
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.clearForm = function() {
+ return this.each(function() {
+ $('input,select,textarea', this).clearFields();
+ });
+};
+
+/**
+ * Clears the selected form elements. Takes the following actions on the matched elements:
+ * - input text fields will have their 'value' property set to the empty string
+ * - select elements will have their 'selectedIndex' property set to -1
+ * - checkbox and radio inputs will have their 'checked' property set to false
+ * - inputs of type submit, button, reset, and hidden will *not* be effected
+ * - button elements will *not* be effected
+ *
+ * @example $('.myInputs').clearFields();
+ * @desc Clears all inputs with class myInputs
+ *
+ * @name clearFields
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.clearFields = $.fn.clearInputs = function() {
+ return this.each(function() {
+ var t = this.type, tag = this.tagName.toLowerCase();
+ if (t == 'text' || t == 'password' || tag == 'textarea')
+ this.value = '';
+ else if (t == 'checkbox' || t == 'radio')
+ this.checked = false;
+ else if (tag == 'select')
+ this.selectedIndex = -1;
+ });
+};
+
+
+/**
+ * Resets the form data. Causes all form elements to be reset to their original value.
+ *
+ * @example $('form').resetForm();
+ * @desc Resets all forms on the page.
+ *
+ * @name resetForm
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.resetForm = function() {
+ return this.each(function() {
+ // guard against an input with the name of 'reset'
+ // note that IE reports the reset function as an 'object'
+ if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
+ this.reset();
+ });
+};
+
+
+/**
+ * Enables or disables any matching elements.
+ *
+ * @example $(':radio').enabled(false);
+ * @desc Disables all radio buttons
+ *
+ * @name select
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.enable = function(b) {
+ if (b == undefined) b = true;
+ return this.each(function() {
+ this.disabled = !b
+ });
+};
+
+/**
+ * Checks/unchecks any matching checkboxes or radio buttons and
+ * selects/deselects and matching option elements.
+ *
+ * @example $(':checkbox').selected();
+ * @desc Checks all checkboxes
+ *
+ * @name select
+ * @type jQuery
+ * @cat Plugins/Form
+ */
+$.fn.select = function(select) {
+ if (select == undefined) select = true;
+ return this.each(function() {
+ var t = this.type;
+ if (t == 'checkbox' || t == 'radio')
+ this.checked = select;
+ else if (this.tagName.toLowerCase() == 'option') {
+ var $sel = $(this).parent('select');
+ if (select && $sel[0] && $sel[0].type == 'select-one') {
+ // deselect all other options
+ $sel.find('option').select(false);
+ }
+ this.selected = select;
+ }
+ });
+};
+
+})(jQuery);
diff --git a/wp-includes/js/jquery/jquery.js b/wp-includes/js/jquery/jquery.js
index 56d7f9d..c3dbc8c 100644
--- a/wp-includes/js/jquery/jquery.js
+++ b/wp-includes/js/jquery/jquery.js
@@ -1,11 +1,11 @@
/*
- * jQuery 1.2.3 - New Wave Javascript
+ * jQuery 1.2.6 - New Wave Javascript
*
* Copyright (c) 2008 John Resig (jquery.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
- * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $
- * $Rev: 4663 $
+ * $Date: 2008-05-27 12:17:26 -0700 (Tue, 27 May 2008) $
+ * $Rev: 5700 $
*/
-eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(J(){7(1e.3N)L w=1e.3N;L E=1e.3N=J(a,b){K 1B E.2l.4T(a,b)};7(1e.$)L D=1e.$;1e.$=E;L u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;L G=/^.[^:#\\[\\.]*$/;E.1n=E.2l={4T:J(d,b){d=d||T;7(d.15){6[0]=d;6.M=1;K 6}N 7(1o d=="25"){L c=u.2O(d);7(c&&(c[1]||!b)){7(c[1])d=E.4a([c[1]],b);N{L a=T.5J(c[3]);7(a)7(a.2w!=c[3])K E().2s(d);N{6[0]=a;6.M=1;K 6}N d=[]}}N K 1B E(b).2s(d)}N 7(E.1q(d))K 1B E(T)[E.1n.21?"21":"3U"](d);K 6.6E(d.1k==1M&&d||(d.5h||d.M&&d!=1e&&!d.15&&d[0]!=10&&d[0].15)&&E.2I(d)||[d])},5h:"1.2.3",87:J(){K 6.M},M:0,22:J(a){K a==10?E.2I(6):6[a]},2F:J(b){L a=E(b);a.54=6;K a},6E:J(a){6.M=0;1M.2l.1g.1i(6,a);K 6},R:J(a,b){K E.R(6,a,b)},4X:J(b){L a=-1;6.R(J(i){7(6==b)a=i});K a},1J:J(c,a,b){L d=c;7(c.1k==4e)7(a==10)K 6.M&&E[b||"1J"](6[0],c)||10;N{d={};d[c]=a}K 6.R(J(i){Q(c 1p d)E.1J(b?6.W:6,c,E.1l(6,d[c],b,i,c))})},1j:J(b,a){7((b==\'27\'||b==\'1R\')&&2M(a)<0)a=10;K 6.1J(b,a,"2o")},1u:J(b){7(1o b!="3V"&&b!=V)K 6.4x().3t((6[0]&&6[0].2i||T).5r(b));L a="";E.R(b||6,J(){E.R(6.3p,J(){7(6.15!=8)a+=6.15!=1?6.6K:E.1n.1u([6])})});K a},5m:J(b){7(6[0])E(b,6[0].2i).5k().3o(6[0]).2c(J(){L a=6;2b(a.1C)a=a.1C;K a}).3t(6);K 6},8w:J(a){K 6.R(J(){E(6).6z().5m(a)})},8p:J(a){K 6.R(J(){E(6).5m(a)})},3t:J(){K 6.3O(18,P,S,J(a){7(6.15==1)6.38(a)})},6q:J(){K 6.3O(18,P,P,J(a){7(6.15==1)6.3o(a,6.1C)})},6o:J(){K 6.3O(18,S,S,J(a){6.1a.3o(a,6)})},5a:J(){K 6.3O(18,S,P,J(a){6.1a.3o(a,6.2B)})},3h:J(){K 6.54||E([])},2s:J(b){L c=E.2c(6,J(a){K E.2s(b,a)});K 6.2F(/[^+>] [^+>]/.17(b)||b.1f("..")>-1?E.57(c):c)},5k:J(e){L f=6.2c(J(){7(E.14.1d&&!E.3E(6)){L a=6.69(P),4Y=T.3s("1x");4Y.38(a);K E.4a([4Y.3d])[0]}N K 6.69(P)});L d=f.2s("*").4R().R(J(){7(6[F]!=10)6[F]=V});7(e===P)6.2s("*").4R().R(J(i){7(6.15==3)K;L c=E.O(6,"2R");Q(L a 1p c)Q(L b 1p c[a])E.16.1b(d[i],a,c[a][b],c[a][b].O)});K f},1E:J(b){K 6.2F(E.1q(b)&&E.3y(6,J(a,i){K b.1P(a,i)})||E.3e(b,6))},56:J(b){7(b.1k==4e)7(G.17(b))K 6.2F(E.3e(b,6,P));N b=E.3e(b,6);L a=b.M&&b[b.M-1]!==10&&!b.15;K 6.1E(J(){K a?E.33(6,b)<0:6!=b})},1b:J(a){K!a?6:6.2F(E.37(6.22(),a.1k==4e?E(a).22():a.M!=10&&(!a.12||E.12(a,"3u"))?a:[a]))},3H:J(a){K a?E.3e(a,6).M>0:S},7j:J(a){K 6.3H("."+a)},5O:J(b){7(b==10){7(6.M){L c=6[0];7(E.12(c,"2k")){L e=c.3T,5I=[],11=c.11,2X=c.U=="2k-2X";7(e<0)K V;Q(L i=2X?e:0,2f=2X?e+1:11.M;i<2f;i++){L d=11[i];7(d.2p){b=E.14.1d&&!d.9J.1A.9y?d.1u:d.1A;7(2X)K b;5I.1g(b)}}K 5I}N K(6[0].1A||"").1r(/\\r/g,"")}K 10}K 6.R(J(){7(6.15!=1)K;7(b.1k==1M&&/5u|5t/.17(6.U))6.3k=(E.33(6.1A,b)>=0||E.33(6.31,b)>=0);N 7(E.12(6,"2k")){L a=b.1k==1M?b:[b];E("98",6).R(J(){6.2p=(E.33(6.1A,a)>=0||E.33(6.1u,a)>=0)});7(!a.M)6.3T=-1}N 6.1A=b})},3q:J(a){K a==10?(6.M?6[0].3d:V):6.4x().3t(a)},6S:J(a){K 6.5a(a).1V()},6Z:J(i){K 6.2K(i,i+1)},2K:J(){K 6.2F(1M.2l.2K.1i(6,18))},2c:J(b){K 6.2F(E.2c(6,J(a,i){K b.1P(a,i,a)}))},4R:J(){K 6.1b(6.54)},O:J(d,b){L a=d.23(".");a[1]=a[1]?"."+a[1]:"";7(b==V){L c=6.5n("8P"+a[1]+"!",[a[0]]);7(c==10&&6.M)c=E.O(6[0],d);K c==V&&a[1]?6.O(a[0]):c}N K 6.1N("8K"+a[1]+"!",[a[0],b]).R(J(){E.O(6,d,b)})},35:J(a){K 6.R(J(){E.35(6,a)})},3O:J(g,f,h,d){L e=6.M>1,3n;K 6.R(J(){7(!3n){3n=E.4a(g,6.2i);7(h)3n.8D()}L b=6;7(f&&E.12(6,"1O")&&E.12(3n[0],"4v"))b=6.3S("1U")[0]||6.38(6.2i.3s("1U"));L c=E([]);E.R(3n,J(){L a=e?E(6).5k(P)[0]:6;7(E.12(a,"1m")){c=c.1b(a)}N{7(a.15==1)c=c.1b(E("1m",a).1V());d.1P(b,a)}});c.R(6A)})}};E.2l.4T.2l=E.2l;J 6A(i,a){7(a.3Q)E.3P({1c:a.3Q,3l:S,1H:"1m"});N E.5g(a.1u||a.6x||a.3d||"");7(a.1a)a.1a.34(a)}E.1s=E.1n.1s=J(){L b=18[0]||{},i=1,M=18.M,5c=S,11;7(b.1k==8d){5c=b;b=18[1]||{};i=2}7(1o b!="3V"&&1o b!="J")b={};7(M==1){b=6;i=0}Q(;i<M;i++)7((11=18[i])!=V)Q(L a 1p 11){7(b===11[a])6w;7(5c&&11[a]&&1o 11[a]=="3V"&&b[a]&&!11[a].15)b[a]=E.1s(b[a],11[a]);N 7(11[a]!=10)b[a]=11[a]}K b};L F="3N"+(1B 3v()).3L(),6t=0,5b={};L H=/z-?4X|86-?84|1w|6k|7Z-?1R/i;E.1s({7Y:J(a){1e.$=D;7(a)1e.3N=w;K E},1q:J(a){K!!a&&1o a!="25"&&!a.12&&a.1k!=1M&&/J/i.17(a+"")},3E:J(a){K a.1F&&!a.1h||a.28&&a.2i&&!a.2i.1h},5g:J(a){a=E.3g(a);7(a){L b=T.3S("6f")[0]||T.1F,1m=T.3s("1m");1m.U="1u/4m";7(E.14.1d)1m.1u=a;N 1m.38(T.5r(a));b.38(1m);b.34(1m)}},12:J(b,a){K b.12&&b.12.2E()==a.2E()},1T:{},O:J(c,d,b){c=c==1e?5b:c;L a=c[F];7(!a)a=c[F]=++6t;7(d&&!E.1T[a])E.1T[a]={};7(b!=10)E.1T[a][d]=b;K d?E.1T[a][d]:a},35:J(c,b){c=c==1e?5b:c;L a=c[F];7(b){7(E.1T[a]){2V E.1T[a][b];b="";Q(b 1p E.1T[a])1Q;7(!b)E.35(c)}}N{1S{2V c[F]}1X(e){7(c.52)c.52(F)}2V E.1T[a]}},R:J(c,a,b){7(b){7(c.M==10){Q(L d 1p c)7(a.1i(c[d],b)===S)1Q}N Q(L i=0,M=c.M;i<M;i++)7(a.1i(c[i],b)===S)1Q}N{7(c.M==10){Q(L d 1p c)7(a.1P(c[d],d,c[d])===S)1Q}N Q(L i=0,M=c.M,1A=c[0];i<M&&a.1P(1A,i,1A)!==S;1A=c[++i]){}}K c},1l:J(b,a,c,i,d){7(E.1q(a))a=a.1P(b,i);K a&&a.1k==51&&c=="2o"&&!H.17(d)?a+"2S":a},1t:{1b:J(c,b){E.R((b||"").23(/\\s+/),J(i,a){7(c.15==1&&!E.1t.3Y(c.1t,a))c.1t+=(c.1t?" ":"")+a})},1V:J(c,b){7(c.15==1)c.1t=b!=10?E.3y(c.1t.23(/\\s+/),J(a){K!E.1t.3Y(b,a)}).6a(" "):""},3Y:J(b,a){K E.33(a,(b.1t||b).3X().23(/\\s+/))>-1}},68:J(b,c,a){L e={};Q(L d 1p c){e[d]=b.W[d];b.W[d]=c[d]}a.1P(b);Q(L d 1p c)b.W[d]=e[d]},1j:J(d,e,c){7(e=="27"||e=="1R"){L b,46={43:"4W",4U:"1Z",19:"3D"},3c=e=="27"?["7O","7M"]:["7J","7I"];J 5E(){b=e=="27"?d.7H:d.7F;L a=0,2N=0;E.R(3c,J(){a+=2M(E.2o(d,"7E"+6,P))||0;2N+=2M(E.2o(d,"2N"+6+"5X",P))||0});b-=24.7C(a+2N)}7(E(d).3H(":4d"))5E();N E.68(d,46,5E);K 24.2f(0,b)}K E.2o(d,e,c)},2o:J(e,k,j){L d;J 3x(b){7(!E.14.2d)K S;L a=T.4c.4K(b,V);K!a||a.4M("3x")==""}7(k=="1w"&&E.14.1d){d=E.1J(e.W,"1w");K d==""?"1":d}7(E.14.2z&&k=="19"){L c=e.W.50;e.W.50="0 7r 7o";e.W.50=c}7(k.1D(/4g/i))k=y;7(!j&&e.W&&e.W[k])d=e.W[k];N 7(T.4c&&T.4c.4K){7(k.1D(/4g/i))k="4g";k=k.1r(/([A-Z])/g,"-$1").2h();L h=T.4c.4K(e,V);7(h&&!3x(e))d=h.4M(k);N{L f=[],2C=[];Q(L a=e;a&&3x(a);a=a.1a)2C.4J(a);Q(L i=0;i<2C.M;i++)7(3x(2C[i])){f[i]=2C[i].W.19;2C[i].W.19="3D"}d=k=="19"&&f[2C.M-1]!=V?"2H":(h&&h.4M(k))||"";Q(L i=0;i<f.M;i++)7(f[i]!=V)2C[i].W.19=f[i]}7(k=="1w"&&d=="")d="1"}N 7(e.4n){L g=k.1r(/\\-(\\w)/g,J(a,b){K b.2E()});d=e.4n[k]||e.4n[g];7(!/^\\d+(2S)?$/i.17(d)&&/^\\d/.17(d)){L l=e.W.26,3K=e.3K.26;e.3K.26=e.4n.26;e.W.26=d||0;d=e.W.7f+"2S";e.W.26=l;e.3K.26=3K}}K d},4a:J(l,h){L k=[];h=h||T;7(1o h.3s==\'10\')h=h.2i||h[0]&&h[0].2i||T;E.R(l,J(i,d){7(!d)K;7(d.1k==51)d=d.3X();7(1o d=="25"){d=d.1r(/(<(\\w+)[^>]*?)\\/>/g,J(b,a,c){K c.1D(/^(aa|a6|7e|a5|4D|7a|a0|3m|9W|9U|9S)$/i)?b:a+"></"+c+">"});L f=E.3g(d).2h(),1x=h.3s("1x");L e=!f.1f("<9P")&&[1,"<2k 74=\'74\'>","</2k>"]||!f.1f("<9M")&&[1,"<73>","</73>"]||f.1D(/^<(9G|1U|9E|9B|9x)/)&&[1,"<1O>","</1O>"]||!f.1f("<4v")&&[2,"<1O><1U>","</1U></1O>"]||(!f.1f("<9w")||!f.1f("<9v"))&&[3,"<1O><1U><4v>","</4v></1U></1O>"]||!f.1f("<7e")&&[2,"<1O><1U></1U><6V>","</6V></1O>"]||E.14.1d&&[1,"1x<1x>","</1x>"]||[0,"",""];1x.3d=e[1]+d+e[2];2b(e[0]--)1x=1x.5o;7(E.14.1d){L g=!f.1f("<1O")&&f.1f("<1U")<0?1x.1C&&1x.1C.3p:e[1]=="<1O>"&&f.1f("<1U")<0?1x.3p:[];Q(L j=g.M-1;j>=0;--j)7(E.12(g[j],"1U")&&!g[j].3p.M)g[j].1a.34(g[j]);7(/^\\s/.17(d))1x.3o(h.5r(d.1D(/^\\s*/)[0]),1x.1C)}d=E.2I(1x.3p)}7(d.M===0&&(!E.12(d,"3u")&&!E.12(d,"2k")))K;7(d[0]==10||E.12(d,"3u")||d.11)k.1g(d);N k=E.37(k,d)});K k},1J:J(d,e,c){7(!d||d.15==3||d.15==8)K 10;L f=E.3E(d)?{}:E.46;7(e=="2p"&&E.14.2d)d.1a.3T;7(f[e]){7(c!=10)d[f[e]]=c;K d[f[e]]}N 7(E.14.1d&&e=="W")K E.1J(d.W,"9u",c);N 7(c==10&&E.14.1d&&E.12(d,"3u")&&(e=="9r"||e=="9o"))K d.9m(e).6K;N 7(d.28){7(c!=10){7(e=="U"&&E.12(d,"4D")&&d.1a)6Q"U 9i 9h\'t 9g 9e";d.9b(e,""+c)}7(E.14.1d&&/6O|3Q/.17(e)&&!E.3E(d))K d.4z(e,2);K d.4z(e)}N{7(e=="1w"&&E.14.1d){7(c!=10){d.6k=1;d.1E=(d.1E||"").1r(/6M\\([^)]*\\)/,"")+(2M(c).3X()=="96"?"":"6M(1w="+c*6L+")")}K d.1E&&d.1E.1f("1w=")>=0?(2M(d.1E.1D(/1w=([^)]*)/)[1])/6L).3X():""}e=e.1r(/-([a-z])/95,J(a,b){K b.2E()});7(c!=10)d[e]=c;K d[e]}},3g:J(a){K(a||"").1r(/^\\s+|\\s+$/g,"")},2I:J(b){L a=[];7(1o b!="93")Q(L i=0,M=b.M;i<M;i++)a.1g(b[i]);N a=b.2K(0);K a},33:J(b,a){Q(L i=0,M=a.M;i<M;i++)7(a[i]==b)K i;K-1},37:J(a,b){7(E.14.1d){Q(L i=0;b[i];i++)7(b[i].15!=8)a.1g(b[i])}N Q(L i=0;b[i];i++)a.1g(b[i]);K a},57:J(a){L c=[],2r={};1S{Q(L i=0,M=a.M;i<M;i++){L b=E.O(a[i]);7(!2r[b]){2r[b]=P;c.1g(a[i])}}}1X(e){c=a}K c},3y:J(c,a,d){L b=[];Q(L i=0,M=c.M;i<M;i++)7(!d&&a(c[i],i)||d&&!a(c[i],i))b.1g(c[i]);K b},2c:J(d,a){L c=[];Q(L i=0,M=d.M;i<M;i++){L b=a(d[i],i);7(b!==V&&b!=10){7(b.1k!=1M)b=[b];c=c.71(b)}}K c}});L v=8Y.8W.2h();E.14={5K:(v.1D(/.+(?:8T|8S|8R|8O)[\\/: ]([\\d.]+)/)||[])[1],2d:/77/.17(v),2z:/2z/.17(v),1d:/1d/.17(v)&&!/2z/.17(v),48:/48/.17(v)&&!/(8L|77)/.17(v)};L y=E.14.1d?"6H":"75";E.1s({8I:!E.14.1d||T.6F=="79",46:{"Q":"8F","8E":"1t","4g":y,75:y,6H:y,3d:"3d",1t:"1t",1A:"1A",2Y:"2Y",3k:"3k",8C:"8B",2p:"2p",8A:"8z",3T:"3T",6C:"6C",28:"28",12:"12"}});E.R({6B:J(a){K a.1a},8y:J(a){K E.4u(a,"1a")},8x:J(a){K E.2Z(a,2,"2B")},8v:J(a){K E.2Z(a,2,"4t")},8u:J(a){K E.4u(a,"2B")},8t:J(a){K E.4u(a,"4t")},8s:J(a){K E.5i(a.1a.1C,a)},8r:J(a){K E.5i(a.1C)},6z:J(a){K E.12(a,"8q")?a.8o||a.8n.T:E.2I(a.3p)}},J(c,d){E.1n[c]=J(b){L a=E.2c(6,d);7(b&&1o b=="25")a=E.3e(b,a);K 6.2F(E.57(a))}});E.R({6y:"3t",8m:"6q",3o:"6o",8l:"5a",8k:"6S"},J(c,b){E.1n[c]=J(){L a=18;K 6.R(J(){Q(L i=0,M=a.M;i<M;i++)E(a[i])[b](6)})}});E.R({8j:J(a){E.1J(6,a,"");7(6.15==1)6.52(a)},8i:J(a){E.1t.1b(6,a)},8h:J(a){E.1t.1V(6,a)},8g:J(a){E.1t[E.1t.3Y(6,a)?"1V":"1b"](6,a)},1V:J(a){7(!a||E.1E(a,[6]).r.M){E("*",6).1b(6).R(J(){E.16.1V(6);E.35(6)});7(6.1a)6.1a.34(6)}},4x:J(){E(">*",6).1V();2b(6.1C)6.34(6.1C)}},J(a,b){E.1n[a]=J(){K 6.R(b,18)}});E.R(["8f","5X"],J(i,c){L b=c.2h();E.1n[b]=J(a){K 6[0]==1e?E.14.2z&&T.1h["5e"+c]||E.14.2d&&1e["8e"+c]||T.6F=="79"&&T.1F["5e"+c]||T.1h["5e"+c]:6[0]==T?24.2f(24.2f(T.1h["5d"+c],T.1F["5d"+c]),24.2f(T.1h["5L"+c],T.1F["5L"+c])):a==10?(6.M?E.1j(6[0],b):V):6.1j(b,a.1k==4e?a:a+"2S")}});L C=E.14.2d&&4s(E.14.5K)<8c?"(?:[\\\\w*4r-]|\\\\\\\\.)":"(?:[\\\\w\\8b-\\8a*4r-]|\\\\\\\\.)",6v=1B 4q("^>\\\\s*("+C+"+)"),6u=1B 4q("^("+C+"+)(#)("+C+"+)"),6s=1B 4q("^([#.]?)("+C+"*)");E.1s({6r:{"":J(a,i,m){K m[2]=="*"||E.12(a,m[2])},"#":J(a,i,m){K a.4z("2w")==m[2]},":":{89:J(a,i,m){K i<m[3]-0},88:J(a,i,m){K i>m[3]-0},2Z:J(a,i,m){K m[3]-0==i},6Z:J(a,i,m){K m[3]-0==i},3j:J(a,i){K i==0},3J:J(a,i,m,r){K i==r.M-1},6n:J(a,i){K i%2==0},6l:J(a,i){K i%2},"3j-4p":J(a){K a.1a.3S("*")[0]==a},"3J-4p":J(a){K E.2Z(a.1a.5o,1,"4t")==a},"83-4p":J(a){K!E.2Z(a.1a.5o,2,"4t")},6B:J(a){K a.1C},4x:J(a){K!a.1C},82:J(a,i,m){K(a.6x||a.81||E(a).1u()||"").1f(m[3])>=0},4d:J(a){K"1Z"!=a.U&&E.1j(a,"19")!="2H"&&E.1j(a,"4U")!="1Z"},1Z:J(a){K"1Z"==a.U||E.1j(a,"19")=="2H"||E.1j(a,"4U")=="1Z"},80:J(a){K!a.2Y},2Y:J(a){K a.2Y},3k:J(a){K a.3k},2p:J(a){K a.2p||E.1J(a,"2p")},1u:J(a){K"1u"==a.U},5u:J(a){K"5u"==a.U},5t:J(a){K"5t"==a.U},59:J(a){K"59"==a.U},3I:J(a){K"3I"==a.U},58:J(a){K"58"==a.U},6j:J(a){K"6j"==a.U},6i:J(a){K"6i"==a.U},2G:J(a){K"2G"==a.U||E.12(a,"2G")},4D:J(a){K/4D|2k|6h|2G/i.17(a.12)},3Y:J(a,i,m){K E.2s(m[3],a).M},7X:J(a){K/h\\d/i.17(a.12)},7W:J(a){K E.3y(E.3G,J(b){K a==b.Y}).M}}},6g:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1B 4q("^([:.#]*)("+C+"+)")],3e:J(a,c,b){L d,2m=[];2b(a&&a!=d){d=a;L f=E.1E(a,c,b);a=f.t.1r(/^\\s*,\\s*/,"");2m=b?c=f.r:E.37(2m,f.r)}K 2m},2s:J(t,p){7(1o t!="25")K[t];7(p&&p.15!=1&&p.15!=9)K[];p=p||T;L d=[p],2r=[],3J,12;2b(t&&3J!=t){L r=[];3J=t;t=E.3g(t);L o=S;L g=6v;L m=g.2O(t);7(m){12=m[1].2E();Q(L i=0;d[i];i++)Q(L c=d[i].1C;c;c=c.2B)7(c.15==1&&(12=="*"||c.12.2E()==12))r.1g(c);d=r;t=t.1r(g,"");7(t.1f(" ")==0)6w;o=P}N{g=/^([>+~])\\s*(\\w*)/i;7((m=g.2O(t))!=V){r=[];L l={};12=m[2].2E();m=m[1];Q(L j=0,3f=d.M;j<3f;j++){L n=m=="~"||m=="+"?d[j].2B:d[j].1C;Q(;n;n=n.2B)7(n.15==1){L h=E.O(n);7(m=="~"&&l[h])1Q;7(!12||n.12.2E()==12){7(m=="~")l[h]=P;r.1g(n)}7(m=="+")1Q}}d=r;t=E.3g(t.1r(g,""));o=P}}7(t&&!o){7(!t.1f(",")){7(p==d[0])d.4l();2r=E.37(2r,d);r=d=[p];t=" "+t.6e(1,t.M)}N{L k=6u;L m=k.2O(t);7(m){m=[0,m[2],m[3],m[1]]}N{k=6s;m=k.2O(t)}m[2]=m[2].1r(/\\\\/g,"");L f=d[d.M-1];7(m[1]=="#"&&f&&f.5J&&!E.3E(f)){L q=f.5J(m[2]);7((E.14.1d||E.14.2z)&&q&&1o q.2w=="25"&&q.2w!=m[2])q=E(\'[@2w="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.12(q,m[3]))?[q]:[]}N{Q(L i=0;d[i];i++){L a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];7(a=="*"&&d[i].12.2h()=="3V")a="3m";r=E.37(r,d[i].3S(a))}7(m[1]==".")r=E.55(r,m[2]);7(m[1]=="#"){L e=[];Q(L i=0;r[i];i++)7(r[i].4z("2w")==m[2]){e=[r[i]];1Q}r=e}d=r}t=t.1r(k,"")}}7(t){L b=E.1E(t,r);d=r=b.r;t=E.3g(b.t)}}7(t)d=[];7(d&&p==d[0])d.4l();2r=E.37(2r,d);K 2r},55:J(r,m,a){m=" "+m+" ";L c=[];Q(L i=0;r[i];i++){L b=(" "+r[i].1t+" ").1f(m)>=0;7(!a&&b||a&&!b)c.1g(r[i])}K c},1E:J(t,r,h){L d;2b(t&&t!=d){d=t;L p=E.6g,m;Q(L i=0;p[i];i++){m=p[i].2O(t);7(m){t=t.7V(m[0].M);m[2]=m[2].1r(/\\\\/g,"");1Q}}7(!m)1Q;7(m[1]==":"&&m[2]=="56")r=G.17(m[3])?E.1E(m[3],r,P).r:E(r).56(m[3]);N 7(m[1]==".")r=E.55(r,m[2],h);N 7(m[1]=="["){L g=[],U=m[3];Q(L i=0,3f=r.M;i<3f;i++){L a=r[i],z=a[E.46[m[2]]||m[2]];7(z==V||/6O|3Q|2p/.17(m[2]))z=E.1J(a,m[2])||\'\';7((U==""&&!!z||U=="="&&z==m[5]||U=="!="&&z!=m[5]||U=="^="&&z&&!z.1f(m[5])||U=="$="&&z.6e(z.M-m[5].M)==m[5]||(U=="*="||U=="~=")&&z.1f(m[5])>=0)^h)g.1g(a)}r=g}N 7(m[1]==":"&&m[2]=="2Z-4p"){L e={},g=[],17=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2O(m[3]=="6n"&&"2n"||m[3]=="6l"&&"2n+1"||!/\\D/.17(m[3])&&"7U+"+m[3]||m[3]),3j=(17[1]+(17[2]||1))-0,d=17[3]-0;Q(L i=0,3f=r.M;i<3f;i++){L j=r[i],1a=j.1a,2w=E.O(1a);7(!e[2w]){L c=1;Q(L n=1a.1C;n;n=n.2B)7(n.15==1)n.4k=c++;e[2w]=P}L b=S;7(3j==0){7(j.4k==d)b=P}N 7((j.4k-d)%3j==0&&(j.4k-d)/3j>=0)b=P;7(b^h)g.1g(j)}r=g}N{L f=E.6r[m[1]];7(1o f=="3V")f=f[m[2]];7(1o f=="25")f=6c("S||J(a,i){K "+f+";}");r=E.3y(r,J(a,i){K f(a,i,m,r)},h)}}K{r:r,t:t}},4u:J(b,c){L d=[];L a=b[c];2b(a&&a!=T){7(a.15==1)d.1g(a);a=a[c]}K d},2Z:J(a,e,c,b){e=e||1;L d=0;Q(;a;a=a[c])7(a.15==1&&++d==e)1Q;K a},5i:J(n,a){L r=[];Q(;n;n=n.2B){7(n.15==1&&(!a||n!=a))r.1g(n)}K r}});E.16={1b:J(f,i,g,e){7(f.15==3||f.15==8)K;7(E.14.1d&&f.53!=10)f=1e;7(!g.2D)g.2D=6.2D++;7(e!=10){L h=g;g=J(){K h.1i(6,18)};g.O=e;g.2D=h.2D}L j=E.O(f,"2R")||E.O(f,"2R",{}),1v=E.O(f,"1v")||E.O(f,"1v",J(){L a;7(1o E=="10"||E.16.5f)K a;a=E.16.1v.1i(18.3R.Y,18);K a});1v.Y=f;E.R(i.23(/\\s+/),J(c,b){L a=b.23(".");b=a[0];g.U=a[1];L d=j[b];7(!d){d=j[b]={};7(!E.16.2y[b]||E.16.2y[b].4j.1P(f)===S){7(f.3F)f.3F(b,1v,S);N 7(f.6b)f.6b("4i"+b,1v)}}d[g.2D]=g;E.16.2a[b]=P});f=V},2D:1,2a:{},1V:J(e,h,f){7(e.15==3||e.15==8)K;L i=E.O(e,"2R"),29,4X;7(i){7(h==10||(1o h=="25"&&h.7T(0)=="."))Q(L g 1p i)6.1V(e,g+(h||""));N{7(h.U){f=h.2q;h=h.U}E.R(h.23(/\\s+/),J(b,a){L c=a.23(".");a=c[0];7(i[a]){7(f)2V i[a][f.2D];N Q(f 1p i[a])7(!c[1]||i[a][f].U==c[1])2V i[a][f];Q(29 1p i[a])1Q;7(!29){7(!E.16.2y[a]||E.16.2y[a].4h.1P(e)===S){7(e.67)e.67(a,E.O(e,"1v"),S);N 7(e.66)e.66("4i"+a,E.O(e,"1v"))}29=V;2V i[a]}}})}Q(29 1p i)1Q;7(!29){L d=E.O(e,"1v");7(d)d.Y=V;E.35(e,"2R");E.35(e,"1v")}}},1N:J(g,c,d,f,h){c=E.2I(c||[]);7(g.1f("!")>=0){g=g.2K(0,-1);L a=P}7(!d){7(6.2a[g])E("*").1b([1e,T]).1N(g,c)}N{7(d.15==3||d.15==8)K 10;L b,29,1n=E.1q(d[g]||V),16=!c[0]||!c[0].36;7(16)c.4J(6.4Z({U:g,2L:d}));c[0].U=g;7(a)c[0].65=P;7(E.1q(E.O(d,"1v")))b=E.O(d,"1v").1i(d,c);7(!1n&&d["4i"+g]&&d["4i"+g].1i(d,c)===S)b=S;7(16)c.4l();7(h&&E.1q(h)){29=h.1i(d,b==V?c:c.71(b));7(29!==10)b=29}7(1n&&f!==S&&b!==S&&!(E.12(d,\'a\')&&g=="4V")){6.5f=P;1S{d[g]()}1X(e){}}6.5f=S}K b},1v:J(c){L a;c=E.16.4Z(c||1e.16||{});L b=c.U.23(".");c.U=b[0];L f=E.O(6,"2R")&&E.O(6,"2R")[c.U],42=1M.2l.2K.1P(18,1);42.4J(c);Q(L j 1p f){L d=f[j];42[0].2q=d;42[0].O=d.O;7(!b[1]&&!c.65||d.U==b[1]){L e=d.1i(6,42);7(a!==S)a=e;7(e===S){c.36();c.44()}}}7(E.14.1d)c.2L=c.36=c.44=c.2q=c.O=V;K a},4Z:J(c){L a=c;c=E.1s({},a);c.36=J(){7(a.36)a.36();a.7S=S};c.44=J(){7(a.44)a.44();a.7R=P};7(!c.2L)c.2L=c.7Q||T;7(c.2L.15==3)c.2L=a.2L.1a;7(!c.4S&&c.5w)c.4S=c.5w==c.2L?c.7P:c.5w;7(c.64==V&&c.63!=V){L b=T.1F,1h=T.1h;c.64=c.63+(b&&b.2v||1h&&1h.2v||0)-(b.62||0);c.7N=c.7L+(b&&b.2x||1h&&1h.2x||0)-(b.60||0)}7(!c.3c&&((c.4f||c.4f===0)?c.4f:c.5Z))c.3c=c.4f||c.5Z;7(!c.7b&&c.5Y)c.7b=c.5Y;7(!c.3c&&c.2G)c.3c=(c.2G&1?1:(c.2G&2?3:(c.2G&4?2:0)));K c},2y:{21:{4j:J(){5M();K},4h:J(){K}},3C:{4j:J(){7(E.14.1d)K S;E(6).2j("4P",E.16.2y.3C.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4P",E.16.2y.3C.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3C";K E.16.1v.1i(6,18)}},3B:{4j:J(){7(E.14.1d)K S;E(6).2j("4O",E.16.2y.3B.2q);K P},4h:J(){7(E.14.1d)K S;E(6).3w("4O",E.16.2y.3B.2q);K P},2q:J(a){7(I(a,6))K P;18[0].U="3B";K E.16.1v.1i(6,18)}}}};E.1n.1s({2j:J(c,a,b){K c=="4H"?6.2X(c,a,b):6.R(J(){E.16.1b(6,c,b||a,b&&a)})},2X:J(d,b,c){K 6.R(J(){E.16.1b(6,d,J(a){E(6).3w(a);K(c||b).1i(6,18)},c&&b)})},3w:J(a,b){K 6.R(J(){E.16.1V(6,a,b)})},1N:J(c,a,b){K 6.R(J(){E.16.1N(c,a,6,P,b)})},5n:J(c,a,b){7(6[0])K E.16.1N(c,a,6[0],S,b);K 10},2g:J(){L b=18;K 6.4V(J(a){6.4N=0==6.4N?1:0;a.36();K b[6.4N].1i(6,18)||S})},7D:J(a,b){K 6.2j(\'3C\',a).2j(\'3B\',b)},21:J(a){5M();7(E.2Q)a.1P(T,E);N E.3A.1g(J(){K a.1P(6,E)});K 6}});E.1s({2Q:S,3A:[],21:J(){7(!E.2Q){E.2Q=P;7(E.3A){E.R(E.3A,J(){6.1i(T)});E.3A=V}E(T).5n("21")}}});L x=S;J 5M(){7(x)K;x=P;7(T.3F&&!E.14.2z)T.3F("5W",E.21,S);7(E.14.1d&&1e==3b)(J(){7(E.2Q)K;1S{T.1F.7B("26")}1X(3a){3z(18.3R,0);K}E.21()})();7(E.14.2z)T.3F("5W",J(){7(E.2Q)K;Q(L i=0;i<T.4L.M;i++)7(T.4L[i].2Y){3z(18.3R,0);K}E.21()},S);7(E.14.2d){L a;(J(){7(E.2Q)K;7(T.39!="5V"&&T.39!="1y"){3z(18.3R,0);K}7(a===10)a=E("W, 7a[7A=7z]").M;7(T.4L.M!=a){3z(18.3R,0);K}E.21()})()}E.16.1b(1e,"3U",E.21)}E.R(("7y,7x,3U,7w,5d,4H,4V,7v,"+"7G,7u,7t,4P,4O,7s,2k,"+"58,7K,7q,7p,3a").23(","),J(i,b){E.1n[b]=J(a){K a?6.2j(b,a):6.1N(b)}});L I=J(a,c){L b=a.4S;2b(b&&b!=c)1S{b=b.1a}1X(3a){b=c}K b==c};E(1e).2j("4H",J(){E("*").1b(T).3w()});E.1n.1s({3U:J(g,d,c){7(E.1q(g))K 6.2j("3U",g);L e=g.1f(" ");7(e>=0){L i=g.2K(e,g.M);g=g.2K(0,e)}c=c||J(){};L f="4Q";7(d)7(E.1q(d)){c=d;d=V}N{d=E.3m(d);f="61"}L h=6;E.3P({1c:g,U:f,1H:"3q",O:d,1y:J(a,b){7(b=="1W"||b=="5U")h.3q(i?E("<1x/>").3t(a.4b.1r(/<1m(.|\\s)*?\\/1m>/g,"")).2s(i):a.4b);h.R(c,[a.4b,b,a])}});K 6},7n:J(){K E.3m(6.5T())},5T:J(){K 6.2c(J(){K E.12(6,"3u")?E.2I(6.7m):6}).1E(J(){K 6.31&&!6.2Y&&(6.3k||/2k|6h/i.17(6.12)||/1u|1Z|3I/i.17(6.U))}).2c(J(i,c){L b=E(6).5O();K b==V?V:b.1k==1M?E.2c(b,J(a,i){K{31:c.31,1A:a}}):{31:c.31,1A:b}}).22()}});E.R("5S,6d,5R,6D,5Q,6m".23(","),J(i,o){E.1n[o]=J(f){K 6.2j(o,f)}});L B=(1B 3v).3L();E.1s({22:J(d,b,a,c){7(E.1q(b)){a=b;b=V}K E.3P({U:"4Q",1c:d,O:b,1W:a,1H:c})},7l:J(b,a){K E.22(b,V,a,"1m")},7k:J(c,b,a){K E.22(c,b,a,"3i")},7i:J(d,b,a,c){7(E.1q(b)){a=b;b={}}K E.3P({U:"61",1c:d,O:b,1W:a,1H:c})},85:J(a){E.1s(E.4I,a)},4I:{2a:P,U:"4Q",2U:0,5P:"4o/x-7h-3u-7g",5N:P,3l:P,O:V,6p:V,3I:V,49:{3M:"4o/3M, 1u/3M",3q:"1u/3q",1m:"1u/4m, 4o/4m",3i:"4o/3i, 1u/4m",1u:"1u/a7",4G:"*/*"}},4F:{},3P:J(s){L f,2W=/=\\?(&|$)/g,1z,O;s=E.1s(P,s,E.1s(P,{},E.4I,s));7(s.O&&s.5N&&1o s.O!="25")s.O=E.3m(s.O);7(s.1H=="4E"){7(s.U.2h()=="22"){7(!s.1c.1D(2W))s.1c+=(s.1c.1D(/\\?/)?"&":"?")+(s.4E||"7d")+"=?"}N 7(!s.O||!s.O.1D(2W))s.O=(s.O?s.O+"&":"")+(s.4E||"7d")+"=?";s.1H="3i"}7(s.1H=="3i"&&(s.O&&s.O.1D(2W)||s.1c.1D(2W))){f="4E"+B++;7(s.O)s.O=(s.O+"").1r(2W,"="+f+"$1");s.1c=s.1c.1r(2W,"="+f+"$1");s.1H="1m";1e[f]=J(a){O=a;1W();1y();1e[f]=10;1S{2V 1e[f]}1X(e){}7(h)h.34(g)}}7(s.1H=="1m"&&s.1T==V)s.1T=S;7(s.1T===S&&s.U.2h()=="22"){L i=(1B 3v()).3L();L j=s.1c.1r(/(\\?|&)4r=.*?(&|$)/,"$a4="+i+"$2");s.1c=j+((j==s.1c)?(s.1c.1D(/\\?/)?"&":"?")+"4r="+i:"")}7(s.O&&s.U.2h()=="22"){s.1c+=(s.1c.1D(/\\?/)?"&":"?")+s.O;s.O=V}7(s.2a&&!E.5H++)E.16.1N("5S");7((!s.1c.1f("a3")||!s.1c.1f("//"))&&s.1H=="1m"&&s.U.2h()=="22"){L h=T.3S("6f")[0];L g=T.3s("1m");g.3Q=s.1c;7(s.7c)g.a2=s.7c;7(!f){L l=S;g.9Z=g.9Y=J(){7(!l&&(!6.39||6.39=="5V"||6.39=="1y")){l=P;1W();1y();h.34(g)}}}h.38(g);K 10}L m=S;L k=1e.78?1B 78("9X.9V"):1B 76();k.9T(s.U,s.1c,s.3l,s.6p,s.3I);1S{7(s.O)k.4C("9R-9Q",s.5P);7(s.5C)k.4C("9O-5A-9N",E.4F[s.1c]||"9L, 9K 9I 9H 5z:5z:5z 9F");k.4C("X-9C-9A","76");k.4C("9z",s.1H&&s.49[s.1H]?s.49[s.1H]+", */*":s.49.4G)}1X(e){}7(s.6Y)s.6Y(k);7(s.2a)E.16.1N("6m",[k,s]);L c=J(a){7(!m&&k&&(k.39==4||a=="2U")){m=P;7(d){6I(d);d=V}1z=a=="2U"&&"2U"||!E.6X(k)&&"3a"||s.5C&&E.6J(k,s.1c)&&"5U"||"1W";7(1z=="1W"){1S{O=E.6W(k,s.1H)}1X(e){1z="5x"}}7(1z=="1W"){L b;1S{b=k.5q("6U-5A")}1X(e){}7(s.5C&&b)E.4F[s.1c]=b;7(!f)1W()}N E.5v(s,k,1z);1y();7(s.3l)k=V}};7(s.3l){L d=53(c,13);7(s.2U>0)3z(J(){7(k){k.9t();7(!m)c("2U")}},s.2U)}1S{k.9s(s.O)}1X(e){E.5v(s,k,V,e)}7(!s.3l)c();J 1W(){7(s.1W)s.1W(O,1z);7(s.2a)E.16.1N("5Q",[k,s])}J 1y(){7(s.1y)s.1y(k,1z);7(s.2a)E.16.1N("5R",[k,s]);7(s.2a&&!--E.5H)E.16.1N("6d")}K k},5v:J(s,a,b,e){7(s.3a)s.3a(a,b,e);7(s.2a)E.16.1N("6D",[a,s,e])},5H:0,6X:J(r){1S{K!r.1z&&9q.9p=="59:"||(r.1z>=6T&&r.1z<9n)||r.1z==6R||r.1z==9l||E.14.2d&&r.1z==10}1X(e){}K S},6J:J(a,c){1S{L b=a.5q("6U-5A");K a.1z==6R||b==E.4F[c]||E.14.2d&&a.1z==10}1X(e){}K S},6W:J(r,b){L c=r.5q("9k-U");L d=b=="3M"||!b&&c&&c.1f("3M")>=0;L a=d?r.9j:r.4b;7(d&&a.1F.28=="5x")6Q"5x";7(b=="1m")E.5g(a);7(b=="3i")a=6c("("+a+")");K a},3m:J(a){L s=[];7(a.1k==1M||a.5h)E.R(a,J(){s.1g(3r(6.31)+"="+3r(6.1A))});N Q(L j 1p a)7(a[j]&&a[j].1k==1M)E.R(a[j],J(){s.1g(3r(j)+"="+3r(6))});N s.1g(3r(j)+"="+3r(a[j]));K s.6a("&").1r(/%20/g,"+")}});E.1n.1s({1G:J(c,b){K c?6.2e({1R:"1G",27:"1G",1w:"1G"},c,b):6.1E(":1Z").R(J(){6.W.19=6.5s||"";7(E.1j(6,"19")=="2H"){L a=E("<"+6.28+" />").6y("1h");6.W.19=a.1j("19");7(6.W.19=="2H")6.W.19="3D";a.1V()}}).3h()},1I:J(b,a){K b?6.2e({1R:"1I",27:"1I",1w:"1I"},b,a):6.1E(":4d").R(J(){6.5s=6.5s||E.1j(6,"19");6.W.19="2H"}).3h()},6N:E.1n.2g,2g:J(a,b){K E.1q(a)&&E.1q(b)?6.6N(a,b):a?6.2e({1R:"2g",27:"2g",1w:"2g"},a,b):6.R(J(){E(6)[E(6).3H(":1Z")?"1G":"1I"]()})},9f:J(b,a){K 6.2e({1R:"1G"},b,a)},9d:J(b,a){K 6.2e({1R:"1I"},b,a)},9c:J(b,a){K 6.2e({1R:"2g"},b,a)},9a:J(b,a){K 6.2e({1w:"1G"},b,a)},99:J(b,a){K 6.2e({1w:"1I"},b,a)},97:J(c,a,b){K 6.2e({1w:a},c,b)},2e:J(l,k,j,h){L i=E.6P(k,j,h);K 6[i.2P===S?"R":"2P"](J(){7(6.15!=1)K S;L g=E.1s({},i);L f=E(6).3H(":1Z"),4A=6;Q(L p 1p l){7(l[p]=="1I"&&f||l[p]=="1G"&&!f)K E.1q(g.1y)&&g.1y.1i(6);7(p=="1R"||p=="27"){g.19=E.1j(6,"19");g.32=6.W.32}}7(g.32!=V)6.W.32="1Z";g.40=E.1s({},l);E.R(l,J(c,a){L e=1B E.2t(4A,g,c);7(/2g|1G|1I/.17(a))e[a=="2g"?f?"1G":"1I":a](l);N{L b=a.3X().1D(/^([+-]=)?([\\d+-.]+)(.*)$/),1Y=e.2m(P)||0;7(b){L d=2M(b[2]),2A=b[3]||"2S";7(2A!="2S"){4A.W[c]=(d||1)+2A;1Y=((d||1)/e.2m(P))*1Y;4A.W[c]=1Y+2A}7(b[1])d=((b[1]=="-="?-1:1)*d)+1Y;e.45(1Y,d,2A)}N e.45(1Y,a,"")}});K P})},2P:J(a,b){7(E.1q(a)||(a&&a.1k==1M)){b=a;a="2t"}7(!a||(1o a=="25"&&!b))K A(6[0],a);K 6.R(J(){7(b.1k==1M)A(6,a,b);N{A(6,a).1g(b);7(A(6,a).M==1)b.1i(6)}})},94:J(b,c){L a=E.3G;7(b)6.2P([]);6.R(J(){Q(L i=a.M-1;i>=0;i--)7(a[i].Y==6){7(c)a[i](P);a.72(i,1)}});7(!c)6.5p();K 6}});L A=J(b,c,a){7(!b)K 10;c=c||"2t";L q=E.O(b,c+"2P");7(!q||a)q=E.O(b,c+"2P",a?E.2I(a):[]);K q};E.1n.5p=J(a){a=a||"2t";K 6.R(J(){L q=A(6,a);q.4l();7(q.M)q[0].1i(6)})};E.1s({6P:J(b,a,c){L d=b&&b.1k==92?b:{1y:c||!c&&a||E.1q(b)&&b,2u:b,3Z:c&&a||a&&a.1k!=91&&a};d.2u=(d.2u&&d.2u.1k==51?d.2u:{90:8Z,9D:6T}[d.2u])||8X;d.5y=d.1y;d.1y=J(){7(d.2P!==S)E(6).5p();7(E.1q(d.5y))d.5y.1i(6)};K d},3Z:{70:J(p,n,b,a){K b+a*p},5j:J(p,n,b,a){K((-24.8V(p*24.8U)/2)+0.5)*a+b}},3G:[],3W:V,2t:J(b,c,a){6.11=c;6.Y=b;6.1l=a;7(!c.47)c.47={}}});E.2t.2l={4y:J(){7(6.11.30)6.11.30.1i(6.Y,[6.2J,6]);(E.2t.30[6.1l]||E.2t.30.4G)(6);7(6.1l=="1R"||6.1l=="27")6.Y.W.19="3D"},2m:J(a){7(6.Y[6.1l]!=V&&6.Y.W[6.1l]==V)K 6.Y[6.1l];L r=2M(E.1j(6.Y,6.1l,a));K r&&r>-8Q?r:2M(E.2o(6.Y,6.1l))||0},45:J(c,b,d){6.5B=(1B 3v()).3L();6.1Y=c;6.3h=b;6.2A=d||6.2A||"2S";6.2J=6.1Y;6.4B=6.4w=0;6.4y();L e=6;J t(a){K e.30(a)}t.Y=6.Y;E.3G.1g(t);7(E.3W==V){E.3W=53(J(){L a=E.3G;Q(L i=0;i<a.M;i++)7(!a[i]())a.72(i--,1);7(!a.M){6I(E.3W);E.3W=V}},13)}},1G:J(){6.11.47[6.1l]=E.1J(6.Y.W,6.1l);6.11.1G=P;6.45(0,6.2m());7(6.1l=="27"||6.1l=="1R")6.Y.W[6.1l]="8N";E(6.Y).1G()},1I:J(){6.11.47[6.1l]=E.1J(6.Y.W,6.1l);6.11.1I=P;6.45(6.2m(),0)},30:J(a){L t=(1B 3v()).3L();7(a||t>6.11.2u+6.5B){6.2J=6.3h;6.4B=6.4w=1;6.4y();6.11.40[6.1l]=P;L b=P;Q(L i 1p 6.11.40)7(6.11.40[i]!==P)b=S;7(b){7(6.11.19!=V){6.Y.W.32=6.11.32;6.Y.W.19=6.11.19;7(E.1j(6.Y,"19")=="2H")6.Y.W.19="3D"}7(6.11.1I)6.Y.W.19="2H";7(6.11.1I||6.11.1G)Q(L p 1p 6.11.40)E.1J(6.Y.W,p,6.11.47[p])}7(b&&E.1q(6.11.1y))6.11.1y.1i(6.Y);K S}N{L n=t-6.5B;6.4w=n/6.11.2u;6.4B=E.3Z[6.11.3Z||(E.3Z.5j?"5j":"70")](6.4w,n,0,1,6.11.2u);6.2J=6.1Y+((6.3h-6.1Y)*6.4B);6.4y()}K P}};E.2t.30={2v:J(a){a.Y.2v=a.2J},2x:J(a){a.Y.2x=a.2J},1w:J(a){E.1J(a.Y.W,"1w",a.2J)},4G:J(a){a.Y.W[a.1l]=a.2J+a.2A}};E.1n.5L=J(){L b=0,3b=0,Y=6[0],5l;7(Y)8M(E.14){L d=Y.1a,41=Y,1K=Y.1K,1L=Y.2i,5D=2d&&4s(5K)<8J&&!/a1/i.17(v),2T=E.1j(Y,"43")=="2T";7(Y.6G){L c=Y.6G();1b(c.26+24.2f(1L.1F.2v,1L.1h.2v),c.3b+24.2f(1L.1F.2x,1L.1h.2x));1b(-1L.1F.62,-1L.1F.60)}N{1b(Y.5G,Y.5F);2b(1K){1b(1K.5G,1K.5F);7(48&&!/^t(8H|d|h)$/i.17(1K.28)||2d&&!5D)2N(1K);7(!2T&&E.1j(1K,"43")=="2T")2T=P;41=/^1h$/i.17(1K.28)?41:1K;1K=1K.1K}2b(d&&d.28&&!/^1h|3q$/i.17(d.28)){7(!/^8G|1O.*$/i.17(E.1j(d,"19")))1b(-d.2v,-d.2x);7(48&&E.1j(d,"32")!="4d")2N(d);d=d.1a}7((5D&&(2T||E.1j(41,"43")=="4W"))||(48&&E.1j(41,"43")!="4W"))1b(-1L.1h.5G,-1L.1h.5F);7(2T)1b(24.2f(1L.1F.2v,1L.1h.2v),24.2f(1L.1F.2x,1L.1h.2x))}5l={3b:3b,26:b}}J 2N(a){1b(E.2o(a,"a8",P),E.2o(a,"a9",P))}J 1b(l,t){b+=4s(l)||0;3b+=4s(t)||0}K 5l}})();',62,631,'||||||this|if||||||||||||||||||||||||||||||||||||||function|return|var|length|else|data|true|for|each|false|document|type|null|style||elem||undefined|options|nodeName||browser|nodeType|event|test|arguments|display|parentNode|add|url|msie|window|indexOf|push|body|apply|css|constructor|prop|script|fn|typeof|in|isFunction|replace|extend|className|text|handle|opacity|div|complete|status|value|new|firstChild|match|filter|documentElement|show|dataType|hide|attr|offsetParent|doc|Array|trigger|table|call|break|height|try|cache|tbody|remove|success|catch|start|hidden||ready|get|split|Math|string|left|width|tagName|ret|global|while|map|safari|animate|max|toggle|toLowerCase|ownerDocument|bind|select|prototype|cur||curCSS|selected|handler|done|find|fx|duration|scrollLeft|id|scrollTop|special|opera|unit|nextSibling|stack|guid|toUpperCase|pushStack|button|none|makeArray|now|slice|target|parseFloat|border|exec|queue|isReady|events|px|fixed|timeout|delete|jsre|one|disabled|nth|step|name|overflow|inArray|removeChild|removeData|preventDefault|merge|appendChild|readyState|error|top|which|innerHTML|multiFilter|rl|trim|end|json|first|checked|async|param|elems|insertBefore|childNodes|html|encodeURIComponent|createElement|append|form|Date|unbind|color|grep|setTimeout|readyList|mouseleave|mouseenter|block|isXMLDoc|addEventListener|timers|is|password|last|runtimeStyle|getTime|xml|jQuery|domManip|ajax|src|callee|getElementsByTagName|selectedIndex|load|object|timerId|toString|has|easing|curAnim|offsetChild|args|position|stopPropagation|custom|props|orig|mozilla|accepts|clean|responseText|defaultView|visible|String|charCode|float|teardown|on|setup|nodeIndex|shift|javascript|currentStyle|application|child|RegExp|_|parseInt|previousSibling|dir|tr|state|empty|update|getAttribute|self|pos|setRequestHeader|input|jsonp|lastModified|_default|unload|ajaxSettings|unshift|getComputedStyle|styleSheets|getPropertyValue|lastToggle|mouseout|mouseover|GET|andSelf|relatedTarget|init|visibility|click|absolute|index|container|fix|outline|Number|removeAttribute|setInterval|prevObject|classFilter|not|unique|submit|file|after|windowData|deep|scroll|client|triggered|globalEval|jquery|sibling|swing|clone|results|wrapAll|triggerHandler|lastChild|dequeue|getResponseHeader|createTextNode|oldblock|checkbox|radio|handleError|fromElement|parsererror|old|00|Modified|startTime|ifModified|safari2|getWH|offsetTop|offsetLeft|active|values|getElementById|version|offset|bindReady|processData|val|contentType|ajaxSuccess|ajaxComplete|ajaxStart|serializeArray|notmodified|loaded|DOMContentLoaded|Width|ctrlKey|keyCode|clientTop|POST|clientLeft|clientX|pageX|exclusive|detachEvent|removeEventListener|swap|cloneNode|join|attachEvent|eval|ajaxStop|substr|head|parse|textarea|reset|image|zoom|odd|ajaxSend|even|before|username|prepend|expr|quickClass|uuid|quickID|quickChild|continue|textContent|appendTo|contents|evalScript|parent|defaultValue|ajaxError|setArray|compatMode|getBoundingClientRect|styleFloat|clearInterval|httpNotModified|nodeValue|100|alpha|_toggle|href|speed|throw|304|replaceWith|200|Last|colgroup|httpData|httpSuccess|beforeSend|eq|linear|concat|splice|fieldset|multiple|cssFloat|XMLHttpRequest|webkit|ActiveXObject|CSS1Compat|link|metaKey|scriptCharset|callback|col|pixelLeft|urlencoded|www|post|hasClass|getJSON|getScript|elements|serialize|black|keyup|keypress|solid|change|mousemove|mouseup|dblclick|resize|focus|blur|stylesheet|rel|doScroll|round|hover|padding|offsetHeight|mousedown|offsetWidth|Bottom|Top|keydown|clientY|Right|pageY|Left|toElement|srcElement|cancelBubble|returnValue|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|ajaxSetup|font|size|gt|lt|uFFFF|u0128|417|Boolean|inner|Height|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|contentWindow|contentDocument|wrap|iframe|children|siblings|prevAll|nextAll|prev|wrapInner|next|parents|maxLength|maxlength|readOnly|readonly|reverse|class|htmlFor|inline|able|boxModel|522|setData|compatible|with|1px|ie|getData|10000|ra|it|rv|PI|cos|userAgent|400|navigator|600|slow|Function|Object|array|stop|ig|NaN|fadeTo|option|fadeOut|fadeIn|setAttribute|slideToggle|slideUp|changed|slideDown|be|can|property|responseXML|content|1223|getAttributeNode|300|method|protocol|location|action|send|abort|cssText|th|td|cap|specified|Accept|With|colg|Requested|fast|tfoot|GMT|thead|1970|Jan|attributes|01|Thu|leg|Since|If|opt|Type|Content|embed|open|area|XMLHTTP|hr|Microsoft|onreadystatechange|onload|meta|adobeair|charset|http|1_|img|br|plain|borderLeftWidth|borderTopWidth|abbr'.split('|'),0,{}));jQuery.noConflict();
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(H(){J w=1c.4I,3n$=1c.$;J D=1c.4I=1c.$=H(a,b){I 2r D.18.5i(a,b)};J u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/,61=/^.[^:#\\[\\.]*$/,12;D.18=D.3V={5i:H(d,b){d=d||S;G(d.15){7[0]=d;7.K=1;I 7}G(1j d=="1W"){J c=u.2D(d);G(c&&(c[1]||!b)){G(c[1])d=D.4h([c[1]],b);N{J a=S.60(c[3]);G(a){G(a.2t!=c[3])I D().2u(d);I D(a)}d=[]}}N I D(b).2u(d)}N G(D.1F(d))I D(S)[D.18.25?"25":"3Y"](d);I 7.6V(D.2h(d))},5w:"1.2.6",8H:H(){I 7.K},K:0,3p:H(a){I a==12?D.2h(7):7[a]},2F:H(b){J a=D(b);a.5n=7;I a},6V:H(a){7.K=0;2q.3V.1A.1t(7,a);I 7},P:H(a,b){I D.P(7,a,b)},5h:H(b){J a=-1;I D.2E(b&&b.5w?b[0]:b,7)},1M:H(c,a,b){J d=c;G(c.1q==56)G(a===12)I 7[0]&&D[b||"1M"](7[0],c);N{d={};d[c]=a}I 7.P(H(i){R(c 1k d)D.1M(b?7.V:7,c,D.1e(7,d[c],b,i,c))})},1h:H(b,a){G((b==\'2d\'||b==\'1T\')&&3e(a)<0)a=12;I 7.1M(b,a,"24")},1r:H(b){G(1j b!="3y"&&b!=U)I 7.4F().3s((7[0]&&7[0].2z||S).5J(b));J a="";D.P(b||7,H(){D.P(7.3u,H(){G(7.15!=8)a+=7.15!=1?7.73:D.18.1r([7])})});I a},5W:H(b){G(7[0])D(b,7[0].2z).5y().38(7[0]).2i(H(){J a=7;1G(a.1s)a=a.1s;I a}).3s(7);I 7},8Z:H(a){I 7.P(H(){D(7).6P().5W(a)})},8S:H(a){I 7.P(H(){D(7).5W(a)})},3s:H(){I 7.3S(1a,M,Q,H(a){G(7.15==1)7.49(a)})},6E:H(){I 7.3S(1a,M,M,H(a){G(7.15==1)7.38(a,7.1s)})},6D:H(){I 7.3S(1a,Q,Q,H(a){7.1f.38(a,7)})},5p:H(){I 7.3S(1a,Q,M,H(a){7.1f.38(a,7.2J)})},3m:H(){I 7.5n||D([])},2u:H(b){J c=D.2i(7,H(a){I D.2u(b,a)});I 7.2F(/[^+>] [^+>]/.11(b)||b.1i("..")>-1?D.4u(c):c)},5y:H(e){J f=7.2i(H(){G(D.14.1g&&!D.4o(7)){J a=7.6n(M),5f=S.3t("1w");5f.49(a);I D.4h([5f.4l])[0]}N I 7.6n(M)});J d=f.2u("*").5M().P(H(){G(7[E]!=12)7[E]=U});G(e===M)7.2u("*").5M().P(H(i){G(7.15==3)I;J c=D.L(7,"3x");R(J a 1k c)R(J b 1k c[a])D.W.17(d[i],a,c[a][b],c[a][b].L)});I f},1E:H(b){I 7.2F(D.1F(b)&&D.3G(7,H(a,i){I b.1l(a,i)})||D.3f(b,7))},4W:H(b){G(b.1q==56)G(61.11(b))I 7.2F(D.3f(b,7,M));N b=D.3f(b,7);J a=b.K&&b[b.K-1]!==12&&!b.15;I 7.1E(H(){I a?D.2E(7,b)<0:7!=b})},17:H(a){I 7.2F(D.4u(D.39(7.3p(),1j a==\'1W\'?D(a):D.2h(a))))},3C:H(a){I!!a&&D.3f(a,7).K>0},7V:H(a){I 7.3C("."+a)},6a:H(b){G(b==12){G(7.K){J c=7[0];G(D.Y(c,"2y")){J e=c.63,62=[],16=c.16,2Y=c.O=="2y-2Y";G(e<0)I U;R(J i=2Y?e:0,2e=2Y?e+1:16.K;i<2e;i++){J d=16[i];G(d.3a){b=D.14.1g&&!d.au.2s.aq?d.1r:d.2s;G(2Y)I b;62.1A(b)}}I 62}N I(7[0].2s||"").1o(/\\r/g,"")}I 12}G(b.1q==4N)b+=\'\';I 7.P(H(){G(7.15!=1)I;G(b.1q==2q&&/5R|5A/.11(7.O))7.4M=(D.2E(7.2s,b)>=0||D.2E(7.32,b)>=0);N G(D.Y(7,"2y")){J a=D.2h(b);D("9U",7).P(H(){7.3a=(D.2E(7.2s,a)>=0||D.2E(7.1r,a)>=0)});G(!a.K)7.63=-1}N 7.2s=b})},2I:H(a){I a==12?(7[0]?7[0].4l:U):7.4F().3s(a)},7b:H(a){I 7.5p(a).1Z()},77:H(i){I 7.3w(i,i+1)},3w:H(){I 7.2F(2q.3V.3w.1t(7,1a))},2i:H(b){I 7.2F(D.2i(7,H(a,i){I b.1l(a,i,a)}))},5M:H(){I 7.17(7.5n)},L:H(d,b){J a=d.1Q(".");a[1]=a[1]?"."+a[1]:"";G(b===12){J c=7.5G("9B"+a[1]+"!",[a[0]]);G(c===12&&7.K)c=D.L(7[0],d);I c===12&&a[1]?7.L(a[0]):c}N I 7.1R("9v"+a[1]+"!",[a[0],b]).P(H(){D.L(7,d,b)})},3b:H(a){I 7.P(H(){D.3b(7,a)})},3S:H(g,f,h,d){J e=7.K>1,3z;I 7.P(H(){G(!3z){3z=D.4h(g,7.2z);G(h)3z.9o()}J b=7;G(f&&D.Y(7,"1X")&&D.Y(3z[0],"4H"))b=7.40("22")[0]||7.49(7.2z.3t("22"));J c=D([]);D.P(3z,H(){J a=e?D(7).5y(M)[0]:7;G(D.Y(a,"1m"))c=c.17(a);N{G(a.15==1)c=c.17(D("1m",a).1Z());d.1l(b,a)}});c.P(6R)})}};D.18.5i.3V=D.18;H 6R(i,a){G(a.4e)D.3T({1b:a.4e,31:Q,1L:"1m"});N D.5u(a.1r||a.6N||a.4l||"");G(a.1f)a.1f.30(a)}H 1x(){I+2r 8K}D.1n=D.18.1n=H(){J b=1a[0]||{},i=1,K=1a.K,4B=Q,16;G(b.1q==8I){4B=b;b=1a[1]||{};i=2}G(1j b!="3y"&&1j b!="H")b={};G(K==i){b=7;--i}R(;i<K;i++)G((16=1a[i])!=U)R(J c 1k 16){J a=b[c],2x=16[c];G(b===2x)6L;G(4B&&2x&&1j 2x=="3y"&&!2x.15)b[c]=D.1n(4B,a||(2x.K!=U?[]:{}),2x);N G(2x!==12)b[c]=2x}I b};J E="4I"+1x(),6K=0,5q={},6G=/z-?5h|8B-?8A|1y|6A|8w-?1T/i,3N=S.3N||{};D.1n({8u:H(a){1c.$=3n$;G(a)1c.4I=w;I D},1F:H(a){I!!a&&1j a!="1W"&&!a.Y&&a.1q!=2q&&/^[\\s[]?H/.11(a+"")},4o:H(a){I a.1B&&!a.1d||a.2g&&a.2z&&!a.2z.1d},5u:H(a){a=D.3l(a);G(a){J b=S.40("6v")[0]||S.1B,1m=S.3t("1m");1m.O="1r/4v";G(D.14.1g)1m.1r=a;N 1m.49(S.5J(a));b.38(1m,b.1s);b.30(1m)}},Y:H(b,a){I b.Y&&b.Y.2m()==a.2m()},1Y:{},L:H(c,d,b){c=c==1c?5q:c;J a=c[E];G(!a)a=c[E]=++6K;G(d&&!D.1Y[a])D.1Y[a]={};G(b!==12)D.1Y[a][d]=b;I d?D.1Y[a][d]:a},3b:H(c,b){c=c==1c?5q:c;J a=c[E];G(b){G(D.1Y[a]){3d D.1Y[a][b];b="";R(b 1k D.1Y[a])1V;G(!b)D.3b(c)}}N{23{3d c[E]}21(e){G(c.5k)c.5k(E)}3d D.1Y[a]}},P:H(d,a,c){J e,i=0,K=d.K;G(c){G(K==12){R(e 1k d)G(a.1t(d[e],c)===Q)1V}N R(;i<K;)G(a.1t(d[i++],c)===Q)1V}N{G(K==12){R(e 1k d)G(a.1l(d[e],e,d[e])===Q)1V}N R(J b=d[0];i<K&&a.1l(b,i,b)!==Q;b=d[++i]){}}I d},1e:H(b,a,c,i,d){G(D.1F(a))a=a.1l(b,i);I a&&a.1q==4N&&c=="24"&&!6G.11(d)?a+"2U":a},1D:{17:H(c,b){D.P((b||"").1Q(/\\s+/),H(i,a){G(c.15==1&&!D.1D.3Q(c.1D,a))c.1D+=(c.1D?" ":"")+a})},1Z:H(c,b){G(c.15==1)c.1D=b!=12?D.3G(c.1D.1Q(/\\s+/),H(a){I!D.1D.3Q(b,a)}).6r(" "):""},3Q:H(b,a){I D.2E(a,(b.1D||b).6p().1Q(/\\s+/))>-1}},6o:H(b,c,a){J e={};R(J d 1k c){e[d]=b.V[d];b.V[d]=c[d]}a.1l(b);R(J d 1k c)b.V[d]=e[d]},1h:H(d,e,c){G(e=="2d"||e=="1T"){J b,2L={3c:"5g",5D:"1C",19:"3H"},2S=e=="2d"?["5d","6i"]:["5b","6g"];H 5a(){b=e=="2d"?d.8g:d.8f;J a=0,2A=0;D.P(2S,H(){a+=3e(D.24(d,"55"+7,M))||0;2A+=3e(D.24(d,"2A"+7+"47",M))||0});b-=26.85(a+2A)}G(D(d).3C(":4i"))5a();N D.6o(d,2L,5a);I 26.2e(0,b)}I D.24(d,e,c)},24:H(f,l,k){J e,V=f.V;H 4d(b){G(!D.14.2f)I Q;J a=3N.53(b,U);I!a||a.52("4d")==""}G(l=="1y"&&D.14.1g){e=D.1M(V,"1y");I e==""?"1":e}G(D.14.2H&&l=="19"){J d=V.50;V.50="0 7Z 7Y";V.50=d}G(l.1I(/4g/i))l=y;G(!k&&V&&V[l])e=V[l];N G(3N.53){G(l.1I(/4g/i))l="4g";l=l.1o(/([A-Z])/g,"-$1").3h();J c=3N.53(f,U);G(c&&!4d(f))e=c.52(l);N{J g=[],2G=[],a=f,i=0;R(;a&&4d(a);a=a.1f)2G.6b(a);R(;i<2G.K;i++)G(4d(2G[i])){g[i]=2G[i].V.19;2G[i].V.19="3H"}e=l=="19"&&g[2G.K-1]!=U?"2P":(c&&c.52(l))||"";R(i=0;i<g.K;i++)G(g[i]!=U)2G[i].V.19=g[i]}G(l=="1y"&&e=="")e="1"}N G(f.4f){J h=l.1o(/\\-(\\w)/g,H(a,b){I b.2m()});e=f.4f[l]||f.4f[h];G(!/^\\d+(2U)?$/i.11(e)&&/^\\d/.11(e)){J j=V.1z,65=f.64.1z;f.64.1z=f.4f.1z;V.1z=e||0;e=V.aO+"2U";V.1z=j;f.64.1z=65}}I e},4h:H(l,h){J k=[];h=h||S;G(1j h.3t==\'12\')h=h.2z||h[0]&&h[0].2z||S;D.P(l,H(i,d){G(!d)I;G(d.1q==4N)d+=\'\';G(1j d=="1W"){d=d.1o(/(<(\\w+)[^>]*?)\\/>/g,H(b,a,c){I c.1I(/^(aN|43|7E|aH|4t|7z|aE|3A|aB|aA|az)$/i)?b:a+"></"+c+">"});J f=D.3l(d).3h(),1w=h.3t("1w");J e=!f.1i("<av")&&[1,"<2y 7u=\'7u\'>","</2y>"]||!f.1i("<at")&&[1,"<7t>","</7t>"]||f.1I(/^<(ar|22|ap|al|aj)/)&&[1,"<1X>","</1X>"]||!f.1i("<4H")&&[2,"<1X><22>","</22></1X>"]||(!f.1i("<ah")||!f.1i("<ae"))&&[3,"<1X><22><4H>","</4H></22></1X>"]||!f.1i("<7E")&&[2,"<1X><22></22><7p>","</7p></1X>"]||D.14.1g&&[1,"1w<1w>","</1w>"]||[0,"",""];1w.4l=e[1]+d+e[2];1G(e[0]--)1w=1w.5U;G(D.14.1g){J g=!f.1i("<1X")&&f.1i("<22")<0?1w.1s&&1w.1s.3u:e[1]=="<1X>"&&f.1i("<22")<0?1w.3u:[];R(J j=g.K-1;j>=0;--j)G(D.Y(g[j],"22")&&!g[j].3u.K)g[j].1f.30(g[j]);G(/^\\s/.11(d))1w.38(h.5J(d.1I(/^\\s*/)[0]),1w.1s)}d=D.2h(1w.3u)}G(d.K===0&&(!D.Y(d,"45")&&!D.Y(d,"2y")))I;G(d[0]==12||D.Y(d,"45")||d.16)k.1A(d);N k=D.39(k,d)});I k},1M:H(d,f,c){G(!d||d.15==3||d.15==8)I 12;J e=!D.4o(d),3W=c!==12,1g=D.14.1g;f=e&&D.2L[f]||f;G(d.2g){J g=/5x|4e|V/.11(f);G(f=="3a"&&D.14.2f)d.1f.63;G(f 1k d&&e&&!g){G(3W){G(f=="O"&&D.Y(d,"4t")&&d.1f)7m"O a5 a2\'t 9Z 9W";d[f]=c}G(D.Y(d,"45")&&d.7i(f))I d.7i(f).73;I d[f]}G(1g&&e&&f=="V")I D.1M(d.V,"9V",c);G(3W)d.9T(f,""+c);J h=1g&&e&&g?d.4K(f,2):d.4K(f);I h===U?12:h}G(1g&&f=="1y"){G(3W){d.6A=1;d.1E=(d.1E||"").1o(/7d\\([^)]*\\)/,"")+(3v(c)+\'\'=="9P"?"":"7d(1y="+c*79+")")}I d.1E&&d.1E.1i("1y=")>=0?(3e(d.1E.1I(/1y=([^)]*)/)[1])/79)+\'\':""}f=f.1o(/-([a-z])/9M,H(a,b){I b.2m()});G(3W)d[f]=c;I d[f]},3l:H(a){I(a||"").1o(/^\\s+|\\s+$/g,"")},2h:H(b){J a=[];G(b!=U){J i=b.K;G(i==U||b.1Q||b.4L||b.1l)a[0]=b;N 1G(i)a[--i]=b[i]}I a},2E:H(b,a){R(J i=0,K=a.K;i<K;i++)G(a[i]===b)I i;I-1},39:H(a,b){J i=0,T,36=a.K;G(D.14.1g){1G(T=b[i++])G(T.15!=8)a[36++]=T}N 1G(T=b[i++])a[36++]=T;I a},4u:H(a){J c=[],2w={};23{R(J i=0,K=a.K;i<K;i++){J b=D.L(a[i]);G(!2w[b]){2w[b]=M;c.1A(a[i])}}}21(e){c=a}I c},3G:H(c,a,d){J b=[];R(J i=0,K=c.K;i<K;i++)G(!d!=!a(c[i],i))b.1A(c[i]);I b},2i:H(d,a){J c=[];R(J i=0,K=d.K;i<K;i++){J b=a(d[i],i);G(b!=U)c[c.K]=b}I c.75.1t([],c)}});J v=9E.9C.3h();D.14={5F:(v.1I(/.+(?:9A|9z|9y|9w)[\\/: ]([\\d.]+)/)||[])[1],2f:/72/.11(v),2H:/2H/.11(v),1g:/1g/.11(v)&&!/2H/.11(v),3r:/3r/.11(v)&&!/(9s|72)/.11(v)};J y=D.14.1g?"70":"6Z";D.1n({6Y:!D.14.1g||S.6X=="6W",2L:{"R":"9n","9m":"1D","4g":y,6Z:y,70:y,9j:"9h",9g:"9e",9d:"9b",9a:"99"}});D.P({6S:H(a){I a.1f},96:H(a){I D.4T(a,"1f")},93:H(a){I D.2V(a,2,"2J")},90:H(a){I D.2V(a,2,"4D")},8Y:H(a){I D.4T(a,"2J")},8X:H(a){I D.4T(a,"4D")},8W:H(a){I D.5v(a.1f.1s,a)},8V:H(a){I D.5v(a.1s)},6P:H(a){I D.Y(a,"8U")?a.8T||a.8R.S:D.2h(a.3u)}},H(c,d){D.18[c]=H(b){J a=D.2i(7,d);G(b&&1j b=="1W")a=D.3f(b,a);I 7.2F(D.4u(a))}});D.P({6O:"3s",8Q:"6E",38:"6D",8P:"5p",8O:"7b"},H(c,b){D.18[c]=H(){J a=1a;I 7.P(H(){R(J i=0,K=a.K;i<K;i++)D(a[i])[b](7)})}});D.P({8N:H(a){D.1M(7,a,"");G(7.15==1)7.5k(a)},8M:H(a){D.1D.17(7,a)},8L:H(a){D.1D.1Z(7,a)},8J:H(a){D.1D[D.1D.3Q(7,a)?"1Z":"17"](7,a)},1Z:H(a){G(!a||D.1E(a,[7]).r.K){D("*",7).17(7).P(H(){D.W.1Z(7);D.3b(7)});G(7.1f)7.1f.30(7)}},4F:H(){D(">*",7).1Z();1G(7.1s)7.30(7.1s)}},H(a,b){D.18[a]=H(){I 7.P(b,1a)}});D.P(["6M","47"],H(i,c){J b=c.3h();D.18[b]=H(a){I 7[0]==1c?D.14.2H&&S.1d["5t"+c]||D.14.2f&&1c["5s"+c]||S.6X=="6W"&&S.1B["5t"+c]||S.1d["5t"+c]:7[0]==S?26.2e(26.2e(S.1d["4A"+c],S.1B["4A"+c]),26.2e(S.1d["2k"+c],S.1B["2k"+c])):a==12?(7.K?D.1h(7[0],b):U):7.1h(b,a.1q==56?a:a+"2U")}});H 2a(a,b){I a[0]&&3v(D.24(a[0],b,M),10)||0}J C=D.14.2f&&3v(D.14.5F)<8G?"(?:[\\\\w*3n-]|\\\\\\\\.)":"(?:[\\\\w\\8F-\\8E*3n-]|\\\\\\\\.)",6J=2r 4y("^>\\\\s*("+C+"+)"),6I=2r 4y("^("+C+"+)(#)("+C+"+)"),6H=2r 4y("^([#.]?)("+C+"*)");D.1n({6F:{"":H(a,i,m){I m[2]=="*"||D.Y(a,m[2])},"#":H(a,i,m){I a.4K("2t")==m[2]},":":{8D:H(a,i,m){I i<m[3]-0},8C:H(a,i,m){I i>m[3]-0},2V:H(a,i,m){I m[3]-0==i},77:H(a,i,m){I m[3]-0==i},3o:H(a,i){I i==0},3P:H(a,i,m,r){I i==r.K-1},6C:H(a,i){I i%2==0},6B:H(a,i){I i%2},"3o-4w":H(a){I a.1f.40("*")[0]==a},"3P-4w":H(a){I D.2V(a.1f.5U,1,"4D")==a},"8z-4w":H(a){I!D.2V(a.1f.5U,2,"4D")},6S:H(a){I a.1s},4F:H(a){I!a.1s},8y:H(a,i,m){I(a.6N||a.8x||D(a).1r()||"").1i(m[3])>=0},4i:H(a){I"1C"!=a.O&&D.1h(a,"19")!="2P"&&D.1h(a,"5D")!="1C"},1C:H(a){I"1C"==a.O||D.1h(a,"19")=="2P"||D.1h(a,"5D")=="1C"},8v:H(a){I!a.3O},3O:H(a){I a.3O},4M:H(a){I a.4M},3a:H(a){I a.3a||D.1M(a,"3a")},1r:H(a){I"1r"==a.O},5R:H(a){I"5R"==a.O},5A:H(a){I"5A"==a.O},5o:H(a){I"5o"==a.O},3K:H(a){I"3K"==a.O},5m:H(a){I"5m"==a.O},6z:H(a){I"6z"==a.O},6y:H(a){I"6y"==a.O},2p:H(a){I"2p"==a.O||D.Y(a,"2p")},4t:H(a){I/4t|2y|6x|2p/i.11(a.Y)},3Q:H(a,i,m){I D.2u(m[3],a).K},8t:H(a){I/h\\d/i.11(a.Y)},8s:H(a){I D.3G(D.3M,H(b){I a==b.T}).K}}},6w:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,2r 4y("^([:.#]*)("+C+"+)")],3f:H(a,c,b){J d,1u=[];1G(a&&a!=d){d=a;J f=D.1E(a,c,b);a=f.t.1o(/^\\s*,\\s*/,"");1u=b?c=f.r:D.39(1u,f.r)}I 1u},2u:H(t,o){G(1j t!="1W")I[t];G(o&&o.15!=1&&o.15!=9)I[];o=o||S;J d=[o],2w=[],3P,Y;1G(t&&3P!=t){J r=[];3P=t;t=D.3l(t);J l=Q,3k=6J,m=3k.2D(t);G(m){Y=m[1].2m();R(J i=0;d[i];i++)R(J c=d[i].1s;c;c=c.2J)G(c.15==1&&(Y=="*"||c.Y.2m()==Y))r.1A(c);d=r;t=t.1o(3k,"");G(t.1i(" ")==0)6L;l=M}N{3k=/^([>+~])\\s*(\\w*)/i;G((m=3k.2D(t))!=U){r=[];J k={};Y=m[2].2m();m=m[1];R(J j=0,3j=d.K;j<3j;j++){J n=m=="~"||m=="+"?d[j].2J:d[j].1s;R(;n;n=n.2J)G(n.15==1){J g=D.L(n);G(m=="~"&&k[g])1V;G(!Y||n.Y.2m()==Y){G(m=="~")k[g]=M;r.1A(n)}G(m=="+")1V}}d=r;t=D.3l(t.1o(3k,""));l=M}}G(t&&!l){G(!t.1i(",")){G(o==d[0])d.4s();2w=D.39(2w,d);r=d=[o];t=" "+t.6t(1,t.K)}N{J h=6I;J m=h.2D(t);G(m){m=[0,m[2],m[3],m[1]]}N{h=6H;m=h.2D(t)}m[2]=m[2].1o(/\\\\/g,"");J f=d[d.K-1];G(m[1]=="#"&&f&&f.60&&!D.4o(f)){J p=f.60(m[2]);G((D.14.1g||D.14.2H)&&p&&1j p.2t=="1W"&&p.2t!=m[2])p=D(\'[@2t="\'+m[2]+\'"]\',f)[0];d=r=p&&(!m[3]||D.Y(p,m[3]))?[p]:[]}N{R(J i=0;d[i];i++){J a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];G(a=="*"&&d[i].Y.3h()=="3y")a="3A";r=D.39(r,d[i].40(a))}G(m[1]==".")r=D.5l(r,m[2]);G(m[1]=="#"){J e=[];R(J i=0;r[i];i++)G(r[i].4K("2t")==m[2]){e=[r[i]];1V}r=e}d=r}t=t.1o(h,"")}}G(t){J b=D.1E(t,r);d=r=b.r;t=D.3l(b.t)}}G(t)d=[];G(d&&o==d[0])d.4s();2w=D.39(2w,d);I 2w},5l:H(r,m,a){m=" "+m+" ";J c=[];R(J i=0;r[i];i++){J b=(" "+r[i].1D+" ").1i(m)>=0;G(!a&&b||a&&!b)c.1A(r[i])}I c},1E:H(t,r,h){J d;1G(t&&t!=d){d=t;J p=D.6w,m;R(J i=0;p[i];i++){m=p[i].2D(t);G(m){t=t.8r(m[0].K);m[2]=m[2].1o(/\\\\/g,"");1V}}G(!m)1V;G(m[1]==":"&&m[2]=="4W")r=61.11(m[3])?D.1E(m[3],r,M).r:D(r).4W(m[3]);N G(m[1]==".")r=D.5l(r,m[2],h);N G(m[1]=="["){J g=[],O=m[3];R(J i=0,3j=r.K;i<3j;i++){J a=r[i],z=a[D.2L[m[2]]||m[2]];G(z==U||/5x|4e|3a/.11(m[2]))z=D.1M(a,m[2])||\'\';G((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1i(m[5])||O=="$="&&z.6t(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1i(m[5])>=0)^h)g.1A(a)}r=g}N G(m[1]==":"&&m[2]=="2V-4w"){J e={},g=[],11=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2D(m[3]=="6C"&&"2n"||m[3]=="6B"&&"2n+1"||!/\\D/.11(m[3])&&"8q+"+m[3]||m[3]),3o=(11[1]+(11[2]||1))-0,d=11[3]-0;R(J i=0,3j=r.K;i<3j;i++){J j=r[i],1f=j.1f,2t=D.L(1f);G(!e[2t]){J c=1;R(J n=1f.1s;n;n=n.2J)G(n.15==1)n.4r=c++;e[2t]=M}J b=Q;G(3o==0){G(j.4r==d)b=M}N G((j.4r-d)%3o==0&&(j.4r-d)/3o>=0)b=M;G(b^h)g.1A(j)}r=g}N{J f=D.6F[m[1]];G(1j f=="3y")f=f[m[2]];G(1j f=="1W")f=6s("Q||H(a,i){I "+f+";}");r=D.3G(r,H(a,i){I f(a,i,m,r)},h)}}I{r:r,t:t}},4T:H(b,c){J a=[],1u=b[c];1G(1u&&1u!=S){G(1u.15==1)a.1A(1u);1u=1u[c]}I a},2V:H(a,e,c,b){e=e||1;J d=0;R(;a;a=a[c])G(a.15==1&&++d==e)1V;I a},5v:H(n,a){J r=[];R(;n;n=n.2J){G(n.15==1&&n!=a)r.1A(n)}I r}});D.W={17:H(f,i,g,e){G(f.15==3||f.15==8)I;G(D.14.1g&&f.4L)f=1c;G(!g.29)g.29=7.29++;G(e!=12){J h=g;g=7.3J(h,H(){I h.1t(7,1a)});g.L=e}J j=D.L(f,"3x")||D.L(f,"3x",{}),1H=D.L(f,"1H")||D.L(f,"1H",H(){G(1j D!="12"&&!D.W.5j)I D.W.1H.1t(1a.3I.T,1a)});1H.T=f;D.P(i.1Q(/\\s+/),H(c,b){J a=b.1Q(".");b=a[0];g.O=a[1];J d=j[b];G(!d){d=j[b]={};G(!D.W.2C[b]||D.W.2C[b].4q.1l(f)===Q){G(f.4a)f.4a(b,1H,Q);N G(f.6q)f.6q("4p"+b,1H)}}d[g.29]=g;D.W.28[b]=M});f=U},29:1,28:{},1Z:H(e,h,f){G(e.15==3||e.15==8)I;J i=D.L(e,"3x"),1K,5h;G(i){G(h==12||(1j h=="1W"&&h.8p(0)=="."))R(J g 1k i)7.1Z(e,g+(h||""));N{G(h.O){f=h.2o;h=h.O}D.P(h.1Q(/\\s+/),H(b,a){J c=a.1Q(".");a=c[0];G(i[a]){G(f)3d i[a][f.29];N R(f 1k i[a])G(!c[1]||i[a][f].O==c[1])3d i[a][f];R(1K 1k i[a])1V;G(!1K){G(!D.W.2C[a]||D.W.2C[a].4G.1l(e)===Q){G(e.6m)e.6m(a,D.L(e,"1H"),Q);N G(e.6l)e.6l("4p"+a,D.L(e,"1H"))}1K=U;3d i[a]}}})}R(1K 1k i)1V;G(!1K){J d=D.L(e,"1H");G(d)d.T=U;D.3b(e,"3x");D.3b(e,"1H")}}},1R:H(h,c,f,g,i){c=D.2h(c);G(h.1i("!")>=0){h=h.3w(0,-1);J a=M}G(!f){G(7.28[h])D("*").17([1c,S]).1R(h,c)}N{G(f.15==3||f.15==8)I 12;J b,1K,18=D.1F(f[h]||U),W=!c[0]||!c[0].37;G(W){c.6b({O:h,2N:f,37:H(){},3X:H(){},4J:1x()});c[0][E]=M}c[0].O=h;G(a)c[0].6k=M;J d=D.L(f,"1H");G(d)b=d.1t(f,c);G((!18||(D.Y(f,\'a\')&&h=="4n"))&&f["4p"+h]&&f["4p"+h].1t(f,c)===Q)b=Q;G(W)c.4s();G(i&&D.1F(i)){1K=i.1t(f,b==U?c:c.75(b));G(1K!==12)b=1K}G(18&&g!==Q&&b!==Q&&!(D.Y(f,\'a\')&&h=="4n")){7.5j=M;23{f[h]()}21(e){}}7.5j=Q}I b},1H:H(b){J a,1K,2T,5e,4m;b=1a[0]=D.W.6j(b||1c.W);2T=b.O.1Q(".");b.O=2T[0];2T=2T[1];5e=!2T&&!b.6k;4m=(D.L(7,"3x")||{})[b.O];R(J j 1k 4m){J c=4m[j];G(5e||c.O==2T){b.2o=c;b.L=c.L;1K=c.1t(7,1a);G(a!==Q)a=1K;G(1K===Q){b.37();b.3X()}}}I a},2L:"8o 8n 8m 8l 2p 8k 42 5c 6h 5I 8j L 8i 8h 4k 2o 59 58 8e 8c 57 6f 8b 8a 4j 88 87 86 6d 2N 4J 6c O 84 83 2S".1Q(" "),6j:H(b){G(b[E]==M)I b;J c=b;b={82:c};R(J i=7.2L.K,1e;i;){1e=7.2L[--i];b[1e]=c[1e]}b[E]=M;b.37=H(){G(c.37)c.37();c.81=Q};b.3X=H(){G(c.3X)c.3X();c.80=M};b.4J=b.4J||1x();G(!b.2N)b.2N=b.6d||S;G(b.2N.15==3)b.2N=b.2N.1f;G(!b.4j&&b.4k)b.4j=b.4k==b.2N?b.6c:b.4k;G(b.57==U&&b.5c!=U){J a=S.1B,1d=S.1d;b.57=b.5c+(a&&a.2c||1d&&1d.2c||0)-(a.69||0);b.6f=b.6h+(a&&a.2l||1d&&1d.2l||0)-(a.68||0)}G(!b.2S&&((b.42||b.42===0)?b.42:b.59))b.2S=b.42||b.59;G(!b.58&&b.5I)b.58=b.5I;G(!b.2S&&b.2p)b.2S=(b.2p&1?1:(b.2p&2?3:(b.2p&4?2:0)));I b},3J:H(a,b){b.29=a.29=a.29||b.29||7.29++;I b},2C:{25:{4q:H(){54();I},4G:H(){I}},4c:{4q:H(){G(D.14.1g)I Q;D(7).2O("51",D.W.2C.4c.2o);I M},4G:H(){G(D.14.1g)I Q;D(7).3L("51",D.W.2C.4c.2o);I M},2o:H(a){G(F(a,7))I M;a.O="4c";I D.W.1H.1t(7,1a)}},3F:{4q:H(){G(D.14.1g)I Q;D(7).2O("4Z",D.W.2C.3F.2o);I M},4G:H(){G(D.14.1g)I Q;D(7).3L("4Z",D.W.2C.3F.2o);I M},2o:H(a){G(F(a,7))I M;a.O="3F";I D.W.1H.1t(7,1a)}}}};D.18.1n({2O:H(c,a,b){I c=="4Y"?7.2Y(c,a,b):7.P(H(){D.W.17(7,c,b||a,b&&a)})},2Y:H(d,b,c){J e=D.W.3J(c||b,H(a){D(7).3L(a,e);I(c||b).1t(7,1a)});I 7.P(H(){D.W.17(7,d,e,c&&b)})},3L:H(a,b){I 7.P(H(){D.W.1Z(7,a,b)})},1R:H(c,a,b){I 7.P(H(){D.W.1R(c,a,7,M,b)})},5G:H(c,a,b){I 7[0]&&D.W.1R(c,a,7[0],Q,b)},2B:H(b){J c=1a,i=1;1G(i<c.K)D.W.3J(b,c[i++]);I 7.4n(D.W.3J(b,H(a){7.4X=(7.4X||0)%i;a.37();I c[7.4X++].1t(7,1a)||Q}))},7X:H(a,b){I 7.2O(\'4c\',a).2O(\'3F\',b)},25:H(a){54();G(D.2Q)a.1l(S,D);N D.3D.1A(H(){I a.1l(7,D)});I 7}});D.1n({2Q:Q,3D:[],25:H(){G(!D.2Q){D.2Q=M;G(D.3D){D.P(D.3D,H(){7.1l(S)});D.3D=U}D(S).5G("25")}}});J x=Q;H 54(){G(x)I;x=M;G(S.4a&&!D.14.2H)S.4a("67",D.25,Q);G(D.14.1g&&1c==1P)(H(){G(D.2Q)I;23{S.1B.7W("1z")}21(3g){3E(1a.3I,0);I}D.25()})();G(D.14.2H)S.4a("67",H(){G(D.2Q)I;R(J i=0;i<S.4V.K;i++)G(S.4V[i].3O){3E(1a.3I,0);I}D.25()},Q);G(D.14.2f){J a;(H(){G(D.2Q)I;G(S.3i!="66"&&S.3i!="1O"){3E(1a.3I,0);I}G(a===12)a=D("V, 7z[7U=7T]").K;G(S.4V.K!=a){3E(1a.3I,0);I}D.25()})()}D.W.17(1c,"3Y",D.25)}D.P(("7S,7R,3Y,7Q,4A,4Y,4n,7P,"+"89,7O,7N,51,4Z,7M,2y,"+"5m,8d,7L,7K,3g").1Q(","),H(i,b){D.18[b]=H(a){I a?7.2O(b,a):7.1R(b)}});J F=H(a,c){J b=a.4j;1G(b&&b!=c)23{b=b.1f}21(3g){b=c}I b==c};D(1c).2O("4Y",H(){D("*").17(S).3L()});D.18.1n({6e:D.18.3Y,3Y:H(g,d,c){G(1j g!=\'1W\')I 7.6e(g);J e=g.1i(" ");G(e>=0){J i=g.3w(e,g.K);g=g.3w(0,e)}c=c||H(){};J f="2R";G(d)G(D.1F(d)){c=d;d=U}N G(1j d==\'3y\'){d=D.3A(d);f="7J"}J h=7;D.3T({1b:g,O:f,1L:"2I",L:d,1O:H(a,b){G(b=="1U"||b=="7I")h.2I(i?D("<1w/>").3s(a.4U.1o(/<1m(.|\\s)*?\\/1m>/g,"")).2u(i):a.4U);h.P(c,[a.4U,b,a])}});I 7},aL:H(){I D.3A(7.7H())},7H:H(){I 7.2i(H(){I D.Y(7,"45")?D.2h(7.aK):7}).1E(H(){I 7.32&&!7.3O&&(7.4M||/2y|6x/i.11(7.Y)||/1r|1C|3K/i.11(7.O))}).2i(H(i,c){J b=D(7).6a();I b==U?U:b.1q==2q?D.2i(b,H(a,i){I{32:c.32,2s:a}}):{32:c.32,2s:b}}).3p()}});D.P("7G,7D,7C,7B,6u,7A".1Q(","),H(i,o){D.18[o]=H(f){I 7.2O(o,f)}});J B=1x();D.1n({3p:H(d,b,a,c){G(D.1F(b)){a=b;b=U}I D.3T({O:"2R",1b:d,L:b,1U:a,1L:c})},aG:H(b,a){I D.3p(b,U,a,"1m")},aF:H(c,b,a){I D.3p(c,b,a,"3B")},aD:H(d,b,a,c){G(D.1F(b)){a=b;b={}}I D.3T({O:"7J",1b:d,L:b,1U:a,1L:c})},aC:H(a){D.1n(D.5Z,a)},5Z:{1b:5Y.5x,28:M,O:"2R",2W:0,7y:"4x/x-ay-45-ax",7v:M,31:M,L:U,5r:U,3K:U,4z:{2K:"4x/2K, 1r/2K",2I:"1r/2I",1m:"1r/4v, 4x/4v",3B:"4x/3B, 1r/4v",1r:"1r/as",4S:"*/*"}},4R:{},3T:H(s){s=D.1n(M,s,D.1n(M,{},D.5Z,s));J g,33=/=\\?(&|$)/g,1v,L,O=s.O.2m();G(s.L&&s.7v&&1j s.L!="1W")s.L=D.3A(s.L);G(s.1L=="4Q"){G(O=="2R"){G(!s.1b.1I(33))s.1b+=(s.1b.1I(/\\?/)?"&":"?")+(s.4Q||"7s")+"=?"}N G(!s.L||!s.L.1I(33))s.L=(s.L?s.L+"&":"")+(s.4Q||"7s")+"=?";s.1L="3B"}G(s.1L=="3B"&&(s.L&&s.L.1I(33)||s.1b.1I(33))){g="4Q"+B++;G(s.L)s.L=(s.L+"").1o(33,"="+g+"$1");s.1b=s.1b.1o(33,"="+g+"$1");s.1L="1m";1c[g]=H(a){L=a;1U();1O();1c[g]=12;23{3d 1c[g]}21(e){}G(i)i.30(h)}}G(s.1L=="1m"&&s.1Y==U)s.1Y=Q;G(s.1Y===Q&&O=="2R"){J j=1x();J k=s.1b.1o(/(\\?|&)3n=.*?(&|$)/,"$am="+j+"$2");s.1b=k+((k==s.1b)?(s.1b.1I(/\\?/)?"&":"?")+"3n="+j:"")}G(s.L&&O=="2R"){s.1b+=(s.1b.1I(/\\?/)?"&":"?")+s.L;s.L=U}G(s.28&&!D.4P++)D.W.1R("7G");J n=/^(?:\\w+:)?\\/\\/([^\\/?#]+)/;G(s.1L=="1m"&&O=="2R"&&n.11(s.1b)&&n.2D(s.1b)[1]!=5Y.ak){J i=S.40("6v")[0];J h=S.3t("1m");h.4e=s.1b;G(s.7r)h.ai=s.7r;G(!g){J l=Q;h.ag=h.af=H(){G(!l&&(!7.3i||7.3i=="66"||7.3i=="1O")){l=M;1U();1O();i.30(h)}}}i.49(h);I 12}J m=Q;J c=1c.7q?2r 7q("ad.ac"):2r 6Q();G(s.5r)c.7o(O,s.1b,s.31,s.5r,s.3K);N c.7o(O,s.1b,s.31);23{G(s.L)c.4O("ab-aa",s.7y);G(s.5T)c.4O("a9-5S-a8",D.4R[s.1b]||"a7, a6 a4 a3 5O:5O:5O a1");c.4O("X-a0-9Y","6Q");c.4O("9X",s.1L&&s.4z[s.1L]?s.4z[s.1L]+", */*":s.4z.4S)}21(e){}G(s.7k&&s.7k(c,s)===Q){s.28&&D.4P--;c.7j();I Q}G(s.28)D.W.1R("7A",[c,s]);J d=H(a){G(!m&&c&&(c.3i==4||a=="2W")){m=M;G(f){7h(f);f=U}1v=a=="2W"?"2W":!D.7g(c)?"3g":s.5T&&D.7f(c,s.1b)?"7I":"1U";G(1v=="1U"){23{L=D.6U(c,s.1L,s.9S)}21(e){1v="5L"}}G(1v=="1U"){J b;23{b=c.5K("7e-5S")}21(e){}G(s.5T&&b)D.4R[s.1b]=b;G(!g)1U()}N D.5E(s,c,1v);1O();G(s.31)c=U}};G(s.31){J f=4L(d,13);G(s.2W>0)3E(H(){G(c){c.7j();G(!m)d("2W")}},s.2W)}23{c.9R(s.L)}21(e){D.5E(s,c,U,e)}G(!s.31)d();H 1U(){G(s.1U)s.1U(L,1v);G(s.28)D.W.1R("6u",[c,s])}H 1O(){G(s.1O)s.1O(c,1v);G(s.28)D.W.1R("7C",[c,s]);G(s.28&&!--D.4P)D.W.1R("7D")}I c},5E:H(s,a,b,e){G(s.3g)s.3g(a,b,e);G(s.28)D.W.1R("7B",[a,s,e])},4P:0,7g:H(a){23{I!a.1v&&5Y.9Q=="5o:"||(a.1v>=7c&&a.1v<9O)||a.1v==7a||a.1v==9N||D.14.2f&&a.1v==12}21(e){}I Q},7f:H(a,c){23{J b=a.5K("7e-5S");I a.1v==7a||b==D.4R[c]||D.14.2f&&a.1v==12}21(e){}I Q},6U:H(a,c,b){J d=a.5K("9L-O"),2K=c=="2K"||!c&&d&&d.1i("2K")>=0,L=2K?a.9K:a.4U;G(2K&&L.1B.2g=="5L")7m"5L";G(b)L=b(L,c);G(c=="1m")D.5u(L);G(c=="3B")L=6s("("+L+")");I L},3A:H(a){J s=[];H 17(b,a){s[s.K]=78(b)+\'=\'+78(a)};G(a.1q==2q||a.5w)D.P(a,H(){17(7.32,7.2s)});N R(J j 1k a)G(a[j]&&a[j].1q==2q)D.P(a[j],H(){17(j,7)});N 17(j,D.1F(a[j])?a[j]():a[j]);I s.6r("&").1o(/%20/g,"+")}});D.18.1n({1N:H(c,b){I c?7.2j({1T:"1N",2d:"1N",1y:"1N"},c,b):7.1E(":1C").P(H(){7.V.19=7.5H||"";G(D.1h(7,"19")=="2P"){J a=D("<"+7.2g+" />").6O("1d");7.V.19=a.1h("19");G(7.V.19=="2P")7.V.19="3H";a.1Z()}}).3m()},1J:H(b,a){I b?7.2j({1T:"1J",2d:"1J",1y:"1J"},b,a):7.1E(":4i").P(H(){7.5H=7.5H||D.1h(7,"19");7.V.19="2P"}).3m()},76:D.18.2B,2B:H(a,b){I D.1F(a)&&D.1F(b)?7.76.1t(7,1a):a?7.2j({1T:"2B",2d:"2B",1y:"2B"},a,b):7.P(H(){D(7)[D(7).3C(":1C")?"1N":"1J"]()})},9J:H(b,a){I 7.2j({1T:"1N"},b,a)},9I:H(b,a){I 7.2j({1T:"1J"},b,a)},9H:H(b,a){I 7.2j({1T:"2B"},b,a)},9G:H(b,a){I 7.2j({1y:"1N"},b,a)},9F:H(b,a){I 7.2j({1y:"1J"},b,a)},9D:H(c,a,b){I 7.2j({1y:a},c,b)},2j:H(k,j,i,g){J h=D.74(j,i,g);I 7[h.35===Q?"P":"35"](H(){G(7.15!=1)I Q;J f=D.1n({},h),p,1C=D(7).3C(":1C"),41=7;R(p 1k k){G(k[p]=="1J"&&1C||k[p]=="1N"&&!1C)I f.1O.1l(7);G(p=="1T"||p=="2d"){f.19=D.1h(7,"19");f.34=7.V.34}}G(f.34!=U)7.V.34="1C";f.44=D.1n({},k);D.P(k,H(c,a){J e=2r D.27(41,f,c);G(/2B|1N|1J/.11(a))e[a=="2B"?1C?"1N":"1J":a](k);N{J b=a.6p().1I(/^([+-]=)?([\\d+-.]+)(.*)$/),2b=e.1u(M)||0;G(b){J d=3e(b[2]),2M=b[3]||"2U";G(2M!="2U"){41.V[c]=(d||1)+2M;2b=((d||1)/e.1u(M))*2b;41.V[c]=2b+2M}G(b[1])d=((b[1]=="-="?-1:1)*d)+2b;e.3Z(2b,d,2M)}N e.3Z(2b,a,"")}});I M})},35:H(a,b){G(D.1F(a)||(a&&a.1q==2q)){b=a;a="27"}G(!a||(1j a=="1W"&&!b))I A(7[0],a);I 7.P(H(){G(b.1q==2q)A(7,a,b);N{A(7,a).1A(b);G(A(7,a).K==1)b.1l(7)}})},9x:H(b,c){J a=D.3M;G(b)7.35([]);7.P(H(){R(J i=a.K-1;i>=0;i--)G(a[i].T==7){G(c)a[i](M);a.7l(i,1)}});G(!c)7.5C();I 7}});J A=H(b,c,a){G(b){c=c||"27";J q=D.L(b,c+"35");G(!q||a)q=D.L(b,c+"35",D.2h(a))}I q};D.18.5C=H(a){a=a||"27";I 7.P(H(){J q=A(7,a);q.4s();G(q.K)q[0].1l(7)})};D.1n({74:H(b,a,c){J d=b&&b.1q==9u?b:{1O:c||!c&&a||D.1F(b)&&b,2v:b,3U:c&&a||a&&a.1q!=9t&&a};d.2v=(d.2v&&d.2v.1q==4N?d.2v:D.27.5N[d.2v])||D.27.5N.71;d.5P=d.1O;d.1O=H(){G(d.35!==Q)D(7).5C();G(D.1F(d.5P))d.5P.1l(7)};I d},3U:{7n:H(p,n,b,a){I b+a*p},5Q:H(p,n,b,a){I((-26.9r(p*26.9q)/2)+0.5)*a+b}},3M:[],46:U,27:H(b,c,a){7.16=c;7.T=b;7.1e=a;G(!c.3R)c.3R={}}});D.27.3V={4E:H(){G(7.16.2Z)7.16.2Z.1l(7.T,7.1x,7);(D.27.2Z[7.1e]||D.27.2Z.4S)(7);G(7.1e=="1T"||7.1e=="2d")7.T.V.19="3H"},1u:H(a){G(7.T[7.1e]!=U&&7.T.V[7.1e]==U)I 7.T[7.1e];J r=3e(D.1h(7.T,7.1e,a));I r&&r>-9p?r:3e(D.24(7.T,7.1e))||0},3Z:H(c,b,d){7.5B=1x();7.2b=c;7.3m=b;7.2M=d||7.2M||"2U";7.1x=7.2b;7.36=7.4C=0;7.4E();J e=7;H t(a){I e.2Z(a)}t.T=7.T;D.3M.1A(t);G(D.46==U){D.46=4L(H(){J a=D.3M;R(J i=0;i<a.K;i++)G(!a[i]())a.7l(i--,1);G(!a.K){7h(D.46);D.46=U}},13)}},1N:H(){7.16.3R[7.1e]=D.1M(7.T.V,7.1e);7.16.1N=M;7.3Z(0,7.1u());G(7.1e=="2d"||7.1e=="1T")7.T.V[7.1e]="9l";D(7.T).1N()},1J:H(){7.16.3R[7.1e]=D.1M(7.T.V,7.1e);7.16.1J=M;7.3Z(7.1u(),0)},2Z:H(a){J t=1x();G(a||t>7.16.2v+7.5B){7.1x=7.3m;7.36=7.4C=1;7.4E();7.16.44[7.1e]=M;J b=M;R(J i 1k 7.16.44)G(7.16.44[i]!==M)b=Q;G(b){G(7.16.19!=U){7.T.V.34=7.16.34;7.T.V.19=7.16.19;G(D.1h(7.T,"19")=="2P")7.T.V.19="3H"}G(7.16.1J)7.T.V.19="2P";G(7.16.1J||7.16.1N)R(J p 1k 7.16.44)D.1M(7.T.V,p,7.16.3R[p])}G(b)7.16.1O.1l(7.T);I Q}N{J n=t-7.5B;7.4C=n/7.16.2v;7.36=D.3U[7.16.3U||(D.3U.5Q?"5Q":"7n")](7.4C,n,0,1,7.16.2v);7.1x=7.2b+((7.3m-7.2b)*7.36);7.4E()}I M}};D.1n(D.27,{5N:{9k:9i,an:7c,71:ao},2Z:{2c:H(a){a.T.2c=a.1x},2l:H(a){a.T.2l=a.1x},1y:H(a){D.1M(a.T.V,"1y",a.1x)},4S:H(a){a.T.V[a.1e]=a.1x+a.2M}}});D.18.2k=H(){J b=0,1P=0,T=7[0],3q;G(T)9f(D.14){J d=T.1f,48=T,1p=T.1p,1S=T.2z,5V=2f&&3v(5F)<9c&&!/aw/i.11(v),1h=D.24,2X=1h(T,"3c")=="2X";G(!(3r&&T==S.1d)&&T.6T){J c=T.6T();17(c.1z+26.2e(1S.1B.2c,1S.1d.2c),c.1P+26.2e(1S.1B.2l,1S.1d.2l));17(-1S.1B.69,-1S.1B.68)}N{17(T.5X,T.5z);1G(1p){17(1p.5X,1p.5z);G(3r&&!/^t(98|d|h)$/i.11(1p.2g)||2f&&!5V)2A(1p);G(!2X&&1h(1p,"3c")=="2X")2X=M;48=/^1d$/i.11(1p.2g)?48:1p;1p=1p.1p}1G(d&&d.2g&&!/^1d|2I$/i.11(d.2g)){G(!/^97|1X.*$/i.11(1h(d,"19")))17(-d.2c,-d.2l);G(3r&&1h(d,"34")!="4i")2A(d);d=d.1f}G((5V&&(2X||1h(48,"3c")=="5g"))||(3r&&1h(48,"3c")!="5g"))17(-1S.1d.5X,-1S.1d.5z);G(2X)17(26.2e(1S.1B.2c,1S.1d.2c),26.2e(1S.1B.2l,1S.1d.2l))}3q={1P:1P,1z:b}}H 2A(a){17(D.24(a,"7w",M),D.24(a,"7x",M))}H 17(l,t){b+=3v(l,10)||0;1P+=3v(t,10)||0}I 3q};D.18.1n({3c:H(){J a=0,1P=0,3q;G(7[0]){J b=7.1p(),2k=7.2k(),4b=/^1d|2I$/i.11(b[0].2g)?{1P:0,1z:0}:b.2k();2k.1P-=2a(7,\'95\');2k.1z-=2a(7,\'94\');4b.1P+=2a(b,\'7x\');4b.1z+=2a(b,\'7w\');3q={1P:2k.1P-4b.1P,1z:2k.1z-4b.1z}}I 3q},1p:H(){J a=7[0].1p;1G(a&&(!/^1d|2I$/i.11(a.2g)&&D.1h(a,\'3c\')==\'aI\'))a=a.1p;I D(a)}});D.P([\'5d\',\'5b\'],H(i,b){J c=\'4A\'+b;D.18[c]=H(a){G(!7[0])I;I a!=12?7.P(H(){7==1c||7==S?1c.aJ(!i?a:D(1c).2c(),i?a:D(1c).2l()):7[c]=a}):7[0]==1c||7[0]==S?41[i?\'92\':\'91\']||D.6Y&&S.1B[c]||S.1d[c]:7[0][c]}});D.P(["6M","47"],H(i,b){J c=i?"5d":"5b",43=i?"6i":"6g";D.18["5s"+b]=H(){I 7[b.3h()]()+2a(7,"55"+c)+2a(7,"55"+43)};D.18["aM"+b]=H(a){I 7["5s"+b]()+2a(7,"2A"+c+"47")+2a(7,"2A"+43+"47")+(a?2a(7,"7F"+c)+2a(7,"7F"+43):0)}})})();',62,671,'|||||||this|||||||||||||||||||||||||||||||||||if|function|return|var|length|data|true|else|type|each|false|for|document|elem|null|style|event||nodeName|||test|undefined||browser|nodeType|options|add|fn|display|arguments|url|window|body|prop|parentNode|msie|css|indexOf|typeof|in|call|script|extend|replace|offsetParent|constructor|text|firstChild|apply|cur|status|div|now|opacity|left|push|documentElement|hidden|className|filter|isFunction|while|handle|match|hide|ret|dataType|attr|show|complete|top|split|trigger|doc|height|success|break|string|table|cache|remove||catch|tbody|try|curCSS|ready|Math|fx|global|guid|num|start|scrollLeft|width|max|safari|tagName|makeArray|map|animate|offset|scrollTop|toUpperCase||handler|button|Array|new|value|id|find|duration|done|copy|select|ownerDocument|border|toggle|special|exec|inArray|pushStack|stack|opera|html|nextSibling|xml|props|unit|target|bind|none|isReady|GET|which|namespace|px|nth|timeout|fixed|one|step|removeChild|async|name|jsre|overflow|queue|pos|preventDefault|insertBefore|merge|selected|removeData|position|delete|parseFloat|multiFilter|error|toLowerCase|readyState|rl|re|trim|end|_|first|get|results|mozilla|append|createElement|childNodes|parseInt|slice|events|object|elems|param|json|is|readyList|setTimeout|mouseleave|grep|block|callee|proxy|password|unbind|timers|defaultView|disabled|last|has|orig|domManip|ajax|easing|prototype|set|stopPropagation|load|custom|getElementsByTagName|self|charCode|br|curAnim|form|timerId|Width|offsetChild|appendChild|addEventListener|parentOffset|mouseenter|color|src|currentStyle|float|clean|visible|relatedTarget|fromElement|innerHTML|handlers|click|isXMLDoc|on|setup|nodeIndex|shift|input|unique|javascript|child|application|RegExp|accepts|scroll|deep|state|previousSibling|update|empty|teardown|tr|jQuery|timeStamp|getAttribute|setInterval|checked|Number|setRequestHeader|active|jsonp|lastModified|_default|dir|responseText|styleSheets|not|lastToggle|unload|mouseout|outline|mouseover|getPropertyValue|getComputedStyle|bindReady|padding|String|pageX|metaKey|keyCode|getWH|Top|clientX|Left|all|container|absolute|index|init|triggered|removeAttribute|classFilter|submit|prevObject|file|after|windowData|username|inner|client|globalEval|sibling|jquery|href|clone|offsetTop|checkbox|startTime|dequeue|visibility|handleError|version|triggerHandler|oldblock|ctrlKey|createTextNode|getResponseHeader|parsererror|andSelf|speeds|00|old|swing|radio|Modified|ifModified|lastChild|safari2|wrapAll|offsetLeft|location|ajaxSettings|getElementById|isSimple|values|selectedIndex|runtimeStyle|rsLeft|loaded|DOMContentLoaded|clientTop|clientLeft|val|unshift|toElement|srcElement|_load|pageY|Bottom|clientY|Right|fix|exclusive|detachEvent|removeEventListener|cloneNode|swap|toString|attachEvent|join|eval|substr|ajaxSuccess|head|parse|textarea|reset|image|zoom|odd|even|before|prepend|expr|exclude|quickClass|quickID|quickChild|uuid|continue|Height|textContent|appendTo|contents|XMLHttpRequest|evalScript|parent|getBoundingClientRect|httpData|setArray|CSS1Compat|compatMode|boxModel|cssFloat|styleFloat|def|webkit|nodeValue|speed|concat|_toggle|eq|encodeURIComponent|100|304|replaceWith|200|alpha|Last|httpNotModified|httpSuccess|clearInterval|getAttributeNode|abort|beforeSend|splice|throw|linear|open|colgroup|ActiveXObject|scriptCharset|callback|fieldset|multiple|processData|borderLeftWidth|borderTopWidth|contentType|link|ajaxSend|ajaxError|ajaxComplete|ajaxStop|col|margin|ajaxStart|serializeArray|notmodified|POST|keyup|keypress|change|mousemove|mouseup|dblclick|resize|focus|blur|stylesheet|rel|hasClass|doScroll|hover|black|solid|cancelBubble|returnValue|originalEvent|wheelDelta|view|round|shiftKey|screenY|screenX|mousedown|relatedNode|prevValue|originalTarget|keydown|newValue|offsetHeight|offsetWidth|eventPhase|detail|currentTarget|cancelable|bubbles|attrName|attrChange|altKey|charAt|0n|substring|animated|header|noConflict|enabled|line|innerText|contains|only|weight|font|gt|lt|uFFFF|u0128|417|size|Boolean|toggleClass|Date|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|contentWindow|wrap|contentDocument|iframe|children|siblings|prevAll|nextAll|wrapInner|prev|pageXOffset|pageYOffset|next|marginLeft|marginTop|parents|inline|able|rowSpan|rowspan|cellSpacing|522|cellspacing|maxLength|with|maxlength|readOnly|600|readonly|slow|1px|class|htmlFor|reverse|10000|PI|cos|compatible|Function|Object|setData|ie|stop|ra|it|rv|getData|userAgent|fadeTo|navigator|fadeOut|fadeIn|slideToggle|slideUp|slideDown|responseXML|content|ig|1223|300|NaN|protocol|send|dataFilter|setAttribute|option|cssText|changed|Accept|With|be|Requested|GMT|can|1970|Jan|property|01|Thu|Since|If|Type|Content|XMLHTTP|Microsoft|th|onreadystatechange|onload|td|charset|cap|host|colg|1_|fast|400|tfoot|specified|thead|plain|leg|attributes|opt|adobeair|urlencoded|www|embed|area|hr|ajaxSetup|post|meta|getJSON|getScript|img|static|scrollTo|elements|serialize|outer|abbr|pixelLeft'.split('|'),0,{}));jQuery.noConflict();
diff --git a/wp-includes/js/jquery/suggest.js b/wp-includes/js/jquery/suggest.js
index f01d28c..d0f4578 100644
--- a/wp-includes/js/jquery/suggest.js
+++ b/wp-includes/js/jquery/suggest.js
@@ -309,4 +309,4 @@
};
-})(jQuery);
+})(jQuery); \ No newline at end of file
diff --git a/wp-includes/js/jquery/ui.core.js b/wp-includes/js/jquery/ui.core.js
new file mode 100644
index 0000000..7a07cef
--- /dev/null
+++ b/wp-includes/js/jquery/ui.core.js
@@ -0,0 +1,2 @@
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(3(C){C.8={2t:{1o:3(E,F,H){6 G=C.8[E].m;1v(6 D 2s H){G.u[D]=G.u[D]||[];G.u[D].2r([F,H[D]])}},1n:3(D,F,E){6 H=D.u[F];5(!H){4}1v(6 G=0;G<H.2q;G++){5(D.a[H[G][0]]){H[G][1].r(D.c,E)}}}},n:{},f:3(D){5(C.8.n[D]){4 C.8.n[D]}6 E=C(\'<2p 2o="8-2n-2m">\').1i(D).f({2l:"2k",11:"-1u",2j:"-1u",2i:"2h"}).2g("1t");C.8.n[D]=!!((!(/2f|2e/).h(E.f("2d"))||(/^[1-9]/).h(E.f("2c"))||(/^[1-9]/).h(E.f("2b"))||!(/1r/).h(E.f("2a"))||!(/29|28\\(0, 0, 0, 0\\)/).h(E.f("27"))));26{C("1t").1s(0).25(E.1s(0))}24(F){}4 C.8.n[D]},23:3(D){D.j="1g";D.1q=3(){4 7};5(D.t){D.t.1p="1r"}},22:3(D){D.j="21";D.1q=3(){4 d};5(D.t){D.t.1p=""}},20:3(G,E){6 D=/11/.h(E||"11")?"1Z":"1Y",F=7;5(G[D]>0){4 d}G[D]=1;F=G[D]>0?d:7;G[D]=0;4 F}};6 B=C.Z.q;C.Z.q=3(){C("*",2).1o(2).1X("q");4 B.r(2,1m)};3 A(E,F,G){6 D=C[E][F].1W||[];D=(U D=="T"?D.10(/,?\\s+/):D);4(C.1V(G,D)!=-1)}C.X=3(E,D){6 F=E.10(".")[0];E=E.10(".")[1];C.Z[E]=3(J){6 H=(U J=="T"),I=1U.m.1T.1n(1m,1);5(H&&A(F,E,J)){6 G=C.Y(2[0],E);4(G?G[J].r(G,I):1S)}4 2.1R(3(){6 K=C.Y(2,E);5(H&&K&&C.1Q(K[J])){K[J].r(K,I)}1P{5(!H){C.Y(2,E,1O C[F][E](2,J))}}})};C[F][E]=3(I,H){6 G=2;2.e=E;2.1h=F+"-"+E;2.a=C.1l({k:7},C[F][E].13,H);2.c=C(I).g("l."+E,3(L,J,K){4 G.l(J,K)}).g("W."+E,3(K,J){4 G.W(J)}).g("q",3(){4 G.1j()});2.1k()};C[F][E].m=C.1l({},C.X.m,D)};C.X.m={1k:3(){},1j:3(){2.c.1N(2.e)},W:3(D){4 2.a[D]},l:3(D,E){2.a[D]=E;5(D=="k"){2.c[E?"1i":"1M"](2.1h+"-k")}},1L:3(){2.l("k",7)},1K:3(){2.l("k",d)}};C.8.14={1J:3(){6 D=2;2.c.g("1I."+2.e,3(E){4 D.1e(E)});5(C.S.R){2.1f=2.c.V("j");2.c.V("j","1g")}2.1H=7},1G:3(){2.c.P("."+2.e);(C.S.R&&2.c.V("j",2.1f))},1e:3(F){(2.b&&2.i(F));2.p=F;6 E=2,G=(F.1F==1),D=(U 2.a.w=="T"?C(F.1E).1D(2.a.w):7);5(!G||D||!2.15(F)){4 d}2.o=!2.a.v;5(!2.o){2.1C=1B(3(){E.o=d},2.a.v)}5(2.N(F)&&2.z(F)){2.b=(2.y(F)!==7);5(!2.b){F.1A();4 d}}2.Q=3(H){4 E.1d(H)};2.O=3(H){4 E.i(H)};C(1c).g("1b."+2.e,2.Q).g("1a."+2.e,2.O);4 7},1d:3(D){5(C.S.R&&!D.1z){4 2.i(D)}5(2.b){2.x(D);4 7}5(2.N(D)&&2.z(D)){2.b=(2.y(2.p,D)!==7);(2.b?2.x(D):2.i(D))}4!2.b},i:3(D){C(1c).P("1b."+2.e,2.Q).P("1a."+2.e,2.O);5(2.b){2.b=7;2.16(D)}4 7},N:3(D){4(M.1y(M.18(2.p.19-D.19),M.18(2.p.17-D.17))>=2.a.12)},z:3(D){4 2.o},y:3(D){},x:3(D){},16:3(D){},15:3(D){4 d}};C.8.14.13={w:1x,12:1,v:0}})(1w)',62,154,'||this|function|return|if|var|false|ui||options|_mouseStarted|element|true|widgetName|css|bind|test|mouseUp|unselectable|disabled|setData|prototype|cssCache|_mouseDelayMet|_mouseDownEvent|remove|apply||style|plugins|delay|cancel|mouseDrag|mouseStart|mouseDelayMet|||||||||||||Math|mouseDistanceMet|_mouseUpDelegate|unbind|_mouseMoveDelegate|msie|browser|string|typeof|attr|getData|widget|data|fn|split|top|distance|defaults|mouse|mouseCapture|mouseStop|pageY|abs|pageX|mouseup|mousemove|document|mouseMove|mouseDown|_mouseUnselectable|on|widgetBaseClass|addClass|destroy|init|extend|arguments|call|add|MozUserSelect|onselectstart|none|get|body|5000px|for|jQuery|null|max|button|preventDefault|setTimeout|_mouseDelayTimer|is|target|which|mouseDestroy|started|mousedown|mouseInit|disable|enable|removeClass|removeData|new|else|isFunction|each|undefined|slice|Array|inArray|getter|trigger|scrollLeft|scrollTop|hasScroll|off|enableSelection|disableSelection|catch|removeChild|try|backgroundColor|rgba|transparent|backgroundImage|width|height|cursor|default|auto|appendTo|block|display|left|absolute|position|gen|resizable|class|div|length|push|in|plugin'.split('|'),0,{}))
+
diff --git a/wp-includes/js/jquery/ui.sortable.js b/wp-includes/js/jquery/ui.sortable.js
new file mode 100644
index 0000000..4d4d308
--- /dev/null
+++ b/wp-includes/js/jquery/ui.sortable.js
@@ -0,0 +1,2 @@
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(b(B){b A(E,D){9 C=B.2Q.3T&&B.2Q.3S<3R;5(E.2P&&!C){c E.2P(D)}5(E.2O){c!!(E.2O(D)&16)}1O(D=D.1g){5(D==E){c W}}c w}B.3Q("k.o",B.2f(B.k.3P,{3O:b(){9 C=4.6;4.O={};4.g.24("k-o");4.25();4.13=4.f.z?(/7|23/).17(4.f[0].v.e("3N")):w;5(!(/(2N|1s|3M)/).17(4.g.e("Y"))){4.g.e("Y","2N")}4.a=4.g.a();4.3L()},3K:{},k:b(C){c{l:(C||4)["l"],q:(C||4)["q"]||B([]),Y:(C||4)["Y"],3J:(C||4)["1b"],6:4.6,g:4.g,v:(C||4)["j"],3I:C?C.g:X}},t:b(F,E,C,D){B.k.1o.14(4,F,[E,4.k(C)]);5(!D){4.g.3H(F=="1z"?F:"1z"+F,[E,4.k(C)],4.6[F])}},2e:b(E){9 C=(B.1L(4.6.f)?4.6.f.14(4.g):B(4.6.f,4.g)).1F(".k-o-l");9 D=[];E=E||{};C.1v(b(){9 F=(B(4).2L(E.3G||"2K")||"").3F(E.3E||(/(.+)[-=3D](.+)/));5(F){D.1w((E.2M||F[1])+"[]="+(E.2M?F[1]:F[2]))}});c D.3C("&")},2d:b(C){9 D=(B.1L(4.6.f)?4.6.f.14(4.g):B(4.6.f,4.g)).1F(".k-o-l");9 E=[];D.1v(b(){E.1w(B(4).2L(C||"2K"))});c E},2F:b(J){9 E=4.1b.7,D=E+4.r.m,I=4.1b.8,H=I+4.r.n;9 F=J.7,C=F+J.m,K=J.8,G=K+J.n;5(4.6.1r=="2J"||(4.6.1r=="1S"&&4.r[4.13?"m":"n"]>J[4.13?"m":"n"])){c(I+4.a.p.8>K&&I+4.a.p.8<G&&E+4.a.p.7>F&&E+4.a.p.7<C)}Z{c(F<E+(4.r.m/2)&&D-(4.r.m/2)<C&&K<I+(4.r.n/2)&&H-(4.r.n/2)<G)}},2s:b(J){9 E=4.1b.7,D=E+4.r.m,I=4.1b.8,H=I+4.r.n;9 F=J.7,C=F+J.m,K=J.8,G=K+J.n;5(4.6.1r=="2J"||(4.6.1r=="1S"&&4.r[4.13?"m":"n"]>J[4.13?"m":"n"])){5(!(I+4.a.p.8>K&&I+4.a.p.8<G&&E+4.a.p.7>F&&E+4.a.p.7<C)){c w}5(4.13){5(E+4.a.p.7>F&&E+4.a.p.7<F+J.m/2){c 2}5(E+4.a.p.7>F+J.m/2&&E+4.a.p.7<C){c 1}}Z{5(I+4.a.p.8>K&&I+4.a.p.8<K+J.n/2){c 2}5(I+4.a.p.8>K+J.n/2&&I+4.a.p.8<G){c 1}}}Z{5(!(F<E+(4.r.m/2)&&D-(4.r.m/2)<C&&K<I+(4.r.n/2)&&H-(4.r.n/2)<G)){c w}5(4.13){5(D>F&&E<F){c 2}5(E<C&&D>C){c 1}}Z{5(H>K&&I<K){c 1}5(I<G&&H>G){c 2}}}c w},25:b(){4.2I();4.1T()},2I:b(){4.f=[];4.d=[4];9 C=4.f;9 E=[B.1L(4.6.f)?4.6.f.14(4.g):B(4.6.f,4.g)];5(4.6.28){P(9 F=4.6.28.z-1;F>=0;F--){9 H=B(4.6.28[F]);P(9 D=H.z-1;D>=0;D--){9 G=B.1f(H[D],"o");5(G&&!G.6.27){E.1w(B.1L(G.6.f)?G.6.f.14(G.g):B(G.6.f,G.g));4.d.1w(G)}}}}P(9 F=E.z-1;F>=0;F--){E[F].1v(b(){B.1f(4,"o-v",W);C.1w({v:B(4),m:0,n:0,7:0,8:0})})}},1T:b(C){P(9 E=4.f.z-1;E>=0;E--){9 D=4.f[E].v;5(!C){4.f[E].m=(4.6.1l?B(4.6.1l,D):D).1u()}5(!C){4.f[E].n=(4.6.1l?B(4.6.1l,D):D).1t()}9 F=(4.6.1l?B(4.6.1l,D):D).a();4.f[E].7=F.7;4.f[E].8=F.8}P(9 E=4.d.z-1;E>=0;E--){9 F=4.d[E].g.a();4.d[E].O.7=F.7;4.d[E].O.8=F.8;4.d[E].O.m=4.d[E].g.1u();4.d[E].O.n=4.d[E].g.1t()}},3B:b(){4.g.3A("k-o k-o-27").2H("o").3z(".o");4.3y();P(9 C=4.f.z-1;C>=0;C--){4.f[C].v.2H("o-v")}},1Z:b(E){9 C=E||4,F=C.6;5(F.q.3x==3w){9 D=F.q;F.q={g:b(){c B("<2G></2G>").24(D)[0]},1i:b(G,H){H.e(G.a()).e({m:G.1u(),n:G.1t()})}}}C.q=B(F.q.g.14(C.g,C.j)).1q("S").e({Y:"1s"});F.q.1i.14(C.g,C.j,C.q)},2q:b(F){P(9 D=4.d.z-1;D>=0;D--){5(4.2F(4.d[D].O)){5(!4.d[D].O.1a){5(4.26!=4.d[D]){9 I=3v;9 H=X;9 E=4.1b[4.d[D].13?"7":"8"];P(9 C=4.f.z-1;C>=0;C--){5(!A(4.d[D].g[0],4.f[C].v[0])){1X}9 G=4.f[C][4.d[D].13?"7":"8"];5(1k.2E(G-E)<I){I=1k.2E(G-E);H=4.f[C]}}5(!H&&!4.6.2c){1X}5(4.q){4.q.1E()}5(4.d[D].6.q){4.d[D].1Z(4)}Z{4.q=X}H?4.1D(F,H):4.1D(F,X,4.d[D].g);4.t("1W",F);4.d[D].t("1W",F,4);4.26=4.d[D]}4.d[D].t("1a",F,4);4.d[D].O.1a=1}}Z{5(4.d[D].O.1a){4.d[D].t("2k",F,4);4.d[D].O.1a=0}}}},3u:b(F,E){5(4.6.27||4.6.2r=="3t"){c w}9 D=X,C=B(F.1K).2C().1v(b(){5(B.1f(4,"o-v")){D=B(4);c w}});5(B.1f(F.1K,"o-v")){D=B(F.1K)}5(!D){c w}5(4.6.2D&&!E){9 G=w;B(4.6.2D,D).3s("*").3r().1v(b(){5(4==F.1K){G=W}});5(!G){c w}}4.j=D;c W},3q:b(H,F,C){9 J=4.6;4.26=4;4.25();4.l=3p J.l=="b"?B(J.l.3o(4.g[0],[H,4.j])):4.j.2w();5(!4.l.2C("S").z){4.l.1q((J.1q!="s"?J.1q:4.j[0].1g))}4.l.e({Y:"1s",1H:"3n"}).24("k-o-l");4.T={7:(L(4.j.e("3m"),10)||0),8:(L(4.j.e("3l"),10)||0)};4.a=4.j.a();4.a={8:4.a.8-4.T.8,7:4.a.7-4.T.7};4.a.p={7:H.1c-4.a.7,8:H.1e-4.a.8};4.u=4.l.u();9 D=4.u.a();4.a.s={8:D.8+(L(4.u.e("21"),10)||0),7:D.7+(L(4.u.e("22"),10)||0)};4.1j=4.1Y(H);4.r={m:4.l.1u(),n:4.l.1t()};5(J.12){5(J.12.7!=1J){4.a.p.7=J.12.7}5(J.12.23!=1J){4.a.p.7=4.r.m-J.12.23}5(J.12.8!=1J){4.a.p.8=J.12.8}5(J.12.2B!=1J){4.a.p.8=4.r.n-J.12.2B}}4.1U=4.j.1G()[0];5(J.i){5(J.i=="s"){J.i=4.l[0].1g}5(J.i=="h"||J.i=="1d"){4.i=[0-4.a.s.7,0-4.a.s.8,B(J.i=="h"?h:1d).m()-4.a.s.7-4.r.m-4.T.7-(L(4.g.e("2A"),10)||0),(B(J.i=="h"?h:1d).n()||h.S.1g.2y)-4.a.s.8-4.r.n-4.T.8-(L(4.g.e("2x"),10)||0)]}5(!(/^(h|1d|s)$/).17(J.i)){9 G=B(J.i)[0];9 I=B(J.i).a();4.i=[I.7+(L(B(G).e("22"),10)||0)-4.a.s.7,I.8+(L(B(G).e("21"),10)||0)-4.a.s.8,I.7+1k.2z(G.3k,G.29)-(L(B(G).e("22"),10)||0)-4.a.s.7-4.r.m-4.T.7-(L(4.j.e("2A"),10)||0),I.8+1k.2z(G.2y,G.2a)-(L(B(G).e("21"),10)||0)-4.a.s.8-4.r.n-4.T.8-(L(4.j.e("2x"),10)||0)]}}5(J.q){4.1Z()}4.t("1n",H);4.r={m:4.l.1u(),n:4.l.1t()};5(4.6.q!="2w"){4.j.e("2i","3j")}5(!C){P(9 E=4.d.z-1;E>=0;E--){4.d[E].t("3i",H,4)}}5(B.k.15){B.k.15.3h=4}5(B.k.15&&!J.2n){B.k.15.3g(4,H)}4.2j=W;4.2u(H);c W},2t:b(D,E){5(!E){E=4.Y}9 C=D=="1s"?1:-1;c{8:(E.8+4.a.s.8*C-(4.u[0]==h.S?0:4.u[0].N)*C+4.T.8*C),7:(E.7+4.a.s.7*C-(4.u[0]==h.S?0:4.u[0].M)*C+4.T.7*C)}},1Y:b(F){9 G=4.6;9 C={8:(F.1e-4.a.p.8-4.a.s.8+(4.u[0]==h.S?0:4.u[0].N)),7:(F.1c-4.a.p.7-4.a.s.7+(4.u[0]==h.S?0:4.u[0].M))};5(!4.1j){c C}5(4.i){5(C.7<4.i[0]){C.7=4.i[0]}5(C.8<4.i[1]){C.8=4.i[1]}5(C.7>4.i[2]){C.7=4.i[2]}5(C.8>4.i[3]){C.8=4.i[3]}}5(G.11){9 E=4.1j.8+1k.2v((C.8-4.1j.8)/G.11[1])*G.11[1];C.8=4.i?(!(E<4.i[1]||E>4.i[3])?E:(!(E<4.i[1])?E-G.11[1]:E+G.11[1])):E;9 D=4.1j.7+1k.2v((C.7-4.1j.7)/G.11[0])*G.11[0];C.7=4.i?(!(D<4.i[0]||D>4.i[2])?D:(!(D<4.i[0])?D-G.11[0]:D+G.11[0])):D}c C},2u:b(D){4.Y=4.1Y(D);4.1b=4.2t("1s");P(9 C=4.f.z-1;C>=0;C--){9 E=4.2s(4.f[C]);5(!E){1X}5(4.f[C].v[0]!=4.j[0]&&4.j[E==1?"3f":"1G"]()[0]!=4.f[C].v[0]&&!A(4.j[0],4.f[C].v[0])&&(4.6.2r=="3e-3d"?!A(4.g[0],4.f[C].v[0]):W)){4.2h=E==1?"2g":"3c";4.1D(D,4.f[C]);4.t("1W",D);3b}}4.2q(D);4.t("1z",D);5(!4.6.1I||4.6.1I=="x"){4.l[0].2p.7=4.Y.7+"2o"}5(!4.6.1I||4.6.1I=="y"){4.l[0].2p.8=4.Y.8+"2o"}5(B.k.15){B.k.15.3a(4,D)}c w},39:b(E,D){5(B.k.15&&!4.6.2n){B.k.15.38(4,E)}5(4.6.1V){9 C=4;9 F=C.j.a();5(C.q){C.q.2m({18:"37"},(L(4.6.1V,10)||2l)-36)}B(4.l).2m({7:F.7-4.a.s.7-C.T.7+(4.u[0]==h.S?0:4.u[0].M),8:F.8-4.a.s.8-C.T.8+(4.u[0]==h.S?0:4.u[0].N)},L(4.6.1V,10)||2l,b(){C.t("1p",E,X,D);C.1H(E)})}Z{4.t("1p",E,X,D);4.1H(E,D)}c w},1H:b(E,D){5(4.1U!=4.j.1G().1F(".k-o-l")[0]){4.t("1i",E,X,D)}5(!A(4.g[0],4.j[0])){5(4.1U==4.j.1G().1F(".k-o-l")[0]){4.t("1i",E,X,D)}4.t("1E",E,X,D);P(9 C=4.d.z-1;C>=0;C--){5(A(4.d[C].g[0],4.j[0])){4.d[C].t("1i",E,4,D);4.d[C].t("35",E,4,D)}}}P(9 C=4.d.z-1;C>=0;C--){4.d[C].t("34",E,4,D);5(4.d[C].O.1a){4.d[C].t("2k",E,4);4.d[C].O.1a=0}}4.2j=w;5(4.33){c w}B(4.j).e("2i","");5(4.q){4.q.1E()}4.l.1E();c W},1D:b(E,D,C){C?C.32(4.j):D.v[4.2h=="2g"?"31":"30"](4.j);4.1T(W);5(4.6.q){4.6.q.1i.14(4.g,4.j,4.q)}}}));B.2f(B.k.o,{2Z:"2e 2d",2Y:{1r:"1S",2X:0,2W:0,2V:":2U,2T",f:"> *",19:2S,2c:W,1q:"s"}});B.k.1o.1C("o","1h",{1n:b(E,D){9 C=B("S");5(C.e("1h")){D.6.1R=C.e("1h")}C.e("1h",D.6.1h)},1p:b(D,C){5(C.6.1R){B("S").e("1h",C.6.1R)}}});B.k.1o.1C("o","19",{1n:b(E,D){9 C=D.l;5(C.e("19")){D.6.1Q=C.e("19")}C.e("19",D.6.19)},1p:b(D,C){5(C.6.1Q){B(C.l).e("19",C.6.1Q)}}});B.k.1o.1C("o","18",{1n:b(E,D){9 C=D.l;5(C.e("18")){D.6.1P=C.e("18")}C.e("18",D.6.18)},1p:b(D,C){5(C.6.1P){B(C.l).e("18",C.6.1P)}}});B.k.1o.1C("o","1m",{1n:b(E,D){9 F=D.6;9 C=B(4).1f("o");F.V=F.V||20;F.U=F.U||20;C.R=b(G){2b{5(/1B|1m/.17(G.e("1A"))||(/1B|1m/).17(G.e("1A-y"))){c G}G=G.s()}1O(G[0].1g);c B(h)}(C.j);C.Q=b(G){2b{5(/1B|1m/.17(G.e("1A"))||(/1B|1m/).17(G.e("1A-x"))){c G}G=G.s()}1O(G[0].1g);c B(h)}(C.j);5(C.R[0]!=h&&C.R[0].1y!="1x"){C.1N=C.R.a()}5(C.Q[0]!=h&&C.Q[0].1y!="1x"){C.1M=C.Q.a()}},1z:b(E,D){9 F=D.6;9 C=B(4).1f("o");5(C.R[0]!=h&&C.R[0].1y!="1x"){5((C.1N.8+C.R[0].2a)-E.1e<F.V){C.R[0].N=C.R[0].N+F.U}5(E.1e-C.1N.8<F.V){C.R[0].N=C.R[0].N-F.U}}Z{5(E.1e-B(h).N()<F.V){B(h).N(B(h).N()-F.U)}5(B(1d).n()-(E.1e-B(h).N())<F.V){B(h).N(B(h).N()+F.U)}}5(C.Q[0]!=h&&C.Q[0].1y!="1x"){5((C.1M.7+C.Q[0].29)-E.1c<F.V){C.Q[0].M=C.Q[0].M+F.U}5(E.1c-C.1M.7<F.V){C.Q[0].M=C.Q[0].M-F.U}}Z{5(E.1c-B(h).M()<F.V){B(h).M(B(h).M()-F.U)}5(B(1d).m()-(E.1c-B(h).M())<F.V){B(h).M(B(h).M()+F.U)}}}})})(2R)',62,242,'||||this|if|options|left|top|var|offset|function|return|containers|css|items|element|document|containment|currentItem|ui|helper|width|height|sortable|click|placeholder|helperProportions|parent|propagate|offsetParent|item|false|||length||||||||||||parseInt|scrollLeft|scrollTop|containerCache|for|overflowX|overflowY|body|margins|scrollSpeed|scrollSensitivity|true|null|position|else||grid|cursorAt|floating|call|ddmanager||test|opacity|zIndex|over|positionAbs|pageX|window|pageY|data|parentNode|cursor|update|originalPosition|Math|toleranceElement|scroll|start|plugin|stop|appendTo|tolerance|absolute|outerHeight|outerWidth|each|push|HTML|tagName|sort|overflow|auto|add|rearrange|remove|not|prev|clear|axis|undefined|target|isFunction|overflowXOffset|overflowYOffset|while|_opacity|_zIndex|_cursor|guess|refreshPositions|domPosition|revert|change|continue|generatePosition|createPlaceholder||borderTopWidth|borderLeftWidth|right|addClass|refresh|currentContainer|disabled|connectWith|offsetWidth|offsetHeight|do|dropOnEmpty|toArray|serialize|extend|down|direction|visibility|dragging|out|500|animate|dropBehaviour|px|style|contactContainers|type|intersectsWithEdge|convertPositionTo|mouseDrag|round|clone|marginBottom|scrollHeight|max|marginRight|bottom|parents|handle|abs|intersectsWith|div|removeData|refreshItems|pointer|id|attr|key|relative|compareDocumentPosition|contains|browser|jQuery|1000|button|input|cancel|delay|distance|defaults|getter|after|before|append|cancelHelperRemoval|deactivate|receive|50|hide|drop|mouseStop|drag|break|up|dynamic|semi|next|prepareOffsets|current|activate|hidden|scrollWidth|marginTop|marginLeft|both|apply|typeof|mouseStart|andSelf|find|static|mouseCapture|10000|String|constructor|mouseDestroy|unbind|removeClass|destroy|join|_|expression|match|attribute|triggerHandler|sender|absolutePosition|plugins|mouseInit|fixed|float|init|mouse|widget|522|version|safari'.split('|'),0,{}))
+
diff --git a/wp-includes/js/jquery/ui.tabs.js b/wp-includes/js/jquery/ui.tabs.js
index 8634b41..339de6b 100644
--- a/wp-includes/js/jquery/ui.tabs.js
+++ b/wp-includes/js/jquery/ui.tabs.js
@@ -1,529 +1,2 @@
-/*
- * Tabs 3 - New Wave Tabs
- *
- * Copyright (c) 2007 Klaus Hartl (stilbuero.de)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- */
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(4(A){A.39("8.3",{38:4(){2.c.u+=".3";2.1e(1c)},37:4(B,C){5((/^7/).1Z(B)){2.16(C)}m{2.c[B]=C;2.1e()}},i:4(){f 2.$3.i},1E:4(B){f B.24&&B.24.13(/\\s/g,"23").13(/[^A-36-35-9\\-23:\\.]/g,"")||2.c.1Q+A.e(B)},8:4(C,B){f{c:2.c,34:C,1M:B}},1e:4(O){2.$h=A("1i:33(a[n])",2.k);2.$3=2.$h.1s(4(){f A("a",2)[0]});2.$b=A([]);6 P=2,D=2.c;2.$3.V(4(R,Q){5(Q.t&&Q.t.13("#","")){P.$b=P.$b.1b(Q.t)}m{5(A(Q).12("n")!="#"){A.e(Q,"n.3",Q.n);A.e(Q,"p.3",Q.n);6 T=P.1E(Q);Q.n="#"+T;6 S=A("#"+T);5(!S.i){S=A(D.1x).12("1f",T).l(D.18).32(P.$b[R-1]||P.k);S.e("1a.3",1c)}P.$b=P.$b.1b(S)}m{D.d.1U(R+1)}}});5(O){2.k.l(D.1w);2.$b.V(4(){6 Q=A(2);Q.l(D.18)});5(D.7===1p){5(1J.t){2.$3.V(4(S,Q){5(Q.t==1J.t){D.7=S;5(A.W.1g||A.W.31){6 R=A(1J.t),T=R.12("1f");R.12("1f","");1z(4(){R.12("1f",T)},30)}2Z(0,0);f o}})}m{5(D.Y){6 J=2Y(A.Y("8-3"+A.e(P.k)),10);5(J&&P.$3[J]){D.7=J}}m{5(P.$h.z("."+D.j).i){D.7=P.$h.Z(P.$h.z("."+D.j)[0])}}}}D.7=D.7===v||D.7!==1p?D.7:0;D.d=A.2X(D.d.2W(A.1s(2.$h.z("."+D.U),4(R,Q){f P.$h.Z(R)}))).1T();5(A.1r(D.7,D.d)!=-1){D.d.2V(A.1r(D.7,D.d),1)}2.$b.l(D.w);2.$h.q(D.j);5(D.7!==v){2.$b.r(D.7).1G().q(D.w);2.$h.r(D.7).l(D.j);6 K=4(){A(P.k).y("20",[P.8(P.$3[D.7],P.$b[D.7])],D.1G)};5(A.e(2.$3[D.7],"p.3")){2.p(D.7,K)}m{K()}}A(2U).15("2T",4(){P.$3.14(".3");P.$h=P.$3=P.$b=v})}2S(6 G=0,N;N=2.$h[G];G++){A(N)[A.1r(G,D.d)!=-1&&!A(N).11(D.j)?"l":"q"](D.U)}5(D.x===o){2.$3.1m("x.3")}6 C,I,B={"2R-2Q":0,1I:1},E="2P";5(D.X&&D.X.2O==2N){C=D.X[0]||B,I=D.X[1]||B}m{C=I=D.X||B}6 H={1q:"",2M:"",2L:""};5(!A.W.1g){H.1H=""}4 M(R,Q,S){Q.22(C,C.1I||E,4(){Q.l(D.w).1d(H);5(A.W.1g&&C.1H){Q[0].21.z=""}5(S){L(R,S,Q)}})}4 L(R,S,Q){5(I===B){S.1d("1q","1D")}S.22(I,I.1I||E,4(){S.q(D.w).1d(H);5(A.W.1g&&I.1H){S[0].21.z=""}A(P.k).y("20",[P.8(R,S[0])],D.1G)})}4 F(R,T,Q,S){T.l(D.j).2K().q(D.j);M(R,Q,S)}2.$3.14(".3").15(D.u,4(){6 T=A(2).2J("1i:r(0)"),Q=P.$b.z(":2I"),S=A(2.t);5((T.11(D.j)&&!D.1h)||T.11(D.U)||A(2).11(D.17)||A(P.k).y("2H",[P.8(2,S[0])],D.16)===o){2.1t();f o}P.c.7=P.$3.Z(2);5(D.1h){5(T.11(D.j)){P.c.7=v;T.q(D.j);P.$b.1F();M(2,Q);2.1t();f o}m{5(!Q.i){P.$b.1F();6 R=2;P.p(P.$3.Z(2),4(){T.l(D.j).l(D.1v);L(R,S)});2.1t();f o}}}5(D.Y){A.Y("8-3"+A.e(P.k),P.c.7,D.Y)}P.$b.1F();5(S.i){6 R=2;P.p(P.$3.Z(2),Q.i?4(){F(R,T,Q,S)}:4(){T.l(D.j);L(R,S)})}m{2G"1K 2F 2E: 2D 2C 2B."}5(A.W.1g){2.1t()}f o});5(!(/^1y/).1Z(D.u)){2.$3.15("1y.3",4(){f o})}},1b:4(E,D,C){5(C==1p){C=2.$3.i}6 G=2.c;6 I=A(G.1P.13(/#\\{n\\}/g,E).13(/#\\{1j\\}/g,D));I.e("1a.3",1c);6 H=E.2A("#")==0?E.13("#",""):2.1E(A("a:2z-2y",I)[0]);6 F=A("#"+H);5(!F.i){F=A(G.1x).12("1f",H).l(G.w).e("1a.3",1c)}F.l(G.18);5(C>=2.$h.i){I.1Y(2.k);F.1Y(2.k[0].2x)}m{I.1X(2.$h[C]);F.1X(2.$b[C])}G.d=A.1s(G.d,4(K,J){f K>=C?++K:K});2.1e();5(2.$3.i==1){I.l(G.j);F.q(G.w);6 B=A.e(2.$3[0],"p.3");5(B){2.p(C,B)}}2.k.y("2w",[2.8(2.$3[C],2.$b[C])],G.1b)},19:4(B){6 D=2.c,E=2.$h.r(B).19(),C=2.$b.r(B).19();5(E.11(D.j)&&2.$3.i>1){2.16(B+(B+1<2.$3.i?1:-1))}D.d=A.1s(A.1W(D.d,4(G,F){f G!=B}),4(G,F){f G>=B?--G:G});2.1e();2.k.y("2v",[2.8(E.1C("a")[0],C[0])],D.19)},1V:4(B){6 C=2.c;5(A.1r(B,C.d)==-1){f}6 D=2.$h.r(B).q(C.U);5(A.W.2u){D.1d("1q","2t-1D");1z(4(){D.1d("1q","1D")},0)}C.d=A.1W(C.d,4(F,E){f F!=B});2.k.y("2s",[2.8(2.$3[B],2.$b[B])],C.1V)},1S:4(C){6 B=2,D=2.c;5(C!=D.7){2.$h.r(C).l(D.U);D.d.1U(C);D.d.1T();2.k.y("2r",[2.8(2.$3[C],2.$b[C])],D.1S)}},16:4(B){5(2q B=="2p"){B=2.$3.Z(2.$3.z("[n$="+B+"]")[0])}2.$3.r(B).2o(2.c.u)},p:4(G,K){6 L=2,D=2.c,E=2.$3.r(G),J=E[0],H=K==1p||K===o,B=E.e("p.3");K=K||4(){};5(!B||!H&&A.e(J,"x.3")){K();f}6 M=4(N){6 O=A(N),P=O.1C("*:2n");f P.i&&P||O};6 C=4(){L.$3.z("."+D.17).q(D.17).V(4(){5(D.1l){M(2).2m().1o(M(2).e("1j.3"))}});L.1n=v};5(D.1l){6 I=M(J).1o();M(J).2l("<1B></1B>").1C("1B").e("1j.3",I).1o(D.1l)}6 F=A.1L({},D.1k,{1R:B,1A:4(O,N){A(J.t).1o(O);C();5(D.x){A.e(J,"x.3",1c)}A(L.k).y("2k",[L.8(L.$3[G],L.$b[G])],D.p);D.1k.1A&&D.1k.1A(O,N);K()}});5(2.1n){2.1n.2j();C()}E.l(D.17);1z(4(){L.1n=A.2i(F)},0)},1R:4(C,B){2.$3.r(C).1m("x.3").e("p.3",B)},1a:4(){6 B=2.c;2.k.14(".3").q(B.1w).1m("3");2.$3.V(4(){6 C=A.e(2,"n.3");5(C){2.n=C}6 D=A(2).14(".3");A.V(["n","p","x"],4(E,F){D.1m(F+".3")})});2.$h.1b(2.$b).V(4(){5(A.e(2,"1a.3")){A(2).19()}m{A(2).q([B.j,B.1v,B.U,B.18,B.w].2h(" "))}})}});A.8.3.2g={1h:o,u:"1y",d:[],Y:v,1l:"2f&#2e;",x:o,1Q:"8-3-",1k:{},X:v,1P:\'<1i><a n="#{n}"><1O>#{1j}</1O></a></1i>\',1x:"<1N></1N>",1w:"8-3-2d",j:"8-3-7",1v:"8-3-1h",U:"8-3-d",18:"8-3-1M",w:"8-3-2c",17:"8-3-2b"};A.8.3.2a="i";A.1L(A.8.3.29,{1u:v,28:4(C,F){F=F||o;6 B=2,E=2.c.7;4 G(){B.1u=27(4(){E=++E<B.$3.i?E:0;B.16(E)},C)}4 D(H){5(!H||H.26){25(B.1u)}}5(C){G();5(!F){2.$3.15(2.c.u,D)}m{2.$3.15(2.c.u,4(){D();E=B.c.7;G()})}}m{D();2.$3.14(2.c.u,D)}}})})(1K)',62,196,'||this|tabs|function|if|var|selected|ui|||panels|options|disabled|data|return||lis|length|selectedClass|element|addClass|else|href|false|load|removeClass|eq||hash|event|null|hideClass|cache|triggerHandler|filter|||||||||||||||||||||disabledClass|each|browser|fx|cookie|index||hasClass|attr|replace|unbind|bind|select|loadingClass|panelClass|remove|destroy|add|true|css|tabify|id|msie|unselect|li|label|ajaxOptions|spinner|removeData|xhr|html|undefined|display|inArray|map|blur|rotation|unselectClass|navClass|panelTemplate|click|setTimeout|success|em|find|block|tabId|stop|show|opacity|duration|location|jQuery|extend|panel|div|span|tabTemplate|idPrefix|url|disable|sort|push|enable|grep|insertBefore|appendTo|test|tabsshow|style|animate|_|title|clearInterval|clientX|setInterval|rotate|prototype|getter|loading|hide|nav|8230|Loading|defaults|join|ajax|abort|tabsload|wrapInner|parent|last|trigger|string|typeof|tabsdisable|tabsenable|inline|safari|tabsremove|tabsadd|parentNode|child|first|indexOf|identifier|fragment|Mismatching|Tabs|UI|throw|tabsselect|visible|parents|siblings|height|overflow|Array|constructor|normal|width|min|for|unload|window|splice|concat|unique|parseInt|scrollTo|500|opera|insertAfter|has|tab|z0|Za|setData|init|widget'.split('|'),0,{}))
-(function($) {
-
- // if the UI scope is not availalable, add it
- $.ui = $.ui || {};
-
- // tabs initialization
- $.fn.tabs = function(initial, options) {
- if (initial && initial.constructor == Object) { // shift arguments
- options = initial;
- initial = null;
- }
- options = options || {};
-
- initial = initial && initial.constructor == Number && --initial || 0;
-
- return this.each(function() {
- new $.ui.tabs(this, $.extend(options, { initial: initial }));
- });
- };
-
- // other chainable tabs methods
- $.each(['Add', 'Remove', 'Enable', 'Disable', 'Click', 'Load', 'Href'], function(i, method) {
- $.fn['tabs' + method] = function() {
- var args = arguments;
- return this.each(function() {
- var instance = $.ui.tabs.getInstance(this);
- instance[method.toLowerCase()].apply(instance, args);
- });
- };
- });
- $.fn.tabsSelected = function() {
- var selected = -1;
- if (this[0]) {
- var instance = $.ui.tabs.getInstance(this[0]),
- $lis = $('li', this);
- selected = $lis.index( $lis.filter('.' + instance.options.selectedClass)[0] );
- }
- return selected >= 0 ? ++selected : -1;
- };
-
- // tabs class
- $.ui.tabs = function(el, options) {
-
- this.source = el;
-
- this.options = $.extend({
-
- // basic setup
- initial: 0,
- event: 'click',
- disabled: [],
- cookie: null, // pass options object as expected by cookie plugin: { expires: 7, path: '/', domain: 'jquery.com', secure: true }
- // TODO bookmarkable: $.ajaxHistory ? true : false,
- unselected: false,
- unselect: options.unselected ? true : false,
-
- // Ajax
- spinner: 'Loading&#8230;',
- cache: false,
- idPrefix: 'ui-tabs-',
- ajaxOptions: {},
-
- // animations
- /*fxFade: null,
- fxSlide: null,
- fxShow: null,
- fxHide: null,*/
- fxSpeed: 'normal',
- /*fxShowSpeed: null,
- fxHideSpeed: null,*/
-
- // callbacks
- add: function() {},
- remove: function() {},
- enable: function() {},
- disable: function() {},
- click: function() {},
- hide: function() {},
- show: function() {},
- load: function() {},
-
- // templates
- tabTemplate: '<li><a href="#{href}"><span>#{text}</span></a></li>',
- panelTemplate: '<div></div>',
-
- // CSS classes
- navClass: 'ui-tabs-nav',
- selectedClass: 'ui-tabs-selected',
- unselectClass: 'ui-tabs-unselect',
- disabledClass: 'ui-tabs-disabled',
- panelClass: 'ui-tabs-panel',
- hideClass: 'ui-tabs-hide',
- loadingClass: 'ui-tabs-loading'
-
- }, options);
-
- this.options.event += '.ui-tabs'; // namespace event
- this.options.cookie = $.cookie && $.cookie.constructor == Function && this.options.cookie;
-
- // save instance for later
- $.data(el, $.ui.tabs.INSTANCE_KEY, this);
-
- // create tabs
- this.tabify(true);
- };
-
- // static
- $.ui.tabs.INSTANCE_KEY = 'ui_tabs_instance';
- $.ui.tabs.getInstance = function(el) {
- return $.data(el, $.ui.tabs.INSTANCE_KEY);
- };
-
- // instance methods
- $.extend($.ui.tabs.prototype, {
- tabId: function(a) {
- return a.title ? a.title.replace(/\s/g, '_')
- : this.options.idPrefix + $.data(a);
- },
- tabify: function(init) {
-
- this.$lis = $('li:has(a[href])', this.source);
- this.$tabs = this.$lis.map(function() { return $('a', this)[0] });
- this.$panels = $([]);
-
- var self = this, o = this.options;
-
- this.$tabs.each(function(i, a) {
- // inline tab
- if (a.hash && a.hash.replace('#', '')) { // Safari 2 reports '#' for an empty hash
- self.$panels = self.$panels.add(a.hash);
- }
- // remote tab
- else if ($(a).attr('href') != '#') { // prevent loading the page itself if href is just "#"
- $.data(a, 'href', a.href);
- var id = self.tabId(a);
- a.href = '#' + id;
- self.$panels = self.$panels.add(
- $('#' + id)[0] || $(o.panelTemplate).attr('id', id).addClass(o.panelClass)
- .insertAfter( self.$panels[i - 1] || self.source )
- );
- }
- // invalid tab href
- else {
- o.disabled.push(i + 1);
- }
- });
-
- if (init) {
-
- // attach necessary classes for styling if not present
- $(this.source).hasClass(o.navClass) || $(this.source).addClass(o.navClass);
- this.$panels.each(function() {
- var $this = $(this);
- $this.hasClass(o.panelClass) || $this.addClass(o.panelClass);
- });
-
- // disabled tabs
- for (var i = 0, position; position = o.disabled[i]; i++) {
- this.disable(position);
- }
-
- // Try to retrieve initial tab:
- // 1. from fragment identifier in url if present
- // 2. from cookie
- // 3. from selected class attribute on <li>
- // 4. otherwise use given initial argument
- // 5. check if tab is disabled
- this.$tabs.each(function(i, a) {
- if (location.hash) {
- if (a.hash == location.hash) {
- o.initial = i;
- // prevent page scroll to fragment
- //if (($.browser.msie || $.browser.opera) && !o.remote) {
- if ($.browser.msie || $.browser.opera) {
- var $toShow = $(location.hash), toShowId = $toShow.attr('id');
- $toShow.attr('id', '');
- setTimeout(function() {
- $toShow.attr('id', toShowId); // restore id
- }, 500);
- }
- scrollTo(0, 0);
- return false; // break
- }
- } else if (o.cookie) {
- o.initial = parseInt($.cookie( $.ui.tabs.INSTANCE_KEY + $.data(self.source) )) || 0;
- return false; // break
- } else if ( self.$lis.eq(i).hasClass(o.selectedClass) ) {
- o.initial = i;
- return false; // break
- }
- });
- var n = this.$lis.length;
- while (this.$lis.eq(o.initial).hasClass(o.disabledClass) && n) {
- o.initial = ++o.initial < this.$lis.length ? o.initial : 0;
- n--;
- }
- if (!n) { // all tabs disabled, set option unselected to true
- o.unselected = o.unselect = true;
- }
-
- // highlight selected tab
- this.$panels.addClass(o.hideClass);
- this.$lis.removeClass(o.selectedClass);
- if (!o.unselected) {
- this.$panels.eq(o.initial).show().removeClass(o.hideClass); // use show and remove class to show in any case no matter how it has been hidden before
- this.$lis.eq(o.initial).addClass(o.selectedClass);
- }
-
- // load if remote tab
- var href = !o.unselected && $.data(this.$tabs[o.initial], 'href');
- if (href) {
- this.load(o.initial + 1, href);
- }
-
- // disable click if event is configured to something else
- if (!/^click/.test(o.event)) {
- this.$tabs.bind('click', function(e) { e.preventDefault(); });
- }
-
- }
-
- // setup animations
- var showAnim = {}, showSpeed = o.fxShowSpeed || o.fxSpeed,
- hideAnim = {}, hideSpeed = o.fxHideSpeed || o.fxSpeed;
- if (o.fxSlide || o.fxFade) {
- if (o.fxSlide) {
- showAnim['height'] = 'show';
- hideAnim['height'] = 'hide';
- }
- if (o.fxFade) {
- showAnim['opacity'] = 'show';
- hideAnim['opacity'] = 'hide';
- }
- } else {
- if (o.fxShow) {
- showAnim = o.fxShow;
- } else { // use some kind of animation to prevent browser scrolling to the tab
- showAnim['min-width'] = 0; // avoid opacity, causes flicker in Firefox
- showSpeed = 1; // as little as 1 is sufficient
- }
- if (o.fxHide) {
- hideAnim = o.fxHide;
- } else { // use some kind of animation to prevent browser scrolling to the tab
- hideAnim['min-width'] = 0; // avoid opacity, causes flicker in Firefox
- hideSpeed = 1; // as little as 1 is sufficient
- }
- }
-
- // reset some styles to maintain print style sheets etc.
- var resetCSS = { display: '', overflow: '', height: '' };
- if (!$.browser.msie) { // not in IE to prevent ClearType font issue
- resetCSS['opacity'] = '';
- }
-
- // Hide a tab, animation prevents browser scrolling to fragment,
- // $show is optional.
- function hideTab(clicked, $hide, $show) {
- $hide.animate(hideAnim, hideSpeed, function() { //
- $hide.addClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
- if ($.browser.msie && hideAnim['opacity']) {
- $hide[0].style.filter = '';
- }
- o.hide(clicked, $hide[0], $show && $show[0] || null);
- if ($show) {
- showTab(clicked, $show, $hide);
- }
- });
- }
-
- // Show a tab, animation prevents browser scrolling to fragment,
- // $hide is optional
- function showTab(clicked, $show, $hide) {
- if (!(o.fxSlide || o.fxFade || o.fxShow)) {
- $show.css('display', 'block'); // prevent occasionally occuring flicker in Firefox cause by gap between showing and hiding the tab panels
- }
- $show.animate(showAnim, showSpeed, function() {
- $show.removeClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
- if ($.browser.msie && showAnim['opacity']) {
- $show[0].style.filter = '';
- }
- o.show(clicked, $show[0], $hide && $hide[0] || null);
- });
- }
-
- // switch a tab
- function switchTab(clicked, $li, $hide, $show) {
- /*if (o.bookmarkable && trueClick) { // add to history only if true click occured, not a triggered click
- $.ajaxHistory.update(clicked.hash);
- }*/
- $li.addClass(o.selectedClass)
- .siblings().removeClass(o.selectedClass);
- hideTab(clicked, $hide, $show);
- }
-
- // attach tab event handler, unbind to avoid duplicates from former tabifying...
- this.$tabs.unbind(o.event).bind(o.event, function() {
-
- //var trueClick = e.clientX; // add to history only if true click occured, not a triggered click
- var $li = $(this).parents('li:eq(0)'),
- $hide = self.$panels.filter(':visible'),
- $show = $(this.hash);
-
- // If tab is already selected and not unselectable or tab disabled or click callback returns false stop here.
- // Check if click handler returns false last so that it is not executed for a disabled tab!
- if (($li.hasClass(o.selectedClass) && !o.unselect) || $li.hasClass(o.disabledClass)
- || o.click(this, $show[0], $hide[0]) === false) {
- this.blur();
- return false;
- }
-
- if (o.cookie) {
- $.cookie($.ui.tabs.INSTANCE_KEY + $.data(self.source), self.$tabs.index(this), o.cookie);
- }
-
- // if tab may be closed
- if (o.unselect) {
- if ($li.hasClass(o.selectedClass)) {
- $li.removeClass(o.selectedClass);
- self.$panels.stop();
- hideTab(this, $hide);
- this.blur();
- return false;
- } else if (!$hide.length) {
- self.$panels.stop();
- if ($.data(this, 'href')) { // remote tab
- var a = this;
- self.load(self.$tabs.index(this) + 1, $.data(this, 'href'), function() {
- $li.addClass(o.selectedClass).addClass(o.unselectClass);
- showTab(a, $show);
- });
- } else {
- $li.addClass(o.selectedClass).addClass(o.unselectClass);
- showTab(this, $show);
- }
- this.blur();
- return false;
- }
- }
-
- // stop possibly running animations
- self.$panels.stop();
-
- // show new tab
- if ($show.length) {
-
- // prevent scrollbar scrolling to 0 and than back in IE7, happens only if bookmarking/history is enabled
- /*if ($.browser.msie && o.bookmarkable) {
- var showId = this.hash.replace('#', '');
- $show.attr('id', '');
- setTimeout(function() {
- $show.attr('id', showId); // restore id
- }, 0);
- }*/
-
- if ($.data(this, 'href')) { // remote tab
- var a = this;
- self.load(self.$tabs.index(this) + 1, $.data(this, 'href'), function() {
- switchTab(a, $li, $hide, $show);
- });
- } else {
- switchTab(this, $li, $hide, $show);
- }
-
- // Set scrollbar to saved position - need to use timeout with 0 to prevent browser scroll to target of hash
- /*var scrollX = window.pageXOffset || document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft || 0;
- var scrollY = window.pageYOffset || document.documentElement && document.documentElement.scrollTop || document.body.scrollTop || 0;
- setTimeout(function() {
- scrollTo(scrollX, scrollY);
- }, 0);*/
-
- } else {
- throw 'jQuery UI Tabs: Mismatching fragment identifier.';
- }
-
- // Prevent IE from keeping other link focussed when using the back button
- // and remove dotted border from clicked link. This is controlled in modern
- // browsers via CSS, also blur removes focus from address bar in Firefox
- // which can become a usability and annoying problem with tabsRotate.
- if ($.browser.msie) {
- this.blur();
- }
-
- //return o.bookmarkable && !!trueClick; // convert trueClick == undefined to Boolean required in IE
- return false;
-
- });
-
- },
- add: function(url, text, position) {
- if (url && text) {
- position = position || this.$tabs.length; // append by default
-
- var o = this.options,
- $li = $(o.tabTemplate.replace(/#\{href\}/, url).replace(/#\{text\}/, text));
-
- var id = url.indexOf('#') == 0 ? url.replace('#', '') : this.tabId( $('a:first-child', $li)[0] );
-
- // try to find an existing element before creating a new one
- var $panel = $('#' + id);
- $panel = $panel.length && $panel
- || $(o.panelTemplate).attr('id', id).addClass(o.panelClass).addClass(o.hideClass);
- if (position >= this.$lis.length) {
- $li.appendTo(this.source);
- $panel.appendTo(this.source.parentNode);
- } else {
- $li.insertBefore(this.$lis[position - 1]);
- $panel.insertBefore(this.$panels[position - 1]);
- }
-
- this.tabify();
-
- if (this.$tabs.length == 1) {
- $li.addClass(o.selectedClass);
- $panel.removeClass(o.hideClass);
- var href = $.data(this.$tabs[0], 'href');
- if (href) {
- this.load(position + 1, href);
- }
- }
- o.add(this.$tabs[position], this.$panels[position]); // callback
- } else {
- throw 'jQuery UI Tabs: Not enough arguments to add tab.';
- }
- },
- remove: function(position) {
- if (position && position.constructor == Number) {
- var o = this.options, $li = this.$lis.eq(position - 1).remove(),
- $panel = this.$panels.eq(position - 1).remove();
-
- // If selected tab was removed focus tab to the right or
- // tab to the left if last tab was removed.
- if ($li.hasClass(o.selectedClass) && this.$tabs.length > 1) {
- this.click(position + (position < this.$tabs.length ? 1 : -1));
- }
- this.tabify();
- o.remove($li.end()[0], $panel[0]); // callback
- }
- },
- enable: function(position) {
- var o = this.options, $li = this.$lis.eq(position - 1);
- $li.removeClass(o.disabledClass);
- if ($.browser.safari) { // fix disappearing tab (that used opacity indicating disabling) after enabling in Safari 2...
- $li.css('display', 'inline-block');
- setTimeout(function() {
- $li.css('display', 'block')
- }, 0)
- }
- o.enable(this.$tabs[position - 1], this.$panels[position - 1]); // callback
- },
- disable: function(position) {
- var o = this.options;
- this.$lis.eq(position - 1).addClass(o.disabledClass);
- o.disable(this.$tabs[position - 1], this.$panels[position - 1]); // callback
- },
- click: function(position) {
- this.$tabs.eq(position - 1).trigger(this.options.event);
- },
- load: function(position, url, callback) {
- var self = this, o = this.options,
- $a = this.$tabs.eq(position - 1), a = $a[0], $span = $('span', a);
-
- // shift arguments
- if (url && url.constructor == Function) {
- callback = url;
- url = null;
- }
-
- // set new URL or get existing
- if (url) {
- $.data(a, 'href', url);
- } else {
- url = $.data(a, 'href');
- }
-
- // load
- if (o.spinner) {
- $.data(a, 'title', $span.html());
- $span.html('<em>' + o.spinner + '</em>');
- }
- var finish = function() {
- self.$tabs.filter('.' + o.loadingClass).each(function() {
- $(this).removeClass(o.loadingClass);
- if (o.spinner) {
- $('span', this).html( $.data(this, 'title') );
- }
- });
- self.xhr = null;
- };
- var ajaxOptions = $.extend(o.ajaxOptions, {
- url: url,
- success: function(r) {
- $(a.hash).html(r);
- finish();
- // This callback is required because the switch has to take
- // place after loading has completed.
- if (callback && callback.constructor == Function) {
- callback();
- }
- if (o.cache) {
- $.removeData(a, 'href'); // if loaded once do not load them again
- }
- o.load(self.$tabs[position - 1], self.$panels[position - 1]); // callback
- }
- });
- if (this.xhr) {
- // terminate pending requests from other tabs and restore title
- this.xhr.abort();
- finish();
- }
- $a.addClass(o.loadingClass);
- setTimeout(function() { // timeout is again required in IE, "wait" for id being restored
- self.xhr = $.ajax(ajaxOptions);
- }, 0);
-
- },
- href: function(position, href) {
- $.data(this.$tabs.eq(position - 1)[0], 'href', href);
- }
- });
-
-})(jQuery);
diff --git a/wp-includes/js/prototype.js b/wp-includes/js/prototype.js
index 0cc66ee..5c73462 100644
--- a/wp-includes/js/prototype.js
+++ b/wp-includes/js/prototype.js
@@ -4181,4 +4181,4 @@ Object.extend(Element.ClassNames.prototype, Enumerable);
/*--------------------------------------------------------------------------*/
-Element.addMethods();
+Element.addMethods(); \ No newline at end of file
diff --git a/wp-includes/js/quicktags.js b/wp-includes/js/quicktags.js
index 0837d84..90b0e7e 100644
--- a/wp-includes/js/quicktags.js
+++ b/wp-includes/js/quicktags.js
@@ -25,15 +25,15 @@ function zeroise(number, threshold) {
}
var now = new Date();
-var datetime = now.getUTCFullYear() + '-' +
+var datetime = now.getUTCFullYear() + '-' +
zeroise(now.getUTCMonth() + 1, 2) + '-' +
-zeroise(now.getUTCDate(), 2) + 'T' +
-zeroise(now.getUTCHours(), 2) + ':' +
-zeroise(now.getUTCMinutes(), 2) + ':' +
+zeroise(now.getUTCDate(), 2) + 'T' +
+zeroise(now.getUTCHours(), 2) + ':' +
+zeroise(now.getUTCMinutes(), 2) + ':' +
zeroise(now.getUTCSeconds() ,2) +
'+00:00';
-edButtons[edButtons.length] =
+edButtons[edButtons.length] =
new edButton('ed_strong'
,'b'
,'<strong>'
@@ -41,7 +41,7 @@ new edButton('ed_strong'
,'b'
);
-edButtons[edButtons.length] =
+edButtons[edButtons.length] =
new edButton('ed_em'
,'i'
,'<em>'
@@ -49,7 +49,7 @@ new edButton('ed_em'
,'i'
);
-edButtons[edButtons.length] =
+edButtons[edButtons.length] =
new edButton('ed_link'
,'link'
,''
@@ -57,7 +57,7 @@ new edButton('ed_link'
,'a'
); // special case
-edButtons[edButtons.length] =
+edButtons[edButtons.length] =
new edButton('ed_block'
,'b-quote'
,'\n\n<blockquote>'
@@ -66,7 +66,7 @@ new edButton('ed_block'
);
-edButtons[edButtons.length] =
+edButtons[edButtons.length] =
new edButton('ed_del'
,'del'
,'<del datetime="' + datetime + '">'
@@ -74,7 +74,7 @@ new edButton('ed_del'
,'d'
);
-edButtons[edButtons.length] =
+edButtons[edButtons.length] =
new edButton('ed_ins'
,'ins'
,'<ins datetime="' + datetime + '">'
@@ -82,7 +82,7 @@ new edButton('ed_ins'
,'s'
);
-edButtons[edButtons.length] =
+edButtons[edButtons.length] =
new edButton('ed_img'
,'img'
,''
@@ -91,7 +91,7 @@ new edButton('ed_img'
,-1
); // special case
-edButtons[edButtons.length] =
+edButtons[edButtons.length] =
new edButton('ed_ul'
,'ul'
,'<ul>\n'
@@ -99,7 +99,7 @@ new edButton('ed_ul'
,'u'
);
-edButtons[edButtons.length] =
+edButtons[edButtons.length] =
new edButton('ed_ol'
,'ol'
,'<ol>\n'
@@ -107,7 +107,7 @@ new edButton('ed_ol'
,'o'
);
-edButtons[edButtons.length] =
+edButtons[edButtons.length] =
new edButton('ed_li'
,'li'
,'\t<li>'
@@ -115,7 +115,7 @@ new edButton('ed_li'
,'l'
);
-edButtons[edButtons.length] =
+edButtons[edButtons.length] =
new edButton('ed_code'
,'code'
,'<code>'
@@ -123,7 +123,7 @@ new edButton('ed_code'
,'c'
);
-edButtons[edButtons.length] =
+edButtons[edButtons.length] =
new edButton('ed_more'
,'more'
,'<!--more-->'
@@ -132,7 +132,7 @@ new edButton('ed_more'
,-1
);
/*
-edButtons[edButtons.length] =
+edButtons[edButtons.length] =
new edButton('ed_next'
,'page'
,'<!--nextpage-->'
@@ -220,7 +220,7 @@ function edQuickLink(i, thisSelect) {
if (edLinks[i].newWin == 1) {
newWin = ' target="_blank"';
}
- var tempStr = '<a href="' + edLinks[i].URL + '"' + newWin + '>'
+ var tempStr = '<a href="' + edLinks[i].URL + '"' + newWin + '>'
+ edLinks[i].display
+ '</a>';
thisSelect.selectedIndex = 0;
@@ -298,21 +298,21 @@ function edInsertTag(myField, i) {
if (startPos != endPos) {
myField.value = myField.value.substring(0, startPos)
+ edButtons[i].tagStart
- + myField.value.substring(startPos, endPos)
+ + myField.value.substring(startPos, endPos)
+ edButtons[i].tagEnd
+ myField.value.substring(endPos, myField.value.length);
cursorPos += edButtons[i].tagStart.length + edButtons[i].tagEnd.length;
}
else {
if (!edCheckOpenTags(i) || edButtons[i].tagEnd == '') {
- myField.value = myField.value.substring(0, startPos)
+ myField.value = myField.value.substring(0, startPos)
+ edButtons[i].tagStart
+ myField.value.substring(endPos, myField.value.length);
edAddTag(i);
cursorPos = startPos + edButtons[i].tagStart.length;
}
else {
- myField.value = myField.value.substring(0, startPos)
+ myField.value = myField.value.substring(0, startPos)
+ edButtons[i].tagEnd
+ myField.value.substring(endPos, myField.value.length);
edRemoveTag(i);
@@ -350,7 +350,7 @@ function edInsertContent(myField, myValue) {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos)
- + myValue
+ + myValue
+ myField.value.substring(endPos, myField.value.length);
myField.focus();
myField.selectionStart = startPos + myValue.length;
@@ -380,9 +380,9 @@ function edInsertLink(myField, i, defaultValue) {
function edInsertImage(myField) {
var myValue = prompt(quicktagsL10n.enterImageURL, 'http://');
if (myValue) {
- myValue = '<img src="'
- + myValue
- + '" alt="' + prompt(quicktagsL10n.enterImageDescription, '')
+ myValue = '<img src="'
+ + myValue
+ + '" alt="' + prompt(quicktagsL10n.enterImageDescription, '')
+ '" />';
edInsertContent(myField, myValue);
}
diff --git a/wp-includes/js/scriptaculous/MIT-LICENSE b/wp-includes/js/scriptaculous/MIT-LICENSE
index 5600377..384ca15 100644
--- a/wp-includes/js/scriptaculous/MIT-LICENSE
+++ b/wp-includes/js/scriptaculous/MIT-LICENSE
@@ -1,20 +1,20 @@
-Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file
diff --git a/wp-includes/js/scriptaculous/prototype.js b/wp-includes/js/scriptaculous/prototype.js
index 0cc66ee..5c73462 100644
--- a/wp-includes/js/scriptaculous/prototype.js
+++ b/wp-includes/js/scriptaculous/prototype.js
@@ -4181,4 +4181,4 @@ Object.extend(Element.ClassNames.prototype, Enumerable);
/*--------------------------------------------------------------------------*/
-Element.addMethods();
+Element.addMethods(); \ No newline at end of file
diff --git a/wp-includes/js/scriptaculous/scriptaculous.js b/wp-includes/js/scriptaculous/scriptaculous.js
index 8fafc39..c976e6b 100644
--- a/wp-includes/js/scriptaculous/scriptaculous.js
+++ b/wp-includes/js/scriptaculous/scriptaculous.js
@@ -55,4 +55,4 @@ var Scriptaculous = {
}
}
-Scriptaculous.load();
+Scriptaculous.load(); \ No newline at end of file
diff --git a/wp-includes/js/scriptaculous/unittest.js b/wp-includes/js/scriptaculous/unittest.js
index 959f13c..13473a3 100644
--- a/wp-includes/js/scriptaculous/unittest.js
+++ b/wp-includes/js/scriptaculous/unittest.js
@@ -565,4 +565,4 @@ Test.context = function(name, spec, log){
}
}
new Test.Unit.Runner(compiledSpec, { titles: titles, testLog: log || 'testlog', context: name });
-};
+}; \ No newline at end of file
diff --git a/wp-includes/js/thickbox/thickbox.css b/wp-includes/js/thickbox/thickbox.css
index dc502a7..cadee17 100644
--- a/wp-includes/js/thickbox/thickbox.css
+++ b/wp-includes/js/thickbox/thickbox.css
@@ -45,17 +45,19 @@
#TB_window {
position: fixed;
+ background: #ffffff;
z-index: 102;
color:#000000;
display:none;
+ border: 4px solid #525252;
text-align:left;
- top:20px;
+ top:50%;
left:50%;
}
* html #TB_window { /* ie6 hack */
position: absolute;
-margin-top: expression(20) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
+margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
}
#TB_window img#TB_Image {
@@ -80,24 +82,19 @@ margin-top: expression(20) + (TBWindowMargin = document.documentElement && docum
}
#TB_closeAjaxWindow{
- padding:7px 10px 5px 0;
- margin-bottom:1px;
+ padding:6px 10px 0;
text-align:right;
float:right;
}
#TB_ajaxWindowTitle{
float:left;
- padding:7px 0 5px 10px;
- margin-bottom:1px;
+ padding:6px 10px 0;
}
#TB_title{
background-color:#e8e8e8;
height:27px;
- border-width: 4px;
- border-color: #525252;
- border-style: solid solid none;
}
#TB_ajaxContent{
@@ -155,6 +152,5 @@ margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = d
clear:both;
border:none;
margin-bottom:-1px;
- margin-top:1px;
_margin-bottom:1px;
}
diff --git a/wp-includes/js/tinymce/langs/wp-langs.php b/wp-includes/js/tinymce/langs/wp-langs.php
index f9c5830..b1875e9 100644
--- a/wp-includes/js/tinymce/langs/wp-langs.php
+++ b/wp-includes/js/tinymce/langs/wp-langs.php
@@ -398,4 +398,4 @@ wp_more_alt:"' . mce_escape( __('More...') ) . '",
wp_page_alt:"' . mce_escape( __('Next page...') ) . '"
});
';
-?>
+?> \ No newline at end of file
diff --git a/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js b/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js
index aeea0a2..01a994e 100644
--- a/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js
+++ b/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js
@@ -1 +1 @@
-(function(){tinymce.create('tinymce.plugins.AutoSavePlugin',{init:function(ed,url){var t=this;t.editor=ed;window.onbeforeunload=tinymce.plugins.AutoSavePlugin._beforeUnloadHandler;},getInfo:function(){return{longname:'Auto save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',version:tinymce.majorVersion+"."+tinymce.minorVersion};},'static':{_beforeUnloadHandler:function(){var msg;tinymce.each(tinyMCE.editors,function(ed){if(ed.getParam("fullscreen_is_enabled"))return;if(ed.isDirty()){msg=ed.getLang("autosave.unload_msg");return false;}});return msg;}}});tinymce.PluginManager.add('autosave',tinymce.plugins.AutoSavePlugin);})();
+(function(){tinymce.create('tinymce.plugins.AutoSavePlugin',{init:function(ed,url){var t=this;t.editor=ed;window.onbeforeunload=tinymce.plugins.AutoSavePlugin._beforeUnloadHandler;},getInfo:function(){return{longname:'Auto save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',version:tinymce.majorVersion+"."+tinymce.minorVersion};},'static':{_beforeUnloadHandler:function(){var msg;tinymce.each(tinyMCE.editors,function(ed){if(ed.getParam("fullscreen_is_enabled"))return;if(ed.isDirty()){msg=ed.getLang("autosave.unload_msg");return false;}});return msg;}}});tinymce.PluginManager.add('autosave',tinymce.plugins.AutoSavePlugin);})(); \ No newline at end of file
diff --git a/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js b/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js
index 3c17bf9..6966d80 100644
--- a/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js
+++ b/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js
@@ -1 +1 @@
-(function(){tinymce.create('tinymce.plugins.Directionality',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceDirectionLTR',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="ltr")ed.dom.setAttrib(e,"dir","ltr");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addCommand('mceDirectionRTL',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="rtl")ed.dom.setAttrib(e,"dir","rtl");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addButton('ltr',{title:'directionality.ltr_desc',cmd:'mceDirectionLTR'});ed.addButton('rtl',{title:'directionality.rtl_desc',cmd:'mceDirectionRTL'});ed.onNodeChange.add(t._nodeChange,t);},getInfo:function(){return{longname:'Directionality',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var dom=ed.dom,dir;n=dom.getParent(n,dom.isBlock);if(!n){cm.setDisabled('ltr',1);cm.setDisabled('rtl',1);return;}dir=dom.getAttrib(n,'dir');cm.setActive('ltr',dir=="ltr");cm.setDisabled('ltr',0);cm.setActive('rtl',dir=="rtl");cm.setDisabled('rtl',0);}});tinymce.PluginManager.add('directionality',tinymce.plugins.Directionality);})();
+(function(){tinymce.create('tinymce.plugins.Directionality',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceDirectionLTR',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="ltr")ed.dom.setAttrib(e,"dir","ltr");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addCommand('mceDirectionRTL',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="rtl")ed.dom.setAttrib(e,"dir","rtl");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addButton('ltr',{title:'directionality.ltr_desc',cmd:'mceDirectionLTR'});ed.addButton('rtl',{title:'directionality.rtl_desc',cmd:'mceDirectionRTL'});ed.onNodeChange.add(t._nodeChange,t);},getInfo:function(){return{longname:'Directionality',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var dom=ed.dom,dir;n=dom.getParent(n,dom.isBlock);if(!n){cm.setDisabled('ltr',1);cm.setDisabled('rtl',1);return;}dir=dom.getAttrib(n,'dir');cm.setActive('ltr',dir=="ltr");cm.setDisabled('ltr',0);cm.setActive('rtl',dir=="rtl");cm.setDisabled('rtl',0);}});tinymce.PluginManager.add('directionality',tinymce.plugins.Directionality);})(); \ No newline at end of file
diff --git a/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js b/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js
index 46d3a7f..7b848f1 100644
--- a/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js
+++ b/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js
@@ -1 +1 @@
-(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.plugins.FullScreenPlugin',{init:function(ed,url){var t=this,s={},vp;t.editor=ed;ed.addCommand('mceFullScreen',function(){var win,de=DOM.doc.documentElement;if(ed.getParam('fullscreen_is_enabled')){if(ed.getParam('fullscreen_new_window'))closeFullscreen();else{DOM.win.setTimeout(function(){tinymce.dom.Event.remove(DOM.win,'resize',t.resizeFunc);tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format:'raw'}),{format:'raw'});tinyMCE.remove(ed);DOM.remove('mce_fullscreen_container');de.style.overflow=ed.getParam('fullscreen_html_overflow');DOM.setStyle(DOM.doc.body,'overflow',ed.getParam('fullscreen_overflow'));DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'),ed.getParam('fullscreen_scrolly'));tinyMCE.settings=tinyMCE.oldSettings;},10);}return;}if(ed.getParam('fullscreen_new_window')){win=DOM.win.open(url+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}}else{tinyMCE.oldSettings=tinyMCE.settings;s.fullscreen_overflow=DOM.getStyle(DOM.doc.body,'overflow',1)||'auto';s.fullscreen_html_overflow=DOM.getStyle(de,'overflow',1);vp=DOM.getViewPort();s.fullscreen_scrollx=vp.x;s.fullscreen_scrolly=vp.y;if(tinymce.isOpera&&s.fullscreen_overflow=='visible')s.fullscreen_overflow='auto';if(tinymce.isIE&&s.fullscreen_overflow=='scroll')s.fullscreen_overflow='auto';if(s.fullscreen_overflow=='0px')s.fullscreen_overflow='';DOM.setStyle(DOM.doc.body,'overflow','hidden');de.style.overflow='hidden';vp=DOM.getViewPort();DOM.win.scrollTo(0,0);if(tinymce.isIE)vp.h-=1;n=DOM.add(DOM.doc.body,'div',{id:'mce_fullscreen_container',style:'position:absolute;top:0;left:0;width:'+vp.w+'px;height:'+vp.h+'px;z-index:200000;'});DOM.add(n,'div',{id:'mce_fullscreen'});tinymce.each(ed.settings,function(v,n){s[n]=v;});s.id='mce_fullscreen';s.width=n.clientWidth;s.height=n.clientHeight-15;s.fullscreen_is_enabled=true;s.fullscreen_editor_id=ed.id;s.theme_advanced_resizing=false;s.save_onsavecallback=function(){ed.setContent(tinyMCE.get(s.id).getContent({format:'raw'}),{format:'raw'});ed.execCommand('mceSave');};tinymce.each(ed.getParam('fullscreen_settings'),function(v,k){s[k]=v;});if(s.theme_advanced_toolbar_location==='external')s.theme_advanced_toolbar_location='top';t.fullscreenEditor=new tinymce.Editor('mce_fullscreen',s);t.fullscreenEditor.onInit.add(function(){t.fullscreenEditor.setContent(ed.getContent());t.fullscreenEditor.focus();});t.fullscreenEditor.render();tinyMCE.add(t.fullscreenEditor);t.fullscreenElement=new tinymce.dom.Element('mce_fullscreen_container');t.fullscreenElement.update();t.resizeFunc=tinymce.dom.Event.add(DOM.win,'resize',function(){var vp=tinymce.DOM.getViewPort();t.fullscreenEditor.theme.resizeTo(vp.w,vp.h);});}});ed.addButton('fullscreen',{title:'fullscreen.desc',cmd:'mceFullScreen'});ed.onNodeChange.add(function(ed,cm){cm.setActive('fullscreen',ed.getParam('fullscreen_is_enabled'));});},getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('fullscreen',tinymce.plugins.FullScreenPlugin);})();
+(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.plugins.FullScreenPlugin',{init:function(ed,url){var t=this,s={},vp;t.editor=ed;ed.addCommand('mceFullScreen',function(){var win,de=DOM.doc.documentElement;if(ed.getParam('fullscreen_is_enabled')){if(ed.getParam('fullscreen_new_window'))closeFullscreen();else{DOM.win.setTimeout(function(){tinymce.dom.Event.remove(DOM.win,'resize',t.resizeFunc);tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format:'raw'}),{format:'raw'});tinyMCE.remove(ed);DOM.remove('mce_fullscreen_container');de.style.overflow=ed.getParam('fullscreen_html_overflow');DOM.setStyle(DOM.doc.body,'overflow',ed.getParam('fullscreen_overflow'));DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'),ed.getParam('fullscreen_scrolly'));tinyMCE.settings=tinyMCE.oldSettings;},10);}return;}if(ed.getParam('fullscreen_new_window')){win=DOM.win.open(url+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}}else{tinyMCE.oldSettings=tinyMCE.settings;s.fullscreen_overflow=DOM.getStyle(DOM.doc.body,'overflow',1)||'auto';s.fullscreen_html_overflow=DOM.getStyle(de,'overflow',1);vp=DOM.getViewPort();s.fullscreen_scrollx=vp.x;s.fullscreen_scrolly=vp.y;if(tinymce.isOpera&&s.fullscreen_overflow=='visible')s.fullscreen_overflow='auto';if(tinymce.isIE&&s.fullscreen_overflow=='scroll')s.fullscreen_overflow='auto';if(s.fullscreen_overflow=='0px')s.fullscreen_overflow='';DOM.setStyle(DOM.doc.body,'overflow','hidden');de.style.overflow='hidden';vp=DOM.getViewPort();DOM.win.scrollTo(0,0);if(tinymce.isIE)vp.h-=1;n=DOM.add(DOM.doc.body,'div',{id:'mce_fullscreen_container',style:'position:absolute;top:0;left:0;width:'+vp.w+'px;height:'+vp.h+'px;z-index:200000;'});DOM.add(n,'div',{id:'mce_fullscreen'});tinymce.each(ed.settings,function(v,n){s[n]=v;});s.id='mce_fullscreen';s.width=n.clientWidth;s.height=n.clientHeight-15;s.fullscreen_is_enabled=true;s.fullscreen_editor_id=ed.id;s.theme_advanced_resizing=false;s.save_onsavecallback=function(){ed.setContent(tinyMCE.get(s.id).getContent({format:'raw'}),{format:'raw'});ed.execCommand('mceSave');};tinymce.each(ed.getParam('fullscreen_settings'),function(v,k){s[k]=v;});if(s.theme_advanced_toolbar_location==='external')s.theme_advanced_toolbar_location='top';t.fullscreenEditor=new tinymce.Editor('mce_fullscreen',s);t.fullscreenEditor.onInit.add(function(){t.fullscreenEditor.setContent(ed.getContent());t.fullscreenEditor.focus();});t.fullscreenEditor.render();tinyMCE.add(t.fullscreenEditor);t.fullscreenElement=new tinymce.dom.Element('mce_fullscreen_container');t.fullscreenElement.update();t.resizeFunc=tinymce.dom.Event.add(DOM.win,'resize',function(){var vp=tinymce.DOM.getViewPort();t.fullscreenEditor.theme.resizeTo(vp.w,vp.h);});}});ed.addButton('fullscreen',{title:'fullscreen.desc',cmd:'mceFullScreen'});ed.onNodeChange.add(function(ed,cm){cm.setActive('fullscreen',ed.getParam('fullscreen_is_enabled'));});},getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('fullscreen',tinymce.plugins.FullScreenPlugin);})(); \ No newline at end of file
diff --git a/wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm b/wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm
index a18f396..97a6c7c 100644
--- a/wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm
+++ b/wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm
@@ -3,7 +3,7 @@
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <script type="text/javascript" src="../../tiny_mce.js?v=307"></script>
+ <script type="text/javascript" src="../../tiny_mce.js?ver=3091"></script>
<script type="text/javascript">
function patchCallback(settings, key) {
if (settings[key])
diff --git a/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js b/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js
index d942e45..2ddf43b 100644
--- a/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js
+++ b/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js
@@ -1 +1 @@
-(function(){var DOM=tinymce.DOM,Element=tinymce.dom.Element,Event=tinymce.dom.Event,each=tinymce.each,is=tinymce.is;tinymce.create('tinymce.plugins.InlinePopups',{init:function(ed,url){ed.onBeforeRenderUI.add(function(){ed.windowManager=new tinymce.InlineWindowManager(ed);DOM.loadCSS(url+'/skins/'+(ed.settings.inlinepopups_skin||'clearlooks2')+"/window.css");});},getInfo:function(){return{longname:'InlinePopups',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager',{InlineWindowManager:function(ed){var t=this;t.parent(ed);t.zIndex=300000;t.count=0;},open:function(f,p){var t=this,id,opt='',ed=t.editor,dw=0,dh=0,vp,po,mdf,clf,we,w,u;f=f||{};p=p||{};if(!f.inline)return t.parent(f,p);if(!f.type)t.bookmark=ed.selection.getBookmark('simple');id=DOM.uniqueId();vp=DOM.getViewPort();f.width=parseInt(f.width||320);f.height=parseInt(f.height||240)+(tinymce.isIE?8:0);f.min_width=parseInt(f.min_width||150);f.min_height=parseInt(f.min_height||100);f.max_width=parseInt(f.max_width||2000);f.max_height=parseInt(f.max_height||2000);f.left=f.left||Math.round(Math.max(vp.x,vp.x+(vp.w/ 2.0) - (f.width /2.0)));f.top=f.top||Math.round(Math.max(vp.y,vp.y+(vp.h/ 2.0) - (f.height /2.0)));f.movable=f.resizable=true;p.mce_width=f.width;p.mce_height=f.height;p.mce_inline=true;p.mce_window_id=id;p.mce_auto_focus=f.auto_focus;t.features=f;t.params=p;t.onOpen.dispatch(t,f,p);if(f.type){opt+=' mceModal';if(f.type)opt+=' mce'+f.type.substring(0,1).toUpperCase()+f.type.substring(1);f.resizable=false;}if(f.statusbar)opt+=' mceStatusbar';if(f.resizable)opt+=' mceResizable';if(f.minimizable)opt+=' mceMinimizable';if(f.maximizable)opt+=' mceMaximizable';if(f.movable)opt+=' mceMovable';t._addAll(DOM.doc.body,['div',{id:id,'class':ed.settings.inlinepopups_skin||'clearlooks2',style:'width:100px;height:100px'},['div',{id:id+'_wrapper','class':'mceWrapper'+opt},['div',{id:id+'_top','class':'mceTop'},['div',{'class':'mceLeft'}],['div',{'class':'mceCenter'}],['div',{'class':'mceRight'}],['span',{id:id+'_title'},f.title||'']],['div',{id:id+'_middle','class':'mceMiddle'},['div',{id:id+'_left','class':'mceLeft'}],['span',{id:id+'_content'}],['div',{id:id+'_right','class':'mceRight'}]],['div',{id:id+'_bottom','class':'mceBottom'},['div',{'class':'mceLeft'}],['div',{'class':'mceCenter'}],['div',{'class':'mceRight'}],['span',{id:id+'_status'},'Content']],['a',{'class':'mceMove',tabindex:'-1',href:'javascript:;'}],['a',{'class':'mceMin',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceMax',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceMed',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceClose',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{id:id+'_resize_n','class':'mceResize mceResizeN',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_s','class':'mceResize mceResizeS',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_w','class':'mceResize mceResizeW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_e','class':'mceResize mceResizeE',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_nw','class':'mceResize mceResizeNW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_ne','class':'mceResize mceResizeNE',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_sw','class':'mceResize mceResizeSW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_se','class':'mceResize mceResizeSE',tabindex:'-1',href:'javascript:;'}]]]);DOM.setStyles(id,{top:-10000,left:-10000});if(tinymce.isGecko)DOM.setStyle(id,'overflow','auto');if(!f.type){dw+=DOM.get(id+'_left').clientWidth;dw+=DOM.get(id+'_right').clientWidth;dh+=DOM.get(id+'_top').clientHeight;dh+=DOM.get(id+'_bottom').clientHeight;}DOM.setStyles(id,{top:f.top,left:f.left,width:f.width+dw,height:f.height+dh});u=f.url||f.file;if(u){if(tinymce.relaxedDomain)u+=(u.indexOf('?')==-1?'?':'&')+'mce_rdomain='+tinymce.relaxedDomain;u=tinymce._addVer(u);}if(!f.type){DOM.add(id+'_content','iframe',{id:id+'_ifr',src:'javascript:""',frameBorder:0,style:'border:0;width:10px;height:10px'});DOM.setStyles(id+'_ifr',{width:f.width,height:f.height});DOM.setAttrib(id+'_ifr','src',u);}else{DOM.add(id+'_wrapper','a',{id:id+'_ok','class':'mceButton mceOk',href:'javascript:;',onmousedown:'return false;'},'Ok');if(f.type=='confirm')DOM.add(id+'_wrapper','a',{'class':'mceButton mceCancel',href:'javascript:;',onmousedown:'return false;'},'Cancel');DOM.add(id+'_middle','div',{'class':'mceIcon'});DOM.setHTML(id+'_content',f.content.replace('\n','<br />'));}mdf=Event.add(id,'mousedown',function(e){var n=e.target,w,vp;w=t.windows[id];t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){if(n.className=='mceMax'){w.oldPos=w.element.getXY();w.oldSize=w.element.getSize();vp=DOM.getViewPort();vp.w-=2;vp.h-=2;w.element.moveTo(vp.x,vp.y);w.element.resizeTo(vp.w,vp.h);DOM.setStyles(id+'_ifr',{width:vp.w-w.deltaWidth,height:vp.h-w.deltaHeight});DOM.addClass(id+'_wrapper','mceMaximized');}else if(n.className=='mceMed'){w.element.moveTo(w.oldPos.x,w.oldPos.y);w.element.resizeTo(w.oldSize.w,w.oldSize.h);w.iframeElement.resizeTo(w.oldSize.w-w.deltaWidth,w.oldSize.h-w.deltaHeight);DOM.removeClass(id+'_wrapper','mceMaximized');}else if(n.className=='mceMove')return t._startDrag(id,e,n.className);else if(DOM.hasClass(n,'mceResize'))return t._startDrag(id,e,n.className.substring(13));}});clf=Event.add(id,'click',function(e){var n=e.target;t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){switch(n.className){case'mceClose':t.close(null,id);return Event.cancel(e);case'mceButton mceOk':case'mceButton mceCancel':f.button_func(n.className=='mceButton mceOk');return Event.cancel(e);}}});t.windows=t.windows||{};w=t.windows[id]={id:id,mousedown_func:mdf,click_func:clf,element:new Element(id,{blocker:1,container:ed.getContainer()}),iframeElement:new Element(id+'_ifr'),features:f,deltaWidth:dw,deltaHeight:dh};w.iframeElement.on('focus',function(){t.focus(id);});if(t.count==0&&t.editor.getParam('dialog_type')=='modal'){DOM.add(DOM.doc.body,'div',{id:'mceModalBlocker','class':(t.editor.settings.inlinepopups_skin||'clearlooks2')+'_modalBlocker',style:{left:vp.x,top:vp.y,zIndex:t.zIndex-1}});DOM.show('mceModalBlocker');}else DOM.setStyle('mceModalBlocker','z-index',t.zIndex-1);t.focus(id);t._fixIELayout(id,1);if(DOM.get(id+'_ok'))DOM.get(id+'_ok').focus();t.count++;return w;},focus:function(id){var t=this,w=t.windows[id];w.zIndex=this.zIndex++;w.element.setStyle('zIndex',w.zIndex);w.element.update();id=id+'_wrapper';DOM.removeClass(t.lastId,'mceFocus');DOM.addClass(id,'mceFocus');t.lastId=id;},_addAll:function(te,ne){var i,n,t=this,dom=tinymce.DOM;if(is(ne,'string'))te.appendChild(dom.doc.createTextNode(ne));else if(ne.length){te=te.appendChild(dom.create(ne[0],ne[1]));for(i=2;i<ne.length;i++)t._addAll(te,ne[i]);}},_startDrag:function(id,se,ac){var t=this,mu,mm,d=DOM.doc,eb,w=t.windows[id],we=w.element,sp=we.getXY(),p,sz,ph,cp,vp,sx,sy,sex,sey,dx,dy,dw,dh;cp={x:0,y:0};vp=DOM.getViewPort();vp.w-=2;vp.h-=2;sex=se.screenX;sey=se.screenY;dx=dy=dw=dh=0;mu=Event.add(d,'mouseup',function(e){Event.remove(d,'mouseup',mu);Event.remove(d,'mousemove',mm);if(eb)eb.remove();we.moveBy(dx,dy);we.resizeBy(dw,dh);sz=we.getSize();DOM.setStyles(id+'_ifr',{width:sz.w-w.deltaWidth,height:sz.h-w.deltaHeight});t._fixIELayout(id,1);return Event.cancel(e);});if(ac!='Move')startMove();function startMove(){if(eb)return;t._fixIELayout(id,0);DOM.add(d.body,'div',{id:'mceEventBlocker','class':'mceEventBlocker '+(t.editor.settings.inlinepopups_skin||'clearlooks2'),style:{left:vp.x,top:vp.y,zIndex:t.zIndex+1}});eb=new Element('mceEventBlocker');eb.update();p=we.getXY();sz=we.getSize();sx=cp.x+p.x-vp.x;sy=cp.y+p.y-vp.y;DOM.add(eb.get(),'div',{id:'mcePlaceHolder','class':'mcePlaceHolder',style:{left:sx,top:sy,width:sz.w,height:sz.h}});ph=new Element('mcePlaceHolder');};mm=Event.add(d,'mousemove',function(e){var x,y,v;startMove();x=e.screenX-sex;y=e.screenY-sey;switch(ac){case'ResizeW':dx=x;dw=0-x;break;case'ResizeE':dw=x;break;case'ResizeN':case'ResizeNW':case'ResizeNE':if(ac=="ResizeNW"){dx=x;dw=0-x;}else if(ac=="ResizeNE")dw=x;dy=y;dh=0-y;break;case'ResizeS':case'ResizeSW':case'ResizeSE':if(ac=="ResizeSW"){dx=x;dw=0-x;}else if(ac=="ResizeSE")dw=x;dh=y;break;case'mceMove':dx=x;dy=y;break;}if(dw<(v=w.features.min_width-sz.w)){if(dx!==0)dx+=dw-v;dw=v;}if(dh<(v=w.features.min_height-sz.h)){if(dy!==0)dy+=dh-v;dh=v;}dw=Math.min(dw,w.features.max_width-sz.w);dh=Math.min(dh,w.features.max_height-sz.h);dx=Math.max(dx,vp.x-(sx+vp.x));dy=Math.max(dy,vp.y-(sy+vp.y));dx=Math.min(dx,(vp.w+vp.x)-(sx+sz.w+vp.x));dy=Math.min(dy,(vp.h+vp.y)-(sy+sz.h+vp.y));if(dx+dy!==0){if(sx+dx<0)dx=0;if(sy+dy<0)dy=0;ph.moveTo(sx+dx,sy+dy);}if(dw+dh!==0)ph.resizeTo(sz.w+dw,sz.h+dh);return Event.cancel(e);});return Event.cancel(se);},resizeBy:function(dw,dh,id){var w=this.windows[id];if(w){w.element.resizeBy(dw,dh);w.iframeElement.resizeBy(dw,dh);}},close:function(win,id){var t=this,w,d=DOM.doc,ix=0,fw;t.count--;if(t.count==0)DOM.remove('mceModalBlocker');if(!id&&win){t.parent(win);return;}if(w=t.windows[id]){t.onClose.dispatch(t);Event.remove(d,'mousedown',w.mousedownFunc);Event.remove(d,'click',w.clickFunc);Event.clear(id);Event.clear(id+'_ifr');DOM.setAttrib(id+'_ifr','src','javascript:""');w.element.remove();delete t.windows[id];each(t.windows,function(w){if(w.zIndex>ix){fw=w;ix=w.zIndex;}});if(fw)t.focus(fw.id);}},setTitle:function(ti,id){var e;if(e=DOM.get(id+'_title'))e.innerHTML=DOM.encode(ti);},alert:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'alert',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},confirm:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'confirm',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},_fixIELayout:function(id,s){var w,img;if(!tinymce.isIE6)return;each(['n','s','w','e','nw','ne','sw','se'],function(v){var e=DOM.get(id+'_resize_'+v);DOM.setStyles(e,{width:s?e.clientWidth:'',height:s?e.clientHeight:'',cursor:DOM.getStyle(e,'cursor',1)});DOM.setStyle(id+"_bottom",'bottom','-1px');e=0;});if(w=this.windows[id]){w.element.hide();w.element.show();each(DOM.select('div,a',id),function(e,i){if(e.currentStyle.backgroundImage!='none'){img=new Image();img.src=e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,'$1');}});DOM.get(id).style.filter='';}}});tinymce.PluginManager.add('inlinepopups',tinymce.plugins.InlinePopups);})();
+(function(){var DOM=tinymce.DOM,Element=tinymce.dom.Element,Event=tinymce.dom.Event,each=tinymce.each,is=tinymce.is;tinymce.create('tinymce.plugins.InlinePopups',{init:function(ed,url){ed.onBeforeRenderUI.add(function(){ed.windowManager=new tinymce.InlineWindowManager(ed);DOM.loadCSS(url+'/skins/'+(ed.settings.inlinepopups_skin||'clearlooks2')+"/window.css");});},getInfo:function(){return{longname:'InlinePopups',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager',{InlineWindowManager:function(ed){var t=this;t.parent(ed);t.zIndex=300000;t.count=0;},open:function(f,p){var t=this,id,opt='',ed=t.editor,dw=0,dh=0,vp,po,mdf,clf,we,w,u;f=f||{};p=p||{};if(!f.inline)return t.parent(f,p);if(!f.type)t.bookmark=ed.selection.getBookmark('simple');id=DOM.uniqueId();vp=DOM.getViewPort();f.width=parseInt(f.width||320);f.height=parseInt(f.height||240)+(tinymce.isIE?8:0);f.min_width=parseInt(f.min_width||150);f.min_height=parseInt(f.min_height||100);f.max_width=parseInt(f.max_width||2000);f.max_height=parseInt(f.max_height||2000);f.left=f.left||Math.round(Math.max(vp.x,vp.x+(vp.w/ 2.0) - (f.width /2.0)));f.top=f.top||Math.round(Math.max(vp.y,vp.y+(vp.h/ 2.0) - (f.height /2.0)));f.movable=f.resizable=true;p.mce_width=f.width;p.mce_height=f.height;p.mce_inline=true;p.mce_window_id=id;p.mce_auto_focus=f.auto_focus;t.features=f;t.params=p;t.onOpen.dispatch(t,f,p);if(f.type){opt+=' mceModal';if(f.type)opt+=' mce'+f.type.substring(0,1).toUpperCase()+f.type.substring(1);f.resizable=false;}if(f.statusbar)opt+=' mceStatusbar';if(f.resizable)opt+=' mceResizable';if(f.minimizable)opt+=' mceMinimizable';if(f.maximizable)opt+=' mceMaximizable';if(f.movable)opt+=' mceMovable';t._addAll(DOM.doc.body,['div',{id:id,'class':ed.settings.inlinepopups_skin||'clearlooks2',style:'width:100px;height:100px'},['div',{id:id+'_wrapper','class':'mceWrapper'+opt},['div',{id:id+'_top','class':'mceTop'},['div',{'class':'mceLeft'}],['div',{'class':'mceCenter'}],['div',{'class':'mceRight'}],['span',{id:id+'_title'},f.title||'']],['div',{id:id+'_middle','class':'mceMiddle'},['div',{id:id+'_left','class':'mceLeft'}],['span',{id:id+'_content'}],['div',{id:id+'_right','class':'mceRight'}]],['div',{id:id+'_bottom','class':'mceBottom'},['div',{'class':'mceLeft'}],['div',{'class':'mceCenter'}],['div',{'class':'mceRight'}],['span',{id:id+'_status'},'Content']],['a',{'class':'mceMove',tabindex:'-1',href:'javascript:;'}],['a',{'class':'mceMin',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceMax',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceMed',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'mceClose',tabindex:'-1',href:'javascript:;',onmousedown:'return false;'}],['a',{id:id+'_resize_n','class':'mceResize mceResizeN',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_s','class':'mceResize mceResizeS',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_w','class':'mceResize mceResizeW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_e','class':'mceResize mceResizeE',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_nw','class':'mceResize mceResizeNW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_ne','class':'mceResize mceResizeNE',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_sw','class':'mceResize mceResizeSW',tabindex:'-1',href:'javascript:;'}],['a',{id:id+'_resize_se','class':'mceResize mceResizeSE',tabindex:'-1',href:'javascript:;'}]]]);DOM.setStyles(id,{top:-10000,left:-10000});if(tinymce.isGecko)DOM.setStyle(id,'overflow','auto');if(!f.type){dw+=DOM.get(id+'_left').clientWidth;dw+=DOM.get(id+'_right').clientWidth;dh+=DOM.get(id+'_top').clientHeight;dh+=DOM.get(id+'_bottom').clientHeight;}DOM.setStyles(id,{top:f.top,left:f.left,width:f.width+dw,height:f.height+dh});u=f.url||f.file;if(u){if(tinymce.relaxedDomain)u+=(u.indexOf('?')==-1?'?':'&')+'mce_rdomain='+tinymce.relaxedDomain;u=tinymce._addVer(u);}if(!f.type){DOM.add(id+'_content','iframe',{id:id+'_ifr',src:'javascript:""',frameBorder:0,style:'border:0;width:10px;height:10px'});DOM.setStyles(id+'_ifr',{width:f.width,height:f.height});DOM.setAttrib(id+'_ifr','src',u);}else{DOM.add(id+'_wrapper','a',{id:id+'_ok','class':'mceButton mceOk',href:'javascript:;',onmousedown:'return false;'},'Ok');if(f.type=='confirm')DOM.add(id+'_wrapper','a',{'class':'mceButton mceCancel',href:'javascript:;',onmousedown:'return false;'},'Cancel');DOM.add(id+'_middle','div',{'class':'mceIcon'});DOM.setHTML(id+'_content',f.content.replace('\n','<br />'));}mdf=Event.add(id,'mousedown',function(e){var n=e.target,w,vp;w=t.windows[id];t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){if(n.className=='mceMax'){w.oldPos=w.element.getXY();w.oldSize=w.element.getSize();vp=DOM.getViewPort();vp.w-=2;vp.h-=2;w.element.moveTo(vp.x,vp.y);w.element.resizeTo(vp.w,vp.h);DOM.setStyles(id+'_ifr',{width:vp.w-w.deltaWidth,height:vp.h-w.deltaHeight});DOM.addClass(id+'_wrapper','mceMaximized');}else if(n.className=='mceMed'){w.element.moveTo(w.oldPos.x,w.oldPos.y);w.element.resizeTo(w.oldSize.w,w.oldSize.h);w.iframeElement.resizeTo(w.oldSize.w-w.deltaWidth,w.oldSize.h-w.deltaHeight);DOM.removeClass(id+'_wrapper','mceMaximized');}else if(n.className=='mceMove')return t._startDrag(id,e,n.className);else if(DOM.hasClass(n,'mceResize'))return t._startDrag(id,e,n.className.substring(13));}});clf=Event.add(id,'click',function(e){var n=e.target;t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){switch(n.className){case'mceClose':t.close(null,id);return Event.cancel(e);case'mceButton mceOk':case'mceButton mceCancel':f.button_func(n.className=='mceButton mceOk');return Event.cancel(e);}}});t.windows=t.windows||{};w=t.windows[id]={id:id,mousedown_func:mdf,click_func:clf,element:new Element(id,{blocker:1,container:ed.getContainer()}),iframeElement:new Element(id+'_ifr'),features:f,deltaWidth:dw,deltaHeight:dh};w.iframeElement.on('focus',function(){t.focus(id);});if(t.count==0&&t.editor.getParam('dialog_type')=='modal'){DOM.add(DOM.doc.body,'div',{id:'mceModalBlocker','class':(t.editor.settings.inlinepopups_skin||'clearlooks2')+'_modalBlocker',style:{left:vp.x,top:vp.y,zIndex:t.zIndex-1}});DOM.show('mceModalBlocker');}else DOM.setStyle('mceModalBlocker','z-index',t.zIndex-1);t.focus(id);t._fixIELayout(id,1);if(DOM.get(id+'_ok'))DOM.get(id+'_ok').focus();t.count++;return w;},focus:function(id){var t=this,w=t.windows[id];w.zIndex=this.zIndex++;w.element.setStyle('zIndex',w.zIndex);w.element.update();id=id+'_wrapper';DOM.removeClass(t.lastId,'mceFocus');DOM.addClass(id,'mceFocus');t.lastId=id;},_addAll:function(te,ne){var i,n,t=this,dom=tinymce.DOM;if(is(ne,'string'))te.appendChild(dom.doc.createTextNode(ne));else if(ne.length){te=te.appendChild(dom.create(ne[0],ne[1]));for(i=2;i<ne.length;i++)t._addAll(te,ne[i]);}},_startDrag:function(id,se,ac){var t=this,mu,mm,d=DOM.doc,eb,w=t.windows[id],we=w.element,sp=we.getXY(),p,sz,ph,cp,vp,sx,sy,sex,sey,dx,dy,dw,dh;cp={x:0,y:0};vp=DOM.getViewPort();vp.w-=2;vp.h-=2;sex=se.screenX;sey=se.screenY;dx=dy=dw=dh=0;mu=Event.add(d,'mouseup',function(e){Event.remove(d,'mouseup',mu);Event.remove(d,'mousemove',mm);if(eb)eb.remove();we.moveBy(dx,dy);we.resizeBy(dw,dh);sz=we.getSize();DOM.setStyles(id+'_ifr',{width:sz.w-w.deltaWidth,height:sz.h-w.deltaHeight});t._fixIELayout(id,1);return Event.cancel(e);});if(ac!='Move')startMove();function startMove(){if(eb)return;t._fixIELayout(id,0);DOM.add(d.body,'div',{id:'mceEventBlocker','class':'mceEventBlocker '+(t.editor.settings.inlinepopups_skin||'clearlooks2'),style:{left:vp.x,top:vp.y,zIndex:t.zIndex+1}});eb=new Element('mceEventBlocker');eb.update();p=we.getXY();sz=we.getSize();sx=cp.x+p.x-vp.x;sy=cp.y+p.y-vp.y;DOM.add(eb.get(),'div',{id:'mcePlaceHolder','class':'mcePlaceHolder',style:{left:sx,top:sy,width:sz.w,height:sz.h}});ph=new Element('mcePlaceHolder');};mm=Event.add(d,'mousemove',function(e){var x,y,v;startMove();x=e.screenX-sex;y=e.screenY-sey;switch(ac){case'ResizeW':dx=x;dw=0-x;break;case'ResizeE':dw=x;break;case'ResizeN':case'ResizeNW':case'ResizeNE':if(ac=="ResizeNW"){dx=x;dw=0-x;}else if(ac=="ResizeNE")dw=x;dy=y;dh=0-y;break;case'ResizeS':case'ResizeSW':case'ResizeSE':if(ac=="ResizeSW"){dx=x;dw=0-x;}else if(ac=="ResizeSE")dw=x;dh=y;break;case'mceMove':dx=x;dy=y;break;}if(dw<(v=w.features.min_width-sz.w)){if(dx!==0)dx+=dw-v;dw=v;}if(dh<(v=w.features.min_height-sz.h)){if(dy!==0)dy+=dh-v;dh=v;}dw=Math.min(dw,w.features.max_width-sz.w);dh=Math.min(dh,w.features.max_height-sz.h);dx=Math.max(dx,vp.x-(sx+vp.x));dy=Math.max(dy,vp.y-(sy+vp.y));dx=Math.min(dx,(vp.w+vp.x)-(sx+sz.w+vp.x));dy=Math.min(dy,(vp.h+vp.y)-(sy+sz.h+vp.y));if(dx+dy!==0){if(sx+dx<0)dx=0;if(sy+dy<0)dy=0;ph.moveTo(sx+dx,sy+dy);}if(dw+dh!==0)ph.resizeTo(sz.w+dw,sz.h+dh);return Event.cancel(e);});return Event.cancel(se);},resizeBy:function(dw,dh,id){var w=this.windows[id];if(w){w.element.resizeBy(dw,dh);w.iframeElement.resizeBy(dw,dh);}},close:function(win,id){var t=this,w,d=DOM.doc,ix=0,fw,id;id=t._findId(id||win);t.count--;if(t.count==0)DOM.remove('mceModalBlocker');if(!id&&win){t.parent(win);return;}if(w=t.windows[id]){t.onClose.dispatch(t);Event.remove(d,'mousedown',w.mousedownFunc);Event.remove(d,'click',w.clickFunc);Event.clear(id);Event.clear(id+'_ifr');DOM.setAttrib(id+'_ifr','src','javascript:""');w.element.remove();delete t.windows[id];each(t.windows,function(w){if(w.zIndex>ix){fw=w;ix=w.zIndex;}});if(fw)t.focus(fw.id);}},setTitle:function(w,ti){var e;w=this._findId(w);if(e=DOM.get(w+'_title'))e.innerHTML=DOM.encode(ti);},alert:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'alert',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},confirm:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'confirm',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},_findId:function(w){var t=this;if(typeof(w)=='string')return w;each(t.windows,function(wo){var ifr=DOM.get(wo.id+'_ifr');if(ifr&&w==ifr.contentWindow){w=wo.id;return false;}});return w;},_fixIELayout:function(id,s){var w,img;if(!tinymce.isIE6)return;each(['n','s','w','e','nw','ne','sw','se'],function(v){var e=DOM.get(id+'_resize_'+v);DOM.setStyles(e,{width:s?e.clientWidth:'',height:s?e.clientHeight:'',cursor:DOM.getStyle(e,'cursor',1)});DOM.setStyle(id+"_bottom",'bottom','-1px');e=0;});if(w=this.windows[id]){w.element.hide();w.element.show();each(DOM.select('div,a',id),function(e,i){if(e.currentStyle.backgroundImage!='none'){img=new Image();img.src=e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,'$1');}});DOM.get(id).style.filter='';}}});tinymce.PluginManager.add('inlinepopups',tinymce.plugins.InlinePopups);})(); \ No newline at end of file
diff --git a/wp-includes/js/tinymce/plugins/inlinepopups/template.htm b/wp-includes/js/tinymce/plugins/inlinepopups/template.htm
index 8fe667e..79c89dc 100644
--- a/wp-includes/js/tinymce/plugins/inlinepopups/template.htm
+++ b/wp-includes/js/tinymce/plugins/inlinepopups/template.htm
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Template for dialogs</title>
-<link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css?v=307" />
+<link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css?ver=3091" />
</head>
<body>
diff --git a/wp-includes/js/tinymce/plugins/media/css/media.css b/wp-includes/js/tinymce/plugins/media/css/media.css
index 62d666a..7b2253b 100644
--- a/wp-includes/js/tinymce/plugins/media/css/media.css
+++ b/wp-includes/js/tinymce/plugins/media/css/media.css
@@ -1,68 +1,16 @@
-#id, #name, #hspace, #vspace, #class_name, #align {
- width: 100px;
-}
-
-#hspace, #vspace {
- width: 50px;
-}
-
-#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode {
- width: 100px;
-}
-
-#flash_base, #flash_flashvars {
- width: 240px;
-}
-
-#width, #height {
- width: 40px;
-}
-
-#src, #media_type {
- width: 250px;
-}
-
-#class {
- width: 120px;
-}
-
-#prev {
- margin: 0;
- border: 1px solid black;
- width: 99%;
- height: 230px;
- overflow: auto;
-}
-
-.panel_wrapper div.current {
- height: 390px;
- overflow: auto;
-}
-
-#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options {
- display: none;
-}
-
-.mceAddSelectValue {
- background-color: #DDDDDD;
-}
-
-#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume {
- width: 70px;
-}
-
-#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume {
- width: 70px;
-}
-
-#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks {
- width: 70px;
-}
-
-#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle {
- width: 90px;
-}
-
-#qt_qtsrc {
- width: 200px;
-}
+#id, #name, #hspace, #vspace, #class_name, #align { width: 100px }
+#hspace, #vspace { width: 50px }
+#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px }
+#flash_base, #flash_flashvars { width: 240px }
+#width, #height { width: 40px }
+#src, #media_type { width: 250px }
+#class { width: 120px }
+#prev { margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: auto }
+.panel_wrapper div.current { height: 390px; overflow: auto }
+#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none }
+.mceAddSelectValue { background-color: #DDDDDD }
+#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px }
+#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px }
+#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px }
+#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px }
+#qt_qtsrc { width: 200px }
diff --git a/wp-includes/js/tinymce/plugins/media/editor_plugin.js b/wp-includes/js/tinymce/plugins/media/editor_plugin.js
index 0001174..4591be7 100644
--- a/wp-includes/js/tinymce/plugins/media/editor_plugin.js
+++ b/wp-includes/js/tinymce/plugins/media/editor_plugin.js
@@ -1 +1 @@
-(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.MediaPlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;function isMediaElm(n){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);};ed.addCommand('mceMedia',function(){ed.windowManager.open({file:url+'/media.htm',width:430+parseInt(ed.getLang('media.delta_width',0)),height:470+parseInt(ed.getLang('media.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('media',{title:'media.desc',cmd:'mceMedia'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('media',n.nodeName=='IMG'&&isMediaElm(n));});ed.onInit.add(function(){var lo={mceItemFlash:'flash',mceItemShockWave:'shockwave',mceItemWindowsMedia:'windowsmedia',mceItemQuickTime:'quicktime',mceItemRealMedia:'realmedia'};if(ed.settings.content_css!==false)ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.name=='img'){each(lo,function(v,k){if(ed.dom.hasClass(o.node,k)){o.name=v;o.title=ed.dom.getAttrib(o.node,'title');return false;}});}});}if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){if(e.nodeName=='IMG'&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)){m.add({title:'media.edit',icon:'media',cmd:'mceMedia'});}});}});ed.onBeforeSetContent.add(function(ed,o){var h=o.content;h=h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(a,b,c){var o=t._parse(c);return'<img class="mceItem'+b+'" title="'+ed.dom.encode(c)+'" src="'+url+'/img/trans.gif" width="'+o.width+'" height="'+o.height+'" />'});h=h.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');h=h.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');h=h.replace(/<\/(object|embed)([^>]*)>/gi,'</span>');h=h.replace(/<param([^>]*)>/gi,function(a,b){return'<span '+b.replace(/value=/gi,'_value=')+' class="mceItemParam"></span>'});h=h.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');o.content=h;});ed.onSetContent.add(function(){t._spansToImgs(ed.getBody());});ed.onPreProcess.add(function(ed,o){var dom=ed.dom;if(o.set){t._spansToImgs(o.node);each(dom.select('IMG',o.node),function(n){var p;if(isMediaElm(n)){p=t._parse(n.title);dom.setAttrib(n,'width',dom.getAttrib(n,'width',p.width||100));dom.setAttrib(n,'height',dom.getAttrib(n,'height',p.height||100));}});}if(o.get){each(dom.select('IMG',o.node),function(n){var ci,cb,mt;if(ed.getParam('media_use_script')){if(isMediaElm(n))n.className=n.className.replace(/mceItem/g,'mceTemp');return;}switch(n.className){case'mceItemFlash':ci='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='application/x-shockwave-flash';break;case'mceItemShockWave':ci='166b1bca-3f9c-11cf-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'mceItemWindowsMedia':ci=ed.getParam('media_wmp6_compatible')?'05589fa1-c356-11ce-bf01-00aa0055595a':'6bf52a52-394a-11d3-b153-00c04f79faa6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'mceItemQuickTime':ci='02bf25d5-8c17-4b23-bc80-d3488abddc6b';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'mceItemRealMedia':ci='cfcdaa03-8be4-11cf-b84b-0020afbbccfa';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='audio/x-pn-realaudio-plugin';break;}if(ci){dom.replace(t._buildObj({classid:ci,codebase:cb,type:mt},n),n);}});}});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/_value=/g,'value=');});if(ed.getParam('media_use_script')){function getAttr(s,n){n=new RegExp(n+'=\"([^\"]+)\"','g').exec(s);return n?ed.dom.decode(n[1]):'';};ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/<img[^>]+>/g,function(im){var cl=getAttr(im,'class');if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)){at=t._parse(getAttr(im,'title'));at.width=getAttr(im,'width');at.height=getAttr(im,'height');im='<script type="text/javascript">write'+cl.substring(7)+'({'+t._serialize(at)+'});</script>';}return im;});});}},getInfo:function(){return{longname:'Media',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_buildObj:function(o,n){var ob,ed=this.editor,dom=ed.dom,p=this._parse(n.title);p.width=o.width=dom.getAttrib(n,'width')||100;p.height=o.height=dom.getAttrib(n,'height')||100;ob=dom.create('span',{mce_name:'object',classid:"clsid:"+o.classid,codebase:o.codebase,width:o.width,height:o.height});if(p.src)p.src=ed.convertURL(p.src,'src',n);each(p,function(v,k){if(!/^(width|height|codebase|classid)$/.test(k)){if(o.type=='application/x-mplayer2'&&k=='src')k='url';dom.add(ob,'span',{mce_name:'param',name:k,'_value':v});}});dom.add(ob,'span',tinymce.extend({mce_name:'embed',type:o.type},p));return ob;},_spansToImgs:function(p){var t=this,dom=t.editor.dom,im,ci;each(dom.select('span',p),function(n){if(dom.getAttrib(n,'class')=='mceItemObject'){ci=dom.getAttrib(n,"classid").toLowerCase().replace(/\s+/g,'');switch(ci){case'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':dom.replace(t._createImg('mceItemFlash',n),n);break;case'clsid:166b1bca-3f9c-11cf-8075-444553540000':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':case'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':case'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}return;}if(dom.getAttrib(n,'class')=='mceItemEmbed'){switch(dom.getAttrib(n,'type')){case'application/x-shockwave-flash':dom.replace(t._createImg('mceItemFlash',n),n);break;case'application/x-director':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'application/x-mplayer2':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'video/quicktime':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'audio/x-pn-realaudio-plugin':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}}});},_createImg:function(cl,n){var im,dom=this.editor.dom,pa={},ti='';im=dom.create('img',{src:this.url+'/img/trans.gif',width:dom.getAttrib(n,'width')||100,height:dom.getAttrib(n,'height')||100,'class':cl});each(['id','name','width','height','bgcolor','align','flashvars','src','wmode'],function(na){var v=dom.getAttrib(n,na);if(v)pa[na]=v;});each(dom.select('span',n),function(n){if(dom.hasClass(n,'mceItemParam'))pa[dom.getAttrib(n,'name')]=dom.getAttrib(n,'_value');});if(pa.movie){pa.src=pa.movie;delete pa.movie;}delete pa.width;delete pa.height;im.title=this._serialize(pa);return im;},_parse:function(s){return tinymce.util.JSON.parse('{'+s+'}');},_serialize:function(o){return tinymce.util.JSON.serialize(o).replace(/[{}]/g,'');}});tinymce.PluginManager.add('media',tinymce.plugins.MediaPlugin);})();
+(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.MediaPlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;function isMediaElm(n){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);};ed.addCommand('mceMedia',function(){ed.windowManager.open({file:url+'/media.htm',width:430+parseInt(ed.getLang('media.delta_width',0)),height:470+parseInt(ed.getLang('media.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('media',{title:'media.desc',cmd:'mceMedia'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('media',n.nodeName=='IMG'&&isMediaElm(n));});ed.onInit.add(function(){var lo={mceItemFlash:'flash',mceItemShockWave:'shockwave',mceItemWindowsMedia:'windowsmedia',mceItemQuickTime:'quicktime',mceItemRealMedia:'realmedia'};if(ed.settings.content_css!==false)ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.name=='img'){each(lo,function(v,k){if(ed.dom.hasClass(o.node,k)){o.name=v;o.title=ed.dom.getAttrib(o.node,'title');return false;}});}});}if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){if(e.nodeName=='IMG'&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)){m.add({title:'media.edit',icon:'media',cmd:'mceMedia'});}});}});ed.onBeforeSetContent.add(function(ed,o){var h=o.content;h=h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(a,b,c){var o=t._parse(c);return'<img class="mceItem'+b+'" title="'+ed.dom.encode(c)+'" src="'+url+'/img/trans.gif" width="'+o.width+'" height="'+o.height+'" />'});h=h.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');h=h.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');h=h.replace(/<\/(object|embed)([^>]*)>/gi,'</span>');h=h.replace(/<param([^>]*)>/gi,function(a,b){return'<span '+b.replace(/value=/gi,'_value=')+' class="mceItemParam"></span>'});h=h.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');o.content=h;});ed.onSetContent.add(function(){t._spansToImgs(ed.getBody());});ed.onPreProcess.add(function(ed,o){var dom=ed.dom;if(o.set){t._spansToImgs(o.node);each(dom.select('IMG',o.node),function(n){var p;if(isMediaElm(n)){p=t._parse(n.title);dom.setAttrib(n,'width',dom.getAttrib(n,'width',p.width||100));dom.setAttrib(n,'height',dom.getAttrib(n,'height',p.height||100));}});}if(o.get){each(dom.select('IMG',o.node),function(n){var ci,cb,mt;if(ed.getParam('media_use_script')){if(isMediaElm(n))n.className=n.className.replace(/mceItem/g,'mceTemp');return;}switch(n.className){case'mceItemFlash':ci='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='application/x-shockwave-flash';break;case'mceItemShockWave':ci='166b1bca-3f9c-11cf-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'mceItemWindowsMedia':ci=ed.getParam('media_wmp6_compatible')?'05589fa1-c356-11ce-bf01-00aa0055595a':'6bf52a52-394a-11d3-b153-00c04f79faa6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'mceItemQuickTime':ci='02bf25d5-8c17-4b23-bc80-d3488abddc6b';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'mceItemRealMedia':ci='cfcdaa03-8be4-11cf-b84b-0020afbbccfa';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='audio/x-pn-realaudio-plugin';break;}if(ci){dom.replace(t._buildObj({classid:ci,codebase:cb,type:mt},n),n);}});}});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/_value=/g,'value=');});if(ed.getParam('media_use_script')){function getAttr(s,n){n=new RegExp(n+'=\"([^\"]+)\"','g').exec(s);return n?ed.dom.decode(n[1]):'';};ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/<img[^>]+>/g,function(im){var cl=getAttr(im,'class');if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)){at=t._parse(getAttr(im,'title'));at.width=getAttr(im,'width');at.height=getAttr(im,'height');im='<script type="text/javascript">write'+cl.substring(7)+'({'+t._serialize(at)+'});</script>';}return im;});});}},getInfo:function(){return{longname:'Media',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_buildObj:function(o,n){var ob,ed=this.editor,dom=ed.dom,p=this._parse(n.title);p.width=o.width=dom.getAttrib(n,'width')||100;p.height=o.height=dom.getAttrib(n,'height')||100;ob=dom.create('span',{mce_name:'object',classid:"clsid:"+o.classid,codebase:o.codebase,width:o.width,height:o.height});if(p.src)p.src=ed.convertURL(p.src,'src',n);each(p,function(v,k){if(!/^(width|height|codebase|classid)$/.test(k)){if(o.type=='application/x-mplayer2'&&k=='src')k='url';dom.add(ob,'span',{mce_name:'param',name:k,'_value':v});}});dom.add(ob,'span',tinymce.extend({mce_name:'embed',type:o.type},p));return ob;},_spansToImgs:function(p){var t=this,dom=t.editor.dom,im,ci;each(dom.select('span',p),function(n){if(dom.getAttrib(n,'class')=='mceItemObject'){ci=dom.getAttrib(n,"classid").toLowerCase().replace(/\s+/g,'');switch(ci){case'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':dom.replace(t._createImg('mceItemFlash',n),n);break;case'clsid:166b1bca-3f9c-11cf-8075-444553540000':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':case'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':case'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}return;}if(dom.getAttrib(n,'class')=='mceItemEmbed'){switch(dom.getAttrib(n,'type')){case'application/x-shockwave-flash':dom.replace(t._createImg('mceItemFlash',n),n);break;case'application/x-director':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'application/x-mplayer2':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'video/quicktime':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'audio/x-pn-realaudio-plugin':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}}});},_createImg:function(cl,n){var im,dom=this.editor.dom,pa={},ti='';im=dom.create('img',{src:this.url+'/img/trans.gif',width:dom.getAttrib(n,'width')||100,height:dom.getAttrib(n,'height')||100,'class':cl});each(['id','name','width','height','bgcolor','align','flashvars','src','wmode'],function(na){var v=dom.getAttrib(n,na);if(v)pa[na]=v;});each(dom.select('span',n),function(n){if(dom.hasClass(n,'mceItemParam'))pa[dom.getAttrib(n,'name')]=dom.getAttrib(n,'_value');});if(pa.movie){pa.src=pa.movie;delete pa.movie;}delete pa.width;delete pa.height;im.title=this._serialize(pa);return im;},_parse:function(s){return tinymce.util.JSON.parse('{'+s+'}');},_serialize:function(o){return tinymce.util.JSON.serialize(o).replace(/[{}]/g,'');}});tinymce.PluginManager.add('media',tinymce.plugins.MediaPlugin);})(); \ No newline at end of file
diff --git a/wp-includes/js/tinymce/plugins/media/js/media.js b/wp-includes/js/tinymce/plugins/media/js/media.js
index 58d2faf..0f0cfd6 100644
--- a/wp-includes/js/tinymce/plugins/media/js/media.js
+++ b/wp-includes/js/tinymce/plugins/media/js/media.js
@@ -598,14 +598,17 @@ function generatePreview(c) {
pl.name = !pl.name ? 'eobj' : pl.name;
pl.align = !pl.align ? '' : pl.align;
- h += '<object classid="clsid:' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">';
+ // Avoid annoying warning about insecure items
+ if (!tinymce.isIE || document.location.protocol != 'https:') {
+ h += '<object classid="clsid:' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">';
- for (n in pl) {
- h += '<param name="' + n + '" value="' + pl[n] + '">';
+ for (n in pl) {
+ h += '<param name="' + n + '" value="' + pl[n] + '">';
- // Add extra url parameter if it's an absolute URL
- if (n == 'src' && pl[n].indexOf('://') != -1)
- h += '<param name="url" value="' + pl[n] + '" />';
+ // Add extra url parameter if it's an absolute URL
+ if (n == 'src' && pl[n].indexOf('://') != -1)
+ h += '<param name="url" value="' + pl[n] + '" />';
+ }
}
h += '<embed type="' + type + '" ';
@@ -613,7 +616,11 @@ function generatePreview(c) {
for (n in pl)
h += n + '="' + pl[n] + '" ';
- h += '></embed></object>';
+ h += '></embed>';
+
+ // Avoid annoying warning about insecure items
+ if (!tinymce.isIE || document.location.protocol != 'https:')
+ h += '</object>';
p.innerHTML = "<!-- x --->" + h;
}
diff --git a/wp-includes/js/tinymce/plugins/media/media.htm b/wp-includes/js/tinymce/plugins/media/media.htm
index 69d9e77..4986c75 100644
--- a/wp-includes/js/tinymce/plugins/media/media.htm
+++ b/wp-includes/js/tinymce/plugins/media/media.htm
@@ -2,13 +2,13 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#media_dlg.title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?v=307"></script>
- <script type="text/javascript" src="js/media.js?v=307"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
- <script type="text/javascript" src="../../utils/validate.js?v=307"></script>
- <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
- <script type="text/javascript" src="../../utils/editable_selects.js?v=307"></script>
- <link href="css/media.css?v=307" rel="stylesheet" type="text/css" />
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3091"></script>
+ <script type="text/javascript" src="js/media.js?ver=3091"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3091"></script>
+ <script type="text/javascript" src="../../utils/validate.js?ver=3091"></script>
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3091"></script>
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=3091"></script>
+ <link href="css/media.css?ver=3091" rel="stylesheet" type="text/css" />
<base target="_self" />
</head>
<body style="display: none">
diff --git a/wp-includes/js/tinymce/plugins/paste/blank.htm b/wp-includes/js/tinymce/plugins/paste/blank.htm
index fcf3217..0d749fc 100644
--- a/wp-includes/js/tinymce/plugins/paste/blank.htm
+++ b/wp-includes/js/tinymce/plugins/paste/blank.htm
@@ -1,22 +1,22 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title>blank_page</title>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link href="css/blank.css?v=307" rel="stylesheet" type="text/css" />
-<base target="_self" />
-<script type="text/javascript">
-function init() {
- if (parent.tinymce.isIE)
- document.body.contentEditable = true;
- else
- document.designMode = 'on';
-
- parent.initIframe(document);
- window.focus();
-}
-</script>
-</head>
-<body onload="init();">
-
-</body>
-</html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>blank_page</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link href="css/blank.css?ver=3091" rel="stylesheet" type="text/css" />
+<base target="_self" />
+<script type="text/javascript">
+function init() {
+ if (parent.tinymce.isIE)
+ document.body.contentEditable = true;
+ else
+ document.designMode = 'on';
+
+ parent.initIframe(document);
+ window.focus();
+}
+</script>
+</head>
+<body onload="init();">
+
+</body>
+</html>
diff --git a/wp-includes/js/tinymce/plugins/paste/css/blank.css b/wp-includes/js/tinymce/plugins/paste/css/blank.css
index 6b16bac..f1ab113 100644
--- a/wp-includes/js/tinymce/plugins/paste/css/blank.css
+++ b/wp-includes/js/tinymce/plugins/paste/css/blank.css
@@ -1,14 +1,14 @@
-html, body {height:98%}
-body {
-background-color: #FFFFFF;
-font-family: Verdana, Arial, Helvetica, sans-serif;
-font-size: 10px;
-scrollbar-3dlight-color: #F0F0EE;
-scrollbar-arrow-color: #676662;
-scrollbar-base-color: #F0F0EE;
-scrollbar-darkshadow-color: #DDDDDD;
-scrollbar-face-color: #E0E0DD;
-scrollbar-highlight-color: #F0F0EE;
-scrollbar-shadow-color: #F0F0EE;
-scrollbar-track-color: #F5F5F5;
-}
+html, body {height:98%}
+body {
+background-color: #FFFFFF;
+font-family: Verdana, Arial, Helvetica, sans-serif;
+font-size: 10px;
+scrollbar-3dlight-color: #F0F0EE;
+scrollbar-arrow-color: #676662;
+scrollbar-base-color: #F0F0EE;
+scrollbar-darkshadow-color: #DDDDDD;
+scrollbar-face-color: #E0E0DD;
+scrollbar-highlight-color: #F0F0EE;
+scrollbar-shadow-color: #F0F0EE;
+scrollbar-track-color: #F5F5F5;
+}
diff --git a/wp-includes/js/tinymce/plugins/paste/css/pasteword.css b/wp-includes/js/tinymce/plugins/paste/css/pasteword.css
index b3be627..77685fd 100644
--- a/wp-includes/js/tinymce/plugins/paste/css/pasteword.css
+++ b/wp-includes/js/tinymce/plugins/paste/css/pasteword.css
@@ -1,3 +1,3 @@
-.sourceIframe {
- border: 1px solid #808080;
-}
+.sourceIframe {
+ border: 1px solid #808080;
+}
diff --git a/wp-includes/js/tinymce/plugins/paste/editor_plugin.js b/wp-includes/js/tinymce/plugins/paste/editor_plugin.js
index e841917..4a35002 100644
--- a/wp-includes/js/tinymce/plugins/paste/editor_plugin.js
+++ b/wp-includes/js/tinymce/plugins/paste/editor_plugin.js
@@ -1 +1 @@
-(function(){var Event=tinymce.dom.Event;tinymce.create('tinymce.plugins.PastePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mcePasteText',function(ui,v){if(ui){if((ed.getParam('paste_use_dialog',true))||(!tinymce.isIE)){ed.windowManager.open({file:url+'/pastetext.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertText(clipboardData.getData("Text"),true);}else t._insertText(v.html,v.linebreaks);});ed.addCommand('mcePasteWord',function(ui,v){if(ui){if((ed.getParam('paste_use_dialog',true))||(!tinymce.isIE)){ed.windowManager.open({file:url+'/pasteword.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertText(t._clipboardHTML());}else t._insertWordContent(v);});ed.addCommand('mceSelectAll',function(){ed.execCommand('selectall');});ed.addButton('pastetext',{title:'paste.paste_text_desc',cmd:'mcePasteText',ui:true});ed.addButton('pasteword',{title:'paste.paste_word_desc',cmd:'mcePasteWord',ui:true});ed.addButton('selectall',{title:'paste.selectall_desc',cmd:'mceSelectAll'});if(ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onPaste.add(function(ed,e){return t._handlePasteEvent(e)});}if(!tinymce.isIE&&ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onKeyDown.add(function(ed,e){if(e.ctrlKey&&e.keyCode==86){window.setTimeout(function(){ed.execCommand("mcePasteText",true);},1);Event.cancel(e);}});}},getInfo:function(){return{longname:'Paste text/word',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_handlePasteEvent:function(e){var html=this._clipboardHTML(),ed=this.editor,sel=ed.selection,r;if(ed&&(r=sel.getRng())&&r.text.length>0)ed.execCommand('delete');if(html&&html.length>0)ed.execCommand('mcePasteWord',false,html);return Event.cancel(e);},_insertText:function(content,bLinebreaks){if(content&&content.length>0){if(bLinebreaks){if(this.editor.getParam("paste_create_paragraphs",true)){var rl=this.editor.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);content=content.replace(/\r\n\r\n/g,'</p><p>');content=content.replace(/\r\r/g,'</p><p>');content=content.replace(/\n\n/g,'</p><p>');if((pos=content.indexOf('</p><p>'))!=-1){this.editor.execCommand("Delete");var node=this.editor.selection.getNode();var breakElms=[];do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="</p>";before+=content.substring(0,pos);for(var i=0;i<breakElms.length;i++){before+="</"+breakElms[i].nodeName+">";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="<p>";content=before+content.substring(pos+7)+after;}}if(this.editor.getParam("paste_create_linebreaks",true)){content=content.replace(/\r\n/g,'<br />');content=content.replace(/\r/g,'<br />');content=content.replace(/\n/g,'<br />');}}this.editor.execCommand("mceInsertRawHTML",false,content);}},_insertWordContent:function(content){var t=this,ed=t.editor;if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);if(ed.getParam('paste_insert_word_content_callback'))content=ed.execCallback('paste_insert_word_content_callback','before',content);var rl=ed.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>','gi'),'<p><b>$1</b></p>');}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">','gi'),'">'+"--list--");content=content.replace(new RegExp(bull+"(.*?)<BR>","gi"),"<p>"+middot+"$1</p>");content=content.replace(new RegExp('<SPAN style="mso-list: Ignore">','gi'),"<span>"+bull);content=content.replace(/<o:p><\/o:p>/gi,"");content=content.replace(new RegExp('<br style="page-break-before: always;.*>','gi'),'-- page break --');content=content.replace(new RegExp('<(!--)([^>]*)(--)>','g'),"");if(this.editor.getParam("paste_remove_spans",true))content=content.replace(/<\/?span[^>]*>/gi,"");if(this.editor.getParam("paste_remove_styles",true))content=content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)','gi'),"<$1$3");content=content.replace(/<\/?font[^>]*>/gi,"");switch(this.editor.getParam("paste_strip_class_attributes","all")){case"all":content=content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");break;case"mso":content=content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)','gi'),"<$1$3");break;}content=content.replace(new RegExp('href="?'+this._reEscape(""+document.location)+'','gi'),'href="'+this.editor.documentBaseURI.getURI());content=content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");content=content.replace(/<\\?\?xml[^>]*>/gi,"");content=content.replace(/<\/?\w+:[^>]*>/gi,"");content=content.replace(/-- page break --\s*<p>&nbsp;<\/p>/gi,"");content=content.replace(/-- page break --/gi,"");if(!this.editor.getParam('force_p_newlines')){content=content.replace('','','gi');content=content.replace('</p>','<br /><br />','gi');}if(!tinymce.isIE&&!this.editor.getParam('force_p_newlines')){content=content.replace(/<\/?p[^>]*>/gi,"");}content=content.replace(/<\/?div[^>]*>/gi,"");if(this.editor.getParam("paste_convert_middot_lists",true)){var div=ed.dom.create("div",null,content);var className=this.editor.getParam("paste_unindented_list_class","unIndentedList");while(this._convertMiddots(div,"--list--"));while(this._convertMiddots(div,middot,className));while(this._convertMiddots(div,bull));content=div.innerHTML;}if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(/<h[1-6]>&nbsp;<\/h[1-6]>/gi,'<p>&nbsp;&nbsp;</p>');content=content.replace(/<h[1-6]>/gi,'<p><b>');content=content.replace(/<\/h[1-6]>/gi,'</b></p>');content=content.replace(/<b>&nbsp;<\/b>/gi,'<b>&nbsp;&nbsp;</b>');content=content.replace(/^(&nbsp;)*/gi,'');}content=content.replace(/--list--/gi,"");if(ed.getParam('paste_insert_word_content_callback'))content=ed.execCallback('paste_insert_word_content_callback','after',content);this.editor.execCommand("mceInsertContent",false,content);if(this.editor.getParam('paste_force_cleanup_wordpaste',true)){var ed=this.editor;window.setTimeout(function(){ed.execCommand("mceCleanup");},1);}}},_reEscape:function(s){var l="?.\\*[](){}+^$:";var o="";for(var i=0;i<s.length;i++){var c=s.charAt(i);if(l.indexOf(c)!=-1)o+='\\'+c;else o+=c;}return o;},_convertMiddots:function(div,search,class_name){var ed=this.editor,mdot=String.fromCharCode(183),bull=String.fromCharCode(8226);var nodes,prevul,i,p,ul,li,np,cp,li;nodes=div.getElementsByTagName("p");for(i=0;i<nodes.length;i++){p=nodes[i];if(p.innerHTML.indexOf(search)==0){ul=ed.dom.create("ul");if(class_name)ul.className=class_name;li=ed.dom.create("li");li.innerHTML=p.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--|&nbsp;',"gi"),'');ul.appendChild(li);np=p.nextSibling;while(np){if(np.nodeType==3&&new RegExp('^\\s$','m').test(np.nodeValue)){np=np.nextSibling;continue;}if(search==mdot){if(np.nodeType==1&&new RegExp('^o(\\s+|&nbsp;)').test(np.innerHTML)){if(!prevul){prevul=ul;ul=ed.dom.create("ul");prevul.appendChild(ul);}np.innerHTML=np.innerHTML.replace(/^o/,'');}else{if(prevul){ul=prevul;prevul=null;}if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}}else{if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}cp=np.nextSibling;li=ed.dom.create("li");li.innerHTML=np.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--|&nbsp;',"gi"),'');np.parentNode.removeChild(np);ul.appendChild(li);np=cp;}p.parentNode.replaceChild(ul,p);return true;}}return false;},_clipboardHTML:function(){var div=document.getElementById('_TinyMCE_clipboardHTML');if(!div){var div=document.createElement('DIV');div.id='_TinyMCE_clipboardHTML';with(div.style){visibility='hidden';overflow='hidden';position='absolute';width=1;height=1;}document.body.appendChild(div);}div.innerHTML='';var rng=document.body.createTextRange();rng.moveToElementText(div);rng.execCommand('Paste');var html=div.innerHTML;div.innerHTML='';return html;}});tinymce.PluginManager.add('paste',tinymce.plugins.PastePlugin);})();
+(function(){var Event=tinymce.dom.Event;tinymce.create('tinymce.plugins.PastePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mcePasteText',function(ui,v){if(ui){if((ed.getParam('paste_use_dialog',true))||(!tinymce.isIE)){ed.windowManager.open({file:url+'/pastetext.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertText(clipboardData.getData("Text"),true);}else t._insertText(v.html,v.linebreaks);});ed.addCommand('mcePasteWord',function(ui,v){if(ui){if((ed.getParam('paste_use_dialog',true))||(!tinymce.isIE)){ed.windowManager.open({file:url+'/pasteword.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertText(t._clipboardHTML());}else t._insertWordContent(v);});ed.addCommand('mceSelectAll',function(){ed.execCommand('selectall');});ed.addButton('pastetext',{title:'paste.paste_text_desc',cmd:'mcePasteText',ui:true});ed.addButton('pasteword',{title:'paste.paste_word_desc',cmd:'mcePasteWord',ui:true});ed.addButton('selectall',{title:'paste.selectall_desc',cmd:'mceSelectAll'});if(ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onPaste.add(function(ed,e){return t._handlePasteEvent(e)});}if(!tinymce.isIE&&ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onKeyDown.add(function(ed,e){if(e.ctrlKey&&e.keyCode==86){window.setTimeout(function(){ed.execCommand("mcePasteText",true);},1);Event.cancel(e);}});}},getInfo:function(){return{longname:'Paste text/word',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_handlePasteEvent:function(e){var html=this._clipboardHTML(),ed=this.editor,sel=ed.selection,r;if(ed&&(r=sel.getRng())&&r.text.length>0)ed.execCommand('delete');if(html&&html.length>0)ed.execCommand('mcePasteWord',false,html);return Event.cancel(e);},_insertText:function(content,bLinebreaks){content=this.editor.dom.encode(content);if(content&&content.length>0){if(bLinebreaks){if(this.editor.getParam("paste_create_paragraphs",true)){var rl=this.editor.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);content=content.replace(/\r\n\r\n/g,'</p><p>');content=content.replace(/\r\r/g,'</p><p>');content=content.replace(/\n\n/g,'</p><p>');if((pos=content.indexOf('</p><p>'))!=-1){this.editor.execCommand("Delete");var node=this.editor.selection.getNode();var breakElms=[];do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="</p>";before+=content.substring(0,pos);for(var i=0;i<breakElms.length;i++){before+="</"+breakElms[i].nodeName+">";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="<p>";content=before+content.substring(pos+7)+after;}}if(this.editor.getParam("paste_create_linebreaks",true)){content=content.replace(/\r\n/g,'<br />');content=content.replace(/\r/g,'<br />');content=content.replace(/\n/g,'<br />');}}this.editor.execCommand("mceInsertRawHTML",false,content);}},_insertWordContent:function(content){var t=this,ed=t.editor;if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);if(ed.getParam('paste_insert_word_content_callback'))content=ed.execCallback('paste_insert_word_content_callback','before',content);var rl=ed.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>','gi'),'<p><b>$1</b></p>');}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">','gi'),'">'+"--list--");content=content.replace(new RegExp(bull+"(.*?)<BR>","gi"),"<p>"+middot+"$1</p>");content=content.replace(new RegExp('<SPAN style="mso-list: Ignore">','gi'),"<span>"+bull);content=content.replace(/<o:p><\/o:p>/gi,"");content=content.replace(new RegExp('<br style="page-break-before: always;.*>','gi'),'-- page break --');content=content.replace(new RegExp('<(!--)([^>]*)(--)>','g'),"");if(this.editor.getParam("paste_remove_spans",true))content=content.replace(/<\/?span[^>]*>/gi,"");if(this.editor.getParam("paste_remove_styles",true))content=content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)','gi'),"<$1$3");content=content.replace(/<\/?font[^>]*>/gi,"");switch(this.editor.getParam("paste_strip_class_attributes","all")){case"all":content=content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");break;case"mso":content=content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)','gi'),"<$1$3");break;}content=content.replace(new RegExp('href="?'+this._reEscape(""+document.location)+'','gi'),'href="'+this.editor.documentBaseURI.getURI());content=content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");content=content.replace(/<\\?\?xml[^>]*>/gi,"");content=content.replace(/<\/?\w+:[^>]*>/gi,"");content=content.replace(/-- page break --\s*<p>&nbsp;<\/p>/gi,"");content=content.replace(/-- page break --/gi,"");if(!this.editor.getParam('force_p_newlines')){content=content.replace('','','gi');content=content.replace('</p>','<br /><br />','gi');}if(!tinymce.isIE&&!this.editor.getParam('force_p_newlines')){content=content.replace(/<\/?p[^>]*>/gi,"");}content=content.replace(/<\/?div[^>]*>/gi,"");if(this.editor.getParam("paste_convert_middot_lists",true)){var div=ed.dom.create("div",null,content);var className=this.editor.getParam("paste_unindented_list_class","unIndentedList");while(this._convertMiddots(div,"--list--"));while(this._convertMiddots(div,middot,className));while(this._convertMiddots(div,bull));content=div.innerHTML;}if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(/<h[1-6]>&nbsp;<\/h[1-6]>/gi,'<p>&nbsp;&nbsp;</p>');content=content.replace(/<h[1-6]>/gi,'<p><b>');content=content.replace(/<\/h[1-6]>/gi,'</b></p>');content=content.replace(/<b>&nbsp;<\/b>/gi,'<b>&nbsp;&nbsp;</b>');content=content.replace(/^(&nbsp;)*/gi,'');}content=content.replace(/--list--/gi,"");if(ed.getParam('paste_insert_word_content_callback'))content=ed.execCallback('paste_insert_word_content_callback','after',content);this.editor.execCommand("mceInsertContent",false,content);if(this.editor.getParam('paste_force_cleanup_wordpaste',true)){var ed=this.editor;window.setTimeout(function(){ed.execCommand("mceCleanup");},1);}}},_reEscape:function(s){var l="?.\\*[](){}+^$:";var o="";for(var i=0;i<s.length;i++){var c=s.charAt(i);if(l.indexOf(c)!=-1)o+='\\'+c;else o+=c;}return o;},_convertMiddots:function(div,search,class_name){var ed=this.editor,mdot=String.fromCharCode(183),bull=String.fromCharCode(8226);var nodes,prevul,i,p,ul,li,np,cp,li;nodes=div.getElementsByTagName("p");for(i=0;i<nodes.length;i++){p=nodes[i];if(p.innerHTML.indexOf(search)==0){ul=ed.dom.create("ul");if(class_name)ul.className=class_name;li=ed.dom.create("li");li.innerHTML=p.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--|&nbsp;',"gi"),'');ul.appendChild(li);np=p.nextSibling;while(np){if(np.nodeType==3&&new RegExp('^\\s$','m').test(np.nodeValue)){np=np.nextSibling;continue;}if(search==mdot){if(np.nodeType==1&&new RegExp('^o(\\s+|&nbsp;)').test(np.innerHTML)){if(!prevul){prevul=ul;ul=ed.dom.create("ul");prevul.appendChild(ul);}np.innerHTML=np.innerHTML.replace(/^o/,'');}else{if(prevul){ul=prevul;prevul=null;}if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}}else{if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}cp=np.nextSibling;li=ed.dom.create("li");li.innerHTML=np.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--|&nbsp;',"gi"),'');np.parentNode.removeChild(np);ul.appendChild(li);np=cp;}p.parentNode.replaceChild(ul,p);return true;}}return false;},_clipboardHTML:function(){var div=document.getElementById('_TinyMCE_clipboardHTML');if(!div){var div=document.createElement('DIV');div.id='_TinyMCE_clipboardHTML';with(div.style){visibility='hidden';overflow='hidden';position='absolute';width=1;height=1;}document.body.appendChild(div);}div.innerHTML='';var rng=document.body.createTextRange();rng.moveToElementText(div);rng.execCommand('Paste');var html=div.innerHTML;div.innerHTML='';return html;}});tinymce.PluginManager.add('paste',tinymce.plugins.PastePlugin);})(); \ No newline at end of file
diff --git a/wp-includes/js/tinymce/plugins/paste/pastetext.htm b/wp-includes/js/tinymce/plugins/paste/pastetext.htm
index cd086bd..de7f400 100644
--- a/wp-includes/js/tinymce/plugins/paste/pastetext.htm
+++ b/wp-includes/js/tinymce/plugins/paste/pastetext.htm
@@ -1,34 +1,34 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>{#paste.paste_text_desc}</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <script type="text/javascript" src="../../tiny_mce_popup.js?v=307"></script>
- <script type="text/javascript" src="js/pastetext.js?v=307"></script>
- <base target="_self" />
-</head>
-<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
-<form name="source" onsubmit="saveContent();return false;" action="#">
- <div style="float: left" class="title">{#paste.paste_text_desc}</div>
-
- <div style="float: right">
- <input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label>
- </div>
-
- <br style="clear: both" />
-
- <div>{#paste_dlg.text_title}</div>
-
- <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft" class="mceFocus"></textarea>
-
- <div class="mceActionPanel">
- <div style="float: left">
- <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
- </div>
-
- <div style="float: right">
- <input type="submit" name="insert" value="{#insert}" id="insert" />
- </div>
- </div>
-</form>
-</body>
-</html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>{#paste.paste_text_desc}</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3091"></script>
+ <script type="text/javascript" src="js/pastetext.js?ver=3091"></script>
+ <base target="_self" />
+</head>
+<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
+<form name="source" onsubmit="saveContent();return false;" action="#">
+ <div style="float: left" class="title">{#paste.paste_text_desc}</div>
+
+ <div style="float: right">
+ <input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label>
+ </div>
+
+ <br style="clear: both" />
+
+ <div>{#paste_dlg.text_title}</div>
+
+ <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft" class="mceFocus"></textarea>
+
+ <div class="mceActionPanel">
+ <div style="float: left">
+ <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
+ </div>
+
+ <div style="float: right">
+ <input type="submit" name="insert" value="{#insert}" id="insert" />
+ </div>
+ </div>
+</form>
+</body>
+</html> \ No newline at end of file
diff --git a/wp-includes/js/tinymce/plugins/paste/pasteword.htm b/wp-includes/js/tinymce/plugins/paste/pasteword.htm
index 3c559b1..1ef91ab 100644
--- a/wp-includes/js/tinymce/plugins/paste/pasteword.htm
+++ b/wp-includes/js/tinymce/plugins/paste/pasteword.htm
@@ -1,29 +1,29 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>{#paste.paste_word_desc}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?v=307"></script>
- <script type="text/javascript" src="js/pasteword.js?v=307"></script>
- <link href="css/pasteword.css?v=307" rel="stylesheet" type="text/css" />
- <base target="_self" />
-</head>
-<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
- <form name="source" onsubmit="saveContent();" action="#">
- <div class="title">{#paste.paste_word_desc}</div>
-
- <div>{#paste_dlg.word_title}</div>
-
- <div id="iframecontainer"></div>
-
- <div class="mceActionPanel">
- <div style="float: left">
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
- </div>
-
- <div style="float: right">
- <input type="button" id="insert" name="insert" value="{#insert}" onclick="saveContent();" />
- </div>
- </div>
- </form>
-</body>
-</html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>{#paste.paste_word_desc}</title>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3091"></script>
+ <script type="text/javascript" src="js/pasteword.js?ver=3091"></script>
+ <link href="css/pasteword.css?ver=3091" rel="stylesheet" type="text/css" />
+ <base target="_self" />
+</head>
+<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
+ <form name="source" onsubmit="saveContent();" action="#">
+ <div class="title">{#paste.paste_word_desc}</div>
+
+ <div>{#paste_dlg.word_title}</div>
+
+ <div id="iframecontainer"></div>
+
+ <div class="mceActionPanel">
+ <div style="float: left">
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+ </div>
+
+ <div style="float: right">
+ <input type="button" id="insert" name="insert" value="{#insert}" onclick="saveContent();" />
+ </div>
+ </div>
+ </form>
+</body>
+</html>
diff --git a/wp-includes/js/tinymce/plugins/safari/editor_plugin.js b/wp-includes/js/tinymce/plugins/safari/editor_plugin.js
index 3ee7a37..f722c2f 100644
--- a/wp-includes/js/tinymce/plugins/safari/editor_plugin.js
+++ b/wp-includes/js/tinymce/plugins/safari/editor_plugin.js
@@ -1 +1 @@
-(function(){var Event=tinymce.dom.Event,grep=tinymce.grep,each=tinymce.each,inArray=tinymce.inArray,isOldWebKit=tinymce.isOldWebKit;tinymce.create('tinymce.plugins.Safari',{init:function(ed){var t=this,dom;if(!tinymce.isWebKit)return;t.editor=ed;t.webKitFontSizes=['x-small','small','medium','large','x-large','xx-large','-webkit-xxx-large'];t.namedFontSizes=['xx-small','x-small','small','medium','large','x-large','xx-large'];ed.onPaste.add(function(ed,e){function removeStyles(e){e=e.target;if(e.nodeType==1){e.style.cssText='';each(ed.dom.select('*',e),function(e){e.style.cssText='';});}};Event.add(ed.getDoc(),'DOMNodeInserted',removeStyles);window.setTimeout(function(){Event.remove(ed.getDoc(),'DOMNodeInserted',removeStyles);},0);});ed.onKeyUp.add(function(ed,e){var h,b;if(e.keyCode==46||e.keyCode==8){b=ed.getBody();h=b.innerHTML;if(b.childNodes.length==1&&!/<(img|hr)/.test(h)&&tinymce.trim(h.replace(/<[^>]+>/g,'')).length==0)ed.setContent('',{format:'raw'});}});ed.addCommand('FormatBlock',function(u,v){var dom=ed.dom,e=dom.getParent(ed.selection.getNode(),dom.isBlock);if(e)dom.replace(dom.create(v),e,1);else ed.getDoc().execCommand("FormatBlock",false,v);});ed.addCommand('mceInsertContent',function(u,v){ed.getDoc().execCommand("InsertText",false,'mce_marker');ed.getBody().innerHTML=ed.getBody().innerHTML.replace(/mce_marker/g,v+'<span id="_mce_tmp">XX</span>');ed.selection.select(ed.dom.get('_mce_tmp'));ed.getDoc().execCommand("Delete",false,' ');});ed.onKeyPress.add(function(ed,e){if(e.keyCode==13&&(e.shiftKey||ed.settings.force_br_newlines&&ed.selection.getNode().nodeName!='LI')){t._insertBR(ed);Event.cancel(e);}});ed.addQueryValueHandler('FontSize',function(u,v){var e,v;if((e=ed.dom.getParent(ed.selection.getStart(),'span'))&&(v=e.style.fontSize))return tinymce.inArray(t.namedFontSizes,v)+1;if((e=ed.dom.getParent(ed.selection.getEnd(),'span'))&&(v=e.style.fontSize))return tinymce.inArray(t.namedFontSizes,v)+1;return ed.getDoc().queryCommandValue('FontSize');});ed.addQueryValueHandler('FontName',function(u,v){var e,v;if((e=ed.dom.getParent(ed.selection.getStart(),'span'))&&(v=e.style.fontFamily))return v.replace(/, /g,',');if((e=ed.dom.getParent(ed.selection.getEnd(),'span'))&&(v=e.style.fontFamily))return v.replace(/, /g,',');return ed.getDoc().queryCommandValue('FontName');});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName=='IMG'){t.selElm=e;ed.selection.select(e);}else t.selElm=null;});ed.onInit.add(function(){t._fixWebKitSpans();if(isOldWebKit)t._patchSafari2x(ed);});ed.onSetContent.add(function(){dom=ed.dom;each(['strong','b','em','u','strike','sub','sup','a'],function(v){each(grep(dom.select(v)).reverse(),function(n){var nn=n.nodeName.toLowerCase(),st;if(nn=='a'){if(n.name)dom.replace(dom.create('img',{mce_name:'a',name:n.name,'class':'mceItemAnchor'}),n);return;}switch(nn){case'b':case'strong':if(nn=='b')nn='strong';st='font-weight: bold;';break;case'em':st='font-style: italic;';break;case'u':st='text-decoration: underline;';break;case'sub':st='vertical-align: sub;';break;case'sup':st='vertical-align: super;';break;case'strike':st='text-decoration: line-through;';break;}dom.replace(dom.create('span',{mce_name:nn,style:st,'class':'Apple-style-span'}),n,1);});});});ed.onPreProcess.add(function(ed,o){dom=ed.dom;each(grep(o.node.getElementsByTagName('span')).reverse(),function(n){var v,bg;if(o.get){if(dom.hasClass(n,'Apple-style-span')){bg=n.style.backgroundColor;switch(dom.getAttrib(n,'mce_name')){case'font':if(!ed.settings.convert_fonts_to_spans)dom.setAttrib(n,'style','');break;case'strong':case'em':case'sub':case'sup':dom.setAttrib(n,'style','');break;case'strike':case'u':if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');else dom.setAttrib(n,'mce_name','');break;default:if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');}if(bg)n.style.backgroundColor=bg;}}if(dom.hasClass(n,'mceItemRemoved'))dom.remove(n,1);});});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g,'</$1>');o.content=o.content.replace(/ id=\"undefined\"/g,'');});},getInfo:function(){return{longname:'Safari compatibility',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_fixWebKitSpans:function(){var t=this,ed=t.editor;if(!isOldWebKit){Event.add(ed.getDoc(),'DOMNodeInserted',function(e){e=e.target;if(e&&e.nodeType==1)t._fixAppleSpan(e);});}else{ed.onExecCommand.add(function(){each(ed.dom.select('span'),function(n){t._fixAppleSpan(n);});ed.nodeChanged();});}},_fixAppleSpan:function(e){var ed=this.editor,dom=ed.dom,fz=this.webKitFontSizes,fzn=this.namedFontSizes,s=ed.settings,st,p;if(dom.getAttrib(e,'mce_fixed'))return;if(e.nodeName=='SPAN'&&e.className=='Apple-style-span'){st=e.style;if(!s.convert_fonts_to_spans){if(st.fontSize){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'size',inArray(fz,st.fontSize)+1);}if(st.fontFamily){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'face',st.fontFamily);}if(st.color){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'color',dom.toHex(st.color));}if(st.backgroundColor){dom.setAttrib(e,'mce_name','font');dom.setStyle(e,'background-color',st.backgroundColor);}}else{if(st.fontSize)dom.setStyle(e,'fontSize',fzn[inArray(fz,st.fontSize)]);}if(st.fontWeight=='bold')dom.setAttrib(e,'mce_name','strong');if(st.fontStyle=='italic')dom.setAttrib(e,'mce_name','em');if(st.textDecoration=='underline')dom.setAttrib(e,'mce_name','u');if(st.textDecoration=='line-through')dom.setAttrib(e,'mce_name','strike');if(st.verticalAlign=='super')dom.setAttrib(e,'mce_name','sup');if(st.verticalAlign=='sub')dom.setAttrib(e,'mce_name','sub');dom.setAttrib(e,'mce_fixed','1');}},_patchSafari2x:function(ed){var t=this,setContent,getNode,dom=ed.dom,lr;if(ed.windowManager.onBeforeOpen){ed.windowManager.onBeforeOpen.add(function(){r=ed.selection.getRng();});}ed.selection.select=function(n){this.getSel().setBaseAndExtent(n,0,n,1);};getNode=ed.selection.getNode;ed.selection.getNode=function(){return t.selElm||getNode.call(this);};ed.selection.getRng=function(){var t=this,s=t.getSel(),d=ed.getDoc(),r,rb,ra,di;if(s.anchorNode){r=d.createRange();try{rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(1);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(1);di=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;r.setStart(di?s.anchorNode:s.focusNode,di?s.anchorOffset:s.focusOffset);r.setEnd(di?s.focusNode:s.anchorNode,di?s.focusOffset:s.anchorOffset);lr=r;}catch(ex){}}return r||lr;};setContent=ed.selection.setContent;ed.selection.setContent=function(h,s){var r=this.getRng(),b;try{setContent.call(this,h,s);}catch(ex){b=dom.create('body');b.innerHTML=h;each(b.childNodes,function(n){r.insertNode(n.cloneNode(true));});}};},_insertBR:function(ed){var dom=ed.dom,s=ed.selection,r=s.getRng(),br;r.insertNode(br=dom.create('br'));r.setStartAfter(br);r.setEndAfter(br);s.setRng(r);if(s.getSel().focusNode==br.previousSibling){s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'),br));s.collapse(1);}ed.getWin().scrollTo(0,dom.getPos(s.getRng().startContainer).y);}});tinymce.PluginManager.add('safari',tinymce.plugins.Safari);})();
+(function(){var Event=tinymce.dom.Event,grep=tinymce.grep,each=tinymce.each,inArray=tinymce.inArray,isOldWebKit=tinymce.isOldWebKit;tinymce.create('tinymce.plugins.Safari',{init:function(ed){var t=this,dom;if(!tinymce.isWebKit)return;t.editor=ed;t.webKitFontSizes=['x-small','small','medium','large','x-large','xx-large','-webkit-xxx-large'];t.namedFontSizes=['xx-small','x-small','small','medium','large','x-large','xx-large'];ed.onPaste.add(function(ed,e){function removeStyles(e){e=e.target;if(e.nodeType==1){e.style.cssText='';each(ed.dom.select('*',e),function(e){e.style.cssText='';});}};Event.add(ed.getDoc(),'DOMNodeInserted',removeStyles);window.setTimeout(function(){Event.remove(ed.getDoc(),'DOMNodeInserted',removeStyles);},0);});ed.onKeyUp.add(function(ed,e){var h,b;if(e.keyCode==46||e.keyCode==8){b=ed.getBody();h=b.innerHTML;if(b.childNodes.length==1&&!/<(img|hr)/.test(h)&&tinymce.trim(h.replace(/<[^>]+>/g,'')).length==0)ed.setContent('',{format:'raw'});}});ed.addCommand('FormatBlock',function(u,v){var dom=ed.dom,e=dom.getParent(ed.selection.getNode(),dom.isBlock);if(e)dom.replace(dom.create(v),e,1);else ed.getDoc().execCommand("FormatBlock",false,v);});ed.addCommand('mceInsertContent',function(u,v){ed.getDoc().execCommand("InsertText",false,'mce_marker');ed.getBody().innerHTML=ed.getBody().innerHTML.replace(/mce_marker/g,v+'<span id="_mce_tmp">XX</span>');ed.selection.select(ed.dom.get('_mce_tmp'));ed.getDoc().execCommand("Delete",false,' ');});ed.onKeyPress.add(function(ed,e){if(e.keyCode==13&&(e.shiftKey||ed.settings.force_br_newlines&&ed.selection.getNode().nodeName!='LI')){t._insertBR(ed);Event.cancel(e);}});ed.addQueryValueHandler('FontSize',function(u,v){var e,v;if((e=ed.dom.getParent(ed.selection.getStart(),'span'))&&(v=e.style.fontSize))return tinymce.inArray(t.namedFontSizes,v)+1;if((e=ed.dom.getParent(ed.selection.getEnd(),'span'))&&(v=e.style.fontSize))return tinymce.inArray(t.namedFontSizes,v)+1;return ed.getDoc().queryCommandValue('FontSize');});ed.addQueryValueHandler('FontName',function(u,v){var e,v;if((e=ed.dom.getParent(ed.selection.getStart(),'span'))&&(v=e.style.fontFamily))return v.replace(/, /g,',');if((e=ed.dom.getParent(ed.selection.getEnd(),'span'))&&(v=e.style.fontFamily))return v.replace(/, /g,',');return ed.getDoc().queryCommandValue('FontName');});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName=='IMG'){t.selElm=e;ed.selection.select(e);}else t.selElm=null;});ed.onInit.add(function(){t._fixWebKitSpans();if(isOldWebKit)t._patchSafari2x(ed);});ed.onSetContent.add(function(){dom=ed.dom;each(['strong','b','em','u','strike','sub','sup','a'],function(v){each(grep(dom.select(v)).reverse(),function(n){var nn=n.nodeName.toLowerCase(),st;if(nn=='a'){if(n.name)dom.replace(dom.create('img',{mce_name:'a',name:n.name,'class':'mceItemAnchor'}),n);return;}switch(nn){case'b':case'strong':if(nn=='b')nn='strong';st='font-weight: bold;';break;case'em':st='font-style: italic;';break;case'u':st='text-decoration: underline;';break;case'sub':st='vertical-align: sub;';break;case'sup':st='vertical-align: super;';break;case'strike':st='text-decoration: line-through;';break;}dom.replace(dom.create('span',{mce_name:nn,style:st,'class':'Apple-style-span'}),n,1);});});});ed.onPreProcess.add(function(ed,o){dom=ed.dom;each(grep(o.node.getElementsByTagName('span')).reverse(),function(n){var v,bg;if(o.get){if(dom.hasClass(n,'Apple-style-span')){bg=n.style.backgroundColor;switch(dom.getAttrib(n,'mce_name')){case'font':if(!ed.settings.convert_fonts_to_spans)dom.setAttrib(n,'style','');break;case'strong':case'em':case'sub':case'sup':dom.setAttrib(n,'style','');break;case'strike':case'u':if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');else dom.setAttrib(n,'mce_name','');break;default:if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');}if(bg)n.style.backgroundColor=bg;}}if(dom.hasClass(n,'mceItemRemoved'))dom.remove(n,1);});});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g,'</$1>');o.content=o.content.replace(/ id=\"undefined\"/g,'');});},getInfo:function(){return{longname:'Safari compatibility',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_fixWebKitSpans:function(){var t=this,ed=t.editor;if(!isOldWebKit){Event.add(ed.getDoc(),'DOMNodeInserted',function(e){e=e.target;if(e&&e.nodeType==1)t._fixAppleSpan(e);});}else{ed.onExecCommand.add(function(){each(ed.dom.select('span'),function(n){t._fixAppleSpan(n);});ed.nodeChanged();});}},_fixAppleSpan:function(e){var ed=this.editor,dom=ed.dom,fz=this.webKitFontSizes,fzn=this.namedFontSizes,s=ed.settings,st,p;if(dom.getAttrib(e,'mce_fixed'))return;if(e.nodeName=='SPAN'&&e.className=='Apple-style-span'){st=e.style;if(!s.convert_fonts_to_spans){if(st.fontSize){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'size',inArray(fz,st.fontSize)+1);}if(st.fontFamily){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'face',st.fontFamily);}if(st.color){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'color',dom.toHex(st.color));}if(st.backgroundColor){dom.setAttrib(e,'mce_name','font');dom.setStyle(e,'background-color',st.backgroundColor);}}else{if(st.fontSize)dom.setStyle(e,'fontSize',fzn[inArray(fz,st.fontSize)]);}if(st.fontWeight=='bold')dom.setAttrib(e,'mce_name','strong');if(st.fontStyle=='italic')dom.setAttrib(e,'mce_name','em');if(st.textDecoration=='underline')dom.setAttrib(e,'mce_name','u');if(st.textDecoration=='line-through')dom.setAttrib(e,'mce_name','strike');if(st.verticalAlign=='super')dom.setAttrib(e,'mce_name','sup');if(st.verticalAlign=='sub')dom.setAttrib(e,'mce_name','sub');dom.setAttrib(e,'mce_fixed','1');}},_patchSafari2x:function(ed){var t=this,setContent,getNode,dom=ed.dom,lr;if(ed.windowManager.onBeforeOpen){ed.windowManager.onBeforeOpen.add(function(){r=ed.selection.getRng();});}ed.selection.select=function(n){this.getSel().setBaseAndExtent(n,0,n,1);};getNode=ed.selection.getNode;ed.selection.getNode=function(){return t.selElm||getNode.call(this);};ed.selection.getRng=function(){var t=this,s=t.getSel(),d=ed.getDoc(),r,rb,ra,di;if(s.anchorNode){r=d.createRange();try{rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(1);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(1);di=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;r.setStart(di?s.anchorNode:s.focusNode,di?s.anchorOffset:s.focusOffset);r.setEnd(di?s.focusNode:s.anchorNode,di?s.focusOffset:s.anchorOffset);lr=r;}catch(ex){}}return r||lr;};setContent=ed.selection.setContent;ed.selection.setContent=function(h,s){var r=this.getRng(),b;try{setContent.call(this,h,s);}catch(ex){b=dom.create('body');b.innerHTML=h;each(b.childNodes,function(n){r.insertNode(n.cloneNode(true));});}};},_insertBR:function(ed){var dom=ed.dom,s=ed.selection,r=s.getRng(),br;r.insertNode(br=dom.create('br'));r.setStartAfter(br);r.setEndAfter(br);s.setRng(r);if(s.getSel().focusNode==br.previousSibling){s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'),br));s.collapse(1);}ed.getWin().scrollTo(0,dom.getPos(s.getRng().startContainer).y);}});tinymce.PluginManager.add('safari',tinymce.plugins.Safari);})(); \ No newline at end of file
diff --git a/wp-includes/js/tinymce/plugins/spellchecker/config.php b/wp-includes/js/tinymce/plugins/spellchecker/config.php
index 96f273a..a518570 100755
--- a/wp-includes/js/tinymce/plugins/spellchecker/config.php
+++ b/wp-includes/js/tinymce/plugins/spellchecker/config.php
@@ -1,21 +1,21 @@
-<?php
- // General settings
- $config['general.engine'] = 'GoogleSpell';
- //$config['general.engine'] = 'PSpell';
- //$config['general.engine'] = 'PSpellShell';
-
- // PSpell settings
- $config['PSpell.mode'] = PSPELL_FAST;
- $config['PSpell.spelling'] = "";
- $config['PSpell.jargon'] = "";
- $config['PSpell.encoding'] = "";
-
- // PSpellShell settings
- $config['PSpellShell.mode'] = PSPELL_FAST;
- $config['PSpellShell.aspell'] = '/usr/bin/aspell';
- $config['PSpellShell.tmp'] = '/tmp';
-
- // Windows PSpellShell settings
- //$config['PSpellShell.aspell'] = '"c:\Program Files\Aspell\bin\aspell.exe"';
- //$config['PSpellShell.tmp'] = 'c:/temp';
-?>
+<?php
+ // General settings
+ $config['general.engine'] = 'GoogleSpell';
+ //$config['general.engine'] = 'PSpell';
+ //$config['general.engine'] = 'PSpellShell';
+
+ // PSpell settings
+ $config['PSpell.mode'] = PSPELL_FAST;
+ $config['PSpell.spelling'] = "";
+ $config['PSpell.jargon'] = "";
+ $config['PSpell.encoding'] = "";
+
+ // PSpellShell settings
+ $config['PSpellShell.mode'] = PSPELL_FAST;
+ $config['PSpellShell.aspell'] = '/usr/bin/aspell';
+ $config['PSpellShell.tmp'] = '/tmp';
+
+ // Windows PSpellShell settings
+ //$config['PSpellShell.aspell'] = '"c:\Program Files\Aspell\bin\aspell.exe"';
+ //$config['PSpellShell.tmp'] = 'c:/temp';
+?>
diff --git a/wp-includes/js/tinymce/plugins/spellchecker/css/content.css b/wp-includes/js/tinymce/plugins/spellchecker/css/content.css
index 24efa02..656ce1e 100755
--- a/wp-includes/js/tinymce/plugins/spellchecker/css/content.css
+++ b/wp-includes/js/tinymce/plugins/spellchecker/css/content.css
@@ -1 +1 @@
-.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;}
+.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;}
diff --git a/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js b/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js
index 5bfdd47..72c1a7a 100755
--- a/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js
+++ b/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js
@@ -335,4 +335,4 @@
// Register plugin
tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin);
-})();
+})(); \ No newline at end of file
diff --git a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js
index 2814457..cd4c71e 100644
--- a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js
+++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js
@@ -132,7 +132,17 @@
}
});
- // Add listeners to handle more break
+ // Word count if script is loaded
+ if ( 'undefined' != typeof wpWordCount ) {
+ var last = 0;
+ ed.onKeyUp.add(function(ed, e) {
+ if ( e.keyCode == last ) return;
+ if ( 13 == e.keyCode || 8 == last || 46 == last ) wpWordCount.wc( ed.getContent({format : 'raw'}) );
+ last = e.keyCode;
+ });
+ };
+
+ // Add listeners to handle more break
t._handleMoreBreak(ed, url);
// Add custom shortcuts
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css b/wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css
new file mode 100644
index 0000000..48a5a9f
--- /dev/null
+++ b/wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css
@@ -0,0 +1,167 @@
+
+html, body {
+ background-color: #fff;
+ margin: 0;
+ padding: 0;
+}
+
+.submit input,
+.button {
+ font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
+ padding: 3px 5px;
+ font-size: 12px;
+ line-height: 1.5em;
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 3px;
+ -khtml-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+ text-decoration: none;
+}
+
+textarea,
+input,
+select {
+ font: 13px Verdana, Arial, Helvetica, sans-serif;
+ margin: 1px;
+ padding: 3px;
+}
+
+body, td {
+ font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
+}
+
+abbr.required {
+ color: #FF0000;
+ text-align: left;
+}
+
+.alignright {
+ float: right;
+}
+
+.alignleft {
+ float: left;
+}
+
+.aligncenter {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+label {
+ cursor: pointer;
+}
+
+th.label {
+ width: 128px;
+}
+
+.show-align {
+ padding: 8px;
+ height: 200px;
+ background-color: #f1f1f1;
+ cursor: default;
+ -moz-user-select: none;
+ user-select: none;
+ overflow: hidden;
+}
+
+#media-upload #img-edit {
+ border: 1px solid #c0c0c0;
+ width: 623px;
+ margin: 20px auto auto;
+}
+
+#media-upload .media-upload-form table.describe {
+ border-top-style: none;
+ border-top-width: 0;
+}
+
+#img_demo_txt {
+ font-size: 6px;
+ line-height: 10px;
+ font-family: "Courier New",Courier,monotype;
+ color: #ccc;
+ background-color: #ccc;
+}
+
+#img_demo {
+ padding: 0 5px 4px;
+}
+
+#saveeditimg {
+ padding: 10px 0 0 5px;
+ border-top: 1px solid #ccc;
+}
+
+#sidemenu,
+#sidemenu li {
+ list-style: none;
+
+}
+
+#sidemenu li {
+
+ display: inline;
+}
+
+#sidemenu a {
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+ border-top-style: solid;
+ border-top-width: 1px;
+ display: block;
+ float: left;
+ line-height: 28px;
+ text-decoration: none;
+ text-align: center;
+ white-space: nowrap;
+ margin: 0;
+ padding: 0pt 7px;
+}
+
+#sidemenu a.current {
+ -moz-border-radius-topleft:4px;
+ -moz-border-radius-topright:4px;
+ border-style:solid;
+ border-width:1px;
+ font-weight:normal;
+}
+
+#adv_settings .field label {
+ padding: 0 5px 5px;
+}
+
+#media-upload h3 {
+ clear:both;
+ padding:0pt 0pt 3px;
+ border-bottom-style:solid;
+ border-bottom-width:1px;
+ font-family:Georgia,"Times New Roman",Times,serif;
+ font-size:20px;
+ font-weight:normal;
+ line-height:normal;
+ margin:20px 0 15px -4px;
+ padding:0 0 3px 0;
+ border-bottom-color:#DADADA;
+ color:#5A5A5A;
+}
+
+#img_dim #width,
+#img_dim #height {
+ width:40px;
+}
+
+#img_dim abbr {
+ padding: 0 4px;
+}
+
+#basic .align .field label {
+ margin: 0 10px 0 0;
+ padding: 0 0 0 25px;
+}
+
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html b/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
new file mode 100644
index 0000000..33ccc5f
--- /dev/null
+++ b/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
@@ -0,0 +1,262 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title></title>
+
+<script type="text/javascript" src="js/editimage.js?ver=3091"></script>
+<script type="text/javascript" src="../../utils/form_utils.js?ver=3091"></script>
+
+<link rel="stylesheet" href="css/editimage.css?ver=3091" type="text/css" media="all" />
+<link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-bleeding2" type="text/css" media="all" />
+<base target="_self" />
+</head>
+
+<body id="media-upload" style="display:none;">
+<div id="media-upload-header">
+ <ul id="sidemenu">
+ <li><a href="javascript:;" id="tab_basic" class="current" onclick="wpImage.setTabs(this);">Edit image</a></li>
+ <li><a href="javascript:;" id="tab_advanced" onclick="wpImage.setTabs(this);">Advanced settings</a></li>
+ <li><a href="javascript:;" id="tab_attachment" style="display:none" target="_blanc" onclick="tinyMCEPopup.close();">Edit Attachment</a></li>
+ </ul>
+</div>
+
+<div id="img-edit">
+ <form class="media-upload-form" action="" onsubmit="wpImage.update();">
+ <div id="div_basic">
+
+ <div class="show-align">
+ <img id="img_demo" src="img/image.png" alt="" />
+ <span id="img_demo_txt">
+ Lorem ipsum dolor sit amet consectetuer velit pretium euismod ipsum enim. Mi cursus at a mollis senectus id arcu gravida quis urna. Sed et felis id tempus Morbi mauris tincidunt enim In mauris. Pede eu risus velit libero natoque enim lorem adipiscing ipsum consequat. In malesuada et sociis tincidunt tempus pellentesque cursus convallis ipsum Suspendisse. Risus In ac quis ut Nunc convallis laoreet ante Suspendisse Nam. Amet amet urna condimentum Vestibulum sem at Curabitur lorem et cursus. Sodales tortor fermentum leo dui habitant Nunc Sed Vestibulum.
+ Ut lorem In penatibus libero id ipsum sagittis nec elit Sed. Condimentum eget Vivamus vel consectetuer lorem molestie turpis amet tellus id. Condimentum vel ridiculus Fusce sed pede Nam nunc sodales eros tempor. Sit lacus magna dictumst Curabitur fringilla auctor id vitae wisi facilisi. Fermentum eget turpis felis velit leo Nunc Proin orci molestie Praesent. Curabitur tellus scelerisque suscipit ut sem amet cursus mi Morbi eu. Donec libero Vestibulum augue et mollis accumsan ornare condimentum In enim. Leo eget ac consectetuer quis condimentum malesuada.
+ Condimentum commodo et Lorem fringilla malesuada libero volutpat sem tellus enim. Tincidunt sed at Aenean nec nonummy porttitor Nam Sed Nulla ut. Auctor leo In aliquet Curabitur eros et velit Quisque justo morbi. Et vel mauris sit nulla semper vitae et quis at dui. Id at elit laoreet justo eu mauris Quisque et interdum pharetra. Nullam accumsan interdum Maecenas condimentum quis quis Fusce a sollicitudin Sed. Non Quisque Vivamus congue porttitor non semper ipsum porttitor quis vel. Donec eros lacus volutpat et tincidunt sem convallis id venenatis sit. Consectetuer odio.
+ Semper faucibus Morbi nulla convallis orci Aliquam Sed porttitor et Pellentesque. Venenatis laoreet lorem id a a Morbi augue turpis id semper. Arcu volutpat ac mauris Vestibulum fringilla Aenean condimentum nibh sed id. Sagittis eu lacus orci urna tellus tellus pretium Curabitur dui nunc. Et nibh eu eu nibh adipiscing at lorem Vestibulum adipiscing augue. Magna convallis Phasellus dolor malesuada Curabitur ornare adipiscing tellus Aliquam tempus. Id Aliquam Integer augue Nulla consectetuer ac Donec Curabitur tincidunt et. Id vel Nunc amet lacus dui magna ridiculus penatibus laoreet Duis. Enim sagittis nibh quis Nulla nec laoreet vel Maecenas mattis vel. Nullam velit est Curabitur gravida Vestibulum justo.
+ </span>
+ </div>
+
+ <table id="basic" class="describe">
+ <tbody>
+ <tr class="">
+ <th valign="top" scope="row" class="label">
+ <label for="img_title">
+ <span class="alignleft">Title</span>
+ <span class="alignright"><abbr title="required" class="required">*</abbr></span>
+ </label>
+ </th>
+ <td class="field">
+ <input type="text" id="img_title" name="img_title" value="" aria-required="true" size="60" />
+ </td>
+ </tr>
+
+ <tr class="post_excerpt">
+ <th valign="top" scope="row" class="label">
+ <label for="img_alt">
+ <span class="alignleft">Caption</span>
+ </label>
+ </th>
+ <td class="field">
+ <input type="text" id="img_alt" name="img_alt" value="" size="60" />
+ <p class="help">Alternate text, e.g. "The Mona Lisa"</p>
+ </td>
+ </tr>
+
+ <tr class="url">
+ <th valign="top" scope="row" class="label">
+ <label for="link_href">
+ <span class="alignleft" id="lb_link_href">Link URL</span>
+ </label>
+ </th>
+ <td class="field">
+ <input type="text" id="link_href" name="link_href" value="" /><br />
+ <input type="button" class="button" onclick="wpImage.I('link_href').value='';" value="None" />
+ <input type="button" class="button" id="img_url_current" onclick="wpImage.img_seturl('current')" value="Current Link" />
+ <input type="button" class="button" id="img_url_img" onclick="wpImage.img_seturl('link')" value="Link to Image" />
+ <p class="help">Enter a link URL or click above for presets.</p>
+ </td>
+ </tr>
+
+ <tr class="align">
+ <th valign="top" scope="row" class="label">
+ <label for="img_align_td">
+ <span class="alignleft">{#advanced_dlg.image_align}</span>
+ </label>
+ </th>
+ <td class="field" id="img_align_td">
+ <input type="radio" onclick="wpImage.imgAlignCls('alignnone')" name="img_align" id="alignnone" value="alignnone" />
+ <label for="alignnone" class="align image-align-none-label">None</label>
+
+ <input type="radio" onclick="wpImage.imgAlignCls('alignleft')" name="img_align" id="alignleft" value="alignleft" />
+ <label for="alignleft" class="align image-align-left-label">{#advanced_dlg.image_align_left}</label>
+
+ <input type="radio" onclick="wpImage.imgAlignCls('aligncenter')" name="img_align" id="aligncenter" value="aligncenter" />
+ <label for="aligncenter" class="align image-align-center-label">Center</label>
+
+ <input type="radio" onclick="wpImage.imgAlignCls('alignright')" name="img_align" id="alignright" value="alignright" />
+ <label for="alignright" class="align image-align-right-label">{#advanced_dlg.image_align_right}</label>
+ </td>
+ </tr>
+
+ <tr class="image-size">
+ <th valign="top" scope="row" class="label">
+ <label for="img_size">
+ <span class="alignleft">Size</span>
+ </label>
+ </th>
+ <td class="field" id="img_size">
+ <input onclick="wpImage.imgEditSize('thumbnail')" type="radio" name="img_size" id="thumbnail" value="thumbnail" />
+ <label for="thumbnail" id="lb_sizethumb">Thumbnail</label>
+
+ <input onclick="wpImage.imgEditSize('medium')" type="radio" name="img_size" id="medium" value="medium" />
+ <label for="medium" id="lb_sizemedium">Medium</label>
+
+ <input onclick="wpImage.imgEditSize('full')" type="radio" name="img_size" id="full" value="full" />
+ <label for="full" id="lb_sizefull">Full_size</label>
+ </td>
+ </tr>
+ </tbody>
+ </table></div>
+
+ <div id="div_advanced" style="display:none;">
+ <h3>Advanced Image Settings</h3>
+ <table id="adv_settings_img" class="describe">
+ <tbody>
+ <tr>
+ <th valign="top" scope="row" class="label">
+ <label for="img_src">
+ <span class="alignleft">Source</span>
+ <span class="alignright"><abbr title="required" class="required">*</abbr></span>
+ </label>
+ </th>
+ <td class="field">
+ <input type="text" id="img_src" name="img_src" value="" onblur="wpImage.checkVal(this)" size="60" />
+ </td>
+ </tr>
+
+ <tr>
+ <th valign="top" scope="row" class="label">
+ <label for="img_dim">
+ <span class="alignleft">Size</span>
+ <span class="alignright"></span>
+ </label>
+ </th>
+ <td class="field" id="img_dim">
+ <label for="width">Width</label>
+ <input type="text" id="width" name="width" value="" />
+
+ <label for="height">Height</label>
+ <input type="text" id="height" name="height" value="" />
+ <input type="button" class="button" id="orig_size" name="orig_size" value="Original Size" onclick="wpImage.origSize();" />
+
+ </td>
+ </tr>
+
+ <tr>
+ <th valign="top" scope="row" class="label">
+ <label for="img_classes">
+ <span class="alignleft">CSS Class</span>
+ </label>
+ </th>
+ <td class="field">
+ <input type="text" id="img_classes" name="img_classes" value="" size="60" />
+ </td>
+ </tr>
+
+ <tr>
+ <th valign="top" scope="row" class="label">
+ <label for="img_style">
+ <span class="alignleft">Style</span>
+ </label>
+ </th>
+ <td class="field">
+ <input type="text" id="img_style" name="img_style" value="" size="60" />
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h3>Advanced Link Settings</h3>
+ <table id="adv_settings_img" class="describe">
+ <tbody>
+ <tr>
+ <th valign="top" scope="row" class="label">
+ <label for="link_title">
+ <span class="alignleft">Link Title</span>
+ </label>
+ </th>
+ <td class="field">
+ <input type="text" id="link_title" name="link_title" value="" size="60" />
+ </td>
+ </tr>
+
+ <tr>
+ <th valign="top" scope="row" class="label">
+ <label for="link_rel">
+ <span class="alignleft">Link Rel</span>
+ </label>
+ </th>
+ <td class="field">
+ <input type="text" id="link_rel" name="link_rel" value="" size="60" />
+ </td>
+ </tr>
+
+ <tr>
+ <th valign="top" scope="row" class="label">
+ <label for="link_rev">
+ <span class="alignleft">Link Rev</span>
+ </label>
+ </th>
+ <td class="field">
+ <input type="text" id="link_rev" name="link_rev" value="" size="60" />
+ </td>
+ </tr>
+
+ <tr>
+ <th valign="top" scope="row" class="label">
+ <label for="link_classes">
+ <span class="alignleft">CSS Class</span>
+ </label>
+ </th>
+ <td class="field">
+ <input type="text" id="link_classes" name="link_classes" value="" size="60" />
+ </td>
+ </tr>
+
+ <tr>
+ <th valign="top" scope="row" class="label">
+ <label for="link_style">
+ <span class="alignleft">Style</span>
+ </label>
+ </th>
+ <td class="field">
+ <input type="text" id="link_style" name="link_style" value="" size="60" />
+ </td>
+ </tr>
+
+ <tr>
+ <th valign="top" scope="row" class="label">
+ <label for="link_target">
+ <span class="alignleft">Target</span>
+ </label>
+ </th>
+ <td class="field">
+ <input type="text" id="link_target" name="link_target" value="" size="60" />
+ </td>
+ </tr>
+ </tbody>
+ </table></div>
+
+ <div id="saveeditimg">
+ <input type="hidden" id="border" name="border" value="" />
+ <input type="hidden" id="hspace" name="hspace" value="" />
+ <input type="hidden" id="vspace" name="vspace" value="" />
+ <input type="hidden" id="align" name="align" value="" />
+
+ <input type="submit" id="saveimg" class="button" value="{#update}" />
+ <input type="button" class="button" id="cancelimg" name="cancelimg" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+ </div>
+</form>
+</div>
+
+</body>
+</html>
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js
new file mode 100644
index 0000000..4ad1ba3
--- /dev/null
+++ b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js
@@ -0,0 +1,138 @@
+
+(function() {
+ tinymce.create('tinymce.plugins.wpEditImage', {
+
+ init : function(ed, url) {
+ var t = this;
+
+ t.url = url;
+ t._createButtons();
+
+ // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...');
+ ed.addCommand('WP_EditImage', function() {
+ var el = ed.selection.getNode();
+
+ if ( ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1 || el.nodeName != 'IMG' )
+ return;
+
+ tb_show('', url + '/editimage.html?TB_iframe=true');
+ tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
+ });
+
+ ed.onInit.add(function(ed) {
+ tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) {
+ ed.plugins.wpeditimage.hideButtons();
+ });
+ });
+
+ ed.onExecCommand.add(function(ed, cmd, ui, val) {
+ if ( 'mceFullScreen' == cmd )
+ ed.plugins.wpeditimage.hideButtons();
+ });
+
+ ed.onSaveContent.add(function(ed, o) {
+ ed.plugins.wpeditimage.hideButtons();
+ });
+
+ ed.onMouseUp.add(function(ed, e) {
+ if ( tinymce.isOpera )
+ ed.plugins.wpeditimage.showButtons(e);
+ });
+
+ ed.onMouseDown.add(function(ed, e) {
+ if ( tinymce.isOpera ) return;
+ ed.plugins.wpeditimage.showButtons(e);
+ });
+ },
+
+ showButtons : function(e) {
+ var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y, el = e.target;
+
+ t.hideButtons();
+ if (el.nodeName == 'IMG') {
+ if (ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1)
+ return;
+
+ vp = ed.dom.getViewPort(ed.getWin());
+ p1 = DOM.getPos(ed.getContentAreaContainer());
+ p2 = ed.dom.getPos(el);
+
+ X = Math.max(p2.x - vp.x, 0) + p1.x;
+ Y = Math.max(p2.y - vp.y, 0) + p1.y;
+
+ DOM.setStyles('wp_editbtns', {
+ 'top' : Y+5+'px',
+ 'left' : X+5+'px',
+ 'display' : 'block'
+ });
+
+ t.btnsTout = window.setTimeout( function(){ed.plugins.wpeditimage.hideButtons();}, 5000 );
+ }
+ },
+
+ hideButtons : function() {
+ tinymce.DOM.hide('wp_editbtns');
+ window.clearTimeout(this.btnsTout);
+ },
+
+ _createButtons : function() {
+ var t = this, ed = tinyMCE.activeEditor, DOM = tinymce.DOM;
+
+ DOM.remove('wp_editbtns');
+
+ var wp_editbtns = DOM.add(document.body, 'div', {
+ id : 'wp_editbtns',
+ style : 'display:none;'
+ });
+
+ var wp_editimgbtn = DOM.add('wp_editbtns', 'img', {
+ src : t.url+'/img/image.png',
+ id : 'wp_editimgbtn',
+ width : '24',
+ height : '24',
+ title : 'Edit'
+ });
+
+ wp_editimgbtn.onmousedown = function(e) {
+ var ed = tinyMCE.activeEditor;
+ ed.windowManager.bookmark = ed.selection.getBookmark('simple');
+ ed.execCommand("WP_EditImage");
+ this.parentNode.style.display = 'none';
+ }
+
+ var wp_delimgbtn = DOM.add('wp_editbtns', 'img', {
+ src : t.url+'/img/delete.png',
+ id : 'wp_delimgbtn',
+ width : '24',
+ height : '24',
+ title : 'Delete'
+ });
+
+ wp_delimgbtn.onmousedown = function(e) {
+ var ed = tinyMCE.activeEditor, el = ed.selection.getNode(), p;
+
+ if ( el.nodeName != 'IMG' || ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1 ) return;
+
+ if ( (p = ed.dom.getParent(el, 'A')) && p.childNodes.length == 1)
+ ed.dom.remove(p);
+ else ed.dom.remove(el);
+
+ this.parentNode.style.display = 'none';
+ ed.execCommand('mceRepaint');
+ return false;
+ }
+ },
+
+ getInfo : function() {
+ return {
+ longname : 'Edit Image',
+ author : 'WordPress',
+ authorurl : 'http://wordpress.org',
+ infourl : '',
+ version : "1.0"
+ };
+ }
+ });
+
+ tinymce.PluginManager.add('wpeditimage', tinymce.plugins.wpEditImage);
+})();
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png b/wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png
new file mode 100644
index 0000000..d64d8a6
--- /dev/null
+++ b/wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png
Binary files differ
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/img/image.png b/wp-includes/js/tinymce/plugins/wpeditimage/img/image.png
new file mode 100644
index 0000000..f3d4b44
--- /dev/null
+++ b/wp-includes/js/tinymce/plugins/wpeditimage/img/image.png
Binary files differ
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
new file mode 100644
index 0000000..8a218a1
--- /dev/null
+++ b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
@@ -0,0 +1,471 @@
+
+var tinymce = null, tinyMCEPopup, tinyMCE;
+
+tinyMCEPopup = {
+ init: function() {
+ var t = this, w, ti, li, q, i, it;
+
+ li = ('' + document.location.search).replace(/^\?/, '').split('&');
+ q = {};
+ for (i=0; i<li.length; i++) {
+ it = li[i].split('=');
+ q[unescape(it[0])] = unescape(it[1]);
+ }
+
+ if (q.mce_rdomain)
+ document.domain = q.mce_rdomain;
+
+ // Find window & API
+ w = t.getWin();
+ tinymce = w.tinymce;
+ tinyMCE = w.tinyMCE;
+ t.editor = tinymce.EditorManager.activeEditor;
+ t.params = t.editor.windowManager.params;
+
+ // Setup local DOM
+ t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document);
+ t.editor.windowManager.onOpen.dispatch(t.editor.windowManager, window);
+ },
+
+ getWin : function() {
+ return window.dialogArguments || opener || parent || top;
+ },
+
+ getParam : function(n, dv) {
+ return this.editor.getParam(n, dv);
+ },
+
+ close : function() {
+ var t = this, win = t.getWin();
+
+ // To avoid domain relaxing issue in Opera
+ function close() {
+ t.editor.execCommand('mceRepaint');
+ win.tb_remove();
+ tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup
+ };
+
+ if (tinymce.isOpera)
+ win.setTimeout(close, 0);
+ else
+ close();
+ },
+
+ execCommand : function(cmd, ui, val, a) {
+ a = a || {};
+ a.skip_focus = 1;
+
+ this.restoreSelection();
+ return this.editor.execCommand(cmd, ui, val, a);
+ },
+
+ storeSelection : function() {
+ this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark('simple');
+ },
+
+ restoreSelection : function() {
+ var t = tinyMCEPopup;
+
+ if (tinymce.isIE)
+ t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark);
+ }
+}
+tinyMCEPopup.init();
+
+var wpImage = {
+ preInit : function() {
+ // import colors stylesheet from parent
+ var win = tinyMCEPopup.getWin();
+ var styles = win.document.styleSheets;
+
+ for ( i = 0; i < styles.length; i++ ) {
+ var url = styles.item(i).href;
+ if ( url && url.indexOf('colors-') != -1 ) {
+ document.write( '<link rel="stylesheet" href="'+url+'" type="text/css" media="all" />' );
+ break;
+ }
+ }
+ },
+
+ I : function(e) {
+ return document.getElementById(e);
+ },
+
+ current : '',
+ link : '',
+ link_rel : '',
+
+ setTabs : function(tab) {
+ var t = this;
+
+ if ( 'current' == tab.className ) return false;
+ t.I('div_advanced').style.display = ( 'tab_advanced' == tab.id ) ? 'block' : 'none';
+ t.I('div_basic').style.display = ( 'tab_basic' == tab.id ) ? 'block' : 'none';
+ t.I('tab_basic').className = t.I('tab_advanced').className = '';
+ tab.className = 'current';
+ return false;
+ },
+
+ img_seturl : function(u) {
+ var t = this, rel = t.I('link_rel').value;
+
+ if ( 'current' == u ) {
+ t.I('link_href').value = t.current;
+ t.I('link_rel').value = t.link_rel;
+ } else {
+ t.I('link_href').value = t.link;
+ if ( rel ) {
+ rel = rel.replace( /attachment|wp-att-[0-9]+/gi, '' );
+ t.I('link_rel').value = tinymce.trim(rel);
+ }
+ }
+ },
+
+ imgAlignCls : function(v) {
+ var t = this, cls = t.I('img_classes').value;
+
+ t.I('img_demo').className = v;
+
+ cls = cls.replace( /align[^ "']+/gi, '' );
+ cls += (' ' + v);
+ cls = cls.replace( /\s+/g, ' ' ).replace( /^\s/, '' );
+
+ t.I('img_classes').value = cls;
+ },
+
+ imgSizeCls : function(v) {
+ var t = this, cls = t.I('img_classes').value;
+
+ if (v) {
+ if ( cls.indexOf('size-') != -1 )
+ cls = cls.replace( /size-[^ "']+/i, 'size-' + v );
+ else cls += (' size-' + v);
+ } else {
+ cls = cls.replace( /size-[^ "']+/gi, '' );
+ t.demoSetSize();
+ t.I('thumbnail').checked = '';
+ t.I('medium').checked = '';
+ t.I('full').checked = '';
+ }
+ cls = cls.replace( /\s+/g, ' ' ).replace( /^\s|\s$/, '' );
+
+ t.I('img_classes').value = cls;
+ },
+
+ imgEditSize : function(size) {
+ var t = this, f = document.forms[0], sz, m = null;
+
+ var W = parseInt(t.preloadImg.width), H = parseInt(t.preloadImg.height);
+
+ if ( ! t.preloadImg || W == "" || H == "" )
+ return;
+
+ switch(size) {
+ case 'thumbnail':
+ m = 150;
+ t.imgSizeCls('thumbnail');
+ break;
+ case 'medium':
+ m = 300;
+ t.imgSizeCls('medium');
+ break;
+ case 'full':
+ m = 500;
+ t.imgSizeCls('full');
+ break;
+ }
+
+ if (m) {
+ if ( W > H ) {
+ m = Math.min(W, m);
+ f.width.value = m;
+ f.height.value = Math.floor((m / W) * H);
+ } else {
+ m = Math.min(H, m);
+ f.height.value = m;
+ f.width.value = Math.floor((m / H) * W);
+ }
+
+ t.width = f.width.value;
+ t.height = f.height.value;
+ }
+ t.demoSetSize();
+ },
+
+ demoSetSize : function(img) {
+ var demo = this.I('img_demo'), f = document.forms[0];
+
+ demo.style.width = f.width.value ? Math.floor(f.width.value * 0.6) + 'px' : '';
+ demo.style.height = f.height.value ? Math.floor(f.height.value * 0.6) + 'px' : '60%';
+ },
+
+ origSize : function() {
+ var t = this, f = document.forms[0];
+
+ f.width.value = t.preloadImg.width;
+ f.height.value = t.preloadImg.height;
+ t.demoSetSize();
+ t.imgSizeCls();
+ },
+
+ init : function() {
+ var ed = tinyMCEPopup.editor, h;
+
+ h = document.body.innerHTML;
+
+ // Replace a=x with a="x" in IE
+ if (tinymce.isIE)
+ h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"')
+
+ document.dir = ed.getParam('directionality','');
+ document.body.innerHTML = ed.translate(h);
+ window.setTimeout( function(){wpImage.setup();}, 100 );
+ },
+
+ setup : function() {
+ var t = this, h, c, el, id, link, fname, f = document.forms[0], ed = tinyMCEPopup.editor, d = t.I('img_demo'), tr = ed.translate;
+
+ tinyMCEPopup.restoreSelection();
+ el = ed.selection.getNode();
+ if (el.nodeName != 'IMG') return;
+
+ f.img_src.value = d.src = link = ed.dom.getAttrib(el, 'src');
+
+ f.img_title.value = ed.dom.getAttrib(el, 'title');
+ f.img_alt.value = ed.dom.getAttrib(el, 'alt');
+ f.border.value = ed.dom.getAttrib(el, 'border');
+ f.vspace.value = ed.dom.getAttrib(el, 'vspace');
+ f.hspace.value = ed.dom.getAttrib(el, 'hspace');
+ f.align.value = ed.dom.getAttrib(el, 'align');
+ f.width.value = t.width = ed.dom.getAttrib(el, 'width');
+ f.height.value = t.height = ed.dom.getAttrib(el, 'height');
+ f.img_classes.value = c = ed.dom.getAttrib(el, 'class');
+ f.img_style.value = ed.dom.getAttrib(el, 'style');
+ this.updateStyle();
+
+ if (pa = ed.dom.getParent(el, 'A')) {
+ f.link_href.value = t.current = ed.dom.getAttrib(pa, 'href');
+ f.link_title.value = ed.dom.getAttrib(pa, 'title');
+ f.link_rel.value = t.link_rel = ed.dom.getAttrib(pa, 'rel');
+ f.link_rev.value = ed.dom.getAttrib(pa, 'rev');
+ f.link_style.value = ed.dom.getAttrib(pa, 'style');
+ f.link_target.value = ed.dom.getAttrib(pa, 'target');
+ f.link_classes.value = ed.dom.getAttrib(pa, 'class');
+ }
+
+ fname = link.substring( link.lastIndexOf('/') );
+ fname = fname.replace(/-[0-9]{2,4}x[0-9]{2,4}/, '' );
+ t.link = link.substring( 0, link.lastIndexOf('/') ) + fname;
+
+ if ( c.indexOf('size-thumbnail') != -1 )
+ t.I('thumbnail').checked = "checked";
+ else if ( c.indexOf('size-medium') != -1 )
+ t.I('medium').checked = "checked";
+ else if ( c.indexOf('size-full') != -1 )
+ t.I('full').checked = "checked";
+
+ if ( c.indexOf('alignleft') != -1 ) {
+ t.I('alignleft').checked = "checked";
+ d.className = "alignleft";
+ } else if ( c.indexOf('aligncenter') != -1 ) {
+ t.I('aligncenter').checked = "checked";
+ d.className = "aligncenter";
+ } else if ( c.indexOf('alignright') != -1 ) {
+ t.I('alignright').checked = "checked";
+ d.className = "alignright";
+ } else if ( c.indexOf('alignnone') != -1 ) {
+ t.I('alignnone').checked = "checked";
+ d.className = "alignnone";
+ }
+
+ document.body.style.display = '';
+ t.getImageData();
+
+ if ( (id = c.match( /wp-image-([0-9]{1,6})/ )) && id[1] ) {
+ t.I('tab_attachment').href = tinymce.documentBaseURL + 'media.php?action=edit&attachment_id=' + id[1];
+ t.I('tab_attachment').style.display = 'inline';
+ }
+ },
+
+ remove : function() {
+ var ed = tinyMCEPopup.editor, p, el;
+
+ tinyMCEPopup.restoreSelection();
+ el = ed.selection.getNode();
+ if (el.nodeName != 'IMG') return;
+
+ if ( (p = ed.dom.getParent(el, 'A')) && p.childNodes.length == 1)
+ ed.dom.remove(p);
+ else
+ ed.dom.remove(el);
+
+ ed.execCommand('mceRepaint');
+ tinyMCEPopup.close();
+ return;
+ },
+
+ update : function() {
+ var t = this, f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, p, el, b;
+
+ tinyMCEPopup.restoreSelection();
+ el = ed.selection.getNode();
+
+ if (el.nodeName != 'IMG') return;
+ if (f.img_src.value === '') t.remove();
+
+ ed.dom.setAttribs(el, {
+ src : f.img_src.value,
+ title : f.img_title.value,
+ alt : f.img_alt.value,
+ width : f.width.value,
+ height : f.height.value,
+ style : f.img_style.value,
+ 'class' : f.img_classes.value
+ });
+
+ pa = ed.dom.getParent(el, 'A');
+
+ if ( ! f.link_href.value ) {
+ if ( pa ) {
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");
+ b = ed.selection.getBookmark();
+ ed.dom.remove(pa, 1);
+ ed.selection.moveToBookmark(b);
+ tinyMCEPopup.execCommand("mceEndUndoLevel");
+ tinyMCEPopup.close();
+ return;
+ }
+ }
+
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");
+
+ // Create new anchor elements
+ if (pa == null) {
+ tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
+
+ tinymce.each(ed.dom.select("a"), function(n) {
+ if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {
+
+ ed.dom.setAttribs(n, {
+ href : f.link_href.value,
+ title : f.link_title.value,
+ rel : f.link_rel.value,
+ rev : f.link_rev.value,
+ target : f.link_target.value,
+ 'class' : f.link_classes.value,
+ style : f.link_style.value
+ });
+ }
+ });
+ } else {
+ ed.dom.setAttribs(pa, {
+ href : f.link_href.value,
+ title : f.link_title.value,
+ rel : f.link_rel.value,
+ rev : f.link_rev.value,
+ target : f.link_target.value,
+ 'class' : f.link_classes.value,
+ style : f.link_style.value
+ });
+ }
+
+ tinyMCEPopup.execCommand("mceEndUndoLevel");
+ tinyMCEPopup.close();
+ },
+
+ updateStyle : function() {
+ var dom = tinyMCEPopup.dom, st, v, f = document.forms[0];
+
+ if (tinyMCEPopup.editor.settings.inline_styles) {
+ st = tinyMCEPopup.dom.parseStyle(f.img_style.value);
+
+ // Handle align
+ v = f.align.value;
+ if (v) {
+ if (v == 'left' || v == 'right') {
+ st['float'] = v;
+ delete st['vertical-align'];
+ } else {
+ st['vertical-align'] = v;
+ delete st['float'];
+ }
+ } else {
+ delete st['float'];
+ delete st['vertical-align'];
+ }
+
+ // Handle border
+ v = f.border.value;
+ if (v || v == '0') {
+ if (v == '0')
+ st['border'] = '0';
+ else
+ st['border'] = v + 'px solid black';
+ } else
+ delete st['border'];
+
+ // Handle hspace
+ v = f.hspace.value;
+ if (v) {
+ delete st['margin'];
+ st['margin-left'] = v + 'px';
+ st['margin-right'] = v + 'px';
+ } else {
+ delete st['margin-left'];
+ delete st['margin-right'];
+ }
+
+ // Handle vspace
+ v = f.vspace.value;
+ if (v) {
+ delete st['margin'];
+ st['margin-top'] = v + 'px';
+ st['margin-bottom'] = v + 'px';
+ } else {
+ delete st['margin-top'];
+ delete st['margin-bottom'];
+ }
+
+ // Merge
+ st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st));
+ f.img_style.value = dom.serializeStyle(st);
+ }
+ },
+
+ checkVal : function(f) {
+
+ if ( f.value == '' ) {
+ // if ( f.id == 'width' ) f.value = this.width || this.preloadImg.width;
+ // if ( f.id == 'height' ) f.value = this.height || this.preloadImg.height;
+ if ( f.id == 'img_src' ) f.value = this.I('img_demo').src || this.preloadImg.src;
+ }
+ },
+
+ resetImageData : function() {
+ var f = document.forms[0];
+
+ f.width.value = f.height.value = "";
+ },
+
+ updateImageData : function() {
+ var f = document.forms[0], t = wpImage;
+
+ if ( f.width.value == '' || f.height.value == '' ) {
+ f.width.value = t.preloadImg.width;
+ f.height.value = t.preloadImg.height;
+ }
+ t.demoSetSize();
+ },
+
+ getImageData : function() {
+ var t = wpImage, f = document.forms[0];
+
+ t.preloadImg = new Image();
+ t.preloadImg.onload = t.updateImageData;
+ t.preloadImg.onerror = t.resetImageData;
+ t.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.img_src.value);
+ }
+};
+
+window.onload = function(){wpImage.init();}
+wpImage.preInit();
diff --git a/wp-includes/js/tinymce/themes/advanced/about.htm b/wp-includes/js/tinymce/themes/advanced/about.htm
index 69e3760..493a60b 100644
--- a/wp-includes/js/tinymce/themes/advanced/about.htm
+++ b/wp-includes/js/tinymce/themes/advanced/about.htm
@@ -2,9 +2,9 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.about_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?v=307"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
- <script type="text/javascript" src="js/about.js?v=307"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3091"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3091"></script>
+ <script type="text/javascript" src="js/about.js?ver=3091"></script>
</head>
<body id="about" style="display: none">
<div class="tabs">
diff --git a/wp-includes/js/tinymce/themes/advanced/anchor.htm b/wp-includes/js/tinymce/themes/advanced/anchor.htm
index 3ae87d0..644518d 100644
--- a/wp-includes/js/tinymce/themes/advanced/anchor.htm
+++ b/wp-includes/js/tinymce/themes/advanced/anchor.htm
@@ -2,8 +2,8 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.anchor_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?v=307"></script>
- <script type="text/javascript" src="js/anchor.js?v=307"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3091"></script>
+ <script type="text/javascript" src="js/anchor.js?ver=3091"></script>
<base target="_self" />
</head>
<body style="display: none">
diff --git a/wp-includes/js/tinymce/themes/advanced/charmap.htm b/wp-includes/js/tinymce/themes/advanced/charmap.htm
index 4f71457..80bfda8 100644
--- a/wp-includes/js/tinymce/themes/advanced/charmap.htm
+++ b/wp-includes/js/tinymce/themes/advanced/charmap.htm
@@ -3,8 +3,8 @@
<head>
<title>{#advanced_dlg.charmap_title}</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
- <script type="text/javascript" src="../../tiny_mce_popup.js?v=307"></script>
- <script type="text/javascript" src="js/charmap.js?v=307"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3091"></script>
+ <script type="text/javascript" src="js/charmap.js?ver=3091"></script>
<base target="_self" />
</head>
<body id="charmap" style="display:none">
diff --git a/wp-includes/js/tinymce/themes/advanced/color_picker.htm b/wp-includes/js/tinymce/themes/advanced/color_picker.htm
index 62fc40f..ab907a9 100644
--- a/wp-includes/js/tinymce/themes/advanced/color_picker.htm
+++ b/wp-includes/js/tinymce/themes/advanced/color_picker.htm
@@ -2,9 +2,9 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.colorpicker_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?v=307"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
- <script type="text/javascript" src="js/color_picker.js?v=307"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3091"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3091"></script>
+ <script type="text/javascript" src="js/color_picker.js?ver=3091"></script>
<base target="_self" />
</head>
<body id="colorpicker" style="display: none">
diff --git a/wp-includes/js/tinymce/themes/advanced/editor_template.js b/wp-includes/js/tinymce/themes/advanced/editor_template.js
index 8ad3394..eea384f 100644
--- a/wp-includes/js/tinymce/themes/advanced/editor_template.js
+++ b/wp-includes/js/tinymce/themes/advanced/editor_template.js
@@ -1 +1 @@
-(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,each=tinymce.each,Cookie=tinymce.util.Cookie,lastExtID,explode=tinymce.explode;tinymce.ThemeManager.requireLangPack('advanced');tinymce.create('tinymce.themes.AdvancedTheme',{controls:{bold:['bold_desc','Bold'],italic:['italic_desc','Italic'],underline:['underline_desc','Underline'],strikethrough:['striketrough_desc','Strikethrough'],justifyleft:['justifyleft_desc','JustifyLeft'],justifycenter:['justifycenter_desc','JustifyCenter'],justifyright:['justifyright_desc','JustifyRight'],justifyfull:['justifyfull_desc','JustifyFull'],bullist:['bullist_desc','InsertUnorderedList'],numlist:['numlist_desc','InsertOrderedList'],outdent:['outdent_desc','Outdent'],indent:['indent_desc','Indent'],cut:['cut_desc','Cut'],copy:['copy_desc','Copy'],paste:['paste_desc','Paste'],undo:['undo_desc','Undo'],redo:['redo_desc','Redo'],link:['link_desc','mceLink'],unlink:['unlink_desc','unlink'],image:['image_desc','mceImage'],cleanup:['cleanup_desc','mceCleanup'],help:['help_desc','mceHelp'],code:['code_desc','mceCodeEditor'],hr:['hr_desc','InsertHorizontalRule'],removeformat:['removeformat_desc','RemoveFormat'],sub:['sub_desc','subscript'],sup:['sup_desc','superscript'],forecolor:['forecolor_desc','ForeColor'],forecolorpicker:['forecolor_desc','mceForeColor'],backcolor:['backcolor_desc','HiliteColor'],backcolorpicker:['backcolor_desc','mceBackColor'],charmap:['charmap_desc','mceCharMap'],visualaid:['visualaid_desc','mceToggleVisualAid'],anchor:['anchor_desc','mceInsertAnchor'],newdocument:['newdocument_desc','mceNewDocument'],blockquote:['blockquote_desc','mceBlockQuote']},stateControls:['bold','italic','underline','strikethrough','bullist','numlist','justifyleft','justifycenter','justifyright','justifyfull','sub','sup','blockquote'],init:function(ed,url){var t=this,s,v;t.editor=ed;t.url=url;t.onResolveName=new tinymce.util.Dispatcher(this);t.settings=s=extend({theme_advanced_path:true,theme_advanced_toolbar_location:'bottom',theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1},ed.settings);if((v=s.theme_advanced_path_location)&&v!='none')s.theme_advanced_statusbar_location=s.theme_advanced_path_location;if(s.theme_advanced_statusbar_location=='none')s.theme_advanced_statusbar_location=0;ed.onInit.add(function(){ed.onNodeChange.add(t._nodeChanged,t);if(ed.settings.content_css!==false)ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/"+ed.settings.skin+"/content.css"));});ed.onSetProgressState.add(function(ed,b,ti){var co,id=ed.id,tb;if(b){t.progressTimer=setTimeout(function(){co=ed.getContainer();co=co.insertBefore(DOM.create('DIV',{style:'position:relative'}),co.firstChild);tb=DOM.get(ed.id+'_tbl');DOM.add(co,'div',{id:id+'_blocker','class':'mceBlocker',style:{width:tb.clientWidth+2,height:tb.clientHeight+2}});DOM.add(co,'div',{id:id+'_progress','class':'mceProgress',style:{left:tb.clientWidth/ 2, top : tb.clientHeight /2}});},ti||0);}else{DOM.remove(id+'_blocker');DOM.remove(id+'_progress');clearTimeout(t.progressTimer);}});DOM.loadCSS(ed.baseURI.toAbsolute(s.editor_css||"themes/advanced/skins/"+ed.settings.skin+"/ui.css"));if(s.skin_variant)DOM.loadCSS(ed.baseURI.toAbsolute(s.editor_css||"themes/advanced/skins/"+ed.settings.skin+"/ui_"+s.skin_variant+".css"));},createControl:function(n,cf){var cd,c;if(c=cf.createControl(n))return c;switch(n){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu();}if((cd=this.controls[n]))return cf.createButton(n,{title:"advanced."+cd[0],cmd:cd[1],ui:cd[2],value:cd[3]});},execCommand:function(cmd,ui,val){var f=this['_'+cmd];if(f){f.call(this,ui,val);return true;}return false;},_importClasses:function(){var ed=this.editor,c=ed.controlManager.get('styleselect');if(c.getLength()==0){each(ed.dom.getClasses(),function(o){c.add(o['class'],o['class']);});}},_createStyleSelect:function(n){var t=this,ed=t.editor,cf=ed.controlManager,c=cf.createListBox('styleselect',{title:'advanced.style_select',onselect:function(v){if(c.selectedValue===v){ed.execCommand('mceSetStyleInfo',0,{command:'removeformat'});c.select();return false;}else ed.execCommand('mceSetCSSClass',0,v);}});if(c){each(ed.getParam('theme_advanced_styles','','hash'),function(v,k){if(v)c.add(t.editor.translate(k),v);});c.onPostRender.add(function(ed,n){Event.add(n,'focus',t._importClasses,t);Event.add(n,'mousedown',t._importClasses,t);});}return c;},_createFontSelect:function(){var c,t=this,ed=t.editor;c=ed.controlManager.createListBox('fontselect',{title:'advanced.fontdefault',cmd:'FontName'});if(c){each(ed.getParam('theme_advanced_fonts',t.settings.theme_advanced_fonts,'hash'),function(v,k){c.add(ed.translate(k),v,{style:v.indexOf('dings')==-1?'font-family:'+v:''});});}return c;},_createFontSizeSelect:function(){var c,t=this,lo=["1 (8 pt)","2 (10 pt)","3 (12 pt)","4 (14 pt)","5 (18 pt)","6 (24 pt)","7 (36 pt)"],fz=[8,10,12,14,18,24,36];c=t.editor.controlManager.createListBox('fontsizeselect',{title:'advanced.font_size',cmd:'FontSize'});if(c){each(explode(t.settings.theme_advanced_font_sizes),function(v){c.add(lo[parseInt(v)-1],v,{'style':'font-size:'+fz[v-1]+'pt','class':'mceFontSize'+v});});}return c;},_createBlockFormats:function(){var c,fmts={p:'advanced.paragraph',address:'advanced.address',pre:'advanced.pre',h1:'advanced.h1',h2:'advanced.h2',h3:'advanced.h3',h4:'advanced.h4',h5:'advanced.h5',h6:'advanced.h6',div:'advanced.div',blockquote:'advanced.blockquote',code:'advanced.code',dt:'advanced.dt',dd:'advanced.dd',samp:'advanced.samp'},t=this;c=t.editor.controlManager.createListBox('formatselect',{title:'advanced.block',cmd:'FormatBlock'});if(c){each(t.editor.getParam('theme_advanced_blockformats',t.settings.theme_advanced_blockformats,'hash'),function(v,k){c.add(t.editor.translate(k!=v?k:fmts[v]),v,{'class':'mce_formatPreview mce_'+v});});}return c;},_createForeColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_text_colors)o.colors=v;o.title='advanced.forecolor_desc';o.cmd='ForeColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('forecolor',o);return c;},_createBackColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_background_colors)o.colors=v;o.title='advanced.backcolor_desc';o.cmd='HiliteColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('backcolor',o);return c;},renderUI:function(o){var n,ic,tb,t=this,ed=t.editor,s=t.settings,sc,p,nl;n=p=DOM.create('span',{id:ed.id+'_parent','class':'mceEditor '+ed.settings.skin+'Skin'+(s.skin_variant?' '+ed.settings.skin+'Skin'+t._ufirst(s.skin_variant):'')});if(!DOM.boxModel)n=DOM.add(n,'div',{'class':'mceOldBoxModel'});n=sc=DOM.add(n,'table',{id:ed.id+'_tbl','class':'mceLayout',cellSpacing:0,cellPadding:0});n=tb=DOM.add(n,'tbody');switch((s.theme_advanced_layout_manager||'').toLowerCase()){case"rowlayout":ic=t._rowLayout(s,tb,o);break;case"customlayout":ic=ed.execCallback("theme_advanced_custom_layout",s,tb,o,p);break;default:ic=t._simpleLayout(s,tb,o,p);}n=o.targetNode;nl=DOM.stdMode?sc.getElementsByTagName('tr'):sc.rows;DOM.addClass(nl[0],'mceFirst');DOM.addClass(nl[nl.length-1],'mceLast');each(DOM.select('tr',tb),function(n){DOM.addClass(n.firstChild,'mceFirst');DOM.addClass(n.childNodes[n.childNodes.length-1],'mceLast');});if(DOM.get(s.theme_advanced_toolbar_container))DOM.get(s.theme_advanced_toolbar_container).appendChild(p);else DOM.insertAfter(p,n);Event.add(ed.id+'_path_row','click',function(e){e=e.target;if(e.nodeName=='A'){t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/,'$1'));return Event.cancel(e);}});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))Event.add(DOM.add(p,'a',{href:'#'},'<!-- IE -->'),'focus',function(){tinyMCE.get(ed.id).focus();});if(s.theme_advanced_toolbar_location=='external')o.deltaHeight=0;t.deltaHeight=o.deltaHeight;o.targetNode=null;return{iframeContainer:ic,editorContainer:ed.id+'_parent',sizeContainer:sc,deltaHeight:o.deltaHeight};},getInfo:function(){return{longname:'Advanced theme',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}},resizeBy:function(dw,dh){var e=DOM.get(this.editor.id+'_tbl');this.resizeTo(e.clientWidth+dw,e.clientHeight+dh);},resizeTo:function(w,h){var ed=this.editor,s=ed.settings,e=DOM.get(ed.id+'_tbl'),ifr=DOM.get(ed.id+'_ifr'),dh;w=Math.max(s.theme_advanced_resizing_min_width||100,w);h=Math.max(s.theme_advanced_resizing_min_height||100,h);w=Math.min(s.theme_advanced_resizing_max_width||0xFFFF,w);h=Math.min(s.theme_advanced_resizing_max_height||0xFFFF,h);dh=e.clientHeight-ifr.clientHeight;DOM.setStyle(ifr,'height',h-dh);DOM.setStyles(e,{width:w,height:h});},destroy:function(){var id=this.editor.id;Event.clear(id+'_resize');Event.clear(id+'_path_row');Event.clear(id+'_external_close');},_simpleLayout:function(s,tb,o,p){var t=this,ed=t.editor,lo=s.theme_advanced_toolbar_location,sl=s.theme_advanced_statusbar_location,n,ic,etb,c;if(lo=='top')t._addToolbars(tb,o);if(lo=='external'){n=c=DOM.create('div',{style:'position:relative'});n=DOM.add(n,'div',{id:ed.id+'_external','class':'mceExternalToolbar'});DOM.add(n,'a',{id:ed.id+'_external_close',href:'javascript:;','class':'mceExternalClose'});n=DOM.add(n,'table',{id:ed.id+'_tblext',cellSpacing:0,cellPadding:0});etb=DOM.add(n,'tbody');if(p.firstChild.className=='mceOldBoxModel')p.firstChild.appendChild(c);else p.insertBefore(c,p.firstChild);t._addToolbars(etb,o);ed.onMouseUp.add(function(){var e=DOM.get(ed.id+'_external');DOM.show(e);DOM.hide(lastExtID);var f=Event.add(ed.id+'_external_close','click',function(){DOM.hide(ed.id+'_external');Event.remove(ed.id+'_external_close','click',f);});DOM.show(e);DOM.setStyle(e,'top',0-DOM.getRect(ed.id+'_tblext').h-1);DOM.hide(e);DOM.show(e);e.style.filter='';lastExtID=ed.id+'_external';e=null;});}if(sl=='top')t._addStatusBar(tb,o);if(!s.theme_advanced_toolbar_container){n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});}if(lo=='bottom')t._addToolbars(tb,o);if(sl=='bottom')t._addStatusBar(tb,o);return ic;},_rowLayout:function(s,tb,o){var t=this,ed=t.editor,dc,da,cf=ed.controlManager,n,ic,to,a;dc=s.theme_advanced_containers_default_class||'';da=s.theme_advanced_containers_default_align||'center';each(explode(s.theme_advanced_containers||''),function(c,i){var v=s['theme_advanced_container_'+c]||'';switch(c.toLowerCase()){case'mceeditor':n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});break;case'mceelementpath':t._addStatusBar(tb,o);break;default:a=s['theme_advanced_container_'+c+'_align'].toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(tb,'tr'),'td',{'class':'mceToolbar '+(s['theme_advanced_container_'+c+'_class']||dc)+' '+a||da});to=cf.createToolbar("toolbar"+i);t._addControls(v,to);DOM.setHTML(n,to.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}});return ic;},_addControls:function(v,tb){var t=this,s=t.settings,di,cf=t.editor.controlManager;if(s.theme_advanced_disable&&!t._disabled){di={};each(explode(s.theme_advanced_disable),function(v){di[v]=1;});t._disabled=di;}else di=t._disabled;each(explode(v),function(n){var c;if(di&&di[n])return;if(n=='tablecontrols'){each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(n){n=t.createControl(n,cf);if(n)tb.add(n);});return;}c=t.createControl(n,cf);if(c)tb.add(c);});},_addToolbars:function(c,o){var t=this,i,tb,ed=t.editor,s=t.settings,v,cf=ed.controlManager,di,n,h=[],a;a=s.theme_advanced_toolbar_align.toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(c,'tr'),'td',{'class':'mceToolbar '+a});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))h.push(DOM.createHTML('a',{href:'#',onfocus:'tinyMCE.get(\''+ed.id+'\').focus();'},'<!-- IE -->'));h.push(DOM.createHTML('a',{href:'#',accesskey:'q',title:ed.getLang("advanced.toolbar_focus")},'<!-- IE -->'));for(i=1;(v=s['theme_advanced_buttons'+i]);i++){tb=cf.createToolbar("toolbar"+i,{'class':'mceToolbarRow'+i});if(s['theme_advanced_buttons'+i+'_add'])v+=','+s['theme_advanced_buttons'+i+'_add'];if(s['theme_advanced_buttons'+i+'_add_before'])v=s['theme_advanced_buttons'+i+'_add_before']+','+v;t._addControls(v,tb);h.push(tb.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}h.push(DOM.createHTML('a',{href:'#',accesskey:'z',title:ed.getLang("advanced.toolbar_focus"),onfocus:'tinyMCE.getInstanceById(\''+ed.id+'\').focus();'},'<!-- IE -->'));DOM.setHTML(n,h.join(''));},_addStatusBar:function(tb,o){var n,t=this,ed=t.editor,s=t.settings,r,mf,me,td;n=DOM.add(tb,'tr');n=td=DOM.add(n,'td',{'class':'mceStatusbar'});n=DOM.add(n,'div',{id:ed.id+'_path_row'},s.theme_advanced_path?ed.translate('advanced.path')+': ':'&nbsp;');DOM.add(n,'a',{href:'#',accesskey:'x'});if(s.theme_advanced_resizing&&!tinymce.isOldWebKit){DOM.add(td,'a',{id:ed.id+'_resize',href:'javascript:;',onclick:"return false;",'class':'mceResize'});if(s.theme_advanced_resizing_use_cookie){ed.onPostRender.add(function(){var o=Cookie.getHash("TinyMCE_"+ed.id+"_size"),c=DOM.get(ed.id+'_tbl');if(!o)return;if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,o.cw)+'px';c.style.height=Math.max(10,o.ch)+'px';DOM.get(ed.id+'_ifr').style.height=Math.max(10,parseInt(o.ch)+t.deltaHeight)+'px';});}ed.onPostRender.add(function(){Event.add(ed.id+'_resize','mousedown',function(e){var c,p,w,h,n,pa;c=DOM.get(ed.id+'_tbl');w=c.clientWidth;h=c.clientHeight;miw=s.theme_advanced_resizing_min_width||100;mih=s.theme_advanced_resizing_min_height||100;maw=s.theme_advanced_resizing_max_width||0xFFFF;mah=s.theme_advanced_resizing_max_height||0xFFFF;p=DOM.add(DOM.get(ed.id+'_parent'),'div',{'class':'mcePlaceHolder'});DOM.setStyles(p,{width:w,height:h});DOM.hide(c);DOM.show(p);r={x:e.screenX,y:e.screenY,w:w,h:h,dx:null,dy:null};mf=Event.add(DOM.doc,'mousemove',function(e){var w,h;r.dx=e.screenX-r.x;r.dy=e.screenY-r.y;w=Math.max(miw,r.w+r.dx);h=Math.max(mih,r.h+r.dy);w=Math.min(maw,w);h=Math.min(mah,h);if(s.theme_advanced_resize_horizontal)p.style.width=w+'px';p.style.height=h+'px';return Event.cancel(e);});me=Event.add(DOM.doc,'mouseup',function(e){var ifr;Event.remove(DOM.doc,'mousemove',mf);Event.remove(DOM.doc,'mouseup',me);c.style.display='';DOM.remove(p);if(r.dx===null)return;ifr=DOM.get(ed.id+'_ifr');if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,r.w+r.dx)+'px';c.style.height=Math.max(10,r.h+r.dy)+'px';ifr.style.height=Math.max(10,ifr.clientHeight+r.dy)+'px';if(s.theme_advanced_resizing_use_cookie){Cookie.setHash("TinyMCE_"+ed.id+"_size",{cw:r.w+r.dx,ch:r.h+r.dy});}});return Event.cancel(e);});});}o.deltaHeight-=21;n=tb=null;},_nodeChanged:function(ed,cm,n,co){var t=this,p,de=0,v,c,s=t.settings;tinymce.each(t.stateControls,function(c){cm.setActive(c,ed.queryCommandState(t.controls[c][1]));});cm.setActive('visualaid',ed.hasVisual);cm.setDisabled('undo',!ed.undoManager.hasUndo()&&!ed.typing);cm.setDisabled('redo',!ed.undoManager.hasRedo());cm.setDisabled('outdent',!ed.queryCommandState('Outdent'));p=DOM.getParent(n,'A');if(c=cm.get('link')){if(!p||!p.name){c.setDisabled(!p&&co);c.setActive(!!p);}}if(c=cm.get('unlink')){c.setDisabled(!p&&co);c.setActive(!!p&&!p.name);}if(c=cm.get('anchor')){c.setActive(!!p&&p.name);if(tinymce.isWebKit){p=DOM.getParent(n,'IMG');c.setActive(!!p&&DOM.getAttrib(p,'mce_name')=='a');}}p=DOM.getParent(n,'IMG');if(c=cm.get('image'))c.setActive(!!p&&n.className.indexOf('mceItem')==-1);if(c=cm.get('styleselect')){if(n.className){t._importClasses();c.select(n.className);}else c.select();}if(c=cm.get('formatselect')){p=DOM.getParent(n,DOM.isBlock);if(p)c.select(p.nodeName.toLowerCase());}if(c=cm.get('fontselect'))c.select(ed.queryCommandValue('FontName'));if(c=cm.get('fontsizeselect'))c.select(ed.queryCommandValue('FontSize'));if(s.theme_advanced_path&&s.theme_advanced_statusbar_location){p=DOM.get(ed.id+'_path')||DOM.add(ed.id+'_path_row','span',{id:ed.id+'_path'});DOM.setHTML(p,'');ed.dom.getParent(n,function(n){var na=n.nodeName.toLowerCase(),u,pi,ti='';if(n.nodeType!=1||(DOM.hasClass(n,'mceItemHidden')||DOM.hasClass(n,'mceItemRemoved')))return;if(v=DOM.getAttrib(n,'mce_name'))na=v;if(tinymce.isIE&&n.scopeName!=='HTML')na=n.scopeName+':'+na;na=na.replace(/mce\:/g,'');switch(na){case'b':na='strong';break;case'i':na='em';break;case'img':if(v=DOM.getAttrib(n,'src'))ti+='src: '+v+' ';break;case'a':if(v=DOM.getAttrib(n,'name')){ti+='name: '+v+' ';na+='#'+v;}if(v=DOM.getAttrib(n,'href'))ti+='href: '+v+' ';break;case'font':if(s.convert_fonts_to_spans)na='span';if(v=DOM.getAttrib(n,'face'))ti+='font: '+v+' ';if(v=DOM.getAttrib(n,'size'))ti+='size: '+v+' ';if(v=DOM.getAttrib(n,'color'))ti+='color: '+v+' ';break;case'span':if(v=DOM.getAttrib(n,'style'))ti+='style: '+v+' ';break;}if(v=DOM.getAttrib(n,'id'))ti+='id: '+v+' ';if(v=n.className){v=v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,'');if(v&&v.indexOf('mceItem')==-1){ti+='class: '+v+' ';if(DOM.isBlock(n)||na=='img'||na=='span')na+='.'+v;}}na=na.replace(/(html:)/g,'');na={name:na,node:n,title:ti};t.onResolveName.dispatch(t,na);ti=na.title;na=na.name;pi=DOM.create('a',{'href':"javascript:;",onmousedown:"return false;",title:ti,'class':'mcePath_'+(de++)},na);if(p.hasChildNodes()){p.insertBefore(DOM.doc.createTextNode(' \u00bb '),p.firstChild);p.insertBefore(pi,p.firstChild);}else p.appendChild(pi);},ed.getBody());}},_sel:function(v){this.editor.execCommand('mceSelectNodeDepth',false,v);},_mceInsertAnchor:function(ui,v){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/anchor.htm',width:320+parseInt(ed.getLang('advanced.anchor_delta_width',0)),height:90+parseInt(ed.getLang('advanced.anchor_delta_height',0)),inline:true},{theme_url:this.url});},_mceCharMap:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/charmap.htm',width:550+parseInt(ed.getLang('advanced.charmap_delta_width',0)),height:250+parseInt(ed.getLang('advanced.charmap_delta_height',0)),inline:true},{theme_url:this.url});},_mceHelp:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/about.htm',width:480,height:380,inline:true},{theme_url:this.url});},_mceColorPicker:function(u,v){var ed=this.editor;v=v||{};ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/color_picker.htm',width:375+parseInt(ed.getLang('advanced.colorpicker_delta_width',0)),height:250+parseInt(ed.getLang('advanced.colorpicker_delta_height',0)),close_previous:false,inline:true},{input_color:v.color,func:v.func,theme_url:this.url});},_mceCodeEditor:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/source_editor.htm',width:parseInt(ed.getParam("theme_advanced_source_editor_width",720)),height:parseInt(ed.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url});},_mceImage:function(ui,val){var ed=this.editor;if(ed.dom.getAttrib(ed.selection.getNode(),'class').indexOf('mceItem')!=-1)return;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/image.htm',width:355+parseInt(ed.getLang('advanced.image_delta_width',0)),height:275+parseInt(ed.getLang('advanced.image_delta_height',0)),inline:true},{theme_url:this.url});},_mceLink:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/link.htm',width:310+parseInt(ed.getLang('advanced.link_delta_width',0)),height:200+parseInt(ed.getLang('advanced.link_delta_height',0)),inline:true},{theme_url:this.url});},_mceNewDocument:function(){var ed=this.editor;ed.windowManager.confirm('advanced.newdocument',function(s){if(s)ed.execCommand('mceSetContent',false,'');});},_mceForeColor:function(){var t=this;this._mceColorPicker(0,{color:t.fgColor,func:function(co){t.fgColor=co;t.editor.execCommand('ForeColor',false,co);}});},_mceBackColor:function(){var t=this;this._mceColorPicker(0,{color:t.bgColor,func:function(co){t.bgColor=co;t.editor.execCommand('HiliteColor',false,co);}});},_ufirst:function(s){return s.substring(0,1).toUpperCase()+s.substring(1);}});tinymce.ThemeManager.add('advanced',tinymce.themes.AdvancedTheme);}());
+(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,each=tinymce.each,Cookie=tinymce.util.Cookie,lastExtID,explode=tinymce.explode;tinymce.ThemeManager.requireLangPack('advanced');tinymce.create('tinymce.themes.AdvancedTheme',{controls:{bold:['bold_desc','Bold'],italic:['italic_desc','Italic'],underline:['underline_desc','Underline'],strikethrough:['striketrough_desc','Strikethrough'],justifyleft:['justifyleft_desc','JustifyLeft'],justifycenter:['justifycenter_desc','JustifyCenter'],justifyright:['justifyright_desc','JustifyRight'],justifyfull:['justifyfull_desc','JustifyFull'],bullist:['bullist_desc','InsertUnorderedList'],numlist:['numlist_desc','InsertOrderedList'],outdent:['outdent_desc','Outdent'],indent:['indent_desc','Indent'],cut:['cut_desc','Cut'],copy:['copy_desc','Copy'],paste:['paste_desc','Paste'],undo:['undo_desc','Undo'],redo:['redo_desc','Redo'],link:['link_desc','mceLink'],unlink:['unlink_desc','unlink'],image:['image_desc','mceImage'],cleanup:['cleanup_desc','mceCleanup'],help:['help_desc','mceHelp'],code:['code_desc','mceCodeEditor'],hr:['hr_desc','InsertHorizontalRule'],removeformat:['removeformat_desc','RemoveFormat'],sub:['sub_desc','subscript'],sup:['sup_desc','superscript'],forecolor:['forecolor_desc','ForeColor'],forecolorpicker:['forecolor_desc','mceForeColor'],backcolor:['backcolor_desc','HiliteColor'],backcolorpicker:['backcolor_desc','mceBackColor'],charmap:['charmap_desc','mceCharMap'],visualaid:['visualaid_desc','mceToggleVisualAid'],anchor:['anchor_desc','mceInsertAnchor'],newdocument:['newdocument_desc','mceNewDocument'],blockquote:['blockquote_desc','mceBlockQuote']},stateControls:['bold','italic','underline','strikethrough','bullist','numlist','justifyleft','justifycenter','justifyright','justifyfull','sub','sup','blockquote'],init:function(ed,url){var t=this,s,v;t.editor=ed;t.url=url;t.onResolveName=new tinymce.util.Dispatcher(this);t.settings=s=extend({theme_advanced_path:true,theme_advanced_toolbar_location:'bottom',theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1},ed.settings);if((v=s.theme_advanced_path_location)&&v!='none')s.theme_advanced_statusbar_location=s.theme_advanced_path_location;if(s.theme_advanced_statusbar_location=='none')s.theme_advanced_statusbar_location=0;ed.onInit.add(function(){ed.onNodeChange.add(t._nodeChanged,t);if(ed.settings.content_css!==false)ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/"+ed.settings.skin+"/content.css"));});ed.onSetProgressState.add(function(ed,b,ti){var co,id=ed.id,tb;if(b){t.progressTimer=setTimeout(function(){co=ed.getContainer();co=co.insertBefore(DOM.create('DIV',{style:'position:relative'}),co.firstChild);tb=DOM.get(ed.id+'_tbl');DOM.add(co,'div',{id:id+'_blocker','class':'mceBlocker',style:{width:tb.clientWidth+2,height:tb.clientHeight+2}});DOM.add(co,'div',{id:id+'_progress','class':'mceProgress',style:{left:tb.clientWidth/ 2, top : tb.clientHeight /2}});},ti||0);}else{DOM.remove(id+'_blocker');DOM.remove(id+'_progress');clearTimeout(t.progressTimer);}});DOM.loadCSS(ed.baseURI.toAbsolute(s.editor_css||"themes/advanced/skins/"+ed.settings.skin+"/ui.css"));if(s.skin_variant)DOM.loadCSS(ed.baseURI.toAbsolute(s.editor_css||"themes/advanced/skins/"+ed.settings.skin+"/ui_"+s.skin_variant+".css"));},createControl:function(n,cf){var cd,c;if(c=cf.createControl(n))return c;switch(n){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu();}if((cd=this.controls[n]))return cf.createButton(n,{title:"advanced."+cd[0],cmd:cd[1],ui:cd[2],value:cd[3]});},execCommand:function(cmd,ui,val){var f=this['_'+cmd];if(f){f.call(this,ui,val);return true;}return false;},_importClasses:function(e){var ed=this.editor,c=ed.controlManager.get('styleselect');if(c.getLength()==0){each(ed.dom.getClasses(),function(o){c.add(o['class'],o['class']);});}},_createStyleSelect:function(n){var t=this,ed=t.editor,cf=ed.controlManager,c=cf.createListBox('styleselect',{title:'advanced.style_select',onselect:function(v){if(c.selectedValue===v){ed.execCommand('mceSetStyleInfo',0,{command:'removeformat'});c.select();return false;}else ed.execCommand('mceSetCSSClass',0,v);}});if(c){each(ed.getParam('theme_advanced_styles','','hash'),function(v,k){if(v)c.add(t.editor.translate(k),v);});c.onPostRender.add(function(ed,n){Event.add(n.id+'_text','focus',t._importClasses,t);Event.add(n.id+'_text','mousedown',t._importClasses,t);});}return c;},_createFontSelect:function(){var c,t=this,ed=t.editor;c=ed.controlManager.createListBox('fontselect',{title:'advanced.fontdefault',cmd:'FontName'});if(c){each(ed.getParam('theme_advanced_fonts',t.settings.theme_advanced_fonts,'hash'),function(v,k){c.add(ed.translate(k),v,{style:v.indexOf('dings')==-1?'font-family:'+v:''});});}return c;},_createFontSizeSelect:function(){var t=this,ed=t.editor,c,lo=["1 (8 pt)","2 (10 pt)","3 (12 pt)","4 (14 pt)","5 (18 pt)","6 (24 pt)","7 (36 pt)"],fz=[8,10,12,14,18,24,36];c=ed.controlManager.createListBox('fontsizeselect',{title:'advanced.font_size',cmd:'FontSize'});if(c){each(ed.getParam('theme_advanced_font_sizes',t.settings.theme_advanced_font_sizes,'hash'),function(v,k){c.add(k!=v?k:lo[parseInt(v)-1],v,{'style':'font-size:'+fz[v-1]+'pt','class':'mceFontSize'+v});});}return c;},_createBlockFormats:function(){var c,fmts={p:'advanced.paragraph',address:'advanced.address',pre:'advanced.pre',h1:'advanced.h1',h2:'advanced.h2',h3:'advanced.h3',h4:'advanced.h4',h5:'advanced.h5',h6:'advanced.h6',div:'advanced.div',blockquote:'advanced.blockquote',code:'advanced.code',dt:'advanced.dt',dd:'advanced.dd',samp:'advanced.samp'},t=this;c=t.editor.controlManager.createListBox('formatselect',{title:'advanced.block',cmd:'FormatBlock'});if(c){each(t.editor.getParam('theme_advanced_blockformats',t.settings.theme_advanced_blockformats,'hash'),function(v,k){c.add(t.editor.translate(k!=v?k:fmts[v]),v,{'class':'mce_formatPreview mce_'+v});});}return c;},_createForeColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_text_colors)o.colors=v;o.title='advanced.forecolor_desc';o.cmd='ForeColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('forecolor',o);return c;},_createBackColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_background_colors)o.colors=v;o.title='advanced.backcolor_desc';o.cmd='HiliteColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('backcolor',o);return c;},renderUI:function(o){var n,ic,tb,t=this,ed=t.editor,s=t.settings,sc,p,nl;n=p=DOM.create('span',{id:ed.id+'_parent','class':'mceEditor '+ed.settings.skin+'Skin'+(s.skin_variant?' '+ed.settings.skin+'Skin'+t._ufirst(s.skin_variant):'')});if(!DOM.boxModel)n=DOM.add(n,'div',{'class':'mceOldBoxModel'});n=sc=DOM.add(n,'table',{id:ed.id+'_tbl','class':'mceLayout',cellSpacing:0,cellPadding:0});n=tb=DOM.add(n,'tbody');switch((s.theme_advanced_layout_manager||'').toLowerCase()){case"rowlayout":ic=t._rowLayout(s,tb,o);break;case"customlayout":ic=ed.execCallback("theme_advanced_custom_layout",s,tb,o,p);break;default:ic=t._simpleLayout(s,tb,o,p);}n=o.targetNode;nl=DOM.stdMode?sc.getElementsByTagName('tr'):sc.rows;DOM.addClass(nl[0],'mceFirst');DOM.addClass(nl[nl.length-1],'mceLast');each(DOM.select('tr',tb),function(n){DOM.addClass(n.firstChild,'mceFirst');DOM.addClass(n.childNodes[n.childNodes.length-1],'mceLast');});if(DOM.get(s.theme_advanced_toolbar_container))DOM.get(s.theme_advanced_toolbar_container).appendChild(p);else DOM.insertAfter(p,n);Event.add(ed.id+'_path_row','click',function(e){e=e.target;if(e.nodeName=='A'){t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/,'$1'));return Event.cancel(e);}});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))Event.add(DOM.add(p,'a',{href:'#'},'<!-- IE -->'),'focus',function(){tinyMCE.get(ed.id).focus();});if(s.theme_advanced_toolbar_location=='external')o.deltaHeight=0;t.deltaHeight=o.deltaHeight;o.targetNode=null;return{iframeContainer:ic,editorContainer:ed.id+'_parent',sizeContainer:sc,deltaHeight:o.deltaHeight};},getInfo:function(){return{longname:'Advanced theme',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}},resizeBy:function(dw,dh){var e=DOM.get(this.editor.id+'_tbl');this.resizeTo(e.clientWidth+dw,e.clientHeight+dh);},resizeTo:function(w,h){var ed=this.editor,s=ed.settings,e=DOM.get(ed.id+'_tbl'),ifr=DOM.get(ed.id+'_ifr'),dh;w=Math.max(s.theme_advanced_resizing_min_width||100,w);h=Math.max(s.theme_advanced_resizing_min_height||100,h);w=Math.min(s.theme_advanced_resizing_max_width||0xFFFF,w);h=Math.min(s.theme_advanced_resizing_max_height||0xFFFF,h);dh=e.clientHeight-ifr.clientHeight;DOM.setStyle(ifr,'height',h-dh);DOM.setStyles(e,{width:w,height:h});},destroy:function(){var id=this.editor.id;Event.clear(id+'_resize');Event.clear(id+'_path_row');Event.clear(id+'_external_close');},_simpleLayout:function(s,tb,o,p){var t=this,ed=t.editor,lo=s.theme_advanced_toolbar_location,sl=s.theme_advanced_statusbar_location,n,ic,etb,c;if(lo=='top')t._addToolbars(tb,o);if(lo=='external'){n=c=DOM.create('div',{style:'position:relative'});n=DOM.add(n,'div',{id:ed.id+'_external','class':'mceExternalToolbar'});DOM.add(n,'a',{id:ed.id+'_external_close',href:'javascript:;','class':'mceExternalClose'});n=DOM.add(n,'table',{id:ed.id+'_tblext',cellSpacing:0,cellPadding:0});etb=DOM.add(n,'tbody');if(p.firstChild.className=='mceOldBoxModel')p.firstChild.appendChild(c);else p.insertBefore(c,p.firstChild);t._addToolbars(etb,o);ed.onMouseUp.add(function(){var e=DOM.get(ed.id+'_external');DOM.show(e);DOM.hide(lastExtID);var f=Event.add(ed.id+'_external_close','click',function(){DOM.hide(ed.id+'_external');Event.remove(ed.id+'_external_close','click',f);});DOM.show(e);DOM.setStyle(e,'top',0-DOM.getRect(ed.id+'_tblext').h-1);DOM.hide(e);DOM.show(e);e.style.filter='';lastExtID=ed.id+'_external';e=null;});}if(sl=='top')t._addStatusBar(tb,o);if(!s.theme_advanced_toolbar_container){n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});}if(lo=='bottom')t._addToolbars(tb,o);if(sl=='bottom')t._addStatusBar(tb,o);return ic;},_rowLayout:function(s,tb,o){var t=this,ed=t.editor,dc,da,cf=ed.controlManager,n,ic,to,a;dc=s.theme_advanced_containers_default_class||'';da=s.theme_advanced_containers_default_align||'center';each(explode(s.theme_advanced_containers||''),function(c,i){var v=s['theme_advanced_container_'+c]||'';switch(v.toLowerCase()){case'mceeditor':n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});break;case'mceelementpath':t._addStatusBar(tb,o);break;default:a=(s['theme_advanced_container_'+c+'_align']||da).toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(tb,'tr'),'td',{'class':'mceToolbar '+(s['theme_advanced_container_'+c+'_class']||dc)+' '+a||da});to=cf.createToolbar("toolbar"+i);t._addControls(v,to);DOM.setHTML(n,to.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}});return ic;},_addControls:function(v,tb){var t=this,s=t.settings,di,cf=t.editor.controlManager;if(s.theme_advanced_disable&&!t._disabled){di={};each(explode(s.theme_advanced_disable),function(v){di[v]=1;});t._disabled=di;}else di=t._disabled;each(explode(v),function(n){var c;if(di&&di[n])return;if(n=='tablecontrols'){each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(n){n=t.createControl(n,cf);if(n)tb.add(n);});return;}c=t.createControl(n,cf);if(c)tb.add(c);});},_addToolbars:function(c,o){var t=this,i,tb,ed=t.editor,s=t.settings,v,cf=ed.controlManager,di,n,h=[],a;a=s.theme_advanced_toolbar_align.toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(c,'tr'),'td',{'class':'mceToolbar '+a});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))h.push(DOM.createHTML('a',{href:'#',onfocus:'tinyMCE.get(\''+ed.id+'\').focus();'},'<!-- IE -->'));h.push(DOM.createHTML('a',{href:'#',accesskey:'q',title:ed.getLang("advanced.toolbar_focus")},'<!-- IE -->'));for(i=1;(v=s['theme_advanced_buttons'+i]);i++){tb=cf.createToolbar("toolbar"+i,{'class':'mceToolbarRow'+i});if(s['theme_advanced_buttons'+i+'_add'])v+=','+s['theme_advanced_buttons'+i+'_add'];if(s['theme_advanced_buttons'+i+'_add_before'])v=s['theme_advanced_buttons'+i+'_add_before']+','+v;t._addControls(v,tb);h.push(tb.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}h.push(DOM.createHTML('a',{href:'#',accesskey:'z',title:ed.getLang("advanced.toolbar_focus"),onfocus:'tinyMCE.getInstanceById(\''+ed.id+'\').focus();'},'<!-- IE -->'));DOM.setHTML(n,h.join(''));},_addStatusBar:function(tb,o){var n,t=this,ed=t.editor,s=t.settings,r,mf,me,td;n=DOM.add(tb,'tr');n=td=DOM.add(n,'td',{'class':'mceStatusbar'});n=DOM.add(n,'div',{id:ed.id+'_path_row'},s.theme_advanced_path?ed.translate('advanced.path')+': ':'&nbsp;');DOM.add(n,'a',{href:'#',accesskey:'x'});if(s.theme_advanced_resizing&&!tinymce.isOldWebKit){DOM.add(td,'a',{id:ed.id+'_resize',href:'javascript:;',onclick:"return false;",'class':'mceResize'});if(s.theme_advanced_resizing_use_cookie){ed.onPostRender.add(function(){var o=Cookie.getHash("TinyMCE_"+ed.id+"_size"),c=DOM.get(ed.id+'_tbl');if(!o)return;if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,o.cw)+'px';c.style.height=Math.max(10,o.ch)+'px';DOM.get(ed.id+'_ifr').style.height=Math.max(10,parseInt(o.ch)+t.deltaHeight)+'px';});}ed.onPostRender.add(function(){Event.add(ed.id+'_resize','mousedown',function(e){var c,p,w,h,n,pa;c=DOM.get(ed.id+'_tbl');w=c.clientWidth;h=c.clientHeight;miw=s.theme_advanced_resizing_min_width||100;mih=s.theme_advanced_resizing_min_height||100;maw=s.theme_advanced_resizing_max_width||0xFFFF;mah=s.theme_advanced_resizing_max_height||0xFFFF;p=DOM.add(DOM.get(ed.id+'_parent'),'div',{'class':'mcePlaceHolder'});DOM.setStyles(p,{width:w,height:h});DOM.hide(c);DOM.show(p);r={x:e.screenX,y:e.screenY,w:w,h:h,dx:null,dy:null};mf=Event.add(DOM.doc,'mousemove',function(e){var w,h;r.dx=e.screenX-r.x;r.dy=e.screenY-r.y;w=Math.max(miw,r.w+r.dx);h=Math.max(mih,r.h+r.dy);w=Math.min(maw,w);h=Math.min(mah,h);if(s.theme_advanced_resize_horizontal)p.style.width=w+'px';p.style.height=h+'px';return Event.cancel(e);});me=Event.add(DOM.doc,'mouseup',function(e){var ifr;Event.remove(DOM.doc,'mousemove',mf);Event.remove(DOM.doc,'mouseup',me);c.style.display='';DOM.remove(p);if(r.dx===null)return;ifr=DOM.get(ed.id+'_ifr');if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,r.w+r.dx)+'px';c.style.height=Math.max(10,r.h+r.dy)+'px';ifr.style.height=Math.max(10,ifr.clientHeight+r.dy)+'px';if(s.theme_advanced_resizing_use_cookie){Cookie.setHash("TinyMCE_"+ed.id+"_size",{cw:r.w+r.dx,ch:r.h+r.dy});}});return Event.cancel(e);});});}o.deltaHeight-=21;n=tb=null;},_nodeChanged:function(ed,cm,n,co){var t=this,p,de=0,v,c,s=t.settings;tinymce.each(t.stateControls,function(c){cm.setActive(c,ed.queryCommandState(t.controls[c][1]));});cm.setActive('visualaid',ed.hasVisual);cm.setDisabled('undo',!ed.undoManager.hasUndo()&&!ed.typing);cm.setDisabled('redo',!ed.undoManager.hasRedo());cm.setDisabled('outdent',!ed.queryCommandState('Outdent'));p=DOM.getParent(n,'A');if(c=cm.get('link')){if(!p||!p.name){c.setDisabled(!p&&co);c.setActive(!!p);}}if(c=cm.get('unlink')){c.setDisabled(!p&&co);c.setActive(!!p&&!p.name);}if(c=cm.get('anchor')){c.setActive(!!p&&p.name);if(tinymce.isWebKit){p=DOM.getParent(n,'IMG');c.setActive(!!p&&DOM.getAttrib(p,'mce_name')=='a');}}p=DOM.getParent(n,'IMG');if(c=cm.get('image'))c.setActive(!!p&&n.className.indexOf('mceItem')==-1);if(c=cm.get('styleselect')){if(n.className){t._importClasses();c.select(n.className);}else c.select();}if(c=cm.get('formatselect')){p=DOM.getParent(n,DOM.isBlock);if(p)c.select(p.nodeName.toLowerCase());}if(c=cm.get('fontselect'))c.select(ed.queryCommandValue('FontName'));if(c=cm.get('fontsizeselect'))c.select(''+ed.queryCommandValue('FontSize'));if(s.theme_advanced_path&&s.theme_advanced_statusbar_location){p=DOM.get(ed.id+'_path')||DOM.add(ed.id+'_path_row','span',{id:ed.id+'_path'});DOM.setHTML(p,'');ed.dom.getParent(n,function(n){var na=n.nodeName.toLowerCase(),u,pi,ti='';if(n.nodeType!=1||(DOM.hasClass(n,'mceItemHidden')||DOM.hasClass(n,'mceItemRemoved')))return;if(v=DOM.getAttrib(n,'mce_name'))na=v;if(tinymce.isIE&&n.scopeName!=='HTML')na=n.scopeName+':'+na;na=na.replace(/mce\:/g,'');switch(na){case'b':na='strong';break;case'i':na='em';break;case'img':if(v=DOM.getAttrib(n,'src'))ti+='src: '+v+' ';break;case'a':if(v=DOM.getAttrib(n,'name')){ti+='name: '+v+' ';na+='#'+v;}if(v=DOM.getAttrib(n,'href'))ti+='href: '+v+' ';break;case'font':if(s.convert_fonts_to_spans)na='span';if(v=DOM.getAttrib(n,'face'))ti+='font: '+v+' ';if(v=DOM.getAttrib(n,'size'))ti+='size: '+v+' ';if(v=DOM.getAttrib(n,'color'))ti+='color: '+v+' ';break;case'span':if(v=DOM.getAttrib(n,'style'))ti+='style: '+v+' ';break;}if(v=DOM.getAttrib(n,'id'))ti+='id: '+v+' ';if(v=n.className){v=v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,'');if(v&&v.indexOf('mceItem')==-1){ti+='class: '+v+' ';if(DOM.isBlock(n)||na=='img'||na=='span')na+='.'+v;}}na=na.replace(/(html:)/g,'');na={name:na,node:n,title:ti};t.onResolveName.dispatch(t,na);ti=na.title;na=na.name;pi=DOM.create('a',{'href':"javascript:;",onmousedown:"return false;",title:ti,'class':'mcePath_'+(de++)},na);if(p.hasChildNodes()){p.insertBefore(DOM.doc.createTextNode(' \u00bb '),p.firstChild);p.insertBefore(pi,p.firstChild);}else p.appendChild(pi);},ed.getBody());}},_sel:function(v){this.editor.execCommand('mceSelectNodeDepth',false,v);},_mceInsertAnchor:function(ui,v){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/anchor.htm',width:320+parseInt(ed.getLang('advanced.anchor_delta_width',0)),height:90+parseInt(ed.getLang('advanced.anchor_delta_height',0)),inline:true},{theme_url:this.url});},_mceCharMap:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/charmap.htm',width:550+parseInt(ed.getLang('advanced.charmap_delta_width',0)),height:250+parseInt(ed.getLang('advanced.charmap_delta_height',0)),inline:true},{theme_url:this.url});},_mceHelp:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/about.htm',width:480,height:380,inline:true},{theme_url:this.url});},_mceColorPicker:function(u,v){var ed=this.editor;v=v||{};ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/color_picker.htm',width:375+parseInt(ed.getLang('advanced.colorpicker_delta_width',0)),height:250+parseInt(ed.getLang('advanced.colorpicker_delta_height',0)),close_previous:false,inline:true},{input_color:v.color,func:v.func,theme_url:this.url});},_mceCodeEditor:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/source_editor.htm',width:parseInt(ed.getParam("theme_advanced_source_editor_width",720)),height:parseInt(ed.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url});},_mceImage:function(ui,val){var ed=this.editor;if(ed.dom.getAttrib(ed.selection.getNode(),'class').indexOf('mceItem')!=-1)return;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/image.htm',width:355+parseInt(ed.getLang('advanced.image_delta_width',0)),height:275+parseInt(ed.getLang('advanced.image_delta_height',0)),inline:true},{theme_url:this.url});},_mceLink:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/link.htm',width:310+parseInt(ed.getLang('advanced.link_delta_width',0)),height:200+parseInt(ed.getLang('advanced.link_delta_height',0)),inline:true},{theme_url:this.url});},_mceNewDocument:function(){var ed=this.editor;ed.windowManager.confirm('advanced.newdocument',function(s){if(s)ed.execCommand('mceSetContent',false,'');});},_mceForeColor:function(){var t=this;this._mceColorPicker(0,{color:t.fgColor,func:function(co){t.fgColor=co;t.editor.execCommand('ForeColor',false,co);}});},_mceBackColor:function(){var t=this;this._mceColorPicker(0,{color:t.bgColor,func:function(co){t.bgColor=co;t.editor.execCommand('HiliteColor',false,co);}});},_ufirst:function(s){return s.substring(0,1).toUpperCase()+s.substring(1);}});tinymce.ThemeManager.add('advanced',tinymce.themes.AdvancedTheme);}()); \ No newline at end of file
diff --git a/wp-includes/js/tinymce/themes/advanced/image.htm b/wp-includes/js/tinymce/themes/advanced/image.htm
index f0bd23c..03a5850 100644
--- a/wp-includes/js/tinymce/themes/advanced/image.htm
+++ b/wp-includes/js/tinymce/themes/advanced/image.htm
@@ -2,10 +2,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.image_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?v=307"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
- <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
- <script type="text/javascript" src="js/image.js?v=307"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3091"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3091"></script>
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3091"></script>
+ <script type="text/javascript" src="js/image.js?ver=3091"></script>
<base target="_self" />
</head>
<body id="image" style="display: none">
diff --git a/wp-includes/js/tinymce/themes/advanced/img/icons.gif b/wp-includes/js/tinymce/themes/advanced/img/icons.gif
index 6870827..ccac36f 100644
--- a/wp-includes/js/tinymce/themes/advanced/img/icons.gif
+++ b/wp-includes/js/tinymce/themes/advanced/img/icons.gif
Binary files differ
diff --git a/wp-includes/js/tinymce/themes/advanced/js/color_picker.js b/wp-includes/js/tinymce/themes/advanced/js/color_picker.js
index db5ac25..c1a65db 100644
--- a/wp-includes/js/tinymce/themes/advanced/js/color_picker.js
+++ b/wp-includes/js/tinymce/themes/advanced/js/color_picker.js
@@ -230,7 +230,7 @@ function updateLight(r, g, b) {
color = finalR + finalG + finalB;
- document.getElementById('gs' + i).style.backgroundColor = '#'+color;
+ setCol('gs' + i, '#'+color);
}
}
@@ -238,8 +238,16 @@ function changeFinalColor(color) {
if (color.indexOf('#') == -1)
color = convertRGBToHex(color);
- document.getElementById('preview').style.backgroundColor = color;
+ setCol('preview', color);
document.getElementById('color').value = color;
}
+function setCol(e, c) {
+ try {
+ document.getElementById(e).style.backgroundColor = c;
+ } catch (ex) {
+ // Ignore IE warning
+ }
+}
+
tinyMCEPopup.onInit.add(init);
diff --git a/wp-includes/js/tinymce/themes/advanced/js/image.js b/wp-includes/js/tinymce/themes/advanced/js/image.js
index 4c018ed..63c843d 100644
--- a/wp-includes/js/tinymce/themes/advanced/js/image.js
+++ b/wp-includes/js/tinymce/themes/advanced/js/image.js
@@ -90,7 +90,7 @@ var ImageDialog = {
if (el && el.nodeName == 'IMG') {
ed.dom.setAttribs(el, args);
} else {
- ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" src="javascript:;" />', {skip_undo : 1});
+ ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});
ed.dom.setAttribs('__mce_tmp', args);
ed.dom.setAttrib('__mce_tmp', 'id', '');
ed.undoManager.add();
diff --git a/wp-includes/js/tinymce/themes/advanced/link.htm b/wp-includes/js/tinymce/themes/advanced/link.htm
index cdc149b..27c1176 100644
--- a/wp-includes/js/tinymce/themes/advanced/link.htm
+++ b/wp-includes/js/tinymce/themes/advanced/link.htm
@@ -2,11 +2,11 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.link_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?v=307"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?v=307"></script>
- <script type="text/javascript" src="../../utils/form_utils.js?v=307"></script>
- <script type="text/javascript" src="../../utils/validate.js?v=307"></script>
- <script type="text/javascript" src="js/link.js?v=307"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3091"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3091"></script>
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3091"></script>
+ <script type="text/javascript" src="../../utils/validate.js?ver=3091"></script>
+ <script type="text/javascript" src="js/link.js?ver=3091"></script>
<base target="_self" />
</head>
<body id="link" style="display: none">
diff --git a/wp-includes/js/tinymce/themes/advanced/skins/default/content.css b/wp-includes/js/tinymce/themes/advanced/skins/default/content.css
index c13d0a3..cb7604e 100644
--- a/wp-includes/js/tinymce/themes/advanced/skins/default/content.css
+++ b/wp-includes/js/tinymce/themes/advanced/skins/default/content.css
@@ -13,6 +13,11 @@ img.mceItemAnchor {width:12px; height:12px; background:url(img/items.gif) no-rep
img {border:0;}
table {cursor:default}
table td, table th {cursor:text}
+ins {border-bottom:1px solid green; text-decoration: none; color:green}
+del {color:red; text-decoration:line-through}
+cite {border-bottom:1px dashed blue}
+acronym {border-bottom:1px dotted #CCC; cursor:help}
+abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help}
/* IE */
* html body {
diff --git a/wp-includes/js/tinymce/themes/advanced/skins/o2k7/content.css b/wp-includes/js/tinymce/themes/advanced/skins/o2k7/content.css
index 0a73a57..a404931 100644
--- a/wp-includes/js/tinymce/themes/advanced/skins/o2k7/content.css
+++ b/wp-includes/js/tinymce/themes/advanced/skins/o2k7/content.css
@@ -13,6 +13,11 @@ img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.
img {border:0;}
table {cursor:default}
table td, table th {cursor:text}
+ins {border-bottom:1px solid green; text-decoration: none; color:green}
+del {color:red; text-decoration:line-through}
+cite {border-bottom:1px dashed blue}
+acronym {border-bottom:1px dotted #CCC; cursor:help}
+abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help}
/* IE */
* html body {
diff --git a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css
index 011363b..16d589c 100644
--- a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css
+++ b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css
@@ -23,4 +23,4 @@ scrollbar-highlight-color:#F0F0EE;
scrollbar-shadow-color:#F0F0EE;
scrollbar-track-color:#F5F5F5;
}
-*/
+*/ \ No newline at end of file
diff --git a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css
index e263991..344d7e2 100644
--- a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css
+++ b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css
@@ -116,4 +116,4 @@ h3 {font-size:14px;}
#colorpicker #namedcolors {width:150px;}
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
#colorpicker #colornamecontainer {margin-top:5px;}
-#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
+#colorpicker #picker_panel fieldset {margin:auto;width:325px;} \ No newline at end of file
diff --git a/wp-includes/js/tinymce/themes/advanced/source_editor.htm b/wp-includes/js/tinymce/themes/advanced/source_editor.htm
index dcc636d..b2bf8de 100644
--- a/wp-includes/js/tinymce/themes/advanced/source_editor.htm
+++ b/wp-includes/js/tinymce/themes/advanced/source_editor.htm
@@ -2,8 +2,8 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{#advanced_dlg.code_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?v=307"></script>
- <script type="text/javascript" src="js/source_editor.js?v=307"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3091"></script>
+ <script type="text/javascript" src="js/source_editor.js?ver=3091"></script>
<base target="_self" />
</head>
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
diff --git a/wp-includes/js/tinymce/tiny_mce.js b/wp-includes/js/tinymce/tiny_mce.js
index 1bbb35b..33d1c6d 100644
--- a/wp-includes/js/tinymce/tiny_mce.js
+++ b/wp-includes/js/tinymce/tiny_mce.js
@@ -1 +1 @@
-var tinymce={majorVersion:'3',minorVersion:'0.7',releaseDate:'2008-04-14',_init:function(){var t=this,d=document,w=window,na=navigator,ua=na.userAgent,i,nl,n,base;t.isOpera=w.opera&&opera.buildNumber;t.isWebKit=/WebKit/.test(ua);t.isOldWebKit=t.isWebKit&&!w.getSelection().getRangeAt;t.isIE=!t.isWebKit&&!t.isOpera&&(/MSIE/gi).test(ua)&&(/Explorer/gi).test(na.appName);t.isIE6=t.isIE&&/MSIE [56]/.test(ua);t.isGecko=!t.isWebKit&&/Gecko/.test(ua);t.isMac=ua.indexOf('Mac')!=-1;if(w.tinyMCEPreInit){t.suffix=tinyMCEPreInit.suffix;t.baseURL=tinyMCEPreInit.base;return;}t.suffix='';nl=d.getElementsByTagName('base');for(i=0;i<nl.length;i++){if(nl[i].href)base=nl[i].href;}function getBase(n){if(n.src&&/tiny_mce(|_dev|_src|_gzip|_jquery|_prototype).js/.test(n.src)){if(/_(src|dev)\.js/g.test(n.src))t.suffix='_src';t.baseURL=n.src.substring(0,n.src.lastIndexOf('/'));if(base&&t.baseURL.indexOf('://')==-1)t.baseURL=base+t.baseURL;return t.baseURL;}return null;};nl=d.getElementsByTagName('script');for(i=0;i<nl.length;i++){if(getBase(nl[i]))return;}n=d.getElementsByTagName('head')[0];if(n){nl=n.getElementsByTagName('script');for(i=0;i<nl.length;i++){if(getBase(nl[i]))return;}}return;},is:function(o,t){var n=typeof(o);if(!t)return n!='undefined';if(t=='array'&&(o instanceof Array))return true;return n==t;},each:function(o,cb,s){var n,l;if(!o)return 0;s=s||o;if(typeof(o.length)!='undefined'){for(n=0,l=o.length;n<l;n++){if(cb.call(s,o[n],n,o)===false)return 0;}}else{for(n in o){if(o.hasOwnProperty(n)){if(cb.call(s,o[n],n,o)===false)return 0;}}}return 1;},map:function(a,f){var o=[];tinymce.each(a,function(v){o.push(f(v));});return o;},grep:function(a,f){var o=[];tinymce.each(a,function(v){if(!f||f(v))o.push(v);});return o;},inArray:function(a,v){var i,l;if(a){for(i=0,l=a.length;i<l;i++){if(a[i]===v)return i;}}return-1;},extend:function(o,e){var i,a=arguments;for(i=1;i<a.length;i++){e=a[i];tinymce.each(e,function(v,n){if(typeof(v)!=='undefined')o[n]=v;});}return o;},trim:function(s){return(s?''+s:'').replace(/^\s*|\s*$/g,'');},create:function(s,p){var t=this,sp,ns,cn,scn,c,de=0;s=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);cn=s[3].match(/(^|\.)(\w+)$/i)[2];ns=t.createNS(s[3].replace(/\.\w+$/,''));if(ns[cn])return;if(s[2]=='static'){ns[cn]=p;if(this.onCreate)this.onCreate(s[2],s[3],ns[cn]);return;}if(!p[cn]){p[cn]=function(){};de=1;}ns[cn]=p[cn];t.extend(ns[cn].prototype,p);if(s[5]){sp=t.resolve(s[5]).prototype;scn=s[5].match(/\.(\w+)$/i)[1];c=ns[cn];if(de){ns[cn]=function(){return sp[scn].apply(this,arguments);};}else{ns[cn]=function(){this.parent=sp[scn];return c.apply(this,arguments);};}ns[cn].prototype[cn]=ns[cn];t.each(sp,function(f,n){ns[cn].prototype[n]=sp[n];});t.each(p,function(f,n){if(sp[n]){ns[cn].prototype[n]=function(){this.parent=sp[n];return f.apply(this,arguments);};}else{if(n!=cn)ns[cn].prototype[n]=f;}});}t.each(p['static'],function(f,n){ns[cn][n]=f;});if(this.onCreate)this.onCreate(s[2],s[3],ns[cn].prototype);},walk:function(o,f,n,s){s=s||this;if(o){if(n)o=o[n];tinymce.each(o,function(o,i){if(f.call(s,o,i,n)===false)return false;tinymce.walk(o,f,n,s);});}},createNS:function(n,o){var i,v;o=o||window;n=n.split('.');for(i=0;i<n.length;i++){v=n[i];if(!o[v])o[v]={};o=o[v];}return o;},resolve:function(n,o){var i,l;o=o||window;n=n.split('.');for(i=0,l=n.length;i<l;i++){o=o[n[i]];if(!o)break;}return o;},addUnload:function(f,s){var t=this,w=window;f={func:f,scope:s||this};if(!t.unloads){function unload(){var li=t.unloads,o,n;if(li){for(n in li){o=li[n];if(o&&o.func)o.func.call(o.scope,1);}if(w.detachEvent){w.detachEvent('onbeforeunload',fakeUnload);w.detachEvent('onunload',unload);}else if(w.removeEventListener)w.removeEventListener('unload',unload,false);t.unloads=o=li=w=unload=null;if(window.CollectGarbage)window.CollectGarbage();}};function fakeUnload(){var d=document;if(d.readyState=='interactive'){function stop(){d.detachEvent('onstop',stop);unload();d=null;};d.attachEvent('onstop',stop);window.setTimeout(function(){d.detachEvent('onstop',stop);},0);}};if(w.attachEvent){w.attachEvent('onunload',unload);w.attachEvent('onbeforeunload',fakeUnload);}else if(w.addEventListener)w.addEventListener('unload',unload,false);t.unloads=[f];}else t.unloads.push(f);return f;},removeUnload:function(f){var u=this.unloads,r=null;tinymce.each(u,function(o,i){if(o&&o.func==f){u.splice(i,1);r=f;return false;}});return r;},explode:function(s,d){return tinymce.map(s.split(d||','),tinymce.trim);},_addVer:function(u,s){return u+(u.indexOf('?')==-1?'?':'&')+'v='+(tinymce.majorVersion+tinymce.minorVersion).replace(/[^0-9]/g,'');}};window.tinymce=tinymce;tinymce._init();tinymce.create('tinymce.util.Dispatcher',{scope:null,listeners:null,Dispatcher:function(s){this.scope=s||this;this.listeners=[];},add:function(cb,s){this.listeners.push({cb:cb,scope:s||this.scope});return cb;},addToTop:function(cb,s){this.listeners.unshift({cb:cb,scope:s||this.scope});return cb;},remove:function(cb){var l=this.listeners,o=null;tinymce.each(l,function(c,i){if(cb==c.cb){o=cb;l.splice(i,1);return false;}});return o;},dispatch:function(){var s,a=arguments,i,li=this.listeners,c;for(i=0;i<li.length;i++){c=li[i];s=c.cb.apply(c.scope,a);if(s===false)break;}return s;}});(function(){var each=tinymce.each;tinymce.create('tinymce.util.URI',{URI:function(u,s){var t=this,o,a,b;s=t.settings=s||{};if(/^(mailto|news|javascript|about):/i.test(u)||/^\s*#/.test(u)){t.source=u;return;}if(u.indexOf('/')===0&&u.indexOf('//')!==0)u=(s.base_uri?s.base_uri.protocol||'http':'http')+'://mce_host'+u;if(u.indexOf('://')===-1&&u.indexOf('//')!==0)u=(s.base_uri.protocol||'http')+'://mce_host'+t.toAbsPath(s.base_uri.path,u);u=u.replace(/@@/g,'(mce_at)');u=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u);each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(v,i){var s=u[i];if(s)s=s.replace(/\(mce_at\)/g,'@@');t[v]=s;});if(b=s.base_uri){if(!t.protocol)t.protocol=b.protocol;if(!t.userInfo)t.userInfo=b.userInfo;if(!t.port&&t.host=='mce_host')t.port=b.port;if(!t.host||t.host=='mce_host')t.host=b.host;t.source='';}},setPath:function(p){var t=this;p=/^(.*?)\/?(\w+)?$/.exec(p);t.path=p[0];t.directory=p[1];t.file=p[2];t.source='';t.getURI();},toRelative:function(u){var t=this,o;u=new tinymce.util.URI(u,{base_uri:t});if((u.host!='mce_host'&&t.host!=u.host&&u.host)||t.port!=u.port||t.protocol!=u.protocol)return u.getURI();o=t.toRelPath(t.path,u.path);if(u.query)o+='?'+u.query;if(u.anchor)o+='#'+u.anchor;return o;},toAbsolute:function(u,nh){var u=new tinymce.util.URI(u,{base_uri:this});return u.getURI(this.host==u.host?nh:0);},toRelPath:function(base,path){var items,bp=0,out='',i;base=base.substring(0,base.lastIndexOf('/'));base=base.split('/');items=path.split('/');if(base.length>=items.length){for(i=0;i<base.length;i++){if(i>=items.length||base[i]!=items[i]){bp=i+1;break;}}}if(base.length<items.length){for(i=0;i<items.length;i++){if(i>=base.length||base[i]!=items[i]){bp=i+1;break;}}}if(bp==1)return path;for(i=0;i<base.length-(bp-1);i++)out+="../";for(i=bp-1;i<items.length;i++){if(i!=bp-1)out+="/"+items[i];else out+=items[i];}return out;},toAbsPath:function(base,path){var i,nb=0,o=[];base=base.split('/');path=path.split('/');each(base,function(k){if(k)o.push(k);});base=o;for(i=path.length-1,o=[];i>=0;i--){if(path[i].length==0||path[i]==".")continue;if(path[i]=='..'){nb++;continue;}if(nb>0){nb--;continue;}o.push(path[i]);}i=base.length-nb;if(i<=0)return'/'+o.reverse().join('/');return'/'+base.slice(0,i).join('/')+'/'+o.reverse().join('/');},getURI:function(nh){var s,t=this;if(!t.source||nh){s='';if(!nh){if(t.protocol)s+=t.protocol+'://';if(t.userInfo)s+=t.userInfo+'@';if(t.host)s+=t.host;if(t.port)s+=':'+t.port;}if(t.path)s+=t.path;if(t.query)s+='?'+t.query;if(t.anchor)s+='#'+t.anchor;t.source=s;}return t.source;}});})();(function(){var each=tinymce.each;tinymce.create('static tinymce.util.Cookie',{getHash:function(n){var v=this.get(n),h;if(v){each(v.split('&'),function(v){v=v.split('=');h=h||{};h[unescape(v[0])]=unescape(v[1]);});}return h;},setHash:function(n,v,e,p,d,s){var o='';each(v,function(v,k){o+=(!o?'':'&')+escape(k)+'='+escape(v);});this.set(n,o,e,p,d,s);},get:function(n){var c=document.cookie,e,p=n+"=",b;if(!c)return;b=c.indexOf("; "+p);if(b==-1){b=c.indexOf(p);if(b!=0)return null;}else b+=2;e=c.indexOf(";",b);if(e==-1)e=c.length;return unescape(c.substring(b+p.length,e));},set:function(n,v,e,p,d,s){document.cookie=n+"="+escape(v)+((e)?"; expires="+e.toGMTString():"")+((p)?"; path="+escape(p):"")+((d)?"; domain="+d:"")+((s)?"; secure":"");},remove:function(n,p){var d=new Date();d.setTime(d.getTime()-1000);this.set(n,'',d,p,d);}});})();tinymce.create('static tinymce.util.JSON',{serialize:function(o){var i,v,s=tinymce.util.JSON.serialize,t;if(o==null)return'null';t=typeof o;if(t=='string'){v='\bb\tt\nn\ff\rr\""\'\'\\\\';return'"'+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'])/g,function(a,b){i=v.indexOf(b);if(i+1)return'\\'+v.charAt(i+1);a=b.charCodeAt().toString(16);return'\\u'+'0000'.substring(a.length)+a;})+'"';}if(t=='object'){if(o instanceof Array){for(i=0,v='[';i<o.length;i++)v+=(i>0?',':'')+s(o[i]);return v+']';}v='{';for(i in o)v+=typeof o[i]!='function'?(v.length>1?',"':'"')+i+'":'+s(o[i]):'';return v+'}';}return''+o;},parse:function(s){try{return eval('('+s+')');}catch(ex){}}});tinymce.create('static tinymce.util.XHR',{send:function(o){var x,t,w=window,c=0;o.scope=o.scope||this;o.success_scope=o.success_scope||o.scope;o.error_scope=o.error_scope||o.scope;o.async=o.async===false?false:true;o.data=o.data||'';function get(s){x=0;try{x=new ActiveXObject(s);}catch(ex){}return x;};x=w.XMLHttpRequest?new XMLHttpRequest():get('Microsoft.XMLHTTP')||get('Msxml2.XMLHTTP');if(x){if(x.overrideMimeType)x.overrideMimeType(o.content_type);x.open(o.type||(o.data?'POST':'GET'),o.url,o.async);if(o.content_type)x.setRequestHeader('Content-Type',o.content_type);x.send(o.data);t=w.setInterval(function(){if(x.readyState==4||c++>10000){w.clearInterval(t);if(o.success&&c<10000&&x.status==200)o.success.call(o.success_scope,''+x.responseText,x,o);else if(o.error)o.error.call(o.error_scope,c>10000?'TIMED_OUT':'GENERAL',x,o);x=null;}},10);}}});(function(){var extend=tinymce.extend,JSON=tinymce.util.JSON,XHR=tinymce.util.XHR;tinymce.create('tinymce.util.JSONRequest',{JSONRequest:function(s){this.settings=extend({},s);this.count=0;},send:function(o){var ecb=o.error,scb=o.success;o=extend(this.settings,o);o.success=function(c,x){c=JSON.parse(c);if(typeof(c)=='undefined'){c={error:'JSON Parse error.'};}if(c.error)ecb.call(o.error_scope||o.scope,c.error,x);else scb.call(o.success_scope||o.scope,c.result);};o.error=function(ty,x){ecb.call(o.error_scope||o.scope,ty,x);};o.data=JSON.serialize({id:o.id||'c'+(this.count++),method:o.method,params:o.params});o.content_type='application/json';XHR.send(o);},'static':{sendRPC:function(o){return new tinymce.util.JSONRequest().send(o);}}});}());(function(){var each=tinymce.each,is=tinymce.is;var isWebKit=tinymce.isWebKit,isIE=tinymce.isIE;tinymce.create('tinymce.dom.DOMUtils',{doc:null,root:null,files:null,listeners:{},pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,cache:{},idPattern:/^#[\w]+$/,elmPattern:/^[\w_*]+$/,elmClassPattern:/^([\w_]*)\.([\w_]+)$/,DOMUtils:function(d,s){var t=this;t.doc=d;t.win=window;t.files={};t.cssFlicker=false;t.counter=0;t.boxModel=!tinymce.isIE||d.compatMode=="CSS1Compat";t.stdMode=d.documentMode===8;this.settings=s=tinymce.extend({keep_values:false,hex_colors:1,process_html:1},s);if(tinymce.isIE6){try{d.execCommand('BackgroundImageCache',false,true);}catch(e){t.cssFlicker=true;}}tinymce.addUnload(t.destroy,t);},getRoot:function(){var t=this,s=t.settings;return(s&&t.get(s.root_element))||t.doc.body;},getViewPort:function(w){var d,b;w=!w?this.win:w;d=w.document;b=this.boxModel?d.documentElement:d.body;return{x:w.pageXOffset||b.scrollLeft,y:w.pageYOffset||b.scrollTop,w:w.innerWidth||b.clientWidth,h:w.innerHeight||b.clientHeight};},getRect:function(e){var p,t=this,w,h;e=t.get(e);p=t.getPos(e);w=t.getStyle(e,'width');h=t.getStyle(e,'height');if(w.indexOf('px')===-1)w=0;if(h.indexOf('px')===-1)h=0;return{x:p.x,y:p.y,w:parseInt(w)||e.offsetWidth||e.clientWidth,h:parseInt(h)||e.offsetHeight||e.clientHeight};},getParent:function(n,f,r){var na,se=this.settings;n=this.get(n);if(se.strict_root)r=r||this.getRoot();if(is(f,'string')){na=f.toUpperCase();f=function(n){var s=false;if(n.nodeType==1&&na==='*'){s=true;return false;}each(na.split(','),function(v){if(n.nodeType==1&&((se.strict&&n.nodeName.toUpperCase()==v)||n.nodeName==v)){s=true;return false;}});return s;};}while(n){if(n==r)return null;if(f(n))return n;n=n.parentNode;}return null;},get:function(e){var n;if(e&&this.doc&&typeof(e)=='string'){n=e;e=this.doc.getElementById(e);if(e&&e.id!==n)return this.doc.getElementsByName(n)[1];}return e;},select:function(pa,s){var t=this,cs,c,pl,o=[],x,i,l,n;s=t.get(s)||t.doc;if(s.querySelectorAll){if(s!=t.doc){i=s.id;s.id='_mc_tmp';pa='#_mc_tmp '+pa;}l=tinymce.grep(s.querySelectorAll(pa));s.id=i;return l;}if(t.settings.strict){function get(s,n){return s.getElementsByTagName(n.toLowerCase());};}else{function get(s,n){return s.getElementsByTagName(n);};}if(t.elmPattern.test(pa)){x=get(s,pa);for(i=0,l=x.length;i<l;i++)o.push(x[i]);return o;}if(t.elmClassPattern.test(pa)){pl=t.elmClassPattern.exec(pa);x=get(s,pl[1]||'*');c=' '+pl[2]+' ';for(i=0,l=x.length;i<l;i++){n=x[i];if(n.className&&(' '+n.className+' ').indexOf(c)!==-1)o.push(n);}return o;}function collect(n){if(!n.mce_save){n.mce_save=1;o.push(n);}};function collectIE(n){if(!n.getAttribute('mce_save')){n.setAttribute('mce_save','1');o.push(n);}};function find(n,f,r){var i,l,nl=get(r,n);for(i=0,l=nl.length;i<l;i++)f(nl[i]);};each(pa.split(','),function(v,i){v=tinymce.trim(v);if(t.elmPattern.test(v)){each(get(s,v),function(n){collect(n);});return;}if(t.elmClassPattern.test(v)){x=t.elmClassPattern.exec(v);each(get(s,x[1]),function(n){if(t.hasClass(n,x[2]))collect(n);});return;}if(!(cs=t.cache[pa])){cs='x=(function(cf, s) {';pl=v.split(' ');each(pl,function(v){var p=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@([\w\\]+)([\^\$\*!]?=)([\w\\]+)\])?(?:\:([\w\\]+))?/i.exec(v);p[1]=p[1]||'*';cs+='find("'+p[1]+'", function(n) {';if(p[2])cs+='if (n.id !== "'+p[2]+'") return;';if(p[3]){cs+='var c = " " + n.className + " ";';cs+='if (';c='';each(p[3].split('.'),function(v){if(v)c+=(c?'||':'')+'c.indexOf(" '+v+' ") === -1';});cs+=c+') return;';}});cs+='cf(n);';for(i=pl.length-1;i>=0;i--)cs+='}, '+(i?'n':'s')+');';cs+='})';t.cache[pa]=cs=eval(cs);}cs(isIE?collectIE:collect,s);});each(o,function(n){if(isIE)n.removeAttribute('mce_save');else delete n.mce_save;});return o;},add:function(p,n,a,h,c){var t=this;return this.run(p,function(p){var e,k;e=is(n,'string')?t.doc.createElement(n):n;if(a){for(k in a){if(a.hasOwnProperty(k)&&!is(a[k],'object'))t.setAttrib(e,k,''+a[k]);}if(a.style&&!is(a.style,'string')){each(a.style,function(v,n){t.setStyle(e,n,v);});}}if(h){if(h.nodeType)e.appendChild(h);else t.setHTML(e,h);}return!c?p.appendChild(e):e;});},create:function(n,a,h){return this.add(this.doc.createElement(n),n,a,h,1);},createHTML:function(n,a,h){var o='',t=this,k;o+='<'+n;for(k in a){if(a.hasOwnProperty(k))o+=' '+k+'="'+t.encode(a[k])+'"';}if(tinymce.is(h))return o+'>'+h+'</'+n+'>';return o+' />';},remove:function(n,k){return this.run(n,function(n){var p,g;p=n.parentNode;if(!p)return null;if(k){each(n.childNodes,function(c){p.insertBefore(c.cloneNode(true),n);});}return p.removeChild(n);});},setStyle:function(n,na,v){var t=this;return t.run(n,function(e){var s,i;s=e.style;na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase();});if(t.pixelStyles.test(na)&&(tinymce.is(v,'number')||/^[\-0-9\.]+$/.test(v)))v+='px';switch(na){case'opacity':if(isIE){s.filter=v===''?'':"alpha(opacity="+(v*100)+")";if(!n.currentStyle||!n.currentStyle.hasLayout)s.display='inline-block';}s[na]=s['-moz-opacity']=s['-khtml-opacity']=v||'';break;case'float':isIE?s.styleFloat=v:s.cssFloat=v;break;default:s[na]=v||'';}if(t.settings.update_styles)t.setAttrib(e,'mce_style');});},getStyle:function(n,na,c){n=this.get(n);if(!n)return false;if(this.doc.defaultView&&c){na=na.replace(/[A-Z]/g,function(a){return'-'+a;});try{return this.doc.defaultView.getComputedStyle(n,null).getPropertyValue(na);}catch(ex){return null;}}na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase();});if(na=='float')na=isIE?'styleFloat':'cssFloat';if(n.currentStyle&&c)return n.currentStyle[na];return n.style[na];},setStyles:function(e,o){var t=this,s=t.settings,ol;ol=s.update_styles;s.update_styles=0;each(o,function(v,n){t.setStyle(e,n,v);});s.update_styles=ol;if(s.update_styles)t.setAttrib(e,s.cssText);},setAttrib:function(e,n,v){var t=this;if(t.settings.strict)n=n.toLowerCase();return this.run(e,function(e){var s=t.settings;switch(n){case"style":if(s.keep_values&&/^(| )(top|left|bottom|right|width|height)/i.test(v)){if(v)e.setAttribute('mce_style',v,2);else e.removeAttribute('mce_style',2);}e.style.cssText=v;break;case"class":e.className=v||'';break;case"src":case"href":if(s.keep_values){if(s.url_converter)v=s.url_converter.call(s.url_converter_scope||t,v,n,e);t.setAttrib(e,'mce_'+n,v,2);}break;}if(is(v)&&v!==null&&v.length!==0)e.setAttribute(n,''+v,2);else e.removeAttribute(n,2);});},setAttribs:function(e,o){var t=this;return this.run(e,function(e){each(o,function(v,n){t.setAttrib(e,n,v);});});},getAttrib:function(e,n,dv){var v,t=this;e=t.get(e);if(!e||e.nodeType!==1)return false;if(!is(dv))dv="";if(/^(src|href|style|coords)$/.test(n)){v=e.getAttribute("mce_"+n);if(v)return v;}v=e.getAttribute(n,2);if(!v){switch(n){case'class':v=e.className;break;default:if(isIE&&n==='name'&&e.nodeName==='A'){v=e.name;break;}v=e.attributes[n];v=v&&is(v.nodeValue)?v.nodeValue:v;}}switch(n){case'style':v=v||e.style.cssText;if(v){v=t.serializeStyle(t.parseStyle(v));if(t.settings.keep_values&&/^(| )(top|left|bottom|right|width|height)/i.test(v))e.setAttribute('mce_style',v);}break;}if(isWebKit&&n==="class"&&v)v=v.replace(/(apple|webkit)\-[a-z\-]+/gi,'');if(isIE){switch(n){case'rowspan':case'colspan':if(v===1)v='';break;case'size':if(v==='+0')v='';break;case'hspace':if(v===-1)v='';break;case'tabindex':if(v===32768)v='';break;case'shape':v=v.toLowerCase();break;default:if(n.indexOf('on')===0&&v)v=(''+v).replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/,'$1');}}return(v&&v!='')?''+v:dv;},getPos:function(n){var t=this,x=0,y=0,e,d=t.doc,r;n=t.get(n);if(n&&isIE){n=n.getBoundingClientRect();e=t.boxModel?d.documentElement:d.body;x=t.getStyle(t.select('html')[0],'borderWidth');x=(x=='medium'||t.boxModel&&!t.isIE6)&&2||x;n.top+=t.win.self!=t.win.top?2:0;return{x:n.left+e.scrollLeft-x,y:n.top+e.scrollTop-x};}r=n;while(r){x+=r.offsetLeft||0;y+=r.offsetTop||0;r=r.offsetParent;}r=n;while(r){if(!/^table-row|inline.*/i.test(t.getStyle(r,"display",1))){x-=r.scrollLeft||0;y-=r.scrollTop||0;}r=r.parentNode;if(r==d.body)break;}return{x:x,y:y};},parseStyle:function(st){var t=this,s=t.settings,o={};if(!st)return o;function compress(p,s,ot){var t,r,b,l;t=o[p+'-top'+s];if(!t)return;r=o[p+'-right'+s];if(t!=r)return;b=o[p+'-bottom'+s];if(r!=b)return;l=o[p+'-left'+s];if(b!=l)return;o[ot]=l;delete o[p+'-top'+s];delete o[p+'-right'+s];delete o[p+'-bottom'+s];delete o[p+'-left'+s];};function compress2(ta,a,b,c){var t;t=o[a];if(!t)return;t=o[b];if(!t)return;t=o[c];if(!t)return;o[ta]=o[a]+' '+o[b]+' '+o[c];delete o[a];delete o[b];delete o[c];};each(st.split(';'),function(v){var sv,ur=[];if(v){v=v.replace(/url\([^\)]+\)/g,function(v){ur.push(v);return'url('+ur.length+')';});v=v.split(':');sv=tinymce.trim(v[1]);sv=sv.replace(/url\(([^\)]+)\)/g,function(a,b){return ur[parseInt(b)-1];});sv=sv.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v);});if(s.url_converter){sv=sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(x,c){return'url('+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),'style',null))+')';});}o[tinymce.trim(v[0]).toLowerCase()]=sv;}});compress("border","","border");compress("border","-width","border-width");compress("border","-color","border-color");compress("border","-style","border-style");compress("padding","","padding");compress("margin","","margin");compress2('border','border-width','border-style','border-color');if(isIE){if(o.border=='medium none')o.border='';}return o;},serializeStyle:function(o){var s='';each(o,function(v,k){if(k&&v){switch(k){case'color':case'background-color':v=v.toLowerCase();break;}s+=(s?' ':'')+k+': '+v+';';}});return s;},loadCSS:function(u){var t=this,d=t.doc;if(!u)u='';each(u.split(','),function(u){if(t.files[u])return;t.files[u]=true;t.add(t.select('head')[0],'link',{rel:'stylesheet',href:tinymce._addVer(u)});});},addClass:function(e,c){return this.run(e,function(e){var o;if(!c)return 0;if(this.hasClass(e,c))return e.className;o=this.removeClass(e,c);return e.className=(o!=''?(o+' '):'')+c;});},removeClass:function(e,c){var t=this,re;return t.run(e,function(e){var v;if(t.hasClass(e,c)){if(!re)re=new RegExp("(^|\\s+)"+c+"(\\s+|$)","g");v=e.className.replace(re,' ');return e.className=tinymce.trim(v!=' '?v:'');}return e.className;});},hasClass:function(n,c){n=this.get(n);if(!n||!c)return false;return(' '+n.className+' ').indexOf(' '+c+' ')!==-1;},show:function(e){return this.setStyle(e,'display','block');},hide:function(e){return this.setStyle(e,'display','none');},isHidden:function(e){e=this.get(e);return e.style.display=='none'||this.getStyle(e,'display')=='none';},uniqueId:function(p){return(!p?'mce_':p)+(this.counter++);},setHTML:function(e,h){var t=this;return this.run(e,function(e){var x,i,nl,n,p,x;h=t.processHTML(h);if(isIE){function set(){try{e.innerHTML='<br />'+h;e.removeChild(e.firstChild);}catch(ex){while(e.firstChild)e.firstChild.removeNode();x=t.create('div');x.innerHTML='<br />'+h;each(x.childNodes,function(n,i){if(i)e.appendChild(n);});}};if(t.settings.fix_ie_paragraphs)h=h.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true">&nbsp;</p>');set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("p");for(i=nl.length-1,x=0;i>=0;i--){n=nl[i];if(!n.hasChildNodes()){if(!n.mce_keep){x=1;break;}n.removeAttribute('mce_keep');}}}if(x){h=h.replace(/<p([^>]+)>|<p>/g,'<div$1 mce_tmp="1">');h=h.replace(/<\/p>/g,'</div>');set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("DIV");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.mce_tmp){p=t.doc.createElement('p');n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(a,b){var v;if(b!=='mce_tmp'){v=n.getAttribute(b);if(!v&&b==='class')v=n.className;p.setAttribute(b,v);}});for(x=0;x<n.childNodes.length;x++)p.appendChild(n.childNodes[x].cloneNode(true));n.swapNode(p);}}}}}else e.innerHTML=h;return h;});},processHTML:function(h){var t=this,s=t.settings;if(!s.process_html)return h;if(tinymce.isGecko){h=h.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,'<$1b$2>');h=h.replace(/<(\/?)em>|<em( [^>]+)>/gi,'<$1i$2>');}else if(isIE)h=h.replace(/&apos;/g,'&#39;');h=h.replace(/<a( )([^>]+)\/>|<a\/>/gi,'<a$1$2></a>');if(s.keep_values){if(h.indexOf('<script')!==-1){h=h.replace(/<script>/g,'<script type="text/javascript">');h=h.replace(/<script(|[^>]+)>(\s*<!--|\/\/\s*<\[CDATA\[)?[\r\n]*/g,'<mce:script$1><!--\n');h=h.replace(/\s*(\/\/\s*-->|\/\/\s*]]>)?<\/script>/g,'\n// --></mce:script>');h=h.replace(/<mce:script(|[^>]+)><!--\n\/\/ --><\/mce:script>/g,'<mce:script$1></mce:script>');}h=h.replace(/<([\w:]+) [^>]*(src|href|style|coords)[^>]*>/gi,function(a,n){function handle(m,b,c){var u=c;if(a.indexOf('mce_'+b)!=-1)return m;if(b=='style'){if(/^(| )(top|left|bottom|right|width|height)/i.test(c))return m;if(s.hex_colors){u=u.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v);});}if(s.url_converter){u=u.replace(/url\([\'\"]?([^\)\'\"]+)\)/g,function(x,c){return'url('+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n))+')';});}}else if(b!='coords'){if(s.url_converter)u=t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n));}return' '+b+'="'+c+'" mce_'+b+'="'+u+'"';};a=a.replace(/ (src|href|style|coords)=[\"]([^\"]+)[\"]/gi,handle);a=a.replace(/ (src|href|style|coords)=[\']([^\']+)[\']/gi,handle);return a.replace(/ (src|href|style|coords)=([^\s\"\'>]+)/gi,handle);});}return h;},getOuterHTML:function(e){var d;e=this.get(e);if(!e)return null;if(isIE)return e.outerHTML;d=(e.ownerDocument||this.doc).createElement("body");d.appendChild(e.cloneNode(true));return d.innerHTML;},setOuterHTML:function(e,h,d){var t=this;return this.run(e,function(e){var n,tp;e=t.get(e);d=d||e.ownerDocument||t.doc;if(isIE&&e.nodeType==1)e.outerHTML=h;else{tp=d.createElement("body");tp.innerHTML=h;n=tp.lastChild;while(n){t.insertAfter(n.cloneNode(true),e);n=n.previousSibling;}t.remove(e);}});},decode:function(s){var e;if(/&[^;]+;/.test(s)){e=this.doc.createElement("div");e.innerHTML=s;return!e.firstChild?s:e.firstChild.nodeValue;}return s;},encode:function(s){return s?(''+s).replace(/[<>&\"]/g,function(c,b){switch(c){case'&':return'&amp;';case'"':return'&quot;';case'<':return'&lt;';case'>':return'&gt;';}return c;}):s;},insertAfter:function(n,r){var t=this;r=t.get(r);return this.run(n,function(n){var p,ns;p=r.parentNode;ns=r.nextSibling;if(ns)p.insertBefore(n,ns);else p.appendChild(n);return n;});},isBlock:function(n){if(n.nodeType&&n.nodeType!==1)return false;n=n.nodeName||n;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n);},replace:function(n,o,k){if(is(o,'array'))n=n.cloneNode(true);return this.run(o,function(o){if(k){each(o.childNodes,function(c){n.appendChild(c.cloneNode(true));});}return o.parentNode.replaceChild(n,o);});},toHex:function(s){var c=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);function hex(s){s=parseInt(s).toString(16);return s.length>1?s:'0'+s;};if(c){s='#'+hex(c[1])+hex(c[2])+hex(c[3]);return s;}return s;},getClasses:function(){var t=this,cl=[],i,lo={},f=t.settings.class_filter,ov;if(t.classes)return t.classes;function addClasses(s){each(s.imports,function(r){addClasses(r);});each(s.cssRules||s.rules,function(r){switch(r.type||1){case 1:if(r.selectorText){each(r.selectorText.split(','),function(v){v=v.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(v)||!/\.[\w\-]+$/.test(v))return;ov=v;v=v.replace(/.*\.([a-z0-9_\-]+).*/i,'$1');if(f&&!(v=f(v,ov)))return;if(!lo[v]){cl.push({'class':v});lo[v]=1;}});}break;case 3:addClasses(r.styleSheet);break;}});};try{each(t.doc.styleSheets,addClasses);}catch(ex){}if(cl.length>0)t.classes=cl;return cl;},run:function(e,f,s){var t=this,o;if(t.doc&&typeof(e)==='string')e=t.doc.getElementById(e);if(!e)return false;s=s||this;if(!e.nodeType&&(e.length||e.length===0)){o=[];each(e,function(e,i){if(e){if(typeof(e)=='string')e=t.doc.getElementById(e);o.push(f.call(s,e,i));}});return o;}return f.call(s,e);},getAttribs:function(n){var o;n=this.get(n);if(!n)return[];if(isIE){o=[];if(n.nodeName=='OBJECT')return n.attributes;n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b});});return o;}return n.attributes;},destroy:function(s){var t=this;t.win=t.doc=t.root=null;if(!s)tinymce.removeUnload(t.destroy);}});tinymce.DOM=new tinymce.dom.DOMUtils(document,{process_html:0});})();(function(){var each=tinymce.each,DOM=tinymce.DOM,isIE=tinymce.isIE,isWebKit=tinymce.isWebKit,Event;tinymce.create('static tinymce.dom.Event',{inits:[],events:[],add:function(o,n,f,s){var cb,t=this,el=t.events,r;if(o&&o instanceof Array){r=[];each(o,function(o){o=DOM.get(o);r.push(t.add(o,n,f,s));});return r;}o=DOM.get(o);if(!o)return;cb=function(e){e=e||window.event;if(e&&!e.target&&isIE)e.target=e.srcElement;if(!s)return f(e);return f.call(s,e);};if(n=='unload'){tinymce.unloads.unshift({func:cb});return cb;}if(n=='init'){if(t.domLoaded)cb();else t.inits.push(cb);return cb;}el.push({obj:o,name:n,func:f,cfunc:cb,scope:s});t._add(o,n,cb);return f;},remove:function(o,n,f){var t=this,a=t.events,s=false,r;if(o&&o instanceof Array){r=[];each(o,function(o){o=DOM.get(o);r.push(t.remove(o,n,f));});return r;}o=DOM.get(o);each(a,function(e,i){if(e.obj==o&&e.name==n&&(!f||(e.func==f||e.cfunc==f))){a.splice(i,1);t._remove(o,n,e.cfunc);s=true;return false;}});return s;},clear:function(o){var t=this,a=t.events,i,e;if(o){o=DOM.get(o);for(i=a.length-1;i>=0;i--){e=a[i];if(e.obj===o){t._remove(e.obj,e.name,e.cfunc);e.obj=e.cfunc=null;a.splice(i,1);}}}},cancel:function(e){if(!e)return false;this.stop(e);return this.prevent(e);},stop:function(e){if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=true;return false;},prevent:function(e){if(e.preventDefault)e.preventDefault();else e.returnValue=false;return false;},_unload:function(){var t=Event;each(t.events,function(e,i){t._remove(e.obj,e.name,e.cfunc);e.obj=e.cfunc=null;});t.events=[];t=null;},_add:function(o,n,f){if(o.attachEvent)o.attachEvent('on'+n,f);else if(o.addEventListener)o.addEventListener(n,f,false);else o['on'+n]=f;},_remove:function(o,n,f){if(o){try{if(o.detachEvent)o.detachEvent('on'+n,f);else if(o.removeEventListener)o.removeEventListener(n,f,false);else o['on'+n]=null;}catch(ex){}}},_pageInit:function(){var e=Event;e._remove(window,'DOMContentLoaded',e._pageInit);e.domLoaded=true;each(e.inits,function(c){c();});e.inits=[];},_wait:function(){var t;if(window.tinyMCE_GZ&&tinyMCE_GZ.loaded)return;if(isIE&&document.location.protocol!='https:'){document.write('<script id=__ie_onload defer src=\'javascript:""\';><\/script>');DOM.get("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){Event._pageInit();DOM.get("__ie_onload").onreadystatechange=null;}};}else{Event._add(window,'DOMContentLoaded',Event._pageInit,Event);if(isIE||isWebKit){t=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(t);Event._pageInit();}},10);}}}});Event=tinymce.dom.Event;Event._wait();tinymce.addUnload(Event._unload);})();(function(){var each=tinymce.each;tinymce.create('tinymce.dom.Element',{Element:function(id,s){var t=this,dom,el;s=s||{};t.id=id;t.dom=dom=s.dom||tinymce.DOM;t.settings=s;if(!tinymce.isIE)el=t.dom.get(t.id);each(['getPos','getRect','getParent','add','setStyle','getStyle','setStyles','setAttrib','setAttribs','getAttrib','addClass','removeClass','hasClass','getOuterHTML','setOuterHTML','remove','show','hide','isHidden','setHTML','get'],function(k){t[k]=function(){var a=arguments,o;if(tinymce.isOpera){a=[id];each(arguments,function(v){a.push(v);});}else Array.prototype.unshift.call(a,el||id);o=dom[k].apply(dom,a);t.update(k);return o;};});},on:function(n,f,s){return tinymce.dom.Event.add(this.id,n,f,s);},getXY:function(){return{x:parseInt(this.getStyle('left')),y:parseInt(this.getStyle('top'))};},getSize:function(){var n=this.dom.get(this.id);return{w:parseInt(this.getStyle('width')||n.clientWidth),h:parseInt(this.getStyle('height')||n.clientHeight)};},moveTo:function(x,y){this.setStyles({left:x,top:y});},moveBy:function(x,y){var p=this.getXY();this.moveTo(p.x+x,p.y+y);},resizeTo:function(w,h){this.setStyles({width:w,height:h});},resizeBy:function(w,h){var s=this.getSize();this.resizeTo(s.w+w,s.h+h);},update:function(k){var t=this,b,dom=t.dom;if(tinymce.isIE6&&t.settings.blocker){k=k||'';if(k.indexOf('get')===0||k.indexOf('has')===0||k.indexOf('is')===0)return;if(k=='remove'){dom.remove(t.blocker);return;}if(!t.blocker){t.blocker=dom.uniqueId();b=dom.add(t.settings.container||dom.getRoot(),'iframe',{id:t.blocker,style:'position:absolute;',frameBorder:0,src:'javascript:""'});dom.setStyle(b,'opacity',0);}else b=dom.get(t.blocker);dom.setStyle(b,'left',t.getStyle('left',1));dom.setStyle(b,'top',t.getStyle('top',1));dom.setStyle(b,'width',t.getStyle('width',1));dom.setStyle(b,'height',t.getStyle('height',1));dom.setStyle(b,'display',t.getStyle('display',1));dom.setStyle(b,'zIndex',parseInt(t.getStyle('zIndex',1)||0)-1);}}});})();(function(){var is=tinymce.is,isIE=tinymce.isIE,each=tinymce.each;tinymce.create('tinymce.dom.Selection',{Selection:function(dom,win,serializer){var t=this;t.dom=dom;t.win=win;t.serializer=serializer;tinymce.addUnload(t.destroy,t);},getContent:function(s){var t=this,r=t.getRng(),e=t.dom.create("body"),se=t.getSel(),wb,wa,n;s=s||{};wb=wa='';s.get=true;s.format=s.format||'html';if(s.format=='text')return t.isCollapsed()?'':(r.text||(se.toString?se.toString():''));if(r.cloneContents){n=r.cloneContents();if(n)e.appendChild(n);}else if(is(r.item)||is(r.htmlText))e.innerHTML=r.item?r.item(0).outerHTML:r.htmlText;else e.innerHTML=r.toString();if(/^\s/.test(e.innerHTML))wb=' ';if(/\s+$/.test(e.innerHTML))wa=' ';s.getInner=true;return t.isCollapsed()?'':wb+t.serializer.serialize(e,s)+wa;},setContent:function(h,s){var t=this,r=t.getRng(),d;s=s||{format:'html'};s.set=true;h=t.dom.processHTML(h);if(r.insertNode){d=t.win.document;if(tinymce.isGecko&&h.indexOf('<')==-1){r.deleteContents();r.insertNode(t.getRng().createContextualFragment(h+'<span id="__caret">_</span>'));t.select(t.dom.get('__caret'));t.getRng().deleteContents();return;}try{if(d.queryCommandEnabled('InsertHTML'))return d.execCommand('InsertHTML',false,h);}catch(ex){r.deleteContents();r.insertNode(t.getRng().createContextualFragment(h));}}else{if(r.item)r.item(0).outerHTML=h;else r.pasteHTML(h);}},getStart:function(){var t=this,r=t.getRng(),e;if(isIE){if(r.item)return r.item(0);r=r.duplicate();r.collapse(1);e=r.parentElement();if(e.nodeName=='BODY')return e.firstChild;return e;}else{e=r.startContainer;if(e.nodeName=='BODY')return e.firstChild;return t.dom.getParent(e,function(n){return n.nodeType==1;});}},getEnd:function(){var t=this,r=t.getRng(),e;if(isIE){if(r.item)return r.item(0);r=r.duplicate();r.collapse(0);e=r.parentElement();if(e.nodeName=='BODY')return e.lastChild;return e;}else{e=r.endContainer;if(e.nodeName=='BODY')return e.lastChild;return t.dom.getParent(e,function(n){return n.nodeType==1;});}},getBookmark:function(si){var t=this,r=t.getRng(),tr,sx,sy,vp=t.dom.getViewPort(t.win),e,sp,bp,le,c=-0xFFFFFF,s,ro=t.dom.getRoot(),wb=0,wa=0,nv;sx=vp.x;sy=vp.y;if(si=='simple')return{rng:r,scrollX:sx,scrollY:sy};if(isIE){if(r.item){e=r.item(0);each(t.dom.select(e.nodeName),function(n,i){if(e==n){sp=i;return false;}});return{tag:e.nodeName,index:sp,scrollX:sx,scrollY:sy};}tr=t.dom.doc.body.createTextRange();tr.moveToElementText(ro);tr.collapse(true);bp=Math.abs(tr.move('character',c));tr=r.duplicate();tr.collapse(true);sp=Math.abs(tr.move('character',c));tr=r.duplicate();tr.collapse(false);le=Math.abs(tr.move('character',c))-sp;return{start:sp-bp,length:le,scrollX:sx,scrollY:sy};}e=t.getNode();s=t.getSel();if(!s)return null;if(e&&e.nodeName=='IMG'){return{scrollX:sx,scrollY:sy};}function getPos(r,sn,en){var w=t.dom.doc.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={};while((n=w.nextNode())!=null){if(n==sn)d.start=p;if(n==en){d.end=p;return d;}p+=tinymce.trim(n.nodeValue||'').length;}return null;};if(s.anchorNode==s.focusNode&&s.anchorOffset==s.focusOffset){e=getPos(ro,s.anchorNode,s.focusNode);if(!e)return{scrollX:sx,scrollY:sy};(s.anchorNode.nodeValue||'').replace(/^\s+/,function(a){wb=a.length;});return{start:Math.max(e.start+s.anchorOffset-wb,0),end:Math.max(e.end+s.focusOffset-wb,0),scrollX:sx,scrollY:sy,beg:s.anchorOffset-wb==0};}else{e=getPos(ro,r.startContainer,r.endContainer);(r.startContainer.nodeValue||'').replace(/^\s+/,function(a){wb=a.length;});(r.endContainer.nodeValue||'').replace(/^\s+/,function(a){wa=a.length;});if(!e)return{scrollX:sx,scrollY:sy};return{start:Math.max(e.start+r.startOffset-wb,0),end:Math.max(e.end+r.endOffset-wa,0),scrollX:sx,scrollY:sy,beg:r.startOffset-wb==0};}},moveToBookmark:function(b){var t=this,r=t.getRng(),s=t.getSel(),ro=t.dom.getRoot(),sd,nvl,nv;function getPos(r,sp,ep){var w=t.dom.doc.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={},o,v,wa,wb;while((n=w.nextNode())!=null){wa=wb=0;nv=n.nodeValue||'';nv.replace(/^\s+[^\s]/,function(a){wb=a.length-1;});nv.replace(/[^\s]\s+$/,function(a){wa=a.length-1;});nvl=tinymce.trim(nv).length;p+=nvl;if(p>=sp&&!d.startNode){o=sp-(p-nvl);if(b.beg&&o>=nvl)continue;d.startNode=n;d.startOffset=o+wb;}if(p>=ep){d.endNode=n;d.endOffset=ep-(p-nvl)+wb;return d;}}return null;};if(!b)return false;t.win.scrollTo(b.scrollX,b.scrollY);if(isIE){if(r=b.rng){try{r.select();}catch(ex){}return true;}t.win.focus();if(b.tag){r=ro.createControlRange();each(t.dom.select(b.tag),function(n,i){if(i==b.index)r.addElement(n);});}else{try{if(b.start<0)return true;r=s.createRange();r.moveToElementText(ro);r.collapse(true);r.moveStart('character',b.start);r.moveEnd('character',b.length);}catch(ex2){return true;}}try{r.select();}catch(ex){}return true;}if(!s)return false;if(b.rng){s.removeAllRanges();s.addRange(b.rng);}else{if(is(b.start)&&is(b.end)){try{sd=getPos(ro,b.start,b.end);if(sd){r=t.dom.doc.createRange();r.setStart(sd.startNode,sd.startOffset);r.setEnd(sd.endNode,sd.endOffset);s.removeAllRanges();s.addRange(r);}if(!tinymce.isOpera)t.win.focus();}catch(ex){}}}},select:function(n,c){var t=this,r=t.getRng(),s=t.getSel(),b,fn,ln,d=t.win.document;function first(n){return n?d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false).nextNode():null;};function last(n){var c,o,w;if(!n)return null;w=d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while(c=w.nextNode())o=c;return o;};if(isIE){try{b=d.body;if(/^(IMG|TABLE)$/.test(n.nodeName)){r=b.createControlRange();r.addElement(n);}else{r=b.createTextRange();r.moveToElementText(n);}r.select();}catch(ex){}}else{if(c){fn=first(n);ln=last(n);if(fn&&ln){r=d.createRange();r.setStart(fn,0);r.setEnd(ln,ln.nodeValue.length);}else r.selectNode(n);}else r.selectNode(n);t.setRng(r);}return n;},isCollapsed:function(){var t=this,r=t.getRng(),s=t.getSel();if(!r||r.item)return false;return!s||r.boundingWidth==0||s.isCollapsed;},collapse:function(b){var t=this,r=t.getRng(),n;if(r.item){n=r.item(0);r=this.win.document.body.createTextRange();r.moveToElementText(n);}r.collapse(!!b);t.setRng(r);},getSel:function(){var t=this,w=this.win;return w.getSelection?w.getSelection():w.document.selection;},getRng:function(){var t=this,s=t.getSel(),r;try{if(s)r=s.rangeCount>0?s.getRangeAt(0):(s.createRange?s.createRange():t.win.document.createRange());}catch(ex){}if(!r)r=isIE?t.win.document.body.createTextRange():t.win.document.createRange();return r;},setRng:function(r){var s;if(!isIE){s=this.getSel();if(s){s.removeAllRanges();s.addRange(r);}}else{try{r.select();}catch(ex){}}},setNode:function(n){var t=this;t.setContent(t.dom.getOuterHTML(n));return n;},getNode:function(){var t=this,r=t.getRng(),s=t.getSel(),e;if(!isIE){if(!r)return t.dom.getRoot();e=r.commonAncestorContainer;if(!r.collapsed){if(r.startContainer==r.endContainer||(tinymce.isWebKit&&r.startContainer==r.endContainer.parentNode)){if(r.startOffset-r.endOffset<2||tinymce.isWebKit){if(r.startContainer.hasChildNodes())e=r.startContainer.childNodes[r.startOffset];}}}return t.dom.getParent(e,function(n){return n.nodeType==1;});}return r.item?r.item(0):r.parentElement();},destroy:function(s){var t=this;t.win=null;if(!s)tinymce.removeUnload(t.destroy);}});})();(function(){tinymce.create('tinymce.dom.XMLWriter',{node:null,XMLWriter:function(s){function getXML(){var i=document.implementation;if(!i||!i.createDocument){try{return new ActiveXObject('MSXML2.DOMDocument');}catch(ex){}try{return new ActiveXObject('Microsoft.XmlDom');}catch(ex){}}else return i.createDocument('','',null);};this.doc=getXML();this.valid=tinymce.isOpera||tinymce.isWebKit;this.reset();},reset:function(){var t=this,d=t.doc;if(d.firstChild)d.removeChild(d.firstChild);t.node=d.appendChild(d.createElement("html"));},writeStartElement:function(n){var t=this;t.node=t.node.appendChild(t.doc.createElement(n));},writeAttribute:function(n,v){if(this.valid)v=v.replace(/>/g,'%MCGT%');this.node.setAttribute(n,v);},writeEndElement:function(){this.node=this.node.parentNode;},writeFullEndElement:function(){var t=this,n=t.node;n.appendChild(t.doc.createTextNode(""));t.node=n.parentNode;},writeText:function(v){if(this.valid)v=v.replace(/>/g,'%MCGT%');this.node.appendChild(this.doc.createTextNode(v));},writeCDATA:function(v){this.node.appendChild(this.doc.createCDATA(v));},writeComment:function(v){this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g,' ')));},getContent:function(){var h;h=this.doc.xml||new XMLSerializer().serializeToString(this.doc);h=h.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,'');h=h.replace(/ ?\/>/g,' />');if(this.valid)h=h.replace(/\%MCGT%/g,'&gt;');return h;}});})();(function(){tinymce.create('tinymce.dom.StringWriter',{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(s){this.settings=tinymce.extend({indent_char:' ',indentation:1},s);this.reset();},reset:function(){this.indent='';this.str="";this.tags=[];this.count=0;},writeStartElement:function(n){this._writeAttributesEnd();this.writeRaw('<'+n);this.tags.push(n);this.inAttr=true;this.count++;this.elementCount=this.count;},writeAttribute:function(n,v){var t=this;t.writeRaw(" "+t.encode(n)+'="'+t.encode(v)+'"');},writeEndElement:function(){var n;if(this.tags.length>0){n=this.tags.pop();if(this._writeAttributesEnd(1))this.writeRaw('</'+n+'>');if(this.settings.indentation>0)this.writeRaw('\n');}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw('</'+this.tags.pop()+'>');if(this.settings.indentation>0)this.writeRaw('\n');}},writeText:function(v){this._writeAttributesEnd();this.writeRaw(this.encode(v));this.count++;},writeCDATA:function(v){this._writeAttributesEnd();this.writeRaw('<![CDATA['+v+']]>');this.count++;},writeComment:function(v){this._writeAttributesEnd();this.writeRaw('<!-- '+v+'-->');this.count++;},writeRaw:function(v){this.str+=v;},encode:function(s){return s.replace(/[<>&"]/g,function(v){switch(v){case'<':return'&lt;';case'>':return'&gt;';case'&':return'&amp;';case'"':return'&quot;';}return v;});},getContent:function(){return this.str;},_writeAttributesEnd:function(s){if(!this.inAttr)return;this.inAttr=false;if(s&&this.elementCount==this.count){this.writeRaw(' />');return false;}this.writeRaw('>');return true;}});})();(function(){var extend=tinymce.extend,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher,isIE=tinymce.isIE,isGecko=tinymce.isGecko;function getIEAtts(n){var o=[];if(n.nodeName=='OBJECT')return n.attributes;n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b});});return o;};function wildcardToRE(s){return s.replace(/([?+*])/g,'.$1');};tinymce.create('tinymce.dom.Serializer',{Serializer:function(s){var t=this;t.key=0;t.onPreProcess=new Dispatcher(t);t.onPostProcess=new Dispatcher(t);if(tinymce.relaxedDomain&&tinymce.isGecko){t.writer=new tinymce.dom.StringWriter();}else{try{t.writer=new tinymce.dom.XMLWriter();}catch(ex){t.writer=new tinymce.dom.StringWriter();}}t.settings=s=extend({dom:tinymce.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_)/,closed:/(br|hr|input|meta|img|link|param)/,entity_encoding:'named',entities:'160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro',valid_elements:'*[*]',extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:0,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:'simple',indent_char:'\t',indent_levels:1,remove_linebreaks:1},s);t.dom=s.dom;if(s.fix_list_elements){t.onPreProcess.add(function(se,o){var nl,x,a=['ol','ul'],i,n,p,r=/^(OL|UL)$/,np;function prevNode(e,n){var a=n.split(','),i;while((e=e.previousSibling)!=null){for(i=0;i<a.length;i++){if(e.nodeName==a[i])return e;}}return null;};for(x=0;x<a.length;x++){nl=t.dom.select(a[x],o.node);for(i=0;i<nl.length;i++){n=nl[i];p=n.parentNode;if(r.test(p.nodeName)){np=prevNode(n,'LI');if(!np){np=t.dom.create('li');np.innerHTML='&nbsp;';np.appendChild(n);p.insertBefore(np,p.firstChild);}else np.appendChild(n);}}}});}if(s.fix_table_elements){t.onPreProcess.add(function(se,o){each(t.dom.select('table',o.node),function(e){var pa=t.dom.getParent(e,'H1,H2,H3,H4,H5,H6,P'),pa2,n,tm,pl=[],i,ns;if(pa){pa2=pa.cloneNode(false);pl.push(e);for(n=e;n=n.parentNode;){pl.push(n);if(n==pa)break;}tm=pa2;for(i=pl.length-1;i>=0;i--){if(i==pl.length-1){while(ns=pl[i-1].nextSibling)tm.appendChild(ns.parentNode.removeChild(ns));}else{n=pl[i].cloneNode(false);if(i!=0){while(ns=pl[i-1].nextSibling)n.appendChild(ns.parentNode.removeChild(ns));}tm=tm.appendChild(n);}}e=t.dom.insertAfter(e.parentNode.removeChild(e),pa);t.dom.insertAfter(e,pa);t.dom.insertAfter(pa2,e);}});});}},setEntities:function(s){var t=this,a,i,l={},re='',v;if(t.entityLookup)return;a=s.split(',');for(i=0;i<a.length;i+=2){v=a[i];if(v==34||v==38||v==60||v==62)continue;l[String.fromCharCode(a[i])]=a[i+1];v=parseInt(a[i]).toString(16);re+='\\u'+'0000'.substring(v.length)+v;}if(!re){t.settings.entity_encoding='raw';return;}t.entitiesRE=new RegExp('['+re+']','g');t.entityLookup=l;},setValidChildRules:function(s){this.childRules=null;this.addValidChildRules(s);},addValidChildRules:function(s){var t=this,inst,intr,bloc;if(!s)return;inst='A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment';intr='A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment';bloc='H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP';each(s.split(','),function(s){var p=s.split(/\[|\]/),re;s='';each(p[1].split('|'),function(v){if(s)s+='|';switch(v){case'%itrans':v=intr;break;case'%itrans_na':v=intr.substring(2);break;case'%istrict':v=inst;break;case'%istrict_na':v=inst.substring(2);break;case'%btrans':v=bloc;break;case'%bstrict':v=bloc;break;}s+=v;});re=new RegExp('^('+s.toLowerCase()+')$','i');each(p[0].split('/'),function(s){t.childRules=t.childRules||{};t.childRules[s]=re;});});s='';each(t.childRules,function(v,k){if(s)s+='|';s+=k;});t.parentElementsRE=new RegExp('^('+s.toLowerCase()+')$','i');},setRules:function(s){var t=this;t._setup();t.rules={};t.wildRules=[];t.validElements={};return t.addRules(s);},addRules:function(s){var t=this,dr;if(!s)return;t._setup();each(s.split(','),function(s){var p=s.split(/\[|\]/),tn=p[0].split('/'),ra,at,wat,va=[];if(dr)at=tinymce.extend([],dr.attribs);if(p.length>1){each(p[1].split('|'),function(s){var ar={},i;at=at||[];s=s.replace(/::/g,'~');s=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(s);s[2]=s[2].replace(/~/g,':');if(s[1]=='!'){ra=ra||[];ra.push(s[2]);}if(s[1]=='-'){for(i=0;i<at.length;i++){if(at[i].name==s[2]){at.splice(i,1);return;}}}switch(s[3]){case'=':ar.defaultVal=s[4]||'';break;case':':ar.forcedVal=s[4];break;case'<':ar.validVals=s[4].split('?');break;}if(/[*.?]/.test(s[2])){wat=wat||[];ar.nameRE=new RegExp('^'+wildcardToRE(s[2])+'$');wat.push(ar);}else{ar.name=s[2];at.push(ar);}va.push(s[2]);});}each(tn,function(s,i){var pr=s.charAt(0),x=1,ru={};if(dr){if(dr.noEmpty)ru.noEmpty=dr.noEmpty;if(dr.fullEnd)ru.fullEnd=dr.fullEnd;if(dr.padd)ru.padd=dr.padd;}switch(pr){case'-':ru.noEmpty=true;break;case'+':ru.fullEnd=true;break;case'#':ru.padd=true;break;default:x=0;}tn[i]=s=s.substring(x);t.validElements[s]=1;if(/[*.?]/.test(tn[0])){ru.nameRE=new RegExp('^'+wildcardToRE(tn[0])+'$');t.wildRules=t.wildRules||{};t.wildRules.push(ru);}else{ru.name=tn[0];if(tn[0]=='@')dr=ru;t.rules[s]=ru;}ru.attribs=at;if(ra)ru.requiredAttribs=ra;if(wat){s='';each(va,function(v){if(s)s+='|';s+='('+wildcardToRE(v)+')';});ru.validAttribsRE=new RegExp('^'+s.toLowerCase()+'$');ru.wildAttribs=wat;}});});s='';each(t.validElements,function(v,k){if(s)s+='|';if(k!='@')s+=k;});t.validElementsRE=new RegExp('^('+wildcardToRE(s.toLowerCase())+')$');},findRule:function(n){var t=this,rl=t.rules,i,r;t._setup();r=rl[n];if(r)return r;rl=t.wildRules;for(i=0;i<rl.length;i++){if(rl[i].nameRE.test(n))return rl[i];}return null;},findAttribRule:function(ru,n){var i,wa=ru.wildAttribs;for(i=0;i<wa.length;i++){if(wa[i].nameRE.test(n))return wa[i];}return null;},serialize:function(n,o){var h,t=this;t._setup();o=o||{};o.format=o.format||'html';t.processObj=o;n=n.cloneNode(true);t.key=''+(parseInt(t.key)+1);if(!o.no_events){o.node=n;t.onPreProcess.dispatch(t,o);}t.writer.reset();t._serializeNode(n,o.getInner);o.content=t.writer.getContent();if(!o.no_events)t.onPostProcess.dispatch(t,o);t._postProcess(o);o.node=null;return tinymce.trim(o.content);},_postProcess:function(o){var t=this,s=t.settings,h=o.content,sc=[],p;if(o.format=='html'){p=t._protect({content:h,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1}]});h=p.content;if(s.entity_encoding!=='raw')h=t._encode(h);if(!o.set){h=h.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,s.entity_encoding=='numeric'?'<p$1>&#160;</p>':'<p$1>&nbsp;</p>');if(s.remove_linebreaks){h=h.replace(/\r?\n|\r/g,' ');h=h.replace(/(<[^>]+>)\s+/g,'$1 ');h=h.replace(/\s+(<\/[^>]+>)/g,' $1');h=h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,'<$1 $2>');h=h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,'<$1>');h=h.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,'</$1>');}if(s.apply_source_formatting&&s.indent_mode=='simple'){h=h.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,'\n<$1$2$3>\n');h=h.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,'\n<$1$2>');h=h.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,'</$1>\n');h=h.replace(/\n\n/g,'\n');}}h=t._unprotect(h,p);if(s.entity_encoding=='raw')h=h.replace(/<p>&nbsp;<\/p>|<p([^>]+)>&nbsp;<\/p>/g,'<p$1>\u00a0</p>');}o.content=h;},_serializeNode:function(n,inn){var t=this,s=t.settings,w=t.writer,hc,el,cn,i,l,a,at,no,v,nn,ru,ar,iv;if(!s.node_filter||s.node_filter(n)){switch(n.nodeType){case 1:if(n.hasAttribute?n.hasAttribute('mce_bogus'):n.getAttribute('mce_bogus'))return;iv=false;hc=n.hasChildNodes();nn=n.getAttribute('mce_name')||n.nodeName.toLowerCase();if(isIE){if(n.scopeName!=='HTML'&&n.scopeName!=='html')nn=n.scopeName+':'+nn;}if(nn.indexOf('mce:')===0)nn=nn.substring(4);if(!t.validElementsRE.test(nn)||(t.invalidElementsRE&&t.invalidElementsRE.test(nn))||inn){iv=true;break;}if(isIE){if(s.fix_content_duplication){if(n.mce_serialized==t.key)return;n.mce_serialized=t.key;}if(nn.charAt(0)=='/')nn=nn.substring(1);}else if(isGecko){if(n.nodeName==='BR'&&n.getAttribute('type')=='_moz')return;}if(t.childRules){if(t.parentElementsRE.test(t.elementName)){if(!t.childRules[t.elementName].test(nn)){iv=true;break;}}t.elementName=nn;}ru=t.findRule(nn);nn=ru.name||nn;if((!hc&&ru.noEmpty)||(isIE&&!nn)){iv=true;break;}if(ru.requiredAttribs){a=ru.requiredAttribs;for(i=a.length-1;i>=0;i--){if(this.dom.getAttrib(n,a[i])!=='')break;}if(i==-1){iv=true;break;}}w.writeStartElement(nn);if(ru.attribs){for(i=0,at=ru.attribs,l=at.length;i<l;i++){a=at[i];v=t._getAttrib(n,a);if(v!==null)w.writeAttribute(a.name,v);}}if(ru.validAttribsRE){at=isIE?getIEAtts(n):n.attributes;for(i=at.length-1;i>-1;i--){no=at[i];if(no.specified){a=no.nodeName.toLowerCase();if(s.invalid_attrs.test(a)||!ru.validAttribsRE.test(a))continue;ar=t.findAttribRule(ru,a);v=t._getAttrib(n,ar,a);if(v!==null)w.writeAttribute(a,v);}}}if(!hc&&ru.padd)w.writeText('\u00a0');break;case 3:if(t.childRules&&t.parentElementsRE.test(t.elementName)){if(!t.childRules[t.elementName].test(n.nodeName))return;}return w.writeText(n.nodeValue);case 4:return w.writeCDATA(n.nodeValue);case 8:return w.writeComment(n.nodeValue);}}else if(n.nodeType==1)hc=n.hasChildNodes();if(hc){cn=n.firstChild;while(cn){t._serializeNode(cn);t.elementName=nn;cn=cn.nextSibling;}}if(!iv){if(hc||!s.closed.test(nn))w.writeFullEndElement();else w.writeEndElement();}},_protect:function(o){var t=this;o.items=o.items||[];function enc(s){return s.replace(/[\r\n\\]/g,function(c){if(c==='\n')return'\\n';else if(c==='\\')return'\\\\';return'\\r';});};function dec(s){return s.replace(/\\[\\rn]/g,function(c){if(c==='\\n')return'\n';else if(c==='\\\\')return'\\';return'\r';});};each(o.patterns,function(p){o.content=dec(enc(o.content).replace(p.pattern,function(x,a,b,c){b=dec(b);if(p.encode)b=t._encode(b);o.items.push(b);return a+'<!--mce:'+(o.items.length-1)+'-->'+c;}));});return o;},_unprotect:function(h,o){h=h.replace(/\<!--mce:([0-9]+)--\>/g,function(a,b){return o.items[parseInt(b)];});o.items=[];return h;},_encode:function(h){var t=this,s=t.settings,l;if(s.entity_encoding!=='raw'){if(s.entity_encoding.indexOf('named')!=-1){t.setEntities(s.entities);l=t.entityLookup;h=h.replace(t.entitiesRE,function(a){var v;if(v=l[a])a='&'+v+';';return a;});}if(s.entity_encoding.indexOf('numeric')!=-1){h=h.replace(/[\u007E-\uFFFF]/g,function(a){return'&#'+a.charCodeAt(0)+';';});}}return h;},_setup:function(){var t=this,s=this.settings;if(t.done)return;t.done=1;t.setRules(s.valid_elements);t.addRules(s.extended_valid_elements);t.addValidChildRules(s.valid_child_elements);if(s.invalid_elements)t.invalidElementsRE=new RegExp('^('+wildcardToRE(s.invalid_elements.replace(',','|').toLowerCase())+')$');if(s.attrib_value_filter)t.attribValueFilter=s.attribValueFilter;},_getAttrib:function(n,a,na){var i,v;na=na||a.name;if(a.forcedVal&&(v=a.forcedVal)){if(v==='{$uid}')return this.dom.uniqueId();return v;}v=this.dom.getAttrib(n,na);switch(na){case'rowspan':case'colspan':if(v=='1')v='';break;}if(this.attribValueFilter)v=this.attribValueFilter(na,v,n);if(a.validVals){for(i=a.validVals.length-1;i>=0;i--){if(v==a.validVals[i])break;}if(i==-1)return null;}if(v===''&&typeof(a.defaultVal)!='undefined'){v=a.defaultVal;if(v==='{$uid}')return this.dom.uniqueId();return v;}else{if(na=='class'&&this.processObj.get)v=v.replace(/\s?mceItem\w+\s?/g,'');}if(v==='')return null;return v;}});})();(function(){var each=tinymce.each;tinymce.create('tinymce.dom.ScriptLoader',{ScriptLoader:function(s){this.settings=s||{};this.queue=[];this.lookup={};},isDone:function(u){return this.lookup[u]?this.lookup[u].state==2:0;},markDone:function(u){this.lookup[u]={state:2,url:u};},add:function(u,cb,s,pr){var t=this,lo=t.lookup,o;if(o=lo[u]){if(cb&&o.state==2)cb.call(s||this);return o;}o={state:0,url:u,func:cb,scope:s||this};if(pr)t.queue.unshift(o);else t.queue.push(o);lo[u]=o;return o;},load:function(u,cb,s){var t=this,o;if(o=t.lookup[u]){if(cb&&o.state==2)cb.call(s||t);return o;}function loadScript(u){if(tinymce.dom.Event.domLoaded||t.settings.strict_mode){tinymce.util.XHR.send({url:tinymce._addVer(u),error:t.settings.error,async:false,success:function(co){t.eval(co);}});}else document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"></script>');};if(!tinymce.is(u,'string')){each(u,function(u){loadScript(u);});if(cb)cb.call(s||t);}else{loadScript(u);if(cb)cb.call(s||t);}},loadQueue:function(cb,s){var t=this;if(!t.queueLoading){t.queueLoading=1;t.queueCallbacks=[];t.loadScripts(t.queue,function(){t.queueLoading=0;if(cb)cb.call(s||t);each(t.queueCallbacks,function(o){o.func.call(o.scope);});});}else if(cb)t.queueCallbacks.push({func:cb,scope:s||t});},eval:function(co){var w=window;if(!w.execScript){try{eval.call(w,co);}catch(ex){eval(co,w);}}else w.execScript(co);},loadScripts:function(sc,cb,s){var t=this,lo=t.lookup;function done(o){o.state=2;if(o.func)o.func.call(o.scope||t);};function allDone(){var l;l=sc.length;each(sc,function(o){o=lo[o.url];if(o.state===2){done(o);l--;}else load(o);});if(l===0&&cb){cb.call(s||t);cb=0;}};function load(o){if(o.state>0)return;o.state=1;tinymce.util.XHR.send({url:o.url,error:t.settings.error,success:function(co){t.eval(co);done(o);allDone();}});};each(sc,function(o){var u=o.url;if(!lo[u]){lo[u]=o;t.queue.push(o);}else o=lo[u];if(o.state>0)return;if(!tinymce.dom.Event.domLoaded&&!t.settings.strict_mode){var ix,ol='';if(cb||o.func){o.state=1;ix=tinymce.dom.ScriptLoader._addOnLoad(function(){done(o);allDone();});if(tinymce.isIE)ol=' onreadystatechange="';else ol=' onload="';ol+='tinymce.dom.ScriptLoader._onLoad(this,\''+u+'\','+ix+');"';}document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"'+ol+'></script>');if(!o.func)done(o);}else load(o);});allDone();},'static':{_addOnLoad:function(f){var t=this;t._funcs=t._funcs||[];t._funcs.push(f);return t._funcs.length-1;},_onLoad:function(e,u,ix){if(!tinymce.isIE||e.readyState=='complete')this._funcs[ix].call(this);}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader();})();(function(){var DOM=tinymce.DOM,is=tinymce.is;tinymce.create('tinymce.ui.Control',{Control:function(id,s){this.id=id;this.settings=s=s||{};this.rendered=false;this.onRender=new tinymce.util.Dispatcher(this);this.classPrefix='';this.scope=s.scope||this;this.disabled=0;this.active=0;},setDisabled:function(s){var e;if(s!=this.disabled){e=DOM.get(this.id);if(e&&this.settings.unavailable_prefix){if(s){this.prevTitle=e.title;e.title=this.settings.unavailable_prefix+": "+e.title;}else e.title=this.prevTitle;}this.setState('Disabled',s);this.setState('Enabled',!s);this.disabled=s;}},isDisabled:function(){return this.disabled;},setActive:function(s){if(s!=this.active){this.setState('Active',s);this.active=s;}},isActive:function(){return this.active;},setState:function(c,s){var n=DOM.get(this.id);c=this.classPrefix+c;if(s)DOM.addClass(n,c);else DOM.removeClass(n,c);},isRendered:function(){return this.rendered;},renderHTML:function(){},renderTo:function(n){DOM.setHTML(n,this.renderHTML());},postRender:function(){var t=this,b;if(is(t.disabled)){b=t.disabled;t.disabled=-1;t.setDisabled(b);}if(is(t.active)){b=t.active;t.active=-1;t.setActive(b);}},remove:function(){DOM.remove(this.id);this.destroy();},destroy:function(){tinymce.dom.Event.clear(this.id);}});})();tinymce.create('tinymce.ui.Container:tinymce.ui.Control',{Container:function(id,s){this.parent(id,s);this.controls=[];this.lookup={};},add:function(c){this.lookup[c.id]=c;this.controls.push(c);return c;},get:function(n){return this.lookup[n];}});tinymce.create('tinymce.ui.Separator:tinymce.ui.Control',{Separator:function(id,s){this.parent(id,s);this.classPrefix='mceSeparator';},renderHTML:function(){return tinymce.DOM.createHTML('span',{'class':this.classPrefix});}});(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,walk=tinymce.walk;tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control',{MenuItem:function(id,s){this.parent(id,s);this.classPrefix='mceMenuItem';},setSelected:function(s){this.setState('Selected',s);this.selected=s;},isSelected:function(){return this.selected;},postRender:function(){var t=this;t.parent();if(is(t.selected))t.setSelected(t.selected);}});})();(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,walk=tinymce.walk;tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem',{Menu:function(id,s){var t=this;t.parent(id,s);t.items={};t.collapsed=false;t.menuCount=0;t.onAddItem=new tinymce.util.Dispatcher(this);},expand:function(d){var t=this;if(d){walk(t,function(o){if(o.expand)o.expand();},'items',t);}t.collapsed=false;},collapse:function(d){var t=this;if(d){walk(t,function(o){if(o.collapse)o.collapse();},'items',t);}t.collapsed=true;},isCollapsed:function(){return this.collapsed;},add:function(o){if(!o.settings)o=new tinymce.ui.MenuItem(o.id||DOM.uniqueId(),o);this.onAddItem.dispatch(this,o);return this.items[o.id]=o;},addSeparator:function(){return this.add({separator:true});},addMenu:function(o){if(!o.collapse)o=this.createMenu(o);this.menuCount++;return this.add(o);},hasMenus:function(){return this.menuCount!==0;},remove:function(o){delete this.items[o.id];},removeAll:function(){var t=this;walk(t,function(o){if(o.removeAll)o.removeAll();else o.remove();o.destroy();},'items',t);t.items={};},createMenu:function(o){var m=new tinymce.ui.Menu(o.id||DOM.uniqueId(),o);m.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return m;}});})();(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,Event=tinymce.dom.Event,Element=tinymce.dom.Element;tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu',{DropMenu:function(id,s){s=s||{};s.container=s.container||DOM.doc.body;s.offset_x=s.offset_x||0;s.offset_y=s.offset_y||0;s.vp_offset_x=s.vp_offset_x||0;s.vp_offset_y=s.vp_offset_y||0;if(is(s.icons)&&!s.icons)s['class']+=' mceNoIcons';this.parent(id,s);this.onShowMenu=new tinymce.util.Dispatcher(this);this.onHideMenu=new tinymce.util.Dispatcher(this);this.classPrefix='mceMenu';this.fixIE=tinymce.isIE&&DOM.win.top!=DOM.win;},createMenu:function(s){var t=this,cs=t.settings,m;s.container=s.container||cs.container;s.parent=t;s.constrain=s.constrain||cs.constrain;s['class']=s['class']||cs['class'];s.vp_offset_x=s.vp_offset_x||cs.vp_offset_x;s.vp_offset_y=s.vp_offset_y||cs.vp_offset_y;m=new tinymce.ui.DropMenu(s.id||DOM.uniqueId(),s);m.onAddItem.add(t.onAddItem.dispatch,t.onAddItem);return m;},update:function(){var t=this,s=t.settings,tb=DOM.get('menu_'+t.id+'_tbl'),co=DOM.get('menu_'+t.id+'_co'),tw,th;tw=s.max_width?Math.min(tb.clientWidth,s.max_width):tb.clientWidth;th=s.max_height?Math.min(tb.clientHeight,s.max_height):tb.clientHeight;if(!DOM.boxModel)t.element.setStyles({width:tw+2,height:th+2});else t.element.setStyles({width:tw,height:th});if(s.max_width)DOM.setStyle(co,'width',tw);if(s.max_height){DOM.setStyle(co,'height',th);if(tb.clientHeight<s.max_height)DOM.setStyle(co,'overflow','hidden');}},showMenu:function(x,y,px){var t=this,s=t.settings,co,vp=DOM.getViewPort(),w,h,mx,my,ot=2,dm,tb,cp=t.classPrefix;t.collapse(1);if(t.isMenuVisible)return;if(!t.rendered){co=DOM.add(t.settings.container,t.renderNode());each(t.items,function(o){o.postRender();});t.element=new Element('menu_'+t.id,{blocker:1,container:s.container});}else co=DOM.get('menu_'+t.id);if(!tinymce.isOpera)DOM.setStyles(co,{left:-0xFFFF,top:-0xFFFF});DOM.show(co);t.update();x+=s.offset_x||0;y+=s.offset_y||0;vp.w-=4;vp.h-=4;if(s.constrain){w=co.clientWidth-ot;h=co.clientHeight-ot;mx=vp.x+vp.w;my=vp.y+vp.h;if((x+s.vp_offset_x+w)>mx)x=px?px-w:Math.max(0,(mx-s.vp_offset_x)-w);if((y+s.vp_offset_y+h)>my)y=Math.max(0,(my-s.vp_offset_y)-h);}DOM.setStyles(co,{left:x,top:y});t.element.update();t.isMenuVisible=1;t.mouseClickFunc=Event.add(co,t.fixIE?'mousedown':'click',function(e){var m;e=e.target;if(e&&(e=DOM.getParent(e,'TR'))&&!DOM.hasClass(e,cp+'ItemSub')){m=t.items[e.id];if(m.isDisabled())return;dm=t;DOM.win.setTimeout(function(){while(dm){if(dm.hideMenu)dm.hideMenu();dm=dm.settings.parent;}},0);if(m.settings.onclick)m.settings.onclick(e);return Event.cancel(e);}});if(t.hasMenus()){t.mouseOverFunc=Event.add(co,'mouseover',function(e){var m,r,mi;e=e.target;if(e&&(e=DOM.getParent(e,'TR'))){m=t.items[e.id];if(t.lastMenu)t.lastMenu.collapse(1);if(m.isDisabled())return;if(e&&DOM.hasClass(e,cp+'ItemSub')){r=DOM.getRect(e);m.showMenu((r.x+r.w-ot),r.y-ot,r.x);t.lastMenu=m;DOM.addClass(DOM.get(m.id).firstChild,cp+'ItemActive');}}});}t.onShowMenu.dispatch(t);if(s.keyboard_focus){Event.add(co,'keydown',t._keyHandler,t);DOM.select('a','menu_'+t.id)[0].focus();}},hideMenu:function(c){var t=this,co=DOM.get('menu_'+t.id),e;if(!t.isMenuVisible)return;Event.remove(co,'mouseover',t.mouseOverFunc);Event.remove(co,t.fixIE?'mousedown':'click',t.mouseClickFunc);Event.remove(co,'keydown',t._keyHandler);DOM.hide(co);t.isMenuVisible=0;if(!c)t.collapse(1);if(t.element)t.element.hide();if(e=DOM.get(t.id))DOM.removeClass(e.firstChild,t.classPrefix+'ItemActive');t.onHideMenu.dispatch(t);},add:function(o){var t=this,co;o=t.parent(o);if(t.isRendered&&(co=DOM.get('menu_'+t.id)))t._add(DOM.select('tbody',co)[0],o);return o;},collapse:function(d){this.parent(d);this.hideMenu(1);},remove:function(o){DOM.remove(o.id);this.destroy();return this.parent(o);},destroy:function(){var t=this,co=DOM.get('menu_'+t.id);Event.remove(co,'mouseover',t.mouseOverFunc);Event.remove(co,'click',t.mouseClickFunc);if(t.element)t.element.remove();DOM.remove(co);},renderNode:function(){var t=this,s=t.settings,n,tb,co,w;w=DOM.create('div',{id:'menu_'+t.id,'class':s['class'],'style':'position:absolute;left:0;top:0;z-index:200000'});co=DOM.add(w,'div',{id:'menu_'+t.id+'_co','class':t.classPrefix+(s['class']?' '+s['class']:'')});t.element=new Element('menu_'+t.id,{blocker:1,container:s.container});if(s.menu_line)DOM.add(co,'span',{'class':t.classPrefix+'Line'});n=DOM.add(co,'table',{id:'menu_'+t.id+'_tbl',border:0,cellPadding:0,cellSpacing:0});tb=DOM.add(n,'tbody');each(t.items,function(o){t._add(tb,o);});t.rendered=true;return w;},_keyHandler:function(e){if(e.keyCode==27)this.hideMenu();},_add:function(tb,o){var n,s=o.settings,a,ro,it,cp=this.classPrefix;if(s.separator){ro=DOM.add(tb,'tr',{id:o.id,'class':cp+'ItemSeparator'});DOM.add(ro,'td',{'class':cp+'ItemSeparator'});if(n=ro.previousSibling)DOM.addClass(n,'mceLast');return;}n=ro=DOM.add(tb,'tr',{id:o.id,'class':cp+'Item '+cp+'ItemEnabled'});n=it=DOM.add(n,'td');n=a=DOM.add(n,'a',{href:'javascript:;',onclick:"return false;",onmousedown:'return false;'});DOM.addClass(it,s['class']);DOM.add(n,'span',{'class':'mceIcon'+(s.icon?' mce_'+s.icon:'')});n=DOM.add(n,s.element||'span',{'class':'mceText',title:o.settings.title},o.settings.title);if(o.settings.style)DOM.setAttrib(n,'style',o.settings.style);if(tb.childNodes.length==1)DOM.addClass(ro,'mceFirst');if((n=ro.previousSibling)&&DOM.hasClass(n,cp+'ItemSeparator'))DOM.addClass(ro,'mceFirst');if(o.collapse)DOM.addClass(ro,cp+'ItemSub');if(n=ro.previousSibling)DOM.removeClass(n,'mceLast');DOM.addClass(ro,'mceLast');}});})();(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.ui.Button:tinymce.ui.Control',{Button:function(id,s){this.parent(id,s);this.classPrefix='mceButton';},renderHTML:function(){var cp=this.classPrefix,s=this.settings,h,l;l=DOM.encode(s.label||'');h='<a id="'+this.id+'" href="javascript:;" class="'+cp+' '+cp+'Enabled '+s['class']+(l?' '+cp+'Labeled':'')+'" onmousedown="return false;" onclick="return false;" title="'+DOM.encode(s.title)+'">';if(s.image)h+='<img class="mceIcon" src="'+s.image+'" />'+l+'</a>';else h+='<span class="mceIcon '+s['class']+'"></span>'+(l?'<span class="'+cp+'Label">'+l+'</span>':'')+'</a>';return h;},postRender:function(){var t=this,s=t.settings;tinymce.dom.Event.add(t.id,'click',function(e){if(!t.isDisabled())return s.onclick.call(s.scope,e);});}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher;tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control',{ListBox:function(id,s){var t=this;t.parent(id,s);t.items=[];t.onChange=new Dispatcher(t);t.onPostRender=new Dispatcher(t);t.onAdd=new Dispatcher(t);t.onRenderMenu=new tinymce.util.Dispatcher(this);t.classPrefix='mceListBox';},select:function(v){var t=this,e,fv;if(v!=t.selectedValue){e=DOM.get(t.id+'_text');t.selectedValue=v;each(t.items,function(o){if(o.value==v){DOM.setHTML(e,DOM.encode(o.title));fv=1;return false;}});if(!fv){DOM.setHTML(e,DOM.encode(t.settings.title));DOM.addClass(e,'mceTitle');e=0;return;}else DOM.removeClass(e,'mceTitle');}e=0;},add:function(n,v,o){var t=this;o=o||{};o=tinymce.extend(o,{title:n,value:v});t.items.push(o);t.onAdd.dispatch(t,o);},getLength:function(){return this.items.length;},renderHTML:function(){var h='',t=this,s=t.settings,cp=t.classPrefix;h='<table id="'+t.id+'" cellpadding="0" cellspacing="0" class="'+cp+' '+cp+'Enabled'+(s['class']?(' '+s['class']):'')+'"><tbody><tr>';h+='<td>'+DOM.createHTML('a',{id:t.id+'_text',href:'javascript:;','class':'mceText',onclick:"return false;",onmousedown:'return false;'},DOM.encode(t.settings.title))+'</td>';h+='<td>'+DOM.createHTML('a',{id:t.id+'_open',tabindex:-1,href:'javascript:;','class':'mceOpen',onclick:"return false;",onmousedown:'return false;'},'<span></span>')+'</td>';h+='</tr></tbody></table>';return h;},showMenu:function(){var t=this,p1,p2,e=DOM.get(this.id),m;if(t.isDisabled()||t.items.length==0)return;if(t.menu&&t.menu.isMenuVisible)return t.hideMenu();if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}p1=DOM.getPos(this.settings.menu_container);p2=DOM.getPos(e);m=t.menu;m.settings.offset_x=p2.x;m.settings.offset_y=p2.y;m.settings.keyboard_focus=t._focused;if(t.oldID)m.items[t.oldID].setSelected(0);each(t.items,function(o){if(o.value===t.selectedValue){m.items[o.id].setSelected(1);t.oldID=o.id;}});m.showMenu(0,e.clientHeight);Event.add(DOM.doc,'mousedown',t.hideMenu,t);DOM.addClass(t.id,t.classPrefix+'Selected');},hideMenu:function(e){var t=this;if(e&&e.type=="mousedown"&&(e.target.id==t.id+'_text'||e.target.id==t.id+'_open'))return;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceMenu');})){DOM.removeClass(t.id,t.classPrefix+'Selected');Event.remove(DOM.doc,'mousedown',t.hideMenu,t);if(t.menu)t.menu.hideMenu();}},renderMenu:function(){var t=this,m;m=t.settings.control_manager.createDropMenu(t.id+'_menu',{menu_line:1,'class':t.classPrefix+'Menu mceNoIcons',max_width:150,max_height:150});m.onHideMenu.add(t.hideMenu,t);m.add({title:t.settings.title,'class':'mceMenuItemTitle'}).setDisabled(1);each(t.items,function(o){o.id=DOM.uniqueId();o.onclick=function(){if(t.settings.onselect(o.value)!==false)t.select(o.value);};m.add(o);});t.onRenderMenu.dispatch(t,m);t.menu=m;},postRender:function(){var t=this,cp=t.classPrefix;Event.add(t.id,'click',t.showMenu,t);Event.add(t.id+'_text','focus',function(){t._focused=1;});Event.add(t.id+'_text','blur',function(){t._focused=0;});if(tinymce.isIE6||!DOM.boxModel){Event.add(t.id,'mouseover',function(){if(!DOM.hasClass(t.id,cp+'Disabled'))DOM.addClass(t.id,cp+'Hover');});Event.add(t.id,'mouseout',function(){if(!DOM.hasClass(t.id,cp+'Disabled'))DOM.removeClass(t.id,cp+'Hover');});}t.onPostRender.dispatch(t,DOM.get(t.id));},destroy:function(){this.parent();Event.clear(this.id+'_text');}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher;tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox',{NativeListBox:function(id,s){this.parent(id,s);this.classPrefix='mceNativeListBox';},setDisabled:function(s){DOM.get(this.id).disabled=s;},isDisabled:function(){return DOM.get(this.id).disabled;},select:function(v){var e=DOM.get(this.id),ol=e.options;v=''+(v||'');e.selectedIndex=0;each(ol,function(o,i){if(o.value==v){e.selectedIndex=i;return false;}});},add:function(n,v,a){var o,t=this;a=a||{};a.value=v;if(t.isRendered())DOM.add(DOM.get(this.id),'option',a,n);o={title:n,value:v,attribs:a};t.items.push(o);t.onAdd.dispatch(t,o);},getLength:function(){return DOM.get(this.id).options.length-1;},renderHTML:function(){var h,t=this;h=DOM.createHTML('option',{value:''},'-- '+t.settings.title+' --');each(t.items,function(it){h+=DOM.createHTML('option',{value:it.value},it.title);});h=DOM.createHTML('select',{id:t.id,'class':'mceNativeListBox'},h);return h;},postRender:function(){var t=this,ch;t.rendered=true;function onChange(e){var v=e.target.options[e.target.selectedIndex].value;t.onChange.dispatch(t,v);if(t.settings.onselect)t.settings.onselect(v);};Event.add(t.id,'change',onChange);Event.add(t.id,'keydown',function(e){var bf;Event.remove(t.id,'change',ch);bf=Event.add(t.id,'blur',function(){Event.add(t.id,'change',onChange);Event.remove(t.id,'blur',bf);});if(e.keyCode==13||e.keyCode==32){onChange(e);return Event.cancel(e);}});t.onPostRender.dispatch(t,DOM.get(t.id));}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each;tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button',{MenuButton:function(id,s){this.parent(id,s);this.onRenderMenu=new tinymce.util.Dispatcher(this);s.menu_container=s.menu_container||DOM.doc.body;},showMenu:function(){var t=this,p1,p2,e=DOM.get(t.id),m;if(t.isDisabled())return;if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}if(t.isMenuVisible)return t.hideMenu();p1=DOM.getPos(t.settings.menu_container);p2=DOM.getPos(e);m=t.menu;m.settings.offset_x=p2.x;m.settings.offset_y=p2.y;m.settings.vp_offset_x=p2.x;m.settings.vp_offset_y=p2.y;m.settings.keyboard_focus=t._focused;m.showMenu(0,e.clientHeight);Event.add(DOM.doc,'mousedown',t.hideMenu,t);t.setState('Selected',1);t.isMenuVisible=1;},renderMenu:function(){var t=this,m;m=t.settings.control_manager.createDropMenu(t.id+'_menu',{menu_line:1,'class':this.classPrefix+'Menu',icons:t.settings.icons});m.onHideMenu.add(t.hideMenu,t);t.onRenderMenu.dispatch(t,m);t.menu=m;},hideMenu:function(e){var t=this;if(e&&e.type=="mousedown"&&DOM.getParent(e.target,function(e){return e.id===t.id||e.id===t.id+'_open';}))return;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceMenu');})){t.setState('Selected',0);Event.remove(DOM.doc,'mousedown',t.hideMenu,t);if(t.menu)t.menu.hideMenu();}t.isMenuVisible=0;},postRender:function(){var t=this,s=t.settings;Event.add(t.id,'click',function(){if(!t.isDisabled()){if(s.onclick)s.onclick(t.value);t.showMenu();}});}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each;tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton',{SplitButton:function(id,s){this.parent(id,s);this.classPrefix='mceSplitButton';},renderHTML:function(){var h,t=this,s=t.settings,h1;h='<tbody><tr>';if(s.image)h1=DOM.createHTML('img ',{src:s.image,'class':'mceAction '+s['class']});else h1=DOM.createHTML('span',{'class':'mceAction '+s['class']},'');h+='<td>'+DOM.createHTML('a',{id:t.id+'_action',href:'javascript:;','class':'mceAction '+s['class'],onclick:"return false;",onmousedown:'return false;',title:s.title},h1)+'</td>';h1=DOM.createHTML('span',{'class':'mceOpen '+s['class']});h+='<td>'+DOM.createHTML('a',{id:t.id+'_open',href:'javascript:;','class':'mceOpen '+s['class'],onclick:"return false;",onmousedown:'return false;',title:s.title},h1)+'</td>';h+='</tr></tbody>';return DOM.createHTML('table',{id:t.id,'class':'mceSplitButton mceSplitButtonEnabled '+s['class'],cellpadding:'0',cellspacing:'0',onmousedown:'return false;',title:s.title},h);},postRender:function(){var t=this,s=t.settings;if(s.onclick){Event.add(t.id+'_action','click',function(){if(!t.isDisabled())s.onclick(t.value);});}Event.add(t.id+'_open','click',t.showMenu,t);Event.add(t.id+'_open','focus',function(){t._focused=1;});Event.add(t.id+'_open','blur',function(){t._focused=0;});if(tinymce.isIE6||!DOM.boxModel){Event.add(t.id,'mouseover',function(){if(!DOM.hasClass(t.id,'mceSplitButtonDisabled'))DOM.addClass(t.id,'mceSplitButtonHover');});Event.add(t.id,'mouseout',function(){if(!DOM.hasClass(t.id,'mceSplitButtonDisabled'))DOM.removeClass(t.id,'mceSplitButtonHover');});}},destroy:function(){this.parent();Event.clear(this.id+'_action');Event.clear(this.id+'_open');}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,is=tinymce.is,each=tinymce.each;tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton',{ColorSplitButton:function(id,s){var t=this;t.parent(id,s);t.settings=s=tinymce.extend({colors:'000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF',grid_width:8,default_color:'#888888'},t.settings);t.value=s.default_color;},showMenu:function(){var t=this,r,p,e,p2;if(t.isDisabled())return;if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}if(t.isMenuVisible)return t.hideMenu();e=DOM.get(t.id);DOM.show(t.id+'_menu');DOM.addClass(e,'mceSplitButtonSelected');p2=DOM.getPos(e);DOM.setStyles(t.id+'_menu',{left:p2.x,top:p2.y+e.clientHeight,zIndex:200000});e=0;Event.add(DOM.doc,'mousedown',t.hideMenu,t);if(t._focused){t._keyHandler=Event.add(t.id+'_menu','keydown',function(e){if(e.keyCode==27)t.hideMenu();});DOM.select('a',t.id+'_menu')[0].focus();}t.isMenuVisible=1;},hideMenu:function(e){var t=this;if(e&&e.type=="mousedown"&&DOM.getParent(e.target,function(e){return e.id===t.id+'_open';}))return;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceSplitButtonMenu');})){DOM.removeClass(t.id,'mceSplitButtonSelected');Event.remove(DOM.doc,'mousedown',t.hideMenu,t);Event.remove(t.id+'_menu','keydown',t._keyHandler);DOM.hide(t.id+'_menu');}t.isMenuVisible=0;},renderMenu:function(){var t=this,m,i=0,s=t.settings,n,tb,tr,w;w=DOM.add(s.menu_container,'div',{id:t.id+'_menu','class':s['menu_class']+' '+s['class'],style:'position:absolute;left:0;top:-1000px;'});m=DOM.add(w,'div',{'class':s['class']+' mceSplitButtonMenu'});DOM.add(m,'span',{'class':'mceMenuLine'});n=DOM.add(m,'table',{'class':'mceColorSplitMenu'});tb=DOM.add(n,'tbody');i=0;each(is(s.colors,'array')?s.colors:s.colors.split(','),function(c){c=c.replace(/^#/,'');if(!i--){tr=DOM.add(tb,'tr');i=s.grid_width-1;}n=DOM.add(tr,'td');n=DOM.add(n,'a',{href:'javascript:;',style:{backgroundColor:'#'+c},mce_color:'#'+c});});if(s.more_colors_func){n=DOM.add(tb,'tr');n=DOM.add(n,'td',{colspan:s.grid_width,'class':'mceMoreColors'});n=DOM.add(n,'a',{id:t.id+'_more',href:'javascript:;',onclick:'return false;','class':'mceMoreColors'},s.more_colors_title);Event.add(n,'click',function(e){s.more_colors_func.call(s.more_colors_scope||this);return Event.cancel(e);});}DOM.addClass(m,'mceColorSplitMenu');Event.add(t.id+'_menu','click',function(e){var c;e=e.target;if(e.nodeName=='A'&&(c=e.getAttribute('mce_color')))t.setColor(c);});return w;},setColor:function(c){var t=this;DOM.setStyle(t.id+'_preview','backgroundColor',c);t.value=c;t.hideMenu();t.settings.onselect(c);},postRender:function(){var t=this,id=t.id;t.parent();DOM.add(id+'_action','div',{id:id+'_preview','class':'mceColorPreview'});},destroy:function(){this.parent();Event.clear(this.id+'_menu');Event.clear(this.id+'_more');DOM.remove(this.id+'_menu');}});})();tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container',{renderHTML:function(){var t=this,h='',c,co,dom=tinymce.DOM,s=t.settings,i,pr,nx,cl;cl=t.controls;for(i=0;i<cl.length;i++){co=cl[i];pr=cl[i-1];nx=cl[i+1];if(i===0){c='mceToolbarStart';if(co.Button)c+=' mceToolbarStartButton';else if(co.SplitButton)c+=' mceToolbarStartSplitButton';else if(co.ListBox)c+=' mceToolbarStartListBox';h+=dom.createHTML('td',{'class':c},dom.createHTML('span',null,'<!-- IE -->'));}if(pr&&co.ListBox){if(pr.Button||pr.SplitButton)h+=dom.createHTML('td',{'class':'mceToolbarEnd'},dom.createHTML('span',null,'<!-- IE -->'));}if(dom.stdMode)h+='<td style="position: relative">'+co.renderHTML()+'</td>';else h+='<td>'+co.renderHTML()+'</td>';if(nx&&co.ListBox){if(nx.Button||nx.SplitButton)h+=dom.createHTML('td',{'class':'mceToolbarStart'},dom.createHTML('span',null,'<!-- IE -->'));}}c='mceToolbarEnd';if(co.Button)c+=' mceToolbarEndButton';else if(co.SplitButton)c+=' mceToolbarEndSplitButton';else if(co.ListBox)c+=' mceToolbarEndListBox';h+=dom.createHTML('td',{'class':c},dom.createHTML('span',null,'<!-- IE -->'));return dom.createHTML('table',{id:t.id,'class':'mceToolbar'+(s['class']?' '+s['class']:''),cellpadding:'0',cellspacing:'0',align:t.settings.align||''},'<tbody><tr>'+h+'</tr></tbody>');}});(function(){var Dispatcher=tinymce.util.Dispatcher,each=tinymce.each;tinymce.create('tinymce.AddOnManager',{items:[],urls:{},lookup:{},onAdd:new Dispatcher(this),get:function(n){return this.lookup[n];},requireLangPack:function(n){var u,s;if(tinymce.EditorManager.settings){u=this.urls[n]+'/langs/'+tinymce.EditorManager.settings.language+'.js';s=tinymce.EditorManager.settings;if(s){if(!tinymce.dom.Event.domLoaded&&!s.strict_mode)tinymce.ScriptLoader.load(u);else tinymce.ScriptLoader.add(u);}}},add:function(id,o){this.items.push(o);this.lookup[id]=o;this.onAdd.dispatch(this,id,o);return o;},load:function(n,u,cb,s){var t=this;if(t.urls[n])return;if(u.indexOf('/')!=0&&u.indexOf('://')==-1)u=tinymce.baseURL+'/'+u;t.urls[n]=u.substring(0,u.lastIndexOf('/'));tinymce.ScriptLoader.add(u,cb,s);}});tinymce.PluginManager=new tinymce.AddOnManager();tinymce.ThemeManager=new tinymce.AddOnManager();}());(function(){var each=tinymce.each,extend=tinymce.extend,DOM=tinymce.DOM,Event=tinymce.dom.Event,ThemeManager=tinymce.ThemeManager,PluginManager=tinymce.PluginManager,explode=tinymce.explode;tinymce.create('static tinymce.EditorManager',{editors:{},i18n:{},activeEditor:null,preInit:function(){var t=this,lo=window.location;tinymce.documentBaseURL=lo.href.replace(/[\?#].*$/,'').replace(/[\/\\][^\/]+$/,'');if(!/[\/\\]$/.test(tinymce.documentBaseURL))tinymce.documentBaseURL+='/';tinymce.baseURL=new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);tinymce.EditorManager.baseURI=new tinymce.util.URI(tinymce.baseURL);if(tinymce.EditorManager.baseURI.host!=lo.hostname&&lo.hostname)document.domain=tinymce.relaxedDomain=lo.hostname.replace(/.*\.(.+\..+)$/,'$1');t.onBeforeUnload=new tinymce.util.Dispatcher(t);Event.add(window,'beforeunload',function(e){t.onBeforeUnload.dispatch(t,e);});},init:function(s){var t=this,pl,sl=tinymce.ScriptLoader,c,e;function execCallback(se,n,s){var f=se[n];if(!f)return;if(tinymce.is(f,'string')){s=f.replace(/\.\w+$/,'');s=s?tinymce.resolve(s):0;f=tinymce.resolve(f);}return f.apply(s||this,Array.prototype.slice.call(arguments,2));};s=extend({theme:"simple",language:"en",strict_loading_mode:document.contentType=='application/xhtml+xml'},s);t.settings=s;if(!Event.domLoaded&&!s.strict_loading_mode){if(s.language)sl.add(tinymce.baseURL+'/langs/'+s.language+'.js');if(s.theme&&s.theme.charAt(0)!='-'&&!ThemeManager.urls[s.theme])ThemeManager.load(s.theme,'themes/'+s.theme+'/editor_template'+tinymce.suffix+'.js');if(s.plugins){pl=explode(s.plugins);if(tinymce.inArray(pl,'compat2x')!=-1)PluginManager.load('compat2x','plugins/compat2x/editor_plugin'+tinymce.suffix+'.js');each(pl,function(v){if(v&&v.charAt(0)!='-'&&!PluginManager.urls[v]){if(!tinymce.isWebKit&&v=='safari')return;PluginManager.load(v,'plugins/'+v+'/editor_plugin'+tinymce.suffix+'.js');}});}sl.loadQueue();}Event.add(document,'init',function(){var l,co;execCallback(s,'onpageload');if(s.browsers){l=false;each(explode(s.browsers),function(v){switch(v){case'ie':case'msie':if(tinymce.isIE)l=true;break;case'gecko':if(tinymce.isGecko)l=true;break;case'safari':case'webkit':if(tinymce.isWebKit)l=true;break;case'opera':if(tinymce.isOpera)l=true;break;}});if(!l)return;}switch(s.mode){case"exact":l=s.elements||'';if(l.length>0){each(explode(l),function(v){if(DOM.get(v))new tinymce.Editor(v,s).render(1);else{c=0;each(document.forms,function(f){each(f.elements,function(e){if(e.name===v){v='mce_editor_'+c;DOM.setAttrib(e,'id',v);new tinymce.Editor(v,s).render(1);}});});}});}break;case"textareas":case"specific_textareas":function hasClass(n,c){return new RegExp('\\b'+c+'\\b','g').test(n.className);};each(DOM.select('textarea'),function(v){if(s.editor_deselector&&hasClass(v,s.editor_deselector))return;if(!s.editor_selector||hasClass(v,s.editor_selector)){e=DOM.get(v.name);if(!v.id&&!e)v.id=v.name;if(!v.id||t.get(v.id))v.id=DOM.uniqueId();new tinymce.Editor(v.id,s).render(1);}});break;}if(s.oninit){l=co=0;each(t.editors,function(ed){co++;if(!ed.initialized){ed.onInit.add(function(){l++;if(l==co)execCallback(s,'oninit');});}else l++;if(l==co)execCallback(s,'oninit');});}});},get:function(id){return this.editors[id];},getInstanceById:function(id){return this.get(id);},add:function(e){this.editors[e.id]=e;this._setActive(e);return e;},remove:function(e){var t=this;if(!t.editors[e.id])return null;delete t.editors[e.id];if(t.activeEditor==e){each(t.editors,function(e){t._setActive(e);return false;});}e.destroy();return e;},execCommand:function(c,u,v){var t=this,ed=t.get(v),w;switch(c){case"mceFocus":ed.focus();return true;case"mceAddEditor":case"mceAddControl":if(!t.get(v))new tinymce.Editor(v,t.settings).render();return true;case"mceAddFrameControl":w=v.window;w.tinyMCE=tinyMCE;w.tinymce=tinymce;tinymce.DOM.doc=w.document;tinymce.DOM.win=w;ed=new tinymce.Editor(v.element_id,v);ed.render();if(tinymce.isIE){function clr(){ed.destroy();w.detachEvent('onunload',clr);w=w.tinyMCE=w.tinymce=null;};w.attachEvent('onunload',clr);}v.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":ed.remove();return true;case'mceToggleEditor':if(!ed){t.execCommand('mceAddControl',0,v);return true;}if(ed.isHidden())ed.show();else ed.hide();return true;}if(t.activeEditor)return t.activeEditor.execCommand(c,u,v);return false;},execInstanceCommand:function(id,c,u,v){var ed=this.get(id);if(ed)return ed.execCommand(c,u,v);return false;},triggerSave:function(){each(this.editors,function(e){e.save();});},addI18n:function(p,o){var lo,i18n=this.i18n;if(!tinymce.is(p,'string')){each(p,function(o,lc){each(o,function(o,g){each(o,function(o,k){if(g==='common')i18n[lc+'.'+k]=o;else i18n[lc+'.'+g+'.'+k]=o;});});});}else{each(o,function(o,k){i18n[p+'.'+k]=o;});}},_setActive:function(e){this.selectedInstance=this.activeEditor=e;}});tinymce.EditorManager.preInit();})();var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,Dispatcher=tinymce.util.Dispatcher;var each=tinymce.each,isGecko=tinymce.isGecko,isIE=tinymce.isIE,isWebKit=tinymce.isWebKit;var is=tinymce.is,ThemeManager=tinymce.ThemeManager,PluginManager=tinymce.PluginManager,EditorManager=tinymce.EditorManager;var inArray=tinymce.inArray,grep=tinymce.grep,explode=tinymce.explode;tinymce.create('tinymce.Editor',{Editor:function(id,s){var t=this;t.id=t.editorId=id;t.execCommands={};t.queryStateCommands={};t.queryValueCommands={};t.plugins={};each(['onPreInit','onBeforeRenderUI','onPostRender','onInit','onRemove','onActivate','onDeactivate','onClick','onEvent','onMouseUp','onMouseDown','onDblClick','onKeyDown','onKeyUp','onKeyPress','onContextMenu','onSubmit','onReset','onPaste','onPreProcess','onPostProcess','onBeforeSetContent','onBeforeGetContent','onSetContent','onGetContent','onLoadContent','onSaveContent','onNodeChange','onChange','onBeforeExecCommand','onExecCommand','onUndo','onRedo','onVisualAid','onSetProgressState'],function(e){t[e]=new Dispatcher(t);});t.settings=s=extend({id:id,language:'en',docs_language:'en',theme:'simple',skin:'default',delta_width:0,delta_height:0,popup_css:'',plugins:'',document_base_url:tinymce.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',visual_table_class:'mceItemTable',visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:'xx-small,x-small,small,medium,large,x-large,xx-large',apply_source_formatting:1,directionality:'ltr',forced_root_block:'p',valid_elements:'@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote,-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value|_value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big',hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:'30px'},s);t.documentBaseURI=new tinymce.util.URI(s.document_base_url||tinymce.documentBaseURL,{base_uri:tinyMCE.baseURI});t.baseURI=EditorManager.baseURI;t.execCallback('setup',t);},render:function(nst){var t=this,s=t.settings,id=t.id,sl=tinymce.ScriptLoader;if(!Event.domLoaded){Event.add(document,'init',function(){t.render();});return;}if(!nst){s.strict_loading_mode=1;tinyMCE.settings=s;}if(!t.getElement())return;if(s.strict_loading_mode){sl.settings.strict_mode=s.strict_loading_mode;tinymce.DOM.settings.strict=1;}if(!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&s.hidden_input&&DOM.getParent(id,'form'))DOM.insertAfter(DOM.create('input',{type:'hidden',name:id}),id);t.windowManager=new tinymce.WindowManager(t);if(s.encoding=='xml'){t.onGetContent.add(function(ed,o){if(o.get)o.content=DOM.encode(o.content);});}if(s.add_form_submit_trigger){t.onSubmit.addToTop(function(){if(t.initialized){t.save();t.isNotDirty=1;}});}if(s.add_unload_trigger){t._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(t.initialized&&!t.destroyed&&!t.isHidden())t.save({format:'raw',no_events:true});});}tinymce.addUnload(t.destroy,t);if(s.submit_patch){t.onBeforeRenderUI.add(function(){var n=t.getElement().form;if(!n)return;if(n._mceOldSubmit)return;if(!n.submit.nodeType&&!n.submit.length){t.formElement=n;n._mceOldSubmit=n.submit;n.submit=function(){EditorManager.triggerSave();t.isNotDirty=1;return this._mceOldSubmit(this);};}n=null;});}function loadScripts(){if(s.language)sl.add(tinymce.baseURL+'/langs/'+s.language+'.js');if(s.theme.charAt(0)!='-'&&!ThemeManager.urls[s.theme])ThemeManager.load(s.theme,'themes/'+s.theme+'/editor_template'+tinymce.suffix+'.js');each(explode(s.plugins),function(p){if(p&&p.charAt(0)!='-'&&!PluginManager.urls[p]){if(!isWebKit&&p=='safari')return;PluginManager.load(p,'plugins/'+p+'/editor_plugin'+tinymce.suffix+'.js');}});sl.loadQueue(function(){if(s.ask){function ask(){t.windowManager.confirm(t.getLang('edit_confirm'),function(s){if(s)t.init();else Event.remove(t.id,'focus',ask);});};Event.add(t.id,'focus',ask);return;}if(!t.removed)t.init();});};if(s.plugins.indexOf('compat2x')!=-1){PluginManager.load('compat2x','plugins/compat2x/editor_plugin'+tinymce.suffix+'.js');sl.loadQueue(loadScripts);}else loadScripts();},init:function(){var n,t=this,s=t.settings,w,h,e=t.getElement(),o,ti,u,bi,bc,re;EditorManager.add(t);s.theme=s.theme.replace(/-/,'');o=ThemeManager.get(s.theme);t.theme=new o();if(t.theme.init&&s.init_theme)t.theme.init(t,ThemeManager.urls[s.theme]||tinymce.documentBaseURL.replace(/\/$/,''));each(explode(s.plugins.replace(/\-/g,'')),function(p){var c=PluginManager.get(p),u=PluginManager.urls[p]||tinymce.documentBaseURL.replace(/\/$/,''),po;if(c){po=new c(t,u);t.plugins[p]=po;if(po.init)po.init(t,u);}});if(s.popup_css)s.popup_css=t.documentBaseURI.toAbsolute(s.popup_css);else s.popup_css=t.baseURI.toAbsolute("themes/"+s.theme+"/skins/"+s.skin+"/dialog.css");if(s.popup_css_add)s.popup_css+=','+t.documentBaseURI.toAbsolute(s.popup_css_add);t.controlManager=new tinymce.ControlManager(t);t.undoManager=new tinymce.UndoManager(t);t.undoManager.onAdd.add(function(um,l){return t.onChange.dispatch(t,l,um);});t.undoManager.onUndo.add(function(um,l){return t.onUndo.dispatch(t,l,um);});t.undoManager.onRedo.add(function(um,l){return t.onRedo.dispatch(t,l,um);});if(s.custom_undo_redo){t.onExecCommand.add(function(ed,cmd,ui,val,a){if(cmd!='Undo'&&cmd!='Redo'&&cmd!='mceRepaint'&&(!a||!a.skip_undo))t.undoManager.add();});}t.onExecCommand.add(function(ed,c){if(!/^(FontName|FontSize)$/.test(c))t.nodeChanged();});if(isGecko){function repaint(a,o){if(!o||!o.initial)t.execCommand('mceRepaint');};t.onUndo.add(repaint);t.onRedo.add(repaint);t.onSetContent.add(repaint);}t.onBeforeRenderUI.dispatch(t,t.controlManager);if(s.render_ui){w=s.width||e.style.width||e.clientWidth;h=s.height||e.style.height||e.clientHeight;t.orgDisplay=e.style.display;re=/^[0-9\.]+(|px)$/i;if(re.test(''+w))w=Math.max(parseInt(w)+(o.deltaWidth||0),100);if(re.test(''+h))h=Math.max(parseInt(h)+(o.deltaHeight||0),100);o=t.theme.renderUI({targetNode:e,width:w,height:h,deltaWidth:s.delta_width,deltaHeight:s.delta_height});t.editorContainer=o.editorContainer;}DOM.setStyles(o.sizeContainer||o.editorContainer,{width:w,height:h});h=(o.iframeHeight||h)+((h+'').indexOf('%')==-1?(o.deltaHeight||0):'');if(h<100)h=100;t.iframeHTML=s.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+t.documentBaseURI.getURI()+'"></base>';t.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(tinymce.relaxedDomain)t.iframeHTML+='<script type="text/javascript">document.domain = "'+tinymce.relaxedDomain+'";</script>';bi=s.body_id||'tinymce';if(bi.indexOf('=')!=-1){bi=t.getParam('body_id','','hash');bi=bi[t.id]||bi;}bc=s.body_class||'';if(bc.indexOf('=')!=-1){bc=t.getParam('body_class','','hash');bc=bc[t.id]||'';}t.iframeHTML+='</head><body id="'+bi+'" class="mceContentBody '+bc+'"></body></html>';if(tinymce.relaxedDomain){if(isIE)u='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()';else if(tinymce.isOpera)u='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()';}n=DOM.add(o.iframeContainer,'iframe',{id:t.id+"_ifr",src:u||'javascript:""',frameBorder:'0',style:{width:'100%',height:h}});t.contentAreaContainer=o.iframeContainer;DOM.get(o.editorContainer).style.display=t.orgDisplay;DOM.get(t.id).style.display='none';if(tinymce.isOldWebKit){Event.add(n,'load',t.setupIframe,t);n.src=tinymce.baseURL+'/plugins/safari/blank.htm';}else{if(!isIE||!tinymce.relaxedDomain)t.setupIframe();e=n=o=null;}},setupIframe:function(){var t=this,s=t.settings,e=DOM.get(t.id),d=t.getDoc(),h,b;if(!isIE||!tinymce.relaxedDomain){d.open();d.write(t.iframeHTML);d.close();}if(!isIE){try{d.designMode='On';}catch(ex){}}if(isIE){b=t.getBody();DOM.hide(b);b.contentEditable=true;DOM.show(b);}t.dom=new tinymce.DOM.DOMUtils(t.getDoc(),{keep_values:true,url_converter:t.convertURL,url_converter_scope:t,hex_colors:s.force_hex_style_colors,class_filter:s.class_filter,update_styles:1,fix_ie_paragraphs:1});t.serializer=new tinymce.dom.Serializer({entity_encoding:s.entity_encoding,entities:s.entities,valid_elements:s.verify_html===false?'*[*]':s.valid_elements,extended_valid_elements:s.extended_valid_elements,valid_child_elements:s.valid_child_elements,invalid_elements:s.invalid_elements,fix_table_elements:s.fix_table_elements,fix_list_elements:s.fix_list_elements,fix_content_duplication:s.fix_content_duplication,convert_fonts_to_spans:s.convert_fonts_to_spans,font_size_classes:s.font_size_classes,font_size_style_values:s.font_size_style_values,apply_source_formatting:s.apply_source_formatting,remove_linebreaks:s.remove_linebreaks,dom:t.dom});t.selection=new tinymce.dom.Selection(t.dom,t.getWin(),t.serializer);t.forceBlocks=new tinymce.ForceBlocks(t,{forced_root_block:s.forced_root_block});t.editorCommands=new tinymce.EditorCommands(t);t.serializer.onPreProcess.add(function(se,o){return t.onPreProcess.dispatch(t,o,se);});t.serializer.onPostProcess.add(function(se,o){return t.onPostProcess.dispatch(t,o,se);});t.onPreInit.dispatch(t);if(!s.gecko_spellcheck)t.getBody().spellcheck=0;t._addEvents();t.controlManager.onPostRender.dispatch(t,t.controlManager);t.onPostRender.dispatch(t);if(s.directionality)t.getBody().dir=s.directionality;if(s.nowrap)t.getBody().style.whiteSpace="nowrap";if(s.auto_resize)t.onNodeChange.add(t.resizeToContent,t);if(s.custom_elements){function handleCustom(ed,o){each(explode(s.custom_elements),function(v){var n;if(v.indexOf('~')===0){v=v.substring(1);n='span';}else n='div';o.content=o.content.replace(new RegExp('<('+v+')([^>]*)>','g'),'<'+n+' mce_name="$1"$2>');o.content=o.content.replace(new RegExp('</('+v+')>','g'),'</'+n+'>');});};t.onBeforeSetContent.add(handleCustom);t.onPostProcess.add(function(ed,o){if(o.set)handleCustom(ed,o)});}if(s.handle_node_change_callback){t.onNodeChange.add(function(ed,cm,n){t.execCallback('handle_node_change_callback',t.id,n,-1,-1,true,t.selection.isCollapsed());});}if(s.save_callback){t.onSaveContent.add(function(ed,o){var h=t.execCallback('save_callback',t.id,o.content,t.getBody());if(h)o.content=h;});}if(s.onchange_callback){t.onChange.add(function(ed,l){t.execCallback('onchange_callback',t,l);});}if(s.convert_newlines_to_brs){t.onBeforeSetContent.add(function(ed,o){if(o.initial)o.content=o.content.replace(/\r?\n/g,'<br />');});}if(s.fix_nesting&&isIE){t.onBeforeSetContent.add(function(ed,o){o.content=t._fixNesting(o.content);});}if(s.preformatted){t.onPostProcess.add(function(ed,o){o.content=o.content.replace(/^\s*<pre.*?>/,'');o.content=o.content.replace(/<\/pre>\s*$/,'');if(o.set)o.content='<pre class="mceItemHidden">'+o.content+'</pre>';});}if(s.verify_css_classes){t.serializer.attribValueFilter=function(n,v){var s,cl;if(n=='class'){if(!t.classesRE){cl=t.dom.getClasses();if(cl.length>0){s='';each(cl,function(o){s+=(s?'|':'')+o['class'];});t.classesRE=new RegExp('('+s+')','gi');}}return!t.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v)||t.classesRE.test(v)?v:'';}return v;};}if(s.convert_fonts_to_spans)t._convertFonts();if(s.inline_styles)t._convertInlineElements();if(s.cleanup_callback){t.onBeforeSetContent.add(function(ed,o){o.content=t.execCallback('cleanup_callback','insert_to_editor',o.content,o);});t.onPreProcess.add(function(ed,o){if(o.set)t.execCallback('cleanup_callback','insert_to_editor_dom',o.node,o);if(o.get)t.execCallback('cleanup_callback','get_from_editor_dom',o.node,o);});t.onPostProcess.add(function(ed,o){if(o.set)o.content=t.execCallback('cleanup_callback','insert_to_editor',o.content,o);if(o.get)o.content=t.execCallback('cleanup_callback','get_from_editor',o.content,o);});}if(s.save_callback){t.onGetContent.add(function(ed,o){if(o.save)o.content=t.execCallback('save_callback',t.id,o.content,t.getBody());});}if(s.handle_event_callback){t.onEvent.add(function(ed,e,o){if(t.execCallback('handle_event_callback',e,ed,o)===false)Event.cancel(e);});}t.onSetContent.add(function(){t.addVisual(t.getBody());});if(s.padd_empty_editor){t.onPostProcess.add(function(ed,o){o.content=o.content.replace(/^(<p>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,'');});}if(isGecko){try{d.designMode='Off';d.designMode='On';}catch(ex){}}setTimeout(function(){if(t.removed)return;t.load({initial:true,format:(s.cleanup_on_startup?'html':'raw')});t.startContent=t.getContent({format:'raw'});t.undoManager.add({initial:true});t.initialized=true;t.onInit.dispatch(t);t.execCallback('setupcontent_callback',t.id,t.getBody(),t.getDoc());t.execCallback('init_instance_callback',t);t.focus(true);t.nodeChanged({initial:1});if(s.content_css){tinymce.each(explode(s.content_css),function(u){t.dom.loadCSS(t.documentBaseURI.toAbsolute(u));});}if(s.auto_focus){setTimeout(function(){var ed=EditorManager.get(s.auto_focus);ed.selection.select(ed.getBody(),1);ed.selection.collapse(1);ed.getWin().focus();},100);}},1);e=null;},focus:function(sf){var oed,t=this;if(!sf){t.getWin().focus();}if(EditorManager.activeEditor!=t){if((oed=EditorManager.activeEditor)!=null)oed.onDeactivate.dispatch(oed,t);t.onActivate.dispatch(t,oed);}EditorManager._setActive(t);},execCallback:function(n){var t=this,f=t.settings[n],s;if(!f)return;if(t.callbackLookup&&(s=t.callbackLookup[n])){f=s.func;s=s.scope;}if(is(f,'string')){s=f.replace(/\.\w+$/,'');s=s?tinymce.resolve(s):0;f=tinymce.resolve(f);t.callbackLookup=t.callbackLookup||{};t.callbackLookup[n]={func:f,scope:s};}return f.apply(s||t,Array.prototype.slice.call(arguments,1));},translate:function(s){var c=this.settings.language,i18n=EditorManager.i18n;if(!s)return'';return i18n[c+'.'+s]||s.replace(/{\#([^}]+)\}/g,function(a,b){return i18n[c+'.'+b]||'{#'+b+'}';});},getLang:function(n,dv){return EditorManager.i18n[this.settings.language+'.'+n]||(is(dv)?dv:'{#'+n+'}');},getParam:function(n,dv,ty){var tr=tinymce.trim,v=is(this.settings[n])?this.settings[n]:dv,o;if(ty==='hash'){o={};if(is(v,'string')){each(v.indexOf('=')>0?v.split(/[;,](?![^=;,]*(?:[;,]|$))/):v.split(','),function(v){v=v.split('=');if(v.length>1)o[tr(v[0])]=tr(v[1]);else o[tr(v[0])]=tr(v);});}else o=v;return o;}return v;},nodeChanged:function(o){var t=this,s=t.selection,n=s.getNode()||t.getBody();if(t.initialized){t.onNodeChange.dispatch(t,o?o.controlManager||t.controlManager:t.controlManager,isIE&&n.ownerDocument!=t.getDoc()?t.getBody():n,s.isCollapsed(),o);}},addButton:function(n,s){var t=this;t.buttons=t.buttons||{};t.buttons[n]=s;},addCommand:function(n,f,s){this.execCommands[n]={func:f,scope:s||this};},addQueryStateHandler:function(n,f,s){this.queryStateCommands[n]={func:f,scope:s||this};},addQueryValueHandler:function(n,f,s){this.queryValueCommands[n]={func:f,scope:s||this};},addShortcut:function(pa,desc,cmd_func,sc){var t=this,c;if(!t.settings.custom_shortcuts)return false;t.shortcuts=t.shortcuts||{};if(is(cmd_func,'string')){c=cmd_func;cmd_func=function(){t.execCommand(c,false,null);};}if(is(cmd_func,'object')){c=cmd_func;cmd_func=function(){t.execCommand(c[0],c[1],c[2]);};}each(explode(pa),function(pa){var o={func:cmd_func,scope:sc||this,desc:desc,alt:false,ctrl:false,shift:false};each(explode(pa,'+'),function(v){switch(v){case'alt':case'ctrl':case'shift':o[v]=true;break;default:o.charCode=v.charCodeAt(0);o.keyCode=v.toUpperCase().charCodeAt(0);}});t.shortcuts[(o.ctrl?'ctrl':'')+','+(o.alt?'alt':'')+','+(o.shift?'shift':'')+','+o.keyCode]=o;});return true;},execCommand:function(cmd,ui,val,a){var t=this,s=0,o,st;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd)&&(!a||!a.skip_focus))t.focus();o={};t.onBeforeExecCommand.dispatch(t,cmd,ui,val,o);if(o.terminate)return false;if(t.execCallback('execcommand_callback',t.id,t.selection.getNode(),cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}if(o=t.execCommands[cmd]){st=o.func.call(o.scope,ui,val);if(st!==true){t.onExecCommand.dispatch(t,cmd,ui,val,a);return st;}}each(t.plugins,function(p){if(p.execCommand&&p.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);s=1;return false;}});if(s)return true;if(t.theme.execCommand&&t.theme.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}if(t.editorCommands.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}t.getDoc().execCommand(cmd,ui,val);t.onExecCommand.dispatch(t,cmd,ui,val,a);},queryCommandState:function(c){var t=this,o,s;if(t._isHidden())return;if(o=t.queryStateCommands[c]){s=o.func.call(o.scope);if(s!==true)return s;}o=t.editorCommands.queryCommandState(c);if(o!==-1)return o;try{return this.getDoc().queryCommandState(c);}catch(ex){}},queryCommandValue:function(c){var t=this,o,s;if(t._isHidden())return;if(o=t.queryValueCommands[c]){s=o.func.call(o.scope);if(s!==true)return s;}o=t.editorCommands.queryCommandValue(c);if(is(o))return o;try{return this.getDoc().queryCommandValue(c);}catch(ex){}},show:function(){var t=this;DOM.show(t.getContainer());DOM.hide(t.id);t.load();},hide:function(){var t=this,d=t.getDoc();if(isIE&&d)d.execCommand('SelectAll');t.save();DOM.hide(t.getContainer());DOM.setStyle(t.id,'display',t.orgDisplay);},isHidden:function(){return!DOM.isHidden(this.id);},setProgressState:function(b,ti,o){this.onSetProgressState.dispatch(this,b,ti,o);return b;},resizeToContent:function(){var t=this;DOM.setStyle(t.id+"_ifr",'height',t.getBody().scrollHeight);},load:function(o){var t=this,e=t.getElement(),h;o=o||{};o.load=true;h=t.setContent(is(e.value)?e.value:e.innerHTML,o);o.element=e;if(!o.no_events)t.onLoadContent.dispatch(t,o);o.element=e=null;return h;},save:function(o){var t=this,e=t.getElement(),h,f;if(!t.initialized)return;o=o||{};o.save=true;o.element=e;h=o.content=t.getContent(o);if(!o.no_events)t.onSaveContent.dispatch(t,o);h=o.content;if(!/TEXTAREA|INPUT/i.test(e.nodeName)){e.innerHTML=h;if(f=DOM.getParent(t.id,'form')){each(f.elements,function(e){if(e.name==t.id){e.value=h;return false;}});}}else e.value=h;o.element=e=null;return h;},setContent:function(h,o){var t=this;o=o||{};o.format=o.format||'html';o.set=true;o.content=h;if(!o.no_events)t.onBeforeSetContent.dispatch(t,o);if(!tinymce.isIE&&(h.length===0||/^\s+$/.test(h))){o.content=t.dom.setHTML(t.getBody(),'<br mce_bogus="1" />',1);o.format='raw';}o.content=t.dom.setHTML(t.getBody(),tinymce.trim(o.content));if(o.format!='raw'&&t.settings.cleanup){o.getInner=true;o.content=t.dom.setHTML(t.getBody(),t.serializer.serialize(t.getBody(),o));}if(!o.no_events)t.onSetContent.dispatch(t,o);return o.content;},getContent:function(o){var t=this,h;o=o||{};o.format=o.format||'html';o.get=true;if(!o.no_events)t.onBeforeGetContent.dispatch(t,o);if(o.format!='raw'&&t.settings.cleanup){o.getInner=true;h=t.serializer.serialize(t.getBody(),o);}else h=t.getBody().innerHTML;h=h.replace(/^\s*|\s*$/g,'');o={content:h};t.onGetContent.dispatch(t,o);return o.content;},isDirty:function(){var t=this;return tinymce.trim(t.startContent)!=tinymce.trim(t.getContent({format:'raw',no_events:1}))&&!t.isNotDirty;},getContainer:function(){var t=this;if(!t.container)t.container=DOM.get(t.editorContainer||t.id+'_parent');return t.container;},getContentAreaContainer:function(){return this.contentAreaContainer;},getElement:function(){return DOM.get(this.settings.content_element||this.id);},getWin:function(){var t=this,e;if(!t.contentWindow){e=DOM.get(t.id+"_ifr");if(e)t.contentWindow=e.contentWindow;}return t.contentWindow;},getDoc:function(){var t=this,w;if(!t.contentDocument){w=t.getWin();if(w)t.contentDocument=w.document;}return t.contentDocument;},getBody:function(){return this.bodyElement||this.getDoc().body;},convertURL:function(u,n,e){var t=this,s=t.settings;if(s.urlconverter_callback)return t.execCallback('urlconverter_callback',u,e,true,n);if(!s.convert_urls||(e&&e.nodeName=='LINK')||u.indexOf('file:')===0)return u;if(s.relative_urls)return t.documentBaseURI.toRelative(u);u=t.documentBaseURI.toAbsolute(u,s.remove_script_host);return u;},addVisual:function(e){var t=this,s=t.settings;e=e||t.getBody();if(!is(t.hasVisual))t.hasVisual=s.visual;each(t.dom.select('table,a',e),function(e){var v;switch(e.nodeName){case'TABLE':v=t.dom.getAttrib(e,'border');if(!v||v=='0'){if(t.hasVisual)t.dom.addClass(e,s.visual_table_class);else t.dom.removeClass(e,s.visual_table_class);}return;case'A':v=t.dom.getAttrib(e,'name');if(v){if(t.hasVisual)t.dom.addClass(e,'mceItemAnchor');else t.dom.removeClass(e,'mceItemAnchor');}return;}});t.onVisualAid.dispatch(t,e,t.hasVisual);},remove:function(){var t=this,e=t.getContainer();t.removed=1;t.hide();t.execCallback('remove_instance_callback',t);t.onRemove.dispatch(t);t.onExecCommand.listeners=[];EditorManager.remove(t);DOM.remove(e);},destroy:function(s){var t=this;if(t.destroyed)return;if(!s){tinymce.removeUnload(t.destroy);tinyMCE.onBeforeUnload.remove(t._beforeUnload);if(t.theme.destroy)t.theme.destroy();t.controlManager.destroy();t.selection.destroy();t.dom.destroy();if(!t.settings.content_editable){Event.clear(t.getWin());Event.clear(t.getDoc());}Event.clear(t.getBody());Event.clear(t.formElement);}if(t.formElement){t.formElement.submit=t.formElement._mceOldSubmit;t.formElement._mceOldSubmit=null;}t.contentAreaContainer=t.formElement=t.container=t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null;if(t.selection)t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null;t.destroyed=1;},_addEvents:function(){var t=this,i,s=t.settings,lo={mouseup:'onMouseUp',mousedown:'onMouseDown',click:'onClick',keyup:'onKeyUp',keydown:'onKeyDown',keypress:'onKeyPress',submit:'onSubmit',reset:'onReset',contextmenu:'onContextMenu',dblclick:'onDblClick',paste:'onPaste'};function eventHandler(e,o){var ty=e.type;if(t.removed)return;if(t.onEvent.dispatch(t,e,o)!==false){t[lo[e.fakeType||e.type]].dispatch(t,e,o);}};each(lo,function(v,k){switch(k){case'contextmenu':if(tinymce.isOpera){Event.add(t.getDoc(),'mousedown',function(e){if(e.ctrlKey){e.fakeType='contextmenu';eventHandler(e);}});}else Event.add(t.getDoc(),k,eventHandler);break;case'paste':Event.add(t.getBody(),k,function(e){var tx,h,el,r;if(e.clipboardData)tx=e.clipboardData.getData('text/plain');else if(tinymce.isIE)tx=t.getWin().clipboardData.getData('Text');eventHandler(e,{text:tx,html:h});});break;case'submit':case'reset':Event.add(t.getElement().form||DOM.getParent(t.id,'form'),k,eventHandler);break;default:Event.add(s.content_editable?t.getBody():t.getDoc(),k,eventHandler);}});Event.add(s.content_editable?t.getBody():(isGecko?t.getDoc():t.getWin()),'focus',function(e){t.focus(true);});if(tinymce.isGecko){Event.add(t.getDoc(),'DOMNodeInserted',function(e){var v;e=e.target;if(e.nodeType===1&&e.nodeName==='IMG'&&(v=e.getAttribute('mce_src')))e.src=t.documentBaseURI.toAbsolute(v);});}if(isGecko){function setOpts(){var t=this,d=t.getDoc(),s=t.settings;if(isGecko){if(t._isHidden()){try{if(!s.content_editable)d.designMode='On';}catch(ex){}}try{d.execCommand("styleWithCSS",0,false);}catch(ex){if(!t._isHidden())d.execCommand("useCSS",0,true);}if(!s.table_inline_editing)try{d.execCommand('enableInlineTableEditing',false,false);}catch(ex){}if(!s.object_resizing)try{d.execCommand('enableObjectResizing',false,false);}catch(ex){}}};t.onBeforeExecCommand.add(setOpts);t.onMouseDown.add(setOpts);}t.onMouseUp.add(t.nodeChanged);t.onClick.add(t.nodeChanged);t.onKeyUp.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45||e.keyCode==46||e.keyCode==8||e.ctrlKey)t.nodeChanged();});t.onReset.add(function(){t.setContent(t.startContent,{format:'raw'});});if(t.getParam('tab_focus')){function tabCancel(ed,e){if(e.keyCode===9)return Event.cancel(e);};function tabHandler(ed,e){var x,i,f,el,v;function find(d){f=DOM.getParent(ed.id,'form');el=f.elements;if(f){each(el,function(e,i){if(e.id==ed.id){x=i;return false;}});if(d>0){for(i=x+1;i<el.length;i++){if(el[i].type!='hidden')return el[i];}}else{for(i=x-1;i>=0;i--){if(el[i].type!='hidden')return el[i];}}}return null;};if(e.keyCode===9){v=explode(ed.getParam('tab_focus'));if(v.length==1){v[1]=v[0];v[0]=':prev';}if(e.shiftKey){if(v[0]==':prev')el=find(-1);else el=DOM.get(v[0]);}else{if(v[1]==':next')el=find(1);else el=DOM.get(v[1]);}if(el){if(ed=EditorManager.get(el.id||el.name))ed.focus();else window.setTimeout(function(){window.focus();el.focus();},10);return Event.cancel(e);}}};t.onKeyUp.add(tabCancel);if(isGecko){t.onKeyPress.add(tabHandler);t.onKeyDown.add(tabCancel);}else t.onKeyDown.add(tabHandler);}if(s.custom_shortcuts){if(s.custom_undo_redo_keyboard_shortcuts){t.addShortcut('ctrl+z',t.getLang('undo_desc'),'Undo');t.addShortcut('ctrl+y',t.getLang('redo_desc'),'Redo');}if(isGecko){t.addShortcut('ctrl+b',t.getLang('bold_desc'),'Bold');t.addShortcut('ctrl+i',t.getLang('italic_desc'),'Italic');t.addShortcut('ctrl+u',t.getLang('underline_desc'),'Underline');}for(i=1;i<=6;i++)t.addShortcut('ctrl+'+i,'',['FormatBlock',false,'<h'+i+'>']);t.addShortcut('ctrl+7','',['FormatBlock',false,'<p>']);t.addShortcut('ctrl+8','',['FormatBlock',false,'<div>']);t.addShortcut('ctrl+9','',['FormatBlock',false,'<address>']);function find(e){var v=null;if(!e.altKey&&!e.ctrlKey&&!e.metaKey)return v;each(t.shortcuts,function(o){if(o.ctrl!=e.ctrlKey&&(!tinymce.isMac||o.ctrl==e.metaKey))return;if(o.alt!=e.altKey)return;if(o.shift!=e.shiftKey)return;if(e.keyCode==o.keyCode||(e.charCode&&e.charCode==o.charCode)){v=o;return false;}});return v;};t.onKeyUp.add(function(ed,e){var o=find(e);if(o)return Event.cancel(e);});t.onKeyPress.add(function(ed,e){var o=find(e);if(o)return Event.cancel(e);});t.onKeyDown.add(function(ed,e){var o=find(e);if(o){o.func.call(o.scope);return Event.cancel(e);}});}if(tinymce.isIE){Event.add(t.getDoc(),'controlselect',function(e){var re=t.resizeInfo,cb;e=e.target;if(e.nodeName!=='IMG')return;if(re)Event.remove(re.node,re.ev,re.cb);if(!t.dom.hasClass(e,'mceItemNoResize')){ev='resizeend';cb=Event.add(e,ev,function(e){var v;e=e.target;if(v=t.dom.getStyle(e,'width')){t.dom.setAttrib(e,'width',v.replace(/[^0-9%]+/g,''));t.dom.setStyle(e,'width','');}if(v=t.dom.getStyle(e,'height')){t.dom.setAttrib(e,'height',v.replace(/[^0-9%]+/g,''));t.dom.setStyle(e,'height','');}});}else{ev='resizestart';cb=Event.add(e,'resizestart',Event.cancel,Event);}re=t.resizeInfo={node:e,ev:ev,cb:cb};});t.onKeyDown.add(function(ed,e){switch(e.keyCode){case 8:if(t.selection.getRng().item){t.selection.getRng().item(0).removeNode();return Event.cancel(e);}}});}if(tinymce.isOpera){t.onClick.add(function(ed,e){Event.prevent(e);});}if(s.custom_undo_redo){function addUndo(){t.undoManager.typing=0;t.undoManager.add();};if(tinymce.isIE){Event.add(t.getWin(),'blur',function(e){var n;if(t.selection){n=t.selection.getNode();if(!t.removed&&n.ownerDocument&&n.ownerDocument!=t.getDoc())addUndo();}});}else{Event.add(t.getDoc(),'blur',function(){if(t.selection&&!t.removed)addUndo();});}t.onMouseDown.add(addUndo);t.onKeyUp.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45||e.ctrlKey){t.undoManager.typing=0;t.undoManager.add();}});t.onKeyDown.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45){if(t.undoManager.typing){t.undoManager.add();t.undoManager.typing=0;}return;}if(!t.undoManager.typing){t.undoManager.add();t.undoManager.typing=1;}});}},_convertInlineElements:function(){var t=this,s=t.settings,dom=t.dom,v,e,na,st,sp;function convert(ed,o){if(!s.inline_styles)return;if(o.get){each(t.dom.select('table,u,strike',o.node),function(n){switch(n.nodeName){case'TABLE':if(v=dom.getAttrib(n,'height')){dom.setStyle(n,'height',v);dom.setAttrib(n,'height','');}break;case'U':case'STRIKE':n.style.textDecoration=n.nodeName=='U'?'underline':'line-through';dom.setAttrib(n,'mce_style','');dom.setAttrib(n,'mce_name','span');break;}});}else if(o.set){each(t.dom.select('table,span',o.node).reverse(),function(n){if(n.nodeName=='TABLE'){if(v=dom.getStyle(n,'height'))dom.setAttrib(n,'height',v.replace(/[^0-9%]+/g,''));}else{if(n.style.textDecoration=='underline')na='u';else if(n.style.textDecoration=='line-through')na='strike';else na='';if(na){n.style.textDecoration='';dom.setAttrib(n,'mce_style','');e=dom.create(na,{style:dom.getAttrib(n,'style')});dom.replace(e,n,1);}}});}};t.onPreProcess.add(convert);if(!s.cleanup_on_startup){t.onSetContent.add(function(ed,o){if(o.initial)convert(t,{node:t.getBody(),set:1});});}},_convertFonts:function(){var t=this,s=t.settings,dom=t.dom,fz,fzn,sl,cl;if(!s.inline_styles)return;fz=[8,10,12,14,18,24,36];fzn=['xx-small','x-small','small','medium','large','x-large','xx-large'];if(sl=s.font_size_style_values)sl=explode(sl);if(cl=s.font_size_classes)cl=explode(cl);function convertToFonts(no){var n,f,nl,x,i,v,st;if(tinymce.isWebKit||!s.inline_styles)return;nl=t.dom.select('span',no);for(x=nl.length-1;x>=0;x--){n=nl[x];f=dom.create('font',{color:dom.toHex(dom.getStyle(n,'color')),face:dom.getStyle(n,'fontFamily'),style:dom.getAttrib(n,'style'),'class':dom.getAttrib(n,'class')});st=f.style;if(st.color||st.fontFamily){st.color=st.fontFamily='';dom.setAttrib(f,'mce_style','');}if(sl){i=inArray(sl,dom.getStyle(n,'fontSize'));if(i!=-1){dom.setAttrib(f,'size',''+(i+1||1));f.style.fontSize='';}}else if(cl){i=inArray(cl,dom.getAttrib(n,'class'));v=dom.getStyle(n,'fontSize');if(i==-1&&v.indexOf('pt')>0)i=inArray(fz,parseInt(v));if(i==-1)i=inArray(fzn,v);if(i!=-1){dom.setAttrib(f,'size',''+(i+1||1));f.style.fontSize='';}}if(f.color||f.face||f.size){f.style.fontFamily='';dom.setAttrib(f,'mce_style','');dom.replace(f,n,1);}f=n=null;}};t.onSetContent.add(function(ed,o){convertToFonts(ed.getBody());});t.onPreProcess.add(function(ed,o){var n,sp,nl,x;if(!s.inline_styles)return;if(o.get){nl=t.dom.select('font',o.node);for(x=nl.length-1;x>=0;x--){n=nl[x];sp=dom.create('span',{style:dom.getAttrib(n,'style'),'class':dom.getAttrib(n,'class')});dom.setStyles(sp,{fontFamily:dom.getAttrib(n,'face'),color:dom.getAttrib(n,'color'),backgroundColor:n.style.backgroundColor});if(n.size){if(sl)dom.setStyle(sp,'fontSize',sl[parseInt(n.size)-1]);else dom.setAttrib(sp,'class',cl[parseInt(n.size)-1]);}dom.setAttrib(sp,'mce_style','');dom.replace(sp,n,1);}}});},_isHidden:function(){var s;if(!isGecko)return 0;s=this.selection.getSel();return(!s||!s.rangeCount||s.rangeCount==0);},_fixNesting:function(s){var d=[],i;s=s.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(a,b,c){var e;if(b==='/'){if(!d.length)return'';if(c!==d[d.length-1].tag){for(i=d.length-1;i>=0;i--){if(d[i].tag===c){d[i].close=1;break;}}return'';}else{d.pop();if(d.length&&d[d.length-1].close){a=a+'</'+d[d.length-1].tag+'>';d.pop();}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(c))return a;if(/\/>$/.test(a))return a;d.push({tag:c});}return a;});for(i=d.length-1;i>=0;i--)s+='</'+d[i].tag+'>';return s;}});})();(function(){var each=tinymce.each,isIE=tinymce.isIE,isGecko=tinymce.isGecko,isOpera=tinymce.isOpera,isWebKit=tinymce.isWebKit;tinymce.create('tinymce.EditorCommands',{EditorCommands:function(ed){this.editor=ed;},execCommand:function(cmd,ui,val){var t=this,ed=t.editor,f;switch(cmd){case'Cut':case'Copy':case'Paste':try{ed.getDoc().execCommand(cmd,ui,val);}catch(ex){if(isGecko){ed.windowManager.confirm(ed.getLang('clipboard_msg'),function(s){if(s)window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html','mceExternal');});}else ed.windowManager.alert(ed.getLang('clipboard_no_support'));}return true;case'mceResetDesignMode':case'mceBeginUndoLevel':return true;case'unlink':t.UnLink();return true;case'JustifyLeft':case'JustifyCenter':case'JustifyRight':case'JustifyFull':t.mceJustify(cmd,cmd.substring(7).toLowerCase());return true;case'mceEndUndoLevel':case'mceAddUndoLevel':ed.undoManager.add();return true;default:f=this[cmd];if(f){f.call(this,ui,val);return true;}}return false;},Indent:function(){var ed=this.editor,d=ed.dom,s=ed.selection,e,iv,iu;iv=ed.settings.indentation;iu=/[a-z%]+$/i.exec(iv);iv=parseInt(iv);if(ed.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){each(this._getSelectedBlocks(),function(e){d.setStyle(e,'paddingLeft',(parseInt(e.style.paddingLeft||0)+iv)+iu);});return;}ed.getDoc().execCommand('Indent',false,null);if(isIE){d.getParent(s.getNode(),function(n){if(n.nodeName=='BLOCKQUOTE'){n.dir=n.style.cssText='';}});}},Outdent:function(){var ed=this.editor,d=ed.dom,s=ed.selection,e,v,iv,iu;iv=ed.settings.indentation;iu=/[a-z%]+$/i.exec(iv);iv=parseInt(iv);if(ed.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){each(this._getSelectedBlocks(),function(e){v=Math.max(0,parseInt(e.style.paddingLeft||0)-iv);d.setStyle(e,'paddingLeft',v?v+iu:'');});return;}ed.getDoc().execCommand('Outdent',false,null);},mceSetAttribute:function(u,v){var ed=this.editor,d=ed.dom,e;if(e=d.getParent(ed.selection.getNode(),d.isBlock))d.setAttrib(e,v.name,v.value);},mceSetContent:function(u,v){this.editor.setContent(v);},mceToggleVisualAid:function(){var ed=this.editor;ed.hasVisual=!ed.hasVisual;ed.addVisual();},mceReplaceContent:function(u,v){var s=this.editor.selection;s.setContent(v.replace(/\{\$selection\}/g,s.getContent({format:'text'})));},mceInsertLink:function(u,v){var ed=this.editor,s=ed.selection,e=ed.dom.getParent(s.getNode(),'A');if(tinymce.is(v,'string'))v={href:v};function set(e){each(v,function(v,k){ed.dom.setAttrib(e,k,v);});};if(!e){ed.execCommand('CreateLink',false,'javascript:mctmp(0);');each(ed.dom.select('a'),function(e){if(e.href=='javascript:mctmp(0);')set(e);});}else{if(v.href)set(e);else ed.dom.remove(e,1);}},UnLink:function(){var ed=this.editor,s=ed.selection;if(s.isCollapsed())s.select(s.getNode());ed.getDoc().execCommand('unlink',false,null);s.collapse(0);},FontName:function(u,v){var t=this,ed=t.editor,s=ed.selection,e;if(!v){if(s.isCollapsed())s.select(s.getNode());t.RemoveFormat();}else ed.getDoc().execCommand('FontName',false,v);},queryCommandValue:function(c){var f=this['queryValue'+c];if(f)return f.call(this,c);return false;},queryCommandState:function(cmd){var f;switch(cmd){case'JustifyLeft':case'JustifyCenter':case'JustifyRight':case'JustifyFull':return this.queryStateJustify(cmd,cmd.substring(7).toLowerCase());default:if(f=this['queryState'+cmd])return f.call(this,cmd);}return-1;},_queryState:function(c){try{return this.editor.getDoc().queryCommandState(c);}catch(ex){}},_queryVal:function(c){try{return this.editor.getDoc().queryCommandValue(c);}catch(ex){}},queryValueFontSize:function(){var ed=this.editor,v=0,p;if(isOpera||isWebKit){if(p=ed.dom.getParent(ed.selection.getNode(),'FONT'))v=p.size;return v;}return this._queryVal('FontSize');},queryValueFontName:function(){var ed=this.editor,v=0,p;if(p=ed.dom.getParent(ed.selection.getNode(),'FONT'))v=p.face;if(!v)v=this._queryVal('FontName');return v;},mceJustify:function(c,v){var ed=this.editor,se=ed.selection,n=se.getNode(),nn=n.nodeName,bl,nb,dom=ed.dom,rm;if(ed.settings.inline_styles&&this.queryStateJustify(c,v))rm=1;bl=dom.getParent(n,ed.dom.isBlock);if(nn=='IMG'){if(v=='full')return;if(rm){if(v=='center')dom.setStyle(n.parentNode,'textAlign','');dom.setStyle(n,'float','');this.mceRepaint();return;}if(v=='center'){if(/^(TD|TH)$/.test(bl.nodeName))bl=0;if(!bl||bl.childNodes.length>1){nb=dom.create('p');nb.appendChild(n.cloneNode(false));if(bl)dom.insertAfter(nb,bl);else dom.insertAfter(nb,n);dom.remove(n);n=nb.firstChild;bl=nb;}dom.setStyle(bl,'textAlign',v);dom.setStyle(n,'float','');}else{dom.setStyle(n,'float',v);dom.setStyle(n.parentNode,'textAlign','');}this.mceRepaint();return;}if(ed.settings.inline_styles&&ed.settings.forced_root_block){if(rm)v='';each(this._getSelectedBlocks(dom.getParent(se.getStart(),dom.isBlock),dom.getParent(se.getEnd(),dom.isBlock)),function(e){dom.setAttrib(e,'align','');dom.setStyle(e,'textAlign',v=='full'?'justify':v);});return;}else if(!rm)ed.getDoc().execCommand(c,false,null);if(ed.settings.inline_styles){if(rm){dom.getParent(ed.selection.getNode(),function(n){if(n.style&&n.style.textAlign)dom.setStyle(n,'textAlign','');});return;}each(dom.select('*'),function(n){var v=n.align;if(v){if(v=='full')v='justify';dom.setStyle(n,'textAlign',v);dom.setAttrib(n,'align','');}});}},mceSetCSSClass:function(u,v){this.mceSetStyleInfo(0,{command:'setattrib',name:'class',value:v});},getSelectedElement:function(){var t=this,ed=t.editor,dom=ed.dom,se=ed.selection,r=se.getRng(),r1,r2,sc,ec,so,eo,e,sp,ep,re;if(se.isCollapsed()||r.item)return se.getNode();re=ed.settings.merge_styles_invalid_parents;if(tinymce.is(re,'string'))re=new RegExp(re,'i');if(isIE){r1=r.duplicate();r1.collapse(true);sc=r1.parentElement();r2=r.duplicate();r2.collapse(false);ec=r2.parentElement();if(sc!=ec){r1.move('character',1);sc=r1.parentElement();}if(sc==ec){r1=r.duplicate();r1.moveToElementText(sc);if(r1.compareEndPoints('StartToStart',r)==0&&r1.compareEndPoints('EndToEnd',r)==0)return re&&re.test(sc.nodeName)?null:sc;}}else{function getParent(n){return dom.getParent(n,function(n){return n.nodeType==1;});};sc=r.startContainer;ec=r.endContainer;so=r.startOffset;eo=r.endOffset;if(!r.collapsed){if(sc==ec){if(so-eo<2){if(sc.hasChildNodes()){sp=sc.childNodes[so];return re&&re.test(sp.nodeName)?null:sp;}}}}if(sc.nodeType!=3||ec.nodeType!=3)return null;if(so==0){sp=getParent(sc);if(sp&&sp.firstChild!=sc)sp=null;}if(so==sc.nodeValue.length){e=sc.nextSibling;if(e&&e.nodeType==1)sp=sc.nextSibling;}if(eo==0){e=ec.previousSibling;if(e&&e.nodeType==1)ep=e;}if(eo==ec.nodeValue.length){ep=getParent(ec);if(ep&&ep.lastChild!=ec)ep=null;}if(sp==ep)return re&&sp&&re.test(sp.nodeName)?null:sp;}return null;},InsertHorizontalRule:function(){if(isGecko||isIE)this.editor.selection.setContent('<hr />');else this.editor.getDoc().execCommand('InsertHorizontalRule',false,'');},RemoveFormat:function(){var t=this,ed=t.editor,s=ed.selection,b;if(isWebKit)s.setContent(s.getContent({format:'raw'}).replace(/(<(span|b|i|strong|em|strike) [^>]+>|<(span|b|i|strong|em|strike)>|<\/(span|b|i|strong|em|strike)>|)/g,''),{format:'raw'});else ed.getDoc().execCommand('RemoveFormat',false,null);t.mceSetStyleInfo(0,{command:'removeformat'});ed.addVisual();},mceSetStyleInfo:function(u,v){var t=this,ed=t.editor,d=ed.getDoc(),dom=ed.dom,e,b,s=ed.selection,nn=v.wrapper||'span',b=s.getBookmark(),re;function set(n,e){if(n.nodeType==1){switch(v.command){case'setattrib':return dom.setAttrib(n,v.name,v.value);case'setstyle':return dom.setStyle(n,v.name,v.value);case'removeformat':return dom.setAttrib(n,'class','');}}};re=ed.settings.merge_styles_invalid_parents;if(tinymce.is(re,'string'))re=new RegExp(re,'i');if(e=t.getSelectedElement())set(e,1);else{d.execCommand('FontName',false,'__');each(isWebKit?dom.select('span'):dom.select('font'),function(n){var sp,e;if(dom.getAttrib(n,'face')=='__'||n.style.fontFamily==='__'){sp=dom.create(nn,{mce_new:'1'});set(sp);each(n.childNodes,function(n){sp.appendChild(n.cloneNode(true));});dom.replace(sp,n);}});}each(dom.select(nn).reverse(),function(n){var p=n.parentNode;if(!dom.getAttrib(n,'mce_new')){p=dom.getParent(n,function(n){return n.nodeType==1&&dom.getAttrib(n,'mce_new');});if(p)dom.remove(n,1);}});each(dom.select(nn).reverse(),function(n){var p=n.parentNode;if(!p||!dom.getAttrib(n,'mce_new'))return;if(p.nodeName==nn.toUpperCase()&&p.childNodes.length==1)return dom.remove(p,1);if(n.nodeType==1&&(!re||!re.test(p.nodeName))&&p.childNodes.length==1){set(p);dom.setAttrib(n,'class','');}});each(dom.select(nn).reverse(),function(n){if(dom.getAttrib(n,'mce_new')||(dom.getAttribs(n).length<=1&&n.className==='')){if(!dom.getAttrib(n,'class')&&!dom.getAttrib(n,'style'))return dom.remove(n,1);dom.setAttrib(n,'mce_new','');}});s.moveToBookmark(b);},queryStateJustify:function(c,v){var ed=this.editor,n=ed.selection.getNode(),dom=ed.dom;if(n&&n.nodeName=='IMG'){if(dom.getStyle(n,'float')==v)return 1;return n.parentNode.style.textAlign==v;}n=dom.getParent(ed.selection.getStart(),function(n){return n.nodeType==1&&n.style.textAlign;});if(v=='full')v='justify';if(ed.settings.inline_styles)return(n&&n.style.textAlign==v);return this._queryState(c);},HiliteColor:function(ui,val){var t=this,ed=t.editor,d=ed.getDoc();function set(s){if(!isGecko)return;try{d.execCommand("styleWithCSS",0,s);}catch(ex){d.execCommand("useCSS",0,!s);}};if(isGecko||isOpera){set(true);d.execCommand('hilitecolor',false,val);set(false);}else d.execCommand('BackColor',false,val);},Undo:function(){var ed=this.editor;if(ed.settings.custom_undo_redo){ed.undoManager.undo();ed.nodeChanged();}else ed.getDoc().execCommand('Undo',false,null);},Redo:function(){var ed=this.editor;if(ed.settings.custom_undo_redo){ed.undoManager.redo();ed.nodeChanged();}else ed.getDoc().execCommand('Redo',false,null);},FormatBlock:function(ui,val){var t=this,ed=t.editor;val=ed.settings.forced_root_block?(val||'<p>'):val;if(/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(ed.selection.getNode().nodeName))t.mceRemoveNode();if(val.indexOf('<')==-1)val='<'+val+'>';if(tinymce.isGecko)val=val.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,'$1');ed.getDoc().execCommand('FormatBlock',false,val);},mceCleanup:function(){var ed=this.editor,s=ed.selection,b=s.getBookmark();ed.setContent(ed.getContent());s.moveToBookmark(b);},mceRemoveNode:function(ui,val){var ed=this.editor,s=ed.selection,b,n=val||s.getNode();if(n==ed.getBody())return;b=s.getBookmark();ed.dom.remove(n,1);s.moveToBookmark(b);ed.nodeChanged();},mceSelectNodeDepth:function(ui,val){var ed=this.editor,s=ed.selection,c=0;ed.dom.getParent(s.getNode(),function(n){if(n.nodeType==1&&c++==val){s.select(n);ed.nodeChanged();return false;}},ed.getBody());},mceSelectNode:function(u,v){this.editor.selection.select(v);},mceInsertContent:function(ui,val){this.editor.selection.setContent(val);},mceInsertRawHTML:function(ui,val){var ed=this.editor;ed.selection.setContent('tiny_mce_marker');ed.setContent(ed.getContent().replace(/tiny_mce_marker/g,val));},mceRepaint:function(){var s,b,e=this.editor;if(tinymce.isGecko){try{s=e.selection;b=s.getBookmark(true);if(s.getSel())s.getSel().selectAllChildren(e.getBody());s.collapse(true);s.moveToBookmark(b);}catch(ex){}}},queryStateUnderline:function(){var ed=this.editor,n=ed.selection.getNode();if(n&&n.nodeName=='A')return false;return this._queryState('Underline');},queryStateOutdent:function(){var ed=this.editor,n;if(ed.settings.inline_styles){if((n=ed.dom.getParent(ed.selection.getStart(),ed.dom.isBlock))&&parseInt(n.style.paddingLeft)>0)return true;if((n=ed.dom.getParent(ed.selection.getEnd(),ed.dom.isBlock))&&parseInt(n.style.paddingLeft)>0)return true;}else return!!ed.dom.getParent(ed.selection.getNode(),'BLOCKQUOTE');return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList();},queryStateInsertUnorderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),'UL');},queryStateInsertOrderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),'OL');},queryStatemceBlockQuote:function(){return!!this.editor.dom.getParent(this.editor.selection.getStart(),function(n){return n.nodeName==='BLOCKQUOTE';});},mceBlockQuote:function(){var t=this,ed=t.editor,s=ed.selection,dom=ed.dom,sb,eb,n,bm,bq,r,bq2,i,nl;function getBQ(e){return dom.getParent(e,function(n){return n.nodeName==='BLOCKQUOTE';});};sb=dom.getParent(s.getStart(),dom.isBlock);eb=dom.getParent(s.getEnd(),dom.isBlock);if(bq=getBQ(sb)){if(sb!=eb||sb.childNodes.length>1||(sb.childNodes.length==1&&sb.firstChild.nodeName!='BR'))bm=s.getBookmark();if(getBQ(eb)){bq2=bq.cloneNode(false);while(n=eb.nextSibling)bq2.appendChild(n.parentNode.removeChild(n));}if(bq2)dom.insertAfter(bq2,bq);nl=t._getSelectedBlocks(sb,eb);for(i=nl.length-1;i>=0;i--){dom.insertAfter(nl[i],bq);}if(/^\s*$/.test(bq.innerHTML))dom.remove(bq,1);if(bq2&&/^\s*$/.test(bq2.innerHTML))dom.remove(bq2,1);if(!bm){if(!isIE){r=ed.getDoc().createRange();r.setStart(sb,0);r.setEnd(sb,0);s.setRng(r);}else{s.select(sb);s.collapse(0);if(dom.getParent(s.getStart(),dom.isBlock)!=sb){r=s.getRng();r.move('character',-1);r.select();}}}else t.editor.selection.moveToBookmark(bm);return;}if(isIE&&!sb&&!eb){t.editor.getDoc().execCommand('Indent');n=getBQ(s.getNode());n.style.margin=n.dir='';return;}if(!sb||!eb)return;if(sb!=eb||sb.childNodes.length>1||(sb.childNodes.length==1&&sb.firstChild.nodeName!='BR'))bm=s.getBookmark();each(t._getSelectedBlocks(getBQ(s.getStart()),getBQ(s.getEnd())),function(e){if(e.nodeName=='BLOCKQUOTE'&&!bq){bq=e;return;}if(!bq){bq=dom.create('blockquote');e.parentNode.insertBefore(bq,e);}if(e.nodeName=='BLOCKQUOTE'&&bq){n=e.firstChild;while(n){bq.appendChild(n.cloneNode(true));n=n.nextSibling;}dom.remove(e);return;}bq.appendChild(dom.remove(e));});if(!bm){if(!isIE){r=ed.getDoc().createRange();r.setStart(sb,0);r.setEnd(sb,0);s.setRng(r);}else{s.select(sb);s.collapse(1);}}else s.moveToBookmark(bm);},_getSelectedBlocks:function(st,en){var ed=this.editor,dom=ed.dom,s=ed.selection,sb,eb,n,bl=[];sb=dom.getParent(st||s.getStart(),dom.isBlock);eb=dom.getParent(en||s.getEnd(),dom.isBlock);if(sb)bl.push(sb);if(sb&&eb&&sb!=eb){n=sb;while((n=n.nextSibling)&&n!=eb){if(dom.isBlock(n))bl.push(n);}}if(eb&&sb!=eb)bl.push(eb);return bl;}});})();tinymce.create('tinymce.UndoManager',{index:0,data:null,typing:0,UndoManager:function(ed){var t=this,Dispatcher=tinymce.util.Dispatcher;t.editor=ed;t.data=[];t.onAdd=new Dispatcher(this);t.onUndo=new Dispatcher(this);t.onRedo=new Dispatcher(this);},add:function(l){var t=this,i,ed=t.editor,b,s=ed.settings,la;l=l||{};l.content=l.content||ed.getContent({format:'raw',no_events:1});l.content=l.content.replace(/^\s*|\s*$/g,'');la=t.data[t.index>0?t.index-1:0];if(!l.initial&&la&&l.content==la.content)return null;if(s.custom_undo_redo_levels){if(t.data.length>s.custom_undo_redo_levels){for(i=0;i<t.data.length-1;i++)t.data[i]=t.data[i+1];t.data.length--;t.index=t.data.length;}}if(s.custom_undo_redo_restore_selection&&!l.initial)l.bookmark=b=l.bookmark||ed.selection.getBookmark();if(t.index<t.data.length&&t.data[t.index].initial)t.index++;if(t.data.length===0&&!l.initial)return null;t.data.length=t.index+1;t.data[t.index++]=l;if(l.initial)t.index=0;if(t.data.length==2&&t.data[0].initial)t.data[0].bookmark=b;t.onAdd.dispatch(t,l);ed.isNotDirty=0;return l;},undo:function(){var t=this,ed=t.editor,l=l,i;if(t.typing){t.add();t.typing=0;}if(t.index>0){if(t.index==t.data.length&&t.index>1){i=t.index;t.typing=0;if(!t.add())t.index=i;--t.index;}l=t.data[--t.index];ed.setContent(l.content,{format:'raw'});ed.selection.moveToBookmark(l.bookmark);t.onUndo.dispatch(t,l);}return l;},redo:function(){var t=this,ed=t.editor,l=null;if(t.index<t.data.length-1){l=t.data[++t.index];ed.setContent(l.content,{format:'raw'});ed.selection.moveToBookmark(l.bookmark);t.onRedo.dispatch(t,l);}return l;},clear:function(){var t=this;t.data=[];t.index=0;t.typing=0;t.add({initial:true});},hasUndo:function(){return this.index!=0||this.typing;},hasRedo:function(){return this.index<this.data.length-1;}});(function(){var Event,isIE,isGecko,isOpera,each,extend;Event=tinymce.dom.Event;isIE=tinymce.isIE;isGecko=tinymce.isGecko;isOpera=tinymce.isOpera;each=tinymce.each;extend=tinymce.extend;tinymce.create('tinymce.ForceBlocks',{ForceBlocks:function(ed){var t=this,s=ed.settings,elm;t.editor=ed;t.dom=ed.dom;elm=(s.forced_root_block||'p').toLowerCase();s.element=elm.toUpperCase();ed.onPreInit.add(t.setup,t);t.reOpera=new RegExp('(\\u00a0|&#160;|&nbsp;)<\/'+elm+'>','gi');t.rePadd=new RegExp('<p( )([^>]+)><\\\/p>|<p( )([^>]+)\\\/>|<p( )([^>]+)>\\s+<\\\/p>|<p><\\\/p>|<p\\\/>|<p>\\s+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR1=new RegExp('<p( )([^>]+)>[\\s\\u00a0]+<\\\/p>|<p>[\\s\\u00a0]+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR2=new RegExp('<p( )([^>]+)>(&nbsp;|&#160;)<\\\/p>|<p>(&nbsp;|&#160;)<\\\/p>'.replace(/p/g,elm),'gi');t.reBR2Nbsp=new RegExp('<p( )([^>]+)>\\s*<br \\\/>\\s*<\\\/p>|<p>\\s*<br \\\/>\\s*<\\\/p>'.replace(/p/g,elm),'gi');t.reTrailBr=new RegExp('\\s*<br \\/>\\s*<\\\/p>'.replace(/p/g,elm),'gi');function padd(ed,o){if(isOpera)o.content=o.content.replace(t.reOpera,'</'+elm+'>');o.content=o.content.replace(t.rePadd,'<'+elm+'$1$2$3$4$5$6>\u00a0</'+elm+'>');if(!isIE&&!isOpera&&o.set){o.content=o.content.replace(t.reNbsp2BR1,'<'+elm+'$1$2><br /></'+elm+'>');o.content=o.content.replace(t.reNbsp2BR2,'<'+elm+'$1$2><br /></'+elm+'>');}else{o.content=o.content.replace(t.reBR2Nbsp,'<'+elm+'$1$2>\u00a0</'+elm+'>');o.content=o.content.replace(t.reTrailBr,'</'+elm+'>');}};ed.onBeforeSetContent.add(padd);ed.onPostProcess.add(padd);if(s.forced_root_block){ed.onInit.add(t.forceRoots,t);ed.onSetContent.add(t.forceRoots,t);ed.onBeforeGetContent.add(t.forceRoots,t);}},setup:function(){var t=this,ed=t.editor,s=ed.settings;if(s.forced_root_block){ed.onKeyUp.add(t.forceRoots,t);ed.onPreProcess.add(t.forceRoots,t);}if(s.force_br_newlines){if(isIE){ed.onKeyPress.add(function(ed,e){var n,s=ed.selection;if(e.keyCode==13&&s.getNode().nodeName!='LI'){s.setContent('<br id="__" /> ',{format:'raw'});n=ed.dom.get('__');n.removeAttribute('id');s.select(n);s.collapse();return Event.cancel(e);}});}return;}if(!isIE&&s.force_p_newlines){ed.onKeyPress.add(function(ed,e){if(e.keyCode==13&&!e.shiftKey){if(!t.insertPara(e))Event.cancel(e);}});if(isGecko){ed.onKeyDown.add(function(ed,e){if((e.keyCode==8||e.keyCode==46)&&!e.shiftKey)t.backspaceDelete(e,e.keyCode==8);});}}function ren(rn,na){var ne=ed.dom.create(na);each(rn.attributes,function(a){if(a.specified&&a.nodeValue)ne.setAttribute(a.nodeName.toLowerCase(),a.nodeValue);});each(rn.childNodes,function(n){ne.appendChild(n.cloneNode(true));});rn.parentNode.replaceChild(ne,rn);return ne;};if(isIE&&s.element!='P'){ed.onKeyPress.add(function(ed,e){t.lastElm=ed.selection.getNode().nodeName;});ed.onKeyUp.add(function(ed,e){var bl,sel=ed.selection,n=sel.getNode(),b=ed.getBody();if(b.childNodes.length===1&&n.nodeName=='P'){n=ren(n,s.element);sel.select(n);sel.collapse();ed.nodeChanged();}else if(e.keyCode==13&&!e.shiftKey&&t.lastElm!='P'){bl=ed.dom.getParent(n,'P');if(bl){ren(bl,s.element);ed.nodeChanged();}}});}},find:function(n,t,s){var ed=this.editor,w=ed.getDoc().createTreeWalker(n,4,null,false),c=-1;while(n=w.nextNode()){c++;if(t==0&&n==s)return c;if(t==1&&c==s)return n;}return-1;},forceRoots:function(ed,e){var t=this,ed=t.editor,b=ed.getBody(),d=ed.getDoc(),se=ed.selection,s=se.getSel(),r=se.getRng(),si=-2,ei,so,eo,tr,c=-0xFFFFFF;var nx,bl,bp,sp,le,nl=b.childNodes,i;if(e&&e.keyCode==13)return true;for(i=nl.length-1;i>=0;i--){nx=nl[i];if(nx.nodeType==3||(!t.dom.isBlock(nx)&&nx.nodeType!=8)){if(!bl){if(nx.nodeType!=3||/[^\s]/g.test(nx.nodeValue)){if(si==-2&&r){if(!isIE){so=r.startOffset;eo=r.endOffset;si=t.find(b,0,r.startContainer);ei=t.find(b,0,r.endContainer);}else{tr=d.body.createTextRange();tr.moveToElementText(b);tr.collapse(1);bp=tr.move('character',c)*-1;tr=r.duplicate();tr.collapse(1);sp=tr.move('character',c)*-1;tr=r.duplicate();tr.collapse(0);le=(tr.move('character',c)*-1)-sp;si=sp-bp;ei=le;}}bl=ed.dom.create(ed.settings.forced_root_block);bl.appendChild(nx.cloneNode(1));nx.parentNode.replaceChild(bl,nx);}}else{if(bl.hasChildNodes())bl.insertBefore(nx,bl.firstChild);else bl.appendChild(nx);}}else bl=null;}if(si!=-2){if(!isIE){bl=d.getElementsByTagName(ed.settings.element)[0];r=d.createRange();if(si!=-1)r.setStart(t.find(b,1,si),so);else r.setStart(bl,0);if(ei!=-1)r.setEnd(t.find(b,1,ei),eo);else r.setEnd(bl,0);if(s){s.removeAllRanges();s.addRange(r);}}else{try{r=s.createRange();r.moveToElementText(b);r.collapse(1);r.moveStart('character',si);r.moveEnd('character',ei);r.select();}catch(ex){}}}},getParentBlock:function(n){var d=this.dom;return d.getParent(n,d.isBlock);},insertPara:function(e){var t=this,ed=t.editor,dom=ed.dom,d=ed.getDoc(),se=ed.settings,s=ed.selection.getSel(),r=s.getRangeAt(0),b=d.body;var rb,ra,dir,sn,so,en,eo,sb,eb,bn,bef,aft,sc,ec,n,vp=dom.getViewPort(ed.getWin()),y,ch;function isEmpty(n){n=n.innerHTML;n=n.replace(/<(img|hr|table)/gi,'-');n=n.replace(/<[^>]+>/g,'');return n.replace(/[ \t\r\n]+/g,'')=='';};rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(true);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(true);dir=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;sn=dir?s.anchorNode:s.focusNode;so=dir?s.anchorOffset:s.focusOffset;en=dir?s.focusNode:s.anchorNode;eo=dir?s.focusOffset:s.anchorOffset;if(sn===en&&/^(TD|TH)$/.test(sn.nodeName)){dom.remove(sn.firstChild);ed.dom.add(sn,se.element,null,'<br />');aft=ed.dom.add(sn,se.element,null,'<br />');r=d.createRange();r.selectNodeContents(aft);r.collapse(1);ed.selection.setRng(r);return false;}if(sn==b&&en==b&&b.firstChild&&ed.dom.isBlock(b.firstChild)){sn=en=sn.firstChild;so=eo=0;rb=d.createRange();rb.setStart(sn,0);ra=d.createRange();ra.setStart(en,0);}sn=sn.nodeName=="HTML"?d.body:sn;sn=sn.nodeName=="BODY"?sn.firstChild:sn;en=en.nodeName=="HTML"?d.body:en;en=en.nodeName=="BODY"?en.firstChild:en;sb=t.getParentBlock(sn);eb=t.getParentBlock(en);bn=sb?sb.nodeName:se.element;if(t.dom.getParent(sb,function(n){return/OL|UL|PRE/.test(n.nodeName);}))return true;if(sb&&(sb.nodeName=='CAPTION'||/absolute|relative|static/gi.test(sb.style.position))){bn=se.element;sb=null;}if(eb&&(eb.nodeName=='CAPTION'||/absolute|relative|static/gi.test(eb.style.position))){bn=se.element;eb=null;}if(/(TD|TABLE|TH|CAPTION)/.test(bn)||(sb&&bn=="DIV"&&/left|right/gi.test(sb.style.cssFloat))){bn=se.element;sb=eb=null;}bef=(sb&&sb.nodeName==bn)?sb.cloneNode(0):ed.dom.create(bn);aft=(eb&&eb.nodeName==bn)?eb.cloneNode(0):ed.dom.create(bn);aft.removeAttribute('id');if(/^(H[1-6])$/.test(bn)&&sn.nodeValue&&so==sn.nodeValue.length)aft=ed.dom.create(se.element);n=sc=sn;do{if(n==b||n.nodeType==9||t.dom.isBlock(n)||/(TD|TABLE|TH|CAPTION)/.test(n.nodeName))break;sc=n;}while((n=n.previousSibling?n.previousSibling:n.parentNode));n=ec=en;do{if(n==b||n.nodeType==9||t.dom.isBlock(n)||/(TD|TABLE|TH|CAPTION)/.test(n.nodeName))break;ec=n;}while((n=n.nextSibling?n.nextSibling:n.parentNode));if(sc.nodeName==bn)rb.setStart(sc,0);else rb.setStartBefore(sc);rb.setEnd(sn,so);bef.appendChild(rb.cloneContents()||d.createTextNode(''));try{ra.setEndAfter(ec);}catch(ex){}ra.setStart(en,eo);aft.appendChild(ra.cloneContents()||d.createTextNode(''));r=d.createRange();if(!sc.previousSibling&&sc.parentNode.nodeName==bn){r.setStartBefore(sc.parentNode);}else{if(rb.startContainer.nodeName==bn&&rb.startOffset==0)r.setStartBefore(rb.startContainer);else r.setStart(rb.startContainer,rb.startOffset);}if(!ec.nextSibling&&ec.parentNode.nodeName==bn)r.setEndAfter(ec.parentNode);else r.setEnd(ra.endContainer,ra.endOffset);r.deleteContents();if(isOpera)ed.getWin().scrollTo(0,vp.y);if(bef.firstChild&&bef.firstChild.nodeName==bn)bef.innerHTML=bef.firstChild.innerHTML;if(aft.firstChild&&aft.firstChild.nodeName==bn)aft.innerHTML=aft.firstChild.innerHTML;if(isEmpty(bef))bef.innerHTML='<br />';if(isEmpty(aft))aft.innerHTML=isOpera?'&nbsp;':'<br />';if(isOpera){r.insertNode(bef);r.insertNode(aft);}else{r.insertNode(aft);r.insertNode(bef);}aft.normalize();bef.normalize();r=d.createRange();r.selectNodeContents(aft);r.collapse(1);s.removeAllRanges();s.addRange(r);y=ed.dom.getPos(aft).y;ch=aft.clientHeight;if(y<vp.y||y+ch>vp.y+vp.h){ed.getWin().scrollTo(0,y<vp.y?y:y-vp.h+ch);}return false;},backspaceDelete:function(e,bs){var t=this,ed=t.editor,b=ed.getBody(),n,se=ed.selection,r=se.getRng(),sc=r.startContainer,n,w,tn;if(sc&&ed.dom.isBlock(sc)&&!/^(TD|TH)$/.test(sc.nodeName)&&bs){if(sc.childNodes.length==0||(sc.childNodes.length==1&&sc.firstChild.nodeName=='BR')){n=sc;while((n=n.previousSibling)&&!ed.dom.isBlock(n));if(n){if(sc!=b.firstChild){w=ed.dom.doc.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while(tn=w.nextNode())n=tn;r=ed.getDoc().createRange();r.setStart(n,n.nodeValue?n.nodeValue.length:0);r.setEnd(n,n.nodeValue?n.nodeValue.length:0);se.setRng(r);ed.dom.remove(sc);}return Event.cancel(e);}}}function handler(e){e=e.target;if(e&&e.parentNode&&e.nodeName=='BR'&&(n=t.getParentBlock(e))){Event.remove(b,'DOMNodeInserted',handler);if(e.previousSibling||e.nextSibling)ed.dom.remove(e);}};Event._add(b,'DOMNodeInserted',handler);window.setTimeout(function(){Event._remove(b,'DOMNodeInserted',handler);},1);}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,extend=tinymce.extend;tinymce.create('tinymce.ControlManager',{ControlManager:function(ed,s){var t=this,i;s=s||{};t.editor=ed;t.controls={};t.onAdd=new tinymce.util.Dispatcher(t);t.onPostRender=new tinymce.util.Dispatcher(t);t.prefix=s.prefix||ed.id+'_';t._cls={};t.onPostRender.add(function(){each(t.controls,function(c){c.postRender();});});},get:function(id){return this.controls[this.prefix+id]||this.controls[id];},setActive:function(id,s){var c=null;if(c=this.get(id))c.setActive(s);return c;},setDisabled:function(id,s){var c=null;if(c=this.get(id))c.setDisabled(s);return c;},add:function(c){var t=this;if(c){t.controls[c.id]=c;t.onAdd.dispatch(c,t);}return c;},createControl:function(n){var c,t=this,ed=t.editor;each(ed.plugins,function(p){if(p.createControl){c=p.createControl(n,t);if(c)return false;}});switch(n){case"|":case"separator":return t.createSeparator();}if(!c&&ed.buttons&&(c=ed.buttons[n]))return t.createButton(n,c);return t.add(c);},createDropMenu:function(id,s,cc){var t=this,ed=t.editor,c,bm,v,cls;s=extend({'class':'mceDropDown',constrain:ed.settings.constrain_menus},s);s['class']=s['class']+' '+ed.getParam('skin')+'Skin';if(v=ed.getParam('skin_variant'))s['class']+=' '+ed.getParam('skin')+'Skin'+v.substring(0,1).toUpperCase()+v.substring(1);id=t.prefix+id;cls=cc||t._cls.dropmenu||tinymce.ui.DropMenu;c=t.controls[id]=new cls(id,s);c.onAddItem.add(function(c,o){var s=o.settings;s.title=ed.getLang(s.title,s.title);if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,s.value);};}});ed.onRemove.add(function(){c.destroy();});if(tinymce.isIE){c.onShowMenu.add(function(){var s=ed.selection,n=s.getNode();if(n.nodeName=='IMG')bm=s.getBookmark();else bm=0;});c.onHideMenu.add(function(){if(bm)ed.selection.moveToBookmark(bm);});}return t.add(c);},createListBox:function(id,s,cc){var t=this,ed=t.editor,cmd,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':'mce_'+id,scope:s.scope,control_manager:t},s);id=t.prefix+id;if(ed.settings.use_native_selects)c=new tinymce.ui.NativeListBox(id,s);else{cls=cc||t._cls.listbox||tinymce.ui.ListBox;c=new cls(id,s);}t.controls[id]=c;if(tinymce.isWebKit){c.onPostRender.add(function(c,n){Event.add(n,'mousedown',function(){ed.bookmark=ed.selection.getBookmark('simple');});Event.add(n,'focus',function(){ed.selection.moveToBookmark(ed.bookmark);ed.bookmark=null;});});}if(c.hideMenu)ed.onMouseDown.add(c.hideMenu,c);return t.add(c);},createButton:function(id,s,cc){var t=this,ed=t.editor,o,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.label=ed.translate(s.label);s.scope=s.scope||ed;if(!s.onclick&&!s.menu_button){s.onclick=function(){ed.execCommand(s.cmd,s.ui||false,s.value);};}s=extend({title:s.title,'class':'mce_'+id,unavailable_prefix:ed.getLang('unavailable',''),scope:s.scope,control_manager:t},s);id=t.prefix+id;if(s.menu_button){cls=cc||t._cls.menubutton||tinymce.ui.MenuButton;c=new cls(id,s);ed.onMouseDown.add(c.hideMenu,c);}else{cls=t._cls.button||tinymce.ui.Button;c=new cls(id,s);}return t.add(c);},createMenuButton:function(id,s){s=s||{};s.menu_button=1;return this.createButton(id,s);},createSplitButton:function(id,s,cc){var t=this,ed=t.editor,cmd,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':'mce_'+id,scope:s.scope,control_manager:t},s);id=t.prefix+id;cls=cc||t._cls.splitbutton||tinymce.ui.SplitButton;c=t.add(new cls(id,s));ed.onMouseDown.add(c.hideMenu,c);return c;},createColorSplitButton:function(id,s,cc){var t=this,ed=t.editor,cmd,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':'mce_'+id,'menu_class':ed.getParam('skin')+'Skin',scope:s.scope,more_colors_title:ed.getLang('more_colors')},s);id=t.prefix+id;cls=cc||t._cls.colorsplitbutton||tinymce.ui.ColorSplitButton;c=new cls(id,s);ed.onMouseDown.add(c.hideMenu,c);ed.onRemove.add(function(){c.destroy();});return t.add(c);},createToolbar:function(id,s,cc){var c,t=this,cls;id=t.prefix+id;cls=cc||t._cls.toolbar||tinymce.ui.Toolbar;c=new cls(id,s);if(t.get(id))return null;return t.add(c);},createSeparator:function(cc){var cls=cc||this._cls.separator||tinymce.ui.Separator;return new cls();},setControlType:function(n,c){return this._cls[n.toLowerCase()]=c;},destroy:function(){each(this.controls,function(c){c.destroy();});this.controls=null;}});})();(function(){var Dispatcher=tinymce.util.Dispatcher,each=tinymce.each,isIE=tinymce.isIE,isOpera=tinymce.isOpera;tinymce.create('tinymce.WindowManager',{WindowManager:function(ed){var t=this;t.editor=ed;t.onOpen=new Dispatcher(t);t.onClose=new Dispatcher(t);t.params={};t.features={};},open:function(s,p){var t=this,f='',x,y,mo=t.editor.settings.dialog_type=='modal',w,sw,sh,vp=tinymce.DOM.getViewPort(),u;s=s||{};p=p||{};sw=isOpera?vp.w:screen.width;sh=isOpera?vp.h:screen.height;s.name=s.name||'mc_'+new Date().getTime();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240);s.resizable=true;s.left=s.left||parseInt(sw/ 2.0) - (s.width /2.0);s.top=s.top||parseInt(sh/ 2.0) - (s.height /2.0);p.inline=false;p.mce_width=s.width;p.mce_height=s.height;p.mce_auto_focus=s.auto_focus;if(mo){if(isIE){s.center=true;s.help=false;s.dialogWidth=s.width+'px';s.dialogHeight=s.height+'px';s.scroll=s.scrollbars||false;}else s.modal=s.alwaysRaised=s.dialog=s.centerscreen=s.dependent=true;}each(s,function(v,k){if(tinymce.is(v,'boolean'))v=v?'yes':'no';if(!/^(name|url)$/.test(k)){if(isIE&&mo)f+=(f?';':'')+k+':'+v;else f+=(f?',':'')+k+'='+v;}});t.features=s;t.params=p;t.onOpen.dispatch(t,s,p);u=s.url||s.file;if(tinymce.relaxedDomain)u+=(u.indexOf('?')==-1?'?':'&')+'mce_rdomain='+tinymce.relaxedDomain;u=tinymce._addVer(u);try{if(isIE&&mo){w=1;window.showModalDialog(u,window,f);}else w=window.open(u,s.name,f);}catch(ex){}if(!w)alert(t.editor.getLang('popup_blocked'));},close:function(w){w.close();this.onClose.dispatch(this);},createInstance:function(cl,a,b,c,d,e){var f=tinymce.resolve(cl);return new f(a,b,c,d,e);},confirm:function(t,cb,s){cb.call(s||this,confirm(this._decode(this.editor.getLang(t,t))));},alert:function(tx,cb,s){var t=this;alert(t._decode(t.editor.getLang(tx,tx)));if(cb)cb.call(s||t);},_decode:function(s){return tinymce.DOM.decode(s).replace(/\\n/g,'\n');}});}());
+var tinymce={majorVersion:'3',minorVersion:'0.9',releaseDate:'2008-06-02',_init:function(){var t=this,d=document,w=window,na=navigator,ua=na.userAgent,i,nl,n,base,p,v;t.isOpera=w.opera&&opera.buildNumber;t.isWebKit=/WebKit/.test(ua);t.isOldWebKit=t.isWebKit&&!w.getSelection().getRangeAt;t.isIE=!t.isWebKit&&!t.isOpera&&(/MSIE/gi).test(ua)&&(/Explorer/gi).test(na.appName);t.isIE6=t.isIE&&/MSIE [56]/.test(ua);t.isGecko=!t.isWebKit&&/Gecko/.test(ua);t.isMac=ua.indexOf('Mac')!=-1;if(w.tinyMCEPreInit){t.suffix=tinyMCEPreInit.suffix;t.baseURL=tinyMCEPreInit.base;t.query=tinyMCEPreInit.query;return;}t.suffix='';nl=d.getElementsByTagName('base');for(i=0;i<nl.length;i++){if(v=nl[i].href){if(/^https?:\/\/[^\/]+$/.test(v))v+='/';base=v?v.match(/.*\//)[0]:'';}}function getBase(n){if(n.src&&/tiny_mce(|_dev|_src|_gzip|_jquery|_prototype).js/.test(n.src)){if(/_(src|dev)\.js/g.test(n.src))t.suffix='_src';if((p=n.src.indexOf('?'))!=-1)t.query=n.src.substring(p+1);t.baseURL=n.src.substring(0,n.src.lastIndexOf('/'));if(base&&t.baseURL.indexOf('://')==-1)t.baseURL=base+t.baseURL;return t.baseURL;}return null;};nl=d.getElementsByTagName('script');for(i=0;i<nl.length;i++){if(getBase(nl[i]))return;}n=d.getElementsByTagName('head')[0];if(n){nl=n.getElementsByTagName('script');for(i=0;i<nl.length;i++){if(getBase(nl[i]))return;}}return;},is:function(o,t){var n=typeof(o);if(!t)return n!='undefined';if(t=='array'&&(o instanceof Array))return true;return n==t;},each:function(o,cb,s){var n,l;if(!o)return 0;s=s||o;if(typeof(o.length)!='undefined'){for(n=0,l=o.length;n<l;n++){if(cb.call(s,o[n],n,o)===false)return 0;}}else{for(n in o){if(o.hasOwnProperty(n)){if(cb.call(s,o[n],n,o)===false)return 0;}}}return 1;},map:function(a,f){var o=[];tinymce.each(a,function(v){o.push(f(v));});return o;},grep:function(a,f){var o=[];tinymce.each(a,function(v){if(!f||f(v))o.push(v);});return o;},inArray:function(a,v){var i,l;if(a){for(i=0,l=a.length;i<l;i++){if(a[i]===v)return i;}}return-1;},extend:function(o,e){var i,a=arguments;for(i=1;i<a.length;i++){e=a[i];tinymce.each(e,function(v,n){if(typeof(v)!=='undefined')o[n]=v;});}return o;},trim:function(s){return(s?''+s:'').replace(/^\s*|\s*$/g,'');},create:function(s,p){var t=this,sp,ns,cn,scn,c,de=0;s=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);cn=s[3].match(/(^|\.)(\w+)$/i)[2];ns=t.createNS(s[3].replace(/\.\w+$/,''));if(ns[cn])return;if(s[2]=='static'){ns[cn]=p;if(this.onCreate)this.onCreate(s[2],s[3],ns[cn]);return;}if(!p[cn]){p[cn]=function(){};de=1;}ns[cn]=p[cn];t.extend(ns[cn].prototype,p);if(s[5]){sp=t.resolve(s[5]).prototype;scn=s[5].match(/\.(\w+)$/i)[1];c=ns[cn];if(de){ns[cn]=function(){return sp[scn].apply(this,arguments);};}else{ns[cn]=function(){this.parent=sp[scn];return c.apply(this,arguments);};}ns[cn].prototype[cn]=ns[cn];t.each(sp,function(f,n){ns[cn].prototype[n]=sp[n];});t.each(p,function(f,n){if(sp[n]){ns[cn].prototype[n]=function(){this.parent=sp[n];return f.apply(this,arguments);};}else{if(n!=cn)ns[cn].prototype[n]=f;}});}t.each(p['static'],function(f,n){ns[cn][n]=f;});if(this.onCreate)this.onCreate(s[2],s[3],ns[cn].prototype);},walk:function(o,f,n,s){s=s||this;if(o){if(n)o=o[n];tinymce.each(o,function(o,i){if(f.call(s,o,i,n)===false)return false;tinymce.walk(o,f,n,s);});}},createNS:function(n,o){var i,v;o=o||window;n=n.split('.');for(i=0;i<n.length;i++){v=n[i];if(!o[v])o[v]={};o=o[v];}return o;},resolve:function(n,o){var i,l;o=o||window;n=n.split('.');for(i=0,l=n.length;i<l;i++){o=o[n[i]];if(!o)break;}return o;},addUnload:function(f,s){var t=this,w=window;f={func:f,scope:s||this};if(!t.unloads){function unload(){var li=t.unloads,o,n;if(li){for(n in li){o=li[n];if(o&&o.func)o.func.call(o.scope,1);}if(w.detachEvent){w.detachEvent('onbeforeunload',fakeUnload);w.detachEvent('onunload',unload);}else if(w.removeEventListener)w.removeEventListener('unload',unload,false);t.unloads=o=li=w=unload=null;if(window.CollectGarbage)window.CollectGarbage();}};function fakeUnload(){var d=document;if(d.readyState=='interactive'){function stop(){d.detachEvent('onstop',stop);unload();d=null;};d.attachEvent('onstop',stop);window.setTimeout(function(){d.detachEvent('onstop',stop);},0);}};if(w.attachEvent){w.attachEvent('onunload',unload);w.attachEvent('onbeforeunload',fakeUnload);}else if(w.addEventListener)w.addEventListener('unload',unload,false);t.unloads=[f];}else t.unloads.push(f);return f;},removeUnload:function(f){var u=this.unloads,r=null;tinymce.each(u,function(o,i){if(o&&o.func==f){u.splice(i,1);r=f;return false;}});return r;},explode:function(s,d){return s?tinymce.map(s.split(d||','),tinymce.trim):s;},_addVer:function(u){var v;if(!this.query)return u;v=(u.indexOf('?')==-1?'?':'&')+this.query;if(u.indexOf('#')==-1)return u+v;return u.replace('#',v+'#');}};window.tinymce=tinymce;tinymce._init();tinymce.create('tinymce.util.Dispatcher',{scope:null,listeners:null,Dispatcher:function(s){this.scope=s||this;this.listeners=[];},add:function(cb,s){this.listeners.push({cb:cb,scope:s||this.scope});return cb;},addToTop:function(cb,s){this.listeners.unshift({cb:cb,scope:s||this.scope});return cb;},remove:function(cb){var l=this.listeners,o=null;tinymce.each(l,function(c,i){if(cb==c.cb){o=cb;l.splice(i,1);return false;}});return o;},dispatch:function(){var s,a=arguments,i,li=this.listeners,c;for(i=0;i<li.length;i++){c=li[i];s=c.cb.apply(c.scope,a);if(s===false)break;}return s;}});(function(){var each=tinymce.each;tinymce.create('tinymce.util.URI',{URI:function(u,s){var t=this,o,a,b;s=t.settings=s||{};if(/^(mailto|news|javascript|about):/i.test(u)||/^\s*#/.test(u)){t.source=u;return;}if(u.indexOf('/')===0&&u.indexOf('//')!==0)u=(s.base_uri?s.base_uri.protocol||'http':'http')+'://mce_host'+u;if(u.indexOf('://')===-1&&u.indexOf('//')!==0)u=(s.base_uri.protocol||'http')+'://mce_host'+t.toAbsPath(s.base_uri.path,u);u=u.replace(/@@/g,'(mce_at)');u=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u);each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(v,i){var s=u[i];if(s)s=s.replace(/\(mce_at\)/g,'@@');t[v]=s;});if(b=s.base_uri){if(!t.protocol)t.protocol=b.protocol;if(!t.userInfo)t.userInfo=b.userInfo;if(!t.port&&t.host=='mce_host')t.port=b.port;if(!t.host||t.host=='mce_host')t.host=b.host;t.source='';}},setPath:function(p){var t=this;p=/^(.*?)\/?(\w+)?$/.exec(p);t.path=p[0];t.directory=p[1];t.file=p[2];t.source='';t.getURI();},toRelative:function(u){var t=this,o;u=new tinymce.util.URI(u,{base_uri:t});if((u.host!='mce_host'&&t.host!=u.host&&u.host)||t.port!=u.port||t.protocol!=u.protocol)return u.getURI();o=t.toRelPath(t.path,u.path);if(u.query)o+='?'+u.query;if(u.anchor)o+='#'+u.anchor;return o;},toAbsolute:function(u,nh){var u=new tinymce.util.URI(u,{base_uri:this});return u.getURI(this.host==u.host?nh:0);},toRelPath:function(base,path){var items,bp=0,out='',i;base=base.substring(0,base.lastIndexOf('/'));base=base.split('/');items=path.split('/');if(base.length>=items.length){for(i=0;i<base.length;i++){if(i>=items.length||base[i]!=items[i]){bp=i+1;break;}}}if(base.length<items.length){for(i=0;i<items.length;i++){if(i>=base.length||base[i]!=items[i]){bp=i+1;break;}}}if(bp==1)return path;for(i=0;i<base.length-(bp-1);i++)out+="../";for(i=bp-1;i<items.length;i++){if(i!=bp-1)out+="/"+items[i];else out+=items[i];}return out;},toAbsPath:function(base,path){var i,nb=0,o=[];base=base.split('/');path=path.split('/');each(base,function(k){if(k)o.push(k);});base=o;for(i=path.length-1,o=[];i>=0;i--){if(path[i].length==0||path[i]==".")continue;if(path[i]=='..'){nb++;continue;}if(nb>0){nb--;continue;}o.push(path[i]);}i=base.length-nb;if(i<=0)return'/'+o.reverse().join('/');return'/'+base.slice(0,i).join('/')+'/'+o.reverse().join('/');},getURI:function(nh){var s,t=this;if(!t.source||nh){s='';if(!nh){if(t.protocol)s+=t.protocol+'://';if(t.userInfo)s+=t.userInfo+'@';if(t.host)s+=t.host;if(t.port)s+=':'+t.port;}if(t.path)s+=t.path;if(t.query)s+='?'+t.query;if(t.anchor)s+='#'+t.anchor;t.source=s;}return t.source;}});})();(function(){var each=tinymce.each;tinymce.create('static tinymce.util.Cookie',{getHash:function(n){var v=this.get(n),h;if(v){each(v.split('&'),function(v){v=v.split('=');h=h||{};h[unescape(v[0])]=unescape(v[1]);});}return h;},setHash:function(n,v,e,p,d,s){var o='';each(v,function(v,k){o+=(!o?'':'&')+escape(k)+'='+escape(v);});this.set(n,o,e,p,d,s);},get:function(n){var c=document.cookie,e,p=n+"=",b;if(!c)return;b=c.indexOf("; "+p);if(b==-1){b=c.indexOf(p);if(b!=0)return null;}else b+=2;e=c.indexOf(";",b);if(e==-1)e=c.length;return unescape(c.substring(b+p.length,e));},set:function(n,v,e,p,d,s){document.cookie=n+"="+escape(v)+((e)?"; expires="+e.toGMTString():"")+((p)?"; path="+escape(p):"")+((d)?"; domain="+d:"")+((s)?"; secure":"");},remove:function(n,p){var d=new Date();d.setTime(d.getTime()-1000);this.set(n,'',d,p,d);}});})();tinymce.create('static tinymce.util.JSON',{serialize:function(o){var i,v,s=tinymce.util.JSON.serialize,t;if(o==null)return'null';t=typeof o;if(t=='string'){v='\bb\tt\nn\ff\rr\""\'\'\\\\';return'"'+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'])/g,function(a,b){i=v.indexOf(b);if(i+1)return'\\'+v.charAt(i+1);a=b.charCodeAt().toString(16);return'\\u'+'0000'.substring(a.length)+a;})+'"';}if(t=='object'){if(o instanceof Array){for(i=0,v='[';i<o.length;i++)v+=(i>0?',':'')+s(o[i]);return v+']';}v='{';for(i in o)v+=typeof o[i]!='function'?(v.length>1?',"':'"')+i+'":'+s(o[i]):'';return v+'}';}return''+o;},parse:function(s){try{return eval('('+s+')');}catch(ex){}}});tinymce.create('static tinymce.util.XHR',{send:function(o){var x,t,w=window,c=0;o.scope=o.scope||this;o.success_scope=o.success_scope||o.scope;o.error_scope=o.error_scope||o.scope;o.async=o.async===false?false:true;o.data=o.data||'';function get(s){x=0;try{x=new ActiveXObject(s);}catch(ex){}return x;};x=w.XMLHttpRequest?new XMLHttpRequest():get('Microsoft.XMLHTTP')||get('Msxml2.XMLHTTP');if(x){if(x.overrideMimeType)x.overrideMimeType(o.content_type);x.open(o.type||(o.data?'POST':'GET'),o.url,o.async);if(o.content_type)x.setRequestHeader('Content-Type',o.content_type);x.send(o.data);function ready(){if(!o.async||x.readyState==4||c++>10000){if(o.success&&c<10000&&x.status==200)o.success.call(o.success_scope,''+x.responseText,x,o);else if(o.error)o.error.call(o.error_scope,c>10000?'TIMED_OUT':'GENERAL',x,o);x=null;}else w.setTimeout(ready,10);};if(!o.async)return ready();t=w.setTimeout(ready,10);}}});(function(){var extend=tinymce.extend,JSON=tinymce.util.JSON,XHR=tinymce.util.XHR;tinymce.create('tinymce.util.JSONRequest',{JSONRequest:function(s){this.settings=extend({},s);this.count=0;},send:function(o){var ecb=o.error,scb=o.success;o=extend(this.settings,o);o.success=function(c,x){c=JSON.parse(c);if(typeof(c)=='undefined'){c={error:'JSON Parse error.'};}if(c.error)ecb.call(o.error_scope||o.scope,c.error,x);else scb.call(o.success_scope||o.scope,c.result);};o.error=function(ty,x){ecb.call(o.error_scope||o.scope,ty,x);};o.data=JSON.serialize({id:o.id||'c'+(this.count++),method:o.method,params:o.params});o.content_type='application/json';XHR.send(o);},'static':{sendRPC:function(o){return new tinymce.util.JSONRequest().send(o);}}});}());(function(){var each=tinymce.each,is=tinymce.is;var isWebKit=tinymce.isWebKit,isIE=tinymce.isIE;tinymce.create('tinymce.dom.DOMUtils',{doc:null,root:null,files:null,listeners:{},pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,cache:{},idPattern:/^#[\w]+$/,elmPattern:/^[\w_*]+$/,elmClassPattern:/^([\w_]*)\.([\w_]+)$/,DOMUtils:function(d,s){var t=this;t.doc=d;t.win=window;t.files={};t.cssFlicker=false;t.counter=0;t.boxModel=!tinymce.isIE||d.compatMode=="CSS1Compat";t.stdMode=d.documentMode===8;this.settings=s=tinymce.extend({keep_values:false,hex_colors:1,process_html:1},s);if(tinymce.isIE6){try{d.execCommand('BackgroundImageCache',false,true);}catch(e){t.cssFlicker=true;}}tinymce.addUnload(t.destroy,t);},getRoot:function(){var t=this,s=t.settings;return(s&&t.get(s.root_element))||t.doc.body;},getViewPort:function(w){var d,b;w=!w?this.win:w;d=w.document;b=this.boxModel?d.documentElement:d.body;return{x:w.pageXOffset||b.scrollLeft,y:w.pageYOffset||b.scrollTop,w:w.innerWidth||b.clientWidth,h:w.innerHeight||b.clientHeight};},getRect:function(e){var p,t=this,w,h;e=t.get(e);p=t.getPos(e);w=t.getStyle(e,'width');h=t.getStyle(e,'height');if(w.indexOf('px')===-1)w=0;if(h.indexOf('px')===-1)h=0;return{x:p.x,y:p.y,w:parseInt(w)||e.offsetWidth||e.clientWidth,h:parseInt(h)||e.offsetHeight||e.clientHeight};},getParent:function(n,f,r){var na,se=this.settings;n=this.get(n);if(se.strict_root)r=r||this.getRoot();if(is(f,'string')){na=f.toUpperCase();f=function(n){var s=false;if(n.nodeType==1&&na==='*'){s=true;return false;}each(na.split(','),function(v){if(n.nodeType==1&&((se.strict&&n.nodeName.toUpperCase()==v)||n.nodeName.toUpperCase()==v)){s=true;return false;}});return s;};}while(n){if(n==r)return null;if(f(n))return n;n=n.parentNode;}return null;},get:function(e){var n;if(e&&this.doc&&typeof(e)=='string'){n=e;e=this.doc.getElementById(e);if(e&&e.id!==n)return this.doc.getElementsByName(n)[1];}return e;},select:function(pa,s){var t=this,cs,c,pl,o=[],x,i,l,n;s=t.get(s)||t.doc;if(s.querySelectorAll){if(s!=t.doc){i=s.id;s.id='_mc_tmp';pa='#_mc_tmp '+pa;}l=tinymce.grep(s.querySelectorAll(pa));s.id=i;return l;}if(t.settings.strict){function get(s,n){return s.getElementsByTagName(n.toLowerCase());};}else{function get(s,n){return s.getElementsByTagName(n);};}if(t.elmPattern.test(pa)){x=get(s,pa);for(i=0,l=x.length;i<l;i++)o.push(x[i]);return o;}if(t.elmClassPattern.test(pa)){pl=t.elmClassPattern.exec(pa);x=get(s,pl[1]||'*');c=' '+pl[2]+' ';for(i=0,l=x.length;i<l;i++){n=x[i];if(n.className&&(' '+n.className+' ').indexOf(c)!==-1)o.push(n);}return o;}function collect(n){if(!n.mce_save){n.mce_save=1;o.push(n);}};function collectIE(n){if(!n.getAttribute('mce_save')){n.setAttribute('mce_save','1');o.push(n);}};function find(n,f,r){var i,l,nl=get(r,n);for(i=0,l=nl.length;i<l;i++)f(nl[i]);};each(pa.split(','),function(v,i){v=tinymce.trim(v);if(t.elmPattern.test(v)){each(get(s,v),function(n){collect(n);});return;}if(t.elmClassPattern.test(v)){x=t.elmClassPattern.exec(v);each(get(s,x[1]),function(n){if(t.hasClass(n,x[2]))collect(n);});return;}if(!(cs=t.cache[pa])){cs='x=(function(cf, s) {';pl=v.split(' ');each(pl,function(v){var p=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@([\w\\]+)([\^\$\*!]?=)([\w\\]+)\])?(?:\:([\w\\]+))?/i.exec(v);p[1]=p[1]||'*';cs+='find("'+p[1]+'", function(n) {';if(p[2])cs+='if (n.id !== "'+p[2]+'") return;';if(p[3]){cs+='var c = " " + n.className + " ";';cs+='if (';c='';each(p[3].split('.'),function(v){if(v)c+=(c?'||':'')+'c.indexOf(" '+v+' ") === -1';});cs+=c+') return;';}});cs+='cf(n);';for(i=pl.length-1;i>=0;i--)cs+='}, '+(i?'n':'s')+');';cs+='})';t.cache[pa]=cs=eval(cs);}cs(isIE?collectIE:collect,s);});each(o,function(n){if(isIE)n.removeAttribute('mce_save');else delete n.mce_save;});return o;},add:function(p,n,a,h,c){var t=this;return this.run(p,function(p){var e,k;e=is(n,'string')?t.doc.createElement(n):n;if(a){for(k in a){if(a.hasOwnProperty(k)&&!is(a[k],'object'))t.setAttrib(e,k,''+a[k]);}if(a.style&&!is(a.style,'string')){each(a.style,function(v,n){t.setStyle(e,n,v);});}}if(h){if(h.nodeType)e.appendChild(h);else t.setHTML(e,h);}return!c?p.appendChild(e):e;});},create:function(n,a,h){return this.add(this.doc.createElement(n),n,a,h,1);},createHTML:function(n,a,h){var o='',t=this,k;o+='<'+n;for(k in a){if(a.hasOwnProperty(k))o+=' '+k+'="'+t.encode(a[k])+'"';}if(tinymce.is(h))return o+'>'+h+'</'+n+'>';return o+' />';},remove:function(n,k){return this.run(n,function(n){var p,g;p=n.parentNode;if(!p)return null;if(k){each(n.childNodes,function(c){p.insertBefore(c.cloneNode(true),n);});}return p.removeChild(n);});},setStyle:function(n,na,v){var t=this;return t.run(n,function(e){var s,i;s=e.style;na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase();});if(t.pixelStyles.test(na)&&(tinymce.is(v,'number')||/^[\-0-9\.]+$/.test(v)))v+='px';switch(na){case'opacity':if(isIE){s.filter=v===''?'':"alpha(opacity="+(v*100)+")";if(!n.currentStyle||!n.currentStyle.hasLayout)s.display='inline-block';}s[na]=s['-moz-opacity']=s['-khtml-opacity']=v||'';break;case'float':isIE?s.styleFloat=v:s.cssFloat=v;break;default:s[na]=v||'';}if(t.settings.update_styles)t.setAttrib(e,'mce_style');});},getStyle:function(n,na,c){n=this.get(n);if(!n)return false;if(this.doc.defaultView&&c){na=na.replace(/[A-Z]/g,function(a){return'-'+a;});try{return this.doc.defaultView.getComputedStyle(n,null).getPropertyValue(na);}catch(ex){return null;}}na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase();});if(na=='float')na=isIE?'styleFloat':'cssFloat';if(n.currentStyle&&c)return n.currentStyle[na];return n.style[na];},setStyles:function(e,o){var t=this,s=t.settings,ol;ol=s.update_styles;s.update_styles=0;each(o,function(v,n){t.setStyle(e,n,v);});s.update_styles=ol;if(s.update_styles)t.setAttrib(e,s.cssText);},setAttrib:function(e,n,v){var t=this;if(t.settings.strict)n=n.toLowerCase();return this.run(e,function(e){var s=t.settings;switch(n){case"style":if(s.keep_values){if(v&&!t._isRes(v))e.setAttribute('mce_style',v,2);else e.removeAttribute('mce_style',2);}e.style.cssText=v;break;case"class":e.className=v||'';break;case"src":case"href":if(s.keep_values){if(s.url_converter)v=s.url_converter.call(s.url_converter_scope||t,v,n,e);t.setAttrib(e,'mce_'+n,v,2);}break;}if(is(v)&&v!==null&&v.length!==0)e.setAttribute(n,''+v,2);else e.removeAttribute(n,2);});},setAttribs:function(e,o){var t=this;return this.run(e,function(e){each(o,function(v,n){t.setAttrib(e,n,v);});});},getAttrib:function(e,n,dv){var v,t=this;e=t.get(e);if(!e||e.nodeType!==1)return false;if(!is(dv))dv="";if(/^(src|href|style|coords)$/.test(n)){v=e.getAttribute("mce_"+n);if(v)return v;}v=e.getAttribute(n,2);if(!v){switch(n){case'class':v=e.className;break;default:if(isIE&&n==='name'&&e.nodeName==='A'){v=e.name;break;}v=e.attributes[n];v=v&&is(v.nodeValue)?v.nodeValue:v;}}switch(n){case'style':v=v||e.style.cssText;if(v){v=t.serializeStyle(t.parseStyle(v));if(t.settings.keep_values&&!t._isRes(v))e.setAttribute('mce_style',v);}break;}if(isWebKit&&n==="class"&&v)v=v.replace(/(apple|webkit)\-[a-z\-]+/gi,'');if(isIE){switch(n){case'rowspan':case'colspan':if(v===1)v='';break;case'size':if(v==='+0')v='';break;case'hspace':if(v===-1)v='';break;case'tabindex':if(v===32768)v='';break;case'shape':v=v.toLowerCase();break;default:if(n.indexOf('on')===0&&v)v=(''+v).replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/,'$1');}}return(v&&v!='')?''+v:dv;},getPos:function(n){var t=this,x=0,y=0,e,d=t.doc,r;n=t.get(n);if(n&&isIE){n=n.getBoundingClientRect();e=t.boxModel?d.documentElement:d.body;x=t.getStyle(t.select('html')[0],'borderWidth');x=(x=='medium'||t.boxModel&&!t.isIE6)&&2||x;n.top+=t.win.self!=t.win.top?2:0;return{x:n.left+e.scrollLeft-x,y:n.top+e.scrollTop-x};}r=n;while(r){x+=r.offsetLeft||0;y+=r.offsetTop||0;r=r.offsetParent;}r=n;while(r){if(!/^table-row|inline.*/i.test(t.getStyle(r,"display",1))){x-=r.scrollLeft||0;y-=r.scrollTop||0;}r=r.parentNode;if(r==d.body)break;}return{x:x,y:y};},parseStyle:function(st){var t=this,s=t.settings,o={};if(!st)return o;function compress(p,s,ot){var t,r,b,l;t=o[p+'-top'+s];if(!t)return;r=o[p+'-right'+s];if(t!=r)return;b=o[p+'-bottom'+s];if(r!=b)return;l=o[p+'-left'+s];if(b!=l)return;o[ot]=l;delete o[p+'-top'+s];delete o[p+'-right'+s];delete o[p+'-bottom'+s];delete o[p+'-left'+s];};function compress2(ta,a,b,c){var t;t=o[a];if(!t)return;t=o[b];if(!t)return;t=o[c];if(!t)return;o[ta]=o[a]+' '+o[b]+' '+o[c];delete o[a];delete o[b];delete o[c];};each(st.split(';'),function(v){var sv,ur=[];if(v){v=v.replace(/url\([^\)]+\)/g,function(v){ur.push(v);return'url('+ur.length+')';});v=v.split(':');sv=tinymce.trim(v[1]);sv=sv.replace(/url\(([^\)]+)\)/g,function(a,b){return ur[parseInt(b)-1];});sv=sv.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v);});if(s.url_converter){sv=sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(x,c){return'url('+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),'style',null))+')';});}o[tinymce.trim(v[0]).toLowerCase()]=sv;}});compress("border","","border");compress("border","-width","border-width");compress("border","-color","border-color");compress("border","-style","border-style");compress("padding","","padding");compress("margin","","margin");compress2('border','border-width','border-style','border-color');if(isIE){if(o.border=='medium none')o.border='';}return o;},serializeStyle:function(o){var s='';each(o,function(v,k){if(k&&v){switch(k){case'color':case'background-color':v=v.toLowerCase();break;}s+=(s?' ':'')+k+': '+v+';';}});return s;},loadCSS:function(u){var t=this,d=t.doc;if(!u)u='';each(u.split(','),function(u){if(t.files[u])return;t.files[u]=true;t.add(t.select('head')[0],'link',{rel:'stylesheet',href:tinymce._addVer(u)});});},addClass:function(e,c){return this.run(e,function(e){var o;if(!c)return 0;if(this.hasClass(e,c))return e.className;o=this.removeClass(e,c);return e.className=(o!=''?(o+' '):'')+c;});},removeClass:function(e,c){var t=this,re;return t.run(e,function(e){var v;if(t.hasClass(e,c)){if(!re)re=new RegExp("(^|\\s+)"+c+"(\\s+|$)","g");v=e.className.replace(re,' ');return e.className=tinymce.trim(v!=' '?v:'');}return e.className;});},hasClass:function(n,c){n=this.get(n);if(!n||!c)return false;return(' '+n.className+' ').indexOf(' '+c+' ')!==-1;},show:function(e){return this.setStyle(e,'display','block');},hide:function(e){return this.setStyle(e,'display','none');},isHidden:function(e){e=this.get(e);return e.style.display=='none'||this.getStyle(e,'display')=='none';},uniqueId:function(p){return(!p?'mce_':p)+(this.counter++);},setHTML:function(e,h){var t=this;return this.run(e,function(e){var x,i,nl,n,p,x;h=t.processHTML(h);if(isIE){function set(){try{e.innerHTML='<br />'+h;e.removeChild(e.firstChild);}catch(ex){while(e.firstChild)e.firstChild.removeNode();x=t.create('div');x.innerHTML='<br />'+h;each(x.childNodes,function(n,i){if(i)e.appendChild(n);});}};if(t.settings.fix_ie_paragraphs)h=h.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true">&nbsp;</p>');set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("p");for(i=nl.length-1,x=0;i>=0;i--){n=nl[i];if(!n.hasChildNodes()){if(!n.mce_keep){x=1;break;}n.removeAttribute('mce_keep');}}}if(x){h=h.replace(/<p([^>]+)>|<p>/g,'<div$1 mce_tmp="1">');h=h.replace(/<\/p>/g,'</div>');set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("DIV");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.mce_tmp){p=t.doc.createElement('p');n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(a,b){var v;if(b!=='mce_tmp'){v=n.getAttribute(b);if(!v&&b==='class')v=n.className;p.setAttribute(b,v);}});for(x=0;x<n.childNodes.length;x++)p.appendChild(n.childNodes[x].cloneNode(true));n.swapNode(p);}}}}}else e.innerHTML=h;return h;});},processHTML:function(h){var t=this,s=t.settings;if(!s.process_html)return h;if(tinymce.isGecko){h=h.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,'<$1b$2>');h=h.replace(/<(\/?)em>|<em( [^>]+)>/gi,'<$1i$2>');}else if(isIE)h=h.replace(/&apos;/g,'&#39;');h=h.replace(/<a( )([^>]+)\/>|<a\/>/gi,'<a$1$2></a>');if(s.keep_values){if(h.indexOf('<script')!==-1){h=h.replace(/<script>/g,'<script type="text/javascript">');h=h.replace(/<script(|[^>]+)>(\s*<!--|\/\/\s*<\[CDATA\[)?[\r\n]*/g,'<mce:script$1><!--\n');h=h.replace(/\s*(\/\/\s*-->|\/\/\s*]]>)?<\/script>/g,'\n// --></mce:script>');h=h.replace(/<mce:script(|[^>]+)><!--\n\/\/ --><\/mce:script>/g,'<mce:script$1></mce:script>');}h=h.replace(/<([\w:]+) [^>]*(src|href|style|coords)[^>]*>/gi,function(a,n){function handle(m,b,c){var u=c;if(a.indexOf('mce_'+b)!=-1)return m;if(b=='style'){if(t._isRes(c))return m;if(s.hex_colors){u=u.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v);});}if(s.url_converter){u=u.replace(/url\([\'\"]?([^\)\'\"]+)\)/g,function(x,c){return'url('+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n))+')';});}}else if(b!='coords'){if(s.url_converter)u=t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n));}return' '+b+'="'+c+'" mce_'+b+'="'+u+'"';};a=a.replace(/ (src|href|style|coords)=[\"]([^\"]+)[\"]/gi,handle);a=a.replace(/ (src|href|style|coords)=[\']([^\']+)[\']/gi,handle);return a.replace(/ (src|href|style|coords)=([^\s\"\'>]+)/gi,handle);});}return h;},getOuterHTML:function(e){var d;e=this.get(e);if(!e)return null;if(isIE)return e.outerHTML;d=(e.ownerDocument||this.doc).createElement("body");d.appendChild(e.cloneNode(true));return d.innerHTML;},setOuterHTML:function(e,h,d){var t=this;return this.run(e,function(e){var n,tp;e=t.get(e);d=d||e.ownerDocument||t.doc;if(isIE&&e.nodeType==1)e.outerHTML=h;else{tp=d.createElement("body");tp.innerHTML=h;n=tp.lastChild;while(n){t.insertAfter(n.cloneNode(true),e);n=n.previousSibling;}t.remove(e);}});},decode:function(s){var e;if(/&[^;]+;/.test(s)){e=this.doc.createElement("div");e.innerHTML=s;return!e.firstChild?s:e.firstChild.nodeValue;}return s;},encode:function(s){return s?(''+s).replace(/[<>&\"]/g,function(c,b){switch(c){case'&':return'&amp;';case'"':return'&quot;';case'<':return'&lt;';case'>':return'&gt;';}return c;}):s;},insertAfter:function(n,r){var t=this;r=t.get(r);return this.run(n,function(n){var p,ns;p=r.parentNode;ns=r.nextSibling;if(ns)p.insertBefore(n,ns);else p.appendChild(n);return n;});},isBlock:function(n){if(n.nodeType&&n.nodeType!==1)return false;n=n.nodeName||n;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n);},replace:function(n,o,k){if(is(o,'array'))n=n.cloneNode(true);return this.run(o,function(o){if(k){each(o.childNodes,function(c){n.appendChild(c.cloneNode(true));});}return o.parentNode.replaceChild(n,o);});},toHex:function(s){var c=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);function hex(s){s=parseInt(s).toString(16);return s.length>1?s:'0'+s;};if(c){s='#'+hex(c[1])+hex(c[2])+hex(c[3]);return s;}return s;},getClasses:function(){var t=this,cl=[],i,lo={},f=t.settings.class_filter,ov;if(t.classes)return t.classes;function addClasses(s){each(s.imports,function(r){addClasses(r);});each(s.cssRules||s.rules,function(r){switch(r.type||1){case 1:if(r.selectorText){each(r.selectorText.split(','),function(v){v=v.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(v)||!/\.[\w\-]+$/.test(v))return;ov=v;v=v.replace(/.*\.([a-z0-9_\-]+).*/i,'$1');if(f&&!(v=f(v,ov)))return;if(!lo[v]){cl.push({'class':v});lo[v]=1;}});}break;case 3:addClasses(r.styleSheet);break;}});};try{each(t.doc.styleSheets,addClasses);}catch(ex){}if(cl.length>0)t.classes=cl;return cl;},run:function(e,f,s){var t=this,o;if(t.doc&&typeof(e)==='string')e=t.doc.getElementById(e);if(!e)return false;s=s||this;if(!e.nodeType&&(e.length||e.length===0)){o=[];each(e,function(e,i){if(e){if(typeof(e)=='string')e=t.doc.getElementById(e);o.push(f.call(s,e,i));}});return o;}return f.call(s,e);},getAttribs:function(n){var o;n=this.get(n);if(!n)return[];if(isIE){o=[];if(n.nodeName=='OBJECT')return n.attributes;n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b});});return o;}return n.attributes;},destroy:function(s){var t=this;t.win=t.doc=t.root=null;if(!s)tinymce.removeUnload(t.destroy);},_isRes:function(c){return/^(top|left|bottom|right|width|height)/i.test(c)||/;\s*(top|left|bottom|right|width|height)/i.test(c);}});tinymce.DOM=new tinymce.dom.DOMUtils(document,{process_html:0});})();(function(){var each=tinymce.each,DOM=tinymce.DOM,isIE=tinymce.isIE,isWebKit=tinymce.isWebKit,Event;tinymce.create('static tinymce.dom.Event',{inits:[],events:[],add:function(o,n,f,s){var cb,t=this,el=t.events,r;if(o&&o instanceof Array){r=[];each(o,function(o){o=DOM.get(o);r.push(t.add(o,n,f,s));});return r;}o=DOM.get(o);if(!o)return;cb=function(e){e=e||window.event;if(e&&!e.target&&isIE)e.target=e.srcElement;if(!s)return f(e);return f.call(s,e);};if(n=='unload'){tinymce.unloads.unshift({func:cb});return cb;}if(n=='init'){if(t.domLoaded)cb();else t.inits.push(cb);return cb;}el.push({obj:o,name:n,func:f,cfunc:cb,scope:s});t._add(o,n,cb);return f;},remove:function(o,n,f){var t=this,a=t.events,s=false,r;if(o&&o instanceof Array){r=[];each(o,function(o){o=DOM.get(o);r.push(t.remove(o,n,f));});return r;}o=DOM.get(o);each(a,function(e,i){if(e.obj==o&&e.name==n&&(!f||(e.func==f||e.cfunc==f))){a.splice(i,1);t._remove(o,n,e.cfunc);s=true;return false;}});return s;},clear:function(o){var t=this,a=t.events,i,e;if(o){o=DOM.get(o);for(i=a.length-1;i>=0;i--){e=a[i];if(e.obj===o){t._remove(e.obj,e.name,e.cfunc);e.obj=e.cfunc=null;a.splice(i,1);}}}},cancel:function(e){if(!e)return false;this.stop(e);return this.prevent(e);},stop:function(e){if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=true;return false;},prevent:function(e){if(e.preventDefault)e.preventDefault();else e.returnValue=false;return false;},_unload:function(){var t=Event;each(t.events,function(e,i){t._remove(e.obj,e.name,e.cfunc);e.obj=e.cfunc=null;});t.events=[];t=null;},_add:function(o,n,f){if(o.attachEvent)o.attachEvent('on'+n,f);else if(o.addEventListener)o.addEventListener(n,f,false);else o['on'+n]=f;},_remove:function(o,n,f){if(o){try{if(o.detachEvent)o.detachEvent('on'+n,f);else if(o.removeEventListener)o.removeEventListener(n,f,false);else o['on'+n]=null;}catch(ex){}}},_pageInit:function(){var e=Event;e._remove(window,'DOMContentLoaded',e._pageInit);e.domLoaded=true;each(e.inits,function(c){c();});e.inits=[];},_wait:function(){var t;if(window.tinyMCE_GZ&&tinyMCE_GZ.loaded){Event.domLoaded=1;return;}if(isIE&&document.location.protocol!='https:'){document.write('<script id=__ie_onload defer src=\'javascript:""\';><\/script>');DOM.get("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){Event._pageInit();DOM.get("__ie_onload").onreadystatechange=null;}};}else{Event._add(window,'DOMContentLoaded',Event._pageInit,Event);if(isIE||isWebKit){t=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(t);Event._pageInit();}},10);}}}});Event=tinymce.dom.Event;Event._wait();tinymce.addUnload(Event._unload);})();(function(){var each=tinymce.each;tinymce.create('tinymce.dom.Element',{Element:function(id,s){var t=this,dom,el;s=s||{};t.id=id;t.dom=dom=s.dom||tinymce.DOM;t.settings=s;if(!tinymce.isIE)el=t.dom.get(t.id);each(['getPos','getRect','getParent','add','setStyle','getStyle','setStyles','setAttrib','setAttribs','getAttrib','addClass','removeClass','hasClass','getOuterHTML','setOuterHTML','remove','show','hide','isHidden','setHTML','get'],function(k){t[k]=function(){var a=arguments,o;if(tinymce.isOpera){a=[id];each(arguments,function(v){a.push(v);});}else Array.prototype.unshift.call(a,el||id);o=dom[k].apply(dom,a);t.update(k);return o;};});},on:function(n,f,s){return tinymce.dom.Event.add(this.id,n,f,s);},getXY:function(){return{x:parseInt(this.getStyle('left')),y:parseInt(this.getStyle('top'))};},getSize:function(){var n=this.dom.get(this.id);return{w:parseInt(this.getStyle('width')||n.clientWidth),h:parseInt(this.getStyle('height')||n.clientHeight)};},moveTo:function(x,y){this.setStyles({left:x,top:y});},moveBy:function(x,y){var p=this.getXY();this.moveTo(p.x+x,p.y+y);},resizeTo:function(w,h){this.setStyles({width:w,height:h});},resizeBy:function(w,h){var s=this.getSize();this.resizeTo(s.w+w,s.h+h);},update:function(k){var t=this,b,dom=t.dom;if(tinymce.isIE6&&t.settings.blocker){k=k||'';if(k.indexOf('get')===0||k.indexOf('has')===0||k.indexOf('is')===0)return;if(k=='remove'){dom.remove(t.blocker);return;}if(!t.blocker){t.blocker=dom.uniqueId();b=dom.add(t.settings.container||dom.getRoot(),'iframe',{id:t.blocker,style:'position:absolute;',frameBorder:0,src:'javascript:""'});dom.setStyle(b,'opacity',0);}else b=dom.get(t.blocker);dom.setStyle(b,'left',t.getStyle('left',1));dom.setStyle(b,'top',t.getStyle('top',1));dom.setStyle(b,'width',t.getStyle('width',1));dom.setStyle(b,'height',t.getStyle('height',1));dom.setStyle(b,'display',t.getStyle('display',1));dom.setStyle(b,'zIndex',parseInt(t.getStyle('zIndex',1)||0)-1);}}});})();(function(){function trimNl(s){return s.replace(/[\n\r]+/g,'');};var is=tinymce.is,isIE=tinymce.isIE,each=tinymce.each;tinymce.create('tinymce.dom.Selection',{Selection:function(dom,win,serializer){var t=this;t.dom=dom;t.win=win;t.serializer=serializer;tinymce.addUnload(t.destroy,t);},getContent:function(s){var t=this,r=t.getRng(),e=t.dom.create("body"),se=t.getSel(),wb,wa,n;s=s||{};wb=wa='';s.get=true;s.format=s.format||'html';if(s.format=='text')return t.isCollapsed()?'':(r.text||(se.toString?se.toString():''));if(r.cloneContents){n=r.cloneContents();if(n)e.appendChild(n);}else if(is(r.item)||is(r.htmlText))e.innerHTML=r.item?r.item(0).outerHTML:r.htmlText;else e.innerHTML=r.toString();if(/^\s/.test(e.innerHTML))wb=' ';if(/\s+$/.test(e.innerHTML))wa=' ';s.getInner=true;return t.isCollapsed()?'':wb+t.serializer.serialize(e,s)+wa;},setContent:function(h,s){var t=this,r=t.getRng(),d=t.win.document;s=s||{format:'html'};s.set=true;h=t.dom.processHTML(h);if(r.insertNode){if(tinymce.isGecko&&h.indexOf('<')==-1){r.deleteContents();r.insertNode(t.getRng().createContextualFragment(h+'<span id="__caret">_</span>'));t.select(t.dom.get('__caret'));t.getRng().deleteContents();return;}try{if(d.queryCommandEnabled('InsertHTML'))return d.execCommand('InsertHTML',false,h);}catch(ex){r.deleteContents();r.insertNode(t.getRng().createContextualFragment(h));}}else{if(r.item){d.execCommand('Delete',false,null);r=t.getRng();}r.pasteHTML(h);}},getStart:function(){var t=this,r=t.getRng(),e;if(isIE){if(r.item)return r.item(0);r=r.duplicate();r.collapse(1);e=r.parentElement();if(e&&e.nodeName=='BODY')return e.firstChild;return e;}else{e=r.startContainer;if(e.nodeName=='BODY')return e.firstChild;return t.dom.getParent(e,function(n){return n.nodeType==1;});}},getEnd:function(){var t=this,r=t.getRng(),e;if(isIE){if(r.item)return r.item(0);r=r.duplicate();r.collapse(0);e=r.parentElement();if(e&&e.nodeName=='BODY')return e.lastChild;return e;}else{e=r.endContainer;if(e.nodeName=='BODY')return e.lastChild;return t.dom.getParent(e,function(n){return n.nodeType==1;});}},getBookmark:function(si){var t=this,r=t.getRng(),tr,sx,sy,vp=t.dom.getViewPort(t.win),e,sp,bp,le,c=-0xFFFFFF,s,ro=t.dom.getRoot(),wb=0,wa=0,nv;sx=vp.x;sy=vp.y;if(si=='simple')return{rng:r,scrollX:sx,scrollY:sy};if(isIE){if(r.item){e=r.item(0);each(t.dom.select(e.nodeName),function(n,i){if(e==n){sp=i;return false;}});return{tag:e.nodeName,index:sp,scrollX:sx,scrollY:sy};}tr=t.dom.doc.body.createTextRange();tr.moveToElementText(ro);tr.collapse(true);bp=Math.abs(tr.move('character',c));tr=r.duplicate();tr.collapse(true);sp=Math.abs(tr.move('character',c));tr=r.duplicate();tr.collapse(false);le=Math.abs(tr.move('character',c))-sp;return{start:sp-bp,length:le,scrollX:sx,scrollY:sy};}e=t.getNode();s=t.getSel();if(!s)return null;if(e&&e.nodeName=='IMG'){return{scrollX:sx,scrollY:sy};}function getPos(r,sn,en){var w=t.dom.doc.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={};while((n=w.nextNode())!=null){if(n==sn)d.start=p;if(n==en){d.end=p;return d;}p+=trimNl(n.nodeValue||'').length;}return null;};if(s.anchorNode==s.focusNode&&s.anchorOffset==s.focusOffset){e=getPos(ro,s.anchorNode,s.focusNode);if(!e)return{scrollX:sx,scrollY:sy};trimNl(s.anchorNode.nodeValue||'').replace(/^\s+/,function(a){wb=a.length;});return{start:Math.max(e.start+s.anchorOffset-wb,0),end:Math.max(e.end+s.focusOffset-wb,0),scrollX:sx,scrollY:sy,beg:s.anchorOffset-wb==0};}else{e=getPos(ro,r.startContainer,r.endContainer);if(!e)return{scrollX:sx,scrollY:sy};return{start:Math.max(e.start+r.startOffset-wb,0),end:Math.max(e.end+r.endOffset-wa,0),scrollX:sx,scrollY:sy,beg:r.startOffset-wb==0};}},moveToBookmark:function(b){var t=this,r=t.getRng(),s=t.getSel(),ro=t.dom.getRoot(),sd,nvl,nv;function getPos(r,sp,ep){var w=t.dom.doc.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={},o,v,wa,wb;while((n=w.nextNode())!=null){wa=wb=0;nv=n.nodeValue||'';nvl=trimNl(nv).length;p+=nvl;if(p>=sp&&!d.startNode){o=sp-(p-nvl);if(b.beg&&o>=nvl)continue;d.startNode=n;d.startOffset=o+wb;}if(p>=ep){d.endNode=n;d.endOffset=ep-(p-nvl)+wb;return d;}}return null;};if(!b)return false;t.win.scrollTo(b.scrollX,b.scrollY);if(isIE){if(r=b.rng){try{r.select();}catch(ex){}return true;}t.win.focus();if(b.tag){r=ro.createControlRange();each(t.dom.select(b.tag),function(n,i){if(i==b.index)r.addElement(n);});}else{try{if(b.start<0)return true;r=s.createRange();r.moveToElementText(ro);r.collapse(true);r.moveStart('character',b.start);r.moveEnd('character',b.length);}catch(ex2){return true;}}try{r.select();}catch(ex){}return true;}if(!s)return false;if(b.rng){s.removeAllRanges();s.addRange(b.rng);}else{if(is(b.start)&&is(b.end)){try{sd=getPos(ro,b.start,b.end);if(sd){r=t.dom.doc.createRange();r.setStart(sd.startNode,sd.startOffset);r.setEnd(sd.endNode,sd.endOffset);s.removeAllRanges();s.addRange(r);}if(!tinymce.isOpera)t.win.focus();}catch(ex){}}}},select:function(n,c){var t=this,r=t.getRng(),s=t.getSel(),b,fn,ln,d=t.win.document;function first(n){return n?d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false).nextNode():null;};function last(n){var c,o,w;if(!n)return null;w=d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while(c=w.nextNode())o=c;return o;};if(isIE){try{b=d.body;if(/^(IMG|TABLE)$/.test(n.nodeName)){r=b.createControlRange();r.addElement(n);}else{r=b.createTextRange();r.moveToElementText(n);}r.select();}catch(ex){}}else{if(c){fn=first(n);ln=last(n);if(fn&&ln){r=d.createRange();r.setStart(fn,0);r.setEnd(ln,ln.nodeValue.length);}else r.selectNode(n);}else r.selectNode(n);t.setRng(r);}return n;},isCollapsed:function(){var t=this,r=t.getRng(),s=t.getSel();if(!r||r.item)return false;return!s||r.boundingWidth==0||s.isCollapsed;},collapse:function(b){var t=this,r=t.getRng(),n;if(r.item){n=r.item(0);r=this.win.document.body.createTextRange();r.moveToElementText(n);}r.collapse(!!b);t.setRng(r);},getSel:function(){var t=this,w=this.win;return w.getSelection?w.getSelection():w.document.selection;},getRng:function(){var t=this,s=t.getSel(),r;try{if(s)r=s.rangeCount>0?s.getRangeAt(0):(s.createRange?s.createRange():t.win.document.createRange());}catch(ex){}if(!r)r=isIE?t.win.document.body.createTextRange():t.win.document.createRange();return r;},setRng:function(r){var s;if(!isIE){s=this.getSel();if(s){s.removeAllRanges();s.addRange(r);}}else{try{r.select();}catch(ex){}}},setNode:function(n){var t=this;t.setContent(t.dom.getOuterHTML(n));return n;},getNode:function(){var t=this,r=t.getRng(),s=t.getSel(),e;if(!isIE){if(!r)return t.dom.getRoot();e=r.commonAncestorContainer;if(!r.collapsed){if(r.startContainer==r.endContainer||(tinymce.isWebKit&&r.startContainer==r.endContainer.parentNode)){if(r.startOffset-r.endOffset<2||tinymce.isWebKit){if(r.startContainer.hasChildNodes())e=r.startContainer.childNodes[r.startOffset];}}}return t.dom.getParent(e,function(n){return n.nodeType==1;});}return r.item?r.item(0):r.parentElement();},destroy:function(s){var t=this;t.win=null;if(!s)tinymce.removeUnload(t.destroy);}});})();(function(){tinymce.create('tinymce.dom.XMLWriter',{node:null,XMLWriter:function(s){function getXML(){var i=document.implementation;if(!i||!i.createDocument){try{return new ActiveXObject('MSXML2.DOMDocument');}catch(ex){}try{return new ActiveXObject('Microsoft.XmlDom');}catch(ex){}}else return i.createDocument('','',null);};this.doc=getXML();this.valid=tinymce.isOpera||tinymce.isWebKit;this.reset();},reset:function(){var t=this,d=t.doc;if(d.firstChild)d.removeChild(d.firstChild);t.node=d.appendChild(d.createElement("html"));},writeStartElement:function(n){var t=this;t.node=t.node.appendChild(t.doc.createElement(n));},writeAttribute:function(n,v){if(this.valid)v=v.replace(/>/g,'%MCGT%');this.node.setAttribute(n,v);},writeEndElement:function(){this.node=this.node.parentNode;},writeFullEndElement:function(){var t=this,n=t.node;n.appendChild(t.doc.createTextNode(""));t.node=n.parentNode;},writeText:function(v){if(this.valid)v=v.replace(/>/g,'%MCGT%');this.node.appendChild(this.doc.createTextNode(v));},writeCDATA:function(v){this.node.appendChild(this.doc.createCDATA(v));},writeComment:function(v){this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g,' ')));},getContent:function(){var h;h=this.doc.xml||new XMLSerializer().serializeToString(this.doc);h=h.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,'');h=h.replace(/ ?\/>/g,' />');if(this.valid)h=h.replace(/\%MCGT%/g,'&gt;');return h;}});})();(function(){tinymce.create('tinymce.dom.StringWriter',{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(s){this.settings=tinymce.extend({indent_char:' ',indentation:1},s);this.reset();},reset:function(){this.indent='';this.str="";this.tags=[];this.count=0;},writeStartElement:function(n){this._writeAttributesEnd();this.writeRaw('<'+n);this.tags.push(n);this.inAttr=true;this.count++;this.elementCount=this.count;},writeAttribute:function(n,v){var t=this;t.writeRaw(" "+t.encode(n)+'="'+t.encode(v)+'"');},writeEndElement:function(){var n;if(this.tags.length>0){n=this.tags.pop();if(this._writeAttributesEnd(1))this.writeRaw('</'+n+'>');if(this.settings.indentation>0)this.writeRaw('\n');}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw('</'+this.tags.pop()+'>');if(this.settings.indentation>0)this.writeRaw('\n');}},writeText:function(v){this._writeAttributesEnd();this.writeRaw(this.encode(v));this.count++;},writeCDATA:function(v){this._writeAttributesEnd();this.writeRaw('<![CDATA['+v+']]>');this.count++;},writeComment:function(v){this._writeAttributesEnd();this.writeRaw('<!-- '+v+'-->');this.count++;},writeRaw:function(v){this.str+=v;},encode:function(s){return s.replace(/[<>&"]/g,function(v){switch(v){case'<':return'&lt;';case'>':return'&gt;';case'&':return'&amp;';case'"':return'&quot;';}return v;});},getContent:function(){return this.str;},_writeAttributesEnd:function(s){if(!this.inAttr)return;this.inAttr=false;if(s&&this.elementCount==this.count){this.writeRaw(' />');return false;}this.writeRaw('>');return true;}});})();(function(){var extend=tinymce.extend,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher,isIE=tinymce.isIE,isGecko=tinymce.isGecko;function getIEAtts(n){var o=[];if(n.nodeName=='OBJECT')return n.attributes;n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b});});return o;};function wildcardToRE(s){return s.replace(/([?+*])/g,'.$1');};tinymce.create('tinymce.dom.Serializer',{Serializer:function(s){var t=this;t.key=0;t.onPreProcess=new Dispatcher(t);t.onPostProcess=new Dispatcher(t);if(tinymce.relaxedDomain&&tinymce.isGecko){t.writer=new tinymce.dom.StringWriter();}else{try{t.writer=new tinymce.dom.XMLWriter();}catch(ex){t.writer=new tinymce.dom.StringWriter();}}t.settings=s=extend({dom:tinymce.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_)/,closed:/(br|hr|input|meta|img|link|param)/,entity_encoding:'named',entities:'160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro',valid_elements:'*[*]',extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:0,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:'simple',indent_char:'\t',indent_levels:1,remove_linebreaks:1},s);t.dom=s.dom;if(s.fix_list_elements){t.onPreProcess.add(function(se,o){var nl,x,a=['ol','ul'],i,n,p,r=/^(OL|UL)$/,np;function prevNode(e,n){var a=n.split(','),i;while((e=e.previousSibling)!=null){for(i=0;i<a.length;i++){if(e.nodeName==a[i])return e;}}return null;};for(x=0;x<a.length;x++){nl=t.dom.select(a[x],o.node);for(i=0;i<nl.length;i++){n=nl[i];p=n.parentNode;if(r.test(p.nodeName)){np=prevNode(n,'LI');if(!np){np=t.dom.create('li');np.innerHTML='&nbsp;';np.appendChild(n);p.insertBefore(np,p.firstChild);}else np.appendChild(n);}}}});}if(s.fix_table_elements){t.onPreProcess.add(function(se,o){each(t.dom.select('table',o.node),function(e){var pa=t.dom.getParent(e,'H1,H2,H3,H4,H5,H6,P'),pa2,n,tm,pl=[],i,ns;if(pa){pa2=pa.cloneNode(false);pl.push(e);for(n=e;n=n.parentNode;){pl.push(n);if(n==pa)break;}tm=pa2;for(i=pl.length-1;i>=0;i--){if(i==pl.length-1){while(ns=pl[i-1].nextSibling)tm.appendChild(ns.parentNode.removeChild(ns));}else{n=pl[i].cloneNode(false);if(i!=0){while(ns=pl[i-1].nextSibling)n.appendChild(ns.parentNode.removeChild(ns));}tm=tm.appendChild(n);}}e=t.dom.insertAfter(e.parentNode.removeChild(e),pa);t.dom.insertAfter(e,pa);t.dom.insertAfter(pa2,e);}});});}},setEntities:function(s){var t=this,a,i,l={},re='',v;if(t.entityLookup)return;a=s.split(',');for(i=0;i<a.length;i+=2){v=a[i];if(v==34||v==38||v==60||v==62)continue;l[String.fromCharCode(a[i])]=a[i+1];v=parseInt(a[i]).toString(16);re+='\\u'+'0000'.substring(v.length)+v;}if(!re){t.settings.entity_encoding='raw';return;}t.entitiesRE=new RegExp('['+re+']','g');t.entityLookup=l;},setValidChildRules:function(s){this.childRules=null;this.addValidChildRules(s);},addValidChildRules:function(s){var t=this,inst,intr,bloc;if(!s)return;inst='A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment';intr='A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment';bloc='H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP';each(s.split(','),function(s){var p=s.split(/\[|\]/),re;s='';each(p[1].split('|'),function(v){if(s)s+='|';switch(v){case'%itrans':v=intr;break;case'%itrans_na':v=intr.substring(2);break;case'%istrict':v=inst;break;case'%istrict_na':v=inst.substring(2);break;case'%btrans':v=bloc;break;case'%bstrict':v=bloc;break;}s+=v;});re=new RegExp('^('+s.toLowerCase()+')$','i');each(p[0].split('/'),function(s){t.childRules=t.childRules||{};t.childRules[s]=re;});});s='';each(t.childRules,function(v,k){if(s)s+='|';s+=k;});t.parentElementsRE=new RegExp('^('+s.toLowerCase()+')$','i');},setRules:function(s){var t=this;t._setup();t.rules={};t.wildRules=[];t.validElements={};return t.addRules(s);},addRules:function(s){var t=this,dr;if(!s)return;t._setup();each(s.split(','),function(s){var p=s.split(/\[|\]/),tn=p[0].split('/'),ra,at,wat,va=[];if(dr)at=tinymce.extend([],dr.attribs);if(p.length>1){each(p[1].split('|'),function(s){var ar={},i;at=at||[];s=s.replace(/::/g,'~');s=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(s);s[2]=s[2].replace(/~/g,':');if(s[1]=='!'){ra=ra||[];ra.push(s[2]);}if(s[1]=='-'){for(i=0;i<at.length;i++){if(at[i].name==s[2]){at.splice(i,1);return;}}}switch(s[3]){case'=':ar.defaultVal=s[4]||'';break;case':':ar.forcedVal=s[4];break;case'<':ar.validVals=s[4].split('?');break;}if(/[*.?]/.test(s[2])){wat=wat||[];ar.nameRE=new RegExp('^'+wildcardToRE(s[2])+'$');wat.push(ar);}else{ar.name=s[2];at.push(ar);}va.push(s[2]);});}each(tn,function(s,i){var pr=s.charAt(0),x=1,ru={};if(dr){if(dr.noEmpty)ru.noEmpty=dr.noEmpty;if(dr.fullEnd)ru.fullEnd=dr.fullEnd;if(dr.padd)ru.padd=dr.padd;}switch(pr){case'-':ru.noEmpty=true;break;case'+':ru.fullEnd=true;break;case'#':ru.padd=true;break;default:x=0;}tn[i]=s=s.substring(x);t.validElements[s]=1;if(/[*.?]/.test(tn[0])){ru.nameRE=new RegExp('^'+wildcardToRE(tn[0])+'$');t.wildRules=t.wildRules||{};t.wildRules.push(ru);}else{ru.name=tn[0];if(tn[0]=='@')dr=ru;t.rules[s]=ru;}ru.attribs=at;if(ra)ru.requiredAttribs=ra;if(wat){s='';each(va,function(v){if(s)s+='|';s+='('+wildcardToRE(v)+')';});ru.validAttribsRE=new RegExp('^'+s.toLowerCase()+'$');ru.wildAttribs=wat;}});});s='';each(t.validElements,function(v,k){if(s)s+='|';if(k!='@')s+=k;});t.validElementsRE=new RegExp('^('+wildcardToRE(s.toLowerCase())+')$');},findRule:function(n){var t=this,rl=t.rules,i,r;t._setup();r=rl[n];if(r)return r;rl=t.wildRules;for(i=0;i<rl.length;i++){if(rl[i].nameRE.test(n))return rl[i];}return null;},findAttribRule:function(ru,n){var i,wa=ru.wildAttribs;for(i=0;i<wa.length;i++){if(wa[i].nameRE.test(n))return wa[i];}return null;},serialize:function(n,o){var h,t=this;t._setup();o=o||{};o.format=o.format||'html';t.processObj=o;n=n.cloneNode(true);t.key=''+(parseInt(t.key)+1);if(!o.no_events){o.node=n;t.onPreProcess.dispatch(t,o);}t.writer.reset();t._serializeNode(n,o.getInner);o.content=t.writer.getContent();if(!o.no_events)t.onPostProcess.dispatch(t,o);t._postProcess(o);o.node=null;return tinymce.trim(o.content);},_postProcess:function(o){var t=this,s=t.settings,h=o.content,sc=[],p;if(o.format=='html'){p=t._protect({content:h,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1}]});h=p.content;if(s.entity_encoding!=='raw')h=t._encode(h);if(!o.set){h=h.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,s.entity_encoding=='numeric'?'<p$1>&#160;</p>':'<p$1>&nbsp;</p>');if(s.remove_linebreaks){h=h.replace(/\r?\n|\r/g,' ');h=h.replace(/(<[^>]+>)\s+/g,'$1 ');h=h.replace(/\s+(<\/[^>]+>)/g,' $1');h=h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,'<$1 $2>');h=h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,'<$1>');h=h.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,'</$1>');}if(s.apply_source_formatting&&s.indent_mode=='simple'){h=h.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,'\n<$1$2$3>\n');h=h.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,'\n<$1$2>');h=h.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,'</$1>\n');h=h.replace(/\n\n/g,'\n');}}h=t._unprotect(h,p);if(s.entity_encoding=='raw')h=h.replace(/<p>&nbsp;<\/p>|<p([^>]+)>&nbsp;<\/p>/g,'<p$1>\u00a0</p>');}o.content=h;},_serializeNode:function(n,inn){var t=this,s=t.settings,w=t.writer,hc,el,cn,i,l,a,at,no,v,nn,ru,ar,iv;if(!s.node_filter||s.node_filter(n)){switch(n.nodeType){case 1:if(n.hasAttribute?n.hasAttribute('mce_bogus'):n.getAttribute('mce_bogus'))return;iv=false;hc=n.hasChildNodes();nn=n.getAttribute('mce_name')||n.nodeName.toLowerCase();if(isIE){if(n.scopeName!=='HTML'&&n.scopeName!=='html')nn=n.scopeName+':'+nn;}if(nn.indexOf('mce:')===0)nn=nn.substring(4);if(!t.validElementsRE.test(nn)||(t.invalidElementsRE&&t.invalidElementsRE.test(nn))||inn){iv=true;break;}if(isIE){if(s.fix_content_duplication){if(n.mce_serialized==t.key)return;n.mce_serialized=t.key;}if(nn.charAt(0)=='/')nn=nn.substring(1);}else if(isGecko){if(n.nodeName==='BR'&&n.getAttribute('type')=='_moz')return;}if(t.childRules){if(t.parentElementsRE.test(t.elementName)){if(!t.childRules[t.elementName].test(nn)){iv=true;break;}}t.elementName=nn;}ru=t.findRule(nn);nn=ru.name||nn;if((!hc&&ru.noEmpty)||(isIE&&!nn)){iv=true;break;}if(ru.requiredAttribs){a=ru.requiredAttribs;for(i=a.length-1;i>=0;i--){if(this.dom.getAttrib(n,a[i])!=='')break;}if(i==-1){iv=true;break;}}w.writeStartElement(nn);if(ru.attribs){for(i=0,at=ru.attribs,l=at.length;i<l;i++){a=at[i];v=t._getAttrib(n,a);if(v!==null)w.writeAttribute(a.name,v);}}if(ru.validAttribsRE){at=isIE?getIEAtts(n):n.attributes;for(i=at.length-1;i>-1;i--){no=at[i];if(no.specified){a=no.nodeName.toLowerCase();if(s.invalid_attrs.test(a)||!ru.validAttribsRE.test(a))continue;ar=t.findAttribRule(ru,a);v=t._getAttrib(n,ar,a);if(v!==null)w.writeAttribute(a,v);}}}if(!hc&&ru.padd)w.writeText('\u00a0');break;case 3:if(t.childRules&&t.parentElementsRE.test(t.elementName)){if(!t.childRules[t.elementName].test(n.nodeName))return;}return w.writeText(n.nodeValue);case 4:return w.writeCDATA(n.nodeValue);case 8:return w.writeComment(n.nodeValue);}}else if(n.nodeType==1)hc=n.hasChildNodes();if(hc){cn=n.firstChild;while(cn){t._serializeNode(cn);t.elementName=nn;cn=cn.nextSibling;}}if(!iv){if(hc||!s.closed.test(nn))w.writeFullEndElement();else w.writeEndElement();}},_protect:function(o){var t=this;o.items=o.items||[];function enc(s){return s.replace(/[\r\n\\]/g,function(c){if(c==='\n')return'\\n';else if(c==='\\')return'\\\\';return'\\r';});};function dec(s){return s.replace(/\\[\\rn]/g,function(c){if(c==='\\n')return'\n';else if(c==='\\\\')return'\\';return'\r';});};each(o.patterns,function(p){o.content=dec(enc(o.content).replace(p.pattern,function(x,a,b,c){b=dec(b);if(p.encode)b=t._encode(b);o.items.push(b);return a+'<!--mce:'+(o.items.length-1)+'-->'+c;}));});return o;},_unprotect:function(h,o){h=h.replace(/\<!--mce:([0-9]+)--\>/g,function(a,b){return o.items[parseInt(b)];});o.items=[];return h;},_encode:function(h){var t=this,s=t.settings,l;if(s.entity_encoding!=='raw'){if(s.entity_encoding.indexOf('named')!=-1){t.setEntities(s.entities);l=t.entityLookup;h=h.replace(t.entitiesRE,function(a){var v;if(v=l[a])a='&'+v+';';return a;});}if(s.entity_encoding.indexOf('numeric')!=-1){h=h.replace(/[\u007E-\uFFFF]/g,function(a){return'&#'+a.charCodeAt(0)+';';});}}return h;},_setup:function(){var t=this,s=this.settings;if(t.done)return;t.done=1;t.setRules(s.valid_elements);t.addRules(s.extended_valid_elements);t.addValidChildRules(s.valid_child_elements);if(s.invalid_elements)t.invalidElementsRE=new RegExp('^('+wildcardToRE(s.invalid_elements.replace(/,/g,'|').toLowerCase())+')$');if(s.attrib_value_filter)t.attribValueFilter=s.attribValueFilter;},_getAttrib:function(n,a,na){var i,v;na=na||a.name;if(a.forcedVal&&(v=a.forcedVal)){if(v==='{$uid}')return this.dom.uniqueId();return v;}v=this.dom.getAttrib(n,na);switch(na){case'rowspan':case'colspan':if(v=='1')v='';break;}if(this.attribValueFilter)v=this.attribValueFilter(na,v,n);if(a.validVals){for(i=a.validVals.length-1;i>=0;i--){if(v==a.validVals[i])break;}if(i==-1)return null;}if(v===''&&typeof(a.defaultVal)!='undefined'){v=a.defaultVal;if(v==='{$uid}')return this.dom.uniqueId();return v;}else{if(na=='class'&&this.processObj.get)v=v.replace(/\s?mceItem\w+\s?/g,'');}if(v==='')return null;return v;}});})();(function(){var each=tinymce.each;tinymce.create('tinymce.dom.ScriptLoader',{ScriptLoader:function(s){this.settings=s||{};this.queue=[];this.lookup={};},isDone:function(u){return this.lookup[u]?this.lookup[u].state==2:0;},markDone:function(u){this.lookup[u]={state:2,url:u};},add:function(u,cb,s,pr){var t=this,lo=t.lookup,o;if(o=lo[u]){if(cb&&o.state==2)cb.call(s||this);return o;}o={state:0,url:u,func:cb,scope:s||this};if(pr)t.queue.unshift(o);else t.queue.push(o);lo[u]=o;return o;},load:function(u,cb,s){var t=this,o;if(o=t.lookup[u]){if(cb&&o.state==2)cb.call(s||t);return o;}function loadScript(u){if(tinymce.dom.Event.domLoaded||t.settings.strict_mode){tinymce.util.XHR.send({url:tinymce._addVer(u),error:t.settings.error,async:false,success:function(co){t.eval(co);}});}else document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"></script>');};if(!tinymce.is(u,'string')){each(u,function(u){loadScript(u);});if(cb)cb.call(s||t);}else{loadScript(u);if(cb)cb.call(s||t);}},loadQueue:function(cb,s){var t=this;if(!t.queueLoading){t.queueLoading=1;t.queueCallbacks=[];t.loadScripts(t.queue,function(){t.queueLoading=0;if(cb)cb.call(s||t);each(t.queueCallbacks,function(o){o.func.call(o.scope);});});}else if(cb)t.queueCallbacks.push({func:cb,scope:s||t});},eval:function(co){var w=window;if(!w.execScript){try{eval.call(w,co);}catch(ex){eval(co,w);}}else w.execScript(co);},loadScripts:function(sc,cb,s){var t=this,lo=t.lookup;function done(o){o.state=2;if(o.func)o.func.call(o.scope||t);};function allDone(){var l;l=sc.length;each(sc,function(o){o=lo[o.url];if(o.state===2){done(o);l--;}else load(o);});if(l===0&&cb){cb.call(s||t);cb=0;}};function load(o){if(o.state>0)return;o.state=1;tinymce.util.XHR.send({url:o.url,error:t.settings.error,success:function(co){t.eval(co);done(o);allDone();}});};each(sc,function(o){var u=o.url;if(!lo[u]){lo[u]=o;t.queue.push(o);}else o=lo[u];if(o.state>0)return;if(!tinymce.dom.Event.domLoaded&&!t.settings.strict_mode){var ix,ol='';if(cb||o.func){o.state=1;ix=tinymce.dom.ScriptLoader._addOnLoad(function(){done(o);allDone();});if(tinymce.isIE)ol=' onreadystatechange="';else ol=' onload="';ol+='tinymce.dom.ScriptLoader._onLoad(this,\''+u+'\','+ix+');"';}document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"'+ol+'></script>');if(!o.func)done(o);}else load(o);});allDone();},'static':{_addOnLoad:function(f){var t=this;t._funcs=t._funcs||[];t._funcs.push(f);return t._funcs.length-1;},_onLoad:function(e,u,ix){if(!tinymce.isIE||e.readyState=='complete')this._funcs[ix].call(this);}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader();})();(function(){var DOM=tinymce.DOM,is=tinymce.is;tinymce.create('tinymce.ui.Control',{Control:function(id,s){this.id=id;this.settings=s=s||{};this.rendered=false;this.onRender=new tinymce.util.Dispatcher(this);this.classPrefix='';this.scope=s.scope||this;this.disabled=0;this.active=0;},setDisabled:function(s){var e;if(s!=this.disabled){e=DOM.get(this.id);if(e&&this.settings.unavailable_prefix){if(s){this.prevTitle=e.title;e.title=this.settings.unavailable_prefix+": "+e.title;}else e.title=this.prevTitle;}this.setState('Disabled',s);this.setState('Enabled',!s);this.disabled=s;}},isDisabled:function(){return this.disabled;},setActive:function(s){if(s!=this.active){this.setState('Active',s);this.active=s;}},isActive:function(){return this.active;},setState:function(c,s){var n=DOM.get(this.id);c=this.classPrefix+c;if(s)DOM.addClass(n,c);else DOM.removeClass(n,c);},isRendered:function(){return this.rendered;},renderHTML:function(){},renderTo:function(n){DOM.setHTML(n,this.renderHTML());},postRender:function(){var t=this,b;if(is(t.disabled)){b=t.disabled;t.disabled=-1;t.setDisabled(b);}if(is(t.active)){b=t.active;t.active=-1;t.setActive(b);}},remove:function(){DOM.remove(this.id);this.destroy();},destroy:function(){tinymce.dom.Event.clear(this.id);}});})();tinymce.create('tinymce.ui.Container:tinymce.ui.Control',{Container:function(id,s){this.parent(id,s);this.controls=[];this.lookup={};},add:function(c){this.lookup[c.id]=c;this.controls.push(c);return c;},get:function(n){return this.lookup[n];}});tinymce.create('tinymce.ui.Separator:tinymce.ui.Control',{Separator:function(id,s){this.parent(id,s);this.classPrefix='mceSeparator';},renderHTML:function(){return tinymce.DOM.createHTML('span',{'class':this.classPrefix});}});(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,walk=tinymce.walk;tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control',{MenuItem:function(id,s){this.parent(id,s);this.classPrefix='mceMenuItem';},setSelected:function(s){this.setState('Selected',s);this.selected=s;},isSelected:function(){return this.selected;},postRender:function(){var t=this;t.parent();if(is(t.selected))t.setSelected(t.selected);}});})();(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,walk=tinymce.walk;tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem',{Menu:function(id,s){var t=this;t.parent(id,s);t.items={};t.collapsed=false;t.menuCount=0;t.onAddItem=new tinymce.util.Dispatcher(this);},expand:function(d){var t=this;if(d){walk(t,function(o){if(o.expand)o.expand();},'items',t);}t.collapsed=false;},collapse:function(d){var t=this;if(d){walk(t,function(o){if(o.collapse)o.collapse();},'items',t);}t.collapsed=true;},isCollapsed:function(){return this.collapsed;},add:function(o){if(!o.settings)o=new tinymce.ui.MenuItem(o.id||DOM.uniqueId(),o);this.onAddItem.dispatch(this,o);return this.items[o.id]=o;},addSeparator:function(){return this.add({separator:true});},addMenu:function(o){if(!o.collapse)o=this.createMenu(o);this.menuCount++;return this.add(o);},hasMenus:function(){return this.menuCount!==0;},remove:function(o){delete this.items[o.id];},removeAll:function(){var t=this;walk(t,function(o){if(o.removeAll)o.removeAll();else o.remove();o.destroy();},'items',t);t.items={};},createMenu:function(o){var m=new tinymce.ui.Menu(o.id||DOM.uniqueId(),o);m.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return m;}});})();(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,Event=tinymce.dom.Event,Element=tinymce.dom.Element;tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu',{DropMenu:function(id,s){s=s||{};s.container=s.container||DOM.doc.body;s.offset_x=s.offset_x||0;s.offset_y=s.offset_y||0;s.vp_offset_x=s.vp_offset_x||0;s.vp_offset_y=s.vp_offset_y||0;if(is(s.icons)&&!s.icons)s['class']+=' mceNoIcons';this.parent(id,s);this.onShowMenu=new tinymce.util.Dispatcher(this);this.onHideMenu=new tinymce.util.Dispatcher(this);this.classPrefix='mceMenu';},createMenu:function(s){var t=this,cs=t.settings,m;s.container=s.container||cs.container;s.parent=t;s.constrain=s.constrain||cs.constrain;s['class']=s['class']||cs['class'];s.vp_offset_x=s.vp_offset_x||cs.vp_offset_x;s.vp_offset_y=s.vp_offset_y||cs.vp_offset_y;m=new tinymce.ui.DropMenu(s.id||DOM.uniqueId(),s);m.onAddItem.add(t.onAddItem.dispatch,t.onAddItem);return m;},update:function(){var t=this,s=t.settings,tb=DOM.get('menu_'+t.id+'_tbl'),co=DOM.get('menu_'+t.id+'_co'),tw,th;tw=s.max_width?Math.min(tb.clientWidth,s.max_width):tb.clientWidth;th=s.max_height?Math.min(tb.clientHeight,s.max_height):tb.clientHeight;if(!DOM.boxModel)t.element.setStyles({width:tw+2,height:th+2});else t.element.setStyles({width:tw,height:th});if(s.max_width)DOM.setStyle(co,'width',tw);if(s.max_height){DOM.setStyle(co,'height',th);if(tb.clientHeight<s.max_height)DOM.setStyle(co,'overflow','hidden');}},showMenu:function(x,y,px){var t=this,s=t.settings,co,vp=DOM.getViewPort(),w,h,mx,my,ot=2,dm,tb,cp=t.classPrefix;t.collapse(1);if(t.isMenuVisible)return;if(!t.rendered){co=DOM.add(t.settings.container,t.renderNode());each(t.items,function(o){o.postRender();});t.element=new Element('menu_'+t.id,{blocker:1,container:s.container});}else co=DOM.get('menu_'+t.id);if(!tinymce.isOpera)DOM.setStyles(co,{left:-0xFFFF,top:-0xFFFF});DOM.show(co);t.update();x+=s.offset_x||0;y+=s.offset_y||0;vp.w-=4;vp.h-=4;if(s.constrain){w=co.clientWidth-ot;h=co.clientHeight-ot;mx=vp.x+vp.w;my=vp.y+vp.h;if((x+s.vp_offset_x+w)>mx)x=px?px-w:Math.max(0,(mx-s.vp_offset_x)-w);if((y+s.vp_offset_y+h)>my)y=Math.max(0,(my-s.vp_offset_y)-h);}DOM.setStyles(co,{left:x,top:y});t.element.update();t.isMenuVisible=1;t.mouseClickFunc=Event.add(co,'click',function(e){var m;e=e.target;if(e&&(e=DOM.getParent(e,'TR'))&&!DOM.hasClass(e,cp+'ItemSub')){m=t.items[e.id];if(m.isDisabled())return;dm=t;while(dm){if(dm.hideMenu)dm.hideMenu();dm=dm.settings.parent;}if(m.settings.onclick)m.settings.onclick(e);return Event.cancel(e);}});if(t.hasMenus()){t.mouseOverFunc=Event.add(co,'mouseover',function(e){var m,r,mi;e=e.target;if(e&&(e=DOM.getParent(e,'TR'))){m=t.items[e.id];if(t.lastMenu)t.lastMenu.collapse(1);if(m.isDisabled())return;if(e&&DOM.hasClass(e,cp+'ItemSub')){r=DOM.getRect(e);m.showMenu((r.x+r.w-ot),r.y-ot,r.x);t.lastMenu=m;DOM.addClass(DOM.get(m.id).firstChild,cp+'ItemActive');}}});}t.onShowMenu.dispatch(t);if(s.keyboard_focus){Event.add(co,'keydown',t._keyHandler,t);DOM.select('a','menu_'+t.id)[0].focus();t._focusIdx=0;}},hideMenu:function(c){var t=this,co=DOM.get('menu_'+t.id),e;if(!t.isMenuVisible)return;Event.remove(co,'mouseover',t.mouseOverFunc);Event.remove(co,'click',t.mouseClickFunc);Event.remove(co,'keydown',t._keyHandler);DOM.hide(co);t.isMenuVisible=0;if(!c)t.collapse(1);if(t.element)t.element.hide();if(e=DOM.get(t.id))DOM.removeClass(e.firstChild,t.classPrefix+'ItemActive');t.onHideMenu.dispatch(t);},add:function(o){var t=this,co;o=t.parent(o);if(t.isRendered&&(co=DOM.get('menu_'+t.id)))t._add(DOM.select('tbody',co)[0],o);return o;},collapse:function(d){this.parent(d);this.hideMenu(1);},remove:function(o){DOM.remove(o.id);this.destroy();return this.parent(o);},destroy:function(){var t=this,co=DOM.get('menu_'+t.id);Event.remove(co,'mouseover',t.mouseOverFunc);Event.remove(co,'click',t.mouseClickFunc);if(t.element)t.element.remove();DOM.remove(co);},renderNode:function(){var t=this,s=t.settings,n,tb,co,w;w=DOM.create('div',{id:'menu_'+t.id,'class':s['class'],'style':'position:absolute;left:0;top:0;z-index:200000'});co=DOM.add(w,'div',{id:'menu_'+t.id+'_co','class':t.classPrefix+(s['class']?' '+s['class']:'')});t.element=new Element('menu_'+t.id,{blocker:1,container:s.container});if(s.menu_line)DOM.add(co,'span',{'class':t.classPrefix+'Line'});n=DOM.add(co,'table',{id:'menu_'+t.id+'_tbl',border:0,cellPadding:0,cellSpacing:0});tb=DOM.add(n,'tbody');each(t.items,function(o){t._add(tb,o);});t.rendered=true;return w;},_keyHandler:function(e){var t=this,kc=e.keyCode;function focus(d){var i=t._focusIdx+d,e=DOM.select('a','menu_'+t.id)[i];if(e){t._focusIdx=i;e.focus();}};switch(kc){case 38:focus(-1);return;case 40:focus(1);return;case 13:return;case 27:return this.hideMenu();}},_add:function(tb,o){var n,s=o.settings,a,ro,it,cp=this.classPrefix;if(s.separator){ro=DOM.add(tb,'tr',{id:o.id,'class':cp+'ItemSeparator'});DOM.add(ro,'td',{'class':cp+'ItemSeparator'});if(n=ro.previousSibling)DOM.addClass(n,'mceLast');return;}n=ro=DOM.add(tb,'tr',{id:o.id,'class':cp+'Item '+cp+'ItemEnabled'});n=it=DOM.add(n,'td');n=a=DOM.add(n,'a',{href:'javascript:;',onclick:"return false;",onmousedown:'return false;'});DOM.addClass(it,s['class']);DOM.add(n,'span',{'class':'mceIcon'+(s.icon?' mce_'+s.icon:'')});n=DOM.add(n,s.element||'span',{'class':'mceText',title:o.settings.title},o.settings.title);if(o.settings.style)DOM.setAttrib(n,'style',o.settings.style);if(tb.childNodes.length==1)DOM.addClass(ro,'mceFirst');if((n=ro.previousSibling)&&DOM.hasClass(n,cp+'ItemSeparator'))DOM.addClass(ro,'mceFirst');if(o.collapse)DOM.addClass(ro,cp+'ItemSub');if(n=ro.previousSibling)DOM.removeClass(n,'mceLast');DOM.addClass(ro,'mceLast');}});})();(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.ui.Button:tinymce.ui.Control',{Button:function(id,s){this.parent(id,s);this.classPrefix='mceButton';},renderHTML:function(){var cp=this.classPrefix,s=this.settings,h,l;l=DOM.encode(s.label||'');h='<a id="'+this.id+'" href="javascript:;" class="'+cp+' '+cp+'Enabled '+s['class']+(l?' '+cp+'Labeled':'')+'" onmousedown="return false;" onclick="return false;" title="'+DOM.encode(s.title)+'">';if(s.image)h+='<img class="mceIcon" src="'+s.image+'" />'+l+'</a>';else h+='<span class="mceIcon '+s['class']+'"></span>'+(l?'<span class="'+cp+'Label">'+l+'</span>':'')+'</a>';return h;},postRender:function(){var t=this,s=t.settings;tinymce.dom.Event.add(t.id,'click',function(e){if(!t.isDisabled())return s.onclick.call(s.scope,e);});}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher;tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control',{ListBox:function(id,s){var t=this;t.parent(id,s);t.items=[];t.onChange=new Dispatcher(t);t.onPostRender=new Dispatcher(t);t.onAdd=new Dispatcher(t);t.onRenderMenu=new tinymce.util.Dispatcher(this);t.classPrefix='mceListBox';},select:function(v){var t=this,e,fv;if(v!=t.selectedValue){e=DOM.get(t.id+'_text');t.selectedValue=v;each(t.items,function(o){if(o.value==v){DOM.setHTML(e,DOM.encode(o.title));fv=1;return false;}});if(!fv){DOM.setHTML(e,DOM.encode(t.settings.title));DOM.addClass(e,'mceTitle');e=0;return;}else DOM.removeClass(e,'mceTitle');}e=0;},add:function(n,v,o){var t=this;o=o||{};o=tinymce.extend(o,{title:n,value:v});t.items.push(o);t.onAdd.dispatch(t,o);},getLength:function(){return this.items.length;},renderHTML:function(){var h='',t=this,s=t.settings,cp=t.classPrefix;h='<table id="'+t.id+'" cellpadding="0" cellspacing="0" class="'+cp+' '+cp+'Enabled'+(s['class']?(' '+s['class']):'')+'"><tbody><tr>';h+='<td>'+DOM.createHTML('a',{id:t.id+'_text',href:'javascript:;','class':'mceText',onclick:"return false;",onmousedown:'return false;'},DOM.encode(t.settings.title))+'</td>';h+='<td>'+DOM.createHTML('a',{id:t.id+'_open',tabindex:-1,href:'javascript:;','class':'mceOpen',onclick:"return false;",onmousedown:'return false;'},'<span></span>')+'</td>';h+='</tr></tbody></table>';return h;},showMenu:function(){var t=this,p1,p2,e=DOM.get(this.id),m;if(t.isDisabled()||t.items.length==0)return;if(t.menu&&t.menu.isMenuVisible)return t.hideMenu();if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}p1=DOM.getPos(this.settings.menu_container);p2=DOM.getPos(e);m=t.menu;m.settings.offset_x=p2.x;m.settings.offset_y=p2.y;m.settings.keyboard_focus=!tinymce.isOpera;if(t.oldID)m.items[t.oldID].setSelected(0);each(t.items,function(o){if(o.value===t.selectedValue){m.items[o.id].setSelected(1);t.oldID=o.id;}});m.showMenu(0,e.clientHeight);Event.add(DOM.doc,'mousedown',t.hideMenu,t);DOM.addClass(t.id,t.classPrefix+'Selected');},hideMenu:function(e){var t=this;if(e&&e.type=="mousedown"&&(e.target.id==t.id+'_text'||e.target.id==t.id+'_open'))return;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceMenu');})){DOM.removeClass(t.id,t.classPrefix+'Selected');Event.remove(DOM.doc,'mousedown',t.hideMenu,t);if(t.menu)t.menu.hideMenu();}},renderMenu:function(){var t=this,m;m=t.settings.control_manager.createDropMenu(t.id+'_menu',{menu_line:1,'class':t.classPrefix+'Menu mceNoIcons',max_width:150,max_height:150});m.onHideMenu.add(t.hideMenu,t);m.add({title:t.settings.title,'class':'mceMenuItemTitle'}).setDisabled(1);each(t.items,function(o){o.id=DOM.uniqueId();o.onclick=function(){if(t.settings.onselect(o.value)!==false)t.select(o.value);};m.add(o);});t.onRenderMenu.dispatch(t,m);t.menu=m;},postRender:function(){var t=this,cp=t.classPrefix;Event.add(t.id,'click',t.showMenu,t);Event.add(t.id+'_text','focus',function(e){if(!t._focused){t.keyDownHandler=Event.add(t.id+'_text','keydown',function(e){var idx=-1,v,kc=e.keyCode;each(t.items,function(v,i){if(t.selectedValue==v.value)idx=i;});if(kc==38)v=t.items[idx-1];else if(kc==40)v=t.items[idx+1];else if(kc==13){v=t.selectedValue;t.selectedValue=null;t.settings.onselect(v);return Event.cancel(e);}if(v){t.hideMenu();t.select(v.value);}});}t._focused=1;});Event.add(t.id+'_text','blur',function(){Event.remove(t.id+'_text','keydown',t.keyDownHandler);t._focused=0;});if(tinymce.isIE6||!DOM.boxModel){Event.add(t.id,'mouseover',function(){if(!DOM.hasClass(t.id,cp+'Disabled'))DOM.addClass(t.id,cp+'Hover');});Event.add(t.id,'mouseout',function(){if(!DOM.hasClass(t.id,cp+'Disabled'))DOM.removeClass(t.id,cp+'Hover');});}t.onPostRender.dispatch(t,DOM.get(t.id));},destroy:function(){this.parent();Event.clear(this.id+'_text');}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher;tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox',{NativeListBox:function(id,s){this.parent(id,s);this.classPrefix='mceNativeListBox';},setDisabled:function(s){DOM.get(this.id).disabled=s;},isDisabled:function(){return DOM.get(this.id).disabled;},select:function(v){var e=DOM.get(this.id),ol=e.options;v=''+(v||'');e.selectedIndex=0;each(ol,function(o,i){if(o.value==v){e.selectedIndex=i;return false;}});},add:function(n,v,a){var o,t=this;a=a||{};a.value=v;if(t.isRendered())DOM.add(DOM.get(this.id),'option',a,n);o={title:n,value:v,attribs:a};t.items.push(o);t.onAdd.dispatch(t,o);},getLength:function(){return DOM.get(this.id).options.length-1;},renderHTML:function(){var h,t=this;h=DOM.createHTML('option',{value:''},'-- '+t.settings.title+' --');each(t.items,function(it){h+=DOM.createHTML('option',{value:it.value},it.title);});h=DOM.createHTML('select',{id:t.id,'class':'mceNativeListBox'},h);return h;},postRender:function(){var t=this,ch;t.rendered=true;function onChange(e){var v=e.target.options[e.target.selectedIndex].value;t.onChange.dispatch(t,v);if(t.settings.onselect)t.settings.onselect(v);};Event.add(t.id,'change',onChange);Event.add(t.id,'keydown',function(e){var bf;Event.remove(t.id,'change',ch);bf=Event.add(t.id,'blur',function(){Event.add(t.id,'change',onChange);Event.remove(t.id,'blur',bf);});if(e.keyCode==13||e.keyCode==32){onChange(e);return Event.cancel(e);}});t.onPostRender.dispatch(t,DOM.get(t.id));}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each;tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button',{MenuButton:function(id,s){this.parent(id,s);this.onRenderMenu=new tinymce.util.Dispatcher(this);s.menu_container=s.menu_container||DOM.doc.body;},showMenu:function(){var t=this,p1,p2,e=DOM.get(t.id),m;if(t.isDisabled())return;if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}if(t.isMenuVisible)return t.hideMenu();p1=DOM.getPos(t.settings.menu_container);p2=DOM.getPos(e);m=t.menu;m.settings.offset_x=p2.x;m.settings.offset_y=p2.y;m.settings.vp_offset_x=p2.x;m.settings.vp_offset_y=p2.y;m.settings.keyboard_focus=t._focused;m.showMenu(0,e.clientHeight);Event.add(DOM.doc,'mousedown',t.hideMenu,t);t.setState('Selected',1);t.isMenuVisible=1;},renderMenu:function(){var t=this,m;m=t.settings.control_manager.createDropMenu(t.id+'_menu',{menu_line:1,'class':this.classPrefix+'Menu',icons:t.settings.icons});m.onHideMenu.add(t.hideMenu,t);t.onRenderMenu.dispatch(t,m);t.menu=m;},hideMenu:function(e){var t=this;if(e&&e.type=="mousedown"&&DOM.getParent(e.target,function(e){return e.id===t.id||e.id===t.id+'_open';}))return;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceMenu');})){t.setState('Selected',0);Event.remove(DOM.doc,'mousedown',t.hideMenu,t);if(t.menu)t.menu.hideMenu();}t.isMenuVisible=0;},postRender:function(){var t=this,s=t.settings;Event.add(t.id,'click',function(){if(!t.isDisabled()){if(s.onclick)s.onclick(t.value);t.showMenu();}});}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each;tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton',{SplitButton:function(id,s){this.parent(id,s);this.classPrefix='mceSplitButton';},renderHTML:function(){var h,t=this,s=t.settings,h1;h='<tbody><tr>';if(s.image)h1=DOM.createHTML('img ',{src:s.image,'class':'mceAction '+s['class']});else h1=DOM.createHTML('span',{'class':'mceAction '+s['class']},'');h+='<td>'+DOM.createHTML('a',{id:t.id+'_action',href:'javascript:;','class':'mceAction '+s['class'],onclick:"return false;",onmousedown:'return false;',title:s.title},h1)+'</td>';h1=DOM.createHTML('span',{'class':'mceOpen '+s['class']});h+='<td>'+DOM.createHTML('a',{id:t.id+'_open',href:'javascript:;','class':'mceOpen '+s['class'],onclick:"return false;",onmousedown:'return false;',title:s.title},h1)+'</td>';h+='</tr></tbody>';return DOM.createHTML('table',{id:t.id,'class':'mceSplitButton mceSplitButtonEnabled '+s['class'],cellpadding:'0',cellspacing:'0',onmousedown:'return false;',title:s.title},h);},postRender:function(){var t=this,s=t.settings;if(s.onclick){Event.add(t.id+'_action','click',function(){if(!t.isDisabled())s.onclick(t.value);});}Event.add(t.id+'_open','click',t.showMenu,t);Event.add(t.id+'_open','focus',function(){t._focused=1;});Event.add(t.id+'_open','blur',function(){t._focused=0;});if(tinymce.isIE6||!DOM.boxModel){Event.add(t.id,'mouseover',function(){if(!DOM.hasClass(t.id,'mceSplitButtonDisabled'))DOM.addClass(t.id,'mceSplitButtonHover');});Event.add(t.id,'mouseout',function(){if(!DOM.hasClass(t.id,'mceSplitButtonDisabled'))DOM.removeClass(t.id,'mceSplitButtonHover');});}},destroy:function(){this.parent();Event.clear(this.id+'_action');Event.clear(this.id+'_open');}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,is=tinymce.is,each=tinymce.each;tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton',{ColorSplitButton:function(id,s){var t=this;t.parent(id,s);t.settings=s=tinymce.extend({colors:'000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF',grid_width:8,default_color:'#888888'},t.settings);t.onShowMenu=new tinymce.util.Dispatcher(t);t.onHideMenu=new tinymce.util.Dispatcher(t);t.value=s.default_color;},showMenu:function(){var t=this,r,p,e,p2;if(t.isDisabled())return;if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}if(t.isMenuVisible)return t.hideMenu();e=DOM.get(t.id);DOM.show(t.id+'_menu');DOM.addClass(e,'mceSplitButtonSelected');p2=DOM.getPos(e);DOM.setStyles(t.id+'_menu',{left:p2.x,top:p2.y+e.clientHeight,zIndex:200000});e=0;Event.add(DOM.doc,'mousedown',t.hideMenu,t);if(t._focused){t._keyHandler=Event.add(t.id+'_menu','keydown',function(e){if(e.keyCode==27)t.hideMenu();});DOM.select('a',t.id+'_menu')[0].focus();}t.onShowMenu.dispatch(t);t.isMenuVisible=1;},hideMenu:function(e){var t=this;if(e&&e.type=="mousedown"&&DOM.getParent(e.target,function(e){return e.id===t.id+'_open';}))return;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceSplitButtonMenu');})){DOM.removeClass(t.id,'mceSplitButtonSelected');Event.remove(DOM.doc,'mousedown',t.hideMenu,t);Event.remove(t.id+'_menu','keydown',t._keyHandler);DOM.hide(t.id+'_menu');}t.onHideMenu.dispatch(t);t.isMenuVisible=0;},renderMenu:function(){var t=this,m,i=0,s=t.settings,n,tb,tr,w;w=DOM.add(s.menu_container,'div',{id:t.id+'_menu','class':s['menu_class']+' '+s['class'],style:'position:absolute;left:0;top:-1000px;'});m=DOM.add(w,'div',{'class':s['class']+' mceSplitButtonMenu'});DOM.add(m,'span',{'class':'mceMenuLine'});n=DOM.add(m,'table',{'class':'mceColorSplitMenu'});tb=DOM.add(n,'tbody');i=0;each(is(s.colors,'array')?s.colors:s.colors.split(','),function(c){c=c.replace(/^#/,'');if(!i--){tr=DOM.add(tb,'tr');i=s.grid_width-1;}n=DOM.add(tr,'td');n=DOM.add(n,'a',{href:'javascript:;',style:{backgroundColor:'#'+c},mce_color:'#'+c});});if(s.more_colors_func){n=DOM.add(tb,'tr');n=DOM.add(n,'td',{colspan:s.grid_width,'class':'mceMoreColors'});n=DOM.add(n,'a',{id:t.id+'_more',href:'javascript:;',onclick:'return false;','class':'mceMoreColors'},s.more_colors_title);Event.add(n,'click',function(e){s.more_colors_func.call(s.more_colors_scope||this);return Event.cancel(e);});}DOM.addClass(m,'mceColorSplitMenu');Event.add(t.id+'_menu','click',function(e){var c;e=e.target;if(e.nodeName=='A'&&(c=e.getAttribute('mce_color')))t.setColor(c);return Event.cancel(e);});return w;},setColor:function(c){var t=this;DOM.setStyle(t.id+'_preview','backgroundColor',c);t.value=c;t.hideMenu();t.settings.onselect(c);},postRender:function(){var t=this,id=t.id;t.parent();DOM.add(id+'_action','div',{id:id+'_preview','class':'mceColorPreview'});},destroy:function(){this.parent();Event.clear(this.id+'_menu');Event.clear(this.id+'_more');DOM.remove(this.id+'_menu');}});})();tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container',{renderHTML:function(){var t=this,h='',c,co,dom=tinymce.DOM,s=t.settings,i,pr,nx,cl;cl=t.controls;for(i=0;i<cl.length;i++){co=cl[i];pr=cl[i-1];nx=cl[i+1];if(i===0){c='mceToolbarStart';if(co.Button)c+=' mceToolbarStartButton';else if(co.SplitButton)c+=' mceToolbarStartSplitButton';else if(co.ListBox)c+=' mceToolbarStartListBox';h+=dom.createHTML('td',{'class':c},dom.createHTML('span',null,'<!-- IE -->'));}if(pr&&co.ListBox){if(pr.Button||pr.SplitButton)h+=dom.createHTML('td',{'class':'mceToolbarEnd'},dom.createHTML('span',null,'<!-- IE -->'));}if(dom.stdMode)h+='<td style="position: relative">'+co.renderHTML()+'</td>';else h+='<td>'+co.renderHTML()+'</td>';if(nx&&co.ListBox){if(nx.Button||nx.SplitButton)h+=dom.createHTML('td',{'class':'mceToolbarStart'},dom.createHTML('span',null,'<!-- IE -->'));}}c='mceToolbarEnd';if(co.Button)c+=' mceToolbarEndButton';else if(co.SplitButton)c+=' mceToolbarEndSplitButton';else if(co.ListBox)c+=' mceToolbarEndListBox';h+=dom.createHTML('td',{'class':c},dom.createHTML('span',null,'<!-- IE -->'));return dom.createHTML('table',{id:t.id,'class':'mceToolbar'+(s['class']?' '+s['class']:''),cellpadding:'0',cellspacing:'0',align:t.settings.align||''},'<tbody><tr>'+h+'</tr></tbody>');}});(function(){var Dispatcher=tinymce.util.Dispatcher,each=tinymce.each;tinymce.create('tinymce.AddOnManager',{items:[],urls:{},lookup:{},onAdd:new Dispatcher(this),get:function(n){return this.lookup[n];},requireLangPack:function(n){var u,s;if(tinymce.EditorManager.settings){u=this.urls[n]+'/langs/'+tinymce.EditorManager.settings.language+'.js';s=tinymce.EditorManager.settings;if(s){if(!tinymce.dom.Event.domLoaded&&!s.strict_mode)tinymce.ScriptLoader.load(u);else tinymce.ScriptLoader.add(u);}}},add:function(id,o){this.items.push(o);this.lookup[id]=o;this.onAdd.dispatch(this,id,o);return o;},load:function(n,u,cb,s){var t=this;if(t.urls[n])return;if(u.indexOf('/')!=0&&u.indexOf('://')==-1)u=tinymce.baseURL+'/'+u;t.urls[n]=u.substring(0,u.lastIndexOf('/'));tinymce.ScriptLoader.add(u,cb,s);}});tinymce.PluginManager=new tinymce.AddOnManager();tinymce.ThemeManager=new tinymce.AddOnManager();}());(function(){var each=tinymce.each,extend=tinymce.extend,DOM=tinymce.DOM,Event=tinymce.dom.Event,ThemeManager=tinymce.ThemeManager,PluginManager=tinymce.PluginManager,explode=tinymce.explode;tinymce.create('static tinymce.EditorManager',{editors:{},i18n:{},activeEditor:null,preInit:function(){var t=this,lo=window.location;tinymce.documentBaseURL=lo.href.replace(/[\?#].*$/,'').replace(/[\/\\][^\/]+$/,'');if(!/[\/\\]$/.test(tinymce.documentBaseURL))tinymce.documentBaseURL+='/';tinymce.baseURL=new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);tinymce.EditorManager.baseURI=new tinymce.util.URI(tinymce.baseURL);if(tinymce.EditorManager.baseURI.host!=lo.hostname&&lo.hostname)document.domain=tinymce.relaxedDomain=lo.hostname.replace(/.*\.(.+\..+)$/,'$1');t.onBeforeUnload=new tinymce.util.Dispatcher(t);Event.add(window,'beforeunload',function(e){t.onBeforeUnload.dispatch(t,e);});},init:function(s){var t=this,pl,sl=tinymce.ScriptLoader,c,e;function execCallback(se,n,s){var f=se[n];if(!f)return;if(tinymce.is(f,'string')){s=f.replace(/\.\w+$/,'');s=s?tinymce.resolve(s):0;f=tinymce.resolve(f);}return f.apply(s||this,Array.prototype.slice.call(arguments,2));};s=extend({theme:"simple",language:"en",strict_loading_mode:document.contentType=='application/xhtml+xml'},s);t.settings=s;if(!Event.domLoaded&&!s.strict_loading_mode){if(s.language)sl.add(tinymce.baseURL+'/langs/'+s.language+'.js');if(s.theme&&s.theme.charAt(0)!='-'&&!ThemeManager.urls[s.theme])ThemeManager.load(s.theme,'themes/'+s.theme+'/editor_template'+tinymce.suffix+'.js');if(s.plugins){pl=explode(s.plugins);if(tinymce.inArray(pl,'compat2x')!=-1)PluginManager.load('compat2x','plugins/compat2x/editor_plugin'+tinymce.suffix+'.js');each(pl,function(v){if(v&&v.charAt(0)!='-'&&!PluginManager.urls[v]){if(!tinymce.isWebKit&&v=='safari')return;PluginManager.load(v,'plugins/'+v+'/editor_plugin'+tinymce.suffix+'.js');}});}sl.loadQueue();}Event.add(document,'init',function(){var l,co;execCallback(s,'onpageload');if(s.browsers){l=false;each(explode(s.browsers),function(v){switch(v){case'ie':case'msie':if(tinymce.isIE)l=true;break;case'gecko':if(tinymce.isGecko)l=true;break;case'safari':case'webkit':if(tinymce.isWebKit)l=true;break;case'opera':if(tinymce.isOpera)l=true;break;}});if(!l)return;}switch(s.mode){case"exact":l=s.elements||'';if(l.length>0){each(explode(l),function(v){if(DOM.get(v))new tinymce.Editor(v,s).render(1);else{c=0;each(document.forms,function(f){each(f.elements,function(e){if(e.name===v){v='mce_editor_'+c;DOM.setAttrib(e,'id',v);new tinymce.Editor(v,s).render(1);}});});}});}break;case"textareas":case"specific_textareas":function hasClass(n,c){return c.constructor===RegExp?c.test(n.className):DOM.hasClass(n,c);};each(DOM.select('textarea'),function(v){if(s.editor_deselector&&hasClass(v,s.editor_deselector))return;if(!s.editor_selector||hasClass(v,s.editor_selector)){e=DOM.get(v.name);if(!v.id&&!e)v.id=v.name;if(!v.id||t.get(v.id))v.id=DOM.uniqueId();new tinymce.Editor(v.id,s).render(1);}});break;}if(s.oninit){l=co=0;each(t.editors,function(ed){co++;if(!ed.initialized){ed.onInit.add(function(){l++;if(l==co)execCallback(s,'oninit');});}else l++;if(l==co)execCallback(s,'oninit');});}});},get:function(id){return this.editors[id];},getInstanceById:function(id){return this.get(id);},add:function(e){this.editors[e.id]=e;this._setActive(e);return e;},remove:function(e){var t=this;if(!t.editors[e.id])return null;delete t.editors[e.id];if(t.activeEditor==e){each(t.editors,function(e){t._setActive(e);return false;});}e.destroy();return e;},execCommand:function(c,u,v){var t=this,ed=t.get(v),w;switch(c){case"mceFocus":ed.focus();return true;case"mceAddEditor":case"mceAddControl":if(!t.get(v))new tinymce.Editor(v,t.settings).render();return true;case"mceAddFrameControl":w=v.window;w.tinyMCE=tinyMCE;w.tinymce=tinymce;tinymce.DOM.doc=w.document;tinymce.DOM.win=w;ed=new tinymce.Editor(v.element_id,v);ed.render();if(tinymce.isIE){function clr(){ed.destroy();w.detachEvent('onunload',clr);w=w.tinyMCE=w.tinymce=null;};w.attachEvent('onunload',clr);}v.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":ed.remove();return true;case'mceToggleEditor':if(!ed){t.execCommand('mceAddControl',0,v);return true;}if(ed.isHidden())ed.show();else ed.hide();return true;}if(t.activeEditor)return t.activeEditor.execCommand(c,u,v);return false;},execInstanceCommand:function(id,c,u,v){var ed=this.get(id);if(ed)return ed.execCommand(c,u,v);return false;},triggerSave:function(){each(this.editors,function(e){e.save();});},addI18n:function(p,o){var lo,i18n=this.i18n;if(!tinymce.is(p,'string')){each(p,function(o,lc){each(o,function(o,g){each(o,function(o,k){if(g==='common')i18n[lc+'.'+k]=o;else i18n[lc+'.'+g+'.'+k]=o;});});});}else{each(o,function(o,k){i18n[p+'.'+k]=o;});}},_setActive:function(e){this.selectedInstance=this.activeEditor=e;}});tinymce.EditorManager.preInit();})();var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,Dispatcher=tinymce.util.Dispatcher;var each=tinymce.each,isGecko=tinymce.isGecko,isIE=tinymce.isIE,isWebKit=tinymce.isWebKit;var is=tinymce.is,ThemeManager=tinymce.ThemeManager,PluginManager=tinymce.PluginManager,EditorManager=tinymce.EditorManager;var inArray=tinymce.inArray,grep=tinymce.grep,explode=tinymce.explode;tinymce.create('tinymce.Editor',{Editor:function(id,s){var t=this;t.id=t.editorId=id;t.execCommands={};t.queryStateCommands={};t.queryValueCommands={};t.plugins={};each(['onPreInit','onBeforeRenderUI','onPostRender','onInit','onRemove','onActivate','onDeactivate','onClick','onEvent','onMouseUp','onMouseDown','onDblClick','onKeyDown','onKeyUp','onKeyPress','onContextMenu','onSubmit','onReset','onPaste','onPreProcess','onPostProcess','onBeforeSetContent','onBeforeGetContent','onSetContent','onGetContent','onLoadContent','onSaveContent','onNodeChange','onChange','onBeforeExecCommand','onExecCommand','onUndo','onRedo','onVisualAid','onSetProgressState'],function(e){t[e]=new Dispatcher(t);});t.settings=s=extend({id:id,language:'en',docs_language:'en',theme:'simple',skin:'default',delta_width:0,delta_height:0,popup_css:'',plugins:'',document_base_url:tinymce.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',visual_table_class:'mceItemTable',visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:'xx-small,x-small,small,medium,large,x-large,xx-large',apply_source_formatting:1,directionality:'ltr',forced_root_block:'p',valid_elements:'@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value|_value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big',hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:'30px'},s);t.documentBaseURI=new tinymce.util.URI(s.document_base_url||tinymce.documentBaseURL,{base_uri:tinyMCE.baseURI});t.baseURI=EditorManager.baseURI;t.execCallback('setup',t);},render:function(nst){var t=this,s=t.settings,id=t.id,sl=tinymce.ScriptLoader;if(!Event.domLoaded){Event.add(document,'init',function(){t.render();});return;}if(!nst){s.strict_loading_mode=1;tinyMCE.settings=s;}if(!t.getElement())return;if(s.strict_loading_mode){sl.settings.strict_mode=s.strict_loading_mode;tinymce.DOM.settings.strict=1;}if(!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&s.hidden_input&&DOM.getParent(id,'form'))DOM.insertAfter(DOM.create('input',{type:'hidden',name:id}),id);t.windowManager=new tinymce.WindowManager(t);if(s.encoding=='xml'){t.onGetContent.add(function(ed,o){if(o.save)o.content=DOM.encode(o.content);});}if(s.add_form_submit_trigger){t.onSubmit.addToTop(function(){if(t.initialized){t.save();t.isNotDirty=1;}});}if(s.add_unload_trigger&&!s.ask){t._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(t.initialized&&!t.destroyed&&!t.isHidden())t.save({format:'raw',no_events:true});});}tinymce.addUnload(t.destroy,t);if(s.submit_patch){t.onBeforeRenderUI.add(function(){var n=t.getElement().form;if(!n)return;if(n._mceOldSubmit)return;if(!n.submit.nodeType&&!n.submit.length){t.formElement=n;n._mceOldSubmit=n.submit;n.submit=function(){EditorManager.triggerSave();t.isNotDirty=1;return this._mceOldSubmit(this);};}n=null;});}function loadScripts(){if(s.language)sl.add(tinymce.baseURL+'/langs/'+s.language+'.js');if(s.theme.charAt(0)!='-'&&!ThemeManager.urls[s.theme])ThemeManager.load(s.theme,'themes/'+s.theme+'/editor_template'+tinymce.suffix+'.js');each(explode(s.plugins),function(p){if(p&&p.charAt(0)!='-'&&!PluginManager.urls[p]){if(!isWebKit&&p=='safari')return;PluginManager.load(p,'plugins/'+p+'/editor_plugin'+tinymce.suffix+'.js');}});sl.loadQueue(function(){if(s.ask){function ask(){window.setTimeout(function(){Event.remove(t.id,'focus',ask);t.windowManager.confirm(t.getLang('edit_confirm'),function(s){if(s)t.init();});},0);};Event.add(t.id,'focus',ask);return;}if(!t.removed)t.init();});};if(s.plugins.indexOf('compat2x')!=-1){PluginManager.load('compat2x','plugins/compat2x/editor_plugin'+tinymce.suffix+'.js');sl.loadQueue(loadScripts);}else loadScripts();},init:function(){var n,t=this,s=t.settings,w,h,e=t.getElement(),o,ti,u,bi,bc,re;EditorManager.add(t);s.theme=s.theme.replace(/-/,'');o=ThemeManager.get(s.theme);t.theme=new o();if(t.theme.init&&s.init_theme)t.theme.init(t,ThemeManager.urls[s.theme]||tinymce.documentBaseURL.replace(/\/$/,''));each(explode(s.plugins.replace(/\-/g,'')),function(p){var c=PluginManager.get(p),u=PluginManager.urls[p]||tinymce.documentBaseURL.replace(/\/$/,''),po;if(c){po=new c(t,u);t.plugins[p]=po;if(po.init)po.init(t,u);}});if(s.popup_css)s.popup_css=t.documentBaseURI.toAbsolute(s.popup_css);else s.popup_css=t.baseURI.toAbsolute("themes/"+s.theme+"/skins/"+s.skin+"/dialog.css");if(s.popup_css_add)s.popup_css+=','+t.documentBaseURI.toAbsolute(s.popup_css_add);t.controlManager=new tinymce.ControlManager(t);t.undoManager=new tinymce.UndoManager(t);t.undoManager.onAdd.add(function(um,l){if(!l.initial)return t.onChange.dispatch(t,l,um);});t.undoManager.onUndo.add(function(um,l){return t.onUndo.dispatch(t,l,um);});t.undoManager.onRedo.add(function(um,l){return t.onRedo.dispatch(t,l,um);});if(s.custom_undo_redo){t.onExecCommand.add(function(ed,cmd,ui,val,a){if(cmd!='Undo'&&cmd!='Redo'&&cmd!='mceRepaint'&&(!a||!a.skip_undo))t.undoManager.add();});}t.onExecCommand.add(function(ed,c){if(!/^(FontName|FontSize)$/.test(c))t.nodeChanged();});if(isGecko){function repaint(a,o){if(!o||!o.initial)t.execCommand('mceRepaint');};t.onUndo.add(repaint);t.onRedo.add(repaint);t.onSetContent.add(repaint);}t.onBeforeRenderUI.dispatch(t,t.controlManager);if(s.render_ui){w=s.width||e.style.width||e.offsetWidth;h=s.height||e.style.height||e.offsetHeight;t.orgDisplay=e.style.display;re=/^[0-9\.]+(|px)$/i;if(re.test(''+w))w=Math.max(parseInt(w)+(o.deltaWidth||0),100);if(re.test(''+h))h=Math.max(parseInt(h)+(o.deltaHeight||0),100);o=t.theme.renderUI({targetNode:e,width:w,height:h,deltaWidth:s.delta_width,deltaHeight:s.delta_height});t.editorContainer=o.editorContainer;}DOM.setStyles(o.sizeContainer||o.editorContainer,{width:w,height:h});h=(o.iframeHeight||h)+((h+'').indexOf('%')==-1?(o.deltaHeight||0):'');if(h<100)h=100;t.iframeHTML=s.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+t.documentBaseURI.getURI()+'"></base>';t.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(tinymce.relaxedDomain)t.iframeHTML+='<script type="text/javascript">document.domain = "'+tinymce.relaxedDomain+'";</script>';bi=s.body_id||'tinymce';if(bi.indexOf('=')!=-1){bi=t.getParam('body_id','','hash');bi=bi[t.id]||bi;}bc=s.body_class||'';if(bc.indexOf('=')!=-1){bc=t.getParam('body_class','','hash');bc=bc[t.id]||'';}t.iframeHTML+='</head><body id="'+bi+'" class="mceContentBody '+bc+'"></body></html>';if(tinymce.relaxedDomain){if(isIE)u='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()';else if(tinymce.isOpera)u='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()';}n=DOM.add(o.iframeContainer,'iframe',{id:t.id+"_ifr",src:u||'javascript:""',frameBorder:'0',style:{width:'100%',height:h}});t.contentAreaContainer=o.iframeContainer;DOM.get(o.editorContainer).style.display=t.orgDisplay;DOM.get(t.id).style.display='none';if(tinymce.isOldWebKit){Event.add(n,'load',t.setupIframe,t);n.src=tinymce.baseURL+'/plugins/safari/blank.htm';}else{if(!isIE||!tinymce.relaxedDomain)t.setupIframe();e=n=o=null;}},setupIframe:function(){var t=this,s=t.settings,e=DOM.get(t.id),d=t.getDoc(),h,b;if(!isIE||!tinymce.relaxedDomain){d.open();d.write(t.iframeHTML);d.close();}if(!isIE){try{d.designMode='On';}catch(ex){}}if(isIE){b=t.getBody();DOM.hide(b);b.contentEditable=true;DOM.show(b);}t.dom=new tinymce.DOM.DOMUtils(t.getDoc(),{keep_values:true,url_converter:t.convertURL,url_converter_scope:t,hex_colors:s.force_hex_style_colors,class_filter:s.class_filter,update_styles:1,fix_ie_paragraphs:1});t.serializer=new tinymce.dom.Serializer({entity_encoding:s.entity_encoding,entities:s.entities,valid_elements:s.verify_html===false?'*[*]':s.valid_elements,extended_valid_elements:s.extended_valid_elements,valid_child_elements:s.valid_child_elements,invalid_elements:s.invalid_elements,fix_table_elements:s.fix_table_elements,fix_list_elements:s.fix_list_elements,fix_content_duplication:s.fix_content_duplication,convert_fonts_to_spans:s.convert_fonts_to_spans,font_size_classes:s.font_size_classes,font_size_style_values:s.font_size_style_values,apply_source_formatting:s.apply_source_formatting,remove_linebreaks:s.remove_linebreaks,dom:t.dom});t.selection=new tinymce.dom.Selection(t.dom,t.getWin(),t.serializer);t.forceBlocks=new tinymce.ForceBlocks(t,{forced_root_block:s.forced_root_block});t.editorCommands=new tinymce.EditorCommands(t);t.serializer.onPreProcess.add(function(se,o){return t.onPreProcess.dispatch(t,o,se);});t.serializer.onPostProcess.add(function(se,o){return t.onPostProcess.dispatch(t,o,se);});t.onPreInit.dispatch(t);if(!s.gecko_spellcheck)t.getBody().spellcheck=0;t._addEvents();t.controlManager.onPostRender.dispatch(t,t.controlManager);t.onPostRender.dispatch(t);if(s.directionality)t.getBody().dir=s.directionality;if(s.nowrap)t.getBody().style.whiteSpace="nowrap";if(s.auto_resize)t.onNodeChange.add(t.resizeToContent,t);if(s.custom_elements){function handleCustom(ed,o){each(explode(s.custom_elements),function(v){var n;if(v.indexOf('~')===0){v=v.substring(1);n='span';}else n='div';o.content=o.content.replace(new RegExp('<('+v+')([^>]*)>','g'),'<'+n+' mce_name="$1"$2>');o.content=o.content.replace(new RegExp('</('+v+')>','g'),'</'+n+'>');});};t.onBeforeSetContent.add(handleCustom);t.onPostProcess.add(function(ed,o){if(o.set)handleCustom(ed,o)});}if(s.handle_node_change_callback){t.onNodeChange.add(function(ed,cm,n){t.execCallback('handle_node_change_callback',t.id,n,-1,-1,true,t.selection.isCollapsed());});}if(s.save_callback){t.onSaveContent.add(function(ed,o){var h=t.execCallback('save_callback',t.id,o.content,t.getBody());if(h)o.content=h;});}if(s.onchange_callback){t.onChange.add(function(ed,l){t.execCallback('onchange_callback',t,l);});}if(s.convert_newlines_to_brs){t.onBeforeSetContent.add(function(ed,o){if(o.initial)o.content=o.content.replace(/\r?\n/g,'<br />');});}if(s.fix_nesting&&isIE){t.onBeforeSetContent.add(function(ed,o){o.content=t._fixNesting(o.content);});}if(s.preformatted){t.onPostProcess.add(function(ed,o){o.content=o.content.replace(/^\s*<pre.*?>/,'');o.content=o.content.replace(/<\/pre>\s*$/,'');if(o.set)o.content='<pre class="mceItemHidden">'+o.content+'</pre>';});}if(s.verify_css_classes){t.serializer.attribValueFilter=function(n,v){var s,cl;if(n=='class'){if(!t.classesRE){cl=t.dom.getClasses();if(cl.length>0){s='';each(cl,function(o){s+=(s?'|':'')+o['class'];});t.classesRE=new RegExp('('+s+')','gi');}}return!t.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v)||t.classesRE.test(v)?v:'';}return v;};}if(s.convert_fonts_to_spans)t._convertFonts();if(s.inline_styles)t._convertInlineElements();if(s.cleanup_callback){t.onBeforeSetContent.add(function(ed,o){o.content=t.execCallback('cleanup_callback','insert_to_editor',o.content,o);});t.onPreProcess.add(function(ed,o){if(o.set)t.execCallback('cleanup_callback','insert_to_editor_dom',o.node,o);if(o.get)t.execCallback('cleanup_callback','get_from_editor_dom',o.node,o);});t.onPostProcess.add(function(ed,o){if(o.set)o.content=t.execCallback('cleanup_callback','insert_to_editor',o.content,o);if(o.get)o.content=t.execCallback('cleanup_callback','get_from_editor',o.content,o);});}if(s.save_callback){t.onGetContent.add(function(ed,o){if(o.save)o.content=t.execCallback('save_callback',t.id,o.content,t.getBody());});}if(s.handle_event_callback){t.onEvent.add(function(ed,e,o){if(t.execCallback('handle_event_callback',e,ed,o)===false)Event.cancel(e);});}t.onSetContent.add(function(){t.addVisual(t.getBody());});if(s.padd_empty_editor){t.onPostProcess.add(function(ed,o){o.content=o.content.replace(/^(<p>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,'');});}if(isGecko){try{d.designMode='Off';d.designMode='On';}catch(ex){}}setTimeout(function(){if(t.removed)return;t.load({initial:true,format:(s.cleanup_on_startup?'html':'raw')});t.startContent=t.getContent({format:'raw'});t.undoManager.add({initial:true});t.initialized=true;t.onInit.dispatch(t);t.execCallback('setupcontent_callback',t.id,t.getBody(),t.getDoc());t.execCallback('init_instance_callback',t);t.focus(true);t.nodeChanged({initial:1});if(s.content_css){tinymce.each(explode(s.content_css),function(u){t.dom.loadCSS(t.documentBaseURI.toAbsolute(u));});}if(s.auto_focus){setTimeout(function(){var ed=EditorManager.get(s.auto_focus);ed.selection.select(ed.getBody(),1);ed.selection.collapse(1);ed.getWin().focus();},100);}},1);e=null;},focus:function(sf){var oed,t=this,ce=t.settings.content_editable;if(!sf){if(!ce)t.getWin().focus();}if(EditorManager.activeEditor!=t){if((oed=EditorManager.activeEditor)!=null)oed.onDeactivate.dispatch(oed,t);t.onActivate.dispatch(t,oed);}EditorManager._setActive(t);},execCallback:function(n){var t=this,f=t.settings[n],s;if(!f)return;if(t.callbackLookup&&(s=t.callbackLookup[n])){f=s.func;s=s.scope;}if(is(f,'string')){s=f.replace(/\.\w+$/,'');s=s?tinymce.resolve(s):0;f=tinymce.resolve(f);t.callbackLookup=t.callbackLookup||{};t.callbackLookup[n]={func:f,scope:s};}return f.apply(s||t,Array.prototype.slice.call(arguments,1));},translate:function(s){var c=this.settings.language,i18n=EditorManager.i18n;if(!s)return'';return i18n[c+'.'+s]||s.replace(/{\#([^}]+)\}/g,function(a,b){return i18n[c+'.'+b]||'{#'+b+'}';});},getLang:function(n,dv){return EditorManager.i18n[this.settings.language+'.'+n]||(is(dv)?dv:'{#'+n+'}');},getParam:function(n,dv,ty){var tr=tinymce.trim,v=is(this.settings[n])?this.settings[n]:dv,o;if(ty==='hash'){o={};if(is(v,'string')){each(v.indexOf('=')>0?v.split(/[;,](?![^=;,]*(?:[;,]|$))/):v.split(','),function(v){v=v.split('=');if(v.length>1)o[tr(v[0])]=tr(v[1]);else o[tr(v[0])]=tr(v);});}else o=v;return o;}return v;},nodeChanged:function(o){var t=this,s=t.selection,n=s.getNode()||t.getBody();if(t.initialized){t.onNodeChange.dispatch(t,o?o.controlManager||t.controlManager:t.controlManager,isIE&&n.ownerDocument!=t.getDoc()?t.getBody():n,s.isCollapsed(),o);}},addButton:function(n,s){var t=this;t.buttons=t.buttons||{};t.buttons[n]=s;},addCommand:function(n,f,s){this.execCommands[n]={func:f,scope:s||this};},addQueryStateHandler:function(n,f,s){this.queryStateCommands[n]={func:f,scope:s||this};},addQueryValueHandler:function(n,f,s){this.queryValueCommands[n]={func:f,scope:s||this};},addShortcut:function(pa,desc,cmd_func,sc){var t=this,c;if(!t.settings.custom_shortcuts)return false;t.shortcuts=t.shortcuts||{};if(is(cmd_func,'string')){c=cmd_func;cmd_func=function(){t.execCommand(c,false,null);};}if(is(cmd_func,'object')){c=cmd_func;cmd_func=function(){t.execCommand(c[0],c[1],c[2]);};}each(explode(pa),function(pa){var o={func:cmd_func,scope:sc||this,desc:desc,alt:false,ctrl:false,shift:false};each(explode(pa,'+'),function(v){switch(v){case'alt':case'ctrl':case'shift':o[v]=true;break;default:o.charCode=v.charCodeAt(0);o.keyCode=v.toUpperCase().charCodeAt(0);}});t.shortcuts[(o.ctrl?'ctrl':'')+','+(o.alt?'alt':'')+','+(o.shift?'shift':'')+','+o.keyCode]=o;});return true;},execCommand:function(cmd,ui,val,a){var t=this,s=0,o,st;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd)&&(!a||!a.skip_focus))t.focus();o={};t.onBeforeExecCommand.dispatch(t,cmd,ui,val,o);if(o.terminate)return false;if(t.execCallback('execcommand_callback',t.id,t.selection.getNode(),cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}if(o=t.execCommands[cmd]){st=o.func.call(o.scope,ui,val);if(st!==true){t.onExecCommand.dispatch(t,cmd,ui,val,a);return st;}}each(t.plugins,function(p){if(p.execCommand&&p.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);s=1;return false;}});if(s)return true;if(t.theme.execCommand&&t.theme.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}if(t.editorCommands.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}t.getDoc().execCommand(cmd,ui,val);t.onExecCommand.dispatch(t,cmd,ui,val,a);},queryCommandState:function(c){var t=this,o,s;if(t._isHidden())return;if(o=t.queryStateCommands[c]){s=o.func.call(o.scope);if(s!==true)return s;}o=t.editorCommands.queryCommandState(c);if(o!==-1)return o;try{return this.getDoc().queryCommandState(c);}catch(ex){}},queryCommandValue:function(c){var t=this,o,s;if(t._isHidden())return;if(o=t.queryValueCommands[c]){s=o.func.call(o.scope);if(s!==true)return s;}o=t.editorCommands.queryCommandValue(c);if(is(o))return o;try{return this.getDoc().queryCommandValue(c);}catch(ex){}},show:function(){var t=this;DOM.show(t.getContainer());DOM.hide(t.id);t.load();},hide:function(){var t=this,d=t.getDoc();if(isIE&&d)d.execCommand('SelectAll');t.save();DOM.hide(t.getContainer());DOM.setStyle(t.id,'display',t.orgDisplay);},isHidden:function(){return!DOM.isHidden(this.id);},setProgressState:function(b,ti,o){this.onSetProgressState.dispatch(this,b,ti,o);return b;},resizeToContent:function(){var t=this;DOM.setStyle(t.id+"_ifr",'height',t.getBody().scrollHeight);},load:function(o){var t=this,e=t.getElement(),h;o=o||{};o.load=true;h=t.setContent(is(e.value)?e.value:e.innerHTML,o);o.element=e;if(!o.no_events)t.onLoadContent.dispatch(t,o);o.element=e=null;return h;},save:function(o){var t=this,e=t.getElement(),h,f;if(!t.initialized)return;o=o||{};o.save=true;if(!o.no_events){t.undoManager.typing=0;t.undoManager.add();}o.element=e;h=o.content=t.getContent(o);if(!o.no_events)t.onSaveContent.dispatch(t,o);h=o.content;if(!/TEXTAREA|INPUT/i.test(e.nodeName)){e.innerHTML=h;if(f=DOM.getParent(t.id,'form')){each(f.elements,function(e){if(e.name==t.id){e.value=h;return false;}});}}else e.value=h;o.element=e=null;return h;},setContent:function(h,o){var t=this;o=o||{};o.format=o.format||'html';o.set=true;o.content=h;if(!o.no_events)t.onBeforeSetContent.dispatch(t,o);if(!tinymce.isIE&&(h.length===0||/^\s+$/.test(h))){o.content=t.dom.setHTML(t.getBody(),'<br mce_bogus="1" />');o.format='raw';}o.content=t.dom.setHTML(t.getBody(),tinymce.trim(o.content));if(o.format!='raw'&&t.settings.cleanup){o.getInner=true;o.content=t.dom.setHTML(t.getBody(),t.serializer.serialize(t.getBody(),o));}if(!o.no_events)t.onSetContent.dispatch(t,o);return o.content;},getContent:function(o){var t=this,h;o=o||{};o.format=o.format||'html';o.get=true;if(!o.no_events)t.onBeforeGetContent.dispatch(t,o);if(o.format!='raw'&&t.settings.cleanup){o.getInner=true;h=t.serializer.serialize(t.getBody(),o);}else h=t.getBody().innerHTML;h=h.replace(/^\s*|\s*$/g,'');o.content=h;if(!o.no_events)t.onGetContent.dispatch(t,o);return o.content;},isDirty:function(){var t=this;return tinymce.trim(t.startContent)!=tinymce.trim(t.getContent({format:'raw',no_events:1}))&&!t.isNotDirty;},getContainer:function(){var t=this;if(!t.container)t.container=DOM.get(t.editorContainer||t.id+'_parent');return t.container;},getContentAreaContainer:function(){return this.contentAreaContainer;},getElement:function(){return DOM.get(this.settings.content_element||this.id);},getWin:function(){var t=this,e;if(!t.contentWindow){e=DOM.get(t.id+"_ifr");if(e)t.contentWindow=e.contentWindow;}return t.contentWindow;},getDoc:function(){var t=this,w;if(!t.contentDocument){w=t.getWin();if(w)t.contentDocument=w.document;}return t.contentDocument;},getBody:function(){return this.bodyElement||this.getDoc().body;},convertURL:function(u,n,e){var t=this,s=t.settings;if(s.urlconverter_callback)return t.execCallback('urlconverter_callback',u,e,true,n);if(!s.convert_urls||(e&&e.nodeName=='LINK')||u.indexOf('file:')===0)return u;if(s.relative_urls)return t.documentBaseURI.toRelative(u);u=t.documentBaseURI.toAbsolute(u,s.remove_script_host);return u;},addVisual:function(e){var t=this,s=t.settings;e=e||t.getBody();if(!is(t.hasVisual))t.hasVisual=s.visual;each(t.dom.select('table,a',e),function(e){var v;switch(e.nodeName){case'TABLE':v=t.dom.getAttrib(e,'border');if(!v||v=='0'){if(t.hasVisual)t.dom.addClass(e,s.visual_table_class);else t.dom.removeClass(e,s.visual_table_class);}return;case'A':v=t.dom.getAttrib(e,'name');if(v){if(t.hasVisual)t.dom.addClass(e,'mceItemAnchor');else t.dom.removeClass(e,'mceItemAnchor');}return;}});t.onVisualAid.dispatch(t,e,t.hasVisual);},remove:function(){var t=this,e=t.getContainer();t.removed=1;t.hide();t.execCallback('remove_instance_callback',t);t.onRemove.dispatch(t);t.onExecCommand.listeners=[];EditorManager.remove(t);DOM.remove(e);},destroy:function(s){var t=this;if(t.destroyed)return;if(!s){tinymce.removeUnload(t.destroy);tinyMCE.onBeforeUnload.remove(t._beforeUnload);if(t.theme.destroy)t.theme.destroy();t.controlManager.destroy();t.selection.destroy();t.dom.destroy();if(!t.settings.content_editable){Event.clear(t.getWin());Event.clear(t.getDoc());}Event.clear(t.getBody());Event.clear(t.formElement);}if(t.formElement){t.formElement.submit=t.formElement._mceOldSubmit;t.formElement._mceOldSubmit=null;}t.contentAreaContainer=t.formElement=t.container=t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null;if(t.selection)t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null;t.destroyed=1;},_addEvents:function(){var t=this,i,s=t.settings,lo={mouseup:'onMouseUp',mousedown:'onMouseDown',click:'onClick',keyup:'onKeyUp',keydown:'onKeyDown',keypress:'onKeyPress',submit:'onSubmit',reset:'onReset',contextmenu:'onContextMenu',dblclick:'onDblClick',paste:'onPaste'};function eventHandler(e,o){var ty=e.type;if(t.removed)return;if(t.onEvent.dispatch(t,e,o)!==false){t[lo[e.fakeType||e.type]].dispatch(t,e,o);}};each(lo,function(v,k){switch(k){case'contextmenu':if(tinymce.isOpera){Event.add(t.getBody(),'mousedown',function(e){if(e.ctrlKey){e.fakeType='contextmenu';eventHandler(e);}});}else Event.add(t.getBody(),k,eventHandler);break;case'paste':Event.add(t.getBody(),k,function(e){var tx,h,el,r;if(e.clipboardData)tx=e.clipboardData.getData('text/plain');else if(tinymce.isIE)tx=t.getWin().clipboardData.getData('Text');eventHandler(e,{text:tx,html:h});});break;case'submit':case'reset':Event.add(t.getElement().form||DOM.getParent(t.id,'form'),k,eventHandler);break;default:Event.add(s.content_editable?t.getBody():t.getDoc(),k,eventHandler);}});Event.add(s.content_editable?t.getBody():(isGecko?t.getDoc():t.getWin()),'focus',function(e){t.focus(true);});if(tinymce.isGecko){Event.add(t.getDoc(),'DOMNodeInserted',function(e){var v;e=e.target;if(e.nodeType===1&&e.nodeName==='IMG'&&(v=e.getAttribute('mce_src')))e.src=t.documentBaseURI.toAbsolute(v);});}if(isGecko){function setOpts(){var t=this,d=t.getDoc(),s=t.settings;if(isGecko){if(t._isHidden()){try{if(!s.content_editable)d.designMode='On';}catch(ex){}}try{d.execCommand("styleWithCSS",0,false);}catch(ex){if(!t._isHidden())try{d.execCommand("useCSS",0,true);}catch(ex){}}if(!s.table_inline_editing)try{d.execCommand('enableInlineTableEditing',false,false);}catch(ex){}if(!s.object_resizing)try{d.execCommand('enableObjectResizing',false,false);}catch(ex){}}};t.onBeforeExecCommand.add(setOpts);t.onMouseDown.add(setOpts);}t.onMouseUp.add(t.nodeChanged);t.onClick.add(t.nodeChanged);t.onKeyUp.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45||e.keyCode==46||e.keyCode==8||e.ctrlKey)t.nodeChanged();});t.onReset.add(function(){t.setContent(t.startContent,{format:'raw'});});if(t.getParam('tab_focus')){function tabCancel(ed,e){if(e.keyCode===9)return Event.cancel(e);};function tabHandler(ed,e){var x,i,f,el,v;function find(d){f=DOM.getParent(ed.id,'form');el=f.elements;if(f){each(el,function(e,i){if(e.id==ed.id){x=i;return false;}});if(d>0){for(i=x+1;i<el.length;i++){if(el[i].type!='hidden')return el[i];}}else{for(i=x-1;i>=0;i--){if(el[i].type!='hidden')return el[i];}}}return null;};if(e.keyCode===9){v=explode(ed.getParam('tab_focus'));if(v.length==1){v[1]=v[0];v[0]=':prev';}if(e.shiftKey){if(v[0]==':prev')el=find(-1);else el=DOM.get(v[0]);}else{if(v[1]==':next')el=find(1);else el=DOM.get(v[1]);}if(el){if(ed=EditorManager.get(el.id||el.name))ed.focus();else window.setTimeout(function(){window.focus();el.focus();},10);return Event.cancel(e);}}};t.onKeyUp.add(tabCancel);if(isGecko){t.onKeyPress.add(tabHandler);t.onKeyDown.add(tabCancel);}else t.onKeyDown.add(tabHandler);}if(s.custom_shortcuts){if(s.custom_undo_redo_keyboard_shortcuts){t.addShortcut('ctrl+z',t.getLang('undo_desc'),'Undo');t.addShortcut('ctrl+y',t.getLang('redo_desc'),'Redo');}if(isGecko){t.addShortcut('ctrl+b',t.getLang('bold_desc'),'Bold');t.addShortcut('ctrl+i',t.getLang('italic_desc'),'Italic');t.addShortcut('ctrl+u',t.getLang('underline_desc'),'Underline');}for(i=1;i<=6;i++)t.addShortcut('ctrl+'+i,'',['FormatBlock',false,'<h'+i+'>']);t.addShortcut('ctrl+7','',['FormatBlock',false,'<p>']);t.addShortcut('ctrl+8','',['FormatBlock',false,'<div>']);t.addShortcut('ctrl+9','',['FormatBlock',false,'<address>']);function find(e){var v=null;if(!e.altKey&&!e.ctrlKey&&!e.metaKey)return v;each(t.shortcuts,function(o){if(o.ctrl!=e.ctrlKey&&(!tinymce.isMac||o.ctrl==e.metaKey))return;if(o.alt!=e.altKey)return;if(o.shift!=e.shiftKey)return;if(e.keyCode==o.keyCode||(e.charCode&&e.charCode==o.charCode)){v=o;return false;}});return v;};t.onKeyUp.add(function(ed,e){var o=find(e);if(o)return Event.cancel(e);});t.onKeyPress.add(function(ed,e){var o=find(e);if(o)return Event.cancel(e);});t.onKeyDown.add(function(ed,e){var o=find(e);if(o){o.func.call(o.scope);return Event.cancel(e);}});}if(tinymce.isIE){Event.add(t.getDoc(),'controlselect',function(e){var re=t.resizeInfo,cb;e=e.target;if(e.nodeName!=='IMG')return;if(re)Event.remove(re.node,re.ev,re.cb);if(!t.dom.hasClass(e,'mceItemNoResize')){ev='resizeend';cb=Event.add(e,ev,function(e){var v;e=e.target;if(v=t.dom.getStyle(e,'width')){t.dom.setAttrib(e,'width',v.replace(/[^0-9%]+/g,''));t.dom.setStyle(e,'width','');}if(v=t.dom.getStyle(e,'height')){t.dom.setAttrib(e,'height',v.replace(/[^0-9%]+/g,''));t.dom.setStyle(e,'height','');}});}else{ev='resizestart';cb=Event.add(e,'resizestart',Event.cancel,Event);}re=t.resizeInfo={node:e,ev:ev,cb:cb};});t.onKeyDown.add(function(ed,e){switch(e.keyCode){case 8:if(t.selection.getRng().item){t.selection.getRng().item(0).removeNode();return Event.cancel(e);}}});}if(tinymce.isOpera){t.onClick.add(function(ed,e){Event.prevent(e);});}if(s.custom_undo_redo){function addUndo(){t.undoManager.typing=0;t.undoManager.add();};if(tinymce.isIE){Event.add(t.getWin(),'blur',function(e){var n;if(t.selection){n=t.selection.getNode();if(!t.removed&&n.ownerDocument&&n.ownerDocument!=t.getDoc())addUndo();}});}else{Event.add(t.getDoc(),'blur',function(){if(t.selection&&!t.removed)addUndo();});}t.onMouseDown.add(addUndo);t.onKeyUp.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45||e.ctrlKey){t.undoManager.typing=0;t.undoManager.add();}});t.onKeyDown.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45){if(t.undoManager.typing){t.undoManager.add();t.undoManager.typing=0;}return;}if(!t.undoManager.typing){t.undoManager.add();t.undoManager.typing=1;}});}},_convertInlineElements:function(){var t=this,s=t.settings,dom=t.dom,v,e,na,st,sp;function convert(ed,o){if(!s.inline_styles)return;if(o.get){each(t.dom.select('table,u,strike',o.node),function(n){switch(n.nodeName){case'TABLE':if(v=dom.getAttrib(n,'height')){dom.setStyle(n,'height',v);dom.setAttrib(n,'height','');}break;case'U':case'STRIKE':n.style.textDecoration=n.nodeName=='U'?'underline':'line-through';dom.setAttrib(n,'mce_style','');dom.setAttrib(n,'mce_name','span');break;}});}else if(o.set){each(t.dom.select('table,span',o.node).reverse(),function(n){if(n.nodeName=='TABLE'){if(v=dom.getStyle(n,'height'))dom.setAttrib(n,'height',v.replace(/[^0-9%]+/g,''));}else{if(n.style.textDecoration=='underline')na='u';else if(n.style.textDecoration=='line-through')na='strike';else na='';if(na){n.style.textDecoration='';dom.setAttrib(n,'mce_style','');e=dom.create(na,{style:dom.getAttrib(n,'style')});dom.replace(e,n,1);}}});}};t.onPreProcess.add(convert);if(!s.cleanup_on_startup){t.onSetContent.add(function(ed,o){if(o.initial)convert(t,{node:t.getBody(),set:1});});}},_convertFonts:function(){var t=this,s=t.settings,dom=t.dom,fz,fzn,sl,cl;if(!s.inline_styles)return;fz=[8,10,12,14,18,24,36];fzn=['xx-small','x-small','small','medium','large','x-large','xx-large'];if(sl=s.font_size_style_values)sl=explode(sl);if(cl=s.font_size_classes)cl=explode(cl);function convertToFonts(no){var n,f,nl,x,i,v,st;if(tinymce.isWebKit||!s.inline_styles)return;nl=t.dom.select('span',no);for(x=nl.length-1;x>=0;x--){n=nl[x];f=dom.create('font',{color:dom.toHex(dom.getStyle(n,'color')),face:dom.getStyle(n,'fontFamily'),style:dom.getAttrib(n,'style'),'class':dom.getAttrib(n,'class')});st=f.style;if(st.color||st.fontFamily){st.color=st.fontFamily='';dom.setAttrib(f,'mce_style','');}if(sl){i=inArray(sl,dom.getStyle(n,'fontSize'));if(i!=-1){dom.setAttrib(f,'size',''+(i+1||1));}}else if(cl){i=inArray(cl,dom.getAttrib(n,'class'));v=dom.getStyle(n,'fontSize');if(i==-1&&v.indexOf('pt')>0)i=inArray(fz,parseInt(v));if(i==-1)i=inArray(fzn,v);if(i!=-1){dom.setAttrib(f,'size',''+(i+1||1));f.style.fontSize='';}}if(f.color||f.face||f.size){f.style.fontFamily='';dom.setAttrib(f,'mce_style','');dom.replace(f,n,1);}f=n=null;}};t.onSetContent.add(function(ed,o){convertToFonts(ed.getBody());});t.onPreProcess.add(function(ed,o){var n,sp,nl,x;if(!s.inline_styles)return;if(o.get){nl=t.dom.select('font',o.node);for(x=nl.length-1;x>=0;x--){n=nl[x];sp=dom.create('span',{style:dom.getAttrib(n,'style'),'class':dom.getAttrib(n,'class')});dom.setStyles(sp,{fontFamily:dom.getAttrib(n,'face'),color:dom.getAttrib(n,'color'),backgroundColor:n.style.backgroundColor});if(n.size){if(sl)dom.setStyle(sp,'fontSize',sl[parseInt(n.size)-1]);else dom.setAttrib(sp,'class',cl[parseInt(n.size)-1]);}dom.setAttrib(sp,'mce_style','');dom.replace(sp,n,1);}}});},_isHidden:function(){var s;if(!isGecko)return 0;s=this.selection.getSel();return(!s||!s.rangeCount||s.rangeCount==0);},_fixNesting:function(s){var d=[],i;s=s.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(a,b,c){var e;if(b==='/'){if(!d.length)return'';if(c!==d[d.length-1].tag){for(i=d.length-1;i>=0;i--){if(d[i].tag===c){d[i].close=1;break;}}return'';}else{d.pop();if(d.length&&d[d.length-1].close){a=a+'</'+d[d.length-1].tag+'>';d.pop();}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(c))return a;if(/\/>$/.test(a))return a;d.push({tag:c});}return a;});for(i=d.length-1;i>=0;i--)s+='</'+d[i].tag+'>';return s;}});})();(function(){var each=tinymce.each,isIE=tinymce.isIE,isGecko=tinymce.isGecko,isOpera=tinymce.isOpera,isWebKit=tinymce.isWebKit;tinymce.create('tinymce.EditorCommands',{EditorCommands:function(ed){this.editor=ed;},execCommand:function(cmd,ui,val){var t=this,ed=t.editor,f;switch(cmd){case'Cut':case'Copy':case'Paste':try{ed.getDoc().execCommand(cmd,ui,val);}catch(ex){if(isGecko){ed.windowManager.confirm(ed.getLang('clipboard_msg'),function(s){if(s)window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html','mceExternal');});}else ed.windowManager.alert(ed.getLang('clipboard_no_support'));}return true;case'mceResetDesignMode':case'mceBeginUndoLevel':return true;case'unlink':t.UnLink();return true;case'JustifyLeft':case'JustifyCenter':case'JustifyRight':case'JustifyFull':t.mceJustify(cmd,cmd.substring(7).toLowerCase());return true;case'mceEndUndoLevel':case'mceAddUndoLevel':ed.undoManager.add();return true;default:f=this[cmd];if(f){f.call(this,ui,val);return true;}}return false;},Indent:function(){var ed=this.editor,d=ed.dom,s=ed.selection,e,iv,iu;iv=ed.settings.indentation;iu=/[a-z%]+$/i.exec(iv);iv=parseInt(iv);if(ed.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){each(this._getSelectedBlocks(),function(e){d.setStyle(e,'paddingLeft',(parseInt(e.style.paddingLeft||0)+iv)+iu);});return;}ed.getDoc().execCommand('Indent',false,null);if(isIE){d.getParent(s.getNode(),function(n){if(n.nodeName=='BLOCKQUOTE'){n.dir=n.style.cssText='';}});}},Outdent:function(){var ed=this.editor,d=ed.dom,s=ed.selection,e,v,iv,iu;iv=ed.settings.indentation;iu=/[a-z%]+$/i.exec(iv);iv=parseInt(iv);if(ed.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){each(this._getSelectedBlocks(),function(e){v=Math.max(0,parseInt(e.style.paddingLeft||0)-iv);d.setStyle(e,'paddingLeft',v?v+iu:'');});return;}ed.getDoc().execCommand('Outdent',false,null);},mceSetAttribute:function(u,v){var ed=this.editor,d=ed.dom,e;if(e=d.getParent(ed.selection.getNode(),d.isBlock))d.setAttrib(e,v.name,v.value);},mceSetContent:function(u,v){this.editor.setContent(v);},mceToggleVisualAid:function(){var ed=this.editor;ed.hasVisual=!ed.hasVisual;ed.addVisual();},mceReplaceContent:function(u,v){var s=this.editor.selection;s.setContent(v.replace(/\{\$selection\}/g,s.getContent({format:'text'})));},mceInsertLink:function(u,v){var ed=this.editor,s=ed.selection,e=ed.dom.getParent(s.getNode(),'A');if(tinymce.is(v,'string'))v={href:v};function set(e){each(v,function(v,k){ed.dom.setAttrib(e,k,v);});};if(!e){ed.execCommand('CreateLink',false,'javascript:mctmp(0);');each(ed.dom.select('a'),function(e){if(e.href=='javascript:mctmp(0);')set(e);});}else{if(v.href)set(e);else ed.dom.remove(e,1);}},UnLink:function(){var ed=this.editor,s=ed.selection;if(s.isCollapsed())s.select(s.getNode());ed.getDoc().execCommand('unlink',false,null);s.collapse(0);},FontName:function(u,v){var t=this,ed=t.editor,s=ed.selection,e;if(!v){if(s.isCollapsed())s.select(s.getNode());t.RemoveFormat();}else ed.getDoc().execCommand('FontName',false,v);},FontSize:function(u,v){var ed=this.editor,s=ed.settings,fz=tinymce.explode(s.font_size_style_values),fzc=tinymce.explode(s.font_size_classes),h,bm;each(ed.dom.select('font'),function(e){e.style.fontSize='';});ed.getDoc().execCommand('FontSize',false,v);if(s.inline_styles){each(ed.dom.select('font'),function(e){if(!e.size||e.parentNode.nodeName=='FONT'&&e.size==e.parentNode.size){if(!bm)bm=ed.selection.getBookmark();ed.dom.remove(e,1);return;}if(v=e.size){if(fzc&&fzc.length>0)ed.dom.setAttrib(e,'class',fzc[parseInt(v)-1]);else ed.dom.setStyle(e,'fontSize',fz[parseInt(v)-1]);}});}ed.selection.moveToBookmark(bm);},queryCommandValue:function(c){var f=this['queryValue'+c];if(f)return f.call(this,c);return false;},queryCommandState:function(cmd){var f;switch(cmd){case'JustifyLeft':case'JustifyCenter':case'JustifyRight':case'JustifyFull':return this.queryStateJustify(cmd,cmd.substring(7).toLowerCase());default:if(f=this['queryState'+cmd])return f.call(this,cmd);}return-1;},_queryState:function(c){try{return this.editor.getDoc().queryCommandState(c);}catch(ex){}},_queryVal:function(c){try{return this.editor.getDoc().queryCommandValue(c);}catch(ex){}},queryValueFontSize:function(){var ed=this.editor,v=0,p;if(isOpera||isWebKit){if(p=ed.dom.getParent(ed.selection.getNode(),'FONT'))v=p.size;return v;}return this._queryVal('FontSize');},queryValueFontName:function(){var ed=this.editor,v=0,p;if(p=ed.dom.getParent(ed.selection.getNode(),'FONT'))v=p.face;if(!v)v=this._queryVal('FontName');return v;},mceJustify:function(c,v){var ed=this.editor,se=ed.selection,n=se.getNode(),nn=n.nodeName,bl,nb,dom=ed.dom,rm;if(ed.settings.inline_styles&&this.queryStateJustify(c,v))rm=1;bl=dom.getParent(n,ed.dom.isBlock);if(nn=='IMG'){if(v=='full')return;if(rm){if(v=='center')dom.setStyle(n.parentNode,'textAlign','');dom.setStyle(n,'float','');this.mceRepaint();return;}if(v=='center'){if(/^(TD|TH)$/.test(bl.nodeName))bl=0;if(!bl||bl.childNodes.length>1){nb=dom.create('p');nb.appendChild(n.cloneNode(false));if(bl)dom.insertAfter(nb,bl);else dom.insertAfter(nb,n);dom.remove(n);n=nb.firstChild;bl=nb;}dom.setStyle(bl,'textAlign',v);dom.setStyle(n,'float','');}else{dom.setStyle(n,'float',v);dom.setStyle(n.parentNode,'textAlign','');}this.mceRepaint();return;}if(ed.settings.inline_styles&&ed.settings.forced_root_block){if(rm)v='';each(this._getSelectedBlocks(dom.getParent(se.getStart(),dom.isBlock),dom.getParent(se.getEnd(),dom.isBlock)),function(e){dom.setAttrib(e,'align','');dom.setStyle(e,'textAlign',v=='full'?'justify':v);});return;}else if(!rm)ed.getDoc().execCommand(c,false,null);if(ed.settings.inline_styles){if(rm){dom.getParent(ed.selection.getNode(),function(n){if(n.style&&n.style.textAlign)dom.setStyle(n,'textAlign','');});return;}each(dom.select('*'),function(n){var v=n.align;if(v){if(v=='full')v='justify';dom.setStyle(n,'textAlign',v);dom.setAttrib(n,'align','');}});}},mceSetCSSClass:function(u,v){this.mceSetStyleInfo(0,{command:'setattrib',name:'class',value:v});},getSelectedElement:function(){var t=this,ed=t.editor,dom=ed.dom,se=ed.selection,r=se.getRng(),r1,r2,sc,ec,so,eo,e,sp,ep,re;if(se.isCollapsed()||r.item)return se.getNode();re=ed.settings.merge_styles_invalid_parents;if(tinymce.is(re,'string'))re=new RegExp(re,'i');if(isIE){r1=r.duplicate();r1.collapse(true);sc=r1.parentElement();r2=r.duplicate();r2.collapse(false);ec=r2.parentElement();if(sc!=ec){r1.move('character',1);sc=r1.parentElement();}if(sc==ec){r1=r.duplicate();r1.moveToElementText(sc);if(r1.compareEndPoints('StartToStart',r)==0&&r1.compareEndPoints('EndToEnd',r)==0)return re&&re.test(sc.nodeName)?null:sc;}}else{function getParent(n){return dom.getParent(n,function(n){return n.nodeType==1;});};sc=r.startContainer;ec=r.endContainer;so=r.startOffset;eo=r.endOffset;if(!r.collapsed){if(sc==ec){if(so-eo<2){if(sc.hasChildNodes()){sp=sc.childNodes[so];return re&&re.test(sp.nodeName)?null:sp;}}}}if(sc.nodeType!=3||ec.nodeType!=3)return null;if(so==0){sp=getParent(sc);if(sp&&sp.firstChild!=sc)sp=null;}if(so==sc.nodeValue.length){e=sc.nextSibling;if(e&&e.nodeType==1)sp=sc.nextSibling;}if(eo==0){e=ec.previousSibling;if(e&&e.nodeType==1)ep=e;}if(eo==ec.nodeValue.length){ep=getParent(ec);if(ep&&ep.lastChild!=ec)ep=null;}if(sp==ep)return re&&sp&&re.test(sp.nodeName)?null:sp;}return null;},InsertHorizontalRule:function(){if(isGecko||isIE)this.editor.selection.setContent('<hr />');else this.editor.getDoc().execCommand('InsertHorizontalRule',false,'');},RemoveFormat:function(){var t=this,ed=t.editor,s=ed.selection,b;if(isWebKit)s.setContent(s.getContent({format:'raw'}).replace(/(<(span|b|i|strong|em|strike) [^>]+>|<(span|b|i|strong|em|strike)>|<\/(span|b|i|strong|em|strike)>|)/g,''),{format:'raw'});else ed.getDoc().execCommand('RemoveFormat',false,null);t.mceSetStyleInfo(0,{command:'removeformat'});ed.addVisual();},mceSetStyleInfo:function(u,v){var t=this,ed=t.editor,d=ed.getDoc(),dom=ed.dom,e,b,s=ed.selection,nn=v.wrapper||'span',b=s.getBookmark(),re;function set(n,e){if(n.nodeType==1){switch(v.command){case'setattrib':return dom.setAttrib(n,v.name,v.value);case'setstyle':return dom.setStyle(n,v.name,v.value);case'removeformat':return dom.setAttrib(n,'class','');}}};re=ed.settings.merge_styles_invalid_parents;if(tinymce.is(re,'string'))re=new RegExp(re,'i');if(e=t.getSelectedElement())set(e,1);else{d.execCommand('FontName',false,'__');each(isWebKit?dom.select('span'):dom.select('font'),function(n){var sp,e;if(dom.getAttrib(n,'face')=='__'||n.style.fontFamily==='__'){sp=dom.create(nn,{mce_new:'1'});set(sp);each(n.childNodes,function(n){sp.appendChild(n.cloneNode(true));});dom.replace(sp,n);}});}each(dom.select(nn).reverse(),function(n){var p=n.parentNode;if(!dom.getAttrib(n,'mce_new')){p=dom.getParent(n,function(n){return n.nodeType==1&&dom.getAttrib(n,'mce_new');});if(p)dom.remove(n,1);}});each(dom.select(nn).reverse(),function(n){var p=n.parentNode;if(!p||!dom.getAttrib(n,'mce_new'))return;if(p.nodeName==nn.toUpperCase()&&p.childNodes.length==1)return dom.remove(p,1);if(n.nodeType==1&&(!re||!re.test(p.nodeName))&&p.childNodes.length==1){set(p);dom.setAttrib(n,'class','');}});each(dom.select(nn).reverse(),function(n){if(dom.getAttrib(n,'mce_new')||(dom.getAttribs(n).length<=1&&n.className==='')){if(!dom.getAttrib(n,'class')&&!dom.getAttrib(n,'style'))return dom.remove(n,1);dom.setAttrib(n,'mce_new','');}});s.moveToBookmark(b);},queryStateJustify:function(c,v){var ed=this.editor,n=ed.selection.getNode(),dom=ed.dom;if(n&&n.nodeName=='IMG'){if(dom.getStyle(n,'float')==v)return 1;return n.parentNode.style.textAlign==v;}n=dom.getParent(ed.selection.getStart(),function(n){return n.nodeType==1&&n.style.textAlign;});if(v=='full')v='justify';if(ed.settings.inline_styles)return(n&&n.style.textAlign==v);return this._queryState(c);},HiliteColor:function(ui,val){var t=this,ed=t.editor,d=ed.getDoc();function set(s){if(!isGecko)return;try{d.execCommand("styleWithCSS",0,s);}catch(ex){d.execCommand("useCSS",0,!s);}};if(isGecko||isOpera){set(true);d.execCommand('hilitecolor',false,val);set(false);}else d.execCommand('BackColor',false,val);},Undo:function(){var ed=this.editor;if(ed.settings.custom_undo_redo){ed.undoManager.undo();ed.nodeChanged();}else ed.getDoc().execCommand('Undo',false,null);},Redo:function(){var ed=this.editor;if(ed.settings.custom_undo_redo){ed.undoManager.redo();ed.nodeChanged();}else ed.getDoc().execCommand('Redo',false,null);},FormatBlock:function(ui,val){var t=this,ed=t.editor,s=ed.selection,dom=ed.dom,bl,nb,b;function isBlock(n){return/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(n.nodeName);};bl=dom.getParent(s.getNode(),function(n){return isBlock(n);});if(bl){if((isIE&&isBlock(bl.parentNode))||bl.nodeName=='DIV'){nb=ed.dom.create(val);each(dom.getAttribs(bl),function(v){dom.setAttrib(nb,v.nodeName,dom.getAttrib(bl,v.nodeName));});b=s.getBookmark();dom.replace(nb,bl,1);s.moveToBookmark(b);ed.nodeChanged();return;}}val=ed.settings.forced_root_block?(val||'<p>'):val;if(val.indexOf('<')==-1)val='<'+val+'>';if(tinymce.isGecko)val=val.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,'$1');ed.getDoc().execCommand('FormatBlock',false,val);},mceCleanup:function(){var ed=this.editor,s=ed.selection,b=s.getBookmark();ed.setContent(ed.getContent());s.moveToBookmark(b);},mceRemoveNode:function(ui,val){var ed=this.editor,s=ed.selection,b,n=val||s.getNode();if(n==ed.getBody())return;b=s.getBookmark();ed.dom.remove(n,1);s.moveToBookmark(b);ed.nodeChanged();},mceSelectNodeDepth:function(ui,val){var ed=this.editor,s=ed.selection,c=0;ed.dom.getParent(s.getNode(),function(n){if(n.nodeType==1&&c++==val){s.select(n);ed.nodeChanged();return false;}},ed.getBody());},mceSelectNode:function(u,v){this.editor.selection.select(v);},mceInsertContent:function(ui,val){this.editor.selection.setContent(val);},mceInsertRawHTML:function(ui,val){var ed=this.editor;ed.selection.setContent('tiny_mce_marker');ed.setContent(ed.getContent().replace(/tiny_mce_marker/g,val));},mceRepaint:function(){var s,b,e=this.editor;if(tinymce.isGecko){try{s=e.selection;b=s.getBookmark(true);if(s.getSel())s.getSel().selectAllChildren(e.getBody());s.collapse(true);s.moveToBookmark(b);}catch(ex){}}},queryStateUnderline:function(){var ed=this.editor,n=ed.selection.getNode();if(n&&n.nodeName=='A')return false;return this._queryState('Underline');},queryStateOutdent:function(){var ed=this.editor,n;if(ed.settings.inline_styles){if((n=ed.dom.getParent(ed.selection.getStart(),ed.dom.isBlock))&&parseInt(n.style.paddingLeft)>0)return true;if((n=ed.dom.getParent(ed.selection.getEnd(),ed.dom.isBlock))&&parseInt(n.style.paddingLeft)>0)return true;}else return!!ed.dom.getParent(ed.selection.getNode(),'BLOCKQUOTE');return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList();},queryStateInsertUnorderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),'UL');},queryStateInsertOrderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),'OL');},queryStatemceBlockQuote:function(){return!!this.editor.dom.getParent(this.editor.selection.getStart(),function(n){return n.nodeName==='BLOCKQUOTE';});},mceBlockQuote:function(){var t=this,ed=t.editor,s=ed.selection,dom=ed.dom,sb,eb,n,bm,bq,r,bq2,i,nl;function getBQ(e){return dom.getParent(e,function(n){return n.nodeName==='BLOCKQUOTE';});};sb=dom.getParent(s.getStart(),dom.isBlock);eb=dom.getParent(s.getEnd(),dom.isBlock);if(bq=getBQ(sb)){if(sb!=eb||sb.childNodes.length>1||(sb.childNodes.length==1&&sb.firstChild.nodeName!='BR'))bm=s.getBookmark();if(getBQ(eb)){bq2=bq.cloneNode(false);while(n=eb.nextSibling)bq2.appendChild(n.parentNode.removeChild(n));}if(bq2)dom.insertAfter(bq2,bq);nl=t._getSelectedBlocks(sb,eb);for(i=nl.length-1;i>=0;i--){dom.insertAfter(nl[i],bq);}if(/^\s*$/.test(bq.innerHTML))dom.remove(bq,1);if(bq2&&/^\s*$/.test(bq2.innerHTML))dom.remove(bq2,1);if(!bm){if(!isIE){r=ed.getDoc().createRange();r.setStart(sb,0);r.setEnd(sb,0);s.setRng(r);}else{s.select(sb);s.collapse(0);if(dom.getParent(s.getStart(),dom.isBlock)!=sb){r=s.getRng();r.move('character',-1);r.select();}}}else t.editor.selection.moveToBookmark(bm);return;}if(isIE&&!sb&&!eb){t.editor.getDoc().execCommand('Indent');n=getBQ(s.getNode());n.style.margin=n.dir='';return;}if(!sb||!eb)return;if(sb!=eb||sb.childNodes.length>1||(sb.childNodes.length==1&&sb.firstChild.nodeName!='BR'))bm=s.getBookmark();each(t._getSelectedBlocks(getBQ(s.getStart()),getBQ(s.getEnd())),function(e){if(e.nodeName=='BLOCKQUOTE'&&!bq){bq=e;return;}if(!bq){bq=dom.create('blockquote');e.parentNode.insertBefore(bq,e);}if(e.nodeName=='BLOCKQUOTE'&&bq){n=e.firstChild;while(n){bq.appendChild(n.cloneNode(true));n=n.nextSibling;}dom.remove(e);return;}bq.appendChild(dom.remove(e));});if(!bm){if(!isIE){r=ed.getDoc().createRange();r.setStart(sb,0);r.setEnd(sb,0);s.setRng(r);}else{s.select(sb);s.collapse(1);}}else s.moveToBookmark(bm);},_getSelectedBlocks:function(st,en){var ed=this.editor,dom=ed.dom,s=ed.selection,sb,eb,n,bl=[];sb=dom.getParent(st||s.getStart(),dom.isBlock);eb=dom.getParent(en||s.getEnd(),dom.isBlock);if(sb)bl.push(sb);if(sb&&eb&&sb!=eb){n=sb;while((n=n.nextSibling)&&n!=eb){if(dom.isBlock(n))bl.push(n);}}if(eb&&sb!=eb)bl.push(eb);return bl;}});})();tinymce.create('tinymce.UndoManager',{index:0,data:null,typing:0,UndoManager:function(ed){var t=this,Dispatcher=tinymce.util.Dispatcher;t.editor=ed;t.data=[];t.onAdd=new Dispatcher(this);t.onUndo=new Dispatcher(this);t.onRedo=new Dispatcher(this);},add:function(l){var t=this,i,ed=t.editor,b,s=ed.settings,la;l=l||{};l.content=l.content||ed.getContent({format:'raw',no_events:1});l.content=l.content.replace(/^\s*|\s*$/g,'');la=t.data[t.index>0&&(t.index==0||t.index==t.data.length)?t.index-1:t.index];if(!l.initial&&la&&l.content==la.content)return null;if(s.custom_undo_redo_levels){if(t.data.length>s.custom_undo_redo_levels){for(i=0;i<t.data.length-1;i++)t.data[i]=t.data[i+1];t.data.length--;t.index=t.data.length;}}if(s.custom_undo_redo_restore_selection&&!l.initial)l.bookmark=b=l.bookmark||ed.selection.getBookmark();if(t.index<t.data.length)t.index++;if(t.data.length===0&&!l.initial)return null;t.data.length=t.index+1;t.data[t.index++]=l;if(l.initial)t.index=0;if(t.data.length==2&&t.data[0].initial)t.data[0].bookmark=b;t.onAdd.dispatch(t,l);ed.isNotDirty=0;return l;},undo:function(){var t=this,ed=t.editor,l=l,i;if(t.typing){t.add();t.typing=0;}if(t.index>0){if(t.index==t.data.length&&t.index>1){i=t.index;t.typing=0;if(!t.add())t.index=i;--t.index;}l=t.data[--t.index];ed.setContent(l.content,{format:'raw'});ed.selection.moveToBookmark(l.bookmark);t.onUndo.dispatch(t,l);}return l;},redo:function(){var t=this,ed=t.editor,l=null;if(t.index<t.data.length-1){l=t.data[++t.index];ed.setContent(l.content,{format:'raw'});ed.selection.moveToBookmark(l.bookmark);t.onRedo.dispatch(t,l);}return l;},clear:function(){var t=this;t.data=[];t.index=0;t.typing=0;t.add({initial:true});},hasUndo:function(){return this.index!=0||this.typing;},hasRedo:function(){return this.index<this.data.length-1;}});(function(){var Event,isIE,isGecko,isOpera,each,extend;Event=tinymce.dom.Event;isIE=tinymce.isIE;isGecko=tinymce.isGecko;isOpera=tinymce.isOpera;each=tinymce.each;extend=tinymce.extend;tinymce.create('tinymce.ForceBlocks',{ForceBlocks:function(ed){var t=this,s=ed.settings,elm;t.editor=ed;t.dom=ed.dom;elm=(s.forced_root_block||'p').toLowerCase();s.element=elm.toUpperCase();ed.onPreInit.add(t.setup,t);t.reOpera=new RegExp('(\\u00a0|&#160;|&nbsp;)<\/'+elm+'>','gi');t.rePadd=new RegExp('<p( )([^>]+)><\\\/p>|<p( )([^>]+)\\\/>|<p( )([^>]+)>\\s+<\\\/p>|<p><\\\/p>|<p\\\/>|<p>\\s+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR1=new RegExp('<p( )([^>]+)>[\\s\\u00a0]+<\\\/p>|<p>[\\s\\u00a0]+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR2=new RegExp('<p( )([^>]+)>(&nbsp;|&#160;)<\\\/p>|<p>(&nbsp;|&#160;)<\\\/p>'.replace(/p/g,elm),'gi');t.reBR2Nbsp=new RegExp('<p( )([^>]+)>\\s*<br \\\/>\\s*<\\\/p>|<p>\\s*<br \\\/>\\s*<\\\/p>'.replace(/p/g,elm),'gi');t.reTrailBr=new RegExp('\\s*<br \\/>\\s*<\\\/p>'.replace(/p/g,elm),'gi');function padd(ed,o){if(isOpera)o.content=o.content.replace(t.reOpera,'</'+elm+'>');o.content=o.content.replace(t.rePadd,'<'+elm+'$1$2$3$4$5$6>\u00a0</'+elm+'>');if(!isIE&&!isOpera&&o.set){o.content=o.content.replace(t.reNbsp2BR1,'<'+elm+'$1$2><br /></'+elm+'>');o.content=o.content.replace(t.reNbsp2BR2,'<'+elm+'$1$2><br /></'+elm+'>');}else{o.content=o.content.replace(t.reBR2Nbsp,'<'+elm+'$1$2>\u00a0</'+elm+'>');o.content=o.content.replace(t.reTrailBr,'</'+elm+'>');}};ed.onBeforeSetContent.add(padd);ed.onPostProcess.add(padd);if(s.forced_root_block){ed.onInit.add(t.forceRoots,t);ed.onSetContent.add(t.forceRoots,t);ed.onBeforeGetContent.add(t.forceRoots,t);}},setup:function(){var t=this,ed=t.editor,s=ed.settings;if(s.forced_root_block){ed.onKeyUp.add(t.forceRoots,t);ed.onPreProcess.add(t.forceRoots,t);}if(s.force_br_newlines){if(isIE){ed.onKeyPress.add(function(ed,e){var n,s=ed.selection;if(e.keyCode==13&&s.getNode().nodeName!='LI'){s.setContent('<br id="__" /> ',{format:'raw'});n=ed.dom.get('__');n.removeAttribute('id');s.select(n);s.collapse();return Event.cancel(e);}});}return;}if(!isIE&&s.force_p_newlines){ed.onKeyPress.add(function(ed,e){if(e.keyCode==13&&!e.shiftKey){if(!t.insertPara(e))Event.cancel(e);}});if(isGecko){ed.onKeyDown.add(function(ed,e){if((e.keyCode==8||e.keyCode==46)&&!e.shiftKey)t.backspaceDelete(e,e.keyCode==8);});}}function ren(rn,na){var ne=ed.dom.create(na);each(rn.attributes,function(a){if(a.specified&&a.nodeValue)ne.setAttribute(a.nodeName.toLowerCase(),a.nodeValue);});each(rn.childNodes,function(n){ne.appendChild(n.cloneNode(true));});rn.parentNode.replaceChild(ne,rn);return ne;};if(isIE&&s.element!='P'){ed.onKeyPress.add(function(ed,e){t.lastElm=ed.selection.getNode().nodeName;});ed.onKeyUp.add(function(ed,e){var bl,sel=ed.selection,n=sel.getNode(),b=ed.getBody();if(b.childNodes.length===1&&n.nodeName=='P'){n=ren(n,s.element);sel.select(n);sel.collapse();ed.nodeChanged();}else if(e.keyCode==13&&!e.shiftKey&&t.lastElm!='P'){bl=ed.dom.getParent(n,'P');if(bl){ren(bl,s.element);ed.nodeChanged();}}});}},find:function(n,t,s){var ed=this.editor,w=ed.getDoc().createTreeWalker(n,4,null,false),c=-1;while(n=w.nextNode()){c++;if(t==0&&n==s)return c;if(t==1&&c==s)return n;}return-1;},forceRoots:function(ed,e){var t=this,ed=t.editor,b=ed.getBody(),d=ed.getDoc(),se=ed.selection,s=se.getSel(),r=se.getRng(),si=-2,ei,so,eo,tr,c=-0xFFFFFF;var nx,bl,bp,sp,le,nl=b.childNodes,i;if(e&&e.keyCode==13)return true;for(i=nl.length-1;i>=0;i--){nx=nl[i];if(nx.nodeType==3||(!t.dom.isBlock(nx)&&nx.nodeType!=8)){if(!bl){if(nx.nodeType!=3||/[^\s]/g.test(nx.nodeValue)){if(si==-2&&r){if(!isIE){if(ed.dom.getParent(r.startContainer,function(e){return e===b;})){so=r.startOffset;eo=r.endOffset;si=t.find(b,0,r.startContainer);ei=t.find(b,0,r.endContainer);}}else{tr=d.body.createTextRange();tr.moveToElementText(b);tr.collapse(1);bp=tr.move('character',c)*-1;tr=r.duplicate();tr.collapse(1);sp=tr.move('character',c)*-1;tr=r.duplicate();tr.collapse(0);le=(tr.move('character',c)*-1)-sp;si=sp-bp;ei=le;}}bl=ed.dom.create(ed.settings.forced_root_block);bl.appendChild(nx.cloneNode(1));nx.parentNode.replaceChild(bl,nx);}}else{if(bl.hasChildNodes())bl.insertBefore(nx,bl.firstChild);else bl.appendChild(nx);}}else bl=null;}if(si!=-2){if(!isIE){bl=b.getElementsByTagName(ed.settings.element)[0];r=d.createRange();if(si!=-1)r.setStart(t.find(b,1,si),so);else r.setStart(bl,0);if(ei!=-1)r.setEnd(t.find(b,1,ei),eo);else r.setEnd(bl,0);if(s){s.removeAllRanges();s.addRange(r);}}else{try{r=s.createRange();r.moveToElementText(b);r.collapse(1);r.moveStart('character',si);r.moveEnd('character',ei);r.select();}catch(ex){}}}},getParentBlock:function(n){var d=this.dom;return d.getParent(n,d.isBlock);},insertPara:function(e){var t=this,ed=t.editor,dom=ed.dom,d=ed.getDoc(),se=ed.settings,s=ed.selection.getSel(),r=s.getRangeAt(0),b=d.body;var rb,ra,dir,sn,so,en,eo,sb,eb,bn,bef,aft,sc,ec,n,vp=dom.getViewPort(ed.getWin()),y,ch;function isEmpty(n){n=n.innerHTML;n=n.replace(/<(img|hr|table)/gi,'-');n=n.replace(/<[^>]+>/g,'');return n.replace(/[ \t\r\n]+/g,'')=='';};rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(true);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(true);dir=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;sn=dir?s.anchorNode:s.focusNode;so=dir?s.anchorOffset:s.focusOffset;en=dir?s.focusNode:s.anchorNode;eo=dir?s.focusOffset:s.anchorOffset;if(sn===en&&/^(TD|TH)$/.test(sn.nodeName)){dom.remove(sn.firstChild);ed.dom.add(sn,se.element,null,'<br />');aft=ed.dom.add(sn,se.element,null,'<br />');r=d.createRange();r.selectNodeContents(aft);r.collapse(1);ed.selection.setRng(r);return false;}if(sn==b&&en==b&&b.firstChild&&ed.dom.isBlock(b.firstChild)){sn=en=sn.firstChild;so=eo=0;rb=d.createRange();rb.setStart(sn,0);ra=d.createRange();ra.setStart(en,0);}sn=sn.nodeName=="HTML"?d.body:sn;sn=sn.nodeName=="BODY"?sn.firstChild:sn;en=en.nodeName=="HTML"?d.body:en;en=en.nodeName=="BODY"?en.firstChild:en;sb=t.getParentBlock(sn);eb=t.getParentBlock(en);bn=sb?sb.nodeName:se.element;if(t.dom.getParent(sb,function(n){return/OL|UL|PRE/.test(n.nodeName);}))return true;if(sb&&(sb.nodeName=='CAPTION'||/absolute|relative|static/gi.test(sb.style.position))){bn=se.element;sb=null;}if(eb&&(eb.nodeName=='CAPTION'||/absolute|relative|static/gi.test(eb.style.position))){bn=se.element;eb=null;}if(/(TD|TABLE|TH|CAPTION)/.test(bn)||(sb&&bn=="DIV"&&/left|right/gi.test(sb.style.cssFloat))){bn=se.element;sb=eb=null;}bef=(sb&&sb.nodeName==bn)?sb.cloneNode(0):ed.dom.create(bn);aft=(eb&&eb.nodeName==bn)?eb.cloneNode(0):ed.dom.create(bn);aft.removeAttribute('id');if(/^(H[1-6])$/.test(bn)&&sn.nodeValue&&so==sn.nodeValue.length)aft=ed.dom.create(se.element);n=sc=sn;do{if(n==b||n.nodeType==9||t.dom.isBlock(n)||/(TD|TABLE|TH|CAPTION)/.test(n.nodeName))break;sc=n;}while((n=n.previousSibling?n.previousSibling:n.parentNode));n=ec=en;do{if(n==b||n.nodeType==9||t.dom.isBlock(n)||/(TD|TABLE|TH|CAPTION)/.test(n.nodeName))break;ec=n;}while((n=n.nextSibling?n.nextSibling:n.parentNode));if(sc.nodeName==bn)rb.setStart(sc,0);else rb.setStartBefore(sc);rb.setEnd(sn,so);bef.appendChild(rb.cloneContents()||d.createTextNode(''));try{ra.setEndAfter(ec);}catch(ex){}ra.setStart(en,eo);aft.appendChild(ra.cloneContents()||d.createTextNode(''));r=d.createRange();if(!sc.previousSibling&&sc.parentNode.nodeName==bn){r.setStartBefore(sc.parentNode);}else{if(rb.startContainer.nodeName==bn&&rb.startOffset==0)r.setStartBefore(rb.startContainer);else r.setStart(rb.startContainer,rb.startOffset);}if(!ec.nextSibling&&ec.parentNode.nodeName==bn)r.setEndAfter(ec.parentNode);else r.setEnd(ra.endContainer,ra.endOffset);r.deleteContents();if(isOpera)ed.getWin().scrollTo(0,vp.y);if(bef.firstChild&&bef.firstChild.nodeName==bn)bef.innerHTML=bef.firstChild.innerHTML;if(aft.firstChild&&aft.firstChild.nodeName==bn)aft.innerHTML=aft.firstChild.innerHTML;if(isEmpty(bef))bef.innerHTML='<br />';if(isEmpty(aft))aft.innerHTML=isOpera?'&nbsp;':'<br />';if(isOpera){r.insertNode(bef);r.insertNode(aft);}else{r.insertNode(aft);r.insertNode(bef);}aft.normalize();bef.normalize();function first(n){return d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false).nextNode()||n;};r=d.createRange();r.selectNodeContents(isGecko?first(aft):aft);r.collapse(1);s.removeAllRanges();s.addRange(r);y=ed.dom.getPos(aft).y;ch=aft.clientHeight;if(y<vp.y||y+ch>vp.y+vp.h){ed.getWin().scrollTo(0,y<vp.y?y:y-vp.h+ch);}return false;},backspaceDelete:function(e,bs){var t=this,ed=t.editor,b=ed.getBody(),n,se=ed.selection,r=se.getRng(),sc=r.startContainer,n,w,tn;if(sc&&ed.dom.isBlock(sc)&&!/^(TD|TH)$/.test(sc.nodeName)&&bs){if(sc.childNodes.length==0||(sc.childNodes.length==1&&sc.firstChild.nodeName=='BR')){n=sc;while((n=n.previousSibling)&&!ed.dom.isBlock(n));if(n){if(sc!=b.firstChild){w=ed.dom.doc.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while(tn=w.nextNode())n=tn;r=ed.getDoc().createRange();r.setStart(n,n.nodeValue?n.nodeValue.length:0);r.setEnd(n,n.nodeValue?n.nodeValue.length:0);se.setRng(r);ed.dom.remove(sc);}return Event.cancel(e);}}}function handler(e){e=e.target;if(e&&e.parentNode&&e.nodeName=='BR'&&(n=t.getParentBlock(e))){Event.remove(b,'DOMNodeInserted',handler);if(e.previousSibling||e.nextSibling)ed.dom.remove(e);}};Event._add(b,'DOMNodeInserted',handler);window.setTimeout(function(){Event._remove(b,'DOMNodeInserted',handler);},1);}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,extend=tinymce.extend;tinymce.create('tinymce.ControlManager',{ControlManager:function(ed,s){var t=this,i;s=s||{};t.editor=ed;t.controls={};t.onAdd=new tinymce.util.Dispatcher(t);t.onPostRender=new tinymce.util.Dispatcher(t);t.prefix=s.prefix||ed.id+'_';t._cls={};t.onPostRender.add(function(){each(t.controls,function(c){c.postRender();});});},get:function(id){return this.controls[this.prefix+id]||this.controls[id];},setActive:function(id,s){var c=null;if(c=this.get(id))c.setActive(s);return c;},setDisabled:function(id,s){var c=null;if(c=this.get(id))c.setDisabled(s);return c;},add:function(c){var t=this;if(c){t.controls[c.id]=c;t.onAdd.dispatch(c,t);}return c;},createControl:function(n){var c,t=this,ed=t.editor;each(ed.plugins,function(p){if(p.createControl){c=p.createControl(n,t);if(c)return false;}});switch(n){case"|":case"separator":return t.createSeparator();}if(!c&&ed.buttons&&(c=ed.buttons[n]))return t.createButton(n,c);return t.add(c);},createDropMenu:function(id,s,cc){var t=this,ed=t.editor,c,bm,v,cls;s=extend({'class':'mceDropDown',constrain:ed.settings.constrain_menus},s);s['class']=s['class']+' '+ed.getParam('skin')+'Skin';if(v=ed.getParam('skin_variant'))s['class']+=' '+ed.getParam('skin')+'Skin'+v.substring(0,1).toUpperCase()+v.substring(1);id=t.prefix+id;cls=cc||t._cls.dropmenu||tinymce.ui.DropMenu;c=t.controls[id]=new cls(id,s);c.onAddItem.add(function(c,o){var s=o.settings;s.title=ed.getLang(s.title,s.title);if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,s.value);};}});ed.onRemove.add(function(){c.destroy();});if(tinymce.isIE){c.onShowMenu.add(function(){bm=ed.selection.getBookmark(1);});c.onHideMenu.add(function(){if(bm)ed.selection.moveToBookmark(bm);});}return t.add(c);},createListBox:function(id,s,cc){var t=this,ed=t.editor,cmd,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':'mce_'+id,scope:s.scope,control_manager:t},s);id=t.prefix+id;if(ed.settings.use_native_selects)c=new tinymce.ui.NativeListBox(id,s);else{cls=cc||t._cls.listbox||tinymce.ui.ListBox;c=new cls(id,s);}t.controls[id]=c;if(tinymce.isWebKit){c.onPostRender.add(function(c,n){Event.add(n,'mousedown',function(){ed.bookmark=ed.selection.getBookmark('simple');});Event.add(n,'focus',function(){ed.selection.moveToBookmark(ed.bookmark);ed.bookmark=null;});});}if(c.hideMenu)ed.onMouseDown.add(c.hideMenu,c);return t.add(c);},createButton:function(id,s,cc){var t=this,ed=t.editor,o,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.label=ed.translate(s.label);s.scope=s.scope||ed;if(!s.onclick&&!s.menu_button){s.onclick=function(){ed.execCommand(s.cmd,s.ui||false,s.value);};}s=extend({title:s.title,'class':'mce_'+id,unavailable_prefix:ed.getLang('unavailable',''),scope:s.scope,control_manager:t},s);id=t.prefix+id;if(s.menu_button){cls=cc||t._cls.menubutton||tinymce.ui.MenuButton;c=new cls(id,s);ed.onMouseDown.add(c.hideMenu,c);}else{cls=t._cls.button||tinymce.ui.Button;c=new cls(id,s);}return t.add(c);},createMenuButton:function(id,s){s=s||{};s.menu_button=1;return this.createButton(id,s);},createSplitButton:function(id,s,cc){var t=this,ed=t.editor,cmd,c,cls;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':'mce_'+id,scope:s.scope,control_manager:t},s);id=t.prefix+id;cls=cc||t._cls.splitbutton||tinymce.ui.SplitButton;c=t.add(new cls(id,s));ed.onMouseDown.add(c.hideMenu,c);return c;},createColorSplitButton:function(id,s,cc){var t=this,ed=t.editor,cmd,c,cls,bm;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':'mce_'+id,'menu_class':ed.getParam('skin')+'Skin',scope:s.scope,more_colors_title:ed.getLang('more_colors')},s);id=t.prefix+id;cls=cc||t._cls.colorsplitbutton||tinymce.ui.ColorSplitButton;c=new cls(id,s);ed.onMouseDown.add(c.hideMenu,c);ed.onRemove.add(function(){c.destroy();});if(tinymce.isIE){c.onShowMenu.add(function(){bm=ed.selection.getBookmark(1);});c.onHideMenu.add(function(){if(bm)ed.selection.moveToBookmark(bm);});}return t.add(c);},createToolbar:function(id,s,cc){var c,t=this,cls;id=t.prefix+id;cls=cc||t._cls.toolbar||tinymce.ui.Toolbar;c=new cls(id,s);if(t.get(id))return null;return t.add(c);},createSeparator:function(cc){var cls=cc||this._cls.separator||tinymce.ui.Separator;return new cls();},setControlType:function(n,c){return this._cls[n.toLowerCase()]=c;},destroy:function(){each(this.controls,function(c){c.destroy();});this.controls=null;}});})();(function(){var Dispatcher=tinymce.util.Dispatcher,each=tinymce.each,isIE=tinymce.isIE,isOpera=tinymce.isOpera;tinymce.create('tinymce.WindowManager',{WindowManager:function(ed){var t=this;t.editor=ed;t.onOpen=new Dispatcher(t);t.onClose=new Dispatcher(t);t.params={};t.features={};},open:function(s,p){var t=this,f='',x,y,mo=t.editor.settings.dialog_type=='modal',w,sw,sh,vp=tinymce.DOM.getViewPort(),u;s=s||{};p=p||{};sw=isOpera?vp.w:screen.width;sh=isOpera?vp.h:screen.height;s.name=s.name||'mc_'+new Date().getTime();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240);s.resizable=true;s.left=s.left||parseInt(sw/ 2.0) - (s.width /2.0);s.top=s.top||parseInt(sh/ 2.0) - (s.height /2.0);p.inline=false;p.mce_width=s.width;p.mce_height=s.height;p.mce_auto_focus=s.auto_focus;if(mo){if(isIE){s.center=true;s.help=false;s.dialogWidth=s.width+'px';s.dialogHeight=s.height+'px';s.scroll=s.scrollbars||false;}}each(s,function(v,k){if(tinymce.is(v,'boolean'))v=v?'yes':'no';if(!/^(name|url)$/.test(k)){if(isIE&&mo)f+=(f?';':'')+k+':'+v;else f+=(f?',':'')+k+'='+v;}});t.features=s;t.params=p;t.onOpen.dispatch(t,s,p);u=s.url||s.file;if(tinymce.relaxedDomain)u+=(u.indexOf('?')==-1?'?':'&')+'mce_rdomain='+tinymce.relaxedDomain;u=tinymce._addVer(u);try{if(isIE&&mo){w=1;window.showModalDialog(u,window,f);}else w=window.open(u,s.name,f);}catch(ex){}if(!w)alert(t.editor.getLang('popup_blocked'));},close:function(w){w.close();this.onClose.dispatch(this);},createInstance:function(cl,a,b,c,d,e){var f=tinymce.resolve(cl);return new f(a,b,c,d,e);},confirm:function(t,cb,s){cb.call(s||this,confirm(this._decode(this.editor.getLang(t,t))));},alert:function(tx,cb,s){var t=this;alert(t._decode(t.editor.getLang(tx,tx)));if(cb)cb.call(s||t);},_decode:function(s){return tinymce.DOM.decode(s).replace(/\\n/g,'\n');}});}()); \ No newline at end of file
diff --git a/wp-includes/js/tinymce/tiny_mce_config.php b/wp-includes/js/tinymce/tiny_mce_config.php
index f95a746..6f7b0cc 100644
--- a/wp-includes/js/tinymce/tiny_mce_config.php
+++ b/wp-includes/js/tinymce/tiny_mce_config.php
@@ -4,7 +4,7 @@
* $Id: tiny_mce_gzip.php 315 2007-10-25 14:03:43Z spocke $
*
* @author Moxiecode
- * @copyright Copyright © 2005-2006, Moxiecode Systems AB, All rights reserved.
+ * @copyright Copyright © 2005-2006, Moxiecode Systems AB, All rights reserved.
*
* This file compresses the TinyMCE JavaScript using GZip.
**/
@@ -12,7 +12,7 @@
// Discard any buffers
while ( @ob_end_clean() );
-@ require('../../../wp-config.php');
+@ require('../../../wp-load.php');
function getFileContents($path) {
@@ -70,7 +70,7 @@ http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker
*/
$mce_spellchecker_languages = apply_filters('mce_spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv');
-$plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen' );
+$plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage' );
/*
The following filter takes an associative array of external plugins for TinyMCE in the form 'plugin_name' => 'url'.
@@ -122,7 +122,7 @@ if ( ! empty($mce_external_plugins) ) {
}
$plugins = implode($plugins, ',');
-$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'image', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' ));
+$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' ));
$mce_buttons = implode($mce_buttons, ',');
$mce_buttons_2 = apply_filters('mce_buttons_2', array('formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'media', 'charmap', '|', 'outdent', 'indent', '|', 'undo', 'redo', 'wp_help' ));
@@ -206,14 +206,14 @@ if ( $msie = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ) {
}
// Cache path, this is where the .gz files will be stored
-$cache_path = ABSPATH . 'wp-content/uploads/js_cache';
+$cache_path = WP_CONTENT_DIR . '/uploads/js_cache';
if ( $disk_cache && ! is_dir($cache_path) )
$disk_cache = wp_mkdir_p($cache_path);
$cache_ext = '.js';
$plugins = explode( ',', $initArray['plugins'] );
$theme = ( 'simple' == $initArray['theme'] ) ? 'simple' : 'advanced';
-$language = isset($initArray['language']) ? substr( $initArray['language'], 0, 2 ) : 'en';
+$language = ( isset($initArray['language']) && ! empty($initArray['language']) ) ? substr( $initArray['language'], 0, 2 ) : 'en';
$cacheKey = $mce_options = '';
// Check if browser supports gzip
@@ -226,7 +226,7 @@ if ( $compress && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
// Setup cache info
if ( $disk_cache ) {
- $cacheKey = apply_filters('tiny_mce_version', '20080414');
+ $cacheKey = apply_filters('tiny_mce_version', '20080606');
foreach ( $initArray as $v )
$cacheKey .= $v;
@@ -273,7 +273,7 @@ if ( $mce_deprecated ) $mce_options .= $mce_deprecated;
$mce_options = rtrim( trim($mce_options), '\n\r,' );
-$content = 'var tinyMCEPreInit = { settings : { themes : "' . $theme . '", plugins : "' . $initArray['plugins'] . '", languages : "' . $language . '", debug : false }, base : "' . $baseurl . '", suffix : "" };';
+$content = 'var tinyMCEPreInit = { settings : { themes : "' . $theme . '", plugins : "' . $initArray['plugins'] . '", languages : "' . $language . '", debug : false }, base : "' . $baseurl . '", suffix : "", query : "ver=3091" };';
// Load patch
$content .= getFileContents( 'tiny_mce_ext.js' );
@@ -329,4 +329,4 @@ if ( '' != $cacheKey && is_dir($cache_path) && is_readable($cache_path) ) {
putFileContents( $cache_file, $content );
}
-?>
+?> \ No newline at end of file
diff --git a/wp-includes/js/tinymce/tiny_mce_ext.js b/wp-includes/js/tinymce/tiny_mce_ext.js
index 6eab910..cee045d 100644
--- a/wp-includes/js/tinymce/tiny_mce_ext.js
+++ b/wp-includes/js/tinymce/tiny_mce_ext.js
@@ -29,8 +29,7 @@ tinyMCEPreInit.start = function() {
};
tinyMCEPreInit.load_ext = function(url,lang) {
var sl = tinymce.ScriptLoader;
-
-// sl.add(url + '/langs/lang.php');
+
sl.markDone(url + '/langs/' + lang + '.js');
sl.markDone(url + '/langs/' + lang + '_dlg.js');
};
diff --git a/wp-includes/js/tinymce/tiny_mce_popup.js b/wp-includes/js/tinymce/tiny_mce_popup.js
index 84cbded..6c8f73b 100644
--- a/wp-includes/js/tinymce/tiny_mce_popup.js
+++ b/wp-includes/js/tinymce/tiny_mce_popup.js
@@ -132,7 +132,7 @@ tinyMCEPopup = {
// To avoid domain relaxing issue in Opera
function close() {
- t.editor.windowManager.close(window, t.id);
+ t.editor.windowManager.close(window);
tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup
};
@@ -183,7 +183,7 @@ tinyMCEPopup = {
// Set inline title
if (!t.isWindow)
- t.editor.windowManager.setTitle(ti, t.id);
+ t.editor.windowManager.setTitle(window, ti);
else
window.focus();
diff --git a/wp-includes/js/tinymce/utils/editable_selects.js b/wp-includes/js/tinymce/utils/editable_selects.js
index 9b40922..7f58dfc 100644
--- a/wp-includes/js/tinymce/utils/editable_selects.js
+++ b/wp-includes/js/tinymce/utils/editable_selects.js
@@ -1,61 +1,61 @@
-/**
- * $Id: editable_selects.js 520 2008-01-07 16:30:32Z spocke $
- *
- * Makes select boxes editable.
- *
- * @author Moxiecode
- * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
- */
-
-var TinyMCE_EditableSelects = {
- editSelectElm : null,
-
- init : function() {
- var nl = document.getElementsByTagName("select"), i, d = document, o;
-
- for (i=0; i<nl.length; i++) {
- if (nl[i].className.indexOf('mceEditableSelect') != -1) {
- o = new Option('(value)', '__mce_add_custom__');
-
- o.className = 'mceAddSelectValue';
-
- nl[i].options[nl[i].options.length] = o;
- nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;
- }
- }
- },
-
- onChangeEditableSelect : function(e) {
- var d = document, ne, se = window.event ? window.event.srcElement : e.target;
-
- if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
- ne = d.createElement("input");
- ne.id = se.id + "_custom";
- ne.name = se.name + "_custom";
- ne.type = "text";
-
- ne.style.width = se.offsetWidth + 'px';
- se.parentNode.insertBefore(ne, se);
- se.style.display = 'none';
- ne.focus();
- ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
- TinyMCE_EditableSelects.editSelectElm = se;
- }
- },
-
- onBlurEditableSelectInput : function() {
- var se = TinyMCE_EditableSelects.editSelectElm;
-
- if (se) {
- if (se.previousSibling.value != '') {
- addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);
- selectByValue(document.forms[0], se.id, se.previousSibling.value);
- } else
- selectByValue(document.forms[0], se.id, '');
-
- se.style.display = 'inline';
- se.parentNode.removeChild(se.previousSibling);
- TinyMCE_EditableSelects.editSelectElm = null;
- }
- }
-};
+/**
+ * $Id: editable_selects.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * Makes select boxes editable.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+var TinyMCE_EditableSelects = {
+ editSelectElm : null,
+
+ init : function() {
+ var nl = document.getElementsByTagName("select"), i, d = document, o;
+
+ for (i=0; i<nl.length; i++) {
+ if (nl[i].className.indexOf('mceEditableSelect') != -1) {
+ o = new Option('(value)', '__mce_add_custom__');
+
+ o.className = 'mceAddSelectValue';
+
+ nl[i].options[nl[i].options.length] = o;
+ nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;
+ }
+ }
+ },
+
+ onChangeEditableSelect : function(e) {
+ var d = document, ne, se = window.event ? window.event.srcElement : e.target;
+
+ if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
+ ne = d.createElement("input");
+ ne.id = se.id + "_custom";
+ ne.name = se.name + "_custom";
+ ne.type = "text";
+
+ ne.style.width = se.offsetWidth + 'px';
+ se.parentNode.insertBefore(ne, se);
+ se.style.display = 'none';
+ ne.focus();
+ ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
+ TinyMCE_EditableSelects.editSelectElm = se;
+ }
+ },
+
+ onBlurEditableSelectInput : function() {
+ var se = TinyMCE_EditableSelects.editSelectElm;
+
+ if (se) {
+ if (se.previousSibling.value != '') {
+ addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);
+ selectByValue(document.forms[0], se.id, se.previousSibling.value);
+ } else
+ selectByValue(document.forms[0], se.id, '');
+
+ se.style.display = 'inline';
+ se.parentNode.removeChild(se.previousSibling);
+ TinyMCE_EditableSelects.editSelectElm = null;
+ }
+ }
+};
diff --git a/wp-includes/js/tinymce/utils/form_utils.js b/wp-includes/js/tinymce/utils/form_utils.js
index c1f1409..6d79d0a 100644
--- a/wp-includes/js/tinymce/utils/form_utils.js
+++ b/wp-includes/js/tinymce/utils/form_utils.js
@@ -1,199 +1,199 @@
-/**
- * $Id: form_utils.js 673 2008-03-06 13:26:20Z spocke $
- *
- * Various form utilitiy functions.
- *
- * @author Moxiecode
- * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
- */
-
-var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
-
-function getColorPickerHTML(id, target_form_element) {
- var h = "";
-
- h += '<a id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';
- h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>';
-
- return h;
-}
-
-function updateColor(img_id, form_element_id) {
- document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
-}
-
-function setBrowserDisabled(id, state) {
- var img = document.getElementById(id);
- var lnk = document.getElementById(id + "_link");
-
- if (lnk) {
- if (state) {
- lnk.setAttribute("realhref", lnk.getAttribute("href"));
- lnk.removeAttribute("href");
- tinyMCEPopup.dom.addClass(img, 'disabled');
- } else {
- if (lnk.getAttribute("realhref"))
- lnk.setAttribute("href", lnk.getAttribute("realhref"));
-
- tinyMCEPopup.dom.removeClass(img, 'disabled');
- }
- }
-}
-
-function getBrowserHTML(id, target_form_element, type, prefix) {
- var option = prefix + "_" + type + "_browser_callback", cb, html;
-
- cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
-
- if (!cb)
- return "";
-
- html = "";
- html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';
- html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>';
-
- return html;
-}
-
-function openBrowser(img_id, target_form_element, type, option) {
- var img = document.getElementById(img_id);
-
- if (img.className != "mceButtonDisabled")
- tinyMCEPopup.openBrowser(target_form_element, type, option);
-}
-
-function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
- if (!form_obj || !form_obj.elements[field_name])
- return;
-
- var sel = form_obj.elements[field_name];
-
- var found = false;
- for (var i=0; i<sel.options.length; i++) {
- var option = sel.options[i];
-
- if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
- option.selected = true;
- found = true;
- } else
- option.selected = false;
- }
-
- if (!found && add_custom && value != '') {
- var option = new Option(value, value);
- option.selected = true;
- sel.options[sel.options.length] = option;
- sel.selectedIndex = sel.options.length - 1;
- }
-
- return found;
-}
-
-function getSelectValue(form_obj, field_name) {
- var elm = form_obj.elements[field_name];
-
- if (elm == null || elm.options == null)
- return "";
-
- return elm.options[elm.selectedIndex].value;
-}
-
-function addSelectValue(form_obj, field_name, name, value) {
- var s = form_obj.elements[field_name];
- var o = new Option(name, value);
- s.options[s.options.length] = o;
-}
-
-function addClassesToList(list_id, specific_option) {
- // Setup class droplist
- var styleSelectElm = document.getElementById(list_id);
- var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);
- styles = tinyMCEPopup.getParam(specific_option, styles);
-
- if (styles) {
- var stylesAr = styles.split(';');
-
- for (var i=0; i<stylesAr.length; i++) {
- if (stylesAr != "") {
- var key, value;
-
- key = stylesAr[i].split('=')[0];
- value = stylesAr[i].split('=')[1];
-
- styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
- }
- }
- } else {
- tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
- styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
- });
- }
-}
-
-function isVisible(element_id) {
- var elm = document.getElementById(element_id);
-
- return elm && elm.style.display != "none";
-}
-
-function convertRGBToHex(col) {
- var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
-
- var rgb = col.replace(re, "$1,$2,$3").split(',');
- if (rgb.length == 3) {
- r = parseInt(rgb[0]).toString(16);
- g = parseInt(rgb[1]).toString(16);
- b = parseInt(rgb[2]).toString(16);
-
- r = r.length == 1 ? '0' + r : r;
- g = g.length == 1 ? '0' + g : g;
- b = b.length == 1 ? '0' + b : b;
-
- return "#" + r + g + b;
- }
-
- return col;
-}
-
-function convertHexToRGB(col) {
- if (col.indexOf('#') != -1) {
- col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
-
- r = parseInt(col.substring(0, 2), 16);
- g = parseInt(col.substring(2, 4), 16);
- b = parseInt(col.substring(4, 6), 16);
-
- return "rgb(" + r + "," + g + "," + b + ")";
- }
-
- return col;
-}
-
-function trimSize(size) {
- return size.replace(/([0-9\.]+)px|(%|in|cm|mm|em|ex|pt|pc)/, '$1$2');
-}
-
-function getCSSSize(size) {
- size = trimSize(size);
-
- if (size == "")
- return "";
-
- // Add px
- if (/^[0-9]+$/.test(size))
- size += 'px';
-
- return size;
-}
-
-function getStyle(elm, attrib, style) {
- var val = tinyMCEPopup.dom.getAttrib(elm, attrib);
-
- if (val != '')
- return '' + val;
-
- if (typeof(style) == 'undefined')
- style = attrib;
-
- return tinyMCEPopup.dom.getStyle(elm, style);
-}
+/**
+ * $Id: form_utils.js 673 2008-03-06 13:26:20Z spocke $
+ *
+ * Various form utilitiy functions.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
+
+function getColorPickerHTML(id, target_form_element) {
+ var h = "";
+
+ h += '<a id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';
+ h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>';
+
+ return h;
+}
+
+function updateColor(img_id, form_element_id) {
+ document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
+}
+
+function setBrowserDisabled(id, state) {
+ var img = document.getElementById(id);
+ var lnk = document.getElementById(id + "_link");
+
+ if (lnk) {
+ if (state) {
+ lnk.setAttribute("realhref", lnk.getAttribute("href"));
+ lnk.removeAttribute("href");
+ tinyMCEPopup.dom.addClass(img, 'disabled');
+ } else {
+ if (lnk.getAttribute("realhref"))
+ lnk.setAttribute("href", lnk.getAttribute("realhref"));
+
+ tinyMCEPopup.dom.removeClass(img, 'disabled');
+ }
+ }
+}
+
+function getBrowserHTML(id, target_form_element, type, prefix) {
+ var option = prefix + "_" + type + "_browser_callback", cb, html;
+
+ cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
+
+ if (!cb)
+ return "";
+
+ html = "";
+ html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';
+ html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>';
+
+ return html;
+}
+
+function openBrowser(img_id, target_form_element, type, option) {
+ var img = document.getElementById(img_id);
+
+ if (img.className != "mceButtonDisabled")
+ tinyMCEPopup.openBrowser(target_form_element, type, option);
+}
+
+function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
+ if (!form_obj || !form_obj.elements[field_name])
+ return;
+
+ var sel = form_obj.elements[field_name];
+
+ var found = false;
+ for (var i=0; i<sel.options.length; i++) {
+ var option = sel.options[i];
+
+ if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
+ option.selected = true;
+ found = true;
+ } else
+ option.selected = false;
+ }
+
+ if (!found && add_custom && value != '') {
+ var option = new Option(value, value);
+ option.selected = true;
+ sel.options[sel.options.length] = option;
+ sel.selectedIndex = sel.options.length - 1;
+ }
+
+ return found;
+}
+
+function getSelectValue(form_obj, field_name) {
+ var elm = form_obj.elements[field_name];
+
+ if (elm == null || elm.options == null)
+ return "";
+
+ return elm.options[elm.selectedIndex].value;
+}
+
+function addSelectValue(form_obj, field_name, name, value) {
+ var s = form_obj.elements[field_name];
+ var o = new Option(name, value);
+ s.options[s.options.length] = o;
+}
+
+function addClassesToList(list_id, specific_option) {
+ // Setup class droplist
+ var styleSelectElm = document.getElementById(list_id);
+ var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);
+ styles = tinyMCEPopup.getParam(specific_option, styles);
+
+ if (styles) {
+ var stylesAr = styles.split(';');
+
+ for (var i=0; i<stylesAr.length; i++) {
+ if (stylesAr != "") {
+ var key, value;
+
+ key = stylesAr[i].split('=')[0];
+ value = stylesAr[i].split('=')[1];
+
+ styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
+ }
+ }
+ } else {
+ tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
+ styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
+ });
+ }
+}
+
+function isVisible(element_id) {
+ var elm = document.getElementById(element_id);
+
+ return elm && elm.style.display != "none";
+}
+
+function convertRGBToHex(col) {
+ var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
+
+ var rgb = col.replace(re, "$1,$2,$3").split(',');
+ if (rgb.length == 3) {
+ r = parseInt(rgb[0]).toString(16);
+ g = parseInt(rgb[1]).toString(16);
+ b = parseInt(rgb[2]).toString(16);
+
+ r = r.length == 1 ? '0' + r : r;
+ g = g.length == 1 ? '0' + g : g;
+ b = b.length == 1 ? '0' + b : b;
+
+ return "#" + r + g + b;
+ }
+
+ return col;
+}
+
+function convertHexToRGB(col) {
+ if (col.indexOf('#') != -1) {
+ col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
+
+ r = parseInt(col.substring(0, 2), 16);
+ g = parseInt(col.substring(2, 4), 16);
+ b = parseInt(col.substring(4, 6), 16);
+
+ return "rgb(" + r + "," + g + "," + b + ")";
+ }
+
+ return col;
+}
+
+function trimSize(size) {
+ return size.replace(/([0-9\.]+)px|(%|in|cm|mm|em|ex|pt|pc)/, '$1$2');
+}
+
+function getCSSSize(size) {
+ size = trimSize(size);
+
+ if (size == "")
+ return "";
+
+ // Add px
+ if (/^[0-9]+$/.test(size))
+ size += 'px';
+
+ return size;
+}
+
+function getStyle(elm, attrib, style) {
+ var val = tinyMCEPopup.dom.getAttrib(elm, attrib);
+
+ if (val != '')
+ return '' + val;
+
+ if (typeof(style) == 'undefined')
+ style = attrib;
+
+ return tinyMCEPopup.dom.getStyle(elm, style);
+}
diff --git a/wp-includes/js/tinymce/utils/mclayer.js b/wp-includes/js/tinymce/utils/mclayer.js
index 41aabcf..a46d174 100644
--- a/wp-includes/js/tinymce/utils/mclayer.js
+++ b/wp-includes/js/tinymce/utils/mclayer.js
@@ -1,210 +1,210 @@
-/**
- * $Id: mclayer.js 520 2008-01-07 16:30:32Z spocke $
- *
- * Moxiecode floating layer script.
- *
- * @author Moxiecode
- * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
- */
-
-function MCLayer(id) {
- this.id = id;
- this.settings = new Array();
- this.blockerElement = null;
- this.isMSIE = navigator.appName == "Microsoft Internet Explorer";
- this.events = false;
- this.autoHideCallback = null;
-}
-
-MCLayer.prototype = {
- moveRelativeTo : function(re, p, a) {
- var rep = this.getAbsPosition(re);
- var w = parseInt(re.offsetWidth);
- var h = parseInt(re.offsetHeight);
- var x, y;
-
- switch (p) {
- case "tl":
- break;
-
- case "tr":
- x = rep.absLeft + w;
- y = rep.absTop;
- break;
-
- case "bl":
- break;
-
- case "br":
- break;
- }
-
- this.moveTo(x, y);
- },
-
- moveBy : function(dx, dy) {
- var e = this.getElement();
- var x = parseInt(e.style.left);
- var y = parseInt(e.style.top);
-
- e.style.left = (x + dx) + "px";
- e.style.top = (y + dy) + "px";
-
- this.updateBlocker();
- },
-
- moveTo : function(x, y) {
- var e = this.getElement();
-
- e.style.left = x + "px";
- e.style.top = y + "px";
-
- this.updateBlocker();
- },
-
- show : function() {
- MCLayer.visibleLayer = this;
-
- this.getElement().style.display = 'block';
- this.updateBlocker();
- },
-
- hide : function() {
- this.getElement().style.display = 'none';
- this.updateBlocker();
- },
-
- setAutoHide : function(s, cb) {
- this.autoHideCallback = cb;
- this.registerEventHandlers();
- },
-
- getElement : function() {
- return document.getElementById(this.id);
- },
-
- updateBlocker : function() {
- if (!this.isMSIE)
- return;
-
- var e = this.getElement();
- var b = this.getBlocker();
- var x = this.parseInt(e.style.left);
- var y = this.parseInt(e.style.top);
- var w = this.parseInt(e.offsetWidth);
- var h = this.parseInt(e.offsetHeight);
-
- b.style.left = x + 'px';
- b.style.top = y + 'px';
- b.style.width = w + 'px';
- b.style.height = h + 'px';
- b.style.display = e.style.display;
- },
-
- getBlocker : function() {
- if (!this.blockerElement) {
- var d = document, b = d.createElement("iframe");
-
- b.style.cssText = 'display: none; left: 0px; position: absolute; top: 0';
- b.src = 'javascript:false;';
- b.frameBorder = '0';
- b.scrolling = 'no';
-
- d.body.appendChild(b);
- this.blockerElement = b;
- }
-
- return this.blockerElement;
- },
-
- getAbsPosition : function(n) {
- var p = {absLeft : 0, absTop : 0};
-
- while (n) {
- p.absLeft += n.offsetLeft;
- p.absTop += n.offsetTop;
- n = n.offsetParent;
- }
-
- return p;
- },
-
- registerEventHandlers : function() {
- if (!this.events) {
- var d = document;
-
- this.addEvent(d, 'mousedown', MCLayer.prototype.onMouseDown);
-
- this.events = true;
- }
- },
-
- addEvent : function(o, n, h) {
- if (o.attachEvent)
- o.attachEvent("on" + n, h);
- else
- o.addEventListener(n, h, false);
- },
-
- onMouseDown : function(e) {
- e = typeof(e) == "undefined" ? window.event : e;
- var b = document.body;
- var l = MCLayer.visibleLayer;
-
- if (l) {
- var mx = l.isMSIE ? e.clientX + b.scrollLeft : e.pageX;
- var my = l.isMSIE ? e.clientY + b.scrollTop : e.pageY;
- var el = l.getElement();
- var x = parseInt(el.style.left);
- var y = parseInt(el.style.top);
- var w = parseInt(el.offsetWidth);
- var h = parseInt(el.offsetHeight);
-
- if (!(mx > x && mx < x + w && my > y && my < y + h)) {
- MCLayer.visibleLayer = null;
-
- if (l.autoHideCallback && l.autoHideCallback(l, e, mx, my))
- return true;
-
- l.hide();
- }
- }
- },
-
- addCSSClass : function(e, c) {
- this.removeCSSClass(e, c);
- var a = this.explode(' ', e.className);
- a[a.length] = c;
- e.className = a.join(' ');
- },
-
- removeCSSClass : function(e, c) {
- var a = this.explode(' ', e.className), i;
-
- for (i=0; i<a.length; i++) {
- if (a[i] == c)
- a[i] = '';
- }
-
- e.className = a.join(' ');
- },
-
- explode : function(d, s) {
- var ar = s.split(d);
- var oar = new Array();
-
- for (var i = 0; i<ar.length; i++) {
- if (ar[i] != "")
- oar[oar.length] = ar[i];
- }
-
- return oar;
- },
-
- parseInt : function(s) {
- if (s == null || s == '')
- return 0;
-
- return parseInt(s);
- }
-}
+/**
+ * $Id: mclayer.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * Moxiecode floating layer script.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+function MCLayer(id) {
+ this.id = id;
+ this.settings = new Array();
+ this.blockerElement = null;
+ this.isMSIE = navigator.appName == "Microsoft Internet Explorer";
+ this.events = false;
+ this.autoHideCallback = null;
+}
+
+MCLayer.prototype = {
+ moveRelativeTo : function(re, p, a) {
+ var rep = this.getAbsPosition(re);
+ var w = parseInt(re.offsetWidth);
+ var h = parseInt(re.offsetHeight);
+ var x, y;
+
+ switch (p) {
+ case "tl":
+ break;
+
+ case "tr":
+ x = rep.absLeft + w;
+ y = rep.absTop;
+ break;
+
+ case "bl":
+ break;
+
+ case "br":
+ break;
+ }
+
+ this.moveTo(x, y);
+ },
+
+ moveBy : function(dx, dy) {
+ var e = this.getElement();
+ var x = parseInt(e.style.left);
+ var y = parseInt(e.style.top);
+
+ e.style.left = (x + dx) + "px";
+ e.style.top = (y + dy) + "px";
+
+ this.updateBlocker();
+ },
+
+ moveTo : function(x, y) {
+ var e = this.getElement();
+
+ e.style.left = x + "px";
+ e.style.top = y + "px";
+
+ this.updateBlocker();
+ },
+
+ show : function() {
+ MCLayer.visibleLayer = this;
+
+ this.getElement().style.display = 'block';
+ this.updateBlocker();
+ },
+
+ hide : function() {
+ this.getElement().style.display = 'none';
+ this.updateBlocker();
+ },
+
+ setAutoHide : function(s, cb) {
+ this.autoHideCallback = cb;
+ this.registerEventHandlers();
+ },
+
+ getElement : function() {
+ return document.getElementById(this.id);
+ },
+
+ updateBlocker : function() {
+ if (!this.isMSIE)
+ return;
+
+ var e = this.getElement();
+ var b = this.getBlocker();
+ var x = this.parseInt(e.style.left);
+ var y = this.parseInt(e.style.top);
+ var w = this.parseInt(e.offsetWidth);
+ var h = this.parseInt(e.offsetHeight);
+
+ b.style.left = x + 'px';
+ b.style.top = y + 'px';
+ b.style.width = w + 'px';
+ b.style.height = h + 'px';
+ b.style.display = e.style.display;
+ },
+
+ getBlocker : function() {
+ if (!this.blockerElement) {
+ var d = document, b = d.createElement("iframe");
+
+ b.style.cssText = 'display: none; left: 0px; position: absolute; top: 0';
+ b.src = 'javascript:false;';
+ b.frameBorder = '0';
+ b.scrolling = 'no';
+
+ d.body.appendChild(b);
+ this.blockerElement = b;
+ }
+
+ return this.blockerElement;
+ },
+
+ getAbsPosition : function(n) {
+ var p = {absLeft : 0, absTop : 0};
+
+ while (n) {
+ p.absLeft += n.offsetLeft;
+ p.absTop += n.offsetTop;
+ n = n.offsetParent;
+ }
+
+ return p;
+ },
+
+ registerEventHandlers : function() {
+ if (!this.events) {
+ var d = document;
+
+ this.addEvent(d, 'mousedown', MCLayer.prototype.onMouseDown);
+
+ this.events = true;
+ }
+ },
+
+ addEvent : function(o, n, h) {
+ if (o.attachEvent)
+ o.attachEvent("on" + n, h);
+ else
+ o.addEventListener(n, h, false);
+ },
+
+ onMouseDown : function(e) {
+ e = typeof(e) == "undefined" ? window.event : e;
+ var b = document.body;
+ var l = MCLayer.visibleLayer;
+
+ if (l) {
+ var mx = l.isMSIE ? e.clientX + b.scrollLeft : e.pageX;
+ var my = l.isMSIE ? e.clientY + b.scrollTop : e.pageY;
+ var el = l.getElement();
+ var x = parseInt(el.style.left);
+ var y = parseInt(el.style.top);
+ var w = parseInt(el.offsetWidth);
+ var h = parseInt(el.offsetHeight);
+
+ if (!(mx > x && mx < x + w && my > y && my < y + h)) {
+ MCLayer.visibleLayer = null;
+
+ if (l.autoHideCallback && l.autoHideCallback(l, e, mx, my))
+ return true;
+
+ l.hide();
+ }
+ }
+ },
+
+ addCSSClass : function(e, c) {
+ this.removeCSSClass(e, c);
+ var a = this.explode(' ', e.className);
+ a[a.length] = c;
+ e.className = a.join(' ');
+ },
+
+ removeCSSClass : function(e, c) {
+ var a = this.explode(' ', e.className), i;
+
+ for (i=0; i<a.length; i++) {
+ if (a[i] == c)
+ a[i] = '';
+ }
+
+ e.className = a.join(' ');
+ },
+
+ explode : function(d, s) {
+ var ar = s.split(d);
+ var oar = new Array();
+
+ for (var i = 0; i<ar.length; i++) {
+ if (ar[i] != "")
+ oar[oar.length] = ar[i];
+ }
+
+ return oar;
+ },
+
+ parseInt : function(s) {
+ if (s == null || s == '')
+ return 0;
+
+ return parseInt(s);
+ }
+}
diff --git a/wp-includes/js/tinymce/utils/mctabs.js b/wp-includes/js/tinymce/utils/mctabs.js
index 1ece6d2..1351806 100644
--- a/wp-includes/js/tinymce/utils/mctabs.js
+++ b/wp-includes/js/tinymce/utils/mctabs.js
@@ -1,74 +1,76 @@
-/**
- * $Id: mctabs.js 520 2008-01-07 16:30:32Z spocke $
- *
- * Moxiecode DHTML Tabs script.
- *
- * @author Moxiecode
- * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
- */
-
-function MCTabs() {
- this.settings = new Array();
-};
-
-MCTabs.prototype.init = function(settings) {
- this.settings = settings;
-};
-
-MCTabs.prototype.getParam = function(name, default_value) {
- var value = null;
-
- value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
-
- // Fix bool values
- if (value == "true" || value == "false")
- return (value == "true");
-
- return value;
-};
-
-MCTabs.prototype.displayTab = function(tab_id, panel_id) {
- var panelElm = document.getElementById(panel_id);
- var panelContainerElm = panelElm ? panelElm.parentNode : null;
- var tabElm = document.getElementById(tab_id);
- var tabContainerElm = tabElm ? tabElm.parentNode : null;
- var selectionClass = this.getParam('selection_class', 'current');
-
- if (tabElm && tabContainerElm) {
- var nodes = tabContainerElm.childNodes;
-
- // Hide all other tabs
- for (var i=0; i<nodes.length; i++) {
- if (nodes[i].nodeName == "LI")
- nodes[i].className = '';
- }
-
- // Show selected tab
- tabElm.className = 'current';
- }
-
- if (panelElm && panelContainerElm) {
- var nodes = panelContainerElm.childNodes;
-
- // Hide all other panels
- for (var i=0; i<nodes.length; i++) {
- if (nodes[i].nodeName == "DIV")
- nodes[i].className = 'panel';
- }
-
- // Show selected panel
- panelElm.className = 'current';
- }
-};
-
-MCTabs.prototype.getAnchor = function() {
- var pos, url = document.location.href;
-
- if ((pos = url.lastIndexOf('#')) != -1)
- return url.substring(pos + 1);
-
- return "";
-};
-
-// Global instance
-var mcTabs = new MCTabs();
+/**
+ * $Id: mctabs.js 758 2008-03-30 13:53:29Z spocke $
+ *
+ * Moxiecode DHTML Tabs script.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+function MCTabs() {
+ this.settings = [];
+};
+
+MCTabs.prototype.init = function(settings) {
+ this.settings = settings;
+};
+
+MCTabs.prototype.getParam = function(name, default_value) {
+ var value = null;
+
+ value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
+
+ // Fix bool values
+ if (value == "true" || value == "false")
+ return (value == "true");
+
+ return value;
+};
+
+MCTabs.prototype.displayTab = function(tab_id, panel_id) {
+ var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i;
+
+ panelElm= document.getElementById(panel_id);
+ panelContainerElm = panelElm ? panelElm.parentNode : null;
+ tabElm = document.getElementById(tab_id);
+ tabContainerElm = tabElm ? tabElm.parentNode : null;
+ selectionClass = this.getParam('selection_class', 'current');
+
+ if (tabElm && tabContainerElm) {
+ nodes = tabContainerElm.childNodes;
+
+ // Hide all other tabs
+ for (i = 0; i < nodes.length; i++) {
+ if (nodes[i].nodeName == "LI")
+ nodes[i].className = '';
+ }
+
+ // Show selected tab
+ tabElm.className = 'current';
+ }
+
+ if (panelElm && panelContainerElm) {
+ nodes = panelContainerElm.childNodes;
+
+ // Hide all other panels
+ for (i = 0; i < nodes.length; i++) {
+ if (nodes[i].nodeName == "DIV")
+ nodes[i].className = 'panel';
+ }
+
+ // Show selected panel
+ panelElm.className = 'current';
+ }
+};
+
+MCTabs.prototype.getAnchor = function() {
+ var pos, url = document.location.href;
+
+ if ((pos = url.lastIndexOf('#')) != -1)
+ return url.substring(pos + 1);
+
+ return "";
+};
+
+// Global instance
+var mcTabs = new MCTabs();
diff --git a/wp-includes/js/tinymce/utils/validate.js b/wp-includes/js/tinymce/utils/validate.js
index 26d426a..3fcd639 100644
--- a/wp-includes/js/tinymce/utils/validate.js
+++ b/wp-includes/js/tinymce/utils/validate.js
@@ -1,219 +1,219 @@
-/**
- * $Id: validate.js 673 2008-03-06 13:26:20Z spocke $
- *
- * Various form validation methods.
- *
- * @author Moxiecode
- * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
- */
-
-/**
- // String validation:
-
- if (!Validator.isEmail('myemail'))
- alert('Invalid email.');
-
- // Form validation:
-
- var f = document.forms['myform'];
-
- if (!Validator.isEmail(f.myemail))
- alert('Invalid email.');
-*/
-
-var Validator = {
- isEmail : function(s) {
- return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
- },
-
- isAbsUrl : function(s) {
- return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');
- },
-
- isSize : function(s) {
- return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
- },
-
- isId : function(s) {
- return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');
- },
-
- isEmpty : function(s) {
- var nl, i;
-
- if (s.nodeName == 'SELECT' && s.selectedIndex < 1)
- return true;
-
- if (s.type == 'checkbox' && !s.checked)
- return true;
-
- if (s.type == 'radio') {
- for (i=0, nl = s.form.elements; i<nl.length; i++) {
- if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)
- return false;
- }
-
- return true;
- }
-
- return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);
- },
-
- isNumber : function(s, d) {
- return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));
- },
-
- test : function(s, p) {
- s = s.nodeType == 1 ? s.value : s;
-
- return s == '' || new RegExp(p).test(s);
- }
-};
-
-var AutoValidator = {
- settings : {
- id_cls : 'id',
- int_cls : 'int',
- url_cls : 'url',
- number_cls : 'number',
- email_cls : 'email',
- size_cls : 'size',
- required_cls : 'required',
- invalid_cls : 'invalid',
- min_cls : 'min',
- max_cls : 'max'
- },
-
- init : function(s) {
- var n;
-
- for (n in s)
- this.settings[n] = s[n];
- },
-
- validate : function(f) {
- var i, nl, s = this.settings, c = 0;
-
- nl = this.tags(f, 'label');
- for (i=0; i<nl.length; i++)
- this.removeClass(nl[i], s.invalid_cls);
-
- c += this.validateElms(f, 'input');
- c += this.validateElms(f, 'select');
- c += this.validateElms(f, 'textarea');
-
- return c == 3;
- },
-
- invalidate : function(n) {
- this.mark(n.form, n);
- },
-
- reset : function(e) {
- var t = new Array('label', 'input', 'select', 'textarea');
- var i, j, nl, s = this.settings;
-
- if (e == null)
- return;
-
- for (i=0; i<t.length; i++) {
- nl = this.tags(e.form ? e.form : e, t[i]);
- for (j=0; j<nl.length; j++)
- this.removeClass(nl[j], s.invalid_cls);
- }
- },
-
- validateElms : function(f, e) {
- var nl, i, n, s = this.settings, st = true, va = Validator, v;
-
- nl = this.tags(f, e);
- for (i=0; i<nl.length; i++) {
- n = nl[i];
-
- this.removeClass(n, s.invalid_cls);
-
- if (this.hasClass(n, s.required_cls) && va.isEmpty(n))
- st = this.mark(f, n);
-
- if (this.hasClass(n, s.number_cls) && !va.isNumber(n))
- st = this.mark(f, n);
-
- if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))
- st = this.mark(f, n);
-
- if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))
- st = this.mark(f, n);
-
- if (this.hasClass(n, s.email_cls) && !va.isEmail(n))
- st = this.mark(f, n);
-
- if (this.hasClass(n, s.size_cls) && !va.isSize(n))
- st = this.mark(f, n);
-
- if (this.hasClass(n, s.id_cls) && !va.isId(n))
- st = this.mark(f, n);
-
- if (this.hasClass(n, s.min_cls, true)) {
- v = this.getNum(n, s.min_cls);
-
- if (isNaN(v) || parseInt(n.value) < parseInt(v))
- st = this.mark(f, n);
- }
-
- if (this.hasClass(n, s.max_cls, true)) {
- v = this.getNum(n, s.max_cls);
-
- if (isNaN(v) || parseInt(n.value) > parseInt(v))
- st = this.mark(f, n);
- }
- }
-
- return st;
- },
-
- hasClass : function(n, c, d) {
- return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);
- },
-
- getNum : function(n, c) {
- c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];
- c = c.replace(/[^0-9]/g, '');
-
- return c;
- },
-
- addClass : function(n, c, b) {
- var o = this.removeClass(n, c);
- n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
- },
-
- removeClass : function(n, c) {
- c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
- return n.className = c != ' ' ? c : '';
- },
-
- tags : function(f, s) {
- return f.getElementsByTagName(s);
- },
-
- mark : function(f, n) {
- var s = this.settings;
-
- this.addClass(n, s.invalid_cls);
- this.markLabels(f, n, s.invalid_cls);
-
- return false;
- },
-
- markLabels : function(f, n, ic) {
- var nl, i;
-
- nl = this.tags(f, "label");
- for (i=0; i<nl.length; i++) {
- if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)
- this.addClass(nl[i], ic);
- }
-
- return null;
- }
-};
+/**
+ * $Id: validate.js 758 2008-03-30 13:53:29Z spocke $
+ *
+ * Various form validation methods.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+/**
+ // String validation:
+
+ if (!Validator.isEmail('myemail'))
+ alert('Invalid email.');
+
+ // Form validation:
+
+ var f = document.forms['myform'];
+
+ if (!Validator.isEmail(f.myemail))
+ alert('Invalid email.');
+*/
+
+var Validator = {
+ isEmail : function(s) {
+ return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
+ },
+
+ isAbsUrl : function(s) {
+ return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');
+ },
+
+ isSize : function(s) {
+ return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
+ },
+
+ isId : function(s) {
+ return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');
+ },
+
+ isEmpty : function(s) {
+ var nl, i;
+
+ if (s.nodeName == 'SELECT' && s.selectedIndex < 1)
+ return true;
+
+ if (s.type == 'checkbox' && !s.checked)
+ return true;
+
+ if (s.type == 'radio') {
+ for (i=0, nl = s.form.elements; i<nl.length; i++) {
+ if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)
+ return false;
+ }
+
+ return true;
+ }
+
+ return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);
+ },
+
+ isNumber : function(s, d) {
+ return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));
+ },
+
+ test : function(s, p) {
+ s = s.nodeType == 1 ? s.value : s;
+
+ return s == '' || new RegExp(p).test(s);
+ }
+};
+
+var AutoValidator = {
+ settings : {
+ id_cls : 'id',
+ int_cls : 'int',
+ url_cls : 'url',
+ number_cls : 'number',
+ email_cls : 'email',
+ size_cls : 'size',
+ required_cls : 'required',
+ invalid_cls : 'invalid',
+ min_cls : 'min',
+ max_cls : 'max'
+ },
+
+ init : function(s) {
+ var n;
+
+ for (n in s)
+ this.settings[n] = s[n];
+ },
+
+ validate : function(f) {
+ var i, nl, s = this.settings, c = 0;
+
+ nl = this.tags(f, 'label');
+ for (i=0; i<nl.length; i++)
+ this.removeClass(nl[i], s.invalid_cls);
+
+ c += this.validateElms(f, 'input');
+ c += this.validateElms(f, 'select');
+ c += this.validateElms(f, 'textarea');
+
+ return c == 3;
+ },
+
+ invalidate : function(n) {
+ this.mark(n.form, n);
+ },
+
+ reset : function(e) {
+ var t = ['label', 'input', 'select', 'textarea'];
+ var i, j, nl, s = this.settings;
+
+ if (e == null)
+ return;
+
+ for (i=0; i<t.length; i++) {
+ nl = this.tags(e.form ? e.form : e, t[i]);
+ for (j=0; j<nl.length; j++)
+ this.removeClass(nl[j], s.invalid_cls);
+ }
+ },
+
+ validateElms : function(f, e) {
+ var nl, i, n, s = this.settings, st = true, va = Validator, v;
+
+ nl = this.tags(f, e);
+ for (i=0; i<nl.length; i++) {
+ n = nl[i];
+
+ this.removeClass(n, s.invalid_cls);
+
+ if (this.hasClass(n, s.required_cls) && va.isEmpty(n))
+ st = this.mark(f, n);
+
+ if (this.hasClass(n, s.number_cls) && !va.isNumber(n))
+ st = this.mark(f, n);
+
+ if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))
+ st = this.mark(f, n);
+
+ if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))
+ st = this.mark(f, n);
+
+ if (this.hasClass(n, s.email_cls) && !va.isEmail(n))
+ st = this.mark(f, n);
+
+ if (this.hasClass(n, s.size_cls) && !va.isSize(n))
+ st = this.mark(f, n);
+
+ if (this.hasClass(n, s.id_cls) && !va.isId(n))
+ st = this.mark(f, n);
+
+ if (this.hasClass(n, s.min_cls, true)) {
+ v = this.getNum(n, s.min_cls);
+
+ if (isNaN(v) || parseInt(n.value) < parseInt(v))
+ st = this.mark(f, n);
+ }
+
+ if (this.hasClass(n, s.max_cls, true)) {
+ v = this.getNum(n, s.max_cls);
+
+ if (isNaN(v) || parseInt(n.value) > parseInt(v))
+ st = this.mark(f, n);
+ }
+ }
+
+ return st;
+ },
+
+ hasClass : function(n, c, d) {
+ return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);
+ },
+
+ getNum : function(n, c) {
+ c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];
+ c = c.replace(/[^0-9]/g, '');
+
+ return c;
+ },
+
+ addClass : function(n, c, b) {
+ var o = this.removeClass(n, c);
+ n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
+ },
+
+ removeClass : function(n, c) {
+ c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
+ return n.className = c != ' ' ? c : '';
+ },
+
+ tags : function(f, s) {
+ return f.getElementsByTagName(s);
+ },
+
+ mark : function(f, n) {
+ var s = this.settings;
+
+ this.addClass(n, s.invalid_cls);
+ this.markLabels(f, n, s.invalid_cls);
+
+ return false;
+ },
+
+ markLabels : function(f, n, ic) {
+ var nl, i;
+
+ nl = this.tags(f, "label");
+ for (i=0; i<nl.length; i++) {
+ if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)
+ this.addClass(nl[i], ic);
+ }
+
+ return null;
+ }
+};
diff --git a/wp-includes/js/tinymce/wp-mce-help.php b/wp-includes/js/tinymce/wp-mce-help.php
index d462b95..5c3bf14 100644
--- a/wp-includes/js/tinymce/wp-mce-help.php
+++ b/wp-includes/js/tinymce/wp-mce-help.php
@@ -1,4 +1,4 @@
-<?php require_once('../../../wp-config.php');
+<?php require_once('../../../wp-load.php');
header('Content-Type: text/html; charset=' . get_bloginfo('charset'));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -6,10 +6,10 @@ header('Content-Type: text/html; charset=' . get_bloginfo('charset'));
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
<title><?php _e('Rich Editor Help') ?></title>
-<script type="text/javascript" src="tiny_mce_popup.js"></script>
+<script type="text/javascript" src="tiny_mce_popup.js?ver=3091"></script>
<?php
-wp_admin_css( 'css/global' );
-wp_admin_css();
+wp_admin_css( 'global', true );
+wp_admin_css( 'wp-admin', true );
?>
<style type="text/css">
#wphead {
diff --git a/wp-includes/kses.php b/wp-includes/kses.php
index 3c5688e..1c9a0d7 100644
--- a/wp-includes/kses.php
+++ b/wp-includes/kses.php
@@ -189,8 +189,10 @@ if (!CUSTOM_TAGS) {
'class' => array (),
'dir' => array (),
'align' => array (),
+ 'lang' => array (),
'style' => array (),
- 'title' => array ()),
+ 'title' => array (),
+ 'xml:lang' => array()),
'strike' => array(),
'strong' => array(),
'sub' => array(),
diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php
index 0584f9d..f48a4c9 100644
--- a/wp-includes/l10n.php
+++ b/wp-includes/l10n.php
@@ -38,7 +38,7 @@ function get_locale() {
$locale = WPLANG;
if (empty($locale))
- $locale = '';
+ $locale = 'en_US';
$locale = apply_filters('locale', $locale);
@@ -263,8 +263,6 @@ function load_textdomain($domain, $mofile) {
*/
function load_default_textdomain() {
$locale = get_locale();
- if ( empty($locale) )
- $locale = 'en_US';
$mofile = ABSPATH . LANGDIR . "/$locale.mo";
@@ -278,26 +276,24 @@ function load_default_textdomain() {
* directory. The .mo file should be named based on the domain with a
* dash followed by a dash, and then the locale exactly.
*
- * The plugin may place all of the .mo files in another folder and set
- * the $path based on the relative location from ABSPATH constant. The
- * plugin may use the constant PLUGINDIR and/or plugin_basename() to
- * get path of the plugin and then add the folder which holds the .mo
- * files.
- *
* @since 1.5.0
*
* @param string $domain Unique identifier for retrieving translated strings
- * @param string $path Optional. Path of the folder where the .mo files reside.
+ * @param string $abs_rel_path Optional. Relative path to ABSPATH of a folder,
+ * where the .mo file resides. Deprecated, but still functional until 2.7
+ * @param string $plugin_rel_path Optional. Relative path to WP_PLUGIN_DIR. This is the preferred argument to use. It takes precendence over $abs_rel_path
*/
-function load_plugin_textdomain($domain, $path = false) {
+function load_plugin_textdomain($domain, $abs_rel_path = false, $plugin_rel_path = false) {
$locale = get_locale();
- if ( empty($locale) )
- $locale = 'en_US';
-
- if ( false === $path )
- $path = PLUGINDIR;
+
+ if ( false !== $plugin_rel_path )
+ $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/');
+ else if ( false !== $abs_rel_path)
+ $path = ABSPATH . trim( $abs_rel_path, '/');
+ else
+ $path = WP_PLUGIN_DIR;
- $mofile = ABSPATH . "$path/$domain-$locale.mo";
+ $mofile = $path . '/'. $domain . '-' . $locale . '.mo';
load_textdomain($domain, $mofile);
}
@@ -315,8 +311,6 @@ function load_plugin_textdomain($domain, $path = false) {
*/
function load_theme_textdomain($domain) {
$locale = get_locale();
- if ( empty($locale) )
- $locale = 'en_US';
$mofile = get_template_directory() . "/$locale.mo";
load_textdomain($domain, $mofile);
diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php
index 92f57e4..edfb5f1 100644
--- a/wp-includes/link-template.php
+++ b/wp-includes/link-template.php
@@ -442,10 +442,15 @@ function get_search_comments_feed_link($search_query = '', $feed = '') {
return $link;
}
-function get_edit_post_link( $id = 0 ) {
+function get_edit_post_link( $id = 0, $context = 'display' ) {
if ( !$post = &get_post( $id ) )
return;
+ if ( 'display' == $context )
+ $action = 'action=edit&amp;';
+ else
+ $action = 'action=edit&';
+
switch ( $post->post_type ) :
case 'page' :
if ( !current_user_can( 'edit_page', $post->ID ) )
@@ -459,6 +464,13 @@ function get_edit_post_link( $id = 0 ) {
$file = 'media';
$var = 'attachment_id';
break;
+ case 'revision' :
+ if ( !current_user_can( 'edit_post', $post->ID ) )
+ return;
+ $file = 'revision';
+ $var = 'revision';
+ $action = '';
+ break;
default :
if ( !current_user_can( 'edit_post', $post->ID ) )
return;
@@ -467,7 +479,7 @@ function get_edit_post_link( $id = 0 ) {
break;
endswitch;
- return apply_filters( 'get_edit_post_link', get_bloginfo( 'wpurl' ) . "/wp-admin/$file.php?action=edit&amp;$var=$post->ID", $post->ID );
+ return apply_filters( 'get_edit_post_link', get_bloginfo( 'wpurl' ) . "/wp-admin/$file.php?{$action}$var=$post->ID", $post->ID );
}
function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) {
@@ -730,4 +742,80 @@ function posts_nav_link($sep=' &#8212; ', $prelabel='&laquo; Previous Page', $nx
}
}
+function get_shortcut_link() {
+ $link = "javascript:
+ var d=document;
+ var w=window;
+ var e=w.getSelection;
+ var k=d.getSelection;
+ var x=d.selection;
+ var s=(e?e():(k)?k():(x?x.createRange().text:0));
+ var f='" . admin_url('press-this.php') . "';
+ var l=d.location;
+ var e=encodeURIComponent;
+ var u= '?u=' + e(l.href);
+ var t= '&t=' + e(d.title);
+ var s= '&s=' + e(s);
+ var v='&v=1';
+ var g= f+u+t+s+v;
+ function a(){
+ if(!w.open(g,'t','toolbar=0,resizable=0,scrollbars=1,status=1,width=700,height=500')){
+ l.href=g;
+ }
+ }
+ if(/Firefox/.test(navigator.userAgent)){
+ setTimeout(a,0);
+ }else{
+ a();
+ }
+ void(0);";
+
+ $link = str_replace(array("\r", "\n", "\t"), '', $link);
+
+ return apply_filters('shortcut_link', $link);
+}
+
+// return the site_url option, using https if is_ssl() is true
+// if $scheme is 'http' or 'https' it will override is_ssl()
+function site_url($path = '', $scheme = null) {
+ // should the list of allowed schemes be maintained elsewhere?
+ if ( !in_array($scheme, array('http', 'https')) ) {
+ if ( ('login' == $scheme) && ( force_ssl_login() || force_ssl_admin() ) )
+ $scheme = 'https';
+ elseif ( ('admin' == $scheme) && force_ssl_admin() )
+ $scheme = 'https';
+ else
+ $scheme = ( is_ssl() ? 'https' : 'http' );
+ }
+
+ $url = str_replace( 'http://', "{$scheme}://", get_option('siteurl') );
+
+ if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
+ $url .= '/' . ltrim($path, '/');
+
+ return $url;
+}
+
+function admin_url($path = '') {
+ global $_wp_admin_url;
+
+ $url = site_url('wp-admin/', 'admin');
+
+ if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
+ $url .= ltrim($path, '/');
+
+ return $url;
+}
+
+function includes_url($path = '') {
+ global $_wp_includes_url;
+
+ $url = site_url() . '/' . WPINC . '/';
+
+ if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
+ $url .= ltrim($path, '/');
+
+ return $url;
+}
+
?>
diff --git a/wp-includes/media.php b/wp-includes/media.php
index dc7da3a..fd4b0a2 100644
--- a/wp-includes/media.php
+++ b/wp-includes/media.php
@@ -325,7 +325,7 @@ function wp_get_attachment_image_src($attachment_id, $size='thumbnail', $icon =
return $image;
if ( $icon && $src = wp_mime_type_icon($attachment_id) ) {
- $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' );
+ $icon_dir = apply_filters( 'icon_dir', includes_url('images/crystal') );
$src_file = $icon_dir . '/' . basename($src);
@list($width, $height) = getimagesize($src_file);
}
@@ -368,7 +368,8 @@ function gallery_shortcode($attr) {
}
extract(shortcode_atts(array(
- 'orderby' => 'menu_order ASC, ID ASC',
+ 'order' => 'ASC',
+ 'orderby' => 'menu_order ID',
'id' => $post->ID,
'itemtag' => 'dl',
'icontag' => 'dt',
@@ -378,7 +379,7 @@ function gallery_shortcode($attr) {
), $attr));
$id = intval($id);
- $attachments = get_children("post_parent=$id&post_type=attachment&post_mime_type=image&orderby={$orderby}");
+ $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
if ( empty($attachments) )
return '';
@@ -452,7 +453,7 @@ function next_image_link() {
function adjacent_image_link($prev = true) {
global $post;
$post = get_post($post);
- $attachments = array_values(get_children("post_parent=$post->post_parent&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC"));
+ $attachments = array_values(get_children( array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ));
foreach ( $attachments as $k => $attachment )
if ( $attachment->ID == $post->ID )
diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php
index be7dda2..325f9d7 100644
--- a/wp-includes/pluggable.php
+++ b/wp-includes/pluggable.php
@@ -100,8 +100,10 @@ function get_currentuserinfo() {
return;
if ( ! $user = wp_validate_auth_cookie() ) {
- wp_set_current_user(0);
- return false;
+ if ( empty($_COOKIE[LOGGED_IN_COOKIE]) || !$user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in') ) {
+ wp_set_current_user(0);
+ return false;
+ }
}
wp_set_current_user($user);
@@ -471,13 +473,22 @@ if ( !function_exists('wp_validate_auth_cookie') ) :
* @since 2.5
*
* @param string $cookie Optional. If used, will validate contents instead of cookie's
+ * @param string $scheme Optional. The cookie scheme to use: auth, secure_auth, or logged_in
* @return bool|int False if invalid cookie, User ID if valid.
*/
-function wp_validate_auth_cookie($cookie = '') {
+function wp_validate_auth_cookie($cookie = '', $scheme = 'auth') {
if ( empty($cookie) ) {
- if ( empty($_COOKIE[AUTH_COOKIE]) )
+ if ( is_ssl() ) {
+ $cookie_name = SECURE_AUTH_COOKIE;
+ $scheme = 'secure_auth';
+ } else {
+ $cookie_name = AUTH_COOKIE;
+ $scheme = 'auth';
+ }
+
+ if ( empty($_COOKIE[$cookie_name]) )
return false;
- $cookie = $_COOKIE[AUTH_COOKIE];
+ $cookie = $_COOKIE[$cookie_name];
}
$cookie_elements = explode('|', $cookie);
@@ -496,7 +507,7 @@ function wp_validate_auth_cookie($cookie = '') {
if ( $expired < time() )
return false;
- $key = wp_hash($username . '|' . $expiration);
+ $key = wp_hash($username . '|' . $expiration, $scheme);
$hash = hash_hmac('md5', $username . '|' . $expiration, $key);
if ( $hmac != $hash )
@@ -520,17 +531,18 @@ if ( !function_exists('wp_generate_auth_cookie') ) :
*
* @param int $user_id User ID
* @param int $expiration Cookie expiration in seconds
+ * @param string $scheme Optional. The cookie scheme to use: auth, secure_auth, or logged_in
* @return string Authentication cookie contents
*/
-function wp_generate_auth_cookie($user_id, $expiration) {
+function wp_generate_auth_cookie($user_id, $expiration, $scheme = 'auth') {
$user = get_userdata($user_id);
- $key = wp_hash($user->user_login . '|' . $expiration);
+ $key = wp_hash($user->user_login . '|' . $expiration, $scheme);
$hash = hash_hmac('md5', $user->user_login . '|' . $expiration, $key);
$cookie = $user->user_login . '|' . $expiration . '|' . $hash;
- return apply_filters('auth_cookie', $cookie, $user_id, $expiration);
+ return apply_filters('auth_cookie', $cookie, $user_id, $expiration, $scheme);
}
endif;
@@ -548,7 +560,7 @@ if ( !function_exists('wp_set_auth_cookie') ) :
* @param int $user_id User ID
* @param bool $remember Whether to remember the user or not
*/
-function wp_set_auth_cookie($user_id, $remember = false) {
+function wp_set_auth_cookie($user_id, $remember = false, $secure = '') {
if ( $remember ) {
$expiration = $expire = time() + 1209600;
} else {
@@ -556,13 +568,27 @@ function wp_set_auth_cookie($user_id, $remember = false) {
$expire = 0;
}
- $cookie = wp_generate_auth_cookie($user_id, $expiration);
+ if ( '' === $secure )
+ $secure = is_ssl() ? true : false;
+
+ if ( $secure ) {
+ $auth_cookie_name = SECURE_AUTH_COOKIE;
+ $scheme = 'secure_auth';
+ } else {
+ $auth_cookie_name = AUTH_COOKIE;
+ $scheme = 'auth';
+ }
+
+ $auth_cookie = wp_generate_auth_cookie($user_id, $expiration, $scheme);
+ $logged_in_cookie = wp_generate_auth_cookie($user_id, $expiration, 'logged_in');
- do_action('set_auth_cookie', $cookie, $expire);
+ do_action('set_auth_cookie', $auth_cookie, $expire, $scheme);
+ do_action('set_auth_cookie', $logged_in_cookie, $expire, 'logged_in');
- setcookie(AUTH_COOKIE, $cookie, $expire, COOKIEPATH, COOKIE_DOMAIN);
+ setcookie($auth_cookie_name, $auth_cookie, $expire, SITECOOKIEPATH . 'wp-admin', COOKIE_DOMAIN, $secure);
+ setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN);
if ( COOKIEPATH != SITECOOKIEPATH )
- setcookie(AUTH_COOKIE, $cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN);
+ setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN);
}
endif;
@@ -573,8 +599,12 @@ if ( !function_exists('wp_clear_auth_cookie') ) :
* @since 2.5
*/
function wp_clear_auth_cookie() {
- setcookie(AUTH_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);
- setcookie(AUTH_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);
+ setcookie(AUTH_COOKIE, ' ', time() - 31536000, COOKIEPATH . 'wp-admin', COOKIE_DOMAIN);
+ setcookie(AUTH_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH . 'wp-admin', COOKIE_DOMAIN);
+ setcookie(SECURE_AUTH_COOKIE, ' ', time() - 31536000, COOKIEPATH . 'wp-admin', COOKIE_DOMAIN);
+ setcookie(SECURE_AUTH_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH . 'wp-admin', COOKIE_DOMAIN);
+ setcookie(LOGGED_IN_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);
+ setcookie(LOGGED_IN_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);
// Old cookies
setcookie(USER_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);
@@ -610,15 +640,38 @@ if ( !function_exists('auth_redirect') ) :
*/
function auth_redirect() {
// Checks if a user is logged in, if not redirects them to the login page
- if ( (!empty($_COOKIE[AUTH_COOKIE]) &&
- !wp_validate_auth_cookie($_COOKIE[AUTH_COOKIE])) ||
- (empty($_COOKIE[AUTH_COOKIE])) ) {
- nocache_headers();
- wp_clearcookie();
-
- wp_redirect(get_option('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']));
- exit();
+
+ if ( is_ssl() || force_ssl_admin() )
+ $secure = true;
+ else
+ $secure = false;
+
+ // If https is required and request is http, redirect
+ if ( $secure && !is_ssl() ) {
+ if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
+ wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));
+ exit();
+ } else {
+ wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
+ exit();
+ }
}
+
+ if ( wp_validate_auth_cookie() )
+ return; // The cookie is good so we're done
+
+ // The cookie is no good so force login
+ nocache_headers();
+
+ if ( is_ssl() )
+ $proto = 'https://';
+ else
+ $proto = 'http://';
+
+ $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode($proto . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']), 'login' );
+
+ wp_redirect($login_url);
+ exit();
}
endif;
@@ -633,7 +686,7 @@ if ( !function_exists('check_admin_referer') ) :
* @param string $query_arg where to look for nonce in $_REQUEST (since 2.5)
*/
function check_admin_referer($action = -1, $query_arg = '_wpnonce') {
- $adminurl = strtolower(get_option('siteurl')).'/wp-admin';
+ $adminurl = strtolower(admin_url());
$referer = strtolower(wp_get_referer());
$result = wp_verify_nonce($_REQUEST[$query_arg], $action);
if ( !$result && !(-1 == $action && strpos($referer, $adminurl) !== false) ) {
@@ -763,7 +816,7 @@ function wp_safe_redirect($location, $status = 302) {
$allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '');
if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) )
- $location = get_option('siteurl') . '/wp-admin/';
+ $location = admin_url();
wp_redirect($location, $status);
}
@@ -817,8 +870,8 @@ function wp_notify_postauthor($comment_id, $comment_type='') {
$subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title );
}
$notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
- $notify_message .= sprintf( __('Delete it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";
- $notify_message .= sprintf( __('Spam it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";
+ $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=cdc&c=$comment_id") ) . "\r\n";
+ $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=cdc&dt=spam&c=$comment_id") ) . "\r\n";
$wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));
@@ -897,13 +950,13 @@ function wp_notify_moderator($comment_id) {
break;
}
- $notify_message .= sprintf( __('Approve it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n";
- $notify_message .= sprintf( __('Delete it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";
- $notify_message .= sprintf( __('Spam it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";
+ $notify_message .= sprintf( __('Approve it: %s'), admin_url("comment.php?action=mac&c=$comment_id") ) . "\r\n";
+ $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=cdc&c=$comment_id") ) . "\r\n";
+ $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=cdc&dt=spam&c=$comment_id") ) . "\r\n";
- $strCommentsPending = sprintf( __ngettext('%s comment', '%s comments', $comments_waiting), $comments_waiting );
- $notify_message .= sprintf( __('Currently %s are waiting for approval. Please visit the moderation panel:'), $strCommentsPending ) . "\r\n";
- $notify_message .= get_option('siteurl') . "/wp-admin/edit-comments.php?comment_status=moderated\r\n";
+ $notify_message .= sprintf( __ngettext('Currently %s comment is waiting for approval. Please visit the moderation panel:',
+ 'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting), number_format_i18n($comments_waiting) ) . "\r\n";
+ $notify_message .= admin_url("edit-comments.php?comment_status=moderated") . "\r\n";
$subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_option('blogname'), $post->post_title );
$admin_email = get_option('admin_email');
@@ -943,7 +996,7 @@ function wp_new_user_notification($user_id, $plaintext_pass = '') {
$message = sprintf(__('Username: %s'), $user_login) . "\r\n";
$message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
- $message .= get_option('siteurl') . "/wp-login.php\r\n";
+ $message .= site_url("wp-login.php", 'login') . "\r\n";
wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $message);
@@ -1050,23 +1103,56 @@ if ( !function_exists('wp_salt') ) :
*
* @return string Salt value from either 'SECRET_KEY' or 'secret' option
*/
-function wp_salt() {
+function wp_salt($scheme = 'auth') {
global $wp_default_secret_key;
$secret_key = '';
if ( defined('SECRET_KEY') && ('' != SECRET_KEY) && ( $wp_default_secret_key != SECRET_KEY) )
$secret_key = SECRET_KEY;
- if ( defined('SECRET_SALT') ) {
- $salt = SECRET_SALT;
- } else {
- $salt = get_option('secret');
- if ( empty($salt) ) {
- $salt = wp_generate_password();
- update_option('secret', $salt);
+ if ( 'auth' == $scheme ) {
+ if ( defined('AUTH_KEY') && ('' != AUTH_KEY) && ( $wp_default_secret_key != AUTH_KEY) )
+ $secret_key = AUTH_KEY;
+
+ if ( defined('AUTH_SALT') ) {
+ $salt = AUTH_SALT;
+ } elseif ( defined('SECRET_SALT') ) {
+ $salt = SECRET_SALT;
+ } else {
+ $salt = get_option('auth_salt');
+ if ( empty($salt) ) {
+ $salt = wp_generate_password();
+ update_option('auth_salt', $salt);
+ }
+ }
+ } elseif ( 'secure_auth' == $scheme ) {
+ if ( defined('SECURE_AUTH_KEY') && ('' != SECURE_AUTH_KEY) && ( $wp_default_secret_key != SECURE_AUTH_KEY) )
+ $secret_key = SECURE_AUTH_KEY;
+
+ if ( defined('SECURE_AUTH_SALT') ) {
+ $salt = SECRET_AUTH_SALT;
+ } else {
+ $salt = get_option('secure_auth_salt');
+ if ( empty($salt) ) {
+ $salt = wp_generate_password();
+ update_option('secure_auth_salt', $salt);
+ }
+ }
+ } elseif ( 'logged_in' == $scheme ) {
+ if ( defined('LOGGED_IN_KEY') && ('' != LOGGED_IN_KEY) && ( $wp_default_secret_key != LOGGED_IN_KEY) )
+ $secret_key = LOGGED_IN_KEY;
+
+ if ( defined('LOGGED_IN_SALT') ) {
+ $salt = LOGGED_IN_SALT;
+ } else {
+ $salt = get_option('logged_in_salt');
+ if ( empty($salt) ) {
+ $salt = wp_generate_password();
+ update_option('logged_in_salt', $salt);
+ }
}
}
- return apply_filters('salt', $secret_key . $salt);
+ return apply_filters('salt', $secret_key . $salt, $scheme);
}
endif;
@@ -1080,8 +1166,8 @@ if ( !function_exists('wp_hash') ) :
* @param string $data Plain text to hash
* @return string Hash of $data
*/
-function wp_hash($data) {
- $salt = wp_salt();
+function wp_hash($data, $scheme = 'auth') {
+ $salt = wp_salt($scheme);
return hash_hmac('md5', $data, $salt);
}
@@ -1250,8 +1336,26 @@ function get_avatar( $id_or_email, $size = '96', $default = '' ) {
$email = $id_or_email;
}
- if ( empty($default) )
- $default = "http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=$size"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com')
+ if ( empty($default) ) {
+ $avatar_default = get_option('avatar_default');
+ if ( empty($avatar_default) )
+ $default = 'mystery';
+ else
+ $default = $avatar_default;
+ }
+
+ if ( 'custom' == $default )
+ $default = add_query_arg( 's', $size, $defaults[$avatar_default][1] );
+ elseif ( 'mystery' == $default )
+ $default = "http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s={$size}"; // ad516503a11cd5ca435acc9bb6523536 == md5('unknown@gravatar.com')
+ elseif ( 'blank' == $default )
+ $default = includes_url('images/blank.gif');
+ elseif ( !empty($email) && 'gravatar_default' == $default )
+ $default = '';
+ elseif ( 'gravatar_default' == $default )
+ $default = "http://www.gravatar.com/avatar/s={$size}";
+ elseif ( empty($email) )
+ $default = "http://www.gravatar.com/avatar/?d=$default&amp;s={$size}";
if ( !empty($email) ) {
$out = 'http://www.gravatar.com/avatar/';
@@ -1360,4 +1464,78 @@ function wp_login($username, $password, $deprecated = '') {
}
endif;
+if ( !function_exists( 'wp_text_diff' ) ) :
+/**
+ * wp_text_diff() - compares two strings and outputs a human readable HTML representation of their difference
+ *
+ * Basically a wrapper for man diff(1)
+ *
+ * Must accept an optional third parameter, $args @see wp_parse_args()
+ * (string) title: optional. If present, titles the diff in a manner compatible with the output
+ *
+ * Must return the empty string if the two compared strings are found to be equivalent according to whatever metric
+ *
+ * @since 2.6
+ * @uses Text_Diff
+ * @uses WP_Text_Diff_Renderer_Table
+ *
+ * @param string $left_string "old" (left) version of string
+ * @param string $right_string "new" (right) version of string
+ * @param string|array $args @see wp_parse_args()
+ * @return string human readable HTML of string differences. Empty string if strings are equivalent
+ */
+function wp_text_diff( $left_string, $right_string, $args = null ) {
+ $defaults = array( 'title' => '', 'title_left' => '', 'title_right' => '' );
+ $args = wp_parse_args( $args, $defaults );
+
+ // PEAR Text_Diff is lame; it includes things from include_path rather than it's own path.
+ // Not sure of the ramifications of disttributing modified code.
+ ini_set('include_path', '.' . PATH_SEPARATOR . ABSPATH . WPINC );
+
+ if ( !class_exists( 'WP_Text_Diff_Renderer_Table' ) )
+ require( ABSPATH . WPINC . '/wp-diff.php' );
+
+ // Normalize whitespace
+ $left_string = trim($left_string);
+ $right_string = trim($right_string);
+ $left_string = str_replace("\r", "\n", $left_string);
+ $right_string = str_replace("\r", "\n", $right_string);
+ $left_string = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $left_string );
+ $right_string = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $right_string );
+
+ $left_lines = split("\n", $left_string);
+ $right_lines = split("\n", $right_string);
+
+ $text_diff = new Text_Diff($left_lines, $right_lines);
+ $renderer = new WP_Text_Diff_Renderer_Table();
+ $diff = $renderer->render($text_diff);
+
+ ini_restore('include_path');
+
+ if ( !$diff )
+ return '';
+
+ $r = "<table class='diff'>\n";
+ $r .= "<col class='ltype' /><col class='content' /><col class='ltype' /><col class='content' />";
+
+ if ( $args['title'] || $args['title_left'] || $args['title_right'] )
+ $r .= "<thead>";
+ if ( $args['title'] )
+ $r .= "<tr class='diff-title'><th colspan='4'>$args[title]</th></tr>\n";
+ if ( $args['title_left'] || $args['title_right'] ) {
+ $r .= "<tr class='diff-sub-title'>\n";
+ $r .= "\t<td></td><th>$args[title_left]</th>\n";
+ $r .= "\t<td></td><th>$args[title_right]</th>\n";
+ $r .= "</tr>\n";
+ }
+ if ( $args['title'] || $args['title_left'] || $args['title_right'] )
+ $r .= "</thead>\n";
+
+ $r .= "<tbody>\n$diff\n</tbody>\n";
+ $r .= "</table>";
+
+ return $r;
+}
+endif;
+
?>
diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php
index 829efc8..57e2677 100644
--- a/wp-includes/plugin.php
+++ b/wp-includes/plugin.php
@@ -434,7 +434,7 @@ function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args
/**
* plugin_basename() - Gets the basename of a plugin.
*
- * This method extract the name of a plugin from its filename.
+ * This method extracts the name of a plugin from its filename.
*
* @package WordPress
* @subpackage Plugin
@@ -444,11 +444,14 @@ function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args
*
* @param string $file The filename of plugin.
* @return string The name of a plugin.
+ * @uses WP_PLUGIN_DIR
*/
function plugin_basename($file) {
$file = str_replace('\\','/',$file); // sanitize for Win32 installs
$file = preg_replace('|/+|','/', $file); // remove any duplicate slash
- $file = preg_replace('|^.*/' . PLUGINDIR . '/|','',$file); // get relative path from plugins dir
+ $plugin_dir = str_replace('\\','/',WP_PLUGIN_DIR); // sanitize for Win32 installs
+ $plugin_dir = preg_replace('|/+|','/', $plugin_dir); // remove any duplicate slash
+ $file = preg_replace('|^' . preg_quote($plugin_dir, '|') . '/|','',$file); // get relative path from plugins dir
$file = preg_replace('|^.*/' . MUPLUGINDIR . '/|','',$file); // get relative path from plugins dir
return $file;
}
diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php
index 915101c..40a56d9 100644
--- a/wp-includes/post-template.php
+++ b/wp-includes/post-template.php
@@ -283,7 +283,7 @@ function wp_dropdown_pages($args = '') {
$output = '';
if ( ! empty($pages) ) {
- $output = "<select name='$name'>\n";
+ $output = "<select name='$name' id='$name'>\n";
if ( $show_option_none )
$output .= "\t<option value=''>$show_option_none</option>\n";
$output .= walk_page_dropdown_tree($pages, $depth, $r);
@@ -565,4 +565,169 @@ function is_page_template($template = '') {
return false;
}
-?>
+/**
+ * wp_post_revision_title() - returns formatted datetimestamp of a revision (linked to that revisions's page)
+ *
+ * @package WordPress
+ * @subpackage Post Revisions
+ * @since 2.6
+ *
+ * @uses date_i18n()
+ *
+ * @param int|object $revision revision ID or revision object
+ * @param bool $link optional Link to revisions's page?
+ * @return string i18n formatted datetimestamp or localized 'Corrent Revision'
+ */
+function wp_post_revision_title( $revision, $link = true ) {
+ if ( !$revision = get_post( $revision ) )
+ return $revision;
+
+ if ( !in_array( $revision->post_type, array( 'post', 'page', 'revision' ) ) )
+ return false;
+
+ $datef = _c( 'j F, Y @ G:i|revision date format');
+ $autosavef = __( '%s [Autosave]' );
+ $currentf = __( '%s [Current Revision]' );
+
+ $date = date_i18n( $datef, strtotime( $revision->post_modified_gmt . ' +0000' ) );
+ if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) )
+ $date = "<a href='$link'>$date</a>";
+
+ if ( !wp_is_post_revision( $revision ) )
+ $date = sprintf( $currentf, $date );
+ elseif ( wp_is_post_autosave( $revision ) )
+ $date = sprintf( $autosavef, $date );
+
+ return $date;
+}
+
+/**
+ * wp_list_post_revisions() - echoes list of a post's revisions
+ *
+ * Can output either a UL with edit links or a TABLE with diff interface, and restore action links
+ *
+ * Second argument controls parameters:
+ * (bool) parent : include the parent (the "Current Revision") in the list
+ * (string) format : 'list' or 'form-table'. 'list' outputs UL, 'form-table' outputs TABLE with UI
+ * (int) right : what revision is currently being viewed - used in form-table format
+ * (int) left : what revision is currently being diffed against right - used in form-table format
+ *
+ * @package WordPress
+ * @subpackage Post Revisions
+ * @since 2.6
+ *
+ * @uses wp_get_post_revisions()
+ * @uses wp_post_revision_title()
+ * @uses get_edit_post_link()
+ * @uses get_author_name()
+ *
+ * @param int|object $post_id post ID or post object
+ * @param string|array $args see description @see wp_parse_args()
+ */
+function wp_list_post_revisions( $post_id = 0, $args = null ) { // TODO? split into two functions (list, form-table) ?
+ if ( !$post = get_post( $post_id ) )
+ return;
+
+ $defaults = array( 'parent' => false, 'right' => false, 'left' => false, 'format' => 'list', 'type' => 'all' );
+ extract( wp_parse_args( $args, $defaults ), EXTR_SKIP );
+
+ switch ( $type ) {
+ case 'autosave' :
+ if ( !$autosave = wp_get_post_autosave( $post->ID ) )
+ return;
+ $revisions = array( $autosave );
+ break;
+ case 'revision' : // just revisions - remove autosave later
+ case 'all' :
+ default :
+ if ( !$revisions = wp_get_post_revisions( $post->ID ) )
+ return;
+ break;
+ }
+
+ $titlef = _c( '%1$s by %2$s|post revision 1:datetime, 2:name' );
+
+ if ( $parent )
+ array_unshift( $revisions, $post );
+
+ $rows = '';
+ $class = false;
+ $can_edit_post = current_user_can( 'edit_post', $post->ID );
+ foreach ( $revisions as $revision ) {
+ if ( !current_user_can( 'read_post', $revision->ID ) )
+ continue;
+ if ( 'revision' === $type && wp_is_post_autosave( $revision ) )
+ continue;
+
+ $date = wp_post_revision_title( $revision );
+ $name = get_author_name( $revision->post_author );
+
+ if ( 'form-table' == $format ) {
+ if ( $left )
+ $left_checked = $left == $revision->ID ? ' checked="checked"' : '';
+ else
+ $left_checked = $right_checked ? ' checked="checked"' : ''; // [sic] (the next one)
+ $right_checked = $right == $revision->ID ? ' checked="checked"' : '';
+
+ $class = $class ? '' : " class='alternate'";
+
+ if ( $post->ID != $revision->ID && $can_edit_post )
+ $actions = '<a href="' . wp_nonce_url( add_query_arg( array( 'revision' => $revision->ID, 'diff' => false, 'action' => 'restore' ) ), "restore-post_$post->ID|$revision->ID" ) . '">' . __( 'Restore' ) . '</a>';
+ else
+ $actions = '';
+
+ $rows .= "<tr$class>\n";
+ $rows .= "\t<th style='white-space: nowrap' scope='row'><input type='radio' name='left' value='$revision->ID'$left_checked /><input type='radio' name='right' value='$revision->ID'$right_checked /></th>\n";
+ $rows .= "\t<td>$date</td>\n";
+ $rows .= "\t<td>$name</td>\n";
+ $rows .= "\t<td class='action-links'>$actions</td>\n";
+ $rows .= "</tr>\n";
+ } else {
+ $title = sprintf( $titlef, $date, $name );
+ $rows .= "\t<li>$title</li>\n";
+ }
+ }
+
+ if ( 'form-table' == $format ) : ?>
+
+<form action="revision.php" method="get">
+
+<div class="tablenav">
+ <div class="alignleft">
+ <input type="submit" class="button-secondary" value="<?php _e( 'Compare Revisions' ); ?>" />
+ <input type="hidden" name="action" value="diff" />
+ </div>
+</div>
+
+<br class="clear" />
+
+<table class="widefat post-revisions">
+ <col />
+ <col style="width: 33%" />
+ <col style="width: 33%" />
+ <col style="width: 33%" />
+<thead>
+<tr>
+ <th scope="col"></th>
+ <th scope="col"><?php _e( 'Date Created' ); ?></th>
+ <th scope="col"><?php _e( 'Author' ); ?></th>
+ <th scope="col" class="action-links"><?php _e( 'Actions' ); ?></th>
+</tr>
+</thead>
+<tbody>
+
+<?php echo $rows; ?>
+
+</tbody>
+</table>
+
+</form>
+
+<?php
+ else :
+ echo "<ul class='post-revisions'>\n";
+ echo $rows;
+ echo "</ul>";
+ endif;
+
+}
diff --git a/wp-includes/post.php b/wp-includes/post.php
index cf76638..5c9409a 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -44,14 +44,9 @@ function update_attached_file( $attachment_id, $file ) {
if ( !get_post( $attachment_id ) )
return false;
- $old_file = get_attached_file( $attachment_id, true );
-
$file = apply_filters( 'update_attached_file', $file, $attachment_id );
- if ( $old_file )
- return update_post_meta( $attachment_id, '_wp_attached_file', $file, $old_file );
- else
- return add_post_meta( $attachment_id, '_wp_attached_file', $file );
+ return update_post_meta( $attachment_id, '_wp_attached_file', $file );
}
/**
@@ -70,14 +65,14 @@ function update_attached_file( $attachment_id, $file ) {
function &get_children($args = '', $output = OBJECT) {
if ( empty( $args ) ) {
if ( isset( $GLOBALS['post'] ) ) {
- $args = 'post_parent=' . (int) $GLOBALS['post']->post_parent;
+ $args = array('post_parent' => (int) $GLOBALS['post']->post_parent );
} else {
return false;
}
} elseif ( is_object( $args ) ) {
- $args = 'post_parent=' . (int) $args->post_parent;
+ $args = array('post_parent' => (int) $args->post_parent );
} elseif ( is_numeric( $args ) ) {
- $args = 'post_parent=' . (int) $args;
+ $args = array('post_parent' => (int) $args);
}
$defaults = array(
@@ -88,7 +83,6 @@ function &get_children($args = '', $output = OBJECT) {
$r = wp_parse_args( $args, $defaults );
$children = get_posts( $r );
-
if ( !$children )
return false;
@@ -401,87 +395,32 @@ function set_post_type( $post_id = 0, $post_type = 'post' ) {
* @return array {@internal Missing Description}}
*/
function get_posts($args = null) {
- global $wpdb;
-
$defaults = array(
'numberposts' => 5, 'offset' => 0,
'category' => 0, 'orderby' => 'post_date',
'order' => 'DESC', 'include' => '',
'exclude' => '', 'meta_key' => '',
'meta_value' =>'', 'post_type' => 'post',
- 'post_status' => 'publish', 'post_parent' => 0
+ 'post_parent' => 0
);
$r = wp_parse_args( $args, $defaults );
- extract( $r, EXTR_SKIP );
-
- $numberposts = (int) $numberposts;
- $offset = (int) $offset;
- $category = (int) $category;
- $post_parent = (int) $post_parent;
+ if ( empty( $r['post_status'] ) )
+ $r['post_status'] = ( 'attachment' == $r['post_type'] ) ? 'inherit' : 'publish';
+ if ( ! empty($r['numberposts']) )
+ $r['posts_per_page'] = $r['numberposts'];
+ if ( ! empty($r['category']) )
+ $r['cat'] = $r['category'];
+ if ( ! empty($r['include']) ) {
+ $incposts = preg_split('/[\s,]+/',$r['include']);
+ $r['posts_per_page'] = count($incposts); // only the number of posts included
+ $r['post__in'] = $incposts;
+ } elseif ( ! empty($r['exclude']) )
+ $r['post__not_in'] = preg_split('/[\s,]+/',$r['exclude']);
- $inclusions = '';
- if ( !empty($include) ) {
- $offset = 0; //ignore offset, category, exclude, meta_key, and meta_value, post_parent if using include
- $category = 0;
- $exclude = '';
- $meta_key = '';
- $meta_value = '';
- $post_parent = 0;
- $incposts = preg_split('/[\s,]+/',$include);
- $numberposts = count($incposts); // only the number of posts included
- if ( count($incposts) ) {
- foreach ( $incposts as $incpost ) {
- if (empty($inclusions))
- $inclusions = $wpdb->prepare(' AND ( ID = %d ', $incpost);
- else
- $inclusions .= $wpdb->prepare(' OR ID = %d ', $incpost);
- }
- }
- }
- if (!empty($inclusions))
- $inclusions .= ')';
+ $get_posts = new WP_Query;
+ return $get_posts->query($r);
- $exclusions = '';
- if ( !empty($exclude) ) {
- $exposts = preg_split('/[\s,]+/',$exclude);
- if ( count($exposts) ) {
- foreach ( $exposts as $expost ) {
- if (empty($exclusions))
- $exclusions = $wpdb->prepare(' AND ( ID <> %d ', $expost);
- else
- $exclusions .= $wpdb->prepare(' AND ID <> %d ', $expost);
- }
- }
- }
- if (!empty($exclusions))
- $exclusions .= ')';
-
- // orderby
- if ( preg_match( '/.+ +(ASC|DESC)/i', $orderby ) )
- $order = ''; // orderby has its own order, so we'll use that
-
- $query = "SELECT DISTINCT * FROM $wpdb->posts ";
- $query .= empty( $category ) ? '' : ", $wpdb->term_relationships, $wpdb->term_taxonomy ";
- $query .= empty( $meta_key ) ? '' : ", $wpdb->postmeta ";
- $query .= " WHERE 1=1 ";
- $query .= empty( $post_type ) ? '' : $wpdb->prepare("AND post_type = %s ", $post_type);
- $query .= empty( $post_status ) ? '' : $wpdb->prepare("AND post_status = %s ", $post_status);
- $query .= "$exclusions $inclusions " ;
- $query .= empty( $category ) ? '' : $wpdb->prepare("AND ($wpdb->posts.ID = $wpdb->term_relationships.object_id AND $wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id AND $wpdb->term_taxonomy.term_id = %d AND $wpdb->term_taxonomy.taxonomy = 'category')", $category);
- $query .= empty( $post_parent ) ? '' : $wpdb->prepare("AND $wpdb->posts.post_parent = %d ", $post_parent);
- // expected_slashed ($meta_key, $meta_value) -- Also, this looks really funky, doesn't seem like it works
- $query .= empty( $meta_key ) | empty($meta_value) ? '' : " AND ($wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = '$meta_key' AND $wpdb->postmeta.meta_value = '$meta_value' )";
- $query .= empty( $post_mime_type ) ? '' : wp_post_mime_type_where($post_mime_type);
- $query .= " GROUP BY $wpdb->posts.ID ORDER BY " . $orderby . ' ' . $order;
- if ( 0 < $numberposts )
- $query .= $wpdb->prepare(" LIMIT %d,%d", $offset, $numberposts);
-
- $posts = $wpdb->get_results($query);
-
- update_post_caches($posts);
-
- return $posts;
}
//
@@ -626,20 +565,22 @@ function get_post_meta($post_id, $key, $single = false) {
function update_post_meta($post_id, $meta_key, $meta_value, $prev_value = '') {
global $wpdb;
- $meta_value = maybe_serialize($meta_value);
- $prev_value = maybe_serialize($prev_value);
-
// expected_slashed ($meta_key)
$meta_key = stripslashes($meta_key);
- if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d", $meta_key, $post_id ) ) )
- return false;
+ if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d", $meta_key, $post_id ) ) ) {
+ return add_post_meta($post_id, $meta_key, $meta_value);
+ }
+
+ $meta_value = maybe_serialize($meta_value);
$data = compact( 'meta_value' );
$where = compact( 'meta_key', 'post_id' );
- if ( !empty( $prev_value ) )
+ if ( !empty( $prev_value ) ) {
+ $prev_value = maybe_serialize($prev_value);
$where['meta_value'] = $prev_value;
+ }
$wpdb->update( $wpdb->postmeta, $data, $where );
wp_cache_delete($post_id, 'post_meta');
@@ -693,7 +634,7 @@ function get_post_custom($post_id = 0) {
if ( ! wp_cache_get($post_id, 'post_meta') )
update_postmeta_cache($post_id);
- return (array)wp_cache_get($post_id, 'post_meta');
+ return wp_cache_get($post_id, 'post_meta');
}
/**
@@ -1012,6 +953,12 @@ function wp_delete_post($postid = 0) {
$wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'page' ) );
}
+ // Do raw query. wp_get_post_revisions() is filtered
+ $revision_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'revision'", $postid ) );
+ // Use wp_delete_post (via wp_delete_post_revision) again. Ensures any meta/misplaced data gets cleaned up.
+ foreach ( $revision_ids as $revision_id )
+ wp_delete_post_revision( $revision_id );
+
// Point all attachments to this post up one level
$wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'attachment' ) );
@@ -1352,8 +1299,7 @@ function wp_insert_post($postarr = array(), $wp_error = false) {
else
return 0;
}
- if ( ! update_post_meta($post_ID, '_wp_page_template', $page_template) )
- add_post_meta($post_ID, '_wp_page_template', $page_template, true);
+ update_post_meta($post_ID, '_wp_page_template', $page_template);
}
wp_transition_post_status($post_status, $previous_status, $post);
@@ -1974,11 +1920,21 @@ function &get_pages($args = '') {
}
}
- $query = "SELECT * FROM $wpdb->posts " ;
- $query .= ( empty( $meta_key ) ? "" : ", $wpdb->postmeta " ) ;
- $query .= " WHERE (post_type = 'page' AND post_status = 'publish') $exclusions $inclusions " ;
- // expected_slashed ($meta_key, $meta_value) -- also, it looks funky
- $query .= ( empty( $meta_key ) | empty($meta_value) ? "" : " AND ($wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = '$meta_key' AND $wpdb->postmeta.meta_value = '$meta_value' )" ) ;
+ $join = '';
+ $where = "$exclusions $inclusions ";
+ if ( ! empty( $meta_key ) || ! empty( $meta_value ) ) {
+ $join = " LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )";
+
+ // meta_key and met_value might be slashed
+ $meta_key = stripslashes($meta_key);
+ $meta_value = stripslashes($meta_value);
+ if ( ! empty( $meta_key ) )
+ $where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_key = %s", $meta_key);
+ if ( ! empty( $meta_value ) )
+ $where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_value = %s", $meta_value);
+
+ }
+ $query = "SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page' AND post_status = 'publish') $where ";
$query .= $author_query;
$query .= " ORDER BY " . $sort_column . " " . $sort_order ;
@@ -2280,14 +2236,9 @@ function wp_update_attachment_metadata( $post_id, $data ) {
if ( !$post =& get_post( $post_id ) )
return false;
- $old_data = wp_get_attachment_metadata( $post->ID, true );
-
$data = apply_filters( 'wp_update_attachment_metadata', $data, $post->ID );
- if ( $old_data )
- return update_post_meta( $post->ID, '_wp_attachment_metadata', $data, $old_data );
- else
- return add_post_meta( $post->ID, '_wp_attachment_metadata', $data );
+ return update_post_meta( $post->ID, '_wp_attachment_metadata', $data);
}
/**
@@ -2441,7 +2392,7 @@ function wp_mime_type_icon( $mime = 0 ) {
if ( !is_array($icon_files) ) {
$icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' );
- $icon_dir_uri = apply_filters( 'icon_dir_uri', trailingslashit(get_option('siteurl')) . WPINC . '/images/crystal' );
+ $icon_dir_uri = apply_filters( 'icon_dir_uri', includes_url('images/crystal') );
$dirs = apply_filters( 'icon_dirs', array($icon_dir => $icon_dir_uri) );
$icon_files = array();
while ( $dirs ) {
@@ -2996,4 +2947,354 @@ function _get_post_ancestors(&$_post) {
}
}
-?>
+/* Post Revisions */
+
+/**
+ * _wp_post_revision_fields() - determines which fields of posts are to be saved in revisions
+ *
+ * Does two things. If passed a post *array*, it will return a post array ready to be
+ * insterted into the posts table as a post revision.
+ * Otherwise, returns an array whose keys are the post fields to be saved for post revisions.
+ *
+ * @package WordPress
+ * @subpackage Post Revisions
+ * @since 2.6
+ *
+ * @param array $post optional a post array to be processed for insertion as a post revision
+ * @param bool $autosave optional Is the revision an autosave?
+ * @return array post array ready to be inserted as a post revision or array of fields that can be versioned
+ */
+function _wp_post_revision_fields( $post = null, $autosave = false ) {
+ static $fields = false;
+
+ if ( !$fields ) {
+ // Allow these to be versioned
+ $fields = array(
+ 'post_title' => __( 'Title' ),
+ 'post_author' => __( 'Author' ),
+ 'post_content' => __( 'Content' ),
+ 'post_excerpt' => __( 'Excerpt' ),
+ );
+
+ // Runs only once
+ $fields = apply_filters( '_wp_post_revision_fields', $fields );
+
+ // WP uses these internally either in versioning or elsewhere - they cannot be versioned
+ foreach ( array( 'ID', 'post_name', 'post_parent', 'post_date', 'post_date_gmt', 'post_status', 'post_type', 'comment_count' ) as $protect )
+ unset( $fields[$protect] );
+ }
+
+ if ( !is_array($post) )
+ return $fields;
+
+ $return = array();
+ foreach ( array_intersect( array_keys( $post ), array_keys( $fields ) ) as $field )
+ $return[$field] = $post[$field];
+
+ $return['post_parent'] = $post['ID'];
+ $return['post_status'] = 'inherit';
+ $return['post_type'] = 'revision';
+ $return['post_name'] = $autosave ? "$post[ID]-autosave" : "$post[ID]-revision";
+ $return['post_date'] = $post['post_modified'];
+ $return['post_date_gmt'] = $post['post_modified_gmt'];
+
+ return $return;
+}
+
+/**
+ * wp_save_post_revision() - Saves an already existing post as a post revision. Typically used immediately prior to post updates.
+ *
+ * @package WordPress
+ * @subpackage Post Revisions
+ * @since 2.6
+ *
+ * @uses _wp_put_post_revision()
+ *
+ * @param int $post_id The ID of the post to save as a revision
+ * @return mixed null or 0 if error, new revision ID if success
+ */
+function wp_save_post_revision( $post_id ) {
+ // We do autosaves manually with wp_create_post_autosave()
+ if ( @constant( 'DOING_AUTOSAVE' ) )
+ return;
+
+ // WP_POST_REVISIONS = 0, false
+ if ( !constant('WP_POST_REVISIONS') )
+ return;
+
+ if ( !$post = get_post( $post_id, ARRAY_A ) )
+ return;
+
+ if ( !in_array( $post['post_type'], array( 'post', 'page' ) ) )
+ return;
+
+ $return = _wp_put_post_revision( $post );
+
+ // WP_POST_REVISIONS = true (default), -1
+ if ( !is_numeric( WP_POST_REVISIONS ) || WP_POST_REVISIONS < 0 )
+ return $return;
+
+ // all revisions and (possibly) one autosave
+ $revisions = wp_get_post_revisions( $post_id, array( 'order' => 'ASC' ) );
+
+ // WP_POST_REVISIONS = (int) (# of autasaves to save)
+ $delete = count($revisions) - WP_POST_REVISIONS;
+
+ if ( $delete < 1 )
+ return $return;
+
+ $revisions = array_slice( $revisions, 0, $delete );
+
+ for ( $i = 0; isset($revisions[$i]); $i++ ) {
+ if ( false !== strpos( $revisions[$i]->post_name, 'autosave' ) )
+ continue;
+ wp_delete_post_revision( $revisions[$i]->ID );
+ }
+
+ return $return;
+}
+
+/**
+ * wp_get_post_autosave() - returns the autosaved data of the specified post.
+ *
+ * Returns a post object containing the information that was autosaved for the specified post.
+ *
+ * @package WordPress
+ * @subpackage Post Revisions
+ * @since 2.6
+ *
+ * @param int $post_id The post ID
+ * @return object|bool the autosaved data or false on failure or when no autosave exists
+ */
+function wp_get_post_autosave( $post_id ) {
+ global $wpdb;
+ if ( !$post = get_post( $post_id ) )
+ return false;
+
+ $q = array(
+ 'name' => "{$post->ID}-autosave",
+ 'post_parent' => $post->ID,
+ 'post_type' => 'revision',
+ 'post_status' => 'inherit'
+ );
+
+ // Use WP_Query so that the result gets cached
+ $autosave_query = new WP_Query;
+
+ add_action( 'parse_query', '_wp_get_post_autosave_hack' );
+ $autosave = $autosave_query->query( $q );
+ remove_action( 'parse_query', '_wp_get_post_autosave_hack' );
+
+ if ( $autosave && is_array($autosave) && is_object($autosave[0]) )
+ return $autosave[0];
+
+ return false;
+}
+
+// Internally used to hack WP_Query into submission
+function _wp_get_post_autosave_hack( $query ) {
+ $query->is_single = false;
+}
+
+
+/**
+ * wp_is_post_revision() - Determines if the specified post is a revision.
+ *
+ * @package WordPress
+ * @subpackage Post Revisions
+ * @since 2.6
+ *
+ * @param int|object $post post ID or post object
+ * @return bool|int false if not a revision, ID of revision's parent otherwise
+ */
+function wp_is_post_revision( $post ) {
+ if ( !$post = wp_get_post_revision( $post ) )
+ return false;
+ return (int) $post->post_parent;
+}
+
+/**
+ * wp_is_post_autosave() - Determines if the specified post is an autosave.
+ *
+ * @package WordPress
+ * @subpackage Post Revisions
+ * @since 2.6
+ *
+ * @param int|object $post post ID or post object
+ * @return bool|int false if not a revision, ID of autosave's parent otherwise
+ */
+function wp_is_post_autosave( $post ) {
+ if ( !$post = wp_get_post_revision( $post ) )
+ return false;
+ if ( "{$post->post_parent}-autosave" !== $post->post_name )
+ return false;
+ return (int) $post->post_parent;
+}
+
+/**
+ * _wp_put_post_revision() - Inserts post data into the posts table as a post revision
+ *
+ * @package WordPress
+ * @subpackage Post Revisions
+ * @since 2.6
+ *
+ * @uses wp_insert_post()
+ *
+ * @param int|object|array $post post ID, post object OR post array
+ * @param bool $autosave optional Is the revision an autosave?
+ * @return mixed null or 0 if error, new revision ID if success
+ */
+function _wp_put_post_revision( $post = null, $autosave = false ) {
+ if ( is_object($post) )
+ $post = get_object_vars( $post );
+ elseif ( !is_array($post) )
+ $post = get_post($post, ARRAY_A);
+ if ( !$post || empty($post['ID']) )
+ return;
+
+ if ( isset($post['post_type']) && 'revision' == $post_post['type'] )
+ return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );
+
+ $post = _wp_post_revision_fields( $post, $autosave );
+
+ $revision_id = wp_insert_post( $post );
+ if ( is_wp_error($revision_id) )
+ return $revision_id;
+
+ if ( $revision_id )
+ do_action( '_wp_put_post_revision', $revision_id );
+ return $revision_id;
+}
+
+/**
+ * wp_get_post_revision() - Gets a post revision
+ *
+ * @package WordPress
+ * @subpackage Post Revisions
+ * @since 2.6
+ *
+ * @uses get_post()
+ *
+ * @param int|object $post post ID or post object
+ * @param $output optional OBJECT, ARRAY_A, or ARRAY_N
+ * @param string $filter optional sanitation filter. @see sanitize_post()
+ * @return mixed null if error or post object if success
+ */
+function &wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') {
+ $null = null;
+ if ( !$revision = get_post( $post, OBJECT, $filter ) )
+ return $revision;
+ if ( 'revision' !== $revision->post_type )
+ return $null;
+
+ if ( $output == OBJECT ) {
+ return $revision;
+ } elseif ( $output == ARRAY_A ) {
+ $_revision = get_object_vars($revision);
+ return $_revision;
+ } elseif ( $output == ARRAY_N ) {
+ $_revision = array_values(get_object_vars($revision));
+ return $_revision;
+ }
+
+ return $revision;
+}
+
+/**
+ * wp_restore_post_revision() - Restores a post to the specified revision
+ *
+ * Can restore a past using all fields of the post revision, or only selected fields.
+ *
+ * @package WordPress
+ * @subpackage Post Revisions
+ * @since 2.6
+ *
+ * @uses wp_get_post_revision()
+ * @uses wp_update_post()
+ *
+ * @param int|object $revision_id revision ID or revision object
+ * @param array $fields optional What fields to restore from. Defaults to all.
+ * @return mixed null if error, false if no fields to restore, (int) post ID if success
+ */
+function wp_restore_post_revision( $revision_id, $fields = null ) {
+ if ( !$revision = wp_get_post_revision( $revision_id, ARRAY_A ) )
+ return $revision;
+
+ if ( !is_array( $fields ) )
+ $fields = array_keys( _wp_post_revision_fields() );
+
+ $update = array();
+ foreach( array_intersect( array_keys( $revision ), $fields ) as $field )
+ $update[$field] = $revision[$field];
+
+ if ( !$update )
+ return false;
+
+ $update['ID'] = $revision['post_parent'];
+
+ $post_id = wp_update_post( $update );
+ if ( is_wp_error( $post_id ) )
+ return $post_id;
+
+ if ( $post_id )
+ do_action( 'wp_restore_post_revision', $post_id, $revision['ID'] );
+
+ return $post_id;
+}
+
+/**
+ * wp_delete_post_revision() - Deletes a revision.
+ *
+ * Deletes the row from the posts table corresponding to the specified revision
+ *
+ * @package WordPress
+ * @subpackage Post Revisions
+ * @since 2.6
+ *
+ * @uses wp_get_post_revision()
+ * @uses wp_delete_post()
+ *
+ * @param int|object $revision_id revision ID or revision object
+ * @param array $fields optional What fields to restore from. Defaults to all.
+ * @return mixed null if error, false if no fields to restore, (int) post ID if success
+ */
+function wp_delete_post_revision( $revision_id ) {
+ if ( !$revision = wp_get_post_revision( $revision_id ) )
+ return $revision;
+
+ $delete = wp_delete_post( $revision->ID );
+ if ( is_wp_error( $delete ) )
+ return $delete;
+
+ if ( $delete )
+ do_action( 'wp_delete_post_revision', $revision->ID, $revision );
+
+ return $delete;
+}
+
+/**
+ * wp_get_post_revisions() - Returns all revisions of specified post
+ *
+ * @package WordPress
+ * @subpackage Post Revisions
+ * @since 2.6
+ *
+ * @uses get_children()
+ *
+ * @param int|object $post_id post ID or post object
+ * @return array empty if no revisions
+ */
+function wp_get_post_revisions( $post_id = 0, $args = null ) {
+ if ( !constant('WP_POST_REVISIONS') )
+ return array();
+ if ( ( !$post = get_post( $post_id ) ) || empty( $post->ID ) )
+ return array();
+
+ $defaults = array( 'order' => 'DESC', 'orderby' => 'date' );
+ $args = wp_parse_args( $args, $defaults );
+ $args = array_merge( $args, array( 'post_parent' => $post->ID, 'post_type' => 'revision', 'post_status' => 'inherit' ) );
+
+ if ( !$revisions = get_children( $args ) )
+ return array();
+ return $revisions;
+}
diff --git a/wp-includes/query.php b/wp-includes/query.php
index 4ec272b..2806652 100644
--- a/wp-includes/query.php
+++ b/wp-includes/query.php
@@ -453,6 +453,7 @@ class WP_Query {
'error'
, 'm'
, 'p'
+ , 'post_parent'
, 'subpost'
, 'subpost_id'
, 'attachment'
@@ -477,6 +478,8 @@ class WP_Query {
, 'tb'
, 'paged'
, 'comments_popup'
+ , 'meta_key'
+ , 'meta_value'
, 'preview'
);
@@ -485,7 +488,7 @@ class WP_Query {
$array[$key] = '';
}
- $array_keys = array('category__in', 'category__not_in', 'category__and',
+ $array_keys = array('category__in', 'category__not_in', 'category__and', 'post__in', 'post__not_in',
'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and');
foreach ( $array_keys as $key ) {
@@ -512,17 +515,17 @@ class WP_Query {
if ( ! empty($qv['robots']) )
$this->is_robots = true;
- $qv['p'] = (int) $qv['p'];
- $qv['page_id'] = (int) $qv['page_id'];
- $qv['year'] = (int) $qv['year'];
- $qv['monthnum'] = (int) $qv['monthnum'];
- $qv['day'] = (int) $qv['day'];
- $qv['w'] = (int) $qv['w'];
- $qv['m'] = (int) $qv['m'];
+ $qv['p'] = absint($qv['p']);
+ $qv['page_id'] = absint($qv['page_id']);
+ $qv['year'] = absint($qv['year']);
+ $qv['monthnum'] = absint($qv['monthnum']);
+ $qv['day'] = absint($qv['day']);
+ $qv['w'] = absint($qv['w']);
+ $qv['m'] = absint($qv['m']);
$qv['cat'] = preg_replace( '|[^0-9,-]|', '', $qv['cat'] ); // comma separated list of positive or negative integers
- if ( '' !== $qv['hour'] ) $qv['hour'] = (int) $qv['hour'];
- if ( '' !== $qv['minute'] ) $qv['minute'] = (int) $qv['minute'];
- if ( '' !== $qv['second'] ) $qv['second'] = (int) $qv['second'];
+ if ( '' !== $qv['hour'] ) $qv['hour'] = absint($qv['hour']);
+ if ( '' !== $qv['minute'] ) $qv['minute'] = absint($qv['minute']);
+ if ( '' !== $qv['second'] ) $qv['second'] = absint($qv['second']);
// Compat. Map subpost to attachment.
if ( '' != $qv['subpost'] )
@@ -530,7 +533,7 @@ class WP_Query {
if ( '' != $qv['subpost_id'] )
$qv['attachment_id'] = $qv['subpost_id'];
- $qv['attachment_id'] = (int) $qv['attachment_id'];
+ $qv['attachment_id'] = absint($qv['attachment_id']);
if ( ('' != $qv['attachment']) || !empty($qv['attachment_id']) ) {
$this->is_single = true;
@@ -621,47 +624,47 @@ class WP_Query {
if ( !is_array($qv['category__in']) || empty($qv['category__in']) ) {
$qv['category__in'] = array();
} else {
- $qv['category__in'] = array_map('intval', $qv['category__in']);
+ $qv['category__in'] = array_map('absint', $qv['category__in']);
$this->is_category = true;
}
if ( !is_array($qv['category__not_in']) || empty($qv['category__not_in']) ) {
$qv['category__not_in'] = array();
} else {
- $qv['category__not_in'] = array_map('intval', $qv['category__not_in']);
+ $qv['category__not_in'] = array_map('absint', $qv['category__not_in']);
}
if ( !is_array($qv['category__and']) || empty($qv['category__and']) ) {
$qv['category__and'] = array();
} else {
- $qv['category__and'] = array_map('intval', $qv['category__and']);
+ $qv['category__and'] = array_map('absint', $qv['category__and']);
$this->is_category = true;
}
if ( '' != $qv['tag'] )
$this->is_tag = true;
- $qv['tag_id'] = (int) $qv['tag_id'];
+ $qv['tag_id'] = absint($qv['tag_id']);
if ( !empty($qv['tag_id']) )
$this->is_tag = true;
if ( !is_array($qv['tag__in']) || empty($qv['tag__in']) ) {
$qv['tag__in'] = array();
} else {
- $qv['tag__in'] = array_map('intval', $qv['tag__in']);
+ $qv['tag__in'] = array_map('absint', $qv['tag__in']);
$this->is_tag = true;
}
if ( !is_array($qv['tag__not_in']) || empty($qv['tag__not_in']) ) {
$qv['tag__not_in'] = array();
} else {
- $qv['tag__not_in'] = array_map('intval', $qv['tag__not_in']);
+ $qv['tag__not_in'] = array_map('absint', $qv['tag__not_in']);
}
if ( !is_array($qv['tag__and']) || empty($qv['tag__and']) ) {
$qv['tag__and'] = array();
} else {
- $qv['tag__and'] = array_map('intval', $qv['tag__and']);
+ $qv['tag__and'] = array_map('absint', $qv['tag__and']);
$this->is_category = true;
}
@@ -868,8 +871,7 @@ class WP_Query {
if (isset($q['page'])) {
$q['page'] = trim($q['page'], '/');
- $q['page'] = (int) $q['page'];
- $q['page'] = abs($q['page']);
+ $q['page'] = absint($q['page']);
}
// If a month is specified in the querystring, load that month
@@ -920,7 +922,8 @@ class WP_Query {
$reqpage = 0;
}
- if ( ('page' != get_option('show_on_front') ) || ( $reqpage != get_option('page_for_posts') ) ) {
+ $page_for_posts = get_option('page_for_posts');
+ if ( ('page' != get_option('show_on_front') ) || empty($page_for_posts) || ( $reqpage != $page_for_posts ) ) {
$q['pagename'] = str_replace('%2F', '/', urlencode(urldecode($q['pagename'])));
$page_paths = '/' . trim($q['pagename'], '/');
$q['pagename'] = sanitize_title(basename($page_paths));
@@ -945,15 +948,25 @@ class WP_Query {
$where .= " AND WEEK($wpdb->posts.post_date, 1)='" . $q['w'] . "'";
if ( intval($q['comments_popup']) )
- $q['p'] = intval($q['comments_popup']);
+ $q['p'] = absint($q['comments_popup']);
// If an attachment is requested by number, let it supercede any post number.
if ( $q['attachment_id'] )
- $q['p'] = $q['attachment_id'];
+ $q['p'] = absint($q['attachment_id']);
// If a post number is specified, load that post
- if ( $q['p'] )
- $where = " AND {$wpdb->posts}.ID = " . $q['p'];
+ if ( $q['p'] ) {
+ $where .= " AND {$wpdb->posts}.ID = " . $q['p'];
+ } elseif ( $q['post__in'] ) {
+ $post__in = implode(',', array_map( 'absint', $q['post__in'] ));
+ $where .= " AND {$wpdb->posts}.ID IN ($post__in)";
+ } elseif ( $q['post__not_in'] ) {
+ $post__not_in = implode(',', array_map( 'absint', $q['post__not_in'] ));
+ $where .= " AND {$wpdb->posts}.ID NOT IN ($post__not_in)";
+ }
+
+ if ( $q['post_parent'] )
+ $where .= $wpdb->prepare( " AND $wpdb->posts.post_parent = %d ", $q['post_parent'] );
if ( $q['page_id'] ) {
if ( ('page' != get_option('show_on_front') ) || ( $q['page_id'] != get_option('page_for_posts') ) ) {
@@ -1194,15 +1207,15 @@ class WP_Query {
$eq = '!=';
$andor = 'AND';
$q['author'] = explode('-', $q['author']);
- $q['author'] = ''.intval($q['author'][1]);
+ $q['author'] = '' . absint($q['author'][1]);
} else {
$eq = '=';
$andor = 'OR';
}
$author_array = preg_split('/[,\s]+/', $q['author']);
- $whichauthor .= " AND ($wpdb->posts.post_author ".$eq.' '.intval($author_array[0]);
+ $whichauthor .= " AND ($wpdb->posts.post_author ".$eq.' '.absint($author_array[0]);
for ($i = 1; $i < (count($author_array)); $i = $i + 1) {
- $whichauthor .= ' '.$andor." $wpdb->posts.post_author ".$eq.' '.intval($author_array[$i]);
+ $whichauthor .= ' '.$andor." $wpdb->posts.post_author ".$eq.' '.absint($author_array[$i]);
}
$whichauthor .= ')';
}
@@ -1220,7 +1233,7 @@ class WP_Query {
}
$q['author_name'] = sanitize_title($q['author_name']);
$q['author'] = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_nicename='".$q['author_name']."'");
- $whichauthor .= " AND ($wpdb->posts.post_author = ".intval($q['author']).')';
+ $whichauthor .= " AND ($wpdb->posts.post_author = ".absint($q['author']).')';
}
// MIME-Type stuff for attachment browsing
@@ -1338,6 +1351,14 @@ class WP_Query {
$where .= ')';
}
+ // postmeta queries
+ if ( ! empty($q['meta_key']) || ! empty($q['meta_value']) )
+ $join .= " LEFT JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id) ";
+ if ( ! empty($q['meta_key']) )
+ $where .= $wpdb->prepare("AND $wpdb->postmeta.meta_key = %s ", $q['meta_key']);
+ if ( ! empty($q['meta_value']) )
+ $where .= $wpdb->prepare("AND $wpdb->postmeta.meta_value = %s ", $q['meta_value']);
+
// Apply filters on where and join prior to paging so that any
// manipulations to them are reflected in the paging by day queries.
$where = apply_filters('posts_where', $where);
@@ -1352,7 +1373,7 @@ class WP_Query {
if ( empty($q['offset']) ) {
$pgstrt = '';
- $pgstrt = (intval($page) -1) * $q['posts_per_page'] . ', ';
+ $pgstrt = ($page - 1) * $q['posts_per_page'] . ', ';
$limits = 'LIMIT '.$pgstrt.$q['posts_per_page'];
} else { // we're ignoring $page and using 'offset'
$q['offset'] = absint($q['offset']);
@@ -1589,8 +1610,9 @@ class WP_Query {
$tax = $this->get('taxonomy');
$slug = $this->get('term');
$term = &get_terms($tax, array('slug'=>$slug));
- if ( is_wp_error($term) )
+ if ( is_wp_error($term) || empty($term) )
return $term;
+ $term = $term[0];
$this->queried_object = $term;
$this->queried_object_id = $term->term_id;
} else if ($this->is_posts_page) {
diff --git a/wp-includes/rss.php b/wp-includes/rss.php
index f655f12..561e3f9 100644
--- a/wp-includes/rss.php
+++ b/wp-includes/rss.php
@@ -651,11 +651,12 @@ function is_server_error ($sc) {
}
class RSSCache {
- var $BASE_CACHE = 'wp-content/cache'; // where the cache files are stored
+ var $BASE_CACHE; // where the cache files are stored
var $MAX_AGE = 43200; // when are files stale, default twelve hours
var $ERROR = ''; // accumulate error messages
function RSSCache ($base='', $age='') {
+ $this->BASE_CACHE = WP_CONTENT_DIR . '/cache';
if ( $base ) {
$this->BASE_CACHE = $base;
}
@@ -677,8 +678,8 @@ class RSSCache {
$cache_timestamp = 'rss_' . $this->file_name( $url ) . '_ts';
if( $wp_object_cache->cache_enabled ) {
- wp_cache_set( $cache_option, $rss, 'site-options' );
- wp_cache_set( $cache_timestamp, $cache_timestamp, 'site-options' );
+ wp_cache_set( $cache_option, $rss, 'rss' );
+ wp_cache_set( $cache_timestamp, $cache_timestamp, 'rss' );
} else {
if( !get_site_option( $cache_option ) )
add_site_option( $cache_option, $rss );
@@ -701,17 +702,17 @@ class RSSCache {
$cache_option = 'rss_' . $this->file_name( $url );
if( $wp_object_cache->cache_enabled ) {
- if( ! wp_cache_get( $cache_option, 'site-options' ) ) {
+ if( ! wp_cache_get( $cache_option, 'rss' ) ) {
$this->debug( "Cache doesn't contain: $url (cache option: $cache_option)" );
return 0;
}
- return wp_cache_get( $cache_option, 'site-options' );
+ return wp_cache_get( $cache_option, 'rss' );
} else {
- if ( ! get_option( $cache_option ) ) {
+ if ( ! get_site_option( $cache_option ) ) {
$this->debug( "Cache doesn't contain: $url (cache option: $cache_option)" );
return 0;
}
- return get_option( $cache_option );
+ return get_site_option( $cache_option );
}
}
@@ -729,9 +730,9 @@ class RSSCache {
$cache_timestamp = 'rss_' . $this->file_name( $url ) . '_ts';
if( $wp_object_cache->cache_enabled ) {
- $mtime = wp_cache_get( $cache_timestamp, 'site-options' );
+ $mtime = wp_cache_get( $cache_timestamp, 'rss' );
} else {
- $mtime = get_option($cache_timestamp);
+ $mtime = get_site_option($cache_timestamp);
}
if ( $mtime ) {
diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php
index 2bbafa3..3615d41 100644
--- a/wp-includes/script-loader.php
+++ b/wp-includes/script-loader.php
@@ -1,476 +1,236 @@
<?php
-class WP_Scripts {
- var $scripts = array();
- var $queue = array();
- var $to_print = array();
- var $printed = array();
- var $args = array();
-
- function WP_Scripts() {
- $this->default_scripts();
- }
- function default_scripts() {
- $this->add( 'common', '/wp-admin/js/common.js', array('jquery'), '20080318' );
- $this->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' );
-
- $this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3958' );
- $this->localize( 'quicktags', 'quicktagsL10n', array(
- 'quickLinks' => __('(Quick Links)'),
- 'wordLookup' => __('Enter a word to look up:'),
- 'dictionaryLookup' => attribute_escape(__('Dictionary lookup')),
- 'lookup' => attribute_escape(__('lookup')),
- 'closeAllOpenTags' => attribute_escape(__('Close all open tags')),
- 'closeTags' => attribute_escape(__('close tags')),
- 'enterURL' => __('Enter the URL'),
- 'enterImageURL' => __('Enter the URL of the image'),
- 'enterImageDescription' => __('Enter a description of the image')
- ) );
+require( ABSPATH . WPINC . '/class.wp-dependencies.php' );
+require( ABSPATH . WPINC . '/class.wp-scripts.php' );
+require( ABSPATH . WPINC . '/functions.wp-scripts.php' );
+require( ABSPATH . WPINC . '/class.wp-styles.php' );
+require( ABSPATH . WPINC . '/functions.wp-styles.php' );
+
+function wp_default_scripts( &$scripts ) {
+ $scripts->base_url = site_url();
+ $scripts->default_version = get_bloginfo( 'version' );
+
+ $scripts->add( 'common', '/wp-admin/js/common.js', array('jquery'), '20080318' );
+ $scripts->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' );
+
+ $scripts->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3958' );
+ $scripts->localize( 'quicktags', 'quicktagsL10n', array(
+ 'quickLinks' => __('(Quick Links)'),
+ 'wordLookup' => __('Enter a word to look up:'),
+ 'dictionaryLookup' => attribute_escape(__('Dictionary lookup')),
+ 'lookup' => attribute_escape(__('lookup')),
+ 'closeAllOpenTags' => attribute_escape(__('Close all open tags')),
+ 'closeTags' => attribute_escape(__('close tags')),
+ 'enterURL' => __('Enter the URL'),
+ 'enterImageURL' => __('Enter the URL of the image'),
+ 'enterImageDescription' => __('Enter a description of the image')
+ ) );
- $this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', array('prototype'), '3517' );
+ $scripts->add( 'colorpicker', '/wp-includes/js/colorpicker.js', array('prototype'), '3517' );
- // Let a plugin replace the visual editor
- $visual_editor = apply_filters('visual_editor', array('tiny_mce'));
- $this->add( 'editor', false, $visual_editor, '20080321' );
+ // Let a plugin replace the visual editor
+ $visual_editor = apply_filters('visual_editor', array('tiny_mce'));
+ $scripts->add( 'editor', false, $visual_editor, '20080321' );
- $this->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080325' );
+ $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080325' );
- // Modify this version when tinyMCE plugins are changed.
- $mce_version = apply_filters('tiny_mce_version', '20080414');
- $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version );
+ // Modify this version when tinyMCE plugins are changed.
+ $mce_version = apply_filters('tiny_mce_version', '20080606');
+ $scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version );
- $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');
+ $scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');
- $this->add( 'wp-ajax-response', '/wp-includes/js/wp-ajax-response.js', array('jquery'), '20080316' );
- $this->localize( 'wp-ajax-response', 'wpAjax', array(
- 'noPerm' => __('You do not have permission to do that.'),
- 'broken' => __('An unidentified error has occurred.')
- ) );
+ $scripts->add( 'wp-ajax-response', '/wp-includes/js/wp-ajax-response.js', array('jquery'), '20080316' );
+ $scripts->localize( 'wp-ajax-response', 'wpAjax', array(
+ 'noPerm' => __('You do not have permission to do that.'),
+ 'broken' => __('An unidentified error has occurred.')
+ ) );
- $this->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080424' );
+ $scripts->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20080508' );
- $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306');
- $this->localize( 'wp-ajax', 'WPAjaxL10n', array(
- 'defaultUrl' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php',
- 'permText' => __("You do not have permission to do that."),
- 'strangeText' => __("Something strange happened. Try refreshing the page."),
- 'whoaText' => __("Slow down, I'm still sending your data!")
- ) );
+ $scripts->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('wp-ajax-response'), '20080411' );
+ $scripts->localize( 'wp-lists', 'wpListL10n', array(
+ 'url' => admin_url('admin-ajax.php')
+ ) );
- $this->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('wp-ajax-response'), '20080411' );
- $this->localize( 'wp-lists', 'wpListL10n', array(
- 'url' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php'
- ) );
+ $scripts->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/scriptaculous.js', array('prototype'), '1.8.0');
+ $scripts->add( 'scriptaculous-builder', '/wp-includes/js/scriptaculous/builder.js', array('scriptaculous-root'), '1.8.0');
+ $scripts->add( 'scriptaculous-dragdrop', '/wp-includes/js/scriptaculous/dragdrop.js', array('scriptaculous-builder', 'scriptaculous-effects'), '1.8.0');
+ $scripts->add( 'scriptaculous-effects', '/wp-includes/js/scriptaculous/effects.js', array('scriptaculous-root'), '1.8.0');
+ $scripts->add( 'scriptaculous-slider', '/wp-includes/js/scriptaculous/slider.js', array('scriptaculous-effects'), '1.8.0');
+ $scripts->add( 'scriptaculous-sound', '/wp-includes/js/scriptaculous/sound.js', array( 'scriptaculous-root' ), '1.8.0' );
+ $scripts->add( 'scriptaculous-controls', '/wp-includes/js/scriptaculous/controls.js', array('scriptaculous-root'), '1.8.0');
+ $scripts->add( 'scriptaculous', '', array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls'), '1.8.0');
+
+ $scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118');
+
+ $scripts->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.2.6');
+ $scripts->add( 'jquery-form', '/wp-includes/js/jquery/jquery.form.js', array('jquery'), '2.02');
+ $scripts->add( 'jquery-color', '/wp-includes/js/jquery/jquery.color.js', array('jquery'), '2.0-4561');
+ $scripts->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.2' );
+ $scripts->add( 'suggest', '/wp-includes/js/jquery/suggest.js', array('jquery'), '1.1');
+ $scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array('jquery'), '20');
+ $scripts->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1-20080430');
+ $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.1.0');
+ $scripts->add( 'swfupload-degrade', '/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js', array('swfupload'), '2.1.0');
+ $scripts->localize( 'swfupload-degrade', 'uploadDegradeOptions', array(
+ 'is_lighttpd_before_150' => is_lighttpd_before_150(),
+ ) );
+ $scripts->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2.1.0');
+ $scripts->add( 'swfupload-handlers', '/wp-includes/js/swfupload/handlers.js', array('swfupload'), '2.1.0');
+ // these error messages came from the sample swfupload js, they might need changing.
+ $scripts->localize( 'swfupload-handlers', 'swfuploadL10n', array(
+ 'queue_limit_exceeded' => __('You have attempted to queue too many files.'),
+ 'file_exceeds_size_limit' => sprintf(__('This file is too big. Your php.ini upload_max_filesize is %s.'), @ini_get('upload_max_filesize')),
+ 'zero_byte_file' => __('This file is empty. Please try another.'),
+ 'invalid_filetype' => __('This file type is not allowed. Please try another.'),
+ 'default_error' => __('An error occurred in the upload. Please try again later.'),
+ 'missing_upload_url' => __('There was a configuration error. Please contact the server administrator.'),
+ 'upload_limit_exceeded' => __('You may only upload 1 file.'),
+ 'http_error' => __('HTTP error.'),
+ 'upload_failed' => __('Upload failed.'),
+ 'io_error' => __('IO error.'),
+ 'security_error' => __('Security error.'),
+ 'file_cancelled' => __('File cancelled.'),
+ 'upload_stopped' => __('Upload stopped.'),
+ 'dismiss' => __('Dismiss'),
+ 'crunching' => __('Crunching&hellip;'),
+ 'deleted' => __('Deleted'),
+ ) );
- $this->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/scriptaculous.js', array('prototype'), '1.8.0');
- $this->add( 'scriptaculous-builder', '/wp-includes/js/scriptaculous/builder.js', array('scriptaculous-root'), '1.8.0');
- $this->add( 'scriptaculous-dragdrop', '/wp-includes/js/scriptaculous/dragdrop.js', array('scriptaculous-builder', 'scriptaculous-effects'), '1.8.0');
- $this->add( 'scriptaculous-effects', '/wp-includes/js/scriptaculous/effects.js', array('scriptaculous-root'), '1.8.0');
- $this->add( 'scriptaculous-slider', '/wp-includes/js/scriptaculous/slider.js', array('scriptaculous-effects'), '1.8.0');
- $this->add( 'scriptaculous-sound', '/wp-includes/js/scriptaculous/sound.js', array( 'scriptaculous-root' ), '1.8.0' );
- $this->add( 'scriptaculous-controls', '/wp-includes/js/scriptaculous/controls.js', array('scriptaculous-root'), '1.8.0');
- $this->add( 'scriptaculous', '', array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls'), '1.8.0');
-
- $this->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118');
-
- $this->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.2.3');
- $this->add( 'jquery-form', '/wp-includes/js/jquery/jquery.form.js', array('jquery'), '2.02');
- $this->add( 'jquery-color', '/wp-includes/js/jquery/jquery.color.js', array('jquery'), '2.0-4561');
- $this->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.2' );
- $this->add( 'dimensions', '/wp-includes/js/jquery/jquery.dimensions.min.js', array('jquery'), '1.1.2');
- $this->add( 'suggest', '/wp-includes/js/jquery/suggest.js', array('dimensions'), '1.1');
- $this->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array('jquery'), '20');
- $this->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1-20080430');
- $this->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.0.2-20080430');
- $this->add( 'swfupload-degrade', '/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js', array('swfupload'), '2.0.2');
- $this->localize( 'swfupload-degrade', 'uploadDegradeOptions', array(
- 'is_lighttpd_before_150' => is_lighttpd_before_150(),
+ $scripts->add( 'jquery-ui-core', '/wp-includes/js/jquery/ui.core.js', array('jquery'), '1.5' );
+ $scripts->add( 'jquery-ui-tabs', '/wp-includes/js/jquery/ui.tabs.js', array('jquery-ui-core'), '1.5' );
+ $scripts->add( 'jquery-ui-sortable', '/wp-includes/js/jquery/ui.sortable.js', array('jquery-ui-core'), '1.5' );
+
+ if ( is_admin() ) {
+ $scripts->add( 'ajaxcat', '/wp-admin/js/cat.js', array( 'wp-lists' ), '20071101' );
+ $scripts->localize( 'ajaxcat', 'catL10n', array(
+ 'add' => attribute_escape(__('Add')),
+ 'how' => __('Separate multiple categories with commas.')
) );
- $this->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2.0.2');
- $this->add( 'swfupload-handlers', '/wp-includes/js/swfupload/handlers.js', array('swfupload'), '2.0.2-20080407');
- // these error messages came from the sample swfupload js, they might need changing.
- $this->localize( 'swfupload-handlers', 'swfuploadL10n', array(
- 'queue_limit_exceeded' => __('You have attempted to queue too many files.'),
- 'file_exceeds_size_limit' => sprintf(__('This file is too big. Your php.ini upload_max_filesize is %s.'), @ini_get('upload_max_filesize')),
- 'zero_byte_file' => __('This file is empty. Please try another.'),
- 'invalid_filetype' => __('This file type is not allowed. Please try another.'),
- 'default_error' => __('An error occurred in the upload. Please try again later.'),
- 'missing_upload_url' => __('There was a configuration error. Please contact the server administrator.'),
- 'upload_limit_exceeded' => __('You may only upload 1 file.'),
- 'http_error' => __('HTTP error.'),
- 'upload_failed' => __('Upload failed.'),
- 'io_error' => __('IO error.'),
- 'security_error' => __('Security error.'),
- 'file_cancelled' => __('File cancelled.'),
- 'upload_stopped' => __('Upload stopped.'),
- 'dismiss' => __('Dismiss'),
- 'crunching' => __('Crunching&hellip;'),
- 'deleted' => __('Deleted'),
+ $scripts->add( 'admin-categories', '/wp-admin/js/categories.js', array('wp-lists'), '20071031' );
+ $scripts->add( 'admin-tags', '/wp-admin/js/tags.js', array('wp-lists'), '20071031' );
+ $scripts->add( 'admin-custom-fields', '/wp-admin/js/custom-fields.js', array('wp-lists'), '20070823' );
+ $scripts->add( 'password-strength-meter', '/wp-admin/js/password-strength-meter.js', array('jquery'), '20070405' );
+ $scripts->localize( 'password-strength-meter', 'pwsL10n', array(
+ 'short' => __('Too short'),
+ 'bad' => __('Bad'),
+ 'good' => __('Good'),
+ 'strong' => __('Strong')
) );
-
- $this->add( 'jquery-ui-tabs', '/wp-includes/js/jquery/ui.tabs.js', array('jquery'), '3' );
-
- if ( is_admin() ) {
- $this->add( 'ajaxcat', '/wp-admin/js/cat.js', array( 'wp-lists' ), '20071101' );
- $this->localize( 'ajaxcat', 'catL10n', array(
- 'add' => attribute_escape(__('Add')),
- 'how' => __('Separate multiple categories with commas.')
- ) );
- $this->add( 'admin-categories', '/wp-admin/js/categories.js', array('wp-lists'), '20071031' );
- $this->add( 'admin-tags', '/wp-admin/js/tags.js', array('wp-lists'), '20071031' );
- $this->add( 'admin-custom-fields', '/wp-admin/js/custom-fields.js', array('wp-lists'), '20070823' );
- $this->add( 'password-strength-meter', '/wp-admin/js/password-strength-meter.js', array('jquery'), '20070405' );
- $this->localize( 'password-strength-meter', 'pwsL10n', array(
- 'short' => __('Too short'),
- 'bad' => __('Bad'),
- 'good' => __('Good'),
- 'strong' => __('Strong')
- ) );
- $this->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists'), '20080311' );
- $this->localize( 'admin-comments', 'adminCommentsL10n', array(
- 'pending' => __('%i% pending') // must look like: "# blah blah"
- ) );
- $this->add( 'admin-users', '/wp-admin/js/users.js', array('wp-lists'), '20070823' );
- $this->add( 'admin-forms', '/wp-admin/js/forms.js', false, '20080317' );
- $this->add( 'xfn', '/wp-admin/js/xfn.js', false, '3517' );
- $this->add( 'upload', '/wp-admin/js/upload.js', array('jquery'), '20070518' );
- $this->add( 'postbox', '/wp-admin/js/postbox.js', array('jquery'), '20080128' );
- $this->localize( 'postbox', 'postboxL10n', array(
- 'requestFile' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php',
- ) );
- $this->add( 'slug', '/wp-admin/js/slug.js', array('jquery'), '20080208' );
- $this->localize( 'slug', 'slugL10n', array(
- 'requestFile' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php',
- 'save' => __('Save'),
- 'cancel' => __('Cancel'),
- ) );
- $this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20080422' );
- $this->localize( 'post', 'postL10n', array(
- 'tagsUsed' => __('Tags used on this post:'),
- 'add' => attribute_escape(__('Add')),
- 'addTag' => attribute_escape(__('Add new tag')),
- 'separate' => __('Separate tags with commas'),
- 'cancel' => __('Cancel'),
- 'edit' => __('Edit'),
- ) );
- $this->add( 'page', '/wp-admin/js/page.js', array('jquery', 'slug', 'postbox'), '20080318' );
- $this->localize( 'page', 'postL10n', array(
- 'cancel' => __('Cancel'),
- 'edit' => __('Edit'),
- ) );
- $this->add( 'link', '/wp-admin/js/link.js', array('jquery-ui-tabs', 'wp-lists', 'postbox'), '20080131' );
- $this->add( 'comment', '/wp-admin/js/comment.js', array('postbox'), '20080219' );
- $this->localize( 'comment', 'commentL10n', array(
- 'cancel' => __('Cancel'),
- 'edit' => __('Edit'),
- ) );
- $this->add( 'media-upload', '/wp-admin/js/media-upload.js', false, '20080430' );
- $this->localize( 'upload', 'uploadL10n', array(
- 'browseTitle' => attribute_escape(__('Browse your files')),
- 'back' => __('&laquo; Back'),
- 'directTitle' => attribute_escape(__('Direct link to file')),
- 'edit' => __('Edit'),
- 'thumb' => __('Thumbnail'),
- 'full' => __('Full size'),
- 'icon' => __('Icon'),
- 'title' => __('Title'),
- 'show' => __('Show:'),
- 'link' => __('Link to:'),
- 'file' => __('File'),
- 'page' => __('Page'),
- 'none' => __('None'),
- 'editorText' => attribute_escape(__('Send to editor &raquo;')),
- 'insert' => __('Insert'),
- 'urlText' => __('URL'),
- 'desc' => __('Description'),
- 'deleteText' => attribute_escape(__('Delete File')),
- 'saveText' => attribute_escape(__('Save &raquo;')),
- 'confirmText' => __("Are you sure you want to delete the file '%title%'?\nClick ok to delete or cancel to go back.")
- ) );
- $this->add( 'admin-widgets', '/wp-admin/js/widgets.js', array( 'interface' ), '20080503' );
- $this->localize( 'admin-widgets', 'widgetsL10n', array(
- 'add' => __('Add'),
- 'edit' => __('Edit'),
- 'cancel' => __('Cancel'),
- ));
- $this->add( 'editor', '/wp-admin/js/editor.js', array('tiny_mce'), '20080221' );
- }
- }
-
- /**
- * Prints script tags
- *
- * Prints the scripts passed to it or the print queue. Also prints all necessary dependencies.
- *
- * @param mixed handles (optional) Scripts to be printed. (void) prints queue, (string) prints that script, (array of strings) prints those scripts.
- * @return array Scripts that have been printed
- */
- function print_scripts( $handles = false ) {
- global $wp_db_version;
-
- // Print the queue if nothing is passed. If a string is passed, print that script. If an array is passed, print those scripts.
- $handles = false === $handles ? $this->queue : (array) $handles;
- $this->all_deps( $handles );
-
- $to_print = apply_filters( 'print_scripts_array', array_keys($this->to_print) );
-
- foreach( $to_print as $handle ) {
- if ( !in_array($handle, $this->printed) && isset($this->scripts[$handle]) ) {
- if ( $this->scripts[$handle]->src ) { // Else it defines a group.
- $ver = $this->scripts[$handle]->ver ? $this->scripts[$handle]->ver : $wp_db_version;
- if ( isset($this->args[$handle]) )
- $ver .= '&amp;' . $this->args[$handle];
- $src = 0 === strpos($this->scripts[$handle]->src, 'http://') ? $this->scripts[$handle]->src : get_option( 'siteurl' ) . $this->scripts[$handle]->src;
- $src = $this->scripts[$handle]->src;
-
- if (!preg_match('|^https?://|', $src)) {
- $src = get_option('siteurl') . $src;
- }
-
- $src = add_query_arg('ver', $ver, $src);
- $src = clean_url(apply_filters( 'script_loader_src', $src ));
- $this->print_scripts_l10n( $handle );
- echo "<script type='text/javascript' src='$src'></script>\n";
- }
- $this->printed[] = $handle;
- }
- }
-
- $this->to_print = array();
- return $this->printed;
- }
-
- function print_scripts_l10n( $handle ) {
- if ( empty($this->scripts[$handle]->l10n_object) || empty($this->scripts[$handle]->l10n) || !is_array($this->scripts[$handle]->l10n) )
- return;
-
- $object_name = $this->scripts[$handle]->l10n_object;
-
- echo "<script type='text/javascript'>\n";
- echo "/* <![CDATA[ */\n";
- echo "\t$object_name = {\n";
- $eol = '';
- foreach ( $this->scripts[$handle]->l10n as $var => $val ) {
- echo "$eol\t\t$var: \"" . js_escape( $val ) . '"';
- $eol = ",\n";
- }
- echo "\n\t}\n";
- echo "/* ]]> */\n";
- echo "</script>\n";
- }
-
- /**
- * Determines dependencies of scripts
- *
- * Recursively builds array of scripts to print taking dependencies into account. Does NOT catch infinite loops.
- *
- * @param mixed handles Accepts (string) script name or (array of strings) script names
- * @param bool recursion Used internally when function calls itself
- */
- function all_deps( $handles, $recursion = false ) {
- if ( !$handles = (array) $handles )
- return false;
-
- foreach ( $handles as $handle ) {
- $handle = explode('?', $handle);
- if ( isset($handle[1]) )
- $this->args[$handle[0]] = $handle[1];
- $handle = $handle[0];
-
- if ( isset($this->to_print[$handle]) ) // Already grobbed it and its deps
- continue;
-
- $keep_going = true;
- if ( !isset($this->scripts[$handle]) )
- $keep_going = false; // Script doesn't exist
- elseif ( $this->scripts[$handle]->deps && array_diff($this->scripts[$handle]->deps, array_keys($this->scripts)) )
- $keep_going = false; // Script requires deps which don't exist (not a necessary check. efficiency?)
- elseif ( $this->scripts[$handle]->deps && !$this->all_deps( $this->scripts[$handle]->deps, true ) )
- $keep_going = false; // Script requires deps which don't exist
-
- if ( !$keep_going ) { // Either script or its deps don't exist.
- if ( $recursion )
- return false; // Abort this branch.
- else
- continue; // We're at the top level. Move on to the next one.
- }
-
- $this->to_print[$handle] = true;
- }
-
- return true;
- }
-
- /**
- * Adds script
- *
- * Adds the script only if no script of that name already exists
- *
- * @param string handle Script name
- * @param string src Script url
- * @param array deps (optional) Array of script names on which this script depends
- * @param string ver (optional) Script version (used for cache busting)
- * @return array Hierarchical array of dependencies
- */
- function add( $handle, $src, $deps = array(), $ver = false ) {
- if ( isset($this->scripts[$handle]) )
- return false;
- $this->scripts[$handle] = new _WP_Script( $handle, $src, $deps, $ver );
- return true;
- }
-
- /**
- * Localizes a script
- *
- * Localizes only if script has already been added
- *
- * @param string handle Script name
- * @param string object_name Name of JS object to hold l10n info
- * @param array l10n Array of JS var name => localized string
- * @return bool Successful localization
- */
- function localize( $handle, $object_name, $l10n ) {
- if ( !isset($this->scripts[$handle]) )
- return false;
- return $this->scripts[$handle]->localize( $object_name, $l10n );
- }
-
- function remove( $handles ) {
- foreach ( (array) $handles as $handle )
- unset($this->scripts[$handle]);
- }
-
- function enqueue( $handles ) {
- foreach ( (array) $handles as $handle ) {
- $handle = explode('?', $handle);
- if ( !in_array($handle[0], $this->queue) && isset($this->scripts[$handle[0]]) ) {
- $this->queue[] = $handle[0];
- if ( isset($handle[1]) )
- $this->args[$handle[0]] = $handle[1];
- }
- }
- }
-
- function dequeue( $handles ) {
- foreach ( (array) $handles as $handle )
- unset( $this->queue[$handle] );
- }
-
- function query( $handle, $list = 'scripts' ) { // scripts, queue, or printed
- switch ( $list ) :
- case 'scripts':
- if ( isset($this->scripts[$handle]) )
- return $this->scripts[$handle];
- break;
- default:
- if ( in_array($handle, $this->$list) )
- return true;
- break;
- endswitch;
- return false;
- }
-
-}
-
-class _WP_Script {
- var $handle;
- var $src;
- var $deps = array();
- var $ver = false;
- var $l10n_object = '';
- var $l10n = array();
-
- function _WP_Script() {
- @list($this->handle, $this->src, $this->deps, $this->ver) = func_get_args();
- if ( !is_array($this->deps) )
- $this->deps = array();
- if ( !$this->ver )
- $this->ver = false;
- }
-
- function localize( $object_name, $l10n ) {
- if ( !$object_name || !is_array($l10n) )
- return false;
- $this->l10n_object = $object_name;
- $this->l10n = $l10n;
- return true;
+ $scripts->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists'), '20080311' );
+ $scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
+ 'pending' => __('%i% pending') // must look like: "# blah blah"
+ ) );
+ $scripts->add( 'admin-users', '/wp-admin/js/users.js', array('wp-lists'), '20070823' );
+ $scripts->add( 'admin-forms', '/wp-admin/js/forms.js', false, '20080401');
+ $scripts->add( 'xfn', '/wp-admin/js/xfn.js', false, '3517' );
+ $scripts->add( 'upload', '/wp-admin/js/upload.js', array('jquery'), '20070518' );
+ $scripts->add( 'postbox', '/wp-admin/js/postbox.js', array('jquery'), '20080128' );
+ $scripts->localize( 'postbox', 'postboxL10n', array(
+ 'requestFile' => admin_url('admin-ajax.php'),
+ ) );
+ $scripts->add( 'slug', '/wp-admin/js/slug.js', array('jquery'), '20080208' );
+ $scripts->localize( 'slug', 'slugL10n', array(
+ 'requestFile' => admin_url('admin-ajax.php'),
+ 'save' => __('Save'),
+ 'cancel' => __('Cancel'),
+ ) );
+ $scripts->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20080519' );
+ $scripts->localize( 'post', 'postL10n', array(
+ 'tagsUsed' => __('Tags used on this post:'),
+ 'add' => attribute_escape(__('Add')),
+ 'addTag' => attribute_escape(__('Add new tag')),
+ 'separate' => __('Separate tags with commas'),
+ 'cancel' => __('Cancel'),
+ 'edit' => __('Edit'),
+ ) );
+ $scripts->add( 'page', '/wp-admin/js/page.js', array('jquery', 'slug', 'postbox'), '20080318' );
+ $scripts->localize( 'page', 'postL10n', array(
+ 'cancel' => __('Cancel'),
+ 'edit' => __('Edit'),
+ ) );
+ $scripts->add( 'link', '/wp-admin/js/link.js', array('jquery-ui-tabs', 'wp-lists', 'postbox'), '20080131' );
+ $scripts->add( 'comment', '/wp-admin/js/comment.js', array('postbox'), '20080219' );
+ $scripts->localize( 'comment', 'commentL10n', array(
+ 'cancel' => __('Cancel'),
+ 'edit' => __('Edit'),
+ ) );
+ $scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080520' );
+ $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20080523' );
+ $scripts->localize( 'upload', 'uploadL10n', array(
+ 'browseTitle' => attribute_escape(__('Browse your files')),
+ 'back' => __('&laquo; Back'),
+ 'directTitle' => attribute_escape(__('Direct link to file')),
+ 'edit' => __('Edit'),
+ 'thumb' => __('Thumbnail'),
+ 'full' => __('Full size'),
+ 'icon' => __('Icon'),
+ 'title' => __('Title'),
+ 'show' => __('Show:'),
+ 'link' => __('Link to:'),
+ 'file' => __('File'),
+ 'page' => __('Page'),
+ 'none' => __('None'),
+ 'editorText' => attribute_escape(__('Send to editor &raquo;')),
+ 'insert' => __('Insert'),
+ 'urlText' => __('URL'),
+ 'desc' => __('Description'),
+ 'deleteText' => attribute_escape(__('Delete File')),
+ 'saveText' => attribute_escape(__('Save &raquo;')),
+ 'confirmText' => __("Are you sure you want to delete the file '%title%'?\nClick ok to delete or cancel to go back.")
+ ) );
+ $scripts->add( 'admin-widgets', '/wp-admin/js/widgets.js', array( 'interface' ), '20080503' );
+ $scripts->localize( 'admin-widgets', 'widgetsL10n', array(
+ 'add' => __('Add'),
+ 'edit' => __('Edit'),
+ 'cancel' => __('Cancel'),
+ ));
+
+ $scripts->add( 'word-count', '/wp-admin/js/word-count.js', array( 'jquery' ), '20080423' );
+ $scripts->localize( 'word-count', 'wordCountL10n', array(
+ 'count' => __('Word count: %d')
+ ));
+
+ $scripts->add( 'wp-gears', '/wp-admin/js/wp-gears.js', false, '20080511' );
+ $scripts->localize( 'wp-gears', 'wpGearsL10n', array(
+ 'updateCompleted' => __('Update completed.'),
+ 'error' => __('Error:')
+ ));
+
+ $scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'jquery' ), '20080523' );
}
}
-/**
- * Prints script tags in document head
- *
- * Called by admin-header.php and by wp_head hook. Since it is called by wp_head on every page load,
- * the function does not instantiate the WP_Scripts object unless script names are explicitly passed.
- * Does make use of already instantiated $wp_scripts if present.
- * Use provided wp_print_scripts hook to register/enqueue new scripts.
- *
- * @see WP_Scripts::print_scripts()
- */
-function wp_print_scripts( $handles = false ) {
- do_action( 'wp_print_scripts' );
- if ( '' === $handles ) // for wp_head
- $handles = false;
-
- global $wp_scripts;
- if ( !is_a($wp_scripts, 'WP_Scripts') ) {
- if ( !$handles )
- return array(); // No need to instantiate if nothing's there.
- else
- $wp_scripts = new WP_Scripts();
- }
-
- return $wp_scripts->print_scripts( $handles );
-}
+function wp_default_styles( &$styles ) {
+ $styles->base_url = site_url();
+ $styles->default_version = get_bloginfo( 'version' );
+ $styles->text_direction = 'rtl' == get_bloginfo( 'text_direction' ) ? 'rtl' : 'ltr';
-function wp_register_script( $handle, $src, $deps = array(), $ver = false ) {
- global $wp_scripts;
- if ( !is_a($wp_scripts, 'WP_Scripts') )
- $wp_scripts = new WP_Scripts();
+ $rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets' );
- $wp_scripts->add( $handle, $src, $deps, $ver );
-}
+ $styles->add( 'wp-admin', '/wp-admin/wp-admin.css' );
+ $styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' );
-/**
- * Localizes a script
- *
- * Localizes only if script has already been added
- *
- * @see WP_Script::localize()
- */
-function wp_localize_script( $handle, $object_name, $l10n ) {
- global $wp_scripts;
- if ( !is_a($wp_scripts, 'WP_Scripts') )
- return false;
-
- return $wp_scripts->localize( $handle, $object_name, $l10n );
-}
+ $styles->add( 'ie', '/wp-admin/css/ie.css' );
+ $styles->add_data( 'ie', 'conditional', 'gte IE 6' );
-function wp_deregister_script( $handle ) {
- global $wp_scripts;
- if ( !is_a($wp_scripts, 'WP_Scripts') )
- $wp_scripts = new WP_Scripts();
+ $styles->add( 'colors', true ); // Register "meta" stylesheet for admin colors
+ $styles->add( 'colors-fresh', '/wp-admin/css/colors-fresh.css' ); // for login.php. Is there a better way?
+ $styles->add_data( 'colors-fresh', 'rtl', true );
- $wp_scripts->remove( $handle );
-}
+ $styles->add( 'global', '/wp-admin/css/global.css' );
+ $styles->add( 'media', '/wp-admin/css/media.css', array(), '20080523' );
+ $styles->add( 'widgets', '/wp-admin/css/widgets.css' );
+ $styles->add( 'dashboard', '/wp-admin/css/dashboard.css' );
+ $styles->add( 'install', '/wp-admin/css/install.css' );
+ $styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css' );
+ $styles->add( 'press-this', '/wp-admin/css/press-this.css' );
+ $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css' );
+ $styles->add( 'login', '/wp-admin/css/login.css' );
-/**
- * Equeues script
- *
- * Registers the script if src provided (does NOT overwrite) and enqueues.
- *
- * @see WP_Script::add(), WP_Script::enqueue()
-*/
-function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false ) {
- global $wp_scripts;
- if ( !is_a($wp_scripts, 'WP_Scripts') )
- $wp_scripts = new WP_Scripts();
-
- if ( $src ) {
- $_handle = explode('?', $handle);
- $wp_scripts->add( $_handle[0], $src, $deps, $ver );
- }
- $wp_scripts->enqueue( $handle );
+ foreach ( $rtl_styles as $rtl_style )
+ $styles->add_data( $rtl_style, 'rtl', true );
}
function wp_prototype_before_jquery( $js_array ) {
@@ -497,12 +257,36 @@ function wp_just_in_time_script_localization() {
'autosaveInterval' => AUTOSAVE_INTERVAL,
'previewPageText' => __('Preview this Page'),
'previewPostText' => __('Preview this Post'),
- 'requestFile' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php',
+ 'requestFile' => admin_url('admin-ajax.php'),
'savingText' => __('Saving Draft&#8230;')
) );
}
+function wp_style_loader_src( $src, $handle ) {
+ if ( defined('WP_INSTALLING') )
+ return preg_replace( '#^wp-admin/#', './', $src );
+
+ if ( 'colors' == $handle || 'colors-rtl' == $handle ) {
+ global $_wp_admin_css_colors;
+ $color = get_user_option('admin_color');
+ if ( empty($color) || !isset($_wp_admin_css_colors[$color]) )
+ $color = 'fresh';
+ $color = $_wp_admin_css_colors[$color];
+ $parsed = parse_url( $src );
+ $url = $color->url;
+ if ( isset($parsed['query']) && $parsed['query'] ) {
+ wp_parse_str( $parsed['query'], $qv );
+ $url = add_query_arg( $qv, $url );
+ }
+ return $url;
+ }
+
+ return $src;
+}
+
+add_action( 'wp_default_scripts', 'wp_default_scripts' );
add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' );
add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' );
-?>
+add_action( 'wp_default_styles', 'wp_default_styles' );
+add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 );
diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php
index 907f7ff..490f7a6 100644
--- a/wp-includes/shortcodes.php
+++ b/wp-includes/shortcodes.php
@@ -134,6 +134,23 @@ function shortcode_atts($pairs, $atts) {
return $out;
}
+/*
+ * stip all the shortcodes from a post's content
+ * returns the content without shortcodes
+ */
+function strip_shortcodes( $content ) {
+
+ global $shortcode_tags;
+
+ if (empty($shortcode_tags) || !is_array($shortcode_tags))
+ return $content;
+
+ $pattern = get_shortcode_regex();
+
+ return preg_replace('/'.$pattern.'/s', '', $content);
+
+}
+
add_filter('the_content', 'do_shortcode', 11); // AFTER wpautop()
?>
diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php
index 4418e99..e150d21 100644
--- a/wp-includes/taxonomy.php
+++ b/wp-includes/taxonomy.php
@@ -159,7 +159,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
$args = wp_parse_args($args, $defaults);
if ( false !== $args['query_var'] && !empty($wp) ) {
- if ( empty($args['query_var']) )
+ if ( true === $args['query_var'] )
$args['query_var'] = $taxonomy;
$args['query_var'] = sanitize_title_with_dashes($args['query_var']);
$wp->add_query_var($args['query_var']);
@@ -751,7 +751,7 @@ function is_term($term, $taxonomy = '') {
}
if ( !empty($taxonomy) )
- return $wpdb->get_row("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = '$taxonomy'", ARRAY_A);
+ return $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $taxonomy), ARRAY_A);
return $wpdb->get_var("SELECT term_id FROM $wpdb->terms as t WHERE $where");
}
@@ -890,8 +890,7 @@ function wp_count_terms( $taxonomy, $args = array() ) {
if ( $ignore_empty )
$where = 'AND count > 0';
- $taxonomy = $wpdb->escape( $taxonomy );
- return $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE taxonomy = '$taxonomy' $where");
+ return $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE taxonomy = %s $where", $taxonomy) );
}
/**
@@ -920,7 +919,7 @@ function wp_delete_object_term_relationships( $object_id, $taxonomies ) {
foreach ( $taxonomies as $taxonomy ) {
$terms = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids');
$in_terms = "'" . implode("', '", $terms) . "'";
- $wpdb->query("DELETE FROM $wpdb->term_relationships WHERE object_id = '$object_id' AND term_taxonomy_id IN ($in_terms)");
+ $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_terms)", $object_id) );
wp_update_term_count($terms, $taxonomy);
}
}
@@ -1297,7 +1296,7 @@ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) {
$delete_terms = array_diff($old_terms, $tt_ids);
if ( $delete_terms ) {
$in_delete_terms = "'" . implode("', '", $delete_terms) . "'";
- $wpdb->query("DELETE FROM $wpdb->term_relationships WHERE object_id = '$object_id' AND term_taxonomy_id IN ($in_delete_terms)");
+ $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_delete_terms)", $object_id) );
wp_update_term_count($delete_terms, $taxonomy);
}
}
@@ -1306,10 +1305,10 @@ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) {
if ( ! $append && isset($t->sort) && $t->sort ) {
$values = array();
$term_order = 0;
- $final_term_ids = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids');
- foreach ( $term_ids as $term_id )
- if ( in_array($term_id, $final_term_ids) )
- $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $term_id, ++$term_order);
+ $final_tt_ids = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids');
+ foreach ( $tt_ids as $tt_id )
+ if ( in_array($tt_id, $final_tt_ids) )
+ $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tt_id, ++$term_order);
if ( $values )
$wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)");
}
diff --git a/wp-includes/template-loader.php b/wp-includes/template-loader.php
index eb44f68..e0647b0 100644
--- a/wp-includes/template-loader.php
+++ b/wp-includes/template-loader.php
@@ -20,6 +20,9 @@ if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) {
} else if ( is_search() && $template = get_search_template() ) {
include($template);
return;
+ } else if ( is_tax() && $template = get_taxonomy_template()) {
+ include($template);
+ return;
} else if ( is_home() && $template = get_home_template() ) {
include($template);
return;
@@ -39,9 +42,6 @@ if ( defined('WP_USE_THEMES') && constant('WP_USE_THEMES') ) {
} else if ( is_tag() && $template = get_tag_template()) {
include($template);
return;
- } else if ( is_tax() && $template = get_taxonomy_template()) {
- include($template);
- return;
} else if ( is_author() && $template = get_author_template() ) {
include($template);
return;
diff --git a/wp-includes/theme.php b/wp-includes/theme.php
index 2bff937..dafc073 100644
--- a/wp-includes/theme.php
+++ b/wp-includes/theme.php
@@ -128,8 +128,8 @@ function get_themes() {
$themes = array();
$wp_broken_themes = array();
$theme_loc = $theme_root = get_theme_root();
- if ( '/' != ABSPATH ) // don't want to replace all forward slashes, see Trac #4541
- $theme_loc = str_replace(ABSPATH, '', $theme_root);
+ if ( '/' != WP_CONTENT_DIR ) // don't want to replace all forward slashes, see Trac #4541
+ $theme_loc = str_replace(WP_CONTENT_DIR, '', $theme_root);
// Files in wp-content/themes directory and one subdir down
$themes_dir = @ opendir($theme_root);
@@ -333,11 +333,11 @@ function get_current_theme() {
}
function get_theme_root() {
- return apply_filters('theme_root', ABSPATH . "wp-content/themes");
+ return apply_filters('theme_root', WP_CONTENT_DIR . "/themes");
}
function get_theme_root_uri() {
- return apply_filters('theme_root_uri', get_option('siteurl') . "/wp-content/themes", get_option('siteurl'));
+ return apply_filters('theme_root_uri', WP_CONTENT_URL . "/themes", get_option('siteurl'));
}
function get_query_template($type) {
@@ -479,6 +479,48 @@ function locale_stylesheet() {
echo '<link rel="stylesheet" href="' . $stylesheet . '" type="text/css" media="screen" />';
}
+function preview_theme() {
+ if ( ! (isset($_GET['template']) && isset($_GET['preview'])) )
+ return;
+
+ if ( !current_user_can( 'switch_themes' ) )
+ return;
+
+ $_GET[template] = preg_replace('|[^a-z0-9]|i', '', $_GET[template]);
+
+ add_filter('template', create_function('', "return '$_GET[template]';") );
+
+ if ( isset($_GET['stylesheet']) ) {
+ $_GET[stylesheet] = preg_replace('|[^a-z0-9]|i', '', $_GET[stylesheet]);
+ add_filter('stylesheet', create_function('', "return '$_GET[stylesheet]';") );
+ }
+
+ ob_start( 'preview_theme_ob_filter' );
+}
+add_action('setup_theme', 'preview_theme');
+
+function preview_theme_ob_filter( $content ) {
+ return preg_replace_callback( "|(<a.*?href=([\"']))(.*?)([\"'].*?>)|", 'preview_theme_ob_filter_callback', $content );
+}
+
+function preview_theme_ob_filter_callback( $matches ) {
+ if (
+ ( false !== strpos($matches[3], '/wp-admin/') )
+ ||
+ ( false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], get_option('home')) )
+ ||
+ ( false !== strpos($matches[3], '/feed/') )
+ ||
+ ( false !== strpos($matches[3], '/trackback/') )
+ )
+ return $matches[1] . "#$matches[2] onclick=$matches[2]return false;" . $matches[4];
+
+ $link = add_query_arg( array('preview' => 1, 'template' => $_GET['template'], 'stylesheet' => @$_GET['stylesheet'] ), $matches[3] );
+ if ( 0 === strpos($link, 'preview=1') )
+ $link = "?$link";
+ return $matches[1] . attribute_escape( $link ) . $matches[4];
+}
+
function switch_theme($template, $stylesheet) {
update_option('template', $template);
update_option('stylesheet', $stylesheet);
diff --git a/wp-includes/user.php b/wp-includes/user.php
index 1daf3cd..b36231f 100644
--- a/wp-includes/user.php
+++ b/wp-includes/user.php
@@ -1,6 +1,6 @@
<?php
-function wp_signon( $credentials = '' ) {
+function wp_signon( $credentials = '', $secure_cookie = '' ) {
if ( empty($credentials) ) {
if ( ! empty($_POST['log']) )
$credentials['user_login'] = $_POST['log'];
@@ -21,13 +21,21 @@ function wp_signon( $credentials = '' ) {
do_action_ref_array('wp_authenticate', array(&$credentials['user_login'], &$credentials['user_password']));
+ if ( '' === $secure_cookie )
+ $secure_cookie = is_ssl() ? true : false;
+
// If no credential info provided, check cookie.
if ( empty($credentials['user_login']) && empty($credentials['user_password']) ) {
$user = wp_validate_auth_cookie();
if ( $user )
return new WP_User($user);
- if ( !empty($_COOKIE[AUTH_COOKIE]) )
+ if ( $secure_cookie )
+ $auth_cookie = SECURE_AUTH_COOKIE;
+ else
+ $auth_cookie = AUTH_COOKIE;
+
+ if ( !empty($_COOKIE[$auth_cookie]) )
return new WP_Error('expired_session', __('Please log in again.'));
// If the cookie is not set, be silent.
@@ -48,7 +56,7 @@ function wp_signon( $credentials = '' ) {
if ( is_wp_error($user) )
return $user;
- wp_set_auth_cookie($user->ID, $credentials['remember']);
+ wp_set_auth_cookie($user->ID, $credentials['remember'], $secure_cookie);
do_action('wp_login', $credentials['user_login']);
return $user;
}
@@ -57,13 +65,13 @@ function get_profile($field, $user = false) {
global $wpdb;
if ( !$user )
$user = $wpdb->escape($_COOKIE[USER_COOKIE]);
- return $wpdb->get_var("SELECT $field FROM $wpdb->users WHERE user_login = '$user'");
+ return $wpdb->get_var( $wpdb->prepare("SELECT $field FROM $wpdb->users WHERE user_login = %s", $user) );
}
function get_usernumposts($userid) {
global $wpdb;
$userid = (int) $userid;
- return $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '$userid' AND post_type = 'post' AND " . get_private_posts_cap_sql('post'));
+ return $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = %d AND post_type = 'post' AND ", $userid) . get_private_posts_cap_sql('post'));
}
// TODO: xmlrpc only. Maybe move to xmlrpc.php.
@@ -130,9 +138,9 @@ function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) {
$meta_value = trim( $meta_value );
if ( ! empty($meta_value) )
- $wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key' AND meta_value = '$meta_value'");
+ $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $userid, $meta_key, $meta_value) );
else
- $wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'");
+ $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
wp_cache_delete($user_id, 'users');
@@ -183,19 +191,18 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) {
if ( is_string($meta_value) )
$meta_value = stripslashes($meta_value);
$meta_value = maybe_serialize($meta_value);
- $meta_value = $wpdb->escape($meta_value);
if (empty($meta_value)) {
return delete_usermeta($user_id, $meta_key);
}
- $cur = $wpdb->get_row("SELECT * FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'");
+ $cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
if ( !$cur ) {
- $wpdb->query("INSERT INTO $wpdb->usermeta ( user_id, meta_key, meta_value )
+ $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->usermeta ( user_id, meta_key, meta_value )
VALUES
- ( '$user_id', '$meta_key', '$meta_value' )");
+ ( %d, %s, %s )", $user_id, $meta_key, $meta_value) );
} else if ( $cur->meta_value != $meta_value ) {
- $wpdb->query("UPDATE $wpdb->usermeta SET meta_value = '$meta_value' WHERE user_id = '$user_id' AND meta_key = '$meta_key'");
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->usermeta SET meta_value = %s WHERE user_id = %d AND meta_key = %s", $meta_value, $user_id, $meta_key) );
} else {
return false;
}
diff --git a/wp-includes/version.php b/wp-includes/version.php
index d2aa5cc..183fc5f 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -8,7 +8,7 @@
*
* @global string $wp_version
*/
-$wp_version = '2.5.2-alpha';
+$wp_version = '2.6-bleeding2';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB scheme
@@ -16,7 +16,7 @@ $wp_version = '2.5.2-alpha';
*
* @global int $wp_db_version
*/
-$wp_db_version = 7935;
+$wp_db_version = 8000;
$wpmu_version = '1.5.2-alpha';
?>
diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php
index 1c356e6..f396547 100644
--- a/wp-includes/widgets.php
+++ b/wp-includes/widgets.php
@@ -95,6 +95,8 @@ function register_sidebar_widget($name, $output_callback, $classname = '') {
function wp_register_sidebar_widget($id, $name, $output_callback, $options = array()) {
global $wp_registered_widgets;
+ $id = strtolower($id);
+
if ( empty($output_callback) ) {
unset($wp_registered_widgets[$id]);
return;
@@ -164,6 +166,8 @@ function register_widget_control($name, $control_callback, $width = '', $height
*/
function wp_register_widget_control($id, $name, $control_callback, $options = array()) {
global $wp_registered_widget_controls;
+
+ $id = strtolower($id);
if ( empty($control_callback) ) {
unset($wp_registered_widget_controls[$id]);
@@ -306,9 +310,9 @@ function wp_get_sidebars_widgets($update = true) {
$_sidebars_widgets[$index][$i] = $id;
continue;
}
-
+
$found = false;
-
+
foreach ( $wp_registered_widgets as $widget_id => $widget ) {
if ( strtolower($widget['name']) == strtolower($name) ) {
$_sidebars_widgets[$index][$i] = $widget['id'];
@@ -320,10 +324,10 @@ function wp_get_sidebars_widgets($update = true) {
break;
}
}
-
+
if ( $found )
continue;
-
+
unset($_sidebars_widgets[$index][$i]);
}
$_sidebars_widgets['array_version'] = 2;
@@ -381,7 +385,7 @@ function wp_widget_pages( $args ) {
extract( $args );
$options = get_option( 'widget_pages' );
- $title = empty( $options['title'] ) ? __( 'Pages' ) : $options['title'];
+ $title = empty( $options['title'] ) ? __( 'Pages' ) : apply_filters('widget_title', $options['title']);
$sortby = empty( $options['sortby'] ) ? 'menu_order' : $options['sortby'];
$exclude = empty( $options['exclude'] ) ? '' : $options['exclude'];
@@ -461,6 +465,7 @@ function wp_widget_search($args) {
<?php echo $before_widget; ?>
<form id="searchform" method="get" action="<?php bloginfo('home'); ?>">
<div>
+ <label class="hidden" for="s"><?php _e('Search for:'); ?></label>
<input type="text" name="s" id="s" size="15" /><br />
<input type="submit" value="<?php echo attribute_escape(__('Search')); ?>" />
</div>
@@ -474,7 +479,7 @@ function wp_widget_archives($args) {
$options = get_option('widget_archives');
$c = $options['count'] ? '1' : '0';
$d = $options['dropdown'] ? '1' : '0';
- $title = empty($options['title']) ? __('Archives') : $options['title'];
+ $title = empty($options['title']) ? __('Archives') : apply_filters('widget_title', $options['title']);
echo $before_widget;
echo $before_title . $title . $after_title;
@@ -522,7 +527,7 @@ function wp_widget_archives_control() {
function wp_widget_meta($args) {
extract($args);
$options = get_option('widget_meta');
- $title = empty($options['title']) ? __('Meta') : $options['title'];
+ $title = empty($options['title']) ? __('Meta') : apply_filters('widget_title', $options['title']);
?>
<?php echo $before_widget; ?>
<?php echo $before_title . $title . $after_title; ?>
@@ -556,7 +561,7 @@ function wp_widget_meta_control() {
function wp_widget_calendar($args) {
extract($args);
$options = get_option('widget_calendar');
- $title = $options['title'];
+ $title = apply_filters('widget_title', $options['title']);
if ( empty($title) )
$title = '&nbsp;';
echo $before_widget . $before_title . $title . $after_title;
@@ -593,7 +598,7 @@ function wp_widget_text($args, $widget_args = 1) {
if ( !isset($options[$number]) )
return;
- $title = $options[$number]['title'];
+ $title = apply_filters('widget_title', $options[$number]['title']);
$text = apply_filters( 'widget_text', $options[$number]['text'] );
?>
<?php echo $before_widget; ?>
@@ -705,7 +710,7 @@ function wp_widget_categories($args, $widget_args = 1) {
$h = $options[$number]['hierarchical'] ? '1' : '0';
$d = $options[$number]['dropdown'] ? '1' : '0';
- $title = empty($options[$number]['title']) ? __('Categories') : $options[$number]['title'];
+ $title = empty($options[$number]['title']) ? __('Categories') : apply_filters('widget_title', $options[$number]['title']);
echo $before_widget;
echo $before_title . $title . $after_title;
@@ -733,7 +738,10 @@ function wp_widget_categories($args, $widget_args = 1) {
} else {
?>
<ul>
- <?php wp_list_categories($cat_args . '&title_li='); ?>
+ <?php
+ $cat_args['title_li'] = '';
+ wp_list_categories($cat_args);
+ ?>
</ul>
<?php
}
@@ -891,7 +899,7 @@ function wp_widget_recent_entries($args) {
extract($args);
$options = get_option('widget_recent_entries');
- $title = empty($options['title']) ? __('Recent Posts') : $options['title'];
+ $title = empty($options['title']) ? __('Recent Posts') : apply_filters('widget_title', $options['title']);
if ( !$number = (int) $options['number'] )
$number = 10;
else if ( $number < 1 )
@@ -899,7 +907,7 @@ function wp_widget_recent_entries($args) {
else if ( $number > 15 )
$number = 15;
- $r = new WP_Query("showposts=$number&what_to_show=posts&nopaging=0&post_status=publish");
+ $r = new WP_Query(array('showposts' => $number, 'what_to_show' => 'posts', 'nopaging' => 0, 'post_status' => 'publish'));
if ($r->have_posts()) :
?>
<?php echo $before_widget; ?>
@@ -956,7 +964,7 @@ function wp_widget_recent_comments($args) {
global $wpdb, $comments, $comment;
extract($args, EXTR_SKIP);
$options = get_option('widget_recent_comments');
- $title = empty($options['title']) ? __('Recent Comments') : $options['title'];
+ $title = empty($options['title']) ? __('Recent Comments') : apply_filters('widget_title', $options['title']);
if ( !$number = (int) $options['number'] )
$number = 5;
else if ( $number < 1 )
@@ -1062,11 +1070,12 @@ function wp_widget_rss($args, $widget_args = 1) {
$title = $desc;
if ( empty($title) )
$title = __('Unknown Feed');
+ $title = apply_filters('widget_title', $title );
$url = clean_url(strip_tags($url));
if ( file_exists(dirname(__FILE__) . '/rss.png') )
- $icon = str_replace(ABSPATH, get_option('siteurl').'/', dirname(__FILE__)) . '/rss.png';
+ $icon = str_replace(ABSPATH, site_url() . '/', dirname(__FILE__)) . '/rss.png';
else
- $icon = get_option('siteurl').'/wp-includes/images/rss.png';
+ $icon = includes_url('images/rss.png');
$title = "<a class='rsswidget' href='$url' title='" . attribute_escape(__('Syndicate this content')) ."'><img style='background:orange;color:white;border:none;' width='14' height='14' src='$icon' alt='RSS' /></a> <a class='rsswidget' href='$link' title='$desc'>$title</a>";
echo $before_widget;
@@ -1141,7 +1150,7 @@ function wp_widget_rss_output( $rss, $args = array() ) {
if ( $date ) {
if ( $date_stamp = strtotime( $date ) )
- $date = '<span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date_stamp ) . '</span>';
+ $date = ' <span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date_stamp ) . '</span>';
else
$date = '';
}
@@ -1354,7 +1363,7 @@ function wp_widget_rss_register() {
function wp_widget_tag_cloud($args) {
extract($args);
$options = get_option('widget_tag_cloud');
- $title = empty($options['title']) ? __('Tags') : $options['title'];
+ $title = empty($options['title']) ? __('Tags') : apply_filters('widget_title', $options['title']);
echo $before_widget;
echo $before_title . $title . $after_title;
@@ -1497,7 +1506,7 @@ function widget_many_control( $widget_args = 1 ) {
$options[$widget_number] = array( 'something' => $something ); // Even simple widgets should store stuff in array, rather than in scalar
}
- update_option('widget_text', $options);
+ update_option('widget_many', $options);
$updated = true; // So that we don't go through this more than once
}
@@ -1539,8 +1548,8 @@ function widget_many_register() {
// $id should look like {$id_base}-{$o}
$id = "many-$o"; // Never never never translate an id
$registered = true;
- wp_register_sidebar_widget( $id, $name, 'wp_widget_text', $widget_ops, array( 'number' => $o ) );
- wp_register_widget_control( $id, $name, 'wp_widget_text_control', $control_ops, array( 'number' => $o ) );
+ wp_register_sidebar_widget( $id, $name, 'widget_many', $widget_ops, array( 'number' => $o ) );
+ wp_register_widget_control( $id, $name, 'widget_many_control', $control_ops, array( 'number' => $o ) );
}
// If there are none, we register the widget's existance with a generic template
diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php
index b7fb414..00c7e81 100644
--- a/wp-includes/wp-db.php
+++ b/wp-includes/wp-db.php
@@ -104,9 +104,19 @@ class wpdb {
$this->ready = true;
- if ( !empty($this->charset) && version_compare(mysql_get_server_info($this->dbh), '4.1.0', '>=') )
- $this->query("SET NAMES '$this->charset'");
-
+ if ( $this->supports_collation() ) {
+ $collation_query = '';
+ if ( !empty($this->charset) ) {
+ $collation_query = "SET NAMES '{$this->charset}'";
+ if (!empty($this->collate) )
+ $collation_query .= " COLLATE '{$this->collate}'";
+ }
+
+ if ( !empty($collation_query) )
+ $this->query($collation_query);
+
+ }
+
$this->select($dbname, $this->dbh);
}
@@ -115,6 +125,7 @@ class wpdb {
}
function set_prefix($prefix) {
+
if ( preg_match('|[^a-z0-9_]|i', $prefix) )
return new WP_Error('invalid_db_prefix', 'Invalid database prefix'); // No gettext here
diff --git a/wp-includes/wp-diff.php b/wp-includes/wp-diff.php
new file mode 100644
index 0000000..f60614a
--- /dev/null
+++ b/wp-includes/wp-diff.php
@@ -0,0 +1,318 @@
+<?php
+
+if ( !class_exists( 'Text_Diff' ) ) {
+ require( 'Text/Diff.php' );
+ require( 'Text/Diff/Renderer.php' );
+ require( 'Text/Diff/Renderer/inline.php' );
+}
+
+
+/* Descendent of a bastard child of piece of an old MediaWiki Diff Formatter
+ *
+ * Basically all that remains is the table structure and some method names.
+ */
+
+class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
+ var $_leading_context_lines = 10000;
+ var $_trailing_context_lines = 10000;
+ var $_diff_threshold = 0.6;
+
+ var $inline_diff_renderer = 'WP_Text_Diff_Renderer_inline';
+
+ function Text_Diff_Renderer_Table( $params = array() ) {
+ $parent = get_parent_class($this);
+ $this->$parent( $params );
+ }
+
+ function _startBlock( $header ) {
+ return '';
+ }
+
+ function _lines( $lines, $prefix=' ' ) {
+ }
+
+ // HTML-escape parameter before calling this
+ function addedLine( $line ) {
+ return "<td>+</td><td class='diff-addedline'>{$line}</td>";
+ }
+
+ // HTML-escape parameter before calling this
+ function deletedLine( $line ) {
+ return "<td>-</td><td class='diff-deletedline'>{$line}</td>";
+ }
+
+ // HTML-escape parameter before calling this
+ function contextLine( $line ) {
+ return "<td> </td><td class='diff-context'>{$line}</td>";
+ }
+
+ function emptyLine() {
+ return '<td colspan="2">&nbsp;</td>';
+ }
+
+ function _added( $lines, $encode = true ) {
+ $r = '';
+ foreach ($lines as $line) {
+ if ( $encode )
+ $line = htmlspecialchars( $line );
+ $r .= '<tr>' . $this->emptyLine() . $this->addedLine( $line ) . "</tr>\n";
+ }
+ return $r;
+ }
+
+ function _deleted( $lines, $encode = true ) {
+ $r = '';
+ foreach ($lines as $line) {
+ if ( $encode )
+ $line = htmlspecialchars( $line );
+ $r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . "</tr>\n";
+ }
+ return $r;
+ }
+
+ function _context( $lines, $encode = true ) {
+ $r = '';
+ foreach ($lines as $line) {
+ if ( $encode )
+ $line = htmlspecialchars( $line );
+ $r .= '<tr>' .
+ $this->contextLine( $line ) . $this->contextLine( $line ) . "</tr>\n";
+ }
+ return $r;
+ }
+
+ // Process changed lines to do word-by-word diffs for extra highlighting (TRAC style)
+ // sometimes these lines can actually be deleted or added rows - we do additional processing
+ // to figure that out
+ function _changed( $orig, $final ) {
+ $r = '';
+
+ // Does the aforementioned additional processing
+ // *_matches tell what rows are "the same" in orig and final. Those pairs will be diffed to get word changes
+ // match is numeric: an index in other column
+ // match is 'X': no match. It is a new row
+ // *_rows are column vectors for the orig column and the final column.
+ // row >= 0: an indix of the $orig or $final array
+ // row < 0: a blank row for that column
+ list($orig_matches, $final_matches, $orig_rows, $final_rows) = $this->interleave_changed_lines( $orig, $final );
+
+
+ // These will hold the word changes as determined by an inline diff
+ $orig_diffs = array();
+ $final_diffs = array();
+
+ // Compute word diffs for each matched pair using the inline diff
+ foreach ( $orig_matches as $o => $f ) {
+ if ( is_numeric($o) && is_numeric($f) ) {
+ $text_diff = new Text_Diff( 'auto', array( array($orig[$o]), array($final[$f]) ) );
+ $renderer = new $this->inline_diff_renderer;
+ $diff = $renderer->render( $text_diff );
+
+ // If they're too different, don't include any <ins> or <dels>
+ if ( $diff_count = preg_match_all( '!(<ins>.*?</ins>|<del>.*?</del>)!', $diff, $diff_matches ) ) {
+ // length of all text between <ins> or <del>
+ $stripped_matches = strlen(strip_tags( join(' ', $diff_matches[0]) ));
+ // since we count lengith of text between <ins> or <del> (instead of picking just one),
+ // we double the length of chars not in those tags.
+ $stripped_diff = strlen(strip_tags( $diff )) * 2 - $stripped_matches;
+ $diff_ratio = $stripped_matches / $stripped_diff;
+ if ( $diff_ratio > $this->_diff_threshold )
+ continue; // Too different. Don't save diffs.
+ }
+
+ // Un-inline the diffs by removing del or ins
+ $orig_diffs[$o] = preg_replace( '|<ins>.*?</ins>|', '', $diff );
+ $final_diffs[$f] = preg_replace( '|<del>.*?</del>|', '', $diff );
+ }
+ }
+
+ foreach ( array_keys($orig_rows) as $row ) {
+ // Both columns have blanks. Ignore them.
+ if ( $orig_rows[$row] < 0 && $final_rows[$row] < 0 )
+ continue;
+
+ // If we have a word based diff, use it. Otherwise, use the normal line.
+ $orig_line = isset($orig_diffs[$orig_rows[$row]])
+ ? $orig_diffs[$orig_rows[$row]]
+ : htmlspecialchars($orig[$orig_rows[$row]]);
+ $final_line = isset($final_diffs[$final_rows[$row]])
+ ? $final_diffs[$final_rows[$row]]
+ : htmlspecialchars($final[$final_rows[$row]]);
+
+ if ( $orig_rows[$row] < 0 ) { // Orig is blank. This is really an added row.
+ $r .= $this->_added( array($final_line), false );
+ } elseif ( $final_rows[$row] < 0 ) { // Final is blank. This is really a deleted row.
+ $r .= $this->_deleted( array($orig_line), false );
+ } else { // A true changed row.
+ $r .= '<tr>' . $this->deletedLine( $orig_line ) . $this->addedLine( $final_line ) . "</tr>\n";
+ }
+ }
+
+ return $r;
+ }
+
+ // Takes changed blocks and matches which rows in orig turned into which rows in final.
+ // Returns
+ // *_matches ( which rows match with which )
+ // *_rows ( order of rows in each column interleaved with blank rows as necessary )
+ function interleave_changed_lines( $orig, $final ) {
+
+ // Contains all pairwise string comparisons. Keys are such that this need only be a one dimensional array.
+ $matches = array();
+ foreach ( array_keys($orig) as $o ) {
+ foreach ( array_keys($final) as $f ) {
+ $matches["$o,$f"] = $this->compute_string_distance( $orig[$o], $final[$f] );
+ }
+ }
+ asort($matches); // Order by string distance.
+
+ $orig_matches = array();
+ $final_matches = array();
+
+ foreach ( $matches as $keys => $difference ) {
+ list($o, $f) = explode(',', $keys);
+ $o = (int) $o;
+ $f = (int) $f;
+
+ // Already have better matches for these guys
+ if ( isset($orig_matches[$o]) && isset($final_matches[$f]) )
+ continue;
+
+ // First match for these guys. Must be best match
+ if ( !isset($orig_matches[$o]) && !isset($final_matches[$f]) ) {
+ $orig_matches[$o] = $f;
+ $final_matches[$f] = $o;
+ continue;
+ }
+
+ // Best match of this final is already taken? Must mean this final is a new row.
+ if ( isset($orig_matches[$o]) )
+ $final_matches[$f] = 'x';
+
+ // Best match of this orig is already taken? Must mean this orig is a deleted row.
+ elseif ( isset($final_matches[$f]) )
+ $orig_matches[$o] = 'x';
+ }
+
+ // We read the text in this order
+ ksort($orig_matches);
+ ksort($final_matches);
+
+
+ // Stores rows and blanks for each column.
+ $orig_rows = $orig_rows_copy = array_keys($orig_matches);
+ $final_rows = array_keys($final_matches);
+
+ // Interleaves rows with blanks to keep matches aligned.
+ // We may end up with some extraneous blank rows, but we'll just ignore them later.
+ foreach ( $orig_rows_copy as $orig_row ) {
+ $final_pos = array_search($orig_matches[$orig_row], $final_rows, true);
+ $orig_pos = (int) array_search($orig_row, $orig_rows, true);
+
+ if ( false === $final_pos ) { // This orig is paired with a blank final.
+ array_splice( $final_rows, $orig_pos, 0, -1 );
+ } elseif ( $final_pos < $orig_pos ) { // This orig's match is up a ways. Pad final with blank rows.
+ $diff_pos = $final_pos - $orig_pos;
+ while ( $diff_pos < 0 )
+ array_splice( $final_rows, $orig_pos, 0, $diff_pos++ );
+ } elseif ( $final_pos > $orig_pos ) { // This orig's match is down a ways. Pad orig with blank rows.
+ $diff_pos = $orig_pos - $final_pos;
+ while ( $diff_pos < 0 )
+ array_splice( $orig_rows, $orig_pos, 0, $diff_pos++ );
+ }
+ }
+
+
+ // Pad the ends with blank rows if the columns aren't the same length
+ $diff_count = count($orig_rows) - count($final_rows);
+ if ( $diff_count < 0 ) {
+ while ( $diff_count < 0 )
+ array_push($orig_rows, $diff_count++);
+ } elseif ( $diff_count > 0 ) {
+ $diff_count = -1 * $diff_count;
+ while ( $diff_count < 0 )
+ array_push($final_rows, $diff_count++);
+ }
+
+ return array($orig_matches, $final_matches, $orig_rows, $final_rows);
+
+/*
+ // Debug
+ echo "\n\n\n\n\n";
+
+ echo "-- DEBUG Matches: Orig -> Final --";
+
+ foreach ( $orig_matches as $o => $f ) {
+ echo "\n\n\n\n\n";
+ echo "ORIG: $o, FINAL: $f\n";
+ var_dump($orig[$o],$final[$f]);
+ }
+ echo "\n\n\n\n\n";
+
+ echo "-- DEBUG Matches: Final -> Orig --";
+
+ foreach ( $final_matches as $f => $o ) {
+ echo "\n\n\n\n\n";
+ echo "FINAL: $f, ORIG: $o\n";
+ var_dump($final[$f],$orig[$o]);
+ }
+ echo "\n\n\n\n\n";
+
+ echo "-- DEBUG Rows: Orig -- Final --";
+
+ echo "\n\n\n\n\n";
+ foreach ( $orig_rows as $row => $o ) {
+ if ( $o < 0 )
+ $o = 'X';
+ $f = $final_rows[$row];
+ if ( $f < 0 )
+ $f = 'X';
+ echo "$o -- $f\n";
+ }
+ echo "\n\n\n\n\n";
+
+ echo "-- END DEBUG --";
+
+ echo "\n\n\n\n\n";
+
+ return array($orig_matches, $final_matches, $orig_rows, $final_rows);
+*/
+ }
+
+
+ // Computes a number that is intended to reflect the "distance" between two strings.
+ function compute_string_distance( $string1, $string2 ) {
+ // Vectors containing character frequency for all chars in each string
+ $chars1 = count_chars($string1);
+ $chars2 = count_chars($string2);
+
+ // L1-norm of difference vector.
+ $difference = array_sum( array_map( array(&$this, 'difference'), $chars1, $chars2 ) );
+
+ // $string1 has zero length? Odd. Give huge penalty by not dividing.
+ if ( !$string1 )
+ return $difference;
+
+ // Return distance per charcter (of string1)
+ return $difference / strlen($string1);
+ }
+
+ function difference( $a, $b ) {
+ return abs( $a - $b );
+ }
+
+}
+
+// Better word splitting than the PEAR package provides
+class WP_Text_Diff_Renderer_inline extends Text_Diff_Renderer_inline {
+
+ function _splitOnWords($string, $newlineEscape = "\n") {
+ $string = str_replace("\0", '', $string);
+ $words = preg_split( '/([^\w])/', $string, -1, PREG_SPLIT_DELIM_CAPTURE );
+ $words = str_replace( "\n", $newlineEscape, $words );
+ return $words;
+ }
+
+}
+
+?>
diff --git a/wp-links-opml.php b/wp-links-opml.php
index dfa3a44..f536d61 100644
--- a/wp-links-opml.php
+++ b/wp-links-opml.php
@@ -1,7 +1,19 @@
<?php
+/**
+ * Outputs the OPML XML format for getting the links defined in the link
+ * administration. This can be used to export links from one blog over to
+ * another. Links aren't exported by the WordPress export, so this file handles
+ * that.
+ *
+ * This file is not added by default to WordPress theme pages when outputting
+ * feed links. It will have to be added manually for browsers and users to pick
+ * up that this file exists.
+ *
+ * @package WordPress
+ */
if (empty($wp)) {
- require_once('./wp-config.php');
+ require_once('./wp-load.php');
wp();
}
diff --git a/wp-load.php b/wp-load.php
new file mode 100644
index 0000000..f912ed6
--- /dev/null
+++ b/wp-load.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Bootstrap file for setting the ABSPATH constant
+ * and loading the wp-config.php file. The wp-config.php
+ * file will then load the wp-settings.php file, which
+ * will then set up the WordPress environment.
+ *
+ * If the wp-config.php file is not found then an error
+ * will be displayed asking the visitor to set up the
+ * wp-config.php file.
+ *
+ * Also made to work in the wp-admin/ folder, because it
+ * will look in the parent directory if the file is not
+ * found in the current directory.
+ *
+ * @package WordPress
+ */
+
+/** Define ABSPATH as this files directory */
+define( 'ABSPATH', dirname(__FILE__) . '/' );
+
+error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE);
+
+if ( file_exists( ABSPATH . 'wp-config.php') ) {
+
+ /** The config file resides in ABSPATH */
+ require_once( ABSPATH . 'wp-config.php' );
+
+} elseif ( file_exists( dirname(ABSPATH) . '/wp-config.php' ) ) {
+
+ /** The config file resides one level below ABSPATH */
+ require_once( dirname(ABSPATH) . '/wp-config.php' );
+
+} else {
+
+ // A config file doesn't exist
+
+ // Set a path for the link to the installer
+ if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = '';
+ else $path = 'wp-admin/';
+
+ // Die with an error message
+ require_once( ABSPATH . '/wp-includes/classes.php' );
+ require_once( ABSPATH . '/wp-includes/functions.php' );
+ require_once( ABSPATH . '/wp-includes/plugin.php' );
+ wp_die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>. You can create a <code>wp-config.php</code> file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.</p><p><a href='{$path}setup-config.php' class='button'>Create a Configuration File</a>", "WordPress &rsaquo; Error");
+
+}
+
+?>
diff --git a/wp-login.php b/wp-login.php
index 05a86d4..bd87ebc 100644
--- a/wp-login.php
+++ b/wp-login.php
@@ -1,7 +1,44 @@
<?php
-require( dirname(__FILE__) . '/wp-config.php' );
+/**
+ * WordPress User Page
+ *
+ * Handles authentication, registering, resetting passwords, forgot password,
+ * and other user handling.
+ *
+ * @package WordPress
+ */
+
+/** Make sure that the WordPress bootstrap has ran before continuing. */
+require( dirname(__FILE__) . '/wp-load.php' );
+
+// Redirect to https login if forced to use SSL
+if ( (force_ssl_admin() || force_ssl_login()) && !is_ssl() ) {
+ if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
+ wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));
+ exit();
+ } else {
+ wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
+ exit();
+ }
+}
-// Rather than duplicating this HTML all over the place, we'll stick it in function
+/**
+ * login_header() - Outputs the header for the login page
+ *
+ * @package WordPress
+ * @uses do_action() Calls the 'login_head' for outputting HTML in the Login
+ * header.
+ * @uses apply_filters() Calls 'login_headerurl' for the top login link.
+ * @uses apply_filters() Calls 'login_headertitle' for the top login title.
+ * @uses apply_filters() Calls 'login_message' on the message to display in the
+ * header.
+ * @uses $error The error global, which is checked for displaying errors.
+ *
+ * @param string $title Optional. WordPress Login Page title to display in
+ * <title/> element.
+ * @param string $message Optional. Message to display in header.
+ * @param WP_Error $wp_error Optional. WordPress Error Object
+ */
function login_header($title = 'Login', $message = '', $wp_error = '') {
global $error, $current_site;
@@ -14,8 +51,8 @@ function login_header($title = 'Login', $message = '', $wp_error = '') {
<title><?php bloginfo('name'); ?> &rsaquo; <?php echo $title; ?></title>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<?php
- wp_admin_css( 'css/login' );
- wp_admin_css( 'css/colors-fresh' );
+ wp_admin_css( 'login', true );
+ wp_admin_css( 'colors-fresh', true );
?>
<script type="text/javascript">
function focusit() {
@@ -56,6 +93,15 @@ function login_header($title = 'Login', $message = '', $wp_error = '') {
}
} // End of login_header()
+/**
+ * retrieve_password() - Handles sending password retrieval email to user
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @uses $wpdb WordPress Database object
+ *
+ * @return bool|WP_Error True: when finish. WP_Error on error
+ */
function retrieve_password() {
global $wpdb, $current_site;
@@ -90,14 +136,14 @@ function retrieve_password() {
do_action('retreive_password', $user_login); // Misspelled and deprecated
do_action('retrieve_password', $user_login);
- //$key = $wpdb->get_var($wpdb->prepare("SELECT user_activation_key FROM $wpdb->users WHERE user_login = %s", $user_login));
- //if ( empty($key) ) {
+ $key = $wpdb->get_var($wpdb->prepare("SELECT user_activation_key FROM $wpdb->users WHERE user_login = %s", $user_login));
+ if ( empty($key) ) {
// Generate something random for a key...
$key = wp_generate_password(20, false);
do_action('retrieve_password_key', $user_login, $key);
// Now insert the new md5 key into the db
$wpdb->query($wpdb->prepare("UPDATE $wpdb->users SET user_activation_key = %s WHERE user_login = %s", $key, $user_login));
- //}
+ }
$message = __('Someone has asked to reset the password for the following site and username.') . "\r\n\r\n";
$message .= 'http://' . trailingslashit( $current_site->domain . $current_site->path ) . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
@@ -110,6 +156,16 @@ function retrieve_password() {
return true;
}
+/**
+ * reset_password() - Handles resetting the user's password
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @uses $wpdb WordPress Database object
+ *
+ * @param string $key Hash to validate sending user's password
+ * @return bool|WP_Error
+ */
function reset_password($key) {
global $wpdb, $current_site;
@@ -143,6 +199,15 @@ function reset_password($key) {
return true;
}
+/**
+ * register_new_user() - Handles registering a new user
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @param string $user_login User's username for logging in
+ * @param string $user_email User's email address to send password and add
+ * @return int|WP_Error Either user's ID or error on failure.
+ */
function register_new_user($user_login, $user_email) {
$errors = new WP_Error();
@@ -257,10 +322,10 @@ case 'retrievepassword' :
<p id="nav">
<?php if (get_option('users_can_register')) : ?>
-<a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Log in') ?></a> |
-<a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=register"><?php _e('Register') ?></a>
+<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Log in') ?></a> |
+<a href="<?php echo site_url('wp-login.php?action=register', 'login') ?>"><?php _e('Register') ?></a>
<?php else : ?>
-<a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Log in') ?></a>
+<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Log in') ?></a>
<?php endif; ?>
</p>
@@ -328,8 +393,8 @@ case 'register' :
</form>
<p id="nav">
-<a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Log in') ?></a> |
-<a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=lostpassword" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
+<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Log in') ?></a> |
+<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
</p>
</div>
@@ -348,12 +413,17 @@ default:
else
$redirect_to = 'wp-admin/';
- $user = wp_signon();
+ if ( is_ssl() && force_ssl_login() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) )
+ $secure_cookie = false;
+ else
+ $secure_cookie = '';
+
+ $user = wp_signon('', $secure_cookie);
if ( !is_wp_error($user) ) {
// If the user can't edit posts, send them to their profile.
if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' ) )
- $redirect_to = get_option('siteurl') . '/wp-admin/profile.php';
+ $redirect_to = admin_url('profile.php');
wp_safe_redirect($redirect_to);
exit();
}
@@ -402,10 +472,10 @@ default:
<p id="nav">
<?php if ( isset($_GET['checkemail']) && in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) : ?>
<?php elseif (get_option('users_can_register')) : ?>
-<a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=register"><?php _e('Register') ?></a> |
-<a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=lostpassword" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
+<a href="<?php echo site_url('wp-login.php?action=register', 'login') ?>"><?php _e('Register') ?></a> |
+<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
<?php else : ?>
-<a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=lostpassword" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
+<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
<?php endif; ?>
</p>
diff --git a/wp-mail.php b/wp-mail.php
index 9e767fb..8261a22 100644
--- a/wp-mail.php
+++ b/wp-mail.php
@@ -1,8 +1,18 @@
<?php
-require(dirname(__FILE__) . '/wp-config.php');
+/**
+ * Gets the email message from the user's mailbox to add as
+ * a WordPress post. Will only run if this is setup and enabled.
+ *
+ * @package WordPress
+ */
+/** Make sure that the WordPress bootstrap has ran before continuing. */
+require(dirname(__FILE__) . '/wp-load.php');
+
+/** Get the POP3 class for which to access the mailbox. */
require_once(ABSPATH.WPINC.'/class-pop3.php');
+// WTF is this? Use constants instead.
error_reporting(2037);
$time_difference = get_option('gmt_offset') * 3600;
diff --git a/wp-pass.php b/wp-pass.php
index da6b27e..9eb49d1 100644
--- a/wp-pass.php
+++ b/wp-pass.php
@@ -1,5 +1,13 @@
<?php
-require( dirname(__FILE__) . '/wp-config.php');
+/**
+ * Creates the password cookie and redirects back to where the
+ * visitor was before.
+ *
+ * @package WordPress
+ */
+
+/** Make sure that the WordPress bootstrap has ran before continuing. */
+require( dirname(__FILE__) . '/wp-load.php');
if ( get_magic_quotes_gpc() )
$_POST['post_password'] = stripslashes($_POST['post_password']);
diff --git a/wp-rdf.php b/wp-rdf.php
index e85894b..08c4f43 100644
--- a/wp-rdf.php
+++ b/wp-rdf.php
@@ -1,7 +1,20 @@
-<?php /* RDF 1.0 generator, original version by garym@teledyn.com */
+<?php
+/**
+ * Outputs the RDF feed using the feed-rdf.php
+ * file in wp-includes folder.
+ *
+ * This file only sets the feed format and includes the
+ * feed-rdf.php.
+ *
+ * This file is no longer used in WordPress and while it is
+ * not deprecated now. This file will most likely be
+ * deprecated or removed in a later version.
+ *
+ * @package WordPress
+ */
if (empty($wp)) {
- require_once('./wp-config.php');
+ require_once('./wp-load.php');
wp('feed=rdf');
}
diff --git a/wp-rss.php b/wp-rss.php
index 58a3e47..67d3d98 100644
--- a/wp-rss.php
+++ b/wp-rss.php
@@ -1,7 +1,20 @@
<?php
+/**
+ * Outputs the RSS feed RDF format using the feed-rss.php
+ * file in wp-includes folder.
+ *
+ * This file only sets the feed format and includes the
+ * feed-rss.php.
+ *
+ * This file is no longer used in WordPress and while it is
+ * not deprecated now. This file will most likely be
+ * deprecated or removed in a later version.
+ *
+ * @package WordPress
+ */
if (empty($wp)) {
- require_once('./wp-config.php');
+ require_once('./wp-load.php');
wp('feed=rss');
}
diff --git a/wp-rss2.php b/wp-rss2.php
index da71d83..1f4d930 100644
--- a/wp-rss2.php
+++ b/wp-rss2.php
@@ -1,7 +1,18 @@
<?php
+/**
+ * Outputs the RSS2 feed XML format using the feed-rss2.php file in wp-includes
+ * folder. This file only sets the feed format and includes the feed-rss2.php.
+ *
+ * This file is no longer used in WordPress and while it is not deprecated now.
+ * This file will most likely be deprecated or removed in a later version.
+ *
+ * The link for the rss2 feed is /index.php?feed=rss2 with permalinks off.
+ *
+ * @package WordPress
+ */
if (empty($wp)) {
- require_once('./wp-config.php');
+ require_once('./wp-load.php');
wp('feed=rss2');
}
diff --git a/wp-settings.php b/wp-settings.php
index 724a1a6..11ca15f 100644
--- a/wp-settings.php
+++ b/wp-settings.php
@@ -100,7 +100,10 @@ if ( version_compare( '4.3', phpversion(), '>' ) ) {
die( 'Your server is running PHP version ' . phpversion() . ' but WordPress requires at least 4.3.' );
}
-if ( !extension_loaded('mysql') && !file_exists(ABSPATH . 'wp-content/db.php') )
+if ( !defined('WP_CONTENT_DIR') )
+ define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down
+
+if ( !extension_loaded('mysql') && !file_exists(WP_CONTENT_DIR . '/db.php') )
die( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' );
/**
@@ -166,7 +169,7 @@ if (defined('WP_DEBUG') and WP_DEBUG == true) {
// For an advanced caching plugin to use, static because you would only want one
if ( defined('WP_CACHE') )
- @include ABSPATH . 'wp-content/advanced-cache.php';
+ @include WP_CONTENT_DIR . '/advanced-cache.php';
/**
* Stores the location of the WordPress directory of functions, classes, and core content.
@@ -175,44 +178,52 @@ if ( defined('WP_CACHE') )
*/
define('WPINC', 'wp-includes');
-if ( !defined('LANGDIR') ) {
+if ( !defined('WP_LANG_DIR') ) {
/**
- * Stores the location of the language directory. First looks for language folder in wp-content
+ * Stores the location of the language directory. First looks for language folder in WP_CONTENT_DIR
* and uses that folder if it exists. Or it uses the "languages" folder in WPINC.
*
* @since 2.1.0
*/
- if ( file_exists(ABSPATH . 'wp-content/languages') && @is_dir(ABSPATH . 'wp-content/languages') )
- define('LANGDIR', 'wp-content/languages'); // no leading slash, no trailing slash
- else
- define('LANGDIR', WPINC . '/languages'); // no leading slash, no trailing slash
+ if ( file_exists(WP_CONTENT_DIR . '/languages') && @is_dir(WP_CONTENT_DIR . '/languages') ) {
+ define('WP_LANG_DIR', WP_CONTENT_DIR . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH
+ if (!defined('LANGDIR')) {
+ // Old static relative path maintained for limited backwards compatibility - won't work in some cases
+ define('LANGDIR', 'wp-content/languages');
+ }
+ } else {
+ define('WP_LANG_DIR', ABSPATH . WPINC . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH
+ if (!defined('LANGDIR')) {
+ // Old relative path maintained for backwards compatibility
+ define('LANGDIR', WPINC . '/languages');
+ }
+ }
}
-/**
- * Allows for the plugins directory to be moved from the default location.
- *
- * This isn't used everywhere. Constant is not used in plugin_basename()
- * which might cause conflicts with changing this.
- *
- * @since 2.1
- */
-if ( !defined('PLUGINDIR') )
- define('PLUGINDIR', 'wp-content/plugins'); // no leading slash, no trailing slash
-
require (ABSPATH . WPINC . '/compat.php');
require (ABSPATH . WPINC . '/functions.php');
+require (ABSPATH . WPINC . '/classes.php');
require_wp_db();
-$wpdb->set_prefix($table_prefix); // set up global tables
+
if ( !empty($wpdb->error) )
dead_db();
-if ( !defined( 'WP_INSTALLING' ) && file_exists(ABSPATH . 'wp-content/object-cache.php') )
- require_once (ABSPATH . 'wp-content/object-cache.php');
+$prefix = $wpdb->set_prefix($table_prefix); // set up global tables
+
+if ( is_wp_error($prefix) )
+ wp_die('<strong>ERROR</strong>: <code>$table_prefix</code> in <code>wp-config.php</code> can only contain numbers, letters, and underscores.');
+
+if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') )
+ require_once (WP_CONTENT_DIR . '/object-cache.php');
else
require_once (ABSPATH . WPINC . '/cache.php');
wp_cache_init();
+if ( function_exists('wp_cache_add_global_groups') ) {
+ wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss'));
+ wp_cache_add_non_persistent_groups(array( 'comment', 'counts', 'plugins' ));
+}
if( defined( 'SUNRISE' ) )
include_once( ABSPATH . 'wp-content/sunrise.php' );
@@ -224,15 +235,10 @@ $wpdb->set_prefix($table_prefix); // set up blog tables
$table_prefix = $table_prefix . $blog_id . '_';
wp_cache_init(); // need to init cache again after blog_id is set
-if ( defined('CUSTOM_USER_TABLE') )
- $wpdb->users = CUSTOM_USER_TABLE;
-if ( defined('CUSTOM_USER_META_TABLE') )
- $wpdb->usermeta = CUSTOM_USER_META_TABLE;
if( !defined( "UPLOADS" ) )
define( "UPLOADS", "wp-content/blogs.dir/{$wpdb->blogid}/files/" );
-require (ABSPATH . WPINC . '/classes.php');
require (ABSPATH . WPINC . '/plugin.php');
require (ABSPATH . WPINC . '/default-filters.php');
@@ -276,14 +282,34 @@ require (ABSPATH . WPINC . '/canonical.php');
require (ABSPATH . WPINC . '/shortcodes.php');
require (ABSPATH . WPINC . '/media.php');
+if ( !defined('WP_CONTENT_URL') )
+ define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
+
require_once( ABSPATH . WPINC . '/wpmu-functions.php' );
-if( defined( "WP_INSTALLING" ) == false )
- $current_site->site_name = get_site_option('site_name');
+/**
+ * Allows for the plugins directory to be moved from the default location.
+ *
+ * @since 2.6
+ */
+if ( !defined('WP_PLUGIN_DIR') )
+ define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash
+if ( !defined('WP_PLUGIN_URL') )
+ define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash
+if ( !defined('PLUGINDIR') )
+ define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat.
-if( $current_site->site_name == false ) {
+$current_site->site_name = get_site_option('site_name');
+if( $current_site->site_name == false )
$current_site->site_name = ucfirst( $current_site->domain );
-}
+
+// Used to guarantee unique hash cookies
+$cookiehash = '';
+/**
+ * Used to guarantee unique hash cookies
+ * @since 1.5
+ */
+define('COOKIEHASH', '' );
if( defined('WP_INSTALLING') == false ) {
$locale = get_option('WPLANG');
@@ -318,8 +344,6 @@ if( $current_blog->archived == '1' )
if( $current_blog->spam == '1' )
graceful_fail(__('This blog has been archived or suspended.'));
-define('COOKIEHASH', '');
-
/**
* Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php
* @since 2.5
@@ -331,21 +355,35 @@ $wp_default_secret_key = 'put your unique phrase here';
* @since 2.0.0
*/
if ( !defined('USER_COOKIE') )
- define('USER_COOKIE', 'wordpressuser');
+ define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH);
/**
* It is possible to define this in wp-config.php
* @since 2.0.0
*/
if ( !defined('PASS_COOKIE') )
- define('PASS_COOKIE', 'wordpresspass');
+ define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH);
/**
* It is possible to define this in wp-config.php
* @since 2.5
*/
if ( !defined('AUTH_COOKIE') )
- define('AUTH_COOKIE', 'wordpress');
+ define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH);
+
+/**
+ * It is possible to define this in wp-config.php
+ * @since 2.6
+ */
+if ( !defined('SECURE_AUTH_COOKIE') )
+ define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH);
+
+/**
+ * It is possible to define this in wp-config.php
+ * @since 2.6
+ */
+if ( !defined('LOGGED_IN_COOKIE') )
+ define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH);
/**
* It is possible to define this in wp-config.php
@@ -374,7 +412,23 @@ if ( !defined('SITECOOKIEPATH') )
*/
if ( !defined('COOKIE_DOMAIN') )
define('COOKIE_DOMAIN', '.' . $current_site->domain);
-
+
+/**
+ * It is possible to define this in wp-config.php
+ * @since 2.6
+ */
+if ( !defined('FORCE_SSL_ADMIN') )
+ define('FORCE_SSL_ADMIN', false);
+force_ssl_admin(FORCE_SSL_ADMIN);
+
+/**
+ * It is possible to define this in wp-config.php
+ * @since 2.6
+ */
+if ( !defined('FORCE_SSL_LOGIN') )
+ define('FORCE_SSL_LOGIN', false);
+force_ssl_login(FORCE_SSL_LOGIN);
+
/**
* It is possible to define this in wp-config.php
* @since 2.5.0
@@ -385,15 +439,13 @@ if ( !defined( 'AUTOSAVE_INTERVAL' ) )
require (ABSPATH . WPINC . '/vars.php');
-if ( !defined('PLUGINDIR') )
- define('PLUGINDIR', 'wp-content/plugins'); // no leading slash, no trailing slash
if ( get_option('active_plugins') ) {
$current_plugins = get_option('active_plugins');
if ( is_array($current_plugins) ) {
foreach ($current_plugins as $plugin) {
- if ('' != $plugin && file_exists(ABSPATH . PLUGINDIR . '/' . $plugin))
- include_once(ABSPATH . PLUGINDIR . '/' . $plugin);
+ if ('' != $plugin && file_exists(WP_PLUGIN_DIR . '/' . $plugin))
+ include_once(WP_PLUGIN_DIR . '/' . $plugin);
}
}
}
@@ -415,6 +467,11 @@ if ( defined('WP_CACHE') && function_exists('wp_cache_postload') )
do_action('plugins_loaded');
+$default_constants = array( 'WP_POST_REVISIONS' => true );
+foreach ( $default_constants as $c => $v )
+ @define( $c, $v ); // will fail if the constant is already defined
+unset($default_constants, $c, $v);
+
// If already slashed, strip.
if ( get_magic_quotes_gpc() ) {
$_GET = stripslashes_deep($_GET );
@@ -459,6 +516,7 @@ $wp_rewrite =& new WP_Rewrite();
*/
$wp =& new WP();
+do_action('setup_theme');
/**
* Web Path to the current active template directory
@@ -480,7 +538,7 @@ load_default_textdomain();
* @since 1.5.0
*/
$locale = get_locale();
-$locale_file = ABSPATH . LANGDIR . "/$locale.php";
+$locale_file = WP_LANG_DIR . "/$locale.php";
if ( is_readable($locale_file) )
require_once($locale_file);
diff --git a/wp-trackback.php b/wp-trackback.php
index 26f8763..bb83c09 100644
--- a/wp-trackback.php
+++ b/wp-trackback.php
@@ -1,10 +1,21 @@
<?php
+/**
+ * Handle Trackbacks and Pingbacks sent to WordPress
+ *
+ * @package WordPress
+ */
if (empty($wp)) {
- require_once('./wp-config.php');
+ require_once('./wp-load.php');
wp('tb=1');
}
+/**
+ * trackback_response() - Respond with error or success XML message
+ *
+ * @param int|bool $error Whether there was an error or not
+ * @param string $error_message Error message if an error occurred
+ */
function trackback_response($error = 0, $error_message = '') {
header('Content-Type: text/xml; charset=' . get_option('blog_charset') );
if ($error) {
@@ -86,7 +97,7 @@ if ( !empty($tb_url) && !empty($title) ) {
$comment_content = "<strong>$title</strong>\n\n$excerpt";
$comment_type = 'trackback';
- $dupe = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND comment_author_url = '$comment_author_url'");
+ $dupe = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $comment_post_ID, $comment_author_url) );
if ( $dupe )
trackback_response(1, 'We already have a ping from that URL for this post.');
diff --git a/xmlrpc.php b/xmlrpc.php
index 675be21..1e52fb5 100644
--- a/xmlrpc.php
+++ b/xmlrpc.php
@@ -1,5 +1,16 @@
<?php
-
+/**
+ * XML-RPC protocol support for WordPress
+ *
+ * @license GPL v2 <./license.txt>
+ * @package WordPress
+ */
+
+/**
+ * Whether this is a XMLRPC Request
+ *
+ * @var bool
+ */
define('XMLRPC_REQUEST', true);
// Some browser-embedded clients send cookies. We don't want them.
@@ -11,11 +22,12 @@ if ( !isset( $HTTP_RAW_POST_DATA ) ) {
$HTTP_RAW_POST_DATA = file_get_contents( 'php://input' );
}
-# fix for mozBlog and other cases where '<?xml' isn't on the very first line
+// fix for mozBlog and other cases where '<?xml' isn't on the very first line
if ( isset($HTTP_RAW_POST_DATA) )
$HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA);
-include('./wp-config.php');
+/** Include the bootstrap for setting up WordPress environment */
+include('./wp-load.php');
if ( isset( $_GET['rsd'] ) ) { // http://archipelago.phrasewise.com/rsd
header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
@@ -45,10 +57,32 @@ include_once(ABSPATH . WPINC . '/class-IXR.php');
// Turn off all warnings and errors.
// error_reporting(0);
-$post_default_title = ""; // posts submitted via the xmlrpc interface get that title
-
+/**
+ * Posts submitted via the xmlrpc interface get that title
+ * @name post_default_title
+ * @var string
+ */
+$post_default_title = "";
+
+/**
+ * Whether to enable XMLRPC Logging.
+ *
+ * @name xmlrpc_logging
+ * @var int|bool
+ */
$xmlrpc_logging = 0;
+/**
+ * logIO() - Writes logging info to a file.
+ *
+ * @uses $xmlrpc_logging
+ * @package WordPress
+ * @subpackage Logging
+ *
+ * @param string $io Whether input or output
+ * @param string $msg Information describing logging reason.
+ * @return bool Always return true
+ */
function logIO($io,$msg) {
global $xmlrpc_logging;
if ($xmlrpc_logging) {
@@ -59,21 +93,24 @@ function logIO($io,$msg) {
fclose($fp);
}
return true;
- }
-
-function starify($string) {
- $i = strlen($string);
- return str_repeat('*', $i);
}
if ( isset($HTTP_RAW_POST_DATA) )
- logIO("I", $HTTP_RAW_POST_DATA);
-
+ logIO("I", $HTTP_RAW_POST_DATA);
+
+/**
+ * @internal
+ * Left undocumented to work on later. If you want to finish, then please do so.
+ *
+ * @package WordPress
+ * @subpackage Publishing
+ */
class wp_xmlrpc_server extends IXR_Server {
function wp_xmlrpc_server() {
$this->methods = array(
// WordPress API
+ 'wp.getUsersBlogs' => 'this:wp_getUsersBlogs',
'wp.getPage' => 'this:wp_getPage',
'wp.getPages' => 'this:wp_getPages',
'wp.newPage' => 'this:wp_newPage',
@@ -89,6 +126,7 @@ class wp_xmlrpc_server extends IXR_Server {
'wp.getCommentCount' => 'this:wp_getCommentCount',
'wp.getPostStatusList' => 'this:wp_getPostStatusList',
'wp.getPageStatusList' => 'this:wp_getPageStatusList',
+ 'wp.getPageTemplates' => 'this:wp_getPageTemplates',
// Blogger API
'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs',
@@ -219,6 +257,53 @@ class wp_xmlrpc_server extends IXR_Server {
/**
* WordPress XML-RPC API
+ * wp_getUsersBlogs
+ */
+ function wp_getUsersBlogs( $args ) {
+ // If this isn't on WPMU then just use blogger_getUsersBlogs
+ if( !function_exists( 'is_site_admin' ) ) {
+ array_unshift( $args, 1 );
+ return $this->blogger_getUsersBlogs( $args );
+ }
+
+ $this->escape( $args );
+
+ $username = $args[0];
+ $password = $args[1];
+
+ if( !$this->login_pass_ok( $username, $password ) )
+ return $this->error;
+
+ do_action( 'xmlrpc_call', 'wp.getUsersBlogs' );
+
+ $user = set_current_user( 0, $username );
+
+ $blogs = (array) get_blogs_of_user( $user->ID );
+ $struct = array( );
+
+ foreach( $blogs as $blog ) {
+ // Don't include blogs that aren't hosted at this site
+ if( $blog->site_id != 1 )
+ continue;
+
+ $blog_id = $blog->userblog_id;
+ switch_to_blog($blog_id);
+ $is_admin = current_user_can('level_8');
+
+ $struct[] = array(
+ 'isAdmin' => $is_admin,
+ 'url' => get_option( 'home' ) . '/',
+ 'blogid' => $blog_id,
+ 'blogName' => get_option( 'blogname' ),
+ 'xmlrpc' => get_option( 'home' ) . '/xmlrpc.php'
+ );
+ }
+
+ return $struct;
+ }
+
+ /**
+ * WordPress XML-RPC API
* wp_getPage
*/
function wp_getPage($args) {
@@ -272,6 +357,10 @@ class wp_xmlrpc_server extends IXR_Server {
// Get the author info.
$author = get_userdata($page->post_author);
+ $page_template = get_post_meta( $page->ID, '_wp_page_template', true );
+ if( empty( $page_template ) )
+ $page_template = 'default';
+
$page_struct = array(
"dateCreated" => new IXR_Date($page_date),
"userid" => $page->post_author,
@@ -295,7 +384,8 @@ class wp_xmlrpc_server extends IXR_Server {
"wp_author_id" => $author->ID,
"wp_author_display_name" => $author->display_name,
"date_created_gmt" => new IXR_Date($page_date_gmt),
- "custom_fields" => $this->get_custom_fields($page_id)
+ "custom_fields" => $this->get_custom_fields($page_id),
+ "wp_page_template" => $page_template
);
return($page_struct);
@@ -697,7 +787,13 @@ class wp_xmlrpc_server extends IXR_Server {
do_action('xmlrpc_call', 'wp.getCommentCount');
- return get_comment_count( $post_id );
+ $count = wp_count_comments( $post_id );
+ return array(
+ "approved" => $count->approved,
+ "awaiting_moderation" => $count->moderated,
+ "spam" => $count->spam,
+ "total_comments" => $count->total_comments
+ );
}
@@ -744,6 +840,28 @@ class wp_xmlrpc_server extends IXR_Server {
return get_page_statuses( );
}
+ function wp_getPageTemplates( $args ) {
+ $this->escape( $args );
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+
+ if( !$this->login_pass_ok( $username, $password ) ) {
+ return new IXR_Error( 403, __( 'Bad login/pass combination.' ) );
+ }
+
+ set_current_user( 0, $username );
+ if( !current_user_can( 'edit_pages' ) ) {
+ return new IXR_Error( 403, __( 'You are not allowed access to details about this blog.' ) );
+ }
+
+ $templates = get_page_templates( );
+ $templates['Default'] = 'default';
+
+ return $templates;
+ }
+
/* Blogger API functions
* specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/
@@ -1148,11 +1266,14 @@ class wp_xmlrpc_server extends IXR_Server {
$cap = ( $publish ) ? 'publish_posts' : 'edit_posts';
$error_message = __( 'Sorry, you are not allowed to publish posts on this blog.' );
$post_type = 'post';
+ $page_template = '';
if( !empty( $content_struct['post_type'] ) ) {
if( $content_struct['post_type'] == 'page' ) {
$cap = ( $publish ) ? 'publish_pages' : 'edit_pages';
$error_message = __( 'Sorry, you are not allowed to publish pages on this blog.' );
$post_type = 'page';
+ if( !empty( $content_struct['wp_page_template'] ) )
+ $page_template = $content_struct['wp_page_template'];
}
elseif( $content_struct['post_type'] == 'post' ) {
// This is the default, no changes needed
@@ -1309,7 +1430,7 @@ class wp_xmlrpc_server extends IXR_Server {
}
if ($post_more) {
- $post_content = $post_content . "\n<!--more-->\n" . $post_more;
+ $post_content = $post_content . "<!--more-->" . $post_more;
}
$to_ping = $content_struct['mt_tb_ping_urls'];
@@ -1341,9 +1462,9 @@ class wp_xmlrpc_server extends IXR_Server {
}
// We've got all the data -- post it:
- $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order', 'tags_input');
+ $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order', 'tags_input', 'page_template');
- $post_ID = wp_insert_post($postdata);
+ $post_ID = wp_insert_post($postdata, true);
if ( is_wp_error( $post_ID ) )
return new IXR_Error(500, $post_ID->get_error_message());
@@ -1355,6 +1476,12 @@ class wp_xmlrpc_server extends IXR_Server {
$this->set_custom_fields($post_ID, $content_struct['custom_fields']);
}
+ // Handle enclosures
+ $enclosure = $content_struct['enclosure'];
+ if( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) {
+ add_post_meta( $post_ID, 'enclosure', $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'] );
+ }
+
$this->attach_uploads( $post_ID, $post_content );
logIO('O', "Posted ! ID: $post_ID");
@@ -1370,7 +1497,7 @@ class wp_xmlrpc_server extends IXR_Server {
if( is_array( $attachments ) ) {
foreach( $attachments as $file ) {
if( strpos( $post_content, $file->guid ) !== false ) {
- $wpdb->query( "UPDATE {$wpdb->posts} SET post_parent = '$post_ID' WHERE ID = '{$file->ID}'" );
+ $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->posts} SET post_parent = %d WHERE ID = %d", $post_ID, $file->ID) );
}
}
}
@@ -1397,11 +1524,14 @@ class wp_xmlrpc_server extends IXR_Server {
$cap = ( $publish ) ? 'publish_posts' : 'edit_posts';
$error_message = __( 'Sorry, you are not allowed to publish posts on this blog.' );
$post_type = 'post';
+ $page_template = '';
if( !empty( $content_struct['post_type'] ) ) {
if( $content_struct['post_type'] == 'page' ) {
$cap = ( $publish ) ? 'publish_pages' : 'edit_pages';
$error_message = __( 'Sorry, you are not allowed to publish pages on this blog.' );
$post_type = 'page';
+ if( !empty( $content_struct['wp_page_template'] ) )
+ $page_template = $content_struct['wp_page_template'];
}
elseif( $content_struct['post_type'] == 'post' ) {
// This is the default, no changes needed
@@ -1578,7 +1708,7 @@ class wp_xmlrpc_server extends IXR_Server {
}
if ($post_more) {
- $post_content = $post_content . "\n<!--more-->\n" . $post_more;
+ $post_content = $post_content . "<!--more-->" . $post_more;
}
$to_ping = $content_struct['mt_tb_ping_urls'];
@@ -1600,9 +1730,12 @@ class wp_xmlrpc_server extends IXR_Server {
}
// We've got all the data -- post it:
- $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input');
+ $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input', 'page_template');
+
+ $result = wp_update_post($newpost, true);
+ if ( is_wp_error( $result ) )
+ return new IXR_Error(500, $result->get_error_message());
- $result = wp_update_post($newpost);
if (!$result) {
return new IXR_Error(500, __('Sorry, your entry could not be edited. Something wrong happened.'));
}
@@ -1611,6 +1744,12 @@ class wp_xmlrpc_server extends IXR_Server {
$this->set_custom_fields($post_ID, $content_struct['custom_fields']);
}
+ // Handle enclosures
+ $enclosure = $content_struct['enclosure'];
+ if( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) {
+ add_post_meta( $post_ID, 'enclosure', $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'] );
+ }
+
$this->attach_uploads( $ID, $post_content );
logIO('O',"(MW) Edited ! ID: $post_ID");
@@ -2111,7 +2250,7 @@ class wp_xmlrpc_server extends IXR_Server {
return new IXR_Error(404, __('Sorry, no such post.'));
}
- $comments = $wpdb->get_results("SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = $post_ID");
+ $comments = $wpdb->get_results( $wpdb->prepare("SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) );
if (!$comments) {
return array();
@@ -2224,7 +2363,7 @@ class wp_xmlrpc_server extends IXR_Server {
} elseif (is_string($urltest['fragment'])) {
// ...or a string #title, a little more complicated
$title = preg_replace('/[^a-z0-9]/i', '.', $urltest['fragment']);
- $sql = "SELECT ID FROM $wpdb->posts WHERE post_title RLIKE '$title'";
+ $sql = $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_title RLIKE %s", $title);
if (! ($post_ID = $wpdb->get_var($sql)) ) {
// returning unknown error '0' is better than die()ing
return new IXR_Error(0, '');
@@ -2253,7 +2392,7 @@ class wp_xmlrpc_server extends IXR_Server {
return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.'));
// Let's check that the remote site didn't already pingback this entry
- $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post_ID' AND comment_author_url = '$pagelinkedfrom'");
+ $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $post_ID, $pagelinkedfrom) );
if ( $wpdb->num_rows ) // We already have a Pingback from this URL
return new IXR_Error(48, __('The pingback has already been registered.'));
@@ -2362,7 +2501,7 @@ class wp_xmlrpc_server extends IXR_Server {
return new IXR_Error(32, __('The specified target URL does not exist.'));
}
- $comments = $wpdb->get_results("SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = $post_ID");
+ $comments = $wpdb->get_results( $wpdb->prepare("SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) );
if (!$comments) {
return array();