From 76aea3697c6043c1613370f172395b4f65ee71f0 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Fri, 20 Nov 2009 20:20:10 -0500 Subject: [PATCH] Wordpress 2.6.2 Signed-off-by: Edward Z. Yang --- index.php | 15 +- readme.html | 4 +- wp-admin/admin-ajax.php | 96 ++- wp-admin/admin-header.php | 85 +- wp-admin/admin-post.php | 24 + wp-admin/admin.php | 17 +- wp-admin/async-upload.php | 12 +- wp-admin/bookmarklet.php | 107 --- wp-admin/categories.php | 28 +- wp-admin/comment.php | 16 +- wp-admin/css/colors-classic-rtl.css | 25 +- wp-admin/css/colors-classic.css | 53 +- wp-admin/css/colors-fresh-rtl.css | 25 +- wp-admin/css/colors-fresh.css | 44 +- wp-admin/css/dashboard-rtl.css | 66 +- wp-admin/css/global-rtl.css | 31 + wp-admin/css/global.css | 4 + wp-admin/css/ie-rtl.css | 100 ++- wp-admin/css/ie.css | 3 + wp-admin/css/install-rtl.css | 30 +- wp-admin/css/install.css | 52 +- wp-admin/css/login-rtl.css | 25 +- wp-admin/css/media-rtl.css | 77 +- wp-admin/css/media.css | 75 +- wp-admin/css/press-this-ie-rtl.css | 3 + wp-admin/css/press-this-ie.css | 7 + wp-admin/css/press-this-rtl.css | 98 +++ wp-admin/css/press-this.css | 521 +++++++++++ wp-admin/css/theme-editor-rtl.css | 10 +- wp-admin/css/widgets-rtl.css | 53 +- wp-admin/css/widgets.css | 48 +- wp-admin/custom-header.php | 2 +- wp-admin/edit-category-form.php | 6 +- wp-admin/edit-comments.php | 25 +- wp-admin/edit-form-advanced.php | 232 ++--- wp-admin/edit-form-comment.php | 12 +- wp-admin/edit-link-categories.php | 10 +- wp-admin/edit-link-category-form.php | 4 +- wp-admin/edit-link-form.php | 88 +- wp-admin/edit-page-form.php | 174 ++-- wp-admin/edit-pages.php | 32 +- wp-admin/edit-tag-form.php | 4 +- wp-admin/edit-tags.php | 3 +- wp-admin/edit.php | 7 +- wp-admin/export.php | 4 +- wp-admin/gears-manifest.php | 209 +++++ wp-admin/images/gear.png | Bin 0 -> 16742 bytes wp-admin/images/loading-publish.gif | Bin 0 -> 1849 bytes wp-admin/images/loading.gif | Bin 0 -> 2530 bytes wp-admin/images/logo.gif | Bin 0 -> 1238 bytes wp-admin/images/no.png | Bin 0 -> 792 bytes wp-admin/images/required.gif | Bin 0 -> 62 bytes wp-admin/images/tab.png | Bin 0 -> 1006 bytes wp-admin/images/yes.png | Bin 0 -> 612 bytes wp-admin/import/blogger.php | 4 +- wp-admin/import/dotclear.php | 4 +- wp-admin/import/greymatter.php | 12 +- wp-admin/import/mt.php | 8 +- wp-admin/import/textpattern.php | 6 +- wp-admin/import/wordpress.php | 9 +- wp-admin/import/wp-cat2tag.php | 415 ++++++--- wp-admin/includes/bookmark.php | 19 +- .../includes/class-wp-filesystem-base.php | 158 ++++ .../includes/class-wp-filesystem-direct.php | 190 ++-- .../includes/class-wp-filesystem-ftpext.php | 248 ++---- .../class-wp-filesystem-ftpsockets.php | 270 ++---- wp-admin/includes/comment.php | 4 +- wp-admin/includes/dashboard.php | 22 +- wp-admin/includes/export.php | 9 +- wp-admin/includes/file.php | 203 ++++- wp-admin/includes/image.php | 10 +- wp-admin/includes/media.php | 451 ++++++++-- wp-admin/includes/misc.php | 2 +- wp-admin/includes/plugin.php | 144 +++- wp-admin/includes/post.php | 269 +++--- wp-admin/includes/schema.php | 34 +- wp-admin/includes/taxonomy.php | 4 +- wp-admin/includes/template.php | 373 +++++--- wp-admin/includes/theme.php | 2 +- wp-admin/includes/update.php | 135 +-- wp-admin/includes/upgrade.php | 122 +-- wp-admin/includes/user.php | 42 +- wp-admin/includes/widgets.php | 23 +- wp-admin/index.php | 30 +- wp-admin/install-helper.php | 8 +- wp-admin/install.php | 13 +- wp-admin/js/editor.js | 5 +- wp-admin/js/forms.js | 51 +- wp-admin/js/gallery.js | 28 + wp-admin/js/link.js | 3 + wp-admin/js/media-upload.js | 59 +- wp-admin/js/post.js | 16 +- wp-admin/js/revisions-js.php | 34 + wp-admin/js/theme-preview.js | 44 + wp-admin/js/widgets.js | 8 +- wp-admin/js/word-count.js | 39 + wp-admin/js/wp-gears.js | 92 ++ wp-admin/link-add.php | 1 - wp-admin/link-category.php | 9 +- wp-admin/link-import.php | 10 +- wp-admin/link-manager.php | 3 +- wp-admin/link-parse-opml.php | 2 +- wp-admin/link.php | 1 - wp-admin/media.php | 11 +- wp-admin/menu-header.php | 20 +- wp-admin/menu.php | 7 +- wp-admin/moderation.php | 2 +- wp-admin/options-discussion.php | 80 +- wp-admin/options-general.php | 30 +- wp-admin/options-misc.php | 12 +- wp-admin/options-permalink.php | 8 +- wp-admin/options-privacy.php | 4 +- wp-admin/options-reading.php | 18 +- wp-admin/options-writing.php | 44 +- wp-admin/options.php | 2 +- wp-admin/page-new.php | 3 +- wp-admin/page.php | 15 +- wp-admin/plugin-editor.php | 9 +- wp-admin/plugins.php | 412 ++++++--- wp-admin/post-new.php | 3 +- wp-admin/post.php | 15 +- wp-admin/press-this.php | 536 ++++++++++++ wp-admin/revision.php | 213 +++++ wp-admin/rtl.css | 575 ++++++------ wp-admin/setup-config.php | 35 +- wp-admin/sidebar.php | 18 +- wp-admin/theme-editor.php | 18 +- wp-admin/themes.php | 105 ++- wp-admin/update-links.php | 8 +- wp-admin/update.php | 27 +- wp-admin/upgrade.php | 12 +- wp-admin/upload.php | 3 +- wp-admin/user-edit.php | 41 +- wp-admin/users.php | 29 +- wp-admin/widgets.php | 10 +- wp-admin/wp-admin.css | 248 ++++-- wp-app.php | 136 ++- wp-atom.php | 13 +- wp-blog-header.php | 28 +- wp-comments-post.php | 12 +- wp-commentsrss2.php | 15 +- wp-config-sample.php | 15 +- wp-content/plugins/akismet/akismet.php | 30 +- wp-content/plugins/akismet/readme.txt | 22 + wp-content/plugins/hello.php | 2 +- wp-content/themes/classic/index.php | 2 +- wp-content/themes/classic/style.css | 42 + wp-content/themes/default/comments.php | 4 +- .../themes/default/images/header-img.php | 134 +-- wp-content/themes/default/searchform.php | 1 + wp-content/themes/default/single.php | 2 +- wp-content/themes/default/style.css | 41 +- wp-cron.php | 24 +- wp-feed.php | 14 + wp-includes/Text/Diff.php | 414 +++++++++ wp-includes/Text/Diff/Engine/native.php | 437 ++++++++++ wp-includes/Text/Diff/Engine/shell.php | 164 ++++ wp-includes/Text/Diff/Engine/string.php | 234 +++++ wp-includes/Text/Diff/Engine/xdiff.php | 63 ++ wp-includes/Text/Diff/Renderer.php | 237 +++++ wp-includes/Text/Diff/Renderer/inline.php | 172 ++++ wp-includes/atomlib.php | 6 +- wp-includes/author-template.php | 117 ++- wp-includes/bookmark-template.php | 115 ++- wp-includes/bookmark.php | 67 +- wp-includes/cache.php | 133 +-- wp-includes/canonical.php | 41 +- wp-includes/capabilities.php | 4 +- wp-includes/category-template.php | 64 +- wp-includes/category.php | 235 ++++- wp-includes/class-IXR.php | 68 +- wp-includes/class-phpass.php | 17 +- wp-includes/class-phpmailer.php | 21 +- wp-includes/class-pop3.php | 7 +- wp-includes/class-smtp.php | 28 +- wp-includes/class-snoopy.php | 43 +- wp-includes/class.wp-dependencies.php | 193 +++++ wp-includes/class.wp-scripts.php | 89 ++ wp-includes/class.wp-styles.php | 71 ++ wp-includes/classes.php | 26 +- wp-includes/comment-template.php | 136 +-- wp-includes/comment.php | 271 +++--- wp-includes/cron.php | 1 + wp-includes/default-filters.php | 4 + wp-includes/deprecated.php | 6 +- wp-includes/feed.php | 277 +++++- wp-includes/formatting.php | 23 +- wp-includes/functions.php | 814 ++++++++++++++--- wp-includes/functions.wp-scripts.php | 77 ++ wp-includes/functions.wp-styles.php | 45 + wp-includes/general-template.php | 115 ++- wp-includes/images/blank.gif | Bin 0 -> 43 bytes wp-includes/js/autosave.js | 41 +- .../js/jquery/jquery.dimensions.min.js | 12 - wp-includes/js/jquery/jquery.js | 8 +- wp-includes/js/jquery/suggest.js | 24 +- wp-includes/js/jquery/ui.core.js | 2 + wp-includes/js/jquery/ui.sortable.js | 2 + wp-includes/js/jquery/ui.tabs.js | 529 +----------- wp-includes/js/swfupload/handlers.js | 2 +- wp-includes/js/thickbox/macFFBgHack.png | Bin 0 -> 207 bytes wp-includes/js/thickbox/thickbox.css | 14 +- wp-includes/js/tinymce/langs/wp-langs.php | 46 +- .../plugins/fullscreen/editor_plugin.js | 2 +- .../tinymce/plugins/fullscreen/fullscreen.htm | 14 +- .../plugins/inlinepopups/editor_plugin.js | 2 +- .../tinymce/plugins/inlinepopups/template.htm | 2 +- .../js/tinymce/plugins/media/css/media.css | 84 +- .../js/tinymce/plugins/media/editor_plugin.js | 2 +- .../js/tinymce/plugins/media/js/media.js | 21 +- .../js/tinymce/plugins/media/media.htm | 14 +- .../js/tinymce/plugins/paste/blank.htm | 2 +- .../js/tinymce/plugins/paste/editor_plugin.js | 2 +- .../js/tinymce/plugins/paste/pastetext.htm | 4 +- .../js/tinymce/plugins/paste/pasteword.htm | 6 +- .../tinymce/plugins/safari/editor_plugin.js | 2 +- .../plugins/wordpress/editor_plugin.js | 142 ++- .../tinymce/plugins/wordpress/img/audio.gif | Bin 0 -> 146 bytes .../tinymce/plugins/wordpress/img/image.gif | Bin 0 -> 101 bytes .../tinymce/plugins/wordpress/img/media.gif | Bin 0 -> 149 bytes .../tinymce/plugins/wordpress/img/video.gif | Bin 0 -> 99 bytes .../js/tinymce/plugins/wordpress/popups.css | 354 -------- .../plugins/wpeditimage/css/editimage-rtl.css | 68 ++ .../plugins/wpeditimage/css/editimage.css | 239 +++++ .../plugins/wpeditimage/editimage.html | 275 ++++++ .../plugins/wpeditimage/editor_plugin.js | 217 +++++ .../plugins/wpeditimage/img/delete.png | Bin 0 -> 1638 bytes .../tinymce/plugins/wpeditimage/img/image.png | Bin 0 -> 3701 bytes .../plugins/wpeditimage/js/editimage.js | 607 +++++++++++++ .../js/tinymce/themes/advanced/about.htm | 6 +- .../js/tinymce/themes/advanced/anchor.htm | 4 +- .../js/tinymce/themes/advanced/charmap.htm | 4 +- .../tinymce/themes/advanced/color_picker.htm | 6 +- .../themes/advanced/editor_template.js | 2 +- .../js/tinymce/themes/advanced/image.htm | 8 +- .../js/tinymce/themes/advanced/img/icons.gif | Bin 11532 -> 11505 bytes .../themes/advanced/js/color_picker.js | 12 +- .../js/tinymce/themes/advanced/js/image.js | 2 +- .../js/tinymce/themes/advanced/link.htm | 10 +- .../themes/advanced/skins/default/content.css | 5 + .../themes/advanced/skins/o2k7/content.css | 5 + .../advanced/skins/wp_theme/content.css | 25 +- .../tinymce/themes/advanced/source_editor.htm | 4 +- wp-includes/js/tinymce/tiny_mce.js | 2 +- wp-includes/js/tinymce/tiny_mce_config.php | 29 +- wp-includes/js/tinymce/tiny_mce_ext.js | 3 +- wp-includes/js/tinymce/tiny_mce_popup.js | 4 +- .../js/tinymce/utils/editable_selects.js | 10 +- wp-includes/js/tinymce/utils/mctabs.js | 24 +- wp-includes/js/tinymce/utils/validate.js | 4 +- wp-includes/js/tinymce/wordpress.css | 42 +- wp-includes/js/tinymce/wp-mce-help.php | 8 +- wp-includes/js/wp-ajax.js | 100 --- wp-includes/js/wp-lists.js | 2 + wp-includes/kses.php | 33 +- wp-includes/l10n.php | 50 +- wp-includes/link-template.php | 178 +++- wp-includes/media.php | 65 +- wp-includes/pluggable.php | 592 +++++++++---- wp-includes/plugin.php | 7 +- wp-includes/post-template.php | 169 +++- wp-includes/post.php | 815 ++++++++++++++---- wp-includes/query.php | 163 ++-- wp-includes/rewrite.php | 39 +- wp-includes/rss.php | 3 +- wp-includes/script-loader.php | 706 ++++++--------- wp-includes/shortcodes.php | 238 ++++- wp-includes/streams.php | 41 +- wp-includes/taxonomy.php | 549 +++++++----- wp-includes/template-loader.php | 6 +- wp-includes/theme.php | 57 +- wp-includes/update.php | 106 ++- wp-includes/user.php | 31 +- wp-includes/vars.php | 6 +- wp-includes/version.php | 7 +- wp-includes/widgets.php | 106 ++- wp-includes/wp-db.php | 566 ++++++++++-- wp-includes/wp-diff.php | 318 +++++++ wp-links-opml.php | 14 +- wp-load.php | 50 ++ wp-login.php | 141 ++- wp-mail.php | 14 +- wp-pass.php | 10 +- wp-rdf.php | 17 +- wp-register.php | 14 +- wp-rss.php | 15 +- wp-rss2.php | 13 +- wp-settings.php | 132 ++- wp-trackback.php | 17 +- xmlrpc.php | 342 +++++++- 290 files changed, 16685 insertions(+), 6164 deletions(-) create mode 100644 wp-admin/admin-post.php delete mode 100644 wp-admin/bookmarklet.php create mode 100644 wp-admin/css/global-rtl.css create mode 100644 wp-admin/css/press-this-ie-rtl.css create mode 100644 wp-admin/css/press-this-ie.css create mode 100644 wp-admin/css/press-this-rtl.css create mode 100644 wp-admin/css/press-this.css create mode 100644 wp-admin/gears-manifest.php create mode 100644 wp-admin/images/gear.png create mode 100644 wp-admin/images/loading-publish.gif create mode 100644 wp-admin/images/loading.gif create mode 100644 wp-admin/images/logo.gif create mode 100644 wp-admin/images/no.png create mode 100644 wp-admin/images/required.gif create mode 100644 wp-admin/images/tab.png create mode 100644 wp-admin/images/yes.png create mode 100644 wp-admin/includes/class-wp-filesystem-base.php create mode 100644 wp-admin/js/gallery.js create mode 100644 wp-admin/js/revisions-js.php create mode 100644 wp-admin/js/theme-preview.js create mode 100644 wp-admin/js/word-count.js create mode 100644 wp-admin/js/wp-gears.js create mode 100644 wp-admin/press-this.php create mode 100644 wp-admin/revision.php create mode 100644 wp-content/plugins/akismet/readme.txt create mode 100644 wp-includes/Text/Diff.php create mode 100644 wp-includes/Text/Diff/Engine/native.php create mode 100644 wp-includes/Text/Diff/Engine/shell.php create mode 100644 wp-includes/Text/Diff/Engine/string.php create mode 100644 wp-includes/Text/Diff/Engine/xdiff.php create mode 100644 wp-includes/Text/Diff/Renderer.php create mode 100644 wp-includes/Text/Diff/Renderer/inline.php create mode 100644 wp-includes/class.wp-dependencies.php create mode 100644 wp-includes/class.wp-scripts.php create mode 100644 wp-includes/class.wp-styles.php create mode 100644 wp-includes/functions.wp-scripts.php create mode 100644 wp-includes/functions.wp-styles.php create mode 100644 wp-includes/images/blank.gif delete mode 100644 wp-includes/js/jquery/jquery.dimensions.min.js create mode 100644 wp-includes/js/jquery/ui.core.js create mode 100644 wp-includes/js/jquery/ui.sortable.js create mode 100644 wp-includes/js/thickbox/macFFBgHack.png create mode 100644 wp-includes/js/tinymce/plugins/wordpress/img/audio.gif create mode 100644 wp-includes/js/tinymce/plugins/wordpress/img/image.gif create mode 100644 wp-includes/js/tinymce/plugins/wordpress/img/media.gif create mode 100644 wp-includes/js/tinymce/plugins/wordpress/img/video.gif delete mode 100644 wp-includes/js/tinymce/plugins/wordpress/popups.css create mode 100644 wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css create mode 100644 wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css create mode 100644 wp-includes/js/tinymce/plugins/wpeditimage/editimage.html create mode 100644 wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js create mode 100644 wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png create mode 100644 wp-includes/js/tinymce/plugins/wpeditimage/img/image.png create mode 100644 wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js delete mode 100644 wp-includes/js/wp-ajax.js create mode 100644 wp-includes/wp-diff.php create mode 100644 wp-load.php diff --git a/index.php b/index.php index b1c655cd..49403ecc 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,18 @@ \ No newline at end of file diff --git a/readme.html b/readme.html index a60861c5..45fd3f88 100644 --- a/readme.html +++ b/readme.html @@ -8,7 +8,7 @@

WordPress -
Version 2.5 +
Version 2.6.1

Semantic Personal Publishing Platform

@@ -29,7 +29,7 @@

Upgrading

Before you upgrade anything, make sure you have backup copies of any files you may have modified such as index.php.

-

Upgrading from any previous WordPress to 2.5:

+

Upgrading from any previous WordPress to 2.6.1:

  1. Delete your old WP files, saving ones you've modified.
  2. Upload the new files.
  3. diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 4e34333c..44859351 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -1,7 +1,7 @@ get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%$s%')" ); + if ( strstr( $s, ',' ) ) { + $s = explode( ',', $s ); + $s = $s[count( $s ) - 1]; + } + $s = trim( $s ); + if ( strlen( $s ) < 2 ) + die; // require 2 chars for matching + $results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%". $s . "%')" ); echo join( $results, "\n" ); die; } @@ -25,14 +30,17 @@ switch ( $action = $_POST['action'] ) : case 'delete-comment' : check_ajax_referer( "delete-comment_$id" ); if ( !$comment = get_comment( $id ) ) - die('0'); + die('1'); if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) die('-1'); - if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) + if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) { + if ( 'spam' == wp_get_comment_status( $comment->comment_ID ) ) + die('1'); $r = wp_set_comment_status( $comment->comment_ID, 'spam' ); - else + } else { $r = wp_delete_comment( $comment->comment_ID ); + } die( $r ? '1' : '0' ); break; @@ -41,24 +49,38 @@ case 'delete-cat' : if ( !current_user_can( 'manage_categories' ) ) die('-1'); + $cat = get_category( $id ); + if ( !$cat || is_wp_error( $cat ) ) + die('1'); + if ( wp_delete_category( $id ) ) die('1'); - else die('0'); + else + die('0'); break; case 'delete-tag' : check_ajax_referer( "delete-tag_$id" ); if ( !current_user_can( 'manage_categories' ) ) die('-1'); + $tag = get_term( $id, 'post_tag' ); + if ( !$tag || is_wp_error( $tag ) ) + die('1'); + if ( wp_delete_term($id, 'post_tag')) die('1'); - else die('0'); + else + die('0'); break; case 'delete-link-cat' : check_ajax_referer( "delete-link-category_$id" ); if ( !current_user_can( 'manage_categories' ) ) die('-1'); + $cat = get_term( $id, 'link_category' ); + if ( !$cat || is_wp_error( $cat ) ) + die('1'); + $cat_name = get_term_field('name', $id, 'link_category'); // Don't delete the default cats. @@ -89,14 +111,20 @@ case 'delete-link' : if ( !current_user_can( 'manage_links' ) ) die('-1'); + $link = get_bookmark( $id ); + if ( !$link || is_wp_error( $link ) ) + die('1'); + if ( wp_delete_link( $id ) ) die('1'); - else die('0'); + else + die('0'); break; case 'delete-meta' : check_ajax_referer( "delete-meta_$id" ); if ( !$meta = get_post_meta_by_id( $id ) ) - die('0'); + die('1'); + if ( !current_user_can( 'edit_post', $meta->post_id ) ) die('-1'); if ( delete_meta( $meta->meta_id ) ) @@ -108,6 +136,9 @@ case 'delete-post' : if ( !current_user_can( 'delete_post', $id ) ) die('-1'); + if ( !get_post( $id ) ) + die('1'); + if ( wp_delete_post( $id ) ) die('1'); else @@ -118,19 +149,28 @@ case 'delete-page' : if ( !current_user_can( 'delete_page', $id ) ) die('-1'); + if ( !get_page( $id ) ) + die('1'); + if ( wp_delete_post( $id ) ) die('1'); - else die('0'); + else + die('0'); break; case 'dim-comment' : if ( !$comment = get_comment( $id ) ) die('0'); + if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) die('-1'); if ( !current_user_can( 'moderate_comments' ) ) die('-1'); - if ( 'unapproved' == wp_get_comment_status($comment->comment_ID) ) { + $current = wp_get_comment_status( $comment->comment_ID ); + if ( $_POST['new'] == $current ) + die('1'); + + if ( 'unapproved' == $current ) { check_ajax_referer( "approve-comment_$id" ); if ( wp_set_comment_status( $comment->comment_ID, 'approve' ) ) die('1'); @@ -150,6 +190,9 @@ case 'add-category' : // On the Fly $parent = 0; $post_category = isset($_POST['post_category'])? (array) $_POST['post_category'] : array(); $checked_categories = array_map( 'absint', (array) $post_category ); + $popular_ids = isset( $_POST['popular_ids'] ) ? + array_map( 'absint', explode( ',', $_POST['popular_ids'] ) ) : + false; $x = new WP_Ajax_Response(); foreach ( $names as $cat_name ) { @@ -163,7 +206,7 @@ case 'add-category' : // On the Fly continue; $category = get_category( $cat_id ); ob_start(); - wp_category_checklist( 0, $cat_id, $checked_categories ); + wp_category_checklist( 0, $cat_id, $checked_categories, $popular_ids ); $data = ob_get_contents(); ob_end_clean(); $x->add( array( @@ -349,13 +392,16 @@ case 'add-comment' : list($comments, $total) = _wp_get_comment_list( $status, $search, $start, 1 ); + if ( get_option('show_avatars') ) + add_filter( 'comment_author', 'floated_admin_avatar' ); + if ( !$comments ) die('1'); $x = new WP_Ajax_Response(); foreach ( (array) $comments as $comment ) { get_comment( $comment ); ob_start(); - _wp_comment_row( $comment->comment_ID, $mode, false ); + _wp_comment_row( $comment->comment_ID, $mode, $status ); $comment_list_item = ob_get_contents(); ob_end_clean(); $x->add( array( @@ -459,10 +505,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'])) @@ -476,8 +523,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(); @@ -508,8 +556,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 0185a986..54fdea48 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(); <?php bloginfo('name') ?> › <?php echo wp_specialchars( strip_tags( $title ) ); ?> — WordPress - - - - -post_title = stripslashes($post_title); -else - $post->post_title = $popuptitle; - - -$content = wp_specialchars($_REQUEST['content']); -$popupurl = clean_url($_REQUEST['popupurl']); -if ( !empty($content) ) { - $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) ); -} else { - $post->post_content = ''.$popuptitle.''."\n$text"; -} - -/* /big funky fixes */ - -?> - - -<?php bloginfo('name') ?> › Bookmarklet — WordPress - - - - - - - - - - - - - - diff --git a/wp-admin/categories.php b/wp-admin/categories.php index 945da0c6..d2e8fb37 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -126,6 +126,7 @@ endif; ?>

    +

    @@ -134,6 +135,24 @@ endif; ?>
    + add_query_arg( 'pagenum', '%#%' ), + 'format' => '', + 'total' => ceil(wp_count_terms('category') / $catsperpage), + 'current' => $pagenum +)); + +if ( $page_links ) + echo "
    $page_links
    "; +?> +
    @@ -147,7 +166,7 @@ endif; ?> - + @@ -155,13 +174,18 @@ endif; ?>
    + +$page_links
    "; +?>

    diff --git a/wp-admin/comment.php b/wp-admin/comment.php index 72d01470..d1e394ea 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'] ) { - +
    ' onclick="self.location='/wp-admin/edit-comments.php';" />' onclick="self.location='" />
    @@ -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; @@ -193,14 +193,10 @@ case 'approvecomment' : wp_set_comment_status( $comment->comment_ID, 'approve' ); - if ( true == get_option('comments_notify') ) - wp_notify_postauthor( $comment->comment_ID ); - - 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; @@ -229,4 +225,4 @@ default: include('admin-footer.php'); -?> \ No newline at end of file +?> diff --git a/wp-admin/css/colors-classic-rtl.css b/wp-admin/css/colors-classic-rtl.css index 5d0d05cf..4c6f3271 100644 --- a/wp-admin/css/colors-classic-rtl.css +++ b/wp-admin/css/colors-classic-rtl.css @@ -1,3 +1,24 @@ +.post-com-count { +} +#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins { + background-image: url(../images/comment-stalk-rtl.gif); + background-position:right bottom; +} +#footer { + background-position:99% 10px; +} #poststuff .closed .togbox, #poststuff .togbox { -background-image: url(../images/toggle-arrow-rtl.gif) !important; -} \ No newline at end of file + background-image: url(../images/toggle-arrow-rtl.gif) !important; +} +.bar { + border-right-color: transparent; + border-left-color: #99d; +} +.plugins .togl { + border-right-color: transparent; + border-left-color: #ccc; +} +#upload-menu li.current { + border-right-color: transparent; + border-left-color: #448abd; +} diff --git a/wp-admin/css/colors-classic.css b/wp-admin/css/colors-classic.css index 6f83c661..65d0f383 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; @@ -311,11 +312,11 @@ ul.widget-control-list .sorthelper { font-weight: bold; } -#adminmenu li a #awaiting-mod { +#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins { background-image: url(../images/comment-stalk-classic.gif); } -#adminmenu li a #awaiting-mod span { +#adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span { background-color: #d54e21; color: #fff; } @@ -326,7 +327,7 @@ ul.widget-control-list .sorthelper { } -#adminmenu li a:hover #awaiting-mod span { +#adminmenu li a:hover #awaiting-mod span, #sidemenu li a:hover #update-plugins span { background-color: #07273E; } @@ -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-rtl.css b/wp-admin/css/colors-fresh-rtl.css index 5d0d05cf..d7b7afbb 100644 --- a/wp-admin/css/colors-fresh-rtl.css +++ b/wp-admin/css/colors-fresh-rtl.css @@ -1,3 +1,24 @@ +.bar { + border-right-color: transparent; + border-left-color: #99d; +} +.post-com-count { +} +#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins { + background-image: url(../images/comment-stalk-rtl.gif); + background-position:right bottom; +} +#footer { + background-position:99% 10px; +} +.plugins .togl { + border-right-color: transparent; + border-left-color: #ccc; +} #poststuff .closed .togbox, #poststuff .togbox { -background-image: url(../images/toggle-arrow-rtl.gif) !important; -} \ No newline at end of file + background-image: url(../images/toggle-arrow-rtl.gif); +} +#upload-menu li.current { + border-right-color:transparent; + border-left-color: #448abd; +} diff --git a/wp-admin/css/colors-fresh.css b/wp-admin/css/colors-fresh.css index 1332c376..09e0c582 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,28 +279,28 @@ 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; color: #d54e21; } -#adminmenu li a #awaiting-mod { +#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins { background-image: url(../images/comment-stalk-fresh.gif); } -#adminmenu li a #awaiting-mod span, #rightnow .reallynow { +#adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span, #rightnow .reallynow { background-color: #d54e21; color: #fff; } -#adminmenu li a:hover #awaiting-mod span { +#adminmenu li a:hover #awaiting-mod span, #sidemenu li a:hover #update-plugins span { background-color: #264761; } @@ -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/dashboard-rtl.css b/wp-admin/css/dashboard-rtl.css index 29e59cf2..3c4fd61a 100644 --- a/wp-admin/css/dashboard-rtl.css +++ b/wp-admin/css/dashboard-rtl.css @@ -1,62 +1,62 @@ +/* Right Now */ #rightnow { - margin-left: 15px; + margin-right:0; + margin-left: 7px; } - #rightnow .reallynow span { text-align: right; float: right; } - #rightnow .reallynow a { text-align: left; float: left; margin: 1px 0 0 6px; } - -h3.dashboard-widget-title span { - text-align: right; - float: right; +/* Widgets */ +div#dashboard-widgets-wrap { + margin-right:0; + margin-left:-13px; } - -#dashboard-widgets .widget_rss ul li a { +div.dashboard-widget-holder { float:right; - font-weight:bold; - margin:0pt 0pt 0.2em 0.5em; } - -#dashboard-widgets .widget_rss ul li span.rss-date { +div.dashboard-widget { + margin-right:0; + margin-left: 20px; +} +h3.dashboard-widget-title span { + text-align: right; float: right; } - h3.dashboard-widget-title small { text-align: left; - float: left; + float:left; } -div.dashboard-widget-content ul, -div.dashboard-widget-content ol, -div.dashboard-widget-content dl { +div.dashboard-widget-submit input { + font-family: Tahoma; +} +div.dashboard-widget-content ul, div.dashboard-widget-content ol, div.dashboard-widget-content dl { padding-left:0; padding-right:15px; } -div#dashboard-widgets-wrap -{ - margin-right:0; - margin-left:-10px; +#dashboard_secondary div.dashboard-widget-content ul li { + float:right; } - -div.dashboard-widget { - margin-right:0; - margin-left:20px; +#dashboard_secondary div.dashboard-widget-content ul li .post { + font-family:arial; +} +#dashboard_secondary div.dashboard-widget-content ul li a { + border-right:0 none; + border-left: 1px solid #dadada; + height:110px; +} +#dashboard_secondary div.dashboard-widget-content ul li a cite { + font-family: Tahoma; } - #dashboard-widgets .widget_rss ul li span.rss-date { float:right; } #dashboard-widgets .widget_rss ul li a { - float:right; - margin:0 0 0.2em 0.5em; + float: right; + margin: 0 0 .2em .5em; } -#dashboard_secondary div.dashboard-widget-content ul li a { - border-right:0 none; - border-left:1px solid #DADADA; -} \ No newline at end of file diff --git a/wp-admin/css/global-rtl.css b/wp-admin/css/global-rtl.css new file mode 100644 index 00000000..c1dfe5e8 --- /dev/null +++ b/wp-admin/css/global-rtl.css @@ -0,0 +1,31 @@ +body, td { + font-family: Tahoma; +} +textarea, input, select { + font-family: Tahoma; +} +h1, h2, h3 { + font-family:arial; +} +.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 { + font-family:arial; + margin: 5px -4px 0 0; + padding-right:0; + padding-left: 280px; +} +.wrap h2.long-header { + padding-left: 0; +} diff --git a/wp-admin/css/global.css b/wp-admin/css/global.css index 926aa88b..295adea8 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-rtl.css b/wp-admin/css/ie-rtl.css index 54cadd07..1aa7cdb7 100644 --- a/wp-admin/css/ie-rtl.css +++ b/wp-admin/css/ie-rtl.css @@ -1,53 +1,73 @@ -/* footer */ -body, td { - font-family: Tahoma,Verdana,sans-serif; +#poststuff .postbox h3 { + padding-left:0; + padding-right: 23px; } - -.wrap { - text-align: right; +* html #poststuff .postarea, * html #poststuff #titlediv { + margin-left:0; + margin-right: 3%; } - -.wrap h2 { - margin: 5px 0 0 4px; -} - -#footer { - padding-left:50px; +* html #poststuff h2 { + margin-right: 0; } -#footer p { - background:none; - height:auto; - padding: 5px 5px 0; -} - #bh { + padding-right:0; padding-left: 15px; - padding-right: 0px; } -/* write post */ +div#dashboard-widgets { + padding-right:0; + padding-left: 1px; +} +#tagchecklist span a { + margin: 4px -9px 0 0; +} #poststuff .togbox { - margin-right:-16px; + margin-left:0; + margin-right: -19px; } -#poststuff h3 { - padding-right:20px; +.widefat th input { + margin: 0 5px 0 0; } - -p#widget-search, p#post-search { - padding-left: 15px; +/* ---------- add by navid */ +#dashmenu { /* fix top right bottom in admin */ + direction:ltr; +} +#sidemenu a { /* fix left admin buttom ex. plugins, options */ + float:left; } - -.widefat th { - padding-bottom: 8px; +.wrap h2 { + margin:5px 4px 0 0; +} +#editor-toolbar {/* fix hover in media uploader icon */ + direction:ltr; +} +#TB_window { /* fix theme preview */ + left:2%; +} +/* fix widget page */ +form#widgets-filter { + position:static; } - -/* template editor */ -#template textarea { +#widget-search { + display:none; +} +/* fix manage comment page */ +ul.view-switch li { float:left; } - -/* Editor */ - -.mceToolbar { - direction: ltr; - text-align: left; -} \ No newline at end of file +form#posts-filter { + position:static; +} +#post-search { + display:none; +} +#submenu { + margin-right: 20px; +} +/* Fixes for media-upload window */ +/* Center media-upload panel on screen */ +#TB_window { + width: 670px; + position: absolute; + top: 50%; + left: 50%; + margin-right: 335px !important; } diff --git a/wp-admin/css/ie.css b/wp-admin/css/ie.css index 39ef2546..e4d03554 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/install-rtl.css b/wp-admin/css/install-rtl.css index 806dbc54..efef9612 100644 --- a/wp-admin/css/install-rtl.css +++ b/wp-admin/css/install-rtl.css @@ -1,19 +1,27 @@ body { - font-size: 11px;; + font-family: Tahoma; +} +/* Half the page disapears on IE6 */ +* html body { + width: 700px; + position: absolute; + left: 50%; + margin-right: 350px; } ul, ol { padding: 5px 22px 5px 5px; } -.form-table th { - text-align: right; +.step, th { + text-align:right; } -input { - padding: 1px +.submit input, .button, .button-secondary { + font-family: Tahoma; + margin-right:0; +} +.form-table th { + text-align:right; } -#logo { - text-align: left; +h1 { + font-family:arial; + margin: 5px -4px 0 0; } -#admin_email { - direction: ltr; - text-align: left; -} \ No newline at end of file diff --git a/wp-admin/css/install.css b/wp-admin/css/install.css index 5f4164c6..cfa03253 100644 --- a/wp-admin/css/install.css +++ b/wp-admin/css/install.css @@ -7,8 +7,10 @@ body { margin: 2em auto 0 auto; width: 700px; padding: 1em 2em; + -moz-border-radius: 12px; + -khtml-border-radius: 12px; -webkit-border-radius: 12px; - font-size: 62.5%; + border-radius: 12px; } a { color: #2583ad; text-decoration: none; } @@ -25,34 +27,41 @@ h2 { font-size: 16px; } p, li { padding-bottom: 2px; - font-size: 1.3em; - line-height: 1.8em; + font-size: 13px; + line-height: 18px; } code { - font-size: 1.3em; + font-size: 13px; } ul, ol { padding: 5px 5px 5px 22px; } #logo { margin: 6px 0 14px 0px; border-bottom: none;} -.step a, .step input { font-size: 2em; } +.step { + margin: 20px 0 15px; +} -td input { font-size: 1.5em; } +.step input { + font-size: 18px; +} + +a.button { + font-size: 18px; +} .step, th { text-align: left; padding: 0; } .submit input, .button, .button-secondary { font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; - padding: 6px; - border: none; + padding: 5px 7px 7px; + border: 1px solid #a3a3a3; margin-left: 0; - font-size: 13px !important; - -moz-border-radius: 2px; - -khtml-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; color: #246; background: #e5e5e5; } @@ -63,6 +72,7 @@ td input { font-size: 1.5em; } .submit input:hover, .button:hover, .button-secondary:hover { color: #d54e21; + border-color: #535353; } .form-table { @@ -75,12 +85,13 @@ td input { font-size: 1.5em; } margin-bottom: 9px; padding: 10px; border-bottom: 8px solid #fff; + font-size: 12px; } .form-table th { - font-size: 12px; + font-size: 13px; text-align: left; - padding: 12px 10px 10px 10px; + padding: 16px 10px 10px 10px; border-bottom: 8px solid #fff; width: 110px; vertical-align: top; @@ -100,6 +111,12 @@ td input { font-size: 1.5em; } font-size: 11px; } +.form-table input { + line-height: 20px; + font-size: 15px; + padding: 2px; +} + h1 { border-bottom: 1px solid #dadada; clear: both; @@ -116,9 +133,10 @@ h1 { #error-page p { font-size: 14px; - line-height: 1.6em; + line-height: 16px; + margin: 25px 0 20px; } #error-page code { - font-size: 1em; + font-size: 15px; } \ No newline at end of file diff --git a/wp-admin/css/login-rtl.css b/wp-admin/css/login-rtl.css index fc272634..daefbacb 100644 --- a/wp-admin/css/login-rtl.css +++ b/wp-admin/css/login-rtl.css @@ -1,32 +1,37 @@ body { - font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; - direction: rtl; + font-family: Tahoma; } form { margin-left:0; - margin-right:8px; + margin-right: 8px; } form .forgetmenot { float:right; } +#login form .submit input { + font-family: Tahoma; +} form .submit { float:left; } +#backtoblog a { + left:auto; + right:15px; +} #login_error, .message { - margin:0 8px 16px 0; + margin: 0 8px 16px 0; } #nav { - margin: 0 8px 0 0; + margin:0 8px 0 0; } #user_pass, #user_login, #user_email { margin-right:0; margin-left: 6px; - direction:ltr; } h1 a { text-decoration:none; } -#backtoblog a { - left: auto; - right: 15px; -} \ No newline at end of file +/* ltr input */ +#user_login, #user_pass { + direction:ltr; +} diff --git a/wp-admin/css/media-rtl.css b/wp-admin/css/media-rtl.css index f0c00dfe..b23ad0e8 100644 --- a/wp-admin/css/media-rtl.css +++ b/wp-admin/css/media-rtl.css @@ -1,21 +1,66 @@ -ul#sidemenu { - left: auto; - right: 0; +body#media-upload ul#sidemenu { + left:auto; + right:0; + width: 620px; +} +#search-filter { + text-align:left; } .align .field label { - display: block; + padding: 0 28px 0 0; + margin: 0 0 0 1em; +} +.image-align-none-label, .image-align-left-label, .image-align-center-label, .image-align-right-label { + background-position:center right; +} +tr.image-size label { + margin: 0 0 0 1em; +} +.filename.original { float: right; - padding: 0 25px 0 0; - margin: 5px 3px 5px 5px; } -.align .field input { - display: block; +.crunching { + text-align: left; + margin-right:0; + margin-left: 5px; +} +button.dismiss { + right:auto; + left:5px; +} +.file-error { + margin: 0 50px 5px 0; +} +.progress { + left:auto; + right:0; +} +.bar { + border-right-width:0; + border-left-width: 3px; + border-left-style: solid; +} +.media-item .pinkynail { + float:right; +} +.describe-toggle-on, .describe-toggle-off { + float: left; + margin-right:0; + margin-left: 20px; +} +/* Specific to Uploader */ + +#media-upload .media-upload-form p { + margin: 0 0 1em 1em; +} +.filename { float: right; - margin: 5px 15px 5px 0; -} -.image-align-none-label, -.image-align-left-label, -.image-align-center-label, -.image-align-right-label { - background-position: center right; -} \ No newline at end of file + margin-left:0; + margin-right: 10px; +} +#media-upload .describe th.label { + text-align:right; +} +.menu_order { + float:left; +} diff --git a/wp-admin/css/media.css b/wp-admin/css/media.css index c77a069c..d04866af 100644 --- a/wp-admin/css/media.css +++ b/wp-admin/css/media.css @@ -32,6 +32,7 @@ form { .media-upload-form label, .media-upload-form legend { display:block; font-weight: bold; + font-size: 13px; margin-bottom: 0.5em; margin: 0 0 0.5em 0; } @@ -196,6 +197,11 @@ abbr.required { #media-upload .media-upload-form p { margin: 0 1em 1em 0; } + +#media-upload .media-upload-form p.ml-submit { + padding: 1em 0; +} + #media-upload p.help { font-style: italic; font-weight: normal; @@ -217,10 +223,17 @@ abbr.required { min-height: 36px; width: 100%; } + +#media-upload .ui-sortable .media-item { + cursor: move; +} + .filename { + float: left; line-height: 36px; margin-left: 10px; - float: left; + overflow: hidden; + max-width: 430px; } #media-upload .describe { border-top-width: 1px; @@ -228,6 +241,7 @@ abbr.required { padding: 5px; width: 100%; clear: both; + cursor: default; } #media-upload .describe th.label { padding-top: .5em; @@ -240,3 +254,62 @@ abbr.required { margin-bottom: 1em; height: 3em; } + +#media-upload #filter { + width: 623px; +} + +#media-upload #filter .subsubsub { + margin: 8px 0; +} + +#filter .tablenav select { + border-style:solid; + border-width:1px; + 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; +} + +.menu_order { + float: right; + font-size: 11px; + margin: 10px 10px 0; +} + +.menu_order_input { + border: 1px solid #DDDDDD; + font-size: 10px; + padding: 1px; + width: 23px; +} + +.ui-sortable-helper { + background-color: #fff; + border: 1px solid #aaa; + opacity: 0.6; + filter: alpha(opacity=60); +} + +#media-upload th.order-head { + width: 25%; + text-align: center; +} + +#media-upload .widefat { + width: 626px; + border-style: solid solid none; +} + +.sorthelper { + z-index: -1; +} diff --git a/wp-admin/css/press-this-ie-rtl.css b/wp-admin/css/press-this-ie-rtl.css new file mode 100644 index 00000000..912e0e29 --- /dev/null +++ b/wp-admin/css/press-this-ie-rtl.css @@ -0,0 +1,3 @@ +.ui-tabs-nav { + margin-right: 0; +} diff --git a/wp-admin/css/press-this-ie.css b/wp-admin/css/press-this-ie.css new file mode 100644 index 00000000..e9667c1c --- /dev/null +++ b/wp-admin/css/press-this-ie.css @@ -0,0 +1,7 @@ +#posting { + position: static !important; +} + .ui-tabs-nav { + margin-left: 0; + border: 0 !important; +} diff --git a/wp-admin/css/press-this-rtl.css b/wp-admin/css/press-this-rtl.css new file mode 100644 index 00000000..f75d7ec4 --- /dev/null +++ b/wp-admin/css/press-this-rtl.css @@ -0,0 +1,98 @@ +body { + font-family: Tahoma; +} +.ui-tabs-nav { + padding-left:0; + padding-right:8px; +} +.ui-tabs-nav li { + float: right; +} +.button { + font-family: Tahoma; + margin-left:0; + margin-right: 5px; +} +#wphead #viewsite { + margin-left:0; + margin-right: 10px; +} +#viewsite { + right:auto; + left: 8px; +} +#wphead #viewsite a { + font-family: Tahoma; +} +h1 { + right:auto; + left:0; +} +div#posting { + padding-left:0; + padding-right: 16px; +} +#photo_directions span { + right:auto; + left:3px; +} +#img_container a { + float:right; +} +#img_container a, #img_container a:link, #img_container a:visited { + margin:0 0 4px 4px; +} +div#categories { + right:auto; + left:16px; +} +div#categories h2 { + margin: .5em 1em .5em 0; +} +#tagsdiv #newtag { + margin-right:0; + margin-left: 5px; +} +#jaxtag { + padding-left:0; + padding-right: 1em; +} +#tagchecklist { + padding-left:0; + padding-right: 1em; +} +#tagchecklist span { + margin-right: 10px; + margin-left: .5em; + float: right; +} +#tagchecklist span a { + margin: 6px -9px 0pt 0; + float: right; +} +.submitbox { + float: left; +} +.submitbox .submit input { + text-align:right; +} +.video_split #extra_fields { + float:right; +} +.video_split .editor_area { + float: left; +} +.ac_results li { + text-align:right; +} +#TB_ajaxContent #options { + right:auto; + left:25px; +} +#post_status { + margin-left:0; + margin-right: 10px; +} +#footer { + padding: 10px 60px 0 0; +} diff --git a/wp-admin/css/press-this.css b/wp-admin/css/press-this.css new file mode 100644 index 00000000..daf60baf --- /dev/null +++ b/wp-admin/css/press-this.css @@ -0,0 +1,521 @@ +body { + font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; + color: #333; + margin: 0px; + padding: 0px; +} + +img { border: 0; } +/* 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; +} + +/* Header */ +#wphead { + border-top: none; + height: 2em; + padding-top: 8px; +} + +.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; + font-style: italic; + display: block; +} + +#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; +} + +/* Editor/Main Column */ + +div#container { + margin: 0; + min-width: 500px; +} + +div#container form { + margin: 0px; + padding: 0px; +} + +div#posting { + padding-left: 16px; + position: absolute; + z-index: 1; + width: 66%; +} + +#post_title { + width: 99%; +} + +.titlewrap { + border-style: solid; + border-width: 1px; + padding: 2px 3px; + border-color: #CCCCCC; +} + +div#posting h2 { + margin: .5em 0 .25em 0; + font-size: 12px; + padding: 3px; + background: ; +} + +.editor-container { + border-width: 1px; + border-color: #ccc; + border-style: solid; + margin-bottom: 1em; +} + +/* Photo Styles */ + +#photo_directions { + margin-top: .25em; + display: block; + position: relative; +} + +#photo_directions span { + display: block; + position: absolute; + top: 0; + right: 3px; +} + +#photo_saving { + margin: 0 8px 8px; + vertical-align: middle; +} + +#img_container { + background-color: #fff; + overflow: auto; + height: 100px; +} + +#img_container a { + display: block; + width: 79px; + height: 79px; + float: left; +} + +#img_container img { + width: 75px; + height: 75px; + border: 0px; + padding: 2px; + background-color: #f4f4f4; + cursor: pointer; +} +#img_container a, #img_container a:link, #img_container a:visited { + border: 2px solid #ccc; + margin: 0 4px 4px 0; +} +#img_container a:hover, #img_container a:active { + border: 2px solid #000; +} + +/* Submit Column */ + +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 .5em 1em; + padding: 0; +} + +#categories-all { + overflow: auto; + padding: 0 1em 1em 1em; + height: 15em; +} + +#categories ul { + list-style: none; + padding: 0; + margin: 0; +} + +#tagsdiv #newtag { + padding: 3px; + margin-right: 5px; + width: 16em; +} + +#jaxtag { + clear: both; + padding-left: 1em; + margin: 0; +} + +#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; +} +.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: 10px; +} +.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: 6px 4px; + font-size: 12px; + margin: 2px; + -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; +} + +/* Video Styles */ +.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; +} + +.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; + 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; +} + +#post_status { + margin-left: 10px; + margin-bottom: 1em; + display: block; +} + +/* Footer */ + +#footer { + height: 65px; + display: block; + width: 640px; + padding: 10px 0 0 60px; + margin: 0; + position: absolute; + bottom: 0; + font-size: 12px; +} + +#footer p { + margin: 0; + padding: 7px 0; +} + +#footer p a { + text-decoration: none; +} + +#footer p a:hover { + text-decoration: underline; +} + + +/* Utility Classes */ +.centered { + text-align: center; +} + +.hidden { + display: none; +} \ No newline at end of file diff --git a/wp-admin/css/theme-editor-rtl.css b/wp-admin/css/theme-editor-rtl.css index 407886b2..7b9f31bb 100644 --- a/wp-admin/css/theme-editor-rtl.css +++ b/wp-admin/css/theme-editor-rtl.css @@ -1,11 +1,15 @@ +#template textarea { + font-family:monospace; +} #templateside { float:left; } #themeselector { padding-right:0; - padding-left:5px; + padding-left: 5px; + float: left; } div.tablenav { - margin-left:210px; margin-right:0; -} \ No newline at end of file + margin-left: 210px; +} diff --git a/wp-admin/css/widgets-rtl.css b/wp-admin/css/widgets-rtl.css index e17aadc2..70838cd4 100644 --- a/wp-admin/css/widgets-rtl.css +++ b/wp-admin/css/widgets-rtl.css @@ -1,50 +1,45 @@ +/* 2 column liquid layout */ div.widget-liquid-left-holder { - clear:right; - float:right; + float: right; + clear: right; margin-right:0; - margin-left:-310px; + margin-left: -310px; } div.widget-liquid-left { margin-right:0; - margin-left:310px; + margin-left: 320px; } div.widget-liquid-right { - clear:left; - float:left; + float: left; + clear: left; } p#widget-search { + right:auto; left:0; - right:auto +} +h4.widget-title span { + float: right; +} +h4.widget-title a { + float: left; + margin-left:0; + margin-right: 1em; } ul#widget-list li.widget-list-item h4.widget-title { float:right; - text-align:right; } ul#widget-list li.widget-list-item div.widget-description { - margin:0 200px 0 0; - padding:0 4em 0 0; + margin: 0 200px 0 0; + padding: 0 4em 0 0; } .widget-control-save, .widget-control-remove { - float:right; margin-right:0; - margin-left:8px; + margin-left: 8px; + float: right; } -h4.widget-title a { - right:auto; - left:1em; -} -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 { +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; - left:1em; -} - -li.widget-list-control-item div.widget-control { - padding:0 0 0 10px; -} -ul.widget-control-list div.widget-control-actions { - margin-right:0; - margin-left:-10px; + left: 1em; } -ul.widget-control-list .widget-title { - text-align:right; -} \ No newline at end of file diff --git a/wp-admin/css/widgets.css b/wp-admin/css/widgets.css index 5d044cf6..f21f22a1 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 { @@ -74,7 +84,6 @@ ul#widget-list li.widget-list-item div.widget-description { font-size: 11px; } - ul#widget-list li.widget-list-item ul.widget-control-info { display: none; } @@ -91,27 +100,26 @@ ul.widget-control-list { padding: 0 1em; } -ul.widget-control-list li { - position: relative; -} - div#current-widgets p.submit { padding: 1em; } li.widget-list-control-item { - margin: 0 0 1em; + margin: 1em 0; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } -li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4, li.widget-sortable h4 { +li.widget-list-control-item h4, +#dragHelper li.widget-list-control-item h4, +li.widget-sortable h4 { margin: 0; - padding: 0.4em 2.5em 0.4em 0.8em; cursor: move; font-size: 13px; + padding: 0.4em 0.8em; + position: relative; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; @@ -129,13 +137,6 @@ li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4, li.w 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 { @@ -143,16 +144,15 @@ li.widget-list-control-item h4.widget-title a, } li.widget-list-control-item h4.widget-title a:hover { - text-decoration: none; border-bottom: none; } li.widget-list-control-item div.widget-control { display: none; - margin: 1em; - padding: 0 10px 0 7px; /* Correction for padding, margin, border of inputs */ + padding: 15px; font-size: 11px; + position: relative; } li.widget-list-control-item div.widget-control p { @@ -161,15 +161,9 @@ li.widget-list-control-item div.widget-control p { } ul.widget-control-list div.widget-control-actions { - margin-right: -10px; /* Correction for padding, margin, border of inputs */ - margin-left: -6px; border-top-width: 1px; border-top-style: solid; - padding: 0.5em 0 0.8em; -} - -ul.widget-control-list .widget-title { - + padding: 0.5em 0 0; } .widget-control-edit { diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index c54d9a92..b1f583d1 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -189,7 +189,7 @@ Event.observe( window, 'load', hide_text );
    -
    + diff --git a/wp-admin/edit-category-form.php b/wp-admin/edit-category-form.php index 60368c2f..f32cfd4f 100644 --- a/wp-admin/edit-category-form.php +++ b/wp-admin/edit-category-form.php @@ -26,18 +26,18 @@ if ( ! empty($cat_ID) ) { - - diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index bc62681b..62fb2df6 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'] ) ) { @@ -31,6 +30,8 @@ if ( !empty( $_REQUEST['delete_comments'] ) ) { } endforeach; $redirect_to = basename( __FILE__ ) . '?deleted=' . $comments_deleted . '&approved=' . $comments_approved . '&spam=' . $comments_spammed . '&unapproved=' . $comments_unapproved; + if ( isset($_REQUEST['apage']) ) + $redirect_to = add_query_arg( 'apage', absint($_REQUEST['apage']), $redirect_to ); if ( !empty($_REQUEST['mode']) ) $redirect_to = add_query_arg('mode', $_REQUEST['mode'], $redirect_to); if ( !empty($_REQUEST['comment_status']) ) @@ -97,7 +98,7 @@ if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['sp sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', $num_comments->moderated), "$num_comments->moderated"), 'approved' => _c('Approved|plural')); +$stati = array('moderated' => sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', number_format_i18n($num_comments->moderated) ), "" . number_format_i18n($num_comments->moderated) . ""), 'approved' => _c('Approved|plural')); $class = ( '' === $comment_status ) ? ' class="current"' : ''; $status_links[] = "
  4. ".__('Show All Comments').""; foreach ( $stati as $status => $label ) { @@ -117,6 +118,7 @@ unset($status_links);

    +

    @@ -132,22 +134,24 @@ unset($status_links); add_query_arg( 'apage', '%#%' ), 'format' => '', - 'total' => ceil($total / 20), + 'total' => ceil($total / $comments_per_page), 'current' => $page )); @@ -173,6 +177,9 @@ if ( $page_links ) + + +
    @@ -186,7 +193,7 @@ if ($comments) {

  5. +


    +

    - parent . '&hierarchical=1&show_option_none=' . __('None')); ?>
    + 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'hierarchical' => true, 'show_option_none' => __('None'))); ?>
    - + diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 85042a14..983bc27d 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -1,12 +1,46 @@ - go back.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer'] ) ) ); $messages[2] = __('Custom field updated.'); $messages[3] = __('Custom field deleted.'); $messages[4] = __('Post updated.'); + +if ( isset($_GET['revision']) ) + $messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); + +$notice = false; +$notices[1] = __( 'There is an autosave of this post that is more recent than the version below. View the autosave.' ); + +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 = ""; + $autosave = false; +} else { + $post_ID = (int) $post_ID; + $form_action = 'editpost'; + $form_extra = ""; + $autosave = wp_get_post_autosave( $post_id ); + + // Detect if there exists an autosave newer than the post and if that autosave is different than the post + if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) { + foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) { + if ( wp_text_diff( $autosave->$autosave_field, $post->$autosave_field ) ) { + $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) ); + break; + } + } + unset($autosave_field, $_autosave_field); + } +} + ?> + +

    +

    @@ -20,33 +54,15 @@ $messages[4] = __('Post updated.');

    "; +if ( !isset($post_ID) || 0 == $post_ID) wp_nonce_field('add-post'); -} else { - $post_ID = (int) $post_ID; - $form_action = 'editpost'; - $form_extra = ""; +else wp_nonce_field('update-post_' . $post_ID); -} $form_pingback = ''; $form_prevstatus = ''; -$form_trackback = 'to_ping) ) .'" />'; - -if ('' != $post->pinged) { - $pings = '

    '. __('Already pinged:') . '

      '; - $already_pinged = explode("\n", trim($post->pinged)); - foreach ($already_pinged as $pinged_url) { - $pings .= "\n\t
    • " . wp_specialchars($pinged_url) . "
    • "; - } - $pings .= '
    '; -} - $saveasdraft = ''; ?> @@ -57,14 +73,7 @@ $saveasdraft = ' - +post_status ) wp_original_referer_field(true, 'previous'); ?> @@ -83,10 +92,13 @@ else
    -

    +

    - +post_status == 'publish' AND current_user_can('edit_post', $post->ID) ) ) : +?> post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'> post_status ) : ?> post_status, 'future' ); ?> value='future'> @@ -98,7 +110,7 @@ else

    -

    +

    +

    @@ -172,6 +185,9 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
  6. + +
    +

    @@ -179,7 +195,7 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
    -

    +

    @@ -194,7 +210,7 @@ endif; ?>
    -

    +

    post_content); ?> @@ -205,23 +221,22 @@ endif; ?> -
    -

    -
    -

    + +

    -
    -
    - -
    -

    -
    +

    - - 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?> + + 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?> @@ -241,12 +256,13 @@ endif; ?>

      - + ID, false, false, $popular_ids) ?>
    - -
    -
    + @@ -254,32 +270,41 @@ endif; ?>

    -
    -

    -
    + +

    use them in your template'); ?>

    -
    -
    +to_ping) ) .'" />'; + if ('' != $post->pinged) { + $pings = '

    '. __('Already pinged:') . '

      '; + $already_pinged = explode("\n", trim($post->pinged)); + foreach ($already_pinged as $pinged_url) { + $pings .= "\n\t
    • " . wp_specialchars($pinged_url) . "
    • "; + } + $pings .= '
    '; + } -
    -

    -
    -


    ()

    +?> +


    ()

    pingbacks, no other action necessary.'); ?>

    -
    -
    +} +add_meta_box('trackbacksdiv', __('Trackbacks'), 'post_trackback_meta_box', 'post', 'advanced', 'core'); -
    -

    -
    +function post_custom_meta_box($post) { +?>
    ID); list_meta($metadata); ?> @@ -290,55 +315,66 @@ list_meta($metadata);

    use in your theme.'); ?>

    - - + +do_action('dbx_post_advanced'); -
    -

    -
    +function post_comment_status_meta_box($post) { +?>

    trackbacks and pingbacks.'); ?>

    -
    -
    +"> -

    -
    -

    +function post_password_meta_box($post) { +?> +

    -
    - - -
    -

    -
    - -
    -
    + +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; ?> -
    -

    -
    - $authors, 'name' => 'post_author_override', 'selected' => empty($post_ID) ? $user_ID : $post->post_author) ); ?> -
    -
    - + $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?> + +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; - +do_meta_boxes('post', 'advanced', $post); + +do_action('dbx_post_sidebar'); +?> diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php index dfef0a78..601f4cbb 100644 --- a/wp-admin/edit-form-comment.php +++ b/wp-admin/edit-form-comment.php @@ -22,9 +22,9 @@ $form_extra = "' />\n

    +

    - comment_approved, '1' ); ?> value='1'> comment_approved, '0' ); ?> value='0'> comment_approved, 'spam' ); ?> value='spam'> @@ -64,28 +64,28 @@ echo " +

    diff --git a/wp-admin/edit-link-categories.php b/wp-admin/edit-link-categories.php index b8dfebcf..c7a5e9d9 100644 --- a/wp-admin/edit-link-categories.php +++ b/wp-admin/edit-link-categories.php @@ -10,12 +10,13 @@ if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) { foreach( (array) $_GET['delete'] as $cat_ID ) { $cat_name = get_term_field('name', $cat_ID, 'link_category'); - + $default_cat_id = get_option('default_link_category'); + // Don't delete the default cats. - if ( $cat_ID == get_option('default_link_category') ) + if ( $cat_ID == $default_cat_id ) wp_die(sprintf(__("Can’t delete the %s category: this is the default one"), $cat_name)); - wp_delete_term($cat_ID, 'link_category'); + wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id)); } $location = 'edit-link-categories.php'; @@ -62,6 +63,7 @@ endif; ?>

    +

    @@ -101,7 +103,7 @@ if ( $page_links )
    - + diff --git a/wp-admin/edit-link-category-form.php b/wp-admin/edit-link-category-form.php index 67b0be1d..81a686be 100644 --- a/wp-admin/edit-link-category-form.php +++ b/wp-admin/edit-link-category-form.php @@ -26,11 +26,11 @@ if ( ! empty($cat_ID) ) {
    - + - diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php index 15c3fb5d..48b95ccf 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') )
    -

    +


    @@ -82,7 +82,7 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
    -

    +


    http://wordpress.org/ — don’t forget the http://'); ?> @@ -90,21 +90,19 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
    -

    +


    -
    -

    -
    - +

      - + link_id); ?>
    @@ -127,17 +125,17 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
    - -
    -
    +

    -
    -

    -
    + +

    @@ -147,16 +145,17 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') ) +

    _blank your link will open in a new window.'); ?>

    -
    -
    +"> -

    -
    +function link_xfn_meta_box($link) { +?>
    +
    - + @@ -164,15 +163,15 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
    - + - + - + - + - + - + - +
    +
    -
    +
    -
    +
    -
    +
    -
    +
    @@ -214,11 +213,11 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') ) -
    +
    @@ -237,11 +236,11 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') ) -
    +
    @@ -254,19 +253,19 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') ) -

    XFN.'); ?>

    - - +"> -

    -
    +function link_advanced_meta_box($link) { +?> @@ -294,12 +293,13 @@ if ( ( 'edit' == $action) && current_user_can('manage_links') )
    -
    - + +do_meta_boxes('link', 'advanced', $link); - +if ( $link_id ) : ?> diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php index e800a467..eb58d20c 100644 --- a/wp-admin/edit-page-form.php +++ b/wp-admin/edit-page-form.php @@ -5,10 +5,12 @@ $messages[1] = sprintf( __( 'Page updated. Continue editing below or

    -View the autosave
    .' ); if (!isset($post_ID) || 0 == $post_ID) { $form_action = 'post'; @@ -20,17 +22,23 @@ if (!isset($post_ID) || 0 == $post_ID) { $form_action = 'editpost'; $nonce_action = 'update-page_' . $post_ID; $form_extra = ""; + $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; $user_ID = (int) $user_ID; -$sendto = clean_url(stripslashes(wp_get_referer())); - -if ( 0 != $post_ID && $sendto == get_permalink($post_ID) ) - $sendto = 'redo'; ?> + +

    + + +

    + +

    @@ -44,15 +52,11 @@ if (isset($mode) && 'bookmarklet' == $mode) + - + post_status ) wp_original_referer_field(true, 'previous'); ?>
    @@ -68,14 +72,14 @@ else
    - -

    +

    - +post_status == 'publish' AND current_user_can('edit_page', $post->ID) ) ) : +?> post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'> - -post_status, 'private' ); ?> value='private'> post_status ) : ?> post_status, 'future' ); ?> value='future'> @@ -84,8 +88,10 @@ else post_status, 'draft' ); ?> value='draft'>

    + +

    + -

    post_status ) { // scheduled for publishing at a future date @@ -140,6 +146,7 @@ if ( ('edit' == $action) && current_user_can('delete_page', $post_ID) )
    +

    @@ -159,7 +166,7 @@ if ( ('edit' == $action) && current_user_can('delete_page', $post_ID) )
    -

    +

    @@ -174,7 +181,7 @@ endif; ?>
    -

    +

    post_content); ?> @@ -188,13 +195,14 @@ endif; ?>

    -
    -

    -
    + +
    ID); list_meta($metadata); ?> @@ -205,83 +213,97 @@ list_meta($metadata);

    use in your theme.'); ?>

    - - +"> -

    -
    +function page_comments_status_meta_box($post){ +?>

    trackbacks and pingbacks.'); ?>

    -
    - +"> -

    -
    -

    +function page_password_meta_box($post){ +?> +

    -
    - +"> -

    -
    - -
    - +function page_slug_meta_box($post){ +?> + +"> -

    -
    - post_parent); ?>

    -
    - + -
    -

    -
    - page_template); ?>

    -
    -
    - +"> -

    -
    -

    +function page_order_meta_box($post){ +?> +

    -
    - - 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; ?> -
    -

    -
    - $authors, 'name' => 'post_author_override', 'selected' => empty($post_ID) ? $user_ID : $post->post_author) ); ?> -
    -
    - + $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?> + + +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); +?> diff --git a/wp-admin/edit-pages.php b/wp-admin/edit-pages.php index ee4bee2c..c49bc1ff 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,12 +111,32 @@ endif; ?>

    +

    + add_query_arg( 'pagenum', '%#%' ), + 'format' => '', + 'total' => $num_pages, + 'current' => $pagenum +)); + +if ( $page_links ) + echo "
    $page_links
    "; +?> +
    @@ -150,7 +170,7 @@ if ($posts) {
    - +
    @@ -168,6 +188,10 @@ if ($posts) { ?>
    +$page_links
    "; +?>
    @@ -175,7 +199,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 62a8e2b8..de0f6c8f 100644 --- a/wp-admin/edit-tag-form.php +++ b/wp-admin/edit-tag-form.php @@ -26,12 +26,12 @@ if ( ! empty($tag_ID) ) { - -
    +

    +

    diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index b50269be..fffe7cab 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -133,6 +133,7 @@ endif; ?>

    +

    @@ -172,7 +173,7 @@ if ( $page_links ) - + diff --git a/wp-admin/edit.php b/wp-admin/edit.php index b7cdcf45..467a9bb5 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; ?>

    +

    @@ -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 99505e4a..08a0b257 100644 --- a/wp-admin/export.php +++ b/wp-admin/export.php @@ -22,9 +22,9 @@ require_once ('admin-header.php');
    - +
    - 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 00000000..baf6c199 --- /dev/null +++ b/wp-admin/gears-manifest.php @@ -0,0 +1,209 @@ +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 ( 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" : "_20080810", +"entries" : [ + + +{ "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" : "images/loading-publish.gif" }, +{ "url" : "images/loading.gif" }, +{ "url" : "images/required.gif" }, +{ "url" : "images/no.png" }, +{ "url" : "images/yes.png" }, + + +{ "url" : "../wp-includes/js/tinymce/tiny_mce_popup.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/utils/mctabs.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/utils/validate.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/utils/form_utils.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/utils/editable_selects.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/paste/js/pasteword.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/paste/js/pastetext.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/media/js/media.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/color_picker.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/charmap.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/image.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311g" }, +{ "url" : "../wp-includes/js/tinymce/tiny_mce.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js?ver=311" }, + +{ "url" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/themes/advanced/image.htm?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/themes/advanced/link.htm?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/themes/advanced/color_picker.htm?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/themes/advanced/charmap.htm?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/media/media.htm?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/paste/blank.htm?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311g" }, +{ "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" }, + +{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/spellchecker/css/content.css?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/css/content.css?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/media/css/content.css?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311g" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" }, +{ "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" }, + +{ "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" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/image.gif" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/media.gif" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/video.gif" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/audio.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" } +]} diff --git a/wp-admin/images/gear.png b/wp-admin/images/gear.png new file mode 100644 index 0000000000000000000000000000000000000000..f7ac7f402922dd80c5be50d9e0c1fa403dfd2de8 GIT binary patch literal 16742 zcmXwh2Rzl^|Nq66k#TKFT(@iAj8M`wvp1P#kGR<@dyi}x*(+q+e2B`*o=Hf^%;p+p z@A*5vkN^MixQRzx@Ao;c^LjnkyC_X{1#(g*QV0Y>uB0fd4gL^dhN+8b+=jb&xvZFC^X4>C|c;QXqtmGa@MZ$lsXA1=yS z)@D5mG6@JthY{9pvK>yGi@xgv|BXeJfDek5MEEdKDWp56^(-FKxtR)!JfT-o`Z zk0$s0p}DWy-myW!R7;p{(&Qd&deo6bW)+HzTMI(2?qH3-Po$9@k4SN zkl3o^ff7RYgu5BV_(?Y`*&yAFMq}X!Rk{U}BxGI1bN6PQ+Y6UQp-3fLJG&=hIecOd zsf~=5c!Ppu31h|E8NU*;uXvjs6CVAY2(757KwQ8_1~8HjiSfO1dpvIbBJZrZapT6% z$w?n=Ry@nU#<5kbMAG@$7)g180v#THe%9Y^(2b&zS6a%DM7#Bkjpq>6AJ2dH z3U=qhh_wAMy1G?%V|=l!k}Py|bey85>IdlAqZoIR9TVz<348i79nvV-0^}~CY^AI5 z5#?~PTIkl8udhr_H%9R-5m8{vjkBhSnbz}o3lq6II%K`St%fzP+40L#rd!Ck-i&T)|fSuW^IP#W@dj*Na-~0Lm9VS0> zq6g2WJ}TZ&rjg-!8-i3i*>($o2W>PMjhrc|C-`15#8*Az7*SdWF zj9Fz}?KwTrn18Ep5{&8_e$k)lQKZu{C=$8IG{eV)4=a1M@*_h5qIx!ADcR9{aaQ%} z-?JZfFYzI^nGv^yUZCgCF5}*dDrHl+8^6Y65{Jwc?ze0-Fb|pI!^0DcL*T^lzFj8c zvHIavt7%qfTeMO#hl47TdUbVG%E93ty@?O^1BdBIT%IpQHA*8(-1pF%9iJ(Is@82L zbQnT);)WX#$2XfC%=01by+leJw^0_91^M9*3kzCy$C5X1Rpz(RQaLe3P)Er&R|j5Q zrkY-zj{Rk5Iqv%LQCDiFiK%n4kFEe0d) z>G_bkr!D)D+efQj>c10T8Tc>PG&E_gC(8{##YdiY*TbP&q*yGe+OV=CgAoZW)$quO zFzPUH=jJ{+nOXn(Xu5=@eD7Jo5EodzFD_#h##_*B8^hFh8>fE5!mI(8C%Ck&nWo$R z{{C;QZ^h8xTj03Omivak@4iAKs&BgdF0^DAV?Wz`r?TmAl02DHquKoO{3Kn(?suAq z+F5Y{7bFNyT#+H_ve3Q0{_^wZ&+rUY87*3`+}HLGVtStzOX<-vqn#nqsKxaUmAMZ* zH>dA@_1toV{rC3Md*)xl>3z#TXJ!USYL>n*@Gz??g7z0HXyn?Xeg{Gu{#?`D$}I>hdyR(w-iss}h)w<2&56!~Xf=ihjQeH$Yw17*oWcd1OYaFH`KtD6p@C@@Quxnc@~oBrmvChfx!k z>BT`+FiP^n5W<@?5a(VER)5-@KY!{Dem~c^eS%1Gted|vGB#FNRYe8yvPyWveIr(O zN%OHZjMn(B}}hm#nv6rzVKSx)K_Q^SyhP-<=21dbL*l;YpDwOa>G;c5P*H8qC= ztQV^aptE)mNghl8$PmJ%97P*SAqPa%2n2roL*UEy#2;5IJW7PfvJ0q+x>LG*VwB+< zHR0waAfx#u6)1W5?@x>hJzwWnP$6J#&}4H$g)Bc|Z=hVfydAG4&&@j*UDWdtu}b*v zuU^G3zv7DCEnzVA+ZkAS@_PH-l#?X;uH2Y?dKM;tVQ?t72~|5H!96cD{I4#0g4Pwg*0qOD(bqA1`Glaxej>yR9pBK~U`3so zU;AFkI+oOnQAg#Mmy>}`Us_%sX3hxaRw=8w#lC-DLXTn?56k0<7+c|J_B2z9Vc{#2 z)MXp_`y>iN1Lh?LqUmx19Qbe{TO=2|YZnE+6bzc6ucuEmVSgB9fa<NnC&k0M#>j{MBPlarc=9( zScu|!FOy0ou7PCs(bLtX13i7qg&F7KqN*G>Y#Rw@CKKDB&L7F9j?h*l1+!A4`SNtb z;GZ*!6%~Ac zK_4O~Cr^Lm#-TbaE0HI8PX%!<$<|U(fDdrgELq50b7EaHEm0od&&Of40?jGm`lZ6pvO;S|YE zIRms!e>G#l;Ab%xsg+@|LHn)wh)sS_Yq{dSp!K}NOitwBtLx)m-$*Xbe7-$g&dpKO zxp3n&*{S)2V`VV!N>)vceD~x$@&z+Fla`Ny0ucqP1ld$gef<-+rbW?@4q1{y^fB+M ztCPMe-suUpHU#Ct$iyTgmb20jhQ*%ON0`IkD$mz~;mTLPMBTV}XA5lgM~Abbrzu<> zU}LBfdd391n`IX7BH~~rT%;!6%X9#j8jmTk<3$DqnZFPqTMWbas=k=}G$`Tw-Hy=` z?UKB*ce00bQ+lIb@~9-KU|Dp)^r48zg{QIconLFh8g;Z&upC~61Qt0rHz8IjnFwn` zXJ(@40<-Blm(t2g+zPBe0nx6=vww6{SXfBV-`_v|-vXj- z*Sn`bN8DSGPEHdv-s~`S-LgQb1aEFSvQQP7{Q|Ylp^+PV)O^%r7V8qle#%`cNm#bW z4`C@fV#ha&eOFOI!QXNYM&NkMkPop^LuPSrR6Z!fVvH+7)Cnr3$eGAPEtO7eWhj3? zW4gv;lpU;sIabHzum7)?{R4@I*yga`}1dN;@Yf(;_SnB2iJRAOfi*Kt^yqESr2i6AKg& zfisQX*GEx*7aR`&Lo&0nhDJvTdt9PFyG|xUODihmEiLaBtLJ==a-68PF8%PKBZB<) z&#|!{_Goj)@hVFq06HpKE`2KOA~#y4mgii;%W!!?1VZ)Ve^||I{;b@ zsw@a0aOx;lV8<$i;~qx)5du!(!ff3Elhrsqi41Ym$GmDy<8hGzH z|77c1QL^}J?o42X60un9s5A`C>%;xDY~+!&1YR5!Ra*>ybL3lIeTu9I+)`8t-hMT} z=0mnRXvx~bLdytq#&pR*3D8rhjtE*oyLdB*i&?Rps;ROaLOAA@VWSC%DCXiG&dh}! zrnQ_CKCg9@1Gf)WkU9zqrfmTi=*AhUHySD|0VuJ3`4V)5Zl{2~+duLoS;vgr$X)B1 zU)tI2j0Ikdd99a~0Ooi?`ob`E2aHCFWDd0jJ_A8!=7b(W&}oB%gNZ<=$Rk$?awA7j z6=`$Z&otiJ3OM@8-w1^Ssd9uWB4sA`ZB9>5fByU#6dg@!^~sR0*uz)>Tv5ZTm12C$H=7G@5tZFh~vWHL6Ui@t|C1_4)gC`t1{{G_Nu;TSq=W~(1+M0>`{aY_3Ep0KJ z!KC$iRZ%95jGliy#tt6NcrDWQRW~~s>g5)b@6w3Ie;RYiPN+2gs`u>ctACc_;^JQa zzKp$5M7~kw*a46OuXzhlC`-_w>UO{L&Ywx>=!Ro5!5Xx0{`u;y9a(Av>2Pxt%K=T4 z^{Fmh{Nnaev*w}%2R^LH_pU>MkgR)TWW_j~7`!8xil6IhYeCx}^YHNah>EF|R<`6w z4mM|;_S2>%6ngPvZm6}U<^l8LS7bY0%!86wXmCb%-ckD7_UtbAvG-Ny-o?Esg+!d` z!J`wV1J3@9>FMiR9&P>s!(EXhd0KwZ>b^mpGaH9mW@nB_5hJ+5G#i?zf5}&f4AmL7 z%+EMC0?j2$#$j5iw)kW`%O7u$YcbL=S-;uZP`H`7=SQ4(ytQH5a++yC;PdCVLH)7y z-Osy<8u#(>5j`5tj|Z$ZQ4tDsk7|_g!-sbh73W6vP34@N_+ z-fMW}llpYstetl4i%v7~!92CI<7K*i+vV@L;5GGK>`8cy>bt(w2Tn6aOLk5U4qc7j zdyt?Fz6Eyy@7*OA@Iz}c{7w76DnsCc0)1IBFLpj%ktQ;xL0HUYBD zU!xv(Xdgm?0D@z6!&B_y9=B`ue)&^XDb8= z(8{@}ym!mt{#N~C5e~IP1pWT~d)T{lOO&FfY3Ih+$kQ?%EmY3ur$Y*AI9Y`V#%V}U zb@lxUc#=}8Du+4ajbhb|-4vX+ubioL`fU|Fxxb`_Uzw$&3(ot)NN610n2A8$6A%zw zBVnYHB9aIj@mPHr3LZq0JW8kn&6B7nset%rg8>pk`AK+>HScl>wc=-T3MTp^@zz*r-HR zju>~m{PYdXKZrMLmtA+dT1F-T)uo*VWUD@RJA( zISjl%Gv>@b`jN3XaOBVPyx;me^wunA8Ixryg9i(P2AvdwPEH>BfpGz({h z>>DYGHGd2(y6Fv38$RDkMA7=h*Kxd2Z2<$zwR6~=Hp!p`5%UD4j7Rp^r*vzf<#VssSs5utqMVKLvRh&1-Ip8C$eirPaY66@%S8z^^1 zpLpD4;OiX7d7L$t^RJNBQ#q+K^eMzk`dfST=K`BZYCGXx=2qwTRUb*b zi=`F;1Tht2YfmT6ADN~PsN<5Cb5T=bk%hkB-NI<+ z-j$V+*!?bVYYQcc`PHs|DB&J=?3jz&dE6+a-JHvpWM#HHttD>T!g$h7cyqBdF zJP9i%OOn|in8*Behffn}Jz}|6R}rJbqgx&4rVMFy374lyxm#U@d9%tcSEQ1pgJf^d z<{pSc-XZGZ10upTa9Q+QxYj=({g=ICEQHUv6$iUy9-E29xQrBqSx<1LE&$E}{_qbd(!_B>jGo*%v zbDgB1Qrs3L&m>)BSZ~Vyhh29b)tY_X$ta*K39%$Y5w|KU7J|)I+*4+BH^!~Ju_c7` z5Sfh7$y&e)F)1JTIozp+6QiTGYYGn348N& z?D?YT7t5Slw{?bQXC<*-l2i=^*f&<*j4nw!_syI+96)zbVDW}}PP-5RY=jI_EjAl3 zB4Lf0W_&>IKdT_jbT5-ySZ(p9@V6%l#Ht+0S4>c8D!eeYLG7&$#wXt1kH|Xap31Qq z`Pm6G{f8itQW?OQE$-BZKWIXclbF&X;$=a}XaGg!SIyV3&5ds^;t0IIF6*#X`M zl>!u>M9Le|+t0hlPlbjGI%Ma(XQW9VCl`o`ihg^q1zPZ+7968MYR0&FX~Z{1X(kkO zKejb8R`9?7{&O&r$h%rJs5ABB=Xw6bSwfHKN-L>o0utR^O!X>7F$vJ^ib|k+`RAnC z#wfZOGl0Q@K391b2x~|38|x}S5RDBY|E|%g96sa39W=|qltQ4I5LYdIne?N&wh(D!PxPf zuF60AF;Vid$JbRCa_Oub+>RA&_L6M`k~wIj28Vo)YS#>%@Ra{-#OdUh^7LTC}!kiyR8f^`KKd8#5a!6SPQyQRc zfVs&!q`)q$^k?-f;sM0C`tKiM{}|9dyMfGbLswT)LO@_ns9QpPkg|u36wxwybkXBK zD~SdjX}!B!ezhSU5RCDfxIbS#pQKug#)pC{+(ykQB7tT^VLUc8Ir;sjT8a#Qkd0i- zyi7Zx+D*=-+Am*r+Ip8=XLWTw#JRPEBZXIi9Nwv`Z`}38d-ez@%4GWo2k+|ZZ$+4! zP1QI6q4Zkpw>AVIqwajS4^T69@E+p7W@oP=QGJzoUM5WH28oQ89zbJa6;ykgC+dPw zu!ljx_g|Bx50%Z|9j;^%!Gt&IX&;q=n+DsSsQkXJ85V#GnK%txV}4Z4M{BhGdAm>{ zA%fxM<#cuVK`~}G#TkLGHvDsXIyNHWM(pi}@mUtJf~aSoiNT;NiEROLDPZR5;=T_k zrAC3S2$*!e5e1mzX;U@+^$t^LZTf^Bu(v=&J>r)|P`SIi&jG5-d;ecW-2y3NL|cs9 zY6C@&%SWf#W-3V*EqG91;jE?0R_?tzI8DcIO>UMrYDo@R->uSNqpJnB{hdszX73DwsQ zW|hn8PqvEJrPyoehQH&LeK#*eQ|D2vJGCI6ls1Yug#T?4g+;%NOJGHJ-drPfQ0YD< zGs5bA6nMiKw(5H0u?uF)zn=iP=g-a$<}fw`GO1V3;~79MyoNZ9$Ey5JT+f&J1KX-B zd%#@-tOuxqpm{r#?@=kG)e03}5)F5bdf}HZbl}{g$^XRJU`oFr98IbwivoF=--@V#xc}|2%LM{2{YFMd+xE~V!rDm@1R9|9#v8qb(1V4V z?pnUW4yu{LB(Eu1XV{dq3k$ej%YBM{)4|wL8F*m_=K6D|CP2xY?JPb^kxB9W%W`Ze zD}DAoeVrhZuPZU=&A|uLi|DD%0-+G%pkJwevk5>&u-XR3#&6Gmli}`S#yWoun9ZJD zHh~%hj>YzxlwU=~#_Gn#6ToN09zXW3iqbyu2}2DFYXK_Io6LEAJd%(*CoH0T;owH9 zto!J5ZyQ*d-aHN8Is*zzHy8ukXR}utkk(3%-s`H35DB`iA5J;psBMJd%C#Gn zExBp^^VBa-$}$ zCy53<39Jd2;o|uTn>>%HsVQE_k}VIMgk6~e5jM1rk2I{FK(YA#6*M_hw0BZ{DkVy| zZl(GCt6UBW87Z5_Zz|yhRGgRB`Wi4v2J7e&m86uZsm6eC`*V0Wv@3?8u(2^)B^1uc zN2}zch-Og$N1deNMIszv0&tC|rm;s(e;VFq`O=EeR?^kyO{QAk>gnZ&P5=KaK>QtG z^%{JA^p#(DJLP*i=!-i;@^G!dK(Bq!1bc%|Ep*u`zsj!XJBYqfJC!=a?TE#1o}XY!y=%}T@}V(1$+7fJTjfb~8j*<`HhbsGSfRnXIy7%1iw51f^ z|M?SWGd%9bgSq$O^16#tK0GGF3Ew-{IeM0=`^kQyIv0qFi}kqNCqUl0Mm6Nj>P#e* z+UW#J=0)xCk3BbK0Y~Zvd!CueWWo_YN%Ga==DTO0CJMl^fWid*-iSJkivLs~j6ae# z!`VDA6pJ1IWJBpU+hZfKck7^yi1i2HY9rsOv(e9?5N67&2>nM<0vznyc~>WS3V*8F zr_X-|Ug830PR{oR7eQHF!=GqoZj0G=T%@9WfxS;esg>4G`SLVQSDv>TRSsES)46lh z$o{47?hH$y8aisw|L*iio0_t2HlI0yfve%SKtm~4I26bf)5{PLIJozw*J}IQ-2^iL z@8`Sjs{G_Wf!;>dZjOvTd?59?= zJCFPW{x7`)0f>LiE*N z#%s@|^xeC6F2I{aYv~wGsvSk{Nod-;Ql;#Q{JgS2sIWaW(@;?8X$JGuq90@qyqW68 zIk?|eqZ{M%Prgx2*Sxyt*nIK=z5nyc@lHZuV|8aPe%j53YaB(=LU-RY5yo%{5HIq$$JD`5`7Zll%kzfV^RpxraPGl=0UjQw7 z`Rlb7M!_uFigR?mL$edv*U~FYn--d^uZ~h@qsVrcTHV@G0FpKkGhZ8xIYf6^Yy|?( zDAy5#nLkxIe)>5DQRBH~Qhw1&>e!BRlf> zl^!*G+krt9AJRjE1VcvZNA&E~<g)UX@*F4G zQh}LFl6kkvubzuO3FvWw#mNg=f2X~!JNlR%?$GmDVfcv2ICXwm$lr4#KBB(rI-CnA zU7$Fg&VmNnQu6+Nc->~khl+-m2f#@NZ2M6#K}VPyKr(*E9jx8!qaSwWLMay>&z=l? z2Rg1=_^+L5ojdm=6nm;1ZUYtjXf{x?dcwXJL5DEf=70T5ijI`YsR7t_`YU_h({6*} z=`Ch>z@70%+<4>%sK5@8!yTW}T9drDu*-Y_tcBd_CSbcX0*&)}x`OXaR78rh{gmGm zd7J*u&FT>trZY1p*JeXj{{nz8z*Tq%-e=z1WFIuNzY z&uf0|p{Mx?`^K0DRg^6FBtk9gfrDl2J^F&z+y15;{U*A)02Y{^AMXI~ z3gG9(QQ1y4)Gbave5w}8kw1Up0H6b91YG1GLHRb`@LvIa(>e_wUCiesaMNk2hZo3?R=kbFXZ(PnXm^YDUTP=aUXckk{ zZ=!st7C_zh6Zg--k?d^tKl2iZ6h$|(ywib1xCa+Bp2)~3isi@$21){y^$}p&%eR_I zCIIUaKwK3nCx9F)#NW8xz7C9m`CQ-4Hn1nPuD~J0K~JDSAbtdVPIN)PDJh>AK3qw& zbfN_VOrtTd$$tWmugAc@%wl7X$@Nb*gM2c(pnhF|{C;hMf%u!K*ESqzeC)tv*J;0} z3PD6t+(DEBI;HzT?_Fafvq~CY7f286{MiafBMQ^eU7pn{=H|*9tTe23{1X!;yO5c8 zzQj4Euczm_l=s1<&+7j4y4MsnL{k-t#Y!9vB?RbTf&IMOl}y6Pp$p*db*Lm){Pvi! z=N-uP81K1W4rc|j?~opU(t>cfj6|LSurgSDR@uP(1bM!_&s8#4z)Gn2x+!*kdDMb4 zksKDTGVh33PC~vbCY@J6@WZEFY1n=xX5Y=-)N z`EGBYE&=#2Kqr+@c)E$t_Dqp>?jCYTv}sbs`Y9lu&u^vafp#-9O4N-NiP_-{(# zKyXViP*j`jR|@GuETJra=C>*fakhr|L&PsxAXjv;sw5%5Mc+3H3O*H|_P&&KDNk3W zI%N2{awc)zgwGFaTkh>%B^P)-kVfjcuEy%M17E$=0RN;_t~0i)OpqFe0B+9x0SDn$ z3y4BFr7W&sXq9BPpLd-XBIi!mcb|V$W)?}kN7$|zkQo?Rss0!c&3+AbOMe)-nnl8v|% zx=$h442u_uMT*FEKJ_+|X&?@~+{;r4t#Pv?JnsoSCxXm@=CB-|Eswz0vWjx6NA-D~ zET_dt>?m75?TBI)ma^K2Iqn{D! zPHhD#yC~qb?!F?~p>;sNTTy3|oKMa>M>Ze)=OnE~JMA%MEH|pv@if;~D=hfOyi?%W zl#Re{2_^0x_r5zZ{BKTS(DxkAnO>?OB>kP~PAoI6U~4&6-n9^k&)DLQM3g#;}Yh@zc= z0|W-Pr`9B$5(N7rvDXS@74Y(HP3RZ#7D8?cMiq{@v-jQiy!`17Wmc$DR78e{C8%wm zhX@^HMQ(Xk%oVUhAe@nkAs{10^Ku*5t@aQ4p1vzpr0M@+{wa1Ks>Xl(bKxT+E!r6l zHO%`TXxE2NXXWr8GYnLJ!ebD@i-gf%#Rv}%~&>}{UjB>c@86k zc~V|e^E+W7(!h~=y(oJAWSDSCXz2WQ9C<)ZFs+8NvUrX}(>>z+6j%9dML8r=$+gT& z$a;$cWCtccV;Y$vSH)O*FX_7^b7Eu>UKa;r-ZN%+YwDsGUv(r0m(Pt!o43RH&Hgla z$Z7pbZhQ2QpyR=A2EGgS+kfUCKtyk8&)dVyEQrXFt3O6UpCDV5;pt z=e$kww$3nvdwxR!eDJq;&gj9XASB3S-3~nF%h7v0tC|ZlG(}McZ=d|Qlb_=Fj7Ia@ z@^b+A0*Wz{e2^VDF*2H(R4k+%lSyIrAV>jnzNy21Pn}oiLy(?Q9!WMIRV+8}v3uzm zAQVdkob;S9IcILOSdgKMTkMW|zSFA_KwXTX&j>><$Z|hnf7WvG&&d)5@UAm__5WBX zbcTe8dy9~%nH0dWxXyzB_+ZwbDPqv%BT{L`q5MG5M^WSri}w;0FuXa5LrRfKoaF<= z3ip+I@?Gm^kGmhLQ{KAU+TgJP=!85n#I1rLa)YR4FK27JNF`H40TI?7RQ`8;{d5*Y z_omTqE2*}deh#McCd7&x};#+P40?djrjBWxJ!1y z{{7wMmXnn%;NTmP(qiMtZ%At@4WhdKeV#tIcRuSiLn=A95eJzeWgwcu#$LI#wdLjZ z6jbscDE0r+sGxuXoJ2Kgb7$AkIfbPKUMOnIV-vx+?Bcv8-y=khIv`QIFRh!mzDmP% zxT2G8ng&Wx@yl={>gJ$QaO#k{IvP>F2s$~;Jzm}{)QfdKqdFMy7MD%LAaZVdWp#On zh_T@&3s+liZs03}+<+A8+hX_6A+kJ2Xns1!4H>vem;jZLFjPt^4E}qNW@S0OfQtYG zj4}(j{FEl%rHOcJ`kWFy-=sV?9^)5Xkb@)YY)OLVOs@`1fiY(4 zW2}jv%*m!Xafd}0w4{VE28;pC26C-MGg@9}m`GW_ znY_nL%70fakd61{*mU64MfTK9*^k=8pBaFq9|rVEpx%K}zJBH) zQL$(VKT4aL&5t=1W=;+~&7i~#v4HUMpCyifZnn9K%y|b zmK+b}x0f}$)b|Alok7KzmUJMl^YHMLjzcRC_$zJ`Z{V5x&sjC#*ISgKr-5~wkL3Zl zg&zcP@qgogBt`&9#Dfo z2EIOyPaSXGEFscqdP?Uj} z4jzgyTnfJ3dtTV22nUhQyul7(H54dfP=dCOj@l&-;P5A^9KiAdW2;hyQ_hebxx#-CWTjKx{D^^{m+TXdyg}V- zoxgziL4GeLNH)tR6*Udnx(_^_*`WYvnW%Z|T5|?IbjL&Go-xXZw=xR>JpVY9IxzFV z3|jsBw-a~-*RiC=dJv70X(o}9#VUv|K4pHaI$Rh*>;FT7Iugi>5IL+bS5!#P~m9~ zRvcKA*Bp|91?_db)5F^GdApJ6UEadk>$7gnSRKk9Di-3NOX9KD32TpR!W9Q@;H4A< z$cZw@3*_9zht+E1)|fk@2>2*eA^AT%{-l=V`mE<*v6~4!i@U(Ci2xj#G}ZduhYvS_ zs2OwmQRW-tA|abo!y1S1g9nJW%I08njDzU(*;5Vi1APb?WD(C+R7))UjKfugjV0WY zwJQu3HW208Fvt)PGu&4iHE$0K8owpe$nm){ES{w5JxmR!OG^{u#T-z>C1VWvgz9^F zIWZVeW1yAtZ@)LqvuVTlxZf!t6dYv`M~3v^{DK%N<@wS&Ks;PRSVRQG0nta(Zr7sd zU(P%~*F>DRM9>=hjNIR>Sc}f^M>*gZaP@@`M78+S(hy&827LBbO)@K2hJ%>CMpo=% zsH`tZN7%cR@ui=F7dPT*2n2R%=N67zeIUCK3J{~bEpb?taIx|<@07M!BQG8hopRF_ z7N7wDs{^-9g#-EiMx6Lo+co@y6L0sKUQ!Q=A7x+cbtF_yl>bs;Y=et~7{Q{& z31`GO-+?@W_%7}oJLDaAa$fF%H%EiG#dW~vTAu=HH+pPf4}Bc~E6#Fk|1w6g;n{Nb zXX}5LvoTf~m|$(lZ!TKNuf0k@RUNzdiz3`DSb)QP)59fu!}wjxg7;+mRn!>BBXBRo z&f8}MhovWW)`wXjehS3eiv1QS*ZR;NxNwEgiqe*1hOkP(m9$$K3)kR8b5j2P7m|MK zV0qTln)lhiRmXzPwLN(w!aTpFg%!9;o!9#WX$4xt_G)3m!dgk*C8$_$l2%ovB(m;w zL|-*E6z?Fks8#W4^0)qqkB`Eeh+63feA`Wyyb$r)KJ9YSkaHb#e%@#Voy3)V3!R*n zj$x{A8h`0J~A5JF=EF_LIH-t9KZ z02t&WP_od+bD`rO%{x4S36WO`2KgJL5<{q53K_U`0yv>`E9o!^O_4>AdB{GVXcF=y z2|2+iUw2PQn~xYjM(_o}NB`McfIp4LJZ@RCKn80ZWPCIu9U>!Hzl<}Ot19O!qOW%O zuR=iZ2DCsD2neKt(3F`Cmw14^d3%Z)t$}^4VF0zu_ys9epd0V)dq>O_wSeA z0u9B>)x+c9ZS9{|w?V2p;i%>6;yQ7v5CFP8NcC<3>P@b}p4^)X`m~*}+EdaGLFq`P zU@Vq}G)X=QX_{(XIrrQQVla>9v+o?t>RiOHU3%CGT(a@q*OG4@o3r`5EDUEs5 zzqv;d-o;-VOKH|1L1hSDXT9Ob8@e$MYlt$> z+azCK-ve;wA0_uP0=Bc>+8UJ6YZdD*<^YDWcv@dZ#YSe0!$vM{t$FK%G;CEGrU)Uf zcZETtHyS>defDHlaAQ_DL~HOe^M)g}daF^q$-PCulJ=aszS#&mUOn2TAn;ttUmM97 zkj^^2o_zY?NuxM(MrAy65E9HS;K~IbD>mYbG0hblxtL7wvAKY&8GKp5g=ZNnYRUr( z;_Ry~;fgNAWPaFaaL6pa6Vp|0fO-M=3MWg#6o|~Kqggz8d3YMJSf1L3hRIP6aV}VV z>3JfZvv~>RW#LDLFWy>sBO!3jP`KvaN#lxWyv0;aYOfVpU-gJ8MW~rg<(s8|0qzLj#d1Yc}?3a6U1wpK7DetL(zX2@i68tCwtLQ z;hS0P9bsOVsMr}NUuc4&|8zGok~N{{k0NrR+d@!d%!8jg%B!K`j4%vD*`Z0u`sjjV zELN2VS6tF}tQk6&B` z_ZYuuo1uCg!j$Jo*3#8wx7M}Y71K@-#E*CD{%A>b#cWqp?8b*Y#$f@*m+&!jNsp|3>?F27RX zOIF1)E*tVAs5LUGVXX>G6w<6&s)?vIujeZDKPzc&mlUgYRVZFQh{$*ba@!}?xE}Rkz$#}+{Kt1RR*fS`HwJ%W)`1Bn2Q3s8C|fX ztJ`0OeTnzc!+207X-P3@3A7&WXc>zchVJC3wT?a3&=!KV=E0|0U0<&1b**)}F&A&#Z(j$oBRE=Bw;u3RD6?*WK z_@Eo4E>=(_)%y9E$MaNcAOfm@PlkoF1YcwnW5PQdza5k?Z3(uWMBj*bA41tGNcIGz zPk_7jU7(wG%)?`<<^WilO#(f)%XGejlsr{mHQC^v1;nBl(`{|Y_mJ%Fyl6bG!Ew$z zmsy*PU~tdCoFwzFXuOdD21!TUwvA4B4;I101~!yJn-xzPRF?!$WBd*ZE+xP1G=iWnVA%i?N&7w`w~e#L?Zq64@#V8-FnP+k zNRzEIhS0!U6;`uMR18~d7*HK1BkR}}QQISR6X_p|$6{Yer{Js&Ype_hc%qZ^bVWXF z_*6I#3<>vBgtYd)_+-MDwg&|B5L@B(1Wm)G#_-U=)LWu2^Vy$5imdK)-;Q`kMnM5) zA$Yb73_>stpQJ7mTcW6;(g4ifhX~FdEmmx#`sSu>qxmk~Bd!iC6 zKoZD&s%E{RV%5kIg;f+p8LUObBxvD1>#bU9Ba#|?JBc&uG2xxPTFeqpfw}jM&!5n9JHFwjwjii;= zPa^jaW&|2FHx~PS!d?&D8`hkW)Q|v+Wdf%;R&dzkPvq8_R=2^((M3AA%-N$tSy(Qv z%V;d_w3&6sf0j5z>Sl-(0i3~=ARX1$jOvRo;3^17<%K^g^jIruTwr$~hLun)nofB2pO2j1_Z;8fR zWpaQgVBY%ak&$~qAb51w|1W?&a*tk5mFJb;q(Q9TYqWac>O2{$N=( z9=SQOyD;O@w z!2si9AXVXl6t(Z}1(EX~P@wuqf$a_+2oaalO2=e^PAm;*D|i6;8m6M6)8EqMNW!ACN+YDCP(bjEYcRST-ce@F*F!``w_WAgH zc;DarpZA$Jdux_%qnUvi=${ajm6i4T-Mhwuf}>qsWhEsu@4fftz(Anm8y&qnGvlz^ z_te$>bo;i~;rMlK?)KEw#Oc$}|5Gvl7Ns{>%zG?5#ZA^dyTs-iv%Pk=dFKY}3)Q=! zm`4C20>{PtP8MWtdpccj%uL*%LBawpW$>0D5<;8AVi@Med^-$h81QTQ-jSSW&)jwY zsNnn+^BD40hSSe{$BLi36rsQW%)?&e5WD!kWV_3GzA%>i=Q{>RdD@8^!FBsc0|40z%rXOagq8pn(jM*o%V28i)X-@>>3bV(y zp)>&g4VS-mA9yyRx;q@?!<7;QC2T~J!Bye_3?Mryn)5kyx%SY@%`Y9*9ZxMwU8caH z6nl{JITfIQ3_MeU_e^xUT~mn-%8|!T)*GiI+Tm6xLRfRbZ(7hX9P9^ypJi~}j>sH= zQmmN$Mk7?cMK9E4l?Z>F-#D3X9Lh|JhY3dJgbfm!Lsoaa+@Ua(RH{AuVVbR!dYmnJ z4USZO!wLoo#VqCWd2#^bj=^&lB{K>^&l>V(VUL=1jd!ScjKGoH$^i8085@(#^A^Sb z^07*Qow#?=b`HP(wrSQV8_?peJ138e7PhN@6LWD=p#*L@KxFai3Q6r#ZR!IG{queM z4|kGz{oc+BeT!CmQoEcB2&L36jYt^GMS@>jTpOUYuOX>PAB3oG>ohq);2dv#q9E-Q zb@S8kZSKqmH<`)EcUJ#cznT%<8~WS0<#p=&?Yr|5D@#iM{BfC-Nfm~n z<^rpl!YVLIF7HxdIFxUx-Ot6yI_o|NV04|OEPk292_^k0NZQH-NPY?a|8Fr4`Sm%GoUD#k3A7jUKbCjq(7SVAbSY0?`WFuz_GFgJYF)?9tV>G~cg-;=f(*}eRIBFR+Ve?H z^QcB8IJmm^qAHp<`}nCTVL#};>ayh|M=)qHmx-gT2!`V| z$4B;PAF3R`aw|N_*LQM!Cen9f)%>iCE5NQ#jy*00B+iK=wjdadqa;NnDgefZJ7Esr zsvx;)6y3xO#!C@o?}~;9)iefQ%~CeCWoM;#h>2XLzU&QuJ(V;wszINj6H@7WM|wYrK)=c{R$Ie;^H!*^AN08NM%K25N$1dU84zvcFo0i} ztfkNZhPGB&VFoX#(KOL+`N~R>p^}v;ZJ_FX!-O&$Cf~_rpa$8y(Yd`k3U5zem{){% zwjVHDP!5W^+rD2X+)T7NycfQV66_kMN?KIR$9<+*C6{U+_<2aEe6R(98BQ8O>xv3C kD@mk{*_^PA&s1<=;?*k9cVsM`0h|gL{{R30 literal 0 HcmV?d00001 diff --git a/wp-admin/images/loading.gif b/wp-admin/images/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..85b99d46b9911ba53a792d716d9f688f3bb3c784 GIT binary patch literal 2530 zcmb8xdrVVT90%}oAH9#>bK6p?cF>G=h0@JhTLdf!(gIdN1QeV+L;)2XD9^zNN@xod zwcvQjRvj8}y3J)yFv=3A2@i*l5Fc|hs2f3R;^QAN{$aL%*eO}IEP(~izxV$0$@lmB zp0hT=YKq8{00}@xHO(cjNl%Njq^=3k8whNA8mRstISPn@&imc_Tf_3@%d4xaj~qF2 z`t<3uXU|@|c=5`WE2E>Mw{G3KfB*i(#Kf~_&tAQH_4e)C>6t?woVxLBCtLOMhuB(t zGPLP@xf$T%5Zyz3iOuKI^?SO*zNFJ?wrL@=YKNznIpw!L(PPjKYQ7%}eBCama_c91pIJ1~(b1Kal`fZSz8V+OJY|r^QHxE6+WMoDB(^~{XdW=!#+uo_ zaF>U{k0Hho~yN%NrSyV`soxiBvd>cj#}5&$KDA)3{S^?ffCPkeDi5Vo>T8sy}Wj_Hf}N$J0Hz& zv|)_<-f+~-Hi-jgzIkG5vY*T|>7-8J0U*@$d8~ScFqA)f4R7yaDBs3j(<2>@V?*ZD zy6{Vy+~KLc_m5He=9(fsy~0c&4a-*{&i)i(02j`@8?In8dBM!Y(Znu4jtn@VMj|y5 zrTNa5ki}vtEiGN(#07>Rk#HaVI5ZB4@@yk%765mBN(yieTXgm{oK}vXn!h0oZG3gj;>>W?MbZnG6Q_cX~h&<^+R)8g9 zSd!4lZEm4K#ma0{aTpMHv%wr`1VF@rrKl5H7Hyn$;=;nh3JVMEcKbqhXnqO(3z}-# zu=v1OV7q%OY`*dVI>Y}97i4s2yl$S zmSto?fO|=u8h;vSPKY2zqaEs;LlhJgv~%aqwzjtUie_4FUNiT>r-& zOO#{4cBb6f^ zov;AUp?UAne>@_GHz5+(221Xlve$OHK)tvvi!~l<%)zr4PhU@ z(CY^us$O5!${6Pje5gy?*WtA2j>{<;$_PvVQNKa&69IX)a|Fw5>C&=WQ6s37gabVh SjHs`-`=fdj^ILtus=om5Wbpz3 literal 0 HcmV?d00001 diff --git a/wp-admin/images/logo.gif b/wp-admin/images/logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..cd49514d7488aceff085adaa5c081f3bda26e482 GIT binary patch literal 1238 zcmb8o{Zo<$0KoC*L6El))HF*91OY>Asq?a>1kBJpYR(s?rVEHOF->Y@x@>y{ndk{7 z(-RkZ$*gptS?Y}Ry0kPCU!u}kSz%f8rJRjxOP8_rC+z$C=f2Uq`Qh8eT!07M1OTVg z>2Nq^XJ@CTrffD_e}BKlVrgw{HJMB`H8ths^MU`9-!dGr z_CLV-h(106gp*9xNo9If5lgVJMH6gPc$Ca8;@8Ta8$nZ*_wSpMbihQvV_c>xo-$}yEvwk4D=dIHkXaVASD!-5(DNlTyO+@ zZYi=-WjKc7Q{h54jm|X^t1ZRUHgmBj0kDaXsRLZuNb1F3u5vNPj!3jg--3wjzQx9O zQCuQ1vQGS$mceoM+2PSt+r65J37m1{(t*gwPoKI4Q=hklfx^q+li6EibcFs~*onU# zZ^yltRAl++x(aU7#~&^#+wh;f?XUM-0H;yx1vsj;qT0(sJ*DjM`6?ROdl$sR~1 zoMGN-o*sFOgK;<6QA_q-wtMHIjT{GnEM9Q-Gs+odeMOxA3K?q4hWj@88{PCtJc!vq zUo7Yh?+bLv*cmNI?7vhjB!{*PN$zG^a&Q1o$>!uW zF#pnWrpXAg!u~^e*p=Ag=Ej44$5m$rOv+WS;s$&nxFjZo4l^k9+^InlJRHmrWdl8^ zpHS@ns@>EbAD|7M5lJPbk^rfPfE~4Aa~+C56rXkk$lMl_v5i+Ul$+#sSx|d2+Y(J0 zfcN^=4EdGT>bX9)8T<-5(Hg=6i|9L4Y0Ec^yIdD(Hza$Flq9G|YY-Yf`^ z5u(KXVqyJt)82@UB@D&bi_*ruic$6Lvz&+o>vyJ2wGYV_cYc6q0vAG3r@&VbWdzar zX8dvPQk=iBYI|CX{z@OUKBX}$&?$L|2=k$vW2aSS11jdAyvx_# z-TNXbxy-^^(_C&gVLQxoa+Ml@(=;nHdwKE@uWCjW(;6<9HCoS5i8QT;Ui$L&*lJc; zQ=37WvBvhi=R)YcCzHQj-ZH0KBHEmZ+8dja+t&`6->Rz(o1K~ky}yJA2+%PHl_<%a zn@Ig2T0T+@U|HMVZee1`uHeJrkVCM42zKmbw_+c!F!gz`ZX=_k4sClC6>^(JgP*zs z3&lZz%V?}bpRfmZy^o_cocJ?HxawiQN@P@hU2@M*aR=dtMD4jjQbs_)eCHpJ4!fXz swvqq=&A!Klj@+*TkR6Yru(x7MfQ3;icNZ)u{|yI=i2!@N{QzLczxg=-&;S4c literal 0 HcmV?d00001 diff --git a/wp-admin/images/no.png b/wp-admin/images/no.png new file mode 100644 index 0000000000000000000000000000000000000000..e2db55f22d6752e10a57f07e286081ebebacfea5 GIT binary patch literal 792 zcmV+z1LypSP)AsU_?Zci9d!A_6x~Insr^bw(It`ecQh8*8@Fx_eq|^b9kOS$wyR`|06NPhocs8 zU?v>-=-EnfdDG!10kVJ}=mfmL3x4C3JD#r5^Se7=<^gXYh=3bt;e*loYJQ%@zqp#o zc)ieEZw~|j12}i_vg*D#!8fNTYH-)p(SZRifR{fXpPVOOg5)8_Pfax}pxL$sOiaI_ z9663WbAXxGGQR;QY}-bF{nj_X{Nr6+f*aSdgArUWy~x7#3tYQ*U;M!9W0N|Xd56Y> zdw6NVP@4PMEslKs#fSj7!@bq{RDZ|F(lUi+9ee>|JyA+;y-hurBRMxmp;CdWNzChE zEgUAbv5jI00Q-_DfCrBwQLTgC1pOJbJebx(GO4#fZ-Z7r7eRrwu3!}WegvSSe~?;s zg&54uc6CmaclX!;Ty0b?pa&4c#fOgla1%y+p#)Z=f~-xR;Wr)XE6PJrdB<@ zkX^(65AWw<3BGfCZc8qEVwk5llHC!E4clf5C;=vLa<_ciGWRF}HJ|~Mfr?dU+T}WK zwsR5K0^D`Sq1rBg5bskfzs`!nAt2Vip96}O9S)jR-j65r$IZL|SSUu*ZczvKR4}MU zA;+G=VV*iLHje+;F`frfK+$f}Su8OX4QUMmEk`k$jYjm7Pd{sRn(48RUTuLs23_h7>hH;3oe{xsP*g;=fdj*7t_=_KYN7DNh9L(*MX+IPs+eE= zDxM&f=%ZXQal{bBz)%Dm!3LQf+RwS^Q`pLYql&h1ISRI;>9a!ve49Rq1EL~0BK!+x WVm^3T=Dr&M0000ziHF zIys}NBe|+4rl`R`qb4w|(j&gmHLl1dzQiUx$38U6CN#TDF!?3WC7cBwk;M!QTpvJ~ z(P@pz44|NViEBhjaDG}zd16s2gKuJTQGRY}N@k*hTV_#ed45rLv4X|cj7t?jr4k^e z&PAz-C7Jno3L%-fsSJkZdIrXNMg|7v+OA@83=B*=JY5_^D(1YsdoW1YQN-FI5H0``20^l+3rkDBFHZ9MUT|IXXioOGrZ$;# z_cd17r0QpQth~uBm87%a%JwcJu>>G3>?+BvvGw(?H-c+tBx@dva9H_XB=l9atE}Mb z!$RlluQbc-Zus->%jTtdX0w&&f8K9+JjiFIyy(`PHT&W}UHrFm-~Zq832W^4$h^M% z@@3QcZ8w}#D=fp-Ya}xsW9ng*;5Go-av-8%BLhK!hBx|4P17o5j(=Rvbn58(^*8my zt>yLu-FzbWTf?-P^Kus^+X$e2O~gA zkL0D8UehTHU9vIl7*o>5b=g3*K+V6;pSoUGGJ}-xgZN_Ub-|terSB%mvHViI}|H8~{w`44$rjF6*2UngG9hz$O3y literal 0 HcmV?d00001 diff --git a/wp-admin/images/yes.png b/wp-admin/images/yes.png new file mode 100644 index 0000000000000000000000000000000000000000..2f86f0ae6bb797bf29700cb1d0d93e5e30a4e72b GIT binary patch literal 612 zcmV-q0-ODbP)rBUO4f*s#JWo)C=2NW(z=Pj2y|)=wUAF^X9) z4JKxy1u6j0)RIi|M|)sH*wG=?lkGp?mG>pB_MOq^I)2;MG~R$-+5s)qA?%3_N2eo} zXv=IwoqbWvE*4At)uq*@s1n7bC*oOgSF=+RwLNr5*I9GqvaR{^Jq*&<5EDB1n?fTb zm9i$Dus8s4icGE-l{gAN2=9q38c~p!Py4(B*$}~^&cCXrMFSPUdx{aWOhk+U~sJy}m-eUU844&0=2l-7&OZcb~TiB5r z0AlWV30J0SgN!1!`5SNM*CEVJV1gTiG6i&8eG$y5$Xq{AJQ~MOnYT)Dr*_ais&-j# z+G5;h%n*ox)FklyQdiJ%!fJW6w(}QwQIRtCsoTnXOA{Bur&;c)oZ*vSD>X|Aw&+rK yNc65bzq+rET@n6d=x-0l;`?bjil?RWQuz-0He^X1)ISyg0000blogs[$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 16df934f..da1047ff 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 92abc48b..58aa7577 100644 --- a/wp-admin/import/greymatter.php +++ b/wp-admin/import/greymatter.php @@ -38,16 +38,16 @@ class GM_Import {

    - - + + - - + + - - +

    +

    so you need to enter the number of the last GM post here.
    (if you don't know that number, just log into your FTP and look it out
    in the entries' folder)") ?>
    diff --git a/wp-admin/import/mt.php b/wp-admin/import/mt.php index 6ab2f79c..5968095c 100644 --- a/wp-admin/import/mt.php +++ b/wp-admin/import/mt.php @@ -166,9 +166,9 @@ class MT_Import { $j = -1; foreach ($authors as $author) { ++ $j; - echo '
  7. '.__('Current author:').' '.$author.'
    '.sprintf(__('Create user %1$s or map to existing'), '
    '); + echo '
  8. '; + echo ''; } echo ''.'
    '; @@ -179,7 +179,7 @@ class MT_Import { function select_authors() { if ( $_POST['upload_type'] === 'ftp' ) { - $file['file'] = ABSPATH . 'wp-content/mt-export.txt'; + $file['file'] = WP_CONTENT_DIR . '/mt-export.txt'; if ( !file_exists($file['file']) ) $file['error'] = __('mt-export.txt does not exist'); } else { @@ -426,7 +426,7 @@ class MT_Import { function import() { $this->id = (int) $_GET['id']; if ( $this->id == 0 ) - $this->file = ABSPATH . 'wp-content/mt-export.txt'; + $this->file = WP_CONTENT_DIR . '/mt-export.txt'; else $this->file = get_attached_file($this->id); $this->get_authors_from_post(); diff --git a/wp-admin/import/textpattern.php b/wp-admin/import/textpattern.php index 1c10015f..bbddc08d 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) ); } } @@ -333,7 +333,7 @@ class Textpattern_Import { $category1 = get_category_by_slug($Category1); $category1 = $category1->term_id; $category2 = get_category_by_slug($Category2); - $category2 = $category1->term_id; + $category2 = $category2->term_id; if($cat1 = $category1) { $cats[1] = $cat1; } if($cat2 = $category2) { $cats[2] = $cat2; } diff --git a/wp-admin/import/wordpress.php b/wp-admin/import/wordpress.php index 03395bdb..5271abe0 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'), '
    '); + printf('
    '); } else { echo __('Map to existing').'
    '; @@ -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('
    ', '
    ', $post_excerpt); + $post_excerpt = str_replace('
    ', '
    ', $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('
    ', '
    ', $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 0f271cec..ff6da0d5 100644 --- a/wp-admin/import/wp-cat2tag.php +++ b/wp-admin/import/wp-cat2tag.php @@ -3,50 +3,71 @@ 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 '
    '; - echo '

    ' . __('Convert Categories to Tags') . '

    '; + if ( ! current_user_can('manage_categories') ) { + echo '
    '; + echo '

    ' . __('Cheatin’ uh?') . '

    '; + echo '
    '; + } else { ?> +

    +

    +'; } - function populate_all_categories() { - global $wpdb; + function populate_cats() { $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 ( is_term( $category->slug, 'post_tag' ) ) + $this->hybrids_ids[] = $category->term_id; + } + } + + function populate_tags() { + + $tags = get_terms( array('post_tag'), 'get=all' ); + foreach ( $tags as $tag ) { + $this->all_tags[] = $tag; + if ( is_term( $tag->slug, 'category' ) ) + $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 '
    '; + echo '
    '; - if (count($this->all_categories) > 0) { - echo '

    ' . __('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.') . '

    '; - echo '

    ' . __('Keep in mind that if you convert a category with child categories, the children become top-level orphans.') . '

    '; + if ( $cat_num > 0 ) { + echo '

    ' . sprintf( __ngettext( 'Convert Category to Tag.', 'Convert Categories (%d) to Tags.', $cat_num ), $cat_num ) . '

    '; + echo '
    '; + echo '

    ' . __('Hey there. Here you can selectively convert existing categories to tags. To get started, check the categories you wish to be converted, then click the Convert button.') . '

    '; + echo '

    ' . __('Keep in mind that if you convert a category with child categories, the children become top-level orphans.') . '

    '; $this->categories_form(); } else { echo '

    '.__('You have no categories to convert!').'

    '; } - - echo '
    '; } - function categories_form() { -?> + function categories_form() { ?> + - -

    '; - wp_nonce_field('import-cat2tag'); - echo '
      '; - $hier = _get_term_hierarchy('category'); + +

      +

      +
        + +all_categories as $category) { $category = sanitize_term( $category, 'category', 'display' ); - if ((int) $category->parent == 0) { - echo '
      • '; + if ( (int) $category->parent == 0 ) { ?> - if (isset($hier[$category->term_id])) { - $this->_category_children($category, $hier); - } +
      • '; - } - } + if ( in_array( intval($category->term_id), $this->hybrids_ids ) ) + echo ' * '; + + if ( isset($hier[$category->term_id]) ) + $this->_category_children($category, $hier); ?>
      • + +
      - echo '
    '; +hybrids_ids) ) + echo '

    ' . __('* This category is also a tag. Converting it will add that tag to all posts that are currently in the category.') . '

    '; ?> - echo '

    '; +

    + - echo ''; - } +'; + function tags_tab() { + $this->populate_tags(); + $tags_num = count($this->all_tags); - foreach ($hier[$parent->term_id] as $child_id) { - $child =& get_category($child_id); + echo '
    '; - echo '
  9. '; + if ( $tags_num > 0 ) { + echo '

    ' . sprintf( __ngettext( 'Convert Tag to Category.', 'Convert Tags (%d) to Categories.', $tags_num ), $tags_num ) . '

    '; + echo '
    '; + echo '

    ' . __('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.') . '

    '; + echo '

    ' . __('The newly created categories will still be associated with the same posts.') . '

    '; - if (isset($hier[$child->term_id])) { - $this->_category_children($child, $hier); - } + $this->tags_form(); + } else { + echo '

    '.__('You have no tags to convert!').'

    '; + } + } + + function tags_form() { ?> - echo '
  10. '; + - echo ''; +
    +

    +

    +
      + +all_tags as $tag ) { ?> +
    • term_id), $this->hybrids_ids ) ) echo ' * '; ?>
    • + + +
    + +hybrids_ids) ) + echo '

    ' . __('* This tag is also a category. When converted, all posts associated with the tag will also be in the category.') . '

    '; ?> + +

    +
    + + + +
      +term_id] as $child_id) { + $child =& get_category($child_id); ?> +
    • term_id), $this->hybrids_ids ) ) + echo ' * '; + + if ( isset($hier[$child->term_id]) ) + $this->_category_children($child, $hier); ?>
    • + +
    categories_to_convert)) { - echo '
    '; - echo '

    ' . sprintf(__('Uh, oh. Something didn’t work. Please try again.'), 'admin.php?import=wp-cat2tag') . '

    '; - echo '
    '; - return; + if ( (!isset($_POST['cats_to_convert']) || !is_array($_POST['cats_to_convert'])) && empty($this->categories_to_convert)) { ?> +
    +

    try again.'), 'admin.php?import=wp-cat2tag'); ?>

    +
    +categories_to_convert) ) $this->categories_to_convert = $_POST['cats_to_convert']; + $hier = _get_term_hierarchy('category'); + $hybrid_cats = $clear_parents = $parents = false; + $clean_term_cache = $clean_cat_cache = array(); + $default_cat = get_option('default_category'); echo '
      '; foreach ( (array) $this->categories_to_convert as $cat_id) { $cat_id = (int) $cat_id; - echo '
    • ' . sprintf(__('Converting category #%s ... '), $cat_id); - - if (!$this->_category_exists($cat_id)) { - _e('Category doesn\'t exist!'); + if ( ! $this->_category_exists($cat_id) ) { + echo '
    • ' . sprintf( __('Category %s doesn\'t exist!'), $cat_id ) . "
    • \n"; } else { $category =& get_category($cat_id); - - if ( tag_exists($wpdb->escape($category->name)) ) { - _e('Category is already a tag.'); - echo ''; - continue; - } + echo '
    • ' . sprintf(__('Converting category %s ... '), $category->name); // If the category is the default, leave category in place and create tag. - if ( get_option('default_category') == $category->term_id ) { - $id = wp_insert_term($category->name, 'post_tag', array('slug' => $category->slug)); + if ( $default_cat == $category->term_id ) { + + if ( ! ($id = is_term( $category->slug, 'post_tag' ) ) ) + $id = wp_insert_term($category->name, 'post_tag', array('slug' => $category->slug)); + $id = $id['term_taxonomy_id']; $posts = get_objects_in_term($category->term_id, 'category'); + $term_order = 0; + 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')"); + $values[] = $wpdb->prepare( "(%d, %d, %d)", $post, $id, $term_order); 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'"); - 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); + + 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)"); + + $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'post_tag'", $category->count, $category->term_id) ); + } + + echo __('Converted successfully.') . "
    • \n"; + continue; + } + + // if tag already exists, add it to all posts in the category + if ( $tag_ttid = $wpdb->get_var( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'post_tag'", $category->term_id) ) ) { + $objects_ids = get_objects_in_term($category->term_id, 'category'); + $tag_ttid = (int) $tag_ttid; + $term_order = 0; + + foreach ( $objects_ids as $object_id ) + $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tag_ttid, $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)"); + + $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $tag_ttid) ); + $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'post_tag'", $count, $category->term_id) ); } + echo __('Tag added to all posts in this category.') . " *\n"; - // 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'"); + $hybrid_cats = true; + $clean_term_cache[] = $category->term_id; + $clean_cat_cache[] = $category->term_id; - $terms = $wpdb->get_col("SELECT term_id FROM $wpdb->term_taxonomy WHERE parent = '{$category->term_id}' AND taxonomy = 'category'"); - foreach ( (array) $terms as $term ) - clean_category_cache($term); + continue; + } - // 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'"); + $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 ) + clean_post_cache($post); } - // Clean the cache - clean_category_cache($category->term_id); - _e('Converted successfully.'); + // Change the category to a tag. + $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag' WHERE term_id = %d AND taxonomy = 'category'", $category->term_id) ); + + // Set all parents to 0 (root-level) if their parent was the converted tag + $parents = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET parent = 0 WHERE parent = %d AND taxonomy = 'category'", $category->term_id) ); + + if ( $parents ) $clear_parents = true; + $clean_cat_cache[] = $category->term_id; + echo __('Converted successfully.') . "\n"; } + } + echo '
    '; - echo ''; + if ( ! empty($clean_term_cache) ) { + $clean_term_cache = array_unique(array_values($clean_term_cache)); + foreach ( $clean_term_cache as $id ) + wp_cache_delete($id, 'post_tag'); } - echo ''; + if ( ! empty($clean_cat_cache) ) { + $clean_cat_cache = array_unique(array_values($clean_cat_cache)); + foreach ( $clean_cat_cache as $id ) + wp_cache_delete($id, 'category'); + } + + if ( $clear_parents ) delete_option('category_children'); + + if ( $hybrid_cats ) + echo '

    ' . sprintf( __('* This category is also a tag. The converter has added that tag to all posts currently in the category. If you want to remove it, please confirm that all tags were added successfully, then delete it from the Manage Categories page.'), 'categories.php') . '

    '; echo '

    ' . sprintf( __('We’re all done here, but you can always convert more.'), 'admin.php?import=wp-cat2tag' ) . '

    '; } + function convert_tags() { + global $wpdb; + + if ( (!isset($_POST['tags_to_convert']) || !is_array($_POST['tags_to_convert'])) && empty($this->tags_to_convert)) { + echo '
    '; + echo '

    ' . sprintf(__('Uh, oh. Something didn’t work. Please try again.'), 'admin.php?import=wp-cat2tag&step=3') . '

    '; + echo '
    '; + return; + } + + if ( empty($this->tags_to_convert) ) + $this->tags_to_convert = $_POST['tags_to_convert']; + + $hybrid_tags = $clear_parents = false; + $clean_cat_cache = $clean_term_cache = array(); + $default_cat = get_option('default_category'); + echo '
      '; + + foreach ( (array) $this->tags_to_convert as $tag_id) { + $tag_id = (int) $tag_id; + + if ( $tag = get_term( $tag_id, 'post_tag' ) ) { + printf('
    • ' . __('Converting tag %s ... '), $tag->name); + + if ( $cat_ttid = $wpdb->get_var( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'category'", $tag->term_id) ) ) { + $objects_ids = get_objects_in_term($tag->term_id, 'post_tag'); + $cat_ttid = (int) $cat_ttid; + $term_order = 0; + + foreach ( $objects_ids as $object_id ) { + $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $cat_ttid, $term_order); + clean_post_cache($object_id); + } + + 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)"); + + if ( $default_cat != $tag->term_id ) { + $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $tag->term_id) ); + $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'category'", $count, $tag->term_id) ); + } + } + + $hybrid_tags = true; + $clean_term_cache[] = $tag->term_id; + $clean_cat_cache[] = $tag->term_id; + echo __('All posts were added to the category with the same name.') . " *
    • \n"; + + continue; + } + + // 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->term_id) ); + if ( 0 == $parent || (0 < (int) $parent && $this->_category_exists($parent)) ) { + $reset_parent = ''; + $clear_parents = true; + } 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->term_id) ); + + $clean_term_cache[] = $tag->term_id; + $clean_cat_cache[] = $cat['term_id']; + echo __('Converted successfully.') . "\n"; + + } else { + printf( '
    • ' . __('Tag #%s doesn\'t exist!') . "
    • \n", $tag_id ); + } + } + + if ( ! empty($clean_term_cache) ) { + $clean_term_cache = array_unique(array_values($clean_term_cache)); + foreach ( $clean_term_cache as $id ) + wp_cache_delete($id, 'post_tag'); + } + + if ( ! empty($clean_cat_cache) ) { + $clean_cat_cache = array_unique(array_values($clean_cat_cache)); + foreach ( $clean_cat_cache as $id ) + wp_cache_delete($id, 'category'); + } + + if ( $clear_parents ) delete_option('category_children'); + + echo '
    '; + if ( $hybrid_tags ) + echo '

    ' . sprintf( __('* This tag is also a category. The converter has added all posts from it to the category. If you want to remove it, please confirm that all posts were added successfully, then delete it from the Manage Tags page.'), 'edit-tags.php') . '

    '; + echo '

    ' . sprintf( __('We’re all done here, but you can always convert more.'), 'admin.php?import=wp-cat2tag&step=3' ) . '

    '; + } + function init() { $step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1; $this->header(); - if (!current_user_can('manage_categories')) { - echo '
    '; - echo '

    ' . __('Cheatin’ uh?') . '

    '; - echo '
    '; - } 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 +455,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')); -?> \ No newline at end of file +?> diff --git a/wp-admin/includes/bookmark.php b/wp-admin/includes/bookmark.php index 908d6b86..697a71c4 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 00000000..820703e4 --- /dev/null +++ b/wp-admin/includes/class-wp-filesystem-base.php @@ -0,0 +1,158 @@ +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') . '
    ', $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') . '
    ', $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; + } +} +?> diff --git a/wp-admin/includes/class-wp-filesystem-direct.php b/wp-admin/includes/class-wp-filesystem-direct.php index 45972a38..77a75826 100644 --- a/wp-admin/includes/class-wp-filesystem-direct.php +++ b/wp-admin/includes/class-wp-filesystem-direct.php @@ -1,51 +1,46 @@ 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'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 32ccd07d..20699351 100644 --- a/wp-admin/includes/class-wp-filesystem-ftpext.php +++ b/wp-admin/includes/class-wp-filesystem-ftpext.php @@ -1,11 +1,10 @@ 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') . '
    ', $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
    ' ); - 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') . '
    ', $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
    ' ); - 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'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]+|) +(.+)/",$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]+|) +(.+)/", $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]==""); 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 53656236..3b6cdcc8 100644 --- a/wp-admin/includes/class-wp-filesystem-ftpsockets.php +++ b/wp-admin/includes/class-wp-filesystem-ftpsockets.php @@ -1,29 +1,29 @@ 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') . '
    ', $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
    ' ); - 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') . '
    ', $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
    ' ); - 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'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 0f2aa614..8a47fe6d 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 9ce9db91..27839fcf 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -23,7 +23,9 @@ function wp_dashboard_setup() { /* Register Widgets and Controls */ // Recent Comments Widget - if ( current_user_can( 'moderate_comments' ) && $mod_comments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'") ) { + $mod_comments = wp_count_comments(); + $mod_comments = $mod_comments->moderated; + if ( current_user_can( 'moderate_comments' ) && $mod_comments ) { $notice = sprintf( __ngettext( '%d comment awaiting moderation', '%d comments awaiting moderation', $mod_comments ), $mod_comments ); $notice = "$notice"; } else { @@ -34,9 +36,10 @@ function wp_dashboard_setup() { ); // Incoming Links Widget - if ( !isset( $widget_options['dashboard_incoming_links'] ) ) { + if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) { $update = true; $widget_options['dashboard_incoming_links'] = array( + 'home' => get_option('home'), 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), 'url' => apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), 'items' => 5, @@ -214,16 +217,16 @@ function wp_dashboard_dynamic_sidebar_params( $params ) { $wp_registered_widgets[$widget_id]['callback'] = 'wp_dashboard_empty'; $sidebar_widget_name = $wp_registered_widget_controls[$widget_id]['name']; $params[1] = 'wp_dashboard_trigger_widget_control'; - $sidebar_before_widget .= '
    '; + $sidebar_before_widget .= ''; $sidebar_after_widget = "
    $sidebar_after_widget"; - $links[] = '' . __( 'Cancel' ) . ''; + $links[] = '' . __( 'Cancel' ) . ''; } else { - $links[] = '' . __( 'Edit' ) . ''; + $links[] = '' . __( 'Edit' ) . ''; } } if ( $widget_feed_link ) - $links[] = '' . __( 'rss icon' ) . ' ' . __( 'RSS' ) . ''; + $links[] = '' . __( 'rss icon' ) . ' ' . __( 'RSS' ) . ''; $links = apply_filters( "wp_dashboard_widget_links_$widget_id", $links ); @@ -267,7 +270,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; @@ -313,7 +316,7 @@ function wp_dashboard_incoming_links_output() { $widgets = get_option( 'dashboard_widget_options' ); @extract( @$widgets['dashboard_incoming_links'], EXTR_SKIP ); $rss = @fetch_rss( $url ); - if ( isset($rss->items) && 1 < count($rss->items) ) {// Technorati returns a 1-item feed when it has no results + if ( isset($rss->items) && 0 < count($rss->items) ) { echo "
      \n"; @@ -387,8 +390,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
    • $post$author
    • \n"; diff --git a/wp-admin/includes/export.php b/wp-admin/includes/export.php index 96239af9..00201fab 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 '\n"; post_content) ); ?> +post_excerpt) ); ?> ID; ?> post_date; ?> post_date_gmt; ?> @@ -217,7 +218,7 @@ if ($post->post_type == 'attachment') { ?> ID); ?> 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 ) { ?> @@ -228,7 +229,7 @@ if ( $postmeta ) { 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 ) { ?> comment_ID; ?> @@ -252,4 +253,4 @@ if ( $comments ) { foreach ( $comments as $c ) { ?> \ No newline at end of file +?> diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 575a6782..349feb2e 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -34,19 +34,47 @@ 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; } +//$folder = Full path to folder +//$levels = Levels of folders to follow, Default: 100 (PHP Loop limit) +function list_files( $folder = '', $levels = 100 ) { + if( empty($folder) ) + return false; + + if( ! $levels ) + return false; + + $files = array(); + if ( $dir = @opendir( $folder ) ) { + while (($file = readdir( $dir ) ) !== false ) { + if ( in_array($file, array('.', '..') ) ) + continue; + if ( is_dir( $folder . '/' . $file ) ) { + $files2 = list_files( $folder . '/' . $file, $levels - 1); + if( $files2 ) + $files = array_merge($files, $files2 ); + else + $files[] = $folder . '/' . $file . '/'; + } else { + $files[] = $folder . '/' . $file; + } + } + } + @closedir( $dir ); + return $files; +} 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,20 +84,16 @@ function get_temp_dir() { return '/tmp/'; } -function validate_file( $file, $allowed_files = '' ) { - if ( false !== strpos( $file, '..' )) - return 1; +function wp_tempnam($filename = '', $dir = ''){ + if ( empty($dir) ) + $dir = get_temp_dir(); + $filename = basename($filename); + if ( empty($filename) ) + $filename = time(); - if ( false !== strpos( $file, './' )) - return 1; - - if (':' == substr( $file, 1, 1 )) - return 2; - - if (!empty ( $allowed_files ) && (!in_array( $file, $allowed_files ) ) ) - return 3; - - return 0; + $filename = $dir . wp_unique_filename($dir, $filename); + touch($filename); + return $filename; } function validate_file_to_edit( $file, $allowed_files = '' ) { @@ -188,6 +212,102 @@ 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 upload_max_filesize directive in php.ini." ), + __( "The file exceeds the MAX_FILE_SIZE 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 ); + + // Strip the query strings. + $filename = str_replace('?','-', $filename); + $filename = str_replace('&','-', $filename); + + // 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 @@ -200,7 +320,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')); @@ -260,13 +380,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); } @@ -284,27 +404,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); @@ -319,18 +445,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); } -?> +?> \ No newline at end of file diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index 7699f986..8de29079 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -219,17 +219,17 @@ function wp_read_image_metadata( $file ) { if ( !empty($info['APP13']) ) { $iptc = iptcparse($info['APP13']); if ( !empty($iptc['2#110'][0]) ) // credit - $meta['credit'] = trim( $iptc['2#110'][0] ); + $meta['credit'] = utf8_encode(trim($iptc['2#110'][0])); elseif ( !empty($iptc['2#080'][0]) ) // byline - $meta['credit'] = trim( $iptc['2#080'][0] ); + $meta['credit'] = utf8_encode(trim($iptc['2#080'][0])); if ( !empty($iptc['2#055'][0]) and !empty($iptc['2#060'][0]) ) // created datee and time $meta['created_timestamp'] = strtotime($iptc['2#055'][0] . ' ' . $iptc['2#060'][0]); if ( !empty($iptc['2#120'][0]) ) // caption - $meta['caption'] = trim( $iptc['2#120'][0] ); + $meta['caption'] = utf8_encode(trim($iptc['2#120'][0])); if ( !empty($iptc['2#116'][0]) ) // copyright - $meta['copyright'] = trim( $iptc['2#116'][0] ); + $meta['copyright'] = utf8_encode(trim($iptc['2#116'][0])); if ( !empty($iptc['2#005'][0]) ) // title - $meta['title'] = trim( $iptc['2#005'][0] ); + $meta['title'] = utf8_encode(trim($iptc['2#005'][0])); } } diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 1000d15b..d91ffc23 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -26,11 +26,14 @@ function update_gallery_tab($tabs) { add_filter('media_upload_tabs', 'update_gallery_tab'); function the_media_upload_tabs() { + global $redir_tab; $tabs = media_upload_tabs(); if ( !empty($tabs) ) { echo "
        \n"; - if ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) ) + if ( isset($redir_tab) && array_key_exists($redir_tab, $tabs) ) + $current = $redir_tab; + elseif ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) ) $current = $_GET['tab']; else { $keys = array_keys($tabs); @@ -41,8 +44,8 @@ function the_media_upload_tabs() { if ( $current == $callback ) $class = " class='current'"; $href = add_query_arg(array('tab'=>$callback, 's'=>false, 'paged'=>false, 'post_mime_type'=>false, 'm'=>false)); - $link = "$text"; - echo "\t
      • $link
      • \n"; + $link = "$text"; + echo "\t
      • $link
      • \n"; } echo "
      \n"; } @@ -55,20 +58,39 @@ function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = fal $rel = $rel ? ' rel="attachment wp-att-'.attribute_escape($id).'"' : ''; if ( $url ) - $html = "$html"; + $html = '$html"; $html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size ); return $html; } +function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { + + if ( empty($alt) || apply_filters( 'disable_captions', '' ) ) return $html; + $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; + + preg_match( '/width="([0-9]+)/', $html, $matches ); + if ( ! isset($matches[1]) ) return $html; + $width = $matches[1]; + + $html = preg_replace( '/align[^\s\'"]+\s?/', '', $html ); + if ( empty($align) ) $align = 'none'; + + $shcode = '[caption id="' . $id . '" align="align' . $align + . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/caption]'; + + return apply_filters( 'image_add_caption_shortcode', $shcode, $html ); +} +add_filter( 'image_send_to_editor', 'image_add_caption', 20, 7 ); + function media_send_to_editor($html) { ?> 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 $url; + } + return $id; +} + // wrap iframe content (produced by $content_func) in a doctype, html head/body etc // any additional function args will be passed to content_func @@ -126,9 +189,12 @@ function wp_iframe($content_func /* ... */) { <?php bloginfo('name') ?> › <?php _e('Uploads'); ?> — <?php _e('WordPress'); ?> $image_title - $video_title - $audio_title - $media_title + $image_title + $video_title + $audio_title + $media_title EOF; printf($context, $out); } add_action( 'media_buttons', 'media_buttons' ); - -function media_buttons_head() { -$siteurl = get_option('siteurl'); -echo "\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() { @@ -210,6 +256,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); @@ -232,7 +280,7 @@ function media_upload_form_handler() { if ( isset($_POST['send']) ) { $keys = array_keys($_POST['send']); $send_id = (int) array_shift($keys); - $attachment = $_POST['attachments'][$send_id]; + $attachment = stripslashes_deep( $_POST['attachments'][$send_id] ); $html = $attachment['post_title']; if ( !empty($attachment['url']) ) { if ( strpos($attachment['url'], 'attachment_id') || false !== strpos($attachment['url'], get_permalink($_POST['post_id'])) ) @@ -280,12 +328,36 @@ function media_upload_image() { $errors = $return; } - if ( isset($_POST['save']) ) + if ( isset($_POST['save']) ) { $errors['upload_notice'] = __('Saved.'); + return media_upload_gallery(); + } return wp_iframe( 'media_upload_type_form', 'image', $errors, $id ); } +function media_sideload_image($file, $post_id, $desc = null) { + if (!empty($file) ) { + $file_array['name'] = basename($file); + $file_array['tmp_name'] = download_url($file); + $desc = @$desc; + + $id = media_handle_sideload($file_array, $post_id, $desc); + $src = $id; + + if ( is_wp_error($id) ) { + @unlink($file_array['tmp_name']); + return $id; + } + } + + if ( !empty($src) ) { + $alt = @$desc; + $html = "$alt"; + return $html; + } +} + function media_upload_audio() { if ( isset($_POST['html-upload']) && !empty($_FILES) ) { // Upload File button was clicked @@ -318,8 +390,10 @@ function media_upload_audio() { $errors = $return; } - if ( isset($_POST['save']) ) + if ( isset($_POST['save']) ) { $errors['upload_notice'] = __('Saved.'); + return media_upload_gallery(); + } return wp_iframe( 'media_upload_type_form', 'audio', $errors, $id ); } @@ -356,8 +430,10 @@ function media_upload_video() { $errors = $return; } - if ( isset($_POST['save']) ) + if ( isset($_POST['save']) ) { $errors['upload_notice'] = __('Saved.'); + return media_upload_gallery(); + } return wp_iframe( 'media_upload_type_form', 'video', $errors, $id ); } @@ -394,8 +470,10 @@ function media_upload_file() { $errors = $return; } - if ( isset($_POST['save']) ) + if ( isset($_POST['save']) ) { $errors['upload_notice'] = __('Saved.'); + return media_upload_gallery(); + } return wp_iframe( 'media_upload_type_form', 'file', $errors, $id ); } @@ -410,6 +488,7 @@ function media_upload_gallery() { $errors = $return; } + wp_enqueue_script('admin-gallery'); return wp_iframe( 'media_upload_gallery_form', $errors ); } @@ -429,8 +508,9 @@ function media_upload_library() { function image_attachment_fields_to_edit($form_fields, $post) { if ( substr($post->post_mime_type, 0, 5) == 'image' ) { $form_fields['post_title']['required'] = true; + $form_fields['post_excerpt']['label'] = __('Caption'); - $form_fields['post_excerpt']['helps'][] = __('Alternate text, e.g. "The Mona Lisa"'); + $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image'); $form_fields['post_content']['label'] = __('Description'); @@ -546,6 +626,10 @@ function get_attachment_fields_to_edit($post, $errors = null) { \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 ) { @@ -583,7 +667,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 ) @@ -601,6 +685,8 @@ function get_media_items( $post_id, $errors ) { } function get_media_item( $attachment_id, $args = null ) { + global $redir_tab; + $default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true ); $args = wp_parse_args( $args, $default_args ); extract( $args, EXTR_SKIP ); @@ -648,10 +734,27 @@ function get_media_item( $attachment_id, $args = null ) { } $display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case + $display_title = wp_html_excerpt($display_title, 60); + + $gallery = ( (isset($_REQUEST['tab']) && 'gallery' == $_REQUEST['tab']) || (isset($redir_tab) && 'gallery' == $redir_tab) ) ? true : false; + $order = ''; + + foreach ( $form_fields as $key => $val ) { + if ( 'menu_order' == $key ) { + if ( $gallery ) + $order = ''; + else + $order = ''; + + unset($form_fields['menu_order']); + break; + } + } $item = " $type $toggle_links + $order
      $display_title
      @@ -676,9 +779,11 @@ function get_media_item( $attachment_id, $args = null ) { if ( $send ) $send = ""; if ( $delete ) - $delete = "" . __('Delete') . ""; + $delete = "" . __('Delete') . ""; if ( ( $send || $delete ) && !isset($form_fields['buttons']) ) - $form_fields['buttons'] = array('tr' => "\t\t\n"); + $form_fields['buttons'] = array('tr' => "\t\t\n"); $hidden_fields = array(); @@ -700,6 +805,7 @@ function get_media_item( $attachment_id, $args = null ) { } $required = $field['required'] ? '*' : ''; + $aria_required = $field['required'] ? " aria-required='true' " : ''; $class = $id; $class .= $field['required'] ? ' form-required' : ''; @@ -707,9 +813,9 @@ function get_media_item( $attachment_id, $args = null ) { if ( !empty($field[$field['input']]) ) $item .= $field[$field['input']]; elseif ( $field['input'] == 'textarea' ) { - $item .= ""; + $item .= ""; } else { - $item .= ""; + $item .= ""; } if ( !empty($field['helps']) ) $item .= "

      " . join( "

      \n

      ", array_unique((array) $field['helps']) ) . '

      '; @@ -754,7 +860,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; @@ -765,7 +871,6 @@ function media_upload_form( $errors = null ) { $post_id = intval($_REQUEST['post_id']); ?> -
      @@ -776,18 +881,22 @@ function media_upload_form( $errors = null ) { get_error_message(); ?>
      + + + -
      +

      -

      + +

      +

      - +

      -

      +
      + @@ -873,23 +986,100 @@ jQuery(function($){

      + +
      + + +$d + +EOEE +, +dvortr( 'Eabi.p!' ) +); diff --git a/wp-admin/js/theme-preview.js b/wp-admin/js/theme-preview.js new file mode 100644 index 00000000..f4f85e8b --- /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 ( typeof document.body.style.maxWidth != 'undefined' ) + 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(' ' + text + ''); + + $('#TB_iframeContent').width('100%'); + return false; + } ); + + $(window).resize( function() { thickDims() } ); +}); diff --git a/wp-admin/js/widgets.js b/wp-admin/js/widgets.js index 4eb37ee7..b42812f3 100644 --- a/wp-admin/js/widgets.js +++ b/wp-admin/js/widgets.js @@ -13,12 +13,12 @@ jQuery(function($) { if ( t.is(':visible') ) { if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); } li.css( 'marginLeft', 0 ); - t.siblings('h4').children('a').text( widgetsL10n.edit ); + t.siblings('div').children('h4').children('a').text( widgetsL10n.edit ); } else { t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open if ( width > 250 ) li.css( 'marginLeft', ( width - 250 ) * -1 ); - t.siblings('h4').children('a').text( widgetsL10n.cancel ); + t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel ); } t.toggle(); } : function() { @@ -28,12 +28,12 @@ jQuery(function($) { if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); } if ( width > 250 ) li.animate( { marginLeft: 0 } ); - t.siblings('h4').children('a').text( widgetsL10n.edit ); + t.siblings('div').children('h4').children('a').text( widgetsL10n.edit ); } else { t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open if ( width > 250 ) li.animate( { marginLeft: ( width - 250 ) * -1 } ); - t.siblings('h4').children('a').text( widgetsL10n.cancel ); + t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel ); } t.animate( { height: 'toggle' } ); }; diff --git a/wp-admin/js/word-count.js b/wp-admin/js/word-count.js new file mode 100644 index 00000000..9e3c1dff --- /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/, '0' ) ); + 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( / /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 00000000..20c8aa23 --- /dev/null +++ b/wp-admin/js/wp-gears.js @@ -0,0 +1,92 @@ + +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() { + if ( 'undefined' != typeof google && google.gears ) return; + + var gf = false; + if ( 'undefined' != typeof GearsFactory ) { + gf = new GearsFactory(); + } else { + try { + gf = new ActiveXObject('Gears.Factory'); + if ( factory.getBuildInfo().indexOf('ie_mobile') != -1 ) + gf.privateSetGlobalObject(this); + } catch (e) { + if ( ( 'undefined' != typeof navigator.mimeTypes ) && navigator.mimeTypes['application/x-googlegears'] ) { + gf = document.createElement("object"); + gf.style.display = "none"; + gf.width = 0; + gf.height = 0; + gf.type = "application/x-googlegears"; + document.documentElement.appendChild(gf); + } + } + } + + if ( ! gf ) return; + if ( 'undefined' == typeof google ) google = {}; + if ( ! google.gears ) google.gears = { factory : gf }; +})(); diff --git a/wp-admin/link-add.php b/wp-admin/link-add.php index be3f0403..4b6493b5 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-category.php b/wp-admin/link-category.php index a67cf2b6..ea647913 100644 --- a/wp-admin/link-category.php +++ b/wp-admin/link-category.php @@ -28,12 +28,13 @@ case 'delete': wp_die(__('Cheatin’ uh?')); $cat_name = get_term_field('name', $cat_ID, 'link_category'); + $default_cat_id = get_option('default_link_category'); // Don't delete the default cats. - if ( $cat_ID == get_option('default_link_category') ) + if ( $cat_ID == $default_cat_id ) wp_die(sprintf(__("Can’t delete the %s category: this is the default one"), $cat_name)); - wp_delete_term($cat_ID, 'link_category'); + wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id)); $location = 'edit-link-categories.php'; if ( $referer = wp_get_original_referer() ) { @@ -73,7 +74,9 @@ case 'editedcat': $location = $referer; } - if ( wp_update_term($cat_ID, 'link_category', $_POST) ) + $update = wp_update_term($cat_ID, 'link_category', $_POST); + + if ( $update && !is_wp_error($update) ) $location = add_query_arg('message', 3, $location); else $location = add_query_arg('message', 5, $location); diff --git a/wp-admin/link-import.php b/wp-admin/link-import.php index f2183f6b..a2d6e4d5 100644 --- a/wp-admin/link-import.php +++ b/wp-admin/link-import.php @@ -30,19 +30,19 @@ switch ($step) {
      -

      - +

      +
      -

      +

      -


      - add new)' ), 'link-add.php' ); ?>

      +

      @@ -141,7 +142,7 @@ if ( $links ) {
      $send $delete
      $send $delete +
      " . sprintf(__("You are about to delete %s."), $filename) . " " . __('Continue') . " + " . __('Cancel') . "
      - + diff --git a/wp-admin/link-parse-opml.php b/wp-admin/link-parse-opml.php index 0e5edf0d..1cd27d0a 100644 --- a/wp-admin/link-parse-opml.php +++ b/wp-admin/link-parse-opml.php @@ -1,5 +1,5 @@

      - + diff --git a/wp-admin/menu-header.php b/wp-admin/menu-header.php index b9c1dde9..90b62969 100644 --- a/wp-admin/menu-header.php +++ b/wp-admin/menu-header.php @@ -2,6 +2,8 @@ $self = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']); $self = preg_replace('|^.*/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 @@ -19,13 +21,13 @@ foreach ( $menu as $key => $item ) { if ( !empty($submenu[$item[2]]) ) { $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); - if ( file_exists(ABSPATH . PLUGINDIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) + if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) echo "\n\t
    • {$item[0]}
    • "; else echo "\n\t
    • {$item[0]}
    • "; } else if ( current_user_can($item[1]) ) { $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); - if ( file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") || !empty($menu_hook) ) + if ( file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) echo "\n\t
    • {$item[0]}
    • "; else echo "\n\t
    • {$item[0]}
    • "; @@ -49,13 +51,13 @@ foreach ( $menu as $key => $item ) { if ( !empty($submenu[$item[2]]) ) { $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); - if ( file_exists(ABSPATH . PLUGINDIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) + if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) echo "\n\t
    • {$item[0]}
    • "; else echo "\n\t
    • {$item[0]}
    • "; } else if ( current_user_can($item[1]) ) { $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); - if ( file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") || !empty($menu_hook) ) + if ( file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) echo "\n\t
    • {$item[0]}
    • "; else echo "\n\t
    • {$item[0]}
    • "; @@ -74,13 +76,13 @@ foreach ( $menu as $key => $item ) { if ( !empty($submenu[$item[2]]) ) { $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); - if ( file_exists(ABSPATH . PLUGINDIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) + if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) echo "\n\t
    • {$item[0]}
    • "; else echo "\n\t
    • {$item[0]}
    • "; } else if ( current_user_can($item[1]) ) { $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); - if ( file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") || !empty($menu_hook) ) + if ( file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) echo "\n\t
    • {$item[0]}
    • "; else echo "\n\t
    • {$item[0]}
    • "; @@ -106,13 +108,13 @@ foreach ( $menu as $key => $item ) { if ( !empty($submenu[$item[2]]) ) { $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); - if ( file_exists(ABSPATH . PLUGINDIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) + if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) $side_items[] = "\n\t
    • {$item[0]}"; else $side_items[] = "\n\t
    • {$item[0]}"; } else if ( current_user_can($item[1]) ) { $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); - if ( file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") || !empty($menu_hook) ) + if ( file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) $side_items[] = "\n\t
    • {$item[0]}"; else $side_items[] = "\n\t
    • {$item[0]}"; @@ -143,7 +145,7 @@ else $class = ''; $menu_hook = get_plugin_page_hook($item[2], $parent_file); -if (file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") || ! empty($menu_hook)) { +if (file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || ! empty($menu_hook)) { if ( 'admin.php' == $pagenow ) echo "\n\t
    • {$item[0]}
    • "; else diff --git a/wp-admin/menu.php b/wp-admin/menu.php index 3db528fa..cad05c87 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -23,9 +23,12 @@ else $awaiting_mod = wp_count_comments(); $awaiting_mod = $awaiting_mod->moderated; $menu[15] = array(__('Design'), 'switch_themes', 'themes.php'); -$menu[20] = array( sprintf( __('Comments %s'), "$awaiting_mod" ), 'edit_posts', 'edit-comments.php'); +$menu[20] = array( sprintf( __('Comments %s'), "" . number_format_i18n($awaiting_mod) . "" ), 'edit_posts', 'edit-comments.php'); $menu[30] = array(__('Settings'), 'manage_options', 'options-general.php'); -$menu[35] = array(__('Plugins'), 'activate_plugins', 'plugins.php'); + +$update_plugins = get_option( 'update_plugins' ); +$update_count = count( $update_plugins->response ); +$menu[35] = array( sprintf( __('Plugins %s'), "" . number_format_i18n($update_count) . "" ), 'activate_plugins', 'plugins.php'); if ( current_user_can('edit_users') ) $menu[40] = array(__('Users'), 'edit_users', 'users.php'); else diff --git a/wp-admin/moderation.php b/wp-admin/moderation.php index 6750ac32..46cda95f 100644 --- a/wp-admin/moderation.php +++ b/wp-admin/moderation.php @@ -1,4 +1,4 @@ diff --git a/wp-admin/options-discussion.php b/wp-admin/options-discussion.php index 69c0bbd3..e676dc82 100644 --- a/wp-admin/options-discussion.php +++ b/wp-admin/options-discussion.php @@ -14,7 +14,7 @@ include('admin-header.php');
      - + - + - + - + - +
      +
      @@ -28,11 +28,11 @@ include('admin-header.php');
      -
      +
      @@ -40,11 +40,11 @@ include('admin-header.php'); -
      +
      @@ -52,62 +52,98 @@ include('admin-header.php');
      -
      -

      ' ) ?>

      +
      +

      -

      moderation queue. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?>

      +

      -
      -

      +
      +

      -

      -

      Gravatars — short for Globally Recognized Avatars — for the pictures that show up next to comments. Plugins may override this.'); ?>

      +

      - - + + - + + + + +
      +
      __("Don’t show Avatars"), 1 => __('Show Avatars')); foreach ( $yesorno as $key => $value) { $selected = (get_option('show_avatars') == $key) ? 'checked="checked"' : ''; - echo "\n\t
      "; + echo "\n\t
      "; } ?> -
      +
      __('G — Suitable for all audiences'), 'PG' => __('PG — Possibly offensive, usually for audiences 13 and above'), 'R' => __('R — Intended for adult audiences above 17'), 'X' => __('X — Even more mature than above')); foreach ($ratings as $key => $rating) : $selected = (get_option('avatar_rating') == $key) ? 'checked="checked"' : ''; - echo "\n\t
      "; + echo "\n\t
      "; endforeach; ?> -
      + +
      + + __('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'; + $avatar_list .= '
      '; +} +echo apply_filters('default_avatar_select', $avatar_list); +?> + +
      @@ -115,7 +151,7 @@ endforeach;

      - +

      diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php index 680f7ae9..aec47d05 100644 --- a/wp-admin/options-general.php +++ b/wp-admin/options-general.php @@ -13,50 +13,50 @@ include('./admin-header.php'); - + - + - + - + - + - + - - + - + - + - + - + - + - + - + - + - + diff --git a/wp-admin/options-writing.php b/wp-admin/options-writing.php index 645bfc79..03379a42 100644 --- a/wp-admin/options-writing.php +++ b/wp-admin/options-writing.php @@ -14,21 +14,21 @@ include('admin-header.php');

      " />
      " />
      to be different from the directory you installed WordPress.'); ?>


      -
      + +
      -



      Documentation on date formatting. Click "Save Changes" to update sample output.') ?>
      - + - + @@ -44,23 +44,23 @@ include('admin-header.php');

      wp-content/uploads'); ?> @@ -23,7 +23,7 @@ include('admin-header.php');
      - + - +
      +

      /> -
      +
      -
      diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php index 38144a3b..b2d05d36 100644 --- a/wp-admin/options-permalink.php +++ b/wp-admin/options-permalink.php @@ -163,18 +163,18 @@ $structures = array(

      -

      URLs here. For example, using /topics/ as your category base would make your category links like http://example.org/topics/uncategorized/. If you leave these blank the defaults will be used.') ?>

      +

      URLs here. For example, using topics as your category base would make your category links like http://example.org/topics/uncategorized/. If you leave these blank the defaults will be used.') ?>

      -

      URLs here. For example, using /topics/ as your category base would make your category links like http://example.org/index.php/topics/uncategorized/. If you leave these blank the defaults will be used.') ?>

      +

      URLs here. For example, using topics as your category base would make your category links like http://example.org/index.php/topics/uncategorized/. If you leave these blank the defaults will be used.') ?>

      - + - +
      diff --git a/wp-admin/options-privacy.php b/wp-admin/options-privacy.php index b493fc9d..3d9d140f 100644 --- a/wp-admin/options-privacy.php +++ b/wp-admin/options-privacy.php @@ -14,13 +14,13 @@ include('./admin-header.php'); - +
      +

      />

      />

      -
      diff --git a/wp-admin/options-reading.php b/wp-admin/options-reading.php index 82c5049a..b49f88b8 100644 --- a/wp-admin/options-reading.php +++ b/wp-admin/options-reading.php @@ -15,7 +15,7 @@ include('admin-header.php');
      +

        -
      • -
      • +
      • ".__('Front page: %s')."", wp_dropdown_pages("name=page_on_front&echo=0&show_option_none=".__('- Select -')."&selected=" . get_option('page_on_front'))); ?>
      • +
      • ".__('Posts page: %s')."", wp_dropdown_pages("name=page_for_posts&echo=0&show_option_none=".__('- Select -')."&selected=" . get_option('page_for_posts'))); ?>
      @@ -37,29 +37,29 @@ include('admin-header.php');

      -
      +


      -

      recommended)') ?>
      - + - + - + - +
      +

      -
      +

      +

      + + + + + + + + +
      +
      +
      +
      +
      +

      -

      %s, %s, %s.'), wp_generate_password(), wp_generate_password(), wp_generate_password()) ?>

      +

      %s, %s, %s.'), wp_generate_password(8, false), wp_generate_password(8, false), wp_generate_password(8, false)) ?>

      - + - + - + - + - +
      @@ -110,7 +130,7 @@ endforeach;

      - +

      diff --git a/wp-admin/options.php b/wp-admin/options.php index 88ee29ae..7f158db4 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -73,7 +73,7 @@ foreach ( (array) $options as $option) : } echo "
      $option->option_name "; if (strpos($value, "\n") !== false) echo ""; diff --git a/wp-admin/page-new.php b/wp-admin/page-new.php index f09d6578..f324c3d1 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 b10fa727..3e8ae30a 100644 --- a/wp-admin/page.php +++ b/wp-admin/page.php @@ -34,9 +34,7 @@ function redirect_page($page_ID) { } elseif (!empty($referredby) && $referredby != $referer) { $location = $_POST['referredby']; $location = remove_query_arg('_wp_original_http_referer', $location); - if ( $_POST['referredby'] == 'redo' ) - $location = get_permalink( $page_ID ); - elseif ( false !== strpos($location, 'edit-pages.php') ) + if ( false !== strpos($location, 'edit-pages.php') ) $location = add_query_arg('posted', $page_ID, $location); elseif ( false !== strpos($location, 'wp-admin') ) $location = "page-new.php?posted=$page_ID"; @@ -73,16 +71,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 ) ) { @@ -148,8 +147,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 a9c534c5..ea87bea0 100644 --- a/wp-admin/plugin-editor.php +++ b/wp-admin/plugin-editor.php @@ -6,10 +6,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); @@ -18,7 +15,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) { @@ -71,7 +68,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 f0b75ad5..46d2b611 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -1,68 +1,199 @@ 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', 'clear-recent-list') 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('bulk-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); - exit; + 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('bulk-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('bulk-manage-plugins'); + + $plugins = $_REQUEST['checked']; //$_POST = from the plugin form; $_GET = from the FTP details screen. + include(ABSPATH . 'wp-admin/update.php'); + + $title = __('Delete Plugin'); + $parent_file = 'plugins.php'; + + if( ! isset($_REQUEST['verify-delete']) ) { + wp_enqueue_script('jquery'); + require_once('admin-header.php'); + ?> +
      +

      + +

      +

      +

        + ', $plugin['Title'], ' ', __('By'), ' ', $plugin['Author'], ''; + ?> +
      +

      +

      +
      + + + "; + } + ?> + + +
      +
      + +
      + +

      + +
      + $error) + echo '

      ' . sprintf(__('The plugin %s has been deactivated due to an error: %s'), wp_specialchars($plugin_file), $error->get_error_message()) . '

      '; ?>

      fatal error.') ?>

      - +
      - -

      fatal error.') ?>

      + +

      get_error_message() ); ?>

      + +

      deleted.'); ?>

      +

      activated.') ?>

      + +

      activated.'); ?>

      deactivated.') ?>

      - -

      deactivated.'); ?>

      - -

      reactivated.'); ?>

      + +

      deactivated.'); ?>

      @@ -70,107 +201,160 @@ validate_active_plugins();

      '; - _e("Couldn’t open plugins directory or there are no plugins available."); // TODO: make more helpful - echo '

      '; -} 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); -
      -
      - - - - - -
      -
      -
      +$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) { + + // 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'] .= ' ' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.'; - + //Filter into individual sections + 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 + $inactive_plugins[ $plugin_file ] = $plugin_data; + } +} + +?> + + +
      - - - - - + + + + + - + $plugin_data) { - $action_links = array(); - - $style = ''; - - if ( is_plugin_active($plugin_file) ) { - $action_links[] = "".__('Deactivate').""; - $style = 'active'; - } else { - $action_links[] = "".__('Activate').""; - } - if ( current_user_can('edit_plugins') && is_writable(ABSPATH . PLUGINDIR . '/' . $plugin_file) ) - $action_links[] = "".__('Edit').""; - $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 ' + + '; + } + 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']) ) ? '' : ' ' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.'; + if( 'active' == $context ) + $action_links[] = '' . __('Deactivate') . ''; + else //Available or Recently deactivated + $action_links[] = '' . __('Activate') . ''; - if ( $style != '' ) - $style = ' class="' . $style . '"'; + if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) + $action_links[] = '' . __('Edit') . ''; - $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 " - + + - - - + - "; - do_action( 'after_plugin_row', $plugin_file ); + echo ' + '; + do_action( 'after_plugin_row', $plugin_file, $plugin_data, $context ); } ?>
      ' . __('No plugins to show') . '
      {$plugin_data['Title']} {$plugin_data['Version']}

      {$plugin_data['Description']}$author

      "; - if ( is_plugin_active($plugin_file) ) - echo __('Active'); - else - _e('Inactive'); - echo "

      {$plugin_data['Description']}

      - - -

      %s directory and it will be automatically deactivated.'), PLUGINDIR); ?>

      + +

      +
      + + +
      +
      + +
      +
      +
      + +
      + +

      %s directory and it will be automatically deactivated.'), WP_PLUGIN_DIR); ?>

      + + + +

      +

      +
      + + +
      +
      + + + + + +
      +
      +
      + +
      + + + +

      +
      + + +
      +
      + + + + +
      +
      +
      + +
      + + + +

      +

      WordPress plugin directory.'); ?>

      -

      %s directory. Once a plugin is uploaded, you may activate it here.'), PLUGINDIR); ?>

      +

      %s directory. Once a plugin is uploaded, you may activate it here.'), WP_PLUGIN_DIR); ?>

      diff --git a/wp-admin/post-new.php b/wp-admin/post-new.php index 263783a3..f1f2da5b 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 b9400b71..0dfb8212 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -36,9 +36,7 @@ function redirect_post($post_ID = '') { } elseif (!empty($referredby) && $referredby != $referer) { $location = $_POST['referredby']; $location = remove_query_arg('_wp_original_http_referer', $location); - if ( $_POST['referredby'] == 'redo' ) - $location = get_permalink( $post_ID ); - elseif ( false !== strpos($location, 'edit.php') ) + if ( false !== strpos($location, 'edit.php') ) $location = add_query_arg('posted', $post_ID, $location); elseif ( false !== strpos($location, 'wp-admin') ) $location = "post-new.php?posted=$post_ID"; @@ -80,16 +78,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 +158,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 00000000..8bd6ce28 --- /dev/null +++ b/wp-admin/press-this.php @@ -0,0 +1,536 @@ + $image) { + + // see if files exist in content - we don't want to upload non-used selected files. + if( strpos($_REQUEST['content'], $image) !== false ) { + $upload = media_sideload_image($image, $post_ID, $_REQUEST['photo_description'][$key]); + + // Replace the POSTED content with correct uploaded ones. + // escape quote for matching + $quoted = preg_quote2($image); + if( !is_wp_error($upload) ) $content = preg_replace('/]*)src=(\"|\')'.$quoted.'(\2)([^>\/]*)\/*>/is', $upload, $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 + } elseif ( is_wp_error($upload)) { + wp_die($upload); + wp_delete_post($post_ID); + } else { + $quick['ID'] = $post_ID; + wp_update_post($quick); + } + return $post_ID; +} + +// For submitted posts. +if ( 'post' == $_REQUEST['action'] ) { + check_admin_referer('press-this'); $post_ID = press_it(); ?> + + > + + + <?php _e('Press This') ?> + + + +

      | |

      + + + + +

      ', $selection); + $selection = '

      '.str_replace('

      ', '', $selection).'

      '; +} + +$url = clean_url($_GET['u']); +$image = $_GET['i']; + +if($_REQUEST['ajax'] == 'thickbox') { ?> + +

      +
      + +
      + +

      + <?php echo attribute_escape(__('Click to insert.')); ?>

      + +

      + + +

      +
      + +
      + + +

      +
      + +
      + +

      |

      + +

      +
      + +
      +]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))[^<>\'\"]*(\2)([^>\/]*)\/*>/is'; + preg_match_all($pattern, $content, $matches); + + if ( empty($matches[1]) ) return ''; + + $sources = array(); + foreach ($matches[3] as $src) { + // if no http in url + if(strpos($src, 'http') === false) + // if it doesn't have a relative uri + if( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === true) + $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); + else + $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src); + + $sources[] = clean_url($src); + } + return "'" . implode("','", $sources) . "'"; + } + + $url = urldecode($url); + $url = str_replace(' ', '%20', $url); + echo 'new Array('.get_images_from_uri($url).')'; +die; +} + +if($_REQUEST['ajax'] == 'photo_js') { ?> + // gather images and load some default JS + var last = null + var img, img_tag, aspect, w, h, skip, i, strtoappend = ""; + var my_src = eval( + jQuery.ajax({ + type: "GET", + url: "", + cache : false, + async : false, + data: "ajax=photo_images&u=", + 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; + scale = (aspect > 1) ? (75 / img.width) : (75 / img.height); + + w = img.width; + h = img.height; + + if (scale < 1) { + w = parseInt(img.width * scale); + h = parseInt(img.height * scale); + } + img_attr += ' style="width: ' + w + 'px; height: ' + h + 'px;"'; + } + if (!skip) strtoappend += ''; + } + + function pick(img, desc) { + if (img) { + if('object' == typeof jQuery('.photolist input') && jQuery('.photolist input').length != 0) length = jQuery('.photolist input').length; + if(length == 0) length = 1; + jQuery('.photolist').append(''); + jQuery('.photolist').append(''); + append_editor("\n\n" + '

      ' + desc + '

      '); + } + tinyMCE.activeEditor.resizeToContent(); + return false; + } + + function image_selector() { + tb_remove(); + desc = jQuery('#this_photo_description').val(); + src = jQuery('#this_photo').val(); + pick(src, desc); + return false; + } + + jQuery(document).ready(function() { + jQuery('#extra_fields').html('
      +
      '); + jQuery('#img_container').html(strtoappend); + jQuery('#photo_add_url').attr('href', '?ajax=thickbox_url&height=200&width=500'); + tb_init('a.thickbox, area.thickbox, input.thickbox'); + }); + + + + + + > + + + <?php _e('Press This') ?> + + + + + + + + + + +
      + + +
      +

      +
      + +
      + + + +
      +

      +
      + +
      +
      +
      + +
      +
      +
      +
      +

      +
      +
        + +
      +
      + +

      +

      +
      +
      + +

      + + + +

      +
      +
      +
      + + \ No newline at end of file diff --git a/wp-admin/revision.php b/wp-admin/revision.php new file mode 100644 index 00000000..4820abc3 --- /dev/null +++ b/wp-admin/revision.php @@ -0,0 +1,213 @@ +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; + + // If we're comparing a revision to itself, redirect to the 'view' page for that revision or the edit page for that post + if ( $left_revision->ID == $right_revision->ID ) { + $redirect = get_edit_post_link( $left_revision->ID ); + include( 'js/revisions-js.php' ); + 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 = '' . get_the_title() . ''; + $h2 = sprintf( __( 'Compare Revisions of “%1$s”' ), $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 = '' . get_the_title() . ''; + $revision_title = wp_post_revision_title( $revision, false ); + $h2 = sprintf( __( 'Post Revision for “%1$s” 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' ); +} + +require_once( 'admin-header.php' ); + +?> + +
      + +

      + + + + + + + + + $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 ); + } + ?> + + + + + + + + + + + + +
      + + +

      + +
      + +

      + + 'form-table', 'parent' => true, 'right' => $right, 'left' => $left ); +if ( !constant( 'WP_POST_REVISIONS' ) ) + $args['type'] = 'autosave'; + +wp_list_post_revisions( $post, $args ); + +?> + +
      + +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 installing now.

      "); +// Check if wp-config.php exists above the root directory +if (file_exists('../../wp-config.php')) + wp_die("

      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 installing now.

      "); + if (isset($_GET['step'])) $step = $_GET['step']; else @@ -57,7 +62,7 @@ switch($step) {

      If for any reason this automatic file creation doesn't work, don't worry. All this does is fill in the database information to a configuration file. You may also simply open wp-config-sample.php in a text editor, fill in your information, and save it as wp-config.php.

      In all likelihood, these items were supplied to you by your ISP. If you do not have this information, then you will need to contact them before you can continue. If you’re all ready…

      -

      Let’s go!

      +

      Let’s go!

      Below you should enter your database connection details. If you're not sure about these, contact your host.

      - - + + - - + + - - + + - - + + - - + +
      Database Name The name of the database you want to run WP in.
      User Name Your MySQL username
      Password ...and MySQL password.
      Database Host 99% chance you won't need to change this value.
      Table Prefix If you want to run multiple WordPress installations in a single database, change this.
      -

      - -

      +

      All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to…

      -

      Run the install

      +

      Run the install

      ; charset=UTF-8" /> <?php _e('WordPress › Posted'); ?> @@ -32,8 +33,9 @@ wp_admin_css(); <?php _e('WordPress › Sidebar'); ?> \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) && !preg_match('|^' . preg_quote(WP_CONTENT_URL) . '|', $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 0d866faa..3c3a4db8 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; @@ -90,6 +91,10 @@ class WP { // Look for matches. $request_match = $request; foreach ($rewrite as $match => $query) { + // Don't try to match against AtomPub calls + if ( $req_uri == 'wp-app.php' ) + break; + // If the requesting file is the anchor of the match, prepend it // to the path info. if ((! empty($req_uri)) && (strpos($match, $req_uri) === 0) && ($req_uri != $request)) { @@ -105,7 +110,7 @@ class WP { $query = preg_replace("!^.+\?!", '', $query); // Substitute the substring matches into the query. - eval("\$query = \"$query\";"); + eval("\$query = \"" . addslashes($query) . "\";"); $this->matched_query = $query; // Parse the query. @@ -140,6 +145,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; $ipublic_query_vars); $i += 1) { $wpvar = $this->public_query_vars[$i]; if (isset($this->extra_query_vars[$wpvar])) @@ -153,8 +162,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) { @@ -419,7 +433,8 @@ class Walker { if ( $max_depth == 0 || ($max_depth != 0 && $max_depth > $depth+1 )) { //whether to descend - for ( $i = 0; $i < sizeof( $children_elements ); $i++ ) { + $num_elements = sizeof( $children_elements ); + for ( $i = 0; $i < $num_elements; $i++ ) { $child = $children_elements[$i]; if ( $child->$parent_field == $element->$id_field ) { @@ -432,6 +447,7 @@ class Walker { } array_splice( $children_elements, $i, 1 ); + $num_elements--; $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output ); $i = -1; } @@ -498,12 +514,14 @@ class Walker { if ( !$top_level_elements ) { $root = $children_elements[0]; - for ( $i = 0; $i < sizeof( $children_elements ); $i++ ) { + $num_elements = sizeof($children_elements); + for ( $i = 0; $i < $num_elements; $i++ ) { $child = $children_elements[$i]; if ($root->$parent_field == $child->$parent_field ) { $top_level_elements[] = $child; array_splice( $children_elements, $i, 1 ); + $num_elements--; $i--; } } diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 6e2ec62d..a0474173 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -9,10 +9,10 @@ */ /** - * get_comment_author() - Retrieve the author of the current comment + * Retrieve the author of the current comment. * - * If the comment has an empty comment_author field, then 'Anonymous' person - * is assumed. + * If the comment has an empty comment_author field, then 'Anonymous' person is + * assumed. * * @since 1.5 * @uses apply_filters() Calls 'get_comment_author' hook on the comment author @@ -29,7 +29,7 @@ function get_comment_author() { } /** - * comment_author() - Displays the author of the current comment + * Displays the author of the current comment. * * @since 0.71 * @uses apply_filters() Calls 'comment_author' on comment author before displaying @@ -40,7 +40,7 @@ function comment_author() { } /** - * get_comment_author_email() - Retrieve the email of the author of the current comment + * Retrieve the email of the author of the current comment. * * @since 1.5 * @uses apply_filters() Calls the 'get_comment_author_email' hook on the comment author email @@ -54,12 +54,13 @@ function get_comment_author_email() { } /** - * comment_author_email() - Display the email of the author of the current global $comment + * Display the email of the author of the current global $comment. * - * Care should be taken to protect the email address and assure that email harvesters - * do not capture your commentors' email address. Most assume that their email address will - * not appear in raw form on the blog. Doing so will enable anyone, including those that - * people don't want to get the email address and use it for their own means good and bad. + * Care should be taken to protect the email address and assure that email + * harvesters do not capture your commentors' email address. Most assume that + * their email address will not appear in raw form on the blog. Doing so will + * enable anyone, including those that people don't want to get the email + * address and use it for their own means good and bad. * * @since 0.71 * @uses apply_filters() Calls 'author_email' hook on the author email @@ -69,12 +70,13 @@ function comment_author_email() { } /** - * comment_author_email_link() - Display the html email link to the author of the current comment + * Display the html email link to the author of the current comment. * - * Care should be taken to protect the email address and assure that email harvesters - * do not capture your commentors' email address. Most assume that their email address will - * not appear in raw form on the blog. Doing so will enable anyone, including those that - * people don't want to get the email address and use it for their own means good and bad. + * Care should be taken to protect the email address and assure that email + * harvesters do not capture your commentors' email address. Most assume that + * their email address will not appear in raw form on the blog. Doing so will + * enable anyone, including those that people don't want to get the email + * address and use it for their own means good and bad. * * @since 0.71 * @uses apply_filters() Calls 'comment_email' hook for the display of the comment author's email @@ -96,7 +98,7 @@ function comment_author_email_link($linktext='', $before='', $after='') { } /** - * get_comment_author_link() - Retrieve the html link to the url of the author of the current comment + * Retrieve the html link to the url of the author of the current comment. * * @since 1.5 * @uses apply_filters() Calls 'get_comment_author_link' hook on the complete link HTML or author @@ -116,7 +118,7 @@ function get_comment_author_link() { } /** - * comment_author_link() - Display the html link to the url of the author of the current comment + * Display the html link to the url of the author of the current comment. * * @since 0.71 * @see get_comment_author_link() Echos result @@ -126,7 +128,7 @@ function comment_author_link() { } /** - * get_comment_author_IP() - Retrieve the IP address of the author of the current comment + * Retrieve the IP address of the author of the current comment. * * @since 1.5 * @uses $comment @@ -140,7 +142,7 @@ function get_comment_author_IP() { } /** - * comment_author_IP() - Displays the IP address of the author of the current comment + * Display the IP address of the author of the current comment. * * @since 0.71 * @see get_comment_author_IP() Echos Result @@ -150,7 +152,7 @@ function comment_author_IP() { } /** - * get_comment_author_url() - Returns the url of the author of the current comment + * Retrieve the url of the author of the current comment. * * @since 1.5 * @uses apply_filters() Calls 'get_comment_author_url' hook on the comment author's URL @@ -163,7 +165,7 @@ function get_comment_author_url() { } /** - * comment_author_url() - Display the url of the author of the current comment + * Display the url of the author of the current comment. * * @since 0.71 * @uses apply_filters() @@ -174,13 +176,14 @@ function comment_author_url() { } /** - * get_comment_author_url_link() - Retrieves the HTML link of the url of the author of the current comment + * Retrieves the HTML link of the url of the author of the current comment. * - * $linktext parameter is only used if the URL does not exist for the comment author. If the URL does - * exist then the URL will be used and the $linktext will be ignored. + * $linktext parameter is only used if the URL does not exist for the comment + * author. If the URL does exist then the URL will be used and the $linktext + * will be ignored. * - * Encapsulate the HTML link between the $before and $after. So it will appear in the order of $before, - * link, and finally $after. + * Encapsulate the HTML link between the $before and $after. So it will appear + * in the order of $before, link, and finally $after. * * @since 1.5 * @uses apply_filters() Calls the 'get_comment_author_url_link' on the complete HTML before returning. @@ -202,7 +205,7 @@ function get_comment_author_url_link( $linktext = '', $before = '', $after = '' } /** - * comment_author_url_link() - Displays the HTML link of the url of the author of the current comment + * Displays the HTML link of the url of the author of the current comment. * * @since 0.71 * @see get_comment_author_url_link() Echos result @@ -216,7 +219,7 @@ function comment_author_url_link( $linktext = '', $before = '', $after = '' ) { } /** - * get_comment_date() - Retrieve the comment date of the current comment + * Retrieve the comment date of the current comment. * * @since 1.5 * @uses apply_filters() Calls 'get_comment_date' hook with the formated date and the $d parameter respectively @@ -235,7 +238,7 @@ function get_comment_date( $d = '' ) { } /** - * comment_date() - Display the comment date of the current comment + * Display the comment date of the current comment. * * @since 0.71 * @@ -246,7 +249,7 @@ function comment_date( $d = '' ) { } /** - * get_comment_excerpt() - Retrieve the excerpt of the current comment + * Retrieve the excerpt of the current comment. * * Will cut each word and only output the first 20 words with '...' at the end. * If the word count is less than 20, then no truncating is done and no '...' @@ -278,7 +281,7 @@ function get_comment_excerpt() { } /** - * comment_excerpt() - Returns the excerpt of the current comment + * Display the excerpt of the current comment. * * @since 1.2 * @uses apply_filters() Calls 'comment_excerpt' hook before displaying excerpt @@ -288,7 +291,7 @@ function comment_excerpt() { } /** - * get_comment_ID() - Retrieve the comment id of the current comment + * Retrieve the comment id of the current comment. * * @since 1.5 * @uses $comment @@ -302,7 +305,7 @@ function get_comment_ID() { } /** - * comment_ID() - Displays the comment id of the current comment + * Displays the comment id of the current comment. * * @since 0.71 * @see get_comment_ID() Echos Result @@ -312,7 +315,7 @@ function comment_ID() { } /** - * get_comment_link() - Retrieve the link to the current comment + * Retrieve the link to the current comment. * * @since 1.5 * @uses $comment @@ -325,7 +328,7 @@ function get_comment_link() { } /** - * get_comments_link() - Retrieves the link to the current post comments + * Retrieves the link to the current post comments. * * @since 1.5 * @@ -336,7 +339,7 @@ function get_comments_link() { } /** - * comments_link() - Displays the link to the current post comments + * Displays the link to the current post comments. * * @since 0.71 * @@ -348,7 +351,7 @@ function comments_link( $deprecated = '', $deprecated = '' ) { } /** - * get_comments_number() - Retrieve the amount of comments a post has + * Retrieve the amount of comments a post has. * * @since 1.5 * @uses apply_filters() Calls the 'get_comments_number' hook on the number of comments @@ -373,7 +376,7 @@ function get_comments_number( $post_id = 0 ) { } /** - * comments_number() - Display the language string for the number of comments the current post has + * Display the language string for the number of comments the current post has. * * @since 0.71 * @uses $id @@ -389,7 +392,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 @@ -399,7 +402,7 @@ function comments_number( $zero = false, $one = false, $more = false, $deprecate } /** - * get_comment_text() - Retrieve the text of the current comment + * Retrieve the text of the current comment. * * @since 1.5 * @uses $comment @@ -412,7 +415,7 @@ function get_comment_text() { } /** - * comment_text() - Displays the text of the current comment + * Displays the text of the current comment. * * @since 0.71 * @uses apply_filters() Passes the comment content through the 'comment_text' hook before display @@ -423,7 +426,7 @@ function comment_text() { } /** - * get_comment_time() - Retrieve the comment time of the current comment + * Retrieve the comment time of the current comment. * * @since 1.5 * @uses $comment @@ -444,7 +447,7 @@ function get_comment_time( $d = '', $gmt = false ) { } /** - * comment_time() - Display the comment time of the current comment + * Display the comment time of the current comment. * * @since 0.71 * @@ -455,7 +458,7 @@ function comment_time( $d = '' ) { } /** - * get_comment_type() - Retrieve the comment type of the current comment + * Retrieve the comment type of the current comment. * * @since 1.5 * @uses $comment @@ -473,7 +476,7 @@ function get_comment_type() { } /** - * comment_type() - Display the comment type of the current comment + * Display the comment type of the current comment. * * @since 0.71 * @@ -496,11 +499,11 @@ function comment_type($commenttxt = 'Comment', $trackbacktxt = 'Trackback', $pin } /** - * get_trackback_url() - Retrieve The current post's trackback URL + * Retrieve The current post's trackback URL. * - * There is a check to see if permalink's have been enabled and if so, will retrieve - * the pretty path. If permalinks weren't enabled, the ID of the current post is used - * and appended to the correct page to go to. + * There is a check to see if permalink's have been enabled and if so, will + * retrieve the pretty path. If permalinks weren't enabled, the ID of the + * current post is used and appended to the correct page to go to. * * @since 1.5 * @uses apply_filters() Calls 'trackback_url' on the resulting trackback URL @@ -519,7 +522,7 @@ function get_trackback_url() { } /** - * trackback_url() - Displays the current post's trackback URL + * Displays the current post's trackback URL. * * @since 0.71 * @uses get_trackback_url() Gets the trackback url for the current post @@ -533,7 +536,7 @@ function trackback_url($deprecated = true) { } /** - * trackback_rdf() - Generates and displays the RDF for the trackback information of current post + * Generates and displays the RDF for the trackback information of current post. * * @since 0.71 * @@ -557,7 +560,7 @@ function trackback_rdf($deprecated = '') { } /** - * comments_open() - Whether the current post is open for comments + * Whether the current post is open for comments. * * @since 1.5 * @uses $post @@ -574,7 +577,7 @@ function comments_open( $post_id=NULL ) { } /** - * pings_open() - Whether the current post is open for pings + * Whether the current post is open for pings. * * @since 1.5 * @uses $post @@ -591,14 +594,14 @@ function pings_open( $post_id = NULL ) { } /** - * wp_comment_form_unfiltered_html_nonce() - Displays form token for unfiltered comments + * Displays form token for unfiltered comments. * - * Will only display nonce token if the current user has permissions for unfiltered html. - * Won't display the token for other users. + * Will only display nonce token if the current user has permissions for + * unfiltered html. Won't display the token for other users. * - * The function was backported to 2.0.10 and was added to versions 2.1.3 and above. Does not - * exist in versions prior to 2.0.10 in the 2.0 branch and in the 2.1 branch, prior to 2.1.3. - * Technically added in 2.2.0. + * The function was backported to 2.0.10 and was added to versions 2.1.3 and + * above. Does not exist in versions prior to 2.0.10 in the 2.0 branch and in + * the 2.1 branch, prior to 2.1.3. Technically added in 2.2.0. * * @since 2.0.10 Backported to 2.0 branch * @since 2.1.3 @@ -611,10 +614,10 @@ function wp_comment_form_unfiltered_html_nonce() { } /** - * comments_template() - Loads the comment template specified in $file + * Loads the comment template specified in $file. * - * Will not display the comments template if not on single post or page, or - * if the post does not have comments. + * Will not display the comments template if not on single post or page, or if + * the post does not have comments. * * Uses the WordPress database object to query for the comments. The comments * are passed through the 'comments_array' filter hook with the list of comments @@ -665,11 +668,11 @@ 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'); } /** - * comments_popup_script() - Displays the JS popup script to show a comment + * Displays the JS popup script to show a comment. * * If the $file parameter is empty, then the home page is assumed. The defaults * for the window are 400px by 400px. @@ -700,9 +703,10 @@ function comments_popup_script($width=400, $height=400, $file='') { } /** - * comments_popup_link() - Displays the link to the comments popup window for the current post ID. + * Displays the link to the comments popup window for the current post ID. * - * Is not meant to be displayed on single posts and pages. Should be used on the lists of posts + * Is not meant to be displayed on single posts and pages. Should be used on the + * lists of posts * * @since 0.71 * @uses $id diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 63e6b1b3..0873db52 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -6,21 +6,37 @@ */ /** - * check_comment() - Checks whether a comment passes internal checks to be allowed to add + * Checks whether a comment passes internal checks to be allowed to add. * - * {@internal Missing Long Description}} + * If comment moderation is set in the administration, then all comments, + * regardless of their type and whitelist will be set to false. + * + * If the number of links exceeds the amount in the administration, then the + * check fails. + * + * If any of the parameter contents match the blacklist of words, then the check + * fails. + * + * If the comment is a trackback and part of the blogroll, then the trackback is + * automatically whitelisted. If the comment author was approved before, then + * the comment is automatically whitelisted. + * + * If none of the checks fail, then the failback is to set the check to pass + * (return true). * * @since 1.2 * @uses $wpdb * - * @param string $author {@internal Missing Description }} - * @param string $email {@internal Missing Description }} - * @param string $url {@internal Missing Description }} - * @param string $comment {@internal Missing Description }} - * @param string $user_ip {@internal Missing Description }} - * @param string $user_agent {@internal Missing Description }} - * @param string $comment_type {@internal Missing Description }} - * @return bool {@internal Missing Description }} + * @param string $author Comment Author's name + * @param string $email Comment Author's email + * @param string $url Comment Author's URL + * @param string $comment Comment contents + * @param string $user_ip Comment Author's IP address + * @param string $user_agent Comment Author's User Agent + * @param string $comment_type Comment type, either user submitted comment, + * trackback, or pingback + * @return bool Whether the checks passed (true) and the comments should be + * displayed or set to moderated */ function check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $comment_type) { global $wpdb; @@ -83,7 +99,7 @@ function check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $ } /** - * get_approved_comments() - Returns the approved comments for post $post_id + * Retrieve the approved comments for post $post_id. * * @since 2.0 * @uses $wpdb @@ -97,15 +113,19 @@ function get_approved_comments($post_id) { } /** - * get_comment() - Retrieves comment data given a comment ID or comment object. + * Retrieves comment data given a comment ID or comment object. * - * {@internal Missing Long Description}} + * If an object is passed then the comment data will be cached and then returned + * after being passed through a filter. + * + * If the comment is empty, then the global comment variable will be used, if it + * is set. * * @since 2.0 * @uses $wpdb * - * @param object|string|int $comment {@internal Missing Description}} - * @param string $output OBJECT or ARRAY_A or ARRAY_N constants + * @param object|string|int $comment Comment to retrieve. + * @param string $output Optional. OBJECT or ARRAY_A or ARRAY_N constants * @return object|array|null Depends on $output value. */ function &get_comment(&$comment, $output = OBJECT) { @@ -142,12 +162,12 @@ function &get_comment(&$comment, $output = OBJECT) { } /** - * get_commentdata() - Returns an array of comment data about comment $comment_ID + * Retrieve an array of comment data about comment $comment_ID. * - * get_comment() technically does the same thing as this function. This function also - * appears to reference variables and then not use them or not update them when needed. - * It is advised to switch to get_comment(), since this function might be deprecated in - * favor of using get_comment(). + * get_comment() technically does the same thing as this function. This function + * also appears to reference variables and then not use them or not update them + * when needed. It is advised to switch to get_comment(), since this function + * might be deprecated in favor of using get_comment(). * * @deprecated Use get_comment() * @see get_comment() @@ -162,7 +182,7 @@ function &get_comment(&$comment, $output = OBJECT) { * @param bool $include_unapproved Whether to include unapproved comments or not * @return array The comment data */ -function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) { // less flexible, but saves DB queries +function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) { global $postc, $wpdb; if ( $no_cache ) { $query = $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_ID = %d", $comment_ID); @@ -186,7 +206,7 @@ function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = fals } /** - * get_lastcommentmodified() - The date the last comment was modified + * The date the last comment was modified. * * {@internal Missing Long Description}} * @@ -194,7 +214,8 @@ function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = fals * @uses $wpdb * @global array $cache_lastcommentmodified * - * @param string $timezone Which timezone to use in reference to 'gmt', 'blog', or 'server' locations + * @param string $timezone Which timezone to use in reference to 'gmt', 'blog', + * or 'server' locations * @return string Last comment modified date */ function get_lastcommentmodified($timezone = 'server') { @@ -223,15 +244,14 @@ function get_lastcommentmodified($timezone = 'server') { } /** - * get_comment_count() - The amount of comments in a post or total comments + * The amount of comments in a post or total comments. * * {@internal Missing Long Description}} * * @since 2.0.0 * @uses $wpdb * - * @param int $post_id Optional. Comment amount in post if > 0, else total com -ments blog wide + * @param int $post_id Optional. Comment amount in post if > 0, else total comments blog wide * @return array The amount of spam, approved, awaiting moderation, and total */ function get_comment_count( $post_id = 0 ) { @@ -241,7 +261,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(" @@ -281,12 +301,12 @@ function get_comment_count( $post_id = 0 ) { } /** - * sanitize_comment_cookies() - {@internal Missing Short Description}} + * Sanitizes the cookies sent to the user already. * - * {@internal Missing Long Description}} + * Will only do anything if the cookies have already been created for the user. + * Mostly used after cookies had been sent to use elsewhere. * * @since 2.0.4 - * */ function sanitize_comment_cookies() { if ( isset($_COOKIE['comment_author_'.COOKIEHASH]) ) { @@ -311,7 +331,7 @@ function sanitize_comment_cookies() { } /** - * wp_allow_comment() - Validates whether this comment is allowed to be made or not + * Validates whether this comment is allowed to be made or not. * * {@internal Missing Long Description}} * @@ -344,7 +364,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 { @@ -362,7 +382,7 @@ function wp_allow_comment($commentdata) { } /** - * check_comment_flood_db() - {@internal Missing Short Description}} + * {@internal Missing Short Description}} * * {@internal Missing Long Description}} * @@ -379,7 +399,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); @@ -391,7 +411,7 @@ function check_comment_flood_db( $ip, $email, $date ) { } /** - * wp_blacklist_check() - Does comment contain blacklisted characters or words + * Does comment contain blacklisted characters or words. * * {@internal Missing Long Description}} * @@ -448,38 +468,55 @@ function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_age return false; } -function wp_count_comments() { +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @param unknown_type $post_id + * @return unknown + */ +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; } /** - * wp_delete_comment() - Removes comment ID and maybe updates post comment count + * Removes comment ID and maybe updates post comment count. * - * The post comment count will be updated if the comment was approved and has a post - * ID available. + * The post comment count will be updated if the comment was approved and has a + * post ID available. * * @since 2.0.0 * @uses $wpdb @@ -495,7 +532,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; @@ -509,7 +546,7 @@ function wp_delete_comment($comment_id) { } /** - * wp_get_comment_status() - The status of a comment by ID + * The status of a comment by ID. * * @since 1.0.0 * @@ -536,7 +573,7 @@ function wp_get_comment_status($comment_id) { } /** - * wp_get_current_commenter() - Get current commenter's name, email, and URL + * Get current commenter's name, email, and URL. * * Expects cookies content to already be sanitized. User of this function * might wish to recheck the returned array for validity. @@ -566,7 +603,7 @@ function wp_get_current_commenter() { } /** - * wp_insert_comment() - Inserts a comment to the database + * Inserts a comment to the database. * * {@internal Missing Long Description}} * @@ -578,7 +615,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 +630,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; @@ -608,11 +644,11 @@ function wp_insert_comment($commentdata) { } /** - * wp_filter_comment() - Parses and returns comment information + * Parses and returns comment information. * - * Sets the comment data 'filtered' field to true when finished. This - * can be checked as to whether the comment should be filtered and to - * keep from filtering the same comment more than once. + * Sets the comment data 'filtered' field to true when finished. This can be + * checked as to whether the comment should be filtered and to keep from + * filtering the same comment more than once. * * @since 2.0.0 * @uses apply_filters() Calls 'pre_user_id' hook on comment author's user ID @@ -639,7 +675,7 @@ function wp_filter_comment($commentdata) { } /** - * wp_throttle_comment_flood() - {@internal Missing Short Description}} + * {@internal Missing Short Description}} * * {@internal Missing Long Description}} * @@ -659,7 +695,7 @@ function wp_throttle_comment_flood($block, $time_lastcomment, $time_newcomment) } /** - * wp_new_comment() - Parses and adds a new comment to the database + * Parses and adds a new comment to the database. * * {@internal Missing Long Description}} * @@ -707,7 +743,7 @@ function wp_new_comment( $commentdata ) { } /** - * wp_set_comment_status() - Sets the status of comment ID + * Sets the status of comment ID. * * {@internal Missing Long Description}} * @@ -722,13 +758,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); @@ -750,7 +790,7 @@ function wp_set_comment_status($comment_id, $comment_status) { } /** - * wp_update_comment() - Parses and updates an existing comment in the database + * Parses and updates an existing comment in the database. * * {@internal Missing Long Description}} * @@ -776,22 +816,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; @@ -802,7 +849,7 @@ function wp_update_comment($commentarr) { } /** - * wp_defer_comment_counting() - Whether to defer comment counting + * Whether to defer comment counting. * * When setting $defer to true, all post comment counts will not be updated * until $defer is set to false. When $defer is set to false, then all @@ -829,15 +876,15 @@ function wp_defer_comment_counting($defer=null) { } /** - * wp_update_comment_count() - Updates the comment count for post(s) + * Updates the comment count for post(s). * - * When $do_deferred is false (is by default) and the comments have been - * set to be deferred, the post_id will be added to a queue, which will - * be updated at a later date and only updated once per post ID. + * When $do_deferred is false (is by default) and the comments have been set to + * be deferred, the post_id will be added to a queue, which will be updated at a + * later date and only updated once per post ID. * - * If the comments have not be set up to be deferred, then the post will - * be updated. When $do_deferred is set to true, then all previous deferred - * post IDs will be updated along with the current $post_id. + * If the comments have not be set up to be deferred, then the post will be + * updated. When $do_deferred is set to true, then all previous deferred post + * IDs will be updated along with the current $post_id. * * @since 2.1.0 * @see wp_update_comment_count_now() For what could cause a false return value @@ -868,7 +915,7 @@ function wp_update_comment_count($post_id, $do_deferred=false) { } /** - * wp_update_comment_count_now() - Updates the comment count for the post + * Updates the comment count for the post. * * @since 2.5 * @uses $wpdb @@ -887,8 +934,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 ); @@ -906,7 +953,7 @@ function wp_update_comment_count_now($post_id) { // /** - * discover_pingback_server_uri() - Finds a pingback server URI based on the given URL + * Finds a pingback server URI based on the given URL. * * {@internal Missing Long Description}} * @@ -982,23 +1029,27 @@ 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; } /** - * do_all_pings() - {@internal Missing Short Description}} + * {@internal Missing Short Description}} * * {@internal Missing Long Description}} * @@ -1016,7 +1067,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); } @@ -1031,7 +1082,7 @@ function do_all_pings() { } /** - * do_trackbacks() - {@internal Missing Short Description}} + * {@internal Missing Short Description}} * * {@internal Missing Long Description}} * @@ -1043,11 +1094,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; } @@ -1068,14 +1119,14 @@ 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) ); } } } } /** - * generic_ping() - {@internal Missing Short Description}} + * {@internal Missing Short Description}} * * {@internal Missing Long Description}} * @@ -1098,7 +1149,7 @@ function generic_ping($post_id = 0) { } /** - * pingback() - Pings back the links found in a post + * Pings back the links found in a post. * * {@internal Missing Long Description}} * @@ -1175,7 +1226,7 @@ function pingback($content, $post_ID) { } /** - * privacy_ping_filter() - {@internal Missing Short Description}} + * {@internal Missing Short Description}} * * {@internal Missing Long Description}} * @@ -1192,19 +1243,19 @@ function privacy_ping_filter($sites) { } /** - * trackback() - Send a Trackback + * Send a Trackback. * - * {@internal Missing Long Description}} + * Updates database when sending trackback to prevent duplicates. * * @since 0.71 * @uses $wpdb * @uses $wp_version WordPress version * - * @param string $trackback_url {@internal Missing Description}} - * @param string $title {@internal Missing Description}} - * @param string $excerpt {@internal Missing Description}} - * @param int $ID {@internal Missing Description}} - * @return unknown {@internal Missing Description}} + * @param string $trackback_url URL to send trackbacks. + * @param string $title Title of post + * @param string $excerpt Excerpt of post + * @param int $ID Post ID + * @return mixed Database query from update */ function trackback($trackback_url, $title, $excerpt, $ID) { global $wpdb, $wp_version; @@ -1233,21 +1284,19 @@ 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) ); } /** - * weblog_ping() - {@internal Missing Short Description}} - * - * {@internal Missing Long Description}} + * Send a pingback. * * @since 1.2.0 * @uses $wp_version * @uses IXR_Client * - * @param unknown_type $server - * @param unknown_type $path + * @param string $server Host of blog to connect to. + * @param string $path Path to send the ping. */ function weblog_ping($server = '', $path = '') { global $wp_version; @@ -1270,7 +1319,7 @@ function weblog_ping($server = '', $path = '') { // /** - * clean_comment_cache() - Removes comment ID from the comment cache + * Removes comment ID from the comment cache. * * @since 2.3.0 * @package WordPress @@ -1283,7 +1332,7 @@ function clean_comment_cache($id) { } /** - * update_comment_cache() - Updates the comment cache of given comments + * Updates the comment cache of given comments. * * Will add the comments in $comments to the cache. If comment ID already * exists in the comment cache then it will not be updated. diff --git a/wp-includes/cron.php b/wp-includes/cron.php index 08fbb0ea..6eff54a3 100644 --- a/wp-includes/cron.php +++ b/wp-includes/cron.php @@ -133,6 +133,7 @@ function wp_cron() { function wp_get_schedules() { $schedules = array( 'hourly' => array( 'interval' => 3600, 'display' => __('Once Hourly') ), + 'twicedaily' => array( 'interval' => 43200, 'display' => __('Twice Daily') ), 'daily' => array( 'interval' => 86400, 'display' => __('Once Daily') ), ); return array_merge( apply_filters( 'cron_schedules', array() ), $schedules ); diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index 857de94d..011a1ed4 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -153,6 +153,8 @@ add_action('check_comment_flood', 'check_comment_flood_db', 10, 3); add_filter('comment_flood_filter', 'wp_throttle_comment_flood', 10, 3); add_filter('pre_comment_content', 'wp_rel_nofollow', 15); add_filter('comment_email', 'antispambot'); +add_filter('option_tag_base', '_wp_filter_taxonomy_base'); +add_filter('option_category_base', '_wp_filter_taxonomy_base'); //Atom SSL support add_filter('atom_service_url','atom_service_url_filter'); @@ -175,9 +177,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/deprecated.php b/wp-includes/deprecated.php index 32c28ce9..066e62c8 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -1064,14 +1064,14 @@ function get_links($category = -1, $before = '', $after = '
      ', $between = ' * * @author Dougal * @since 1.0.1 - * @deprecated Use get_categories() - * @see get_categories() + * @deprecated Use wp_list_bookmarks() + * @see wp_list_bookmarks() * * @param string $order Sort link categories by 'name' or 'id' * @param string $$deprecated Not Used */ function get_links_list($order = 'name', $deprecated = '') { - _deprecated_function(__FUNCTION__, '0.0', 'get_categories()'); + _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()'); $order = strtolower($order); diff --git a/wp-includes/feed.php b/wp-includes/feed.php index 4cf5e676..11ff42bc 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -1,18 +1,83 @@ comment_post_ID) . '#comment-' . $comment->comment_ID; } +/** + * Display the link to the comments. + * + * @since 1.5.0 + */ function comment_link() { echo get_comment_link(); } +/** + * Retrieve the current comment author for use in the feeds. + * + * @package WordPress + * @subpackage Feed + * @since 2.0.0 + * @uses apply_filters() Calls 'comment_author_rss' hook on comment author. + * @uses get_comment_author() + * + * @return string Comment Author + */ function get_comment_author_rss() { return apply_filters('comment_author_rss', get_comment_author() ); } +/** + * Display the current comment author in the feed. + * + * @package WordPress + * @subpackage Feed + * @since 1.0.0 + */ function comment_author_rss() { echo get_comment_author_rss(); } +/** + * Display the current comment content for use in the feeds. + * + * @package WordPress + * @subpackage Feed + * @since 1.0.0 + * @uses apply_filters() Calls 'comment_text_rss' filter on comment content. + * @uses get_comment_text() + */ function comment_text_rss() { $comment_text = get_comment_text(); $comment_text = apply_filters('comment_text_rss', $comment_text); echo $comment_text; } +/** + * Retrieve all of the post categories, formatted for use in feeds. + * + * All of the categories for the current post in the feed loop, will be + * retrieved and have feed markup added, so that they can easily be added to the + * RSS2, Atom, or RSS1 and RSS0.91 RDF feeds. + * + * @package WordPress + * @subpackage Feed + * @since 2.1.0 + * @uses apply_filters() + * + * @param string $type Optional, default is 'rss'. Either 'rss', 'atom', or 'rdf'. + * @return string All of the post categories for displaying in the feed. + */ function get_the_category_rss($type = 'rss') { $categories = get_the_category(); $tags = get_the_tags(); @@ -142,10 +343,29 @@ function get_the_category_rss($type = 'rss') { return apply_filters('the_category_rss', $the_list, $type); } +/** + * Display the post categories in the feed. + * + * @package WordPress + * @subpackage Feed + * @since 0.71 + * @see get_the_category_rss() For better explanation. + * + * @param string $type Optional, default is 'rss'. Either 'rss', 'atom', or 'rdf'. + */ function the_category_rss($type = 'rss') { echo get_the_category_rss($type); } +/** + * Display the HTML type based on the blog setting. + * + * The two possible values are either 'xhtml' or 'html'. + * + * @package WordPress + * @subpackage Feed + * @since 2.2.0 + */ function html_type_rss() { $type = get_bloginfo('html_type'); if (strpos($type, 'xhtml') !== false) @@ -155,7 +375,24 @@ function html_type_rss() { echo $type; } - +/** + * Display the rss enclosure for the current post. + * + * Uses the global $post to check whether the post requires a password and if + * the user has the password for the post. If not then it will return before + * displaying. + * + * Also uses the function get_post_custom() to get the post's 'enclosure' + * metadata field and parses the value to display the enclosure(s). The + * enclosure(s) consist of enclosure HTML tag(s) with a URI and other + * attributes. + * + * @package WordPress + * @subpackage Template + * @since 1.5.0 + * @uses apply_filters() Calls 'rss_enclosure' hook on rss enclosure. + * @uses get_post_custom() To get the current post enclosure metadata. + */ function rss_enclosure() { global $post; if ( !empty($post->post_password) && (!isset($_COOKIE['wp-postpass_'.COOKIEHASH]) || $_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) @@ -171,6 +408,23 @@ function rss_enclosure() { } } +/** + * Display the atom enclosure for the current post. + * + * Uses the global $post to check whether the post requires a password and if + * the user has the password for the post. If not then it will return before + * displaying. + * + * Also uses the function get_post_custom() to get the post's 'enclosure' + * metadata field and parses the value to display the enclosure(s). The + * enclosure(s) consist of link HTML tag(s) with a URI and other attributes. + * + * @package WordPress + * @subpackage Template + * @since 2.2.0 + * @uses apply_filters() Calls 'atom_enclosure' hook on atom enclosure. + * @uses get_post_custom() To get the current post enclosure metadata. + */ function atom_enclosure() { global $post; if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) @@ -187,7 +441,7 @@ function atom_enclosure() { } /** - * prep_atom_text_construct() - Determine the type of a given string of data + * Determine the type of a string of data with the data formatted. * * Tell whether the type is text, html, or xhtml, per RFC 4287 section 3.1. * @@ -202,8 +456,8 @@ function atom_enclosure() { * @subpackage Feed * @since 2.5 * - * @param string $data input string - * @return array $result array(type, value) + * @param string $data Input string + * @return array array(type, value) */ function prep_atom_text_construct($data) { if (strpos($data, '<') === false && strpos($data, '&') === false) { @@ -232,14 +486,13 @@ function prep_atom_text_construct($data) { } /** - * self_link() - Generate a correct link for the atom:self elemet + * Display the link for the currently displayed feed in a XSS safe way. * - * Echo the link for the currently displayed feed in a XSS safe way. + * Generate a correct link for the atom:self element. * * @package WordPress * @subpackage Feed * @since 2.5 - * */ function self_link() { echo 'http' @@ -248,4 +501,4 @@ function self_link() { . wp_specialchars(stripslashes($_SERVER['REQUEST_URI']), 1); } -?> +?> \ No newline at end of file diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 052445d1..eeafe0b4 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -3,6 +3,7 @@ function wptexturize($text) { global $wp_cockneyreplace; $next = true; + $has_pre_parent = false; $output = ''; $curl = ''; $textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); @@ -26,13 +27,17 @@ function wptexturize($text) { for ( $i = 0; $i < $stop; $i++ ) { $curl = $textarr[$i]; - if (isset($curl{0}) && '<' != $curl{0} && '[' != $curl{0} && $next) { // If it's not a tag + if (isset($curl{0}) && '<' != $curl{0} && '[' != $curl{0} && $next && !$has_pre_parent) { // If it's not a tag // static strings $curl = str_replace($static_characters, $static_replacements, $curl); // regular expressions $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); - } elseif (strpos($curl, '') !== false) { + $has_pre_parent = false; } else { $next = true; } @@ -327,6 +332,9 @@ function sanitize_user( $username, $strict = false ) { if ( $strict ) $username = preg_replace('|[^a-z0-9 _.\-@]|i', '', $username); + // Consolidate contiguous whitespace + $username = preg_replace('|\s+|', ' ', $username); + return apply_filters('sanitize_user', $username, $raw_username, $strict); } @@ -839,6 +847,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(']]>', ']]>', $text); $text = strip_tags($text); @@ -1121,13 +1132,9 @@ function wp_richedit_pre($text) { // Filtering a blank results in an annoying
      \n if ( empty($text) ) return apply_filters('richedit_pre', ''); - $output = $text; - $output = convert_chars($output); + $output = convert_chars($text); $output = wpautop($output); - - // These must be double-escaped or planets will collide. - $output = str_replace('<', '&lt;', $output); - $output = str_replace('>', '&gt;', $output); + $output = htmlspecialchars($output, ENT_NOQUOTES); return apply_filters('richedit_pre', $output); } diff --git a/wp-includes/functions.php b/wp-includes/functions.php index e011d340..fb3aaf0f 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1,5 +1,27 @@ month ) ) && ( !empty( $wp_locale->weekday ) ) ) { $datemonth = $wp_locale->get_month( date( 'm', $i ) ); $datemonth_abbrev = $wp_locale->get_month_abbrev( $datemonth ); @@ -88,7 +140,15 @@ function date_i18n( $dateformatstring, $unixtimestamp ) { return $j; } - +/** + * Convert number to format based on the locale. + * + * @since 2.3.0 + * + * @param mixed $number The number to convert based on locale. + * @param int $decimals Precision of the number of decimal places. + * @return string Converted number in string format. + */ function number_format_i18n( $number, $decimals = null ) { global $wp_locale; // let the user override the precision only @@ -97,10 +157,28 @@ function number_format_i18n( $number, $decimals = null ) { return number_format( $number, $decimals, $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] ); } - +/** + * Convert number of bytes largest unit bytes will fit into. + * + * It is easier to read 1kB than 1024 bytes and 1MB than 1048576 bytes. Converts + * number of bytes to human readable number by taking the number of that unit + * that the bytes will go into it. Supports TB value. + * + * Please note that integers in PHP are limited to 32 bits, unless they are on + * 64 bit architecture, then they have 64 bit size. If you need to place the + * larger size then what PHP integer type will hold, then use a string. It will + * be converted to a double, which should always have 64 bit length. + * + * Technically the correct unit names for powers of 1024 are KiB, MiB etc. + * @link http://en.wikipedia.org/wiki/Byte + * + * @since 2.3.0 + * + * @param int|string $bytes Number of bytes. Note max integer size for integers. + * @param int $decimals Precision of number of decimal places. + * @return unknown + */ function size_format( $bytes, $decimals = null ) { - // technically the correct unit names for powers of 1024 are KiB, MiB etc - // see http://en.wikipedia.org/wiki/Byte $quant = array( // ========================= Origin ==== 'TB' => 1099511627776, // pow( 1024, 4) @@ -144,7 +222,14 @@ function get_weekstartend( $mysqlstring, $start_of_week = '' ) { return $week; } - +/** + * Unserialize value only if it was serialized. + * + * @since 2.0.0 + * + * @param string $original Maybe unserialized original, if is needed. + * @return mixed Unserialized data can be any type. + */ function maybe_unserialize( $original ) { if ( is_serialized( $original ) ) // don't attempt to unserialize data that wasn't serialized going in if ( false !== $gm = @unserialize( $original ) ) @@ -152,7 +237,17 @@ function maybe_unserialize( $original ) { return $original; } - +/** + * Check value to find if it was serialized. + * + * If $data is not an string, then returned value will always be false. + * Serialized data is always a string. + * + * @since 2.0.5 + * + * @param mixed $data Value to check to see if was serialized. + * @return bool False if not serialized and true if it was. + */ function is_serialized( $data ) { // if it isn't a string, it isn't serialized if ( !is_string( $data ) ) @@ -179,7 +274,14 @@ function is_serialized( $data ) { return false; } - +/** + * Check whether serialized data is of string type. + * + * @since 2.0.5 + * + * @param mixed $data Serialized data + * @return bool False if not a serialized string, true if it is. + */ function is_serialized_string( $data ) { // if it isn't a string, it isn't a serialized string if ( !is_string( $data ) ) @@ -190,10 +292,33 @@ function is_serialized_string( $data ) { return false; } - -/* Options functions */ - -// expects $setting to already be SQL-escaped +/** + * Retrieve option value based on setting name. + * + * If the option does not exist or does not have a value, then the return value + * will be false. This is useful to check whether you need to install an option + * and is commonly used during installation of plugin options and to test + * whether upgrading is required. + * + * You can "short-circuit" the retrieval of the option from the database for + * your plugin or core options that aren't protected. You can do so by hooking + * into the 'pre_option_$option' with the $option being replaced by the option + * name. You should not try to override special options, but you will not be + * prevented from doing so. + * + * There is a second filter called 'option_$option' with the $option being + * replaced with the option name. This gives the value as the only parameter. + * + * @since 1.5.0 + * @package WordPress + * @subpackage Option + * @uses apply_filters() Calls 'pre_option_$optionname' false to allow + * overwriting the option value in a plugin. + * @uses apply_filters() Calls 'option_$optionname' with the option name value. + * + * @param string $setting Name of option to retrieve. Should already be SQL-escaped + * @return mixed Value set for the option. + */ function get_option( $setting ) { global $wpdb; @@ -216,7 +341,7 @@ function get_option( $setting ) { if ( false === $value ) { if ( defined( 'WP_INSTALLING' ) ) - $supress = $wpdb->suppress_errors(); + $suppress = $wpdb->suppress_errors(); // expected_slashed ($setting) $row = $wpdb->get_row( "SELECT option_value FROM $wpdb->options WHERE option_name = '$setting' LIMIT 1" ); if ( defined( 'WP_INSTALLING' ) ) @@ -243,17 +368,52 @@ function get_option( $setting ) { return apply_filters( 'option_' . $setting, maybe_unserialize( $value ) ); } - +/** + * Protect WordPress special option from being modified. + * + * Will die if $option is in protected list. + * + * @since 2.2.0 + * @package WordPress + * @subpackage Option + * + * @param string $option Option name. + */ function wp_protect_special_option( $option ) { $protected = array( 'alloptions', 'notoptions' ); if ( in_array( $option, $protected ) ) die( sprintf( __( '%s is a protected WP option and may not be modified' ), wp_specialchars( $option ) ) ); } +/** + * Print option value after sanitizing for forms. + * + * @uses attribute_escape Sanitizes value. + * @since 1.5.0 + * @package WordPress + * @subpackage Option + * + * @param string $option Option name. + */ function form_option( $option ) { echo attribute_escape (get_option( $option ) ); } +/** + * Retrieve all autoload options or all options, if no autoloaded ones exist. + * + * This is different from wp_load_alloptions(), in this that function does not + * cache all options and will retrieve all options from the database every time + * it is called. + * + * @since 1.0.0 + * @package WordPress + * @subpackage Option + * @uses apply_filters() Calls 'pre_option_$optionname' hook with option value as parameter. + * @uses apply_filters() Calls 'all_options' on options list. + * + * @return array List of all options. + */ function get_alloptions() { global $wpdb, $wp_queries; $show = $wpdb->hide_errors(); @@ -264,7 +424,7 @@ function get_alloptions() { foreach ( $options as $option ) { // "When trying to design a foolproof system, // never underestimate the ingenuity of the fools :)" -- Dougal - if ( in_array( $option->option_name, array( 'siteurl', 'home', 'category_base' ) ) ) + if ( in_array( $option->option_name, array( 'siteurl', 'home', 'category_base', 'tag_base' ) ) ) $option->option_value = untrailingslashit( $option->option_value ); $value = maybe_unserialize( $option->option_value ); $all_options->{$option->option_name} = apply_filters( 'pre_option_' . $option->option_name, $value ); @@ -272,7 +432,18 @@ function get_alloptions() { return apply_filters( 'all_options', $all_options ); } - +/** + * Loads and caches all autoloaded options, if available or all options. + * + * This is different from get_alloptions(), in that this function will cache the + * options and will return the cached options when called again. + * + * @since 2.2.0 + * @package WordPress + * @subpackage Option + * + * @return array List all options. + */ function wp_load_alloptions() { global $wpdb; @@ -291,8 +462,26 @@ function wp_load_alloptions() { return $alloptions; } - -// expects $option_name to NOT be SQL-escaped +/** + * Update the value of an option that was already added. + * + * If the option does not exist, then the option will be added with the option + * value, but you will not be able to set whether it is autoloaded. If you want + * to set whether an option autoloaded, then you need to use the add_option(). + * + * When the option is updated, then the filter named + * 'update_option_$option_name', with the $option_name as the $option_name + * parameter value, will be called. The hook should accept two parameters, the + * first is the old parameter and the second is the new parameter. + * + * @since 1.0.0 + * @package WordPress + * @subpackage Option + * + * @param string $option_name Option name. Expected to not be SQL-escaped + * @param mixed $newvalue Option value. + * @return bool False if value was not updated and true if value was updated. + */ function update_option( $option_name, $newvalue ) { global $wpdb; @@ -301,8 +490,11 @@ function update_option( $option_name, $newvalue ) { $safe_option_name = $wpdb->escape( $option_name ); $newvalue = sanitize_option( $option_name, $newvalue ); - // If the new and old values are the same, no need to update. $oldvalue = get_option( $safe_option_name ); + + $newvalue = apply_filters( 'pre_update_option_' . $option_name, $newvalue, $oldvalue ); + + // If the new and old values are the same, no need to update. if ( $newvalue === $oldvalue ) return false; @@ -336,9 +528,30 @@ function update_option( $option_name, $newvalue ) { return false; } - -// thx Alex Stapleton, http://alex.vort-x.net/blog/ -// expects $name to NOT be SQL-escaped +/** + * Add a new option. + * + * You can create options without values and then add values later. Does not + * check whether the option has already been added, but does check that you + * aren't adding a protected WordPress option. Care should be taken to not name + * options, the same as the ones which are protected and to not add options + * that were already added. + * + * The filter named 'add_option_$optionname', with the $optionname being + * replaced with the option's name, will be called. The hook should accept two + * parameters, the first is the option name, and the second is the value. + * + * @package WordPress + * @subpackage Option + * @since 1.0.0 + * @link http://alex.vort-x.net/blog/ Thanks Alex Stapleton + * + * @param string $name Option name to add. Expects to NOT be SQL escaped. + * @param mixed $value Optional. Option value, can be anything. + * @param mixed $deprecated Optional. Description. Not used anymore. + * @param bool $autoload Optional. Default is enabled. Whether to load the option when WordPress starts up. + * @return null returns when finished. + */ function add_option( $name, $value = '', $deprecated = '', $autoload = 'yes' ) { global $wpdb; @@ -372,11 +585,20 @@ function add_option( $name, $value = '', $deprecated = '', $autoload = 'yes' ) { $wpdb->query( $wpdb->prepare( "INSERT INTO $wpdb->options (option_name, option_value, autoload) VALUES (%s, %s, %s)", $name, $value, $autoload ) ); - do_action( "add_option_{$name}", $name, $value ); + do_action( "add_option_{$name}", $name, $value ); return; } - +/** + * Removes option by name and prevents removal of protected WordPress options. + * + * @package WordPress + * @subpackage Option + * @since unknown + * + * @param string $name Option name to remove. + * @return bool True, if succeed. False, if failure. + */ function delete_option( $name ) { global $wpdb; @@ -401,14 +623,19 @@ function delete_option( $name ) { return true; } - +/** + * Serialize data, if needed. + * + * @param mixed $data Data that might be serialized. + * @return mixed A scalar data + */ function maybe_serialize( $data ) { - if ( is_string( $data ) ) - $data = trim( $data ); - elseif ( is_array( $data ) || is_object( $data ) ) + if ( is_array( $data ) || is_object( $data ) ) return serialize( $data ); + if ( is_serialized( $data ) ) return serialize( $data ); + return $data; } @@ -465,7 +692,22 @@ function xmlrpc_removepostdata( $content ) { return $content; } - +/** + * Open the file handle for debugging. + * + * This function is used for XMLRPC feature, but it is general purpose enough + * to be used in anywhere. + * + * @see fopen() for mode options. + * @package WordPress + * @subpackage Debug + * @since unknown + * @uses $debug Used for whether debugging is enabled. + * + * @param string $filename File path to debug file. + * @param string $mode Same as fopen() mode parameter. + * @return bool|resource File handle. False on failure. + */ function debug_fopen( $filename, $mode ) { global $debug; if ( 1 == $debug ) { @@ -476,14 +718,39 @@ function debug_fopen( $filename, $mode ) { } } - +/** + * Write contents to the file used for debugging. + * + * Technically, this can be used to write to any file handle when the global + * $debug is set to 1 or true. + * + * @package WordPress + * @subpackage Debug + * @since unknown + * @uses $debug Used for whether debugging is enabled. + * + * @param resource $fp File handle for debugging file. + * @param string $string Content to write to debug file. + */ function debug_fwrite( $fp, $string ) { global $debug; if ( 1 == $debug ) fwrite( $fp, $string ); } - +/** + * Close the debugging file handle. + * + * Technically, this can be used to close any file handle when the global $debug + * is set to 1 or true. + * + * @package WordPress + * @subpackage Debug + * @since unknown + * @uses $debug Used for whether debugging is enabled. + * + * @param resource $fp Debug File handle. + */ function debug_fclose( $fp ) { global $debug; if ( 1 == $debug ) @@ -536,9 +803,19 @@ function do_enclose( $content, $post_ID ) { } } -// perform a HTTP HEAD or GET request -// if $file_path is a writable filename, this will do a GET request and write the file to that path -// returns a list of HTTP headers +/** + * Perform a HTTP HEAD or GET request. + * + * If $file_path is a writable filename, this will do a GET request and write + * the file to that path. + * + * @since unknown + * + * @param string $url + * @param string|bool $file_path Optional. File path to write request to. + * @param int $red Optional. Number of Redirects. Stops at 5 redirects. + * @return bool|string False on failure and string of headers if HEAD request. + */ function wp_get_http( $url, $file_path = false, $red = 1 ) { global $wp_version; @set_time_limit( 60 ); @@ -610,11 +887,30 @@ function wp_get_http( $url, $file_path = false, $red = 1 ) { return $headers; } +/** + * Retrieve HTTP Headers from URL. + * + * @since 1.5.1 + * + * @param string $url + * @param int $red Optional. Number of redirects. + * @return bool|string False on failure, headers on success. + */ function wp_get_http_headers( $url, $red = 1 ) { return wp_get_http( $url, false, $red ); } - +/** + * Whether today is a new day. + * + * {@internal Need to find out how this function is used.}} + * + * @since 0.71 + * @uses $day Today + * @uses $previousday Previous day + * + * @return int 1 when new day, 0 if not a new day. + */ function is_new_day() { global $day, $previousday; if ( $day != $previousday ) @@ -623,22 +919,42 @@ function is_new_day() { return 0; } - +/** + * Build URL query based on an associative and, or indexed array. + * + * This is a convenient function for easily building url queries. It sets the + * separator to '&' and uses _http_build_query() function. + * + * @see _http_build_query() Used to build the query + * @link http://us2.php.net/manual/en/function.http-build-query.php more on what + * http_build_query() does. + * + * @since unknown + * + * @param array $data URL-encode key/value pairs. + * @return string URL encoded string + */ function build_query( $data ) { return _http_build_query( $data, NULL, '&', '', false ); } - -/* -add_query_arg: Returns a modified querystring by adding -a single key & value or an associative array. -Setting a key value to emptystring removes the key. -Omitting oldquery_or_uri uses the $_SERVER value. - -Parameters: -add_query_arg(newkey, newvalue, oldquery_or_uri) or -add_query_arg(associative_array, oldquery_or_uri) -*/ +/** + * Retrieve a modified URL query string. + * + * You can rebuild the URL and append a new query variable to the URL query by + * using this function. You can also retrieve the full URL with query data. + * + * Adding a single key & value or an associative array. Setting a key value to + * emptystring removes the key. Omitting oldquery_or_uri uses the $_SERVER + * value. + * + * @since 1.5.0 + * + * @param mixed $param1 Either newkey or an associative_array + * @param mixed $param2 Either newvalue or oldquery or uri + * @param mixed $param3 Optional. Old query or uri + * @return unknown + */ function add_query_arg() { $ret = ''; if ( is_array( func_get_arg(0) ) ) { @@ -704,27 +1020,32 @@ function add_query_arg() { return $ret; } - -/* -remove_query_arg: Returns a modified querystring by removing -a single key or an array of keys. -Omitting oldquery_or_uri uses the $_SERVER value. - -Parameters: -remove_query_arg(removekey, [oldquery_or_uri]) or -remove_query_arg(removekeyarray, [oldquery_or_uri]) -*/ - -function remove_query_arg( $key, $query=FALSE ) { +/** + * Removes an item or list from the query string. + * + * @since 1.5.0 + * + * @param string|array $key Query key or keys to remove. + * @param bool $query When false uses the $_SERVER value. + * @return unknown + */ +function remove_query_arg( $key, $query=false ) { if ( is_array( $key ) ) { // removing multiple keys foreach ( (array) $key as $k ) - $query = add_query_arg( $k, FALSE, $query ); + $query = add_query_arg( $k, false, $query ); return $query; } - return add_query_arg( $key, FALSE, $query ); + return add_query_arg( $key, false, $query ); } - +/** + * Walks the array while sanitizing the contents. + * + * @uses $wpdb Used to sanitize values + * + * @param array $array Array to used to walk while sanitizing contents. + * @return array Sanitized $array. + */ function add_magic_quotes( $array ) { global $wpdb; @@ -738,6 +1059,17 @@ function add_magic_quotes( $array ) { return $array; } +/** + * HTTP request for URI to retrieve content. + * + * Tries to retrieve the HTTP content with fopen first and then using cURL, if + * fopen can't be used. + * + * @since unknown + * + * @param string $uri URI/URL of web page to retrieve. + * @return string HTTP content. + */ function wp_remote_fopen( $uri ) { $timeout = 10; $parsed_url = @parse_url( $uri ); @@ -782,7 +1114,14 @@ function wp( $query_vars = '' ) { $wp_the_query = $wp_query; } - +/** + * Retrieve the description for the HTTP status. + * + * @since 2.3.0 + * + * @param int $code HTTP status code. + * @return string Empty string if not found, or description if found. + */ function get_status_header_desc( $code ) { global $wp_header_to_desc; @@ -842,7 +1181,17 @@ function get_status_header_desc( $code ) { return ''; } - +/** + * Set HTTP status header. + * + * @since unknown + * @uses apply_filters() Calls 'status_header' on status header string, HTTP + * HTTP code, HTTP code description, and protocol string as separate + * parameters. + * + * @param int $header HTTP status code + * @return null Does not return anything. + */ function status_header( $header ) { $text = get_status_header_desc( $header ); @@ -862,7 +1211,14 @@ function status_header( $header ) { return @header( $status_header ); } - +/** + * Sets the headers to prevent caching for the different browsers. + * + * Different browsers support different nocache headers, so several headers must + * be sent so that all of them get the point that no caching should occur. + * + * @since 2.0.0 + */ function nocache_headers() { // why are these @-silenced when other header calls aren't? @header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' ); @@ -871,7 +1227,11 @@ function nocache_headers() { @header( 'Pragma: no-cache' ); } - +/** + * Set the headers for caching for 10 days with JavaScript content type. + * + * @since 2.1.0 + */ function cache_javascript_headers() { $expiresOffset = 864000; // 10 days header( "Content-Type: text/javascript; charset=" . get_bloginfo( 'charset' ) ); @@ -879,13 +1239,26 @@ function cache_javascript_headers() { header( "Expires: " . gmdate( "D, d M Y H:i:s", time() + $expiresOffset ) . " GMT" ); } - +/** + * Retrieve the number of database queries during the WordPress execution. + * + * @since 2.0.0 + * + * @return int Number of database queries + */ function get_num_queries() { global $wpdb; return $wpdb->num_queries; } - +/** + * Whether input is yes or no. Must be 'y' to be true. + * + * @since 1.0.0 + * + * @param string $yn Character string containing either 'y' or 'n' + * @return bool True if yes, false on anything else + */ function bool_from_yn( $yn ) { return ( strtolower( $yn ) == 'y' ); } @@ -911,17 +1284,31 @@ function do_feed() { do_action( $hook, $wp_query->is_comment_feed ); } - +/** + * Load the RDF RSS 0.91 Feed template. + * + * @since 2.1.0 + */ function do_feed_rdf() { load_template( ABSPATH . WPINC . '/feed-rdf.php' ); } - +/** + * Load the RSS 1.0 Feed Template + * + * @since 2.1.0 + */ function do_feed_rss() { load_template( ABSPATH . WPINC . '/feed-rss.php' ); } - +/** + * Load either the RSS2 comment feed or the RSS2 posts feed. + * + * @since 2.1.0 + * + * @param bool $for_comments True for the comment feed, false for normal feed. + */ function do_feed_rss2( $for_comments ) { if ( $for_comments ) load_template( ABSPATH . WPINC . '/feed-rss2-comments.php' ); @@ -929,7 +1316,13 @@ function do_feed_rss2( $for_comments ) { load_template( ABSPATH . WPINC . '/feed-rss2.php' ); } - +/** + * Load either Atom comment feed or Atom posts feed. + * + * @since 2.1.0 + * + * @param bool $for_comments True for the comment feed, false for normal feed. + */ function do_feed_atom( $for_comments ) { if ($for_comments) load_template( ABSPATH . WPINC . '/feed-atom-comments.php'); @@ -937,6 +1330,15 @@ function do_feed_atom( $for_comments ) { load_template( ABSPATH . WPINC . '/feed-atom.php' ); } +/** + * Display the robot.txt file content. + * + * The echo content should be with usage of the permalinks or for creating the + * robot.txt file. + * + * @since 2.1.0 + * @uses do_action() Calls 'do_robotstxt' hook for displaying robot.txt rules. + */ function do_robots() { header( 'Content-Type: text/plain; charset=utf-8' ); @@ -1079,22 +1481,30 @@ function path_join( $base, $path ) { 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'; - $dir = $upload_path; + $upload_path = trim($upload_path); + if ( empty($upload_path) ) + $dir = WP_CONTENT_DIR . '/uploads'; + else + $dir = $upload_path; // $dir is absolute, $path is (maybe) relative to ABSPATH - $dir = path_join( ABSPATH, $upload_path ); - $path = str_replace( ABSPATH, '', trim( $upload_path ) ); - - if ( !$url = get_option( 'upload_url_path' ) ) - $url = trailingslashit( $siteurl ) . $path; + $dir = path_join( ABSPATH, $dir ); + + if ( !$url = get_option( 'upload_url_path' ) ) { + if ( empty($upload_path) or ( $upload_path == $dir ) ) + $url = WP_CONTENT_URL . '/uploads'; + else + $url = trailingslashit( $siteurl ) . $upload_path; + } if ( defined('UPLOADS') ) { $dir = ABSPATH . UPLOADS; $url = trailingslashit( $siteurl ) . UPLOADS; } + $bdir = $dir; + $burl = $url; + $subdir = ''; if ( get_option( 'uploads_use_yearmonth_folders' ) ) { // Generate the yearly and monthly dirs @@ -1113,8 +1523,9 @@ function wp_upload_dir( $time = NULL ) { $message = sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), $dir ); return array( 'error' => $message ); } + + $uploads = array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'basedir' => $bdir, 'baseurl' => $burl, 'error' => false ); - $uploads = array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'error' => false ); return apply_filters( 'upload_dir', $uploads ); } @@ -1511,7 +1922,18 @@ function smilies_init() { } } - +/** + * Merge user defined arguments into defaults array. + * + * This function is used throughout WordPress to allow for both string or array + * to be merged into another array. + * + * @since 2.2.0 + * + * @param string|array $args Value to merge with $defaults + * @param array $defaults Array that serves as the defaults. + * @return array Merged user defined values with defaults. + */ function wp_parse_args( $args, $defaults = '' ) { if ( is_object( $args ) ) $r = get_object_vars( $args ); @@ -1525,7 +1947,15 @@ function wp_parse_args( $args, $defaults = '' ) { return $r; } - +/** + * Determines if Widgets library should be loaded. + * + * Checks to make sure that the widgets library hasn't already been loaded. If + * it hasn't, then it will load the widgets library and run an action hook. + * + * @since 2.2.0 + * @uses add_action() Calls '_admin_menu' hook with 'wp_widgets_add_menu' value. + */ function wp_maybe_load_widgets() { if ( !function_exists( 'dynamic_sidebar' ) ) { require_once( ABSPATH . WPINC . '/widgets.php' ); @@ -1533,43 +1963,67 @@ function wp_maybe_load_widgets() { } } - +/** + * Append the Widgets menu to the themes main menu. + * + * @since 2.2.0 + * @uses $submenu The administration submenu list. + */ function wp_widgets_add_menu() { global $submenu; $submenu['themes.php'][7] = array( __( 'Widgets' ), 'switch_themes', 'widgets.php' ); ksort( $submenu['themes.php'], SORT_NUMERIC ); } - -// For PHP 5.2, make sure all output buffers are flushed -// before our singletons our destroyed. +/** + * Flush all output buffers for PHP 5.2. + * + * Make sure all output buffers are flushed before our singletons our destroyed. + * + * @since 2.2.0 + */ function wp_ob_end_flush_all() { while ( @ob_end_flush() ); } - -/* - * require_wp_db() - require_once the correct database class file. +/** + * Load the correct database class file. * - * This function is used to load the database class file either at runtime or by wp-admin/setup-config.php - * We must globalise $wpdb to ensure that it is defined globally by the inline code in wp-db.php + * This function is used to load the database class file either at runtime or by + * wp-admin/setup-config.php We must globalise $wpdb to ensure that it is + * defined globally by the inline code in wp-db.php. * - * @global $wpdb + * @since 2.5 + * @global $wpdb WordPress Database Object */ 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' ); } +/** + * Load custom DB error or display WordPress DB error. + * + * If a file exists in the wp-content directory named db-error.php, then it will + * be loaded instead of displaying the WordPress DB error. If it is not found, + * then the WordPress DB error will be displayed instead. + * + * The WordPress DB error sets the HTTP status header to 500 to try to prevent + * search engines from caching the message. Custom DB messages should do the + * same. + * + * @since 2.5 + * @uses $wpdb + */ 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(); } @@ -1598,7 +2052,10 @@ function dead_db() { } /** - * Converts input to an absolute integer + * Converts value to positive integer. + * + * @since 2.5 + * * @param mixed $maybeint data you wish to have convered to an absolute integer * @return int an absolute integer */ @@ -1607,8 +2064,14 @@ function absint( $maybeint ) { } /** - * Determines if the blog can be accessed over SSL - * @return bool whether of not SSL access is available + * Determines if the blog can be accessed over SSL. + * + * Determines if blog can be accessed over SSL by using cURL to access the site + * using the https in the siteurl. Requires cURL extension to work correctly. + * + * @since 2.5 + * + * @return bool Whether or not SSL access is available */ function url_is_accessable_via_ssl($url) { @@ -1633,21 +2096,31 @@ function url_is_accessable_via_ssl($url) return false; } +/** + * Secure URL, if available or the given URL. + * + * @since 2.5 + * + * @param string $url Complete URL path with transport. + * @return string Secure or regular URL path. + */ function atom_service_url_filter($url) { if ( url_is_accessable_via_ssl($url) ) - return preg_replace( '/^http:\/\//', 'https://', $url ); + return preg_replace( '/^http:\/\//', 'https://', $url ); else return $url; } /** - * _deprecated_function() - Marks a function as deprecated and informs when it has been used. + * Marks a function as deprecated and informs when it has been used. * - * There is a hook deprecated_function_run that will be called that can be used to get the backtrace - * up to what file and function called the deprecated function. + * There is a hook deprecated_function_run that will be called that can be used + * to get the backtrace up to what file and function called the deprecated + * function. * - * The current behavior is to trigger an user error if WP_DEBUG is defined and is true. + * The current behavior is to trigger an user error if WP_DEBUG is defined and + * is true. * * This function is to be used in every function in depreceated.php * @@ -1670,19 +2143,21 @@ 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 deprecated since version %2$s! Use %3$s instead."), $function, $version, $replacement ) ); + trigger_error( sprintf( __('%1$s is deprecated since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) ); else - trigger_error( printf( __("%1$s is deprecated since version %2$s with no alternative available."), $function, $version ) ); + trigger_error( sprintf( __('%1$s is deprecated since version %2$s with no alternative available.'), $function, $version ) ); } } /** - * _deprecated_file() - Marks a file as deprecated and informs when it has been used. + * Marks a file as deprecated and informs when it has been used. * - * There is a hook deprecated_file_included that will be called that can be used to get the backtrace - * up to what file and function included the deprecated file. + * There is a hook deprecated_file_included that will be called that can be used + * to get the backtrace up to what file and function included the deprecated + * file. * - * The current behavior is to trigger an user error if WP_DEBUG is defined and is true. + * The current behavior is to trigger an user error if WP_DEBUG is defined and + * is true. * * This function is to be used in every file that is depreceated * @@ -1705,14 +2180,16 @@ 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 deprecated since version %2$s! Use %3$s instead."), $file, $version, $replacement ) ); + trigger_error( sprintf( __('%1$s is deprecated since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) ); else - trigger_error( printf( __("%1$s is deprecated since version %2$s with no alternative available."), $file, $version ) ); + trigger_error( sprintf( __('%1$s is deprecated since version %2$s with no alternative available.'), $file, $version ) ); } } /** - * is_lighttpd_before_150() - Is the server running earlier than 1.5.0 version of lighttpd + * Is the server running earlier than 1.5.0 version of lighttpd + * + * @since unknown * * @return bool Whether the server is running lighttpd < 1.5.0 */ @@ -1723,7 +2200,9 @@ function is_lighttpd_before_150() { } /** - * apache_mod_loaded() - Does the specified module exist in the apache config? + * Does the specified module exist in the apache config? + * + * @since unknown * * @param string $mod e.g. mod_rewrite * @param bool $default The default return value if the module is not found @@ -1749,4 +2228,105 @@ function apache_mod_loaded($mod, $default = false) { return $default; } -?> +/** + * File validates against allowed set of defined rules. + * + * A return value of '1' means that the $file contains either '..' or './'. A + * return value of '2' means that the $file contains ':' after the first + * character. A return value of '3' means that the file is not in the allowed + * files list. + * + * @since 2.6 + * + * @param string $file File path. + * @param array $allowed_files List of allowed files. + * @return int 0 means nothing is wrong, greater than 0 means something was wrong. + */ +function validate_file( $file, $allowed_files = '' ) { + if ( false !== strpos( $file, '..' )) + return 1; + + if ( false !== strpos( $file, './' )) + return 1; + + if (':' == substr( $file, 1, 1 )) + return 2; + + if (!empty ( $allowed_files ) && (!in_array( $file, $allowed_files ) ) ) + return 3; + + return 0; +} + +/** + * Determine if SSL is used. + * + * @since 2.6 + * + * @return bool True if SSL, false if not used. + */ +function is_ssl() { + return ( isset($_SERVER['HTTPS']) && 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false; +} + +/** + * Whether SSL login should be forced. + * + * @since 2.6 + * + * @param string|bool $force Optional. + * @return bool True if forced, false if not forced. + */ +function force_ssl_login($force = '') { + static $forced; + + if ( '' != $force ) { + $old_forced = $forced; + $forced = $force; + return $old_forced; + } + + return $forced; +} + +/** + * Whether to force SSL used for the Administration Panels. + * + * @since 2.6 + * + * @param string|bool $force + * @return bool True if forced, false if not forced. + */ +function force_ssl_admin($force = '') { + static $forced; + + if ( '' != $force ) { + $old_forced = $forced; + $forced = $force; + return $old_forced; + } + + return $forced; +} + +/** + * Guess the URL for the site. + * + * Will remove wp-admin links to retrieve only return URLs not in the wp-admin + * directory. + * + * @since 2.6 + * + * @return string + */ +function wp_guess_url() { + if ( defined('WP_SITEURL') && '' != WP_SITEURL ) { + $url = WP_SITEURL; + } else { + $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; + $url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); + } + return $url; +} + +?> \ No newline at end of file diff --git a/wp-includes/functions.wp-scripts.php b/wp-includes/functions.wp-scripts.php new file mode 100644 index 00000000..87995a4b --- /dev/null +++ b/wp-includes/functions.wp-scripts.php @@ -0,0 +1,77 @@ +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 00000000..8a382826 --- /dev/null +++ b/wp-includes/functions.wp-styles.php @@ -0,0 +1,45 @@ +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 1b1baf30..1d070149 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 = '' . __('Log in') . ''; + $link = '' . __('Log in') . ''; else - $link = '' . __('Log out') . ''; + $link = '' . __('Log out') . ''; echo apply_filters('loginout', $link); } @@ -45,11 +45,11 @@ function wp_register( $before = '
    • ', $after = '
    • ' ) { if ( ! is_user_logged_in() ) { if ( get_option('users_can_register') ) - $link = $before . '' . __('Register') . '' . $after; + $link = $before . '' . __('Register') . '' . $after; else $link = ''; } else { - $link = $before . '' . __('Site Admin') . '' . $after; + $link = $before . '' . __('Site Admin') . '' . $after; } echo apply_filters('register', $link); @@ -233,6 +233,19 @@ function wp_title($sep = '»', $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 "; @@ -343,13 +356,17 @@ function get_archives_link($url, $text, $format = 'html', $before = '', $after = $url = clean_url($url); if ('link' == $format) - return "\t\n"; + $link_html = "\t\n"; elseif ('option' == $format) - return "\t\n"; + $link_html = "\t\n"; elseif ('html' == $format) - return "\t
    • $before$text$after
    • \n"; + $link_html = "\t
    • $before$text$after
    • \n"; else // custom - return "\t$before$text$after\n"; + $link_html = "\t$before$text$after\n"; + + $link_html = apply_filters( "get_archives_link", $link_html ); + + return $link_html; } @@ -810,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); } @@ -1110,34 +1127,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', "\n", $file ); - if ( 'rtl' == get_bloginfo( 'text_direction' ) ) { - $rtl = ( 'wp-admin' == $file ) ? 'rtl' : "$file-rtl"; - echo apply_filters( 'wp_admin_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', "\n", $file ); + if ( 'rtl' == get_bloginfo( 'text_direction' ) ) + echo apply_filters( 'wp_admin_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/images/blank.gif b/wp-includes/images/blank.gif new file mode 100644 index 0000000000000000000000000000000000000000..e565824aafafe632011b281cba976baf8b3ba89a GIT binary patch literal 43 qcmZ?wbhEHbWMp7uXkcLY4+e@qSs1y10y+#p0Fq%~V)9{Rum%7ZWeN!Z literal 0 HcmV?d00001 diff --git a/wp-includes/js/autosave.js b/wp-includes/js/autosave.js index b0a2fa56..ee0f3185 100644 --- a/wp-includes/js/autosave.js +++ b/wp-includes/js/autosave.js @@ -1,6 +1,8 @@ var autosaveLast = ''; var autosavePeriodical; var autosaveOldMessage = ''; +var autosaveDelayURL = null; +var previewwin; jQuery(function($) { autosaveLast = $('#post #title').val()+$('#post #content').val(); @@ -8,6 +10,16 @@ jQuery(function($) { //Disable autosave after the form has been submitted $("#post").submit(function() { $.cancel(autosavePeriodical); }); + + // Autosave when the preview button is clicked. + $('#previewview a').click(function(e) { + autosave(); + autosaveDelayURL = this.href; + previewwin = window.open('','_blank'); + + e.preventDefault(); + return false; + }); }); function autosave_parse_response(response) { @@ -96,6 +108,16 @@ function autosave_update_preview_link(post_id) { getpermalinknonce: jQuery('#getpermalinknonce').val() }, function(permalink) { jQuery('#previewview').html(''+previewText+''); + + // Autosave when the preview button is clicked. + jQuery('#previewview a').click(function(e) { + autosave(); + autosaveDelayURL = this.href; + previewwin = window.open('','_blank'); + + e.preventDefault(); + return false; + }); }); } } @@ -125,6 +147,10 @@ function autosave_loading() { function autosave_enable_buttons() { jQuery("#submitpost :button:disabled, #submitpost :submit:disabled").attr('disabled', ''); + if ( autosaveDelayURL ) { + previewwin.location = autosaveDelayURL; + autosaveDelayURL = null; + } } function autosave_disable_buttons() { @@ -154,8 +180,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 +199,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 +211,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.dimensions.min.js b/wp-includes/js/jquery/jquery.dimensions.min.js deleted file mode 100644 index 34c06dee..00000000 --- a/wp-includes/js/jquery/jquery.dimensions.min.js +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) - * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. - * - * $LastChangedDate: 2007-12-20 08:43:48 -0600 (Thu, 20 Dec 2007) $ - * $Rev: 4257 $ - * - * Version: 1.2 - * - * Requires: jQuery 1.2+ - */ -(function($){$.dimensions={version:'1.2'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr);};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase())+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0);};});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val;}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name];};});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return $(offsetParent);}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;};})(jQuery); \ No newline at end of file diff --git a/wp-includes/js/jquery/jquery.js b/wp-includes/js/jquery/jquery.js index f0fd6e43..c3dbc8c7 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(c35?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-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]*?)\\/>/g,J(b,a,c){K c.1D(/^(aa|a6|7e|a5|4D|7a|a0|3m|9W|9U|9S)$/i)?b:a+">"});L f=E.3g(d).2h(),1x=h.3s("1x");L e=!f.1f("<9P")&&[1,"<2k 74=\'74\'>",""]||!f.1f("<9M")&&[1,"<73>",""]||f.1D(/^<(9G|1U|9E|9B|9x)/)&&[1,"<1O>",""]||!f.1f("<4v")&&[2,"<1O><1U>",""]||(!f.1f("<9w")||!f.1f("<9v"))&&[3,"<1O><1U><4v>",""]||!f.1f("<7e")&&[2,"<1O><1U><6V>",""]||E.14.1d&&[1,"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*",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 im[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=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;i6.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(); \ No newline at end of file +eval(function(p,a,c,k,e,r){e=function(c){return(c35?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-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,H(b,a,c){I c.1I(/^(aN|43|7E|aH|4t|7z|aE|3A|aB|aA|az)$/i)?b:a+">"});J f=D.3l(d).3h(),1w=h.3t("1w");J e=!f.1i("",""]||!f.1i("",""]||f.1I(/^<(ar|22|ap|al|aj)/)&&[1,"<1X>",""]||!f.1i("<4H")&&[2,"<1X><22>",""]||(!f.1i("<22><4H>",""]||!f.1i("<7E")&&[2,"<1X><22><7p>",""]||D.14.1g&&[1,"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*",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 im[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=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;i7.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 d0f4578b..344008d7 100644 --- a/wp-includes/js/jquery/suggest.js +++ b/wp-includes/js/jquery/suggest.js @@ -1,5 +1,7 @@ /* - * jquery.suggest 1.1 - 2007-08-06 + * jquery.suggest 1.1b - 2007-08-06 + * Patched by Mark Jaquith with Alexander Dick's "multiple items" patch to allow for auto-suggesting of more than one tag before submitting + * See: http://www.vulgarisoip.com/2007/06/29/jquerysuggest-an-alternative-jquery-based-autocomplete-library/#comment-7228 * * Uses code and techniques from following libraries: * 1. http://www.dyve.net/jquery/?autocomplete @@ -113,6 +115,12 @@ var q = $.trim($input.val()); + if ( options.multiple ) { + var multipleSepPos = q.lastIndexOf(options.multipleSep); + if ( multipleSepPos != -1 ) { + q = q.substr(multipleSepPos + options.multipleSep.length); + } + } if (q.length >= options.minchars) { cached = checkCache(q); @@ -245,7 +253,17 @@ $currentResult = getCurrentResult(); if ($currentResult) { - $input.val($currentResult.text()); + if ( options.multiple ) { + if ( $input.val().indexOf(options.multipleSep) != -1 ) { + $currentVal = $input.val().substr( 0, ( $input.val().lastIndexOf(options.multipleSep) + options.multipleSep.length ) ); + } else { + $currentVal = ""; + } + $input.val( $currentVal + $currentResult.text() + options.multipleSep); + $input.focus(); + } else { + $input.val($currentResult.text()); + } $results.hide(); if (options.onSelect) @@ -291,6 +309,8 @@ return; options = options || {}; + options.multiple = options.multiple || false; + options.multipleSep = options.multipleSep || ", "; options.source = source; options.delay = options.delay || 100; options.resultsClass = options.resultsClass || 'ac_results'; diff --git a/wp-includes/js/jquery/ui.core.js b/wp-includes/js/jquery/ui.core.js new file mode 100644 index 00000000..c38b9206 --- /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(c35?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={2s:{1o:3(E,F,H){6 G=C.8[E].n;1v(6 D 2r H){G.w[D]=G.w[D]||[];G.w[D].2q([F,H[D]])}},1n:3(D,F,E){6 H=D.w[F];5(!H){4}1v(6 G=0;G\').1i(D).f({2l:"2k",12:"-1u",2j:"-1u",2i:"2h"}).2g("1t");C.8.o[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.o[D]},23:3(D){D.j="1g";D.1q=3(){4 7};5(D.v){D.v.1p="1r"}},22:3(D){D.j="21";D.1q=3(){4 d};5(D.v){D.v.1p=""}},20:3(G,E){6 D=/12/.h(E||"12")?"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.10.t;C.10.t=3(){C("*",2).1o(2).1X("t");4 B.u(2,1m)};3 A(E,F,G){6 D=C[E][F].1W||[];D=(W D=="V"?D.11(/,?\\s+/):D);4(C.1V(G,D)!=-1)}C.l=3(E,D){6 F=E.11(".")[0];E=E.11(".")[1];C.10[E]=3(J){6 H=(W J=="V"),I=1U.n.1T.1n(1m,1);5(H&&A(F,E,J)){6 G=C.Z(2[0],E);4(G?G[J].u(G,I):1S)}4 2.1R(3(){6 K=C.Z(2,E);5(H&&K&&C.1Q(K[J])){K[J].u(K,I)}1P{5(!H){C.Z(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({},C.l.p,C[F][E].p,H);2.c=C(I).g("m."+E,3(L,J,K){4 G.m(J,K)}).g("Y."+E,3(K,J){4 G.Y(J)}).g("t",3(){4 G.1j()});2.1k()};C[F][E].n=C.1l({},C.l.n,D)};C.l.n={1k:3(){},1j:3(){2.c.1N(2.e)},Y:3(D){4 2.a[D]},m:3(D,E){2.a[D]=E;5(D=="k"){2.c[E?"1i":"1M"](2.1h+"-k")}},1L:3(){2.m("k",7)},1K:3(){2.m("k",d)}};C.l.p={k:7};C.8.14={1J:3(){6 D=2;2.c.g("1I."+2.e,3(E){4 D.1e(E)});5(C.U.T){2.1f=2.c.X("j");2.c.X("j","1g")}2.1H=7},1G:3(){2.c.R("."+2.e);(C.U.T&&2.c.X("j",2.1f))},1e:3(F){(2.b&&2.i(F));2.r=F;6 E=2,G=(F.1F==1),D=(W 2.a.y=="V"?C(F.1E).1D(2.a.y):7);5(!G||D||!2.15(F)){4 d}2.q=!2.a.x;5(!2.q){2.1C=1B(3(){E.q=d},2.a.x)}5(2.P(F)&&2.N(F)){2.b=(2.M(F)!==7);5(!2.b){F.1A();4 d}}2.S=3(H){4 E.1d(H)};2.Q=3(H){4 E.i(H)};C(1c).g("1b."+2.e,2.S).g("1a."+2.e,2.Q);4 7},1d:3(D){5(C.U.T&&!D.1z){4 2.i(D)}5(2.b){2.z(D);4 7}5(2.P(D)&&2.N(D)){2.b=(2.M(2.r,D)!==7);(2.b?2.z(D):2.i(D))}4!2.b},i:3(D){C(1c).R("1b."+2.e,2.S).R("1a."+2.e,2.Q);5(2.b){2.b=7;2.16(D)}4 7},P:3(D){4(O.1y(O.18(2.r.19-D.19),O.18(2.r.17-D.17))>=2.a.13)},N:3(D){4 2.q},M:3(D){},z:3(D){},16:3(D){},15:3(D){4 d}};C.8.14.p={y:1x,13:1,x:0}})(1w)',62,153,'||this|function|return|if|var|false|ui||options|_mouseStarted|element|true|widgetName|css|bind|test|mouseUp|unselectable|disabled|widget|setData|prototype|cssCache|defaults|_mouseDelayMet|_mouseDownEvent||remove|apply|style|plugins|delay|cancel|mouseDrag|||||||||||||mouseStart|mouseDelayMet|Math|mouseDistanceMet|_mouseUpDelegate|unbind|_mouseMoveDelegate|msie|browser|string|typeof|attr|getData|data|fn|split|top|distance|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|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 00000000..c3f9d06c --- /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(c35?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.2U.3W&&B.2U.3V<3U;5(E.2T&&!C){d E.2T(D)}5(E.2S){d!!(E.2S(D)&16)}1R(D=D.1g){5(D==E){d U}}d w}B.3T("m.q",B.2h(B.m.3S,{3R:b(){9 C=4.8;4.P={};4.g.27("m-q");4.2L();4.13=4.c.z?(/6|25/).18(4.c[0].u.f("3Q")):w;5(!(/(2R|1t|3P)/).18(4.g.f("W"))){4.g.f("W","2R")}4.a=4.g.a();4.3O()},3N:{},m:b(C){d{k:(C||4)["k"],r:(C||4)["r"]||B([]),W:(C||4)["W"],3M:(C||4)["1c"],8:4.8,g:4.g,u:(C||4)["i"],3L:C?C.g:O}},v:b(F,E,C,D){B.m.1m.15(4,F,[E,4.m(C)]);5(!D){4.g.3K(F=="1C"?F:"1C"+F,[E,4.m(C)],4.8[F])}},2g:b(E){9 C=(B.1O(4.8.c)?4.8.c.15(4.g):B(4.8.c,4.g)).1Y(".m-q-k");9 D=[];E=E||{};C.1y(b(){9 F=(B(4).2O(E.3J||"2N")||"").3I(E.2P||(/(.+)[-=3H](.+)/));5(F){D.1z((E.2Q||F[1])+"[]="+(E.2Q&&E.2P?F[1]:F[2]))}});d D.3G("&")},2f:b(C){9 D=(B.1O(4.8.c)?4.8.c.15(4.g):B(4.8.c,4.g)).1Y(".m-q-k");9 E=[];D.1y(b(){E.1z(B(4).2O(C||"2N"))});d E},2G:b(J){9 E=4.1c.6,D=E+4.s.n,I=4.1c.7,H=I+4.s.o;9 F=J.6,C=F+J.n,K=J.7,G=K+J.o;5(4.8.1p=="2M"||(4.8.1p=="1V"&&4.s[4.13?"n":"o"]>J[4.13?"n":"o"])){d(I+4.a.p.7>K&&I+4.a.p.7F&&E+4.a.p.6J[4.13?"n":"o"])){5(!(I+4.a.p.7>K&&I+4.a.p.7F&&E+4.a.p.6F&&E+4.a.p.6F+J.n/2&&E+4.a.p.6K&&I+4.a.p.7K+J.o/2&&I+4.a.p.7F&&EC){d 1}}Z{5(H>K&&IG){d 2}}}d w},2L:b(){4.28();4.1I()},28:b(){4.c=[];4.e=[4];9 D=4.c;9 C=4;9 F=[[B.1O(4.8.c)?4.8.c.15(4.g,O,{8:4.8,u:4.i}):B(4.8.c,4.g),4]];5(4.8.2a){Q(9 G=4.8.2a.z-1;G>=0;G--){9 I=B(4.8.2a[G]);Q(9 E=I.z-1;E>=0;E--){9 H=B.1f(I[E],"q");5(H&&!H.8.29){F.1z([B.1O(H.8.c)?H.8.c.15(H.g):B(H.8.c,H.g),H]);4.e.1z(H)}}}}Q(9 G=F.z-1;G>=0;G--){F[G][0].1y(b(){B.1f(4,"q-u",F[G][1]);D.1z({u:B(4),2K:F[G][1],n:0,o:0,6:0,7:0})})}},1I:b(D){5(4.t){9 C=4.t.a();4.a.l={7:C.7+4.1w.7,6:C.6+4.1w.6}}Q(9 F=4.c.z-1;F>=0;F--){5(4.c[F].2K!=4.1x&&4.1x&&4.c[F].u[0]!=4.i[0]){1L}9 E=4.8.2J?B(4.8.2J,4.c[F].u):4.c[F].u;5(!D){4.c[F].n=E.1v();4.c[F].o=E.1u()}9 G=E.a();4.c[F].6=G.6;4.c[F].7=G.7}Q(9 F=4.e.z-1;F>=0;F--){9 G=4.e[F].g.a();4.e[F].P.6=G.6;4.e[F].P.7=G.7;4.e[F].P.n=4.e[F].g.1v();4.e[F].P.o=4.e[F].g.1u()}},3F:b(){4.g.3E("m-q m-q-29").2I("q").3D(".q");4.3C();Q(9 C=4.c.z-1;C>=0;C--){4.c[C].u.2I("q-u")}},26:b(E){9 C=E||4,F=C.8;5(F.r.3B==3A){9 D=F.r;F.r={g:b(){d B("<2H>").27(D)[0]},1q:b(G,H){H.f(G.a()).f({n:G.1v(),o:G.1u()})}}}C.r=B(F.r.g.15(C.g,C.i)).1o("T").f({W:"1t"});F.r.1q.15(C.g,C.i,C.r)},2s:b(F){Q(9 D=4.e.z-1;D>=0;D--){5(4.2G(4.e[D].P)){5(!4.e[D].P.1b){5(4.1x!=4.e[D]){9 I=3z;9 H=O;9 E=4.1c[4.e[D].13?"6":"7"];Q(9 C=4.c.z-1;C>=0;C--){5(!A(4.e[D].g[0],4.c[C].u[0])){1L}9 G=4.c[C][4.e[D].13?"6":"7"];5(1k.2F(G-E)=0;E--){4.e[E].v("3m",H,4)}}5(B.m.14){B.m.14.3l=4}5(B.m.14&&!J.2n){B.m.14.3k(4,H)}4.2j=U;4.2w(H);d U},2v:b(D,E){5(!E){E=4.W}9 C=D=="1t"?1:-1;d{7:(E.7+4.a.l.7*C-(4.t[0]==h.T?0:4.t[0].N)*C+4.V.7*C),6:(E.6+4.a.l.6*C-(4.t[0]==h.T?0:4.t[0].M)*C+4.V.6*C)}},22:b(F){9 G=4.8;9 C={7:(F.1e-4.a.p.7-4.a.l.7+(4.t[0]==h.T?0:4.t[0].N)),6:(F.1d-4.a.p.6-4.a.l.6+(4.t[0]==h.T?0:4.t[0].M))};5(!4.1j){d C}5(4.j){5(C.6<4.j[0]){C.6=4.j[0]}5(C.7<4.j[1]){C.7=4.j[1]}5(C.6>4.j[2]){C.6=4.j[2]}5(C.7>4.j[3]){C.7=4.j[3]}}5(G.11){9 E=4.1j.7+1k.2x((C.7-4.1j.7)/G.11[1])*G.11[1];C.7=4.j?(!(E<4.j[1]||E>4.j[3])?E:(!(E<4.j[1])?E-G.11[1]:E+G.11[1])):E;9 D=4.1j.6+1k.2x((C.6-4.1j.6)/G.11[0])*G.11[0];C.6=4.j?(!(D<4.j[0]||D>4.j[2])?D:(!(D<4.j[0])?D-G.11[0]:D+G.11[0])):D}d C},2w:b(D){4.W=4.22(D);4.1c=4.2v("1t");Q(9 C=4.c.z-1;C>=0;C--){9 E=4.2u(4.c[C]);5(!E){1L}5(4.c[C].u[0]!=4.i[0]&&4.i[E==1?"3j":"1r"]()[0]!=4.c[C].u[0]&&!A(4.i[0],4.c[C].u[0])&&(4.8.2t=="3i-3h"?!A(4.g[0],4.c[C].u[0]):U)){4.2p=E==1?"2o":"3g";4.1J(D,4.c[C]);4.v("21",D);3f}}4.2s(D);4.v("1C",D);5(!4.8.1K||4.8.1K=="x"){4.k[0].2r.6=4.W.6+"2q"}5(!4.8.1K||4.8.1K=="y"){4.k[0].2r.7=4.W.7+"2q"}5(B.m.14){B.m.14.3e(4,D)}d w},1J:b(H,G,D,F){D?D.3d(4.i):G.u[4.2p=="2o"?"3c":"3b"](4.i);4.1s=4.1s?++4.1s:1;9 E=4,C=4.1s;17.3a(b(){5(C==E.1s){E.1I(!F)}},0);5(4.8.r){4.8.r.1q.15(4.g,4.i,4.r)}},39:b(E,D){5(B.m.14&&!4.8.2n){B.m.14.38(4,E)}5(4.8.1Z){9 C=4;9 F=C.i.a();5(C.r){C.r.2m({19:"37"},(L(4.8.1Z,10)||2l)-36)}B(4.k).2m({6:F.6-4.a.l.6-C.V.6+(4.t[0]==h.T?0:4.t[0].M),7:F.7-4.a.l.7-C.V.7+(4.t[0]==h.T?0:4.t[0].N)},L(4.8.1Z,10)||2l,b(){C.1H(E)})}Z{4.1H(E,D)}d w},1H:b(E,D){5(4.1X.1r!=4.i.1r().1Y(".m-q-k")[0]||4.1X.l!=4.i.l()[0]){4.v("1q",E,O,D)}5(!A(4.g[0],4.i[0])){4.v("1G",E,O,D);Q(9 C=4.e.z-1;C>=0;C--){5(A(4.e[C].g[0],4.i[0])){4.e[C].v("1q",E,4,D);4.e[C].v("35",E,4,D)}}}Q(9 C=4.e.z-1;C>=0;C--){4.e[C].v("34",E,4,D);5(4.e[C].P.1b){4.e[C].v("2k",E,4);4.e[C].P.1b=0}}4.2j=w;5(4.33){4.v("1n",E,O,D);d w}B(4.i).f("2i","");5(4.r){4.r.1G()}4.k.1G();4.k=O;4.v("1n",E,O,D);d U}}));B.2h(B.m.q,{32:"2g 2f",31:{k:"1W",1p:"1V",30:1,2Z:0,1h:U,Y:20,X:20,2Y:":2X",c:"> *",1a:2W,2e:U,1o:"l"}});B.m.1m.1F("q","1i",{1l:b(E,D){9 C=B("T");5(C.f("1i")){D.8.1U=C.f("1i")}C.f("1i",D.8.1i)},1n:b(D,C){5(C.8.1U){B("T").f("1i",C.8.1U)}}});B.m.1m.1F("q","1a",{1l:b(E,D){9 C=D.k;5(C.f("1a")){D.8.1T=C.f("1a")}C.f("1a",D.8.1a)},1n:b(D,C){5(C.8.1T){B(C.k).f("1a",C.8.1T)}}});B.m.1m.1F("q","19",{1l:b(E,D){9 C=D.k;5(C.f("19")){D.8.1S=C.f("19")}C.f("19",D.8.19)},1n:b(D,C){5(C.8.1S){B(C.k).f("19",C.8.1S)}}});B.m.1m.1F("q","1h",{1l:b(E,D){9 F=D.8;9 C=B(4).1f("q");C.S=b(G){2d{5(/1E|1h/.18(G.f("1D"))||(/1E|1h/).18(G.f("1D-y"))){d G}G=G.l()}1R(G[0].1g);d B(h)}(C.i);C.R=b(G){2d{5(/1E|1h/.18(G.f("1D"))||(/1E|1h/).18(G.f("1D-x"))){d G}G=G.l()}1R(G[0].1g);d B(h)}(C.i);5(C.S[0]!=h&&C.S[0].1B!="1A"){C.1Q=C.S.a()}5(C.R[0]!=h&&C.R[0].1B!="1A"){C.1P=C.R.a()}},1C:b(E,D){9 F=D.8;9 C=B(4).1f("q");5(C.S[0]!=h&&C.S[0].1B!="1A"){5((C.1Q.7+C.S[0].2c)-E.1e35?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.v+=".3";2.1e(1c)},37:4(B,C){5((/^7/).1Z(B)){2.16(C)}n{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[o])",2.l);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.u&&Q.u.13("#","")){P.$b=P.$b.1b(Q.u)}n{5(A(Q).12("o")!="#"){A.e(Q,"o.3",Q.o);A.e(Q,"q.3",Q.o);6 T=P.1E(Q);Q.o="#"+T;6 S=A("#"+T);5(!S.i){S=A(D.1x).12("1f",T).m(D.18).32(P.$b[R-1]||P.l);S.e("1a.3",1c)}P.$b=P.$b.1b(S)}n{D.d.1U(R+1)}}});5(O){2.l.m(D.1w);2.$b.V(4(){6 Q=A(2);Q.m(D.18)});5(D.7===1p){5(1J.u){2.$3.V(4(S,Q){5(Q.u==1J.u){D.7=S;5(A.W.1g||A.W.31){6 R=A(1J.u),T=R.12("1f");R.12("1f","");1z(4(){R.12("1f",T)},30)}2Z(0,0);f p}})}n{5(D.Y){6 J=2Y(A.Y("8-3"+A.e(P.l)),10);5(J&&P.$3[J]){D.7=J}}n{5(P.$h.z("."+D.k).i){D.7=P.$h.Z(P.$h.z("."+D.k)[0])}}}}D.7=D.7===j||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.m(D.w);2.$h.r(D.k);5(D.7!==j){2.$b.t(D.7).1G().r(D.w);2.$h.t(D.7).m(D.k);6 K=4(){A(P.l).y("20",[j,P.8(P.$3[D.7],P.$b[D.7])],D.1G)};5(A.e(2.$3[D.7],"q.3")){2.q(D.7,K)}n{K()}}A(2U).15("2T",4(){P.$3.14(".3");P.$h=P.$3=P.$b=j})}2S(6 G=0,N;N=2.$h[G];G++){A(N)[A.1r(G,D.d)!=-1&&!A(N).11(D.k)?"m":"r"](D.U)}5(D.x===p){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}n{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.m(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.r(D.w).1d(H);5(A.W.1g&&I.1H){S[0].21.z=""}A(P.l).y("20",[j,P.8(R,S[0])],D.1G)})}4 F(R,T,Q,S){T.m(D.k).2K().r(D.k);M(R,Q,S)}2.$3.14(".3").15(D.v,4(){6 T=A(2).2J("1i:t(0)"),Q=P.$b.z(":2I"),S=A(2.u);5((T.11(D.k)&&!D.1h)||T.11(D.U)||A(2).11(D.17)||A(P.l).y("2H",[j,P.8(2,S[0])],D.16)===p){2.1t();f p}P.c.7=P.$3.Z(2);5(D.1h){5(T.11(D.k)){P.c.7=j;T.r(D.k);P.$b.1F();M(2,Q);2.1t();f p}n{5(!Q.i){P.$b.1F();6 R=2;P.q(P.$3.Z(2),4(){T.m(D.k).m(D.1v);L(R,S)});2.1t();f p}}}5(D.Y){A.Y("8-3"+A.e(P.l),P.c.7,D.Y)}P.$b.1F();5(S.i){6 R=2;P.q(P.$3.Z(2),Q.i?4(){F(R,T,Q,S)}:4(){T.m(D.k);L(R,S)})}n{2G"1K 2F 2E: 2D 2C 2B."}5(A.W.1g){2.1t()}f p});5(!(/^1y/).1Z(D.v)){2.$3.15("1y.3",4(){f p})}},1b:4(E,D,C){5(C==1p){C=2.$3.i}6 G=2.c;6 I=A(G.1P.13(/#\\{o\\}/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).m(G.w).e("1a.3",1c)}F.m(G.18);5(C>=2.$h.i){I.1Y(2.l);F.1Y(2.l[0].2x)}n{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.m(G.k);F.r(G.w);6 B=A.e(2.$3[0],"q.3");5(B){2.q(C,B)}}2.l.y("2w",[j,2.8(2.$3[C],2.$b[C])],G.1b)},19:4(B){6 D=2.c,E=2.$h.t(B).19(),C=2.$b.t(B).19();5(E.11(D.k)&&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.l.y("2v",[j,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.t(B).r(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.l.y("2s",[j,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.t(C).m(D.U);D.d.1U(C);D.d.1T();2.l.y("2r",[j,2.8(2.$3[C],2.$b[C])],D.1S)}},16:4(B){5(2q B=="2p"){B=2.$3.Z(2.$3.z("[o$="+B+"]")[0])}2.$3.t(B).2o(2.c.v)},q:4(G,K){6 L=2,D=2.c,E=2.$3.t(G),J=E[0],H=K==1p||K===p,B=E.e("q.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).r(D.17).V(4(){5(D.1l){M(2).2m().1o(M(2).e("1j.3"))}});L.1n=j};5(D.1l){6 I=M(J).1o();M(J).2l("<1B>").1C("1B").e("1j.3",I).1o(D.1l)}6 F=A.1L({},D.1k,{1R:B,1A:4(O,N){A(J.u).1o(O);C();5(D.x){A.e(J,"x.3",1c)}A(L.l).y("2k",[j,L.8(L.$3[G],L.$b[G])],D.q);D.1k.1A&&D.1k.1A(O,N);K()}});5(2.1n){2.1n.2j();C()}E.m(D.17);1z(4(){L.1n=A.2i(F)},0)},1R:4(C,B){2.$3.t(C).1m("x.3").e("q.3",B)},1a:4(){6 B=2.c;2.l.14(".3").r(B.1w).1m("3");2.$3.V(4(){6 C=A.e(2,"o.3");5(C){2.o=C}6 D=A(2).14(".3");A.V(["o","q","x"],4(E,F){D.1m(F+".3")})});2.$h.1b(2.$b).V(4(){5(A.e(2,"1a.3")){A(2).19()}n{A(2).r([B.k,B.1v,B.U,B.18,B.w].2h(" "))}})}});A.8.3.2g={1h:p,v:"1y",d:[],Y:j,1l:"2fe;",x:p,1Q:"8-3-",1k:{},X:j,1P:\'<1i><1O>#{1j}\',1x:"<1N>",1w:"8-3-2d",k:"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:j,28:4(C,F){F=F||p;6 B=2,E=2.c.7;4 G(){B.1u=27(4(){E=++E= 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…', - 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: '
    • #{text}
    • ', - panelTemplate: '
      ', - - // 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
    • - // 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('' + o.spinner + ''); - } - 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/swfupload/handlers.js b/wp-includes/js/swfupload/handlers.js index 92eb8ac8..75ce85c5 100644 --- a/wp-includes/js/swfupload/handlers.js +++ b/wp-includes/js/swfupload/handlers.js @@ -55,7 +55,7 @@ function prepareMediaItemInit(fileObj) { jQuery('#media-item-' + fileObj.id + ' .filename.original').replaceWith(jQuery('#media-item-' + fileObj.id + ' .filename.new')); // Also bind toggle to the links - jQuery('#media-item-' + fileObj.id + ' a.toggle').bind('click', function(){jQuery(this).siblings('.slidetoggle').slideToggle(150);jQuery(this).parent().eq(0).children('.toggle').toggle();jQuery(this).siblings('a.toggle').focus();return false;}); + jQuery('#media-item-' + fileObj.id + ' a.toggle').bind('click', function(){jQuery(this).siblings('.slidetoggle').slideToggle(150, function(){window.scrollTo(0,this.parentNode.offsetTop);});jQuery(this).parent().eq(0).children('.toggle').toggle();jQuery(this).siblings('a.toggle').focus();return false;}); // Bind AJAX to the new Delete button jQuery('#media-item-' + fileObj.id + ' a.delete').bind('click',function(){ diff --git a/wp-includes/js/thickbox/macFFBgHack.png b/wp-includes/js/thickbox/macFFBgHack.png new file mode 100644 index 0000000000000000000000000000000000000000..c6473b324ee1dae1faaacc0826639833f551116c GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAIEX7WqAsj$Z!;#Vf4nJ za0`Jjl>Qs8<JF;+Fd5q0wCR k?u=~bH}2*0f`J3~k>FVdQ&MBb@0BAfpf&c&j literal 0 HcmV?d00001 diff --git a/wp-includes/js/thickbox/thickbox.css b/wp-includes/js/thickbox/thickbox.css index 0552cc54..a7c4a401 100644 --- a/wp-includes/js/thickbox/thickbox.css +++ b/wp-includes/js/thickbox/thickbox.css @@ -82,16 +82,14 @@ margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = d } #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{ @@ -118,12 +116,13 @@ margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = d #TB_load{ position: fixed; display:none; - height:13px; - width:208px; z-index:103; top: 50%; left: 50%; - margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */ + background-color: #E8E8E8; + border: 4px solid #525252; + margin: -45px 0pt 0pt -125px; + padding: 40px 15px 15px; } * html #TB_load { /* ie6 hack */ @@ -154,6 +153,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 b1875e9a..75f10a7e 100644 --- a/wp-includes/js/tinymce/langs/wp-langs.php +++ b/wp-includes/js/tinymce/langs/wp-langs.php @@ -3,7 +3,7 @@ // escape text only if it needs translating function mce_escape($text) { global $language; - + if ( 'en' == $language ) return $text; else return js_escape($text); } @@ -395,7 +395,47 @@ wp_more_desc:"' . mce_escape( __('Insert More tag') ) . ' (Alt+Shift+T)", wp_page_desc:"' . mce_escape( __('Insert Page break') ) . ' (Alt+Shift+P)", wp_help_desc:"' . mce_escape( __('Help') ) . ' (Alt+Shift+H)", wp_more_alt:"' . mce_escape( __('More...') ) . '", -wp_page_alt:"' . mce_escape( __('Next page...') ) . '" +wp_page_alt:"' . mce_escape( __('Next page...') ) . '", +add_media:"' . mce_escape( __('Add Media') ) . '", +add_image:"' . mce_escape( __('Add an Image') ) . '", +add_video:"' . mce_escape( __('Add Video') ) . '", +add_audio:"' . mce_escape( __('Add Audio') ) . '" +}); + +tinyMCE.addI18n("' . $language . '.wpeditimage",{ +edit_img:"' . mce_escape( __('Edit Image') ) . '", +del_img:"' . mce_escape( __('Delete Image') ) . '", +adv_settings:"' . mce_escape( __('Advanced Settings') ) . '", +none:"' . mce_escape( __('None') ) . '", +size:"' . mce_escape( __('Size') ) . '", +thumbnail:"' . mce_escape( __('Thumbnail') ) . '", +medium:"' . mce_escape( __('Medium') ) . '", +full_size:"' . mce_escape( __('Full Size') ) . '", +current_link:"' . mce_escape( __('Current Link') ) . '", +link_to_img:"' . mce_escape( __('Link to Image') ) . '", +link_help:"' . mce_escape( __('Enter a link URL or click above for presets.') ) . '", +adv_img_settings:"' . mce_escape( __('Advanced Image Settings') ) . '", +source:"' . mce_escape( __('Source') ) . '", +width:"' . mce_escape( __('Width') ) . '", +height:"' . mce_escape( __('Height') ) . '", +orig_size:"' . mce_escape( __('Original Size') ) . '", +css:"' . mce_escape( __('CSS Class') ) . '", +adv_link_settings:"' . mce_escape( __('Advanced Link Settings') ) . '", +link_rel:"' . mce_escape( __('Link Rel') ) . '", +height:"' . mce_escape( __('Height') ) . '", +orig_size:"' . mce_escape( __('Original Size') ) . '", +css:"' . mce_escape( __('CSS Class') ) . '", +s60:"' . mce_escape( __('60%') ) . '", +s70:"' . mce_escape( __('70%') ) . '", +s80:"' . mce_escape( __('80%') ) . '", +s90:"' . mce_escape( __('90%') ) . '", +s100:"' . mce_escape( __('100%') ) . '", +s110:"' . mce_escape( __('110%') ) . '", +s120:"' . mce_escape( __('120%') ) . '", +s130:"' . mce_escape( __('130%') ) . '", +img_title:"' . mce_escape( __('Edit Image Title') ) . '", +caption:"' . mce_escape( __('Edit Image Caption') ) . '", +alt:"' . mce_escape( __('Edit Alternate Text') ) . '" }); -'; +'; ?> \ 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 7b848f1e..1f0cc1bd 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);})(); \ No newline at end of file +(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:'+(tinymce.isIE6||(tinymce.isIE&&!DOM.boxModel)?'absolute':'fixed')+';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 a18f3967..3209e067 100644 --- a/wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm +++ b/wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm @@ -3,14 +3,14 @@ - + ';}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 +(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.onPreInit.add(function(){ed.serializer.addRules('param[name|value|_value]');});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(/]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(a,b,c){var o=t._parse(c);return''});h=h.replace(/]*)>/gi,'');h=h.replace(/]*)\/?>/gi,'');h=h.replace(/]*)>/gi,'');h=h.replace(/<\/(object)([^>]*)>/gi,'');h=h.replace(/<\/embed>/gi,'');h=h.replace(/]*)>/gi,function(a,b){return''});h=h.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam">');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(/]+>/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='';}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 58d2fafb..0f0cfd64 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 += ''; + // Avoid annoying warning about insecure items + if (!tinymce.isIE || document.location.protocol != 'https:') { + h += ''; - for (n in pl) { - h += ''; + for (n in pl) { + h += ''; - // Add extra url parameter if it's an absolute URL - if (n == 'src' && pl[n].indexOf('://') != -1) - h += ''; + // Add extra url parameter if it's an absolute URL + if (n == 'src' && pl[n].indexOf('://') != -1) + h += ''; + } } h += ' {#media_dlg.title} - - - - - - - + + + + + + + diff --git a/wp-includes/js/tinymce/plugins/paste/blank.htm b/wp-includes/js/tinymce/plugins/paste/blank.htm index 59c8c651..0db61aa4 100644 --- a/wp-includes/js/tinymce/plugins/paste/blank.htm +++ b/wp-includes/js/tinymce/plugins/paste/blank.htm @@ -2,7 +2,7 @@ blank_page - + - + + diff --git a/wp-includes/js/tinymce/plugins/paste/pasteword.htm b/wp-includes/js/tinymce/plugins/paste/pasteword.htm index d3c53e54..99c0348b 100644 --- a/wp-includes/js/tinymce/plugins/paste/pasteword.htm +++ b/wp-includes/js/tinymce/plugins/paste/pasteword.htm @@ -2,9 +2,9 @@ {#paste.paste_word_desc} - - - + + + diff --git a/wp-includes/js/tinymce/plugins/safari/editor_plugin.js b/wp-includes/js/tinymce/plugins/safari/editor_plugin.js index f722c2f1..332b0e70 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+'XX');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(/
      <\/(h[1-6]|div|p|address|pre)>/g,'');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 +(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.addCommand('CreateLink',function(u,v){var n=ed.selection.getNode(),dom=ed.dom,a;if(n&&(/^(left|right)$/i.test(dom.getStyle(n,'float',1))||/^(left|right)$/i.test(dom.getAttrib(n,'align')))){a=dom.create('a',{href:v},n.cloneNode());n.parentNode.replaceChild(a,n);ed.selection.select(a);}else ed.getDoc().execCommand("CreateLink",false,v);});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+'XX');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(/
      <\/(h[1-6]|div|p|address|pre)>/g,'');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/wordpress/editor_plugin.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js index 28144579..faff8415 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js @@ -24,16 +24,16 @@ t._resizeIframe(ed, tbId, 28); } }); - + // Register commands ed.addCommand('WP_More', function() { ed.execCommand('mceInsertContent', 0, moreHTML); }); - + ed.addCommand('WP_Page', function() { ed.execCommand('mceInsertContent', 0, nextpageHTML); }); - + ed.addCommand('WP_Help', function() { ed.windowManager.open({ url : tinymce.baseURL + '/wp-mce-help.php', @@ -80,7 +80,7 @@ ed.addButton('wp_help', { title : 'wordpress.wp_help_desc', image : url + '/img/help.gif', - cmd : 'WP_Help' + cmd : 'WP_Help' }); ed.addButton('wp_adv', { @@ -89,49 +89,85 @@ cmd : 'WP_Adv' }); - // Add class "alignleft", "alignright" and "aligncenter" when selecting align for images. - ed.onExecCommand.add(function( editor, cmd ) { - var node, bl, dom = editor.dom; - - if ( 'JustifyCenter' == cmd ) { - if ( ( node = editor.selection.getNode() ) && node.nodeName == 'IMG' ) { - if ( ! dom.hasClass( node, "aligncenter" ) && ( bl = editor.forceBlocks.getParentBlock(node) ) && bl.childNodes.length == 1 ) - dom.setStyle(bl, 'text-align', ''); - } - editor.execCommand('mceRepaint'); + // Add Media buttons + ed.addButton('add_media', { + title : 'wordpress.add_media', + image : url + '/img/media.gif', + onclick : function() { + tb_show('', tinymce.DOM.get('add_media').href); + tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); + } + }); + + ed.addButton('add_image', { + title : 'wordpress.add_image', + image : url + '/img/image.gif', + onclick : function() { + tb_show('', tinymce.DOM.get('add_image').href); + tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); } }); - ed.onBeforeExecCommand.add(function( editor, cmd ) { - var node, dir, xdir, bl, dom = editor.dom; - - if ( ( cmd.indexOf('Justify') != -1 ) && ( node = editor.selection.getNode() ) ) { - if ( 'JustifyFull' == cmd || node.nodeName !== 'IMG' ) return; - dir = cmd.substring(7).toLowerCase(); - - if ( editor.queryCommandState( cmd ) ) { - dom.removeClass( node, "alignleft" ); - dom.removeClass( node, "alignright" ); - dom.removeClass( node, "aligncenter" ); - } else if ( 'JustifyCenter' == cmd ) { - dom.removeClass( node, "alignleft" ); - dom.removeClass( node, "alignright" ); - - if ( dom.hasClass( node, "aligncenter" ) ) { - dom.removeClass( node, "aligncenter" ); - if ( ( bl = editor.forceBlocks.getParentBlock(node) ) && bl.childNodes.length == 1 && tinymce.isGecko ) - editor.selection.select(bl.firstChild); - } else dom.addClass( node, "aligncenter" ); - - } else { - xdir = ( dir == 'left' ) ? 'right' : 'left'; - dom.removeClass( node, "aligncenter" ); - dom.removeClass( node, "align"+xdir ); - dom.addClass( node, "align"+dir ); - } + ed.addButton('add_video', { + title : 'wordpress.add_video', + image : url + '/img/video.gif', + onclick : function() { + tb_show('', tinymce.DOM.get('add_video').href); + tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); } }); + ed.addButton('add_audio', { + title : 'wordpress.add_audio', + image : url + '/img/audio.gif', + onclick : function() { + tb_show('', tinymce.DOM.get('add_audio').href); + tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); + } + }); + + // Add Media buttons to fullscreen + ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { + if ( 'mceFullScreen' != cmd ) return; + if ( 'mce_fullscreen' != ed.id ) + ed.settings.theme_advanced_buttons1 += ',|,add_image,add_video,add_audio,add_media'; + }); + + // Add class "alignleft", "alignright" and "aligncenter" when selecting align for images. + ed.addCommand('JustifyLeft', function() { + var n = ed.selection.getNode(); + + if ( n.nodeName != 'IMG' ) + ed.editorCommands.mceJustify('JustifyLeft', 'left'); + else ed.plugins.wordpress.do_align(n, 'alignleft'); + }); + + ed.addCommand('JustifyRight', function() { + var n = ed.selection.getNode(); + + if ( n.nodeName != 'IMG' ) + ed.editorCommands.mceJustify('JustifyRight', 'right'); + else ed.plugins.wordpress.do_align(n, 'alignright'); + }); + + ed.addCommand('JustifyCenter', function() { + var n = ed.selection.getNode(), P = ed.dom.getParent(n, 'p'), DL = ed.dom.getParent(n, 'dl'); + + if ( n.nodeName == 'IMG' && ( P || DL ) ) + ed.plugins.wordpress.do_align(n, 'aligncenter'); + else ed.editorCommands.mceJustify('JustifyCenter', 'center'); + }); + + // 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); @@ -171,6 +207,30 @@ }, // Internal functions + do_align : function(n, a) { + var P, DL, DIV, cls, c, ed = tinyMCE.activeEditor; + + P = ed.dom.getParent(n, 'p'); + DL = ed.dom.getParent(n, 'dl'); + DIV = ed.dom.getParent(n, 'div'); + + if ( DL && DIV ) { + cls = ed.dom.hasClass(DL, a) ? 'alignnone' : a; + DL.className = DL.className.replace(/align[^ '"]+\s?/g, ''); + ed.dom.addClass(DL, cls); + c = (cls == 'aligncenter') ? ed.dom.addClass(DIV, 'mceIEcenter') : ed.dom.removeClass(DIV, 'mceIEcenter'); + } else if ( P ) { + cls = ed.dom.hasClass(n, a) ? 'alignnone' : a; + n.className = n.className.replace(/align[^ '"]+\s?/g, ''); + ed.dom.addClass(n, cls); + if ( cls == 'aligncenter' ) + ed.dom.setStyle(P, 'textAlign', 'center'); + else if (P.style && P.style.textAlign == 'center') + ed.dom.setStyle(P, 'textAlign', ''); + } + + ed.execCommand('mceRepaint'); + }, // Resizes the iframe by a relative height value _resizeIframe : function(ed, tb_id, dy) { diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/audio.gif b/wp-includes/js/tinymce/plugins/wordpress/img/audio.gif new file mode 100644 index 0000000000000000000000000000000000000000..f8ad22383aa716922cef904a151cadcc001e033d GIT binary patch literal 146 zcmZ?wbhEHb6k!ly*v!B%bLPyItJfSndh+tE`_JBg-Lie>nTuDq@7}jz)0SHgpC3AY z3aEeq2`K(#VHIKEX3znNfy`iFu`f93xq7d~>$9ewZAB~$2c~LNEqirro0Nb|(?o$~ p*-t;#c{MXRba3(&cZjInOkxu77AZ;8;puY9PCxy&YPTSRH2~cMIspIx literal 0 HcmV?d00001 diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/image.gif b/wp-includes/js/tinymce/plugins/wordpress/img/image.gif new file mode 100644 index 0000000000000000000000000000000000000000..6736e6b009f4bd3c24b9a1cc5a5292d2e34b9dff GIT binary patch literal 101 zcmZ?wbhEHb6k!lyn8?5|bLPzd|NjF?1_lPjpDe5*3``6$ZMql3e5duGdgZkzjgM#cYTcgXac0@ms#}|9?%uv*qHL7IU4gVtjp=997Betd F0|4u+Cw~9{ literal 0 HcmV?d00001 diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/media.gif b/wp-includes/js/tinymce/plugins/wordpress/img/media.gif new file mode 100644 index 0000000000000000000000000000000000000000..786e4f55de224e5d346df90e2d490e51b16474f4 GIT binary patch literal 149 zcmZ?wbhEHb6k!ly*v!B%bLPxVTen}k`{>ZIQx9IeyLkQ1;w4L;zWZ|f(TnZ7_W@-Y zP=Vr47FH1kE(RTtFvtuB7N>xdo~!p-ygqBr>9U;Tq#?uMi5#~X_ZSr9bO?a({K4j zXKcB|+H@~5tD$iA_12{6Q!jPaE%Ru4Etz~xSN%usvVGRSOB;5@sy6v(P48i1um%8* Cg(Zdn literal 0 HcmV?d00001 diff --git a/wp-includes/js/tinymce/plugins/wordpress/popups.css b/wp-includes/js/tinymce/plugins/wordpress/popups.css deleted file mode 100644 index 2d976653..00000000 --- a/wp-includes/js/tinymce/plugins/wordpress/popups.css +++ /dev/null @@ -1,354 +0,0 @@ -/* This file contains the CSS data for all popups in TinyMCE */ - -body { - background-color: #F0F0EE; - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 11px; - 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; - margin: 8px; -} - -td { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 11px; -} - -input { - background: #FFFFFF; - border: 1px solid #cccccc; -} - -td, input, select, textarea { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10px; -} - -input, select, textarea { - border: 1px solid #808080; -} - -.input_noborder { - border: 0; -} - -#insert, .updateButton { - font-weight: bold; - width: 90px; - height: 21px; - border: 0; - background-image: url('../images/insert_button_bg.gif'); - cursor: pointer; -} - -#cancel { - font-weight: bold; - width: 90px; - height: 21px; - border: 0; - background-image: url('../images/cancel_button_bg.gif'); - cursor: pointer; -} - -/* Mozilla only style */ -html>body #insert, html>body #cancel { - padding-bottom: 2px; -} - -.title { - display: block; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 15px; - font-size: 15px; -} - - -table.charmap { - border-style: solid; - border-width: 1px; - border-color: #AAAAAA; -} - -td.charmap, td.charmapOver { - color: #000000; - border-color: #AAAAAA; - border-style: solid; - border-width: 1px; - text-align: center; - font-size: 12px; -} - -td.charmapOver { - background-color: #CCCCCC; - cursor: default; -} - -a.charmap { - color: #000000; - text-decoration: none -} - -.wordWrapCode { - vertical-align: middle; - border: 1px none #000000; - background-color: transparent; -} - -input.radio { - border: 1px none #000000; - background-color: transparent; - vertical-align: middle; -} - -input.checkbox { - border: 1px none #000000; - background-color: transparent; - vertical-align: middle; -} - -.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceButtonDisabled, .mceButtonSelected { - margin-left: 1px; -} - -.mceButtonNormal { - border-top: 1px solid; - border-left: 1px solid; - border-bottom: 1px solid; - border-right: 1px solid; - border-color: #F0F0EE; - cursor: default; -} - -.mceButtonOver { - border: 1px solid #0A246A; - cursor: default; - background-color: #B6BDD2; -} - -.mceButtonDown { - cursor: default; - border: 1px solid #0A246A; - background-color: #8592B5; -} - -.mceButtonDisabled { - filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); - -moz-opacity:0.3; - opacity: 0.3; - border-top: 1px solid; - border-left: 1px solid; - border-bottom: 1px solid; - border-right: 1px solid; - border-color: #F0F0EE; - cursor: default; -} - -.mceActionPanel { - margin-top: 5px; -} - -/* Tabs classes */ - -.tabs { - float: left; - width: 100%; - line-height: normal; - background-image: url("../images/xp/tabs_bg.gif"); -} - -.tabs ul { - margin: 0; - padding: 0 0 0; - list-style: none; -} - -.tabs li { - float: left; - background: url("../images/xp/tab_bg.gif") no-repeat left top; - margin: 0; - margin-left: 0; - margin-right: 2px; - padding: 0 0 0 10px; - line-height: 18px; -} - -.tabs li.current { - background: url("../images/xp/tab_sel_bg.gif") no-repeat left top; - margin-right: 2px; -} - -.tabs span { - float: left; - display: block; - background: url("../images/xp/tab_end.gif") no-repeat right top; - padding: 0px 10px 0 0; -} - -.tabs .current span { - background: url("../images/xp/tab_sel_end.gif") no-repeat right top; -} - -.tabs a { - text-decoration: none; - font-family: Verdana, Arial; - font-size: 10px; -} - -.tabs a:link, .tabs a:visited, .tabs a:hover { - color: black; -} - -.tabs a:hover { -} - -.tabs .current { -} - -.tabs .current a, .tabs .current a:link, .tabs .current a:visited { -} - -.panel_wrapper div.panel { - display: none; -} - -.panel_wrapper div.current { - display: block; - width: 100%; - height: 300px; - overflow: visible; /* Should be auto but that breaks Safari */ -} - -.panel_wrapper { - border: 1px solid #919B9C; - border-top: 0px; - padding: 10px; - padding-top: 5px; - clear: both; - background-color: white; -} - -fieldset { - border: 1px solid #919B9C; - font-family: Verdana, Arial; - font-size: 10px; - padding: 0; - margin: 0; - padding: 4px; -} - -legend { - color: #2B6FB6; - font-weight: bold; -} - -.properties { - width: 100%; -} - -.properties .column1 { -} - -.properties .column2 { - text-align: left; -} - -a:link, a:visited { - color: black; -} - -a:hover { - color: #2B6FB6; -} - -#plugintable thead { - font-weight: bold; - background-color: #DDDDDD; -} - -#plugintable, #about #plugintable td { - border: 1px solid #919B9C; -} - -#plugintable { - width: 99%; - margin-top: 10px; -} - -#pluginscontainer { - height: 290px; - overflow: auto; -} - -/* MSIE Specific styles */ - -* html .panel_wrapper { - width: 100%; -} - -.column { - float: left; -} - -h1, h2, h3, h4 { - color: #2B6FB6; - margin: 0; - padding: 0; - padding-top: 5px; -} - -h3 { - font-size: 14px; -} - -#link .panel_wrapper, #link div.current { - height: 125px; -} - -#image .panel_wrapper, #image div.current { - height: 190px; -} - -/* Disables the advanced tab in the table plugin. */ -/* -#table #advanced_tab { - display: none; -} -*/ - -/* Disables the border input field and label in the table plugin. */ -/* -#table #border, #table #borderlabel { - display: none; -} -*/ - -#insert, #cancel, .submitbutton { - font: 13px Verdana, Arial, Helvetica, sans-serif; - height: auto; - width: auto; - background-color: transparent; - background-image: url(../../../../../wp-admin/images/fade-butt.png); - background-repeat: repeat; - border: 3px double; - border-right-color: rgb(153, 153, 153); - border-bottom-color: rgb(153, 153, 153); - border-left-color: rgb(204, 204, 204); - border-top-color: rgb(204, 204, 204); - color: rgb(51, 51, 51); - padding: 0.25em 0.75em; -} - -#insert:active, #cancel:active, .submitbutton:active { - background: #f4f4f4; - border-left-color: #999; - border-top-color: #999; -} - - diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css b/wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css new file mode 100644 index 00000000..e78820ff --- /dev/null +++ b/wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css @@ -0,0 +1,68 @@ + +body#media-upload ul#sidemenu { + left: auto; + right: 0; +} + +#basic .align .field label { + display: block; + float: right; + padding: 0 24px 0 0; + margin: 5px 3px 5px 5px; +} + +.align .field input { + display: block; + float: right; + margin: 5px 15px 5px 0; +} + +tr.image-size label { + margin: 0; +} + +tr.image-size input { + margin: 3px 15px 0 5px; +} + +.image-align-none-label, +.image-align-left-label, +.image-align-center-label, +.image-align-right-label { + background-position: center right; +} + +#media-upload .describe th.label { + text-align: right; +} + +.show-align, +.alignright, +#img_size { + float: left; +} + +tr.image-size label, +tr.image-size input, +#img_dim label, +#img_dim input, +#img_prop label, +#img_prop input, +#img_size_div, +.alignleft { + float: right; +} + +#img_dim label, +#img_prop label { + margin: 5px 0pt; +} + +#img_dim input, +#img_prop input { + margin: 0 5px 0 10px; +} + +#img_size_title { + text-align: left; +} 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 00000000..112f5db0 --- /dev/null +++ b/wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css @@ -0,0 +1,239 @@ + +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; +} + +img.alignright, +.alignright { + float: right; +} + +img.alignleft, +.alignleft { + float: left; +} + +img.aligncenter { + display: block; + margin-left: auto; + margin-right: auto; +} + +label { + cursor: pointer; +} + +th.label { + width: 107px; +} + +#media-upload #basic th.label { + padding: 5px 5px 5px 0; +} + +.show-align { + height: 200px; + width: 480px; + float: right; + 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: 15px 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; +} + +#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; + -khtml-border-top-left-radius: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topright: 4px; + -khtml-border-top-right-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 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: 0 0 10px -4px; + padding: 15px 0 3px; + border-bottom-color: #DADADA; + color: #5A5A5A; +} + +#img_dim #width, +#img_dim #height, +#img_prop #border, +#img_prop #vspace, +#img_prop #hspace { + width: 36px; +} + +#img_dim abbr { + padding: 0 4px; +} + +#show_align_sp { + width: 115px; +} + +#img_dim input, +#img_prop input { + margin-right: 10px; +} + +#basic .align .field label { + padding: 0 0 0 24px; +} + +#basic { + padding-top: 2px; +} + +td { + padding: 2px 0; +} + +#img_size { + float: right; + text-align: center; + cursor: pointer; + background-color: #f1f1f1; + padding: 5px 0; + width: 45px; +} + +#img_size div { + font-size: 10px; + padding: 2px; + border: 1px solid #f1f1f1; + line-height: 15px; + height: 15px; + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + color: #07273E; +} + +#img_size div#s100 { + border-color: #A3A3A3; + background-color: #E5E5E5; +} + +#img_size_div { + width: 100px; + float: left; + cursor: default; +} + +#img_size_title { + margin: 0 7px 5px; + text-align: right; + font-weight: bold; +} + +#img_align_td { + padding: 2px 0 8px; +} 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 00000000..55554d72 --- /dev/null +++ b/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + +
      +
      +
      +
      {#wpeditimage.size}
      +
      +
      {#wpeditimage.s130}
      +
      {#wpeditimage.s120}
      +
      {#wpeditimage.s110}
      +
      {#wpeditimage.s100}
      +
      {#wpeditimage.s90}
      +
      {#wpeditimage.s80}
      +
      {#wpeditimage.s70}
      +
      {#wpeditimage.s60}
      +
      +
      +
      + + + 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. + +
      + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + +
      + + + +
      + + + +
      + + +
      + + + +

      {#wpeditimage.link_help}

      +
      + + + +
      + + + + +
      +
      +
      + + + 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 00000000..d0ca4ed5 --- /dev/null +++ b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js @@ -0,0 +1,217 @@ + +(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?ver=311g&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.onBeforeExecCommand.add(function(ed, cmd, ui, val) { + ed.plugins.wpeditimage.hideButtons(); + }); + + ed.onSaveContent.add(function(ed, o) { + ed.plugins.wpeditimage.hideButtons(); + }); + + ed.onMouseUp.add(function(ed, e) { + if ( tinymce.isOpera ) { + if ( e.target.nodeName == 'IMG' ) + ed.plugins.wpeditimage.showButtons(e.target); + } else if ( ! tinymce.isWebKit ) { + var n = ed.selection.getNode(), DL; + + if ( n.nodeName == 'IMG' && (DL = ed.dom.getParent(n, 'DL')) ) { + window.setTimeout(function(){ + var ed = tinyMCE.activeEditor, n = ed.selection.getNode(), DL = ed.dom.getParent(n, 'DL'); + + if ( n.width != (parseInt(ed.dom.getStyle(DL, 'width')) - 10) ) { + ed.dom.setStyle(DL, 'width', parseInt(n.width)+10); + ed.execCommand('mceRepaint'); + } + }, 100); + } + } + }); + + ed.onMouseDown.add(function(ed, e) { + if ( tinymce.isOpera || e.target.nodeName != 'IMG' ) { + t.hideButtons(); + return; + } + ed.plugins.wpeditimage.showButtons(e.target); + }); + + ed.onKeyPress.add(function(ed, e) { + var DL, DIV; + + if ( e.keyCode == 13 && (DL = ed.dom.getParent(ed.selection.getNode(), 'DL')) ) { + var P = ed.dom.create('p', {}, ' '); + if ( (DIV = DL.parentNode) && DIV.nodeName == 'DIV' ) + ed.dom.insertAfter( P, DIV ); + else ed.dom.insertAfter( P, DL ); + + tinymce.dom.Event.cancel(e); + ed.selection.select(P); + return false; + } + }); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = t._do_shcode(o.content); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.get) + o.content = t._get_shcode(o.content); + }); + }, + + _do_shcode : function(co) { + return co.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g, function(a,b,c){ + b = b.replace(/\\'|\\'|\\'/g, ''').replace(/\\"|\\"/g, '"'); + c = c.replace(/\\'|\\'/g, ''').replace(/\\"/g, '"'); + var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/align=['"]([^'"]+)/i); + var w = b.match(/width=['"]([0-9]+)/), cap = b.match(/caption=['"]([^'"]+)/i); + + id = ( id && id[1] ) ? id[1] : ''; + cls = ( cls && cls[1] ) ? cls[1] : 'alignnone'; + w = ( w && w[1] ) ? w[1] : ''; + cap = ( cap && cap[1] ) ? cap[1] : ''; + if ( ! w || ! cap ) return c; + + var div_cls = (cls == 'aligncenter') ? 'mceTemp mceIEcenter' : 'mceTemp'; + + return '
      '+c+'
      '+cap+'
      '; + }); + }, + + _get_shcode : function(co) { + return co.replace(/
      \s*]+)>\s*]+>([\s\S]+?)<\/dt>\s*]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi, function(a,b,c,cap){ + var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/class=['"]([^'"]+)/i); + var w = c.match(/width=['"]([0-9]+)/); + + id = ( id && id[1] ) ? id[1] : ''; + cls = ( cls && cls[1] ) ? cls[1] : 'alignnone'; + w = ( w && w[1] ) ? w[1] : ''; + + if ( ! w || ! cap ) return c; + cls = cls.match(/align[^ '"]+/) || 'alignnone'; + cap = cap.replace(/<\S[^<>]*>/gi, '').replace(/'/g, ''').replace(/"/g, '"'); + + return '[caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/caption]'; + }); + }, + + showButtons : function(n) { + var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y; + + if (ed.dom.getAttrib(n, 'class').indexOf('mceItem') != -1) + return; + + vp = ed.dom.getViewPort(ed.getWin()); + p1 = DOM.getPos(ed.getContentAreaContainer()); + p2 = ed.dom.getPos(n); + + 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() { + if ( tinymce.DOM.isHidden('wp_editbtns') ) return; + + 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 : ed.getLang('wpeditimage.edit_img') + }); + + 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 : ed.getLang('wpeditimage.del_img') + }); + + 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 ) { + if ( (p = ed.dom.getParent(el, 'div')) && ed.dom.hasClass(p, 'mceTemp') ) + ed.dom.remove(p); + else 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 0000000000000000000000000000000000000000..d64d8a66ebc7f512f5a44dd30f9ba88b9eb4d81c GIT binary patch literal 1638 zcmV-s2ATPZP)S54zJI5e!u&= za$o=4;(*pHSK`m7um^`QUV9mNTw&os;M_GiAJW0sx8B(K;`R63gVE6emV;Iys1OhcX@F@! z5D;EG&)FAWqJQAj9$(5IUfsd91P^_-Z`Tv+@4ORjnCQBTa_f}xdFIPylvX674(W6T z)3%YRG=_lj!++q=8-IGH90d0*3%JIJKDT4%wkKM9dT_@l&?s_~)BNT1X-T8 z&Y(ryc2<9?yk-K|0$3gHnzULdGi)>=P!b3 zGCn%Y!FNv9CMwkj&co|-aQQyKsaKN?Ln8x)c(T2e%i$FY$V8k?Z5#RM$mmlSE({+A z1_4ZKFo)sT0DHHrZ((9&oPrPpg?XMkF>vEdln=tXs3MP_N+Urcl`o=Q0uG^c3m*Jgun|Z4L3e&(ysY`uOo#Q=j@N!1{zK z86FyD&NK+3G0rZOzQYpyi?#ua`}o*wbL!#w!Zc#iMK@-6BbVd&xr_g}L8_a!Dvi$P z$q0=v_@wOT71Lkb~$B)?@i zCFethAxVagvl+rWEZC<4p9Kvu(xU(vLbC zECa+{TBDZIG!SgvmWaOlt+a!v)EQEmpfQaXaj3g>ECq&PVcHh)r~`pZI6XzP?_ot9 zUMP9|s#4$W!}9=+*8h{HCl8iuUz3P~yH_;OB_w&}W7sCiRV_s97*Yy?P*E)x@$z+I zi5Lqy$_sO4o~^o%umlH4UX`ZH^}Dx9)t#eWaO5lLWNLf!N*Y%;V`eiDi-QzcwHo$Z zgre*7?n0GU3q=mQ{=G3Fp1T@$^@tb&)@T?5CoScJ+b#3^T@9(&=4>PBL>z>mSgtTM zH^)Bj47> znx!l(C`BE(mcRs%OJ5gx6e1dAA4C9Sa1g7#Jv8BjarEd3+20R0l6gk7nG;@wq_MECjbBd07*qoM6N<$f>OgCM*si- literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..f3d4b4490223c9429434d9f3cf9842862229bc26 GIT binary patch literal 3701 zcmV-*4vO)KP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` z008P>0026e000+nl3&F}000A!Nkl6vuz(y!VDTZUn*0Pl*_dUSPWHJ+53IIr_yBfD5_`pDR z(p|e$zdA<8jxyFNW{klBLIf}XC?KkUMJ?FXGoq+iL|q)UoV&8Z^+OHo82~)lmY{Qc zgwTS6!2lM)!LZgP0aQvsLkp?`7OV;?iU>HW1b(=&L;z*Jj}uWeG@u^3s(MYi<(^nT zam8Y-B5FZEMX(|`>fi=uGayp#+VRxy99nYN^ozDi$LS5(?@HRTbW5K%%^iX!I_& zR8m6Y;B1TF4*yE+NH<6N#_2korLHz$XZWScFI%yg1BELFVi4xib6{{l^aT z)_m?ifM`e%F$f@m2L@_JzU1#j6YcG-%;m}%`Qj7ayKtPU`c__f`yCRsaQW;we|+~D z(S@tX^dvjWJPX;wkfyUYdQ6HQH%zV|2M55%pn;bmy4gKf-~aAwo~JrkAz!>iW%DikG*N&m-zt;CbPfyQ8I^ES+U0nq&z+&kkCJ;CvA' ); + } + }, + + I : function(e) { + return document.getElementById(e); + }, + + current : '', + link : '', + link_rel : '', + target_value : '', + current_size_sel : 's100', + width : '', + height : '', + align : '', + img_alt : '', + + 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 = t.align = v; + + cls = cls.replace( /align[^ "']+/gi, '' ); + cls += (' ' + v); + cls = cls.replace( /\s+/g, ' ' ).replace( /^\s/, '' ); + + if ( 'aligncenter' == v ) { + t.I('hspace').value = ''; + t.updateStyle('hspace'); + } + + t.I('img_classes').value = cls; + }, + + showSize : function(el) { + var t = this, demo = t.I('img_demo'), w = t.width, h = t.height, id = el.id || 's100', size; + + size = parseInt(id.substring(1)) / 200; + demo.width = Math.round(w * size); + demo.height = Math.round(h * size); + + t.showSizeClear(); + el.style.borderColor = '#A3A3A3'; + el.style.backgroundColor = '#E5E5E5'; + }, + + showSizeSet : function() { + var t = this; + + if ( (t.width * 1.3) > parseInt(t.preloadImg.width) ) { + var s130 = t.I('s130'), s120 = t.I('s120'), s110 = t.I('s110'); + + s130.onclick = s120.onclick = s110.onclick = null; + s130.onmouseover = s120.onmouseover = s110.onmouseover = null; + s130.style.color = s120.style.color = s110.style.color = '#aaa'; + } + }, + + showSizeRem : function() { + var t = this, demo = t.I('img_demo'), f = document.forms[0]; + + demo.width = Math.round(f.width.value * 0.5); + demo.height = Math.round(f.height.value * 0.5); + t.showSizeClear(); + t.I(t.current_size_sel).style.borderColor = '#A3A3A3'; + t.I(t.current_size_sel).style.backgroundColor = '#E5E5E5'; + + return false; + }, + + showSizeClear : function() { + var divs = this.I('img_size').getElementsByTagName('div'); + + for ( i = 0; i < divs.length; i++ ) { + divs[i].style.borderColor = '#f1f1f1'; + divs[i].style.backgroundColor = '#f1f1f1'; + } + }, + + imgEditSize : function(el) { + var t = this, f = document.forms[0]; + + if ( ! t.preloadImg || ! t.preloadImg.width || ! t.preloadImg.height ) return; + var W = parseInt(t.preloadImg.width), H = parseInt(t.preloadImg.height), w = t.width || W, h = t.height || H, id = el.id || 's100'; + + size = parseInt(id.substring(1)) / 100; + + w = Math.round(w * size); + h = Math.round(h * size); + + f.width.value = Math.min(W, w); + f.height.value = Math.min(H, h); + + t.current_size_sel = id; + t.demoSetSize(); + }, + + demoSetSize : function(img) { + var demo = this.I('img_demo'), f = document.forms[0]; + + demo.width = f.width.value ? Math.round(f.width.value * 0.5) : ''; + demo.height = f.height.value ? Math.round(f.height.value * 0.5) : ''; + }, + + demoSetStyle : function() { + var f = document.forms[0], demo = this.I('img_demo'), dom = tinyMCEPopup.editor.dom; + + if (demo) { + dom.setAttrib(demo, 'style', f.img_style.value); + dom.setStyle(demo, 'width', ''); + dom.setStyle(demo, 'height', ''); + } + }, + + origSize : function() { + var t = this, f = document.forms[0], el = t.I('s100'); + + f.width.value = t.width = t.preloadImg.width; + f.height.value = t.height = t.preloadImg.height; + t.showSizeSet(); + t.demoSetSize(); + t.showSize(el); + }, + + 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.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'), dom = tinyMCEPopup.dom, DL, caption = ''; + document.dir = tinyMCEPopup.editor.getParam('directionality',''); + + if ( tinyMCEPopup.editor.getParam('wpeditimage_disable_captions', false) ) + t.I('cap_field').style.display = 'none'; + + tinyMCEPopup.restoreSelection(); + el = ed.selection.getNode(); + if (el.nodeName != 'IMG') return; + + f.img_src.value = d.src = link = ed.dom.getAttrib(el, 'src'); + ed.dom.setStyle(el, 'float', ''); + t.getImageData(); + c = ed.dom.getAttrib(el, 'class'); + + if ( DL = dom.getParent(el, 'dl') ) { + var dlc = ed.dom.getAttrib(DL, 'class'); + dlc = dlc.match(/align[^ "']+/i); + if ( dlc && ! dom.hasClass(el, dlc) ) { + c += ' '+dlc; + tinymce.trim(c); + } + + tinymce.each(DL.childNodes, function(e) { + if ( e.nodeName == 'DD' && dom.hasClass(e, 'wp-caption-dd') ) { + caption = e.innerHTML; + return; + } + }); + } + + f.img_cap.value = caption; + 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; + f.img_style.value = ed.dom.getAttrib(el, 'style'); + + // Move attribs to styles + if (dom.getAttrib(el, 'hspace')) + t.updateStyle('hspace'); + + if (dom.getAttrib(el, 'border')) + t.updateStyle('border'); + + if (dom.getAttrib(el, 'vspace')) + t.updateStyle('vspace'); + + 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_style.value = ed.dom.getAttrib(pa, 'style'); + t.target_value = ed.dom.getAttrib(pa, 'target'); + f.link_classes.value = ed.dom.getAttrib(pa, 'class'); + } + + f.link_target.checked = ( t.target_value && t.target_value == '_blank' ) ? 'checked' : ''; + + 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('alignleft') != -1 ) { + t.I('alignleft').checked = "checked"; + d.className = t.align = "alignleft"; + } else if ( c.indexOf('aligncenter') != -1 ) { + t.I('aligncenter').checked = "checked"; + d.className = t.align = "aligncenter"; + } else if ( c.indexOf('alignright') != -1 ) { + t.I('alignright').checked = "checked"; + d.className = t.align = "alignright"; + } else if ( c.indexOf('alignnone') != -1 ) { + t.I('alignnone').checked = "checked"; + d.className = t.align = "alignnone"; + } + + if ( t.width && t.preloadImg.width ) t.showSizeSet(); + document.body.style.display = ''; + }, + + 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, 'div')) && ed.dom.hasClass(p, 'mceTemp') ) + ed.dom.remove(p); + else 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], ed = tinyMCEPopup.editor, el, b, fixSafari = null, DL, P, A, DIV, do_caption = null, img_class = f.img_classes.value, html; + + tinyMCEPopup.restoreSelection(); + el = ed.selection.getNode(); + + if (el.nodeName != 'IMG') return; + if (f.img_src.value === '') { + t.remove(); + return; + } + + if ( f.img_cap.value != '' && f.width.value != '' ) { + do_caption = 1; + img_class = img_class.replace( /align[^ "']+\s?/gi, '' ); + } + + A = ed.dom.getParent(el, 'a'); + P = ed.dom.getParent(el, 'p'); + DL = ed.dom.getParent(el, 'dl'); + DIV = ed.dom.getParent(el, 'div'); + + tinyMCEPopup.execCommand("mceBeginUndoLevel"); + + 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' : img_class + }); + + if ( f.link_href.value ) { + // Create new anchor elements + if ( A == null ) { + if ( ! f.link_href.value.match(/https?:\/\//i) ) + f.link_href.value = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.link_href.value); + + if ( tinymce.isWebKit && ed.dom.hasClass(el, 'aligncenter') ) { + ed.dom.removeClass(el, 'aligncenter'); + fixSafari = 1; + } + + tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); + if ( fixSafari ) ed.dom.addClass(el, 'aligncenter'); + + 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, + target : (f.link_target.checked == true) ? '_blank' : '', + 'class' : f.link_classes.value, + style : f.link_style.value + }); + } + }); + } else { + ed.dom.setAttribs(A, { + href : f.link_href.value, + title : f.link_title.value, + rel : f.link_rel.value, + target : (f.link_target.checked == true) ? '_blank' : '', + 'class' : f.link_classes.value, + style : f.link_style.value + }); + } + } + + if ( do_caption ) { + var id, cap_id = '', cap, DT, DD, cap_width = 10 + parseInt(f.width.value), align = t.align.substring(5), div_cls = (t.align == 'aligncenter') ? 'mceTemp mceIEcenter' : 'mceTemp'; + + if ( DL ) { + ed.dom.setAttribs(DL, { + 'class' : 'wp-caption '+t.align, + style : 'width: '+cap_width+'px;' + }); + + if ( DIV ) + ed.dom.setAttrib(DIV, 'class', div_cls); + + if ( (DT = ed.dom.getParent(el, 'dt')) && (DD = DT.nextSibling) && ed.dom.hasClass(DD, 'wp-caption-dd') ) + ed.dom.setHTML(DD, f.img_cap.value); + + } else { + var lnk = '', pa; + if ( (id = f.img_classes.value.match( /wp-image-([0-9]{1,6})/ )) && id[1] ) + cap_id = 'attachment_'+id[1]; + + if ( f.link_href.value && (lnk = ed.dom.getParent(el, 'a')) ) { + if ( lnk.childNodes.length == 1 ) + html = ed.dom.getOuterHTML(lnk); + else { + html = ed.dom.getOuterHTML(lnk); + html = html.match(/]+>/i); + html = html+ed.dom.getOuterHTML(el)+''; + } + } else html = ed.dom.getOuterHTML(el); + + html = '
      '+html+'
      '+f.img_cap.value+'
      '; + + cap = ed.dom.create('div', {'class': div_cls}, html); + + if ( P ) { + P.parentNode.insertBefore(cap, P); + if ( P.childNodes.length == 1 ) + ed.dom.remove(P); + else if ( lnk && lnk.childNodes.length == 1 ) + ed.dom.remove(lnk); + else ed.dom.remove(el); + } else if ( pa = ed.dom.getParent(el, 'TD,TH,LI') ) { + pa.appendChild(cap); + if ( lnk && lnk.childNodes.length == 1 ) + ed.dom.remove(lnk); + else ed.dom.remove(el); + } + } + + } else { + if ( DL && DIV ) { + var aa; + if ( f.link_href.value && (aa = ed.dom.getParent(el, 'a')) ) html = ed.dom.getOuterHTML(aa); + else html = ed.dom.getOuterHTML(el); + + P = ed.dom.create('p', {}, html); + DIV.parentNode.insertBefore(P, DIV); + ed.dom.remove(DIV); + } + } + + if ( f.img_classes.value.indexOf('aligncenter') != -1 ) { + if ( P && ( ! P.style || P.style.textAlign != 'center' ) ) + ed.dom.setStyle(P, 'textAlign', 'center'); + } else { + if ( P && P.style && P.style.textAlign == 'center' ) + ed.dom.setStyle(P, 'textAlign', ''); + } + + if ( ! f.link_href.value && A ) { + b = ed.selection.getBookmark(); + ed.dom.remove(A, 1); + ed.selection.moveToBookmark(b); + } + + tinyMCEPopup.execCommand("mceEndUndoLevel"); + ed.execCommand('mceRepaint'); + tinyMCEPopup.close(); + }, + + updateStyle : function(ty) { + var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : f.img_style.value}); + + if (tinyMCEPopup.editor.settings.inline_styles) { + // Handle align + if (ty == 'align') { + dom.setStyle(img, 'float', ''); + dom.setStyle(img, 'vertical-align', ''); + + v = f.align.value; + if (v) { + if (v == 'left' || v == 'right') + dom.setStyle(img, 'float', v); + else + img.style.verticalAlign = v; + } + } + + // Handle border + if (ty == 'border') { + dom.setStyle(img, 'border', ''); + + v = f.border.value; + if (v || v == '0') { + if (v == '0') + img.style.border = '0'; + else + img.style.border = v + 'px solid black'; + } + } + + // Handle hspace + if (ty == 'hspace') { + dom.setStyle(img, 'marginLeft', ''); + dom.setStyle(img, 'marginRight', ''); + + v = f.hspace.value; + if (v) { + img.style.marginLeft = v + 'px'; + img.style.marginRight = v + 'px'; + } + } + + // Handle vspace + if (ty == 'vspace') { + dom.setStyle(img, 'marginTop', ''); + dom.setStyle(img, 'marginBottom', ''); + + v = f.vspace.value; + if (v) { + img.style.marginTop = v + 'px'; + img.style.marginBottom = v + 'px'; + } + } + + // Merge + f.img_style.value = dom.serializeStyle(dom.parseStyle(img.style.cssText)); + this.demoSetStyle(); + } + }, + + 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.width = t.preloadImg.width; + f.height.value = t.height = t.preloadImg.height; + } + + t.showSizeSet(); + t.demoSetSize(); + if ( f.img_style.value ) + t.demoSetStyle(); + }, + + 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 69e37601..6dc74ba7 100644 --- a/wp-includes/js/tinymce/themes/advanced/about.htm +++ b/wp-includes/js/tinymce/themes/advanced/about.htm @@ -2,9 +2,9 @@ {#advanced_dlg.about_title} - - - + + +
      diff --git a/wp-includes/js/tinymce/themes/advanced/anchor.htm b/wp-includes/js/tinymce/themes/advanced/anchor.htm index 3ae87d01..a97b7cec 100644 --- a/wp-includes/js/tinymce/themes/advanced/anchor.htm +++ b/wp-includes/js/tinymce/themes/advanced/anchor.htm @@ -2,8 +2,8 @@ {#advanced_dlg.anchor_title} - - + + diff --git a/wp-includes/js/tinymce/themes/advanced/charmap.htm b/wp-includes/js/tinymce/themes/advanced/charmap.htm index 4f714576..0d422ba7 100644 --- a/wp-includes/js/tinymce/themes/advanced/charmap.htm +++ b/wp-includes/js/tinymce/themes/advanced/charmap.htm @@ -3,8 +3,8 @@ {#advanced_dlg.charmap_title} - - + + diff --git a/wp-includes/js/tinymce/themes/advanced/color_picker.htm b/wp-includes/js/tinymce/themes/advanced/color_picker.htm index 62fc40f4..faaa8400 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 @@ {#advanced_dlg.colorpicker_title} - - - + + + diff --git a/wp-includes/js/tinymce/themes/advanced/editor_template.js b/wp-includes/js/tinymce/themes/advanced/editor_template.js index 465a8090..eea384f7 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:'#'},''),'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();'},''));h.push(DOM.createHTML('a',{href:'#',accesskey:'q',title:ed.getLang("advanced.toolbar_focus")},''));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();'},''));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')+': ':' ');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 +(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:'#'},''),'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();'},''));h.push(DOM.createHTML('a',{href:'#',accesskey:'q',title:ed.getLang("advanced.toolbar_focus")},''));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();'},''));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')+': ':' ');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 f0bd23c7..af3cbfdb 100644 --- a/wp-includes/js/tinymce/themes/advanced/image.htm +++ b/wp-includes/js/tinymce/themes/advanced/image.htm @@ -2,10 +2,10 @@ {#advanced_dlg.image_title} - - - - + + + + diff --git a/wp-includes/js/tinymce/themes/advanced/img/icons.gif b/wp-includes/js/tinymce/themes/advanced/img/icons.gif index 687082782a37bb539f33e4c16cd1b243939736cc..ccac36f54d983cc33a0a6e45134e3dabf1820367 100644 GIT binary patch delta 7514 zcmWOAi$BwgAII_UzPo)lvwdBT+|4DFFe-!?atUR0b16+!lCqSVOYOT$vs^NzLdxVe zA|vGz8kKvQbRnuKr=RZYa!R+e-}xIpkH`D-dOY)@KSjxe6gb)-MOsoyiCZ*Ny$DWQ zWPiGxV$V5z$<-%pineb`o@??6SO&yImsW2j#vC|N`Dblqt-f}r^3q|h-ijTT5B@RV zv9t!?tT81y29A?P0e8*WDh?~OqvR6vNv&0HC3QS9^+(w;Voe`gS`jY2kzM&k?Zy^J zrK@^tw-f7%qU#ECs?L_ym3G#Zb=G>(7fGk;E^*xJtD@^`GU}!7-1484tkU``KkH?N zms{K~w?<#So^iRo^m1qC<*p}}n}4G1;08Mtx+l6JNn2yEw4qsrNnth^aM#jM> z(1?{Rl#imx-JAqy$bPsJ{}^IA0|5*JhAztp9jyISFP&AY=i*QatAr%rAHfSkw$nyyJpcGfjYusT( zB>#lM#MgCbDE;Q^`<1wD3M{h_tdU@etTuLLTQq}Mt<-x)yz(OW%By-k0~+R!3t+^; zZInSG}fqO3#!4Ne>?iUnm1;tEvPunhQXbQ7C#XLIr$as|p!MUHMj$^NIoe1|fW zpzhEC<~xlUJNT-sKiN~`?G(J9M%pp$dcbpla-iRZiQdo9YH&i4Xr$CK9HydE@Vh)B zw26Oekgtw_1r43TPdml5nCay>fp~PdYg7P$ zRGP=ym|NrTI*D4cK05AE*4>}cGH4v-A;+hT;5`)ZjS$$6j-IeUEf)_5g?7z*+Q04M zpx)=f@zkNvS;jxfW8}1ZuZ_pPWWm2lWAC>1KnUQ^QuwQgi{&VYwI4*`4T16O9Lkry z_a-brL%I2{2T4pV)Apq>{gFL1*29i{w;ibqJvdK^++B zH6`Jk6%)=>g5}me?14VJ22S5NOB18&!#Lf=hTmFQMi(gK3GhSDEa&eu6v(1LbiA?r zI_N{L6vGKD)Ule5-sC$t1uB__7AnzL1twzajnvhT*{s1Y8F$#?tBx?pSi#@DtUn>S zpIO$gX7vmI^pms(QbPxjG8~!MpFRp`(zQ}AP44sbiy-e-E2h01p_E@a(j_vExG=Dva6A zMJ#r+aN!D^t`h7zs#OWQdoa+OG6~;V1bi=9fA6);Y7aOCeuQrZ+dQ$WRH&lNXJVf!Xq_@PkxG)PoJKi@+>j8)hQ%+tBfu&141#RKpYrWYn@!KBuh8*L%D zju`maDBz;ha8aN%#rQ{PE&Y8KpSn;RRb#mE**9g==2u`n_@;{-ouueN7rw~ud|~hP z0&E<%xd>bRJL`H8_G0yXMig6Uz)B8+cJP8(D!`CI;8PbxAV35{iC~PQ$7h|Rz}*Ub zz7j80j(^>2L6>LO<>8`E5^c7@c8&70;=XZMlhh!8^c~Y7(|pLnzLudoRJbtO6tNk* znbm8MT!Q`zsvf%S?O)tDP)l%S-pW4rK*%wF$ zOrGGVfSVnVtGW{x+CM;@OiYG_n*DLeq{i$(?l$<*he?Xo)O(AzB70ap-RJh_{&f7;68}U!sWwQT_t`M0*vp|vZp--$De*j&@$xprw!M3*b2b| zjG2rmrGt+#KK8q--v}{ z<#C$MULL6*4GxXHxccRr^|No7-tR6SzGLE=jkiP4HjJH*5))1cb%M-ga}+rlgwdP` z1a(DzBbJPzQBBW#gNGD=CP2YH>bB+;Ixz9l6#S8C&|ZmI&ww>Xfo?IX+)%Sy`HCD0 zvo4aiFfh+mnpsNJeg!ZshV^L^n;8=^$V4iDrZHhh7AgB4l?mWTmr%lg!QB0%Ahl|~ zfr>e`{x#;`2cXZt1SgOqV394A*7F>4j^xaD+LXKarj7e~YH1#tUw(^W78z#fob_NNzBcw_hX3SdXWy25ijIH6iQNi~Vn-L# zuab~OD2ic@i6!&PtI+K}M~|D=?|l_srM3=bO-M%itJjrVKjpN`-)yRnGC16kbZxd+ z%ThaU9kqX%RS^8ZVKT8d-ccM85L}U&Y8lxauVtR`jno(oB^xbeGy7C=w<-GO#}~_+ z5x)4^`kJx_?{And1`UXZYQlAi$5N?55gjcyVS570)@#PCynnJ=*p*ZicTg>{m3hrv z?ydORE8X8o`XA@X!#59vl@Zq<6{WX2^Sis;_ouO5+8gz=Jc}1|^Eo;;HK9X=@mW7U z&2C8^)md-ojo&u8S`t=1t<#GifFoo=7=p=easVxYc--Im5wqpkO_3@p{*2ojf;LQL z=GyQG)}UtFJgt|1SY~ePr7z=hR|X_f?NEcPaeoeWsT5eEWmQ}u&~}*w${b-yeZSGc zndZRyi_#`9Blf}_;z|qPlbK~f7IkRx`7G@qPQ2uLRzhc57k~Ygq2EZ z@S73*X&+N&AVQ)s2hQXt714Q`OtEumVuKs@qEI-wJdpT~t=>Bx`|o5TB}9L+a*;6y zW}oE8>bJ|a&0R8H&)>GIQID)DOm)tSR@-@6Juqu!a-Sqjy2g{{=OcW)X_=e*~bEV|xo zE(~z~0c2y77HlpA=$A6f4hTEUH5ojahlufwM%6Ugl@wPL9z73a8#-`zx>xmu>)hbC z8)0)k;`CEI6U1>ZQb)rg3o15T(p^mA7>fH#oPxs>bbj}|7&A&?IEY2d$XTbB?%qAj zGD0N{()7KuR24$|$hAi;y*Pp-34cTOlAYg#(M9)pdWl8U5zWrm))X&miC^|#U&>+! zmtR`2fZumK7Xjd#tJZ6yN~~rzzZ&^&Kl*Lwrk8&fjOq(B-Znel%=~jSEO6H7x%wmz z3AXp)YRn<{M=MUd+>ImWvL~poHr9HiI|lC7??r<&^$L`n3fRU48E|UaxXanSWtHQZp+>JL6n_}UHl8qISDL!XgT0h~f0G_kLcNl_vL@{jMA~;BH^m4FqxK*JS zPbb=vxq7X?Uvi*E_;#nueFtP#Liqe70P|qijrD7&pnb2Ojl~a0+j)+l{<+1T*$f%W z!5wS&1UMb`1?n;W=*wHHm*hGPb9D3l*B0(v%HM%Dk|sI(_EtMw({72)8%?m$5u*;j zstXE^DAAH7U@QvP{&|p>(B}zQk?DEyYL}|rdCFI4&Zue~3w&>zs~?@v!VA1+oS>cU z2D$F$4e&87=6S{8el7%;=EA$li5}4Ot5qisgI}o^iv>2)&5Ei#I!Vn!qHkCKb=>(u zMNoR5^SLQV`+@mBycXVXhT675S+V~J8f$u=#gAJ!Wu9#tg#UM(Ya-A-5EK{areAAf z;|6k4mq&5uYM84=v1bUSdxK0LaYx4LDslhJ_FHds^8C|4#?(gpZF&sfSV{Y6d+n;p z$N!>`=#NlVN>M4!->h6`T5#!+{22i^xZbV6XoiWkGmX=zDvHCo`^LFeA>8%1sb~Xa zuiw|<$Ep(rXx`#?Kkf&X|MQ8i-h7{mB5*~zW$-y$oTke$hKA?=S* z0Y1&ut0mQLs_4mM2-=J}fwr~<4sR5%Kiqfv-(Z$d_dbdNiiAJ|6@lbH>CQ=}?nYaI z9^vhb_S0U6&yaoI3z%}@ zgr0uy0LSeGd^PcoRy#8&)8Px*?RF5}LL~~!cw=8QgF_@4;+*IQmuUBbmlRaUs$>y1 zSAI7;&?8F*j291`QFr`(g7au^$W~|N&{|ZDe&{QAaOZ~8Ym}+yxu;Cn?1KO2rWv@Ro|PMe8#knX>MYJMT{A}FmeJKtE5l|Z#^Y~E z0}Om;k$~t6aO9|!?FC(@#5uD)=0%&GO~Rl%1w(xt zb=T13xhLPGJ>R{vNC{P>bQ|woJ>jE!N~8NDqQkxZN^S8yii<2?+WGPLnYF^5XmQ^& zBd5M|cg=Qvu)LHYf?+2rowOs5d3QZ)d0E)X|KXKsXYYp*9e=9}4*kqdOR`y`)4FO0 zl%7;eh-%ewLhq6Cb(y9iXeq&18uCTJ2|3?XJV__d(6<+#0D!6$x3KG`Av`;myl`%V zWlxDM`6czFL(q+aDF_-|x$S&i>@R%m1UYW6$Sje+Lnq&*z0740<;~bG59e``is4O66X2b=9;*?FQ+c z4RS#=Gus5{D0phHr2b7Mkq8)`|sN#(`*{ zE1%BWL-lMi9CToKE~Yy{6+{M0BxG4G52CR@3sT&(wUnGLjS!65!IJN!04>}EkBbTZ z3zqldF+tQSoy_hMH=lx_-iR2VndQ8YOI3O4pe3Mn<{kE|G2z^@o?WsNW2JrOF;z^5B=W%o=!pA@TM1B)0$)AxAFg1-{fIp*K%WNUMffpKqP__EPqAcqf|Kby zJI~S*R$a;DwFcESzFT%>B1m-Oa)yVvZ`)6*jiqHe62v-Dw1EypP2$tUeaHU$-qOBJ zkyw3&%fI??$_P(y@*XQw8_(6l4-viQ;mx!*`$^CX2E2-gY+fTcTkL5q99EQVq9A&7 zq0MC&{Cuwv05On&o`@kA1O3B*u?q0}Jq8?Ye2QSv{tQv2HphCl-Ia~rExQeEIz_lE zC3Y*;Z)BhrD|#~&7%T&Ip)r%CK(FlJ1f4bv;`y>WESQQ)h>Kr1zK;%&Cc{Zm?3PFY zOL>Q*^xO3nWXr&6J{JzYpI~*r*6+C9yjPIaJ(+eqX-4$!&GCI*7?VznnFwb_Y!WK@ zu~Rr#PU0<_M1V|3t5-x0@L6aQ%h9eKb#NY~C*~(e0;2&vngaNpfih441`B@~6cdnT zU4}3c0)yuB;NnP6!5U&>)F4OXDWuDw+`$tKgC+WC8#e(FF>wZvk*XY@p8~$E)q{=e z9+5^K=dJsknR`;!{Os~je$d^A$#=JKs)PT%y0`)&Mh52)+_W$Tk2cJ1Qc@pbX`3-o z!8I`X?G62c@VfV3puJ12!SP`IB_nMjjOoH7n}yA$vQ15`kCy++y%q_8?2-1O<-f0n zME8wUDnjlV$^Cwf{8#+IZ@jIdl*6p`J6}l81pVUyd?;6!nmw?F_}_Vj)tu3~y3u?I z29gNWLOKSNW9uc6xjP{zIX3@z`~E+hH{L++Q{W=ctUHrmZ1#0s0;K6J0bXqED`Da> zgA<1Hd|L@fRUvud?r%3D4n}{yZ#}Q4@}-f+RJvo3+nA01n3L6ISzov3JcxyHKN19N zC4WfzAM^rvC?-nD8LN`;do9*bR4Bct(AAX+^rjfmMu{ z>m|~MtJWaFd*9!~R~mu|uehu~n^W)1#>%W0_=0O&fko-U9|w8unA((K??(C6Guxtg zN5P{sbboTF2Q-_XPq{Q<-qDwbZZU;66DJ+u4&%>q&S zloujGWc3MElPFgyH?0vh_b`Vj!^Y5Gs4Zfu6sWd!F|Ls@*2z1~*gFR}r}$UsW-k|( zeQo~xvi$ED;op4b-+k48H^8sj7Qf10KnxcUY&11e(p@PR>=SWKAiQtaE{bZaxygOt z4}uH2Vx{@Np)_tlqJXl1Ozza3dMYw(!K5T0iIe=4nQej8i*;KO91D#}6u8+wqccVJ z$OOwY@$V;KmE>7gC};kiKhet8)3#l3pn*XS`dj^Z-5_qQ;CSoCkkz7Z4&{KP>tE*)VkF&rM<3;wNe~ZmfleZt80p(+%MW1Q=B&@jyck^1;A%|H z4=edKcf_2MIrRE_$(4JM3ajA~`TLo}%hb=$noay%JBxe8QNFKuKzyk;TGkU#XRVvmT_>@=`QYU6*^9}VZSTmniw6dCWwrGx z&5PLC`s+zTxz}s|oYLPcxG9)AKx{Jpd}R_!Re*J~)*JSx#=!hj*Y_oza{Jj{+= zHkNA78A$!+{8@hevuF>`Y!E|~AfXFf^~)-f)&eqdG4=7WeN_CxRpkfWT}!9xR|yw@ zr_zI7uBAx}$ijz%?lljBk3v4>CpHHi^56b-&CN}Y@!roYEy6KvgZDoXj_o|Zw9P4LTl6_;kp*c{U+lN;?|o+&|T)-dessuK(-sLGL4n!j7bEKXN$b$f`i#fVcK`w#SjCBbhgkWQ`p; z`uuxb6E{}${ip4bV`glgBb)Ed7KAOlQDKo7A@32&$#k2qsfeo zk!K4zNVYoTs&{58AhW~lFgt~vW&5jREVKK0W{>wFj#*~o$IM={ rtUkxz`+cZ@FooUan$@3@HNeRlEXW!v&l+yZ8o8M@ivNiKfXDvoai*&7VazGZwsOsqORMac)SNx18m>Kg zSsOmCy|So8)s|Cz+R@Gb871bKG{^7@U;~6Q7B26_haP!f`M0+6iq4WYYGpi6Yt>$} zCqGP>+11!a!ZT4CVuW}fSWj}h%wcV=?7Os*r^a7jWAf$FfpazHCRJqRNbu3$=d%x0 zcRSWrsMX$nSNYA6Eud*+Sg8x1*ZxE=5r$Nkgj}s2QrF}hyLz?lYW?%8*7&Oz@pZ=b zS1GesZzR=8&egTG)wQ>sa-nJqpVxJ-ukQ`1?@Ov5I9ET^R)7C_{lkTNnclTWA+W0$ zG1i7~rCfV{by=hA+DkoxzXCIHRV|o{u;ij|Jwr!wtx_wm&#k|%NP?XxC=WTfpNz=i zA{|-i16>@9wG3kc8(7FN)=~_v5Q54eHWigj#Z*%8+AwNKoq9LDQS*bilHBMfN=8uu z^hl%ehejmWgmP;#vu;}d8VLcFkQB5y27iN_9rT-70QR(!jw84=n8Io$t57Ctgb!a) z1oCwf4-93s(2`s5ZiE%G7C&DCE}TOQj3Pd!kUrAU!J%lHxE0$4V(mi=)Nmv*Iz`?@ zf&q0Yc!q^rkixZGSIvOyGh7wRg6okitB*-HE99bl1uD%6ROhO3KVS~a(7OPw4Rata()J$s@6R10MH5=B`7@<)&|zww&Fl3oL>{Okve{0>9p!?M8^M7^>=)tI)ZFDLf&v>z0emZg$tz6ZzvUY1|p=Aj)cUpRslLolohRj z;z9v*p%|ZoJ=ES8H3#b{5T6x&dO&g~z28U#>d}cPdVeQ;2Vqa(8VodxE)id2dRRA8 z_YDY@i*QOba*Z6L*`=p01$tNmkyQ9j*`PA959efA?re!J9K6H1J&1Bs!Psb@%7OQ@ za6bpt&)vIKPH4OIN3GLDt+gIz=3oe>4HJJZY`KE$QTNMoWRsh zU;rl|rr;W;P)ztBUZ`kv6K~i@g_0HS%S)hGI4PaUjfO^gsfoLdy@<-mqw zWC~T1BIY1TUsby$qqQr6N3Q^ zPs~V{%ik{72Y`9Ios)De(G5pD+EPsA;B*)gd*>bo85wAcJjLx<9|k)UdtD7kPpN?C zW_TtH_Nnj1c|tBFzyZU%7ROZ8$-plz5GMtB*6=h1k8{Il%MUh0J&1}145gTr49JBJ zY+>~cC65d9u;+8d(YaW^KL``RYvn+H!ukH>u>Q0~)s*&Uf_6AFWq@-cY%o$TIzBf* zlmQwh78kGGES>8y6OHZ_jiwes!d(*>mM_vCbN$+=kUW8|K*t<2Ii4Pj4Zs|A*GACm zoEq<0zPTs0x!*gdhNqG;&}xr&y=eGgq@_TW=|h&vqnLv*I))0`!7sG!@fFR;)uJ0` zSgL1O@SLnE>h=u|@(U(D6}Fb%4=O+!7ql&2YeR|=*l=)?F5gbhbHbkus=-fg2AqW_Mv<25%PAl{V|`JfWk4ch13dC**~u=%MhrPnR`t6+ZyR(H2B0g z8s}m_8iBiwqf`A02orSD4rPIgQvo4XfvUL%hceJMbKP1yVTZ6DJ$Tdsz?|i%VAe&$ zj~T=b^`j$FJe`Zu|EIcfatn>9=D$dM`Ac;(@k2QiCIN(Bim}gmKvd52)nu%uLjMC2 ze^M0EEW=~L+n-Ese^LWe;qg>}Fw-`k_hNjIF@7TkK*(AUVkj=UKQV=P=0!iI@!4?$ z%!O-k5%D>?@l)krxcUXhF01T0Vg!g3-K>y3?@&Ca8ca}~C!jxr7gIhiJpAmsNbKAK z<0&Ta69s8SC@U1M58LJnc22x_@yhV!)UKCCZnzr^LQ)58r218oEB-8dkqJWwWl#VW zOe;V_jF(!<5yXrw{54h85g=SMay?|7xz`eYN5P+D!9yt=L~WF|_p4V|ogQGmpeS<8 zf=E@Bsxr+0FN+}60{N{Dd6XFQl0j{3H&Om*HP z;$?s0r4m~i!cUGugWW_KL03^XA|s@`bfW@h-m}nN3eqbn)<}*aiAgvfNK?k3eLB!v zY_b0zEX)@~zw|v3fni9=dgAw-6~JsC7ghBT@6MX7Eq@(h3;(_dn*p%kVV?X)tbpo; zR@z3e8@gN##i+^KRSjJmg2gI^dOfmzR`d`Rx8QjkPCK8dey#WMBWjk*O5zXR5A*-J zy*uLKXMbGZA&7A^Gxxpa5a3(I#&j?i-n?~HZHrS=h$_bI5rJ1;e&>vi?$8mpm7h#q zAI>ks>RRaX){gg)|L=jD6ioJomMf38lUG!|jcGjZe7*=|0B^~qm~zXlCWRV@GY z^G6Oe(tI$T;NdtI(1ld5@XAkCen|;TA>T$ka4aj`XyChv;HDIz{5uUZZfArVxrR4C2lRl%SQdiWOPcJ?I zQPB&z%1LGN%4}iL6>Goqr4CEIPyYM&A@+`D;EN23b30r<6J22s1u#hN zRNyriNu+RvWS!Ci6U~3i12UFqy9b=OQceaz#0|D-DZ^BBgp;H19md4!x4lUR^>u>x z39?=;;S$XYw~F}qz9nvaT_4NvbdvNpf_Jk#_vnySL&}E}SmPF6)}DI08NyHruDp-! zv-x&^RcrAnAL~YQUq8DKRRmBq#rKVW!fY)Fs+3=y?nV&Q}-MG|>)X zF*@>|yv7@%h@7xf5ANcvEem@{2V;}m)ODrw?K?Ly!JgXU=k}NrftBH2P>hJm_sS1k zrRJFKoLEhvId78h%HTe}gbp=e40Qawg%;(G_x>y0UoLI6kMogZ z%9A^JJu1gHM_<{kmm{}dZYm01aUt2L;@v?FrO|HFmR3%P-|r8NM-P9x zHB(*3`P4S2^R>5yGxksKlsA+A0kNoq3!Hbzz;4Gu|AB|rP{S@d6Tn`1RBzv_$b{3~$F#EtKBt)OQ5 z?F=fWEJjlG4)$4k6>c$qa?d@s9bE7*ZG!9{aBj*vBKu-cHQ{}Xc|}*2-VKJ=eDS>E zDo=%PSgrAP+p_d6gb-FBf8E-d>N4l~Qm%?&_V<~=pToj8In=ieu1gWH+-*!pz4^W; ze=SO81{yHHvzIX_D@EGe)T2Ld-nssWKtO;_AV#meix5xAFbp9J%(A;wYQ7F!-Kt44m=Pe) z%y?ZBu)wg7WJ1P#rhdH0CVbn}vQRF#^ge`KJ0l_-E%4B0h|(`7Mua%jjI}oX;K#hE z!oLd4l?+_Yb0vfD^?;|rD(=Ei4x6tH(*P5=mL}I3(K1ZLTdLTXb}ddp*Wg}hU?3&; zwFrlw*oeaXYWMRbBQ|w;SOortj2)(N+P8yk8I6#E6tUmfx^Ek#D7nt0mUhqWw~v3e zIzDmB{<*K&q-bjW*s5=59iz?-r}dd2m77UBYParRYbGCpJWWe9u5#Xz;(xBB8E|!; zf2WP=e0hj1bu0hY`#eaiqGwd*Wso%*7iQd@?Q#Asq{;|gp3cA5-0qn=JHx+BTK`v6Y*MqDc}==p%Ty&(5`H97nm$Fw z;+?DhsL?==XX3TLqr=`^r^rmy=XtN5@zW8qN5Cv&9Dpu+TN~som3wT70F|+(UPW`{1{k(ezw77^k7)+Gf zL>6#S)dg~Qo!}5`b$si!UC_bWxXi)rYg*3zHHnDT&lvusB@n-%9?AOys-#His*DO? z{I$Ecn@`{`>n>dZ4Z8(L)v++J1{ zTwCXDHe4Y*sBkyHQF?4OUgN@~-Ig> zM^#8QcJJ~dmvy!u_V9>M?t*-R&OI`Hd|7vg8b^0$X5{I;MpHU%vI>X6rqv}!9;{9y z1#$=74`52yMXy&&A3picB!1`=bgcT=g%i?g&UC%DQ0|McDbnp`Wgb#x3AE0`{(k1? z)DP5L+2H!le#OcvGTLNta@q6X$K*JZq64&9s|D2?uZPZ7zMb$19fCE3wvPT4a3hzE z9BSeSyOyCcxL0OPKV-mtW5bn~{kYxfPI6t-NQ%_R9lS;6x?ky`O+E+=Ed9nt#eFl$ z3DiESV&S}c>B3or`gX>)*p;Ae@P47nmKH!2A%Ag$c=<*Tv3k{Im+%HOXm5hrOJ8N!=IiNelrj>Sh*w^6u1A(xVGvEA29%3ej-Q}zADMc$JP8y}H<-iz=`z5ZJT>q2s* z4s2ff4<>Qn=1P2-xBI(77HMgOWc5-6+Hy(Z60iGply)iF>=hauE1E8WbsWuLvu5`P{*7IeQ}ZqL8)H~-**hoIaI zrDB4C$e6u4Jhx*A504hc&K4}wrj6TjQ;sGqV$&9|97GL$qJ`tNSI9@yXqmKUXd2{oXBey=CINbc4HrPwtl0fOCb|%G-R9BXVktTK~4~N)WRzNGb?nWEqOvGJ*x9 zf%PkxfVB`f@Z~x*-xl%xR@8TXlarGt3t=zCSV%K>b8j!(tGOefjVVD{WoK$gE_K|? zFdPR}0j;jbnHU9N@8E20NwKD2k1=?wliE3@W+a-{rUF642oNG}FQ)R9kuv9Y&hr5~ zV8hZGd(A`wJy`g7pD>-0u3D$ z@w;7s-1q3azgx-QvG?*hdxW9d&~Eb3Mas~}C`_&BS{X#HzwcA`UD!;^LC-riq~u+1 zCy3h#5EXBrlF<(1uKCmH+_O%-73-|cJm+XmOog(Q0UZri%RiQeHk`Y4C+t_&Hq1V0zk`i zOD1GV|FAhzLQDmmQn^6bcx$7Ch~6)sO>~# zB_V2`@EALLnTV^-x?nIM%pCxqt^@H*M7|>$RgjTN$F82kk}cEMgk@~wf{D!qDvdX7 znBedGH&?l-9d}b}lc(#4qd60NTR9Sxr=QzYq{8F|Ds;o?T=qDxjpa#eL1Am$^8o}3 z5>S~aj!G$4HUt^c3#IVxcQ}`G; zu!@?_3xn25|8H^l`jjjq2Dpxf$*e-hfJhQctX%+-3V6|lyfW#)gE|nDpiE%C9i1;j z4mQ%y6fS0+3WHRg>`zAwsL4u~1$df~0{}ct$=R|X$e5{m#UVa?-RnD*f|#Cm zy*qGXX_-sscSx?`_r_*y-|@|D3VhUtWlg1AvYJ{9sif8Ue9SKHVNJD0XTm4eoiiuS zo{c0e_*z7NEs$(oVpwr!w-99{d1@iqVZ_{i;|Y#7zw!Yk7fl9wJU4r#OZyg^`ctw8 ziaSWC)%U(bK0Q(nm%~@y`klo=v@RQIvCvtKp>%1`z@wB0jgp#Nhi9V^`eU1MK3u>@ z0eO;vFm_H!>ds6U8CLqND2SLG)9EC`#FUOr8-$2&b>%z># ziva=)=s1nWEhVg%+W373jOROx=R;LK%DOhJ8{O;me_?u5C*7ZpvZYh+E(QCJhYg$# z8@f#BAx-xF7bf+Z{9FebNKd+M;!}SEs*rc4RIsi9aqnnf&;USYp|!< z!#O;8PI-X%7?;O?@nYA?ZT<0ahzl(5Ou8n9##^h&XEioB?H4+0%7TUHH1q4!c|;Nw ziP(jp5W|tc-9vySfU=~F9^Z6k>*@~A z0c<{V8?DJQ`1H0+5o#kB;mrgAE`n1QljqOO*lBsfZ$1CQ=!tUDjfSH!VI#v{N2R$=R{yny=Iox2`Q`{33j80}aEq#>&ikw~E z#(b*6d&<7x+cvjDW$bB6$BwjJ(9(@m8hjs3J#{dcYC*l9c zYV6}lQDiLRBL#uWRoR)^nc0t&EuIm<2;t!GvOz9qVjl7B}9o+I%~r4_(d-&tcc@WQ@{_DtFBjVcE=WraDsK6Fx6N{;AO(AGXfV1%= z7fPsZt*%Sy{->BSjBMyy`-!*lpGMAoLcg)CYyTAWFKcFOsBQdHeF|RcW;bPJ7d&ve zk%j*57yDylY#SHLNsFC7@S>Q-cddzymc%X|4tm#W`lso!21_s-lXs|eW~0s%&NyPt zUNi4qERMI=n=(;`UKP5DmT}BvRE9)R=Qr8OcDB)ZTl3x{9_Ee)>EE{`s&KMVTyAd2 zr^mZzr@}tMKVw?r##l#>j6Mu;&}wdEeX6e^G`yWfvr%{WQ^q%WWaF<_#}1qNMYSG) z=A&G1mV9}2-FNv#f>py&>x0ly8NW60%I<$hLpd zCd1#x``9{V*0OotW)XlN5Ev``p29p;`9}xi!*5Eyu3Hi3;Tk8W*;Vfos)|%RIp2$G zGgT=p+MemH+eS~i4NM2 zrf(;f-Ap|9DzW@?;zebmNHwX#IO)=gq)KeU&VmdMZJ}yUQgy;Yb?idr#iXkZNp*LU z>W7oAy-K?Nc_F4hQ9S&6`dd=disWY3KNb1&+}(e&y_0Wpk|p_nvb=#5;5QadyfvKM z@hZ7<$FI{C^Ch2?yNpx1S1cYfc48OwW82rJ^u?z1a~6H_*|%ep2O3iD-ATFcubY4K h&)wmaVP%R;HFd-|_0fvd$F8YQ{8L9SE^q3?R!@G1ZR 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 db5ac254..c1a65db2 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 4c018eda..63c843d2 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, '', {skip_undo : 1}); + ed.execCommand('mceInsertContent', false, '', {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 cdc149b5..7a4699b5 100644 --- a/wp-includes/js/tinymce/themes/advanced/link.htm +++ b/wp-includes/js/tinymce/themes/advanced/link.htm @@ -2,11 +2,11 @@ {#advanced_dlg.link_title} - - - - - + + + + + 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 c13d0a3e..cb7604e7 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 0a73a575..a4049317 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 16d589c4..0ae41557 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 @@ -1,4 +1,4 @@ -body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body, td {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} body {background:#FFF;} body.mceForceColors {background:#FFF; color:#000;} h1 {font-size: 2em} @@ -8,19 +8,12 @@ h4 {font-size: 1em} h5 {font-size: .83em} h6 {font-size: .75em} .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(img/items.gif) no-repeat bottom left;} -img.mceItemAnchor {width:12px; height:12px; background:url(img/items.gif) no-repeat;} +a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;} +img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;} img {border:0;} - -/* IE -* html body { -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -} -*/ \ No newline at end of file +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} diff --git a/wp-includes/js/tinymce/themes/advanced/source_editor.htm b/wp-includes/js/tinymce/themes/advanced/source_editor.htm index dcc636db..2c709c9e 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 @@ {#advanced_dlg.code_title} - - + + diff --git a/wp-includes/js/tinymce/tiny_mce.js b/wp-includes/js/tinymce/tiny_mce.js index bc86c405..1d2a8034 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=items.length){for(i=0;i=items.length||base[i]!=items[i]){bp=i+1;break;}}}if(base.length=base.length||base[i]!=items[i]){bp=i+1;break;}}}if(bp==1)return path;for(i=0;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='[';i0?',':'')+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=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+'';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='
      '+h;e.removeChild(e.firstChild);}catch(ex){while(e.firstChild)e.firstChild.removeNode();x=t.create('div');x.innerHTML='
      '+h;each(x.childNodes,function(n,i){if(i)e.appendChild(n);});}};if(t.settings.fix_ie_paragraphs)h=h.replace(/

      <\/p>|]+)><\/p>|/gi,' 

      ');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(/]+)>|

      /g,'');h=h.replace(/<\/p>/g,'

      ');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|]+)>/gi,'<$1b$2>');h=h.replace(/<(\/?)em>|]+)>/gi,'<$1i$2>');}else if(isIE)h=h.replace(/'/g,''');h=h.replace(/]+)\/>|/gi,'');if(s.keep_values){if(h.indexOf('/g,'';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+='';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('','g'),'');});};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,'
      ');});}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*/,'');o.content=o.content.replace(/<\/pre>\s*$/,'');if(o.set)o.content='
      '+o.content+'
      ';});}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(/^(

      ( | |\s|\u00a0|)<\/p>[\r\n]*|
      [\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(),'
      ',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=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,'']);t.addShortcut('ctrl+7','',['FormatBlock',false,'

      ']);t.addShortcut('ctrl+8','',['FormatBlock',false,'

      ']);t.addShortcut('ctrl+9','',['FormatBlock',false,'
      ']);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.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+='';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('
      ');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||'

      '):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;i0){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','gi');t.rePadd=new RegExp(']+)><\\\/p>|]+)\\\/>|]+)>\\s+<\\\/p>|

      <\\\/p>||

      \\s+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR1=new RegExp(']+)>[\\s\\u00a0]+<\\\/p>|

      [\\s\\u00a0]+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR2=new RegExp(']+)>( | )<\\\/p>|

      ( | )<\\\/p>'.replace(/p/g,elm),'gi');t.reBR2Nbsp=new RegExp(']+)>\\s*
      \\s*<\\\/p>|

      \\s*
      \\s*<\\\/p>'.replace(/p/g,elm),'gi');t.reTrailBr=new RegExp('\\s*
      \\s*<\\\/p>'.replace(/p/g,elm),'gi');function padd(ed,o){if(isOpera)o.content=o.content.replace(t.reOpera,'');o.content=o.content.replace(t.rePadd,'<'+elm+'$1$2$3$4$5$6>\u00a0');if(!isIE&&!isOpera&&o.set){o.content=o.content.replace(t.reNbsp2BR1,'<'+elm+'$1$2>
      ');o.content=o.content.replace(t.reNbsp2BR2,'<'+elm+'$1$2>
      ');}else{o.content=o.content.replace(t.reBR2Nbsp,'<'+elm+'$1$2>\u00a0');o.content=o.content.replace(t.reTrailBr,'');}};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('
      ',{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,'
      ');aft=ed.dom.add(sn,se.element,null,'
      ');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='
      ';if(isEmpty(aft))aft.innerHTML=isOpera?' ':'
      ';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(yvp.y+vp.h){ed.getWin().scrollTo(0,y=items.length){for(i=0;i=items.length||base[i]!=items[i]){bp=i+1;break;}}}if(base.length=base.length||base[i]!=items[i]){bp=i+1;break;}}}if(bp==1)return path;for(i=0;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='[';i0?',':'')+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=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+'';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;case"shape":e.setAttribute('mce_style',v);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|shape)$/.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'maxlength':case'tabindex':if(v===32768||v===2147483647)v='';break;case'noshade':if(v===65535)return'noshade';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];};st=st.replace(/&(#?[a-z0-9]+);/g,'&$1_MCE_SEMI_');each(st.split(';'),function(v){var sv,ur=[];if(v){v=v.replace(/_MCE_SEMI_/g,';');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('+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){if(tinymce.isGecko&&k.indexOf('-moz-')===0)return;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='
      '+h;e.removeChild(e.firstChild);}catch(ex){while(e.firstChild)e.firstChild.removeNode();x=t.create('div');x.innerHTML='
      '+h;each(x.childNodes,function(n,i){if(i)e.appendChild(n);});}};if(t.settings.fix_ie_paragraphs)h=h.replace(/

      <\/p>|]+)><\/p>|/gi,' 

      ');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(/]+)>|

      /g,'');h=h.replace(/<\/p>/g,'

      ');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|]+)>/gi,'<$1b$2>');h=h.replace(/<(\/?)em>|]+)>/gi,'<$1i$2>');}else if(isIE)h=h.replace(/'/g,''');h=h.replace(/]+)\/>|/gi,'');if(s.keep_values){if(/|\/\/\s*-->|\]\]>|-->)\s*$/g,'');return s;};h=h.replace(/]+|)>([\s\S]*?)<\/script>/g,function(v,a,b){b=trim(b);if(!a)a=' type="text/javascript"';if(b)b='';return''+b+'';});h=h.replace(/]+|)>([\s\S]*?)<\/style>/g,function(v,a,b){b=trim(b);return''+b+'';});}h=h.replace(/<([\w:]+) [^>]*(src|href|style|shape|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'&&b!='shape'){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|shape)=[\"]([^\"]+)[\"]/gi,handle);a=a.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi,handle);return a.replace(/ (src|href|style|coords|shape)=([^\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'&';case'"':return'"';case'<':return'<';case'>':return'>';}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|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('';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+='';if(tinymce.relaxedDomain){if(isIE||(tinymce.isOpera&&parseFloat(opera.version())>=9.5))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('','g'),'');});};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,'
      ');});}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*/,'');o.content=o.content.replace(/<\/pre>\s*$/,'');if(o.set)o.content='
      '+o.content+'
      ';});}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(/^(

      ( | |\s|\u00a0|)<\/p>[\r\n]*|
      [\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&&(!isIE||t.selection.getNode().ownerDocument!=t.getDoc()))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(),'
      ');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=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,'']);t.addShortcut('ctrl+7','',['FormatBlock',false,'

      ']);t.addShortcut('ctrl+8','',['FormatBlock',false,'

      ']);t.addShortcut('ctrl+9','',['FormatBlock',false,'
      ']);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.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+='';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.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(bl||n.parentNode,'textAlign','');dom.setStyle(n,'float','');this.mceRepaint();return;}if(v=='center'){if(bl&&/^(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(bl||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('
      ');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||'

      '):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;i0){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','gi');t.rePadd=new RegExp(']+)><\\\/p>|]+)\\\/>|]+)>\\s+<\\\/p>|

      <\\\/p>||

      \\s+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR1=new RegExp(']+)>[\\s\\u00a0]+<\\\/p>|

      [\\s\\u00a0]+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR2=new RegExp(']+)>( | )<\\\/p>|

      ( | )<\\\/p>'.replace(/p/g,elm),'gi');t.reBR2Nbsp=new RegExp(']+)>\\s*
      \\s*<\\\/p>|

      \\s*
      \\s*<\\\/p>'.replace(/p/g,elm),'gi');t.reTrailBr=new RegExp('\\s*
      \\s*<\\\/p>'.replace(/p/g,elm),'gi');function padd(ed,o){if(isOpera)o.content=o.content.replace(t.reOpera,'');o.content=o.content.replace(t.rePadd,'<'+elm+'$1$2$3$4$5$6>\u00a0');if(!isIE&&!isOpera&&o.set){o.content=o.content.replace(t.reNbsp2BR1,'<'+elm+'$1$2>
      ');o.content=o.content.replace(t.reNbsp2BR2,'<'+elm+'$1$2>
      ');}else{o.content=o.content.replace(t.reBR2Nbsp,'<'+elm+'$1$2>\u00a0');o.content=o.content.replace(t.reTrailBr,'');}};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('
      ',{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,'
      ');aft=ed.dom.add(sn,se.element,null,'
      ');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='
      ';if(isEmpty(aft))aft.innerHTML=isOpera?' ':'
      ';if(isOpera&&parseFloat(opera.version())<9.5){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(yvp.y+vp.h){ed.getWin().scrollTo(0,y 'url'. @@ -109,7 +105,7 @@ if ( ! empty($mce_external_plugins) ) { foreach ( $mce_external_plugins as $name => $url ) { - if ( $https ) $url = str_replace('http://', 'https://', $url); + if ( is_ssl() ) $url = str_replace('http://', 'https://', $url); $plugins[] = '-' . $name; @@ -122,7 +118,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' )); @@ -134,6 +130,8 @@ $mce_buttons_3 = implode($mce_buttons_3, ','); $mce_buttons_4 = apply_filters('mce_buttons_4', array()); $mce_buttons_4 = implode($mce_buttons_4, ','); +$no_captions = ( apply_filters( 'disable_captions', '' ) ) ? true : false; + // TinyMCE init settings $initArray = array ( 'mode' => 'none', @@ -167,6 +165,7 @@ $initArray = array ( 'tab_focus' => ':next', 'content_css' => "$mce_css", 'save_callback' => 'switchEditors.saveCallback', + 'wpeditimage_disable_captions' => $no_captions, 'plugins' => "$plugins", // pass-through the settings for compression and caching, so they can be changed with "tiny_mce_before_init" 'disk_cache' => true, @@ -206,14 +205,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 +225,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', '20080810'); foreach ( $initArray as $v ) $cacheKey .= $v; @@ -273,7 +272,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=311" };'; // Load patch $content .= getFileContents( 'tiny_mce_ext.js' ); @@ -329,4 +328,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 6eab9106..cee045d2 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 84cbded5..6c8f73b6 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 7f58dfc3..c1bfa739 100644 --- a/wp-includes/js/tinymce/utils/editable_selects.js +++ b/wp-includes/js/tinymce/utils/editable_selects.js @@ -1,5 +1,5 @@ /** - * $Id: editable_selects.js 520 2008-01-07 16:30:32Z spocke $ + * $Id: editable_selects.js 867 2008-06-09 20:33:40Z spocke $ * * Makes select boxes editable. * @@ -39,6 +39,7 @@ var TinyMCE_EditableSelects = { se.style.display = 'none'; ne.focus(); ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput; + ne.onkeydown = TinyMCE_EditableSelects.onKeyDown; TinyMCE_EditableSelects.editSelectElm = se; } }, @@ -57,5 +58,12 @@ var TinyMCE_EditableSelects = { se.parentNode.removeChild(se.previousSibling); TinyMCE_EditableSelects.editSelectElm = null; } + }, + + onKeyDown : function(e) { + e = e || window.event; + + if (e.keyCode == 13) + TinyMCE_EditableSelects.onBlurEditableSelectInput(); } }; diff --git a/wp-includes/js/tinymce/utils/mctabs.js b/wp-includes/js/tinymce/utils/mctabs.js index 63d457db..13518064 100644 --- a/wp-includes/js/tinymce/utils/mctabs.js +++ b/wp-includes/js/tinymce/utils/mctabs.js @@ -1,5 +1,5 @@ /** - * $Id: mctabs.js 520 2008-01-07 16:30:32Z spocke $ + * $Id: mctabs.js 758 2008-03-30 13:53:29Z spocke $ * * Moxiecode DHTML Tabs script. * @@ -8,7 +8,7 @@ */ function MCTabs() { - this.settings = new Array(); + this.settings = []; }; MCTabs.prototype.init = function(settings) { @@ -28,17 +28,19 @@ MCTabs.prototype.getParam = function(name, default_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'); + 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) { - var nodes = tabContainerElm.childNodes; + nodes = tabContainerElm.childNodes; // Hide all other tabs - for (var i=0; i @@ -6,10 +6,10 @@ header('Content-Type: text/html; charset=' . get_bloginfo('charset')); <?php _e('Rich Editor Help') ?> - +