<body>
<h1 id="logo" style="text-align: center">
<img alt="WordPress" src="wp-admin/images/wordpress-logo.png" />
- <br /> Version 2.8.5
+ <br /> Version 2.9
</h1>
<p style="text-align: center">Semantic Personal Publishing Platform</p>
<h1>Upgrading</h1>
<p>Before you upgrade anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</p>
-<h2>Upgrading from any previous WordPress to 2.8.5:</h2>
+<h2>Upgrading from any previous WordPress to 2.9:</h2>
<ol>
<li>Delete your old WP files, saving ones you've modified.</li>
<li>Upload the new files.</li>
<h1>System Recommendations</h1>
<ul>
<li>PHP version <strong>4.3</strong> or higher.</li>
- <li>MySQL version <strong>4.0</strong> or higher.</li>
+ <li>MySQL version <strong>4.1.2</strong> or higher.</li>
<li>... and a link to <a href="http://wordpress.org/">http://wordpress.org</a> on your site.</li>
</ul>
<p>WordPress is the official continuation of <a href="http://cafelog.com/">b2/cafélog</a>, which came from Michel V. The work has been continued by the <a href="http://wordpress.org/about/">WordPress developers</a>. If you would like to support WordPress, please consider <a href="http://wordpress.org/donate/">donating</a>.</p>
$x->send();
}
- if ( !empty( $_POST['action']) )
- do_action( 'wp_ajax_nopriv_' . $_POST['action'] );
+ if ( !empty( $_REQUEST['action']) )
+ do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] );
die('-1');
}
echo $test_str;
die;
} elseif ( 2 == $_GET['test'] ) {
+ if ( !isset($_SERVER['HTTP_ACCEPT_ENCODING']) )
+ die('-1');
if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
header('Content-Encoding: deflate');
$out = gzdeflate( $test_str, 1 );
die('0');
break;
+case 'imgedit-preview' :
+ $post_id = intval($_GET['postid']);
+ if ( empty($post_id) || !current_user_can('edit_post', $post_id) )
+ die('-1');
+
+ check_ajax_referer( "image_editor-$post_id" );
+
+ include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
+ if ( !stream_preview_image($post_id) )
+ die('-1');
+
+ die();
+ break;
+case 'oembed-cache' :
+ $return = ( $wp_embed->cache_oembed( $_GET['post'] ) ) ? '1' : '0';
+ die( $return );
+ break;
default :
do_action( 'wp_ajax_' . $_GET['action'] );
die('0');
if ( 0 != $total % $per_page && 1 != mt_rand( 1, $per_page ) ) // Only do the expensive stuff on a page-break, and about 1 other time per page
die( (string) time() );
+ $post_id = 0;
$status = 'total_comments'; // What type of comment count are we looking for?
$parsed = parse_url( $url );
if ( isset( $parsed['query'] ) ) {
parse_str( $parsed['query'], $query_vars );
if ( !empty( $query_vars['comment_status'] ) )
$status = $query_vars['comment_status'];
+ if ( !empty( $query_vars['p'] ) )
+ $post_id = (int) $query_vars['p'];
}
- $comment_count = wp_count_comments();
+ $comment_count = wp_count_comments($post_id);
$time = time(); // The time since the last comment count
if ( isset( $comment_count->$status ) ) // We're looking for a known type of comment count
$id = isset($_POST['id'])? (int) $_POST['id'] : 0;
switch ( $action = $_POST['action'] ) :
case 'delete-comment' : // On success, die with time() instead of 1
- check_ajax_referer( "delete-comment_$id" );
if ( !$comment = get_comment( $id ) )
die( (string) time() );
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
die('-1');
- if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) {
- if ( 'spam' == wp_get_comment_status( $comment->comment_ID ) )
+ check_ajax_referer( "delete-comment_$id" );
+ $status = wp_get_comment_status( $comment->comment_ID );
+
+ if ( isset($_POST['trash']) && 1 == $_POST['trash'] ) {
+ if ( 'trash' == $status )
die( (string) time() );
- $r = wp_set_comment_status( $comment->comment_ID, 'spam' );
- } else {
+ $r = wp_trash_comment( $comment->comment_ID );
+ } elseif ( isset($_POST['untrash']) && 1 == $_POST['untrash'] ) {
+ if ( 'trash' != $status )
+ die( (string) time() );
+ $r = wp_untrash_comment( $comment->comment_ID );
+ } elseif ( isset($_POST['spam']) && 1 == $_POST['spam'] ) {
+ if ( 'spam' == $status )
+ die( (string) time() );
+ $r = wp_spam_comment( $comment->comment_ID );
+ } elseif ( isset($_POST['unspam']) && 1 == $_POST['unspam'] ) {
+ if ( 'spam' != $status )
+ die( (string) time() );
+ $r = wp_unspam_comment( $comment->comment_ID );
+ } elseif ( isset($_POST['delete']) && 1 == $_POST['delete'] ) {
$r = wp_delete_comment( $comment->comment_ID );
+ } else {
+ die('-1');
}
+
if ( $r ) // Decide if we need to send back '1' or a more complicated response including page links and comment counts
_wp_ajax_delete_comment_response( $comment->comment_ID );
die( '0' );
die('0');
break;
case 'delete-tag' :
- check_ajax_referer( "delete-tag_$id" );
+ $tag_id = (int) $_POST['tag_ID'];
+ check_ajax_referer( "delete-tag_$tag_id" );
if ( !current_user_can( 'manage_categories' ) )
die('-1');
- if ( !empty($_POST['taxonomy']) )
- $taxonomy = $_POST['taxonomy'];
- else
- $taxonomy = 'post_tag';
+ $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
- $tag = get_term( $id, $taxonomy );
+ $tag = get_term( $tag_id, $taxonomy );
if ( !$tag || is_wp_error( $tag ) )
die('1');
- if ( wp_delete_term($id, $taxonomy))
+ if ( wp_delete_term($tag_id, $taxonomy))
die('1');
else
die('0');
else
die('0');
break;
+case 'trash-post' :
+case 'untrash-post' :
+ check_ajax_referer( "{$action}_$id" );
+ if ( !current_user_can( 'delete_post', $id ) )
+ die('-1');
+
+ if ( !get_post( $id ) )
+ die('1');
+
+ if ( 'trash-post' == $action )
+ $done = wp_trash_post( $id );
+ else
+ $done = wp_untrash_post( $id );
+
+ if ( $done )
+ die('1');
+
+ die('0');
+ break;
case 'delete-page' :
check_ajax_referer( "{$action}_$id" );
if ( !current_user_can( 'delete_page', $id ) )
$x->send();
}
- if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
- die('-1');
- if ( !current_user_can( 'moderate_comments' ) )
+ if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) && !current_user_can( 'moderate_comments' ) )
die('-1');
$current = wp_get_comment_status( $comment->comment_ID );
if ( $_POST['new'] == $current )
die( (string) time() );
- $r = 0;
- if ( in_array( $current, array( 'unapproved', 'spam' ) ) ) {
- check_ajax_referer( "approve-comment_$id" );
+ check_ajax_referer( "approve-comment_$id" );
+ if ( in_array( $current, array( 'unapproved', 'spam' ) ) )
$result = wp_set_comment_status( $comment->comment_ID, 'approve', true );
- } else {
- check_ajax_referer( "unapprove-comment_$id" );
+ else
$result = wp_set_comment_status( $comment->comment_ID, 'hold', true );
- }
+
if ( is_wp_error($result) ) {
$x = new WP_Ajax_Response( array(
'what' => 'comment',
$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;
+ $popular_ids = wp_popular_terms_checklist('category', 0, 10, false);
- $x = new WP_Ajax_Response();
foreach ( $names as $cat_name ) {
$cat_name = trim($cat_name);
$category_nicename = sanitize_title($cat_name);
wp_category_checklist( 0, $cat_id, $checked_categories, $popular_ids );
$data = ob_get_contents();
ob_end_clean();
- $x->add( array(
+ $add = array(
'what' => 'category',
'id' => $cat_id,
- 'data' => $data,
+ 'data' => str_replace( array("\n", "\t"), '', $data),
'position' => -1
- ) );
+ );
}
if ( $parent ) { // Foncy - replace the parent and all its children
$parent = get_category( $parent );
+ $term_id = $parent->term_id;
+
+ while ( $parent->parent ) { // get the top parent
+ $parent = &get_category( $parent->parent );
+ if ( is_wp_error( $parent ) )
+ break;
+ $term_id = $parent->term_id;
+ }
+
ob_start();
- dropdown_categories( 0, $parent );
+ wp_category_checklist( 0, $term_id, $checked_categories, $popular_ids, null, false );
$data = ob_get_contents();
ob_end_clean();
- $x->add( array(
+ $add = array(
'what' => 'category',
- 'id' => $parent->term_id,
- 'old_id' => $parent->term_id,
- 'data' => $data,
+ 'id' => $term_id,
+ 'data' => str_replace( array("\n", "\t"), '', $data),
'position' => -1
- ) );
-
+ );
}
+
+ ob_start();
+ wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category') ) );
+ $sup = ob_get_contents();
+ ob_end_clean();
+ $add['supplemental'] = array( 'newcat_parent' => $sup );
+
+ $x = new WP_Ajax_Response( $add );
$x->send();
break;
case 'add-link-category' : // On the Fly
if ( !current_user_can( 'manage_categories' ) )
die('-1');
- if ( '' === trim($_POST['name']) ) {
- $x = new WP_Ajax_Response( array(
- 'what' => 'tag',
- 'id' => new WP_Error( 'name', __('You did not enter a tag name.') )
- ) );
- $x->send();
- }
-
- if ( !empty($_POST['taxonomy']) )
- $taxonomy = $_POST['taxonomy'];
- else
- $taxonomy = 'post_tag';
-
- $tag = wp_insert_term($_POST['name'], $taxonomy, $_POST );
+ $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
+ $tag = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST );
- if ( is_wp_error($tag) ) {
- $x = new WP_Ajax_Response( array(
- 'what' => 'tag',
- 'id' => $tag
- ) );
- $x->send();
+ if ( !$tag || is_wp_error($tag) || (!$tag = get_term( $tag['term_id'], $taxonomy )) ) {
+ echo '<div class="error"><p>' . __('An error has occured. Please reload the page and try again.') . '</p></div>';
+ exit;
}
- if ( !$tag || (!$tag = get_term( $tag['term_id'], $taxonomy )) )
- die('0');
-
- $tag_full_name = $tag->name;
- $tag_full_name = esc_attr($tag_full_name);
-
- $x = new WP_Ajax_Response( array(
- 'what' => 'tag',
- 'id' => $tag->term_id,
- 'position' => '-1',
- 'data' => _tag_row( $tag, '', $taxonomy ),
- 'supplemental' => array('name' => $tag_full_name, 'show-link' => sprintf(__( 'Tag <a href="#%s">%s</a> added' ), "tag-$tag->term_id", $tag_full_name))
- ) );
- $x->send();
+ echo _tag_row( $tag, '', $taxonomy );
+ exit;
break;
case 'get-tagcloud' :
if ( !current_user_can( 'edit_posts' ) )
break;
case 'add-comment' :
check_ajax_referer( $action );
- if ( !current_user_can( 'edit_post', $id ) )
+ if ( !current_user_can( 'edit_posts' ) )
die('-1');
$search = isset($_POST['s']) ? $_POST['s'] : false;
$status = isset($_POST['comment_status']) ? $_POST['comment_status'] : 'all';
if ( empty($status) )
die('1');
- elseif ( in_array($status, array('draft', 'pending') ) )
+ elseif ( in_array($status, array('draft', 'pending', 'trash') ) )
die( __('Error: you are replying to a comment on a draft post.') );
$user = wp_get_current_user();
$message = sprintf( __('Draft Saved at %s.'), date_i18n( $draft_saved_date_format ) );
$supplemental = array();
+ if ( isset($login_grace_period) )
+ $supplemental['session_expired'] = add_query_arg( 'interim-login', 1, wp_login_url() );
$id = $revision_id = 0;
if($_POST['post_ID'] < 0) {
case 'autosave-generate-nonces' :
check_ajax_referer( 'autosave', 'autosavenonce' );
$ID = (int) $_POST['post_ID'];
- if($_POST['post_type'] == 'post') {
- if(current_user_can('edit_post', $ID))
- die(wp_create_nonce('update-post_' . $ID));
- }
- if($_POST['post_type'] == 'page') {
- if(current_user_can('edit_page', $ID)) {
- die(wp_create_nonce('update-page_' . $ID));
- }
- }
+ $post_type = ( 'page' == $_POST['post_type'] ) ? 'page' : 'post';
+ if ( current_user_can( "edit_{$post_type}", $ID ) )
+ die( json_encode( array( 'updateNonce' => wp_create_nonce( "update-{$post_type}_{$ID}" ), 'deleteURL' => str_replace( '&', '&', wp_nonce_url( admin_url( $post_type . '.php?action=trash&post=' . $ID ), "trash-{$post_type}_{$ID}" ) ) ) ) );
+ do_action('autosave_generate_nonces');
die('0');
break;
case 'closed-postboxes' :
update_usermeta($user->ID, 'closedpostboxes_'.$page, $closed);
if ( is_array($hidden) ) {
- $hidden = array_diff( $hidden, array('submitdiv', 'pagesubmitdiv', 'linksubmitdiv') ); // postboxes that are always shown
+ $hidden = array_diff( $hidden, array('submitdiv', 'linksubmitdiv') ); // postboxes that are always shown
update_usermeta($user->ID, 'meta-box-hidden_'.$page, $hidden);
}
break;
case 'tag' :
- if ( !empty($_POST['taxonomy']) )
- $taxonomy = $_POST['taxonomy'];
- else
- $taxonomy = 'post_tag';
+ $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
$tag = get_term( $id, $taxonomy );
$_POST['description'] = $tag->description;
if ( !$tag || is_wp_error( $tag ) )
die( __('Tag not updated.') );
- echo _tag_row($tag);
+ echo _tag_row($tag, '', $taxonomy);
} else {
die( __('Tag not updated.') );
}
$what = isset($_POST['pages']) ? 'page' : 'post';
$s = stripslashes($_POST['ps']);
preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches);
- $search_terms = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
+ $search_terms = array_map('_search_terms_tidy', $matches[0]);
$searchand = $search = '';
- foreach( (array) $search_terms as $term) {
+ foreach ( (array) $search_terms as $term ) {
$term = addslashes_gpc($term);
$search .= "{$searchand}(($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%'))";
$searchand = ' AND ';
if ( count($search_terms) > 1 && $search_terms[0] != $s )
$search .= " OR ($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%')";
- $posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND $search ORDER BY post_date_gmt DESC LIMIT 50" );
+ $posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND post_status IN ('draft', 'publish') AND ($search) ORDER BY post_date_gmt DESC LIMIT 50" );
if ( ! $posts )
exit( __('No posts found.') );
- $html = '<table class="widefat" cellspacing="0"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th>'.__('Time').'</th><th>'.__('Status').'</th></tr></thead><tbody>';
+ $html = '<table class="widefat" cellspacing="0"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th>'.__('Date').'</th><th>'.__('Status').'</th></tr></thead><tbody>';
foreach ( $posts as $post ) {
switch ( $post->post_status ) {
$stat = __('Pending Review');
break;
case 'draft' :
- $stat = __('Unpublished');
+ $stat = __('Draft');
break;
}
die();
break;
+case 'image-editor':
+ $attachment_id = intval($_POST['postid']);
+ if ( empty($attachment_id) || !current_user_can('edit_post', $attachment_id) )
+ die('-1');
+
+ check_ajax_referer( "image_editor-$attachment_id" );
+ include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
+
+ $msg = false;
+ switch ( $_POST['do'] ) {
+ case 'save' :
+ $msg = wp_save_image($attachment_id);
+ $msg = json_encode($msg);
+ die($msg);
+ break;
+ case 'scale' :
+ $msg = wp_save_image($attachment_id);
+ break;
+ case 'restore' :
+ $msg = wp_restore_image($attachment_id);
+ break;
+ }
+
+ wp_image_editor($attachment_id, $msg);
+ die();
+ break;
+case 'set-post-thumbnail':
+ $post_id = intval( $_POST['post_id'] );
+ if ( !current_user_can( 'edit_post', $post_id ) )
+ die( '-1' );
+ $thumbnail_id = intval( $_POST['thumbnail_id'] );
+
+ if ( $thumbnail_id == '-1' ) {
+ delete_post_meta( $post_id, '_thumbnail_id' );
+ die( _wp_post_thumbnail_html() );
+ }
+
+ if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
+ $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' );
+ if ( !empty( $thumbnail_html ) ) {
+ update_post_meta( $post_id, '_thumbnail_id', $thumbnail_id );
+ die( _wp_post_thumbnail_html( $thumbnail_id ) );
+ }
+ }
+ die( '0' );
default :
do_action( 'wp_ajax_' . $_POST['action'] );
die('0');
//<![CDATA[
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'};
-var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = '<?php echo substr($pagenow, 0, -4); ?>', adminpage = '<?php echo $admin_body_class; ?>';
+var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = '<?php echo substr($pagenow, 0, -4); ?>', adminpage = '<?php echo $admin_body_class; ?>', thousandsSeparator = '<?php echo $wp_locale->number_format['thousands_sep']; ?>', decimalPoint = '<?php echo $wp_locale->number_format['decimal_point']; ?>';
//]]>
</script>
<?php
update_category_cache();
+// Schedule trash collection
+if ( !wp_next_scheduled('wp_scheduled_delete') && !defined('WP_INSTALLING') )
+ wp_schedule_event(time(), 'daily', 'wp_scheduled_delete');
+
set_screen_options();
$posts_per_page = get_option('posts_per_page');
$date_format = get_option('date_format');
$time_format = get_option('time_format');
-wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'popuptitle', 'popupurl', 'text', 'trackback', 'pingback'));
+wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'text', 'trackback', 'pingback'));
wp_admin_css_color('classic', __('Blue'), admin_url("css/colors-classic.css"), array('#073447', '#21759B', '#EAF3FA', '#BBD8E7'));
wp_admin_css_color('fresh', __('Gray'), admin_url("css/colors-fresh.css"), array('#464646', '#6D6D6D', '#F1F1F1', '#DFDFDF'));
$_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie'];
elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
$_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie'];
+if ( empty($_COOKIE[LOGGED_IN_COOKIE]) && !empty($_REQUEST['logged_in_cookie']) )
+ $_COOKIE[LOGGED_IN_COOKIE] = $_REQUEST['logged_in_cookie'];
unset($current_user);
require_once('admin.php');
break;
case 'delete':
+ if ( !isset( $_GET['cat_ID'] ) ) {
+ wp_redirect('categories.php');
+ exit;
+ }
+
$cat_ID = (int) $_GET['cat_ID'];
check_admin_referer('delete-category_' . $cat_ID);
if ( !current_user_can('manage_categories') )
wp_die(__('Cheatin’ uh?'));
- $cat_name = get_cat_name($cat_ID);
-
// Don't delete the default cats.
if ( $cat_ID == get_option('default_category') )
- wp_die(sprintf(__("Can’t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
+ wp_die( sprintf( __("Can’t delete the <strong>%s</strong> category: this is the default one"), get_cat_name($cat_ID) ) );
wp_delete_category($cat_ID);
if ( !current_user_can('manage_categories') )
wp_die( __('You are not allowed to delete categories.') );
- foreach ( (array) $_GET['delete'] as $cat_ID ) {
- $cat_name = get_cat_name($cat_ID);
+ $cats = (array) $_GET['delete'];
+ $default_cat = get_option('default_category');
+ foreach ( $cats as $cat_ID ) {
+ $cat_ID = (int) $cat_ID;
- // Don't delete the default cats.
- if ( $cat_ID == get_option('default_category') )
- wp_die(sprintf(__("Can’t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
+ // Don't delete the default cat.
+ if ( $cat_ID == $default_cat )
+ wp_die( sprintf( __("Can’t delete the <strong>%s</strong> category: this is the default one"), get_cat_name($cat_ID) ) );
wp_delete_category($cat_ID);
}
wp_safe_redirect( wp_get_referer() );
- exit();
+ exit;
break;
case 'edit':
if ( empty($pagenum) )
$pagenum = 1;
-$cats_per_page = get_user_option('categories_per_page');
-if ( empty($cats_per_page) )
+$cats_per_page = (int) get_user_option( 'categories_per_page', 0, false );
+if ( empty( $cats_per_page ) || $cats_per_page < 1 )
$cats_per_page = 20;
-$cats_per_page = apply_filters('edit_categories_per_page', $cats_per_page);
+$cats_per_page = apply_filters( 'edit_categories_per_page', $cats_per_page );
if ( !empty($_GET['s']) )
$num_cats = count(get_categories(array('hide_empty' => 0, 'search' => $_GET['s'])));
<div class="form-field">
<label for="category_description"><?php _e('Description') ?></label>
<textarea name="category_description" id="category_description" rows="5" cols="40"></textarea>
- <p><?php _e('The description is not prominent by default, however some themes may show it.'); ?></p>
+ <p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
</div>
<p class="submit"><input type="submit" class="button" name="submit" value="<?php esc_attr_e('Add Category'); ?>" /></p>
if ( isset( $_POST['deletecomment'] ) )
$action = 'deletecomment';
+if ( 'cdc' == $action )
+ $action = 'delete';
+elseif ( 'mac' == $action )
+ $action = 'approve';
+
+if ( isset( $_GET['dt'] ) ) {
+ if ( 'spam' == $_GET['dt'] )
+ $action = 'spam';
+ elseif ( 'trash' == $_GET['dt'] )
+ $action = 'trash';
+}
+
/**
* Display error message at bottom of comments.
*
if ( !current_user_can('edit_post', $comment->comment_post_ID) )
comment_footer_die( __('You are not allowed to edit comments on this post.') );
+ if ( 'trash' == $comment->comment_approved )
+ comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') );
+
$comment = get_comment_to_edit( $comment_id );
include('edit-form-comment.php');
break;
-case 'cdc' :
-case 'mac' :
+case 'delete' :
+case 'approve' :
+case 'trash' :
+case 'spam' :
require_once('admin-header.php');
$comment_id = absint( $_GET['c'] );
- $formaction = 'cdc' == $action ? 'deletecomment' : 'approvecomment';
- $nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_';
+ $formaction = $action . 'comment';
+ $nonce_action = 'approve' == $action ? 'approve-comment_' : 'delete-comment_';
$nonce_action .= $comment_id;
if ( !$comment = get_comment_to_edit( $comment_id ) )
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php') );
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
- comment_footer_die( 'cdc' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
+ comment_footer_die( 'approve' != $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
?>
<div class='wrap'>
<div class="narrow">
<?php
-if ( 'spam' == $_GET['dt'] ) {
- $caution_msg = __('You are about to mark the following comment as spam:');
- $button = __('Spam Comment');
-} elseif ( 'cdc' == $action ) {
- $caution_msg = __('You are about to delete the following comment:');
- $button = __('Delete Comment');
-} else {
- $caution_msg = __('You are about to approve the following comment:');
- $button = __('Approve Comment');
+switch ( $action ) {
+ case 'spam' :
+ $caution_msg = __('You are about to mark the following comment as spam:');
+ $button = __('Spam Comment');
+ break;
+ case 'trash' :
+ $caution_msg = __('You are about to move the following comment to the Trash:');
+ $button = __('Trash Comment');
+ break;
+ case 'delete' :
+ $caution_msg = __('You are about to delete the following comment:');
+ $button = __('Permanently Delete Comment');
+ break;
+ default :
+ $caution_msg = __('You are about to approve the following comment:');
+ $button = __('Approve Comment');
+ break;
}
?>
<p><strong><?php _e('Caution:'); ?></strong> <?php echo $caution_msg; ?></p>
-<p><?php _e('Are you sure you want to do that?'); ?></p>
-
-<form action='comment.php' method='get'>
-
-<table width="100%">
-<tr>
-<td><input type='button' class="button" value='<?php esc_attr_e('No'); ?>' onclick="self.location='<?php echo admin_url('edit-comments.php'); ?>" /></td>
-<td class="textright"><input type='submit' class="button" value='<?php echo esc_attr($button); ?>' /></td>
-</tr>
-</table>
-
-<?php wp_nonce_field( $nonce_action ); ?>
-<input type='hidden' name='action' value='<?php echo esc_attr($formaction); ?>' />
-<?php if ( 'spam' == $_GET['dt'] ) { ?>
-<input type='hidden' name='dt' value='spam' />
-<?php } ?>
-<input type='hidden' name='p' value='<?php echo esc_attr($comment->comment_post_ID); ?>' />
-<input type='hidden' name='c' value='<?php echo esc_attr($comment->comment_ID); ?>' />
-<input type='hidden' name='noredir' value='1' />
-</form>
-
-<table class="form-table" cellpadding="5">
+<table class="form-table comment-ays">
<tr class="alt">
<th scope="row"><?php _e('Author'); ?></th>
<td><?php echo $comment->comment_author; ?></td>
</tr>
</table>
+<p><?php _e('Are you sure you want to do that?'); ?></p>
+
+<form action='comment.php' method='get'>
+
+<table width="100%">
+<tr>
+<td><a class="button" href="<?php echo admin_url('edit-comments.php'); ?>"><?php esc_attr_e('No'); ?></a></td>
+<td class="textright"><input type='submit' class="button" value='<?php echo esc_attr($button); ?>' /></td>
+</tr>
+</table>
+
+<?php wp_nonce_field( $nonce_action ); ?>
+<input type='hidden' name='action' value='<?php echo esc_attr($formaction); ?>' />
+<input type='hidden' name='p' value='<?php echo esc_attr($comment->comment_post_ID); ?>' />
+<input type='hidden' name='c' value='<?php echo esc_attr($comment->comment_ID); ?>' />
+<input type='hidden' name='noredir' value='1' />
+</form>
+
</div>
</div>
<?php
break;
case 'deletecomment' :
+case 'trashcomment' :
+case 'untrashcomment' :
+case 'spamcomment' :
+case 'unspamcomment' :
$comment_id = absint( $_REQUEST['c'] );
check_admin_referer( 'delete-comment_' . $comment_id );
- if ( isset( $_REQUEST['noredir'] ) )
- $noredir = true;
- else
- $noredir = false;
+ $noredir = isset($_REQUEST['noredir']);
- if ( !$comment = get_comment( $comment_id ) )
+ if ( !$comment = get_comment($comment_id) )
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit-comments.php') );
-
- if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
+ if ( !current_user_can('edit_post', $comment->comment_post_ID ) )
comment_footer_die( __('You are not allowed to edit comments on this post.') );
- if ( 'spam' == $_REQUEST['dt'] )
- wp_set_comment_status( $comment->comment_ID, 'spam' );
- else
- wp_delete_comment( $comment->comment_ID );
-
- if ( '' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php' ) )
- wp_redirect( wp_get_referer() );
- else if ( '' != wp_get_original_referer() && false == $noredir )
- wp_redirect( wp_get_original_referer() );
+ if ( '' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php') )
+ $redir = wp_get_referer();
+ elseif ( '' != wp_get_original_referer() && false == $noredir )
+ $redir = wp_get_original_referer();
else
- wp_redirect( admin_url('edit-comments.php') );
+ $redir = admin_url('edit-comments.php');
+
+ $redir = remove_query_arg( array('spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids'), $redir );
+
+ switch ( $action ) {
+ case 'deletecomment' :
+ wp_delete_comment( $comment_id );
+ $redir = add_query_arg( array('deleted' => '1'), $redir );
+ break;
+ case 'trashcomment' :
+ wp_trash_comment($comment_id);
+ $redir = add_query_arg( array('trashed' => '1', 'ids' => $comment_id), $redir );
+ break;
+ case 'untrashcomment' :
+ wp_untrash_comment($comment_id);
+ $redir = add_query_arg( array('untrashed' => '1'), $redir );
+ break;
+ case 'spamcomment' :
+ wp_spam_comment($comment_id);
+ $redir = add_query_arg( array('spammed' => '1', 'ids' => $comment_id), $redir );
+ break;
+ case 'unspamcomment' :
+ wp_unspam_comment($comment_id);
+ $redir = add_query_arg( array('unspammed' => '1'), $redir );
+ break;
+ }
+
+ wp_redirect( $redir );
die;
break;
+case 'approvecomment' :
case 'unapprovecomment' :
$comment_id = absint( $_GET['c'] );
- check_admin_referer( 'unapprove-comment_' . $comment_id );
+ check_admin_referer( 'approve-comment_' . $comment_id );
- if ( isset( $_GET['noredir'] ) )
- $noredir = true;
- else
- $noredir = false;
+ $noredir = isset( $_GET['noredir'] );
if ( !$comment = get_comment( $comment_id ) )
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php') );
- if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
- comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') );
-
- wp_set_comment_status( $comment->comment_ID, 'hold' );
+ if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) {
+ if ( 'approvecomment' == $action )
+ comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
+ else
+ comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') );
+ }
if ( '' != wp_get_referer() && false == $noredir )
- wp_redirect( wp_get_referer() );
+ $redir = remove_query_arg( array('approved', 'unapproved'), wp_get_referer() );
else
- wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
+ $redir = admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) );
- exit();
- break;
-
-case 'approvecomment' :
- $comment_id = absint( $_GET['c'] );
- check_admin_referer( 'approve-comment_' . $comment_id );
-
- if ( isset( $_GET['noredir'] ) )
- $noredir = true;
- else
- $noredir = false;
-
- if ( !$comment = get_comment( $comment_id ) )
- comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php') );
-
- if ( !current_user_can('edit_post', $comment->comment_post_ID) )
- comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
+ if ( 'approvecomment' == $action ) {
+ wp_set_comment_status( $comment_id, 'approve' );
+ $redir = add_query_arg( array( 'approved' => 1 ), $redir );
+ } else {
+ wp_set_comment_status( $comment_id, 'hold' );
+ $redir = add_query_arg( array( 'unapproved' => 1 ), $redir );
+ }
- wp_set_comment_status( $comment->comment_ID, 'approve' );
-
- if ( '' != wp_get_referer() && false == $noredir )
- wp_redirect( wp_get_referer() );
- else
- wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
+ wp_redirect( $redir );
exit();
break;
include('admin-footer.php');
-?>
\ No newline at end of file
+?>
-html {
- background-color: #f7f6f1;
-}
-
-* html input,
-* html .widget {
- border-color: #8cbdd5;
-}
-
-textarea,
-input,
-select {
- border-color: #dfdfdf;
-}
-
-kbd,
-code {
- background: #eaeaea;
-}
-
-input[readonly] {
- background-color: #eee;
-}
-
-.find-box-search {
- border-color: #dfdfdf;
- background-color: #f1f1f1;
-}
-
-.find-box {
- background-color: #f1f1f1;
-}
-
-.find-box-inside {
- background-color: #fff;
-}
-
-a.page-numbers:hover {
- border-color: #999;
-}
-
-body,
-#wpbody,
-.form-table .pre {
- color: #333;
-}
-
-body > #upload-menu {
- border-bottom-color: #fff;
-}
-
-#postcustomstuff table,
-#your-profile fieldset,
-#rightnow,
-div.dashboard-widget,
-#dashboard-widgets p.dashboard-widget-links,
-#replyrow #ed_reply_toolbar input {
- border-color: #ccc;
-}
-
-#poststuff .inside label.spam {
- color: red;
-}
-
-#poststuff .inside label.waiting {
- color: orange;
-}
-
-#poststuff .inside label.approved {
- color: green;
-}
-
-#postcustomstuff table {
- border-color: #dfdfdf;
- background-color: #f9f9f9;
-}
-
-#postcustomstuff thead th {
- background-color: #f1f1f1;
-}
-
-#postcustomstuff table input,
-#postcustomstuff table textarea {
- border-color: #dfdfdf;
- background-color: #fff;
-}
-
-.widefat {
- border-color: #dfdfdf;
- background-color: #fff;
-}
-
-div.dashboard-widget-error {
- background-color: #c43;
-}
-
-div.dashboard-widget-notice {
- background-color: #cfe1ef;
-}
-
-div.dashboard-widget-submit {
- border-top-color: #ccc;
-}
-
-div.tabs-panel,
-ul#category-tabs li.tabs {
- border-color: #dfdfdf;
-}
-
-ul#category-tabs li.tabs {
- background-color: #f1f1f1;
-}
-
-input.disabled,
-textarea.disabled {
- background-color: #ccc;
-}
-/* #upload-menu li a.upload-tab-link, */
-.login #backtoblog a:hover,
-#plugin-information .action-button a,
-#plugin-information .action-button a:hover,
-#plugin-information .action-button a:visited {
- color: #fff;
-}
-
-.widget .widget-top,
-.postbox h3,
-.stuffbox h3 {
- background: #d5e6f2 url("../images/blue-grad.png") repeat-x left top;
- text-shadow: #fff 0 1px 0;
-}
-
-.form-table th,
-.form-wrap label {
- color: #222;
- text-shadow: #fff 0 1px 0;
-}
-
-.description,
-.form-wrap p {
- color: #666;
-}
-
-strong .post-com-count span {
- background-color: #21759b;
-}
-
-.sorthelper {
- background-color: #ccf3fa;
-}
-
-.ac_match,
-.subsubsub a.current {
- color: #000;
-}
-
-.wrap h2 {
- color: #093e56;
-}
-
-.ac_over {
- background-color: #f0f0b8;
-}
-
-.ac_results {
- background-color: #fff;
- border-color: #808080;
-}
-
-.ac_results li {
- color: #101010;
-}
-
-.alt
-.alternate {
- background-color: #edfbfc;
-}
-
-.available-theme a.screenshot {
- background-color: #f1f1f1;
- border-color: #ddd;
-}
-
-.bar {
- background-color: #e8e8e8;
- border-right-color: #99d;
-}
-
-#media-upload {
- background: #fff;
-}
-
-#media-upload .slidetoggle {
- border-top-color: #dfdfdf;
-}
-
-.error,
-#login #login_error {
- background-color: #ffebe8;
- border-color: #c00;
-}
-
-.error a {
- color: #c00;
-}
-
-.form-invalid {
- background-color: #ffebe8 !important;
-}
-
-.form-invalid input {
- border-color: #c00 !important;
-}
-
-.submit {
- border-color: #8cbdd5;
-}
-
-.highlight {
- background-color: #e4f2fd;
- color: #d54e21;
-}
-
-.howto,
-.nonessential,
-#edit-slug-box,
-.form-input-tip,
-.rss-widget span.rss-date,
-.subsubsub {
- color: #666;
-}
-
-.media-item {
- border-bottom-color: #dfdfdf;
-}
-
-#wpbody-content #media-items .describe {
- border-top-color: #dfdfdf;
-}
-
-.describe input[type="text"],
-.describe textarea {
- border-color: #dfdfdf;
-}
-
-.media-upload-form label.form-help,
-td.help {
- color: #9a9a9a;
-}
-
-.post-com-count {
- background-image: url(../images/bubble_bg.gif);
- color: #fff;
-}
-
-.post-com-count span {
- background-color: #bbb;
- color: #fff;
-}
-
-.post-com-count:hover span {
- background-color: #d54e21;
-}
-
-.quicktags, .search {
- background-color: #ccc;
- color: #000;
-}
-
-.side-info h5 {
- border-bottom-color: #dadada;
-}
-
-.side-info ul {
- color: #666;
-}
-
-.button,
-.button-secondary,
-.submit input,
-input[type=button],
-input[type=submit] {
- border-color: #dfdfdf;
- color: #464646;
-}
-
-.button:hover,
-.button-secondary:hover,
-.submit input:hover,
-input[type=button]:hover,
-input[type=submit]:hover {
- color: #000;
- border-color: #adaca7;
-}
-
-.button,
-.submit input,
-.button-secondary {
- background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
-}
-
-.button:active,
-.submit input:active,
-.button-secondary:active {
- background: #eee url(../images/white-grad-active.png) repeat-x scroll left top;
-}
-
-.button-primary,
-.submit .button-primary,
-#login form .submit input {
- border-color: #5b86ab !important;
- font-weight: bold;
- color: #fff !important;
- background: #5580a6 url(../images/button-grad-vs.png) repeat-x scroll left top;
-}
-
-.button-primary:active,
-#login form .submit input:active {
- background: #21759b url(../images/button-grad-active-vs.png) repeat-x scroll left top !important;
-}
-
-.button[disabled],
-.button:disabled,
-.button-secondary[disabled],
-.button-secondary:disabled,
-a.button.disabled {
- color: #ccc !important;
- border-color: #ccc;
-}
-
-.button-primary[disabled],
-.button-primary:disabled {
- color: #80a3d2 !important;
-}
-
-a:active,
-a:focus {
- color: #d54e21;
-}
-
-a:hover,
-#wphead #viewsite a:hover,
-#adminmenu a:hover,
-#adminmenu ul.wp-submenu a:hover,
-#the-comment-list .comment a:hover,
-#rightnow a:hover,
-#login form .submit input:hover,
-#media-upload a.del-link:hover,
-div.dashboard-widget-submit input:hover,
-.subsubsub a:hover,
-.subsubsub a.current:hover,
-.ui-tabs-nav a:hover,
-.plugins .inactive a:hover,
-#all-plugins-table .plugins .inactive a:hover,
-#search-plugins-table .plugins .inactive a:hover {
- color: #d54e21;
-}
-
-#the-comment-list .comment-item,
-#dashboard-widgets #dashboard_quick_press form p.submit {
- border-color: #dfdfdf;
-}
-
-#dashboard_right_now .table {
- background:#faf9f7 !important;
-}
-
-.button-primary:hover,
-#login form .submit input:hover {
- border-color: #2e5475 !important;
- color: #eaf2fa !important;
-}
-
-#side-sortables #category-tabs .tabs a {
- color: #333;
-}
-
-#rightnow .rbutton {
- background-color: #ebebeb;
- color: #264761;
-}
-
-.submitbox .submit {
- background-color: #464646;
- color: #ccc;
-}
-
-.plugins a.delete:hover,
-#all-plugins-table .plugins a.delete:hover,
-#search-plugins-table .plugins a.delete:hover,
-.submitbox .submitdelete,
-a.delete {
- color: #f00;
- border-bottom-color: #f00;
-}
-
-.submitbox .submitdelete:hover,
-#media-items a.delete:hover {
- color: #fff;
- background-color: #f00;
- border-bottom-color: #f00;
-}
-
-#normal-sortables .submitbox .submitdelete:hover {
- color: #000;
- background-color: #f00;
- border-bottom-color: #f00;
-}
-
-.tablenav .dots {
- border-color: transparent;
-}
-
-.tablenav .next,
-.tablenav .prev {
- border-color: transparent;
- color: #21759b;
-}
-
-.tablenav .next:hover,
-.tablenav .prev:hover {
- border-color: transparent;
- color: #d54e21;
-}
-
-.updated,
-.login #login_error,
-.login .message {
- background-color: #ffffe0;
- border-color: #e6db55;
-}
-
-.update-message {
- color: #000000;
-}
-
-a.page-numbers {
- border-bottom-color: #b8d3e2;
-}
-
-.commentlist li {
- border-bottom-color: #ccc;
-}
-
-.widefat td,
-.widefat th,
-#install-plugins .plugins td,
-#install-plugins .plugins th {
- border-color: #dfdfdf;
-}
-
-.widefat th {
- text-shadow: rgba(255,255,255,0.8) 0 1px 0;
-}
-
-.widefat thead tr th,
-.widefat tfoot tr th,
-h3.dashboard-widget-title,
-h3.dashboard-widget-title span,
-h3.dashboard-widget-title small,
-.find-box-head {
- color: #333;
- background: #d5e6f2 url(../images/blue-grad.png) repeat-x scroll left top;
-}
-
-h3.dashboard-widget-title small a {
- color: #d7d7d7;
-}
-
-h3.dashboard-widget-title small a:hover {
- color: #fff;
-}
-
-a,
-#adminmenu a,
-#poststuff #edButtonPreview,
-#poststuff #edButtonHTML,
-#the-comment-list p.comment-author strong a,
-#media-upload a.del-link,
-#media-items a.delete,
-.plugins a.delete,
-.ui-tabs-nav a {
- color: #1c6280;
-}
-
-/* Because we don't want visited on these links */
-body.press-this .tabs a,
-body.press-this .tabs a:hover {
- background-color: #fff;
- border-color: #c6d9e9;
- border-bottom-color: #fff;
- color: #d54e21;
-}
-
-#adminmenu #awaiting-mod,
-#adminmenu .update-plugins,
-#sidemenu a .update-plugins,
-#rightnow .reallynow,
-#plugin-information .action-button {
- background-color: #d54e21;
- color: #fff;
-}
-
-#adminmenu li a:hover #awaiting-mod,
-#adminmenu li a:hover .update-plugins,
-#sidemenu li a:hover .update-plugins {
- background-color: #264761;
- color: #fff;
-}
-
-#adminmenu li.current a #awaiting-mod,
-#adminmenu li.current a .update-plugins,
-#adminmenu li.wp-has-current-submenu a .update-plugins,
-#adminmenu li.wp-has-current-submenu a .update-plugins {
- background-color: #ddd;
- color: #000;
- text-shadow: none;
- -moz-box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
- -khtml-box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
- -webkit-box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
- box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
-}
-
-#adminmenu li.current a:hover #awaiting-mod,
-#adminmenu li.current a:hover .update-plugins,
-#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod,
-#adminmenu li.wp-has-current-submenu a:hover .update-plugins {
- background-color: #264761;
- color: #fff;
-}
-
-div#media-upload-header,
-div#plugin-information-header {
- background-color: #f9f9f9;
- border-bottom-color: #dfdfdf;
-}
-
-#currenttheme img {
- border-color: #666;
-}
-
-#dashboard_secondary div.dashboard-widget-content ul li a {
- background-color: #f9f9f9;
-}
-
-input.readonly, textarea.readonly {
- background-color: #ddd;
-}
-
-#ed_toolbar input,
-#ed_reply_toolbar input {
- background: #fff url("../images/fade-butt.png") repeat-x 0 -2px;
-}
-
-#editable-post-name {
- background-color: #fffbcc;
-}
-
-#edit-slug-box strong,
-.tablenav .displaying-num,
-#submitted-on {
- color: #777;
-}
-
-.login #nav a {
- color: #21759b !important;
-}
-
-.login #nav a:hover {
- color: #d54e21 !important;
-}
-
-#footer,
-#footer-upgrade {
- background: #1d507d;
- color: #b6d1e4;
-}
-
-#media-items {
- border-color: #dfdfdf;
-}
-
-.checkbox,
-.side-info,
-.plugins tr,
-.postbox,
-#your-profile #rich_editing {
- background-color: #fff;
-}
-
-.plugins .inactive,
-.plugins .inactive th,
-.plugins .inactive td,
-tr.inactive + tr.plugin-update-tr .plugin-update {
- background-color: #ebeeef;
-}
-
-.plugin-update-tr .update-message {
- background-color: #fffbe4;
- border-color: #dfdfdf;
-}
-
-.plugins .active,
-.plugins .active th,
-.plugins .active td {
- color: #000;
-}
-
-.plugins .inactive a {
- color: #557799;
-}
-
-#the-comment-list .unapproved,
-#the-comment-list .unapproved th,
-#the-comment-list .unapproved td {
- background-color: #ffffe0;
-}
-
-#the-comment-list .approve a {
- color: #006505;
-}
-
-#the-comment-list .unapprove a {
- color: #d98500;
-}
-
-#the-comment-list .delete a {
- color: #bc0b0b;
-}
-
-.widget,
-#widget-list .widget-top,
-.postbox,
-#titlediv,
-#poststuff .postarea,
-.stuffbox {
- border-color: #dfdfdf;
-}
-
-.widget,
-.postbox {
- background-color: #fff;
-}
-
-.ui-sortable .postbox h3 {
- color: #093e56;
-}
-
-.widget .widget-top,
-.ui-sortable .postbox h3:hover {
- color: #000;
-}
-
-.curtime #timestamp {
- background-image: url(../images/date-button.gif);
-}
-
-#quicktags #ed_link {
- color: #00f;
-}
-
-#rightnow .youhave {
- background-color: #f0f6fb;
-}
-
-#rightnow a {
- color: #448abd;
-}
-
-.tagchecklist span a,
-#bulk-titles div a {
- background: url(../images/xit.gif) no-repeat;
-}
-
-.tagchecklist span a:hover,
-#bulk-titles div a:hover {
- background: url(../images/xit.gif) no-repeat -10px 0;
-}
-
-#update-nag {
- background-color: #fffeeb;
- border-color: #ccc;
- color: #555;
-}
-
-.login #backtoblog a {
- color: #ccc;
-}
-
-#wphead {
- background-color: #1d507d;
-}
-
-body.login {
- border-top-color: #093e56;
-}
-
-#wphead h1 a {
- color: #fff;
-}
-
-#login form input {
- color: #555;
-}
-
-#user_info {
- color: #b6d1e4;
-}
-
-#user_info a:link,
-#user_info a:visited,
-#footer a:link,
-#footer a:visited {
- color: #fff;
- text-decoration: none;
-}
-
-#user_info a:hover,
-#user_info a:active,
-#footer a:hover,
-#footer a:active {
- text-decoration: underline;
-}
-
-div#media-upload-error,
-.file-error,
-abbr.required,
-.widget-control-remove:hover,
-.delete a:hover {
- color: #f00;
-}
-
-/* password strength meter */
-#pass-strength-result {
- background-color: #eee;
- border-color: #ddd !important;
-}
-
-#pass-strength-result.bad {
- background-color: #ffb78c;
- border-color: #ff853c !important;
-}
-
-#pass-strength-result.good {
- background-color: #ffec8b;
- border-color: #fc0 !important;
-}
-
-#pass-strength-result.short {
- background-color: #ffa0a0;
- border-color: #f04040 !important;
-}
-
-#pass-strength-result.strong {
- background-color: #c3ff88;
- border-color: #8dff1c !important;
-}
-
-/* editors */
-#quicktags {
- border-color: #dfdfdf;
- background-color: #dfdfdf;
-}
-
-#ed_toolbar input {
- border-color: #c3c3c3;
-}
-
-#ed_toolbar input:hover {
- border-color: #aaa;
- background: #ddd;
-}
-
-#poststuff .wp_themeSkin .mceStatusbar {
- border-color: #ededed;
-}
-
-#poststuff #edButtonPreview,
-#poststuff #edButtonHTML {
- background-color: #f2f1eb;
- border-color: #dfdfdf;
- color: #999;
-}
-
-#poststuff #editor-toolbar .active {
- border-bottom-color: #e3eef7;
- background-color: #e3eef7;
- color: #333;
-}
-
-/* TinyMCE */
-#post-status-info {
- background-color: #ededed;
-}
-
-.wp_themeSkin *,
-.wp_themeSkin a:hover,
-.wp_themeSkin a:link,
-.wp_themeSkin a:visited,
-.wp_themeSkin a:active {
- color: #000;
-}
-
-/* Containers */
-.wp_themeSkin iframe {
- background: #fff;
-}
-
-/* Layout */
-.wp_themeSkin .mceStatusbar {
- color: #000;
- background-color: #f5f5f5;
-}
-
-/* Button */
-.wp_themeSkin .mceButton {
- background-color: #e9e8e8;
- border-color: #b2b2b2;
-}
-
-.wp_themeSkin a.mceButtonEnabled:hover,
-.wp_themeSkin a.mceButtonActive,
-.wp_themeSkin a.mceButtonSelected {
- background-color: #d5d5d5;
- border-color: #777 !important;
-}
-
-.wp_themeSkin .mceButtonDisabled {
- border-color: #ccc !important;
-}
-
-/* ListBox */
-.wp_themeSkin .mceListBox .mceText,
-.wp_themeSkin .mceListBox .mceOpen {
- border-color: #b2b2b2;
- background-color: #d5d5d5;
-}
-
-.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,
-.wp_themeSkin .mceListBoxHover .mceOpen,
-.wp_themeSkin .mceListBoxSelected .mceOpen,
-.wp_themeSkin .mceListBoxSelected .mceText {
- border-color: #777 !important;
- background-color: #d5d5d5;
-}
-
-.wp_themeSkin table.mceListBoxEnabled:hover .mceText,
-.wp_themeSkin .mceListBoxHover .mceText {
- border-color: #777 !important;
-}
-
-.wp_themeSkin select.mceListBox {
- border-color: #b2b2b2;
- background-color: #fff;
-}
-
-/* SplitButton */
-.wp_themeSkin .mceSplitButton a.mceAction,
-.wp_themeSkin .mceSplitButton a.mceOpen {
- border-color: #b2b2b2;
-}
-
-.wp_themeSkin .mceSplitButton a.mceOpen:hover,
-.wp_themeSkin .mceSplitButtonSelected a.mceOpen,
-.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,
-.wp_themeSkin .mceSplitButton a.mceAction:hover {
- background-color: #d5d5d5;
- border-color: #777 !important;
-}
-
-.wp_themeSkin .mceSplitButtonActive {
- background-color: #b2b2b2;
-}
-
-/* ColorSplitButton */
-.wp_themeSkin div.mceColorSplitMenu table {
- background-color: #ebebeb;
- border-color: #b2b2b2;
-}
-
-.wp_themeSkin .mceColorSplitMenu a {
- border-color: #b2b2b2;
-}
-
-.wp_themeSkin .mceColorSplitMenu a.mceMoreColors {
- border-color: #fff;
-}
-
-.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover {
- border-color: #0a246a;
- background-color: #b6bdd2;
-}
-
-.wp_themeSkin a.mceMoreColors:hover {
- border-color: #0a246a;
-}
-
-/* Menu */
-.wp_themeSkin .mceMenu {
- border-color: #ddd;
-}
-
-.wp_themeSkin .mceMenu table {
- background-color: #ebeaeb;
-}
-
-.wp_themeSkin .mceMenu .mceText {
- color: #000;
-}
-
-.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,
-.wp_themeSkin .mceMenu .mceMenuItemActive {
- background-color: #f5f5f5;
-}
-.wp_themeSkin td.mceMenuItemSeparator {
- background-color: #aaa;
-}
-.wp_themeSkin .mceMenuItemTitle a {
- background-color: #ccc;
- border-bottom-color: #aaa;
-}
-.wp_themeSkin .mceMenuItemTitle span.mceText {
- color: #000;
-}
-.wp_themeSkin .mceMenuItemDisabled .mceText {
- color: #888;
-}
-
-#quicktags,
-.wp_themeSkin tr.mceFirst td.mceToolbar {
- background: #e3eef7 url("../images/ed-bg-vs.gif") repeat-x scroll left top;
-}
-.wp_themeSkin tr.mceFirst td.mceToolbar {
- border-color: #dfdfdf;
-}
-
-.wp-admin #mceModalBlocker {
- background: #000;
-}
-
-.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft {
- background: #444;
- border-left: 1px solid #999;
- border-top: 1px solid #999;
- -moz-border-radius: 4px 0 0 0;
- -webkit-border-top-left-radius: 4px;
- -khtml-border-top-left-radius: 4px;
- border-top-left-radius: 4px;
-}
-
-.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight {
- background: #444;
- border-right: 1px solid #999;
- border-top: 1px solid #999;
- border-top-right-radius: 4px;
- -khtml-border-top-right-radius: 4px;
- -webkit-border-top-right-radius: 4px;
- -moz-border-radius: 0 4px 0 0;
-}
-
-.wp-admin .clearlooks2 .mceMiddle .mceLeft {
- background: #f1f1f1;
- border-left: 1px solid #999;
-}
-
-.wp-admin .clearlooks2 .mceMiddle .mceRight {
- background: #f1f1f1;
- border-right: 1px solid #999;
-}
-
-.wp-admin .clearlooks2 .mceBottom {
- background: #f1f1f1;
- border-bottom: 1px solid #999;
-}
-
-.wp-admin .clearlooks2 .mceBottom .mceLeft {
- background: #f1f1f1;
- border-bottom: 1px solid #999;
- border-left: 1px solid #999;
-}
-
-.wp-admin .clearlooks2 .mceBottom .mceCenter {
- background: #f1f1f1;
- border-bottom: 1px solid #999;
-}
-
-.wp-admin .clearlooks2 .mceBottom .mceRight {
- background: #f1f1f1;
- border-bottom: 1px solid #999;
- border-right: 1px solid #999;
-}
-
-.wp-admin .clearlooks2 .mceFocus .mceTop span {
- color: #e5e5e5;
-}
-/* end TinyMCE */
-
-#editorcontainer,
-#post-status-info,
-#titlediv #title,
-.editwidget .widget-inside {
- border-color: #dfdfdf;
-}
-
-#titlediv #title {
- background-color: #fff;
-}
-
-#tTips p#tTips_inside {
- background-color: #ddd;
- color: #333;
-}
-
-#timestampdiv input,
-#namediv input,
-#poststuff .inside .the-tagcloud {
- border-color: #dfdfdf;
-}
-
-/* menu */
-#adminmenu * {
- border-color: #dfdfdf;
-}
-
-#adminmenu li.wp-menu-separator {
- background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;
-}
-
-.folded #adminmenu li.wp-menu-separator {
- background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;
-}
-
-#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,
-#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle {
- background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -207px;
-}
-
-#adminmenu .wp-has-submenu:hover .wp-menu-toggle,
-#adminmenu .wp-menu-open .wp-menu-toggle {
- background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px;
-}
-
-#adminmenu a.menu-top {
- background: #eaf3fa url(../images/menu-bits-vs.gif) repeat-x scroll left -379px;
-}
-
-#adminmenu .wp-submenu a {
- background: #fff url(../images/menu-bits-vs.gif) no-repeat scroll 0 -310px;
-}
-
-#adminmenu .wp-has-current-submenu ul li a {
- background: none;
-}
-
-#adminmenu .wp-has-current-submenu ul li a.current {
- background: url(../images/menu-dark.gif) top left no-repeat !important;
-}
-
-#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
-#adminmenu .menu-top .current {
- background: #3c6b95 url(../images/menu-bits-vs.gif) top left repeat-x;
- border-color: #1d507d;
- color: #fff;
- text-shadow: rgba(0,0,0,0.4) 0 -1px 0;
-}
-
-#adminmenu li.wp-has-current-submenu .wp-submenu,
-#adminmenu li.wp-has-current-submenu ul li a {
- border-color: #aaa !important;
-}
-
-#adminmenu li.wp-has-current-submenu ul li a {
- background: url(../images/menu-dark.gif) bottom left no-repeat !important;
-}
-
-#adminmenu li.wp-has-current-submenu ul {
- border-bottom-color: #aaa;
-}
-
-#adminmenu li.menu-top .current:hover {
- border-color: #6583c0;
-}
-
-#adminmenu .wp-submenu .current a.current {
- background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll 0 -289px;
-}
-
-#adminmenu .wp-submenu a:hover {
- background-color: #eaf2fa !important;
- color: #333 !important;
-}
-
-#adminmenu .wp-submenu li.current,
-#adminmenu .wp-submenu li.current a,
-#adminmenu .wp-submenu li.current a:hover {
- color: #333;
- background-color: #f5f5f5;
- background-image: none;
- border-color: #e3e3e3;
- text-shadow: rgba(255,255,255,1) 0 1px 0;
-}
-
-#adminmenu .wp-submenu ul {
- background-color: #fff;
-}
-
-.folded #adminmenu li.menu-top,
-#adminmenu .wp-submenu .wp-submenu-head {
- background-color: #eaf2fa;
-}
-
-.folded #adminmenu li.wp-has-current-submenu,
-.folded #adminmenu li.menu-top.current {
- background-color: #bbd8e7;
-}
-
-#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head {
- background-color: #bbd8e7;
- border-color: #8cbdd5;
-}
-
-#adminmenu div.wp-submenu {
- background-color: transparent;
-}
-
-/* menu icons */
-#adminmenu #menu-dashboard div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -61px -33px;
-}
-
-#adminmenu #menu-dashboard:hover div.wp-menu-image,
-#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image,
-#adminmenu #menu-dashboard.current div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -61px -1px;
-}
-
-#adminmenu #menu-posts div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -272px -33px;
-}
-
-#adminmenu #menu-posts:hover div.wp-menu-image,
-#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -272px -1px;
-}
-
-#adminmenu #menu-media div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -121px -33px;
-}
-
-#adminmenu #menu-media:hover div.wp-menu-image,
-#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -121px -1px;
-}
-
-#adminmenu #menu-links div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -91px -33px;
-}
-
-#adminmenu #menu-links:hover div.wp-menu-image,
-#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -91px -1px;
-}
-
-#adminmenu #menu-pages div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -151px -33px;
-}
-
-#adminmenu #menu-pages:hover div.wp-menu-image,
-#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -151px -1px;
-}
-
-#adminmenu #menu-comments div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -31px -33px;
-}
-
-#adminmenu #menu-comments:hover div.wp-menu-image,
-#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image,
-#adminmenu #menu-comments.current div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -31px -1px;
-}
-
-#adminmenu #menu-appearance div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -1px -33px;
-}
-
-#adminmenu #menu-appearance:hover div.wp-menu-image,
-#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -1px -1px;
-}
-
-#adminmenu #menu-plugins div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -181px -33px;
-}
-
-#adminmenu #menu-plugins:hover div.wp-menu-image,
-#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -181px -1px;
-}
-
-#adminmenu #menu-users div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -301px -33px;
-}
-
-#adminmenu #menu-users:hover div.wp-menu-image,
-#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -301px -1px;
-}
-
-#adminmenu #menu-tools div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -211px -33px;
-}
-
-#adminmenu #menu-tools:hover div.wp-menu-image,
-#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -211px -1px;
-}
-
-#adminmenu #menu-settings div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -241px -33px;
-}
-
-#adminmenu #menu-settings:hover div.wp-menu-image,
-#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu-vs.png") no-repeat scroll -241px -1px;
-}
-/* end menu */
-
-
-/* Diff */
-table.diff .diff-deletedline {
- background-color: #fdd;
-}
-
-table.diff .diff-deletedline del {
- background-color: #f99;
-}
-
-table.diff .diff-addedline {
- background-color: #dfd;
-}
-
-table.diff .diff-addedline ins {
- background-color: #9f9;
-}
-
-#att-info {
- background-color: #e4f2fd;
-}
-
-/* edit image */
-#sidemenu a {
- background-color: #f9f9f9;
- border-color: #f9f9f9;
- border-bottom-color: #dfdfdf;
-}
-
-#sidemenu a.current {
- background-color: #fff;
- border-color: #dfdfdf #dfdfdf #fff;
- color: #d54e21;
-}
-
-#screen-options-wrap,
-#contextual-help-wrap {
- background-color: #eae9e4;
- border-color: #dfdfdf;
-}
-
-#screen-meta-links a.show-settings {
- color: #606060;
-}
-
-#screen-meta-links a.show-settings:hover {
- color: #000;
-}
-
-#replysubmit {
- background-color: #f1f1f1;
- border-top-color: #ddd;
-}
-
-#replyerror {
- border-color: #ddd;
- background-color: #f9f9f9;
-}
-
-#edithead,
-#replyhead {
- background-color: #f1f1f1;
-}
-
-#ed_reply_toolbar {
- background-color: #e9e9e9;
-}
-
-/* table vim shortcuts */
-.vim-current,
-.vim-current th,
-.vim-current td {
- background-color: #e4f2fd !important;
-}
-
-/* Install Plugins */
-.star-average,
-.star.star-rating {
- background-color: #fc0;
-}
-
-div.star.select:hover {
- background-color: #d00;
-}
-
-#plugin-information .fyi ul {
- background-color: #eaf3fa;
-}
-
-#plugin-information .fyi h2.mainheader {
- background-color: #cee1ef;
-}
-
-#plugin-information pre,
-#plugin-information code {
- background-color: #ededff;
-}
-
-#plugin-information pre {
- border: 1px solid #ccc;
-}
-
-/* inline editor */
-.inline-edit-row fieldset input[type="text"],
-.inline-edit-row fieldset textarea,
-#bulk-titles,
-#replyrow input {
- border-color: #ddd;
-}
-
-.inline-editor div.title {
- background-color: #eaf3fa;
-}
-
-.inline-editor ul.cat-checklist {
- background-color: #fff;
- border-color: #ddd;
-}
-
-.inline-editor .categories .catshow,
-.inline-editor .categories .cathide {
- color: #21759b;
-}
-
-.inline-editor .quick-edit-save {
- background-color: #f1f1f1;
-}
-
-#replyrow #ed_reply_toolbar input:hover {
- border-color: #aaa;
- background: #ddd;
-}
-
-fieldset.inline-edit-col-right .inline-edit-col {
- border-color: #dfdfdf;
-}
-
-.attention {
- color: #d54e21;
-}
-
-.meta-box-sortables .postbox:hover .handlediv {
- background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;
-}
-
-#major-publishing-actions {
- background: #eaf2fa;
-}
-
-.tablenav .tablenav-pages {
- color: #555;
-}
-
-.tablenav .tablenav-pages a {
- border-color: #e3e3e3;
- background: #eee url('../images/menu-bits-vs.gif') repeat-x scroll left -379px;
-}
-
-.tablenav .tablenav-pages a:hover {
- color: #d54e21;
- border-color: #d54321;
-}
-
-.tablenav .tablenav-pages a:active {
- color: #fff !important;
-}
-
-.tablenav .tablenav-pages .current {
- background: #dfdfdf;
- border-color: #d3d3d3;
-}
-
-#availablethemes,
-#availablethemes td {
- border-color: #ddd;
-}
-
-#current-theme img {
- border-color: #999;
-}
-
-#TB_window #TB_title a.tb-theme-preview-link,
-#TB_window #TB_title a.tb-theme-preview-link:visited {
- color: #999;
-}
-
-#TB_window #TB_title a.tb-theme-preview-link:hover,
-#TB_window #TB_title a.tb-theme-preview-link:focus {
- color: #ccc;
-}
-
-.misc-pub-section {
- border-bottom-color: #eee;
-}
-
-#minor-publishing {
- border-bottom-color: #ddd;
-}
-
-#post-body .misc-pub-section {
- border-right-color: #eee;
-}
-
-.post-com-count span {
- background-color: #bbb;
-}
-
-.form-table .color-palette td {
- border-color: #fff;
-}
-
-.sortable-placeholder {
- border-color: #bbb;
- background-color: #f5f5f5;
-}
-
-#post-body ul#category-tabs li.tabs a {
- color: #333;
-}
-
-#wp_editimgbtn,
-#wp_delimgbtn,
-#wp_editgallery,
-#wp_delgallery {
- border-color: #999;
- background-color: #eee;
-}
-
-#wp_editimgbtn:hover,
-#wp_delimgbtn:hover,
-#wp_editgallery:hover,
-#wp_delgallery:hover {
- border-color: #555;
- background-color: #ccc;
-}
-
-#favorite-first {
- background: #5580a6 url(../images/fav-vs.png) repeat-x 0 center;
- border-color: #517ea5 !important;
- border-bottom-color: #416686 !important;
-}
-
-#favorite-actions .slide-down {
- background-image: url(../images/fav-top-vs.gif);
- background-position:0 0;
- background-repeat: repeat-x;
-}
-
-#favorite-inside {
- border-color: #5b86ac;
- background-color: #5580a6;
-}
-
-#favorite-toggle {
- background: transparent url(../images/fav-arrow-vs.gif) no-repeat 0 -4px;
-}
-
-#favorite-actions a {
- color: #ddd;
-}
-
-#favorite-actions a:hover {
- color: #fff;
-}
-
-#favorite-inside a:hover {
- text-decoration: underline;
-}
-
-#favorite-actions .slide-down {
- border-bottom-color: #626262;
-}
-
-.submit input,
-.button,
-.button-primary,
-.button-secondary,
-.button-highlighted,
-#postcustomstuff .submit input {
- text-shadow: rgba(255,255,255,1) 0 1px 0;
-}
-
-.button-primary,
-.submit .button-primary {
- text-shadow: rgba(0,0,0,0.3) 0 -1px 0;
-}
-
-#screen-meta a.show-settings {
- background-color: transparent;
- text-shadow: rgba(255,255,255,0.7) 0 1px 0;
-}
-
-#icon-edit,
-#icon-post {
- background: transparent url(../images/icons32-vs.png) no-repeat -552px -5px;
-}
-
-#icon-index {
- background: transparent url(../images/icons32-vs.png) no-repeat -137px -5px;
-}
-
-#icon-upload {
- background: transparent url(../images/icons32-vs.png) no-repeat -251px -5px;
-}
-
-#icon-link-manager,
-#icon-link,
-#icon-link-category {
- background: transparent url(../images/icons32-vs.png) no-repeat -190px -5px;
-}
-
-#icon-edit-pages,
-#icon-page {
- background: transparent url(../images/icons32-vs.png) no-repeat -312px -5px;
-}
-
-#icon-edit-comments {
- background: transparent url(../images/icons32-vs.png) no-repeat -72px -5px;
-}
-
-#icon-themes {
- background: transparent url(../images/icons32-vs.png) no-repeat -11px -5px;
-}
-
-#icon-plugins {
- background: transparent url(../images/icons32-vs.png) no-repeat -370px -5px;
-}
-
-#icon-users,
-#icon-profile,
-#icon-user-edit {
- background: transparent url(../images/icons32-vs.png) no-repeat -600px -5px;
-}
-
-#icon-tools,
-#icon-admin {
- background: transparent url(../images/icons32-vs.png) no-repeat -432px -5px;
-}
-
-#icon-options-general {
- background: transparent url(../images/icons32-vs.png) no-repeat -492px -5px;
-}
-
-.view-switch #view-switch-list {
- background: transparent url(../images/list-vs.png) no-repeat 0 0;
-}
-
-.view-switch #view-switch-list.current {
- background: transparent url(../images/list-vs.png) no-repeat -40px 0;
-}
-
-.view-switch #view-switch-excerpt {
- background: transparent url(../images/list-vs.png) no-repeat -20px 0;
-}
-
-.view-switch #view-switch-excerpt.current {
- background: transparent url(../images/list-vs.png) no-repeat -60px 0;
-}
-
-#header-logo {
- background: transparent url(../images/wp-logo-vs.gif) no-repeat scroll center center;
-}
-
-#wphead #site-visit-button {
- background-color: #3c6b95;
- background-image: url(../images/visit-site-button-grad-vs.gif);
- color: #b6d1e4;
- text-shadow: #3f3f3f 0 -1px 0;
-}
-
-#wphead a:hover #site-visit-button {
- color: #fff;
-}
-
-#wphead a:focus #site-visit-button,
-#wphead a:active #site-visit-button {
- background-position: 0 -27px;
-}
-
-.popular-tags,
-.feature-filter {
- background-color: #fff;
- border-color: #dfdfdf;
-}
-
-#theme-information .action-button {
- border-top-color: #dfdfdf;
-}
-
-.theme-listing br.line {
- border-bottom-color: #ccc;
-}
-
-div.widgets-sortables,
-#widgets-left .inactive {
- background-color: #f1f1f1;
- border-color: #ddd;
-}
-
-#available-widgets .widget-holder {
- background-color: #fff;
- border-color: #ddd;
-}
-
-#widgets-left .sidebar-name {
- background-color: #aaa;
- background-image: url(../images/ed-bg-vs.gif);
- text-shadow: #FFFFFF 0 1px 0;
- border-color: #dfdfdf;
-}
-
-#widgets-right .sidebar-name {
- background-image: url(../images/fav-vs.png);
- text-shadow: #3f3f3f 0 -1px 0;
- background-color: #636363;
- border-color: #636363;
- color: #fff;
-}
-
-.sidebar-name:hover,
-#removing-widget {
- color: #d54e21;
-}
-
-#removing-widget span {
- color: black;
-}
-
-#widgets-left .sidebar-name-arrow {
- background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px;
-}
-
-#widgets-right .sidebar-name-arrow {
- background: transparent url(../images/fav-arrow-vs.gif) no-repeat scroll 0 -1px;
-}
-
-.in-widget-title {
- color: #606060;
-}
-
-.deleting .widget-title * {
- color: #aaa;
-}
+html{background-color:#f7f6f1;}* html input,* html .widget{border-color:#8cbdd5;}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="button"],input[type="submit"],input[type="reset"],select{border-color:#dfdfdf;background-color:#fff;}kbd,code{background:#eaeaea;}input[readonly]{background-color:#eee;}.find-box-search{border-color:#dfdfdf;background-color:#f1f1f1;}.find-box{background-color:#f1f1f1;}.find-box-inside{background-color:#fff;}a.page-numbers:hover{border-color:#999;}body,#wpbody,.form-table .pre{color:#333;}body>#upload-menu{border-bottom-color:#fff;}#postcustomstuff table,#your-profile fieldset,#rightnow,div.dashboard-widget,#dashboard-widgets p.dashboard-widget-links,#replyrow #ed_reply_toolbar input{border-color:#ccc;}#poststuff .inside label.spam,#poststuff .inside label.deleted{color:red;}#poststuff .inside label.waiting{color:orange;}#poststuff .inside label.approved{color:green;}#postcustomstuff table{border-color:#dfdfdf;background-color:#f9f9f9;}#postcustomstuff thead th{background-color:#f1f1f1;}#postcustomstuff table input,#postcustomstuff table textarea{border-color:#dfdfdf;background-color:#fff;}.widefat{border-color:#dfdfdf;background-color:#fff;}div.dashboard-widget-error{background-color:#c43;}div.dashboard-widget-notice{background-color:#cfe1ef;}div.dashboard-widget-submit{border-top-color:#ccc;}div.tabs-panel,ul#category-tabs li.tabs{border-color:#dfdfdf;}ul#category-tabs li.tabs{background-color:#f1f1f1;}input.disabled,textarea.disabled{background-color:#ccc;}.login #backtoblog a:hover,#plugin-information .action-button a,#plugin-information .action-button a:hover,#plugin-information .action-button a:visited{color:#fff;}.widget .widget-top,.postbox h3,.stuffbox h3{background:#d5e6f2 url("../images/blue-grad.png") repeat-x left top;text-shadow:#fff 0 1px 0;}.form-table th,.form-wrap label{color:#222;text-shadow:#fff 0 1px 0;}.description,.form-wrap p{color:#666;}strong .post-com-count span{background-color:#21759b;}.sorthelper{background-color:#ccf3fa;}.ac_match,.subsubsub a.current{color:#000;}.wrap h2{color:#093e56;}.ac_over{background-color:#f0f0b8;}.ac_results{background-color:#fff;border-color:#808080;}.ac_results li{color:#101010;}.alt .alternate{background-color:#edfbfc;}.available-theme a.screenshot{background-color:#f1f1f1;border-color:#ddd;}.bar{background-color:#e8e8e8;border-right-color:#99d;}#media-upload,#media-upload .media-item .slidetoggle{background:#fff;}#media-upload .slidetoggle{border-top-color:#dfdfdf;}.error,.login #login_error{background-color:#ffebe8;border-color:#c00;}.error a{color:#c00;}.form-invalid{background-color:#ffebe8!important;}.form-invalid input,.form-invalid select{border-color:#c00!important;}.submit{border-color:#8cbdd5;}.highlight{background-color:#e4f2fd;color:#d54e21;}.howto,.nonessential,#edit-slug-box,.form-input-tip,.rss-widget span.rss-date,.subsubsub{color:#666;}.media-item{border-bottom-color:#dfdfdf;}#wpbody-content #media-items .describe{border-top-color:#dfdfdf;}.media-upload-form label.form-help,td.help{color:#9a9a9a;}.post-com-count{background-image:url(../images/bubble_bg.gif);color:#fff;}.post-com-count span{background-color:#bbb;color:#fff;}.post-com-count:hover span{background-color:#d54e21;}.quicktags,.search{background-color:#ccc;color:#000;}.side-info h5{border-bottom-color:#dadada;}.side-info ul{color:#666;}.button,.button-secondary,.submit input,input[type=button],input[type=submit]{border-color:#dfdfdf;color:#464646;}.button:hover,.button-secondary:hover,.submit input:hover,input[type=button]:hover,input[type=submit]:hover{color:#000;border-color:#adaca7;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;text-shadow:rgba(255,255,255,1) 0 1px 0;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}input.button-primary,button.button-primary,a.button-primary{border-color:#5b86ab;font-weight:bold;color:#fff;background:#5580a6 url(../images/button-grad-vs.png) repeat-x scroll left top;text-shadow:rgba(0,0,0,0.3) 0 -1px 0;}input.button-primary:active,button.button-primary:active,a.button-primary:active{background:#21759b url(../images/button-grad-active-vs.png) repeat-x scroll left top;color:#eaf2fa;}input.button-primary:hover,button.button-primary:hover,a.button-primary:hover,a.button-primary:focus,a.button-primary:active{border-color:#2e5475;color:#eaf2fa;}.button-disabled,.button[disabled],.button:disabled,.button-secondary[disabled],.button-secondary:disabled,a.button.disabled{color:#aaa!important;border-color:#ddd!important;}.button-primary-disabled,.button-primary[disabled],.button-primary:disabled{color:#B0C3E2!important;background:#6590A6!important;}a:hover,a:active,a:focus{color:#d54e21;}#wphead #viewsite a:hover,#adminmenu a:hover,#adminmenu ul.wp-submenu a:hover,#the-comment-list .comment a:hover,#rightnow a:hover,#media-upload a.del-link:hover,div.dashboard-widget-submit input:hover,.subsubsub a:hover,.subsubsub a.current:hover,.ui-tabs-nav a:hover,.plugins .inactive a:hover,#all-plugins-table .plugins .inactive a:hover,#search-plugins-table .plugins .inactive a:hover{color:#d54e21;}#the-comment-list .comment-item,#dashboard-widgets #dashboard_quick_press form p.submit{border-color:#dfdfdf;}#dashboard_right_now .table{background:#faf9f7!important;}#side-sortables #category-tabs .tabs a{color:#333;}#rightnow .rbutton{background-color:#ebebeb;color:#264761;}.submitbox .submit{background-color:#464646;color:#ccc;}.plugins a.delete:hover,#all-plugins-table .plugins a.delete:hover,#search-plugins-table .plugins a.delete:hover,.submitbox .submitdelete{color:#f00;border-bottom-color:#f00;}.submitbox .submitdelete:hover,#media-items a.delete:hover{color:#fff;background-color:#f00;border-bottom-color:#f00;}#normal-sortables .submitbox .submitdelete:hover{color:#000;background-color:#f00;border-bottom-color:#f00;}.tablenav .dots{border-color:transparent;}.tablenav .next,.tablenav .prev{border-color:transparent;color:#21759b;}.tablenav .next:hover,.tablenav .prev:hover{border-color:transparent;color:#d54e21;}.updated,.login .message{background-color:#ffffe0;border-color:#e6db55;}.update-message{color:#000;}a.page-numbers{border-bottom-color:#b8d3e2;}.commentlist li{border-bottom-color:#ccc;}.widefat td,.widefat th,#install-plugins .plugins td,#install-plugins .plugins th{border-color:#dfdfdf;}.widefat th{text-shadow:rgba(255,255,255,0.8) 0 1px 0;}.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.find-box-head{color:#333;background:#d5e6f2 url(../images/blue-grad.png) repeat-x scroll left top;}h3.dashboard-widget-title small a{color:#d7d7d7;}h3.dashboard-widget-title small a:hover{color:#fff;}a,#adminmenu a,#poststuff #edButtonPreview,#poststuff #edButtonHTML,#the-comment-list p.comment-author strong a,#media-upload a.del-link,#media-items a.delete,.plugins a.delete,.ui-tabs-nav a{color:#1c6280;}body.press-this .tabs a,body.press-this .tabs a:hover{background-color:#fff;border-color:#c6d9e9;border-bottom-color:#fff;color:#d54e21;}#adminmenu #awaiting-mod,#adminmenu .update-plugins,#sidemenu a .update-plugins,#rightnow .reallynow,#plugin-information .action-button{background-color:#d54e21;color:#fff;}#adminmenu li a:hover #awaiting-mod,#adminmenu li a:hover .update-plugins,#sidemenu li a:hover .update-plugins{background-color:#264761;color:#fff;}#adminmenu li.current a #awaiting-mod,#adminmenu li.current a .update-plugins,#adminmenu li.wp-has-current-submenu a .update-plugins,#adminmenu li.wp-has-current-submenu a .update-plugins{background-color:#ddd;color:#000;text-shadow:none;-moz-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;-khtml-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;-webkit-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;box-shadow:rgba(0,0,0,0.2) 0 -1px 0;}#adminmenu li.current a:hover #awaiting-mod,#adminmenu li.current a:hover .update-plugins,#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod,#adminmenu li.wp-has-current-submenu a:hover .update-plugins{background-color:#264761;color:#fff;}div#media-upload-header,div#plugin-information-header{background-color:#f9f9f9;border-bottom-color:#dfdfdf;}#currenttheme img{border-color:#666;}#dashboard_secondary div.dashboard-widget-content ul li a{background-color:#f9f9f9;}input.readonly,textarea.readonly{background-color:#ddd;}#ed_toolbar input,#ed_reply_toolbar input{background:#fff url("../images/fade-butt.png") repeat-x 0 -2px;}#editable-post-name{background-color:#fffbcc;}#edit-slug-box strong,.tablenav .displaying-num,#submitted-on{color:#777;}.login #nav a{color:#21759b!important;}.login #nav a:hover{color:#d54e21!important;}#footer,#footer-upgrade{background:#1d507d;color:#b6d1e4;}#media-items,.imgedit-group{border-color:#dfdfdf;}.checkbox,.side-info,.plugins tr,.postbox,#your-profile #rich_editing{background-color:#fff;}.plugins .inactive,.plugins .inactive th,.plugins .inactive td,tr.inactive+tr.plugin-update-tr .plugin-update{background-color:#ebeeef;}.plugin-update-tr .update-message{background-color:#fffbe4;border-color:#dfdfdf;}.plugins .active,.plugins .active th,.plugins .active td{color:#000;}.plugins .inactive a{color:#579;}#the-comment-list tr.undo,#the-comment-list div.undo{background-color:#f4f4f4;}#the-comment-list .unapproved{background-color:#ffffe0;}#the-comment-list .approve a{color:#006505;}#the-comment-list .unapprove a{color:#d98500;}table.widefat span.delete a,table.widefat span.trash a,table.widefat span.spam a,#dashboard_recent_comments .delete a,#dashboard_recent_comments .trash a,#dashboard_recent_comments .spam a{color:#bc0b0b;}.widget,#widget-list .widget-top,.postbox,#titlediv,#poststuff .postarea,.stuffbox{border-color:#dfdfdf;}.widget,.postbox{background-color:#fff;}.ui-sortable .postbox h3{color:#093e56;}.widget .widget-top,.ui-sortable .postbox h3:hover{color:#000;}.curtime #timestamp{background-image:url(../images/date-button.gif);}#quicktags #ed_link{color:#00f;}#rightnow .youhave{background-color:#f0f6fb;}#rightnow a{color:#448abd;}.tagchecklist span a,#bulk-titles div a{background:url(../images/xit.gif) no-repeat;}.tagchecklist span a:hover,#bulk-titles div a:hover{background:url(../images/xit.gif) no-repeat -10px 0;}#update-nag{background-color:#fffeeb;border-color:#ccc;color:#555;}.login #backtoblog a{color:#ccc;}#wphead{background-color:#1d507d;}body.login{border-top-color:#093e56;}#wphead h1 a{color:#fff;}#user_info{color:#b6d1e4;}#user_info a:link,#user_info a:visited,#footer a:link,#footer a:visited{color:#fff;text-decoration:none;}#user_info a:hover,#user_info a:active,#footer a:hover,#footer a:active{text-decoration:underline;}div#media-upload-error,.file-error,abbr.required,.widget-control-remove:hover,table.widefat .delete a:hover,table.widefat .trash a:hover,table.widefat .spam a:hover,#dashboard_recent_comments .delete a:hover,#dashboard_recent_comments .trash a:hover,#dashboard_recent_comments .spam a:hover{color:#f00;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}#quicktags{border-color:#dfdfdf;background-color:#dfdfdf;}#ed_toolbar input{border-color:#c3c3c3;}#ed_toolbar input:hover{border-color:#aaa;background:#ddd;}#poststuff .wp_themeSkin .mceStatusbar{border-color:#ededed;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{background-color:#f2f1eb;border-color:#dfdfdf;color:#999;}#poststuff #editor-toolbar .active{border-bottom-color:#e3eef7;background-color:#e3eef7;color:#333;}#post-status-info{background-color:#ededed;}.wp_themeSkin *,.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{color:#000;}.wp_themeSkin iframe{background:#fff;}.wp_themeSkin .mceStatusbar{color:#000;background-color:#f5f5f5;}.wp_themeSkin .mceButton{background-color:#e9e8e8;border-color:#b2b2b2;}.wp_themeSkin a.mceButtonEnabled:hover,.wp_themeSkin a.mceButtonActive,.wp_themeSkin a.mceButtonSelected{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceButtonDisabled{border-color:#ccc!important;}.wp_themeSkin .mceListBox .mceText,.wp_themeSkin .mceListBox .mceOpen{border-color:#b2b2b2;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin .mceListBoxSelected .mceText{border-color:#777!important;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceText,.wp_themeSkin .mceListBoxHover .mceText{border-color:#777!important;}.wp_themeSkin select.mceListBox{border-color:#b2b2b2;background-color:#fff;}.wp_themeSkin .mceSplitButton a.mceAction,.wp_themeSkin .mceSplitButton a.mceOpen{border-color:#b2b2b2;}.wp_themeSkin .mceSplitButton a.mceOpen:hover,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,.wp_themeSkin .mceSplitButton a.mceAction:hover{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceSplitButtonActive{background-color:#b2b2b2;}.wp_themeSkin div.mceColorSplitMenu table{background-color:#ebebeb;border-color:#b2b2b2;}.wp_themeSkin .mceColorSplitMenu a{border-color:#b2b2b2;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors{border-color:#fff;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover{border-color:#0a246a;background-color:#b6bdd2;}.wp_themeSkin a.mceMoreColors:hover{border-color:#0a246a;}.wp_themeSkin .mceMenu{border-color:#ddd;}.wp_themeSkin .mceMenu table{background-color:#ebeaeb;}.wp_themeSkin .mceMenu .mceText{color:#000;}.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,.wp_themeSkin .mceMenu .mceMenuItemActive{background-color:#f5f5f5;}.wp_themeSkin td.mceMenuItemSeparator{background-color:#aaa;}.wp_themeSkin .mceMenuItemTitle a{background-color:#ccc;border-bottom-color:#aaa;}.wp_themeSkin .mceMenuItemTitle span.mceText{color:#000;}.wp_themeSkin .mceMenuItemDisabled .mceText{color:#888;}#quicktags,.wp_themeSkin tr.mceFirst td.mceToolbar{background:#e3eef7 url("../images/ed-bg-vs.gif") repeat-x scroll left top;}.wp_themeSkin tr.mceFirst td.mceToolbar{border-color:#dfdfdf;}.wp-admin #mceModalBlocker{background:#000;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft{background:#444;border-left:1px solid #999;border-top:1px solid #999;-moz-border-radius:4px 0 0 0;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight{background:#444;border-right:1px solid #999;border-top:1px solid #999;border-top-right-radius:4px;-khtml-border-top-right-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius:0 4px 0 0;}.wp-admin .clearlooks2 .mceMiddle .mceLeft{background:#f1f1f1;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceMiddle .mceRight{background:#f1f1f1;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceBottom{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceLeft{background:#f1f1f1;border-bottom:1px solid #999;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceCenter{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceRight{background:#f1f1f1;border-bottom:1px solid #999;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceFocus .mceTop span{color:#e5e5e5;}#editorcontainer,#post-status-info,#titlediv #title,.editwidget .widget-inside{border-color:#dfdfdf;}#titlediv #title{background-color:#fff;}#tTips p#tTips_inside{background-color:#ddd;color:#333;}#timestampdiv input,#namediv input,#poststuff .inside .the-tagcloud{border-color:#dfdfdf;}#adminmenu *{border-color:#dfdfdf;}#adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;}.folded #adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -207px;}#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px;}#adminmenu a.menu-top{background:#eaf3fa url(../images/menu-bits-vs.gif) repeat-x scroll left -379px;}#adminmenu .wp-submenu a{background:#fff url(../images/menu-bits-vs.gif) no-repeat scroll 0 -310px;}#adminmenu .wp-has-current-submenu ul li a{background:none;}#adminmenu .wp-has-current-submenu ul li a.current{background:url(../images/menu-dark.gif) top left no-repeat!important;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu .menu-top .current{background:#3c6b95 url(../images/menu-bits-vs.gif) top left repeat-x;border-color:#1d507d;color:#fff;text-shadow:rgba(0,0,0,0.4) 0 -1px 0;}#adminmenu li.wp-has-current-submenu .wp-submenu,#adminmenu li.wp-has-current-submenu ul li a{border-color:#aaa!important;}#adminmenu li.wp-has-current-submenu ul li a{background:url(../images/menu-dark.gif) bottom left no-repeat!important;}#adminmenu li.wp-has-current-submenu ul{border-bottom-color:#aaa;}#adminmenu li.menu-top .current:hover{border-color:#6583c0;}#adminmenu .wp-submenu .current a.current{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll 0 -289px;}#adminmenu .wp-submenu a:hover{background-color:#eaf2fa!important;color:#333!important;}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{color:#333;background-color:#f5f5f5;background-image:none;border-color:#e3e3e3;text-shadow:rgba(255,255,255,1) 0 1px 0;}#adminmenu .wp-submenu ul{background-color:#fff;}.folded #adminmenu li.menu-top,#adminmenu .wp-submenu .wp-submenu-head{background-color:#eaf2fa;}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.menu-top.current{background-color:#bbd8e7;}#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background-color:#bbd8e7;border-color:#8cbdd5;}#adminmenu div.wp-submenu{background-color:transparent;}#adminmenu #menu-dashboard div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -61px -33px;}#adminmenu #menu-dashboard:hover div.wp-menu-image,#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image,#adminmenu #menu-dashboard.current div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -61px -1px;}#adminmenu #menu-posts div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -272px -33px;}#adminmenu #menu-posts:hover div.wp-menu-image,#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -272px -1px;}#adminmenu #menu-media div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -121px -33px;}#adminmenu #menu-media:hover div.wp-menu-image,#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -121px -1px;}#adminmenu #menu-links div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -91px -33px;}#adminmenu #menu-links:hover div.wp-menu-image,#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -91px -1px;}#adminmenu #menu-pages div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -151px -33px;}#adminmenu #menu-pages:hover div.wp-menu-image,#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -151px -1px;}#adminmenu #menu-comments div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -31px -33px;}#adminmenu #menu-comments:hover div.wp-menu-image,#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image,#adminmenu #menu-comments.current div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -31px -1px;}#adminmenu #menu-appearance div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -1px -33px;}#adminmenu #menu-appearance:hover div.wp-menu-image,#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -1px -1px;}#adminmenu #menu-plugins div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -181px -33px;}#adminmenu #menu-plugins:hover div.wp-menu-image,#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -181px -1px;}#adminmenu #menu-users div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -301px -33px;}#adminmenu #menu-users:hover div.wp-menu-image,#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -301px -1px;}#adminmenu #menu-tools div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -211px -33px;}#adminmenu #menu-tools:hover div.wp-menu-image,#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -211px -1px;}#adminmenu #menu-settings div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -241px -33px;}#adminmenu #menu-settings:hover div.wp-menu-image,#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -241px -1px;}table.diff .diff-deletedline{background-color:#fdd;}table.diff .diff-deletedline del{background-color:#f99;}table.diff .diff-addedline{background-color:#dfd;}table.diff .diff-addedline ins{background-color:#9f9;}#att-info{background-color:#e4f2fd;}#sidemenu a{background-color:#f9f9f9;border-color:#f9f9f9;border-bottom-color:#dfdfdf;}#sidemenu a.current{background-color:#fff;border-color:#dfdfdf #dfdfdf #fff;color:#d54e21;}#screen-options-wrap,#contextual-help-wrap{background-color:#eae9e4;border-color:#dfdfdf;}#screen-meta-links a.show-settings{color:#606060;}#screen-meta-links a.show-settings:hover{color:#000;}#replysubmit{background-color:#f1f1f1;border-top-color:#ddd;}#replyerror{border-color:#ddd;background-color:#f9f9f9;}#edithead,#replyhead{background-color:#f1f1f1;}#ed_reply_toolbar{background-color:#e9e9e9;}.vim-current,.vim-current th,.vim-current td{background-color:#e4f2fd!important;}.star-average,.star.star-rating{background-color:#fc0;}div.star.select:hover{background-color:#d00;}#plugin-information .fyi ul{background-color:#eaf3fa;}#plugin-information .fyi h2.mainheader{background-color:#cee1ef;}#plugin-information pre,#plugin-information code{background-color:#ededff;}#plugin-information pre{border:1px solid #ccc;}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea,#bulk-titles,#replyrow input{border-color:#ddd;}.inline-editor div.title{background-color:#eaf3fa;}.inline-editor ul.cat-checklist{background-color:#fff;border-color:#ddd;}.inline-editor .categories .catshow,.inline-editor .categories .cathide{color:#21759b;}.inline-editor .quick-edit-save{background-color:#f1f1f1;}#replyrow #ed_reply_toolbar input:hover{border-color:#aaa;background:#ddd;}fieldset.inline-edit-col-right .inline-edit-col{border-color:#dfdfdf;}.attention{color:#d54e21;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;}#major-publishing-actions{background:#eaf2fa;}.tablenav .tablenav-pages{color:#555;}.tablenav .tablenav-pages a{border-color:#e3e3e3;background:#eee url('../images/menu-bits-vs.gif') repeat-x scroll left -379px;}.tablenav .tablenav-pages a:hover{color:#d54e21;border-color:#d54321;}.tablenav .tablenav-pages a:active{color:#fff!important;}.tablenav .tablenav-pages .current{background:#dfdfdf;border-color:#d3d3d3;}#availablethemes,#availablethemes td{border-color:#ddd;}#current-theme img{border-color:#999;}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{color:#999;}#TB_window #TB_title a.tb-theme-preview-link:hover,#TB_window #TB_title a.tb-theme-preview-link:focus{color:#ccc;}.misc-pub-section{border-bottom-color:#eee;}#minor-publishing{border-bottom-color:#ddd;}#post-body .misc-pub-section{border-right-color:#eee;}.post-com-count span{background-color:#bbb;}.form-table .color-palette td{border-color:#fff;}.sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;}#post-body ul#category-tabs li.tabs a{color:#333;}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{border-color:#999;background-color:#eee;}#wp_editimgbtn:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_delgallery:hover{border-color:#555;background-color:#ccc;}#favorite-first{background:#5580a6 url(../images/fav-vs.png) repeat-x 0 center;border-color:#517ea5!important;border-bottom-color:#416686!important;}#favorite-actions .slide-down{background-image:url(../images/fav-top-vs.gif);background-position:0 0;background-repeat:repeat-x;}#favorite-inside{border-color:#5b86ac;background-color:#5580a6;}#favorite-toggle{background:transparent url(../images/fav-arrow-vs.gif) no-repeat 0 -4px;}#favorite-actions a{color:#ddd;}#favorite-actions a:hover{color:#fff;}#favorite-inside a:hover{text-decoration:underline;}#favorite-actions .slide-down{border-bottom-color:#626262;}#screen-meta a.show-settings{background-color:transparent;text-shadow:rgba(255,255,255,0.7) 0 1px 0;}#icon-edit,#icon-post{background:transparent url(../images/icons32-vs.png) no-repeat -552px -5px;}#icon-index{background:transparent url(../images/icons32-vs.png) no-repeat -137px -5px;}#icon-upload{background:transparent url(../images/icons32-vs.png) no-repeat -251px -5px;}#icon-link-manager,#icon-link,#icon-link-category{background:transparent url(../images/icons32-vs.png) no-repeat -190px -5px;}#icon-edit-pages,#icon-page{background:transparent url(../images/icons32-vs.png) no-repeat -312px -5px;}#icon-edit-comments{background:transparent url(../images/icons32-vs.png) no-repeat -72px -5px;}#icon-themes{background:transparent url(../images/icons32-vs.png) no-repeat -11px -5px;}#icon-plugins{background:transparent url(../images/icons32-vs.png) no-repeat -370px -5px;}#icon-users,#icon-profile,#icon-user-edit{background:transparent url(../images/icons32-vs.png) no-repeat -600px -5px;}#icon-tools,#icon-admin{background:transparent url(../images/icons32-vs.png) no-repeat -432px -5px;}#icon-options-general{background:transparent url(../images/icons32-vs.png) no-repeat -492px -5px;}.view-switch #view-switch-list{background:transparent url(../images/list-vs.png) no-repeat 0 0;}.view-switch #view-switch-list.current{background:transparent url(../images/list-vs.png) no-repeat -40px 0;}.view-switch #view-switch-excerpt{background:transparent url(../images/list-vs.png) no-repeat -20px 0;}.view-switch #view-switch-excerpt.current{background:transparent url(../images/list-vs.png) no-repeat -60px 0;}#header-logo{background:transparent url(../images/wp-logo-vs.gif) no-repeat scroll center center;}#wphead #site-visit-button{background-color:#3c6b95;background-image:url(../images/visit-site-button-grad-vs.gif);color:#b6d1e4;text-shadow:#3f3f3f 0 -1px 0;}#wphead a:hover #site-visit-button{color:#fff;}#wphead a:focus #site-visit-button,#wphead a:active #site-visit-button{background-position:0 -27px;}.popular-tags,.feature-filter{background-color:#fff;border-color:#dfdfdf;}#theme-information .action-button{border-top-color:#dfdfdf;}.theme-listing br.line{border-bottom-color:#ccc;}div.widgets-sortables,#widgets-left .inactive{background-color:#f1f1f1;border-color:#ddd;}#available-widgets .widget-holder{background-color:#fff;border-color:#ddd;}#widgets-left .sidebar-name{background-color:#aaa;background-image:url(../images/ed-bg-vs.gif);text-shadow:#FFF 0 1px 0;border-color:#dfdfdf;}#widgets-right .sidebar-name{background-image:url(../images/fav-vs.png);text-shadow:#3f3f3f 0 -1px 0;background-color:#636363;border-color:#636363;color:#fff;}.sidebar-name:hover,#removing-widget{color:#d54e21;}#removing-widget span{color:black;}#widgets-left .sidebar-name-arrow{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px;}#widgets-right .sidebar-name-arrow{background:transparent url(../images/fav-arrow-vs.gif) no-repeat scroll 0 -1px;}.in-widget-title{color:#606060;}.deleting .widget-title *{color:#aaa;}.imgedit-menu div{border-color:#d5d5d5;background-color:#f1f1f1;}.imgedit-menu div:hover{border-color:#c1c1c1;background-color:#eaeaea;}.imgedit-menu div.disabled{border-color:#ccc;background-color:#ddd;filter:alpha(opacity=50);opacity:.5;}#dashboard_recent_comments div.undo{border-top-color:#dfdfdf;}.comment-ays,.comment-ays th{border-color:#ddd;}.comment-ays th{background-color:#f1f1f1;}
\ No newline at end of file
--- /dev/null
+html {
+ background-color: #f7f6f1;
+}
+
+* html input,
+* html .widget {
+ border-color: #8cbdd5;
+}
+
+textarea,
+input[type="text"],
+input[type="password"],
+input[type="file"],
+input[type="button"],
+input[type="submit"],
+input[type="reset"],
+select {
+ border-color: #dfdfdf;
+ background-color: #fff;
+}
+
+kbd,
+code {
+ background: #eaeaea;
+}
+
+input[readonly] {
+ background-color: #eee;
+}
+
+.find-box-search {
+ border-color: #dfdfdf;
+ background-color: #f1f1f1;
+}
+
+.find-box {
+ background-color: #f1f1f1;
+}
+
+.find-box-inside {
+ background-color: #fff;
+}
+
+a.page-numbers:hover {
+ border-color: #999;
+}
+
+body,
+#wpbody,
+.form-table .pre {
+ color: #333;
+}
+
+body > #upload-menu {
+ border-bottom-color: #fff;
+}
+
+#postcustomstuff table,
+#your-profile fieldset,
+#rightnow,
+div.dashboard-widget,
+#dashboard-widgets p.dashboard-widget-links,
+#replyrow #ed_reply_toolbar input {
+ border-color: #ccc;
+}
+
+#poststuff .inside label.spam,
+#poststuff .inside label.deleted {
+ color: red;
+}
+
+#poststuff .inside label.waiting {
+ color: orange;
+}
+
+#poststuff .inside label.approved {
+ color: green;
+}
+
+#postcustomstuff table {
+ border-color: #dfdfdf;
+ background-color: #f9f9f9;
+}
+
+#postcustomstuff thead th {
+ background-color: #f1f1f1;
+}
+
+#postcustomstuff table input,
+#postcustomstuff table textarea {
+ border-color: #dfdfdf;
+ background-color: #fff;
+}
+
+.widefat {
+ border-color: #dfdfdf;
+ background-color: #fff;
+}
+
+div.dashboard-widget-error {
+ background-color: #c43;
+}
+
+div.dashboard-widget-notice {
+ background-color: #cfe1ef;
+}
+
+div.dashboard-widget-submit {
+ border-top-color: #ccc;
+}
+
+div.tabs-panel,
+ul#category-tabs li.tabs {
+ border-color: #dfdfdf;
+}
+
+ul#category-tabs li.tabs {
+ background-color: #f1f1f1;
+}
+
+input.disabled,
+textarea.disabled {
+ background-color: #ccc;
+}
+/* #upload-menu li a.upload-tab-link, */
+.login #backtoblog a:hover,
+#plugin-information .action-button a,
+#plugin-information .action-button a:hover,
+#plugin-information .action-button a:visited {
+ color: #fff;
+}
+
+.widget .widget-top,
+.postbox h3,
+.stuffbox h3 {
+ background: #d5e6f2 url("../images/blue-grad.png") repeat-x left top;
+ text-shadow: #fff 0 1px 0;
+}
+
+.form-table th,
+.form-wrap label {
+ color: #222;
+ text-shadow: #fff 0 1px 0;
+}
+
+.description,
+.form-wrap p {
+ color: #666;
+}
+
+strong .post-com-count span {
+ background-color: #21759b;
+}
+
+.sorthelper {
+ background-color: #ccf3fa;
+}
+
+.ac_match,
+.subsubsub a.current {
+ color: #000;
+}
+
+.wrap h2 {
+ color: #093e56;
+}
+
+.ac_over {
+ background-color: #f0f0b8;
+}
+
+.ac_results {
+ background-color: #fff;
+ border-color: #808080;
+}
+
+.ac_results li {
+ color: #101010;
+}
+
+.alt
+.alternate {
+ background-color: #edfbfc;
+}
+
+.available-theme a.screenshot {
+ background-color: #f1f1f1;
+ border-color: #ddd;
+}
+
+.bar {
+ background-color: #e8e8e8;
+ border-right-color: #99d;
+}
+
+#media-upload,
+#media-upload .media-item .slidetoggle {
+ background: #fff;
+}
+
+#media-upload .slidetoggle {
+ border-top-color: #dfdfdf;
+}
+
+.error,
+.login #login_error {
+ background-color: #ffebe8;
+ border-color: #c00;
+}
+
+.error a {
+ color: #c00;
+}
+
+.form-invalid {
+ background-color: #ffebe8 !important;
+}
+
+.form-invalid input,
+.form-invalid select {
+ border-color: #c00 !important;
+}
+
+.submit {
+ border-color: #8cbdd5;
+}
+
+.highlight {
+ background-color: #e4f2fd;
+ color: #d54e21;
+}
+
+.howto,
+.nonessential,
+#edit-slug-box,
+.form-input-tip,
+.rss-widget span.rss-date,
+.subsubsub {
+ color: #666;
+}
+
+.media-item {
+ border-bottom-color: #dfdfdf;
+}
+
+#wpbody-content #media-items .describe {
+ border-top-color: #dfdfdf;
+}
+
+.media-upload-form label.form-help,
+td.help {
+ color: #9a9a9a;
+}
+
+.post-com-count {
+ background-image: url(../images/bubble_bg.gif);
+ color: #fff;
+}
+
+.post-com-count span {
+ background-color: #bbb;
+ color: #fff;
+}
+
+.post-com-count:hover span {
+ background-color: #d54e21;
+}
+
+.quicktags, .search {
+ background-color: #ccc;
+ color: #000;
+}
+
+.side-info h5 {
+ border-bottom-color: #dadada;
+}
+
+.side-info ul {
+ color: #666;
+}
+
+.button,
+.button-secondary,
+.submit input,
+input[type=button],
+input[type=submit] {
+ border-color: #dfdfdf;
+ color: #464646;
+}
+
+.button:hover,
+.button-secondary:hover,
+.submit input:hover,
+input[type=button]:hover,
+input[type=submit]:hover {
+ color: #000;
+ border-color: #adaca7;
+}
+
+.button,
+.submit input,
+.button-secondary {
+ background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
+ text-shadow: rgba(255,255,255,1) 0 1px 0;
+}
+
+.button:active,
+.submit input:active,
+.button-secondary:active {
+ background: #eee url(../images/white-grad-active.png) repeat-x scroll left top;
+}
+
+input.button-primary,
+button.button-primary,
+a.button-primary {
+ border-color: #5b86ab;
+ font-weight: bold;
+ color: #fff;
+ background: #5580a6 url(../images/button-grad-vs.png) repeat-x scroll left top;
+ text-shadow: rgba(0,0,0,0.3) 0 -1px 0;
+}
+
+input.button-primary:active,
+button.button-primary:active,
+a.button-primary:active {
+ background: #21759b url(../images/button-grad-active-vs.png) repeat-x scroll left top;
+ color: #eaf2fa;
+}
+
+input.button-primary:hover,
+button.button-primary:hover,
+a.button-primary:hover,
+a.button-primary:focus,
+a.button-primary:active {
+ border-color: #2e5475;
+ color: #eaf2fa;
+}
+
+.button-disabled,
+.button[disabled],
+.button:disabled,
+.button-secondary[disabled],
+.button-secondary:disabled,
+a.button.disabled {
+ color: #aaa !important;
+ border-color: #ddd !important;
+}
+
+.button-primary-disabled,
+.button-primary[disabled],
+.button-primary:disabled {
+ color: #B0C3E2 !important;
+ background: #6590A6 !important;
+}
+
+a:hover,
+a:active,
+a:focus {
+ color: #d54e21;
+}
+
+#wphead #viewsite a:hover,
+#adminmenu a:hover,
+#adminmenu ul.wp-submenu a:hover,
+#the-comment-list .comment a:hover,
+#rightnow a:hover,
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover,
+.ui-tabs-nav a:hover,
+.plugins .inactive a:hover,
+#all-plugins-table .plugins .inactive a:hover,
+#search-plugins-table .plugins .inactive a:hover {
+ color: #d54e21;
+}
+
+#the-comment-list .comment-item,
+#dashboard-widgets #dashboard_quick_press form p.submit {
+ border-color: #dfdfdf;
+}
+
+#dashboard_right_now .table {
+ background:#faf9f7 !important;
+}
+
+#side-sortables #category-tabs .tabs a {
+ color: #333;
+}
+
+#rightnow .rbutton {
+ background-color: #ebebeb;
+ color: #264761;
+}
+
+.submitbox .submit {
+ background-color: #464646;
+ color: #ccc;
+}
+
+.plugins a.delete:hover,
+#all-plugins-table .plugins a.delete:hover,
+#search-plugins-table .plugins a.delete:hover,
+.submitbox .submitdelete {
+ color: #f00;
+ border-bottom-color: #f00;
+}
+
+.submitbox .submitdelete:hover,
+#media-items a.delete:hover {
+ color: #fff;
+ background-color: #f00;
+ border-bottom-color: #f00;
+}
+
+#normal-sortables .submitbox .submitdelete:hover {
+ color: #000;
+ background-color: #f00;
+ border-bottom-color: #f00;
+}
+
+.tablenav .dots {
+ border-color: transparent;
+}
+
+.tablenav .next,
+.tablenav .prev {
+ border-color: transparent;
+ color: #21759b;
+}
+
+.tablenav .next:hover,
+.tablenav .prev:hover {
+ border-color: transparent;
+ color: #d54e21;
+}
+
+.updated,
+.login .message {
+ background-color: #ffffe0;
+ border-color: #e6db55;
+}
+
+.update-message {
+ color: #000000;
+}
+
+a.page-numbers {
+ border-bottom-color: #b8d3e2;
+}
+
+.commentlist li {
+ border-bottom-color: #ccc;
+}
+
+.widefat td,
+.widefat th,
+#install-plugins .plugins td,
+#install-plugins .plugins th {
+ border-color: #dfdfdf;
+}
+
+.widefat th {
+ text-shadow: rgba(255,255,255,0.8) 0 1px 0;
+}
+
+.widefat thead tr th,
+.widefat tfoot tr th,
+h3.dashboard-widget-title,
+h3.dashboard-widget-title span,
+h3.dashboard-widget-title small,
+.find-box-head {
+ color: #333;
+ background: #d5e6f2 url(../images/blue-grad.png) repeat-x scroll left top;
+}
+
+h3.dashboard-widget-title small a {
+ color: #d7d7d7;
+}
+
+h3.dashboard-widget-title small a:hover {
+ color: #fff;
+}
+
+a,
+#adminmenu a,
+#poststuff #edButtonPreview,
+#poststuff #edButtonHTML,
+#the-comment-list p.comment-author strong a,
+#media-upload a.del-link,
+#media-items a.delete,
+.plugins a.delete,
+.ui-tabs-nav a {
+ color: #1c6280;
+}
+
+/* Because we don't want visited on these links */
+body.press-this .tabs a,
+body.press-this .tabs a:hover {
+ background-color: #fff;
+ border-color: #c6d9e9;
+ border-bottom-color: #fff;
+ color: #d54e21;
+}
+
+#adminmenu #awaiting-mod,
+#adminmenu .update-plugins,
+#sidemenu a .update-plugins,
+#rightnow .reallynow,
+#plugin-information .action-button {
+ background-color: #d54e21;
+ color: #fff;
+}
+
+#adminmenu li a:hover #awaiting-mod,
+#adminmenu li a:hover .update-plugins,
+#sidemenu li a:hover .update-plugins {
+ background-color: #264761;
+ color: #fff;
+}
+
+#adminmenu li.current a #awaiting-mod,
+#adminmenu li.current a .update-plugins,
+#adminmenu li.wp-has-current-submenu a .update-plugins,
+#adminmenu li.wp-has-current-submenu a .update-plugins {
+ background-color: #ddd;
+ color: #000;
+ text-shadow: none;
+ -moz-box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
+ -khtml-box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
+ -webkit-box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
+ box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
+}
+
+#adminmenu li.current a:hover #awaiting-mod,
+#adminmenu li.current a:hover .update-plugins,
+#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod,
+#adminmenu li.wp-has-current-submenu a:hover .update-plugins {
+ background-color: #264761;
+ color: #fff;
+}
+
+div#media-upload-header,
+div#plugin-information-header {
+ background-color: #f9f9f9;
+ border-bottom-color: #dfdfdf;
+}
+
+#currenttheme img {
+ border-color: #666;
+}
+
+#dashboard_secondary div.dashboard-widget-content ul li a {
+ background-color: #f9f9f9;
+}
+
+input.readonly, textarea.readonly {
+ background-color: #ddd;
+}
+
+#ed_toolbar input,
+#ed_reply_toolbar input {
+ background: #fff url("../images/fade-butt.png") repeat-x 0 -2px;
+}
+
+#editable-post-name {
+ background-color: #fffbcc;
+}
+
+#edit-slug-box strong,
+.tablenav .displaying-num,
+#submitted-on {
+ color: #777;
+}
+
+.login #nav a {
+ color: #21759b !important;
+}
+
+.login #nav a:hover {
+ color: #d54e21 !important;
+}
+
+#footer,
+#footer-upgrade {
+ background: #1d507d;
+ color: #b6d1e4;
+}
+
+#media-items,
+.imgedit-group {
+ border-color: #dfdfdf;
+}
+
+.checkbox,
+.side-info,
+.plugins tr,
+.postbox,
+#your-profile #rich_editing {
+ background-color: #fff;
+}
+
+.plugins .inactive,
+.plugins .inactive th,
+.plugins .inactive td,
+tr.inactive + tr.plugin-update-tr .plugin-update {
+ background-color: #ebeeef;
+}
+
+.plugin-update-tr .update-message {
+ background-color: #fffbe4;
+ border-color: #dfdfdf;
+}
+
+.plugins .active,
+.plugins .active th,
+.plugins .active td {
+ color: #000;
+}
+
+.plugins .inactive a {
+ color: #557799;
+}
+
+#the-comment-list tr.undo,
+#the-comment-list div.undo {
+ background-color: #f4f4f4;
+}
+
+#the-comment-list .unapproved {
+ background-color: #ffffe0;
+}
+
+#the-comment-list .approve a {
+ color: #006505;
+}
+
+#the-comment-list .unapprove a {
+ color: #d98500;
+}
+
+table.widefat span.delete a,
+table.widefat span.trash a,
+table.widefat span.spam a,
+#dashboard_recent_comments .delete a,
+#dashboard_recent_comments .trash a,
+#dashboard_recent_comments .spam a {
+ color: #bc0b0b;
+}
+
+.widget,
+#widget-list .widget-top,
+.postbox,
+#titlediv,
+#poststuff .postarea,
+.stuffbox {
+ border-color: #dfdfdf;
+}
+
+.widget,
+.postbox {
+ background-color: #fff;
+}
+
+.ui-sortable .postbox h3 {
+ color: #093e56;
+}
+
+.widget .widget-top,
+.ui-sortable .postbox h3:hover {
+ color: #000;
+}
+
+.curtime #timestamp {
+ background-image: url(../images/date-button.gif);
+}
+
+#quicktags #ed_link {
+ color: #00f;
+}
+
+#rightnow .youhave {
+ background-color: #f0f6fb;
+}
+
+#rightnow a {
+ color: #448abd;
+}
+
+.tagchecklist span a,
+#bulk-titles div a {
+ background: url(../images/xit.gif) no-repeat;
+}
+
+.tagchecklist span a:hover,
+#bulk-titles div a:hover {
+ background: url(../images/xit.gif) no-repeat -10px 0;
+}
+
+#update-nag {
+ background-color: #fffeeb;
+ border-color: #ccc;
+ color: #555;
+}
+
+.login #backtoblog a {
+ color: #ccc;
+}
+
+#wphead {
+ background-color: #1d507d;
+}
+
+body.login {
+ border-top-color: #093e56;
+}
+
+#wphead h1 a {
+ color: #fff;
+}
+
+#user_info {
+ color: #b6d1e4;
+}
+
+#user_info a:link,
+#user_info a:visited,
+#footer a:link,
+#footer a:visited {
+ color: #fff;
+ text-decoration: none;
+}
+
+#user_info a:hover,
+#user_info a:active,
+#footer a:hover,
+#footer a:active {
+ text-decoration: underline;
+}
+
+div#media-upload-error,
+.file-error,
+abbr.required,
+.widget-control-remove:hover,
+table.widefat .delete a:hover,
+table.widefat .trash a:hover,
+table.widefat .spam a:hover,
+#dashboard_recent_comments .delete a:hover,
+#dashboard_recent_comments .trash a:hover,
+#dashboard_recent_comments .spam a:hover {
+ color: #f00;
+}
+
+/* password strength meter */
+#pass-strength-result {
+ background-color: #eee;
+ border-color: #ddd !important;
+}
+
+#pass-strength-result.bad {
+ background-color: #ffb78c;
+ border-color: #ff853c !important;
+}
+
+#pass-strength-result.good {
+ background-color: #ffec8b;
+ border-color: #fc0 !important;
+}
+
+#pass-strength-result.short {
+ background-color: #ffa0a0;
+ border-color: #f04040 !important;
+}
+
+#pass-strength-result.strong {
+ background-color: #c3ff88;
+ border-color: #8dff1c !important;
+}
+
+/* editors */
+#quicktags {
+ border-color: #dfdfdf;
+ background-color: #dfdfdf;
+}
+
+#ed_toolbar input {
+ border-color: #c3c3c3;
+}
+
+#ed_toolbar input:hover {
+ border-color: #aaa;
+ background: #ddd;
+}
+
+#poststuff .wp_themeSkin .mceStatusbar {
+ border-color: #ededed;
+}
+
+#poststuff #edButtonPreview,
+#poststuff #edButtonHTML {
+ background-color: #f2f1eb;
+ border-color: #dfdfdf;
+ color: #999;
+}
+
+#poststuff #editor-toolbar .active {
+ border-bottom-color: #e3eef7;
+ background-color: #e3eef7;
+ color: #333;
+}
+
+/* TinyMCE */
+#post-status-info {
+ background-color: #ededed;
+}
+
+.wp_themeSkin *,
+.wp_themeSkin a:hover,
+.wp_themeSkin a:link,
+.wp_themeSkin a:visited,
+.wp_themeSkin a:active {
+ color: #000;
+}
+
+/* Containers */
+.wp_themeSkin iframe {
+ background: #fff;
+}
+
+/* Layout */
+.wp_themeSkin .mceStatusbar {
+ color: #000;
+ background-color: #f5f5f5;
+}
+
+/* Button */
+.wp_themeSkin .mceButton {
+ background-color: #e9e8e8;
+ border-color: #b2b2b2;
+}
+
+.wp_themeSkin a.mceButtonEnabled:hover,
+.wp_themeSkin a.mceButtonActive,
+.wp_themeSkin a.mceButtonSelected {
+ background-color: #d5d5d5;
+ border-color: #777 !important;
+}
+
+.wp_themeSkin .mceButtonDisabled {
+ border-color: #ccc !important;
+}
+
+/* ListBox */
+.wp_themeSkin .mceListBox .mceText,
+.wp_themeSkin .mceListBox .mceOpen {
+ border-color: #b2b2b2;
+ background-color: #d5d5d5;
+}
+
+.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,
+.wp_themeSkin .mceListBoxHover .mceOpen,
+.wp_themeSkin .mceListBoxSelected .mceOpen,
+.wp_themeSkin .mceListBoxSelected .mceText {
+ border-color: #777 !important;
+ background-color: #d5d5d5;
+}
+
+.wp_themeSkin table.mceListBoxEnabled:hover .mceText,
+.wp_themeSkin .mceListBoxHover .mceText {
+ border-color: #777 !important;
+}
+
+.wp_themeSkin select.mceListBox {
+ border-color: #b2b2b2;
+ background-color: #fff;
+}
+
+/* SplitButton */
+.wp_themeSkin .mceSplitButton a.mceAction,
+.wp_themeSkin .mceSplitButton a.mceOpen {
+ border-color: #b2b2b2;
+}
+
+.wp_themeSkin .mceSplitButton a.mceOpen:hover,
+.wp_themeSkin .mceSplitButtonSelected a.mceOpen,
+.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,
+.wp_themeSkin .mceSplitButton a.mceAction:hover {
+ background-color: #d5d5d5;
+ border-color: #777 !important;
+}
+
+.wp_themeSkin .mceSplitButtonActive {
+ background-color: #b2b2b2;
+}
+
+/* ColorSplitButton */
+.wp_themeSkin div.mceColorSplitMenu table {
+ background-color: #ebebeb;
+ border-color: #b2b2b2;
+}
+
+.wp_themeSkin .mceColorSplitMenu a {
+ border-color: #b2b2b2;
+}
+
+.wp_themeSkin .mceColorSplitMenu a.mceMoreColors {
+ border-color: #fff;
+}
+
+.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover {
+ border-color: #0a246a;
+ background-color: #b6bdd2;
+}
+
+.wp_themeSkin a.mceMoreColors:hover {
+ border-color: #0a246a;
+}
+
+/* Menu */
+.wp_themeSkin .mceMenu {
+ border-color: #ddd;
+}
+
+.wp_themeSkin .mceMenu table {
+ background-color: #ebeaeb;
+}
+
+.wp_themeSkin .mceMenu .mceText {
+ color: #000;
+}
+
+.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,
+.wp_themeSkin .mceMenu .mceMenuItemActive {
+ background-color: #f5f5f5;
+}
+.wp_themeSkin td.mceMenuItemSeparator {
+ background-color: #aaa;
+}
+.wp_themeSkin .mceMenuItemTitle a {
+ background-color: #ccc;
+ border-bottom-color: #aaa;
+}
+.wp_themeSkin .mceMenuItemTitle span.mceText {
+ color: #000;
+}
+.wp_themeSkin .mceMenuItemDisabled .mceText {
+ color: #888;
+}
+
+#quicktags,
+.wp_themeSkin tr.mceFirst td.mceToolbar {
+ background: #e3eef7 url("../images/ed-bg-vs.gif") repeat-x scroll left top;
+}
+.wp_themeSkin tr.mceFirst td.mceToolbar {
+ border-color: #dfdfdf;
+}
+
+.wp-admin #mceModalBlocker {
+ background: #000;
+}
+
+.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft {
+ background: #444;
+ border-left: 1px solid #999;
+ border-top: 1px solid #999;
+ -moz-border-radius: 4px 0 0 0;
+ -webkit-border-top-left-radius: 4px;
+ -khtml-border-top-left-radius: 4px;
+ border-top-left-radius: 4px;
+}
+
+.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight {
+ background: #444;
+ border-right: 1px solid #999;
+ border-top: 1px solid #999;
+ border-top-right-radius: 4px;
+ -khtml-border-top-right-radius: 4px;
+ -webkit-border-top-right-radius: 4px;
+ -moz-border-radius: 0 4px 0 0;
+}
+
+.wp-admin .clearlooks2 .mceMiddle .mceLeft {
+ background: #f1f1f1;
+ border-left: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceMiddle .mceRight {
+ background: #f1f1f1;
+ border-right: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom {
+ background: #f1f1f1;
+ border-bottom: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom .mceLeft {
+ background: #f1f1f1;
+ border-bottom: 1px solid #999;
+ border-left: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom .mceCenter {
+ background: #f1f1f1;
+ border-bottom: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom .mceRight {
+ background: #f1f1f1;
+ border-bottom: 1px solid #999;
+ border-right: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceFocus .mceTop span {
+ color: #e5e5e5;
+}
+/* end TinyMCE */
+
+#editorcontainer,
+#post-status-info,
+#titlediv #title,
+.editwidget .widget-inside {
+ border-color: #dfdfdf;
+}
+
+#titlediv #title {
+ background-color: #fff;
+}
+
+#tTips p#tTips_inside {
+ background-color: #ddd;
+ color: #333;
+}
+
+#timestampdiv input,
+#namediv input,
+#poststuff .inside .the-tagcloud {
+ border-color: #dfdfdf;
+}
+
+/* menu */
+#adminmenu * {
+ border-color: #dfdfdf;
+}
+
+#adminmenu li.wp-menu-separator {
+ background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;
+}
+
+.folded #adminmenu li.wp-menu-separator {
+ background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;
+}
+
+#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,
+#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle {
+ background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -207px;
+}
+
+#adminmenu .wp-has-submenu:hover .wp-menu-toggle,
+#adminmenu .wp-menu-open .wp-menu-toggle {
+ background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px;
+}
+
+#adminmenu a.menu-top {
+ background: #eaf3fa url(../images/menu-bits-vs.gif) repeat-x scroll left -379px;
+}
+
+#adminmenu .wp-submenu a {
+ background: #fff url(../images/menu-bits-vs.gif) no-repeat scroll 0 -310px;
+}
+
+#adminmenu .wp-has-current-submenu ul li a {
+ background: none;
+}
+
+#adminmenu .wp-has-current-submenu ul li a.current {
+ background: url(../images/menu-dark.gif) top left no-repeat !important;
+}
+
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu .menu-top .current {
+ background: #3c6b95 url(../images/menu-bits-vs.gif) top left repeat-x;
+ border-color: #1d507d;
+ color: #fff;
+ text-shadow: rgba(0,0,0,0.4) 0 -1px 0;
+}
+
+#adminmenu li.wp-has-current-submenu .wp-submenu,
+#adminmenu li.wp-has-current-submenu ul li a {
+ border-color: #aaa !important;
+}
+
+#adminmenu li.wp-has-current-submenu ul li a {
+ background: url(../images/menu-dark.gif) bottom left no-repeat !important;
+}
+
+#adminmenu li.wp-has-current-submenu ul {
+ border-bottom-color: #aaa;
+}
+
+#adminmenu li.menu-top .current:hover {
+ border-color: #6583c0;
+}
+
+#adminmenu .wp-submenu .current a.current {
+ background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll 0 -289px;
+}
+
+#adminmenu .wp-submenu a:hover {
+ background-color: #eaf2fa !important;
+ color: #333 !important;
+}
+
+#adminmenu .wp-submenu li.current,
+#adminmenu .wp-submenu li.current a,
+#adminmenu .wp-submenu li.current a:hover {
+ color: #333;
+ background-color: #f5f5f5;
+ background-image: none;
+ border-color: #e3e3e3;
+ text-shadow: rgba(255,255,255,1) 0 1px 0;
+}
+
+#adminmenu .wp-submenu ul {
+ background-color: #fff;
+}
+
+.folded #adminmenu li.menu-top,
+#adminmenu .wp-submenu .wp-submenu-head {
+ background-color: #eaf2fa;
+}
+
+.folded #adminmenu li.wp-has-current-submenu,
+.folded #adminmenu li.menu-top.current {
+ background-color: #bbd8e7;
+}
+
+#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head {
+ background-color: #bbd8e7;
+ border-color: #8cbdd5;
+}
+
+#adminmenu div.wp-submenu {
+ background-color: transparent;
+}
+
+/* menu icons */
+#adminmenu #menu-dashboard div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -61px -33px;
+}
+
+#adminmenu #menu-dashboard:hover div.wp-menu-image,
+#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image,
+#adminmenu #menu-dashboard.current div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -61px -1px;
+}
+
+#adminmenu #menu-posts div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -272px -33px;
+}
+
+#adminmenu #menu-posts:hover div.wp-menu-image,
+#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -272px -1px;
+}
+
+#adminmenu #menu-media div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -121px -33px;
+}
+
+#adminmenu #menu-media:hover div.wp-menu-image,
+#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -121px -1px;
+}
+
+#adminmenu #menu-links div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -91px -33px;
+}
+
+#adminmenu #menu-links:hover div.wp-menu-image,
+#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -91px -1px;
+}
+
+#adminmenu #menu-pages div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -151px -33px;
+}
+
+#adminmenu #menu-pages:hover div.wp-menu-image,
+#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -151px -1px;
+}
+
+#adminmenu #menu-comments div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -31px -33px;
+}
+
+#adminmenu #menu-comments:hover div.wp-menu-image,
+#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image,
+#adminmenu #menu-comments.current div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -31px -1px;
+}
+
+#adminmenu #menu-appearance div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -1px -33px;
+}
+
+#adminmenu #menu-appearance:hover div.wp-menu-image,
+#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -1px -1px;
+}
+
+#adminmenu #menu-plugins div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -181px -33px;
+}
+
+#adminmenu #menu-plugins:hover div.wp-menu-image,
+#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -181px -1px;
+}
+
+#adminmenu #menu-users div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -301px -33px;
+}
+
+#adminmenu #menu-users:hover div.wp-menu-image,
+#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -301px -1px;
+}
+
+#adminmenu #menu-tools div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -211px -33px;
+}
+
+#adminmenu #menu-tools:hover div.wp-menu-image,
+#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -211px -1px;
+}
+
+#adminmenu #menu-settings div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -241px -33px;
+}
+
+#adminmenu #menu-settings:hover div.wp-menu-image,
+#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu-vs.png") no-repeat scroll -241px -1px;
+}
+/* end menu */
+
+
+/* Diff */
+table.diff .diff-deletedline {
+ background-color: #fdd;
+}
+
+table.diff .diff-deletedline del {
+ background-color: #f99;
+}
+
+table.diff .diff-addedline {
+ background-color: #dfd;
+}
+
+table.diff .diff-addedline ins {
+ background-color: #9f9;
+}
+
+#att-info {
+ background-color: #e4f2fd;
+}
+
+/* edit image */
+#sidemenu a {
+ background-color: #f9f9f9;
+ border-color: #f9f9f9;
+ border-bottom-color: #dfdfdf;
+}
+
+#sidemenu a.current {
+ background-color: #fff;
+ border-color: #dfdfdf #dfdfdf #fff;
+ color: #d54e21;
+}
+
+#screen-options-wrap,
+#contextual-help-wrap {
+ background-color: #eae9e4;
+ border-color: #dfdfdf;
+}
+
+#screen-meta-links a.show-settings {
+ color: #606060;
+}
+
+#screen-meta-links a.show-settings:hover {
+ color: #000;
+}
+
+#replysubmit {
+ background-color: #f1f1f1;
+ border-top-color: #ddd;
+}
+
+#replyerror {
+ border-color: #ddd;
+ background-color: #f9f9f9;
+}
+
+#edithead,
+#replyhead {
+ background-color: #f1f1f1;
+}
+
+#ed_reply_toolbar {
+ background-color: #e9e9e9;
+}
+
+/* table vim shortcuts */
+.vim-current,
+.vim-current th,
+.vim-current td {
+ background-color: #e4f2fd !important;
+}
+
+/* Install Plugins */
+.star-average,
+.star.star-rating {
+ background-color: #fc0;
+}
+
+div.star.select:hover {
+ background-color: #d00;
+}
+
+#plugin-information .fyi ul {
+ background-color: #eaf3fa;
+}
+
+#plugin-information .fyi h2.mainheader {
+ background-color: #cee1ef;
+}
+
+#plugin-information pre,
+#plugin-information code {
+ background-color: #ededff;
+}
+
+#plugin-information pre {
+ border: 1px solid #ccc;
+}
+
+/* inline editor */
+.inline-edit-row fieldset input[type="text"],
+.inline-edit-row fieldset textarea,
+#bulk-titles,
+#replyrow input {
+ border-color: #ddd;
+}
+
+.inline-editor div.title {
+ background-color: #eaf3fa;
+}
+
+.inline-editor ul.cat-checklist {
+ background-color: #fff;
+ border-color: #ddd;
+}
+
+.inline-editor .categories .catshow,
+.inline-editor .categories .cathide {
+ color: #21759b;
+}
+
+.inline-editor .quick-edit-save {
+ background-color: #f1f1f1;
+}
+
+#replyrow #ed_reply_toolbar input:hover {
+ border-color: #aaa;
+ background: #ddd;
+}
+
+fieldset.inline-edit-col-right .inline-edit-col {
+ border-color: #dfdfdf;
+}
+
+.attention {
+ color: #d54e21;
+}
+
+.meta-box-sortables .postbox:hover .handlediv {
+ background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;
+}
+
+#major-publishing-actions {
+ background: #eaf2fa;
+}
+
+.tablenav .tablenav-pages {
+ color: #555;
+}
+
+.tablenav .tablenav-pages a {
+ border-color: #e3e3e3;
+ background: #eee url('../images/menu-bits-vs.gif') repeat-x scroll left -379px;
+}
+
+.tablenav .tablenav-pages a:hover {
+ color: #d54e21;
+ border-color: #d54321;
+}
+
+.tablenav .tablenav-pages a:active {
+ color: #fff !important;
+}
+
+.tablenav .tablenav-pages .current {
+ background: #dfdfdf;
+ border-color: #d3d3d3;
+}
+
+#availablethemes,
+#availablethemes td {
+ border-color: #ddd;
+}
+
+#current-theme img {
+ border-color: #999;
+}
+
+#TB_window #TB_title a.tb-theme-preview-link,
+#TB_window #TB_title a.tb-theme-preview-link:visited {
+ color: #999;
+}
+
+#TB_window #TB_title a.tb-theme-preview-link:hover,
+#TB_window #TB_title a.tb-theme-preview-link:focus {
+ color: #ccc;
+}
+
+.misc-pub-section {
+ border-bottom-color: #eee;
+}
+
+#minor-publishing {
+ border-bottom-color: #ddd;
+}
+
+#post-body .misc-pub-section {
+ border-right-color: #eee;
+}
+
+.post-com-count span {
+ background-color: #bbb;
+}
+
+.form-table .color-palette td {
+ border-color: #fff;
+}
+
+.sortable-placeholder {
+ border-color: #bbb;
+ background-color: #f5f5f5;
+}
+
+#post-body ul#category-tabs li.tabs a {
+ color: #333;
+}
+
+#wp_editimgbtn,
+#wp_delimgbtn,
+#wp_editgallery,
+#wp_delgallery {
+ border-color: #999;
+ background-color: #eee;
+}
+
+#wp_editimgbtn:hover,
+#wp_delimgbtn:hover,
+#wp_editgallery:hover,
+#wp_delgallery:hover {
+ border-color: #555;
+ background-color: #ccc;
+}
+
+#favorite-first {
+ background: #5580a6 url(../images/fav-vs.png) repeat-x 0 center;
+ border-color: #517ea5 !important;
+ border-bottom-color: #416686 !important;
+}
+
+#favorite-actions .slide-down {
+ background-image: url(../images/fav-top-vs.gif);
+ background-position:0 0;
+ background-repeat: repeat-x;
+}
+
+#favorite-inside {
+ border-color: #5b86ac;
+ background-color: #5580a6;
+}
+
+#favorite-toggle {
+ background: transparent url(../images/fav-arrow-vs.gif) no-repeat 0 -4px;
+}
+
+#favorite-actions a {
+ color: #ddd;
+}
+
+#favorite-actions a:hover {
+ color: #fff;
+}
+
+#favorite-inside a:hover {
+ text-decoration: underline;
+}
+
+#favorite-actions .slide-down {
+ border-bottom-color: #626262;
+}
+
+#screen-meta a.show-settings {
+ background-color: transparent;
+ text-shadow: rgba(255,255,255,0.7) 0 1px 0;
+}
+
+#icon-edit,
+#icon-post {
+ background: transparent url(../images/icons32-vs.png) no-repeat -552px -5px;
+}
+
+#icon-index {
+ background: transparent url(../images/icons32-vs.png) no-repeat -137px -5px;
+}
+
+#icon-upload {
+ background: transparent url(../images/icons32-vs.png) no-repeat -251px -5px;
+}
+
+#icon-link-manager,
+#icon-link,
+#icon-link-category {
+ background: transparent url(../images/icons32-vs.png) no-repeat -190px -5px;
+}
+
+#icon-edit-pages,
+#icon-page {
+ background: transparent url(../images/icons32-vs.png) no-repeat -312px -5px;
+}
+
+#icon-edit-comments {
+ background: transparent url(../images/icons32-vs.png) no-repeat -72px -5px;
+}
+
+#icon-themes {
+ background: transparent url(../images/icons32-vs.png) no-repeat -11px -5px;
+}
+
+#icon-plugins {
+ background: transparent url(../images/icons32-vs.png) no-repeat -370px -5px;
+}
+
+#icon-users,
+#icon-profile,
+#icon-user-edit {
+ background: transparent url(../images/icons32-vs.png) no-repeat -600px -5px;
+}
+
+#icon-tools,
+#icon-admin {
+ background: transparent url(../images/icons32-vs.png) no-repeat -432px -5px;
+}
+
+#icon-options-general {
+ background: transparent url(../images/icons32-vs.png) no-repeat -492px -5px;
+}
+
+.view-switch #view-switch-list {
+ background: transparent url(../images/list-vs.png) no-repeat 0 0;
+}
+
+.view-switch #view-switch-list.current {
+ background: transparent url(../images/list-vs.png) no-repeat -40px 0;
+}
+
+.view-switch #view-switch-excerpt {
+ background: transparent url(../images/list-vs.png) no-repeat -20px 0;
+}
+
+.view-switch #view-switch-excerpt.current {
+ background: transparent url(../images/list-vs.png) no-repeat -60px 0;
+}
+
+#header-logo {
+ background: transparent url(../images/wp-logo-vs.gif) no-repeat scroll center center;
+}
+
+#wphead #site-visit-button {
+ background-color: #3c6b95;
+ background-image: url(../images/visit-site-button-grad-vs.gif);
+ color: #b6d1e4;
+ text-shadow: #3f3f3f 0 -1px 0;
+}
+
+#wphead a:hover #site-visit-button {
+ color: #fff;
+}
+
+#wphead a:focus #site-visit-button,
+#wphead a:active #site-visit-button {
+ background-position: 0 -27px;
+}
+
+.popular-tags,
+.feature-filter {
+ background-color: #fff;
+ border-color: #dfdfdf;
+}
+
+#theme-information .action-button {
+ border-top-color: #dfdfdf;
+}
+
+.theme-listing br.line {
+ border-bottom-color: #ccc;
+}
+
+div.widgets-sortables,
+#widgets-left .inactive {
+ background-color: #f1f1f1;
+ border-color: #ddd;
+}
+
+#available-widgets .widget-holder {
+ background-color: #fff;
+ border-color: #ddd;
+}
+
+#widgets-left .sidebar-name {
+ background-color: #aaa;
+ background-image: url(../images/ed-bg-vs.gif);
+ text-shadow: #FFFFFF 0 1px 0;
+ border-color: #dfdfdf;
+}
+
+#widgets-right .sidebar-name {
+ background-image: url(../images/fav-vs.png);
+ text-shadow: #3f3f3f 0 -1px 0;
+ background-color: #636363;
+ border-color: #636363;
+ color: #fff;
+}
+
+.sidebar-name:hover,
+#removing-widget {
+ color: #d54e21;
+}
+
+#removing-widget span {
+ color: black;
+}
+
+#widgets-left .sidebar-name-arrow {
+ background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px;
+}
+
+#widgets-right .sidebar-name-arrow {
+ background: transparent url(../images/fav-arrow-vs.gif) no-repeat scroll 0 -1px;
+}
+
+.in-widget-title {
+ color: #606060;
+}
+
+.deleting .widget-title * {
+ color: #aaa;
+}
+
+.imgedit-menu div {
+ border-color: #d5d5d5;
+ background-color: #f1f1f1;
+}
+
+.imgedit-menu div:hover {
+ border-color: #c1c1c1;
+ background-color: #eaeaea;
+}
+
+.imgedit-menu div.disabled {
+ border-color: #ccc;
+ background-color: #ddd;
+ filter: alpha(opacity=50);
+ opacity: 0.5;
+}
+
+#dashboard_recent_comments div.undo {
+ border-top-color: #dfdfdf;
+}
+
+.comment-ays,
+.comment-ays th {
+ border-color: #ddd;
+}
+
+.comment-ays th {
+ background-color: #f1f1f1;
+}
-html {
- background-color: #f9f9f9;
-}
-
-* html input,
-* html .widget {
- border-color: #dfdfdf;
-}
-
-textarea,
-input,
-select {
- border-color: #DFDFDF;
-}
-
-kbd,
-code {
- background: #eaeaea;
-}
-
-input[readonly] {
- background-color: #eee;
-}
-
-.find-box-search {
- border-color: #dfdfdf;
- background-color: #f1f1f1;
-}
-
-.find-box {
- background-color: #f1f1f1;
-}
-
-.find-box-inside {
- background-color: #fff;
-}
-
-a.page-numbers:hover {
- border-color: #999;
-}
-
-body,
-#wpbody,
-.form-table .pre {
- color: #333;
-}
-
-body > #upload-menu {
- border-bottom-color: #fff;
-}
-
-#postcustomstuff table,
-#your-profile fieldset,
-#rightnow,
-div.dashboard-widget,
-#dashboard-widgets p.dashboard-widget-links,
-#replyrow #ed_reply_toolbar input {
- border-color: #ccc;
-}
-
-#poststuff .inside label.spam {
- color: red;
-}
-
-#poststuff .inside label.waiting {
- color: orange;
-}
-
-#poststuff .inside label.approved {
- color: green;
-}
-
-#postcustomstuff table {
- border-color: #dfdfdf;
- background-color: #F9F9F9;
-}
-
-#postcustomstuff thead th {
- background-color: #F1F1F1;
-}
-
-#postcustomstuff table input,
-#postcustomstuff table textarea {
- border-color: #dfdfdf;
- background-color: #fff;
-}
-
-.widefat {
- border-color: #dfdfdf;
- background-color: #fff;
-}
-
-div.dashboard-widget-error {
- background-color: #c43;
-}
-
-div.dashboard-widget-notice {
- background-color: #cfe1ef;
-}
-
-div.dashboard-widget-submit {
- border-top-color: #ccc;
-}
-
-div.tabs-panel,
-ul#category-tabs li.tabs {
- border-color: #dfdfdf;
-}
-
-ul#category-tabs li.tabs {
- background-color: #f1f1f1;
-}
-
-input.disabled,
-textarea.disabled {
- background-color: #ccc;
-}
-/* #upload-menu li a.upload-tab-link, */
-.login #backtoblog a:hover,
-#plugin-information .action-button a,
-#plugin-information .action-button a:hover,
-#plugin-information .action-button a:visited {
- color: #fff;
-}
-
-.widget .widget-top,
-.postbox h3,
-.stuffbox h3 {
- background: #dfdfdf url("../images/gray-grad.png") repeat-x left top;
- text-shadow: #fff 0 1px 0;
-}
-
-.form-table th,
-.form-wrap label {
- color: #222;
- text-shadow: #fff 0 1px 0;
-}
-
-.description,
-.form-wrap p {
- color: #666;
-}
-
-strong .post-com-count span {
- background-color: #21759b;
-}
-
-.sorthelper {
- background-color: #ccf3fa;
-}
-
-.ac_match,
-.subsubsub a.current {
- color: #000;
-}
-
-.wrap h2 {
- color: #464646;
-}
-
-.ac_over {
- background-color: #f0f0b8;
-}
-
-.ac_results {
- background-color: #fff;
- border-color: #808080;
-}
-
-.ac_results li {
- color: #101010;
-}
-
-.alternate,
-.alt {
- background-color: #f9f9f9;
-}
-
-.available-theme a.screenshot {
- background-color: #f1f1f1;
- border-color: #ddd;
-}
-
-.bar {
- background-color: #e8e8e8;
- border-right-color: #99d;
-}
-
-#media-upload {
- background: #fff;
-}
-
-#media-upload .slidetoggle {
- border-top-color: #dfdfdf;
-}
-
-.error,
-#login #login_error {
- background-color: #ffebe8;
- border-color: #c00;
-}
-
-.error a {
- color: #c00;
-}
-
-.form-invalid {
- background-color: #ffebe8 !important;
-}
-
-.form-invalid input {
- border-color: #c00 !important;
-}
-
-.submit {
- border-color: #DFDFDF;
-}
-
-.highlight {
- background-color: #e4f2fd;
- color: #d54e21;
-}
-
-.howto,
-.nonessential,
-#edit-slug-box,
-.form-input-tip,
-.rss-widget span.rss-date,
-.subsubsub {
- color: #666;
-}
-
-.media-item {
- border-bottom-color: #dfdfdf;
-}
-
-#wpbody-content #media-items .describe {
- border-top-color: #dfdfdf;
-}
-
-.describe input[type="text"],
-.describe textarea {
- border-color: #dfdfdf;
-}
-
-.media-upload-form label.form-help,
-td.help {
- color: #9a9a9a;
-}
-
-.post-com-count {
- background-image: url(../images/bubble_bg.gif);
- color: #fff;
-}
-
-.post-com-count span {
- background-color: #bbb;
- color: #fff;
-}
-
-.post-com-count:hover span {
- background-color: #d54e21;
-}
-
-.quicktags, .search {
- background-color: #ccc;
- color: #000;
-}
-
-.side-info h5 {
- border-bottom-color: #dadada;
-}
-
-.side-info ul {
- color: #666;
-}
-
-.button,
-.button-secondary,
-.submit input,
-input[type=button],
-input[type=submit] {
- border-color: #bbb;
- color: #464646;
-}
-
-.button:hover,
-.button-secondary:hover,
-.submit input:hover,
-input[type=button]:hover,
-input[type=submit]:hover {
- color: #000;
- border-color: #666;
-}
-
-.button,
-.submit input,
-.button-secondary {
- background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
-}
-
-.button:active,
-.submit input:active,
-.button-secondary:active {
- background: #eee url(../images/white-grad-active.png) repeat-x scroll left top;
-}
-
-.button-primary,
-.submit .button-primary,
-#login form .submit input {
- border-color: #298cba !important;
- font-weight: bold;
- color: #FFF !important;
- background: #21759B url(../images/button-grad.png) repeat-x scroll left top;
-}
-
-.button-primary:active,
-#login form .submit input:active {
- background: #21759b url(../images/button-grad-active.png) repeat-x scroll left top !important;
-}
-
-.button[disabled],
-.button:disabled,
-.button-secondary[disabled],
-.button-secondary:disabled,
-a.button.disabled {
- color: #ccc !important;
- border-color: #ccc;
-}
-
-.button-primary[disabled],
-.button-primary:disabled {
- color: #2fa0d5 !important;
-}
-
-a:active,
-a:focus {
- color: #d54e21;
-}
-
-a:hover,
-#wphead #viewsite a:hover,
-#adminmenu a:hover,
-#adminmenu ul.wp-submenu a:hover,
-#the-comment-list .comment a:hover,
-#rightnow a:hover,
-#login form .submit input:hover,
-#media-upload a.del-link:hover,
-div.dashboard-widget-submit input:hover,
-.subsubsub a:hover,
-.subsubsub a.current:hover,
-.ui-tabs-nav a:hover,
-.plugins .inactive a:hover,
-#all-plugins-table .plugins .inactive a:hover,
-#search-plugins-table .plugins .inactive a:hover {
- color: #d54e21;
-}
-
-#the-comment-list .comment-item,
-#dashboard-widgets #dashboard_quick_press form p.submit {
- border-color: #dfdfdf;
-}
-
-.button-primary:hover,
-#login form .submit input:hover {
- border-color: #13455b !important;
- color: #EAF2FA !important;
-}
-
-#side-sortables #category-tabs .tabs a {
- color: #333;
-}
-
-#rightnow .rbutton {
- background-color: #ebebeb;
- color: #264761;
-}
-
-.submitbox .submit {
- background-color: #464646;
- color: #ccc;
-}
-
-.plugins a.delete:hover,
-#all-plugins-table .plugins a.delete:hover,
-#search-plugins-table .plugins a.delete:hover,
-.submitbox .submitdelete,
-a.delete {
- color: #f00;
- border-bottom-color: #f00;
-}
-
-.submitbox .submitdelete:hover,
-#media-items a.delete:hover {
- color: #fff;
- background-color: #f00;
- border-bottom-color: #f00;
-}
-
-#normal-sortables .submitbox .submitdelete:hover {
- color: #000;
- background-color: #f00;
- border-bottom-color: #f00;
-}
-
-.tablenav .dots {
- border-color: transparent;
-}
-
-.tablenav .next,
-.tablenav .prev {
- border-color: transparent;
- color: #21759b;
-}
-
-.tablenav .next:hover,
-.tablenav .prev:hover {
- border-color: transparent;
- color: #d54e21;
-}
-
-.updated,
-.login #login_error,
-.login .message {
- background-color: #ffffe0;
- border-color: #e6db55;
-}
-
-.update-message {
- color: #000000;
-}
-
-a.page-numbers {
- border-bottom-color: #B8D3E2;
-}
-
-.commentlist li {
- border-bottom-color: #ccc;
-}
-
-.widefat td,
-.widefat th,
-#install-plugins .plugins td,
-#install-plugins .plugins th {
- border-color: #dfdfdf;
-}
-
-.widefat th {
- text-shadow: rgba(255,255,255,0.8) 0 1px 0;
-}
-
-.widefat thead tr th,
-.widefat tfoot tr th,
-h3.dashboard-widget-title,
-h3.dashboard-widget-title span,
-h3.dashboard-widget-title small,
-.find-box-head {
- color: #333;
- background: #dfdfdf url(../images/gray-grad.png) repeat-x scroll left top;
-}
-
-h3.dashboard-widget-title small a {
- color: #d7d7d7;
-}
-
-h3.dashboard-widget-title small a:hover {
- color: #fff;
-}
-
-a,
-#adminmenu a,
-#poststuff #edButtonPreview,
-#poststuff #edButtonHTML,
-#the-comment-list p.comment-author strong a,
-#media-upload a.del-link,
-#media-items a.delete,
-.plugins a.delete,
-.ui-tabs-nav a {
- color: #21759b;
-}
-
-/* Because we don't want visited on these links */
-body.press-this .tabs a,
-body.press-this .tabs a:hover {
- background-color: #fff;
- border-color: #c6d9e9;
- border-bottom-color: #fff;
- color: #d54e21;
-}
-
-#adminmenu #awaiting-mod,
-#adminmenu .update-plugins,
-#sidemenu a .update-plugins,
-#rightnow .reallynow,
-#plugin-information .action-button {
- background-color: #d54e21;
- color: #fff;
-}
-
-#adminmenu li a:hover #awaiting-mod,
-#adminmenu li a:hover .update-plugins,
-#sidemenu li a:hover .update-plugins {
- background-color: #264761;
- color: #fff;
-}
-
-#adminmenu li.current a #awaiting-mod,
-#adminmenu li.current a .update-plugins,
-#adminmenu li.wp-has-current-submenu a .update-plugins,
-#adminmenu li.wp-has-current-submenu a .update-plugins {
- background-color: #ddd;
- color: #000;
- text-shadow: none;
- -moz-box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
- -khtml-box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
- -webkit-box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
- box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
-}
-
-#adminmenu li.current a:hover #awaiting-mod,
-#adminmenu li.current a:hover .update-plugins,
-#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod,
-#adminmenu li.wp-has-current-submenu a:hover .update-plugins {
- background-color: #264761;
- color: #fff;
-}
-
-div#media-upload-header,
-div#plugin-information-header {
- background-color: #f9f9f9;
- border-bottom-color: #dfdfdf;
-}
-
-#currenttheme img {
- border-color: #666;
-}
-
-#dashboard_secondary div.dashboard-widget-content ul li a {
- background-color: #f9f9f9;
-}
-
-input.readonly, textarea.readonly {
- background-color: #ddd;
-}
-
-#ed_toolbar input,
-#ed_reply_toolbar input {
- background: #fff url("../images/fade-butt.png") repeat-x 0 -2px;
-}
-
-#editable-post-name {
- background-color: #fffbcc;
-}
-
-#edit-slug-box strong,
-.tablenav .displaying-num,
-#submitted-on {
- color: #777;
-}
-
-.login #nav a {
- color: #21759b !important;
-}
-
-.login #nav a:hover {
- color: #d54e21 !important;
-}
-
-#footer,
-#footer-upgrade {
- background: #464646;
- color: #999;
-}
-
-#media-items {
- border-color: #dfdfdf;
-}
-
-.checkbox,
-.side-info,
-.plugins tr,
-#your-profile #rich_editing {
- background-color: #fff;
-}
-
-.plugins .inactive,
-.plugins .inactive th,
-.plugins .inactive td,
-tr.inactive + tr.plugin-update-tr .plugin-update {
- background-color: #eee;
-}
-
-.plugin-update-tr .update-message {
- background-color: #fffbe4;
- border-color: #dfdfdf;
-}
-
-.plugins .active,
-.plugins .active th,
-.plugins .active td {
- color: #000;
-}
-
-.plugins .inactive a {
- color: #557799;
-}
-
-#the-comment-list .unapproved,
-#the-comment-list .unapproved th,
-#the-comment-list .unapproved td {
- background-color: #ffffe0;
-}
-
-#the-comment-list .approve a {
- color: #006505;
-}
-
-#the-comment-list .unapprove a {
- color: #d98500;
-}
-
-#the-comment-list .delete a {
- color: #bc0b0b;
-}
-
-.widget,
-#widget-list .widget-top,
-.postbox,
-#titlediv,
-#poststuff .postarea,
-.stuffbox {
- border-color: #dfdfdf;
-}
-
-.widget,
-.postbox {
- background-color: #fff;
-}
-
-.ui-sortable .postbox h3 {
- color: #464646;
-}
-
-.widget .widget-top,
-.ui-sortable .postbox h3:hover {
- color: #000;
-}
-
-.curtime #timestamp {
- background-image: url(../images/date-button.gif);
-}
-
-#quicktags #ed_link {
- color: #00f;
-}
-
-#rightnow .youhave {
- background-color: #f0f6fb;
-}
-
-#rightnow a {
- color: #448abd;
-}
-
-.tagchecklist span a,
-#bulk-titles div a {
- background: url(../images/xit.gif) no-repeat;
-}
-
-.tagchecklist span a:hover,
-#bulk-titles div a:hover {
- background: url(../images/xit.gif) no-repeat -10px 0;
-}
-
-#update-nag {
- background-color: #fffeeb;
- border-color: #ccc;
- color: #555;
-}
-
-.login #backtoblog a {
- color: #ccc;
-}
-
-#wphead {
- background-color: #464646;
-}
-
-body.login {
- border-top-color: #464646;
-}
-
-#wphead h1 a {
- color: #fff;
-}
-
-#login form input {
- color: #555;
-}
-
-#user_info {
- color: #999;
-}
-
-#user_info a:link,
-#user_info a:visited,
-#footer a:link,
-#footer a:visited {
- color: #ccc;
- text-decoration: none;
-}
-
-#user_info a:hover,
-#footer a:hover {
- color: #fff;
- text-decoration: underline !important;
-}
-
-#user_info a:active,
-#footer a:active {
- color: #ccc !important;
-}
-
-div#media-upload-error,
-.file-error,
-abbr.required,
-.widget-control-remove:hover,
-.delete a:hover {
- color: #f00;
-}
-
-#pass-strength-result {
- background-color: #eee;
- border-color: #ddd !important;
-}
-
-#pass-strength-result.bad {
- background-color: #ffb78c;
- border-color: #ff853c !important;
-}
-
-#pass-strength-result.good {
- background-color: #ffec8b;
- border-color: #fc0 !important;
-}
-
-#pass-strength-result.short {
- background-color: #ffa0a0;
- border-color: #f04040 !important;
-}
-
-#pass-strength-result.strong {
- background-color: #c3ff88;
- border-color: #8dff1c !important;
-}
-
-/* editors */
-#quicktags {
- border-color: #dfdfdf;
- background-color: #dfdfdf;
-}
-
-#ed_toolbar input {
- border-color: #C3C3C3;
-}
-
-#ed_toolbar input:hover {
- border-color: #aaa;
- background: #ddd;
-}
-
-#poststuff .wp_themeSkin .mceStatusbar {
- border-color: #EDEDED;
-}
-
-#poststuff #edButtonPreview,
-#poststuff #edButtonHTML {
- background-color: #f1f1f1;
- border-color: #dfdfdf;
- color: #999;
-}
-
-#poststuff #editor-toolbar .active {
- border-bottom-color: #e9e9e9;
- background-color: #e9e9e9;
- color: #333;
-}
-
-/* TinyMCE */
-#post-status-info {
- background-color: #EDEDED;
-}
-
-.wp_themeSkin *,
-.wp_themeSkin a:hover,
-.wp_themeSkin a:link,
-.wp_themeSkin a:visited,
-.wp_themeSkin a:active {
- color: #000;
-}
-
-/* Containers */
-.wp_themeSkin iframe {
- background: #fff;
-}
-
-/* Layout */
-.wp_themeSkin .mceStatusbar {
- color: #000;
- background-color: #f5f5f5;
-}
-
-/* Button */
-.wp_themeSkin .mceButton {
- background-color: #e9e8e8;
- border-color: #B2B2B2;
-}
-
-.wp_themeSkin a.mceButtonEnabled:hover,
-.wp_themeSkin a.mceButtonActive,
-.wp_themeSkin a.mceButtonSelected {
- background-color: #d5d5d5;
- border-color: #777 !important;
-}
-
-.wp_themeSkin .mceButtonDisabled {
- border-color: #ccc !important;
-}
-
-/* ListBox */
-.wp_themeSkin .mceListBox .mceText,
-.wp_themeSkin .mceListBox .mceOpen {
- border-color: #B2B2B2;
- background-color: #d5d5d5;
-}
-
-.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,
-.wp_themeSkin .mceListBoxHover .mceOpen,
-.wp_themeSkin .mceListBoxSelected .mceOpen,
-.wp_themeSkin .mceListBoxSelected .mceText {
- border-color: #777 !important;
- background-color: #d5d5d5;
-}
-
-.wp_themeSkin table.mceListBoxEnabled:hover .mceText,
-.wp_themeSkin .mceListBoxHover .mceText {
- border-color: #777 !important;
-}
-
-.wp_themeSkin select.mceListBox {
- border-color: #B2B2B2;
- background-color: #fff;
-}
-
-/* SplitButton */
-.wp_themeSkin .mceSplitButton a.mceAction,
-.wp_themeSkin .mceSplitButton a.mceOpen {
- border-color: #B2B2B2;
-}
-
-.wp_themeSkin .mceSplitButton a.mceOpen:hover,
-.wp_themeSkin .mceSplitButtonSelected a.mceOpen,
-.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,
-.wp_themeSkin .mceSplitButton a.mceAction:hover {
- background-color: #d5d5d5;
- border-color: #777 !important;
-}
-
-.wp_themeSkin .mceSplitButtonActive {
- background-color: #B2B2B2;
-}
-
-/* ColorSplitButton */
-.wp_themeSkin div.mceColorSplitMenu table {
- background-color: #ebebeb;
- border-color: #B2B2B2;
-}
-
-.wp_themeSkin .mceColorSplitMenu a {
- border-color: #B2B2B2;
-}
-
-.wp_themeSkin .mceColorSplitMenu a.mceMoreColors {
- border-color: #fff;
-}
-
-.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover {
- border-color: #0A246A;
- background-color: #B6BDD2;
-}
-
-.wp_themeSkin a.mceMoreColors:hover {
- border-color: #0A246A;
-}
-
-/* Menu */
-.wp_themeSkin .mceMenu {
- border-color: #ddd;
-}
-
-.wp_themeSkin .mceMenu table {
- background-color: #ebeaeb;
-}
-
-.wp_themeSkin .mceMenu .mceText {
- color: #000;
-}
-
-.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,
-.wp_themeSkin .mceMenu .mceMenuItemActive {
- background-color: #f5f5f5;
-}
-.wp_themeSkin td.mceMenuItemSeparator {
- background-color: #aaa;
-}
-.wp_themeSkin .mceMenuItemTitle a {
- background-color: #ccc;
- border-bottom-color: #aaa;
-}
-.wp_themeSkin .mceMenuItemTitle span.mceText {
- color: #000;
-}
-.wp_themeSkin .mceMenuItemDisabled .mceText {
- color: #888;
-}
-
-.wp_themeSkin tr.mceFirst td.mceToolbar {
- background: #dfdfdf url("../images/ed-bg.gif") repeat-x scroll left top;
- border-color: #dfdfdf;
-}
-
-.wp-admin #mceModalBlocker {
- background: #000;
-}
-
-.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft {
- background: #444444;
- border-left: 1px solid #999;
- border-top: 1px solid #999;
- -moz-border-radius: 4px 0 0 0;
- -webkit-border-top-left-radius: 4px;
- -khtml-border-top-left-radius: 4px;
- border-top-left-radius: 4px;
-}
-
-.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight {
- background: #444444;
- border-right: 1px solid #999;
- border-top: 1px solid #999;
- border-top-right-radius: 4px;
- -khtml-border-top-right-radius: 4px;
- -webkit-border-top-right-radius: 4px;
- -moz-border-radius: 0 4px 0 0;
-}
-
-.wp-admin .clearlooks2 .mceMiddle .mceLeft {
- background: #f1f1f1;
- border-left: 1px solid #999;
-}
-
-.wp-admin .clearlooks2 .mceMiddle .mceRight {
- background: #f1f1f1;
- border-right: 1px solid #999;
-}
-
-.wp-admin .clearlooks2 .mceBottom {
- background: #f1f1f1;
- border-bottom: 1px solid #999;
-}
-
-.wp-admin .clearlooks2 .mceBottom .mceLeft {
- background: #f1f1f1;
- border-bottom: 1px solid #999;
- border-left: 1px solid #999;
-}
-
-.wp-admin .clearlooks2 .mceBottom .mceCenter {
- background: #f1f1f1;
- border-bottom: 1px solid #999;
-}
-
-.wp-admin .clearlooks2 .mceBottom .mceRight {
- background: #f1f1f1;
- border-bottom: 1px solid #999;
- border-right: 1px solid #999;
-}
-
-.wp-admin .clearlooks2 .mceFocus .mceTop span {
- color: #e5e5e5;
-}
-/* end TinyMCE */
-
-#editorcontainer,
-#post-status-info,
-#titlediv #title,
-.editwidget .widget-inside {
- border-color: #dfdfdf;
-}
-
-#titlediv #title {
- background-color: #fff;
-}
-
-#tTips p#tTips_inside {
- background-color: #ddd;
- color: #333;
-}
-
-#timestampdiv input,
-#namediv input,
-#poststuff .inside .the-tagcloud {
- border-color: #ddd;
-}
-
-/* menu */
-#adminmenu * {
- border-color: #e3e3e3;
-}
-
-#adminmenu li.wp-menu-separator {
- background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;
-}
-
-.folded #adminmenu li.wp-menu-separator {
- background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;
-}
-
-#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,
-#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle {
- background: transparent url(../images/menu-bits.gif) no-repeat scroll left -207px;
-}
-
-#adminmenu .wp-has-submenu:hover .wp-menu-toggle,
-#adminmenu .wp-menu-open .wp-menu-toggle {
- background: transparent url(../images/menu-bits.gif) no-repeat scroll left -109px;
-}
-
-#adminmenu a.menu-top {
- background: #f1f1f1 url(../images/menu-bits.gif) repeat-x scroll left -379px;
-}
-
-#adminmenu .wp-submenu a {
- background: #FFFFFF url(../images/menu-bits.gif) no-repeat scroll 0 -310px;
-}
-
-#adminmenu .wp-has-current-submenu ul li a {
- background: none;
-}
-
-#adminmenu .wp-has-current-submenu ul li a.current {
- background: url(../images/menu-dark.gif) top left no-repeat !important;
-}
-
-#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
-#adminmenu .menu-top .current {
- background: #6d6d6d url(../images/menu-bits.gif) top left repeat-x;
- border-color: #6d6d6d;
- color: #fff;
- text-shadow: rgba(0,0,0,0.4) 0px -1px 0px;
-}
-
-#adminmenu li.wp-has-current-submenu .wp-submenu,
-#adminmenu li.wp-has-current-submenu ul li a {
- border-color: #aaa !important;
-}
-
-#adminmenu li.wp-has-current-submenu ul li a {
- background: url(../images/menu-dark.gif) bottom left no-repeat !important;
-}
-
-#adminmenu li.wp-has-current-submenu ul {
- border-bottom-color: #aaa;
-}
-
-#adminmenu li.menu-top .current:hover {
- border-color: #B5B5B5;
-}
-
-#adminmenu .wp-submenu .current a.current {
- background: transparent url(../images/menu-bits.gif) no-repeat scroll 0 -289px;
-}
-
-#adminmenu .wp-submenu a:hover {
- background-color: #EAF2FA !important;
- color: #333 !important;
-}
-
-#adminmenu .wp-submenu li.current,
-#adminmenu .wp-submenu li.current a,
-#adminmenu .wp-submenu li.current a:hover {
- color: #333;
- background-color: #f5f5f5;
- background-image: none;
- border-color: #e3e3e3;
- text-shadow: rgba(255,255,255,1) 0px 1px 0px;
-}
-
-#adminmenu .wp-submenu ul {
- background-color: #fff;
-}
-
-.folded #adminmenu li.menu-top,
-#adminmenu .wp-submenu .wp-submenu-head {
- background-color: #F1F1F1;
-}
-
-.folded #adminmenu li.wp-has-current-submenu,
-.folded #adminmenu li.menu-top.current {
- background-color: #e6e6e6;
-}
-
-#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head {
- background-color: #EAEAEA;
- border-color: #aaa;
-}
-
-#adminmenu div.wp-submenu {
- background-color: transparent;
-}
-
-/* menu icons */
-#adminmenu #menu-dashboard div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -61px -33px;
-}
-
-#adminmenu #menu-dashboard:hover div.wp-menu-image,
-#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image,
-#adminmenu #menu-dashboard.current div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -61px -1px;
-}
-
-#adminmenu #menu-posts div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -272px -33px;
-}
-
-#adminmenu #menu-posts:hover div.wp-menu-image,
-#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -272px -1px;
-}
-
-#adminmenu #menu-media div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -121px -33px;
-}
-
-#adminmenu #menu-media:hover div.wp-menu-image,
-#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -121px -1px;
-}
-
-#adminmenu #menu-links div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -91px -33px;
-}
-
-#adminmenu #menu-links:hover div.wp-menu-image,
-#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -91px -1px;
-}
-
-#adminmenu #menu-pages div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -151px -33px;
-}
-
-#adminmenu #menu-pages:hover div.wp-menu-image,
-#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -151px -1px;
-}
-
-#adminmenu #menu-comments div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -31px -33px;
-}
-
-#adminmenu #menu-comments:hover div.wp-menu-image,
-#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image,
-#adminmenu #menu-comments.current div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -31px -1px;
-}
-
-#adminmenu #menu-appearance div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -1px -33px;
-}
-
-#adminmenu #menu-appearance:hover div.wp-menu-image,
-#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -1px -1px;
-}
-
-#adminmenu #menu-plugins div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -181px -33px;
-}
-
-#adminmenu #menu-plugins:hover div.wp-menu-image,
-#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -181px -1px;
-}
-
-#adminmenu #menu-users div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -301px -33px;
-}
-
-#adminmenu #menu-users:hover div.wp-menu-image,
-#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -301px -1px;
-}
-
-#adminmenu #menu-tools div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -211px -33px;
-}
-
-#adminmenu #menu-tools:hover div.wp-menu-image,
-#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -211px -1px;
-}
-
-#adminmenu #menu-settings div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -241px -33px;
-}
-
-#adminmenu #menu-settings:hover div.wp-menu-image,
-#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image {
- background: transparent url("../images/menu.png") no-repeat scroll -241px -1px;
-}
-/* end menu */
-
-
-/* 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;
-}
-
-#att-info {
- background-color: #E4F2FD;
-}
-
-/* edit image */
-#sidemenu a {
- background-color: #f9f9f9;
- border-color: #f9f9f9;
- border-bottom-color: #dfdfdf;
-}
-
-#sidemenu a.current {
- background-color: #fff;
- border-color: #dfdfdf #dfdfdf #fff;
- color: #D54E21;
-}
-
-#screen-options-wrap,
-#contextual-help-wrap {
- background-color: #f1f1f1;
- border-color: #dfdfdf;
-}
-
-#screen-meta-links a.show-settings {
- color: #606060;
-}
-
-#screen-meta-links a.show-settings:hover {
- color: #000;
-}
-
-#replysubmit {
- background-color: #f1f1f1;
- border-top-color: #ddd;
-}
-
-#replyerror {
- border-color: #ddd;
- background-color: #f9f9f9;
-}
-
-#edithead,
-#replyhead {
- background-color: #f1f1f1;
-}
-
-#ed_reply_toolbar {
- background-color: #e9e9e9;
-}
-
-/* table vim shortcuts */
-.vim-current,
-.vim-current th,
-.vim-current td {
- background-color: #E4F2FD !important;
-}
-
-/* Install Plugins */
-.star-average,
-.star.star-rating {
- background-color: #fc0;
-}
-
-div.star.select:hover {
- background-color: #d00;
-}
-
-#plugin-information .fyi ul {
- background-color: #eaf3fa;
-}
-
-#plugin-information .fyi h2.mainheader {
- background-color: #cee1ef;
-}
-
-#plugin-information pre,
-#plugin-information code {
- background-color: #ededff;
-}
-
-#plugin-information pre {
- border: 1px solid #ccc;
-}
-
-/* inline editor */
-.inline-edit-row fieldset input[type="text"],
-.inline-edit-row fieldset textarea,
-#bulk-titles,
-#replyrow input {
- border-color: #ddd;
-}
-
-.inline-editor div.title {
- background-color: #EAF3FA;
-}
-
-.inline-editor ul.cat-checklist {
- background-color: #FFFFFF;
- border-color: #ddd;
-}
-
-.inline-editor .categories .catshow,
-.inline-editor .categories .cathide {
- color: #21759b;
-}
-
-.inline-editor .quick-edit-save {
- background-color: #f1f1f1;
-}
-
-#replyrow #ed_reply_toolbar input:hover {
- border-color: #aaa;
- background: #ddd;
-}
-
-fieldset.inline-edit-col-right .inline-edit-col {
- border-color: #dfdfdf;
-}
-
-.attention {
- color: #D54E21;
-}
-
-.meta-box-sortables .postbox:hover .handlediv {
- background: transparent url(../images/menu-bits.gif) no-repeat scroll left -111px;
-}
-
-#major-publishing-actions {
- background: #eaf2fa;
-}
-
-.tablenav .tablenav-pages {
- color: #555;
-}
-
-.tablenav .tablenav-pages a {
- border-color: #e3e3e3;
- background: #eee url('../images/menu-bits.gif') repeat-x scroll left -379px;
-}
-
-.tablenav .tablenav-pages a:hover {
- color: #d54e21;
- border-color: #d54321;
-}
-
-.tablenav .tablenav-pages a:active {
- color: #fff !important;
-}
-
-.tablenav .tablenav-pages .current {
- background: #dfdfdf;
- border-color: #d3d3d3;
-}
-
-#availablethemes,
-#availablethemes td {
- border-color: #ddd;
-}
-
-#current-theme img {
- border-color: #999;
-}
-
-#TB_window #TB_title a.tb-theme-preview-link,
-#TB_window #TB_title a.tb-theme-preview-link:visited {
- color: #999;
-}
-
-#TB_window #TB_title a.tb-theme-preview-link:hover,
-#TB_window #TB_title a.tb-theme-preview-link:focus {
- color: #ccc;
-}
-
-.misc-pub-section {
- border-bottom-color: #eee;
-}
-
-#minor-publishing {
- border-bottom-color: #ddd;
-}
-
-#post-body .misc-pub-section {
- border-right-color: #eee;
-}
-
-.post-com-count span {
- background-color: #bbb;
-}
-
-.form-table .color-palette td {
- border-color: #fff;
-}
-
-.sortable-placeholder {
- border-color: #bbb;
- background-color: #f5f5f5;
-}
-
-#post-body ul#category-tabs li.tabs a {
- color: #333;
-}
-
-#wp_editimgbtn,
-#wp_delimgbtn,
-#wp_editgallery,
-#wp_delgallery {
- border-color: #999;
- background-color: #eee;
-}
-
-#wp_editimgbtn:hover,
-#wp_delimgbtn:hover,
-#wp_editgallery:hover,
-#wp_delgallery:hover {
- border-color: #555;
- background-color: #ccc;
-}
-
-#favorite-first {
- background: #797979 url(../images/fav.png) repeat-x left center;
- border-color: #777 !important;
- border-bottom-color: #666 !important;
-}
-
-#favorite-inside {
- border-color: #797979;
- background-color: #797979;
-}
-
-#favorite-toggle {
- background: transparent url(../images/fav-arrow.gif) no-repeat 0 -4px;
-}
-
-#favorite-actions a {
- color: #ddd;
-}
-
-#favorite-actions a:hover {
- color: #fff;
-}
-
-#favorite-inside a:hover {
- text-decoration: underline;
-}
-
-#favorite-actions .slide-down {
- border-bottom-color: #626262;
-}
-
-.submit input,
-.button,
-.button-primary,
-.button-secondary,
-.button-highlighted,
-#postcustomstuff .submit input {
- text-shadow: rgba(255,255,255,1) 0 1px 0;
-}
-
-.button-primary,
-.submit .button-primary {
- text-shadow: rgba(0,0,0,0.3) 0 -1px 0;
-}
-
-#screen-meta a.show-settings {
- background-color: transparent;
- text-shadow: rgba(255,255,255,0.7) 0 1px 0;
-}
-
-#icon-edit,
-#icon-post {
- background: transparent url(../images/icons32.png) no-repeat -552px -5px;
-}
-
-#icon-index {
- background: transparent url(../images/icons32.png) no-repeat -137px -5px;
-}
-
-#icon-upload {
- background: transparent url(../images/icons32.png) no-repeat -251px -5px;
-}
-
-#icon-link-manager,
-#icon-link,
-#icon-link-category {
- background: transparent url(../images/icons32.png) no-repeat -190px -5px;
-}
-
-#icon-edit-pages,
-#icon-page {
- background: transparent url(../images/icons32.png) no-repeat -312px -5px;
-}
-
-#icon-edit-comments {
- background: transparent url(../images/icons32.png) no-repeat -72px -5px;
-}
-
-#icon-themes {
- background: transparent url(../images/icons32.png) no-repeat -11px -5px;
-}
-
-#icon-plugins {
- background: transparent url(../images/icons32.png) no-repeat -370px -5px;
-}
-
-#icon-users,
-#icon-profile,
-#icon-user-edit {
- background: transparent url(../images/icons32.png) no-repeat -600px -5px;
-}
-
-#icon-tools,
-#icon-admin {
- background: transparent url(../images/icons32.png) no-repeat -432px -5px;
-}
-
-#icon-options-general {
- background: transparent url(../images/icons32.png) no-repeat -492px -5px;
-}
-
-.view-switch #view-switch-list {
- background: transparent url(../images/list.png) no-repeat 0 0;
-}
-
-.view-switch #view-switch-list.current {
- background: transparent url(../images/list.png) no-repeat -40px 0;
-}
-
-.view-switch #view-switch-excerpt {
- background: transparent url(../images/list.png) no-repeat -20px 0;
-}
-
-.view-switch #view-switch-excerpt.current {
- background: transparent url(../images/list.png) no-repeat -60px 0;
-}
-
-#header-logo {
- background: transparent url(../images/wp-logo.gif) no-repeat scroll center center;
-}
-
-#wphead #site-visit-button {
- background-color:#585858;
- background-image: url(../images/visit-site-button-grad.gif);
- color:#aaa;
- text-shadow: #3F3F3F 0 -1px 0;
-}
-
-#wphead a:hover #site-visit-button {
- color:#fff;
-}
-
-#wphead a:focus #site-visit-button,
-#wphead a:active #site-visit-button {
- background-position:0 -27px;
-}
-
-.popular-tags,
-.feature-filter {
- background-color: #FFFFFF;
- border-color: #DFDFDF;
-}
-
-#theme-information .action-button {
- border-top-color: #DFDFDF;
-}
-
-.theme-listing br.line {
- border-bottom-color: #ccc;
-}
-
-div.widgets-sortables,
-#widgets-left .inactive {
- background-color: #f1f1f1;
- border-color: #ddd;
-}
-
-#available-widgets .widget-holder {
- background-color: #fff;
- border-color: #ddd;
-}
-
-#widgets-left .sidebar-name {
- background-color: #aaa;
- background-image: url(../images/ed-bg.gif);
- text-shadow: #FFFFFF 0 1px 0;
- border-color: #dfdfdf;
-}
-
-#widgets-right .sidebar-name {
- background-image: url(../images/fav.png);
- text-shadow: #3f3f3f 0 -1px 0;
- background-color: #636363;
- border-color: #636363;
- color: #fff;
-}
-
-.sidebar-name:hover,
-#removing-widget {
- color: #d54e21;
-}
-
-#removing-widget span {
- color: black;
-}
-
-#widgets-left .sidebar-name-arrow {
- background: transparent url(../images/menu-bits.gif) no-repeat scroll left -109px;
-}
-
-#widgets-right .sidebar-name-arrow {
- background: transparent url(../images/fav-arrow.gif) no-repeat scroll 0 -1px;
-}
-
-.in-widget-title {
- color: #606060;
-}
-
-.deleting .widget-title * {
- color: #aaa;
-}
+html{background-color:#f9f9f9;}* html input,* html .widget{border-color:#dfdfdf;}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="button"],input[type="submit"],input[type="reset"],select{border-color:#dfdfdf;background-color:#fff;}kbd,code{background:#eaeaea;}input[readonly]{background-color:#eee;}.find-box-search{border-color:#dfdfdf;background-color:#f1f1f1;}.find-box{background-color:#f1f1f1;}.find-box-inside{background-color:#fff;}a.page-numbers:hover{border-color:#999;}body,#wpbody,.form-table .pre{color:#333;}body>#upload-menu{border-bottom-color:#fff;}#postcustomstuff table,#your-profile fieldset,#rightnow,div.dashboard-widget,#dashboard-widgets p.dashboard-widget-links,#replyrow #ed_reply_toolbar input{border-color:#ccc;}#poststuff .inside label.spam,#poststuff .inside label.deleted{color:red;}#poststuff .inside label.waiting{color:orange;}#poststuff .inside label.approved{color:green;}#postcustomstuff table{border-color:#dfdfdf;background-color:#F9F9F9;}#postcustomstuff thead th{background-color:#F1F1F1;}#postcustomstuff table input,#postcustomstuff table textarea{border-color:#dfdfdf;background-color:#fff;}.widefat{border-color:#dfdfdf;background-color:#fff;}div.dashboard-widget-error{background-color:#c43;}div.dashboard-widget-notice{background-color:#cfe1ef;}div.dashboard-widget-submit{border-top-color:#ccc;}div.tabs-panel,ul#category-tabs li.tabs{border-color:#dfdfdf;}ul#category-tabs li.tabs{background-color:#f1f1f1;}input.disabled,textarea.disabled{background-color:#ccc;}.login #backtoblog a:hover,#plugin-information .action-button a,#plugin-information .action-button a:hover,#plugin-information .action-button a:visited{color:#fff;}.widget .widget-top,.postbox h3,.stuffbox h3{background:#dfdfdf url("../images/gray-grad.png") repeat-x left top;text-shadow:#fff 0 1px 0;}.form-table th,.form-wrap label{color:#222;text-shadow:#fff 0 1px 0;}.description,.form-wrap p{color:#666;}strong .post-com-count span{background-color:#21759b;}.sorthelper{background-color:#ccf3fa;}.ac_match,.subsubsub a.current{color:#000;}.wrap h2{color:#464646;}.ac_over{background-color:#f0f0b8;}.ac_results{background-color:#fff;border-color:#808080;}.ac_results li{color:#101010;}.alternate,.alt{background-color:#f9f9f9;}.available-theme a.screenshot{background-color:#f1f1f1;border-color:#ddd;}.bar{background-color:#e8e8e8;border-right-color:#99d;}#media-upload,#media-upload .media-item .slidetoggle{background:#fff;}#media-upload .slidetoggle{border-top-color:#dfdfdf;}.error,.login #login_error{background-color:#ffebe8;border-color:#c00;}.error a{color:#c00;}.form-invalid{background-color:#ffebe8!important;}.form-invalid input,.form-invalid select{border-color:#c00!important;}.submit{border-color:#DFDFDF;}.highlight{background-color:#e4f2fd;color:#d54e21;}.howto,.nonessential,#edit-slug-box,.form-input-tip,.rss-widget span.rss-date,.subsubsub{color:#666;}.media-item{border-bottom-color:#dfdfdf;}#wpbody-content #media-items .describe{border-top-color:#dfdfdf;}.media-upload-form label.form-help,td.help{color:#9a9a9a;}.post-com-count{background-image:url(../images/bubble_bg.gif);color:#fff;}.post-com-count span{background-color:#bbb;color:#fff;}.post-com-count:hover span{background-color:#d54e21;}.quicktags,.search{background-color:#ccc;color:#000;}.side-info h5{border-bottom-color:#dadada;}.side-info ul{color:#666;}.button,.button-secondary,.submit input,input[type=button],input[type=submit]{border-color:#bbb;color:#464646;}.button:hover,.button-secondary:hover,.submit input:hover,input[type=button]:hover,input[type=submit]:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;text-shadow:rgba(255,255,255,1) 0 1px 0;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}input.button-primary,button.button-primary,a.button-primary{border-color:#298cba;font-weight:bold;color:#fff;background:#21759B url(../images/button-grad.png) repeat-x scroll left top;text-shadow:rgba(0,0,0,0.3) 0 -1px 0;}input.button-primary:active,button.button-primary:active,a.button-primary:active{background:#21759b url(../images/button-grad-active.png) repeat-x scroll left top;color:#eaf2fa;}input.button-primary:hover,button.button-primary:hover,a.button-primary:hover,a.button-primary:focus,a.button-primary:active{border-color:#13455b;color:#eaf2fa;}.button-disabled,.button[disabled],.button:disabled,.button-secondary[disabled],.button-secondary:disabled,a.button.disabled{color:#aaa!important;border-color:#ddd!important;}.button-primary-disabled,.button-primary[disabled],.button-primary:disabled{color:#9FD0D5!important;background:#298CBA!important;}a:hover,a:active,a:focus{color:#d54e21;}#wphead #viewsite a:hover,#adminmenu a:hover,#adminmenu ul.wp-submenu a:hover,#the-comment-list .comment a:hover,#rightnow a:hover,#media-upload a.del-link:hover,div.dashboard-widget-submit input:hover,.subsubsub a:hover,.subsubsub a.current:hover,.ui-tabs-nav a:hover,.plugins .inactive a:hover,#all-plugins-table .plugins .inactive a:hover,#search-plugins-table .plugins .inactive a:hover{color:#d54e21;}#the-comment-list .comment-item,#dashboard-widgets #dashboard_quick_press form p.submit{border-color:#dfdfdf;}#side-sortables #category-tabs .tabs a{color:#333;}#rightnow .rbutton{background-color:#ebebeb;color:#264761;}.submitbox .submit{background-color:#464646;color:#ccc;}.plugins a.delete:hover,#all-plugins-table .plugins a.delete:hover,#search-plugins-table .plugins a.delete:hover,.submitbox .submitdelete{color:#f00;border-bottom-color:#f00;}.submitbox .submitdelete:hover,#media-items a.delete:hover{color:#fff;background-color:#f00;border-bottom-color:#f00;}#normal-sortables .submitbox .submitdelete:hover{color:#000;background-color:#f00;border-bottom-color:#f00;}.tablenav .dots{border-color:transparent;}.tablenav .next,.tablenav .prev{border-color:transparent;color:#21759b;}.tablenav .next:hover,.tablenav .prev:hover{border-color:transparent;color:#d54e21;}.updated,.login .message{background-color:#ffffe0;border-color:#e6db55;}.update-message{color:#000;}a.page-numbers{border-bottom-color:#B8D3E2;}.commentlist li{border-bottom-color:#ccc;}.widefat td,.widefat th,#install-plugins .plugins td,#install-plugins .plugins th{border-color:#dfdfdf;}.widefat th{text-shadow:rgba(255,255,255,0.8) 0 1px 0;}.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.find-box-head{color:#333;background:#dfdfdf url(../images/gray-grad.png) repeat-x scroll left top;}h3.dashboard-widget-title small a{color:#d7d7d7;}h3.dashboard-widget-title small a:hover{color:#fff;}a,#adminmenu a,#poststuff #edButtonPreview,#poststuff #edButtonHTML,#the-comment-list p.comment-author strong a,#media-upload a.del-link,#media-items a.delete,.plugins a.delete,.ui-tabs-nav a{color:#21759b;}body.press-this .tabs a,body.press-this .tabs a:hover{background-color:#fff;border-color:#c6d9e9;border-bottom-color:#fff;color:#d54e21;}#adminmenu #awaiting-mod,#adminmenu .update-plugins,#sidemenu a .update-plugins,#rightnow .reallynow,#plugin-information .action-button{background-color:#d54e21;color:#fff;}#adminmenu li a:hover #awaiting-mod,#adminmenu li a:hover .update-plugins,#sidemenu li a:hover .update-plugins{background-color:#264761;color:#fff;}#adminmenu li.current a #awaiting-mod,#adminmenu li.current a .update-plugins,#adminmenu li.wp-has-current-submenu a .update-plugins,#adminmenu li.wp-has-current-submenu a .update-plugins{background-color:#ddd;color:#000;text-shadow:none;-moz-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;-khtml-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;-webkit-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;box-shadow:rgba(0,0,0,0.2) 0 -1px 0;}#adminmenu li.current a:hover #awaiting-mod,#adminmenu li.current a:hover .update-plugins,#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod,#adminmenu li.wp-has-current-submenu a:hover .update-plugins{background-color:#264761;color:#fff;}div#media-upload-header,div#plugin-information-header{background-color:#f9f9f9;border-bottom-color:#dfdfdf;}#currenttheme img{border-color:#666;}#dashboard_secondary div.dashboard-widget-content ul li a{background-color:#f9f9f9;}input.readonly,textarea.readonly{background-color:#ddd;}#ed_toolbar input,#ed_reply_toolbar input{background:#fff url("../images/fade-butt.png") repeat-x 0 -2px;}#editable-post-name{background-color:#fffbcc;}#edit-slug-box strong,.tablenav .displaying-num,#submitted-on{color:#777;}.login #nav a{color:#21759b!important;}.login #nav a:hover{color:#d54e21!important;}#footer,#footer-upgrade{background:#464646;color:#999;}#media-items,.imgedit-group{border-color:#dfdfdf;}.checkbox,.side-info,.plugins tr,#your-profile #rich_editing{background-color:#fff;}.plugins .inactive,.plugins .inactive th,.plugins .inactive td,tr.inactive+tr.plugin-update-tr .plugin-update{background-color:#eee;}.plugin-update-tr .update-message{background-color:#fffbe4;border-color:#dfdfdf;}.plugins .active,.plugins .active th,.plugins .active td{color:#000;}.plugins .inactive a{color:#579;}#the-comment-list tr.undo,#the-comment-list div.undo{background-color:#f4f4f4;}#the-comment-list .unapproved{background-color:#ffffe0;}#the-comment-list .approve a{color:#006505;}#the-comment-list .unapprove a{color:#d98500;}table.widefat span.delete a,table.widefat span.trash a,table.widefat span.spam a,#dashboard_recent_comments .delete a,#dashboard_recent_comments .trash a,#dashboard_recent_comments .spam a{color:#bc0b0b;}.widget,#widget-list .widget-top,.postbox,#titlediv,#poststuff .postarea,.stuffbox{border-color:#dfdfdf;}.widget,.postbox{background-color:#fff;}.ui-sortable .postbox h3{color:#464646;}.widget .widget-top,.ui-sortable .postbox h3:hover{color:#000;}.curtime #timestamp{background-image:url(../images/date-button.gif);}#quicktags #ed_link{color:#00f;}#rightnow .youhave{background-color:#f0f6fb;}#rightnow a{color:#448abd;}.tagchecklist span a,#bulk-titles div a{background:url(../images/xit.gif) no-repeat;}.tagchecklist span a:hover,#bulk-titles div a:hover{background:url(../images/xit.gif) no-repeat -10px 0;}#update-nag{background-color:#fffeeb;border-color:#ccc;color:#555;}.login #backtoblog a{color:#ccc;}#wphead{background-color:#464646;}body.login{border-top-color:#464646;}#wphead h1 a{color:#fff;}#user_info{color:#999;}#user_info a:link,#user_info a:visited,#footer a:link,#footer a:visited{color:#ccc;text-decoration:none;}#user_info a:hover,#footer a:hover{color:#fff;text-decoration:underline!important;}#user_info a:active,#footer a:active{color:#ccc!important;}div#media-upload-error,.file-error,abbr.required,.widget-control-remove:hover,table.widefat .delete a:hover,table.widefat .trash a:hover,table.widefat .spam a:hover,#dashboard_recent_comments .delete a:hover,#dashboard_recent_comments .trash a:hover #dashboard_recent_comments .spam a:hover{color:#f00;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}#quicktags{border-color:#dfdfdf;background-color:#dfdfdf;}#ed_toolbar input{border-color:#C3C3C3;}#ed_toolbar input:hover{border-color:#aaa;background:#ddd;}#poststuff .wp_themeSkin .mceStatusbar{border-color:#EDEDED;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{background-color:#f1f1f1;border-color:#dfdfdf;color:#999;}#poststuff #editor-toolbar .active{border-bottom-color:#e9e9e9;background-color:#e9e9e9;color:#333;}#post-status-info{background-color:#EDEDED;}.wp_themeSkin *,.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{color:#000;}.wp_themeSkin iframe{background:#fff;}.wp_themeSkin .mceStatusbar{color:#000;background-color:#f5f5f5;}.wp_themeSkin .mceButton{background-color:#e9e8e8;border-color:#B2B2B2;}.wp_themeSkin a.mceButtonEnabled:hover,.wp_themeSkin a.mceButtonActive,.wp_themeSkin a.mceButtonSelected{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceButtonDisabled{border-color:#ccc!important;}.wp_themeSkin .mceListBox .mceText,.wp_themeSkin .mceListBox .mceOpen{border-color:#B2B2B2;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin .mceListBoxSelected .mceText{border-color:#777!important;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceText,.wp_themeSkin .mceListBoxHover .mceText{border-color:#777!important;}.wp_themeSkin select.mceListBox{border-color:#B2B2B2;background-color:#fff;}.wp_themeSkin .mceSplitButton a.mceAction,.wp_themeSkin .mceSplitButton a.mceOpen{border-color:#B2B2B2;}.wp_themeSkin .mceSplitButton a.mceOpen:hover,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,.wp_themeSkin .mceSplitButton a.mceAction:hover{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceSplitButtonActive{background-color:#B2B2B2;}.wp_themeSkin div.mceColorSplitMenu table{background-color:#ebebeb;border-color:#B2B2B2;}.wp_themeSkin .mceColorSplitMenu a{border-color:#B2B2B2;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors{border-color:#fff;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover{border-color:#0A246A;background-color:#B6BDD2;}.wp_themeSkin a.mceMoreColors:hover{border-color:#0A246A;}.wp_themeSkin .mceMenu{border-color:#ddd;}.wp_themeSkin .mceMenu table{background-color:#ebeaeb;}.wp_themeSkin .mceMenu .mceText{color:#000;}.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,.wp_themeSkin .mceMenu .mceMenuItemActive{background-color:#f5f5f5;}.wp_themeSkin td.mceMenuItemSeparator{background-color:#aaa;}.wp_themeSkin .mceMenuItemTitle a{background-color:#ccc;border-bottom-color:#aaa;}.wp_themeSkin .mceMenuItemTitle span.mceText{color:#000;}.wp_themeSkin .mceMenuItemDisabled .mceText{color:#888;}.wp_themeSkin tr.mceFirst td.mceToolbar{background:#dfdfdf url("../images/ed-bg.gif") repeat-x scroll left top;border-color:#dfdfdf;}.wp-admin #mceModalBlocker{background:#000;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft{background:#444;border-left:1px solid #999;border-top:1px solid #999;-moz-border-radius:4px 0 0 0;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight{background:#444;border-right:1px solid #999;border-top:1px solid #999;border-top-right-radius:4px;-khtml-border-top-right-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius:0 4px 0 0;}.wp-admin .clearlooks2 .mceMiddle .mceLeft{background:#f1f1f1;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceMiddle .mceRight{background:#f1f1f1;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceBottom{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceLeft{background:#f1f1f1;border-bottom:1px solid #999;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceCenter{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceRight{background:#f1f1f1;border-bottom:1px solid #999;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceFocus .mceTop span{color:#e5e5e5;}#editorcontainer,#post-status-info,#titlediv #title,.editwidget .widget-inside{border-color:#dfdfdf;}#titlediv #title{background-color:#fff;}#tTips p#tTips_inside{background-color:#ddd;color:#333;}#timestampdiv input,#namediv input,#poststuff .inside .the-tagcloud{border-color:#ddd;}#adminmenu *{border-color:#e3e3e3;}#adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;}.folded #adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits.gif) no-repeat scroll left -207px;}#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle{background:transparent url(../images/menu-bits.gif) no-repeat scroll left -109px;}#adminmenu a.menu-top{background:#f1f1f1 url(../images/menu-bits.gif) repeat-x scroll left -379px;}#adminmenu .wp-submenu a{background:#FFF url(../images/menu-bits.gif) no-repeat scroll 0 -310px;}#adminmenu .wp-has-current-submenu ul li a{background:none;}#adminmenu .wp-has-current-submenu ul li a.current{background:url(../images/menu-dark.gif) top left no-repeat!important;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu .menu-top .current{background:#6d6d6d url(../images/menu-bits.gif) top left repeat-x;border-color:#6d6d6d;color:#fff;text-shadow:rgba(0,0,0,0.4) 0 -1px 0;}#adminmenu li.wp-has-current-submenu .wp-submenu,#adminmenu li.wp-has-current-submenu ul li a{border-color:#aaa!important;}#adminmenu li.wp-has-current-submenu ul li a{background:url(../images/menu-dark.gif) bottom left no-repeat!important;}#adminmenu li.wp-has-current-submenu ul{border-bottom-color:#aaa;}#adminmenu li.menu-top .current:hover{border-color:#B5B5B5;}#adminmenu .wp-submenu .current a.current{background:transparent url(../images/menu-bits.gif) no-repeat scroll 0 -289px;}#adminmenu .wp-submenu a:hover{background-color:#EAF2FA!important;color:#333!important;}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{color:#333;background-color:#f5f5f5;background-image:none;border-color:#e3e3e3;text-shadow:rgba(255,255,255,1) 0 1px 0;}#adminmenu .wp-submenu ul{background-color:#fff;}.folded #adminmenu li.menu-top,#adminmenu .wp-submenu .wp-submenu-head{background-color:#F1F1F1;}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.menu-top.current{background-color:#e6e6e6;}#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background-color:#EAEAEA;border-color:#aaa;}#adminmenu div.wp-submenu{background-color:transparent;}#adminmenu #menu-dashboard div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -61px -33px;}#adminmenu #menu-dashboard:hover div.wp-menu-image,#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image,#adminmenu #menu-dashboard.current div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -61px -1px;}#adminmenu #menu-posts div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -272px -33px;}#adminmenu #menu-posts:hover div.wp-menu-image,#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -272px -1px;}#adminmenu #menu-media div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -121px -33px;}#adminmenu #menu-media:hover div.wp-menu-image,#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -121px -1px;}#adminmenu #menu-links div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -91px -33px;}#adminmenu #menu-links:hover div.wp-menu-image,#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -91px -1px;}#adminmenu #menu-pages div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -151px -33px;}#adminmenu #menu-pages:hover div.wp-menu-image,#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -151px -1px;}#adminmenu #menu-comments div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -31px -33px;}#adminmenu #menu-comments:hover div.wp-menu-image,#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image,#adminmenu #menu-comments.current div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -31px -1px;}#adminmenu #menu-appearance div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -1px -33px;}#adminmenu #menu-appearance:hover div.wp-menu-image,#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -1px -1px;}#adminmenu #menu-plugins div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -181px -33px;}#adminmenu #menu-plugins:hover div.wp-menu-image,#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -181px -1px;}#adminmenu #menu-users div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -301px -33px;}#adminmenu #menu-users:hover div.wp-menu-image,#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -301px -1px;}#adminmenu #menu-tools div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -211px -33px;}#adminmenu #menu-tools:hover div.wp-menu-image,#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -211px -1px;}#adminmenu #menu-settings div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -241px -33px;}#adminmenu #menu-settings:hover div.wp-menu-image,#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -241px -1px;}table.diff .diff-deletedline{background-color:#fdd;}table.diff .diff-deletedline del{background-color:#f99;}table.diff .diff-addedline{background-color:#dfd;}table.diff .diff-addedline ins{background-color:#9f9;}#att-info{background-color:#E4F2FD;}#sidemenu a{background-color:#f9f9f9;border-color:#f9f9f9;border-bottom-color:#dfdfdf;}#sidemenu a.current{background-color:#fff;border-color:#dfdfdf #dfdfdf #fff;color:#D54E21;}#screen-options-wrap,#contextual-help-wrap{background-color:#f1f1f1;border-color:#dfdfdf;}#screen-meta-links a.show-settings{color:#606060;}#screen-meta-links a.show-settings:hover{color:#000;}#replysubmit{background-color:#f1f1f1;border-top-color:#ddd;}#replyerror{border-color:#ddd;background-color:#f9f9f9;}#edithead,#replyhead{background-color:#f1f1f1;}#ed_reply_toolbar{background-color:#e9e9e9;}.vim-current,.vim-current th,.vim-current td{background-color:#E4F2FD!important;}.star-average,.star.star-rating{background-color:#fc0;}div.star.select:hover{background-color:#d00;}#plugin-information .fyi ul{background-color:#eaf3fa;}#plugin-information .fyi h2.mainheader{background-color:#cee1ef;}#plugin-information pre,#plugin-information code{background-color:#ededff;}#plugin-information pre{border:1px solid #ccc;}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea,#bulk-titles,#replyrow input{border-color:#ddd;}.inline-editor div.title{background-color:#EAF3FA;}.inline-editor ul.cat-checklist{background-color:#FFF;border-color:#ddd;}.inline-editor .categories .catshow,.inline-editor .categories .cathide{color:#21759b;}.inline-editor .quick-edit-save{background-color:#f1f1f1;}#replyrow #ed_reply_toolbar input:hover{border-color:#aaa;background:#ddd;}fieldset.inline-edit-col-right .inline-edit-col{border-color:#dfdfdf;}.attention{color:#D54E21;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/menu-bits.gif) no-repeat scroll left -111px;}#major-publishing-actions{background:#eaf2fa;}.tablenav .tablenav-pages{color:#555;}.tablenav .tablenav-pages a{border-color:#e3e3e3;background:#eee url('../images/menu-bits.gif') repeat-x scroll left -379px;}.tablenav .tablenav-pages a:hover{color:#d54e21;border-color:#d54321;}.tablenav .tablenav-pages a:active{color:#fff!important;}.tablenav .tablenav-pages .current{background:#dfdfdf;border-color:#d3d3d3;}#availablethemes,#availablethemes td{border-color:#ddd;}#current-theme img{border-color:#999;}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{color:#999;}#TB_window #TB_title a.tb-theme-preview-link:hover,#TB_window #TB_title a.tb-theme-preview-link:focus{color:#ccc;}.misc-pub-section{border-bottom-color:#eee;}#minor-publishing{border-bottom-color:#ddd;}#post-body .misc-pub-section{border-right-color:#eee;}.post-com-count span{background-color:#bbb;}.form-table .color-palette td{border-color:#fff;}.sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;}#post-body ul#category-tabs li.tabs a{color:#333;}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{border-color:#999;background-color:#eee;}#wp_editimgbtn:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_delgallery:hover{border-color:#555;background-color:#ccc;}#favorite-first{background:#797979 url(../images/fav.png) repeat-x left center;border-color:#777!important;border-bottom-color:#666!important;}#favorite-inside{border-color:#797979;background-color:#797979;}#favorite-toggle{background:transparent url(../images/fav-arrow.gif) no-repeat 0 -4px;}#favorite-actions a{color:#ddd;}#favorite-actions a:hover{color:#fff;}#favorite-inside a:hover{text-decoration:underline;}#favorite-actions .slide-down{border-bottom-color:#626262;}#screen-meta a.show-settings{background-color:transparent;text-shadow:rgba(255,255,255,0.7) 0 1px 0;}#icon-edit,#icon-post{background:transparent url(../images/icons32.png) no-repeat -552px -5px;}#icon-index{background:transparent url(../images/icons32.png) no-repeat -137px -5px;}#icon-upload{background:transparent url(../images/icons32.png) no-repeat -251px -5px;}#icon-link-manager,#icon-link,#icon-link-category{background:transparent url(../images/icons32.png) no-repeat -190px -5px;}#icon-edit-pages,#icon-page{background:transparent url(../images/icons32.png) no-repeat -312px -5px;}#icon-edit-comments{background:transparent url(../images/icons32.png) no-repeat -72px -5px;}#icon-themes{background:transparent url(../images/icons32.png) no-repeat -11px -5px;}#icon-plugins{background:transparent url(../images/icons32.png) no-repeat -370px -5px;}#icon-users,#icon-profile,#icon-user-edit{background:transparent url(../images/icons32.png) no-repeat -600px -5px;}#icon-tools,#icon-admin{background:transparent url(../images/icons32.png) no-repeat -432px -5px;}#icon-options-general{background:transparent url(../images/icons32.png) no-repeat -492px -5px;}.view-switch #view-switch-list{background:transparent url(../images/list.png) no-repeat 0 0;}.view-switch #view-switch-list.current{background:transparent url(../images/list.png) no-repeat -40px 0;}.view-switch #view-switch-excerpt{background:transparent url(../images/list.png) no-repeat -20px 0;}.view-switch #view-switch-excerpt.current{background:transparent url(../images/list.png) no-repeat -60px 0;}#header-logo{background:transparent url(../images/wp-logo.gif) no-repeat scroll center center;}#wphead #site-visit-button{background-color:#585858;background-image:url(../images/visit-site-button-grad.gif);color:#aaa;text-shadow:#3F3F3F 0 -1px 0;}#wphead a:hover #site-visit-button{color:#fff;}#wphead a:focus #site-visit-button,#wphead a:active #site-visit-button{background-position:0 -27px;}.popular-tags,.feature-filter{background-color:#FFF;border-color:#DFDFDF;}#theme-information .action-button{border-top-color:#DFDFDF;}.theme-listing br.line{border-bottom-color:#ccc;}div.widgets-sortables,#widgets-left .inactive{background-color:#f1f1f1;border-color:#ddd;}#available-widgets .widget-holder{background-color:#fff;border-color:#ddd;}#widgets-left .sidebar-name{background-color:#aaa;background-image:url(../images/ed-bg.gif);text-shadow:#FFF 0 1px 0;border-color:#dfdfdf;}#widgets-right .sidebar-name{background-image:url(../images/fav.png);text-shadow:#3f3f3f 0 -1px 0;background-color:#636363;border-color:#636363;color:#fff;}.sidebar-name:hover,#removing-widget{color:#d54e21;}#removing-widget span{color:black;}#widgets-left .sidebar-name-arrow{background:transparent url(../images/menu-bits.gif) no-repeat scroll left -109px;}#widgets-right .sidebar-name-arrow{background:transparent url(../images/fav-arrow.gif) no-repeat scroll 0 -1px;}.in-widget-title{color:#606060;}.deleting .widget-title *{color:#aaa;}.imgedit-menu div{border-color:#d5d5d5;background-color:#f1f1f1;}.imgedit-menu div:hover{border-color:#c1c1c1;background-color:#eaeaea;}.imgedit-menu div.disabled{border-color:#ccc;background-color:#ddd;filter:alpha(opacity=50);opacity:.5;}#dashboard_recent_comments div.undo{border-top-color:#dfdfdf;}.comment-ays,.comment-ays th{border-color:#ddd;}.comment-ays th{background-color:#f1f1f1;}
\ No newline at end of file
--- /dev/null
+html {
+ background-color: #f9f9f9;
+}
+
+* html input,
+* html .widget {
+ border-color: #dfdfdf;
+}
+
+textarea,
+input[type="text"],
+input[type="password"],
+input[type="file"],
+input[type="button"],
+input[type="submit"],
+input[type="reset"],
+select {
+ border-color: #dfdfdf;
+ background-color: #fff;
+}
+
+kbd,
+code {
+ background: #eaeaea;
+}
+
+input[readonly] {
+ background-color: #eee;
+}
+
+.find-box-search {
+ border-color: #dfdfdf;
+ background-color: #f1f1f1;
+}
+
+.find-box {
+ background-color: #f1f1f1;
+}
+
+.find-box-inside {
+ background-color: #fff;
+}
+
+a.page-numbers:hover {
+ border-color: #999;
+}
+
+body,
+#wpbody,
+.form-table .pre {
+ color: #333;
+}
+
+body > #upload-menu {
+ border-bottom-color: #fff;
+}
+
+#postcustomstuff table,
+#your-profile fieldset,
+#rightnow,
+div.dashboard-widget,
+#dashboard-widgets p.dashboard-widget-links,
+#replyrow #ed_reply_toolbar input {
+ border-color: #ccc;
+}
+
+#poststuff .inside label.spam,
+#poststuff .inside label.deleted {
+ color: red;
+}
+
+#poststuff .inside label.waiting {
+ color: orange;
+}
+
+#poststuff .inside label.approved {
+ color: green;
+}
+
+#postcustomstuff table {
+ border-color: #dfdfdf;
+ background-color: #F9F9F9;
+}
+
+#postcustomstuff thead th {
+ background-color: #F1F1F1;
+}
+
+#postcustomstuff table input,
+#postcustomstuff table textarea {
+ border-color: #dfdfdf;
+ background-color: #fff;
+}
+
+.widefat {
+ border-color: #dfdfdf;
+ background-color: #fff;
+}
+
+div.dashboard-widget-error {
+ background-color: #c43;
+}
+
+div.dashboard-widget-notice {
+ background-color: #cfe1ef;
+}
+
+div.dashboard-widget-submit {
+ border-top-color: #ccc;
+}
+
+div.tabs-panel,
+ul#category-tabs li.tabs {
+ border-color: #dfdfdf;
+}
+
+ul#category-tabs li.tabs {
+ background-color: #f1f1f1;
+}
+
+input.disabled,
+textarea.disabled {
+ background-color: #ccc;
+}
+/* #upload-menu li a.upload-tab-link, */
+.login #backtoblog a:hover,
+#plugin-information .action-button a,
+#plugin-information .action-button a:hover,
+#plugin-information .action-button a:visited {
+ color: #fff;
+}
+
+.widget .widget-top,
+.postbox h3,
+.stuffbox h3 {
+ background: #dfdfdf url("../images/gray-grad.png") repeat-x left top;
+ text-shadow: #fff 0 1px 0;
+}
+
+.form-table th,
+.form-wrap label {
+ color: #222;
+ text-shadow: #fff 0 1px 0;
+}
+
+.description,
+.form-wrap p {
+ color: #666;
+}
+
+strong .post-com-count span {
+ background-color: #21759b;
+}
+
+.sorthelper {
+ background-color: #ccf3fa;
+}
+
+.ac_match,
+.subsubsub a.current {
+ color: #000;
+}
+
+.wrap h2 {
+ color: #464646;
+}
+
+.ac_over {
+ background-color: #f0f0b8;
+}
+
+.ac_results {
+ background-color: #fff;
+ border-color: #808080;
+}
+
+.ac_results li {
+ color: #101010;
+}
+
+.alternate,
+.alt {
+ background-color: #f9f9f9;
+}
+
+.available-theme a.screenshot {
+ background-color: #f1f1f1;
+ border-color: #ddd;
+}
+
+.bar {
+ background-color: #e8e8e8;
+ border-right-color: #99d;
+}
+
+#media-upload,
+#media-upload .media-item .slidetoggle {
+ background: #fff;
+}
+
+#media-upload .slidetoggle {
+ border-top-color: #dfdfdf;
+}
+
+.error,
+.login #login_error {
+ background-color: #ffebe8;
+ border-color: #c00;
+}
+
+.error a {
+ color: #c00;
+}
+
+.form-invalid {
+ background-color: #ffebe8 !important;
+}
+
+.form-invalid input,
+.form-invalid select {
+ border-color: #c00 !important;
+}
+
+.submit {
+ border-color: #DFDFDF;
+}
+
+.highlight {
+ background-color: #e4f2fd;
+ color: #d54e21;
+}
+
+.howto,
+.nonessential,
+#edit-slug-box,
+.form-input-tip,
+.rss-widget span.rss-date,
+.subsubsub {
+ color: #666;
+}
+
+.media-item {
+ border-bottom-color: #dfdfdf;
+}
+
+#wpbody-content #media-items .describe {
+ border-top-color: #dfdfdf;
+}
+
+.media-upload-form label.form-help,
+td.help {
+ color: #9a9a9a;
+}
+
+.post-com-count {
+ background-image: url(../images/bubble_bg.gif);
+ color: #fff;
+}
+
+.post-com-count span {
+ background-color: #bbb;
+ color: #fff;
+}
+
+.post-com-count:hover span {
+ background-color: #d54e21;
+}
+
+.quicktags, .search {
+ background-color: #ccc;
+ color: #000;
+}
+
+.side-info h5 {
+ border-bottom-color: #dadada;
+}
+
+.side-info ul {
+ color: #666;
+}
+
+.button,
+.button-secondary,
+.submit input,
+input[type=button],
+input[type=submit] {
+ border-color: #bbb;
+ color: #464646;
+}
+
+.button:hover,
+.button-secondary:hover,
+.submit input:hover,
+input[type=button]:hover,
+input[type=submit]:hover {
+ color: #000;
+ border-color: #666;
+}
+
+.button,
+.submit input,
+.button-secondary {
+ background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
+ text-shadow: rgba(255,255,255,1) 0 1px 0;
+}
+
+.button:active,
+.submit input:active,
+.button-secondary:active {
+ background: #eee url(../images/white-grad-active.png) repeat-x scroll left top;
+}
+
+input.button-primary,
+button.button-primary,
+a.button-primary {
+ border-color: #298cba;
+ font-weight: bold;
+ color: #fff;
+ background: #21759B url(../images/button-grad.png) repeat-x scroll left top;
+ text-shadow: rgba(0,0,0,0.3) 0 -1px 0;
+}
+
+input.button-primary:active,
+button.button-primary:active,
+a.button-primary:active {
+ background: #21759b url(../images/button-grad-active.png) repeat-x scroll left top;
+ color: #eaf2fa;
+}
+
+input.button-primary:hover,
+button.button-primary:hover,
+a.button-primary:hover,
+a.button-primary:focus,
+a.button-primary:active {
+ border-color: #13455b;
+ color: #eaf2fa;
+}
+
+.button-disabled,
+.button[disabled],
+.button:disabled,
+.button-secondary[disabled],
+.button-secondary:disabled,
+a.button.disabled {
+ color: #aaa !important;
+ border-color: #ddd !important;
+}
+
+.button-primary-disabled,
+.button-primary[disabled],
+.button-primary:disabled {
+ color: #9FD0D5 !important;
+ background: #298CBA !important;
+}
+
+a:hover,
+a:active,
+a:focus {
+ color: #d54e21;
+}
+
+#wphead #viewsite a:hover,
+#adminmenu a:hover,
+#adminmenu ul.wp-submenu a:hover,
+#the-comment-list .comment a:hover,
+#rightnow a:hover,
+#media-upload a.del-link:hover,
+div.dashboard-widget-submit input:hover,
+.subsubsub a:hover,
+.subsubsub a.current:hover,
+.ui-tabs-nav a:hover,
+.plugins .inactive a:hover,
+#all-plugins-table .plugins .inactive a:hover,
+#search-plugins-table .plugins .inactive a:hover {
+ color: #d54e21;
+}
+
+#the-comment-list .comment-item,
+#dashboard-widgets #dashboard_quick_press form p.submit {
+ border-color: #dfdfdf;
+}
+
+#side-sortables #category-tabs .tabs a {
+ color: #333;
+}
+
+#rightnow .rbutton {
+ background-color: #ebebeb;
+ color: #264761;
+}
+
+.submitbox .submit {
+ background-color: #464646;
+ color: #ccc;
+}
+
+.plugins a.delete:hover,
+#all-plugins-table .plugins a.delete:hover,
+#search-plugins-table .plugins a.delete:hover,
+.submitbox .submitdelete {
+ color: #f00;
+ border-bottom-color: #f00;
+}
+
+.submitbox .submitdelete:hover,
+#media-items a.delete:hover {
+ color: #fff;
+ background-color: #f00;
+ border-bottom-color: #f00;
+}
+
+#normal-sortables .submitbox .submitdelete:hover {
+ color: #000;
+ background-color: #f00;
+ border-bottom-color: #f00;
+}
+
+.tablenav .dots {
+ border-color: transparent;
+}
+
+.tablenav .next,
+.tablenav .prev {
+ border-color: transparent;
+ color: #21759b;
+}
+
+.tablenav .next:hover,
+.tablenav .prev:hover {
+ border-color: transparent;
+ color: #d54e21;
+}
+
+.updated,
+.login .message {
+ background-color: #ffffe0;
+ border-color: #e6db55;
+}
+
+.update-message {
+ color: #000000;
+}
+
+a.page-numbers {
+ border-bottom-color: #B8D3E2;
+}
+
+.commentlist li {
+ border-bottom-color: #ccc;
+}
+
+.widefat td,
+.widefat th,
+#install-plugins .plugins td,
+#install-plugins .plugins th {
+ border-color: #dfdfdf;
+}
+
+.widefat th {
+ text-shadow: rgba(255,255,255,0.8) 0 1px 0;
+}
+
+.widefat thead tr th,
+.widefat tfoot tr th,
+h3.dashboard-widget-title,
+h3.dashboard-widget-title span,
+h3.dashboard-widget-title small,
+.find-box-head {
+ color: #333;
+ background: #dfdfdf url(../images/gray-grad.png) repeat-x scroll left top;
+}
+
+h3.dashboard-widget-title small a {
+ color: #d7d7d7;
+}
+
+h3.dashboard-widget-title small a:hover {
+ color: #fff;
+}
+
+a,
+#adminmenu a,
+#poststuff #edButtonPreview,
+#poststuff #edButtonHTML,
+#the-comment-list p.comment-author strong a,
+#media-upload a.del-link,
+#media-items a.delete,
+.plugins a.delete,
+.ui-tabs-nav a {
+ color: #21759b;
+}
+
+/* Because we don't want visited on these links */
+body.press-this .tabs a,
+body.press-this .tabs a:hover {
+ background-color: #fff;
+ border-color: #c6d9e9;
+ border-bottom-color: #fff;
+ color: #d54e21;
+}
+
+#adminmenu #awaiting-mod,
+#adminmenu .update-plugins,
+#sidemenu a .update-plugins,
+#rightnow .reallynow,
+#plugin-information .action-button {
+ background-color: #d54e21;
+ color: #fff;
+}
+
+#adminmenu li a:hover #awaiting-mod,
+#adminmenu li a:hover .update-plugins,
+#sidemenu li a:hover .update-plugins {
+ background-color: #264761;
+ color: #fff;
+}
+
+#adminmenu li.current a #awaiting-mod,
+#adminmenu li.current a .update-plugins,
+#adminmenu li.wp-has-current-submenu a .update-plugins,
+#adminmenu li.wp-has-current-submenu a .update-plugins {
+ background-color: #ddd;
+ color: #000;
+ text-shadow: none;
+ -moz-box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
+ -khtml-box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
+ -webkit-box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
+ box-shadow: rgba(0,0,0,0.2) 0 -1px 0;
+}
+
+#adminmenu li.current a:hover #awaiting-mod,
+#adminmenu li.current a:hover .update-plugins,
+#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod,
+#adminmenu li.wp-has-current-submenu a:hover .update-plugins {
+ background-color: #264761;
+ color: #fff;
+}
+
+div#media-upload-header,
+div#plugin-information-header {
+ background-color: #f9f9f9;
+ border-bottom-color: #dfdfdf;
+}
+
+#currenttheme img {
+ border-color: #666;
+}
+
+#dashboard_secondary div.dashboard-widget-content ul li a {
+ background-color: #f9f9f9;
+}
+
+input.readonly, textarea.readonly {
+ background-color: #ddd;
+}
+
+#ed_toolbar input,
+#ed_reply_toolbar input {
+ background: #fff url("../images/fade-butt.png") repeat-x 0 -2px;
+}
+
+#editable-post-name {
+ background-color: #fffbcc;
+}
+
+#edit-slug-box strong,
+.tablenav .displaying-num,
+#submitted-on {
+ color: #777;
+}
+
+.login #nav a {
+ color: #21759b !important;
+}
+
+.login #nav a:hover {
+ color: #d54e21 !important;
+}
+
+#footer,
+#footer-upgrade {
+ background: #464646;
+ color: #999;
+}
+
+#media-items,
+.imgedit-group {
+ border-color: #dfdfdf;
+}
+
+.checkbox,
+.side-info,
+.plugins tr,
+#your-profile #rich_editing {
+ background-color: #fff;
+}
+
+.plugins .inactive,
+.plugins .inactive th,
+.plugins .inactive td,
+tr.inactive + tr.plugin-update-tr .plugin-update {
+ background-color: #eee;
+}
+
+.plugin-update-tr .update-message {
+ background-color: #fffbe4;
+ border-color: #dfdfdf;
+}
+
+.plugins .active,
+.plugins .active th,
+.plugins .active td {
+ color: #000;
+}
+
+.plugins .inactive a {
+ color: #557799;
+}
+
+#the-comment-list tr.undo,
+#the-comment-list div.undo {
+ background-color: #f4f4f4;
+}
+
+#the-comment-list .unapproved {
+ background-color: #ffffe0;
+}
+
+#the-comment-list .approve a {
+ color: #006505;
+}
+
+#the-comment-list .unapprove a {
+ color: #d98500;
+}
+
+table.widefat span.delete a,
+table.widefat span.trash a,
+table.widefat span.spam a,
+#dashboard_recent_comments .delete a,
+#dashboard_recent_comments .trash a,
+#dashboard_recent_comments .spam a {
+ color: #bc0b0b;
+}
+
+.widget,
+#widget-list .widget-top,
+.postbox,
+#titlediv,
+#poststuff .postarea,
+.stuffbox {
+ border-color: #dfdfdf;
+}
+
+.widget,
+.postbox {
+ background-color: #fff;
+}
+
+.ui-sortable .postbox h3 {
+ color: #464646;
+}
+
+.widget .widget-top,
+.ui-sortable .postbox h3:hover {
+ color: #000;
+}
+
+.curtime #timestamp {
+ background-image: url(../images/date-button.gif);
+}
+
+#quicktags #ed_link {
+ color: #00f;
+}
+
+#rightnow .youhave {
+ background-color: #f0f6fb;
+}
+
+#rightnow a {
+ color: #448abd;
+}
+
+.tagchecklist span a,
+#bulk-titles div a {
+ background: url(../images/xit.gif) no-repeat;
+}
+
+.tagchecklist span a:hover,
+#bulk-titles div a:hover {
+ background: url(../images/xit.gif) no-repeat -10px 0;
+}
+
+#update-nag {
+ background-color: #fffeeb;
+ border-color: #ccc;
+ color: #555;
+}
+
+.login #backtoblog a {
+ color: #ccc;
+}
+
+#wphead {
+ background-color: #464646;
+}
+
+body.login {
+ border-top-color: #464646;
+}
+
+#wphead h1 a {
+ color: #fff;
+}
+
+#user_info {
+ color: #999;
+}
+
+#user_info a:link,
+#user_info a:visited,
+#footer a:link,
+#footer a:visited {
+ color: #ccc;
+ text-decoration: none;
+}
+
+#user_info a:hover,
+#footer a:hover {
+ color: #fff;
+ text-decoration: underline !important;
+}
+
+#user_info a:active,
+#footer a:active {
+ color: #ccc !important;
+}
+
+div#media-upload-error,
+.file-error,
+abbr.required,
+.widget-control-remove:hover,
+table.widefat .delete a:hover,
+table.widefat .trash a:hover,
+table.widefat .spam a:hover,
+#dashboard_recent_comments .delete a:hover,
+#dashboard_recent_comments .trash a:hover
+#dashboard_recent_comments .spam a:hover {
+ color: #f00;
+}
+
+#pass-strength-result {
+ background-color: #eee;
+ border-color: #ddd !important;
+}
+
+#pass-strength-result.bad {
+ background-color: #ffb78c;
+ border-color: #ff853c !important;
+}
+
+#pass-strength-result.good {
+ background-color: #ffec8b;
+ border-color: #fc0 !important;
+}
+
+#pass-strength-result.short {
+ background-color: #ffa0a0;
+ border-color: #f04040 !important;
+}
+
+#pass-strength-result.strong {
+ background-color: #c3ff88;
+ border-color: #8dff1c !important;
+}
+
+/* editors */
+#quicktags {
+ border-color: #dfdfdf;
+ background-color: #dfdfdf;
+}
+
+#ed_toolbar input {
+ border-color: #C3C3C3;
+}
+
+#ed_toolbar input:hover {
+ border-color: #aaa;
+ background: #ddd;
+}
+
+#poststuff .wp_themeSkin .mceStatusbar {
+ border-color: #EDEDED;
+}
+
+#poststuff #edButtonPreview,
+#poststuff #edButtonHTML {
+ background-color: #f1f1f1;
+ border-color: #dfdfdf;
+ color: #999;
+}
+
+#poststuff #editor-toolbar .active {
+ border-bottom-color: #e9e9e9;
+ background-color: #e9e9e9;
+ color: #333;
+}
+
+/* TinyMCE */
+#post-status-info {
+ background-color: #EDEDED;
+}
+
+.wp_themeSkin *,
+.wp_themeSkin a:hover,
+.wp_themeSkin a:link,
+.wp_themeSkin a:visited,
+.wp_themeSkin a:active {
+ color: #000;
+}
+
+/* Containers */
+.wp_themeSkin iframe {
+ background: #fff;
+}
+
+/* Layout */
+.wp_themeSkin .mceStatusbar {
+ color: #000;
+ background-color: #f5f5f5;
+}
+
+/* Button */
+.wp_themeSkin .mceButton {
+ background-color: #e9e8e8;
+ border-color: #B2B2B2;
+}
+
+.wp_themeSkin a.mceButtonEnabled:hover,
+.wp_themeSkin a.mceButtonActive,
+.wp_themeSkin a.mceButtonSelected {
+ background-color: #d5d5d5;
+ border-color: #777 !important;
+}
+
+.wp_themeSkin .mceButtonDisabled {
+ border-color: #ccc !important;
+}
+
+/* ListBox */
+.wp_themeSkin .mceListBox .mceText,
+.wp_themeSkin .mceListBox .mceOpen {
+ border-color: #B2B2B2;
+ background-color: #d5d5d5;
+}
+
+.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,
+.wp_themeSkin .mceListBoxHover .mceOpen,
+.wp_themeSkin .mceListBoxSelected .mceOpen,
+.wp_themeSkin .mceListBoxSelected .mceText {
+ border-color: #777 !important;
+ background-color: #d5d5d5;
+}
+
+.wp_themeSkin table.mceListBoxEnabled:hover .mceText,
+.wp_themeSkin .mceListBoxHover .mceText {
+ border-color: #777 !important;
+}
+
+.wp_themeSkin select.mceListBox {
+ border-color: #B2B2B2;
+ background-color: #fff;
+}
+
+/* SplitButton */
+.wp_themeSkin .mceSplitButton a.mceAction,
+.wp_themeSkin .mceSplitButton a.mceOpen {
+ border-color: #B2B2B2;
+}
+
+.wp_themeSkin .mceSplitButton a.mceOpen:hover,
+.wp_themeSkin .mceSplitButtonSelected a.mceOpen,
+.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,
+.wp_themeSkin .mceSplitButton a.mceAction:hover {
+ background-color: #d5d5d5;
+ border-color: #777 !important;
+}
+
+.wp_themeSkin .mceSplitButtonActive {
+ background-color: #B2B2B2;
+}
+
+/* ColorSplitButton */
+.wp_themeSkin div.mceColorSplitMenu table {
+ background-color: #ebebeb;
+ border-color: #B2B2B2;
+}
+
+.wp_themeSkin .mceColorSplitMenu a {
+ border-color: #B2B2B2;
+}
+
+.wp_themeSkin .mceColorSplitMenu a.mceMoreColors {
+ border-color: #fff;
+}
+
+.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover {
+ border-color: #0A246A;
+ background-color: #B6BDD2;
+}
+
+.wp_themeSkin a.mceMoreColors:hover {
+ border-color: #0A246A;
+}
+
+/* Menu */
+.wp_themeSkin .mceMenu {
+ border-color: #ddd;
+}
+
+.wp_themeSkin .mceMenu table {
+ background-color: #ebeaeb;
+}
+
+.wp_themeSkin .mceMenu .mceText {
+ color: #000;
+}
+
+.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,
+.wp_themeSkin .mceMenu .mceMenuItemActive {
+ background-color: #f5f5f5;
+}
+.wp_themeSkin td.mceMenuItemSeparator {
+ background-color: #aaa;
+}
+.wp_themeSkin .mceMenuItemTitle a {
+ background-color: #ccc;
+ border-bottom-color: #aaa;
+}
+.wp_themeSkin .mceMenuItemTitle span.mceText {
+ color: #000;
+}
+.wp_themeSkin .mceMenuItemDisabled .mceText {
+ color: #888;
+}
+
+.wp_themeSkin tr.mceFirst td.mceToolbar {
+ background: #dfdfdf url("../images/ed-bg.gif") repeat-x scroll left top;
+ border-color: #dfdfdf;
+}
+
+.wp-admin #mceModalBlocker {
+ background: #000;
+}
+
+.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft {
+ background: #444444;
+ border-left: 1px solid #999;
+ border-top: 1px solid #999;
+ -moz-border-radius: 4px 0 0 0;
+ -webkit-border-top-left-radius: 4px;
+ -khtml-border-top-left-radius: 4px;
+ border-top-left-radius: 4px;
+}
+
+.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight {
+ background: #444444;
+ border-right: 1px solid #999;
+ border-top: 1px solid #999;
+ border-top-right-radius: 4px;
+ -khtml-border-top-right-radius: 4px;
+ -webkit-border-top-right-radius: 4px;
+ -moz-border-radius: 0 4px 0 0;
+}
+
+.wp-admin .clearlooks2 .mceMiddle .mceLeft {
+ background: #f1f1f1;
+ border-left: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceMiddle .mceRight {
+ background: #f1f1f1;
+ border-right: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom {
+ background: #f1f1f1;
+ border-bottom: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom .mceLeft {
+ background: #f1f1f1;
+ border-bottom: 1px solid #999;
+ border-left: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom .mceCenter {
+ background: #f1f1f1;
+ border-bottom: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceBottom .mceRight {
+ background: #f1f1f1;
+ border-bottom: 1px solid #999;
+ border-right: 1px solid #999;
+}
+
+.wp-admin .clearlooks2 .mceFocus .mceTop span {
+ color: #e5e5e5;
+}
+/* end TinyMCE */
+
+#editorcontainer,
+#post-status-info,
+#titlediv #title,
+.editwidget .widget-inside {
+ border-color: #dfdfdf;
+}
+
+#titlediv #title {
+ background-color: #fff;
+}
+
+#tTips p#tTips_inside {
+ background-color: #ddd;
+ color: #333;
+}
+
+#timestampdiv input,
+#namediv input,
+#poststuff .inside .the-tagcloud {
+ border-color: #ddd;
+}
+
+/* menu */
+#adminmenu * {
+ border-color: #e3e3e3;
+}
+
+#adminmenu li.wp-menu-separator {
+ background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;
+}
+
+.folded #adminmenu li.wp-menu-separator {
+ background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;
+}
+
+#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,
+#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle {
+ background: transparent url(../images/menu-bits.gif) no-repeat scroll left -207px;
+}
+
+#adminmenu .wp-has-submenu:hover .wp-menu-toggle,
+#adminmenu .wp-menu-open .wp-menu-toggle {
+ background: transparent url(../images/menu-bits.gif) no-repeat scroll left -109px;
+}
+
+#adminmenu a.menu-top {
+ background: #f1f1f1 url(../images/menu-bits.gif) repeat-x scroll left -379px;
+}
+
+#adminmenu .wp-submenu a {
+ background: #FFFFFF url(../images/menu-bits.gif) no-repeat scroll 0 -310px;
+}
+
+#adminmenu .wp-has-current-submenu ul li a {
+ background: none;
+}
+
+#adminmenu .wp-has-current-submenu ul li a.current {
+ background: url(../images/menu-dark.gif) top left no-repeat !important;
+}
+
+#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
+#adminmenu .menu-top .current {
+ background: #6d6d6d url(../images/menu-bits.gif) top left repeat-x;
+ border-color: #6d6d6d;
+ color: #fff;
+ text-shadow: rgba(0,0,0,0.4) 0px -1px 0px;
+}
+
+#adminmenu li.wp-has-current-submenu .wp-submenu,
+#adminmenu li.wp-has-current-submenu ul li a {
+ border-color: #aaa !important;
+}
+
+#adminmenu li.wp-has-current-submenu ul li a {
+ background: url(../images/menu-dark.gif) bottom left no-repeat !important;
+}
+
+#adminmenu li.wp-has-current-submenu ul {
+ border-bottom-color: #aaa;
+}
+
+#adminmenu li.menu-top .current:hover {
+ border-color: #B5B5B5;
+}
+
+#adminmenu .wp-submenu .current a.current {
+ background: transparent url(../images/menu-bits.gif) no-repeat scroll 0 -289px;
+}
+
+#adminmenu .wp-submenu a:hover {
+ background-color: #EAF2FA !important;
+ color: #333 !important;
+}
+
+#adminmenu .wp-submenu li.current,
+#adminmenu .wp-submenu li.current a,
+#adminmenu .wp-submenu li.current a:hover {
+ color: #333;
+ background-color: #f5f5f5;
+ background-image: none;
+ border-color: #e3e3e3;
+ text-shadow: rgba(255,255,255,1) 0px 1px 0px;
+}
+
+#adminmenu .wp-submenu ul {
+ background-color: #fff;
+}
+
+.folded #adminmenu li.menu-top,
+#adminmenu .wp-submenu .wp-submenu-head {
+ background-color: #F1F1F1;
+}
+
+.folded #adminmenu li.wp-has-current-submenu,
+.folded #adminmenu li.menu-top.current {
+ background-color: #e6e6e6;
+}
+
+#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head {
+ background-color: #EAEAEA;
+ border-color: #aaa;
+}
+
+#adminmenu div.wp-submenu {
+ background-color: transparent;
+}
+
+/* menu icons */
+#adminmenu #menu-dashboard div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -61px -33px;
+}
+
+#adminmenu #menu-dashboard:hover div.wp-menu-image,
+#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image,
+#adminmenu #menu-dashboard.current div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -61px -1px;
+}
+
+#adminmenu #menu-posts div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -272px -33px;
+}
+
+#adminmenu #menu-posts:hover div.wp-menu-image,
+#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -272px -1px;
+}
+
+#adminmenu #menu-media div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -121px -33px;
+}
+
+#adminmenu #menu-media:hover div.wp-menu-image,
+#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -121px -1px;
+}
+
+#adminmenu #menu-links div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -91px -33px;
+}
+
+#adminmenu #menu-links:hover div.wp-menu-image,
+#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -91px -1px;
+}
+
+#adminmenu #menu-pages div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -151px -33px;
+}
+
+#adminmenu #menu-pages:hover div.wp-menu-image,
+#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -151px -1px;
+}
+
+#adminmenu #menu-comments div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -31px -33px;
+}
+
+#adminmenu #menu-comments:hover div.wp-menu-image,
+#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image,
+#adminmenu #menu-comments.current div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -31px -1px;
+}
+
+#adminmenu #menu-appearance div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -1px -33px;
+}
+
+#adminmenu #menu-appearance:hover div.wp-menu-image,
+#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -1px -1px;
+}
+
+#adminmenu #menu-plugins div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -181px -33px;
+}
+
+#adminmenu #menu-plugins:hover div.wp-menu-image,
+#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -181px -1px;
+}
+
+#adminmenu #menu-users div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -301px -33px;
+}
+
+#adminmenu #menu-users:hover div.wp-menu-image,
+#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -301px -1px;
+}
+
+#adminmenu #menu-tools div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -211px -33px;
+}
+
+#adminmenu #menu-tools:hover div.wp-menu-image,
+#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -211px -1px;
+}
+
+#adminmenu #menu-settings div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -241px -33px;
+}
+
+#adminmenu #menu-settings:hover div.wp-menu-image,
+#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image {
+ background: transparent url("../images/menu.png") no-repeat scroll -241px -1px;
+}
+/* end menu */
+
+
+/* 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;
+}
+
+#att-info {
+ background-color: #E4F2FD;
+}
+
+/* edit image */
+#sidemenu a {
+ background-color: #f9f9f9;
+ border-color: #f9f9f9;
+ border-bottom-color: #dfdfdf;
+}
+
+#sidemenu a.current {
+ background-color: #fff;
+ border-color: #dfdfdf #dfdfdf #fff;
+ color: #D54E21;
+}
+
+#screen-options-wrap,
+#contextual-help-wrap {
+ background-color: #f1f1f1;
+ border-color: #dfdfdf;
+}
+
+#screen-meta-links a.show-settings {
+ color: #606060;
+}
+
+#screen-meta-links a.show-settings:hover {
+ color: #000;
+}
+
+#replysubmit {
+ background-color: #f1f1f1;
+ border-top-color: #ddd;
+}
+
+#replyerror {
+ border-color: #ddd;
+ background-color: #f9f9f9;
+}
+
+#edithead,
+#replyhead {
+ background-color: #f1f1f1;
+}
+
+#ed_reply_toolbar {
+ background-color: #e9e9e9;
+}
+
+/* table vim shortcuts */
+.vim-current,
+.vim-current th,
+.vim-current td {
+ background-color: #E4F2FD !important;
+}
+
+/* Install Plugins */
+.star-average,
+.star.star-rating {
+ background-color: #fc0;
+}
+
+div.star.select:hover {
+ background-color: #d00;
+}
+
+#plugin-information .fyi ul {
+ background-color: #eaf3fa;
+}
+
+#plugin-information .fyi h2.mainheader {
+ background-color: #cee1ef;
+}
+
+#plugin-information pre,
+#plugin-information code {
+ background-color: #ededff;
+}
+
+#plugin-information pre {
+ border: 1px solid #ccc;
+}
+
+/* inline editor */
+.inline-edit-row fieldset input[type="text"],
+.inline-edit-row fieldset textarea,
+#bulk-titles,
+#replyrow input {
+ border-color: #ddd;
+}
+
+.inline-editor div.title {
+ background-color: #EAF3FA;
+}
+
+.inline-editor ul.cat-checklist {
+ background-color: #FFFFFF;
+ border-color: #ddd;
+}
+
+.inline-editor .categories .catshow,
+.inline-editor .categories .cathide {
+ color: #21759b;
+}
+
+.inline-editor .quick-edit-save {
+ background-color: #f1f1f1;
+}
+
+#replyrow #ed_reply_toolbar input:hover {
+ border-color: #aaa;
+ background: #ddd;
+}
+
+fieldset.inline-edit-col-right .inline-edit-col {
+ border-color: #dfdfdf;
+}
+
+.attention {
+ color: #D54E21;
+}
+
+.meta-box-sortables .postbox:hover .handlediv {
+ background: transparent url(../images/menu-bits.gif) no-repeat scroll left -111px;
+}
+
+#major-publishing-actions {
+ background: #eaf2fa;
+}
+
+.tablenav .tablenav-pages {
+ color: #555;
+}
+
+.tablenav .tablenav-pages a {
+ border-color: #e3e3e3;
+ background: #eee url('../images/menu-bits.gif') repeat-x scroll left -379px;
+}
+
+.tablenav .tablenav-pages a:hover {
+ color: #d54e21;
+ border-color: #d54321;
+}
+
+.tablenav .tablenav-pages a:active {
+ color: #fff !important;
+}
+
+.tablenav .tablenav-pages .current {
+ background: #dfdfdf;
+ border-color: #d3d3d3;
+}
+
+#availablethemes,
+#availablethemes td {
+ border-color: #ddd;
+}
+
+#current-theme img {
+ border-color: #999;
+}
+
+#TB_window #TB_title a.tb-theme-preview-link,
+#TB_window #TB_title a.tb-theme-preview-link:visited {
+ color: #999;
+}
+
+#TB_window #TB_title a.tb-theme-preview-link:hover,
+#TB_window #TB_title a.tb-theme-preview-link:focus {
+ color: #ccc;
+}
+
+.misc-pub-section {
+ border-bottom-color: #eee;
+}
+
+#minor-publishing {
+ border-bottom-color: #ddd;
+}
+
+#post-body .misc-pub-section {
+ border-right-color: #eee;
+}
+
+.post-com-count span {
+ background-color: #bbb;
+}
+
+.form-table .color-palette td {
+ border-color: #fff;
+}
+
+.sortable-placeholder {
+ border-color: #bbb;
+ background-color: #f5f5f5;
+}
+
+#post-body ul#category-tabs li.tabs a {
+ color: #333;
+}
+
+#wp_editimgbtn,
+#wp_delimgbtn,
+#wp_editgallery,
+#wp_delgallery {
+ border-color: #999;
+ background-color: #eee;
+}
+
+#wp_editimgbtn:hover,
+#wp_delimgbtn:hover,
+#wp_editgallery:hover,
+#wp_delgallery:hover {
+ border-color: #555;
+ background-color: #ccc;
+}
+
+#favorite-first {
+ background: #797979 url(../images/fav.png) repeat-x left center;
+ border-color: #777 !important;
+ border-bottom-color: #666 !important;
+}
+
+#favorite-inside {
+ border-color: #797979;
+ background-color: #797979;
+}
+
+#favorite-toggle {
+ background: transparent url(../images/fav-arrow.gif) no-repeat 0 -4px;
+}
+
+#favorite-actions a {
+ color: #ddd;
+}
+
+#favorite-actions a:hover {
+ color: #fff;
+}
+
+#favorite-inside a:hover {
+ text-decoration: underline;
+}
+
+#favorite-actions .slide-down {
+ border-bottom-color: #626262;
+}
+
+#screen-meta a.show-settings {
+ background-color: transparent;
+ text-shadow: rgba(255,255,255,0.7) 0 1px 0;
+}
+
+#icon-edit,
+#icon-post {
+ background: transparent url(../images/icons32.png) no-repeat -552px -5px;
+}
+
+#icon-index {
+ background: transparent url(../images/icons32.png) no-repeat -137px -5px;
+}
+
+#icon-upload {
+ background: transparent url(../images/icons32.png) no-repeat -251px -5px;
+}
+
+#icon-link-manager,
+#icon-link,
+#icon-link-category {
+ background: transparent url(../images/icons32.png) no-repeat -190px -5px;
+}
+
+#icon-edit-pages,
+#icon-page {
+ background: transparent url(../images/icons32.png) no-repeat -312px -5px;
+}
+
+#icon-edit-comments {
+ background: transparent url(../images/icons32.png) no-repeat -72px -5px;
+}
+
+#icon-themes {
+ background: transparent url(../images/icons32.png) no-repeat -11px -5px;
+}
+
+#icon-plugins {
+ background: transparent url(../images/icons32.png) no-repeat -370px -5px;
+}
+
+#icon-users,
+#icon-profile,
+#icon-user-edit {
+ background: transparent url(../images/icons32.png) no-repeat -600px -5px;
+}
+
+#icon-tools,
+#icon-admin {
+ background: transparent url(../images/icons32.png) no-repeat -432px -5px;
+}
+
+#icon-options-general {
+ background: transparent url(../images/icons32.png) no-repeat -492px -5px;
+}
+
+.view-switch #view-switch-list {
+ background: transparent url(../images/list.png) no-repeat 0 0;
+}
+
+.view-switch #view-switch-list.current {
+ background: transparent url(../images/list.png) no-repeat -40px 0;
+}
+
+.view-switch #view-switch-excerpt {
+ background: transparent url(../images/list.png) no-repeat -20px 0;
+}
+
+.view-switch #view-switch-excerpt.current {
+ background: transparent url(../images/list.png) no-repeat -60px 0;
+}
+
+#header-logo {
+ background: transparent url(../images/wp-logo.gif) no-repeat scroll center center;
+}
+
+#wphead #site-visit-button {
+ background-color:#585858;
+ background-image: url(../images/visit-site-button-grad.gif);
+ color:#aaa;
+ text-shadow: #3F3F3F 0 -1px 0;
+}
+
+#wphead a:hover #site-visit-button {
+ color:#fff;
+}
+
+#wphead a:focus #site-visit-button,
+#wphead a:active #site-visit-button {
+ background-position:0 -27px;
+}
+
+.popular-tags,
+.feature-filter {
+ background-color: #FFFFFF;
+ border-color: #DFDFDF;
+}
+
+#theme-information .action-button {
+ border-top-color: #DFDFDF;
+}
+
+.theme-listing br.line {
+ border-bottom-color: #ccc;
+}
+
+div.widgets-sortables,
+#widgets-left .inactive {
+ background-color: #f1f1f1;
+ border-color: #ddd;
+}
+
+#available-widgets .widget-holder {
+ background-color: #fff;
+ border-color: #ddd;
+}
+
+#widgets-left .sidebar-name {
+ background-color: #aaa;
+ background-image: url(../images/ed-bg.gif);
+ text-shadow: #FFFFFF 0 1px 0;
+ border-color: #dfdfdf;
+}
+
+#widgets-right .sidebar-name {
+ background-image: url(../images/fav.png);
+ text-shadow: #3f3f3f 0 -1px 0;
+ background-color: #636363;
+ border-color: #636363;
+ color: #fff;
+}
+
+.sidebar-name:hover,
+#removing-widget {
+ color: #d54e21;
+}
+
+#removing-widget span {
+ color: black;
+}
+
+#widgets-left .sidebar-name-arrow {
+ background: transparent url(../images/menu-bits.gif) no-repeat scroll left -109px;
+}
+
+#widgets-right .sidebar-name-arrow {
+ background: transparent url(../images/fav-arrow.gif) no-repeat scroll 0 -1px;
+}
+
+.in-widget-title {
+ color: #606060;
+}
+
+.deleting .widget-title * {
+ color: #aaa;
+}
+
+.imgedit-menu div {
+ border-color: #d5d5d5;
+ background-color: #f1f1f1;
+}
+
+.imgedit-menu div:hover {
+ border-color: #c1c1c1;
+ background-color: #eaeaea;
+}
+
+.imgedit-menu div.disabled {
+ border-color: #ccc;
+ background-color: #ddd;
+ filter: alpha(opacity=50);
+ opacity: 0.5;
+}
+
+#dashboard_recent_comments div.undo {
+ border-top-color: #dfdfdf;
+}
+
+.comment-ays,
+.comment-ays th {
+ border-color: #ddd;
+}
+
+.comment-ays th {
+ background-color: #f1f1f1;
+}
-.postbox p, .postbox ul, .postbox ol, .postbox blockquote, #wp-version-message { font-size: 11px; }
-
-.edit-box {
- display: none;
-}
-
-h3:hover .edit-box {
- display: inline;
-}
-
-form .input-text-wrap {
- border-style: solid;
- border-width: 1px;
- padding: 2px 3px;
- border-color: #ccc;
-}
-
-#dashboard-widgets form .input-text-wrap input {
- border: 0 none;
- outline: none;
- margin: 0;
- padding: 0;
- width: 99%;
- color: #333;
-}
-
-form .textarea-wrap {
- border-style: solid;
- border-width: 1px;
- padding: 2px;
- border-color: #ccc;
-}
-
-#dashboard-widgets form .textarea-wrap textarea {
- border: 0 none;
- padding: 0;
- outline: none;
- width: 99%;
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-#dashboard-widgets .postbox form .submit {
- float: none;
- margin: .5em 0 0;
- padding: 0;
- border: none;
-}
-
-#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit input {
- margin: 0;
-}
-
-#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish {
- min-width: 0;
-}
-
-div.postbox div.inside {
- margin: 10px;
- position: relative;
-}
-
-#dashboard-widgets a {
- text-decoration: none;
-}
-
-#dashboard-widgets h3 a {
- text-decoration: underline;
-}
-
-#dashboard-widgets h3 .postbox-title-action {
- position: absolute;
- right: 30px;
- padding: 0;
-}
-
-#dashboard-widgets h4 {
- font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
- font-size: 13px;
- margin: 0 0 .2em;
- padding: 0;
-}
-
-/* Right Now */
-
-#dashboard_right_now p.sub,
-#dashboard_right_now .table, #dashboard_right_now .versions {
- margin: -12px;
-}
-
-#dashboard_right_now .inside {
- font-size: 12px;
-}
-
-#dashboard_right_now p.sub {
- font-style: italic;
- font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
- padding: 5px 10px 15px;
- color: #777;
- font-size: 13px;
-}
-
-#dashboard_right_now .table {
- background: #f9f9f9;
- border-top: #ececec 1px solid;
- border-bottom: #ececec 1px solid;
- margin: 0 -9px 10px;
- padding: 0 10px;
-}
-
-#dashboard_right_now table {
- width: 100%;
-}
-
-#dashboard_right_now table td {
- border-top: #ececec 1px solid;
- padding: 3px 0;
- white-space: nowrap;
-}
-
-#dashboard_right_now table tr.first td {
- border-top: none;
-}
-
-#dashboard_right_now td.b {
- padding-right: 6px;
- text-align: right;
- font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
- font-size: 14px;
-}
-
-#dashboard_right_now td.b a {
- font-size: 18px;
-}
-
-#dashboard_right_now td.b a:hover {
- color: #d54e21;
-}
-
-#dashboard_right_now .t {
- font-size: 12px;
- padding-right: 12px;
- padding-top: 6px;
- color: #777;
-}
-
-#dashboard_right_now td.first,
-#dashboard_right_now td.last {
- width: 1px;
-}
-
-#dashboard_right_now .spam {
- color: red;
-}
-
-#dashboard_right_now .waiting {
- color: #e66f00;
-}
-
-#dashboard_right_now .approved {
- color: green;
-}
-
-#dashboard_right_now .versions {
- padding: 6px 10px 12px;
-}
-
-#dashboard_right_now .versions .b {
- font-weight: bold;
-}
-
-#dashboard_right_now a.button {
- float: right;
- clear: right;
- position: relative;
- top: -5px;
-}
-
-/* Recent Comments */
-
-#dashboard_recent_comments h3 {
- margin-bottom: 0;
-}
-
-#dashboard_recent_comments .inside {
- margin-top: 0;
-}
-
-#dashboard_recent_comments .comment-meta .approve {
- font-style: italic;
- font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
- font-size: 10px;
-}
-
-#the-comment-list {
- position: relative;
-}
-
-#the-comment-list .comment-item {
- padding: 1em 10px;
- border-top: 1px solid;
-}
-
-#the-comment-list .pingback {
- padding-left: 9px !important;
-}
-
-#the-comment-list .comment-item,
-#the-comment-list #replyrow {
- margin: 0 -10px;
-}
-
-#the-comment-list .comment-item:first-child {
- border-top: none;
-}
-
-#the-comment-list .comment-item .avatar {
- float: left;
- margin: 0 10px 5px 0;
-}
-
-#the-comment-list .comment-item h4 {
- line-height: 1.4;
- margin-top: -.2em;
- font-weight: normal;
- color: #999;
-}
-
-#the-comment-list .comment-item h4 cite {
- font-style: normal;
- font-weight: normal;
-}
-
-#the-comment-list .comment-item blockquote,
-#the-comment-list .comment-item blockquote p {
- margin: 0;
- padding: 0;
- display: inline;
-}
-
-#dashboard_recent_comments #the-comment-list .trackback blockquote,
-#dashboard_recent_comments #the-comment-list .pingback blockquote {
- display: block;
-}
-
-#the-comment-list .comment-item p.row-actions {
- margin: 3px 0 0;
- padding: 0;
- font-size: 10px;
-}
-
-/* QuickPress */
-
-#dashboard_quick_press h4 {
- font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
- float: left;
- width: 5.5em;
- clear: both;
- font-weight: normal;
- text-align: right;
- padding-top: 5px;
- font-size: 12px;
-}
-
-#dashboard_quick_press h4 label {
- margin-right: 10px;
-}
-
-#dashboard_quick_press .input-text-wrap,
-#dashboard_quick_press .textarea-wrap {
- margin: 0 0 1em 5em;
-}
-
-#dashboard_quick_press #media-buttons {
- margin: 0 0 .5em 5em;
- padding: 0 0 0 10px;
- font-size: 11px;
-}
-
-#dashboard_quick_press #media-buttons a {
- vertical-align: bottom;
-}
-
-#dashboard-widgets #dashboard_quick_press form p.submit {
- margin-left: 4.6em;
-}
-
-#dashboard-widgets #dashboard_quick_press form p.submit input {
- float: left;
-}
-
-#dashboard-widgets #dashboard_quick_press form p.submit #save-post {
- margin: 0 1em 0 10px;
-}
-
-#dashboard-widgets #dashboard_quick_press form p.submit #publish {
- float: right;
-}
-
-/* Recent Drafts */
-#dashboard_recent_drafts ul {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-
-#dashboard_recent_drafts ul li {
- margin-bottom: 0.6em;
-}
-
-#dashboard_recent_drafts h4 {
- font-weight: normal;
-}
-
-#dashboard_recent_drafts h4 abbr {
- font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
- font-size: 11px;
- color: #999;
- margin-left: 3px;
-}
-
-#dashboard_recent_drafts p {
- margin: 0;
- padding: 0;
-}
-
-/* Feeds */
-
-.rss-widget ul {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-
-a.rsswidget {
- font-size: 13px;
- font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
- line-height: 1.7em;
-}
-
-.rss-widget ul li {
- line-height: 1.5em;
- margin-bottom: 12px;
-}
-
-.rss-widget span.rss-date {
- margin-left: 3px;
-}
-
-.rss-widget cite {
- display: block;
- text-align: right;
- margin: 0 0 1em;
- padding: 0;
-}
-
-.rss-widget cite:before {
- content: '\2014';
-}
-
-/* Plugins */
-
-#dashboard_plugins h4 {
- font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
-}
-
-#dashboard_plugins h5 {
- font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
- font-size: 13px !important;
- margin: 0;
- display: inline;
- line-height: 1.4em;
-}
-
-#dashboard_plugins h5 a {
- font-weight: normal;
- line-height: 1.7em;
-}
-
-#dashboard_plugins p {
- margin: 0 0 1.4em;
- line-height: 1.4em;
-}
-
-.dashboard-comment-wrap {
- overflow: hidden;
- word-wrap: break-word;
-}
-
+.postbox p,.postbox ul,.postbox ol,.postbox blockquote,#wp-version-message{font-size:11px;}.edit-box{display:none;}h3:hover .edit-box{display:inline;}form .input-text-wrap{border-style:solid;border-width:1px;padding:2px 3px;border-color:#ccc;}#dashboard-widgets form .input-text-wrap input{border:0 none;outline:none;margin:0;padding:0;width:99%;color:#333;}form .textarea-wrap{border-style:solid;border-width:1px;padding:2px;border-color:#ccc;}#dashboard-widgets form .textarea-wrap textarea{border:0 none;padding:0;outline:none;width:99%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;}#dashboard-widgets .postbox form .submit{float:none;margin:.5em 0 0;padding:0;border:none;}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit input{margin:0;}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish{min-width:0;}div.postbox div.inside{margin:10px;position:relative;}#dashboard-widgets a{text-decoration:none;}#dashboard-widgets h3 a{text-decoration:underline;}#dashboard-widgets h3 .postbox-title-action{position:absolute;right:30px;padding:0;}#dashboard-widgets h4{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:13px;margin:0 0 .2em;padding:0;}#dashboard_right_now p.sub,#dashboard_right_now .table,#dashboard_right_now .versions{margin:-12px;}#dashboard_right_now .inside{font-size:12px;}#dashboard_right_now p.sub{font-style:italic;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding:5px 10px 15px;color:#777;font-size:13px;}#dashboard_right_now .table{background:#f9f9f9;border-top:#ececec 1px solid;border-bottom:#ececec 1px solid;margin:0 -9px 10px;padding:0 10px;}#dashboard_right_now table{width:100%;}#dashboard_right_now table td{border-top:#ececec 1px solid;padding:3px 0;white-space:nowrap;}#dashboard_right_now table tr.first td{border-top:none;}#dashboard_right_now td.b{padding-right:6px;text-align:right;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:14px;}#dashboard_right_now td.b a{font-size:18px;}#dashboard_right_now td.b a:hover{color:#d54e21;}#dashboard_right_now .t{font-size:12px;padding-right:12px;padding-top:6px;color:#777;}#dashboard_right_now .t a{white-space:nowrap;}#dashboard_right_now td.first,#dashboard_right_now td.last{width:1%;}#dashboard_right_now .spam{color:red;}#dashboard_right_now .waiting{color:#e66f00;}#dashboard_right_now .approved{color:green;}#dashboard_right_now .versions{padding:6px 10px 12px;}#dashboard_right_now .versions .b{font-weight:bold;}#dashboard_right_now a.button{float:right;clear:right;position:relative;top:-5px;}#dashboard_recent_comments h3{margin-bottom:0;}#dashboard_recent_comments .inside{margin-top:0;}#dashboard_recent_comments .comment-meta .approve{font-style:italic;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:10px;}#the-comment-list{position:relative;}#the-comment-list .comment-item{padding:1em 10px;border-top:1px solid;}#the-comment-list .pingback{padding-left:9px!important;}#the-comment-list .comment-item,#the-comment-list #replyrow{margin:0 -10px;}#the-comment-list .comment-item:first-child{border-top:none;}#the-comment-list .comment-item .avatar{float:left;margin:0 10px 5px 0;}#the-comment-list .comment-item h4{line-height:1.4;margin-top:-.2em;font-weight:normal;color:#999;}#the-comment-list .comment-item h4 cite{font-style:normal;font-weight:normal;}#the-comment-list .comment-item blockquote,#the-comment-list .comment-item blockquote p{margin:0;padding:0;display:inline;}#dashboard_recent_comments #the-comment-list .trackback blockquote,#dashboard_recent_comments #the-comment-list .pingback blockquote{display:block;}#the-comment-list .comment-item p.row-actions{margin:3px 0 0;padding:0;font-size:10px;}#dashboard_quick_press h4{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;float:left;width:5.5em;clear:both;font-weight:normal;text-align:right;padding-top:5px;font-size:12px;}#dashboard_quick_press h4 label{margin-right:10px;}#dashboard_quick_press .input-text-wrap,#dashboard_quick_press .textarea-wrap{margin:0 0 1em 5em;}#dashboard_quick_press #media-buttons{margin:0 0 .5em 5em;padding:0 0 0 10px;font-size:11px;}#dashboard_quick_press #media-buttons a{vertical-align:bottom;}#dashboard-widgets #dashboard_quick_press form p.submit{margin-left:4.6em;}#dashboard-widgets #dashboard_quick_press form p.submit input{float:left;}#dashboard-widgets #dashboard_quick_press form p.submit #save-post{margin:0 1em 0 10px;}#dashboard-widgets #dashboard_quick_press form p.submit #publish{float:right;}#dashboard_recent_drafts ul{margin:0;padding:0;list-style:none;}#dashboard_recent_drafts ul li{margin-bottom:.6em;}#dashboard_recent_drafts h4{font-weight:normal;}#dashboard_recent_drafts h4 abbr{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:11px;color:#999;margin-left:3px;}#dashboard_recent_drafts p{margin:0;padding:0;}.rss-widget ul{margin:0;padding:0;list-style:none;}a.rsswidget{font-size:13px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;line-height:1.7em;}.rss-widget ul li{line-height:1.5em;margin-bottom:12px;}.rss-widget span.rss-date{margin-left:3px;}.rss-widget cite{display:block;text-align:right;margin:0 0 1em;padding:0;}.rss-widget cite:before{content:'\2014';}#dashboard_plugins h4{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}#dashboard_plugins h5{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:13px!important;margin:0;display:inline;line-height:1.4em;}#dashboard_plugins h5 a{font-weight:normal;line-height:1.7em;}#dashboard_plugins p{margin:0 0 1.4em;line-height:1.4em;}.dashboard-comment-wrap{overflow:hidden;word-wrap:break-word;}
\ No newline at end of file
--- /dev/null
+.postbox p, .postbox ul, .postbox ol, .postbox blockquote, #wp-version-message { font-size: 11px; }
+
+.edit-box {
+ display: none;
+}
+
+h3:hover .edit-box {
+ display: inline;
+}
+
+form .input-text-wrap {
+ border-style: solid;
+ border-width: 1px;
+ padding: 2px 3px;
+ border-color: #ccc;
+}
+
+#dashboard-widgets form .input-text-wrap input {
+ border: 0 none;
+ outline: none;
+ margin: 0;
+ padding: 0;
+ width: 99%;
+ color: #333;
+}
+
+form .textarea-wrap {
+ border-style: solid;
+ border-width: 1px;
+ padding: 2px;
+ border-color: #ccc;
+}
+
+#dashboard-widgets form .textarea-wrap textarea {
+ border: 0 none;
+ padding: 0;
+ outline: none;
+ width: 99%;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+#dashboard-widgets .postbox form .submit {
+ float: none;
+ margin: .5em 0 0;
+ padding: 0;
+ border: none;
+}
+
+#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit input {
+ margin: 0;
+}
+
+#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish {
+ min-width: 0;
+}
+
+div.postbox div.inside {
+ margin: 10px;
+ position: relative;
+}
+
+#dashboard-widgets a {
+ text-decoration: none;
+}
+
+#dashboard-widgets h3 a {
+ text-decoration: underline;
+}
+
+#dashboard-widgets h3 .postbox-title-action {
+ position: absolute;
+ right: 30px;
+ padding: 0;
+}
+
+#dashboard-widgets h4 {
+ font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ font-size: 13px;
+ margin: 0 0 .2em;
+ padding: 0;
+}
+
+/* Right Now */
+
+#dashboard_right_now p.sub,
+#dashboard_right_now .table, #dashboard_right_now .versions {
+ margin: -12px;
+}
+
+#dashboard_right_now .inside {
+ font-size: 12px;
+}
+
+#dashboard_right_now p.sub {
+ font-style: italic;
+ font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ padding: 5px 10px 15px;
+ color: #777;
+ font-size: 13px;
+}
+
+#dashboard_right_now .table {
+ background: #f9f9f9;
+ border-top: #ececec 1px solid;
+ border-bottom: #ececec 1px solid;
+ margin: 0 -9px 10px;
+ padding: 0 10px;
+}
+
+#dashboard_right_now table {
+ width: 100%;
+}
+
+#dashboard_right_now table td {
+ border-top: #ececec 1px solid;
+ padding: 3px 0;
+ white-space: nowrap;
+}
+
+#dashboard_right_now table tr.first td {
+ border-top: none;
+}
+
+#dashboard_right_now td.b {
+ padding-right: 6px;
+ text-align: right;
+ font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ font-size: 14px;
+}
+
+#dashboard_right_now td.b a {
+ font-size: 18px;
+}
+
+#dashboard_right_now td.b a:hover {
+ color: #d54e21;
+}
+
+#dashboard_right_now .t {
+ font-size: 12px;
+ padding-right: 12px;
+ padding-top: 6px;
+ color: #777;
+}
+
+#dashboard_right_now .t a {
+ white-space: nowrap;
+}
+
+#dashboard_right_now td.first,
+#dashboard_right_now td.last {
+ width: 1%;
+}
+
+#dashboard_right_now .spam {
+ color: red;
+}
+
+#dashboard_right_now .waiting {
+ color: #e66f00;
+}
+
+#dashboard_right_now .approved {
+ color: green;
+}
+
+#dashboard_right_now .versions {
+ padding: 6px 10px 12px;
+}
+
+#dashboard_right_now .versions .b {
+ font-weight: bold;
+}
+
+#dashboard_right_now a.button {
+ float: right;
+ clear: right;
+ position: relative;
+ top: -5px;
+}
+
+/* Recent Comments */
+
+#dashboard_recent_comments h3 {
+ margin-bottom: 0;
+}
+
+#dashboard_recent_comments .inside {
+ margin-top: 0;
+}
+
+#dashboard_recent_comments .comment-meta .approve {
+ font-style: italic;
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+ font-size: 10px;
+}
+
+#the-comment-list {
+ position: relative;
+}
+
+#the-comment-list .comment-item {
+ padding: 1em 10px;
+ border-top: 1px solid;
+}
+
+#the-comment-list .pingback {
+ padding-left: 9px !important;
+}
+
+#the-comment-list .comment-item,
+#the-comment-list #replyrow {
+ margin: 0 -10px;
+}
+
+#the-comment-list .comment-item:first-child {
+ border-top: none;
+}
+
+#the-comment-list .comment-item .avatar {
+ float: left;
+ margin: 0 10px 5px 0;
+}
+
+#the-comment-list .comment-item h4 {
+ line-height: 1.4;
+ margin-top: -.2em;
+ font-weight: normal;
+ color: #999;
+}
+
+#the-comment-list .comment-item h4 cite {
+ font-style: normal;
+ font-weight: normal;
+}
+
+#the-comment-list .comment-item blockquote,
+#the-comment-list .comment-item blockquote p {
+ margin: 0;
+ padding: 0;
+ display: inline;
+}
+
+#dashboard_recent_comments #the-comment-list .trackback blockquote,
+#dashboard_recent_comments #the-comment-list .pingback blockquote {
+ display: block;
+}
+
+#the-comment-list .comment-item p.row-actions {
+ margin: 3px 0 0;
+ padding: 0;
+ font-size: 10px;
+}
+
+/* QuickPress */
+
+#dashboard_quick_press h4 {
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+ float: left;
+ width: 5.5em;
+ clear: both;
+ font-weight: normal;
+ text-align: right;
+ padding-top: 5px;
+ font-size: 12px;
+}
+
+#dashboard_quick_press h4 label {
+ margin-right: 10px;
+}
+
+#dashboard_quick_press .input-text-wrap,
+#dashboard_quick_press .textarea-wrap {
+ margin: 0 0 1em 5em;
+}
+
+#dashboard_quick_press #media-buttons {
+ margin: 0 0 .5em 5em;
+ padding: 0 0 0 10px;
+ font-size: 11px;
+}
+
+#dashboard_quick_press #media-buttons a {
+ vertical-align: bottom;
+}
+
+#dashboard-widgets #dashboard_quick_press form p.submit {
+ margin-left: 4.6em;
+}
+
+#dashboard-widgets #dashboard_quick_press form p.submit input {
+ float: left;
+}
+
+#dashboard-widgets #dashboard_quick_press form p.submit #save-post {
+ margin: 0 1em 0 10px;
+}
+
+#dashboard-widgets #dashboard_quick_press form p.submit #publish {
+ float: right;
+}
+
+/* Recent Drafts */
+#dashboard_recent_drafts ul {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+#dashboard_recent_drafts ul li {
+ margin-bottom: 0.6em;
+}
+
+#dashboard_recent_drafts h4 {
+ font-weight: normal;
+}
+
+#dashboard_recent_drafts h4 abbr {
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+ font-size: 11px;
+ color: #999;
+ margin-left: 3px;
+}
+
+#dashboard_recent_drafts p {
+ margin: 0;
+ padding: 0;
+}
+
+/* Feeds */
+
+.rss-widget ul {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+a.rsswidget {
+ font-size: 13px;
+ font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ line-height: 1.7em;
+}
+
+.rss-widget ul li {
+ line-height: 1.5em;
+ margin-bottom: 12px;
+}
+
+.rss-widget span.rss-date {
+ margin-left: 3px;
+}
+
+.rss-widget cite {
+ display: block;
+ text-align: right;
+ margin: 0 0 1em;
+ padding: 0;
+}
+
+.rss-widget cite:before {
+ content: '\2014';
+}
+
+/* Plugins */
+
+#dashboard_plugins h4 {
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+}
+
+#dashboard_plugins h5 {
+ font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ font-size: 13px !important;
+ margin: 0;
+ display: inline;
+ line-height: 1.4em;
+}
+
+#dashboard_plugins h5 a {
+ font-weight: normal;
+ line-height: 1.7em;
+}
+
+#dashboard_plugins p {
+ margin: 0 0 1.4em;
+ line-height: 1.4em;
+}
+
+.dashboard-comment-wrap {
+ overflow: hidden;
+ word-wrap: break-word;
+}
+
.screen-reader-text, .screen-reader-text span {
left:auto;
- right:-1000em;
-}
+ text-indent:-1000em;
}
\ No newline at end of file
-/* http://meyerweb.com/eric/tools/css/reset/ */
-/* v1.0 | 20080212 */
-
-html, body, div, span, applet, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, big, cite, code,
-del, dfn, em, font, img, ins, kbd, q, s, samp,
-small, strike, strong, sub, sup, tt, var,
-b, u, i, center,
-dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td {
- margin: 0;
- padding: 0;
- border: 0;
- outline: 0;
-/* font-size: 100%;
- vertical-align: baseline; */
- background: transparent;
-}
-body {
- line-height: 1;
-}
-ol, ul {
- list-style: none;
-}
-blockquote, q {
- quotes: none;
-}
-blockquote:before, blockquote:after,
-q:before, q:after {
- content: '';
- content: none;
-}
-
-/* remember to define focus styles! */
-/*
-:focus {
- outline: 0;
-}
-*/
-/* remember to highlight inserts somehow! */
-ins {
- text-decoration: none;
-}
-del {
- text-decoration: line-through;
-}
-
-/* tables still need 'cellspacing="0"' in the markup */
-/*
-table {
- border-collapse: collapse;
- border-spacing: 0;
-}
-*/
-/* end reset css */
-
-
-/* 2 column liquid layout */
-#wpwrap {
- height: auto;
- min-height: 100%;
- width: 100%;
-}
-
-#wpcontent {
- height: 100%;
- padding-bottom: 50px;
-}
-
-#wpbody {
- clear: both;
- margin-left: 175px;
-}
-
-.folded #wpbody {
- margin-left: 60px;
-}
-
-#wpbody-content {
- float: left;
- width: 100%;
-}
-
-#adminmenu {
- float: left;
- clear: left;
- width: 145px;
- margin-top: 15px;
- margin-right: 5px;
- margin-bottom: 15px;
- margin-left: -160px;
- position: relative;
- padding: 0;
- list-style: none;
-}
-
-.folded #adminmenu {
- margin-left: -45px;
-}
-
-.folded #adminmenu,
-.folded #adminmenu li.menu-top {
- width: 28px;
-}
-
-#footer {
- clear: both;
- position: relative;
- width: 100%;
-}
-
-/* inner 2 column liquid layout */
-.inner-sidebar {
- float: right;
- clear: right;
- display: none;
- width: 281px;
- position: relative;
-}
-
-.inner-sidebar #side-sortables {
- width: 280px;
- min-height: 300px;
-}
-
-.has-right-sidebar .inner-sidebar {
- display: block;
-}
-
-.has-right-sidebar #post-body {
- float: left;
- clear: left;
- width: 100%;
- margin-right: -340px;
-}
-
-.has-right-sidebar #post-body-content {
- margin-right: 300px;
-}
-
-/* 2 columns main area */
-
-#col-container {
- overflow: hidden;
- padding: 0;
- margin: 0;
-}
-
-#col-left {
- padding: 0;
- margin: 0;
- overflow: hidden;
- width: 39%;
-}
-
-#col-right {
- float: right;
- clear: right;
- overflow: hidden;
- padding: 0;
- margin: 0;
- width: 59%;
-}
-
-/* utility classes */
-.alignleft {
- float: left;
-}
-
-.alignright {
- float: right;
-}
-
-.textleft {
- text-align: left;
-}
-
-.textright {
- text-align: right;
-}
-
-.clear {
- clear: both;
-}
-
-/* Hide visually but not from screen readers */
-.screen-reader-text,
-.screen-reader-text span {
- position: absolute;
- left: -1000em;
- height: 1px;
- width: 1px;
- overflow: hidden;
-}
-
-.hidden,
-.js .closed .inside,
-.js .hide-if-js,
-.no-js .hide-if-no-js {
- display: none;
-}
-
-/* include margin and padding in the width calculation of input and textarea */
-input[type="text"],
-input[type="password"],
-textarea {
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- -ms-box-sizing: border-box; /* ie8 only */
- box-sizing: border-box;
-}
-
-input[type="checkbox"],
-input[type="radio"] {
- vertical-align: middle;
-}
-
-/* styles for use by people extending the WordPress interface */
-html,
-body {
- height: 100%;
-}
-
-body,
-td,
-textarea,
-input,
-select {
- font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
- font-size: 13px;
-}
-
-body,
-textarea {
- line-height: 1.4em;
-}
-
-input,
-select {
- line-height: 1em;
-}
-
-p {
- margin: 1em 0;
-}
-
-blockquote {
- margin: 1em;
-}
-
-label {
- cursor: pointer;
-}
-
-li,
-dd {
- margin-bottom: 6px;
-}
-
-p,
-li,
-dl,
-dd,
-dt {
- line-height: 140%;
-}
-
-textarea,
-input,
-select {
- margin: 1px;
- padding: 3px;
-}
-
-h1 {
- display: block;
- font-size: 2em;
- font-weight: bold;
- margin: .67em 0;
-}
-
-h2 {
- display: block;
- font-size: 1.5em;
- font-weight: bold;
- margin: .83em 0;
-}
-
-h3 {
- display: block;
- font-size: 1.17em;
- font-weight: bold;
- margin: 1em 0;
-}
-
-h4 {
- display: block;
- font-size: 1em;
- font-weight: bold;
- margin: 1.33em 0;
-}
-
-h5 {
- display: block;
- font-size: 0.83em;
- font-weight: bold;
- margin: 1.67em 0;
-}
-
-h6 {
- display: block;
- font-size: 0.67em;
- font-weight: bold;
- margin: 2.33em 0;
-}
-
-ul.ul-disc {
- list-style: disc outside;
-}
-
-ul.ul-square {
- list-style: square outside;
-}
-
-ol.ol-decimal {
- list-style: decimal outside;
-}
-
-ul.ul-disc,
-ul.ul-square,
-ol.ol-decimal {
- margin-left: 1.8em;
-}
-
-ul.ul-disc > li,
-ul.ul-square > li,
-ol.ol-decimal > li {
- margin: 0 0 0.5em;
-}
-
-.subsubsub {
- list-style: none;
- margin: 8px 0 5px;
- padding: 0;
- white-space: nowrap;
- font-size: 11px;
- float: left;
-}
-
-.subsubsub a {
- line-height: 2;
- padding: .2em;
- text-decoration: none;
-}
-
-.subsubsub a .count, .subsubsub a.current .count {
- color: #999;
- font-weight: normal;
-}
-
-.subsubsub a.current {
- font-weight: bold;
- background: none;
- border: none;
-}
-
-.subsubsub li {
- display: inline;
- margin: 0;
- padding: 0;
-}
-
-.widefat {
- border-width: 1px;
- border-style: solid;
- border-spacing: 0;
- width: 100%;
- clear: both;
- margin: 0;
- -moz-border-radius: 4px;
- -khtml-border-radius: 4px;
- -webkit-border-radius: 4px;
- border-radius: 4px;
-}
-
-.widefat * {
- word-wrap: break-word;
-}
-
-.widefat a {
- text-decoration: none;
-}
-
-.widefat td,
-.widefat th {
- border-bottom-width: 1px;
- border-bottom-style: solid;
- font-size: 11px;
- vertical-align: text-top;
-}
-
-.widefat td {
- padding: 3px 7px;
- vertical-align: top;
-}
-
-.widefat td p,
-.widefat td ol,
-.widefat td ul {
- font-size: 11px;
-}
-
-.widefat th {
- padding: 7px 7px 8px;
- text-align: left;
- line-height: 1.3em;
-}
-
-.widefat th input {
- margin: 0 0 0 8px;
- padding: 0;
- vertical-align: text-top;
-}
-
-.widefat .check-column {
- width: 2.2em;
- padding: 0;
-
-}
-
-.widefat tbody th.check-column {
- padding: 7px 0 22px;
-}
-
-.widefat .num,
-.column-comments,
-.column-links,
-.column-posts,
-.column-parent {
- text-align: center;
-}
-
-.widefat th#comments {
- vertical-align: middle;
-}
-
-.wrap {
- margin: 0 15px 0 5px;
-}
-
-.updated,
-.error {
- border-width: 1px;
- border-style: solid;
- padding: 0 0.6em;
- margin: 5px 15px 2px;
- -moz-border-radius: 3px;
- -khtml-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-.updated p,
-.error p {
- margin: 0.5em 0;
- line-height: 1;
- padding: 2px;
-}
-
-.wrap .updated,
-.wrap .error {
- margin: 5px 0 15px;
-}
-
-.wrap h2 {
- font: italic normal normal 24px/29px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
- margin: 0;
- padding: 14px 15px 3px 0;
- line-height: 35px;
- text-shadow: rgba(255,255,255,1) 0px 1px 0px;
-}
-
-.wrap h2.long-header {
- padding-right: 0;
-}
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;background:transparent;}body{line-height:1;}ol,ul{list-style:none;}blockquote,q{quotes:none;}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;}ins{text-decoration:none;}del{text-decoration:line-through;}#wpwrap{height:auto;min-height:100%;width:100%;}#wpcontent{height:100%;padding-bottom:50px;}#wpbody{clear:both;margin-left:175px;}.folded #wpbody{margin-left:60px;}#wpbody-content{float:left;width:100%;}#adminmenu{float:left;clear:left;width:145px;margin-top:15px;margin-right:5px;margin-bottom:15px;margin-left:-160px;position:relative;padding:0;list-style:none;}.folded #adminmenu{margin-left:-45px;}.folded #adminmenu,.folded #adminmenu li.menu-top{width:28px;}#footer{clear:both;position:relative;width:100%;}.inner-sidebar{float:right;clear:right;display:none;width:281px;position:relative;}.inner-sidebar #side-sortables{width:280px;min-height:300px;}.has-right-sidebar .inner-sidebar{display:block;}.has-right-sidebar #post-body{float:left;clear:left;width:100%;margin-right:-340px;}.has-right-sidebar #post-body-content{margin-right:300px;}#col-container{overflow:hidden;padding:0;margin:0;}#col-left{padding:0;margin:0;overflow:hidden;width:39%;}#col-right{float:right;clear:right;overflow:hidden;padding:0;margin:0;width:59%;}.alignleft{float:left;}.alignright{float:right;}.textleft{text-align:left;}.textright{text-align:right;}.clear{clear:both;}.screen-reader-text,.screen-reader-text span{position:absolute;left:-1000em;height:1px;width:1px;overflow:hidden;}.hidden,.js .closed .inside,.js .hide-if-js,.no-js .hide-if-no-js{display:none;}input[type="text"],input[type="password"],textarea{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}input[type="checkbox"],input[type="radio"]{vertical-align:middle;}html,body{height:100%;}body,td,textarea,input,select{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:13px;}body,textarea{line-height:1.4em;}input,select{line-height:1em;}p{margin:1em 0;}blockquote{margin:1em;}label{cursor:pointer;}li,dd{margin-bottom:6px;}p,li,dl,dd,dt{line-height:140%;}textarea,input,select{margin:1px;padding:3px;}h1{display:block;font-size:2em;font-weight:bold;margin:.67em 0;}h2{display:block;font-size:1.5em;font-weight:bold;margin:.83em 0;}h3{display:block;font-size:1.17em;font-weight:bold;margin:1em 0;}h4{display:block;font-size:1em;font-weight:bold;margin:1.33em 0;}h5{display:block;font-size:.83em;font-weight:bold;margin:1.67em 0;}h6{display:block;font-size:.67em;font-weight:bold;margin:2.33em 0;}ul.ul-disc{list-style:disc outside;}ul.ul-square{list-style:square outside;}ol.ol-decimal{list-style:decimal outside;}ul.ul-disc,ul.ul-square,ol.ol-decimal{margin-left:1.8em;}ul.ul-disc>li,ul.ul-square>li,ol.ol-decimal>li{margin:0 0 .5em;}.subsubsub{list-style:none;margin:8px 0 5px;padding:0;white-space:nowrap;font-size:11px;float:left;}.subsubsub a{line-height:2;padding:.2em;text-decoration:none;}.subsubsub a .count,.subsubsub a.current .count{color:#999;font-weight:normal;}.subsubsub a.current{font-weight:bold;background:none;border:none;}.subsubsub li{display:inline;margin:0;padding:0;}.widefat{border-width:1px;border-style:solid;border-spacing:0;width:100%;clear:both;margin:0;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}.widefat *{word-wrap:break-word;}.widefat a{text-decoration:none;}.widefat td,.widefat th{border-bottom-width:1px;border-bottom-style:solid;font-size:11px;}.widefat td{padding:3px 7px;vertical-align:top;}.widefat td p,.widefat td ol,.widefat td ul{font-size:11px;}.widefat th{padding:7px 7px 8px;text-align:left;line-height:1.3em;}.widefat th input{margin:0 0 0 8px;padding:0;vertical-align:text-top;}.widefat .check-column{width:2.2em;padding:0;}.widefat tbody th.check-column{padding:7px 0 22px;}.widefat .num,.column-comments,.column-links,.column-posts{text-align:center;}.widefat th#comments{vertical-align:middle;}.wrap{margin:0 15px 0 5px;}.updated,.error{border-width:1px;border-style:solid;padding:0 .6em;margin:5px 15px 2px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.updated p,.error p{margin:.5em 0;line-height:1;padding:2px;}.wrap .updated,.wrap .error{margin:5px 0 15px;}.wrap h2{font:italic normal normal 24px/29px Georgia,"Times New Roman","Bitstream Charter",Times,serif;margin:0;padding:14px 15px 3px 0;line-height:35px;text-shadow:rgba(255,255,255,1) 0 1px 0;}.wrap h2.long-header{padding-right:0;}
\ No newline at end of file
--- /dev/null
+/* http://meyerweb.com/eric/tools/css/reset/ */
+/* v1.0 | 20080212 */
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, font, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+/* font-size: 100%;
+ vertical-align: baseline; */
+ background: transparent;
+}
+body {
+ line-height: 1;
+}
+ol, ul {
+ list-style: none;
+}
+blockquote, q {
+ quotes: none;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: '';
+ content: none;
+}
+
+/* remember to define focus styles! */
+/*
+:focus {
+ outline: 0;
+}
+*/
+/* remember to highlight inserts somehow! */
+ins {
+ text-decoration: none;
+}
+del {
+ text-decoration: line-through;
+}
+
+/* tables still need 'cellspacing="0"' in the markup */
+/*
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+*/
+/* end reset css */
+
+
+/* 2 column liquid layout */
+#wpwrap {
+ height: auto;
+ min-height: 100%;
+ width: 100%;
+}
+
+#wpcontent {
+ height: 100%;
+ padding-bottom: 50px;
+}
+
+#wpbody {
+ clear: both;
+ margin-left: 175px;
+}
+
+.folded #wpbody {
+ margin-left: 60px;
+}
+
+#wpbody-content {
+ float: left;
+ width: 100%;
+}
+
+#adminmenu {
+ float: left;
+ clear: left;
+ width: 145px;
+ margin-top: 15px;
+ margin-right: 5px;
+ margin-bottom: 15px;
+ margin-left: -160px;
+ position: relative;
+ padding: 0;
+ list-style: none;
+}
+
+.folded #adminmenu {
+ margin-left: -45px;
+}
+
+.folded #adminmenu,
+.folded #adminmenu li.menu-top {
+ width: 28px;
+}
+
+#footer {
+ clear: both;
+ position: relative;
+ width: 100%;
+}
+
+/* inner 2 column liquid layout */
+.inner-sidebar {
+ float: right;
+ clear: right;
+ display: none;
+ width: 281px;
+ position: relative;
+}
+
+.inner-sidebar #side-sortables {
+ width: 280px;
+ min-height: 300px;
+}
+
+.has-right-sidebar .inner-sidebar {
+ display: block;
+}
+
+.has-right-sidebar #post-body {
+ float: left;
+ clear: left;
+ width: 100%;
+ margin-right: -340px;
+}
+
+.has-right-sidebar #post-body-content {
+ margin-right: 300px;
+}
+
+/* 2 columns main area */
+
+#col-container {
+ overflow: hidden;
+ padding: 0;
+ margin: 0;
+}
+
+#col-left {
+ padding: 0;
+ margin: 0;
+ overflow: hidden;
+ width: 39%;
+}
+
+#col-right {
+ float: right;
+ clear: right;
+ overflow: hidden;
+ padding: 0;
+ margin: 0;
+ width: 59%;
+}
+
+/* utility classes */
+.alignleft {
+ float: left;
+}
+
+.alignright {
+ float: right;
+}
+
+.textleft {
+ text-align: left;
+}
+
+.textright {
+ text-align: right;
+}
+
+.clear {
+ clear: both;
+}
+
+/* Hide visually but not from screen readers */
+.screen-reader-text,
+.screen-reader-text span {
+ position: absolute;
+ left: -1000em;
+ height: 1px;
+ width: 1px;
+ overflow: hidden;
+}
+
+.hidden,
+.js .closed .inside,
+.js .hide-if-js,
+.no-js .hide-if-no-js {
+ display: none;
+}
+
+/* include margin and padding in the width calculation of input and textarea */
+input[type="text"],
+input[type="password"],
+textarea {
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ -ms-box-sizing: border-box; /* ie8 only */
+ box-sizing: border-box;
+}
+
+input[type="checkbox"],
+input[type="radio"] {
+ vertical-align: middle;
+}
+
+/* styles for use by people extending the WordPress interface */
+html,
+body {
+ height: 100%;
+}
+
+body,
+td,
+textarea,
+input,
+select {
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+ font-size: 13px;
+}
+
+body,
+textarea {
+ line-height: 1.4em;
+}
+
+input,
+select {
+ line-height: 1em;
+}
+
+p {
+ margin: 1em 0;
+}
+
+blockquote {
+ margin: 1em;
+}
+
+label {
+ cursor: pointer;
+}
+
+li,
+dd {
+ margin-bottom: 6px;
+}
+
+p,
+li,
+dl,
+dd,
+dt {
+ line-height: 140%;
+}
+
+textarea,
+input,
+select {
+ margin: 1px;
+ padding: 3px;
+}
+
+h1 {
+ display: block;
+ font-size: 2em;
+ font-weight: bold;
+ margin: .67em 0;
+}
+
+h2 {
+ display: block;
+ font-size: 1.5em;
+ font-weight: bold;
+ margin: .83em 0;
+}
+
+h3 {
+ display: block;
+ font-size: 1.17em;
+ font-weight: bold;
+ margin: 1em 0;
+}
+
+h4 {
+ display: block;
+ font-size: 1em;
+ font-weight: bold;
+ margin: 1.33em 0;
+}
+
+h5 {
+ display: block;
+ font-size: 0.83em;
+ font-weight: bold;
+ margin: 1.67em 0;
+}
+
+h6 {
+ display: block;
+ font-size: 0.67em;
+ font-weight: bold;
+ margin: 2.33em 0;
+}
+
+ul.ul-disc {
+ list-style: disc outside;
+}
+
+ul.ul-square {
+ list-style: square outside;
+}
+
+ol.ol-decimal {
+ list-style: decimal outside;
+}
+
+ul.ul-disc,
+ul.ul-square,
+ol.ol-decimal {
+ margin-left: 1.8em;
+}
+
+ul.ul-disc > li,
+ul.ul-square > li,
+ol.ol-decimal > li {
+ margin: 0 0 0.5em;
+}
+
+.subsubsub {
+ list-style: none;
+ margin: 8px 0 5px;
+ padding: 0;
+ white-space: nowrap;
+ font-size: 11px;
+ float: left;
+}
+
+.subsubsub a {
+ line-height: 2;
+ padding: .2em;
+ text-decoration: none;
+}
+
+.subsubsub a .count, .subsubsub a.current .count {
+ color: #999;
+ font-weight: normal;
+}
+
+.subsubsub a.current {
+ font-weight: bold;
+ background: none;
+ border: none;
+}
+
+.subsubsub li {
+ display: inline;
+ margin: 0;
+ padding: 0;
+}
+
+.widefat {
+ border-width: 1px;
+ border-style: solid;
+ border-spacing: 0;
+ width: 100%;
+ clear: both;
+ margin: 0;
+ -moz-border-radius: 4px;
+ -khtml-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ border-radius: 4px;
+}
+
+.widefat * {
+ word-wrap: break-word;
+}
+
+.widefat a {
+ text-decoration: none;
+}
+
+.widefat td,
+.widefat th {
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+ font-size: 11px;
+}
+
+.widefat td {
+ padding: 3px 7px;
+ vertical-align: top;
+}
+
+.widefat td p,
+.widefat td ol,
+.widefat td ul {
+ font-size: 11px;
+}
+
+.widefat th {
+ padding: 7px 7px 8px;
+ text-align: left;
+ line-height: 1.3em;
+}
+
+.widefat th input {
+ margin: 0 0 0 8px;
+ padding: 0;
+ vertical-align: text-top;
+}
+
+.widefat .check-column {
+ width: 2.2em;
+ padding: 0;
+
+}
+
+.widefat tbody th.check-column {
+ padding: 7px 0 22px;
+}
+
+.widefat .num,
+.column-comments,
+.column-links,
+.column-posts {
+ text-align: center;
+}
+
+.widefat th#comments {
+ vertical-align: middle;
+}
+
+.wrap {
+ margin: 0 15px 0 5px;
+}
+
+.updated,
+.error {
+ border-width: 1px;
+ border-style: solid;
+ padding: 0 0.6em;
+ margin: 5px 15px 2px;
+ -moz-border-radius: 3px;
+ -khtml-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+}
+
+.updated p,
+.error p {
+ margin: 0.5em 0;
+ line-height: 1;
+ padding: 2px;
+}
+
+.wrap .updated,
+.wrap .error {
+ margin: 5px 0 15px;
+}
+
+.wrap h2 {
+ font: italic normal normal 24px/29px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ margin: 0;
+ padding: 14px 15px 3px 0;
+ line-height: 35px;
+ text-shadow: rgba(255,255,255,1) 0px 1px 0px;
+}
+
+.wrap h2.long-header {
+ padding-right: 0;
+}
form#widgets-filter { /* fix widget page */
position: static;
}
+
+* html .meta-box-sortables .postbox .handlediv {
+ background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -111px;
+}
margin-bottom: -1px;
}
+* html .meta-box-sortables .postbox .handlediv {
+ background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;
+}
+
+* html .edit-box {
+ display: inline;
+}
+
* html .inner-sidebar #side-sortables,
* html .postbox-container .meta-box-sortables {
height: 300px;
margin-top: 2px;
}
+.tablenav .actions select {
+ width: 155px;
+}
+
table.ie-fixed {
table-layout: fixed;
}
position: relative;
}
+* html .media-item .pinkynail {
+ height: 32px;
+ width: 40px;
+}
+
+#wpcontent .button-primary-disabled {
+ color: #9FD0D5;
+ background: #298CBA;
+}
+
+#wpcontent #ajax-loading {
+ vertical-align: baseline;
+}
+
+* html .describe .field input.text,
+* html .describe .field textarea {
+ width: 440px;
+}
+
+#the-comment-list .unapproved tr,
+#the-comment-list .unapproved td {
+ background-color: #ffffe0;
+}
+
+.imgedit-submit {
+ width: 300px;
+}
+
+* html input {
+ border: 1px solid #dfdfdf;
+}
-html { background: #f7f7f7; }
-
-body {
- background: #fff;
- color: #333;
- font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
- margin: 2em auto 0 auto;
- width: 700px;
- padding: 1em 2em;
- -moz-border-radius: 11px;
- -khtml-border-radius: 11px;
- -webkit-border-radius: 11px;
- border-radius: 11px;
- border: 1px solid #dfdfdf;
-}
-
-a { color: #2583ad; text-decoration: none; }
-
-a:hover { color: #d54e21; }
-
-h1 {
- border-bottom: 1px solid #dadada;
- clear: both;
- color: #666;
- font: 24px Georgia, "Times New Roman", Times, serif;
- margin: 5px 0 0 -4px;
- padding: 0;
- padding-bottom: 7px;
-}
-
-h2 { font-size: 16px; }
-
-p, li {
- padding-bottom: 2px;
- font-size: 12px;
- line-height: 18px;
-}
-
-code { font-size: 13px; }
-
-ul, ol { padding: 5px 5px 5px 22px; }
-
-#logo { margin: 6px 0 14px 0; border-bottom: none;}
-
-.step {
- margin: 20px 0 15px;
-}
-
-.step, th { text-align: left; padding: 0; }
-
-.submit input, .button, .button-secondary {
- font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
- text-decoration: none;
- font-size: 14px !important;
- line-height: 16px;
- padding: 6px 12px;
- cursor: pointer;
- border: 1px solid #bbb;
- color: #464646;
- -moz-border-radius: 15px;
- -khtml-border-radius: 15px;
- -webkit-border-radius: 15px;
- border-radius: 15px;
- -moz-box-sizing: content-box;
- -webkit-box-sizing: content-box;
- -khtml-box-sizing: content-box;
- box-sizing: content-box;
-}
-
-.button:hover, .button-secondary:hover, .submit input:hover {
- color: #000;
- border-color: #666;
-}
-
-.button, .submit input, .button-secondary {
- background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
-}
-
-.button:active, .submit input:active, .button-secondary:active {
- background: #eee url(../images/white-grad-active.png) repeat-x scroll left top;
-}
-
-.form-table {
- border-collapse: collapse;
- margin-top: 1em;
- width: 100%;
-}
-
-.form-table td {
- margin-bottom: 9px;
- padding: 10px;
- border-bottom: 8px solid #fff;
- font-size: 12px;
-}
-
-.form-table th {
- font-size: 13px;
- text-align: left;
- padding: 16px 10px 10px 10px;
- border-bottom: 8px solid #fff;
- width: 110px;
- vertical-align: top;
-}
-
-.form-table tr {
- background: #f3f3f3;
-}
-
-.form-table code {
- line-height: 18px;
- font-size: 18px;
-}
-
-.form-table p {
- margin: 4px 0 0 0;
- font-size: 11px;
-}
-
-.form-table input {
- line-height: 20px;
- font-size: 15px;
- padding: 2px;
-}
-
-#error-page { margin-top: 50px; }
-
-#error-page p {
- font-size: 12px;
- line-height: 18px;
- margin: 25px 0 20px;
-}
-
-#error-page code { font-family: Consolas, Monaco, Courier, monospace; }
+html{background:#f7f7f7;}body{background:#fff;color:#333;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;margin:2em auto 0 auto;width:700px;padding:1em 2em;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;border:1px solid #dfdfdf;}a{color:#2583ad;text-decoration:none;}a:hover{color:#d54e21;}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px Georgia,"Times New Roman",Times,serif;margin:5px 0 0 -4px;padding:0;padding-bottom:7px;}h2{font-size:16px;}p,li{padding-bottom:2px;font-size:12px;line-height:18px;}code{font-size:13px;}ul,ol{padding:5px 5px 5px 22px;}#logo{margin:6px 0 14px 0;border-bottom:none;}.step{margin:20px 0 15px;}.step,th{text-align:left;padding:0;}.submit input,.button,.button-secondary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;text-decoration:none;font-size:14px!important;line-height:16px;padding:6px 12px;cursor:pointer;border:1px solid #bbb;color:#464646;-moz-border-radius:15px;-khtml-border-radius:15px;-webkit-border-radius:15px;border-radius:15px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-khtml-box-sizing:content-box;box-sizing:content-box;}.button:hover,.button-secondary:hover,.submit input:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}.form-table{border-collapse:collapse;margin-top:1em;width:100%;}.form-table td{margin-bottom:9px;padding:10px;border-bottom:8px solid #fff;font-size:12px;}.form-table th{font-size:13px;text-align:left;padding:16px 10px 10px 10px;border-bottom:8px solid #fff;width:110px;vertical-align:top;}.form-table tr{background:#f3f3f3;}.form-table code{line-height:18px;font-size:18px;}.form-table p{margin:4px 0 0 0;font-size:11px;}.form-table input{line-height:20px;font-size:15px;padding:2px;}#error-page{margin-top:50px;}#error-page p{font-size:12px;line-height:18px;margin:25px 0 20px;}#error-page code{font-family:Consolas,Monaco,Courier,monospace;}
\ No newline at end of file
--- /dev/null
+html { background: #f7f7f7; }
+
+body {
+ background: #fff;
+ color: #333;
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+ margin: 2em auto 0 auto;
+ width: 700px;
+ padding: 1em 2em;
+ -moz-border-radius: 11px;
+ -khtml-border-radius: 11px;
+ -webkit-border-radius: 11px;
+ border-radius: 11px;
+ border: 1px solid #dfdfdf;
+}
+
+a { color: #2583ad; text-decoration: none; }
+
+a:hover { color: #d54e21; }
+
+h1 {
+ border-bottom: 1px solid #dadada;
+ clear: both;
+ color: #666;
+ font: 24px Georgia, "Times New Roman", Times, serif;
+ margin: 5px 0 0 -4px;
+ padding: 0;
+ padding-bottom: 7px;
+}
+
+h2 { font-size: 16px; }
+
+p, li {
+ padding-bottom: 2px;
+ font-size: 12px;
+ line-height: 18px;
+}
+
+code { font-size: 13px; }
+
+ul, ol { padding: 5px 5px 5px 22px; }
+
+#logo { margin: 6px 0 14px 0; border-bottom: none;}
+
+.step {
+ margin: 20px 0 15px;
+}
+
+.step, th { text-align: left; padding: 0; }
+
+.submit input, .button, .button-secondary {
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+ text-decoration: none;
+ font-size: 14px !important;
+ line-height: 16px;
+ padding: 6px 12px;
+ cursor: pointer;
+ border: 1px solid #bbb;
+ color: #464646;
+ -moz-border-radius: 15px;
+ -khtml-border-radius: 15px;
+ -webkit-border-radius: 15px;
+ border-radius: 15px;
+ -moz-box-sizing: content-box;
+ -webkit-box-sizing: content-box;
+ -khtml-box-sizing: content-box;
+ box-sizing: content-box;
+}
+
+.button:hover, .button-secondary:hover, .submit input:hover {
+ color: #000;
+ border-color: #666;
+}
+
+.button, .submit input, .button-secondary {
+ background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
+}
+
+.button:active, .submit input:active, .button-secondary:active {
+ background: #eee url(../images/white-grad-active.png) repeat-x scroll left top;
+}
+
+.form-table {
+ border-collapse: collapse;
+ margin-top: 1em;
+ width: 100%;
+}
+
+.form-table td {
+ margin-bottom: 9px;
+ padding: 10px;
+ border-bottom: 8px solid #fff;
+ font-size: 12px;
+}
+
+.form-table th {
+ font-size: 13px;
+ text-align: left;
+ padding: 16px 10px 10px 10px;
+ border-bottom: 8px solid #fff;
+ width: 110px;
+ vertical-align: top;
+}
+
+.form-table tr {
+ background: #f3f3f3;
+}
+
+.form-table code {
+ line-height: 18px;
+ font-size: 18px;
+}
+
+.form-table p {
+ margin: 4px 0 0 0;
+ font-size: 11px;
+}
+
+.form-table input {
+ line-height: 20px;
+ font-size: 15px;
+ padding: 2px;
+}
+
+#error-page { margin-top: 50px; }
+
+#error-page p {
+ font-size: 12px;
+ line-height: 18px;
+ margin: 25px 0 20px;
+}
+
+#error-page code { font-family: Consolas, Monaco, Courier, monospace; }
-* { margin: 0; padding: 0; }
-
-body {
- border-top-width: 30px;
- border-top-style: solid;
- font: 11px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
-}
-
-form {
- margin-left: 8px;
- padding: 16px 16px 40px 16px;
- font-weight: normal;
- -moz-border-radius: 11px;
- -khtml-border-radius: 11px;
- -webkit-border-radius: 11px;
- border-radius: 5px;
- background: #fff;
- border: 1px solid #e5e5e5;
- -moz-box-shadow: rgba(200,200,200,1) 0 4px 18px;
- -webkit-box-shadow: rgba(200,200,200,1) 0 4px 18px;
- -khtml-box-shadow: rgba(200,200,200,1) 0 4px 18px;
- box-shadow: rgba(200,200,200,1) 0 4px 18px;
-}
-
-form .forgetmenot { font-weight: normal; float: left; margin-bottom: 0; }
-
-#login form .submit input {
- font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
- padding: 3px 10px;
- border: none;
- font-size: 12px;
- border-width: 1px;
- border-style: solid;
- -moz-border-radius: 11px;
- -khtml-border-radius: 11px;
- -webkit-border-radius: 11px;
- border-radius: 11px;
- cursor: pointer;
- text-decoration: none;
- margin-top: -3px;
- text-shadow: rgba(0,0,0,0.3) 0 -1px 0;
-}
-
-#login form p {
- margin-bottom: 0;
-}
-
-label {
- color: #777;
- font-size: 13px;
-}
-
-form .forgetmenot label {
- font-size: 11px;
- line-height: 19px;
-}
-
-form .submit { float: right; }
-
-form p { margin-bottom: 24px; }
-
-h1 a {
- background: url(../images/logo-login.gif) no-repeat top center;
- width: 326px;
- height: 67px;
- text-indent: -9999px;
- overflow: hidden;
- padding-bottom: 15px;
- display: block;
-}
-
-#nav {
- text-shadow: rgba(255,255,255,1) 0 1px 0;
-}
-
-#backtoblog a {
- position: absolute;
- top: 7px;
- left: 15px;
- text-decoration: none;
-}
-
-#login { width: 320px; margin: 7em auto; }
-
-#login_error, .message {
- margin: 0 0 16px 8px;
- border-width: 1px;
- border-style: solid;
- padding: 12px;
- -moz-border-radius: 3px;
- -khtml-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-#nav { margin: 0 0 0 8px; padding: 16px; }
-
-#user_pass, #user_login, #user_email {
- font-size: 24px;
- width: 97%;
- padding: 3px;
- margin-top: 2px;
- margin-right: 6px;
- margin-bottom: 16px;
- border: 1px solid #e5e5e5;
- background: #fbfbfb;
-}
-
-.clear {
- clear: both;
-}
+*{margin:0;padding:0;}body{border-top-width:30px;border-top-style:solid;font:11px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}form{margin-left:8px;padding:16px 16px 40px 16px;font-weight:normal;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:5px;background:#fff;border:1px solid #e5e5e5;-moz-box-shadow:rgba(200,200,200,1) 0 4px 18px;-webkit-box-shadow:rgba(200,200,200,1) 0 4px 18px;-khtml-box-shadow:rgba(200,200,200,1) 0 4px 18px;box-shadow:rgba(200,200,200,1) 0 4px 18px;}form .forgetmenot{font-weight:normal;float:left;margin-bottom:0;}.button-primary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;padding:3px 10px;border:none;font-size:12px;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;cursor:pointer;text-decoration:none;margin-top:-3px;}#login form p{margin-bottom:0;}label{color:#777;font-size:13px;}form .forgetmenot label{font-size:11px;line-height:19px;}form .submit,.alignright{float:right;}form p{margin-bottom:24px;}h1 a{background:url(../images/logo-login.gif) no-repeat top center;width:326px;height:67px;text-indent:-9999px;overflow:hidden;padding-bottom:15px;display:block;}#nav{text-shadow:rgba(255,255,255,1) 0 1px 0;}#backtoblog a{position:absolute;top:7px;left:15px;text-decoration:none;}#login{width:320px;margin:7em auto;}#login_error,.message{margin:0 0 16px 8px;border-width:1px;border-style:solid;padding:12px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}#nav{margin:0 0 0 8px;padding:16px;}#user_pass,#user_login,#user_email{font-size:24px;width:97%;padding:3px;margin-top:2px;margin-right:6px;margin-bottom:16px;border:1px solid #e5e5e5;background:#fbfbfb;}input{color:#555;}.clear{clear:both;}
\ No newline at end of file
--- /dev/null
+* { margin: 0; padding: 0; }
+
+body {
+ border-top-width: 30px;
+ border-top-style: solid;
+ font: 11px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+}
+
+form {
+ margin-left: 8px;
+ padding: 16px 16px 40px 16px;
+ font-weight: normal;
+ -moz-border-radius: 11px;
+ -khtml-border-radius: 11px;
+ -webkit-border-radius: 11px;
+ border-radius: 5px;
+ background: #fff;
+ border: 1px solid #e5e5e5;
+ -moz-box-shadow: rgba(200,200,200,1) 0 4px 18px;
+ -webkit-box-shadow: rgba(200,200,200,1) 0 4px 18px;
+ -khtml-box-shadow: rgba(200,200,200,1) 0 4px 18px;
+ box-shadow: rgba(200,200,200,1) 0 4px 18px;
+}
+
+form .forgetmenot {
+ font-weight: normal;
+ float: left;
+ margin-bottom: 0;
+}
+
+.button-primary {
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+ padding: 3px 10px;
+ border: none;
+ font-size: 12px;
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 11px;
+ -khtml-border-radius: 11px;
+ -webkit-border-radius: 11px;
+ border-radius: 11px;
+ cursor: pointer;
+ text-decoration: none;
+ margin-top: -3px;
+}
+
+#login form p {
+ margin-bottom: 0;
+}
+
+label {
+ color: #777;
+ font-size: 13px;
+}
+
+form .forgetmenot label {
+ font-size: 11px;
+ line-height: 19px;
+}
+
+form .submit,
+.alignright {
+ float: right;
+}
+
+form p {
+ margin-bottom: 24px;
+}
+
+h1 a {
+ background: url(../images/logo-login.gif) no-repeat top center;
+ width: 326px;
+ height: 67px;
+ text-indent: -9999px;
+ overflow: hidden;
+ padding-bottom: 15px;
+ display: block;
+}
+
+#nav {
+ text-shadow: rgba(255,255,255,1) 0 1px 0;
+}
+
+#backtoblog a {
+ position: absolute;
+ top: 7px;
+ left: 15px;
+ text-decoration: none;
+}
+
+#login { width: 320px; margin: 7em auto; }
+
+#login_error,
+.message {
+ margin: 0 0 16px 8px;
+ border-width: 1px;
+ border-style: solid;
+ padding: 12px;
+ -moz-border-radius: 3px;
+ -khtml-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+}
+
+#nav {
+ margin: 0 0 0 8px;
+ padding: 16px;
+}
+
+#user_pass,
+#user_login,
+#user_email {
+ font-size: 24px;
+ width: 97%;
+ padding: 3px;
+ margin-top: 2px;
+ margin-right: 6px;
+ margin-bottom: 16px;
+ border: 1px solid #e5e5e5;
+ background: #fbfbfb;
+}
+
+input {
+ color: #555;
+}
+
+.clear {
+ clear: both;
+}
border-right-style: none;
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;
-div#media-upload-header {
- margin: 0;
- padding: 0 5px;
- font-weight: bold;
- position: relative;
- border-bottom-width: 1px;
- border-bottom-style: solid;
- height: 2.5em;
-}
-
-body#media-upload ul#sidemenu {
- font-weight: normal;
- margin: 0 5px;
- position: absolute;
- left: 0px;
- bottom: -1px;
-}
-
-div#media-upload-error {
- margin: 1em;
- font-weight: bold;
-}
-
-form {
- margin: 1em;
-}
-
-#search-filter {
- text-align: right;
-}
-
-.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;
-}
-
-th {
- position: relative;
-}
-
-.media-upload-form label.form-help, td.help {
- font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
- font-style: italic;
- font-weight: normal;
-}
-
-.media-upload-form p.help {
- margin: 0;
- padding: 0;
-}
-
-.media-upload-form fieldset {
- width: 100%;
- border: none;
- text-align: justify;
- margin: 0 0 1em 0;
- padding: 0;
-}
-
-/* specific to the image upload form */
-.align .field label {
- display: inline;
- padding: 0 0 0 28px;
- margin: 0 1em 0 0;
-}
-
-.image-align-none-label {
- background: url(../images/align-none.png) no-repeat center left;
-}
-
-.image-align-left-label {
- background: url(../images/align-left.png) no-repeat center left;
-}
-
-.image-align-center-label {
- background: url(../images/align-center.png) no-repeat center left;
-}
-
-.image-align-right-label {
- background: url(../images/align-right.png) no-repeat center left;
-}
-
-tr.image-size td {
- width: 460px;
-}
-
-tr.image-size div.image-size-item {
- float: left;
- width: 25%;
- margin: 0;
-}
-
-tr.image-size label {
- display: inline;
- margin: 0 0 0 1em;
-}
-
-.pinkynail {
- max-width: 40px;
- max-height: 40px;
-}
-
-#library-form .progress,
-#gallery-form .progress,
-#flash-upload-ui,
-.insert-gallery,
-.describe.startopen,
-.describe.startclosed {
- display: none;
-}
-
-.media-item .thumbnail {
- max-width: 128px;
- max-height: 128px;
-}
-
-.media-item .pinkynail {
- float: left;
- margin: 2px;
- height: 32px;
- max-width: 40px;
-}
-
-thead.media-item-info tr {
- background-color: transparent;
-}
-
-thead.media-item-info th,
-thead.media-item-info td {
- border: none;
- margin: 0;
-}
-
-.form-table thead.media-item-info {
- border: 8px solid #fff;
-}
-
-abbr.required {
- text-decoration: none;
- border: none;
-}
-
-.describe label {
- display: inline;
-}
-
-.describe td {
- vertical-align: middle;
- padding: 0 5px 0 0;
-}
-
-.describe td.A1 {
- width: 132px;
-}
-
-.describe input[type="text"],
-.describe textarea {
- width: 460px;
- border-width: 1px;
- border-style: solid;
-}
-
-.describe-toggle-on,
-.describe-toggle-off {
- display: block;
- line-height: 36px;
- float: right;
- margin-right: 20px;
-}
-
-.describe-toggle-off {
- display: none;
-}
-
-.hidden {
- height: 0;
- width: 0;
- overflow: hidden;
- border: none;
-}
-
-/* Specific to Uploader */
-
-#media-upload .media-upload-form p {
- margin: 0 1em 1em 0;
-}
-
-#media-upload p.ml-submit {
- padding: 1em 0;
-}
-
-#media-upload p.help,
-#media-upload label.help {
- font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
- font-style: italic;
- font-weight: normal;
-}
-
-#media-upload tr.image-size td.field {
- text-align: center;
-}
-
-#media-upload #media-items {
- border-width: 1px;
- border-style: solid;
- border-bottom: none;
- width: 623px;
-}
-
-#media-upload .media-item {
- border-bottom-width: 1px;
- border-bottom-style: solid;
- min-height: 36px;
- width: 100%;
-}
-
-#media-upload .ui-sortable .media-item {
- cursor: move;
-}
-
-.filename {
- line-height: 36px;
- padding: 0 10px;
- overflow: hidden;
-}
-
-#media-upload .describe {
- padding: 5px;
- width: 100%;
- clear: both;
- cursor: default;
-}
-
-#media-upload .slidetoggle {
- border-top-width: 1px;
- border-top-style: solid;
-}
-
-#media-upload .describe th.label {
- padding-top: .5em;
- text-align: left;
- min-width: 120px;
-}
-
-#media-upload tr.align td.field {
- text-align: center;
-}
-
-#media-upload tr.image-size {
- 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;
- width: auto;
-}
-
-#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 #ddd;
- 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 {
- height: 37px;
- width: 623px;
- display: block;
-}
-
-#gallery-settings th.label {
- width: 160px;
-}
-
-#gallery-settings #basic th.label {
- padding: 5px 5px 5px 0;
-}
-
-#gallery-settings .title {
- clear: both;
- padding: 0 0 3px;
- border-bottom-style: solid;
- border-bottom-width: 1px;
- font-family: Georgia,"Times New Roman",Times,serif;
- font-size: 1.6em;
- border-bottom-color: #DADADA;
- color: #5A5A5A;
-}
-
-h3.media-title {
- color: #5A5A5A;
- font-family: Georgia,"Times New Roman",Times,serif;
- font-size: 1.6em;
- font-weight: normal;
-}
-
-#gallery-settings .describe td {
- vertical-align: middle;
- height: 3.5em;
-}
-
-#gallery-settings .describe th.label {
- padding-top: .5em;
- text-align: left;
-}
-
-#gallery-settings .describe {
- padding: 5px;
- width: 615px;
- clear: both;
- cursor: default;
-}
-
-#gallery-settings .describe select {
- width: 15em;
- border: 1px solid #dfdfdf;
-}
-
-#gallery-settings label,
-#gallery-settings legend {
- font-size: 13px;
- color: #464646;
- margin-right: 15px;
-}
-
-#gallery-settings .align .field label {
- margin: 0 1.5em 0 0;
-}
-
-#gallery-settings p.ml-submit {
- border-top: 1px solid #dfdfdf;
-}
-
-#gallery-settings select#columns {
- width: 6em;
-}
-
-#sort-buttons {
- font-size: 0.8em;
- margin: 3px 25px -8px 0;
- text-align: right;
- max-width: 625px;
-}
-
-#sort-buttons a {
- text-decoration: none;
-}
-
-#sort-buttons #asc,
-#sort-buttons #showall {
- padding-left: 5px;
-}
-
-#sort-buttons span {
- margin-right: 25px;
-}
+div#media-upload-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;height:2.5em;}body#media-upload ul#sidemenu{font-weight:normal;margin:0 5px;position:absolute;left:0;bottom:-1px;}div#media-upload-error{margin:1em;font-weight:bold;}form{margin:1em;}#search-filter{text-align:right;}th{position:relative;}.media-upload-form label.form-help,td.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}.media-upload-form p.help{margin:0;padding:0;}.media-upload-form fieldset{width:100%;border:none;text-align:justify;margin:0 0 1em 0;padding:0;}.image-align-none-label{background:url(../images/align-none.png) no-repeat center left;}.image-align-left-label{background:url(../images/align-left.png) no-repeat center left;}.image-align-center-label{background:url(../images/align-center.png) no-repeat center left;}.image-align-right-label{background:url(../images/align-right.png) no-repeat center left;}tr.image-size td{width:460px;}tr.image-size div.image-size-item{float:left;width:25%;margin:0;}#library-form .progress,#gallery-form .progress,#flash-upload-ui,.insert-gallery,.describe.startopen,.describe.startclosed{display:none;}.media-item .thumbnail{max-width:128px;max-height:128px;}thead.media-item-info tr{background-color:transparent;}thead.media-item-info th,thead.media-item-info td{border:none;margin:0;}.form-table thead.media-item-info{border:8px solid #fff;}abbr.required{text-decoration:none;border:none;}.describe label{display:inline;}.describe td{vertical-align:middle;padding:0 5px 8px 0;}.describe td.error{padding:2px 8px;}.describe td.A1{width:132px;}.describe input[type="text"],.describe textarea{width:460px;border-width:1px;border-style:solid;}.hidden{height:0;width:0;overflow:hidden;border:none;}#media-upload p.ml-submit{padding:1em 0;}#media-upload p.help,#media-upload label.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}#media-upload tr.image-size td.field{text-align:center;}#media-upload #media-items{border-width:1px;border-style:solid;border-bottom:none;width:623px;}#media-upload .media-item{border-bottom-width:1px;border-bottom-style:solid;min-height:36px;width:100%;}#media-upload .ui-sortable .media-item{cursor:move;}.filename{line-height:36px;padding:0 10px;overflow:hidden;}#media-upload .describe{padding:5px;width:100%;clear:both;cursor:default;}#media-upload .slidetoggle{border-top-width:1px;border-top-style:solid;}#media-upload .describe th.label{padding-top:.2em;text-align:left;min-width:120px;}#media-upload tr.align td.field{text-align:center;}#media-upload tr.image-size{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;width:auto;}#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 #ddd;font-size:10px;padding:1px;width:23px;}.ui-sortable-helper{background-color:#fff;border:1px solid #aaa;opacity:.6;filter:alpha(opacity=60);}#media-upload th.order-head{width:20%;text-align:center;}#media-upload th.actions-head{width:25%;text-align:center;}#media-upload a.wp-post-thumbnail{margin:0 20px;}#media-items a.delete{display:block;float:right;}#media-upload .widefat{width:626px;border-style:solid solid none;}.sorthelper{height:37px;width:623px;display:block;}#gallery-settings th.label{width:160px;}#gallery-settings #basic th.label{padding:5px 5px 5px 0;}#gallery-settings .title{clear:both;padding:0 0 3px;font-size:1.6em;border-bottom:1px solid #DADADA;}h3.media-title{font-size:1.6em;}h4.media-sub-title{border-bottom:1px solid #DADADA;font-size:1.3em;margin:12px;padding:0 0 3px;}#gallery-settings .title,h3.media-title,h4.media-sub-title{font-family:Georgia,"Times New Roman",Times,serif;font-weight:normal;color:#5A5A5A;}#gallery-settings .describe td{vertical-align:middle;height:3em;}#gallery-settings .describe th.label{padding-top:.5em;text-align:left;}#gallery-settings .describe{padding:5px;width:615px;clear:both;cursor:default;}#gallery-settings .describe select{width:15em;}#gallery-settings .describe select option,#gallery-settings .describe td{padding:0;}#gallery-settings label,#gallery-settings legend{font-size:13px;color:#464646;margin-right:15px;}#gallery-settings .align .field label{margin:0 1.5em 0 0;}#gallery-settings p.ml-submit{border-top:1px solid #dfdfdf;}#gallery-settings select#columns{width:6em;}#sort-buttons{font-size:.8em;margin:3px 25px -8px 0;text-align:right;max-width:625px;}#sort-buttons a{text-decoration:none;}#sort-buttons #asc,#sort-buttons #showall{padding-left:5px;}#sort-buttons span{margin-right:25px;}
\ No newline at end of file
--- /dev/null
+div#media-upload-header {
+ margin: 0;
+ padding: 0 5px;
+ font-weight: bold;
+ position: relative;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+ height: 2.5em;
+}
+
+body#media-upload ul#sidemenu {
+ font-weight: normal;
+ margin: 0 5px;
+ position: absolute;
+ left: 0px;
+ bottom: -1px;
+}
+
+div#media-upload-error {
+ margin: 1em;
+ font-weight: bold;
+}
+
+form {
+ margin: 1em;
+}
+
+#search-filter {
+ text-align: right;
+}
+
+th {
+ position: relative;
+}
+
+.media-upload-form label.form-help, td.help {
+ font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
+ font-style: italic;
+ font-weight: normal;
+}
+
+.media-upload-form p.help {
+ margin: 0;
+ padding: 0;
+}
+
+.media-upload-form fieldset {
+ width: 100%;
+ border: none;
+ text-align: justify;
+ margin: 0 0 1em 0;
+ padding: 0;
+}
+
+/* specific to the image upload form */
+
+
+.image-align-none-label {
+ background: url(../images/align-none.png) no-repeat center left;
+}
+
+.image-align-left-label {
+ background: url(../images/align-left.png) no-repeat center left;
+}
+
+.image-align-center-label {
+ background: url(../images/align-center.png) no-repeat center left;
+}
+
+.image-align-right-label {
+ background: url(../images/align-right.png) no-repeat center left;
+}
+
+tr.image-size td {
+ width: 460px;
+}
+
+tr.image-size div.image-size-item {
+ float: left;
+ width: 25%;
+ margin: 0;
+}
+
+#library-form .progress,
+#gallery-form .progress,
+#flash-upload-ui,
+.insert-gallery,
+.describe.startopen,
+.describe.startclosed {
+ display: none;
+}
+
+.media-item .thumbnail {
+ max-width: 128px;
+ max-height: 128px;
+}
+
+thead.media-item-info tr {
+ background-color: transparent;
+}
+
+thead.media-item-info th,
+thead.media-item-info td {
+ border: none;
+ margin: 0;
+}
+
+.form-table thead.media-item-info {
+ border: 8px solid #fff;
+}
+
+abbr.required {
+ text-decoration: none;
+ border: none;
+}
+
+.describe label {
+ display: inline;
+}
+
+.describe td {
+ vertical-align: middle;
+ padding: 0 5px 8px 0;
+}
+
+.describe td.error {
+ padding: 2px 8px;
+}
+
+.describe td.A1 {
+ width: 132px;
+}
+
+.describe input[type="text"],
+.describe textarea {
+ width: 460px;
+ border-width: 1px;
+ border-style: solid;
+}
+
+.hidden {
+ height: 0;
+ width: 0;
+ overflow: hidden;
+ border: none;
+}
+
+/* Specific to Uploader */
+
+#media-upload p.ml-submit {
+ padding: 1em 0;
+}
+
+#media-upload p.help,
+#media-upload label.help {
+ font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
+ font-style: italic;
+ font-weight: normal;
+}
+
+#media-upload tr.image-size td.field {
+ text-align: center;
+}
+
+#media-upload #media-items {
+ border-width: 1px;
+ border-style: solid;
+ border-bottom: none;
+ width: 623px;
+}
+
+#media-upload .media-item {
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+ min-height: 36px;
+ width: 100%;
+}
+
+#media-upload .ui-sortable .media-item {
+ cursor: move;
+}
+
+.filename {
+ line-height: 36px;
+ padding: 0 10px;
+ overflow: hidden;
+}
+
+#media-upload .describe {
+ padding: 5px;
+ width: 100%;
+ clear: both;
+ cursor: default;
+}
+
+#media-upload .slidetoggle {
+ border-top-width: 1px;
+ border-top-style: solid;
+}
+
+#media-upload .describe th.label {
+ padding-top: .2em;
+ text-align: left;
+ min-width: 120px;
+}
+
+#media-upload tr.align td.field {
+ text-align: center;
+}
+
+#media-upload tr.image-size {
+ 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;
+ width: auto;
+}
+
+#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 #ddd;
+ 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: 20%;
+ text-align: center;
+}
+
+#media-upload th.actions-head {
+ width: 25%;
+ text-align: center;
+}
+
+#media-upload a.wp-post-thumbnail {
+ margin: 0 20px;
+}
+
+#media-items a.delete {
+ display: block;
+ float: right;
+}
+
+#media-upload .widefat {
+ width: 626px;
+ border-style: solid solid none;
+}
+
+.sorthelper {
+ height: 37px;
+ width: 623px;
+ display: block;
+}
+
+#gallery-settings th.label {
+ width: 160px;
+}
+
+#gallery-settings #basic th.label {
+ padding: 5px 5px 5px 0;
+}
+
+#gallery-settings .title {
+ clear: both;
+ padding: 0 0 3px;
+ font-size: 1.6em;
+ border-bottom: 1px solid #DADADA;
+}
+
+h3.media-title {
+ font-size: 1.6em;
+}
+
+h4.media-sub-title {
+ border-bottom: 1px solid #DADADA;
+ font-size: 1.3em;
+ margin: 12px;
+ padding: 0 0 3px;
+}
+
+#gallery-settings .title,
+h3.media-title,
+h4.media-sub-title {
+ font-family: Georgia,"Times New Roman",Times,serif;
+ font-weight: normal;
+ color: #5A5A5A;
+}
+
+#gallery-settings .describe td {
+ vertical-align: middle;
+ height: 3em;
+}
+
+#gallery-settings .describe th.label {
+ padding-top: .5em;
+ text-align: left;
+}
+
+#gallery-settings .describe {
+ padding: 5px;
+ width: 615px;
+ clear: both;
+ cursor: default;
+}
+
+#gallery-settings .describe select {
+ width: 15em;
+}
+
+#gallery-settings .describe select option,
+#gallery-settings .describe td {
+ padding: 0;
+}
+
+#gallery-settings label,
+#gallery-settings legend {
+ font-size: 13px;
+ color: #464646;
+ margin-right: 15px;
+}
+
+#gallery-settings .align .field label {
+ margin: 0 1.5em 0 0;
+}
+
+#gallery-settings p.ml-submit {
+ border-top: 1px solid #dfdfdf;
+}
+
+#gallery-settings select#columns {
+ width: 6em;
+}
+
+#sort-buttons {
+ font-size: 0.8em;
+ margin: 3px 25px -8px 0;
+ text-align: right;
+ max-width: 625px;
+}
+
+#sort-buttons a {
+ text-decoration: none;
+}
+
+#sort-buttons #asc,
+#sort-buttons #showall {
+ padding-left: 5px;
+}
+
+#sort-buttons span {
+ margin-right: 25px;
+}
-/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */
-div.star-holder {
- position: relative;
- height: 19px;
- width: 100px;
- font-size: 19px;
-}
-
-div.star {
- height: 100%;
- position: absolute;
- top: 0;
- left: 0;
- background-color: transparent;
- letter-spacing: 1ex;
- border: none;
-}
-
-.star1 { width: 20%; }
-.star2 { width: 40%; }
-.star3 { width: 60%; }
-.star4 { width: 80%; }
-.star5 { width: 100%; }
-
-.star img, div.star a, div.star a:hover, div.star a:visited {
- display: block;
- position: absolute;
- right: 0;
- border: none;
- text-decoration: none;
-}
-
-div.star img {
- width: 19px;
- height: 19px;
- border-left: 1px solid #fff;
- border-right: 1px solid #fff;
-}
-
-/* Start custom CSS */
-/* Header on thickbox */
-#plugin-information-header {
- margin: 0;
- padding: 0 5px;
- font-weight: bold;
- position: relative;
- border-bottom-width: 1px;
- border-bottom-style: solid;
- height: 2.5em;
-}
-#plugin-information ul#sidemenu {
- font-weight: normal;
- margin: 0 5px;
- position: absolute;
- left: 0;
- bottom: -1px;
-}
-
-/* Install sidemenu */
-#plugin-information p.action-button {
- width: 100%;
- padding-bottom: 0;
- margin-bottom: 0;
- margin-top: 10px;
- -moz-border-radius: 3px 0 0 3px;
- -webkit-border-top-left-radius: 3px;
- -khtml-border-top-left-radius: 3px;
- border-top-left-radius: 3px;
- -webkit-border-bottom-left-radius: 3px;
- -khtml-border-bottom-left-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-
-#plugin-information .action-button a {
- text-align: center;
- font-weight: bold;
- text-decoration: none;
- display: block;
- line-height: 2em;
-}
-
-#plugin-information h2 {
- clear: none !important;
- margin-right: 200px;
-}
-
-#plugin-information .fyi {
- margin: 0 10px 50px;
- width: 210px;
-}
-
-#plugin-information .fyi h2 {
- font-size: 0.9em;
- margin-bottom: 0;
- margin-right: 0;
-}
-
-#plugin-information .fyi h2.mainheader {
- padding: 5px;
- -moz-border-radius-topleft: 3px;
- -webkit-border-top-left-radius: 3px;
- -khtml-border-top-left-radius: 3px;
- border-top-left-radius: 3px;
-}
-
-#plugin-information .fyi ul {
- padding: 10px 5px 10px 7px;
- margin: 0;
- list-style: none;
- -moz-border-radius-bottomleft: 3px;
- -webkit-border-bottom-left-radius: 3px;
- -khtml-border-bottom-left-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-
-#plugin-information .fyi li {
- margin-right: 0;
-}
-
-#plugin-information #section-holder {
- padding: 10px;
-}
-
-#plugin-information .section ul,
-#plugin-information .section ol {
- margin-left: 16px;
- list-style-type: square;
- list-style-image: none;
-}
-
-#plugin-information #section-screenshots li img {
- vertical-align: text-top;
-}
-
-#plugin-information #section-screenshots li p {
- font-style: italic;
- padding-left: 20px;
- padding-bottom: 2em;
-}
-
-#plugin-information .updated,
-#plugin-information pre {
- margin-right: 215px;
-}
-
-#plugin-information pre {
- padding: 7px;
-}
+div.star-holder{position:relative;height:19px;width:100px;font-size:19px;}div.star{height:100%;position:absolute;top:0;left:0;background-color:transparent;letter-spacing:1ex;border:none;}.star1{width:20%;}.star2{width:40%;}.star3{width:60%;}.star4{width:80%;}.star5{width:100%;}.star img,div.star a,div.star a:hover,div.star a:visited{display:block;position:absolute;right:0;border:none;text-decoration:none;}div.star img{width:19px;height:19px;border-left:1px solid #fff;border-right:1px solid #fff;}#plugin-information-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;height:2.5em;}#plugin-information ul#sidemenu{font-weight:normal;margin:0 5px;position:absolute;left:0;bottom:-1px;}#plugin-information p.action-button{width:100%;padding-bottom:0;margin-bottom:0;margin-top:10px;-moz-border-radius:3px 0 0 3px;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}#plugin-information .action-button a{text-align:center;font-weight:bold;text-decoration:none;display:block;line-height:2em;}#plugin-information h2{clear:none!important;margin-right:200px;}#plugin-information .fyi{margin:0 10px 50px;width:210px;}#plugin-information .fyi h2{font-size:.9em;margin-bottom:0;margin-right:0;}#plugin-information .fyi h2.mainheader{padding:5px;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;}#plugin-information .fyi ul{padding:10px 5px 10px 7px;margin:0;list-style:none;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}#plugin-information .fyi li{margin-right:0;}#plugin-information #section-holder{padding:10px;}#plugin-information .section ul,#plugin-information .section ol{margin-left:16px;list-style-type:square;list-style-image:none;}#plugin-information #section-screenshots li img{vertical-align:text-top;}#plugin-information #section-screenshots li p{font-style:italic;padding-left:20px;padding-bottom:2em;}#plugin-information .updated,#plugin-information pre{margin-right:215px;}#plugin-information pre{padding:7px;}
\ No newline at end of file
--- /dev/null
+/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */
+div.star-holder {
+ position: relative;
+ height: 19px;
+ width: 100px;
+ font-size: 19px;
+}
+
+div.star {
+ height: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ background-color: transparent;
+ letter-spacing: 1ex;
+ border: none;
+}
+
+.star1 { width: 20%; }
+.star2 { width: 40%; }
+.star3 { width: 60%; }
+.star4 { width: 80%; }
+.star5 { width: 100%; }
+
+.star img, div.star a, div.star a:hover, div.star a:visited {
+ display: block;
+ position: absolute;
+ right: 0;
+ border: none;
+ text-decoration: none;
+}
+
+div.star img {
+ width: 19px;
+ height: 19px;
+ border-left: 1px solid #fff;
+ border-right: 1px solid #fff;
+}
+
+/* Start custom CSS */
+/* Header on thickbox */
+#plugin-information-header {
+ margin: 0;
+ padding: 0 5px;
+ font-weight: bold;
+ position: relative;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+ height: 2.5em;
+}
+#plugin-information ul#sidemenu {
+ font-weight: normal;
+ margin: 0 5px;
+ position: absolute;
+ left: 0;
+ bottom: -1px;
+}
+
+/* Install sidemenu */
+#plugin-information p.action-button {
+ width: 100%;
+ padding-bottom: 0;
+ margin-bottom: 0;
+ margin-top: 10px;
+ -moz-border-radius: 3px 0 0 3px;
+ -webkit-border-top-left-radius: 3px;
+ -khtml-border-top-left-radius: 3px;
+ border-top-left-radius: 3px;
+ -webkit-border-bottom-left-radius: 3px;
+ -khtml-border-bottom-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+
+#plugin-information .action-button a {
+ text-align: center;
+ font-weight: bold;
+ text-decoration: none;
+ display: block;
+ line-height: 2em;
+}
+
+#plugin-information h2 {
+ clear: none !important;
+ margin-right: 200px;
+}
+
+#plugin-information .fyi {
+ margin: 0 10px 50px;
+ width: 210px;
+}
+
+#plugin-information .fyi h2 {
+ font-size: 0.9em;
+ margin-bottom: 0;
+ margin-right: 0;
+}
+
+#plugin-information .fyi h2.mainheader {
+ padding: 5px;
+ -moz-border-radius-topleft: 3px;
+ -webkit-border-top-left-radius: 3px;
+ -khtml-border-top-left-radius: 3px;
+ border-top-left-radius: 3px;
+}
+
+#plugin-information .fyi ul {
+ padding: 10px 5px 10px 7px;
+ margin: 0;
+ list-style: none;
+ -moz-border-radius-bottomleft: 3px;
+ -webkit-border-bottom-left-radius: 3px;
+ -khtml-border-bottom-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+
+#plugin-information .fyi li {
+ margin-right: 0;
+}
+
+#plugin-information #section-holder {
+ padding: 10px;
+}
+
+#plugin-information .section ul,
+#plugin-information .section ol {
+ margin-left: 16px;
+ list-style-type: square;
+ list-style-image: none;
+}
+
+#plugin-information #section-screenshots li img {
+ vertical-align: text-top;
+}
+
+#plugin-information #section-screenshots li p {
+ font-style: italic;
+ padding-left: 20px;
+ padding-bottom: 2em;
+}
+
+#plugin-information .updated,
+#plugin-information pre {
+ margin-right: 215px;
+}
+
+#plugin-information pre {
+ padding: 7px;
+}
-body {
- font: 13px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
- color: #333;
- margin: 0;
- padding: 0;
-}
-
-img {
- border: none;
-}
-
-/* Header */
-#wphead {
- border-top: none;
- padding-top: 4px;
- background: #444 !important;
-}
-
-.tagchecklist span a {
-background: transparent url(../images/xit.gif) no-repeat 0 0;
-}
-
-#poststuff #edButtonPreview,
-#poststuff #edButtonHTML {
- -moz-border-radius: 3px 3px 0 0;
- -webkit-border-top-right-radius: 3px;
- -webkit-border-top-left-radius: 3px;
- -khtml-border-top-right-radius: 3px;
- -khtml-border-top-left-radius: 3px;
- border-top-right-radius: 3px;
- border-top-left-radius: 3px;
- border-style: solid;
- border-width: 1px;
- cursor: pointer;
- display: block;
- height: 18px;
- margin: 0 5px 0 0;
- padding: 0 5px 0;
- font-size: 10px;
- line-height: 18px;
- float: left;
-}
-
-.howto {
- margin-top: 2px;
- margin-bottom: 3px;
- font-size: 11px;
- font-style: italic;
- display: block;
-}
-
-input.text {
- outline-color: -moz-use-text-color;
- outline-style: none;
- outline-width: medium;
- width: 100%;
-}
-
-#message {
- -moz-border-radius: 6px;
- -khtml-border-radius: 6px;
- -webkit-border-radius: 6px;
- border-radius: 6px;
-}
-
-/* Editor/Main Column */
-div#poststuff {
- padding-left: 10px;
- margin-top: 10px;
-}
-
-div.zerosize {
- border: 0 none;
- height: 0;
- margin: 0;
- overflow: hidden;
- padding: 0;
- position: absolute;
- width: 0;
-}
-
-#poststuff #edButtonPreview.active,
-#poststuff #edButtonHTML.active {
- display: none;
-}
-
-.posting {
- margin-right: 228px;
- position: relative;
- left: 0;
-}
-
-#side-info-column {
- float: right;
- width: 218px;
- position: absolute;
- right: 0;
- margin-right: 10px;
-}
-
-#side-info-column .sleeve {
- padding-top: 5px;
- padding-left: 10px;
-}
-
-#poststuff .inside {
- font-size: 11px;
- margin: 0 12px 12px;
-}
-
-#poststuff h2, #poststuff h3 {
- font-size: 12px;
- font-weight: bold;
- line-height: 1;
- margin: 0 0 10px;
- padding: 7px 9px;
-}
-
-h3.tb {
- text-shadow: 0 1px 0 #fff;
- font-weight: bold;
- font-size: 12px;
- margin-left: 5px;
-}
-
-#TB_window {
- border: 1px solid #333;
- -moz-border-radius: 6px;
- -khtml-border-radius: 6px;
- -webkit-border-radius: 6px;
- border-radius: 6px;
-}
-
-.postbox,
-.stuffbox {
- margin-bottom: 10px;
- border-width: 1px;
- border-style: solid;
- line-height: 1;
- -moz-border-radius: 6px;
- -khtml-border-radius: 6px;
- -webkit-border-radius: 6px;
- border-radius: 6px;
-}
-
-#title,
-.tbtitle {
- -moz-border-radius: 6px;
- -khtml-border-radius: 6px;
- -webkit-border-radius: 6px;
- border-radius: 6px;
- border-style: solid;
- border-width: 1px;
- font-size: 1.7em;
- outline: none;
- padding: 3px 4px;
- border-color: #dfdfdf;
-}
-
-.tbtitle {
- font-size: 12px;
- padding: 3px;
-}
-
-#title {
- width: 98%;
-}
-
-.editor-container {
- -moz-border-radius: 6px;
- -khtml-border-radius: 6px;
- -webkit-border-radius: 6px;
- border-radius: 6px;
- border: 1px solid #dfdfdf;
- background-color: #fff;
-}
-
-.postdivrich {
- position: relative;
- padding-top: 25px;
-}
-
-#actions {
- clear: both;
- float: right;
- margin-top: -19px;
- position: relative;
-}
-
-#extra_fields #actions {
- clear: both;
- position: relative;
- right: 0px;
- margin: -24px 0 0;
-}
-
-#actions li {
- float: left;
- list-style: none;
- margin-right: 10px;
-}
-
-#extra_fields .button {
- margin-right: 5px;
- padding: 3px 6px;
- border-radius: 10px;
- -webkit-border-radius: 10px;
- -khtml-border-radius: 10px;
- -moz-border-radius: 10px;
-}
-
-/* Photo Styles */
-.photolist {
- margin-top: -10px;
-}
-
-#photo_saving {
- margin: 0 8px 8px;
- vertical-align: middle;
-}
-
-#img_container {
- background-color: #fff;
-}
-#img_container_container {
- overflow: auto;
-}
-
-#extra_fields {
- margin-top: 10px;
- position: relative;
-}
-
-#extra_fields .postbox {
- margin-bottom: 5px;
-}
-
-#extra_fields .titlewrap {
- padding: 0;
- overflow: auto;
- height: 100px;
-}
-
-#img_container {
- position: relative;
-}
-
-#img_container a {
- display: block;
- float: left;
- overflow: hidden;
- vertical-align: center;
-}
-
-#img_container img,
-#img_container a {
- width: 68px;
- height: 68px;
-}
-
-#img_container img {
- border: none;
- background-color: #f4f4f4;
- cursor: pointer;
-}
-
-#img_container a,
-#img_container a:link,
-#img_container a:visited {
- border: 1px solid #ccc;
- display: block;
- position: relative;
-}
-
-#img_container a:hover,
-#img_container a:active {
- border-color: #000;
- z-index: 1000;
- border-width: 2px;
- margin: -1px;
-}
-
-/* Video */
-#embed-code {
- width: 100%;
- height: 98px;
-}
-
-/* Submit Column */
-#viewsite {
- padding: 0;
- margin: 0 0 20px 0;
- font-size: 10px;
- clear: both;
-}
-
-#viewsite .button {
- margin: 0;
- display: block;
-}
-
-.wp-hidden-children
-.wp-hidden-child {
- display: none;
-}
-
-#category-adder {
- padding: 4px 0;
-}
-
-#category-adder h4 {
- margin: 0 0 8px;
-}
-
-#category-add input {
- width: 94%;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 13px;
- margin: 1px;
- padding: 3px;
-}
-
-#category-add select {
- width: 70%;
- -x-system-font: none;
- border-style: solid;
- border-width: 1px;
- font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
- font-size: 12px;
- height: 2em;
- line-height: 20px;
- padding: 2px;
- margin: 1px;
- vertical-align: top;
-}
-
-#category-add input,
-#category-add-sumbit {
- width: auto;
-}
-
-/* Categories */
-#categorydiv ul,
-#linkcategorydiv ul {
- list-style: none;
- padding: 0;
- margin: 0;
-}
-
-#categorydiv ul.categorychecklist ul {
- margin-left: 18px;
-}
-
-#categorydiv div.tabs-panel {
- height: 140px;
- overflow: auto;
-}
-
-ul.categorychecklist li {
- margin: 0;
- padding: 0;
- line-height: 19px;
-}
-
-/* Tags */
-.tagsdiv .newtag {
- margin-right: 5px;
-}
-
-.jaxtag {
- clear: both;
- margin: 0;
-}
-
-.tagadd {
- margin-left: 3px;
-}
-
-.tagchecklist {
- margin-top: 3px;
- 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 0 0 -9px;
- cursor: pointer;
- width: 10px;
- height: 10px;
- display: block;
- float: left;
- text-indent: -9999px;
- overflow: hidden;
- position: absolute;
-}
-
-#content {
- width: 96% !important;
- margin-left: 1%;
- margin-bottom: 10px;
- border: 0 none;
- height: 365px;
-}
-
-/* Submit */
-
-#saving {
- display: inline;
- vertical-align: middle;
-}
-
-.submit input,
-.button,
-.button-primary,
-.button-secondary,
-.button-highlighted,
-#postcustomstuff .submit input {
- font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
- text-decoration: none;
- font-size: 11px !important;
- line-height: 16px;
- padding: 2px 8px;
- cursor: pointer;
- border-width: 1px;
- border-style: solid;
- -moz-border-radius: 11px;
- -khtml-border-radius: 11px;
- -webkit-border-radius: 11px;
- border-radius: 11px;
-}
-
-.button-primary {
- background: #21759B url(../images/button-grad.png) repeat-x scroll left top;
- border-color: #21759B;
- color: #fff;
-}
-
-.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;
-}
-
-#TB_ajaxContent #options {
- position: absolute;
- top: 20px;
- right: 25px;
- padding: 5px;
-}
-
-#TB_ajaxContent h3 {
- margin-bottom: .25em;
-}
-
-.updated {
- margin: 10px 0;
- padding: 0;
- border-width: 1px;
- border-style: solid;
- width: 99%;
-}
-
-.updated p,
-.error p {
- margin: 0.6em 0;
- padding: 0 0.6em;
-}
-
-.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;
-}
-
-.postbox input[type="text"],
-.postbox textarea,
-.stuffbox input[type="text"],
-.stuffbox textarea {
- border-width: 1px;
- border-style: solid;
-}
+body{font:13px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;color:#333;margin:0;padding:0;min-width:675px;min-height:400px;}img{border:none;}#wphead{border-top:none;padding-top:4px;background:#444!important;}.tagchecklist span a{background:transparent url(../images/xit.gif) no-repeat 0 0;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;border-style:solid;border-width:1px;cursor:pointer;display:block;height:18px;margin:0 5px 0 0;padding:0 5px 0;font-size:10px;line-height:18px;float:left;}.howto{margin-top:2px;margin-bottom:3px;font-size:11px;font-style:italic;display:block;}input.text{outline-color:-moz-use-text-color;outline-style:none;outline-width:medium;width:100%;}#message{-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}div#poststuff{margin:10px;}div.zerosize{border:0 none;height:0;margin:0;overflow:hidden;padding:0;width:0;}#poststuff #edButtonPreview.active,#poststuff #edButtonHTML.active{display:none;}.posting{margin-right:212px;position:relative;}#side-info-column{float:right;width:200px;position:relative;right:0;}#side-info-column .sleeve{padding-top:5px;}#poststuff .inside{font-size:11px;margin:8px;}#poststuff h2,#poststuff h3{font-size:12px;font-weight:bold;line-height:1;margin:0;padding:7px 9px;}#tagsdiv-post_tag h3,#categorydiv h3{cursor:pointer;}h3.tb{text-shadow:0 1px 0 #fff;font-weight:bold;font-size:12px;margin-left:5px;}#TB_window{border:1px solid #333;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.postbox,.stuffbox{margin-bottom:10px;border-width:1px;border-style:solid;line-height:1;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.stuffbox:hover .handlediv{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;}.handlediv{float:right;height:26px;width:23px;}#title,.tbtitle{-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border-style:solid;border-width:1px;font-size:1.7em;outline:none;padding:3px 4px;border-color:#dfdfdf;}.tbtitle{font-size:12px;padding:3px;}#title{width:97%;}.editor-container{-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border:1px solid #dfdfdf;background-color:#fff;}.postdivrich{padding-top:25px;position:relative;}.actions{float:right;margin:-19px 0 0;}#extra-fields .actions{margin:-15px -5px 0 0;}.actions li{float:left;list-style:none;margin-right:10px;}#extra-fields .button{margin-right:5px;padding:3px 6px;border-radius:10px;-webkit-border-radius:10px;-khtml-border-radius:10px;-moz-border-radius:10px;}.photolist{margin-top:-10px;}#photo_saving{margin:0 8px 8px;vertical-align:middle;}#img_container{background-color:#fff;}#img_container_container{overflow:auto;}#extra-fields{margin-top:10px;position:relative;}#waiting{margin-top:10px;}#extra-fields .postbox{margin-bottom:5px;}#extra-fields .titlewrap{padding:0;overflow:auto;height:100px;}#img_container a{display:block;float:left;overflow:hidden;vertical-align:center;}#img_container img,#img_container a{width:68px;height:68px;}#img_container img{border:none;background-color:#f4f4f4;cursor:pointer;}#img_container a,#img_container a:link,#img_container a:visited{border:1px solid #ccc;display:block;position:relative;}#img_container a:hover,#img_container a:active{border-color:#000;z-index:1000;border-width:2px;margin:-1px;}#embed-code{width:100%;height:98px;}#viewsite{padding:0;margin:0 0 20px 5px;font-size:10px;clear:both;}.wp-hidden-children .wp-hidden-child{display:none;}#category-adder{padding:4px 0;}#category-adder h4{margin:0 0 8px;}#category-add input{width:94%;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13px;margin:1px;padding:3px;}#category-add select{width:70%;-x-system-font:none;border-style:solid;border-width:1px;font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-size:12px;height:2em;line-height:20px;padding:2px;margin:1px;vertical-align:top;}#category-add input,#category-add-sumbit{width:auto;}#categorydiv ul,#linkcategorydiv ul{list-style:none;padding:0;margin:0;}#categorydiv ul.categorychecklist ul{margin-left:18px;}#categorydiv div.tabs-panel{height:140px;overflow:auto;}ul.categorychecklist li{margin:0;padding:0;line-height:19px;}.screen-reader-text{display:none;}.tagsdiv .newtag{margin-right:5px;}.jaxtag{clear:both;margin:0;}.tagadd{margin-left:3px;}.tagchecklist{margin-top:3px;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 0 0 -9px;cursor:pointer;width:10px;height:10px;display:block;float:left;text-indent:-9999px;overflow:hidden;position:absolute;}#content{margin:5px 0;padding:0 5px;border:0 none;height:365px;width:97%!important;}* html .postdivrich{zoom:1;}#saving{display:inline;vertical-align:middle;}.submit input,.button,.button-primary,.button-secondary,.button-highlighted,#postcustomstuff .submit input{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;text-decoration:none;font-size:11px!important;line-height:16px;padding:2px 8px;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;}.button-primary{background:#21759B url(../images/button-grad.png) repeat-x scroll left top;border-color:#21759B;color:#fff;}.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;}#TB_ajaxContent #options{position:absolute;top:20px;right:25px;padding:5px;}#TB_ajaxContent h3{margin-bottom:.25em;}.updated{margin:10px 0;padding:0;border-width:1px;border-style:solid;width:99%;}.updated p,.error p{margin:.6em 0;padding:0 .6em;}.error a{text-decoration:underline;}.updated a{text-decoration:none;padding-bottom:2px;}#post_status{margin-left:10px;margin-bottom:1em;display:block;}#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;}.centered{text-align:center;}.hidden{display:none;}.postbox input[type="text"],.postbox textarea,.stuffbox input[type="text"],.stuffbox textarea{border-width:1px;border-style:solid;}.taghint{color:#aaa;margin:-17px 0 0 7px;visibility:hidden;}input.newtag ~ div.taghint{visibility:visible;}input.newtag:focus ~ div.taghint{visibility:hidden;}
\ No newline at end of file
--- /dev/null
+
+body {
+ font: 13px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
+ color: #333;
+ margin: 0;
+ padding: 0;
+ min-width: 675px;
+ min-height: 400px;
+}
+
+img {
+ border: none;
+}
+
+/* Header */
+#wphead {
+ border-top: none;
+ padding-top: 4px;
+ background: #444 !important;
+}
+
+.tagchecklist span a {
+ background: transparent url(../images/xit.gif) no-repeat 0 0;
+}
+
+#poststuff #edButtonPreview,
+#poststuff #edButtonHTML {
+ -moz-border-radius: 3px 3px 0 0;
+ -webkit-border-top-right-radius: 3px;
+ -webkit-border-top-left-radius: 3px;
+ -khtml-border-top-right-radius: 3px;
+ -khtml-border-top-left-radius: 3px;
+ border-top-right-radius: 3px;
+ border-top-left-radius: 3px;
+ border-style: solid;
+ border-width: 1px;
+ cursor: pointer;
+ display: block;
+ height: 18px;
+ margin: 0 5px 0 0;
+ padding: 0 5px 0;
+ font-size: 10px;
+ line-height: 18px;
+ float: left;
+}
+
+.howto {
+ margin-top: 2px;
+ margin-bottom: 3px;
+ font-size: 11px;
+ font-style: italic;
+ display: block;
+}
+
+input.text {
+ outline-color: -moz-use-text-color;
+ outline-style: none;
+ outline-width: medium;
+ width: 100%;
+}
+
+#message {
+ -moz-border-radius: 6px;
+ -khtml-border-radius: 6px;
+ -webkit-border-radius: 6px;
+ border-radius: 6px;
+}
+
+/* Editor/Main Column */
+div#poststuff {
+ margin: 10px;
+}
+
+div.zerosize {
+ border: 0 none;
+ height: 0;
+ margin: 0;
+ overflow: hidden;
+ padding: 0;
+ width: 0;
+}
+
+#poststuff #edButtonPreview.active,
+#poststuff #edButtonHTML.active {
+ display: none;
+}
+
+.posting {
+ margin-right: 212px;
+ position: relative;
+}
+
+#side-info-column {
+ float: right;
+ width: 200px;
+ position: relative;
+ right: 0;
+}
+
+#side-info-column .sleeve {
+ padding-top: 5px;
+}
+
+#poststuff .inside {
+ font-size: 11px;
+ margin: 8px;
+}
+
+#poststuff h2,#poststuff h3 {
+ font-size: 12px;
+ font-weight: bold;
+ line-height: 1;
+ margin: 0;
+ padding: 7px 9px;
+}
+
+#tagsdiv-post_tag h3,
+#categorydiv h3 {
+ cursor: pointer;
+}
+
+h3.tb {
+ text-shadow: 0 1px 0 #fff;
+ font-weight: bold;
+ font-size: 12px;
+ margin-left: 5px;
+}
+
+#TB_window {
+ border: 1px solid #333;
+ -moz-border-radius: 6px;
+ -khtml-border-radius: 6px;
+ -webkit-border-radius: 6px;
+ border-radius: 6px;
+}
+
+.postbox,
+.stuffbox {
+ margin-bottom: 10px;
+ border-width: 1px;
+ border-style: solid;
+ line-height: 1;
+ -moz-border-radius: 6px;
+ -khtml-border-radius: 6px;
+ -webkit-border-radius: 6px;
+ border-radius: 6px;
+}
+
+.stuffbox:hover .handlediv {
+ background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;
+}
+
+.handlediv {
+ float: right;
+ height: 26px;
+ width: 23px;
+}
+
+#title,
+.tbtitle {
+ -moz-border-radius: 6px;
+ -khtml-border-radius: 6px;
+ -webkit-border-radius: 6px;
+ border-radius: 6px;
+ border-style: solid;
+ border-width: 1px;
+ font-size: 1.7em;
+ outline: none;
+ padding: 3px 4px;
+ border-color: #dfdfdf;
+}
+
+.tbtitle {
+ font-size: 12px;
+ padding: 3px;
+}
+
+#title {
+ width: 97%;
+}
+
+.editor-container {
+ -moz-border-radius: 6px;
+ -khtml-border-radius: 6px;
+ -webkit-border-radius: 6px;
+ border-radius: 6px;
+ border: 1px solid #dfdfdf;
+ background-color: #fff;
+}
+
+.postdivrich {
+ padding-top: 25px;
+ position: relative;
+}
+
+.actions {
+ float: right;
+ margin: -19px 0 0;
+}
+
+#extra-fields .actions {
+ margin: -15px -5px 0 0;
+}
+
+.actions li {
+ float: left;
+ list-style: none;
+ margin-right: 10px;
+}
+
+#extra-fields .button {
+ margin-right: 5px;
+ padding: 3px 6px;
+ border-radius: 10px;
+ -webkit-border-radius: 10px;
+ -khtml-border-radius: 10px;
+ -moz-border-radius: 10px;
+}
+
+/* Photo Styles */
+.photolist {
+ margin-top: -10px;
+}
+
+#photo_saving {
+ margin: 0 8px 8px;
+ vertical-align: middle;
+}
+
+#img_container {
+ background-color: #fff;
+}
+
+#img_container_container {
+ overflow: auto;
+}
+
+#extra-fields {
+ margin-top: 10px;
+ position: relative;
+}
+
+#waiting {
+ margin-top: 10px;
+}
+
+#extra-fields .postbox {
+ margin-bottom: 5px;
+}
+
+#extra-fields .titlewrap {
+ padding: 0;
+ overflow: auto;
+ height: 100px;
+}
+
+#img_container a {
+ display: block;
+ float: left;
+ overflow: hidden;
+ vertical-align: center;
+}
+
+#img_container img,
+#img_container a {
+ width: 68px;
+ height: 68px;
+}
+
+#img_container img {
+ border: none;
+ background-color: #f4f4f4;
+ cursor: pointer;
+}
+
+#img_container a,
+#img_container a:link,
+#img_container a:visited {
+ border: 1px solid #ccc;
+ display: block;
+ position: relative;
+}
+
+#img_container a:hover,
+#img_container a:active {
+ border-color: #000;
+ z-index: 1000;
+ border-width: 2px;
+ margin: -1px;
+}
+
+/* Video */
+#embed-code {
+ width: 100%;
+ height: 98px;
+}
+
+/* Submit Column */
+#viewsite {
+ padding: 0;
+ margin: 0 0 20px 5px;
+ font-size: 10px;
+ clear: both;
+}
+
+.wp-hidden-children
+.wp-hidden-child {
+ display: none;
+}
+
+#category-adder {
+ padding: 4px 0;
+}
+
+#category-adder h4 {
+ margin: 0 0 8px;
+}
+
+#category-add input {
+ width: 94%;
+ font-family: Verdana,Arial,Helvetica,sans-serif;
+ font-size: 13px;
+ margin: 1px;
+ padding: 3px;
+}
+
+#category-add select {
+ width: 70%;
+ -x-system-font: none;
+ border-style: solid;
+ border-width: 1px;
+ font-family: "Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;
+ font-size: 12px;
+ height: 2em;
+ line-height: 20px;
+ padding: 2px;
+ margin: 1px;
+ vertical-align: top;
+}
+
+#category-add input,
+#category-add-sumbit {
+ width: auto;
+}
+
+/* Categories */
+#categorydiv ul,
+#linkcategorydiv ul {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+}
+
+#categorydiv ul.categorychecklist ul {
+ margin-left: 18px;
+}
+
+#categorydiv div.tabs-panel {
+ height: 140px;
+ overflow: auto;
+}
+
+ul.categorychecklist li {
+ margin: 0;
+ padding: 0;
+ line-height: 19px;
+}
+
+/* Tags */
+.screen-reader-text {
+ display: none;
+}
+
+.tagsdiv .newtag {
+ margin-right: 5px;
+}
+
+.jaxtag {
+ clear: both;
+ margin: 0;
+}
+
+.tagadd {
+ margin-left: 3px;
+}
+
+.tagchecklist {
+ margin-top: 3px;
+ 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 0 0 -9px;
+ cursor: pointer;
+ width: 10px;
+ height: 10px;
+ display: block;
+ float: left;
+ text-indent: -9999px;
+ overflow: hidden;
+ position: absolute;
+}
+
+#content {
+ margin: 5px 0;
+ padding: 0 5px;
+ border: 0 none;
+ height: 365px;
+ width: 97% !important;
+}
+
+* html .postdivrich {
+ zoom: 1;
+}
+
+/* Submit */
+#saving {
+ display: inline;
+ vertical-align: middle;
+}
+
+.submit input,
+.button,
+.button-primary,
+.button-secondary,
+.button-highlighted,
+#postcustomstuff .submit input {
+ font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
+ text-decoration: none;
+ font-size: 11px !important;
+ line-height: 16px;
+ padding: 2px 8px;
+ cursor: pointer;
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 11px;
+ -khtml-border-radius: 11px;
+ -webkit-border-radius: 11px;
+ border-radius: 11px;
+}
+
+.button-primary {
+ background: #21759B url(../images/button-grad.png) repeat-x scroll left top;
+ border-color: #21759B;
+ color: #fff;
+}
+
+.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;
+}
+
+#TB_ajaxContent #options {
+ position: absolute;
+ top: 20px;
+ right: 25px;
+ padding: 5px;
+}
+
+#TB_ajaxContent h3 {
+ margin-bottom: .25em;
+}
+
+.updated {
+ margin: 10px 0;
+ padding: 0;
+ border-width: 1px;
+ border-style: solid;
+ width: 99%;
+}
+
+.updated p,
+.error p {
+ margin: 0.6em 0;
+ padding: 0 0.6em;
+}
+
+.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;
+}
+
+.postbox input[type="text"],
+.postbox textarea,
+.stuffbox input[type="text"],
+.stuffbox textarea {
+ border-width: 1px;
+ border-style: solid;
+}
+
+/* tag hints */
+.taghint {
+ color: #aaa;
+ margin: -17px 0 0 7px;
+ visibility: hidden;
+}
+
+input.newtag ~ div.taghint {
+ visibility: visible;
+}
+
+input.newtag:focus ~ div.taghint {
+ visibility: hidden;
+}
-#template textarea {
- font-family: Consolas, Monaco, Courier, monospace;
- font-size: 12px;
- width: 97%;
-}
-
-#template p {
- width: 97%;
-}
-
-#templateside {
- float: right;
- width: 190px;
- word-wrap: break-word;
-}
-
-#templateside h3,
-#postcustomstuff p.submit {
- margin: 0;
-}
-
-#templateside h4 {
- margin: 1em 0 0;
-}
-
-#templateside ol,
-#templateside ul {
- margin: .5em;
- padding: 0;
-}
-
-#templateside li {
- margin: 4px 0;
-}
-
-.nonessential {
- font-size: small;
-}
-
-.highlight {
- padding: 1px;
-}
-
-div.tablenav {
- margin-right: 210px;
-}
-
-#documentation {
- margin-top: 10px;
-}
-#documentation label {
- line-height: 22px;
- vertical-align: top;
- font-weight: bold;
-}
-
-.fileedit-sub {
- padding: 10px 0 8px;
- line-height: 180%;
-}
+#template textarea{font-family:Consolas,Monaco,Courier,monospace;font-size:12px;width:97%;}#template p{width:97%;}#templateside{float:right;width:190px;word-wrap:break-word;}#templateside h3,#postcustomstuff p.submit{margin:0;}#templateside h4{margin:1em 0 0;}#templateside ol,#templateside ul{margin:.5em;padding:0;}#templateside li{margin:4px 0;}.nonessential{font-size:small;}.highlight{padding:1px;}div.tablenav{margin-right:210px;}#documentation{margin-top:10px;}#documentation label{line-height:22px;vertical-align:top;font-weight:bold;}.fileedit-sub{padding:10px 0 8px;line-height:180%;}
\ No newline at end of file
--- /dev/null
+#template textarea {
+ font-family: Consolas, Monaco, Courier, monospace;
+ font-size: 12px;
+ width: 97%;
+}
+
+#template p {
+ width: 97%;
+}
+
+#templateside {
+ float: right;
+ width: 190px;
+ word-wrap: break-word;
+}
+
+#templateside h3,
+#postcustomstuff p.submit {
+ margin: 0;
+}
+
+#templateside h4 {
+ margin: 1em 0 0;
+}
+
+#templateside ol,
+#templateside ul {
+ margin: .5em;
+ padding: 0;
+}
+
+#templateside li {
+ margin: 4px 0;
+}
+
+.nonessential {
+ font-size: small;
+}
+
+.highlight {
+ padding: 1px;
+}
+
+div.tablenav {
+ margin-right: 210px;
+}
+
+#documentation {
+ margin-top: 10px;
+}
+#documentation label {
+ line-height: 22px;
+ vertical-align: top;
+ font-weight: bold;
+}
+
+.fileedit-sub {
+ padding: 10px 0 8px;
+ line-height: 180%;
+}
-/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */
-div.star-holder {
- position: relative;
- height: 19px;
- width: 100px;
- font-size: 19px;
-}
-
-div.star {
- height: 100%;
- position: absolute;
- top: 0;
- left: 0;
- background-color: transparent;
- letter-spacing: 1ex;
- border: none;
-}
-
-.star1 { width: 20%; }
-.star2 { width: 40%; }
-.star3 { width: 60%; }
-.star4 { width: 80%; }
-.star5 { width: 100%; }
-
-.star img, div.star a, div.star a:hover, div.star a:visited {
- display: block;
- position: absolute;
- right: 0;
- border: none;
- text-decoration: none;
-}
-
-div.star img {
- width: 19px;
- height: 19px;
- border-left: 1px solid #fff;
- border-right: 1px solid #fff;
-}
-
-.theme-listing .theme-item {
- display: inline-block;
- width: 200px;
- border: thin solid #ccc;
- vertical-align: top;
-}
-
-.theme-listing .theme-item h3 {
- text-align: center;
- font-size: 14px;
- font-style: italic;
- margin: 0;
- padding: 0;
-}
-
-.theme-listing .theme-item img {
- max-width: 150px;
- max-height: 150px;
-}
-
-.theme-listing .theme-item-info span {
- display: none;
-}
-.theme-listing .theme-item:hover .theme-item-info span {
- display: inline;
-}
-.theme-listing .theme-item:hover .theme-item-info span.dots {
- display: none;
-}
-.theme-listing .theme-item-info span.action-links {
- font-weight: bold;
- text-align: center;
-}
-
-.theme-listing br.line {
- border-bottom-width: 1px;
- border-bottom-style: solid;
- margin-bottom: 3px;
-}
-
-.available-theme {
- padding: 20px 15px;
-}
-
-#theme-information .theme-preview-img {
- float: left;
- margin: 5px 25px 10px 15px;
- width: 300px;
-}
-
-#theme-information .action-button {
- border-top-width: 1px;
- border-top-style: solid;
- margin: 10px 5px 20px;
-}
-
-#theme-information .action-button #cancel {
- float: left;
- margin: 10px 15px;
-}
-
-#theme-information .action-button #install {
- float: right;
- margin: 10px 15px;
-}
-
-#theme-information .available-theme h3 {
- margin: 1em 0;
-}
-
-body#theme-information {
- height: auto;
-}
-
-.feature-filter {
- -moz-border-radius: 8px;
- -khtml-border-radius: 8px;
- -webkit-border-radius: 8px;
- border-radius: 8px;
- border-width: 1px;
- border-style: solid;
- padding: 8px 12px 0;
-}
-
-.feature-filter .feature-group {
- float: left;
- margin-bottom: 20px;
- width: 695px;
-}
-
-.feature-filter .feature-name {
- float: left;
- text-align: right;
- width: 95px;
-}
-
-.feature-filter .feature-group li {
- display: inline;
- float: left;
- list-style-type: none;
- padding-right: 25px;
- min-width: 145px;
-}
+div.star-holder{position:relative;height:19px;width:100px;font-size:19px;}div.star{height:100%;position:absolute;top:0;left:0;background-color:transparent;letter-spacing:1ex;border:none;}.star1{width:20%;}.star2{width:40%;}.star3{width:60%;}.star4{width:80%;}.star5{width:100%;}.star img,div.star a,div.star a:hover,div.star a:visited{display:block;position:absolute;right:0;border:none;text-decoration:none;}div.star img{width:19px;height:19px;border-left:1px solid #fff;border-right:1px solid #fff;}.theme-listing .theme-item{display:inline-block;width:200px;border:thin solid #ccc;vertical-align:top;}.theme-listing .theme-item h3{text-align:center;font-size:14px;font-style:italic;margin:0;padding:0;}.theme-listing .theme-item img{max-width:150px;max-height:150px;}.theme-listing .theme-item-info span{display:none;}.theme-listing .theme-item:hover .theme-item-info span{display:inline;}.theme-listing .theme-item:hover .theme-item-info span.dots{display:none;}.theme-listing .theme-item-info span.action-links{font-weight:bold;text-align:center;}.theme-listing br.line{border-bottom-width:1px;border-bottom-style:solid;margin-bottom:3px;}.available-theme{padding:20px 15px;}#theme-information .theme-preview-img{float:left;margin:5px 25px 10px 15px;width:300px;}#theme-information .action-button{border-top-width:1px;border-top-style:solid;margin:10px 5px 20px;}#theme-information .action-button #cancel{float:left;margin:10px 15px;}#theme-information .action-button #install{float:right;margin:10px 15px;}#theme-information .available-theme h3{margin:1em 0;}body#theme-information{height:auto;}.feature-filter{-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;border-width:1px;border-style:solid;padding:8px 12px 0;}.feature-filter .feature-group{float:left;margin-bottom:20px;width:695px;}.feature-filter .feature-name{float:left;text-align:right;width:95px;}.feature-filter .feature-group li{display:inline;float:left;list-style-type:none;padding-right:25px;min-width:145px;}
\ No newline at end of file
--- /dev/null
+/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */
+div.star-holder {
+ position: relative;
+ height: 19px;
+ width: 100px;
+ font-size: 19px;
+}
+
+div.star {
+ height: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ background-color: transparent;
+ letter-spacing: 1ex;
+ border: none;
+}
+
+.star1 { width: 20%; }
+.star2 { width: 40%; }
+.star3 { width: 60%; }
+.star4 { width: 80%; }
+.star5 { width: 100%; }
+
+.star img, div.star a, div.star a:hover, div.star a:visited {
+ display: block;
+ position: absolute;
+ right: 0;
+ border: none;
+ text-decoration: none;
+}
+
+div.star img {
+ width: 19px;
+ height: 19px;
+ border-left: 1px solid #fff;
+ border-right: 1px solid #fff;
+}
+
+.theme-listing .theme-item {
+ display: inline-block;
+ width: 200px;
+ border: thin solid #ccc;
+ vertical-align: top;
+}
+
+.theme-listing .theme-item h3 {
+ text-align: center;
+ font-size: 14px;
+ font-style: italic;
+ margin: 0;
+ padding: 0;
+}
+
+.theme-listing .theme-item img {
+ max-width: 150px;
+ max-height: 150px;
+}
+
+.theme-listing .theme-item-info span {
+ display: none;
+}
+.theme-listing .theme-item:hover .theme-item-info span {
+ display: inline;
+}
+.theme-listing .theme-item:hover .theme-item-info span.dots {
+ display: none;
+}
+.theme-listing .theme-item-info span.action-links {
+ font-weight: bold;
+ text-align: center;
+}
+
+.theme-listing br.line {
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+ margin-bottom: 3px;
+}
+
+.available-theme {
+ padding: 20px 15px;
+}
+
+#theme-information .theme-preview-img {
+ float: left;
+ margin: 5px 25px 10px 15px;
+ width: 300px;
+}
+
+#theme-information .action-button {
+ border-top-width: 1px;
+ border-top-style: solid;
+ margin: 10px 5px 20px;
+}
+
+#theme-information .action-button #cancel {
+ float: left;
+ margin: 10px 15px;
+}
+
+#theme-information .action-button #install {
+ float: right;
+ margin: 10px 15px;
+}
+
+#theme-information .available-theme h3 {
+ margin: 1em 0;
+}
+
+body#theme-information {
+ height: auto;
+}
+
+.feature-filter {
+ -moz-border-radius: 8px;
+ -khtml-border-radius: 8px;
+ -webkit-border-radius: 8px;
+ border-radius: 8px;
+ border-width: 1px;
+ border-style: solid;
+ padding: 8px 12px 0;
+}
+
+.feature-filter .feature-group {
+ float: left;
+ margin-bottom: 20px;
+ width: 695px;
+}
+
+.feature-filter .feature-name {
+ float: left;
+ text-align: right;
+ width: 95px;
+}
+
+.feature-filter .feature-group li {
+ display: inline;
+ float: left;
+ list-style-type: none;
+ padding-right: 25px;
+ min-width: 145px;
+}
-html,
-body {
- min-width: 950px;
-}
-
-/* 2 column liquid layout */
-div.widget-liquid-left {
- float: left;
- clear: left;
- width: 100%;
- margin-right: -325px;
-}
-
-div#widgets-left {
- margin-left: 5px;
- margin-right: 325px;
-}
-
-div#widgets-right {
- width: 285px;
- margin: 0 auto;
-}
-
-div.widget-liquid-right {
- float: right;
- clear: right;
- width: 300px;
-}
-
-.widget-liquid-right .widget,
-#wp_inactive_widgets .widget {
- width: 250px;
- margin: 0 auto 20px;
- overflow: hidden;
-}
-
-#wp_inactive_widgets .widget {
- margin: 0 10px 20px;
- float: left;
-}
-
-div.sidebar-name h3 {
- margin: 0;
- padding: 5px 12px;
- font-size: 13px;
- height: 19px;
- overflow: hidden;
- white-space: nowrap;
-}
-
-div.sidebar-name {
- background-repeat: repeat-x;
- background-position: 0 0;
- cursor: pointer;
- font-size: 13px;
- border-width: 1px;
- border-style: solid;
- -moz-border-radius-topleft: 8px;
- -moz-border-radius-topright: 8px;
- -webkit-border-top-right-radius: 8px;
- -webkit-border-top-left-radius: 8px;
- -khtml-border-top-right-radius: 8px;
- -khtml-border-top-left-radius: 8px;
- border-top-right-radius: 8px;
- border-top-left-radius: 8px;
-}
-
-.js .closed .sidebar-name {
- -moz-border-radius-bottomleft: 8px;
- -moz-border-radius-bottomright: 8px;
- -webkit-border-bottom-right-radius: 8px;
- -webkit-border-bottom-left-radius: 8px;
- -khtml-border-bottom-right-radius: 8px;
- -khtml-border-bottom-left-radius: 8px;
- border-bottom-right-radius: 8px;
- border-bottom-left-radius: 8px;
-}
-
-.widget-liquid-right .widgets-sortables,
-#widgets-left .widget-holder {
- border-width: 0 1px 1px;
- border-style: none solid solid;
- -moz-border-radius-bottomleft: 8px;
- -moz-border-radius-bottomright: 8px;
- -webkit-border-bottom-right-radius: 8px;
- -webkit-border-bottom-left-radius: 8px;
- -khtml-border-bottom-right-radius: 8px;
- -khtml-border-bottom-left-radius: 8px;
- border-bottom-right-radius: 8px;
- border-bottom-left-radius: 8px;
-}
-
-.js .closed .widgets-sortables,
-.js .closed .widget-holder {
- display: none;
-}
-
-.widget-liquid-right .widgets-sortables {
- padding: 15px 0 0;
-}
-
-#available-widgets .widget-holder {
- padding: 7px 5px 0;
-}
-
-#wp_inactive_widgets {
- padding: 5px 5px 0;
-}
-
-#widget-list .widget {
- width: 250px;
- margin: 0 10px 15px;
- border: 0 none;
- float: left;
-}
-
-#widget-list .widget-description {
- padding: 5px 8px;
-}
-
-#widget-list .widget-top {
- border-width: 1px;
- border-style: solid;
- -moz-border-radius: 6px;
- -khtml-border-radius: 6px;
- -webkit-border-radius: 6px;
- border-radius: 6px;
-}
-
-.widget-placeholder {
- border-width: 1px;
- border-style: dashed;
- margin: 0 auto 20px;
- height: 26px;
- width: 250px;
-}
-
-#wp_inactive_widgets .widget-placeholder {
- margin: 0 10px 20px;
- float: left;
-}
-
-div.widgets-holder-wrap {
- padding: 0;
- margin: 10px 0 20px;
-}
-
-#widgets-left #available-widgets {
- background-color: transparent;
- border: 0 none;
-}
-
-ul#widget-list {
- list-style: none;
- margin: 0;
- padding: 0;
- min-height: 100px;
-}
-
-.widget .widget-top {
- font-size: 12px;
- font-weight: bold;
- height: 26px;
- overflow: hidden;
-}
-
-.widget-top .widget-title {
- padding: 5px 9px;
-}
-
-.widget-top .widget-title-action {
- float: right;
-}
-
-a.widget-action {
- display: block;
- width: 24px;
- height: 26px;
-}
-
-#available-widgets a.widget-action {
- display: none;
-}
-
-.widget-top a.widget-action {
- background: url("../images/menu-bits.gif") no-repeat scroll 0 -110px;
-}
-
-.widget .widget-inside,
-.widget .widget-description {
- padding: 12px 12px 10px;
- font-size: 11px;
- line-height: 16px;
-}
-
-.widget-inside,
-.widget-description {
- display: none;
-}
-
-#available-widgets .widget-description {
- display: block;
-}
-
-.widget .widget-inside p {
- margin: 0 0 1em;
- padding: 0;
-}
-
-.widget-title h4 {
- margin: 0;
- line-height: 1.3;
- overflow: hidden;
- white-space: nowrap;
-}
-
-.widgets-sortables {
- min-height: 90px;
-}
-
-.widget-control-actions {
- margin-top: 8px;
-}
-
-.widget-control-actions a {
- text-decoration: none;
-}
-
-.widget-control-actions a:hover {
- text-decoration: underline;
-}
-
-.widget-control-actions .ajax-feedback {
- padding-bottom: 3px;
-}
-
-.widget-control-actions div.alignleft {
- margin-top: 6px;
-}
-
-div#sidebar-info {
- padding: 0 1em;
- margin-bottom: 1em;
- font-size: 11px;
-}
-
-.widget-title a,
-.widget-title a:hover {
- text-decoration: none;
- border-bottom: none;
-}
-
-.widget-control-edit {
- display: block;
- font-size: 11px;
- font-weight: normal;
- line-height: 26px;
- padding: 0 8px 0 0;
-}
-
-a.widget-control-edit {
- text-decoration: none;
-}
-
-.widget-control-edit .add,
-.widget-control-edit .edit {
- display: none;
-}
-
-#available-widgets .widget-control-edit .add,
-#widgets-right .widget-control-edit .edit,
-#wp_inactive_widgets .widget-control-edit .edit {
- display: inline;
-}
-
-.editwidget {
- margin: 0 auto 15px;
-}
-
-.editwidget .widget-inside {
- display: block;
- border-width: 1px;
- border-style: solid;
- padding: 10px;
- -moz-border-radius: 6px;
- -khtml-border-radius: 6px;
- -webkit-border-radius: 6px;
- border-radius: 6px;
-}
-
-.inactive p.description {
- margin: 5px 15px 8px;
-}
-
-#available-widgets p.description {
- margin: 0 12px 12px;
-}
-
-.widget-position {
- margin-top: 8px;
-}
-
-.inactive {
- padding-top: 2px;
-}
-
-.sidebar-name-arrow {
- float: right;
- height: 29px;
- width: 26px;
-}
-
-.widget-title .in-widget-title {
- font-size: 11px;
- white-space: nowrap;
-}
-
-#removing-widget {
- display: none;
- font-weight: normal;
- padding-left: 15px;
- font-size: 12px;
-}
-
-.widget-control-noform,
-#access-off,
-.widgets_access .widget-action,
-.widgets_access .sidebar-name-arrow,
-.widgets_access #access-on,
-.widgets_access .widget-holder .description {
- display: none;
-}
-
-.widgets_access .widget-holder,
-.widgets_access #widget-list {
- padding-top: 10px;
-}
-
-.widgets_access #access-off {
- display: inline;
-}
-
-.widgets_access #wpbody-content .widget-title-action,
-.widgets_access #wpbody-content .widget-control-edit,
-.widgets_access .closed .widgets-sortables,
-.widgets_access .closed .widget-holder {
- display: block;
-}
-
-.widgets_access .closed .sidebar-name {
- -moz-border-radius-bottomleft: 0;
- -moz-border-radius-bottomright: 0;
- -webkit-border-bottom-right-radius: 0;
- -webkit-border-bottom-left-radius: 0;
- -khtml-border-bottom-right-radius: 0;
- -khtml-border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 0;
-}
-
-.widgets_access .sidebar-name,
-.widgets_access .widget .widget-top {
- cursor: default;
-}
-
+html,body{min-width:950px;}div.widget-liquid-left{float:left;clear:left;width:100%;margin-right:-325px;}div#widgets-left{margin-left:5px;margin-right:325px;}div#widgets-right{width:285px;margin:0 auto;}div.widget-liquid-right{float:right;clear:right;width:300px;}.widget-liquid-right .widget,#wp_inactive_widgets .widget,.widget-liquid-right .sidebar-description{width:250px;margin:0 auto 20px;overflow:hidden;}.widget-liquid-right .sidebar-description{margin-bottom:10px;}#wp_inactive_widgets .widget{margin:0 10px 20px;float:left;}div.sidebar-name h3{margin:0;padding:5px 12px;font-size:13px;height:19px;overflow:hidden;white-space:nowrap;}div.sidebar-name{background-repeat:repeat-x;background-position:0 0;cursor:pointer;font-size:13px;border-width:1px;border-style:solid;-moz-border-radius-topleft:8px;-moz-border-radius-topright:8px;-webkit-border-top-right-radius:8px;-webkit-border-top-left-radius:8px;-khtml-border-top-right-radius:8px;-khtml-border-top-left-radius:8px;border-top-right-radius:8px;border-top-left-radius:8px;}.js .closed .sidebar-name{-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;-webkit-border-bottom-right-radius:8px;-webkit-border-bottom-left-radius:8px;-khtml-border-bottom-right-radius:8px;-khtml-border-bottom-left-radius:8px;border-bottom-right-radius:8px;border-bottom-left-radius:8px;}.widget-liquid-right .widgets-sortables,#widgets-left .widget-holder{border-width:0 1px 1px;border-style:none solid solid;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;-webkit-border-bottom-right-radius:8px;-webkit-border-bottom-left-radius:8px;-khtml-border-bottom-right-radius:8px;-khtml-border-bottom-left-radius:8px;border-bottom-right-radius:8px;border-bottom-left-radius:8px;}.js .closed .widgets-sortables,.js .closed .widget-holder{display:none;}.widget-liquid-right .widgets-sortables{padding:15px 0 0;}#available-widgets .widget-holder{padding:7px 5px 0;}#wp_inactive_widgets{padding:5px 5px 0;}#widget-list .widget{width:250px;margin:0 10px 15px;border:0 none;float:left;}#widget-list .widget-description{padding:5px 8px;}#widget-list .widget-top{border-width:1px;border-style:solid;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.widget-placeholder{border-width:1px;border-style:dashed;margin:0 auto 20px;height:26px;width:250px;}#wp_inactive_widgets .widget-placeholder{margin:0 10px 20px;float:left;}div.widgets-holder-wrap{padding:0;margin:10px 0 20px;}#widgets-left #available-widgets{background-color:transparent;border:0 none;}ul#widget-list{list-style:none;margin:0;padding:0;min-height:100px;}.widget .widget-top{font-size:12px;font-weight:bold;height:26px;overflow:hidden;}.widget-top .widget-title{padding:5px 9px;}.widget-top .widget-title-action{float:right;}a.widget-action{display:block;width:24px;height:26px;}#available-widgets a.widget-action{display:none;}.widget-top a.widget-action{background:url("../images/menu-bits.gif") no-repeat scroll 0 -110px;}.widget .widget-inside,.widget .widget-description{padding:12px 12px 10px;font-size:11px;line-height:16px;}.widget-inside,.widget-description{display:none;}#available-widgets .widget-description{display:block;}.widget .widget-inside p{margin:0 0 1em;padding:0;}.widget-title h4{margin:0;line-height:1.3;overflow:hidden;white-space:nowrap;}.widgets-sortables{min-height:90px;}.widget-control-actions{margin-top:8px;}.widget-control-actions a{text-decoration:none;}.widget-control-actions a:hover{text-decoration:underline;}.widget-control-actions .ajax-feedback{padding-bottom:3px;}.widget-control-actions div.alignleft{margin-top:6px;}div#sidebar-info{padding:0 1em;margin-bottom:1em;font-size:11px;}.widget-title a,.widget-title a:hover{text-decoration:none;border-bottom:none;}.widget-control-edit{display:block;font-size:11px;font-weight:normal;line-height:26px;padding:0 8px 0 0;}a.widget-control-edit{text-decoration:none;}.widget-control-edit .add,.widget-control-edit .edit{display:none;}#available-widgets .widget-control-edit .add,#widgets-right .widget-control-edit .edit,#wp_inactive_widgets .widget-control-edit .edit{display:inline;}.editwidget{margin:0 auto 15px;}.editwidget .widget-inside{display:block;border-width:1px;border-style:solid;padding:10px;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.inactive p.description{margin:5px 15px 8px;}#available-widgets p.description{margin:0 12px 12px;}.widget-position{margin-top:8px;}.inactive{padding-top:2px;}.sidebar-name-arrow{float:right;height:29px;width:26px;}.widget-title .in-widget-title{font-size:11px;white-space:nowrap;}#removing-widget{display:none;font-weight:normal;padding-left:15px;font-size:12px;}.widget-control-noform,#access-off,.widgets_access .widget-action,.widgets_access .sidebar-name-arrow,.widgets_access #access-on,.widgets_access .widget-holder .description{display:none;}.widgets_access .widget-holder,.widgets_access #widget-list{padding-top:10px;}.widgets_access #access-off{display:inline;}.widgets_access #wpbody-content .widget-title-action,.widgets_access #wpbody-content .widget-control-edit,.widgets_access .closed .widgets-sortables,.widgets_access .closed .widget-holder{display:block;}.widgets_access .closed .sidebar-name{-moz-border-radius-bottomleft:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;}.widgets_access .sidebar-name,.widgets_access .widget .widget-top{cursor:default;}
\ No newline at end of file
--- /dev/null
+html,
+body {
+ min-width: 950px;
+}
+
+/* 2 column liquid layout */
+div.widget-liquid-left {
+ float: left;
+ clear: left;
+ width: 100%;
+ margin-right: -325px;
+}
+
+div#widgets-left {
+ margin-left: 5px;
+ margin-right: 325px;
+}
+
+div#widgets-right {
+ width: 285px;
+ margin: 0 auto;
+}
+
+div.widget-liquid-right {
+ float: right;
+ clear: right;
+ width: 300px;
+}
+
+.widget-liquid-right .widget,
+#wp_inactive_widgets .widget,
+.widget-liquid-right .sidebar-description {
+ width: 250px;
+ margin: 0 auto 20px;
+ overflow: hidden;
+}
+
+.widget-liquid-right .sidebar-description {
+ margin-bottom: 10px;
+}
+
+#wp_inactive_widgets .widget {
+ margin: 0 10px 20px;
+ float: left;
+}
+
+div.sidebar-name h3 {
+ margin: 0;
+ padding: 5px 12px;
+ font-size: 13px;
+ height: 19px;
+ overflow: hidden;
+ white-space: nowrap;
+}
+
+div.sidebar-name {
+ background-repeat: repeat-x;
+ background-position: 0 0;
+ cursor: pointer;
+ font-size: 13px;
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius-topleft: 8px;
+ -moz-border-radius-topright: 8px;
+ -webkit-border-top-right-radius: 8px;
+ -webkit-border-top-left-radius: 8px;
+ -khtml-border-top-right-radius: 8px;
+ -khtml-border-top-left-radius: 8px;
+ border-top-right-radius: 8px;
+ border-top-left-radius: 8px;
+}
+
+.js .closed .sidebar-name {
+ -moz-border-radius-bottomleft: 8px;
+ -moz-border-radius-bottomright: 8px;
+ -webkit-border-bottom-right-radius: 8px;
+ -webkit-border-bottom-left-radius: 8px;
+ -khtml-border-bottom-right-radius: 8px;
+ -khtml-border-bottom-left-radius: 8px;
+ border-bottom-right-radius: 8px;
+ border-bottom-left-radius: 8px;
+}
+
+.widget-liquid-right .widgets-sortables,
+#widgets-left .widget-holder {
+ border-width: 0 1px 1px;
+ border-style: none solid solid;
+ -moz-border-radius-bottomleft: 8px;
+ -moz-border-radius-bottomright: 8px;
+ -webkit-border-bottom-right-radius: 8px;
+ -webkit-border-bottom-left-radius: 8px;
+ -khtml-border-bottom-right-radius: 8px;
+ -khtml-border-bottom-left-radius: 8px;
+ border-bottom-right-radius: 8px;
+ border-bottom-left-radius: 8px;
+}
+
+.js .closed .widgets-sortables,
+.js .closed .widget-holder {
+ display: none;
+}
+
+.widget-liquid-right .widgets-sortables {
+ padding: 15px 0 0;
+}
+
+#available-widgets .widget-holder {
+ padding: 7px 5px 0;
+}
+
+#wp_inactive_widgets {
+ padding: 5px 5px 0;
+}
+
+#widget-list .widget {
+ width: 250px;
+ margin: 0 10px 15px;
+ border: 0 none;
+ float: left;
+}
+
+#widget-list .widget-description {
+ padding: 5px 8px;
+}
+
+#widget-list .widget-top {
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 6px;
+ -khtml-border-radius: 6px;
+ -webkit-border-radius: 6px;
+ border-radius: 6px;
+}
+
+.widget-placeholder {
+ border-width: 1px;
+ border-style: dashed;
+ margin: 0 auto 20px;
+ height: 26px;
+ width: 250px;
+}
+
+#wp_inactive_widgets .widget-placeholder {
+ margin: 0 10px 20px;
+ float: left;
+}
+
+div.widgets-holder-wrap {
+ padding: 0;
+ margin: 10px 0 20px;
+}
+
+#widgets-left #available-widgets {
+ background-color: transparent;
+ border: 0 none;
+}
+
+ul#widget-list {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ min-height: 100px;
+}
+
+.widget .widget-top {
+ font-size: 12px;
+ font-weight: bold;
+ height: 26px;
+ overflow: hidden;
+}
+
+.widget-top .widget-title {
+ padding: 5px 9px;
+}
+
+.widget-top .widget-title-action {
+ float: right;
+}
+
+a.widget-action {
+ display: block;
+ width: 24px;
+ height: 26px;
+}
+
+#available-widgets a.widget-action {
+ display: none;
+}
+
+.widget-top a.widget-action {
+ background: url("../images/menu-bits.gif") no-repeat scroll 0 -110px;
+}
+
+.widget .widget-inside,
+.widget .widget-description {
+ padding: 12px 12px 10px;
+ font-size: 11px;
+ line-height: 16px;
+}
+
+.widget-inside,
+.widget-description {
+ display: none;
+}
+
+#available-widgets .widget-description {
+ display: block;
+}
+
+.widget .widget-inside p {
+ margin: 0 0 1em;
+ padding: 0;
+}
+
+.widget-title h4 {
+ margin: 0;
+ line-height: 1.3;
+ overflow: hidden;
+ white-space: nowrap;
+}
+
+.widgets-sortables {
+ min-height: 90px;
+}
+
+.widget-control-actions {
+ margin-top: 8px;
+}
+
+.widget-control-actions a {
+ text-decoration: none;
+}
+
+.widget-control-actions a:hover {
+ text-decoration: underline;
+}
+
+.widget-control-actions .ajax-feedback {
+ padding-bottom: 3px;
+}
+
+.widget-control-actions div.alignleft {
+ margin-top: 6px;
+}
+
+div#sidebar-info {
+ padding: 0 1em;
+ margin-bottom: 1em;
+ font-size: 11px;
+}
+
+.widget-title a,
+.widget-title a:hover {
+ text-decoration: none;
+ border-bottom: none;
+}
+
+.widget-control-edit {
+ display: block;
+ font-size: 11px;
+ font-weight: normal;
+ line-height: 26px;
+ padding: 0 8px 0 0;
+}
+
+a.widget-control-edit {
+ text-decoration: none;
+}
+
+.widget-control-edit .add,
+.widget-control-edit .edit {
+ display: none;
+}
+
+#available-widgets .widget-control-edit .add,
+#widgets-right .widget-control-edit .edit,
+#wp_inactive_widgets .widget-control-edit .edit {
+ display: inline;
+}
+
+.editwidget {
+ margin: 0 auto 15px;
+}
+
+.editwidget .widget-inside {
+ display: block;
+ border-width: 1px;
+ border-style: solid;
+ padding: 10px;
+ -moz-border-radius: 6px;
+ -khtml-border-radius: 6px;
+ -webkit-border-radius: 6px;
+ border-radius: 6px;
+}
+
+.inactive p.description {
+ margin: 5px 15px 8px;
+}
+
+#available-widgets p.description {
+ margin: 0 12px 12px;
+}
+
+.widget-position {
+ margin-top: 8px;
+}
+
+.inactive {
+ padding-top: 2px;
+}
+
+.sidebar-name-arrow {
+ float: right;
+ height: 29px;
+ width: 26px;
+}
+
+.widget-title .in-widget-title {
+ font-size: 11px;
+ white-space: nowrap;
+}
+
+#removing-widget {
+ display: none;
+ font-weight: normal;
+ padding-left: 15px;
+ font-size: 12px;
+}
+
+.widget-control-noform,
+#access-off,
+.widgets_access .widget-action,
+.widgets_access .sidebar-name-arrow,
+.widgets_access #access-on,
+.widgets_access .widget-holder .description {
+ display: none;
+}
+
+.widgets_access .widget-holder,
+.widgets_access #widget-list {
+ padding-top: 10px;
+}
+
+.widgets_access #access-off {
+ display: inline;
+}
+
+.widgets_access #wpbody-content .widget-title-action,
+.widgets_access #wpbody-content .widget-control-edit,
+.widgets_access .closed .widgets-sortables,
+.widgets_access .closed .widget-holder {
+ display: block;
+}
+
+.widgets_access .closed .sidebar-name {
+ -moz-border-radius-bottomleft: 0;
+ -moz-border-radius-bottomright: 0;
+ -webkit-border-bottom-right-radius: 0;
+ -webkit-border-bottom-left-radius: 0;
+ -khtml-border-bottom-right-radius: 0;
+ -khtml-border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+ border-bottom-left-radius: 0;
+}
+
+.widgets_access .sidebar-name,
+.widgets_access .widget .widget-top {
+ cursor: default;
+}
+
$alt = '';
$posts_columns = get_column_headers('upload');
$hidden = get_hidden_columns('upload');
-while (have_posts()) : the_post();
+
+while ( have_posts() ) : the_post();
+
+if ( $is_trash && $post->post_status != 'trash' )
+ continue;
+elseif ( !$is_trash && $post->post_status == 'trash' )
+ continue;
+
$alt = ( 'alternate' == $alt ) ? '' : 'alternate';
global $current_user;
$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
$att_title = _draft_or_post_title();
-
?>
<tr id='post-<?php echo $id; ?>' class='<?php echo trim( $alt . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
case 'cb':
?>
- <th scope="row" class="check-column"><input type="checkbox" name="media[]" value="<?php the_ID(); ?>" /></th>
+ <th scope="row" class="check-column"><?php if ( current_user_can('edit_post', $post->ID) ) { ?><input type="checkbox" name="media[]" value="<?php the_ID(); ?>" /><?php } ?></th>
<?php
break;
?>
<td <?php echo $attributes ?>><?php
if ( $thumb = wp_get_attachment_image( $post->ID, array(80, 60), true ) ) {
+ if ( $is_trash ) echo $thumb;
+ else {
?>
-
<a href="media.php?action=edit&attachment_id=<?php the_ID(); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>">
<?php echo $thumb; ?>
</a>
<?php }
+ }
?></td>
<?php
// TODO
case 'media':
?>
- <td <?php echo $attributes ?>><strong><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br />
+ <td <?php echo $attributes ?>><strong><?php if ( $is_trash ) echo $att_title; else { ?><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php echo $att_title; ?></a><?php } ?></strong><br />
<?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post->ID))); ?>
<p>
<?php
$actions = array();
- if ( current_user_can('edit_post', $post->ID) )
+ if ( current_user_can('edit_post', $post->ID) && !$is_trash )
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
- if ( current_user_can('delete_post', $post->ID) )
- $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
- $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
+ if ( current_user_can('delete_post', $post->ID) ) {
+ if ( $is_trash )
+ $actions['untrash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=untrash&post=$post->ID", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>";
+ elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH )
+ $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>";
+ if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH )
+ $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
+ }
+ if ( !$is_trash )
+ $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
+ $actions = apply_filters( 'media_row_actions', $actions, $post );
$action_count = count($actions);
$i = 0;
echo '<div class="row-actions">';
<?php
} else {
?>
- <td <?php echo $attributes ?>> </td>
+ <td <?php echo $attributes ?>><?php _e('(Unattached)'); ?><br />
+ <a class="hide-if-no-js" onclick="findPosts.open('media[]','<?php echo $post->ID ?>');return false;" href="#the-list"><?php _e('Attach'); ?></a></td>
<?php
}
<?php
} // end if ( have_posts() )
?>
+
<tr class="form-field form-required">
<th scope="row" valign="top"><label for="cat_name"><?php _e('Category Name') ?></label></th>
<td><input name="cat_name" id="cat_name" type="text" value="<?php echo esc_attr($category->name); ?>" size="40" aria-required="true" /><br />
- <span class="description"><?php _e('The name is used to identify the category almost everywhere, for example under the post or in the category widget.'); ?></span></td>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="category_nicename"><?php _e('Category Slug') ?></label></th>
<tr class="form-field">
<th scope="row" valign="top"><label for="category_parent"><?php _e('Category Parent') ?></label></th>
<td>
- <?php wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br />
+ <?php wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'exclude' => $category->term_id, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br />
<span class="description"><?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?></span>
</td>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="category_description"><?php _e('Description') ?></label></th>
<td><textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"><?php echo esc_html($category->description); ?></textarea><br />
- <span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td>
+ <span class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></span></td>
</tr>
<?php do_action('edit_category_form_fields', $category); ?>
</table>
$post_id = isset($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0;
-if ( ( isset( $_REQUEST['delete_all_spam'] ) || isset( $_REQUEST['delete_all_spam2'] ) ) && !empty( $_REQUEST['pagegen_timestamp'] ) ) {
- check_admin_referer('bulk-spam-delete', '_spam_nonce');
+if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2']) ) {
+ check_admin_referer('bulk-comments');
- $delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] );
- if ( current_user_can('moderate_comments')) {
- $deleted_spam = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam' AND '$delete_time' > comment_date_gmt" );
+ if ( (isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2'])) && !empty($_REQUEST['pagegen_timestamp']) ) {
+ $comment_status = $wpdb->escape($_REQUEST['comment_status']);
+ $delete_time = $wpdb->escape($_REQUEST['pagegen_timestamp']);
+ $comment_ids = $wpdb->get_col( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = '$comment_status' AND '$delete_time' > comment_date_gmt" );
+ $doaction = 'delete';
+ } elseif ( ($_REQUEST['action'] != -1 || $_REQUEST['action2'] != -1) && isset($_REQUEST['delete_comments']) ) {
+ $comment_ids = $_REQUEST['delete_comments'];
+ $doaction = ($_REQUEST['action'] != -1) ? $_REQUEST['action'] : $_REQUEST['action2'];
+ } elseif ( $_REQUEST['doaction'] == 'undo' && isset($_REQUEST['ids']) ) {
+ $comment_ids = array_map( 'absint', explode(',', $_REQUEST['ids']) );
+ $doaction = $_REQUEST['action'];
} else {
- $deleted_spam = 0;
+ wp_redirect($_SERVER['HTTP_REFERER']);
}
- $redirect_to = 'edit-comments.php?comment_status=spam&deleted=' . (int) $deleted_spam;
- if ( $post_id )
- $redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to );
- wp_redirect( $redirect_to );
-} elseif ( isset($_REQUEST['delete_comments']) && isset($_REQUEST['action']) && ( -1 != $_REQUEST['action'] || -1 != $_REQUEST['action2'] ) ) {
- check_admin_referer('bulk-comments');
- $doaction = ( -1 != $_REQUEST['action'] ) ? $_REQUEST['action'] : $_REQUEST['action2'];
- $deleted = $approved = $unapproved = $spammed = 0;
- foreach ( (array) $_REQUEST['delete_comments'] as $comment_id) : // Check the permissions on each
- $comment_id = (int) $comment_id;
+ $approved = $unapproved = $spammed = $unspammed = $trashed = $untrashed = $deleted = 0;
+
+ foreach ($comment_ids as $comment_id) { // Check the permissions on each
$_post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment_id) );
if ( !current_user_can('edit_post', $_post_id) )
continue;
switch( $doaction ) {
- case 'markspam' :
- wp_set_comment_status($comment_id, 'spam');
- $spammed++;
- break;
- case 'delete' :
- wp_set_comment_status($comment_id, 'delete');
- $deleted++;
- break;
case 'approve' :
wp_set_comment_status($comment_id, 'approve');
$approved++;
wp_set_comment_status($comment_id, 'hold');
$unapproved++;
break;
+ case 'spam' :
+ wp_spam_comment($comment_id);
+ $spammed++;
+ break;
+ case 'unspam' :
+ wp_unspam_comment($comment_id);
+ $unspammed++;
+ break;
+ case 'trash' :
+ wp_trash_comment($comment_id);
+ $trashed++;
+ break;
+ case 'untrash' :
+ wp_untrash_comment($comment_id);
+ $untrashed++;
+ break;
+ case 'delete' :
+ wp_delete_comment($comment_id);
+ $deleted++;
+ break;
}
- endforeach;
+ }
+
+ $redirect_to = 'edit-comments.php';
+
+ if ( $approved )
+ $redirect_to = add_query_arg( 'approved', $approved, $redirect_to );
+ if ( $unapproved )
+ $redirect_to = add_query_arg( 'unapproved', $unapproved, $redirect_to );
+ if ( $spammed )
+ $redirect_to = add_query_arg( 'spammed', $spammed, $redirect_to );
+ if ( $unspammed )
+ $redirect_to = add_query_arg( 'unspammed', $unspammed, $redirect_to );
+ if ( $trashed )
+ $redirect_to = add_query_arg( 'trashed', $trashed, $redirect_to );
+ if ( $untrashed )
+ $redirect_to = add_query_arg( 'untrashed', $untrashed, $redirect_to );
+ if ( $deleted )
+ $redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to );
+ if ( $trashed || $spammed )
+ $redirect_to = add_query_arg( 'ids', join(',', $comment_ids), $redirect_to );
- $redirect_to = 'edit-comments.php?deleted=' . $deleted . '&approved=' . $approved . '&spam=' . $spammed . '&unapproved=' . $unapproved;
if ( $post_id )
$redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to );
if ( isset($_REQUEST['apage']) )
$mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : esc_attr($_GET['mode']);
$comment_status = isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all';
-if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam')) )
+if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam', 'trash')) )
$comment_status = 'all';
$comment_type = !empty($_GET['comment_type']) ? esc_attr($_GET['comment_type']) : '';
</h2>
<?php
-if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['spam'] ) ) {
- $approved = isset( $_GET['approved'] ) ? (int) $_GET['approved'] : 0;
- $deleted = isset( $_GET['deleted'] ) ? (int) $_GET['deleted'] : 0;
- $spam = isset( $_GET['spam'] ) ? (int) $_GET['spam'] : 0;
-
- if ( $approved > 0 || $deleted > 0 || $spam > 0 ) {
+if ( isset($_GET['approved']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) || isset($_GET['spammed']) || isset($_GET['unspammed']) ) {
+ $approved = isset($_GET['approved']) ? (int) $_GET['approved'] : 0;
+ $deleted = isset($_GET['deleted']) ? (int) $_GET['deleted'] : 0;
+ $trashed = isset($_GET['trashed']) ? (int) $_GET['trashed'] : 0;
+ $untrashed = isset($_GET['untrashed']) ? (int) $_GET['untrashed'] : 0;
+ $spammed = isset($_GET['spammed']) ? (int) $_GET['spammed'] : 0;
+ $unspammed = isset($_GET['unspammed']) ? (int) $_GET['unspammed'] : 0;
+
+ if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 ) {
echo '<div id="moderated" class="updated fade"><p>';
if ( $approved > 0 ) {
printf( _n( '%s comment approved', '%s comments approved', $approved ), $approved );
echo '<br />';
}
-
- if ( $deleted > 0 ) {
- printf( _n( '%s comment deleted', '%s comments deleted', $deleted ), $deleted );
+ if ( $spammed > 0 ) {
+ printf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed );
+ $ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
+ echo ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
+ }
+ if ( $unspammed > 0 ) {
+ printf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed );
echo '<br />';
}
-
- if ( $spam > 0 ) {
- printf( _n( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam );
+ if ( $trashed > 0 ) {
+ printf( _n( '%s comment moved to the trash.', '%s comments moved to the trash.', $trashed ), $trashed );
+ $ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
+ echo ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
+ }
+ if ( $untrashed > 0 ) {
+ printf( _n( '%s comment restored from the trash', '%s comments restored from the trash', $untrashed ), $untrashed );
+ echo '<br />';
+ }
+ if ( $deleted > 0 ) {
+ printf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted );
echo '<br />';
}
//, number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>")
$stati = array(
'all' => _n_noop('All', 'All'), // singular not used
- 'moderated' => _n_noop('Pending (<span class="pending-count">%s</span>)', 'Pending (<span class="pending-count">%s</span>)'),
+ 'moderated' => _n_noop('Pending <span class="count">(<span class="pending-count">%s</span>)</span>', 'Pending <span class="count">(<span class="pending-count">%s</span>)</span>'),
'approved' => _n_noop('Approved', 'Approved'), // singular not used
- 'spam' => _n_noop('Spam (<span class="spam-count">%s</span>)', 'Spam (<span class="spam-count">%s</span>)')
+ 'spam' => _n_noop('Spam <span class="count">(<span class="spam-count">%s</span>)</span>', 'Spam <span class="count">(<span class="spam-count">%s</span>)</span>'),
+ 'trash' => _n_noop('Trash <span class="count">(<span class="trash-count">%s</span>)</span>', 'Trash <span class="count">(<span class="trash-count">%s</span>)</span>')
);
+
+if ( !EMPTY_TRASH_DAYS )
+ unset($stati['trash']);
+
$link = 'edit-comments.php';
if ( !empty($comment_type) && 'all' != $comment_type )
$link = add_query_arg( 'comment_type', $comment_type, $link );
+
foreach ( $stati as $status => $label ) {
$class = '';
</p>
<?php
-$comments_per_page = get_user_option('edit_comments_per_page');
-if ( empty($comments_per_page) )
+$comments_per_page = (int) get_user_option( 'edit_comments_per_page', 0, false );
+if ( empty( $comments_per_page ) || $comments_per_page < 1 )
$comments_per_page = 20;
-$comments_per_page = apply_filters('comments_per_page', $comments_per_page, $comment_status);
+$comments_per_page = apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
if ( isset( $_GET['apage'] ) )
$page = abs( (int) $_GET['apage'] );
<?php if ( 'all' == $comment_status || 'moderated' == $comment_status || 'spam' == $comment_status ): ?>
<option value="approve"><?php _e('Approve'); ?></option>
<?php endif; ?>
-<?php if ( 'spam' != $comment_status ): ?>
-<option value="markspam"><?php _e('Mark as Spam'); ?></option>
+<?php if ( 'all' == $comment_status || 'approved' == $comment_status || 'moderated' == $comment_status ): ?>
+<option value="spam"><?php _e('Mark as Spam'); ?></option>
+<?php endif; ?>
+<?php if ( 'trash' == $comment_status ): ?>
+<option value="untrash"><?php _e('Restore'); ?></option>
+<?php elseif ( 'spam' == $comment_status ): ?>
+<option value="unspam"><?php _e('Not Spam'); ?></option>
+<?php endif; ?>
+<?php if ( 'trash' == $comment_status || 'spam' == $comment_status || !EMPTY_TRASH_DAYS ): ?>
+<option value="delete"><?php _e('Delete Permanently'); ?></option>
+<?php else: ?>
+<option value="trash"><?php _e('Move to Trash'); ?></option>
<?php endif; ?>
-<option value="delete"><?php _e('Delete'); ?></option>
</select>
<input type="submit" name="doaction" id="doaction" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary apply" />
<?php wp_nonce_field('bulk-comments'); ?>
<input type="hidden" name="apage" value="<?php echo esc_attr( absint( $_GET['apage'] ) ); ?>" />
<?php }
-if ( 'spam' == $comment_status ) {
- wp_nonce_field('bulk-spam-delete', '_spam_nonce');
- if ( current_user_can ('moderate_comments')) { ?>
- <input type="submit" name="delete_all_spam" value="<?php esc_attr_e('Delete All Spam'); ?>" class="button-secondary apply" />
-<?php }
+if ( ( 'spam' == $comment_status || 'trash' == $comment_status) && current_user_can ('moderate_comments') ) {
+ wp_nonce_field('bulk-destroy', '_destroy_nonce');
+ if ( 'spam' == $comment_status && current_user_can('moderate_comments') ) { ?>
+ <input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Spam'); ?>" class="button-secondary apply" />
+<?php } elseif ( 'trash' == $comment_status && current_user_can('moderate_comments') ) { ?>
+ <input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
+<?php }
} ?>
<?php do_action('manage_comments_nav', $comment_status); ?>
</div>
<?php if ( 'all' == $comment_status || 'moderated' == $comment_status || 'spam' == $comment_status ): ?>
<option value="approve"><?php _e('Approve'); ?></option>
<?php endif; ?>
-<?php if ( 'spam' != $comment_status ): ?>
-<option value="markspam"><?php _e('Mark as Spam'); ?></option>
+<?php if ( 'all' == $comment_status || 'approved' == $comment_status || 'moderated' == $comment_status ): ?>
+<option value="spam"><?php _e('Mark as Spam'); ?></option>
+<?php endif; ?>
+<?php if ( 'trash' == $comment_status ): ?>
+<option value="untrash"><?php _e('Restore'); ?></option>
+<?php endif; ?>
+<?php if ( 'trash' == $comment_status || 'spam' == $comment_status || !EMPTY_TRASH_DAYS ): ?>
+<option value="delete"><?php _e('Delete Permanently'); ?></option>
+<?php elseif ( 'spam' == $comment_status ): ?>
+<option value="unspam"><?php _e('Not Spam'); ?></option>
+<?php else: ?>
+<option value="trash"><?php _e('Move to Trash'); ?></option>
<?php endif; ?>
-<option value="delete"><?php _e('Delete'); ?></option>
</select>
<input type="submit" name="doaction2" id="doaction2" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary apply" />
-<?php if ( 'spam' == $comment_status ) { ?>
-<input type="submit" name="delete_all_spam2" value="<?php esc_attr_e('Delete All Spam'); ?>" class="button-secondary apply" />
+<?php if ( 'spam' == $comment_status && current_user_can('moderate_comments') ) { ?>
+<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Spam'); ?>" class="button-secondary apply" />
+<?php } elseif ( 'trash' == $comment_status && current_user_can('moderate_comments') ) { ?>
+<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
<?php } ?>
<?php do_action('manage_comments_nav', $comment_status); ?>
</div>
<?php
wp_comment_reply('-1', true, 'detail');
+wp_comment_trashnotice();
include('admin-footer.php'); ?>
$post_ID = isset($post_ID) ? (int) $post_ID : 0;
$action = isset($action) ? $action : '';
-if ( isset($_GET['message']) )
+
+$message = false;
+if ( isset($_GET['message']) ) {
$_GET['message'] = absint( $_GET['message'] );
-$messages[1] = sprintf(__('Post updated. <a href="%s">View post</a>'), get_permalink($post_ID));
-$messages[2] = __('Custom field updated.');
-$messages[3] = __('Custom field deleted.');
-$messages[4] = __('Post updated.');
-$messages[6] = sprintf(__('Post published. <a href="%s">View post</a>'), get_permalink($post_ID));
-$messages[7] = __('Post saved.');
-$messages[8] = sprintf(__('Post submitted. <a href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
-if ( isset($_GET['revision']) )
- $messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
+ switch ( $_GET['message'] ) {
+ case 1:
+ $message = sprintf( __('Post updated. <a href="%s">View post</a>'), get_permalink($post_ID) );
+ break;
+ case 2:
+ $message = __('Custom field updated.');
+ break;
+ case 3:
+ $message = __('Custom field deleted.');
+ break;
+ case 4:
+ $message = __('Post updated.');
+ break;
+ case 5:
+ if ( isset($_GET['revision']) )
+ $message = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
+ break;
+ case 6:
+ $message = sprintf( __('Post published. <a href="%s">View post</a>'), get_permalink($post_ID) );
+ break;
+ case 7:
+ $message = __('Post saved.');
+ break;
+ case 8:
+ $message = sprintf( __('Post submitted. <a target="_blank" href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
+ break;
+ case 9:
+ // translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php
+ $message = sprintf( __('Post scheduled for: <b>%1$s</b>. <a target="_blank" href="%2$s">Preview post</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID) );
+ break;
+ case 10:
+ $message = sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
+ break;
+ }
+}
$notice = false;
-$notices[1] = __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>.' );
-
if ( 0 == $post_ID ) {
$form_action = 'post';
$temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) {
if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) {
- $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
+ $notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>.' ), get_edit_post_link( $autosave->ID ) );
break;
}
}
}
// All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
+require_once('includes/meta-boxes.php');
-/**
- * Display post submit form fields.
- *
- * @since 2.7.0
- *
- * @param object $post
- */
-function post_submit_meta_box($post) {
- global $action;
-
- $can_publish = current_user_can('publish_posts');
-?>
-<div class="submitbox" id="submitpost">
-
-<div id="minor-publishing">
-
-<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
-<div style="display:none;">
-<input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
-</div>
-
-<div id="minor-publishing-actions">
-<div id="save-action">
-<?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>
-<input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" tabindex="4" class="button button-highlighted" />
-<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
-<input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" tabindex="4" class="button button-highlighted" />
-<?php } ?>
-</div>
-
-<div id="preview-action">
-<?php
-if ( 'publish' == $post->post_status ) {
- $preview_link = esc_url(get_permalink($post->ID));
- $preview_button = __('Preview Changes');
-} else {
- $preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
- $preview_button = __('Preview');
-}
-?>
-<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a>
-<input type="hidden" name="wp-preview" id="wp-preview" value="" />
-</div>
-
-<div class="clear"></div>
-</div><?php // /minor-publishing-actions ?>
-
-<div id="misc-publishing-actions">
-
-<div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label>
-<span id="post-status-display">
-<?php
-switch ( $post->post_status ) {
- case 'private':
- _e('Privately Published');
- break;
- case 'publish':
- _e('Published');
- break;
- case 'future':
- _e('Scheduled');
- break;
- case 'pending':
- _e('Pending Review');
- break;
- case 'draft':
- _e('Draft');
- break;
-}
-?>
-</span>
-<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
-<a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
-
-<div id="post-status-select" class="hide-if-js">
-<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr($post->post_status); ?>" />
-<select name='post_status' id='post_status' tabindex='4'>
-<?php if ( 'publish' == $post->post_status ) : ?>
-<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
-<?php elseif ( 'private' == $post->post_status ) : ?>
-<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
-<?php elseif ( 'future' == $post->post_status ) : ?>
-<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
-<?php endif; ?>
-<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
-<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
-</select>
- <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
- <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
-</div>
-
-<?php } ?>
-</div><?php // /misc-pub-section ?>
-
-<div class="misc-pub-section " id="visibility">
-<?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php
-
-if ( 'private' == $post->post_status ) {
- $post->post_password = '';
- $visibility = 'private';
- $visibility_trans = __('Private');
-} elseif ( !empty( $post->post_password ) ) {
- $visibility = 'password';
- $visibility_trans = __('Password protected');
-} elseif ( is_sticky( $post->ID ) ) {
- $visibility = 'public';
- $visibility_trans = __('Public, Sticky');
-} else {
- $visibility = 'public';
- $visibility_trans = __('Public');
-}
-
-?><?php echo esc_html( $visibility_trans ); ?></span> <?php if ( $can_publish ) { ?> <a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
-
-<div id="post-visibility-select" class="hide-if-js">
-<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr($post->post_password); ?>" />
-<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID)); ?> />
-<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" />
-
-
-<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br />
-<span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID)); ?> tabindex="4" /> <label for="sticky" class="selectit"><?php _e('Stick this post to the front page') ?></label><br /></span>
-<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br />
-<span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr($post->post_password); ?>" /><br /></span>
-<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
-
-<p>
- <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
- <a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a>
-</p>
-</div>
-<?php } ?>
-
-</div><?php // /misc-pub-section ?>
-
-
-<?php
-// translators: Publish box date formt, see http://php.net/date
-$datef = __( 'M j, Y @ G:i' );
-if ( 0 != $post->ID ) {
- if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
- $stamp = __('Scheduled for: <b>%1$s</b>');
- } else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
- $stamp = __('Published on: <b>%1$s</b>');
- } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
- $stamp = __('Publish <b>immediately</b>');
- } else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
- $stamp = __('Schedule for: <b>%1$s</b>');
- } else { // draft, 1 or more saves, date specified
- $stamp = __('Publish on: <b>%1$s</b>');
- }
- $date = date_i18n( $datef, strtotime( $post->post_date ) );
-} else { // draft (no saves, and thus no date specified)
- $stamp = __('Publish <b>immediately</b>');
- $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
-}
-
-if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
-<div class="misc-pub-section curtime misc-pub-section-last">
- <span id="timestamp">
- <?php printf($stamp, $date); ?></span>
- <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
- <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
-</div><?php // /misc-pub-section ?>
-<?php endif; ?>
-
-</div>
-<div class="clear"></div>
-</div>
-
-<div id="major-publishing-actions">
-<?php do_action('post_submitbox_start'); ?>
-<div id="delete-action">
-<?php
-if ( ( 'edit' == $action ) && current_user_can('delete_post', $post->ID) ) { ?>
-<a class="submitdelete deletion" href="<?php echo wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
-<?php } ?>
-</div>
-
-<div id="publishing-action">
-<?php
-if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {
- if ( current_user_can('publish_posts') ) :
- if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
- <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" />
- <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Schedule') ?>" />
-<?php else : ?>
- <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
- <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Publish') ?>" />
-<?php endif;
- else : ?>
- <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" />
- <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Submit for Review') ?>" />
-<?php
- endif;
-} else { ?>
- <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update Post') ?>" />
- <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Update Post') ?>" />
-<?php
-} ?>
-</div>
-<div class="clear"></div>
-</div>
-</div>
-
-<?php
-}
add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', 'post', 'side', 'core');
-/**
- * Display post tags form fields.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
-function post_tags_meta_box($post, $box) {
- $tax_name = esc_attr(substr($box['id'], 8));
- $taxonomy = get_taxonomy($tax_name);
- $helps = isset($taxonomy->helps) ? esc_attr($taxonomy->helps) : __('Separate tags with commas.');
-?>
-<div class="tagsdiv" id="<?php echo $tax_name; ?>">
- <div class="jaxtag">
- <div class="nojs-tags hide-if-js">
- <p><?php _e('Add or remove tags'); ?></p>
- <textarea name="<?php echo "tax_input[$tax_name]"; ?>" class="the-tags" id="tax-input[<?php echo $tax_name; ?>]"><?php echo esc_attr(get_terms_to_edit( $post->ID, $tax_name )); ?></textarea></div>
-
- <span class="ajaxtag hide-if-no-js">
- <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
- <input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="<?php esc_attr_e('Add new tag'); ?>" />
- <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" />
- </span></div>
- <p class="howto"><?php echo $helps; ?></p>
- <div class="tagchecklist"></div>
-</div>
-<p class="tagcloud-link hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php printf( __('Choose from the most used tags in %s'), $box['title'] ); ?></a></p>
-<?php
-}
-
// all tag-style post taxonomies
foreach ( get_object_taxonomies('post') as $tax_name ) {
if ( !is_taxonomy_hierarchical($tax_name) ) {
}
}
-/**
- * Display post categories form fields.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
-function post_categories_meta_box($post) {
-?>
-<ul id="category-tabs">
- <li class="tabs"><a href="#categories-all" tabindex="3"><?php _e( 'All Categories' ); ?></a></li>
- <li class="hide-if-no-js"><a href="#categories-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>
-</ul>
-
-<div id="categories-pop" class="tabs-panel" style="display: none;">
- <ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
-<?php $popular_ids = wp_popular_terms_checklist('category'); ?>
- </ul>
-</div>
-
-<div id="categories-all" class="tabs-panel">
- <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
-<?php wp_category_checklist($post->ID, false, false, $popular_ids) ?>
- </ul>
-</div>
-
-<?php if ( current_user_can('manage_categories') ) : ?>
-<div id="category-adder" class="wp-hidden-children">
- <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
- <p id="category-add" class="wp-hidden-child">
- <label class="screen-reader-text" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" tabindex="3" aria-required="true"/>
- <label class="screen-reader-text" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
- <input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php esc_attr_e( 'Add' ); ?>" tabindex="3" />
-<?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>
- <span id="category-ajax-response"></span></p>
-</div>
-<?php
-endif;
-
-}
add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'side', 'core');
-
-/**
- * Display post password form fields.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
-function post_password_meta_box($post) {
-?>
-<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex="4" /> <?php _e('Keep this post private') ?></label></p>
-<h4><?php _e( 'Post Password' ); ?></h4>
-<p><label class="screen-reader-text" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php the_post_password(); ?>" /></p>
-<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p>
-<?php
-}
-// add_meta_box('passworddiv', __('Privacy Options'), 'post_password_meta_box', 'post', 'side', 'core');
-
-/**
- * Display post excerpt form fields.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
-function post_excerpt_meta_box($post) {
-?>
-<label class="screen-reader-text" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea>
-<p><?php _e('Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="http://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>'); ?></p>
-<?php
-}
+if ( current_theme_supports( 'post-thumbnails', 'post' ) )
+ add_meta_box('postimagediv', __('Post Thumbnail'), 'post_thumbnail_meta_box', 'post', 'side', 'low');
add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'normal', 'core');
-
-/**
- * Display trackback links form fields.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
-function post_trackback_meta_box($post) {
- $form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" tabindex="7" value="'. esc_attr( str_replace("\n", ' ', $post->to_ping) ) .'" />';
- if ('' != $post->pinged) {
- $pings = '<p>'. __('Already pinged:') . '</p><ul>';
- $already_pinged = explode("\n", trim($post->pinged));
- foreach ($already_pinged as $pinged_url) {
- $pings .= "\n\t<li>" . esc_html($pinged_url) . "</li>";
- }
- $pings .= '</ul>';
- }
-
-?>
-<p><label for="trackback_url"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
-<p><?php _e('Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress blogs they’ll be notified automatically using <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>
-<?php
-if ( ! empty($pings) )
- echo $pings;
-}
add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', 'post', 'normal', 'core');
-
-/**
- * Display custom fields for the post form fields.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
-function post_custom_meta_box($post) {
-?>
-<div id="postcustomstuff">
-<div id="ajax-response"></div>
-<?php
-$metadata = has_meta($post->ID);
-list_meta($metadata);
-meta_form(); ?>
-</div>
-<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
-<?php
-}
add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'post', 'normal', 'core');
-
do_action('dbx_post_advanced');
-
-/**
- * Display comment status for post form fields.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
-function post_comment_status_meta_box($post) {
-?>
-<input name="advanced_view" type="hidden" value="1" />
-<p class="meta-options">
- <label for="comment_status" class="selectit"> <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /> <?php _e('Allow comments on this post') ?></label><br />
- <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a> on this post') ?></label></p>
-<?php
-}
add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'post', 'normal', 'core');
-/**
- * Display comments for post.
- *
- * @since 2.8.0
- *
- * @param object $post
- */
-function post_comment_meta_box($post) {
- global $wpdb, $post_ID;
-
- $total = $wpdb->get_var($wpdb->prepare("SELECT count(1) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID));
-
- if ( 1 > $total ) {
- echo '<p>' . __('No comments yet.') . '</p>';
- return;
- }
-
- wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
-?>
-
-<table class="widefat comments-box fixed" cellspacing="0" style="display:none;">
-<thead><tr>
- <th scope="col" class="column-author"><?php _e('Author') ?></th>
- <th scope="col" class="column-comment">
-<?php /* translators: field name in comment form */ echo _x('Comment', 'noun'); ?></th>
-</tr></thead>
-<tbody id="the-comment-list" class="list:comment"></tbody>
-</table>
-<p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="images/wpspin_light.gif" alt="" /></p>
-<?php
- $hidden = get_hidden_meta_boxes('post');
- if ( ! in_array('commentsdiv', $hidden) ) { ?>
- <script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>
-<?php
- }
-}
if ( 'publish' == $post->post_status || 'private' == $post->post_status )
add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', 'post', 'normal', 'core');
-/**
- * Display post slug form fields.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
-function post_slug_meta_box($post) {
-?>
-<label class="screen-reader-text" for="post_name"><?php _e('Post Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( $post->post_name ); ?>" />
-<?php
-}
if ( !( 'pending' == $post->post_status && !current_user_can( 'publish_posts' ) ) )
add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'normal', 'core');
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
if ( $post->post_author && !in_array($post->post_author, $authors) )
$authors[] = $post->post_author;
-if ( $authors && count( $authors ) > 1 ) :
-/**
- * Display form field with list of authors.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
-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;
-?>
-<label class="screen-reader-text" for="post_author_override"><?php _e('Post Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
-<?php
-}
-add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'normal', 'core');
-endif;
+if ( $authors && count( $authors ) > 1 )
+ add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'normal', 'core');
-if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
-/**
- * Display list of post revisions.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
-function post_revisions_meta_box($post) {
- wp_list_post_revisions();
-}
-add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'normal', 'core');
-endif;
+if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) )
+ add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'normal', 'core');
do_action('do_meta_boxes', 'post', 'normal', $post);
do_action('do_meta_boxes', 'post', 'advanced', $post);
?>
-<?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?>
-<input type="hidden" name="mode" value="bookmarklet" />
-<?php endif; ?>
-
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<?php if ( $notice ) : ?>
<div id="notice" class="error"><p><?php echo $notice ?></p></div>
<?php endif; ?>
-<?php if (isset($_GET['message'])) : ?>
-<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
+<?php if ( $message ) : ?>
+<div id="message" class="updated fade"><p><?php echo $message; ?></p></div>
<?php endif; ?>
<form name="post" action="post.php" method="post" id="post">
<?php
<div id="major-publishing-actions">
<div id="delete-action">
-<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=deletecomment&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . esc_js(__("You are about to delete this comment. \n 'Cancel' to stop, 'OK' to delete.")) . "') ){return true;}return false;\">" . __('Delete') . "</a>\n"; ?>
+<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=" . ( !EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( !EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash') ) . "</a>\n"; ?>
</div>
<div id="publishing-action">
<input type="submit" name="save" value="<?php esc_attr_e('Update Comment'); ?>" tabindex="4" class="button-primary" />
wp_die(__('Cheatin’ uh?'));
if ( 'delete' == $doaction ) {
- 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');
+ $cats = (array) $_GET['delete'];
+ $default_cat_id = get_option('default_link_category');
+ foreach( $cats as $cat_ID ) {
+ $cat_ID = (int) $cat_ID;
// Don't delete the default cats.
if ( $cat_ID == $default_cat_id )
- wp_die(sprintf(__("Can’t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
+ wp_die( sprintf( __("Can’t delete the <strong>%s</strong> category: this is the default one"), get_term_field('name', $cat_ID, 'link_category') ) );
wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id));
}
<div class="form-field">
<label for="description"><?php _e('Description (optional)') ?></label>
<textarea name="description" id="description" rows="5" cols="40"></textarea>
+ <p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
</div>
<p class="submit"><input type="submit" class="button" name="submit" value="<?php esc_attr_e('Add Category'); ?>" /></p>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="description"><?php _e('Description (optional)') ?></label></th>
- <td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $category->description; ?></textarea></td>
+ <td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $category->description; ?></textarea><br />
+ <span class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></span></td>
</tr>
<?php do_action('edit_link_category_form_fields', $category); ?>
</table>
$nonce_action = 'add-bookmark';
}
-/**
- * Display checked checkboxes attribute for xfn microformat options.
- *
- * @since 1.0.1
- *
- * @param string $class
- * @param string $value
- * @param mixed $deprecated Not used.
- */
-function xfn_check($class, $value = '', $deprecated = '') {
- global $link;
-
- $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
- $rels = preg_split('/\s+/', $link_rel);
-
- if ('' != $value && in_array($value, $rels) ) {
- echo ' checked="checked"';
- }
-
- if ('' == $value) {
- if ('family' == $class && strpos($link_rel, 'child') === false && strpos($link_rel, 'parent') === false && strpos($link_rel, 'sibling') === false && strpos($link_rel, 'spouse') === false && strpos($link_rel, 'kin') === false) echo ' checked="checked"';
- if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"';
- if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"';
- if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
- }
-}
-
-/**
- * Display link create form fields.
- *
- * @since 2.7.0
- *
- * @param object $link
- */
-function link_submit_meta_box($link) {
-?>
-<div class="submitbox" id="submitlink">
+require_once('includes/meta-boxes.php');
-<div id="minor-publishing">
-
-<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
-<div style="display:none;">
-<input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
-</div>
-
-<div id="minor-publishing-actions">
-<div id="preview-action">
-<?php if ( !empty($link->link_id) ) { ?>
- <a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank" tabindex="4"><?php _e('Visit Link'); ?></a>
-<?php } ?>
-</div>
-<div class="clear"></div>
-</div>
-
-<div id="misc-publishing-actions">
-<div class="misc-pub-section misc-pub-section-last">
- <label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked($link->link_visible, 'N'); ?> /> <?php _e('Keep this link private') ?></label>
-</div>
-</div>
-
-</div>
-
-<div id="major-publishing-actions">
-<?php do_action('post_submitbox_start'); ?>
-<div id="delete-action">
-<?php
-if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?>
- <a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
-<?php } ?>
-</div>
-
-<div id="publishing-action">
-<?php if ( !empty($link->link_id) ) { ?>
- <input name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="<?php esc_attr_e('Update Link') ?>" />
-<?php } else { ?>
- <input name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="<?php esc_attr_e('Add Link') ?>" />
-<?php } ?>
-</div>
-<div class="clear"></div>
-</div>
-<?php do_action('submitlink_box'); ?>
-<div class="clear"></div>
-</div>
-<?php
-}
add_meta_box('linksubmitdiv', __('Save'), 'link_submit_meta_box', 'link', 'side', 'core');
-
-/**
- * Display link categories form fields.
- *
- * @since 2.6.0
- *
- * @param object $link
- */
-function link_categories_meta_box($link) { ?>
-<ul id="category-tabs">
- <li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
- <li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
-</ul>
-
-<div id="categories-all" class="tabs-panel">
- <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
- <?php
- if ( isset($link->link_id) )
- wp_link_category_checklist($link->link_id);
- else
- wp_link_category_checklist();
- ?>
- </ul>
-</div>
-
-<div id="categories-pop" class="tabs-panel" style="display: none;">
- <ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
- <?php wp_popular_terms_checklist('link_category'); ?>
- </ul>
-</div>
-
-<div id="category-adder" class="wp-hidden-children">
- <h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>
- <p id="link-category-add" class="wp-hidden-child">
- <label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
- <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
- <input type="button" id="category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php esc_attr_e( 'Add' ); ?>" />
- <?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
- <span id="category-ajax-response"></span>
- </p>
-</div>
-<?php
-}
add_meta_box('linkcategorydiv', __('Categories'), 'link_categories_meta_box', 'link', 'normal', 'core');
-
-/**
- * Display form fields for changing link target.
- *
- * @since 2.6.0
- *
- * @param object $link
- */
-function link_target_meta_box($link) { ?>
-<fieldset><legend class="screen-reader-text"><span><?php _e('Target') ?></span></legend>
-<p><label for="link_target_blank" class="selectit">
-<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
-<?php _e('<code>_blank</code> - new window or tab.'); ?></label></p>
-<p><label for="link_target_top" class="selectit">
-<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
-<?php _e('<code>_top</code> - current window or tab, with no frames.'); ?></label></p>
-<p><label for="link_target_none" class="selectit">
-<input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ($link->link_target == '') ? 'checked="checked"' : ''); ?> />
-<?php _e('<code>_none</code> - same window or tab.'); ?></label></p>
-</fieldset>
-<p><?php _e('Choose the target frame for your link.'); ?></p>
-<?php
-}
add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', 'link', 'normal', 'core');
-
-/**
- * Display xfn form fields.
- *
- * @since 2.6.0
- *
- * @param object $link
- */
-function link_xfn_meta_box($link) {
-?>
-<table class="editform" style="width: 100%;" cellspacing="2" cellpadding="5">
- <tr>
- <th style="width: 20%;" scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('rel:') ?></label></th>
- <td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo ( isset( $link->link_rel ) ? esc_attr($link->link_rel) : ''); ?>" /></td>
- </tr>
- <tr>
- <td colspan="2">
- <table cellpadding="3" cellspacing="5" class="form-table">
- <tr>
- <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?> </th>
- <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?> </span></legend>
- <label for="me">
- <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
- <?php _e('another web address of mine') ?></label>
- </fieldset></td>
- </tr>
- <tr>
- <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </th>
- <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </span></legend>
- <label for="contact">
- <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('contact') ?></label>
- <label for="acquaintance">
- <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('acquaintance') ?></label>
- <label for="friend">
- <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friend') ?></label>
- <label for="friendship">
- <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
- </fieldset></td>
- </tr>
- <tr>
- <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?> </th>
- <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?> </span></legend>
- <label for="met">
- <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('met') ?></label>
- </fieldset></td>
- </tr>
- <tr>
- <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?> </th>
- <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?> </span></legend>
- <label for="co-worker">
- <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-worker') ?></label>
- <label for="colleague">
- <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('colleague') ?></label>
- </fieldset></td>
- </tr>
- <tr>
- <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </th>
- <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </span></legend>
- <label for="co-resident">
- <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-resident') ?></label>
- <label for="neighbor">
- <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('neighbor') ?></label>
- <label for="geographical">
- <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
- </fieldset></td>
- </tr>
- <tr>
- <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </th>
- <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </span></legend>
- <label for="child">
- <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('child') ?></label>
- <label for="kin">
- <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('kin') ?></label>
- <label for="parent">
- <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('parent') ?></label>
- <label for="sibling">
- <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sibling') ?></label>
- <label for="spouse">
- <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('spouse') ?></label>
- <label for="family">
- <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
- </fieldset></td>
- </tr>
- <tr>
- <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?> </th>
- <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?> </span></legend>
- <label for="muse">
- <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('muse') ?></label>
- <label for="crush">
- <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('crush') ?></label>
- <label for="date">
- <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('date') ?></label>
- <label for="romantic">
- <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
- <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sweetheart') ?></label>
- </fieldset></td>
- </tr>
- </table>
- </td>
- </tr>
-</table>
-<p><?php _e('If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.'); ?></p>
-<?php
-}
add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', 'link', 'normal', 'core');
-
-/**
- * Display advanced link options form fields.
- *
- * @since 2.6.0
- *
- * @param object $link
- */
-function link_advanced_meta_box($link) {
-?>
-<table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">
- <tr class="form-field">
- <th valign="top" scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>
- <td><input type="text" name="link_image" class="code" id="link_image" size="50" value="<?php echo ( isset( $link->link_image ) ? esc_attr($link->link_image) : ''); ?>" style="width: 95%" /></td>
- </tr>
- <tr class="form-field">
- <th valign="top" scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th>
- <td><input name="link_rss" class="code" type="text" id="rss_uri" value="<?php echo ( isset( $link->link_rss ) ? esc_attr($link->link_rss) : ''); ?>" size="50" style="width: 95%" /></td>
- </tr>
- <tr class="form-field">
- <th valign="top" scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
- <td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); ?></textarea></td>
- </tr>
- <tr class="form-field">
- <th valign="top" scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th>
- <td><select name="link_rating" id="link_rating" size="1">
- <?php
- for ($r = 0; $r < 10; $r++) {
- echo(' <option value="'. esc_attr($r) .'" ');
- if ( isset($link->link_rating) && $link->link_rating == $r)
- echo 'selected="selected"';
- echo('>'.$r.'</option>');
- }
- ?></select> <?php _e('(Leave at 0 for no rating.)') ?>
- </td>
- </tr>
-</table>
-<?php
-}
add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core');
do_action('do_meta_boxes', 'link', 'normal', $link);
if ( ! isset( $temp_ID ) )
$temp_ID = 0;
-if ( isset($_GET['message']) )
+$message = false;
+if ( isset($_GET['message']) ) {
$_GET['message'] = absint( $_GET['message'] );
-$messages[1] = sprintf(__('Page updated. <a href="%s">View page</a>'), get_permalink($post_ID));
-$messages[2] = __('Custom field updated.');
-$messages[3] = __('Custom field deleted.');
-$messages[5] = sprintf(__('Page published. <a href="%s">View page</a>'), get_permalink($post_ID));
-$messages[6] = sprintf(__('Page submitted. <a href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
-if ( isset($_GET['revision']) )
- $messages[5] = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
+ switch ( $_GET['message'] ) {
+ case 1:
+ $message = sprintf( __('Page updated. <a href="%s">View page</a>'), get_permalink($post_ID) );
+ break;
+ case 2:
+ $message = __('Custom field updated.');
+ break;
+ case 3:
+ $message = __('Custom field deleted.');
+ break;
+ case 4:
+ $message = sprintf( __('Page published. <a href="%s">View page</a>'), get_permalink($post_ID) );
+ break;
+ case 5:
+ if ( isset($_GET['revision']) )
+ $message = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
+ break;
+ case 6:
+ $message = sprintf( __('Page submitted. <a target="_blank" href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
+ break;
+ case 7:
+ // translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php
+ $message = sprintf( __('Page scheduled for: <b>%1$s</b>. <a target="_blank" href="%2$s">Preview page</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID) );
+ break;
+ case 8:
+ $message = sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
+ break;
+ }
+}
$notice = false;
-$notices[1] = __( 'There is an autosave of this page that is more recent than the version below. <a href="%s">View the autosave</a>.' );
-
if ( 0 == $post_ID) {
$form_action = 'post';
$nonce_action = 'add-page';
$form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
$autosave = wp_get_post_autosave( $post_ID );
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) )
- $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
+ $notice = sprintf( __( 'There is an autosave of this page that is more recent than the version below. <a href="%s">View the autosave</a>.' ), get_edit_post_link( $autosave->ID ) );
}
$temp_ID = (int) $temp_ID;
$user_ID = (int) $user_ID;
-/**
- * Display submit form fields.
- *
- * @since 2.7.0
- *
- * @param object $post
- */
-function page_submit_meta_box($post) {
- global $action;
-
- $can_publish = current_user_can('publish_pages');
-?>
-<div class="submitbox" id="submitpage">
-
-<div id="minor-publishing">
-
-<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
-<div style="display:none;">
-<input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
-</div>
-
-<div id="minor-publishing-actions">
-<div id="save-action">
-<?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>
-<input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" tabindex="4" class="button button-highlighted" />
-<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
-<input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" tabindex="4" class="button button-highlighted" />
-<?php } ?>
-</div>
-
-<div id="preview-action">
-<?php
-if ( 'publish' == $post->post_status ) {
- $preview_link = esc_url(get_permalink($post->ID));
- $preview_button = __('Preview Changes');
-} else {
- $preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
- $preview_button = __('Preview');
-}
-?>
-<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a>
-<input type="hidden" name="wp-preview" id="wp-preview" value="" />
-</div>
-
-<div class="clear"></div>
-</div><?php // /minor-publishing-actions ?>
-
-<div id="misc-publishing-actions">
-
-<div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label>
-<span id="post-status-display">
-<?php
-switch ( $post->post_status ) {
- case 'private':
- _e('Privately Published');
- break;
- case 'publish':
- _e('Published');
- break;
- case 'future':
- _e('Scheduled');
- break;
- case 'pending':
- _e('Pending Review');
- break;
- case 'draft':
- _e('Draft');
- break;
-}
-?>
-</span>
-<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
-<a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
-
-<div id="post-status-select" class="hide-if-js">
-<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr($post->post_status); ?>" />
-<select name='post_status' id='post_status' tabindex='4'>
-<?php if ( 'publish' == $post->post_status ) : ?>
-<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
-<?php elseif ( 'private' == $post->post_status ) : ?>
-<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
-<?php elseif ( 'future' == $post->post_status ) : ?>
-<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
-<?php endif; ?>
-<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
-<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
-</select>
-
- <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
- <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
-</div>
+require_once('includes/meta-boxes.php');
-<?php } ?>
-</div><?php // /misc-pub-section ?>
-
-<div class="misc-pub-section " id="visibility">
-<?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php
-
-if ( 'private' == $post->post_status ) {
- $post->post_password = '';
- $visibility = 'private';
- $visibility_trans = __('Private');
-} elseif ( !empty( $post->post_password ) ) {
- $visibility = 'password';
- $visibility_trans = __('Password protected');
-} else {
- $visibility = 'public';
- $visibility_trans = __('Public');
-}
-
-echo esc_html( $visibility_trans ); ?></span>
-<?php if ( $can_publish ) { ?>
-<a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
-
-<div id="post-visibility-select" class="hide-if-js">
-<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr($post->post_password); ?>" />
-<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" />
-
-<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br />
-<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br />
-<span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr($post->post_password); ?>" /><br /></span>
-<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
-
-<p><a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
-<a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a></p>
-</div>
-<?php } ?>
-
-</div><?php // /misc-pub-section ?>
-
-<?php
-// translators: Publish box date formt, see http://php.net/date
-$datef = __( 'M j, Y @ G:i' );
-if ( 0 != $post->ID ) {
- if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
- $stamp = __('Scheduled for: <b>%1$s</b>');
- } else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
- $stamp = __('Published on: <b>%1$s</b>');
- } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
- $stamp = __('Publish <b>immediately</b>');
- } else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
- $stamp = __('Schedule for: <b>%1$s</b>');
- } else { // draft, 1 or more saves, date specified
- $stamp = __('Publish on: <b>%1$s</b>');
- }
- $date = date_i18n( $datef, strtotime( $post->post_date ) );
-} else { // draft (no saves, and thus no date specified)
- $stamp = __('Publish <b>immediately</b>');
- $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
-}
-
-if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
-<div class="misc-pub-section curtime misc-pub-section-last">
- <span id="timestamp"><?php printf($stamp, $date); ?></span>
- <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
- <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
-</div><?php // /misc-pub-section
-endif; ?>
-
-</div>
-<div class="clear"></div>
-</div>
-
-<div id="major-publishing-actions">
-<?php do_action('post_submitbox_start'); ?>
-<div id="delete-action">
-<?php
-if ( ( 'edit' == $action ) && current_user_can('delete_page', $post->ID) ) { ?>
-<a class="submitdelete deletion" href="<?php echo wp_nonce_url("page.php?action=delete&post=$post->ID", 'delete-page_' . $post->ID); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
-<?php } ?>
-</div>
-
-<div id="publishing-action">
-<?php
-if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?>
-<?php
- if ( $can_publish ) :
- if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
- <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" />
- <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Schedule') ?>" />
-<?php else : ?>
- <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
- <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Publish') ?>" />
-<?php endif;
- else : ?>
- <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" />
- <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Submit for Review') ?>" />
-<?php
- endif;
-} else { ?>
- <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update Page') ?>" />
- <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Update Page') ?>" />
-<?php
-} ?>
-</div>
-<div class="clear"></div>
-</div>
-</div>
-<?php
-}
-add_meta_box('pagesubmitdiv', __('Publish'), 'page_submit_meta_box', 'page', 'side', 'core');
-
-/**
- * Display page password form fields.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
-function page_password_meta_box($post){
-?>
-<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p>
-<h4><?php _e( 'Page Password' ); ?></h4>
-<p><label class="screen-reader-text" for="post_password"><?php _e('Password Protect This Page') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php the_post_password(); ?>" /></p>
-<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this page and its comments.'); ?></p>
-<?php
-}
-// add_meta_box('pagepassworddiv', __('Privacy Options'), 'page_password_meta_box', 'page', 'side', 'core');
-
-/**
- * Display page attributes form fields.
- *
- * @since 2.7.0
- *
- * @param object $post
- */
-function page_attributes_meta_box($post){
-?>
-<h5><?php _e('Parent') ?></h5>
-<label class="screen-reader-text" for="parent_id"><?php _e('Page Parent') ?></label>
-<?php wp_dropdown_pages(array('exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?>
-<p><?php _e('You can arrange your pages in hierarchies, for example you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how deeply nested you can make pages.'); ?></p>
-<?php
- if ( 0 != count( get_page_templates() ) ) { ?>
-<h5><?php _e('Template') ?></h5>
-<label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
-<option value='default'><?php _e('Default Template'); ?></option>
-<?php page_template_dropdown($post->page_template); ?>
-</select>
-<p><?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them above.'); ?></p>
-<?php
- } ?>
-<h5><?php _e('Order') ?></h5>
-<p><label class="screen-reader-text" for="menu_order"><?php _e('Page Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p>
-<p><?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it’ll be better in future releases.)'); ?></p>
-<?php
-}
+add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', 'page', 'side', 'core');
add_meta_box('pageparentdiv', __('Attributes'), 'page_attributes_meta_box', 'page', 'side', 'core');
-
-/**
- * Display custom field for page form fields.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
-function page_custom_meta_box($post){
-?>
-<div id="postcustomstuff">
-<?php
- $metadata = has_meta($post->ID);
- list_meta($metadata);
- meta_form(); ?>
- <div id="ajax-response"></div>
-</div>
-<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
-<?php
-}
-add_meta_box('pagecustomdiv', __('Custom Fields'), 'page_custom_meta_box', 'page', 'normal', 'core');
-
-/**
- * Display comments status form fields.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
-function page_comments_status_meta_box($post){
-?>
-<input name="advanced_view" type="hidden" value="1" />
-<p><label for="comment_status" class="selectit">
-<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
-<?php _e('Allow Comments') ?></label></p>
-<p><label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label></p>
-<p><?php _e('These settings apply to this page only. “Pings” are <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a>.'); ?></p>
-<?php
-}
-add_meta_box('pagecommentstatusdiv', __('Discussion'), 'page_comments_status_meta_box', 'page', 'normal', 'core');
-
-/**
- * Display page slug form fields.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
-function page_slug_meta_box($post){
-?>
-<label class="screen-reader-text" for="post_name"><?php _e('Page Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( $post->post_name ); ?>" />
-<?php
-}
-add_meta_box('pageslugdiv', __('Page Slug'), 'page_slug_meta_box', 'page', 'normal', 'core');
+add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'page', 'normal', 'core');
+add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'page', 'normal', 'core');
+add_meta_box('slugdiv', __('Page Slug'), 'post_slug_meta_box', 'page', 'normal', 'core');
+if ( current_theme_supports( 'post-thumbnails', 'page' ) )
+ add_meta_box('postimagediv', __('Page Image'), 'post_thumbnail_meta_box', 'page', 'side', 'low');
$authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM
if ( $post->post_author && !in_array($post->post_author, $authors) )
$authors[] = $post->post_author;
-if ( $authors && count( $authors ) > 1 ) {
- /**
- * Display page author form fields, when more than one author exists.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
- function page_author_meta_box($post){
- global $current_user, $user_ID;
- $authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM
- if ( $post->post_author && !in_array($post->post_author, $authors) )
- $authors[] = $post->post_author;
-?>
-<label class="screen-reader-text" for="post_author_override"><?php _e('Page Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
-<?php
- }
- add_meta_box('pageauthordiv', __('Page Author'), 'page_author_meta_box', 'page', 'normal', 'core');
-}
+if ( $authors && count( $authors ) > 1 )
+ add_meta_box('pageauthordiv', __('Page Author'), 'post_author_meta_box', 'page', 'normal', 'core');
-if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
-/**
- * Display list of page revisions.
- *
- * @since 2.6.0
- *
- * @param object $post
- */
-function page_revisions_meta_box($post) {
- wp_list_post_revisions();
-}
-add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'page', 'normal', 'core');
-endif;
+if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) )
+ add_meta_box('revisionsdiv', __('Page Revisions'), 'post_revisions_meta_box', 'page', 'normal', 'core');
do_action('do_meta_boxes', 'page', 'normal', $post);
do_action('do_meta_boxes', 'page', 'advanced', $post);
<?php if ( $notice ) : ?>
<div id="notice" class="error"><p><?php echo $notice ?></p></div>
<?php endif; ?>
-<?php if (isset($_GET['message'])) : ?>
-<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
+<?php if ( $message ) : ?>
+<div id="message" class="updated fade"><p><?php echo $message; ?></p></div>
<?php endif; ?>
-<?php
-wp_nonce_field($nonce_action);
+<?php wp_nonce_field($nonce_action); ?>
-if (isset($mode) && 'bookmarklet' == $mode)
- echo '<input type="hidden" name="mode" value="bookmarklet" />';
-?>
<input type="hidden" id="user-id" name="user_ID" value="<?php echo $user_ID ?>" />
<input type="hidden" id="hiddenaction" name="action" value='<?php echo esc_attr($form_action) ?>' />
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr($form_action) ?>" />
wp_die(__('Cheatin’ uh?'));
// Handle bulk actions
-if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
- $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
+if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) {
+ check_admin_referer('bulk-pages');
+ $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() );
+
+ if ( strpos($sendback, 'page.php') !== false )
+ $sendback = admin_url('page-new.php');
+
+ if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
+ $post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_GET['post_status']);
+ $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status = %s", $post_status ) );
+ $doaction = 'delete';
+ } elseif ( ( $_GET['action'] != -1 || $_GET['action2'] != -1 ) && ( isset($_GET['post']) || isset($_GET['ids']) ) ) {
+ $post_ids = isset($_GET['post']) ? array_map( 'intval', (array) $_GET['post'] ) : explode(',', $_GET['ids']);
+ $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
+ } else {
+ wp_redirect( admin_url('edit-pages.php') );
+ }
switch ( $doaction ) {
- case 'delete':
- if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
- check_admin_referer('bulk-pages');
- $deleted = 0;
- foreach( (array) $_GET['post'] as $post_id_del ) {
- $post_del = & get_post($post_id_del);
-
- if ( !current_user_can('delete_page', $post_id_del) )
- wp_die( __('You are not allowed to delete this page.') );
-
- if ( $post_del->post_type == 'attachment' ) {
- if ( ! wp_delete_attachment($post_id_del) )
- wp_die( __('Error in deleting...') );
- } else {
- if ( !wp_delete_post($post_id_del) )
- wp_die( __('Error in deleting...') );
- }
- $deleted++;
- }
+ case 'trash':
+ $trashed = 0;
+ foreach( (array) $post_ids as $post_id ) {
+ if ( !current_user_can('delete_page', $post_id) )
+ wp_die( __('You are not allowed to move this page to the trash.') );
+
+ if ( !wp_trash_post($post_id) )
+ wp_die( __('Error in moving to trash...') );
+
+ $trashed++;
}
+ $sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids)), $sendback );
break;
- case 'edit':
- if ( isset($_GET['post']) && isset($_GET['bulk_edit']) ) {
- check_admin_referer('bulk-pages');
+ case 'untrash':
+ $untrashed = 0;
+ foreach( (array) $post_ids as $post_id ) {
+ if ( !current_user_can('delete_page', $post_id) )
+ wp_die( __('You are not allowed to restore this page from the trash.') );
+
+ if ( !wp_untrash_post($post_id) )
+ wp_die( __('Error in restoring from trash...') );
- if ( -1 == $_GET['_status'] ) {
- $_GET['post_status'] = null;
- unset($_GET['_status'], $_GET['post_status']);
+ $untrashed++;
+ }
+ $sendback = add_query_arg('untrashed', $untrashed, $sendback);
+ break;
+ case 'delete':
+ $deleted = 0;
+ foreach( (array) $post_ids as $post_id ) {
+ $post_del = & get_post($post_id);
+
+ if ( !current_user_can('delete_page', $post_id) )
+ wp_die( __('You are not allowed to delete this page.') );
+
+ if ( $post_del->post_type == 'attachment' ) {
+ if ( ! wp_delete_attachment($post_id) )
+ wp_die( __('Error in deleting...') );
} else {
- $_GET['post_status'] = $_GET['_status'];
+ if ( !wp_delete_post($post_id) )
+ wp_die( __('Error in deleting...') );
}
-
- $done = bulk_edit_posts($_GET);
+ $deleted++;
+ }
+ $sendback = add_query_arg('deleted', $deleted, $sendback);
+ break;
+ case 'edit':
+ $_GET['post_type'] = 'page';
+ $done = bulk_edit_posts($_GET);
+
+ if ( is_array($done) ) {
+ $done['updated'] = count( $done['updated'] );
+ $done['skipped'] = count( $done['skipped'] );
+ $done['locked'] = count( $done['locked'] );
+ $sendback = add_query_arg( $done, $sendback );
}
break;
}
- $sendback = wp_get_referer();
- if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page-new.php');
- elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
- if ( isset($done) ) {
- $done['updated'] = count( $done['updated'] );
- $done['skipped'] = count( $done['skipped'] );
- $done['locked'] = count( $done['locked'] );
- $sendback = add_query_arg( $done, $sendback );
- }
- if ( isset($deleted) )
- $sendback = add_query_arg('deleted', $deleted, $sendback);
+ if ( isset($_GET['action']) )
+ $sendback = remove_query_arg( array('action', 'action2', 'post_parent', 'page_template', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view', 'post_type'), $sendback );
+
wp_redirect($sendback);
exit();
} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
'future' => array(_x('Scheduled', 'page'), __('Scheduled pages'), _nx_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>', 'page')),
'pending' => array(_x('Pending Review', 'page'), __('Pending pages'), _nx_noop('Pending Review <span class="count">(%s)</span>', 'Pending Review <span class="count">(%s)</span>', 'page')),
'draft' => array(_x('Draft', 'page'), _x('Drafts', 'manage posts header'), _nx_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>', 'page')),
- 'private' => array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>', 'page'))
+ 'private' => array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>', 'page')),
+ 'trash' => array(_x('Trash', 'page'), __('Trash pages'), _nx_noop('Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', 'page'))
);
+if ( !EMPTY_TRASH_DAYS )
+ unset($post_stati['trash']);
+
$post_stati = apply_filters('page_stati', $post_stati);
$query = array('post_type' => 'page', 'orderby' => 'menu_order title',
<div class="wrap">
<?php screen_icon(); ?>
-<h2><?php echo esc_html( $title );
+<h2><?php echo esc_html( $title ); ?> <a href="page-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'page'); ?></a> <?php
if ( isset($_GET['s']) && $_GET['s'] )
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( get_search_query() ) ); ?>
</h2>
-<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) ) { ?>
+<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) ) { ?>
<div id="message" class="updated fade"><p>
<?php if ( isset($_GET['updated']) && (int) $_GET['updated'] ) {
printf( _n( '%s page updated.', '%s pages updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
unset($_GET['updated']);
}
-
if ( isset($_GET['skipped']) && (int) $_GET['skipped'] ) {
printf( _n( '%s page not updated, invalid parent page specified.', '%s pages not updated, invalid parent page specified.', $_GET['skipped'] ), number_format_i18n( $_GET['skipped'] ) );
unset($_GET['skipped']);
}
-
if ( isset($_GET['locked']) && (int) $_GET['locked'] ) {
printf( _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['skipped'] ) );
unset($_GET['locked']);
}
-
if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
- printf( _n( 'Page deleted.', '%s pages deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
+ printf( _n( 'Page permanently deleted.', '%s pages permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
unset($_GET['deleted']);
}
-$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted'), $_SERVER['REQUEST_URI'] );
+if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) {
+ printf( _n( 'Page moved to the trash.', '%s pages moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
+ $ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
+ echo ' <a href="' . esc_url( wp_nonce_url( "edit-pages.php?doaction=undo&action=untrash&ids=$ids", "bulk-pages" ) ) . '">' . __('Undo') . '</a><br />';
+ unset($_GET['trashed']);
+}
+if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) {
+ printf( _n( 'Page restored from the trash.', '%s pages restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
+ unset($_GET['untrashed']);
+}
+$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] );
?>
</p></div>
<?php } ?>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
endif; ?>
-<form id="posts-filter" action="" method="get">
+<form id="posts-filter" action="<?php echo admin_url('edit-pages.php'); ?>" method="get">
<ul class="subsubsub">
<?php
if ( empty($locked_post_status) ) :
$status_links = array();
$num_posts = wp_count_posts('page', 'readable');
-$total_posts = array_sum( (array) $num_posts );
+$total_posts = array_sum( (array) $num_posts ) - $num_posts->trash;
$class = empty($_GET['post_status']) ? ' class="current"' : '';
$status_links[] = "<li><a href='edit-pages.php'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'pages' ), number_format_i18n( $total_posts ) ) . '</a>';
foreach ( $post_stati as $status => $label ) {
$class = '';
- if ( !in_array($status, $avail_post_stati) )
+ if ( !in_array($status, $avail_post_stati) || $num_posts->$status <= 0 )
continue;
if ( isset( $_GET['post_status'] ) && $status == $_GET['post_status'] )
<input type="submit" value="<?php esc_attr_e( 'Search Pages' ); ?>" class="button" />
</p>
-<?php if ( isset($_GET['post_status'] ) ) : ?>
-<input type="hidden" name="post_status" value="<?php echo esc_attr($_GET['post_status']) ?>" />
-<?php endif; ?>
+<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_GET['post_status']) ? esc_attr($_GET['post_status']) : 'all'; ?>" />
<?php if ($posts) { ?>
$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
if ( empty($pagenum) )
$pagenum = 1;
-$per_page = get_user_option('edit_pages_per_page');
-if ( empty( $per_page ) || $per_page < 0 )
+$per_page = (int) get_user_option( 'edit_pages_per_page', 0, false );
+if ( empty( $per_page ) || $per_page < 1 )
$per_page = 20;
+$per_page = apply_filters( 'edit_pages_per_page', $per_page );
$num_pages = ceil($wp_query->post_count / $per_page);
$page_links = paginate_links( array(
'current' => $pagenum
));
+$is_trash = isset($_GET['post_status']) && $_GET['post_status'] == 'trash';
+
if ( $page_links ) : ?>
<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
<div class="alignleft actions">
<select name="action">
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
+<?php if ( $is_trash ) { ?>
+<option value="untrash"><?php _e('Restore'); ?></option>
+<?php } else { ?>
<option value="edit"><?php _e('Edit'); ?></option>
-<option value="delete"><?php _e('Delete'); ?></option>
+<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
+<option value="delete"><?php _e('Delete Permanently'); ?></option>
+<?php } else { ?>
+<option value="trash"><?php _e('Move to Trash'); ?></option>
+<?php } ?>
</select>
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
<?php wp_nonce_field('bulk-pages'); ?>
+<?php if ( $is_trash ) { ?>
+<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
+<?php } ?>
</div>
<br class="clear" />
<div class="alignleft actions">
<select name="action2">
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
+<?php if ( $is_trash ) { ?>
+<option value="untrash"><?php _e('Restore'); ?></option>
+<?php } else { ?>
<option value="edit"><?php _e('Edit'); ?></option>
-<option value="delete"><?php _e('Delete'); ?></option>
+<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
+<option value="delete"><?php _e('Delete Permanently'); ?></option>
+<?php } else { ?>
+<option value="trash"><?php _e('Move to Trash'); ?></option>
+<?php } ?>
</select>
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
+<?php if ( $is_trash ) { ?>
+<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
+<?php } ?>
</div>
<br class="clear" />
<table class="form-table">
<tr class="form-field form-required">
<th scope="row" valign="top"><label for="name"><?php _e('Tag name') ?></label></th>
- <td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo esc_attr($tag->name); ?>" size="40" aria-required="true" />
- <p class="description"><?php _e('The name is how the tag appears on your site.'); ?></p></td>
+ <td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo esc_attr($tag->name); ?>" size="40" aria-required="true" /></td>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="slug"><?php _e('Tag slug') ?></label></th>
switch($action) {
-case 'addtag':
+case 'add-tag':
check_admin_referer('add-tag');
if ( !current_user_can('manage_categories') )
wp_die(__('Cheatin’ uh?'));
- $ret = wp_insert_term($_POST['name'], $taxonomy, $_POST);
+ $ret = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST);
if ( $ret && !is_wp_error( $ret ) ) {
wp_redirect('edit-tags.php?message=1#addtag');
} else {
break;
case 'delete':
+ if ( !isset( $_GET['tag_ID'] ) ) {
+ wp_redirect("edit-tags.php?taxonomy=$taxonomy");
+ exit;
+ }
+
$tag_ID = (int) $_GET['tag_ID'];
check_admin_referer('delete-tag_' . $tag_ID);
if ( !current_user_can('manage_categories') )
wp_die(__('Cheatin’ uh?'));
- $tags = $_GET['delete_tags'];
- foreach( (array) $tags as $tag_ID ) {
+ $tags = (array) $_GET['delete_tags'];
+ foreach( $tags as $tag_ID ) {
wp_delete_term( $tag_ID, $taxonomy);
}
<div id="message" class="updated fade"><p><?php echo $messages[$msg]; ?></p></div>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
endif; ?>
+<div id="ajax-response"></div>
<form class="search-form" action="" method="get">
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
if ( empty($pagenum) )
$pagenum = 1;
-$tags_per_page = get_user_option('edit_tags_per_page');
-if ( empty($tags_per_page) )
+$tags_per_page = (int) get_user_option( 'edit_tags_per_page', 0, false );
+if ( empty($tags_per_page) || $tags_per_page < 1 )
$tags_per_page = 20;
-$tags_per_page = apply_filters('edit_tags_per_page', $tags_per_page);
-$tags_per_page = apply_filters('tagsperpage', $tags_per_page); // Old filter
+$tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
+$tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
$page_links = paginate_links( array(
'base' => add_query_arg( 'pagenum', '%#%' ),
<div class="form-wrap">
<h3><?php _e('Add a New Tag'); ?></h3>
-<div id="ajax-response"></div>
-<form name="addtag" id="addtag" method="post" action="edit-tags.php" class="add:the-list: validate">
-<input type="hidden" name="action" value="addtag" />
+<form id="addtag" method="post" action="edit-tags.php" class="validate">
+<input type="hidden" name="action" value="add-tag" />
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
-<?php wp_original_referer_field(true, 'previous'); wp_nonce_field('add-tag'); ?>
+<?php wp_nonce_field('add-tag'); ?>
<div class="form-field form-required">
- <label for="name"><?php _e('Tag name') ?></label>
- <input name="name" id="name" type="text" value="" size="40" aria-required="true" />
+ <label for="tag-name"><?php _e('Tag name') ?></label>
+ <input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" />
<p><?php _e('The name is how the tag appears on your site.'); ?></p>
</div>
<div class="form-field">
<label for="description"><?php _e('Description') ?></label>
<textarea name="description" id="description" rows="5" cols="40"></textarea>
- <p><?php _e('The description is not prominent by default, however some themes may show it.'); ?></p>
+ <p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
</div>
-<p class="submit"><input type="submit" class="button" name="submit" value="<?php esc_attr_e('Add Tag'); ?>" /></p>
+<p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php esc_attr_e('Add Tag'); ?>" /></p>
<?php do_action('add_tag_form'); ?>
</form></div>
<?php } ?>
}
// Handle bulk actions
-if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
- $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
+if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) {
+ check_admin_referer('bulk-posts');
+ $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() );
+
+ if ( strpos($sendback, 'post.php') !== false )
+ $sendback = admin_url('post-new.php');
+
+ if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
+ $post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_GET['post_status']);
+ $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='post' AND post_status = %s", $post_status ) );
+ $doaction = 'delete';
+ } elseif ( ( $_GET['action'] != -1 || $_GET['action2'] != -1 ) && ( isset($_GET['post']) || isset($_GET['ids']) ) ) {
+ $post_ids = isset($_GET['post']) ? array_map( 'intval', (array) $_GET['post'] ) : explode(',', $_GET['ids']);
+ $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
+ } else {
+ wp_redirect( admin_url('edit.php') );
+ }
switch ( $doaction ) {
- case 'delete':
- if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
- check_admin_referer('bulk-posts');
- $deleted = 0;
- foreach( (array) $_GET['post'] as $post_id_del ) {
- $post_del = & get_post($post_id_del);
-
- if ( !current_user_can('delete_post', $post_id_del) )
- wp_die( __('You are not allowed to delete this post.') );
-
- if ( $post_del->post_type == 'attachment' ) {
- if ( ! wp_delete_attachment($post_id_del) )
- wp_die( __('Error in deleting...') );
- } else {
- if ( !wp_delete_post($post_id_del) )
- wp_die( __('Error in deleting...') );
- }
- $deleted++;
- }
+ case 'trash':
+ $trashed = 0;
+ foreach( (array) $post_ids as $post_id ) {
+ if ( !current_user_can('delete_post', $post_id) )
+ wp_die( __('You are not allowed to move this post to the trash.') );
+
+ if ( !wp_trash_post($post_id) )
+ wp_die( __('Error in moving to trash...') );
+
+ $trashed++;
}
+ $sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids)), $sendback );
break;
- case 'edit':
- if ( isset($_GET['post']) && isset($_GET['bulk_edit']) ) {
- check_admin_referer('bulk-posts');
+ case 'untrash':
+ $untrashed = 0;
+ foreach( (array) $post_ids as $post_id ) {
+ if ( !current_user_can('delete_post', $post_id) )
+ wp_die( __('You are not allowed to restore this post from the trash.') );
+
+ if ( !wp_untrash_post($post_id) )
+ wp_die( __('Error in restoring from trash...') );
- if ( -1 == $_GET['_status'] ) {
- $_GET['post_status'] = null;
- unset($_GET['_status'], $_GET['post_status']);
+ $untrashed++;
+ }
+ $sendback = add_query_arg('untrashed', $untrashed, $sendback);
+ break;
+ case 'delete':
+ $deleted = 0;
+ foreach( (array) $post_ids as $post_id ) {
+ $post_del = & get_post($post_id);
+
+ if ( !current_user_can('delete_post', $post_id) )
+ wp_die( __('You are not allowed to delete this post.') );
+
+ if ( $post_del->post_type == 'attachment' ) {
+ if ( ! wp_delete_attachment($post_id) )
+ wp_die( __('Error in deleting...') );
} else {
- $_GET['post_status'] = $_GET['_status'];
+ if ( !wp_delete_post($post_id) )
+ wp_die( __('Error in deleting...') );
}
+ $deleted++;
+ }
+ $sendback = add_query_arg('deleted', $deleted, $sendback);
+ break;
+ case 'edit':
+ $done = bulk_edit_posts($_GET);
- $done = bulk_edit_posts($_GET);
+ if ( is_array($done) ) {
+ $done['updated'] = count( $done['updated'] );
+ $done['skipped'] = count( $done['skipped'] );
+ $done['locked'] = count( $done['locked'] );
+ $sendback = add_query_arg( $done, $sendback );
}
break;
}
- $sendback = wp_get_referer();
- if ( strpos($sendback, 'post.php') !== false ) $sendback = admin_url('post-new.php');
- elseif ( strpos($sendback, 'attachments.php') !== false ) $sendback = admin_url('attachments.php');
- if ( isset($done) ) {
- $done['updated'] = count( $done['updated'] );
- $done['skipped'] = count( $done['skipped'] );
- $done['locked'] = count( $done['locked'] );
- $sendback = add_query_arg( $done, $sendback );
- }
- if ( isset($deleted) )
- $sendback = add_query_arg('deleted', $deleted, $sendback);
+ if ( isset($_GET['action']) )
+ $sendback = remove_query_arg( array('action', 'action2', 'cat', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view', 'post_type'), $sendback );
+
wp_redirect($sendback);
exit();
} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
$parent_file = 'edit.php';
wp_enqueue_script('inline-edit-post');
+$user_posts = false;
+if ( !current_user_can('edit_others_posts') ) {
+ $user_posts_count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(1) FROM $wpdb->posts WHERE post_type = 'post' AND post_status != 'trash' AND post_author = %d", $current_user->ID) );
+ $user_posts = true;
+ if ( $user_posts_count && empty($_GET['post_status']) && empty($_GET['all_posts']) && empty($_GET['author']) )
+ $_GET['author'] = $current_user->ID;
+}
+
list($post_stati, $avail_post_stati) = wp_edit_posts_query();
require_once('admin-header.php');
<div class="wrap">
<?php screen_icon(); ?>
-<h2><?php echo esc_html( $title );
+<h2><?php echo esc_html( $title ); ?> <a href="post-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'post'); ?></a> <?php
if ( isset($_GET['s']) && $_GET['s'] )
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( get_search_query() ) ); ?>
</h2>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
endif; ?>
-<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) ) { ?>
+<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) ) { ?>
<div id="message" class="updated fade"><p>
<?php if ( isset($_GET['updated']) && (int) $_GET['updated'] ) {
printf( _n( '%s post updated.', '%s posts updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
}
if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
- printf( _n( 'Post deleted.', '%s posts deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
+ printf( _n( 'Post permanently deleted.', '%s posts permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
unset($_GET['deleted']);
}
-$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted'), $_SERVER['REQUEST_URI'] );
+if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) {
+ printf( _n( 'Post moved to the trash.', '%s posts moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
+ $ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
+ echo ' <a href="' . esc_url( wp_nonce_url( "edit.php?doaction=undo&action=untrash&ids=$ids", "bulk-posts" ) ) . '">' . __('Undo') . '</a><br />';
+ unset($_GET['trashed']);
+}
+
+if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) {
+ printf( _n( 'Post restored from the trash.', '%s posts restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
+ unset($_GET['undeleted']);
+}
+
+$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] );
?>
</p></div>
<?php } ?>
-<form id="posts-filter" action="" method="get">
+<form id="posts-filter" action="<?php echo admin_url('edit.php'); ?>" method="get">
<ul class="subsubsub">
<?php
if ( empty($locked_post_status) ) :
$status_links = array();
$num_posts = wp_count_posts( 'post', 'readable' );
-$total_posts = array_sum( (array) $num_posts );
-$class = empty( $_GET['post_status'] ) ? ' class="current"' : '';
-$status_links[] = "<li><a href='edit.php' $class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . '</a>';
+$class = '';
+$allposts = '';
+
+if ( $user_posts ) {
+ if ( isset( $_GET['author'] ) && ( $_GET['author'] == $current_user->ID ) )
+ $class = ' class="current"';
+ $status_links[] = "<li><a href='edit.php?author=$current_user->ID'$class>" . sprintf( _nx( 'My Posts <span class="count">(%s)</span>', 'My Posts <span class="count">(%s)</span>', $user_posts_count, 'posts' ), number_format_i18n( $user_posts_count ) ) . '</a>';
+ $allposts = '?all_posts=1';
+}
+$total_posts = array_sum( (array) $num_posts ) - $num_posts->trash;
+$class = empty($class) && empty($_GET['post_status']) ? ' class="current"' : '';
+$status_links[] = "<li><a href='edit.php{$allposts}'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . '</a>';
foreach ( $post_stati as $status => $label ) {
$class = '';
if ( empty( $num_posts->$status ) )
continue;
+
if ( isset($_GET['post_status']) && $status == $_GET['post_status'] )
$class = ' class="current"';
- $status_links[] = "<li><a href='edit.php?post_status=$status' $class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>';
+ $status_links[] = "<li><a href='edit.php?post_status=$status'$class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>';
}
echo implode( " |</li>\n", $status_links ) . '</li>';
unset( $status_links );
<input type="submit" value="<?php esc_attr_e( 'Search Posts' ); ?>" class="button" />
</p>
-<?php if ( isset($_GET['post_status'] ) ) : ?>
-<input type="hidden" name="post_status" value="<?php echo esc_attr($_GET['post_status']) ?>" />
-<?php endif; ?>
+<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_GET['post_status']) ? esc_attr($_GET['post_status']) : 'all'; ?>" />
<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
<?php if ( have_posts() ) { ?>
'current' => $_GET['paged']
));
+$is_trash = isset($_GET['post_status']) && $_GET['post_status'] == 'trash';
+
?>
<div class="alignleft actions">
<select name="action">
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
+<?php if ( $is_trash ) { ?>
+<option value="untrash"><?php _e('Restore'); ?></option>
+<?php } else { ?>
<option value="edit"><?php _e('Edit'); ?></option>
-<option value="delete"><?php _e('Delete'); ?></option>
+<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
+<option value="delete"><?php _e('Delete Permanently'); ?></option>
+<?php } else { ?>
+<option value="trash"><?php _e('Move to Trash'); ?></option>
+<?php } ?>
</select>
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
<?php wp_nonce_field('bulk-posts'); ?>
do_action('restrict_manage_posts');
?>
<input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
+<?php }
+if ( $is_trash && current_user_can('edit_others_posts') ) { ?>
+<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
<?php } ?>
</div>
<div class="alignleft actions">
<select name="action2">
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
+<?php if ( $is_trash ) { ?>
+<option value="untrash"><?php _e('Restore'); ?></option>
+<?php } else { ?>
<option value="edit"><?php _e('Edit'); ?></option>
-<option value="delete"><?php _e('Delete'); ?></option>
+<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
+<option value="delete"><?php _e('Delete Permanently'); ?></option>
+<?php } else { ?>
+<option value="trash"><?php _e('Move to Trash'); ?></option>
+<?php } ?>
</select>
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
+<?php if ( $is_trash && current_user_can('edit_others_posts') ) { ?>
+<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
+<?php } ?>
<br class="clear" />
</div>
<br class="clear" />
<?php } else { // have_posts() ?>
<div class="clear"></div>
-<p><?php _e('No posts found') ?></p>
+<p><?php
+if ( isset($_GET['post_status']) && 'trash' == $_GET['post_status'] )
+ _e('No posts found in the trash');
+else
+ _e('No posts found');
+?></p>
<?php } ?>
</form>
<?php inline_edit_row( 'post' ); ?>
<div id="ajax-response"></div>
-
<br class="clear" />
-
</div>
<?php
$loadauth = esc_js( __('Preparing author mapping form...') );
$authhead = esc_js( __('Final Step: Author Mapping') );
$nothing = esc_js( __('Nothing was imported. Had you already imported this blog?') );
+ $stopping = ''; //Missing String used below.
$title = __('Blogger Blogs');
$name = __('Blog Name');
$url = __('Blog URL');
return preg_replace( '|\s+|', ' ', $string );
}
+ function _normalize_tag( $matches ) {
+ return '<' . strtolower( $matches[1] );
+ }
+
function import_post( $entry ) {
global $importing_blog;
$post_status = isset( $entry->draft ) ? 'draft' : 'publish';
// Clean up content
- $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
+ $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
$post_content = str_replace('<br>', '<br />', $post_content);
$post_content = str_replace('<hr>', '<hr />', $post_content);
$comment_content = addslashes( $this->no_apos( @html_entity_decode( $entry->content, ENT_COMPAT, get_option('blog_charset') ) ) );
// Clean up content
- $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
+ $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content);
$comment_content = str_replace('<br>', '<br />', $comment_content);
$comment_content = str_replace('<hr>', '<hr />', $comment_content);
} else {
$comment = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_date', 'comment_content');
+ $comment = wp_filter_comment($comment);
$comment_id = wp_insert_comment($comment);
$this->blogs[$importing_blog]['comments'][$entry->old_permalink] = $comment_id;
var $entry;
function AtomParser() {
-
$this->entry = new AtomEntry();
- $this->map_attrs_func = create_function('$k,$v', 'return "$k=\"$v\"";');
- $this->map_xmlns_func = create_function('$p,$n', '$xd = "xmlns"; if(strlen($n[0])>0) $xd .= ":{$n[0]}"; return "{$xd}=\"{$n[1]}\"";');
+ }
+
+ function _map_attrs_func( $k, $v ) {
+ return "$k=\"$v\"";
+ }
+
+ function _map_xmlns_func( $p, $n ) {
+ $xd = "xmlns";
+ if ( strlen( $n[0] ) > 0 )
+ $xd .= ":{$n[0]}";
+
+ return "{$xd}=\"{$n[1]}\"";
}
function parse($xml) {
foreach($attrs as $key => $value) {
$attrs_prefix[$this->ns_to_prefix($key)] = $this->xml_escape($value);
}
- $attrs_str = join(' ', array_map($this->map_attrs_func, array_keys($attrs_prefix), array_values($attrs_prefix)));
+ $attrs_str = join(' ', array_map( array( &$this, '_map_attrs_func' ), array_keys($attrs_prefix), array_values($attrs_prefix)));
if(strlen($attrs_str) > 0) {
$attrs_str = " " . $attrs_str;
}
- $xmlns_str = join(' ', array_map($this->map_xmlns_func, array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0])));
+ $xmlns_str = join(' ', array_map( array( &$this, '_map_xmlns_func' ), array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0])));
if(strlen($xmlns_str) > 0) {
$xmlns_str = " " . $xmlns_str;
}
echo '</div>';
}
+ function _normalize_tag( $matches ) {
+ return '<' . strtolower( $matches[1] );
+ }
+
function import_posts() {
global $wpdb, $current_user;
}
// Clean up content
- $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
+ $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
$post_content = str_replace('<br>', '<br />', $post_content);
$post_content = str_replace('<hr>', '<hr />', $post_content);
$post_content = $wpdb->escape($post_content);
$comment_content = $this->unhtmlentities($comment_content);
// Clean up content
- $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
+ $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content);
$comment_content = str_replace('<br>', '<br />', $comment_content);
$comment_content = str_replace('<hr>', '<hr />', $comment_content);
$comment_content = $wpdb->escape($comment_content);
$web = "http://".$wpdb->escape($comment_site);
$message = $wpdb->escape(textconv ($comment_content));
- if($cinfo = comment_exists($name, $comment_dt))
- {
- // Update comments
- $ret_id = wp_update_comment(array(
- 'comment_ID' => $cinfo,
+ $comment = array(
'comment_post_ID' => $comment_post_ID,
'comment_author' => $name,
'comment_author_email' => $email,
'comment_date' => $comment_dt,
'comment_date_gmt' => $comment_dt,
'comment_content' => $message,
- 'comment_approved' => $comment_approved)
- );
- }
- else
- {
+ 'comment_approved' => $comment_approved);
+ $comment = wp_filter_comment($comment);
+
+ if ( $cinfo = comment_exists($name, $comment_dt) ) {
+ // Update comments
+ $comment['comment_ID'] = $cinfo;
+ $ret_id = wp_update_comment($comment);
+ } else {
// Insert comments
- $ret_id = wp_insert_comment(array(
- 'comment_post_ID' => $comment_post_ID,
- 'comment_author' => $name,
- 'comment_author_email' => $email,
- 'comment_author_url' => $web,
- 'comment_author_IP' => $comment_ip,
- 'comment_date' => $comment_dt,
- 'comment_date_gmt' => $comment_dt,
- 'comment_content' => $message,
- 'comment_approved' => $comment_approved)
- );
+ $ret_id = wp_insert_comment($comment);
}
$dccm2wpcm[$comment_ID] = $ret_id;
}
{
echo '<p>'.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from DotClear, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'</p>';
echo '<h3>'.__('Users').'</h3>';
- echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in DotClear, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and DotClear uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">Login</a> and change it.'), '/wp-login.php').'</p>';
+ echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in DotClear, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and DotClear uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">Log in</a> and change it.'), '/wp-login.php').'</p>';
echo '<h3>'.__('Preserving Authors').'</h3>';
echo '<p>'.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'</p>';
echo '<h3>'.__('Textile').'</h3>';
echo '<li>'.__('<a href="http://wordpress.org/support/">The WordPress support forums</a>').'</li>';
echo '<li>'.__('<a href="http://codex.wordpress.org">The Codex (In other words, the WordPress Bible)</a>').'</li>';
echo '</ul>';
- echo '<p>'.sprintf(__('That’s it! What are you waiting for? Go <a href="%1$s">login</a>!'), '../wp-login.php').'</p>';
+ echo '<p>'.sprintf(__('That’s it! What are you waiting for? Go <a href="%1$s">log in</a>!'), '../wp-login.php').'</p>';
}
function db_form()
<tr>
<td><label for="lastentry"><?php _e('Last entry’s number:') ?></label></td>
<td><input type="text" name="lastentry" id="lastentry" value="00000001" /><br />
- <?php _e('This importer will search for files 00000001.cgi to 000-whatever.cgi,<br />so you need to enter the number of the last GM post here.<br />(if you don’t know that number, just log into your FTP and look it out<br />in the entries’ folder)') ?></td>
+ <?php _e('This importer will search for files 00000001.cgi to 000-whatever.cgi,<br />so you need to enter the number of the last GM post here.<br />(if you don’t know that number, just log in to your FTP and look it out<br />in the entries’ folder)') ?></td>
</tr>
</table>
<p class="submit"><input type="submit" name="submit" class="button" value="<?php esc_attr_e('Start Importing') ?>" /></p>
echo '</ol>';
}
+ function _normalize_tag( $matches ) {
+ return '<' . strtolower( $matches[1] );
+ }
+
function import_post( $post ) {
global $wpdb;
// Clean up content
$post_content = $post['event'];
- $post_content = preg_replace_callback( '|<(/?[A-Z]+)|', create_function( '$match', 'return "<" . strtolower( $match[1] );' ), $post_content );
+ $post_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content );
// XHTMLize some tags
$post_content = str_replace( '<br>', '<br />', $post_content );
$post_content = str_replace( '<hr>', '<hr />', $post_content );
// Parse this comment into an array and insert
$comment = $this->parse_comment( $comment );
+ $comment = wp_filter_comment( $comment );
$id = wp_insert_comment( $comment );
// Clear cache
$comment_content = wpautop( $comment_content );
$comment_content = str_replace( '<br>', '<br />', $comment_content );
$comment_content = str_replace( '<hr>', '<hr />', $comment_content );
- $comment_content = preg_replace_callback( '|<(/?[A-Z]+)|', create_function( '$match', 'return "<" . strtolower( $match[1] );' ), $comment_content );
+ $comment_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content );
$comment_content = $wpdb->escape( trim( $comment_content ) );
// Get and convert the date
$this->protected_password = get_option( 'ljapi_protected_password' );
}
- // Login to confirm the details are correct
+ // Log in to confirm the details are correct
if ( empty( $this->username ) || empty( $this->password ) ) {
?>
<p><?php _e( 'Please enter your LiveJournal username <em>and</em> password so we can download your posts and comments.' ) ?></p>
<?php
/**
- * Movable Type and Typepad Importer
+ * Movable Type and TypePad Importer
*
* @package WordPress
* @subpackage Importer
*/
/**
- * Moveable Type and Typepad Importer class
+ * Moveable Type and TypePad Importer class
*
- * Upload your exported Movable Type or Typepad entries into WordPress.
+ * Upload your exported Movable Type or TypePad entries into WordPress.
*
* @since unknown
*/
$this->header();
?>
<div class="narrow">
-<p><?php _e('Howdy! We’re about to begin importing all of your Movable Type or Typepad entries into WordPress. To begin, either choose a file to upload and click “Upload file and import”, or use FTP to upload your MT export file as <code>mt-export.txt</code> in your <code>/wp-content/</code> directory and then click "Import mt-export.txt"'); ?></p>
+<p><?php _e('Howdy! We’re about to begin importing all of your Movable Type or TypePad entries into WordPress. To begin, either choose a file to upload and click “Upload file and import”, or use FTP to upload your MT export file as <code>mt-export.txt</code> in your <code>/wp-content/</code> directory and then click "Import mt-export.txt"'); ?></p>
<?php wp_import_upload_form( add_query_arg('step', 1) ); ?>
<form method="post" action="<?php echo esc_attr(add_query_arg('step', 1)); ?>" class="import-upload-form">
$mt_import = new MT_Import();
-register_importer('mt', __('Movable Type and TypePad'), __('Import posts and comments from a Movable Type or Typepad blog.'), array ($mt_import, 'dispatch'));
+register_importer('mt', __('Movable Type and TypePad'), __('Import posts and comments from a Movable Type or TypePad blog.'), array ($mt_import, 'dispatch'));
?>
echo '</div>';
}
+ function _normalize_tag( $matches ) {
+ return '<' . strtolower( $matches[1] );
+ }
+
function get_posts() {
global $wpdb;
}
// Clean up content
- $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
+ $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
$post_content = str_replace('<br>', '<br />', $post_content);
$post_content = str_replace('<hr>', '<hr />', $post_content);
$web = $wpdb->escape($web);
$message = $wpdb->escape($message);
- if($cinfo = comment_exists($name, $posted))
- {
+ $comment = array(
+ 'comment_post_ID' => $comment_post_ID,
+ 'comment_author' => $name,
+ 'comment_author_IP' => $ip,
+ 'comment_author_email' => $email,
+ 'comment_author_url' => $web,
+ 'comment_date' => $posted,
+ 'comment_content' => $message,
+ 'comment_approved' => $comment_approved);
+ $comment = wp_filter_comment($comment);
+
+ if ( $cinfo = comment_exists($name, $posted) ) {
// Update comments
- $ret_id = wp_update_comment(array(
- 'comment_ID' => $cinfo,
- 'comment_post_ID' => $comment_post_ID,
- 'comment_author' => $name,
- 'comment_author_email' => $email,
- 'comment_author_url' => $web,
- 'comment_date' => $posted,
- 'comment_content' => $message,
- 'comment_approved' => $comment_approved)
- );
- }
- else
- {
+ $comment['comment_ID'] = $cinfo;
+ $ret_id = wp_update_comment($comment);
+ } else {
// Insert comments
- $ret_id = wp_insert_comment(array(
- 'comment_post_ID' => $comment_post_ID,
- 'comment_author' => $name,
- 'comment_author_email' => $email,
- 'comment_author_url' => $web,
- 'comment_author_IP' => $ip,
- 'comment_date' => $posted,
- 'comment_content' => $message,
- 'comment_approved' => $comment_approved)
- );
+ $ret_id = wp_insert_comment($comment);
}
$txpcm2wpcm[$comment_ID] = $ret_id;
}
{
echo '<p>'.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from Textpattern, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'</p>';
echo '<h3>'.__('Users').'</h3>';
- echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in Textpattern, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and Textpattern uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">Login</a> and change it.'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
+ echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in Textpattern, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and Textpattern uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">log in</a> and change it.'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
echo '<h3>'.__('Preserving Authors').'</h3>';
echo '<p>'.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'</p>';
echo '<h3>'.__('Textile').'</h3>';
echo '<li>'.__('<a href="http://wordpress.org/support/">The WordPress support forums</a>').'</li>';
echo '<li>'.__('<a href="http://codex.wordpress.org">The Codex (In other words, the WordPress Bible)</a>').'</li>';
echo '</ul>';
- echo '<p>'.sprintf(__('That’s it! What are you waiting for? Go <a href="%1$s">login</a>!'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
+ echo '<p>'.sprintf(__('That’s it! What are you waiting for? Go <a href="%1$s">log in</a>!'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
}
function db_form()
var $author_ids = array ();
var $tags = array ();
var $categories = array ();
+ var $terms = array ();
var $j = -1;
var $fetch_attachments = false;
$this->tags[] = $tag[1];
continue;
}
+ if ( false !== strpos($importline, '<wp:term>') ) {
+ preg_match('|<wp:term>(.*?)</wp:term>|is', $importline, $term);
+ $this->terms[] = $term[1];
+ continue;
+ }
if ( false !== strpos($importline, '<item>') ) {
$this->post = '';
$doing_entry = true;
function wp_authors_form() {
?>
-<?php screen_icon(); ?>
<h2><?php _e('Assign Authors'); ?></h2>
<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.'); ?></p>
<?php
$authors = $this->get_wp_authors();
echo '<form action="?import=wordpress&step=2&id=' . $this->id . '" method="post">';
wp_nonce_field('import-wordpress');
- echo '<ol id="authors">';
+?>
+<ol id="authors">
+<?php
$j = -1;
foreach ($authors as $author) {
++ $j;
if ( $this->allow_fetch_attachments() ) {
?>
</ol>
-<?php screen_icon(); ?>
<h2><?php _e('Import Attachments'); ?></h2>
<p>
<input type="checkbox" value="1" name="attachments" id="import-attachments" />
$tag_ID = wp_insert_term($tag_name, 'post_tag', $tagarr);
}
}
+
+ function process_terms() {
+ global $wpdb, $wp_taxonomies;
+
+ $custom_taxonomies = $wp_taxonomies;
+ // get rid of the standard taxonomies
+ unset( $custom_taxonomies['category'] );
+ unset( $custom_taxonomies['post_tag'] );
+ unset( $custom_taxonomies['link_category'] );
+
+ $custom_taxonomies = array_keys( $custom_taxonomies );
+ $current_terms = (array) get_terms( $custom_taxonomies, 'get=all' );
+ $taxonomies = array();
+ foreach ( $current_terms as $term ) {
+ if ( isset( $_terms[$term->taxonomy] ) ) {
+ $taxonomies[$term->taxonomy] = array_merge( $taxonomies[$term->taxonomy], array($term->name) );
+ } else {
+ $taxonomies[$term->taxonomy] = array($term->name);
+ }
+ }
+
+ while ( $c = array_shift($this->terms) ) {
+ $term_name = trim($this->get_tag( $c, 'wp:term_name' ));
+ $term_taxonomy = trim($this->get_tag( $c, 'wp:term_taxonomy' ));
+
+ // If the term exists in the taxonomy we leave it alone
+ if ( isset($taxonomies[$term_taxonomy] ) && in_array( $term_name, $taxonomies[$term_taxonomy] ) )
+ continue;
+
+ $slug = $this->get_tag( $c, 'wp:term_slug' );
+ $description = $this->get_tag( $c, 'wp:term_description' );
+
+ $termarr = compact('slug', 'description');
+
+ $term_ID = wp_insert_term($term_name, $this->get_tag( $c, 'wp:term_taxonomy' ), $termarr);
+ }
+ }
function process_author($post) {
$author = $this->get_tag( $post, 'dc:creator' );
echo '<h3>'.sprintf(__('All done.').' <a href="%s">'.__('Have fun!').'</a>', get_option('home')).'</h3>';
}
+ function _normalize_tag( $matches ) {
+ return '<' . strtolower( $matches[1] );
+ }
+
function process_post($post) {
global $wpdb;
$menu_order = $this->get_tag( $post, 'wp:menu_order' );
$post_type = $this->get_tag( $post, 'wp:post_type' );
$post_password = $this->get_tag( $post, 'wp:post_password' );
+ $is_sticky = $this->get_tag( $post, 'wp:is_sticky' );
$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_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_excerpt);
+ $post_excerpt = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_excerpt);
$post_excerpt = str_replace('<br>', '<br />', $post_excerpt);
$post_excerpt = str_replace('<hr>', '<hr />', $post_excerpt);
$post_content = $this->get_tag( $post, 'content:encoded' );
- $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
+ $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
$post_content = str_replace('<br>', '<br />', $post_content);
$post_content = str_replace('<hr>', '<hr />', $post_content);
else {
printf(__('Importing post <em>%s</em>...'), stripslashes($post_title));
$comment_post_ID = $post_id = wp_insert_post($postdata);
+ if ( $post_id && $is_sticky == 1 )
+ stick_post( $post_id );
+
}
if ( is_wp_error( $post_id ) )
preg_match_all('|<wp:comment>(.*?)</wp:comment>|is', $post, $comments);
$comments = $comments[1];
$num_comments = 0;
- if ( $comments) { foreach ($comments as $comment) {
- $comment_author = $this->get_tag( $comment, 'wp:comment_author');
- $comment_author_email = $this->get_tag( $comment, 'wp:comment_author_email');
- $comment_author_IP = $this->get_tag( $comment, 'wp:comment_author_IP');
- $comment_author_url = $this->get_tag( $comment, 'wp:comment_author_url');
- $comment_date = $this->get_tag( $comment, 'wp:comment_date');
- $comment_date_gmt = $this->get_tag( $comment, 'wp:comment_date_gmt');
- $comment_content = $this->get_tag( $comment, 'wp:comment_content');
- $comment_approved = $this->get_tag( $comment, 'wp:comment_approved');
- $comment_type = $this->get_tag( $comment, 'wp:comment_type');
- $comment_parent = $this->get_tag( $comment, 'wp:comment_parent');
-
- // if this is a new post we can skip the comment_exists() check
- if ( !$post_exists || !comment_exists($comment_author, $comment_date) ) {
- $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_date_gmt', 'comment_content', 'comment_approved', 'comment_type', 'comment_parent');
- wp_insert_comment($commentdata);
- $num_comments++;
+ $inserted_comments = array();
+ if ( $comments) {
+ foreach ($comments as $comment) {
+ $comment_id = $this->get_tag( $comment, 'wp:comment_id');
+ $newcomments[$comment_id]['comment_post_ID'] = $comment_post_ID;
+ $newcomments[$comment_id]['comment_author'] = $this->get_tag( $comment, 'wp:comment_author');
+ $newcomments[$comment_id]['comment_author_email'] = $this->get_tag( $comment, 'wp:comment_author_email');
+ $newcomments[$comment_id]['comment_author_IP'] = $this->get_tag( $comment, 'wp:comment_author_IP');
+ $newcomments[$comment_id]['comment_author_url'] = $this->get_tag( $comment, 'wp:comment_author_url');
+ $newcomments[$comment_id]['comment_date'] = $this->get_tag( $comment, 'wp:comment_date');
+ $newcomments[$comment_id]['comment_date_gmt'] = $this->get_tag( $comment, 'wp:comment_date_gmt');
+ $newcomments[$comment_id]['comment_content'] = $this->get_tag( $comment, 'wp:comment_content');
+ $newcomments[$comment_id]['comment_approved'] = $this->get_tag( $comment, 'wp:comment_approved');
+ $newcomments[$comment_id]['comment_type'] = $this->get_tag( $comment, 'wp:comment_type');
+ $newcomments[$comment_id]['comment_parent'] = $this->get_tag( $comment, 'wp:comment_parent');
}
- } }
+ // Sort by comment ID, to make sure comment parents exist (if there at all)
+ ksort($newcomments);
+ foreach ($newcomments as $key => $comment) {
+ // if this is a new post we can skip the comment_exists() check
+ if ( !$post_exists || !comment_exists($comment['comment_author'], $comment['comment_date']) ) {
+ if (isset($inserted_comments[$comment['comment_parent']]))
+ $comment['comment_parent'] = $inserted_comments[$comment['comment_parent']];
+ $comment = wp_filter_comment($comment);
+ $inserted_comments[$key] = wp_insert_comment($comment);
+ $num_comments++;
+ }
+ }
+ }
if ( $num_comments )
printf(' '._n('(%s comment)', '(%s comments)', $num_comments), $num_comments);
$this->get_entries();
$this->process_categories();
$this->process_tags();
+ $this->process_terms();
$result = $this->process_posts();
wp_suspend_cache_invalidation(false);
$this->backfill_parents();
$dns=@gethostbyaddr($host);
if(!$ip) $ip=$host;
if(!$dns) $dns=$host;
- if(ip2long($ip) === -1) {
+ // Validate the IPAddress PHP4 returns -1 for invalid, PHP5 false
+ // -1 === "255.255.255.255" which is the broadcast address which is also going to be invalid
+ $ipaslong = ip2long($ip);
+ if ( ($ipaslong == false) || ($ipaslong === -1) ) {
$this->SendMSG("Wrong host name/address \"".$host."\"");
return FALSE;
}
<?php
// --------------------------------------------------------------------------------
-// PhpConcept Library - Zip Module 2.8
+// PhpConcept Library - Zip Module 2.8.2
// --------------------------------------------------------------------------------
-// License GNU/LGPL - Vincent Blavet - March 2006
+// License GNU/LGPL - Vincent Blavet - August 2009
// http://www.phpconcept.net
// --------------------------------------------------------------------------------
//
// The use of this software is at the risk of the user.
//
// --------------------------------------------------------------------------------
-// $Id: pclzip.lib.php,v 1.55 2009/04/22 07:38:36 vblavet Exp $
+// $Id: pclzip.lib.php,v 1.60 2009/09/30 21:01:04 vblavet Exp $
// --------------------------------------------------------------------------------
// ----- Constants
if (!defined('PCLZIP_READ_BLOCK_SIZE')) {
define( 'PCLZIP_READ_BLOCK_SIZE', 2048 );
}
-
+
// ----- File list separator
// In version 1.x of PclZip, the separator for file list is a space
// (which is not a very smart choice, specifically for windows paths !).
// ----- Optional threshold ratio for use of temporary files
// Pclzip sense the size of the file to add/extract and decide to
- // use or not temporary file. The algorythm is looking for
+ // use or not temporary file. The algorythm is looking for
// memory_limit of PHP and apply a ratio.
// threshold = memory_limit * ratio.
// Recommended values are under 0.5. Default 0.47.
// --------------------------------------------------------------------------------
// ----- Global variables
- $g_pclzip_version = "2.8";
+ $g_pclzip_version = "2.8.2";
// ----- Error codes
// -1 : Unable to open file in binary write mode
define( 'PCLZIP_OPT_ADD_TEMP_FILE_ON', 77021 ); // alias
define( 'PCLZIP_OPT_TEMP_FILE_OFF', 77022 );
define( 'PCLZIP_OPT_ADD_TEMP_FILE_OFF', 77022 ); // alias
-
+
// ----- File description attributes
define( 'PCLZIP_ATT_FILE_NAME', 79001 );
define( 'PCLZIP_ATT_FILE_NEW_SHORT_NAME', 79002 );
// ----- Internal error handling
var $error_code = 1;
var $error_string = '';
-
+
// ----- Current status of the magic_quotes_runtime
// This value store the php configuration for magic_quotes
// The class can then disable the magic_quotes and reset it after
// --------------------------------------------------------------------------------
function PclZip($p_zipname)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::PclZip', "zipname=$p_zipname");
// ----- Tests the zlib
if (!function_exists('gzopen'))
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 1, "zlib extension seems to be missing");
die('Abort '.basename(__FILE__).' : Missing zlib extensions');
}
$this->magic_quotes_status = -1;
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 1);
return;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function create($p_filelist)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::create', "filelist='$p_filelist', ...");
$v_result=1;
// ----- Reset the error handler
// ----- Look for variable options arguments
$v_size = func_num_args();
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method");
// ----- Look for arguments
if ($v_size > 1) {
// ----- Look for first arg
if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected");
// ----- Parse the options
$v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
//, PCLZIP_OPT_CRYPT => 'optional'
));
if ($v_result != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
}
// Here we need to support the first historic synopsis of the
// method.
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis");
// ----- Get the first argument
$v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0];
else if ($v_size > 2) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,
"Invalid number / type of arguments");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return 0;
}
}
}
-
+
// ----- Look for default option values
$this->privOptionDefaultThreshold($v_options);
$v_att_list = array();
$v_filedescr_list = array();
$p_result_list = array();
-
+
// ----- Look if the $p_filelist is really an array
if (is_array($p_filelist)) {
-
+
// ----- Look if the first element is also an array
// This will mean that this is a file description entry
if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
$v_att_list = $p_filelist;
}
-
+
// ----- The list is a list of string names
else {
$v_string_list = $p_filelist;
// ----- Invalid variable type for $p_filelist
else {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
-
+
// ----- Reformat the string list
if (sizeof($v_string_list) != 0) {
foreach ($v_string_list as $v_string) {
$v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;
}
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Ignore an empty filename");
}
}
}
-
+
// ----- For each file in the list check the attributes
$v_supported_attributes
= array ( PCLZIP_ATT_FILE_NAME => 'mandatory'
$v_options,
$v_supported_attributes);
if ($v_result != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
}
// ----- Expand the filelist (expand directories)
$v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options);
if ($v_result != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
// ----- Call the create fct
$v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options);
if ($v_result != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list);
return $p_result_list;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function add($p_filelist)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::add', "filelist='$p_filelist', ...");
$v_result=1;
// ----- Reset the error handler
// ----- Look for variable options arguments
$v_size = func_num_args();
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method");
// ----- Look for arguments
if ($v_size > 1) {
// ----- Look for first arg
if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected");
// ----- Parse the options
$v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
//, PCLZIP_OPT_CRYPT => 'optional'
));
if ($v_result != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
}
// Here we need to support the first historic synopsis of the
// method.
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis");
// ----- Get the first argument
$v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0];
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return 0;
}
}
$v_att_list = array();
$v_filedescr_list = array();
$p_result_list = array();
-
+
// ----- Look if the $p_filelist is really an array
if (is_array($p_filelist)) {
-
+
// ----- Look if the first element is also an array
// This will mean that this is a file description entry
if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
$v_att_list = $p_filelist;
}
-
+
// ----- The list is a list of string names
else {
$v_string_list = $p_filelist;
// ----- Invalid variable type for $p_filelist
else {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
-
+
// ----- Reformat the string list
if (sizeof($v_string_list) != 0) {
foreach ($v_string_list as $v_string) {
$v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;
}
}
-
+
// ----- For each file in the list check the attributes
$v_supported_attributes
= array ( PCLZIP_ATT_FILE_NAME => 'mandatory'
$v_options,
$v_supported_attributes);
if ($v_result != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
}
// ----- Expand the filelist (expand directories)
$v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options);
if ($v_result != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
// ----- Call the create fct
$v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options);
if ($v_result != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list);
return $p_result_list;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function listContent()
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::listContent', "");
$v_result=1;
// ----- Reset the error handler
// ----- Check archive
if (!$this->privCheckFormat()) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return(0);
}
if (($v_result = $this->privList($p_list)) != 1)
{
unset($p_list);
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
return(0);
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list);
return $p_list;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function extract()
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extract", "");
$v_result=1;
// ----- Reset the error handler
// ----- Check archive
if (!$this->privCheckFormat()) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return(0);
}
// ----- Look for variable options arguments
$v_size = func_num_args();
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method");
// ----- Default values for option
$v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;
// ----- Look for first arg
if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options");
// ----- Parse the options
$v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
));
if ($v_result != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
// Here we need to support the first historic synopsis of the
// method.
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis");
// ----- Get the first argument
$v_path = $v_arg_list[0];
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
return 0;
}
}
$this->privOptionDefaultThreshold($v_options);
// ----- Trace
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'");
// ----- Call the extracting fct
$p_list = array();
$v_remove_all_path, $v_options);
if ($v_result < 1) {
unset($p_list);
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
return(0);
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list);
return $p_list;
}
// --------------------------------------------------------------------------------
//function extractByIndex($p_index, options...)
function extractByIndex($p_index)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extractByIndex", "index='$p_index', ...");
$v_result=1;
// ----- Reset the error handler
// ----- Check archive
if (!$this->privCheckFormat()) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return(0);
}
// ----- Look for variable options arguments
$v_size = func_num_args();
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method");
// ----- Default values for option
$v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;
// ----- Look for first arg
if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options");
// ----- Parse the options
$v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
));
if ($v_result != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
}
if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) {
$v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING not set.");
}
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING set.");
}
}
// Here we need to support the first historic synopsis of the
// method.
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis");
// ----- Get the first argument
$v_path = $v_arg_list[0];
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return 0;
}
}
}
// ----- Trace
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "index='$p_index', path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'");
// ----- Trick
// Here I want to reuse extractByRule(), so I need to parse the $p_index
$v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick,
array (PCLZIP_OPT_BY_INDEX => 'optional' ));
if ($v_result != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
$v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX];
// ----- Call the extracting fct
if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
return(0);
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list);
return $p_list;
}
// --------------------------------------------------------------------------------
// Options :
// PCLZIP_OPT_BY_INDEX :
// PCLZIP_OPT_BY_NAME :
- // PCLZIP_OPT_BY_EREG :
+ // PCLZIP_OPT_BY_EREG :
// PCLZIP_OPT_BY_PREG :
// Return Values :
// 0 on failure,
// --------------------------------------------------------------------------------
function delete()
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::delete", "");
$v_result=1;
// ----- Reset the error handler
// ----- Check archive
if (!$this->privCheckFormat()) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return(0);
}
// ----- Look for variable options arguments
$v_size = func_num_args();
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method");
// ----- Look for arguments
if ($v_size > 0) {
PCLZIP_OPT_BY_PREG => 'optional',
PCLZIP_OPT_BY_INDEX => 'optional' ));
if ($v_result != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
}
if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) {
$this->privSwapBackMagicQuotes();
unset($v_list);
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
return(0);
}
$this->privSwapBackMagicQuotes();
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_list);
return $v_list;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function deleteByIndex($p_index)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::deleteByIndex", "index='$p_index'");
-
+
$p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index);
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list);
return $p_list;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function properties()
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::properties", "");
// ----- Reset the error handler
$this->privErrorReset();
// ----- Check archive
if (!$this->privCheckFormat()) {
$this->privSwapBackMagicQuotes();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return(0);
}
if (@is_file($this->zipname))
{
// ----- Open the zip file
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0)
{
$this->privSwapBackMagicQuotes();
-
+
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), 0);
return 0;
}
if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
{
$this->privSwapBackMagicQuotes();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return 0;
}
$this->privSwapBackMagicQuotes();
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_prop);
return $v_prop;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function duplicate($p_archive)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::duplicate", "");
$v_result = 1;
// ----- Reset the error handler
// ----- Look if the $p_archive is a PclZip object
if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip'))
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is valid PclZip object '".$p_archive->zipname."'");
// ----- Duplicate the archive
$v_result = $this->privDuplicate($p_archive->zipname);
// ----- Look if the $p_archive is a string (so a filename)
else if (is_string($p_archive))
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is a filename '$p_archive'");
// ----- Check that $p_archive is a valid zip file
// TBC : Should also check the archive format
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function merge($p_archive_to_add)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::merge", "");
$v_result = 1;
// ----- Reset the error handler
// ----- Check archive
if (!$this->privCheckFormat()) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
return(0);
}
// ----- Look if the $p_archive_to_add is a PclZip object
if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip'))
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is valid PclZip object");
// ----- Merge the archive
$v_result = $this->privMerge($p_archive_to_add);
// ----- Look if the $p_archive_to_add is a string (so a filename)
else if (is_string($p_archive_to_add))
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is a filename");
// ----- Create a temporary archive
$v_object_archive = new PclZip($p_archive_to_add);
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privCheckFormat($p_level=0)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCheckFormat", "");
$v_result = true;
// ----- Reset the file system cache
if (!is_file($this->zipname)) {
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo());
return(false);
}
if (!is_readable($this->zipname)) {
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo());
return(false);
}
// TBC
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privParseOptions", "");
$v_result=1;
-
+
// ----- Read the options
$i=0;
while ($i<$p_size) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Looking for table index $i, option = '".PclZipUtilOptionText($p_options_list[$i])."(".$p_options_list[$i].")'");
// ----- Check if the option is supported
if (!isset($v_requested_options[$p_options_list[$i]])) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Get the value
$v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
$i++;
break;
// ----- Check the number of parameters
if (($i+1) >= $p_size) {
PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
-
+
// ----- Check for incompatible options
if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
-
+
// ----- Check the value
$v_value = $p_options_list[$i+1];
if ((!is_integer($v_value)) || ($v_value<0)) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Integer expected for option '".PclZipUtilOptionText($p_options_list[$i])."'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Get the value (and convert it in bytes)
$v_result_list[$p_options_list[$i]] = $v_value*1048576;
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
$i++;
break;
// ----- Check for incompatible options
if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
-
+
$v_result_list[$p_options_list[$i]] = true;
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
break;
case PCLZIP_OPT_TEMP_FILE_OFF :
// ----- Check for incompatible options
if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_ON])) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_ON'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Check for incompatible options
if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_THRESHOLD'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
-
+
$v_result_list[$p_options_list[$i]] = true;
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
break;
case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION :
PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
if ( is_string($p_options_list[$i+1])
&& ($p_options_list[$i+1] != '')) {
$v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
$i++;
}
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." set with an empty value is ignored.");
}
break;
PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
- ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
$i++;
break;
// ----- Look for options that request an EREG or PREG expression
case PCLZIP_OPT_BY_EREG :
+ // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG
+ // to PCLZIP_OPT_BY_PREG
+ $p_options_list[$i] = PCLZIP_OPT_BY_PREG;
case PCLZIP_OPT_BY_PREG :
//case PCLZIP_OPT_CRYPT :
// ----- Check the number of parameters
PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
$i++;
break;
."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
$i++;
break;
PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Get the value
$v_work_list = array();
if (is_string($p_options_list[$i+1])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is a string '".$p_options_list[$i+1]."'");
// ----- Remove spaces
$p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', '');
$v_work_list = explode(",", $p_options_list[$i+1]);
}
else if (is_integer($p_options_list[$i+1])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is an integer '".$p_options_list[$i+1]."'");
$v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1];
}
else if (is_array($p_options_list[$i+1])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is an array");
$v_work_list = $p_options_list[$i+1];
}
else {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
-
+
// ----- Reduce the index list
// each index item in the list must be a couple with a start and
// an end value : [0,3], [5-5], [8-10], ...
// ----- Explode the item
$v_item_list = explode("-", $v_work_list[$j]);
$v_size_item_list = sizeof($v_item_list);
-
+
// ----- TBC : Here we might check that each item is a
// real integer ...
-
+
// ----- Look for single value
if ($v_size_item_list == 1) {
// ----- Set the option value
PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Too many values in index range for option '".PclZipUtilOptionText($p_options_list[$i])."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extracted index item = [".$v_result_list[$p_options_list[$i]][$j]['start'].",".$v_result_list[$p_options_list[$i]][$j]['end']."]");
// ----- Look for list sort
if ($v_result_list[$p_options_list[$i]][$j]['start'] < $v_sort_value) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The list should be sorted ...");
$v_sort_flag=true;
// ----- TBC : An automatic sort should be writen ...
PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Invalid order of index range for option '".PclZipUtilOptionText($p_options_list[$i])."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
$v_sort_value = $v_result_list[$p_options_list[$i]][$j]['start'];
}
-
+
// ----- Sort the items
if ($v_sort_flag) {
// TBC : To Be Completed
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "List sorting is not yet write ...");
}
// ----- Next option
case PCLZIP_OPT_REPLACE_NEWER :
case PCLZIP_OPT_STOP_ON_ERROR :
$v_result_list[$p_options_list[$i]] = true;
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
break;
// ----- Look for options that request an octal value
PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Get the value
$v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
$i++;
break;
PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Get the value
$v_function_name = $p_options_list[$i+1];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "call-back ".PclZipUtilOptionText($p_options_list[$i])." = '".$v_function_name."'");
// ----- Check that the value is a valid existing function
if (!function_exists($v_function_name)) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
.$p_options_list[$i]."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) {
// ----- Look for mandatory option
if ($v_requested_options[$key] == 'mandatory') {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Detect a mandatory option : ".PclZipUtilOptionText($key)."(".$key.")");
// ----- Look if present
if (!isset($v_result_list[$key])) {
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
}
}
}
-
+
// ----- Look for default values
if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Calculate auto threshold");
-
+
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privOptionDefaultThreshold(&$p_options)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privOptionDefaultThreshold", "");
$v_result=1;
-
+
if (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])
|| isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
-
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Create an auto-threshold for use of temporay files");
+
// ----- Get 'memory_limit' configuration value
$v_memory_limit = ini_get('memory_limit');
$v_memory_limit = trim($v_memory_limit);
$last = strtolower(substr($v_memory_limit, -1));
-
+
if($last == 'g')
//$v_memory_limit = $v_memory_limit*1024*1024*1024;
$v_memory_limit = $v_memory_limit*1073741824;
$v_memory_limit = $v_memory_limit*1048576;
if($last == 'k')
$v_memory_limit = $v_memory_limit*1024;
-
+
$p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit*PCLZIP_TEMPORARY_FILE_RATIO);
-
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Current memory usage : ".memory_get_usage(TRUE)." bytes");
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Threshold value is : ".$p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]." bytes");
+
// ----- Sanity check : No threshold if value lower than 1M
if ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] < 1048576) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Unset the threshold (value ".$p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD].") because under 1Mo sanity check)");
unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]);
}
-
+
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options=false)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrParseAtt", "");
$v_result=1;
-
+
// ----- For each file in the list check the attributes
foreach ($p_file_list as $v_key => $v_value) {
-
+
// ----- Check if the option is supported
if (!isset($v_requested_options[$v_key])) {
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file attribute '".$v_key."' for this file");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
case PCLZIP_ATT_FILE_NAME :
if (!is_string($v_value)) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
$p_filedescr['filename'] = PclZipUtilPathReduction($v_value);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'");
-
+
if ($p_filedescr['filename'] == '') {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
case PCLZIP_ATT_FILE_NEW_SHORT_NAME :
if (!is_string($v_value)) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
$p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'");
if ($p_filedescr['new_short_name'] == '') {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
break;
case PCLZIP_ATT_FILE_NEW_FULL_NAME :
if (!is_string($v_value)) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
$p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'");
if ($p_filedescr['new_full_name'] == '') {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
break;
case PCLZIP_ATT_FILE_COMMENT :
if (!is_string($v_value)) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
$p_filedescr['comment'] = $v_value;
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'");
break;
case PCLZIP_ATT_FILE_MTIME :
if (!is_integer($v_value)) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". Integer expected for attribute '".PclZipUtilOptionText($v_key)."'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
$p_filedescr['mtime'] = $v_value;
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'");
break;
case PCLZIP_ATT_FILE_CONTENT :
$p_filedescr['content'] = $v_value;
- ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'");
break;
default :
"Unknown parameter '".$v_key."'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) {
// ----- Look for mandatory option
if ($v_requested_options[$key] == 'mandatory') {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Detect a mandatory option : ".PclZipUtilOptionText($key)."(".$key.")");
// ----- Look if present
if (!isset($p_file_list[$key])) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
}
}
}
-
+
// end foreach
}
-
+
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// or a string to be added as file. For any other type of files (link, other)
// just ignore the item.
// Then prepare the information that will be stored for that file.
- // When its a folder, expand the folder with all the files that are in that
+ // When its a folder, expand the folder with all the files that are in that
// folder (recursively).
// Parameters :
// Return Values :
// --------------------------------------------------------------------------------
function privFileDescrExpand(&$p_filedescr_list, &$p_options)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrExpand", "");
$v_result=1;
-
+
// ----- Create a result list
$v_result_list = array();
-
+
// ----- Look each entry
for ($i=0; $i<sizeof($p_filedescr_list); $i++) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Looking for file ".$i.".");
-
+
// ----- Get filedescr
$v_descr = $p_filedescr_list[$i];
-
+
// ----- Reduce the filename
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filedescr before reduction :'".$v_descr['filename']."'");
$v_descr['filename'] = PclZipUtilTranslateWinPath($v_descr['filename'], false);
$v_descr['filename'] = PclZipUtilPathReduction($v_descr['filename']);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filedescr after reduction :'".$v_descr['filename']."'");
-
+
// ----- Look for real file or folder
if (file_exists($v_descr['filename'])) {
if (@is_file($v_descr['filename'])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "This is a file");
$v_descr['type'] = 'file';
}
else if (@is_dir($v_descr['filename'])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "This is a folder");
$v_descr['type'] = 'folder';
}
else if (@is_link($v_descr['filename'])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Unsupported file type : link");
// skip
continue;
}
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Unsupported file type : unknown type");
// skip
continue;
}
}
-
+
// ----- Look for string added as file
else if (isset($v_descr['content'])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "This is a string added as a file");
$v_descr['type'] = 'virtual_file';
}
-
+
// ----- Missing file
else {
// ----- Error log
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_descr['filename']."' does not exist");
PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$v_descr['filename']."' does not exist");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
-
+
// ----- Calculate the stored filename
$this->privCalculateStoredFilename($v_descr, $p_options);
-
+
// ----- Add the descriptor in result list
$v_result_list[sizeof($v_result_list)] = $v_descr;
-
+
// ----- Look for folder
if ($v_descr['type'] == 'folder') {
// ----- List of items in folder
$v_dirlist_nb = 0;
if ($v_folder_handler = @opendir($v_descr['filename'])) {
while (($v_item_handler = @readdir($v_folder_handler)) !== false) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Looking for '".$v_item_handler."' in the directory");
// ----- Skip '.' and '..'
if (($v_item_handler == '.') || ($v_item_handler == '..')) {
continue;
}
-
+
// ----- Compose the full filename
$v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler;
-
+
// ----- Look for different stored filename
// Because the name of the folder was changed, the name of the
// files/sub-folders also change
- if ($v_descr['stored_filename'] != $v_descr['filename']) {
+ if (($v_descr['stored_filename'] != $v_descr['filename'])
+ && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) {
if ($v_descr['stored_filename'] != '') {
$v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler;
}
$v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler;
}
}
-
+
$v_dirlist_nb++;
}
-
+
@closedir($v_folder_handler);
}
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to open dir '".$v_descr['filename']."' in read mode. Skipped.");
// TBC : unable to open folder in read mode
}
-
+
// ----- Expand each element of the list
if ($v_dirlist_nb != 0) {
// ----- Expand
if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
-
+
// ----- Concat the resulting list
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Merging result list (size '".sizeof($v_result_list)."') with dirlist (size '".sizeof($v_dirlist_descr)."')");
$v_result_list = array_merge($v_result_list, $v_dirlist_descr);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "merged result list is size '".sizeof($v_result_list)."'");
}
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Nothing in this folder to expand.");
}
-
+
// ----- Free local array
unset($v_dirlist_descr);
}
}
-
+
// ----- Get the result list
$p_filedescr_list = $v_result_list;
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privCreate($p_filedescr_list, &$p_result_list, &$p_options)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCreate", "list");
$v_result=1;
$v_list_detail = array();
-
+
// ----- Magic quotes trick
$this->privDisableMagicQuotes();
if (($v_result = $this->privOpenFd('wb')) != 1)
{
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
$this->privSwapBackMagicQuotes();
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privAdd($p_filedescr_list, &$p_result_list, &$p_options)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAdd", "list");
$v_result=1;
$v_list_detail = array();
// ----- Look if the archive exists or is empty
if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0))
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive does not exist, or is empty, create it.");
// ----- Do a create
$v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options);
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Magic quotes trick
$this->privDisableMagicQuotes();
// ----- Open the zip file
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
if (($v_result=$this->privOpenFd('rb')) != 1)
{
// ----- Magic quotes trick
$this->privSwapBackMagicQuotes();
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
{
$this->privCloseFd();
$this->privSwapBackMagicQuotes();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Go to beginning of File
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'");
@rewind($this->zip_fd);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'");
// ----- Creates a temporay file
$v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';
// ----- Open the temporary file in write mode
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0)
{
$this->privCloseFd();
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
while ($v_size != 0)
{
$v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
$v_buffer = fread($this->zip_fd, $v_read_size);
@fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
$v_size -= $v_read_size;
$this->privSwapBackMagicQuotes();
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Store the offset of the central dir
$v_offset = @ftell($this->zip_fd);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "New offset of central dir : $v_offset");
// ----- Copy the block of file headers from the old archive
$v_size = $v_central_dir['size'];
while ($v_size != 0)
{
$v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
$v_buffer = @fread($v_zip_temp_fd, $v_read_size);
@fwrite($this->zip_fd, $v_buffer, $v_read_size);
$v_size -= $v_read_size;
$this->privSwapBackMagicQuotes();
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
$v_count++;
$this->privSwapBackMagicQuotes();
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
PclZipUtilRename($v_zip_temp_name, $this->zipname);
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privOpenFd($p_mode)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privOpenFd", 'mode='.$p_mode);
$v_result=1;
// ----- Look if already open
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Open the zip file
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Open file in '.$p_mode.' mode');
if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0)
{
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privCloseFd()
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCloseFd", "");
$v_result=1;
if ($this->zip_fd != 0)
$this->zip_fd = 0;
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options)
function privAddList($p_filedescr_list, &$p_result_list, &$p_options)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddList", "list");
$v_result=1;
// ----- Add the files
if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1)
{
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
if ($v_header_list[$i]['status'] == 'ok') {
if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) {
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
$v_count++;
unset($v_header_list);
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// Function : privAddFileList()
// Description :
// Parameters :
- // $p_filedescr_list : An array containing the file description
+ // $p_filedescr_list : An array containing the file description
// or directory names to add in the zip
// $p_result_list : list of added files with their properties (specially the status field)
// Return Values :
// --------------------------------------------------------------------------------
function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFileList", "filedescr_list");
$v_result=1;
$v_header = array();
// ----- Recuperate the current number of elt in list
$v_nb = sizeof($p_result_list);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Before add, list have ".$v_nb." elements");
// ----- Loop on the files
for ($j=0; ($j<sizeof($p_filedescr_list)) && ($v_result==1); $j++) {
// ----- Format the filename
$p_filedescr_list[$j]['filename']
= PclZipUtilTranslateWinPath($p_filedescr_list[$j]['filename'], false);
-
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Looking for file '".$p_filedescr_list[$j]['filename']."'");
+
// ----- Skip empty file names
// TBC : Can this be possible ? not checked in DescrParseAtt ?
if ($p_filedescr_list[$j]['filename'] == "") {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Skip empty filename");
continue;
}
// ----- Check the filename
if ( ($p_filedescr_list[$j]['type'] != 'virtual_file')
&& (!file_exists($p_filedescr_list[$j]['filename']))) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$p_filedescr_list[$j]['filename']."' does not exist");
PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$p_filedescr_list[$j]['filename']."' does not exist");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
$v_result = $this->privAddFile($p_filedescr_list[$j], $v_header,
$p_options);
if ($v_result != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
$p_result_list[$v_nb++] = $v_header;
}
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "After add, list have ".$v_nb." elements");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privAddFile($p_filedescr, &$p_header, &$p_options)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFile", "filename='".$p_filedescr['filename']."'");
$v_result=1;
-
+
// ----- Working variable
$p_filename = $p_filedescr['filename'];
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
-
- // ----- Look for a stored different filename
+
+ // ----- Look for a stored different filename
/* TBC : Removed
if (isset($p_filedescr['stored_filename'])) {
$v_stored_filename = $p_filedescr['stored_filename'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'Stored filename is NOT the same "'.$v_stored_filename.'"');
}
else {
$v_stored_filename = $p_filedescr['stored_filename'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'Stored filename is the same');
}
*/
$p_header['external'] = 0x00000000;
$p_header['size'] = filesize($p_filename);
}
-
+
// ----- Look for regular folder
else if ($p_filedescr['type']=='folder') {
$p_header['external'] = 0x00000010;
$p_header['mtime'] = filemtime($p_filename);
$p_header['size'] = filesize($p_filename);
}
-
+
// ----- Look for virtual file
else if ($p_filedescr['type'] == 'virtual_file') {
$p_header['external'] = 0x00000000;
$p_header['size'] = strlen($p_filedescr['content']);
}
-
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header external extension '".sprintf("0x%X",$p_header['external'])."'");
+
// ----- Look for filetime
if (isset($p_filedescr['mtime'])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3,"Overload mtime value with :'".$p_filedescr['mtime']."'");
$p_header['mtime'] = $p_filedescr['mtime'];
}
else if ($p_filedescr['type'] == 'virtual_file') {
$p_header['mtime'] = time();
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Virtual file : use current time '".$p_header['mtime']."' for mtime value.");
}
else {
$p_header['mtime'] = filemtime($p_filename);
// ----- Look for pre-add callback
if (isset($p_options[PCLZIP_CB_PRE_ADD])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_ADD]."()') is defined for the extraction");
// ----- Generate a local information
$v_local_header = array();
// ----- Call the callback
// Here I do not use call_user_func() because I need to send a reference to the
// header.
- eval('$v_result = '.$p_options[PCLZIP_CB_PRE_ADD].'(PCLZIP_CB_PRE_ADD, $v_local_header);');
+ $v_result = $p_options[PCLZIP_CB_PRE_ADD](PCLZIP_CB_PRE_ADD, $v_local_header);
if ($v_result == 0) {
// ----- Change the file status
$p_header['status'] = "skipped";
// Only some fields can be modified
if ($p_header['stored_filename'] != $v_local_header['stored_filename']) {
$p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New stored filename is '".$p_header['stored_filename']."'");
}
}
if ($p_header['stored_filename'] == "") {
$p_header['status'] = "filtered";
}
-
+
// ----- Check the path length
if (strlen($p_header['stored_filename']) > 0xFF) {
$p_header['status'] = 'filename_too_long';
// ----- Look for a file
if ($p_filedescr['type'] == 'file') {
// ----- Look for using temporary file to zip
- if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))
+ if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))
&& (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON])
|| (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])
&& ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_header['size'])) ) ) {
return $v_result;
}
}
-
+
// ----- Use "in memory" zip algo
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"In memory compression.");
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Current memory usage : ".memory_get_usage(TRUE)." bytes");
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Current memory peak : ".memory_get_peak_usage(TRUE)." bytes");
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a file");
// ----- Open the source file
if (($v_file = @fopen($p_filename, "rb")) == 0) {
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Read the file content
$v_content = @fread($v_file, $p_header['size']);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory usage after reading file : ".memory_get_usage(TRUE)." bytes");
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory peak after reading file : ".memory_get_peak_usage(TRUE)." bytes");
// ----- Close the file
@fclose($v_file);
// ----- Calculate the CRC
$p_header['crc'] = @crc32($v_content);
-
+
// ----- Look for no compression
if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be compressed");
// ----- Set header parameters
$p_header['compressed_size'] = $p_header['size'];
$p_header['compression'] = 0;
}
-
+
// ----- Look for normal compression
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will be compressed");
// ----- Compress the content
$v_content = @gzdeflate($v_content);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory usage after gzdeflate : ".memory_get_usage(TRUE)." bytes");
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2,"Memory peak after gzdeflate : ".memory_get_peak_usage(TRUE)." bytes");
// ----- Set header parameters
$p_header['compressed_size'] = strlen($v_content);
$p_header['compression'] = 8;
}
-
+
// ----- Call the header generation
if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
@fclose($v_file);
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Look for a virtual file (a file from string)
else if ($p_filedescr['type'] == 'virtual_file') {
-
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Add by string");
+
$v_content = $p_filedescr['content'];
// ----- Calculate the CRC
$p_header['crc'] = @crc32($v_content);
-
+
// ----- Look for no compression
if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be compressed");
// ----- Set header parameters
$p_header['compressed_size'] = $p_header['size'];
$p_header['compression'] = 0;
}
-
+
// ----- Look for normal compression
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will be compressed");
// ----- Compress the content
$v_content = @gzdeflate($v_content);
$p_header['compressed_size'] = strlen($v_content);
$p_header['compression'] = 8;
}
-
+
// ----- Call the header generation
if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
@fclose($v_file);
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Look for a directory
else if ($p_filedescr['type'] == 'folder') {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a folder");
// ----- Look for directory last '/'
if (@substr($p_header['stored_filename'], -1) != '/') {
$p_header['stored_filename'] .= '/';
// ----- Call the header generation
if (($v_result = $this->privWriteFileHeader($p_header)) != 1)
{
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
}
// ----- Look for post-add callback
if (isset($p_options[PCLZIP_CB_POST_ADD])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_ADD]."()') is defined for the extraction");
// ----- Generate a local information
$v_local_header = array();
// ----- Call the callback
// Here I do not use call_user_func() because I need to send a reference to the
// header.
- eval('$v_result = '.$p_options[PCLZIP_CB_POST_ADD].'(PCLZIP_CB_POST_ADD, $v_local_header);');
+ $v_result = $p_options[PCLZIP_CB_POST_ADD](PCLZIP_CB_POST_ADD, $v_local_header);
if ($v_result == 0) {
// ----- Ignored
$v_result = 1;
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privAddFileUsingTempFile($p_filedescr, &$p_header, &$p_options)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFileUsingTempFile", "filename='".$p_filedescr['filename']."'");
$v_result=PCLZIP_ERR_NO_ERROR;
-
+
// ----- Working variable
$p_filename = $p_filedescr['filename'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a file");
// ----- Open the source file
if (($v_file = @fopen($p_filename, "rb")) == 0) {
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
if (($v_file_compressed = @gzopen($v_gzip_temp_name, "wb")) == 0) {
fclose($v_file);
PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode');
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
$v_size = filesize($p_filename);
while ($v_size != 0) {
$v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read ".$v_read_size." bytes");
$v_buffer = @fread($v_file, $v_read_size);
//$v_binary_data = pack('a'.$v_read_size, $v_buffer);
@gzputs($v_file_compressed, $v_buffer, $v_read_size);
@gzclose($v_file_compressed);
// ----- Check the minimum file size
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "gzip file size ".filesize($v_gzip_temp_name));
if (filesize($v_gzip_temp_name) < 18) {
PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'gzip temporary file \''.$v_gzip_temp_name.'\' has invalid filesize - should be minimum 18 bytes');
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Extract the compressed attributes
if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) {
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode');
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
$v_data_header = unpack('a1id1/a1id2/a1cm/a1flag/Vmtime/a1xfl/a1os', $v_binary_data);
// ----- Check some parameters
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, '$v_data_header[id1]='.bin2hex($v_data_header['id1']));
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, '$v_data_header[id2]='.bin2hex($v_data_header['id2']));
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, '$v_data_header[cm]='.bin2hex($v_data_header['cm']));
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, '$v_data_header[flag]='.bin2hex($v_data_header['flag']));
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, '$v_data_header[mtime]='.$v_data_header['mtime']);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, '$v_data_header[xfl]='.bin2hex($v_data_header['xfl']));
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, '$v_data_header[os]='.bin2hex($v_data_header['os']));
$v_data_header['os'] = bin2hex($v_data_header['os']);
// ----- Read the gzip file footer
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "File position after header ".ftell($v_file_compressed));
@fseek($v_file_compressed, filesize($v_gzip_temp_name)-8);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "File position at beginning of footer ".ftell($v_file_compressed));
$v_binary_data = @fread($v_file_compressed, 8);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "File position after footer ".ftell($v_file_compressed));
$v_data_footer = unpack('Vcrc/Vcompressed_size', $v_binary_data);
// ----- Set the attributes
$p_header['compression'] = ord($v_data_header['cm']);
//$p_header['mtime'] = $v_data_header['mtime'];
$p_header['crc'] = $v_data_footer['crc'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Compressed size ".(filesize($v_gzip_temp_name)-18));
$p_header['compressed_size'] = filesize($v_gzip_temp_name)-18;
// ----- Close the file
// ----- Call the header generation
if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0)
{
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode');
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
fseek($v_file_compressed, 10);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "File position before reading compressed data ".ftell($v_file_compressed));
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, ' '.$p_header['compressed_size'].' bytes to read');
$v_size = $p_header['compressed_size'];
while ($v_size != 0)
{
$v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read ".$v_read_size." bytes");
$v_buffer = @fread($v_file_compressed, $v_read_size);
//$v_binary_data = pack('a'.$v_read_size, $v_buffer);
@fwrite($this->zip_fd, $v_buffer, $v_read_size);
// ----- Unlink the temporary file
@unlink($v_gzip_temp_name);
-
+
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privCalculateStoredFilename(&$p_filedescr, &$p_options)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCalculateStoredFilename", "filename='".$p_filedescr['filename']."'");
$v_result=1;
-
+
// ----- Working variables
$p_filename = $p_filedescr['filename'];
if (isset($p_options[PCLZIP_OPT_ADD_PATH])) {
else {
$p_remove_dir = '';
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Remove path ='".$p_remove_dir."'");
if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
$p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH];
}
$p_remove_all_dir = 0;
}
+
// ----- Look for full name change
if (isset($p_filedescr['new_full_name'])) {
// ----- Remove drive letter if any
$v_stored_filename = PclZipUtilTranslateWinPath($p_filedescr['new_full_name']);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Changing full name of '".$p_filename."' for '".$v_stored_filename."'");
}
-
+
// ----- Look for path and/or short name change
else {
$v_dir = $v_path_info['dirname'].'/';
}
$v_stored_filename = $v_dir.$p_filedescr['new_short_name'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Changing short name of '".$p_filename."' for '".$v_stored_filename."'");
}
else {
// ----- Calculate the stored filename
// ----- Look for all path to remove
if ($p_remove_all_dir) {
$v_stored_filename = basename($p_filename);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Remove all path selected change '".$p_filename."' for '".$v_stored_filename."'");
}
// ----- Look for partial path remove
else if ($p_remove_dir != "") {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Partial path to remove");
if (substr($p_remove_dir, -1) != '/')
$p_remove_dir .= "/";
if ( (substr($p_filename, 0, 2) == "./")
|| (substr($p_remove_dir, 0, 2) == "./")) {
-
+
if ( (substr($p_filename, 0, 2) == "./")
&& (substr($p_remove_dir, 0, 2) != "./")) {
$p_remove_dir = "./".$p_remove_dir;
if ($v_compare > 0) {
if ($v_compare == 2) {
$v_stored_filename = "";
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Path to remove is the current folder");
}
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Remove path '$p_remove_dir' in file '$v_stored_filename'");
$v_stored_filename = substr($v_stored_filename,
strlen($p_remove_dir));
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Result is '$v_stored_filename'");
}
}
}
-
+
// ----- Remove drive letter if any
$v_stored_filename = PclZipUtilTranslateWinPath($v_stored_filename);
-
+
// ----- Look for path to add
if ($p_add_dir != "") {
if (substr($p_add_dir, -1) == "/")
$v_stored_filename = $p_add_dir.$v_stored_filename;
else
$v_stored_filename = $p_add_dir."/".$v_stored_filename;
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Add path '$p_add_dir' in file '$p_filename' = '$v_stored_filename'");
}
}
// ----- Filename (reduce the path of stored name)
$v_stored_filename = PclZipUtilPathReduction($v_stored_filename);
$p_filedescr['stored_filename'] = $v_stored_filename;
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Stored filename will be '".$p_filedescr['stored_filename']."', strlen ".strlen($p_filedescr['stored_filename']));
-
+
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privWriteFileHeader(&$p_header)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteFileHeader", 'file="'.$p_header['filename'].'", stored as "'.$p_header['stored_filename'].'"');
$v_result=1;
// ----- Store the offset position of the file
$p_header['offset'] = ftell($this->zip_fd);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'File offset of the header :'.$p_header['offset']);
// ----- Transform UNIX mtime to DOS format mdate/mtime
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
$v_date = getdate($p_header['mtime']);
$v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;
$v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privWriteCentralFileHeader(&$p_header)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteCentralFileHeader", 'file="'.$p_header['filename'].'", stored as "'.$p_header['stored_filename'].'"');
$v_result=1;
// TBC
//for(reset($p_header); $key = key($p_header); next($p_header)) {
- // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "header[$key] = ".$p_header[$key]);
//}
// ----- Transform UNIX mtime to DOS format mdate/mtime
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
$v_date = getdate($p_header['mtime']);
$v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;
$v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Comment size : \''.$p_header['comment_len'].'\'');
// ----- Packed data
$v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50,
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteCentralHeader", 'nb_entries='.$p_nb_entries.', size='.$p_size.', offset='.$p_offset.', comment="'.$p_comment.'"');
$v_result=1;
// ----- Packed data
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privList(&$p_list)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privList", "list");
$v_result=1;
// ----- Magic quotes trick
$this->privDisableMagicQuotes();
// ----- Open the zip file
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0)
{
// ----- Magic quotes trick
$this->privSwapBackMagicQuotes();
-
+
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
{
$this->privSwapBackMagicQuotes();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Go to beginning of Central Dir
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Offset : ".$v_central_dir['offset']."'");
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'");
@rewind($this->zip_fd);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'");
if (@fseek($this->zip_fd, $v_central_dir['offset']))
{
$this->privSwapBackMagicQuotes();
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'");
// ----- Read each entry
for ($i=0; $i<$v_central_dir['entries']; $i++)
if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1)
{
$this->privSwapBackMagicQuotes();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
$v_header['index'] = $i;
$this->privSwapBackMagicQuotes();
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privConvertHeader2FileInfo($p_header, &$p_info)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privConvertHeader2FileInfo", "Filename='".$p_header['filename']."'");
$v_result=1;
// ----- Get the interesting attributes
$p_info['crc'] = $p_header['crc'];
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privExtractByRule", "path='$p_path', remove_path='$p_remove_path', remove_all_path='".($p_remove_all_path?'true':'false')."'");
$v_result=1;
// ----- Magic quotes trick
// ----- Look for the path end '/'
while (substr($p_path, -1) == "/")
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Destination path [$p_path] ends by '/'");
$p_path = substr($p_path, 0, strlen($p_path)-1);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Modified to [$p_path]");
}
}
$p_remove_path_size = strlen($p_remove_path);
// ----- Open the zip file
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
if (($v_result = $this->privOpenFd('rb')) != 1)
{
$this->privSwapBackMagicQuotes();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
$this->privCloseFd();
$this->privSwapBackMagicQuotes();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
$j_start = 0;
for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++)
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Read next file header entry : '$i'");
// ----- Read next Central dir entry
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Position before rewind : ".ftell($this->zip_fd)."'");
@rewind($this->zip_fd);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Position after rewind : ".ftell($this->zip_fd)."'");
if (@fseek($this->zip_fd, $v_pos_entry))
{
// ----- Close the zip file
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position after fseek : ".ftell($this->zip_fd)."'");
// ----- Read the file header
$v_header = array();
$this->privCloseFd();
$this->privSwapBackMagicQuotes();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Look for extract by name rule
if ( (isset($p_options[PCLZIP_OPT_BY_NAME]))
&& ($p_options[PCLZIP_OPT_BY_NAME] != 0)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByName'");
// ----- Look if the filename is in the list
for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_extract); $j++) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Compare with file '".$p_options[PCLZIP_OPT_BY_NAME][$j]."'");
// ----- Look for a directory
if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The searched item is a directory");
// ----- Look if the directory is in the filename path
if ( (strlen($v_header['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j]))
&& (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The directory is in the file path");
$v_extract = true;
}
}
// ----- Look for a filename
elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The file is the right one.");
$v_extract = true;
}
}
}
// ----- Look for extract by ereg rule
+ // ereg() is deprecated with PHP 5.3
+ /*
else if ( (isset($p_options[PCLZIP_OPT_BY_EREG]))
&& ($p_options[PCLZIP_OPT_BY_EREG] != "")) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract by ereg '".$p_options[PCLZIP_OPT_BY_EREG]."'");
if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression");
$v_extract = true;
}
}
+ */
// ----- Look for extract by preg rule
else if ( (isset($p_options[PCLZIP_OPT_BY_PREG]))
&& ($p_options[PCLZIP_OPT_BY_PREG] != "")) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByEreg'");
if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression");
$v_extract = true;
}
}
// ----- Look for extract by index rule
else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX]))
&& ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'");
-
+
// ----- Look if the index is in the list
for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Look if index '$i' is in [".$p_options[PCLZIP_OPT_BY_INDEX][$j]['start'].",".$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']."]");
if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found as part of an index range");
$v_extract = true;
}
if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Do not look this index range for next loop");
$j_start = $j+1;
}
if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Index range is greater than index, stop loop");
break;
}
}
// ----- Look for no rule, which means extract all the archive
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with no rule (extract all)");
$v_extract = true;
}
if ( ($v_extract)
&& ( ($v_header['compression'] != 8)
&& ($v_header['compression'] != 0))) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported compression method (".$v_header['compression'].")");
$v_header['status'] = 'unsupported_compression';
// ----- Look for PCLZIP_OPT_STOP_ON_ERROR
if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
&& ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");
$this->privSwapBackMagicQuotes();
-
+
PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION,
"Filename '".$v_header['stored_filename']."' is "
."compressed by an unsupported compression "
."method (".$v_header['compression'].") ");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
}
-
+
// ----- Check encrypted files
if (($v_extract) && (($v_header['flag'] & 1) == 1)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported file encryption");
$v_header['status'] = 'unsupported_encryption';
// ----- Look for PCLZIP_OPT_STOP_ON_ERROR
if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
&& ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");
$this->privSwapBackMagicQuotes();
." filename '".$v_header['stored_filename']
."'");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
}
// ----- Look for real extraction
if (($v_extract) && ($v_header['status'] != 'ok')) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "No need for extract");
$v_result = $this->privConvertHeader2FileInfo($v_header,
$p_file_list[$v_nb_extracted++]);
if ($v_result != 1) {
$this->privCloseFd();
$this->privSwapBackMagicQuotes();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
$v_extract = false;
}
-
+
// ----- Look for real extraction
if ($v_extract)
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file '".$v_header['filename']."', index '$i'");
// ----- Go to the file position
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'");
@rewind($this->zip_fd);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'");
if (@fseek($this->zip_fd, $v_header['offset']))
{
// ----- Close the zip file
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'");
// ----- Look for extraction as string
if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) {
+ $v_string = '';
+
// ----- Extracting the file
- $v_result1 = $this->privExtractFileAsString($v_header, $v_string);
+ $v_result1 = $this->privExtractFileAsString($v_header, $v_string, $p_options);
if ($v_result1 < 1) {
$this->privCloseFd();
$this->privSwapBackMagicQuotes();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1);
return $v_result1;
}
$this->privCloseFd();
$this->privSwapBackMagicQuotes();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Next extracted file
$v_nb_extracted++;
-
+
// ----- Look for user callback abort
if ($v_result1 == 2) {
break;
if ($v_result1 < 1) {
$this->privCloseFd();
$this->privSwapBackMagicQuotes();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1);
return $v_result1;
}
if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) {
$this->privCloseFd();
$this->privSwapBackMagicQuotes();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
if ($v_result1 < 1) {
$this->privCloseFd();
$this->privSwapBackMagicQuotes();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1);
return $v_result1;
}
$this->privCloseFd();
$this->privSwapBackMagicQuotes();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
$this->privSwapBackMagicQuotes();
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFile', "path='$p_path', remove_path='$p_remove_path', remove_all_path='".($p_remove_all_path?'true':'false')."'");
$v_result=1;
// ----- Read the file header
if (($v_result = $this->privReadFileHeader($v_header)) != 1)
{
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'");
// ----- Check that the file header is coherent with $p_entry info
if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
if ($p_remove_all_path == true) {
// ----- Look for folder entry that not need to be extracted
if (($p_entry['external']&0x00000010)==0x00000010) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The entry is a folder : need to be filtered");
$p_entry['status'] = "filtered";
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "All path is removed");
// ----- Get the basename of the path
$p_entry['filename'] = basename($p_entry['filename']);
}
// ----- Look for path to remove
else if ($p_remove_path != "")
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Look for some path to remove");
if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2)
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The folder is the same as the removed path '".$p_entry['filename']."'");
// ----- Change the file status
$p_entry['status'] = "filtered";
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
$p_remove_path_size = strlen($p_remove_path);
if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path)
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file '".$p_entry['filename']."'");
// ----- Remove the path
$p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Resulting file is '".$p_entry['filename']."'");
}
}
if ($p_path != '') {
$p_entry['filename'] = $p_path."/".$p_entry['filename'];
}
-
+
// ----- Check a base_dir_restriction
if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Check the extract directory restriction");
$v_inclusion
= PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION],
- $p_entry['filename']);
+ $p_entry['filename']);
if ($v_inclusion == 0) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_EXTRACT_DIR_RESTRICTION is selected, file is outside restriction");
PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION,
"Filename '".$p_entry['filename']."' is "
."outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
}
// ----- Look for pre-extract callback
if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_EXTRACT]."()') is defined for the extraction");
// ----- Generate a local information
$v_local_header = array();
// ----- Call the callback
// Here I do not use call_user_func() because I need to send a reference to the
// header.
- eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');
+ $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);
if ($v_result == 0) {
// ----- Change the file status
$p_entry['status'] = "skipped";
$v_result = 1;
}
-
+
// ----- Look for abort result
if ($v_result == 2) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction");
// ----- This status is internal and will be changed in 'skipped'
$p_entry['status'] = "aborted";
$v_result = PCLZIP_ERR_USER_ABORTED;
// ----- Update the informations
// Only some fields can be modified
$p_entry['filename'] = $v_local_header['filename'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'");
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'");
// ----- Look if extraction should be done
if ($p_entry['status'] == 'ok') {
// ----- Look for specific actions while the file exist
if (file_exists($p_entry['filename']))
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$p_entry['filename']."' already exists");
// ----- Look if file is a directory
if (is_dir($p_entry['filename']))
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is a directory");
// ----- Change the file status
$p_entry['status'] = "already_a_directory";
-
+
// ----- Look for PCLZIP_OPT_STOP_ON_ERROR
// For historical reason first PclZip implementation does not stop
// when this kind of error occurs.
if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
&& ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");
PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY,
"Filename '".$p_entry['filename']."' is "
."already used by an existing directory");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
}
// ----- Look if file is write protected
else if (!is_writeable($p_entry['filename']))
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is write protected");
// ----- Change the file status
$p_entry['status'] = "write_protected";
// when this kind of error occurs.
if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
&& ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");
PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,
"Filename '".$p_entry['filename']."' exists "
."and is write protected");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
}
// ----- Look if the extracted file is older
else if (filemtime($p_entry['filename']) > $p_entry['mtime'])
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is newer (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")");
// ----- Change the file status
if ( (isset($p_options[PCLZIP_OPT_REPLACE_NEWER]))
&& ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_REPLACE_NEWER is selected, file will be replaced");
}
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be replaced");
$p_entry['status'] = "newer_exist";
// ----- Look for PCLZIP_OPT_STOP_ON_ERROR
// when this kind of error occurs.
if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
&& ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");
PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,
"Newer version of '".$p_entry['filename']."' exists "
."and option PCLZIP_OPT_REPLACE_NEWER is not selected");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
}
}
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is older than the extrated one - will be replaced by the extracted one (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")");
}
}
$v_dir_to_check = dirname($p_entry['filename']);
if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to create path for '".$p_entry['filename']."'");
-
+
// ----- Change the file status
$p_entry['status'] = "path_creation_fail";
-
+
// ----- Return
- ////--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
//return $v_result;
$v_result = 1;
}
{
// ----- Look for not compressed file
if ($p_entry['compression'] == 0) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file");
// ----- Opening destination file
if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0)
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode");
// ----- Change the file status
$p_entry['status'] = "write_error";
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read '".$p_entry['size']."' bytes");
// ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
$v_size = $p_entry['compressed_size'];
while ($v_size != 0)
{
$v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read $v_read_size bytes");
$v_buffer = @fread($this->zip_fd, $v_read_size);
/* Try to speed up the code
$v_binary_data = pack('a'.$v_read_size, $v_buffer);
@fwrite($v_dest_file, $v_binary_data, $v_read_size);
*/
- @fwrite($v_dest_file, $v_buffer, $v_read_size);
+ @fwrite($v_dest_file, $v_buffer, $v_read_size);
$v_size -= $v_read_size;
}
// ----- Change the file mtime
touch($p_entry['filename'], $p_entry['mtime']);
-
+
}
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file (Compression method ".$p_entry['compression'].")");
// ----- TBC
// Need to be finished
if (($p_entry['flag'] & 1) == 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File is encrypted");
PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, 'File \''.$p_entry['filename'].'\' is encrypted. Encrypted files are not supported.');
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Look for using temporary file to unzip
- if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))
+ if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))
&& (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON])
|| (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])
&& ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_entry['size'])) ) ) {
return $v_result;
}
}
-
+
// ----- Look for extract in memory
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".$p_entry['compressed_size']."' compressed bytes");
-
+
// ----- Read the compressed file in a buffer (one shot)
$v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
-
+
// ----- Decompress the file
$v_file_content = @gzinflate($v_buffer);
unset($v_buffer);
if ($v_file_content === FALSE) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to inflate compressed file");
-
+
// ----- Change the file status
// TBC
$p_entry['status'] = "error";
-
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+
return $v_result;
}
-
+
// ----- Opening destination file
if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode");
-
+
// ----- Change the file status
$p_entry['status'] = "write_error";
-
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+
return $v_result;
}
-
+
// ----- Write the uncompressed data
@fwrite($v_dest_file, $v_file_content, $p_entry['size']);
unset($v_file_content);
-
+
// ----- Closing the destination file
@fclose($v_dest_file);
-
+
}
// ----- Change the file mtime
// ----- Look for chmod option
if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "chmod option activated '".$p_options[PCLZIP_OPT_SET_CHMOD]."'");
// ----- Change the mode of the file
@chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]);
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done");
}
}
- // ----- Change abort status
- if ($p_entry['status'] == "aborted") {
- $p_entry['status'] = "skipped";
- }
-
+ // ----- Change abort status
+ if ($p_entry['status'] == "aborted") {
+ $p_entry['status'] = "skipped";
+ }
+
// ----- Look for post-extract callback
elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction");
// ----- Generate a local information
$v_local_header = array();
// ----- Call the callback
// Here I do not use call_user_func() because I need to send a reference to the
// header.
- eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);');
+ $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);
// ----- Look for abort result
if ($v_result == 2) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction");
$v_result = PCLZIP_ERR_USER_ABORTED;
}
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privExtractFileUsingTempFile(&$p_entry, &$p_options)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileUsingTempFile', "filename='".$p_entry['filename']."'");
$v_result=1;
-
+
// ----- Creates a temporary file
$v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz';
if (($v_dest_file = @fopen($v_gzip_temp_name, "wb")) == 0) {
fclose($v_file);
PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode');
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Start extraction of '".$p_entry['filename']."'");
// ----- Write gz file format header
$v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3));
// ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
$v_size = $p_entry['compressed_size'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Compressed Size :".$v_size."");
while ($v_size != 0)
{
$v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read ".$v_read_size." bytes");
$v_buffer = @fread($this->zip_fd, $v_read_size);
//$v_binary_data = pack('a'.$v_read_size, $v_buffer);
@fwrite($v_dest_file, $v_buffer, $v_read_size);
// ----- Opening destination file
if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode");
$p_entry['status'] = "write_error";
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
@fclose($v_dest_file);
$p_entry['status'] = "read_error";
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode');
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'File size is '.filesize($v_gzip_temp_name));
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes");
// ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
$v_size = $p_entry['size'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size :".$v_size."");
while ($v_size != 0) {
$v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read ".$v_read_size." bytes");
$v_buffer = @gzread($v_src_file, $v_read_size);
//$v_binary_data = pack('a'.$v_read_size, $v_buffer);
@fwrite($v_dest_file, $v_buffer, $v_read_size);
// ----- Delete the temporary file
@unlink($v_gzip_temp_name);
-
+
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privExtractFileInOutput(&$p_entry, &$p_options)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileInOutput', "");
$v_result=1;
// ----- Read the file header
if (($v_result = $this->privReadFileHeader($v_header)) != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'");
// ----- Check that the file header is coherent with $p_entry info
if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
// ----- Look for pre-extract callback
if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_EXTRACT]."()') is defined for the extraction");
// ----- Generate a local information
$v_local_header = array();
// ----- Call the callback
// Here I do not use call_user_func() because I need to send a reference to the
// header.
- eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');
+// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');
+ $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);
if ($v_result == 0) {
// ----- Change the file status
$p_entry['status'] = "skipped";
// ----- Look for abort result
if ($v_result == 2) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction");
// ----- This status is internal and will be changed in 'skipped'
$p_entry['status'] = "aborted";
$v_result = PCLZIP_ERR_USER_ABORTED;
// ----- Update the informations
// Only some fields can be modified
$p_entry['filename'] = $v_local_header['filename'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'");
}
// ----- Trace
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'");
// ----- Look if extraction should be done
if ($p_entry['status'] == 'ok') {
if (!(($p_entry['external']&0x00000010)==0x00000010)) {
// ----- Look for not compressed file
if ($p_entry['compressed_size'] == $p_entry['size']) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file");
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes");
// ----- Read the file in a buffer (one shot)
$v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
unset($v_buffer);
}
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file");
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Reading '".$p_entry['size']."' bytes");
// ----- Read the compressed file in a buffer (one shot)
$v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
-
+
// ----- Decompress the file
$v_file_content = gzinflate($v_buffer);
unset($v_buffer);
echo $v_file_content;
unset($v_file_content);
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done");
}
}
// ----- Look for post-extract callback
elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction");
// ----- Generate a local information
$v_local_header = array();
// ----- Call the callback
// Here I do not use call_user_func() because I need to send a reference to the
// header.
- eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);');
+ $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);
// ----- Look for abort result
if ($v_result == 2) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction");
$v_result = PCLZIP_ERR_USER_ABORTED;
}
}
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// Parameters :
// Return Values :
// --------------------------------------------------------------------------------
- function privExtractFileAsString(&$p_entry, &$p_string)
+ function privExtractFileAsString(&$p_entry, &$p_string, &$p_options)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileAsString', "p_entry['filename']='".$p_entry['filename']."'");
$v_result=1;
// ----- Read the file header
if (($v_result = $this->privReadFileHeader($v_header)) != 1)
{
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'");
// ----- Check that the file header is coherent with $p_entry info
if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
// TBC
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file in string (with path) '".$p_entry['filename']."', size '$v_header[size]'");
+ // ----- Look for pre-extract callback
+ if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {
- // ----- Do the extraction (if not a folder)
- if (!(($p_entry['external']&0x00000010)==0x00000010))
- {
- // ----- Look for not compressed file
-// if ($p_entry['compressed_size'] == $p_entry['size'])
- if ($p_entry['compression'] == 0) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file");
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes");
-
- // ----- Reading the file
- $p_string = @fread($this->zip_fd, $p_entry['compressed_size']);
+ // ----- Generate a local information
+ $v_local_header = array();
+ $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
+
+ // ----- Call the callback
+ // Here I do not use call_user_func() because I need to send a reference to the
+ // header.
+ $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);
+ if ($v_result == 0) {
+ // ----- Change the file status
+ $p_entry['status'] = "skipped";
+ $v_result = 1;
}
- else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file (compression method '".$p_entry['compression']."')");
-
- // ----- Reading the file
- $v_data = @fread($this->zip_fd, $p_entry['compressed_size']);
-
- // ----- Decompress the file
- if (($p_string = @gzinflate($v_data)) === FALSE) {
- // TBC
+
+ // ----- Look for abort result
+ if ($v_result == 2) {
+ // ----- This status is internal and will be changed in 'skipped'
+ $p_entry['status'] = "aborted";
+ $v_result = PCLZIP_ERR_USER_ABORTED;
+ }
+
+ // ----- Update the informations
+ // Only some fields can be modified
+ $p_entry['filename'] = $v_local_header['filename'];
+ }
+
+
+ // ----- Look if extraction should be done
+ if ($p_entry['status'] == 'ok') {
+
+ // ----- Do the extraction (if not a folder)
+ if (!(($p_entry['external']&0x00000010)==0x00000010)) {
+ // ----- Look for not compressed file
+ // if ($p_entry['compressed_size'] == $p_entry['size'])
+ if ($p_entry['compression'] == 0) {
+
+ // ----- Reading the file
+ $p_string = @fread($this->zip_fd, $p_entry['compressed_size']);
+ }
+ else {
+
+ // ----- Reading the file
+ $v_data = @fread($this->zip_fd, $p_entry['compressed_size']);
+
+ // ----- Decompress the file
+ if (($p_string = @gzinflate($v_data)) === FALSE) {
+ // TBC
+ }
}
+
+ // ----- Trace
+ }
+ else {
+ // TBC : error : can not extract a folder in a string
}
- // ----- Trace
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done");
}
- else {
- // TBC : error : can not extract a folder in a string
+
+ // ----- Change abort status
+ if ($p_entry['status'] == "aborted") {
+ $p_entry['status'] = "skipped";
+ }
+
+ // ----- Look for post-extract callback
+ elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
+
+ // ----- Generate a local information
+ $v_local_header = array();
+ $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
+
+ // ----- Swap the content to header
+ $v_local_header['content'] = $p_string;
+ $p_string = '';
+
+ // ----- Call the callback
+ // Here I do not use call_user_func() because I need to send a reference to the
+ // header.
+ $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);
+
+ // ----- Swap back the content to header
+ $p_string = $v_local_header['content'];
+ unset($v_local_header['content']);
+
+ // ----- Look for abort result
+ if ($v_result == 2) {
+ $v_result = PCLZIP_ERR_USER_ABORTED;
+ }
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privReadFileHeader(&$p_header)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadFileHeader", "");
$v_result=1;
// ----- Read the 4 bytes signature
$v_binary_data = @fread($this->zip_fd, 4);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary data is : '".sprintf("%08x", $v_binary_data)."'");
$v_data = unpack('Vid', $v_binary_data);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'");
// ----- Check signature
if ($v_data['id'] != 0x04034b50)
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid File header");
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
{
$p_header['filename'] = "";
$p_header['status'] = "invalid_header";
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid block size : ".strlen($v_binary_data));
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data));
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Extract the values
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Header : '".$v_binary_data."'");
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Header (Hex) : '".bin2hex($v_binary_data)."'");
$v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data);
// ----- Get filename
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "File name length : ".$v_data['filename_len']);
$p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Filename : \''.$p_header['filename'].'\'');
// ----- Get extra_fields
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extra field length : ".$v_data['extra_len']);
if ($v_data['extra_len'] != 0) {
$p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']);
}
else {
$p_header['extra'] = '';
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Extra field : \''.bin2hex($p_header['extra']).'\'');
// ----- Extract properties
$p_header['version_extracted'] = $v_data['version'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version need to extract : ('.$p_header['version_extracted'].') \''.($p_header['version_extracted']/10).'.'.($p_header['version_extracted']%10).'\'');
$p_header['compression'] = $v_data['compression'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compression method : \''.$p_header['compression'].'\'');
$p_header['size'] = $v_data['size'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size : \''.$p_header['size'].'\'');
$p_header['compressed_size'] = $v_data['compressed_size'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compressed Size : \''.$p_header['compressed_size'].'\'');
$p_header['crc'] = $v_data['crc'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'CRC : \''.sprintf("0x%X", $p_header['crc']).'\'');
$p_header['flag'] = $v_data['flag'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Flag : \''.$p_header['flag'].'\'');
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Flag bit 11 (from right) : \''.($p_header['flag']&0x0400).'\'');
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Flag bit 11 (from left) : \''.($p_header['flag']&0x0020).'\'');
$p_header['filename_len'] = $v_data['filename_len'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Filename_len : \''.$p_header['filename_len'].'\'');
// ----- Recuperate date in UNIX format
$p_header['mdate'] = $v_data['mdate'];
// ----- Get UNIX date format
$p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
}
else
{
$p_header['mtime'] = time();
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date is actual : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
}
// TBC
//for(reset($v_data); $key = key($v_data); next($v_data)) {
- // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Attribut[$key] = ".$v_data[$key]);
//}
// ----- Set the stored filename
$p_header['status'] = "ok";
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privReadCentralFileHeader(&$p_header)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadCentralFileHeader", "");
$v_result=1;
// ----- Read the 4 bytes signature
$v_binary_data = @fread($this->zip_fd, 4);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary data is : '".sprintf("%08x", $v_binary_data)."'");
$v_data = unpack('Vid', $v_binary_data);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'");
// ----- Check signature
if ($v_data['id'] != 0x02014b50)
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid Central Dir File signature");
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
{
$p_header['filename'] = "";
$p_header['status'] = "invalid_header";
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid block size : ".strlen($v_binary_data));
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data));
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Extract the values
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header : '".$v_binary_data."'");
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header (Hex) : '".bin2hex($v_binary_data)."'");
$p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data);
// ----- Get filename
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "File name length : ".$p_header['filename_len']);
if ($p_header['filename_len'] != 0)
$p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']);
else
$p_header['filename'] = '';
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Filename : \''.$p_header['filename'].'\'');
// ----- Get extra
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Extra length : ".$p_header['extra_len']);
if ($p_header['extra_len'] != 0)
$p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']);
else
$p_header['extra'] = '';
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Extra : \''.$p_header['extra'].'\'');
// ----- Get comment
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Comment length : ".$p_header['comment_len']);
if ($p_header['comment_len'] != 0)
$p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']);
else
$p_header['comment'] = '';
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Comment : \''.$p_header['comment'].'\'');
// ----- Extract properties
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version : \''.($p_header['version']/10).'.'.($p_header['version']%10).'\'');
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version need to extract : \''.($p_header['version_extracted']/10).'.'.($p_header['version_extracted']%10).'\'');
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Size : \''.$p_header['size'].'\'');
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Compressed Size : \''.$p_header['compressed_size'].'\'');
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'CRC : \''.sprintf("0x%X", $p_header['crc']).'\'');
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Flag : \''.$p_header['flag'].'\'');
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Offset : \''.$p_header['offset'].'\'');
// ----- Recuperate date in UNIX format
//if ($p_header['mdate'] && $p_header['mtime'])
// ----- Get UNIX date format
$p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
}
else
{
$p_header['mtime'] = time();
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Date is actual : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
}
// ----- Set the stored filename
$p_header['status'] = 'ok';
// ----- Look if it is a directory
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Internal (Hex) : '".sprintf("Ox%04X", $p_header['internal'])."'");
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "External (Hex) : '".sprintf("Ox%04X", $p_header['external'])."' (".(($p_header['external']&0x00000010)==0x00000010?'is a folder':'is a file').')');
if (substr($p_header['filename'], -1) == '/') {
//$p_header['external'] = 0x41FF0010;
$p_header['external'] = 0x00000010;
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Force folder external : \''.sprintf("Ox%04X", $p_header['external']).'\'');
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Header of filename : \''.$p_header['filename'].'\'');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privCheckFileHeaders(&$p_local_header, &$p_central_header)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCheckFileHeaders", "");
$v_result=1;
// ----- Check the static values
// TBC
if ($p_local_header['filename'] != $p_central_header['filename']) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename" : TBC To Be Completed');
}
if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "version_extracted" : TBC To Be Completed');
}
if ($p_local_header['flag'] != $p_central_header['flag']) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "flag" : TBC To Be Completed');
}
if ($p_local_header['compression'] != $p_central_header['compression']) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "compression" : TBC To Be Completed');
}
if ($p_local_header['mtime'] != $p_central_header['mtime']) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "mtime" : TBC To Be Completed');
}
if ($p_local_header['filename_len'] != $p_central_header['filename_len']) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename_len" : TBC To Be Completed');
}
-
+
// ----- Look for flag bit 3
if (($p_local_header['flag'] & 8) == 8) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Purpose bit flag bit 3 set !');
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'File size, compression size and crc found in central header');
$p_local_header['size'] = $p_central_header['size'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size : \''.$p_local_header['size'].'\'');
$p_local_header['compressed_size'] = $p_central_header['compressed_size'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compressed Size : \''.$p_local_header['compressed_size'].'\'');
$p_local_header['crc'] = $p_central_header['crc'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'CRC : \''.sprintf("0x%X", $p_local_header['crc']).'\'');
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privReadEndCentralDir(&$p_central_dir)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadEndCentralDir", "");
$v_result=1;
// ----- Go to the end of the zip file
$v_size = filesize($this->zipname);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size of the file :$v_size");
@fseek($this->zip_fd, $v_size);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position at end of zip file : \''.ftell($this->zip_fd).'\'');
if (@ftell($this->zip_fd) != $v_size)
{
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\'');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// in this case the end of central dir is at 22 bytes of the file end
$v_found = 0;
if ($v_size > 26) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Look for central dir with no comment');
@fseek($this->zip_fd, $v_size-22);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position after min central position : \''.ftell($this->zip_fd).'\'');
if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22))
{
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\'');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Read for bytes
$v_binary_data = @fread($this->zip_fd, 4);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Binary data is : '".sprintf("%08x", $v_binary_data)."'");
$v_data = @unpack('Vid', $v_binary_data);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'");
// ----- Check signature
if ($v_data['id'] == 0x06054b50) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found central dir at the default position.");
$v_found = 1;
}
// ----- Go back to the maximum possible size of the Central Dir End Record
if (!$v_found) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Start extended search of end central dir');
$v_maximum_size = 65557; // 0xFFFF + 22;
if ($v_maximum_size > $v_size)
$v_maximum_size = $v_size;
PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\'');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position after max central position : \''.ftell($this->zip_fd).'\'');
// ----- Read byte per byte in order to find the signature
$v_pos = ftell($this->zip_fd);
$v_byte = @fread($this->zip_fd, 1);
// ----- Add the byte
- // $v_bytes = ($v_bytes << 8) | Ord($v_byte);
- // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number
- // Otherwise on systems where we have 64bit integers the check below for the magic number will fail.
- $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);
+ //$v_bytes = ($v_bytes << 8) | Ord($v_byte);
+ // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number
+ // Otherwise on systems where we have 64bit integers the check below for the magic number will fail.
+ $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);
// ----- Compare the bytes
if ($v_bytes == 0x504b0506)
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Found End Central Dir signature at position : \''.ftell($this->zip_fd).'\'');
$v_pos++;
break;
}
// ----- Look if not found end of central dir
if ($v_pos == $v_size)
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to find End of Central Dir Record signature");
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
}
// ----- Look for invalid block size
if (strlen($v_binary_data) != 18)
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid End of Central Dir Record size : ".strlen($v_binary_data));
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data));
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Extract the values
- ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Central Dir Record : '".$v_binary_data."'");
- ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Central Dir Record (Hex) : '".bin2hex($v_binary_data)."'");
$v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data);
// ----- Check the global size
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Comment length : ".$v_data['comment_size']);
if (($v_pos + $v_data['comment_size'] + 18) != $v_size) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The central dir is not at the end of the archive. Some trailing bytes exists after the archive.");
// ----- Removed in release 2.2 see readme file
// The check of the file size is a little too strict.
.' Some trailing bytes exists after the archive.');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
}
// ----- Get comment
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Comment size : \''.$v_data['comment_size'].'\'');
if ($v_data['comment_size'] != 0) {
$p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']);
}
else
$p_central_dir['comment'] = '';
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Comment : \''.$p_central_dir['comment'].'\'');
$p_central_dir['entries'] = $v_data['entries'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Nb of entries : \''.$p_central_dir['entries'].'\'');
$p_central_dir['disk_entries'] = $v_data['disk_entries'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Nb of entries for this disk : \''.$p_central_dir['disk_entries'].'\'');
$p_central_dir['offset'] = $v_data['offset'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Offset of Central Dir : \''.$p_central_dir['offset'].'\'');
$p_central_dir['size'] = $v_data['size'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size of Central Dir : \''.$p_central_dir['size'].'\'');
$p_central_dir['disk'] = $v_data['disk'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Disk number : \''.$p_central_dir['disk'].'\'');
$p_central_dir['disk_start'] = $v_data['disk_start'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Start disk number : \''.$p_central_dir['disk_start'].'\'');
// TBC
//for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) {
- // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "central_dir[$key] = ".$p_central_dir[$key]);
//}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privDeleteByRule(&$p_result_list, &$p_options)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDeleteByRule", "");
$v_result=1;
$v_list_detail = array();
// ----- Open the zip file
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
if (($v_result=$this->privOpenFd('rb')) != 1)
{
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
{
$this->privCloseFd();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Go to beginning of File
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'");
@rewind($this->zip_fd);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'");
// ----- Scan all the files
// ----- Start at beginning of Central Dir
$v_pos_entry = $v_central_dir['offset'];
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'");
@rewind($this->zip_fd);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'");
if (@fseek($this->zip_fd, $v_pos_entry))
{
// ----- Close the zip file
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'");
// ----- Read each entry
$v_header_list = array();
$j_start = 0;
for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++)
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Read next file header entry (index '$i')");
// ----- Read the file header
$v_header_list[$v_nb_extracted] = array();
// ----- Close the zip file
$this->privCloseFd();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename (index '$i') : '".$v_header_list[$v_nb_extracted]['stored_filename']."'");
// ----- Store the index
$v_header_list[$v_nb_extracted]['index'] = $i;
// ----- Look for extract by name rule
if ( (isset($p_options[PCLZIP_OPT_BY_NAME]))
&& ($p_options[PCLZIP_OPT_BY_NAME] != 0)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByName'");
// ----- Look if the filename is in the list
for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_found); $j++) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Compare with file '".$p_options[PCLZIP_OPT_BY_NAME][$j]."'");
// ----- Look for a directory
if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The searched item is a directory");
// ----- Look if the directory is in the filename path
if ( (strlen($v_header_list[$v_nb_extracted]['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j]))
&& (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The directory is in the file path");
$v_found = true;
}
elseif ( (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */
&& ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The entry is the searched directory");
$v_found = true;
}
}
// ----- Look for a filename
elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The file is the right one.");
$v_found = true;
}
}
}
// ----- Look for extract by ereg rule
+ // ereg() is deprecated with PHP 5.3
+ /*
else if ( (isset($p_options[PCLZIP_OPT_BY_EREG]))
&& ($p_options[PCLZIP_OPT_BY_EREG] != "")) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract by ereg '".$p_options[PCLZIP_OPT_BY_EREG]."'");
if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression");
$v_found = true;
}
}
+ */
// ----- Look for extract by preg rule
else if ( (isset($p_options[PCLZIP_OPT_BY_PREG]))
&& ($p_options[PCLZIP_OPT_BY_PREG] != "")) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByEreg'");
if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression");
$v_found = true;
}
}
// ----- Look for extract by index rule
else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX]))
&& ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'");
// ----- Look if the index is in the list
for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_found); $j++) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Look if index '$i' is in [".$p_options[PCLZIP_OPT_BY_INDEX][$j]['start'].",".$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']."]");
if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found as part of an index range");
$v_found = true;
}
if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Do not look this index range for next loop");
$j_start = $j+1;
}
if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Index range is greater than index, stop loop");
break;
}
}
}
else {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "No argument mean remove all file");
$v_found = true;
}
// ----- Look for deletion
if ($v_found)
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_header_list[$v_nb_extracted]['stored_filename']."', index '$i' need to be deleted");
unset($v_header_list[$v_nb_extracted]);
}
else
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_header_list[$v_nb_extracted]['stored_filename']."', index '$i' will not be deleted");
$v_nb_extracted++;
}
}
$v_temp_zip = new PclZip($v_zip_temp_name);
// ----- Open the temporary zip file in write mode
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary write mode");
if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) {
$this->privCloseFd();
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Look which file need to be kept
for ($i=0; $i<sizeof($v_header_list); $i++) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Keep entry index '$i' : '".$v_header_list[$i]['filename']."'");
// ----- Calculate the position of the header
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Offset='". $v_header_list[$i]['offset']."'");
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'");
@rewind($this->zip_fd);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'");
if (@fseek($this->zip_fd, $v_header_list[$i]['offset'])) {
// ----- Close the zip file
$this->privCloseFd();
PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'");
// ----- Read the file header
$v_local_header = array();
@unlink($v_zip_temp_name);
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
-
+
// ----- Check that local file header is same as central file header
if ($this->privCheckFileHeaders($v_local_header,
$v_header_list[$i]) != 1) {
@unlink($v_zip_temp_name);
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Offset for this file is '".$v_header_list[$i]['offset']."'");
// ----- Read/write the data block
if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) {
@unlink($v_zip_temp_name);
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
}
// ----- Store the offset of the central dir
$v_offset = @ftell($v_temp_zip->zip_fd);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "New offset of central dir : $v_offset");
// ----- Re-Create the Central Dir files header
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Creates the new central directory");
for ($i=0; $i<sizeof($v_header_list); $i++) {
// ----- Create the file header
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Offset of file : ".$v_header_list[$i]['offset']);
if (($v_result = $v_temp_zip->privWriteCentralFileHeader($v_header_list[$i])) != 1) {
$v_temp_zip->privCloseFd();
$this->privCloseFd();
@unlink($v_zip_temp_name);
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
$v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Creates the central directory footer");
// ----- Zip file comment
$v_comment = '';
@unlink($v_zip_temp_name);
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// TBC : I should test the result ...
//@rename($v_zip_temp_name, $this->zipname);
PclZipUtilRename($v_zip_temp_name, $this->zipname);
-
+
// ----- Destroy the temporary archive
unset($v_temp_zip);
}
-
+
// ----- Remove every files : reset the file
else if ($v_central_dir['entries'] != 0) {
$this->privCloseFd();
if (($v_result = $this->privOpenFd('wb')) != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
{
$v_result = 1;
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDirCheck", "entry='$p_dir', is_dir='".($p_is_dir?"true":"false")."'");
// ----- Remove the final '/'
if (($p_is_dir) && (substr($p_dir, -1)=='/'))
{
$p_dir = substr($p_dir, 0, strlen($p_dir)-1);
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Looking for entry '$p_dir'");
// ----- Check the directory availability
if ((is_dir($p_dir)) || ($p_dir == ""))
{
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, "'$p_dir' is a directory");
return 1;
}
// ----- Extract parent directory
$p_parent_dir = dirname($p_dir);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Parent directory is '$p_parent_dir'");
// ----- Just a check
if ($p_parent_dir != $p_dir)
{
if (($v_result = $this->privDirCheck($p_parent_dir)) != 1)
{
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
}
}
// ----- Create the directory
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Create directory '$p_dir'");
if (!@mkdir($p_dir, 0777))
{
// ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'");
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result, "Directory '$p_dir' created");
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privMerge(&$p_archive_to_add)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privMerge", "archive='".$p_archive_to_add->zipname."'");
$v_result=1;
// ----- Look if the archive_to_add exists
if (!is_file($p_archive_to_add->zipname))
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive to add does not exist. End of merge.");
// ----- Nothing to merge, so merge is a success
$v_result = 1;
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Look if the archive exists
if (!is_file($this->zipname))
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive does not exist, duplicate the archive_to_add.");
// ----- Do a duplicate
$v_result = $this->privDuplicate($p_archive_to_add->zipname);
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Open the zip file
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
if (($v_result=$this->privOpenFd('rb')) != 1)
{
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
{
$this->privCloseFd();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Go to beginning of File
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in zip : ".ftell($this->zip_fd)."'");
@rewind($this->zip_fd);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in zip : ".ftell($this->zip_fd)."'");
// ----- Open the archive_to_add file
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open archive_to_add in binary read mode");
if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1)
{
$this->privCloseFd();
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
$this->privCloseFd();
$p_archive_to_add->privCloseFd();
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Go to beginning of File
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in archive_to_add : ".ftell($p_archive_to_add->zip_fd)."'");
@rewind($p_archive_to_add->zip_fd);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in archive_to_add : ".ftell($p_archive_to_add->zip_fd)."'");
// ----- Creates a temporay file
$v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';
// ----- Open the temporary file in write mode
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0)
{
$this->privCloseFd();
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
while ($v_size != 0)
{
$v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
$v_buffer = fread($this->zip_fd, $v_read_size);
@fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
$v_size -= $v_read_size;
while ($v_size != 0)
{
$v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
$v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size);
@fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
$v_size -= $v_read_size;
// ----- Store the offset of the central dir
$v_offset = @ftell($v_zip_temp_fd);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "New offset of central dir : $v_offset");
// ----- Copy the block of file headers from the old archive
$v_size = $v_central_dir['size'];
while ($v_size != 0)
{
$v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
$v_buffer = @fread($this->zip_fd, $v_read_size);
@fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
$v_size -= $v_read_size;
while ($v_size != 0)
{
$v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
$v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size);
@fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
$v_size -= $v_read_size;
unset($v_header_list);
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
PclZipUtilRename($v_zip_temp_name, $this->zipname);
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privDuplicate($p_archive_filename)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDuplicate", "archive_filename='$p_archive_filename'");
$v_result=1;
// ----- Look if the $p_archive_filename exists
if (!is_file($p_archive_filename))
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive to duplicate does not exist. End of duplicate.");
// ----- Nothing to duplicate, so duplicate is a success.
$v_result = 1;
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Open the zip file
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
if (($v_result=$this->privOpenFd('wb')) != 1)
{
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Open the temporary file in write mode
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0)
{
$this->privCloseFd();
PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode');
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
return PclZip::errorCode();
}
while ($v_size != 0)
{
$v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read $v_read_size bytes");
$v_buffer = fread($v_zip_temp_fd, $v_read_size);
@fwrite($this->zip_fd, $v_buffer, $v_read_size);
$v_size -= $v_read_size;
@fclose($v_zip_temp_fd);
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privDisableMagicQuotes()
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privDisableMagicQuotes', "");
$v_result=1;
// ----- Look if function exists
if ( (!function_exists("get_magic_quotes_runtime"))
|| (!function_exists("set_magic_quotes_runtime"))) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Functions *et_magic_quotes_runtime are not supported");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Look if already done
if ($this->magic_quotes_status != -1) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "magic_quote already disabled");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Get and memorize the magic_quote value
$this->magic_quotes_status = @get_magic_quotes_runtime();
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Current magic_quotes_runtime status is '".($this->magic_quotes_status==0?'disable':'enable')."'");
// ----- Disable magic_quotes
if ($this->magic_quotes_status == 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Disable magic_quotes");
@set_magic_quotes_runtime(0);
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function privSwapBackMagicQuotes()
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privSwapBackMagicQuotes', "");
$v_result=1;
// ----- Look if function exists
if ( (!function_exists("get_magic_quotes_runtime"))
|| (!function_exists("set_magic_quotes_runtime"))) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Functions *et_magic_quotes_runtime are not supported");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Look if something to do
if ($this->magic_quotes_status != -1) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "magic_quote not modified");
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// ----- Swap back magic_quotes
if ($this->magic_quotes_status == 1) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Enable back magic_quotes");
@set_magic_quotes_runtime($this->magic_quotes_status);
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function PclZipUtilPathReduction($p_dir)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathReduction", "dir='$p_dir'");
$v_result = "";
// ----- Look for not empty path
// ----- It is an invalid path, so the path is not modified
// TBC
$v_result = $p_dir;
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid path is unchanged");
$v_skip = 0;
}
}
}
}
}
-
+
// ----- Look for skip
if ($v_skip > 0) {
while ($v_skip > 0) {
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function PclZipUtilPathInclusion($p_dir, $p_path)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathInclusion", "dir='$p_dir', path='$p_path'");
$v_result = 1;
-
+
// ----- Look for path beginning by ./
if ( ($p_dir == '.')
|| ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) {
$p_dir = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_dir, 1);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Replacing ./ by full path in p_dir '".$p_dir."'");
}
if ( ($p_path == '.')
|| ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) {
$p_path = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_path, 1);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Replacing ./ by full path in p_path '".$p_path."'");
}
// ----- Explode dir and path by directory separator
$i = 0;
$j = 0;
while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Working on dir($i)='".$v_list_dir[$i]."' and path($j)='".$v_list_path[$j]."'");
// ----- Look for empty dir (path reduction)
if ($v_list_dir[$i] == '') {
// ----- Compare the items
if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != '')) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Items ($i,$j) are different");
$v_result = 0;
}
// ----- Look if everything seems to be the same
if ($v_result) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Look for tie break");
// ----- Skip all the empty items
while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++;
while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++;
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Looking on dir($i)='".($i < $v_list_dir_size?$v_list_dir[$i]:'')."' and path($j)='".($j < $v_list_path_size?$v_list_path[$j]:'')."'");
if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) {
// ----- There are exactly the same
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilCopyBlock", "size=$p_size, mode=$p_mode");
$v_result = 1;
if ($p_mode==0)
{
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Src offset before read :".(@ftell($p_src)));
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Dest offset before write :".(@ftell($p_dest)));
while ($p_size != 0)
{
$v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
$v_buffer = @fread($p_src, $v_read_size);
@fwrite($p_dest, $v_buffer, $v_read_size);
$p_size -= $v_read_size;
}
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Src offset after read :".(@ftell($p_src)));
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Dest offset after write :".(@ftell($p_dest)));
}
else if ($p_mode==1)
{
while ($p_size != 0)
{
$v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
$v_buffer = @gzread($p_src, $v_read_size);
@fwrite($p_dest, $v_buffer, $v_read_size);
$p_size -= $v_read_size;
while ($p_size != 0)
{
$v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
$v_buffer = @fread($p_src, $v_read_size);
@gzwrite($p_dest, $v_buffer, $v_read_size);
$p_size -= $v_read_size;
while ($p_size != 0)
{
$v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
$v_buffer = @gzread($p_src, $v_read_size);
@gzwrite($p_dest, $v_buffer, $v_read_size);
$p_size -= $v_read_size;
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function PclZipUtilRename($p_src, $p_dest)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilRename", "source=$p_src, destination=$p_dest");
$v_result = 1;
// ----- Try to rename the files
if (!@rename($p_src, $p_dest)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to rename file, try copy+unlink");
// ----- Try to copy & unlink the src
if (!@copy($p_src, $p_dest)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to copy file");
$v_result = 0;
}
else if (!@unlink($p_src)) {
- //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to unlink old filename");
$v_result = 0;
}
}
// ----- Return
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
function PclZipUtilOptionText($p_option)
{
- //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilOptionText", "option='".$p_option."'");
-
+
$v_list = get_defined_constants();
for (reset($v_list); $v_key = key($v_list); next($v_list)) {
$v_prefix = substr($v_key, 0, 10);
|| ($v_prefix == 'PCLZIP_CB_')
|| ($v_prefix == 'PCLZIP_ATT'))
&& ($v_list[$v_key] == $p_option)) {
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_key);
return $v_key;
}
}
-
+
$v_result = 'Unknown';
- //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
return $v_result;
}
// --------------------------------------------------------------------------------
return trailingslashit($base . $last_path);
}
if ( $loop )
- return false;//Prevent tihs function looping again.
+ 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);
$info = 'd';
elseif (($perms & 0x2000) == 0x2000) // Character special
$info = 'c';
- elseif (($perms & 0x1000) == 0x1000)// FIFO pipe
+ elseif (($perms & 0x1000) == 0x1000) // FIFO pipe
$info = 'p';
else // Unknown
$info = 'u';
* @uses WP_Filesystem_Base Extends class
*/
class WP_Filesystem_Direct extends WP_Filesystem_Base {
- var $permission = null;
var $errors = null;
+ /**
+ * constructor
+ *
+ * @param $arg mixed ingored argument
+ */
function WP_Filesystem_Direct($arg) {
$this->method = 'direct';
$this->errors = new WP_Error();
}
+ /**
+ * connect filesystem.
+ *
+ * @return bool Returns true on success or false on failure (always true for WP_Filesystem_Direct).
+ */
function connect() {
return true;
}
- function setDefaultPermissions($perm) {
- $this->permission = $perm;
- }
+ /**
+ * Reads entire file into a string
+ *
+ * @param $file string Name of the file to read.
+ * @return string|bool The function returns the read data or false on failure.
+ */
function get_contents($file) {
return @file_get_contents($file);
}
+ /**
+ * Reads entire file into an array
+ *
+ * @param $file string Path to the file.
+ * @return array|bool the file contents in an array or false on failure.
+ */
function get_contents_array($file) {
return @file($file);
}
+ /**
+ * Write a string to a file
+ *
+ * @param $file string Path to the file where to write the data.
+ * @param $contents string The data to write.
+ * @param $mode int (optional) The file permissions as octal number, usually 0644.
+ * @param $type string (optional) Specifies additional type of access you require to the file.
+ * @return bool False upon failure.
+ */
function put_contents($file, $contents, $mode = false, $type = '') {
if ( ! ($fp = @fopen($file, 'w' . $type)) )
return false;
@fwrite($fp, $contents);
@fclose($fp);
- $this->chmod($file,$mode);
+ $this->chmod($file, $mode);
return true;
}
+ /**
+ * Gets the current working directory
+ *
+ * @return string|bool the current working directory on success, or false on failure.
+ */
function cwd() {
return @getcwd();
}
+ /**
+ * Change directory
+ *
+ * @param $dir string The new current directory.
+ * @return bool Returns true on success or false on failure.
+ */
function chdir($dir) {
return @chdir($dir);
}
+ /**
+ * Changes file group
+ *
+ * @param $file string Path to the file.
+ * @param $group mixed A group name or number.
+ * @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False.
+ * @return bool Returns true on success or false on failure.
+ */
function chgrp($file, $group, $recursive = false) {
if ( ! $this->exists($file) )
return false;
return true;
}
+ /**
+ * Changes filesystem permissions
+ *
+ * @param $file string Path to the file.
+ * @param $mode int (optional) The permissions as octal number, usually 0644 for files, 0755 for dirs.
+ * @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False.
+ * @return bool Returns true on success or false on failure.
+ */
function chmod($file, $mode = false, $recursive = false) {
if ( ! $this->exists($file) )
return false;
if ( ! $mode ) {
- if ( $this->permission )
- $mode = $this->permission;
- elseif ( $this->is_file($file) )
+ if ( $this->is_file($file) )
$mode = FS_CHMOD_FILE;
elseif ( $this->is_dir($file) )
$mode = FS_CHMOD_DIR;
else
- return false;
+ return false;
}
if ( ! $recursive )
return true;
}
+ /**
+ * Changes file owner
+ *
+ * @param $file string Path to the file.
+ * @param $owner mixed A user name or number.
+ * @param $recursive bool (optional) If set True changes file owner recursivly. Defaults to False.
+ * @return bool Returns true on success or false on failure.
+ */
function chown($file, $owner, $recursive = false) {
if ( ! $this->exists($file) )
return false;
return @chown($file, $owner);
//Is a directory, and we want recursive
$filelist = $this->dirlist($file);
- foreach ($filelist as $filename){
+ foreach ($filelist as $filename) {
$this->chown($file . '/' . $filename, $owner, $recursive);
}
return true;
}
+ /**
+ * Gets file owner
+ *
+ * @param $file string Path to the file.
+ * @return string Username of the user.
+ */
function owner($file) {
$owneruid = @fileowner($file);
if ( ! $owneruid )
$ownerarray = posix_getpwuid($owneruid);
return $ownerarray['name'];
}
+ /**
+ * Gets file permissions
+ *
+ * FIXME does not handle errors in fileperms()
+ *
+ * @param $file string Path to the file.
+ * @return string Mode of the file (last 4 digits).
+ */
function getchmod($file) {
return substr(decoct(@fileperms($file)),3);
}
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 {
return @filesize($file);
}
- function touch($file, $time = 0, $atime = 0){
+ function touch($file, $time = 0, $atime = 0) {
if ($time == 0)
$time = time();
if ($atime == 0)
return @touch($file, $time, $atime);
}
- function mkdir($path, $chmod = false, $chown = false, $chgrp = false){
+ function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
+ if ( ! $chmod )
+ $chmod = FS_CHMOD_DIR;
+
if ( ! @mkdir($path) )
return false;
$this->chmod($path, $chmod);
return @rmdir($path);
}
- function dirlist($path, $incdot = false, $recursive = false) {
+ function dirlist($path, $include_hidden = true, $recursive = false) {
if ( $this->is_file($path) ) {
- $limitFile = basename($path);
+ $limit_file = basename($path);
$path = dirname($path);
} else {
- $limitFile = false;
+ $limit_file = false;
}
+
if ( ! $this->is_dir($path) )
return false;
- $ret = array();
$dir = @dir($path);
if ( ! $dir )
return false;
+
+ $ret = array();
+
while (false !== ($entry = $dir->read()) ) {
$struc = array();
$struc['name'] = $entry;
if ( '.' == $struc['name'] || '..' == $struc['name'] )
- continue; //Do not care about these folders.
- if ( '.' == $struc['name'][0] && !$incdot)
continue;
- if ( $limitFile && $struc['name'] != $limitFile)
+
+ if ( ! $include_hidden && '.' == $struc['name'][0] )
+ continue;
+
+ if ( $limit_file && $struc['name'] != $limit_file)
continue;
$struc['perms'] = $this->gethchmod($path.'/'.$entry);
if ( 'd' == $struc['type'] ) {
if ( $recursive )
- $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
+ $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
else
$struc['files'] = array();
}
*/
class WP_Filesystem_FTPext extends WP_Filesystem_Base {
var $link;
- var $timeout = 5;
var $errors = null;
var $options = array();
- var $permission = null;
-
function WP_Filesystem_FTPext($opt='') {
$this->method = 'ftpext';
$this->errors = new WP_Error();
}
// Set defaults:
+ //This Class uses the timeout on a per-connection basis, Others use it on a per-action basis.
+
+ if ( ! defined('FS_TIMEOUT') )
+ define('FS_TIMEOUT', 240);
+
if ( empty($opt['port']) )
$this->options['port'] = 21;
else
function connect() {
if ( isset($this->options['ssl']) && $this->options['ssl'] && function_exists('ftp_ssl_connect') )
- $this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'], $this->timeout);
+ $this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT);
else
- $this->link = @ftp_connect($this->options['hostname'], $this->options['port'], $this->timeout);
+ $this->link = @ftp_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_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']));
//Set the Connection to use Passive FTP
@ftp_pasv( $this->link, true );
+ if ( @ftp_get_option($this->link, FTP_TIMEOUT_SEC) < FS_TIMEOUT )
+ @ftp_set_option($this->link, FTP_TIMEOUT_SEC, FS_TIMEOUT);
return true;
}
- function setDefaultPermissions($perm) {
- $this->permission = $perm;
- }
-
- function get_contents($file, $type = '', $resumepos = 0 ){
- if( empty($type) )
+ function get_contents($file, $type = '', $resumepos = 0 ) {
+ if ( empty($type) )
$type = FTP_BINARY;
$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
return explode("\n", $this->get_contents($file));
}
function put_contents($file, $contents, $type = '' ) {
- if( empty($type) )
+ if ( empty($type) )
$type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII;
$temp = tmpfile();
}
function cwd() {
$cwd = @ftp_pwd($this->link);
- if( $cwd )
+ if ( $cwd )
$cwd = trailingslashit($cwd);
return $cwd;
}
function chdir($dir) {
- return @ftp_chdir($dir);
+ return @ftp_chdir($this->link, $dir);
}
function chgrp($file, $group, $recursive = false ) {
return false;
}
function chmod($file, $mode = false, $recursive = false) {
- if( ! $mode )
- $mode = $this->permission;
- if( ! $mode )
- return false;
if ( ! $this->exists($file) && ! $this->is_dir($file) )
return false;
+
+ if ( ! $mode ) {
+ if ( $this->is_file($file) )
+ $mode = FS_CHMOD_FILE;
+ elseif ( $this->is_dir($file) )
+ $mode = FS_CHMOD_DIR;
+ else
+ return false;
+ }
+
if ( ! $recursive || ! $this->is_dir($file) ) {
if ( ! function_exists('ftp_chmod') )
return @ftp_site($this->link, sprintf('CHMOD %o %s', $mode, $file));
}
//Is a directory, and we want recursive
$filelist = $this->dirlist($file);
- foreach($filelist as $filename){
+ foreach ( $filelist as $filename ) {
$this->chmod($file . '/' . $filename, $mode, $recursive);
}
return true;
return $dir[$file]['group'];
}
function copy($source, $destination, $overwrite = false ) {
- if( ! $overwrite && $this->exists($destination) )
+ if ( ! $overwrite && $this->exists($destination) )
return false;
$content = $this->get_contents($source);
- if( false === $content)
+ if ( false === $content)
return false;
return $this->put_contents($destination, $content);
}
}
function exists($file) {
- $list = @ftp_rawlist($this->link, $file, false);
+ $list = @ftp_nlist($this->link, $file);
return !empty($list); //empty list = no file, so invert.
}
function is_file($file) {
function is_dir($path) {
$cwd = $this->cwd();
$result = @ftp_chdir($this->link, trailingslashit($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 mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
- if( !ftp_mkdir($this->link, $path) )
+ if ( !ftp_mkdir($this->link, $path) )
return false;
- if( $chmod )
- $this->chmod($path, $chmod);
- if( $chown )
+ if ( ! $chmod )
+ $chmod = FS_CHMOD_DIR;
+ $this->chmod($path, $chmod);
+ if ( $chown )
$this->chown($path, $chown);
- if( $chgrp )
+ if ( $chgrp )
$this->chgrp($path, $chgrp);
return true;
}
if ( is_null($is_windows) )
$is_windows = strpos( strtolower(ftp_systype($this->link)), 'win') !== false;
- if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/", $line, $lucifer)) {
+ if ( $is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/", $line, $lucifer) ) {
$b = array();
- if ($lucifer[3]<70) { $lucifer[3] +=2000; } else { $lucifer[3]+=1900; } // 4digit year fix
+ if ( $lucifer[3] < 70 ) { $lucifer[3] +=2000; } else { $lucifer[3] += 1900; } // 4digit year fix
$b['isdir'] = ($lucifer[7]=="<DIR>");
if ( $b['isdir'] )
$b['type'] = 'd';
return $b;
}
- function dirlist($path = '.', $incdot = false, $recursive = false) {
- if( $this->is_file($path) ) {
- $limitFile = basename($path);
+ function dirlist($path = '.', $include_hidden = true, $recursive = false) {
+ if ( $this->is_file($path) ) {
+ $limit_file = basename($path);
$path = dirname($path) . '/';
} else {
- $limitFile = false;
+ $limit_file = false;
}
$list = @ftp_rawlist($this->link, '-a ' . $path, false);
if ( empty($entry) )
continue;
- if ( '.' == $entry["name"] || '..' == $entry["name"] )
+ if ( '.' == $entry['name'] || '..' == $entry['name'] )
+ continue;
+
+ if ( ! $include_hidden && '.' == $entry['name'][0] )
+ continue;
+
+ if ( $limit_file && $entry['name'] != $limit_file)
continue;
$dirlist[ $entry['name'] ] = $entry;
if ( ! $dirlist )
return false;
- if ( empty($dirlist) )
- return array();
$ret = array();
- foreach ( $dirlist as $struc ) {
-
+ foreach ( (array)$dirlist as $struc ) {
if ( 'd' == $struc['type'] ) {
- $struc['files'] = array();
-
- if ( $incdot ){
- //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);
- }
- } else { //No dots
- if ($recursive)
- $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
- }
+ if ( $recursive )
+ $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
+ else
+ $struc['files'] = array();
}
- //File
- $ret[$struc['name']] = $struc;
+
+ $ret[ $struc['name'] ] = $struc;
}
return $ret;
}
- function __destruct(){
- if( $this->link )
+ function __destruct() {
+ if ( $this->link )
ftp_close($this->link);
}
}
*/
class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
var $ftp = false;
- var $timeout = 5;
var $errors = null;
var $options = array();
- var $permission = null;
-
function WP_Filesystem_ftpsockets($opt = '') {
$this->method = 'ftpsockets';
$this->errors = new WP_Error();
//Check if possible to use ftp functions.
- if( ! @include_once ABSPATH . 'wp-admin/includes/class-ftp.php' )
+ if ( ! @include_once ABSPATH . 'wp-admin/includes/class-ftp.php' )
return false;
$this->ftp = new ftp();
if ( ! $this->ftp )
return false;
- //$this->ftp->Verbose = true;
+ $this->ftp->setTimeout(FS_CONNECT_TIMEOUT);
if ( ! $this->ftp->SetServer($this->options['hostname'], $this->options['port']) ) {
$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
return false;
}
+
if ( ! $this->ftp->connect() ) {
$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
return false;
$this->ftp->SetType(FTP_AUTOASCII);
$this->ftp->Passive(true);
+ $this->ftp->setTimeout(FS_TIMEOUT);
return true;
}
- function setDefaultPermissions($perm) {
- $this->permission = $perm;
- }
-
function get_contents($file, $type = '', $resumepos = 0) {
- if( ! $this->exists($file) )
+ if ( ! $this->exists($file) )
return false;
- if( empty($type) )
+ if ( empty($type) )
$type = FTP_AUTOASCII;
$this->ftp->SetType($type);
}
function put_contents($file, $contents, $type = '' ) {
- if( empty($type) )
+ if ( empty($type) )
$type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII;
$this->ftp->SetType($type);
$temp = wp_tempnam( $file );
- if ( ! $temphandle = fopen($temp, 'w+') ){
+ if ( ! $temphandle = fopen($temp, 'w+') ) {
unlink($temp);
return false;
}
function cwd() {
$cwd = $this->ftp->pwd();
- if( $cwd )
+ if ( $cwd )
$cwd = trailingslashit($cwd);
return $cwd;
}
}
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) ) {
- return $this->ftp->chmod($file,$mode);
+
+ if ( ! $mode ) {
+ if ( $this->is_file($file) )
+ $mode = FS_CHMOD_FILE;
+ elseif ( $this->is_dir($file) )
+ $mode = FS_CHMOD_DIR;
+ else
+ return false;
+ }
+
+ 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){
+ foreach ( $filelist as $filename )
$this->chmod($file . '/' . $filename, $mode, $recursive);
- }
+
return true;
}
}
function copy($source, $destination, $overwrite = false ) {
- if( ! $overwrite && $this->exists($destination) )
+ if ( ! $overwrite && $this->exists($destination) )
return false;
$content = $this->get_contents($source);
}
function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) {
- if( ! $this->ftp->mkdir($path) )
+ if ( ! $this->ftp->mkdir($path) )
return false;
- if( $chmod )
- $this->chmod($path, $chmod);
- if( $chown )
+ if ( ! $chmod )
+ $chmod = FS_CHMOD_DIR;
+ $this->chmod($path, $chmod);
+ if ( $chown )
$this->chown($path, $chown);
- if( $chgrp )
+ if ( $chgrp )
$this->chgrp($path, $chgrp);
return true;
}
function rmdir($path, $recursive = false ) {
- if( ! $recursive )
+ if ( ! $recursive )
return $this->ftp->rmdir($path);
return $this->ftp->mdel($path);
}
- function dirlist($path = '.', $incdot = false, $recursive = false ) {
- if( $this->is_file($path) ) {
- $limitFile = basename($path);
+ function dirlist($path = '.', $include_hidden = true, $recursive = false ) {
+ if ( $this->is_file($path) ) {
+ $limit_file = basename($path);
$path = dirname($path) . '/';
} else {
- $limitFile = false;
+ $limit_file = false;
}
$list = $this->ftp->dirlist($path);
- if( ! $list )
+ if ( ! $list )
return false;
- if( empty($list) )
- return array();
$ret = array();
foreach ( $list as $struc ) {
+ if ( '.' == $struc['name'] || '..' == $struc['name'] )
+ continue;
+
+ if ( ! $include_hidden && '.' == $struc['name'][0] )
+ continue;
+
+ if ( $limit_file && $struc['name'] != $limit_file )
+ continue;
+
if ( 'd' == $struc['type'] ) {
- $struc['files'] = array();
-
- if ( $incdot ){
- //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);
- }
- } else { //No dots
- if ($recursive)
- $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
- }
+ if ( $recursive )
+ $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
+ else
+ $struc['files'] = array();
}
- //File
- $ret[$struc['name']] = $struc;
+
+ $ret[ $struc['name'] ] = $struc;
}
return $ret;
}
var $link = false;
var $sftp_link = false;
var $keys = false;
- /*
- * This is the timeout value for ssh results.
- * Slower servers might need this incressed, but this number otherwise should not change.
- *
- * @parm $timeout int
- *
- */
- var $timeout = 15;
var $errors = array();
var $options = array();
- var $permission = 0644;
-
function WP_Filesystem_SSH2($opt='') {
$this->method = 'ssh2';
$this->errors = new WP_Error();
$this->errors->add('command', sprintf(__('Unable to perform command: %s'), $command));
} else {
stream_set_blocking( $stream, true );
- stream_set_timeout( $stream, $this->timeout );
+ stream_set_timeout( $stream, FS_TIMEOUT );
$data = stream_get_contents( $stream );
fclose( $stream );
return false;
}
- function setDefaultPermissions($perm) {
- $this->debug("setDefaultPermissions();");
- if ( $perm )
- $this->permission = $perm;
- }
-
function get_contents($file, $type = '', $resumepos = 0 ) {
$file = ltrim($file, '/');
return file_get_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file);
function put_contents($file, $contents, $type = '' ) {
$file = ltrim($file, '/');
- return file_put_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file, $contents);
+ return false !== file_put_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file, $contents);
}
function cwd() {
}
function chmod($file, $mode = false, $recursive = false) {
- if( ! $mode )
- $mode = $this->permission;
- if( ! $mode )
- return false;
if ( ! $this->exists($file) )
return false;
+
+ if ( ! $mode ) {
+ if ( $this->is_file($file) )
+ $mode = FS_CHMOD_FILE;
+ elseif ( $this->is_dir($file) )
+ $mode = FS_CHMOD_DIR;
+ else
+ return false;
+ }
+
if ( ! $recursive || ! $this->is_dir($file) )
return $this->run_command(sprintf('chmod %o %s', $mode, escapeshellarg($file)), true);
return $this->run_command(sprintf('chmod -R %o %s', $mode, escapeshellarg($file)), true);
//Not implmented.
}
- function mkdir($path, $chmod = null, $chown = false, $chgrp = false) {
+ function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
$path = untrailingslashit($path);
- $chmod = !empty($chmod) ? $chmod : $this->permission;
+ if ( ! $chmod )
+ $chmod = FS_CHMOD_DIR;
if ( ! ssh2_sftp_mkdir($this->sftp_link, $path, $chmod, true) )
return false;
if ( $chown )
return $this->delete($path, $recursive);
}
- function dirlist($path, $incdot = false, $recursive = false) {
+ function dirlist($path, $include_hidden = true, $recursive = false) {
if ( $this->is_file($path) ) {
- $limitFile = basename($path);
+ $limit_file = basename($path);
$path = dirname($path);
} else {
- $limitFile = false;
+ $limit_file = false;
}
+
if ( ! $this->is_dir($path) )
return false;
$ret = array();
$dir = @dir('ssh2.sftp://' . $this->sftp_link .'/' . ltrim($path, '/') );
+
if ( ! $dir )
return false;
+
while (false !== ($entry = $dir->read()) ) {
$struc = array();
$struc['name'] = $entry;
if ( '.' == $struc['name'] || '..' == $struc['name'] )
continue; //Do not care about these folders.
- if ( '.' == $struc['name'][0] && !$incdot)
+
+ if ( ! $include_hidden && '.' == $struc['name'][0] )
continue;
- if ( $limitFile && $struc['name'] != $limitFile)
+
+ if ( $limit_file && $struc['name'] != $limit_file )
continue;
$struc['perms'] = $this->gethchmod($path.'/'.$entry);
if ( 'd' == $struc['type'] ) {
if ( $recursive )
- $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
+ $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
else
$struc['files'] = array();
}
return new WP_Error('fs_error', $this->strings['fs_error'], $wp_filesystem->errors);
foreach ( (array)$directories as $dir ) {
- if ( ABSPATH == $dir && ! $wp_filesystem->abspath() )
- return new WP_Error('fs_no_root_dir', $this->strings['fs_no_root_dir']);
-
- elseif ( WP_CONTENT_DIR == $dir && ! $wp_filesystem->wp_content_dir() )
- return new WP_Error('fs_no_content_dir', $this->strings['fs_no_content_dir']);
-
- elseif ( WP_PLUGIN_DIR == $dir && ! $wp_filesystem->wp_plugins_dir() )
- return new WP_Error('fs_no_plugins_dir', $this->strings['fs_no_plugins_dir']);
-
- elseif ( WP_CONTENT_DIR . '/themes' == $dir && ! $wp_filesystem->find_folder(WP_CONTENT_DIR . '/themes') )
- return new WP_Error('fs_no_themes_dir', $this->strings['fs_no_themes_dir']);
-
- elseif ( ! $wp_filesystem->find_folder($dir) )
- return new WP_Error('fs_no_folder', sprintf($strings['fs_no_folder'], $dir));
+ switch ( $dir ) {
+ case ABSPATH:
+ if ( ! $wp_filesystem->abspath() )
+ return new WP_Error('fs_no_root_dir', $this->strings['fs_no_root_dir']);
+ break;
+ case WP_CONTENT_DIR:
+ if ( ! $wp_filesystem->wp_content_dir() )
+ return new WP_Error('fs_no_content_dir', $this->strings['fs_no_content_dir']);
+ break;
+ case WP_PLUGIN_DIR:
+ if ( ! $wp_filesystem->wp_plugins_dir() )
+ return new WP_Error('fs_no_plugins_dir', $this->strings['fs_no_plugins_dir']);
+ break;
+ case WP_CONTENT_DIR . '/themes':
+ if ( ! $wp_filesystem->find_folder(WP_CONTENT_DIR . '/themes') )
+ return new WP_Error('fs_no_themes_dir', $this->strings['fs_no_themes_dir']);
+ break;
+ default:
+ if ( ! $wp_filesystem->find_folder($dir) )
+ return new WP_Error('fs_no_folder', sprintf($this->strings['fs_no_folder'], $dir));
+ break;
+ }
}
return true;
} //end fs_connect();
$destination = trailingslashit($destination) . trailingslashit(basename($source));
}
- //If we're not clearing the destination folder, and something exists there allready, Bail.
- if ( ! $clear_destination && $wp_filesystem->exists($remote_destination) ) {
- $wp_filesystem->delete($remote_source, true); //Clear out the source files.
- return new WP_Error('folder_exists', $this->strings['folder_exists'], $remote_destination );
- } else if ( $clear_destination ) {
- //We're going to clear the destination if theres something there
- $this->skin->feedback('remove_old');
-
- $removed = true;
- if ( $wp_filesystem->exists($remote_destination) )
+ if ( $wp_filesystem->exists($remote_destination) ) {
+ if ( $clear_destination ) {
+ //We're going to clear the destination if theres something there
+ $this->skin->feedback('remove_old');
$removed = $wp_filesystem->delete($remote_destination, true);
-
- $removed = apply_filters('upgrader_clear_destination', $removed, $local_destination, $remote_destination, $hook_extra);
-
- if ( is_wp_error($removed) )
- return $removed;
- else if ( ! $removed )
- return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
+ $removed = apply_filters('upgrader_clear_destination', $removed, $local_destination, $remote_destination, $hook_extra);
+
+ if ( is_wp_error($removed) )
+ return $removed;
+ else if ( ! $removed )
+ return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
+ } else {
+ //If we're not clearing the destination folder and something exists there allready, Bail.
+ //But first check to see if there are actually any files in the folder.
+ $_files = $wp_filesystem->dirlist($remote_destination);
+ if ( ! empty($_files) ) {
+ $wp_filesystem->delete($remote_source, true); //Clear out the source files.
+ return new WP_Error('folder_exists', $this->strings['folder_exists'], $remote_destination );
+ }
+ }
}
//Create destination if needed
'destination' => '', //And this
'clear_destination' => false,
'clear_working' => true,
+ 'is_multi' => false,
'hook_extra' => array() //Pass any extra $hook_extra args here, this will be passed to any hooked filters.
);
return $res;
}
- $this->skin->header();
+ if ( !$is_multi ) // call $this->header separately if running multiple times
+ $this->skin->header();
+
$this->skin->before();
//Download the package (Note, This just returns the filename of the file if the package is a local file)
$this->skin->feedback('process_success');
}
$this->skin->after();
- $this->skin->footer();
+
+ if ( !$is_multi )
+ $this->skin->footer();
+
return $result;
}
class Plugin_Upgrader extends WP_Upgrader {
var $result;
+ var $bulk = false;
+ var $show_before = '';
function upgrade_strings() {
$this->strings['up_to_date'] = __('The plugin is at the latest version.');
)
));
- //Cleanup our hooks, incase something else does a upgrade on this connection.
+ // Cleanup our hooks, incase something else does a upgrade on this connection.
remove_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'));
remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'));
delete_transient('update_plugins');
}
+ function bulk_upgrade($plugins) {
+
+ $this->init();
+ $this->bulk = true;
+ $this->upgrade_strings();
+
+ $current = get_transient( 'update_plugins' );
+
+ add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4);
+
+ $this->skin->header();
+
+ // Connect to the Filesystem first.
+ $res = $this->fs_connect( array(WP_CONTENT_DIR, WP_PLUGIN_DIR) );
+ if ( ! $res ) {
+ $this->skin->footer();
+ return false;
+ }
+
+ $this->maintenance_mode(true);
+
+ $all = count($plugins);
+ $i = 1;
+ foreach ( $plugins as $plugin ) {
+
+ $this->show_before = sprintf( '<h4>' . __('Updating plugin %1$d of %2$d...') . '</h4>', $i, $all );
+ $i++;
+
+ if ( !isset( $current->response[ $plugin ] ) ) {
+ $this->skin->set_result(false);
+ $this->skin->error('up_to_date');
+ $this->skin->after();
+ $results[$plugin] = false;
+ continue;
+ }
+
+ // Get the URL to the zip file
+ $r = $current->response[ $plugin ];
+
+ $this->skin->plugin_active = is_plugin_active($plugin);
+
+ $result = $this->run(array(
+ 'package' => $r->package,
+ 'destination' => WP_PLUGIN_DIR,
+ 'clear_destination' => true,
+ 'clear_working' => true,
+ 'is_multi' => true,
+ 'hook_extra' => array(
+ 'plugin' => $plugin
+ )
+ ));
+
+ $results[$plugin] = $this->result;
+
+ // Prevent credentials auth screen from displaying multiple times
+ if ( false === $result )
+ break;
+ }
+ $this->maintenance_mode(false);
+ $this->skin->footer();
+
+ // Cleanup our hooks, incase something else does a upgrade on this connection.
+ remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'));
+
+ // Force refresh of plugin update information
+ delete_transient('update_plugins');
+
+ return $results;
+ }
+
//return plugin info.
function plugin_info() {
if ( ! is_array($this->result) )
$this->skin->after();
return false;
}
-
+
$r = $current->response[ $theme ];
add_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2);
}
function after() {
+ if ( $this->upgrader->bulk )
+ return;
+
$this->plugin = $this->upgrader->plugin_info();
if( !empty($this->plugin) && !is_wp_error($this->result) && $this->plugin_active ){
show_message(__('Attempting reactivation of the plugin'));
echo '<iframe style="border:0;overflow:hidden" width="100%" height="170px" src="' . wp_nonce_url('update.php?action=activate-plugin&plugin=' . $this->plugin, 'activate-plugin_' . $this->plugin) .'"></iframe>';
}
+
$update_actions = array(
'activate_plugin' => '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $this->plugin, 'activate-plugin_' . $this->plugin) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>',
'plugins_page' => '<a href="' . admin_url('plugins.php') . '" title="' . esc_attr__('Goto plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>'
if ( ! empty($update_actions) )
$this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$update_actions));
}
+
+ function before() {
+ if ( $this->upgrader->show_before ) {
+ echo $this->upgrader->show_before;
+ $this->upgrader->show_before = '';
+ }
+ }
}
/**
$name = $theme_info['Name'];
$stylesheet = $this->upgrader->result['destination_name'];
$template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet;
-
+
$preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), trailingslashit(esc_url(get_option('home'))) ) );
$activate_link = wp_nonce_url("themes.php?action=activate&template=" . urlencode($template) . "&stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
-
+
$update_actions = array(
'preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview “%s”'), $name)) . '">' . __('Preview') . '</a>',
'activate' => '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr( sprintf( __('Activate “%s”'), $name ) ) . '">' . __('Activate') . '</a>',
// Incoming Links Widget
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;
+ $num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10;
$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' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=20&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
- 'items' => isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10,
+ 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
+ 'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?scoring=d&ie=utf-8&num=' . $num_items . '&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
+ 'items' => $num_items,
'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false
);
}
function _wp_dashboard_control_callback( $dashboard, $meta_box ) {
echo '<form action="" method="post" class="dashboard-widget-control-form">';
wp_dashboard_trigger_widget_control( $meta_box['id'] );
- echo "<p class='submit'><input type='hidden' name='widget_id' value='" . esc_attr($meta_box['id']) . "' /><input type='submit' value='" . esc_attr__( 'Submit' ) . "' /></p>";
+ echo '<p class="submit"><input type="hidden" name="widget_id" value="' . esc_attr($meta_box['id']) . '" /><input type="submit" value="' . esc_attr__( 'Submit' ) . '" /></p>';
echo '</form>';
}
$hide2 = $hide3 = $hide4 = 'display:none;';
}
?>
-<div id='dashboard-widgets' class='metabox-holder'>
+<div id="dashboard-widgets" class="metabox-holder">
<?php
echo "\t<div class='postbox-container' style='$width'>\n";
do_meta_boxes( 'dashboard', 'normal', '' );
?>
</div></div>
-<form style='display: none' method='get' action=''>
+<form style="display:none" method="get" action="">
<p>
<?php
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
*/
// Total Comments
- $num = number_format_i18n($num_comm->total_comments);
+ $num = '<span class="total-count">' . number_format_i18n($num_comm->total_comments) . '</span>';
$text = _n( 'Comment', 'Comments', $num_comm->total_comments );
if ( current_user_can( 'moderate_comments' ) ) {
$num = "<a href='edit-comments.php'>$num</a>";
echo '<td class="t pages">' . $text . '</td>';
// Approved Comments
- $num = number_format_i18n($num_comm->approved);
+ $num = '<span class="approved-count">' . number_format_i18n($num_comm->approved) . '</span>';
$text = _nc( 'Approved|Right Now', 'Approved', $num_comm->approved );
if ( current_user_can( 'moderate_comments' ) ) {
$num = "<a href='edit-comments.php?comment_status=approved'>$num</a>";
echo '<td class="t cats">' . $text . '</td>';
// Pending Comments
- $num = number_format_i18n($num_comm->moderated);
+ $num = '<span class="pending-count">' . number_format_i18n($num_comm->moderated) . '</span>';
$text = _n( 'Pending', 'Pending', $num_comm->moderated );
if ( current_user_can( 'moderate_comments' ) ) {
- $num = "<a href='edit-comments.php?comment_status=moderated'><span class='pending-count'>$num</span></a>";
+ $num = "<a href='edit-comments.php?comment_status=moderated'>$num</a>";
$text = "<a class='waiting' href='edit-comments.php?comment_status=moderated'>$text</a>";
}
echo '<td class="b b-waiting">' . $num . '</td>';
} else {
if ( current_user_can( 'switch_themes' ) ) {
echo '<a href="themes.php" class="button rbutton">' . __('Change Theme') . '</a>';
- printf('Theme <span class="b"><a href="themes.php">%1$s</a></span>', $ct->title);
+ printf( __('Theme <span class="b"><a href="themes.php">%1$s</a></span>'), $ct->title );
} else {
- printf('Theme <span class="b">%1$s</span>', $ct->title);
+ printf( __('Theme <span class="b">%1$s</span>'), $ct->title );
}
}
echo '</p>';
foreach ( $drafts as $draft ) {
$url = get_edit_post_link( $draft->ID );
$title = _draft_or_post_title( $draft->ID );
- $item = "<h4><a href='$url' title='" . sprintf( __( 'Edit “%s”' ), esc_attr( $title ) ) . "'>$title</a> <abbr title='" . get_the_time(__('Y/m/d g:i:s A'), $draft) . "'>" . get_the_time( get_option( 'date_format' ), $draft ) . '</abbr></h4>';
+ $item = "<h4><a href='$url' title='" . sprintf( __( 'Edit “%s”' ), esc_attr( $title ) ) . "'>" . esc_html($title) . "</a> <abbr title='" . get_the_time(__('Y/m/d g:i:s A'), $draft) . "'>" . get_the_time( get_option( 'date_format' ), $draft ) . '</abbr></h4>';
if ( $the_content = preg_split( '#\s#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) )
$item .= '<p>' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '…' : '' ) . '</p>';
$list[] = $item;
$comments = array();
$start = 0;
- while ( count( $comments ) < 5 && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments ORDER BY comment_date_gmt DESC LIMIT $start, 50" ) ) {
+ while ( count( $comments ) < 5 && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT $start, 50" ) ) {
foreach ( $possible as $comment ) {
if ( count( $comments ) >= 5 )
<?php }
wp_comment_reply( -1, false, 'dashboard', false );
+ wp_comment_trashnotice();
else :
?>
$comment_post_link = "<a href='$comment_post_url'>$comment_post_title</a>";
$comment_link = '<a class="comment-link" href="' . esc_url(get_comment_link()) . '">#</a>';
- $delete_url = esc_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
- $approve_url = esc_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) );
- $unapprove_url = esc_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) );
- $spam_url = esc_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
-
- $actions = array();
-
$actions_string = '';
if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
+ // preorder it: Approve | Reply | Edit | Spam | Trash
+ $actions = array(
+ 'approve' => '', 'unapprove' => '',
+ 'reply' => '',
+ 'edit' => '',
+ 'spam' => '',
+ 'trash' => '', 'delete' => ''
+ );
+
+ $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
+ $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );
+
+ $approve_url = esc_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" );
+ $unapprove_url = esc_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" );
+ $spam_url = esc_url( "comment.php?action=spamcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
+ $trash_url = esc_url( "comment.php?action=trashcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
+ $delete_url = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
+
$actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
$actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
$actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
- //$actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>';
$actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r hide-if-no-js" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
$actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
- $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
+ if ( !EMPTY_TRASH_DAYS )
+ $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
+ else
+ $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . __( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
- $actions = apply_filters( 'comment_row_actions', $actions, $comment );
+ $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
$i = 0;
foreach ( $actions as $action => $link ) {
<?php echo get_avatar( $comment, 50 ); ?>
<div class="dashboard-comment-wrap">
- <h4 class="comment-meta"><?php printf( __( 'From %1$s on %2$s%3$s' ), '<cite class="comment-author">' . get_comment_author_link() . '</cite>', $comment_post_link." ".$comment_link, ' <span class="approve">' . __( '[Pending]' ) . '</span>' ); ?></h4>
+ <h4 class="comment-meta"><?php printf( __( 'From %1$s on %2$s%3$s' ), '<cite class="comment-author">' . get_comment_author_link() . '</cite>', $comment_post_link.' '.$comment_link, ' <span class="approve">' . __( '[Pending]' ) . '</span>' ); ?></h4>
<?php
else :
?>
<div class="dashboard-comment-wrap">
<?php /* translators: %1$s is type of comment, %2$s is link to the post */ ?>
- <h4 class="comment-meta"><?php printf( _x( '%1$s on %2$s', 'dashboard' ), "<strong>$type</strong>", $comment_post_link ); ?></h4>
+ <h4 class="comment-meta"><?php printf( _x( '%1$s on %2$s', 'dashboard' ), "<strong>$type</strong>", $comment_post_link." ".$comment_link ); ?></h4>
<p class="comment-author"><?php comment_author_link(); ?></p>
<?php endif; // comment_type ?>
<blockquote><p><?php comment_excerpt(); ?></p></blockquote>
<p class="row-actions"><?php echo $actions_string; ?></p>
-
- <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
- <textarea class="comment" rows="3" cols="10"><?php echo $comment->comment_content; ?></textarea>
- <div class="author-email"><?php echo esc_attr( $comment->comment_author_email ); ?></div>
- <div class="author"><?php echo esc_attr( $comment->comment_author ); ?></div>
- <div class="author-url"><?php echo esc_attr( $comment->comment_author_url ); ?></div>
- <div class="comment_status"><?php echo $comment->comment_approved; ?></div>
- </div>
</div>
</div>
<?php
if ( !$rss->get_item_quantity() ) {
echo '<p>' . __('This dashboard widget queries <a href="http://blogsearch.google.com/">Google Blog Search</a> so that when another blog links to your site it will show up here. It has found no incoming links… yet. It’s okay — there is no rush.') . "</p>\n";
+ $rss->__destruct();
+ unset($rss);
return;
}
}
echo "</ul>\n";
-
+ $rss->__destruct();
+ unset($rss);
}
function wp_dashboard_incoming_links_control() {
*/
function wp_dashboard_rss_output( $widget_id ) {
$widgets = get_option( 'dashboard_widget_options' );
- echo "<div class='rss-widget'>";
+ echo '<div class="rss-widget">';
wp_widget_rss_output( $widgets[$widget_id] );
echo "</div>";
}
echo '</p></div>';
}
} elseif ( !$rss->get_item_quantity() ) {
+ $rss->__destruct();
+ unset($rss);
return false;
} else {
echo '<div class="rss-widget">';
wp_widget_rss_output( $rss, $widgets['dashboard_secondary'] );
echo '</div>';
+ $rss->__destruct();
+ unset($rss);
}
}
echo "<h4>$label</h4>\n";
echo "<h5><a href='$link'>$title</a></h5> <span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span>\n";
echo "<p>$description</p>\n";
+
+ $$feed->__destruct();
+ unset($$feed);
}
}
// title is optional. If black, fill it if possible
if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) {
$rss = fetch_feed($widget_options[$widget_id]['url']);
- if ( ! is_wp_error($rss) )
- $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title()));
- else
+ if ( is_wp_error($rss) ) {
$widget_options[$widget_id]['title'] = htmlentities(__('Unknown Feed'));
+ } else {
+ $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title()));
+ $rss->__destruct();
+ unset($rss);
+ }
}
update_option( 'dashboard_widget_options', $widget_options );
}
* @param unknown_type $author
*/
function export_wp($author='') {
-global $wpdb, $post_ids, $post;
+global $wpdb, $post_ids, $post, $wp_taxonomies;
do_action('export_wp');
$categories = (array) get_categories('get=all');
$tags = (array) get_tags('get=all');
+$custom_taxonomies = $wp_taxonomies;
+unset($custom_taxonomies['category']);
+unset($custom_taxonomies['post_tag']);
+unset($custom_taxonomies['link_category']);
+$custom_taxonomies = array_keys($custom_taxonomies);
+$terms = (array) get_terms($custom_taxonomies, 'get=all');
+
/**
* {@internal Missing Short Description}}
*
echo '<wp:tag_description>' . wxr_cdata($t->description) . '</wp:tag_description>';
}
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param object $t Term Object
+ */
+function wxr_term_name($t) {
+ if ( empty($t->name) )
+ return;
+
+ echo '<wp:term_name>' . wxr_cdata($t->name) . '</wp:term_name>';
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since unknown
+ *
+ * @param object $t Term Object
+ */
+function wxr_term_description($t) {
+ if ( empty($t->description) )
+ return;
+
+ echo '<wp:term_description>' . wxr_cdata($t->description) . '</wp:term_description>';
+}
+
/**
* {@internal Missing Short Description}}
*
<!-- This file is not intended to serve as a complete backup of your blog. -->
<!-- To import this information into a WordPress blog follow these steps. -->
-<!-- 1. Log into that blog as an administrator. -->
+<!-- 1. Log in to that blog as an administrator. -->
<!-- 2. Go to Tools: Import in the blog's admin panels (or Manage: Import in older versions of WordPress). -->
<!-- 3. Choose "WordPress" from the list. -->
<!-- 4. Upload this file using the form provided on that page. -->
<?php endforeach; endif; ?>
<?php if ( $tags ) : foreach ( $tags as $t ) : ?>
<wp:tag><wp:tag_slug><?php echo $t->slug; ?></wp:tag_slug><?php wxr_tag_name($t); ?><?php wxr_tag_description($t); ?></wp:tag>
+<?php endforeach; endif; ?>
+<?php if ( $terms ) : foreach ( $terms as $t ) : ?>
+ <wp:term><wp:term_taxonomy><?php echo $t->taxonomy; ?></wp:term_taxonomy><wp:term_slug><?php echo $t->slug; ?></wp:term_slug><wp:term_parent><?php echo $t->parent ? $custom_taxonomies[$t->parent]->name : ''; ?></wp:term_parent><?php wxr_term_name($t); ?><?php wxr_term_description($t); ?></wp:term>
<?php endforeach; endif; ?>
<?php do_action('rss2_head'); ?>
<?php if ($post_ids) {
// Don't export revisions. They bloat the export.
if ( 'revision' == $post->post_type )
continue;
- setup_postdata($post); ?>
+ setup_postdata($post);
+
+ $is_sticky = 0;
+ if ( is_sticky( $post->ID ) )
+ $is_sticky = 1;
+
+?>
<item>
<title><?php echo apply_filters('the_title_rss', $post->post_title); ?></title>
<link><?php the_permalink_rss() ?></link>
<wp:menu_order><?php echo $post->menu_order; ?></wp:menu_order>
<wp:post_type><?php echo $post->post_type; ?></wp:post_type>
<wp:post_password><?php echo $post->post_password; ?></wp:post_password>
+<wp:is_sticky><?php echo $is_sticky; ?></wp:is_sticky>
<?php
if ($post->post_type == 'attachment') { ?>
<wp:attachment_url><?php echo wp_get_attachment_url($post->ID); ?></wp:attachment_url>
<wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
<wp:comment_author><?php echo wxr_cdata($c->comment_author); ?></wp:comment_author>
<wp:comment_author_email><?php echo $c->comment_author_email; ?></wp:comment_author_email>
-<wp:comment_author_url><?php echo $c->comment_author_url; ?></wp:comment_author_url>
+<wp:comment_author_url><?php echo esc_url_raw( $c->comment_author_url ); ?></wp:comment_author_url>
<wp:comment_author_IP><?php echo $c->comment_author_IP; ?></wp:comment_author_IP>
<wp:comment_date><?php echo $c->comment_date; ?></wp:comment_date>
<wp:comment_date_gmt><?php echo $c->comment_date_gmt; ?></wp:comment_date_gmt>
}
/**
- * {@internal Missing Short Description}}
+ * Returns a listing of all files in the specified folder and all subdirectories up to 100 levels deep.
+ * The depth of the recursiveness can be controlled by the $levels param.
*
- * @since unknown
+ * @since 2.6.0
*
- * @param string $folder Optional. Full path to folder
- * @param int $levels Optional. Levels of folders to follow, Default: 100 (PHP Loop limit).
- * @return bool|array
+ * @param string $folder Full path to folder
+ * @param int $levels (optional) Levels of folders to follow, Default: 100 (PHP Loop limit).
+ * @return bool|array False on failure, Else array of files
*/
function list_files( $folder = '', $levels = 100 ) {
if( empty($folder) )
}
/**
- * {@internal Missing Short Description}}
+ * Determines a writable directory for temporary files.
+ * Function's preference is to WP_CONTENT_DIR followed by the return value of <code>sys_get_temp_dir()</code>, before finally defaulting to /tmp/
*
- * @since unknown
+ * In the event that this function does not find a writable location, It may be overridden by the <code>WP_TEMP_DIR</code> constant in your <code>wp-config.php</code> file.
*
- * @return unknown
+ * @since 2.5.0
+ *
+ * @return string Writable temporary directory
*/
function get_temp_dir() {
if ( defined('WP_TEMP_DIR') )
}
/**
- * {@internal Missing Short Description}}
+ * Returns a filename of a Temporary unique file.
+ * Please note that the calling function must unlink() this itself.
*
- * @since unknown
+ * The filename is based off the passed parameter or defaults to the current unix timestamp,
+ * while the directory can either be passed as well, or by leaving it blank, default to a writable temporary directory.
*
- * @param unknown_type $filename
- * @param unknown_type $dir
- * @return unknown
+ * @since 2.6.0
+ *
+ * @param string $filename (optional) Filename to base the Unique file off
+ * @param string $dir (optional) Directory to store the file in
+ * @return string a writable filename
*/
function wp_tempnam($filename = '', $dir = ''){
if ( empty($dir) )
if ( empty($filename) )
$filename = time();
+ $filename = preg_replace('|\..*$|', '.tmp', $filename);
$filename = $dir . wp_unique_filename($dir, $filename);
touch($filename);
return $filename;
* @return unknown
*/
function validate_file_to_edit( $file, $allowed_files = '' ) {
- $file = stripslashes( $file );
-
$code = validate_file( $file, $allowed_files );
if (!$code )
case 1 :
wp_die( __('Sorry, can’t edit files with “..” in the name. If you are trying to edit a file in your WordPress home directory, you can just type the name of the file in.' ));
- case 2 :
- wp_die( __('Sorry, can’t call files with their real path.' ));
+ //case 2 :
+ // wp_die( __('Sorry, can’t call files with their real path.' ));
case 3 :
wp_die( __('Sorry, that file cannot be edited.' ));
}
}
+ $file = apply_filters( 'wp_handle_upload_prefilter', $file );
+
// You may define your own function and pass the name in $overrides['upload_error_handler']
$upload_error_handler = 'wp_handle_upload_error';
+ // You may have had one or more 'wp_handle_upload_prefilter' functions error out the file. Handle that gracefully.
+ if ( isset( $file['error'] ) && !ctype_digit( $file['error'] ) && $file['error'] )
+ return $upload_error_handler( $file, $file['error'] );
+
// You may define your own function and pass the name in $overrides['unique_filename_callback']
$unique_filename_callback = null;
// A non-empty file will pass this test.
if ( $test_size && !($file['size'] > 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.' ));
+ 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 or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' ));
// A properly uploaded file will pass this test. There should be no reason to override this one.
if (! @ is_uploaded_file( $file['tmp_name'] ) )
}
/**
- * Downloads a url to a local file using the Snoopy HTTP Class.
+ * Downloads a url to a local temporary file using the WordPress HTTP Class.
+ * Please note, That the calling function must unlink() the file.
*
- * @since unknown
- * @todo Transition over to using the new HTTP Request API (jacob).
+ * @since 2.5.0
*
* @param string $url the URL of the file to download
* @return mixed WP_Error on failure, string Filename on success.
}
/**
- * {@internal Missing Short Description}}
+ * Unzip's a specified ZIP file to a location on the Filesystem via the WordPress Filesystem Abstraction.
+ * Assumes that WP_Filesystem() has already been called and set up.
*
- * @since unknown
+ * Attempts to increase the PHP Memory limit to 256M before uncompressing,
+ * However, The most memory required shouldn't be much larger than the Archive itself.
*
- * @param unknown_type $file
- * @param unknown_type $to
- * @return unknown
+ * @since 2.5.0
+ *
+ * @param string $file Full path and filename of zip archive
+ * @param string $to Full path on the filesystem to extract archive to
+ * @return mixed WP_Error on failure, True on success
*/
function unzip_file($file, $to) {
global $wp_filesystem;
if ( ! $wp_filesystem || !is_object($wp_filesystem) )
return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
- // Unzip uses a lot of memory
+ // Unzip uses a lot of memory, but not this much hopefully
@ini_set('memory_limit', '256M');
$fs =& $wp_filesystem;
}
/**
- * {@internal Missing Short Description}}
+ * Copies a directory from one location to another via the WordPress Filesystem Abstraction.
+ * Assumes that WP_Filesystem() has already been called and setup.
*
- * @since unknown
+ * @since 2.5.0
*
- * @param unknown_type $from
- * @param unknown_type $to
- * @return unknown
+ * @param string $from source directory
+ * @param string $to destination directory
+ * @return mixed WP_Error on failure, True on success.
*/
function copy_dir($from, $to) {
global $wp_filesystem;
return $result;
}
}
+ return true;
}
/**
- * {@internal Missing Short Description}}
+ * Initialises and connects the WordPress Filesystem Abstraction classes.
+ * This function will include the chosen transport and attempt connecting.
*
- * @since unknown
+ * Plugins may add extra transports, And force WordPress to use them by returning the filename via the 'filesystem_method_file' filter.
*
- * @param unknown_type $args
- * @return unknown
+ * @since 2.5.0
+ *
+ * @param array $args (optional) Connection args, These are passed directly to the WP_Filesystem_*() classes.
+ * @param string $context (optional) Context for get_filesystem_method(), See function declaration for more information.
+ * @return boolean false on failure, true on success
*/
function WP_Filesystem( $args = false, $context = false ) {
global $wp_filesystem;
$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);
+ //Define the timeouts for the connections. Only available after the construct is called to allow for per-transport overriding of the default.
+ if ( ! defined('FS_CONNECT_TIMEOUT') )
+ define('FS_CONNECT_TIMEOUT', 30);
+ if ( ! defined('FS_TIMEOUT') )
+ define('FS_TIMEOUT', 30);
+
if ( is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() )
return false;
}
/**
- * {@internal Missing Short Description}}
+ * Determines which Filesystem Method to use.
+ * The priority of the Transports are: Direct, SSH2, FTP PHP Extension, FTP Sockets (Via Sockets class, or fsoxkopen())
*
- * @since unknown
+ * Note that the return value of this function can be overridden in 2 ways
+ * - By defining FS_METHOD in your <code>wp-config.php</code> file
+ * - By using the filesystem_method filter
+ * Valid values for these are: 'direct', 'ssh', 'ftpext' or 'ftpsockets'
+ * Plugins may also define a custom transport handler, See the WP_Filesystem function for more information.
+ *
+ * @since 2.5.0
*
- * @param unknown_type $args
+ * @param array $args Connection details.
* @param string $context Full path to the directory that is tested for being writable.
- * @return unknown
+ * @return string The transport to use, see description for valid return values.
*/
function get_filesystem_method($args = array(), $context = false) {
$method = defined('FS_METHOD') ? FS_METHOD : false; //Please ensure that this is either 'direct', 'ssh', 'ftpext' or 'ftpsockets'
if ( !$context )
$context = WP_CONTENT_DIR;
$context = trailingslashit($context);
- $temp_file_name = $context . '.write-test-' . time();
+ $temp_file_name = $context . 'temp-write-test-' . time();
$temp_handle = @fopen($temp_file_name, 'w');
if ( $temp_handle ) {
- if ( getmyuid() == fileowner($temp_file_name) )
+ if ( getmyuid() == @fileowner($temp_file_name) )
$method = 'direct';
@fclose($temp_handle);
- unlink($temp_file_name);
+ @unlink($temp_file_name);
}
}
}
/**
- * {@internal Missing Short Description}}
+ * Displays a form to the user to request for their FTP/SSH details in order to connect to the filesystem.
+ * All chosen/entered details are saved, Excluding the Password.
*
- * @since unknown
+ * Hostnames may be in the form of hostname:portnumber (eg: wordpress.org:2467) to specify an alternate FTP/SSH port.
*
- * @param unknown_type $form_post
- * @param unknown_type $type
- * @param unknown_type $error
- * @return unknown
+ * Plugins may override this form by returning true|false via the <code>request_filesystem_credentials</code> filter.
+ *
+ * @since 2.5.0
+ *
+ * @param string $form_post the URL to post the form to
+ * @param string $type the chosen Filesystem method in use
+ * @param boolean $error if the current request has failed to connect
+ * @param string $context The directory which is needed access to, The write-test will be performed on this directory by get_filesystem_method()
+ * @return boolean False on failure. True on success.
*/
function request_filesystem_credentials($form_post, $type = '', $error = false, $context = false) {
$req_cred = apply_filters('request_filesystem_credentials', '', $form_post, $type, $error, $context);
$credentials = get_option('ftp_credentials', array( 'hostname' => '', 'username' => ''));
// If defined, set it to that, Else, If POST'd, set it to that, If not, Set it to whatever it previously was(saved details in option)
- $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? $_POST['hostname'] : $credentials['hostname']);
- $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? $_POST['username'] : $credentials['username']);
- $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? $_POST['password'] : '');
+ $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? stripslashes($_POST['hostname']) : $credentials['hostname']);
+ $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? stripslashes($_POST['username']) : $credentials['username']);
+ $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? stripslashes($_POST['password']) : '');
// Check to see if we are setting the public/private keys for ssh
- $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? $_POST['public_key'] : '');
- $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? $_POST['private_key'] : '');
+ $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? stripslashes($_POST['public_key']) : '');
+ $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? stripslashes($_POST['private_key']) : '');
//sanitize the hostname, Some people might pass in odd-data:
$credentials['hostname'] = preg_replace('|\w+://|', '', $credentials['hostname']); //Strip any schemes off
- if ( strpos($credentials['hostname'], ':') )
+ if ( strpos($credentials['hostname'], ':') ) {
list( $credentials['hostname'], $credentials['port'] ) = explode(':', $credentials['hostname'], 2);
- else
+ if ( ! is_numeric($credentials['port']) )
+ unset($credentials['port']);
+ } else {
unset($credentials['port']);
+ }
- if ( defined('FTP_SSH') || (defined('FS_METHOD') && 'ssh' == FS_METHOD) )
+ if ( (defined('FTP_SSH') && FTP_SSH) || (defined('FS_METHOD') && 'ssh' == FS_METHOD) )
$credentials['connection_type'] = 'ssh';
- else if ( defined('FTP_SSL') && 'ftpext' == $type ) //Only the FTP Extension understands SSL
+ else if ( (defined('FTP_SSL') && FTP_SSL) && 'ftpext' == $type ) //Only the FTP Extension understands SSL
$credentials['connection_type'] = 'ftps';
else if ( !empty($_POST['connection_type']) )
- $credentials['connection_type'] = $_POST['connection_type'];
+ $credentials['connection_type'] = stripslashes($_POST['connection_type']);
else if ( !isset($credentials['connection_type']) ) //All else fails (And its not defaulted to something else saved), Default to FTP
$credentials['connection_type'] = 'ftp';
$error_string = $error->get_error_message();
echo '<div id="message" class="error"><p>' . $error_string . '</p></div>';
}
+
+ $types = array();
+ if ( extension_loaded('ftp') || extension_loaded('sockets') || function_exists('fsockopen') )
+ $types[ 'ftp' ] = __('FTP');
+ if ( extension_loaded('ftp') ) //Only this supports FTPS
+ $types[ 'ftps' ] = __('FTPS (SSL)');
+ if ( extension_loaded('ssh2') && function_exists('stream_get_contents') )
+ $types[ 'ssh' ] = __('SSH2');
+
+ $types = apply_filters('fs_ftp_connection_types', $types, $credentials, $type, $error, $context);
+
?>
<script type="text/javascript">
<!--
<td><input name="password" type="password" id="password" value="<?php if ( defined('FTP_PASS') ) echo '*****'; ?>"<?php if ( defined('FTP_PASS') ) echo ' disabled="disabled"' ?> size="40" /></td>
</tr>
-<?php if ( extension_loaded('ssh2') && function_exists('stream_get_contents') ) : ?>
+<?php if ( isset($types['ssh']) ) : ?>
<tr id="ssh_keys" valign="top" style="<?php if ( 'ssh' != $connection_type ) echo 'display:none' ?>">
<th scope="row"><?php _e('Authentication Keys') ?>
<div class="key-labels textright">
<th scope="row"><?php _e('Connection Type') ?></th>
<td>
<fieldset><legend class="screen-reader-text"><span><?php _e('Connection Type') ?></span></legend>
-<label><input id="ftp" name="connection_type" type="radio" value="ftp" <?php checked('ftp', $connection_type); if ( defined('FTP_SSL') || defined('FTP_SSH') ) echo ' disabled="disabled"'; ?>/> <?php _e('FTP') ?></label>
-<?php if ( 'ftpext' == $type ) : ?>
-<br /><label><input id="ftps" name="connection_type" type="radio" value="ftps" <?php checked('ftps', $connection_type); if ( defined('FTP_SSL') || defined('FTP_SSH') ) echo ' disabled="disabled"'; ?>/> <?php _e('FTPS (SSL)') ?></label>
-<?php endif; ?>
-<?php if ( extension_loaded('ssh2') && function_exists('stream_get_contents') ) : ?>
-<br /><label><input id="ssh" name="connection_type" type="radio" value="ssh" <?php checked('ssh', $connection_type); if ( defined('FTP_SSL') || defined('FTP_SSH') ) echo ' disabled="disabled"'; ?>/> <?php _e('SSH') ?></label>
-<?php endif; ?>
+<?php
+
+ $disabled = (defined('FTP_SSL') && FTP_SSL) || (defined('FTP_SSH') && FTP_SSH) ? ' disabled="disabled"' : '';
+
+ foreach ( $types as $name => $text ) : ?>
+ <label for="<?php echo esc_attr($name) ?>">
+ <input type="radio" name="connection_type" id="<?php echo esc_attr($name) ?>" value="<?php echo esc_attr($name) ?>" <?php checked($name, $connection_type); echo $disabled; ?>/>
+ <?php echo $text ?>
+ </label>
+ <?php endforeach; ?>
</fieldset>
</td>
</tr>
</table>
<?php if ( isset( $_POST['version'] ) ) : ?>
-<input type="hidden" name="version" value="<?php echo esc_attr($_POST['version']) ?>" />
+<input type="hidden" name="version" value="<?php echo esc_attr(stripslashes($_POST['version'])) ?>" />
<?php endif; ?>
<?php if ( isset( $_POST['locale'] ) ) : ?>
-<input type="hidden" name="locale" value="<?php echo esc_attr($_POST['locale']) ?>" />
+<input type="hidden" name="locale" value="<?php echo esc_attr(stripslashes($_POST['locale'])) ?>" />
<?php endif; ?>
<p class="submit">
<input id="upgrade" name="upgrade" type="submit" class="button" value="<?php esc_attr_e('Proceed'); ?>" />
--- /dev/null
+<?php
+/**
+ * WordPress Image Editor
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+function wp_image_editor($post_id, $msg = false) {
+ $nonce = wp_create_nonce("image_editor-$post_id");
+ $meta = wp_get_attachment_metadata($post_id);
+ $thumb = image_get_intermediate_size($post_id, 'thumbnail');
+ $sub_sizes = isset($meta['sizes']) && is_array($meta['sizes']);
+ $note = '';
+
+ if ( is_array($meta) && isset($meta['width']) )
+ $big = max( $meta['width'], $meta['height'] );
+ else
+ die( __('Image data does not exist. Please re-upload the image.') );
+
+ $sizer = $big > 400 ? 400 / $big : 1;
+
+ $backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
+ $can_restore = !empty($backup_sizes) && isset($backup_sizes['full-orig'])
+ && $backup_sizes['full-orig']['file'] != basename($meta['file']);
+
+ if ( $msg ) {
+ if ( isset($msg->error) )
+ $note = "<div class='error'><p>$msg->error</p></div>";
+ elseif ( isset($msg->msg) )
+ $note = "<div class='updated'><p>$msg->msg</p></div>";
+ }
+
+ ?>
+ <div class="imgedit-wrap">
+ <?php echo $note; ?>
+ <table id="imgedit-panel-<?php echo $post_id; ?>"><tbody>
+ <tr><td>
+ <div class="imgedit-menu">
+ <div onclick="imageEdit.crop(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-crop disabled" title="<?php esc_attr_e( 'Crop' ); ?>"></div><?php
+
+ if ( function_exists('imagerotate') ) { ?>
+
+ <div onclick="imageEdit.rotate(90, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-rleft" title="<?php esc_attr_e( 'Rotate couter-clockwise' ); ?>"></div>
+ <div onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-rright" title="<?php esc_attr_e( 'Rotate clockwise' ); ?>"></div><?php
+
+ } ?>
+
+ <div onclick="imageEdit.flip(1, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-flipv" title="<?php esc_attr_e( 'Flip vertically' ); ?>"></div>
+ <div onclick="imageEdit.flip(2, <?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-fliph" title="<?php esc_attr_e( 'Flip horizontally' ); ?>"></div>
+
+ <div id="image-undo-<?php echo $post_id; ?>" onclick="imageEdit.undo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-undo disabled" title="<?php esc_attr_e( 'Undo' ); ?>"></div>
+ <div id="image-redo-<?php echo $post_id; ?>" onclick="imageEdit.redo(<?php echo "$post_id, '$nonce'"; ?>, this)" class="imgedit-redo disabled" title="<?php esc_attr_e( 'Redo' ); ?>"></div>
+ <br class="clear" />
+ </div>
+
+ <input type="hidden" id="imgedit-sizer-<?php echo $post_id; ?>" value="<?php echo $sizer; ?>" />
+ <input type="hidden" id="imgedit-minthumb-<?php echo $post_id; ?>" value="<?php echo ( get_option('thumbnail_size_w') . ':' . get_option('thumbnail_size_h') ); ?>" />
+ <input type="hidden" id="imgedit-history-<?php echo $post_id; ?>" value="" />
+ <input type="hidden" id="imgedit-undone-<?php echo $post_id; ?>" value="0" />
+ <input type="hidden" id="imgedit-selection-<?php echo $post_id; ?>" value="" />
+ <input type="hidden" id="imgedit-x-<?php echo $post_id; ?>" value="<?php echo $meta['width']; ?>" />
+ <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo $meta['height']; ?>" />
+
+ <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap">
+ <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" src="<?php echo admin_url('admin-ajax.php'); ?>?action=imgedit-preview&_ajax_nonce=<?php echo $nonce; ?>&postid=<?php echo $post_id; ?>&rand=<?php echo rand(1, 99999); ?>" />
+ </div>
+
+ <div class="imgedit-submit">
+ <input type="button" onclick="imageEdit.close(<?php echo $post_id; ?>, 1)" class="button" value="<?php esc_attr_e( 'Cancel' ); ?>" />
+ <input type="button" onclick="imageEdit.save(<?php echo "$post_id, '$nonce'"; ?>)" disabled="disabled" class="button-primary imgedit-submit-btn" value="<?php esc_attr_e( 'Save' ); ?>" />
+ </div>
+ </td>
+
+ <td class="imgedit-settings">
+ <div class="imgedit-group">
+ <div class="imgedit-group-top">
+ <a class="imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" href="#"><strong><?php _e('Scale Image'); ?></strong></a>
+ <div class="imgedit-help">
+ <p><?php _e('You can proportionally scale the original image. For best results the scaling should be done before performing any other operations on it like crop, rotate, etc. Note that if you make the image larger it may become fuzzy.'); ?></p>
+ <p><?php printf( __('Original dimensions %s'), $meta['width'] . '×' . $meta['height'] ); ?></p>
+ <div class="imgedit-submit">
+ <span class="nowrap"><input type="text" id="imgedit-scale-width-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" style="width:4em;" value="<?php echo $meta['width']; ?>" />×<input type="text" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" style="width:4em;" value="<?php echo $meta['height']; ?>" />
+ <span class="imgedit-scale-warn" id="imgedit-scale-warn-<?php echo $post_id; ?>">!</span></span>
+ <input type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button-primary" value="<?php esc_attr_e( 'Scale' ); ?>" />
+ </div>
+ </div>
+ </div>
+
+<?php if ( $can_restore ) { ?>
+
+ <div class="imgedit-group-top">
+ <a class="imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" href="#"><strong><?php _e('Restore Original Image'); ?></strong></a>
+ <div class="imgedit-help">
+ <p><?php _e('Discard any changes and restore the original image.');
+
+ if ( !defined('IMAGE_EDIT_OVERWRITE') || !IMAGE_EDIT_OVERWRITE )
+ _e(' Previously edited copies of the image will not be deleted.');
+
+ ?></p>
+ <div class="imgedit-submit">
+ <input type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'restore')" class="button-primary" value="<?php esc_attr_e( 'Restore image' ); ?>" <?php echo $can_restore; ?> />
+ </div>
+ </div>
+ </div>
+
+<?php } ?>
+
+ </div>
+
+ <div class="imgedit-group">
+ <div class="imgedit-group-top">
+ <strong><?php _e('Image Crop'); ?></strong>
+ <a class="imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" href="#"><?php _e('(help)'); ?></a>
+ <div class="imgedit-help">
+ <p><?php _e('The image can be cropped by clicking on it and dragging to select the desired part. While dragging the dimensions of the selection are displayed below.'); ?></p>
+ <strong><?php _e('Keyboard shortcuts'); ?></strong>
+ <ul>
+ <li><?php _e('Arrow: move by 10px'); ?></li>
+ <li><?php _e('Shift + arrow: move by 1px'); ?></li>
+ <li><?php _e('Ctrl + arrow: resize by 10px'); ?></li>
+ <li><?php _e('Ctrl + Shift + arrow: resize by 1px'); ?></li>
+ <li><?php _e('Shift + drag: lock aspect ratio'); ?></li>
+ </ul>
+
+ <p><strong><?php _e('Crop Aspect Ratio'); ?></strong><br />
+ <?php _e('You can specify the crop selection aspect ratio then hold down the Shift key while dragging to lock it. The values can be 1:1 (square), 4:3, 16:9, etc. If there is a selection, specifying aspect ratio will set it immediately.'); ?></p>
+
+ <p><strong><?php _e('Crop Selection'); ?></strong><br />
+ <?php _e('Once started, the selection can be adjusted by entering new values (in pixels). Note that these values are scaled to approximately match the original image dimensions. The minimum selection size equals the thumbnail size as set in the Media settings.'); ?></p>
+ </div>
+ </div>
+
+ <p>
+ <?php _e('Aspect ratio:'); ?>
+ <span class="nowrap">
+ <input type="text" id="imgedit-crop-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 0, this)" style="width:3em;" />
+ :
+ <input type="text" id="imgedit-crop-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setRatioSelection(<?php echo $post_id; ?>, 1, this)" style="width:3em;" />
+ </span>
+ </p>
+
+ <p id="imgedit-crop-sel-<?php echo $post_id; ?>">
+ <?php _e('Selection:'); ?>
+ <span class="nowrap">
+ <input type="text" id="imgedit-sel-width-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>)" style="width:4em;" />
+ :
+ <input type="text" id="imgedit-sel-height-<?php echo $post_id; ?>" onkeyup="imageEdit.setNumSelection(<?php echo $post_id; ?>)" style="width:4em;" />
+ </span>
+ </p>
+ </div>
+
+ <?php if ( $thumb && $sub_sizes ) {
+ $thumb_img = wp_constrain_dimensions( $thumb['width'], $thumb['height'], 160, 120 );
+ ?>
+
+ <div class="imgedit-group imgedit-applyto">
+ <div class="imgedit-group-top">
+ <strong><?php _e('Thumbnail Settings'); ?></strong>
+ <a class="imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" href="#"><?php _e('(help)'); ?></a>
+ <p class="imgedit-help"><?php _e('The thumbnail image can be cropped differently. For example it can be square or contain only a portion of the original image to showcase it better. Here you can select whether to apply changes to all image sizes or make the thumbnail different.'); ?></p>
+ </div>
+
+ <p>
+ <img src="<?php echo $thumb['url']; ?>" width="<?php echo $thumb_img[0]; ?>" height="<?php echo $thumb_img[1]; ?>" class="imgedit-size-preview" alt="" /><br /><?php _e('Current thumbnail'); ?>
+ </p>
+
+ <p id="imgedit-save-target-<?php echo $post_id; ?>">
+ <strong><?php _e('Apply changes to:'); ?></strong><br />
+
+ <label class="imgedit-label">
+ <input type="radio" name="imgedit-target-<?php echo $post_id; ?>" value="all" checked="checked" />
+ <?php _e('All image sizes'); ?></label>
+
+ <label class="imgedit-label">
+ <input type="radio" name="imgedit-target-<?php echo $post_id; ?>" value="thumbnail" />
+ <?php _e('Thumbnail'); ?></label>
+
+ <label class="imgedit-label">
+ <input type="radio" name="imgedit-target-<?php echo $post_id; ?>" value="nothumb" />
+ <?php _e('All sizes except thumbnail'); ?></label>
+ </p>
+ </div>
+
+ <?php } ?>
+
+ </td></tr>
+ </tbody></table>
+ <div class="imgedit-wait" id="imgedit-wait-<?php echo $post_id; ?>"></div>
+ <script type="text/javascript">imageEdit.init(<?php echo $post_id; ?>);</script>
+ <div class="hidden" id="imgedit-leaving-<?php echo $post_id; ?>"><?php _e("There are unsaved changes that will be lost. 'OK' to continue, 'Cancel' to return to the Image Editor."); ?></div>
+ </div>
+<?php
+}
+
+function load_image_to_edit($post_id, $mime_type, $size = 'full') {
+ $filepath = get_attached_file($post_id);
+
+ if ( $filepath && file_exists($filepath) ) {
+ if ( 'full' != $size && ( $data = image_get_intermediate_size($post_id, $size) ) )
+ $filepath = path_join( dirname($filepath), $data['file'] );
+ } elseif ( WP_Http_Fopen::test() ) {
+ $filepath = wp_get_attachment_url($post_id);
+ }
+
+ $filepath = apply_filters('load_image_to_edit_path', $filepath, $post_id, $size);
+ if ( empty($filepath) )
+ return false;
+
+ switch ( $mime_type ) {
+ case 'image/jpeg':
+ $image = imagecreatefromjpeg($filepath);
+ break;
+ case 'image/png':
+ $image = imagecreatefrompng($filepath);
+ break;
+ case 'image/gif':
+ $image = imagecreatefromgif($filepath);
+ break;
+ default:
+ $image = false;
+ break;
+ }
+ if ( is_resource($image) ) {
+ $image = apply_filters('load_image_to_edit', $image, $post_id, $size);
+ if ( function_exists('imagealphablending') && function_exists('imagesavealpha') ) {
+ imagealphablending($image, false);
+ imagesavealpha($image, true);
+ }
+ }
+ return $image;
+}
+
+function wp_stream_image($image, $mime_type, $post_id) {
+ $image = apply_filters('image_save_pre', $image, $post_id);
+
+ switch ( $mime_type ) {
+ case 'image/jpeg':
+ header('Content-Type: image/jpeg');
+ return imagejpeg($image, null, 90);
+ case 'image/png':
+ header('Content-Type: image/png');
+ return imagepng($image);
+ case 'image/gif':
+ header('Content-Type: image/gif');
+ return imagegif($image);
+ default:
+ return false;
+ }
+}
+
+function wp_save_image_file($filename, $image, $mime_type, $post_id) {
+ $image = apply_filters('image_save_pre', $image, $post_id);
+ $saved = apply_filters('wp_save_image_file', null, $filename, $image, $mime_type, $post_id);
+ if ( null !== $saved )
+ return $saved;
+
+ switch ( $mime_type ) {
+ case 'image/jpeg':
+ return imagejpeg( $image, $filename, apply_filters( 'jpeg_quality', 90, 'edit_image' ) );
+ case 'image/png':
+ return imagepng($image, $filename);
+ case 'image/gif':
+ return imagegif($image, $filename);
+ default:
+ return false;
+ }
+}
+
+function _image_get_preview_ratio($w, $h) {
+ $max = max($w, $h);
+ return $max > 400 ? (400 / $max) : 1;
+}
+
+function _rotate_image_resource($img, $angle) {
+ if ( function_exists('imagerotate') ) {
+ $rotated = imagerotate($img, $angle, 0);
+ if ( is_resource($rotated) ) {
+ imagedestroy($img);
+ $img = $rotated;
+ }
+ }
+ return $img;
+}
+
+
+function _flip_image_resource($img, $horz, $vert) {
+ $w = imagesx($img);
+ $h = imagesy($img);
+ $dst = wp_imagecreatetruecolor($w, $h);
+ if ( is_resource($dst) ) {
+ $sx = $vert ? ($w - 1) : 0;
+ $sy = $horz ? ($h - 1) : 0;
+ $sw = $vert ? -$w : $w;
+ $sh = $horz ? -$h : $h;
+
+ if ( imagecopyresampled($dst, $img, 0, 0, $sx, $sy, $w, $h, $sw, $sh) ) {
+ imagedestroy($img);
+ $img = $dst;
+ }
+ }
+ return $img;
+}
+
+function _crop_image_resource($img, $x, $y, $w, $h) {
+ $dst = wp_imagecreatetruecolor($w, $h);
+ if ( is_resource($dst) ) {
+ if ( imagecopy($dst, $img, 0, 0, $x, $y, $w, $h) ) {
+ imagedestroy($img);
+ $img = $dst;
+ }
+ }
+ return $img;
+}
+
+function image_edit_apply_changes($img, $changes) {
+
+ if ( !is_array($changes) )
+ return $img;
+
+ // expand change operations
+ foreach ( $changes as $key => $obj ) {
+ if ( isset($obj->r) ) {
+ $obj->type = 'rotate';
+ $obj->angle = $obj->r;
+ unset($obj->r);
+ } elseif ( isset($obj->f) ) {
+ $obj->type = 'flip';
+ $obj->axis = $obj->f;
+ unset($obj->f);
+ } elseif ( isset($obj->c) ) {
+ $obj->type = 'crop';
+ $obj->sel = $obj->c;
+ unset($obj->c);
+ }
+ $changes[$key] = $obj;
+ }
+
+ // combine operations
+ if ( count($changes) > 1 ) {
+ $filtered = array($changes[0]);
+ for ( $i = 0, $j = 1; $j < count($changes); $j++ ) {
+ $combined = false;
+ if ( $filtered[$i]->type == $changes[$j]->type ) {
+ switch ( $filtered[$i]->type ) {
+ case 'rotate':
+ $filtered[$i]->angle += $changes[$j]->angle;
+ $combined = true;
+ break;
+ case 'flip':
+ $filtered[$i]->axis ^= $changes[$j]->axis;
+ $combined = true;
+ break;
+ }
+ }
+ if ( !$combined )
+ $filtered[++$i] = $changes[$j];
+ }
+ $changes = $filtered;
+ unset($filtered);
+ }
+
+ // image resource before applying the changes
+ $img = apply_filters('image_edit_before_change', $img, $changes);
+
+ foreach ( $changes as $operation ) {
+ switch ( $operation->type ) {
+ case 'rotate':
+ if ( $operation->angle != 0 )
+ $img = _rotate_image_resource($img, $operation->angle);
+ break;
+ case 'flip':
+ if ( $operation->axis != 0 )
+ $img = _flip_image_resource($img, ($operation->axis & 1) != 0, ($operation->axis & 2) != 0);
+ break;
+ case 'crop':
+ $sel = $operation->sel;
+ $scale = 1 / _image_get_preview_ratio( imagesx($img), imagesy($img) ); // discard preview scaling
+ $img = _crop_image_resource($img, $sel->x * $scale, $sel->y * $scale, $sel->w * $scale, $sel->h * $scale);
+ break;
+ }
+ }
+
+ return $img;
+}
+
+function stream_preview_image($post_id) {
+ $post = get_post($post_id);
+ @ini_set('memory_limit', '256M');
+ $img = load_image_to_edit( $post_id, $post->post_mime_type, array(400, 400) );
+
+ if ( !is_resource($img) )
+ return false;
+
+ $changes = !empty($_REQUEST['history']) ? json_decode( stripslashes($_REQUEST['history']) ) : null;
+ if ( $changes )
+ $img = image_edit_apply_changes($img, $changes);
+
+ // scale the image
+ $w = imagesx($img);
+ $h = imagesy($img);
+ $ratio = _image_get_preview_ratio($w, $h);
+ $w2 = $w * $ratio;
+ $h2 = $h * $ratio;
+
+ $preview = wp_imagecreatetruecolor($w2, $h2);
+ imagecopyresampled( $preview, $img, 0, 0, 0, 0, $w2, $h2, $w, $h );
+ wp_stream_image($preview, $post->post_mime_type, $post_id);
+
+ imagedestroy($preview);
+ imagedestroy($img);
+ return true;
+}
+
+function wp_restore_image($post_id) {
+ $meta = wp_get_attachment_metadata($post_id);
+ $file = get_attached_file($post_id);
+ $backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
+ $restored = false;
+ $msg = '';
+
+ if ( !is_array($backup_sizes) ) {
+ $msg->error = __('Cannot load image metadata.');
+ return $msg;
+ }
+
+ $parts = pathinfo($file);
+ $suffix = time() . rand(100, 999);
+ $default_sizes = apply_filters( 'intermediate_image_sizes', array('large', 'medium', 'thumbnail') );
+
+ if ( isset($backup_sizes['full-orig']) && is_array($backup_sizes['full-orig']) ) {
+ $data = $backup_sizes['full-orig'];
+
+ if ( $parts['basename'] != $data['file'] ) {
+ if ( defined('IMAGE_EDIT_OVERWRITE') && IMAGE_EDIT_OVERWRITE ) {
+ // delete only if it's edited image
+ if ( preg_match('/-e[0-9]{13}\./', $parts['basename']) ) {
+ $delpath = apply_filters('wp_delete_file', $file);
+ @unlink($delpath);
+ }
+ } else {
+ $backup_sizes["full-$suffix"] = array('width' => $meta['width'], 'height' => $meta['height'], 'file' => $parts['basename']);
+ }
+ }
+
+ $restored_file = path_join($parts['dirname'], $data['file']);
+ $restored = update_attached_file($post_id, $restored_file);
+
+ $meta['file'] = _wp_relative_upload_path( $restored_file );
+ $meta['width'] = $data['width'];
+ $meta['height'] = $data['height'];
+ list ( $uwidth, $uheight ) = wp_shrink_dimensions($meta['width'], $meta['height']);
+ $meta['hwstring_small'] = "height='$uheight' width='$uwidth'";
+ }
+
+ foreach ( $default_sizes as $default_size ) {
+ if ( isset($backup_sizes["$default_size-orig"]) ) {
+ $data = $backup_sizes["$default_size-orig"];
+ if ( isset($meta['sizes'][$default_size]) && $meta['sizes'][$default_size]['file'] != $data['file'] ) {
+ if ( defined('IMAGE_EDIT_OVERWRITE') && IMAGE_EDIT_OVERWRITE ) {
+ // delete only if it's edited image
+ if ( preg_match('/-e[0-9]{13}-/', $meta['sizes'][$default_size]['file']) ) {
+ $delpath = apply_filters( 'wp_delete_file', path_join($parts['dirname'], $meta['sizes'][$default_size]['file']) );
+ @unlink($delpath);
+ }
+ } else {
+ $backup_sizes["$default_size-{$suffix}"] = $meta['sizes'][$default_size];
+ }
+ }
+
+ $meta['sizes'][$default_size] = $data;
+ } else {
+ unset($meta['sizes'][$default_size]);
+ }
+ }
+
+ if ( !wp_update_attachment_metadata($post_id, $meta) || !update_post_meta( $post_id, '_wp_attachment_backup_sizes', $backup_sizes) ) {
+ $msg->error = __('Cannot save image metadata.');
+ return $msg;
+ }
+
+ if ( !$restored )
+ $msg->error = __('Image metadata is inconsistent.');
+ else
+ $msg->msg = __('Image restored successfully.');
+
+ return $msg;
+}
+
+function wp_save_image($post_id) {
+ $return = '';
+ $success = $delete = $scaled = $nocrop = false;
+ $post = get_post($post_id);
+ @ini_set('memory_limit', '256M');
+ $img = load_image_to_edit($post_id, $post->post_mime_type);
+
+ if ( !is_resource($img) ) {
+ $return->error = esc_js( __('Unable to create new image.') );
+ return $return;
+ }
+
+ $fwidth = !empty($_REQUEST['fwidth']) ? intval($_REQUEST['fwidth']) : 0;
+ $fheight = !empty($_REQUEST['fheight']) ? intval($_REQUEST['fheight']) : 0;
+ $target = !empty($_REQUEST['target']) ? preg_replace('/[^a-z0-9_-]+/i', '', $_REQUEST['target']) : '';
+ $scale = !empty($_REQUEST['do']) && 'scale' == $_REQUEST['do'];
+
+ if ( $scale && $fwidth > 0 && $fheight > 0 ) {
+ $sX = imagesx($img);
+ $sY = imagesy($img);
+
+ // check if it has roughly the same w / h ratio
+ $diff = round($sX / $sY, 2) - round($fwidth / $fheight, 2);
+ if ( -0.1 < $diff && $diff < 0.1 ) {
+ // scale the full size image
+ $dst = wp_imagecreatetruecolor($fwidth, $fheight);
+ if ( imagecopyresampled( $dst, $img, 0, 0, 0, 0, $fwidth, $fheight, $sX, $sY ) ) {
+ imagedestroy($img);
+ $img = $dst;
+ $scaled = true;
+ }
+ }
+
+ if ( !$scaled ) {
+ $return->error = esc_js( __('Error while saving the scaled image. Please reload the page and try again.') );
+ return $return;
+ }
+ } elseif ( !empty($_REQUEST['history']) ) {
+ $changes = json_decode( stripslashes($_REQUEST['history']) );
+ if ( $changes )
+ $img = image_edit_apply_changes($img, $changes);
+ } else {
+ $return->error = esc_js( __('Nothing to save, the image has not changed.') );
+ return $return;
+ }
+
+ $meta = wp_get_attachment_metadata($post_id);
+ $backup_sizes = get_post_meta( $post->ID, '_wp_attachment_backup_sizes', true );
+
+ if ( !is_array($meta) ) {
+ $return->error = esc_js( __('Image data does not exist. Please re-upload the image.') );
+ return $return;
+ }
+
+ if ( !is_array($backup_sizes) )
+ $backup_sizes = array();
+
+ // generate new filename
+ $path = get_attached_file($post_id);
+ $path_parts = pathinfo52( $path );
+ $filename = $path_parts['filename'];
+ $suffix = time() . rand(100, 999);
+
+ if ( defined('IMAGE_EDIT_OVERWRITE') && IMAGE_EDIT_OVERWRITE &&
+ isset($backup_sizes['full-orig']) && $backup_sizes['full-orig']['file'] != $path_parts['basename'] ) {
+
+ if ( 'thumbnail' == $target )
+ $new_path = "{$path_parts['dirname']}/{$filename}-temp.{$path_parts['extension']}";
+ else
+ $new_path = $path;
+ } else {
+ while( true ) {
+ $filename = preg_replace( '/-e([0-9]+)$/', '', $filename );
+ $filename .= "-e{$suffix}";
+ $new_filename = "{$filename}.{$path_parts['extension']}";
+ $new_path = "{$path_parts['dirname']}/$new_filename";
+ if ( file_exists($new_path) )
+ $suffix++;
+ else
+ break;
+ }
+ }
+
+ // save the full-size file, also needed to create sub-sizes
+ if ( !wp_save_image_file($new_path, $img, $post->post_mime_type, $post_id) ) {
+ $return->error = esc_js( __('Unable to save the image.') );
+ return $return;
+ }
+
+ if ( 'nothumb' == $target || 'all' == $target || 'full' == $target || $scaled ) {
+ $tag = false;
+ if ( isset($backup_sizes['full-orig']) ) {
+ if ( ( !defined('IMAGE_EDIT_OVERWRITE') || !IMAGE_EDIT_OVERWRITE ) && $backup_sizes['full-orig']['file'] != $path_parts['basename'] )
+ $tag = "full-$suffix";
+ } else {
+ $tag = 'full-orig';
+ }
+
+ if ( $tag )
+ $backup_sizes[$tag] = array('width' => $meta['width'], 'height' => $meta['height'], 'file' => $path_parts['basename']);
+
+ $success = update_attached_file($post_id, $new_path);
+
+ $meta['file'] = _wp_relative_upload_path($new_path);
+ $meta['width'] = imagesx($img);
+ $meta['height'] = imagesy($img);
+
+ list ( $uwidth, $uheight ) = wp_shrink_dimensions($meta['width'], $meta['height']);
+ $meta['hwstring_small'] = "height='$uheight' width='$uwidth'";
+
+ if ( $success && ('nothumb' == $target || 'all' == $target) ) {
+ $sizes = apply_filters( 'intermediate_image_sizes', array('large', 'medium', 'thumbnail') );
+ if ( 'nothumb' == $target )
+ $sizes = array_diff( $sizes, array('thumbnail') );
+ }
+
+ $return->fw = $meta['width'];
+ $return->fh = $meta['height'];
+ } elseif ( 'thumbnail' == $target ) {
+ $sizes = array( 'thumbnail' );
+ $success = $delete = $nocrop = true;
+ }
+
+ if ( isset($sizes) ) {
+ foreach ( $sizes as $size ) {
+ $tag = false;
+ if ( isset($meta['sizes'][$size]) ) {
+ if ( isset($backup_sizes["$size-orig"]) ) {
+ if ( ( !defined('IMAGE_EDIT_OVERWRITE') || !IMAGE_EDIT_OVERWRITE ) && $backup_sizes["$size-orig"]['file'] != $meta['sizes'][$size]['file'] )
+ $tag = "$size-$suffix";
+ } else {
+ $tag = "$size-orig";
+ }
+
+ if ( $tag )
+ $backup_sizes[$tag] = $meta['sizes'][$size];
+ }
+
+ $crop = $nocrop ? false : get_option("{$size}_crop");
+ $resized = image_make_intermediate_size($new_path, get_option("{$size}_size_w"), get_option("{$size}_size_h"), $crop );
+
+ if ( $resized )
+ $meta['sizes'][$size] = $resized;
+ else
+ unset($meta['sizes'][$size]);
+ }
+ }
+
+ if ( $success ) {
+ wp_update_attachment_metadata($post_id, $meta);
+ update_post_meta( $post_id, '_wp_attachment_backup_sizes', $backup_sizes);
+
+ if ( $target == 'thumbnail' || $target == 'all' || $target == 'full' ) {
+ $file_url = wp_get_attachment_url($post_id);
+ if ( $thumb = $meta['sizes']['thumbnail'] )
+ $return->thumbnail = path_join( dirname($file_url), $thumb['file'] );
+ else
+ $return->thumbnail = "$file_url?w=128&h=128";
+ }
+ } else {
+ $delete = true;
+ }
+
+ if ( $delete ) {
+ $delpath = apply_filters('wp_delete_file', $new_path);
+ @unlink($delpath);
+ }
+
+ imagedestroy($img);
+
+ $return->msg = esc_js( __('Image saved') );
+ return $return;
+}
+
if ( !is_resource( $src ))
return $src;
- $dst = imagecreatetruecolor( $dst_w, $dst_h );
+ $dst = wp_imagecreatetruecolor( $dst_w, $dst_h );
if ( $src_abs ) {
$src_w -= $src_x;
}
/**
- * Generate post image attachment meta data.
+ * Generate post thumbnail attachment meta data.
*
* @since 2.1.0
*
$metadata = array();
if ( preg_match('!^image/!', get_post_mime_type( $attachment )) && file_is_displayable_image($file) ) {
- $full_path_file = $file;
- $imagesize = getimagesize( $full_path_file );
+ $imagesize = getimagesize( $file );
$metadata['width'] = $imagesize[0];
$metadata['height'] = $imagesize[1];
list($uwidth, $uheight) = wp_shrink_dimensions($metadata['width'], $metadata['height']);
$metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
// Make the file path relative to the upload dir
- if ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) { // Get upload directory
- if ( 0 === strpos($file, $uploads['basedir']) ) {// Check that the upload base exists in the file path
- $file = str_replace($uploads['basedir'], '', $file); // Remove upload dir from the file path
- $file = ltrim($file, '/');
- }
- }
- $metadata['file'] = $file;
+ $metadata['file'] = _wp_relative_upload_path($file);
// make thumbnails and other intermediate sizes
- $sizes = array('thumbnail', 'medium', 'large');
- $sizes = apply_filters('intermediate_image_sizes', $sizes);
+ global $_wp_additional_image_sizes;
+ $temp_sizes = array('thumbnail', 'medium', 'large'); // Standard sizes
+ if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) )
+ $temp_sizes = array_merge( $temp_sizes, array_keys( $_wp_additional_image_sizes ) );
+
+ $temp_sizes = apply_filters( 'intermediate_image_sizes', $temp_sizes );
+
+ foreach ( $temp_sizes as $s ) {
+ $sizes[$s] = array( 'width' => '', 'height' => '', 'crop' => FALSE );
+ if ( isset( $_wp_additional_image_sizes[$s]['width'] ) )
+ $sizes[$s]['width'] = intval( $_wp_additional_image_sizes[$s]['width'] ); // For theme-added sizes
+ else
+ $sizes[$s]['width'] = get_option( "{$s}_size_w" ); // For default sizes set in options
+ if ( isset( $_wp_additional_image_sizes[$s]['height'] ) )
+ $sizes[$s]['height'] = intval( $_wp_additional_image_sizes[$s]['height'] ); // For theme-added sizes
+ else
+ $sizes[$s]['height'] = get_option( "{$s}_size_h" ); // For default sizes set in options
+ if ( isset( $_wp_additional_image_sizes[$s]['crop'] ) )
+ $sizes[$s]['crop'] = intval( $_wp_additional_image_sizes[$s]['crop'] ); // For theme-added sizes
+ else
+ $sizes[$s]['crop'] = get_option( "{$s}_crop" ); // For default sizes set in options
+ }
- foreach ($sizes as $size) {
- $resized = image_make_intermediate_size( $full_path_file, get_option("{$size}_size_w"), get_option("{$size}_size_h"), get_option("{$size}_crop") );
+ $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );
+
+ foreach ($sizes as $size => $size_data ) {
+ $resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
if ( $resized )
$metadata['sizes'][$size] = $resized;
}
// fetch additional metadata from exif/iptc
- $image_meta = wp_read_image_metadata( $full_path_file );
- if ($image_meta)
+ $image_meta = wp_read_image_metadata( $file );
+ if ( $image_meta )
$metadata['image_meta'] = $image_meta;
}
- return apply_filters( 'wp_generate_attachment_metadata', $metadata );
+ return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
}
/**
return apply_filters('file_is_displayable_image', $result, $path);
}
-
-?>
* @return array
*/
function wp_import_handle_upload() {
+ if ( !isset($_FILES['import']) ) {
+ $file['error'] = __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' );
+ return $file;
+ }
+
$overrides = array( 'test_form' => false, 'test_type' => false );
$_FILES['import']['name'] .= '.txt';
$file = wp_handle_upload( $_FILES['import'], $overrides );
return $tabs;
}
- if ( intval($_REQUEST['post_id']) )
- $attachments = intval($wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent = %d", $_REQUEST['post_id'])));
+ $post_id = intval($_REQUEST['post_id']);
+
+ if ( $post_id )
+ $attachments = intval( $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent = %d", $post_id ) ) );
if ( empty($attachments) ) {
unset($tabs['gallery']);
* @param unknown_type $size
* @return unknown
*/
-function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = false, $size='medium') {
-
- $htmlalt = ( empty($alt) ) ? $title : $alt;
+function get_image_send_to_editor($id, $caption, $title, $align, $url='', $rel = false, $size='medium', $alt = '') {
- $html = get_image_tag($id, $htmlalt, $title, $align, $size);
+ $html = get_image_tag($id, $alt, $title, $align, $size);
$rel = $rel ? ' rel="attachment wp-att-' . esc_attr($id).'"' : '';
if ( $url )
- $html = '<a href="' . esc_url($url) . "\"$rel>$html</a>";
+ $html = '<a href="' . esc_attr($url) . "\"$rel>$html</a>";
- $html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size );
+ $html = apply_filters( 'image_send_to_editor', $html, $id, $caption, $title, $align, $url, $size, $alt );
return $html;
}
* @param unknown_type $size
* @return unknown
*/
-function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) {
+function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $alt = '' ) {
- if ( empty($alt) || apply_filters( 'disable_captions', '' ) )
+ if ( empty($caption) || apply_filters( 'disable_captions', '' ) )
return $html;
$id = ( 0 < (int) $id ) ? 'attachment_' . $id : '';
- preg_match( '/width="([0-9]+)/', $html, $matches );
- if ( ! isset($matches[1]) )
+ if ( ! preg_match( '/width="([0-9]+)/', $html, $matches ) )
return $html;
$width = $matches[1];
if ( empty($align) )
$align = 'none';
- $alt = ! empty($alt) ? addslashes($alt) : '';
-
$shcode = '[caption id="' . $id . '" align="align' . $align
- . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/caption]';
+ . '" width="' . $width . '" caption="' . addslashes($caption) . '"]' . $html . '[/caption]';
return apply_filters( 'image_add_caption_shortcode', $shcode, $html );
}
-add_filter( 'image_send_to_editor', 'image_add_caption', 20, 7 );
+add_filter( 'image_send_to_editor', 'image_add_caption', 20, 8 );
/**
* {@internal Missing Short Description}}
win.send_to_editor('<?php echo addslashes($html); ?>');
/* ]]> */
</script>
- <?php
+<?php
exit;
}
*/
function media_handle_sideload($file_array, $post_id, $desc = null, $post_data = array()) {
$overrides = array('test_form'=>false);
- $file = wp_handle_sideload($file_array, $overrides);
+ $file = wp_handle_sideload($file_array, $overrides);
if ( isset($file['error']) )
return new WP_Error( 'upload_error', $file['error'] );
'post_content' => $content,
), $post_data );
- // Save the data
+ // Save the attachment metadata
$id = wp_insert_attachment($attachment, $file, $post_id);
if ( !is_wp_error($id) ) {
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
<script type="text/javascript">
//<![CDATA[
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
-var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'};
+var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time(); ?>'};
+var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup';
//]]>
</script>
<?php
+do_action('admin_enqueue_scripts', 'media-upload-popup');
+do_action('admin_print_styles-media-upload-popup');
do_action('admin_print_styles');
+do_action('admin_print_scripts-media-upload-popup');
do_action('admin_print_scripts');
+do_action('admin_head-media-upload-popup');
do_action('admin_head');
+
if ( is_string($content_func) )
do_action( "admin_head_{$content_func}" );
?>
$post = apply_filters('attachment_fields_to_save', $post, $attachment);
+ if ( isset($attachment['image_alt']) && !empty($attachment['image_alt']) ) {
+ $image_alt = get_post_meta($attachment_id, '_wp_attachment_image_alt', true);
+ if ( $image_alt != stripslashes($attachment['image_alt']) ) {
+ $image_alt = wp_strip_all_tags( stripslashes($attachment['image_alt']), true );
+ // update_meta expects slashed
+ update_post_meta( $attachment_id, '_wp_attachment_image_alt', addslashes($image_alt) );
+ }
+ }
+
if ( isset($post['errors']) ) {
$errors[$attachment_id] = $post['errors'];
unset($post['errors']);
if ( $post != $_post )
wp_update_post($post);
- foreach ( get_attachment_taxonomies($post) as $t )
+ foreach ( get_attachment_taxonomies($post) as $t ) {
if ( isset($attachment[$t]) )
wp_set_object_terms($attachment_id, array_map('trim', preg_split('/,+/', $attachment[$t])), $t, false);
+ }
}
if ( isset($_POST['insert-gallery']) || isset($_POST['update-gallery']) ) { ?>
}
if ( !empty($_POST['insertonlybutton']) ) {
+ $alt = $align = '';
+
$src = $_POST['insertonly']['src'];
if ( !empty($src) && !strpos($src, '://') )
$src = "http://$src";
$class = " class='align$align'";
}
if ( !empty($src) )
- $html = "<img src='$src' alt='$alt'$class />";
- $html = apply_filters('image_send_to_editor_url', $html, $src, $alt, $align);
+ $html = "<img src='" . esc_url($src) . "' alt='$alt'$class />";
+
+ $html = apply_filters('image_send_to_editor_url', $html, esc_url_raw($src), $alt, $align);
return media_send_to_editor($html);
}
*/
function media_sideload_image($file, $post_id, $desc = null) {
if (!empty($file) ) {
- $file_array['name'] = basename($file);
+ // Download file to temp location
$tmp = download_url($file);
+
+ // Set variables for storage
+ // fix file filename for query strings
+ preg_match('/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $file, $matches);
+ $file_array['name'] = basename($matches[0]);
$file_array['tmp_name'] = $tmp;
- $desc = @$desc;
+ // If error storing temporarily, unlink
if ( is_wp_error($tmp) ) {
@unlink($file_array['tmp_name']);
$file_array['tmp_name'] = '';
}
- $id = media_handle_sideload($file_array, $post_id, $desc);
+ // do the validation and storage stuff
+ $id = media_handle_sideload($file_array, $post_id, @$desc);
$src = $id;
+ // If error storing permanently, unlink
if ( is_wp_error($id) ) {
@unlink($file_array['tmp_name']);
return $id;
}
}
+ // Finally check to make sure the file has been saved, then return the html
if ( !empty($src) ) {
$alt = @$desc;
$html = "<img src='$src' alt='$alt' />";
$href = $_POST['insertonly']['href'];
if ( !empty($href) && !strpos($href, '://') )
$href = "http://$href";
+
$title = esc_attr($_POST['insertonly']['title']);
if ( empty($title) )
- $title = basename($href);
+ $title = esc_attr( basename($href) );
+
if ( !empty($title) && !empty($href) )
- $html = "<a href='$href' >$title</a>";
+ $html = "<a href='" . esc_url($href) . "' >$title</a>";
+
$html = apply_filters('audio_send_to_editor_url', $html, $href, $title);
+
return media_send_to_editor($html);
}
$href = $_POST['insertonly']['href'];
if ( !empty($href) && !strpos($href, '://') )
$href = "http://$href";
+
$title = esc_attr($_POST['insertonly']['title']);
- if ( empty($title) )
- $title = basename($href);
+ if ( empty($title) )
+ $title = esc_attr( basename($href) );
+
if ( !empty($title) && !empty($href) )
- $html = "<a href='$href' >$title</a>";
+ $html = "<a href='" . esc_url($href) . "' >$title</a>";
+
$html = apply_filters('video_send_to_editor_url', $html, $href, $title);
+
return media_send_to_editor($html);
}
$href = $_POST['insertonly']['href'];
if ( !empty($href) && !strpos($href, '://') )
$href = "http://$href";
+
$title = esc_attr($_POST['insertonly']['title']);
if ( empty($title) )
$title = basename($href);
if ( !empty($title) && !empty($href) )
- $html = "<a href='$href' >$title</a>";
- $html = apply_filters('file_send_to_editor_url', $html, $href, $title);
+ $html = "<a href='" . esc_url($href) . "' >$title</a>";
+ $html = apply_filters('file_send_to_editor_url', $html, esc_url_raw($href), $title);
return media_send_to_editor($html);
}
*/
function image_align_input_fields( $post, $checked = '' ) {
+ if ( empty($checked) )
+ $checked = get_user_setting('align', 'none');
+
$alignments = array('none' => __('None'), 'left' => __('Left'), 'center' => __('Center'), 'right' => __('Right'));
if ( !array_key_exists( (string) $checked, $alignments ) )
$checked = 'none';
$out = array();
- foreach ($alignments as $name => $label) {
+ foreach ( $alignments as $name => $label ) {
$name = esc_attr($name);
$out[] = "<input type='radio' name='attachments[{$post->ID}][align]' id='image-align-{$name}-{$post->ID}' value='$name'".
( $checked == $name ? " checked='checked'" : "" ) .
- " /><label for='image-align-{$name}-{$post->ID}' class='align image-align-{$name}-label'>" . $label . "</label>";
+ " /><label for='image-align-{$name}-{$post->ID}' class='align image-align-{$name}-label'>$label</label>";
}
return join("\n", $out);
}
* @param unknown_type $checked
* @return unknown
*/
-function image_size_input_fields( $post, $checked = '' ) {
+function image_size_input_fields( $post, $check = '' ) {
// get a list of the actual pixel dimensions of each possible intermediate version of this image
$size_names = array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full size'));
- foreach ( $size_names as $size => $name ) {
+ if ( empty($check) )
+ $check = get_user_setting('imgsize', 'medium');
+
+ foreach ( $size_names as $size => $label ) {
$downsize = image_downsize($post->ID, $size);
+ $checked = '';
// is this size selectable?
$enabled = ( $downsize[3] || 'full' == $size );
$css_id = "image-size-{$size}-{$post->ID}";
// if this size is the default but that's not available, don't select it
- if ( $checked && !$enabled )
- $checked = '';
- // if $checked was not specified, default to the first available size that's bigger than a thumbnail
- if ( !$checked && $enabled && 'thumbnail' != $size )
- $checked = $size;
-
- $html = "<div class='image-size-item'><input type='radio' ".( $enabled ? '' : "disabled='disabled'")."name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}'".( $checked == $size ? " checked='checked'" : '') ." />";
-
- $html .= "<label for='{$css_id}'>" . __($name). "</label>";
+ if ( $size == $check ) {
+ if ( $enabled )
+ $checked = " checked='checked'";
+ else
+ $check = '';
+ } elseif ( !$check && $enabled && 'thumbnail' != $size ) {
+ // if $check is not enabled, default to the first available size that's bigger than a thumbnail
+ $check = $size;
+ $checked = " checked='checked'";
+ }
+
+ $html = "<div class='image-size-item'><input type='radio' " . ( $enabled ? '' : "disabled='disabled' " ) . "name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}'$checked />";
+
+ $html .= "<label for='{$css_id}'>$label</label>";
// only show the dimensions if that choice is available
if ( $enabled )
$html .= " <label for='{$css_id}' class='help'>" . sprintf( __("(%d × %d)"), $downsize[1], $downsize[2] ). "</label>";
* @param unknown_type $url_type
* @return unknown
*/
-function image_link_input_fields($post, $url_type='') {
+function image_link_input_fields($post, $url_type = '') {
$file = wp_get_attachment_url($post->ID);
$link = get_attachment_link($post->ID);
+ if ( empty($url_type) )
+ $url_type = get_user_setting('urlbutton', 'post');
+
$url = '';
if ( $url_type == 'file' )
$url = $file;
elseif ( $url_type == 'post' )
$url = $link;
- return "<input type='text' class='urlfield' name='attachments[$post->ID][url]' value='" . esc_attr($url) . "' /><br />
- <button type='button' class='button urlnone' title=''>" . __('None') . "</button>
- <button type='button' class='button urlfile' title='" . esc_attr($file) . "'>" . __('File URL') . "</button>
- <button type='button' class='button urlpost' title='" . esc_attr($link) . "'>" . __('Post URL') . "</button>
+ return "
+ <input type='text' class='text urlfield' name='attachments[$post->ID][url]' value='" . esc_attr($url) . "' /><br />
+ <button type='button' class='button urlnone' title=''>" . __('None') . "</button>
+ <button type='button' class='button urlfile' title='" . esc_attr($file) . "'>" . __('File URL') . "</button>
+ <button type='button' class='button urlpost' title='" . esc_attr($link) . "'>" . __('Post URL') . "</button>
";
}
*/
function image_attachment_fields_to_edit($form_fields, $post) {
if ( substr($post->post_mime_type, 0, 5) == 'image' ) {
- $form_fields['post_title']['required'] = true;
- $file = wp_get_attachment_url($post->ID);
-
- $form_fields['image_url']['value'] = $file;
+ $alt = get_post_meta($post->ID, '_wp_attachment_image_alt', true);
+ if ( empty($alt) )
+ $alt = '';
- $form_fields['post_excerpt']['label'] = __('Caption');
- $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image');
+ $form_fields['post_title']['required'] = true;
- $form_fields['post_content']['label'] = __('Description');
+ $form_fields['image_alt'] = array(
+ 'value' => $alt,
+ 'label' => __('Alternate text'),
+ 'helps' => __('Alt text for the image, e.g. “The Mona Lisa”')
+ );
$form_fields['align'] = array(
'label' => __('Alignment'),
'html' => image_align_input_fields($post, get_option('image_default_align')),
);
- $form_fields['image-size'] = image_size_input_fields($post, get_option('image_default_size'));
+ $form_fields['image-size'] = image_size_input_fields( $post, get_option('image_default_size', 'medium') );
+
+ } else {
+ unset( $form_fields['image_alt'] );
}
return $form_fields;
}
$post =& get_post($attachment_id);
if ( substr($post->post_mime_type, 0, 5) == 'image' ) {
$url = $attachment['url'];
-
- if ( isset($attachment['align']) )
- $align = $attachment['align'];
- else
- $align = 'none';
-
- if ( !empty($attachment['image-size']) )
- $size = $attachment['image-size'];
- else
- $size = 'medium';
-
+ $align = !empty($attachment['align']) ? $attachment['align'] : 'none';
+ $size = !empty($attachment['image-size']) ? $attachment['image-size'] : 'medium';
+ $alt = !empty($attachment['image_alt']) ? $attachment['image_alt'] : '';
$rel = ( $url == get_attachment_link($attachment_id) );
- return get_image_send_to_editor($attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size);
+ return get_image_send_to_editor($attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size, $alt);
}
return $html;
$form_fields = array(
'post_title' => array(
'label' => __('Title'),
- 'value' => $edit_post->post_title,
+ 'value' => $edit_post->post_title
),
+ 'image_alt' => array(),
'post_excerpt' => array(
'label' => __('Caption'),
- 'value' => $edit_post->post_excerpt,
+ 'value' => $edit_post->post_excerpt
),
'post_content' => array(
'label' => __('Description'),
'value' => $edit_post->post_content,
- 'input' => 'textarea',
+ 'input' => 'textarea'
),
'url' => array(
'label' => __('Link URL'),
'input' => 'html',
'html' => image_link_input_fields($post, get_option('image_default_link_type')),
- 'helps' => __('Enter a link URL or click above for presets.'),
+ 'helps' => __('Enter a link URL or click above for presets.')
),
'menu_order' => array(
'label' => __('Order'),
'image_url' => array(
'label' => __('File URL'),
'input' => 'html',
- 'html' => "<input type='text' class='urlfield' readonly='readonly' name='attachments[$post->ID][url]' value='" . esc_attr($image_url) . "' /><br />",
- 'value' => isset($edit_post->post_url) ? $edit_post->post_url : '',
- 'helps' => __('Location of the uploaded file.'),
+ 'html' => "<input type='text' class='text urlfield' readonly='readonly' name='attachments[$post->ID][url]' value='" . esc_attr($image_url) . "' /><br />",
+ 'value' => wp_get_attachment_url($post->ID),
+ 'helps' => __('Location of the uploaded file.')
)
);
}
$output = '';
- foreach ( (array) $attachments as $id => $attachment )
+ foreach ( (array) $attachments as $id => $attachment ) {
+ if ( $attachment->post_status == 'trash' )
+ continue;
if ( $item = get_media_item( $id, array( 'errors' => isset($errors[$id]) ? $errors[$id] : null) ) )
$output .= "\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div class='progress'><div class='bar'></div></div><div id='media-upload-error-$id'></div><div class='filename'></div>$item\n</div>";
+ }
return $output;
}
function get_media_item( $attachment_id, $args = null ) {
global $redir_tab;
- $default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true, 'show_title' => true );
- $args = wp_parse_args( $args, $default_args );
- extract( $args, EXTR_SKIP );
-
- global $post_mime_types;
if ( ( $attachment_id = intval($attachment_id) ) && $thumb_url = get_attachment_icon_src( $attachment_id ) )
$thumb_url = $thumb_url[0];
else
return false;
+ $default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true, 'show_title' => true );
+ $args = wp_parse_args( $args, $default_args );
+ extract( $args, EXTR_SKIP );
+
$toggle_on = __('Show');
$toggle_off = __('Hide');
$tags = esc_attr(join(', ', $tags));
}
- $type = '';
- if ( isset($post_mime_types) ) {
- $keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type));
- $type = array_shift($keys);
- $type = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />";
- }
+ $post_mime_types = get_post_mime_types();
+ $keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type));
+ $type = array_shift($keys);
+ $type_html = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />";
$form_fields = get_attachment_fields_to_edit($post, $errors);
}
$display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case
- $display_title = $show_title ? "<div class='filename new'>" . wp_html_excerpt($display_title, 60) . "</div>" : '';
+ $display_title = $show_title ? "<div class='filename new'><span class='title'>" . wp_html_excerpt($display_title, 60) . "</span></div>" : '';
$gallery = ( (isset($_REQUEST['tab']) && 'gallery' == $_REQUEST['tab']) || (isset($redir_tab) && 'gallery' == $redir_tab) ) ? true : false;
$order = '';
}
}
+ $media_dims = '';
+ $meta = wp_get_attachment_metadata($post->ID);
+ if ( is_array($meta) && array_key_exists('width', $meta) && array_key_exists('height', $meta) )
+ $media_dims .= "<span id='media-dims-{$post->ID}'>{$meta['width']} × {$meta['height']}</span> ";
+ $media_dims = apply_filters('media_meta', $media_dims, $post);
+
+ $image_edit_button = '';
+ if ( gd_edit_image_support($post->post_mime_type) ) {
+ $nonce = wp_create_nonce("image_editor-$post->ID");
+ $image_edit_button = "<input type='button' id='imgedit-open-btn-{$post->ID}' onclick='imageEdit.open($post->ID, \"$nonce\")' class='button' value='" . esc_attr__( 'Edit image' ) . "' /> <img src='images/wpspin_light.gif' class='imgedit-wait-spin' alt='' />";
+ }
+
$item = "
- $type
+ $type_html
$toggle_links
$order
$display_title
<table class='slidetoggle describe $class'>
- <thead class='media-item-info'>
+ <thead class='media-item-info' id='media-head-$post->ID'>
<tr>
- <td class='A1B1' rowspan='4'><img class='thumbnail' src='$thumb_url' alt='' /></td>
- <td>$filename</td>
+ <td class='A1B1' id='thumbnail-head-$post->ID' rowspan='5'><img class='thumbnail' src='$thumb_url' alt='' /></td>
+ <td><strong>" . __('File name:') . "</strong> $filename</td>
</tr>
- <tr><td>$post->post_mime_type</td></tr>
- <tr><td>" . mysql2date($post->post_date, get_option('time_format')) . "</td></tr>
- <tr><td>" . apply_filters('media_meta', '', $post) . "</td></tr>
+ <tr><td><strong>" . __('File type:') . "</strong> $post->post_mime_type</td></tr>
+ <tr><td><strong>" . __('Upload date:') . "</strong> " . mysql2date( get_option('date_format'), $post->post_date ) . "</td></tr>\n";
+
+ if ( !empty($media_dims) )
+ $item .= "<tr><td><strong>" . __('Dimensions:') . "</strong> $media_dims</td></tr>\n";
+
+ $item .= "
+ <tr><td class='A1B1'>$image_edit_button</td></tr>
</thead>
- <tbody>\n";
+ <tbody>
+ <tr><td colspan='2' class='imgedit-response' id='imgedit-response-$post->ID'></td></tr>
+ <tr><td style='display:none' colspan='2' class='image-editor' id='image-editor-$post->ID'></td></tr>\n";
$defaults = array(
'input' => 'text',
'extra_rows' => array(),
);
- $delete_href = wp_nonce_url("post.php?action=delete-post&post=$attachment_id", 'delete-post_' . $attachment_id);
if ( $send )
$send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . esc_attr__( 'Insert into Post' ) . "' />";
- if ( $delete )
- $delete = "<a href=\"#\" class=\"del-link\" onclick=\"document.getElementById('del_attachment_$attachment_id').style.display='block';return false;\">" . __('Delete') . "</a>";
- if ( ( $send || $delete ) && !isset($form_fields['buttons']) )
- $form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>$send $delete
- <div id=\"del_attachment_$attachment_id\" class=\"del-attachment\" style=\"display:none;\">" . sprintf(__("You are about to delete <strong>%s</strong>."), $filename) . " <a href=\"$delete_href\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Continue') . "</a>
- <a href=\"#\" class=\"del-link\" onclick=\"this.parentNode.style.display='none';return false;\">" . __('Cancel') . "</a></div></td></tr>\n");
+ if ( $delete && current_user_can('delete_post', $attachment_id) ) {
+ if ( !EMPTY_TRASH_DAYS ) {
+ $delete = "<a href=\"" . wp_nonce_url("post.php?action=delete&post=$attachment_id", 'delete-post_' . $attachment_id) . "\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Delete Permanently') . "</a>";
+ } elseif ( !MEDIA_TRASH ) {
+ $delete = "<a href=\"#\" class=\"del-link\" onclick=\"document.getElementById('del_attachment_$attachment_id').style.display='block';return false;\">" . __('Delete') . "</a> <div id=\"del_attachment_$attachment_id\" class=\"del-attachment\" style=\"display:none;\">" . sprintf(__("You are about to delete <strong>%s</strong>."), $filename) . " <a href=\"" . wp_nonce_url("post.php?action=delete&post=$attachment_id", 'delete-post_' . $attachment_id) . "\" id=\"del[$attachment_id]\" class=\"button\">" . __('Continue') . "</a> <a href=\"#\" class=\"button\" onclick=\"this.parentNode.style.display='none';return false;\">" . __('Cancel') . "</a></div>";
+ } else {
+ $delete = "<a href=\"" . wp_nonce_url("post.php?action=trash&post=$attachment_id", 'trash-post_' . $attachment_id) . "\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Move to Trash') . "</a> <a href=\"" . wp_nonce_url("post.php?action=untrash&post=$attachment_id", 'untrash-post_' . $attachment_id) . "\" id=\"undo[$attachment_id]\" class=\"undo hidden\">" . __('Undo') . "</a>";
+ }
+ } else {
+ $delete = '';
+ }
+
+ $thumbnail = '';
+ $calling_post_id = 0;
+ if ( isset( $_GET['post_id'] ) )
+ $calling_post_id = $_GET['post_id'];
+ elseif ( isset( $_POST ) && count( $_POST ) ) // Like for async-upload where $_GET['post_id'] isn't set
+ $calling_post_id = $post->post_parent;
+ if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id )
+ $thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html__( "Use as thumbnail" ) . "</a>";
+
+ if ( ( $send || $thumbnail || $delete ) && !isset($form_fields['buttons']) )
+ $form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>$send $thumbnail $delete</td></tr>\n");
$hidden_fields = array();
elseif ( $field['input'] == 'textarea' ) {
$item .= "<textarea type='text' id='$name' name='$name'" . $aria_required . ">" . esc_html( $field['value'] ) . "</textarea>";
} else {
- $item .= "<input type='text' id='$name' name='$name' value='" . esc_attr( $field['value'] ) . "'" . $aria_required . "/>";
+ $item .= "<input type='text' class='text' id='$name' name='$name' value='" . esc_attr( $field['value'] ) . "'" . $aria_required . "/>";
}
if ( !empty($field['helps']) )
$item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique((array) $field['helps']) ) . '</p>';
post_params : {
"post_id" : "<?php echo $post_id; ?>",
"auth_cookie" : "<?php if ( is_ssl() ) echo $_COOKIE[SECURE_AUTH_COOKIE]; else echo $_COOKIE[AUTH_COOKIE]; ?>",
+ "logged_in_cookie": "<?php echo $_COOKIE[LOGGED_IN_COOKIE]; ?>",
"_wpnonce" : "<?php echo wp_create_nonce('media-form'); ?>",
"type" : "<?php echo $type; ?>",
"tab" : "<?php echo $tab; ?>",
<?php do_action('pre-html-upload-ui'); ?>
<p id="async-upload-wrap">
<label class="screen-reader-text" for="async-upload"><?php _e('Upload'); ?></label>
- <input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" name="html-upload" value="<?php esc_attr_e('Upload'); ?>" /> <a href="#" onclick="return top.tb_remove();"><?php _e('Cancel'); ?></a>
+ <input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" name="html-upload" value="<?php esc_attr_e('Upload'); ?>" /> <a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e('Cancel'); ?></a>
</p>
<div class="clear"></div>
<?php if ( is_lighttpd_before_150() ): ?>
?>
<form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="media-upload-form type-form validate" id="<?php echo $type; ?>-form">
+<input type="submit" class="hidden" name="save" value="" />
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
<?php wp_nonce_field('media-form'); ?>
align : 'alignnone',
insert : function() {
- var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = null;
+ var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = '';
- if ( '' == f.src.value || '' == t.width ) return false;
+ if ( '' == f.src.value || '' == t.width )
+ return false;
if ( f.title.value ) {
- title = f.title.value.replace(/['"<>]+/g, '');
+ title = f.title.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
title = ' title="'+title+'"';
}
- if ( f.alt.value ) {
- alt = f.alt.value.replace(/['"<>]+/g, '');
+ if ( f.alt.value )
+ alt = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
+
<?php if ( ! apply_filters( 'disable_captions', '' ) ) { ?>
- caption = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
+ if ( f.caption.value )
+ caption = f.caption.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
<?php } ?>
- }
cls = caption ? '' : ' class="'+t.align+'"';
var win = window.dialogArguments || opener || parent || top;
win.send_to_editor(html);
+ return false;
},
resetImageData : function() {
t.width = t.height = '';
document.getElementById('go_button').style.color = '#bbb';
if ( ! document.forms[0].src.value )
- document.getElementById('status_img').src = 'images/required.gif';
- else document.getElementById('status_img').src = 'images/no.png';
+ document.getElementById('status_img').innerHTML = '*';
+ else document.getElementById('status_img').innerHTML = '<img src="images/no.png" alt="" />';
},
updateImageData : function() {
t.width = t.preloadImg.width;
t.height = t.preloadImg.height;
document.getElementById('go_button').style.color = '#333';
- document.getElementById('status_img').src = 'images/yes.png';
+ document.getElementById('status_img').innerHTML = '<img src="images/yes.png" alt="" />';
},
getImageData : function() {
t.resetImageData();
return false;
}
- document.getElementById('status_img').src = 'images/wpspin_light.gif';
+ document.getElementById('status_img').innerHTML = '<img src="images/wpspin_light.gif" alt="" />';
t.preloadImg = new Image();
t.preloadImg.onload = t.updateImageData;
t.preloadImg.onerror = t.resetImageData;
* @param unknown_type $errors
*/
function media_upload_gallery_form($errors) {
- global $redir_tab;
+ global $redir_tab, $type;
$redir_tab = 'gallery';
media_upload_header();
$post_id = intval($_REQUEST['post_id']);
- $form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=gallery&post_id=$post_id");
+ $form_action_url = admin_url("media-upload.php?type=$type&tab=gallery&post_id=$post_id");
+ $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
?>
<script type="text/javascript">
<?php _e('Sort Order:'); ?>
<a href="#" id="asc"><?php _e('Ascending'); ?></a> |
<a href="#" id="desc"><?php _e('Descending'); ?></a> |
-<a href="#" id="clear"><?php _e('Clear'); ?></a>
+<a href="#" id="clear"><?php echo _x('Clear', 'verb'); ?></a>
</div>
<form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="media-upload-form validate" id="gallery-form">
<?php wp_nonce_field('media-form'); ?>
<thead><tr>
<th><?php _e('Media'); ?></th>
<th class="order-head"><?php _e('Order'); ?></th>
+<th class="actions-head"><?php _e('Actions'); ?></th>
</tr></thead>
</table>
<div id="media-items">
$post_id = intval($_REQUEST['post_id']);
- $form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=library&post_id=$post_id");
+ $form_action_url = admin_url("media-upload.php?type=$type&tab=library&post_id=$post_id");
+ $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
$_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0;
if ( $_GET['paged'] < 1 )
continue;
$arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
- if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] )
+ if ( isset($_GET['m']) && ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] ) )
$default = ' selected="selected"';
else
$default = '';
*/
function type_url_form_image() {
- if ( apply_filters( 'disable_captions', '' ) ) {
- $alt = __('Alternate Text');
- $alt_help = __('Alt text for the image, e.g. “The Mona Lisa”');
+ if ( !apply_filters( 'disable_captions', '' ) ) {
+ $caption = '
+ <tr>
+ <th valign="top" scope="row" class="label">
+ <span class="alignleft"><label for="caption">' . __('Image Caption') . '</label></span>
+ </th>
+ <td class="field"><input id="caption" name="caption" value="" type="text" /></td>
+ </tr>
+';
} else {
- $alt = __('Image Caption');
- $alt_help = __('Also used as alternate text for the image');
+ $caption = '';
}
$default_align = get_option('image_default_align');
$default_align = 'none';
return '
+ <h4 class="media-sub-title">' . __('Insert an image from another web site') . '</h4>
<table class="describe"><tbody>
<tr>
- <th valign="top" scope="row" class="label" style="width:120px;">
+ <th valign="top" scope="row" class="label" style="width:130px;">
<span class="alignleft"><label for="src">' . __('Image URL') . '</label></span>
- <span class="alignright"><img id="status_img" src="images/required.gif" title="required" alt="required" /></span>
+ <span class="alignright"><abbr id="status_img" title="required" class="required">*</abbr></span>
</th>
<td class="field"><input id="src" name="src" value="" type="text" aria-required="true" onblur="addExtImage.getImageData()" /></td>
</tr>
<span class="alignleft"><label for="title">' . __('Image Title') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
- <td class="field"><p><input id="title" name="title" value="" type="text" aria-required="true" /></p></td>
+ <td class="field"><input id="title" name="title" value="" type="text" aria-required="true" /></td>
</tr>
<tr>
<th valign="top" scope="row" class="label">
- <span class="alignleft"><label for="alt">' . $alt . '</label></span>
+ <span class="alignleft"><label for="alt">' . __('Alternate Text') . '</label></span>
</th>
<td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" />
- <p class="help">' . $alt_help . '</p></td>
+ <p class="help">' . __('Alt text for the image, e.g. “The Mona Lisa”') . '</p></td>
</tr>
-
+ ' . $caption . '
<tr class="align">
<th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th>
<td class="field">
add_filter('media_upload_library', 'media_upload_library');
-?>
--- /dev/null
+<?php
+
+// -- Post related Meta Boxes
+
+/**
+ * Display post submit form fields.
+ *
+ * @since 2.7.0
+ *
+ * @param object $post
+ */
+function post_submit_meta_box($post) {
+ global $action;
+
+ $post_type = $post->post_type;
+ $can_publish = current_user_can("publish_${post_type}s");
+?>
+<div class="submitbox" id="submitpost">
+
+<div id="minor-publishing">
+
+<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
+<div style="display:none;">
+<input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
+</div>
+
+<div id="minor-publishing-actions">
+<div id="save-action">
+<?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>
+<input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" tabindex="4" class="button button-highlighted" />
+<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
+<input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" tabindex="4" class="button button-highlighted" />
+<?php } ?>
+</div>
+
+<div id="preview-action">
+<?php
+if ( 'publish' == $post->post_status ) {
+ $preview_link = esc_url(get_permalink($post->ID));
+ $preview_button = __('Preview Changes');
+} else {
+ $preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
+ $preview_button = __('Preview');
+}
+?>
+<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a>
+<input type="hidden" name="wp-preview" id="wp-preview" value="" />
+</div>
+
+<div class="clear"></div>
+</div><?php // /minor-publishing-actions ?>
+
+<div id="misc-publishing-actions">
+
+<div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label>
+<span id="post-status-display">
+<?php
+switch ( $post->post_status ) {
+ case 'private':
+ _e('Privately Published');
+ break;
+ case 'publish':
+ _e('Published');
+ break;
+ case 'future':
+ _e('Scheduled');
+ break;
+ case 'pending':
+ _e('Pending Review');
+ break;
+ case 'draft':
+ _e('Draft');
+ break;
+}
+?>
+</span>
+<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
+<a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
+
+<div id="post-status-select" class="hide-if-js">
+<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr($post->post_status); ?>" />
+<select name='post_status' id='post_status' tabindex='4'>
+<?php if ( 'publish' == $post->post_status ) : ?>
+<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
+<?php elseif ( 'private' == $post->post_status ) : ?>
+<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
+<?php elseif ( 'future' == $post->post_status ) : ?>
+<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
+<?php endif; ?>
+<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
+<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
+</select>
+ <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
+ <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
+</div>
+
+<?php } ?>
+</div><?php // /misc-pub-section ?>
+
+<div class="misc-pub-section " id="visibility">
+<?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php
+
+if ( 'private' == $post->post_status ) {
+ $post->post_password = '';
+ $visibility = 'private';
+ $visibility_trans = __('Private');
+} elseif ( !empty( $post->post_password ) ) {
+ $visibility = 'password';
+ $visibility_trans = __('Password protected');
+} elseif ( $post_type == 'post' && is_sticky( $post->ID ) ) {
+ $visibility = 'public';
+ $visibility_trans = __('Public, Sticky');
+} else {
+ $visibility = 'public';
+ $visibility_trans = __('Public');
+}
+
+echo esc_html( $visibility_trans ); ?></span>
+<?php if ( $can_publish ) { ?>
+<a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
+
+<div id="post-visibility-select" class="hide-if-js">
+<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr($post->post_password); ?>" />
+<?php if ($post_type == 'post'): ?>
+<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID)); ?> />
+<?php endif; ?>
+<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" />
+
+
+<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br />
+<?php if ($post_type == 'post'): ?>
+<span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID)); ?> tabindex="4" /> <label for="sticky" class="selectit"><?php _e('Stick this post to the front page') ?></label><br /></span>
+<?php endif; ?>
+<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br />
+<span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr($post->post_password); ?>" /><br /></span>
+<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
+
+<p>
+ <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
+ <a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a>
+</p>
+</div>
+<?php } ?>
+
+</div><?php // /misc-pub-section ?>
+
+
+<?php
+// translators: Publish box date formt, see http://php.net/date
+$datef = __( 'M j, Y @ G:i' );
+if ( 0 != $post->ID ) {
+ if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
+ $stamp = __('Scheduled for: <b>%1$s</b>');
+ } else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
+ $stamp = __('Published on: <b>%1$s</b>');
+ } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
+ $stamp = __('Publish <b>immediately</b>');
+ } else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
+ $stamp = __('Schedule for: <b>%1$s</b>');
+ } else { // draft, 1 or more saves, date specified
+ $stamp = __('Publish on: <b>%1$s</b>');
+ }
+ $date = date_i18n( $datef, strtotime( $post->post_date ) );
+} else { // draft (no saves, and thus no date specified)
+ $stamp = __('Publish <b>immediately</b>');
+ $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
+}
+
+if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
+<div class="misc-pub-section curtime misc-pub-section-last">
+ <span id="timestamp">
+ <?php printf($stamp, $date); ?></span>
+ <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
+ <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
+</div><?php // /misc-pub-section ?>
+<?php endif; ?>
+
+<?php do_action('post_submitbox_misc_actions'); ?>
+</div>
+<div class="clear"></div>
+</div>
+
+<div id="major-publishing-actions">
+<?php do_action('post_submitbox_start'); ?>
+<div id="delete-action">
+<?php
+if ( current_user_can( "delete_${post_type}", $post->ID ) ) {
+ if ( !EMPTY_TRASH_DAYS ) {
+ $delete_url = wp_nonce_url( add_query_arg( array('action' => 'delete', 'post' => $post->ID) ), "delete-${post_type}_{$post->ID}" );
+ $delete_text = __('Delete Permanently');
+ } else {
+ $delete_url = wp_nonce_url( add_query_arg( array('action' => 'trash', 'post' => $post->ID) ), "trash-${post_type}_{$post->ID}" );
+ $delete_text = __('Move to Trash');
+ } ?>
+<a class="submitdelete deletion<?php if ( 'edit' != $action ) { echo " hidden"; } ?>" href="<?php echo $delete_url; ?>"><?php echo $delete_text; ?></a><?php
+} ?>
+</div>
+
+<div id="publishing-action">
+<img src="images/wpspin_light.gif" id="ajax-loading" style="visibility:hidden;" alt="" />
+<?php
+if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {
+ if ( $can_publish ) :
+ if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
+ <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" />
+ <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Schedule') ?>" />
+<?php else : ?>
+ <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
+ <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Publish') ?>" />
+<?php endif;
+ else : ?>
+ <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" />
+ <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Submit for Review') ?>" />
+<?php
+ endif;
+} else { ?>
+ <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" />
+ <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Update') ?>" />
+<?php
+} ?>
+</div>
+<div class="clear"></div>
+</div>
+</div>
+
+<?php
+}
+
+
+/**
+ * Display post tags form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_tags_meta_box($post, $box) {
+ $tax_name = esc_attr(substr($box['id'], 8));
+ $taxonomy = get_taxonomy($tax_name);
+ $helps = isset($taxonomy->helps) ? esc_attr($taxonomy->helps) : __('Separate tags with commas.');
+?>
+<div class="tagsdiv" id="<?php echo $tax_name; ?>">
+ <div class="jaxtag">
+ <div class="nojs-tags hide-if-js">
+ <p><?php _e('Add or remove tags'); ?></p>
+ <textarea name="<?php echo "tax_input[$tax_name]"; ?>" class="the-tags" id="tax-input[<?php echo $tax_name; ?>]"><?php echo esc_attr(get_terms_to_edit( $post->ID, $tax_name )); ?></textarea></div>
+
+ <div class="ajaxtag hide-if-no-js">
+ <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
+ <div class="taghint"><?php _e('Add new tag'); ?></div>
+ <input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
+ <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" />
+ </div></div>
+ <p class="howto"><?php echo $helps; ?></p>
+ <div class="tagchecklist"></div>
+</div>
+<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php printf( __('Choose from the most used tags in %s'), $box['title'] ); ?></a></p>
+<?php
+}
+
+
+/**
+ * Display post categories form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_categories_meta_box($post) {
+?>
+<ul id="category-tabs">
+ <li class="tabs"><a href="#categories-all" tabindex="3"><?php _e( 'All Categories' ); ?></a></li>
+ <li class="hide-if-no-js"><a href="#categories-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>
+</ul>
+
+<div id="categories-pop" class="tabs-panel" style="display: none;">
+ <ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
+<?php $popular_ids = wp_popular_terms_checklist('category'); ?>
+ </ul>
+</div>
+
+<div id="categories-all" class="tabs-panel">
+ <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
+<?php wp_category_checklist($post->ID, false, false, $popular_ids) ?>
+ </ul>
+</div>
+
+<?php if ( current_user_can('manage_categories') ) : ?>
+<div id="category-adder" class="wp-hidden-children">
+ <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
+ <p id="category-add" class="wp-hidden-child">
+ <label class="screen-reader-text" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" tabindex="3" aria-required="true"/>
+ <label class="screen-reader-text" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category') ) ); ?>
+ <input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php esc_attr_e( 'Add' ); ?>" tabindex="3" />
+<?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>
+ <span id="category-ajax-response"></span></p>
+</div>
+<?php
+endif;
+
+}
+
+
+/**
+ * Display post excerpt form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_excerpt_meta_box($post) {
+?>
+<label class="screen-reader-text" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea>
+<p><?php _e('Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="http://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>'); ?></p>
+<?php
+}
+
+
+/**
+ * Display trackback links form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_trackback_meta_box($post) {
+ $form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" tabindex="7" value="'. esc_attr( str_replace("\n", ' ', $post->to_ping) ) .'" />';
+ if ('' != $post->pinged) {
+ $pings = '<p>'. __('Already pinged:') . '</p><ul>';
+ $already_pinged = explode("\n", trim($post->pinged));
+ foreach ($already_pinged as $pinged_url) {
+ $pings .= "\n\t<li>" . esc_html($pinged_url) . "</li>";
+ }
+ $pings .= '</ul>';
+ }
+
+?>
+<p><label for="trackback_url"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
+<p><?php _e('Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress blogs they’ll be notified automatically using <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>
+<?php
+if ( ! empty($pings) )
+ echo $pings;
+}
+
+
+/**
+ * Display custom fields form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_custom_meta_box($post) {
+?>
+<div id="postcustomstuff">
+<div id="ajax-response"></div>
+<?php
+$metadata = has_meta($post->ID);
+list_meta($metadata);
+meta_form(); ?>
+</div>
+<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
+<?php
+}
+
+
+/**
+ * Display comments status form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_comment_status_meta_box($post) {
+?>
+<input name="advanced_view" type="hidden" value="1" />
+<p class="meta-options">
+ <label for="comment_status" class="selectit"><input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /><?php _e('Allow Comments.') ?></label><br />
+ <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /><?php printf( __('Allow <a href="%s" target="_blank">trackbacks and pingbacks</a> on this page.'),_x('http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments','Url to codex article on Managing Comments')); ?></label>
+</p>
+<?php
+}
+
+
+/**
+ * Display comments for post.
+ *
+ * @since 2.8.0
+ *
+ * @param object $post
+ */
+function post_comment_meta_box($post) {
+ global $wpdb, $post_ID;
+
+ $total = $wpdb->get_var($wpdb->prepare("SELECT count(1) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID));
+
+ if ( 1 > $total ) {
+ echo '<p>' . __('No comments yet.') . '</p>';
+ return;
+ }
+
+ wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
+?>
+
+<table class="widefat comments-box fixed" cellspacing="0" style="display:none;">
+<thead><tr>
+ <th scope="col" class="column-author"><?php _e('Author') ?></th>
+ <th scope="col" class="column-comment">
+<?php /* translators: field name in comment form */ echo _x('Comment', 'noun'); ?></th>
+</tr></thead>
+<tbody id="the-comment-list" class="list:comment"></tbody>
+</table>
+<p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="images/wpspin_light.gif" alt="" /></p>
+<?php
+ $hidden = get_hidden_meta_boxes('post');
+ if ( ! in_array('commentsdiv', $hidden) ) { ?>
+ <script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>
+<?php
+ }
+ wp_comment_trashnotice();
+}
+
+
+/**
+ * Display slug form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_slug_meta_box($post) {
+?>
+<label class="screen-reader-text" for="post_name"><?php _e('Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( $post->post_name ); ?>" />
+<?php
+}
+
+
+/**
+ * Display form field with list of authors.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_author_meta_box($post) {
+ global $current_user, $user_ID;
+ $authors = get_editable_user_ids( $current_user->id, true, $post->post_type ); // TODO: ROLE SYSTEM
+ if ( $post->post_author && !in_array($post->post_author, $authors) )
+ $authors[] = $post->post_author;
+?>
+<label class="screen-reader-text" for="post_author_override"><?php _e('Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
+<?php
+}
+
+
+/**
+ * Display list of revisions.
+ *
+ * @since 2.6.0
+ *
+ * @param object $post
+ */
+function post_revisions_meta_box($post) {
+ wp_list_post_revisions();
+}
+
+
+// -- Page related Meta Boxes
+
+/**
+ * Display page attributes form fields.
+ *
+ * @since 2.7.0
+ *
+ * @param object $post
+ */
+function page_attributes_meta_box($post){
+?>
+<h5><?php _e('Parent') ?></h5>
+<label class="screen-reader-text" for="parent_id"><?php _e('Page Parent') ?></label>
+<?php wp_dropdown_pages(array('exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?>
+<p><?php _e('You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how deeply nested you can make pages.'); ?></p>
+<?php
+ if ( 0 != count( get_page_templates() ) ) { ?>
+<h5><?php _e('Template') ?></h5>
+<label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
+<option value='default'><?php _e('Default Template'); ?></option>
+<?php page_template_dropdown($post->page_template); ?>
+</select>
+<p><?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them above.'); ?></p>
+<?php
+ } ?>
+<h5><?php _e('Order') ?></h5>
+<p><label class="screen-reader-text" for="menu_order"><?php _e('Page Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p>
+<p><?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in.'); ?></p>
+<?php
+}
+
+
+// -- Link related Meta Boxes
+
+/**
+ * Display link create form fields.
+ *
+ * @since 2.7.0
+ *
+ * @param object $link
+ */
+function link_submit_meta_box($link) {
+?>
+<div class="submitbox" id="submitlink">
+
+<div id="minor-publishing">
+
+<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
+<div style="display:none;">
+<input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
+</div>
+
+<div id="minor-publishing-actions">
+<div id="preview-action">
+<?php if ( !empty($link->link_id) ) { ?>
+ <a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank" tabindex="4"><?php _e('Visit Link'); ?></a>
+<?php } ?>
+</div>
+<div class="clear"></div>
+</div>
+
+<div id="misc-publishing-actions">
+<div class="misc-pub-section misc-pub-section-last">
+ <label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked($link->link_visible, 'N'); ?> /> <?php _e('Keep this link private') ?></label>
+</div>
+</div>
+
+</div>
+
+<div id="major-publishing-actions">
+<?php do_action('post_submitbox_start'); ?>
+<div id="delete-action">
+<?php
+if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?>
+ <a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
+<?php } ?>
+</div>
+
+<div id="publishing-action">
+<?php if ( !empty($link->link_id) ) { ?>
+ <input name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="<?php esc_attr_e('Update Link') ?>" />
+<?php } else { ?>
+ <input name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="<?php esc_attr_e('Add Link') ?>" />
+<?php } ?>
+</div>
+<div class="clear"></div>
+</div>
+<?php do_action('submitlink_box'); ?>
+<div class="clear"></div>
+</div>
+<?php
+}
+
+
+/**
+ * Display link categories form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
+function link_categories_meta_box($link) { ?>
+<ul id="category-tabs">
+ <li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
+ <li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
+</ul>
+
+<div id="categories-all" class="tabs-panel">
+ <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
+ <?php
+ if ( isset($link->link_id) )
+ wp_link_category_checklist($link->link_id);
+ else
+ wp_link_category_checklist();
+ ?>
+ </ul>
+</div>
+
+<div id="categories-pop" class="tabs-panel" style="display: none;">
+ <ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
+ <?php wp_popular_terms_checklist('link_category'); ?>
+ </ul>
+</div>
+
+<div id="category-adder" class="wp-hidden-children">
+ <h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>
+ <p id="link-category-add" class="wp-hidden-child">
+ <label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
+ <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
+ <input type="button" id="category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php esc_attr_e( 'Add' ); ?>" />
+ <?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
+ <span id="category-ajax-response"></span>
+ </p>
+</div>
+<?php
+}
+
+
+/**
+ * Display form fields for changing link target.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
+function link_target_meta_box($link) { ?>
+<fieldset><legend class="screen-reader-text"><span><?php _e('Target') ?></span></legend>
+<p><label for="link_target_blank" class="selectit">
+<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
+<?php _e('<code>_blank</code> - new window or tab.'); ?></label></p>
+<p><label for="link_target_top" class="selectit">
+<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
+<?php _e('<code>_top</code> - current window or tab, with no frames.'); ?></label></p>
+<p><label for="link_target_none" class="selectit">
+<input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ($link->link_target == '') ? 'checked="checked"' : ''); ?> />
+<?php _e('<code>_none</code> - same window or tab.'); ?></label></p>
+</fieldset>
+<p><?php _e('Choose the target frame for your link.'); ?></p>
+<?php
+}
+
+
+/**
+ * Display checked checkboxes attribute for xfn microformat options.
+ *
+ * @since 1.0.1
+ *
+ * @param string $class
+ * @param string $value
+ * @param mixed $deprecated Not used.
+ */
+function xfn_check($class, $value = '', $deprecated = '') {
+ global $link;
+
+ $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
+ $rels = preg_split('/\s+/', $link_rel);
+
+ if ('' != $value && in_array($value, $rels) ) {
+ echo ' checked="checked"';
+ }
+
+ if ('' == $value) {
+ if ('family' == $class && strpos($link_rel, 'child') === false && strpos($link_rel, 'parent') === false && strpos($link_rel, 'sibling') === false && strpos($link_rel, 'spouse') === false && strpos($link_rel, 'kin') === false) echo ' checked="checked"';
+ if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"';
+ if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"';
+ if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
+ }
+}
+
+
+/**
+ * Display xfn form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
+function link_xfn_meta_box($link) {
+?>
+<table class="editform" style="width: 100%;" cellspacing="2" cellpadding="5">
+ <tr>
+ <th style="width: 20%;" scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('rel:') ?></label></th>
+ <td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo ( isset( $link->link_rel ) ? esc_attr($link->link_rel) : ''); ?>" /></td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <table cellpadding="3" cellspacing="5" class="form-table">
+ <tr>
+ <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?> </th>
+ <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?> </span></legend>
+ <label for="me">
+ <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
+ <?php _e('another web address of mine') ?></label>
+ </fieldset></td>
+ </tr>
+ <tr>
+ <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </th>
+ <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </span></legend>
+ <label for="contact">
+ <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('contact') ?></label>
+ <label for="acquaintance">
+ <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('acquaintance') ?></label>
+ <label for="friend">
+ <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friend') ?></label>
+ <label for="friendship">
+ <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
+ </fieldset></td>
+ </tr>
+ <tr>
+ <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?> </th>
+ <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?> </span></legend>
+ <label for="met">
+ <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('met') ?></label>
+ </fieldset></td>
+ </tr>
+ <tr>
+ <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?> </th>
+ <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?> </span></legend>
+ <label for="co-worker">
+ <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-worker') ?></label>
+ <label for="colleague">
+ <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('colleague') ?></label>
+ </fieldset></td>
+ </tr>
+ <tr>
+ <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </th>
+ <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </span></legend>
+ <label for="co-resident">
+ <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-resident') ?></label>
+ <label for="neighbor">
+ <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('neighbor') ?></label>
+ <label for="geographical">
+ <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
+ </fieldset></td>
+ </tr>
+ <tr>
+ <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </th>
+ <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </span></legend>
+ <label for="child">
+ <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('child') ?></label>
+ <label for="kin">
+ <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('kin') ?></label>
+ <label for="parent">
+ <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('parent') ?></label>
+ <label for="sibling">
+ <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sibling') ?></label>
+ <label for="spouse">
+ <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('spouse') ?></label>
+ <label for="family">
+ <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
+ </fieldset></td>
+ </tr>
+ <tr>
+ <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?> </th>
+ <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?> </span></legend>
+ <label for="muse">
+ <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('muse') ?></label>
+ <label for="crush">
+ <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('crush') ?></label>
+ <label for="date">
+ <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('date') ?></label>
+ <label for="romantic">
+ <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
+ <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sweetheart') ?></label>
+ </fieldset></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+<p><?php _e('If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.'); ?></p>
+<?php
+}
+
+
+/**
+ * Display advanced link options form fields.
+ *
+ * @since 2.6.0
+ *
+ * @param object $link
+ */
+function link_advanced_meta_box($link) {
+?>
+<table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">
+ <tr class="form-field">
+ <th valign="top" scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>
+ <td><input type="text" name="link_image" class="code" id="link_image" size="50" value="<?php echo ( isset( $link->link_image ) ? esc_attr($link->link_image) : ''); ?>" style="width: 95%" /></td>
+ </tr>
+ <tr class="form-field">
+ <th valign="top" scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th>
+ <td><input name="link_rss" class="code" type="text" id="rss_uri" value="<?php echo ( isset( $link->link_rss ) ? esc_attr($link->link_rss) : ''); ?>" size="50" style="width: 95%" /></td>
+ </tr>
+ <tr class="form-field">
+ <th valign="top" scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
+ <td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); ?></textarea></td>
+ </tr>
+ <tr class="form-field">
+ <th valign="top" scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th>
+ <td><select name="link_rating" id="link_rating" size="1">
+ <?php
+ for ($r = 0; $r <= 10; $r++) {
+ echo(' <option value="'. esc_attr($r) .'" ');
+ if ( isset($link->link_rating) && $link->link_rating == $r)
+ echo 'selected="selected"';
+ echo('>'.$r.'</option>');
+ }
+ ?></select> <?php _e('(Leave at 0 for no rating.)') ?>
+ </td>
+ </tr>
+</table>
+<?php
+}
+
+/**
+ * Display post thumbnail meta box.
+ *
+ * @since 2.9.0
+ */
+function post_thumbnail_meta_box() {
+ global $post;
+ $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
+ echo _wp_post_thumbnail_html( $thumbnail_id );
+}
// Using win_is_writable() instead of is_writable() because of a bug in Windows PHP
if ( ( ! file_exists($web_config_file) && win_is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks() ) || win_is_writable($web_config_file) ) {
if ( iis7_supports_permalinks() ) {
- $rule = $wp_rewrite->iis7_url_rewrite_rules();
+ $rule = $wp_rewrite->iis7_url_rewrite_rules(false, '', '');
if ( ! empty($rule) ) {
return iis7_add_rewrite_rule($web_config_file, $rule);
} else {
$rule_fragment->appendXML($rewrite_rule);
$rules_node->appendChild($rule_fragment);
+ $doc->encoding = "UTF-8";
$doc->formatOutput = true;
saveDomDocument($doc, $filename);
* @return array See above for description.
*/
function get_plugin_data( $plugin_file, $markup = true, $translate = true ) {
- // We don't need to write to the file, so just open for reading.
- $fp = fopen($plugin_file, 'r');
-
- // Pull only the first 8kiB of the file in.
- $plugin_data = fread( $fp, 8192 );
-
- // PHP will close file handle, but we are good citizens.
- fclose($fp);
-
- preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $name );
- preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $uri );
- preg_match( '|Version:(.*)|i', $plugin_data, $version );
- preg_match( '|Description:(.*)$|mi', $plugin_data, $description );
- preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name );
- preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri );
- preg_match( '|Text Domain:(.*)$|mi', $plugin_data, $text_domain );
- preg_match( '|Domain Path:(.*)$|mi', $plugin_data, $domain_path );
-
- foreach ( array( 'name', 'uri', 'version', 'description', 'author_name', 'author_uri', 'text_domain', 'domain_path' ) as $field ) {
- if ( !empty( ${$field} ) )
- ${$field} = _cleanup_header_comment(${$field}[1]);
- else
- ${$field} = '';
- }
- $plugin_data = array(
- 'Name' => $name, 'Title' => $name, 'PluginURI' => $uri, 'Description' => $description,
- 'Author' => $author_name, 'AuthorURI' => $author_uri, 'Version' => $version,
- 'TextDomain' => $text_domain, 'DomainPath' => $domain_path
- );
+ $default_headers = array(
+ 'Name' => 'Plugin Name',
+ 'PluginURI' => 'Plugin URI',
+ 'Version' => 'Version',
+ 'Description' => 'Description',
+ 'Author' => 'Author',
+ 'AuthorURI' => 'Author URI',
+ 'TextDomain' => 'Text Domain',
+ 'DomainPath' => 'Domain Path'
+ );
+
+ $plugin_data = get_file_data( $plugin_file, $default_headers, 'plugin' );
+
+ //For backward compatibility by default Title is the same as Name.
+ $plugin_data['Title'] = $plugin_data['Name'];
+
if ( $markup || $translate )
- $plugin_data = _get_plugin_data_markup_translate($plugin_file, $plugin_data, $markup, $translate);
+ $plugin_data = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup, $translate );
return $plugin_data;
}
//Translate fields
if( $translate && ! empty($plugin_data['TextDomain']) ) {
if( ! empty( $plugin_data['DomainPath'] ) )
- load_plugin_textdomain($plugin_data['TextDomain'], dirname($plugin_file). $plugin_data['DomainPath']);
+ load_plugin_textdomain($plugin_data['TextDomain'], false, dirname($plugin_file). $plugin_data['DomainPath']);
else
- load_plugin_textdomain($plugin_data['TextDomain'], dirname($plugin_file));
+ load_plugin_textdomain($plugin_data['TextDomain'], false, dirname($plugin_file));
foreach ( array('Name', 'PluginURI', 'Description', 'Author', 'AuthorURI', 'Version') as $field )
$plugin_data[ $field ] = translate($plugin_data[ $field ], $plugin_data['TextDomain']);
* @return bool True, if in the active plugins list. False, not in the list.
*/
function is_plugin_active($plugin) {
- return in_array($plugin, get_option('active_plugins'));
+ return in_array( $plugin, apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
}
/**
@include(WP_PLUGIN_DIR . '/' . $plugin);
$current[] = $plugin;
sort($current);
+ do_action( 'activate_plugin', trim( $plugin) );
update_option('active_plugins', $current);
- do_action('activate_' . $plugin);
+ do_action( 'activate_' . trim( $plugin ) );
+ do_action( 'activated_plugin', trim( $plugin) );
ob_end_clean();
}
$plugin = plugin_basename($plugin);
if( ! is_plugin_active($plugin) )
continue;
- array_splice($current, array_search( $plugin, $current), 1 ); // Fixed Array-fu!
- if ( ! $silent ) //Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output.
- do_action('deactivate_' . trim( $plugin ));
+ if ( ! $silent )
+ do_action( 'deactivate_plugin', trim( $plugin ) );
+
+ $key = array_search( $plugin, (array) $current );
+
+ if ( false !== $key )
+ array_splice( $current, $key, 1 );
+
+ //Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output.
+ if ( ! $silent ) {
+ do_action( 'deactivate_' . trim( $plugin ) );
+ do_action( 'deactivated_plugin', trim( $plugin ) );
+ }
}
update_option('active_plugins', $current);
}
function validate_active_plugins() {
- $check_plugins = get_option('active_plugins');
+ $check_plugins = apply_filters( 'active_plugins', get_option('active_plugins') );
// Sanity check. If the active plugin list is not an array, make it an
// empty array.
// Menu
//
-function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '' ) {
+function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '', $position = NULL ) {
global $menu, $admin_page_hooks, $_registered_pages;
$file = plugin_basename( $file );
if (!empty ( $function ) && !empty ( $hookname ))
add_action( $hookname, $function );
- if ( empty($icon_url) )
+ if ( empty($icon_url) ) {
$icon_url = 'images/generic.png';
- elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') )
+ } elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') ) {
$icon_url = 'https://' . substr($icon_url, 7);
+ }
- $menu[] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
+ $new_menu = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
+
+ if ( NULL === $position ) {
+ $menu[] = $new_menu;
+ } else {
+ $menu[$position] = $new_menu;
+ }
$_registered_pages[$hookname] = true;
}
function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
- global $menu, $admin_page_hooks, $_wp_last_object_menu, $_registered_pages;
-
- $file = plugin_basename( $file );
-
- $admin_page_hooks[$file] = sanitize_title( $menu_title );
-
- $hookname = get_plugin_page_hookname( $file, '' );
- if (!empty ( $function ) && !empty ( $hookname ))
- add_action( $hookname, $function );
-
- if ( empty($icon_url) )
- $icon_url = 'images/generic.png';
+ global $_wp_last_object_menu;
$_wp_last_object_menu++;
- $menu[$_wp_last_object_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
-
- $_registered_pages[$hookname] = true;
-
- return $hookname;
+ return add_menu_page($page_title, $menu_title, $access_level, $file, $function, $icon_url, $_wp_last_object_menu);
}
function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
- global $menu, $admin_page_hooks, $_wp_last_utility_menu, $_registered_pages;
-
- $file = plugin_basename( $file );
-
- $admin_page_hooks[$file] = sanitize_title( $menu_title );
-
- $hookname = get_plugin_page_hookname( $file, '' );
- if (!empty ( $function ) && !empty ( $hookname ))
- add_action( $hookname, $function );
-
- if ( empty($icon_url) )
- $icon_url = 'images/generic.png';
- elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') )
- $icon_url = 'https://' . substr($icon_url, 7);
+ global $_wp_last_utility_menu;
$_wp_last_utility_menu++;
- $menu[$_wp_last_utility_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
-
- $_registered_pages[$hookname] = true;
-
- return $hookname;
+ return add_menu_page($page_title, $menu_title, $access_level, $file, $function, $icon_url, $_wp_last_utility_menu);
}
function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function = '' ) {
$_registered_pages[$hookname] = true;
// backwards-compatibility for plugins using add_management page. See wp-admin/admin.php for redirect from edit.php to tools.php
- if ( 'tools.php' == $parent )
+ if ( 'tools.php' == $parent )
$_registered_pages[get_plugin_page_hookname( $file, 'edit.php')] = true;
return $hookname;
*
* @since 2.7.0
*
- * @param string $option_group A settings group name. Can be anything.
+ * @param string $option_group A settings group name. Should correspond to a whitelisted option key name.
+ * Default whitelisted option key names include "general," "discussion," and "reading," among others.
* @param string $option_name The name of an option to sanitize and save.
* @param unknown_type $sanitize_callback A callback function that sanitizes the option's value.
* @return unknown
wp_die( __('You are not allowed to edit posts.') );
}
+ if ( -1 == $post_data['_status'] ) {
+ $post_data['post_status'] = null;
+ unset($post_data['post_status']);
+ } else {
+ $post_data['post_status'] = $post_data['_status'];
+ }
+ unset($post_data['_status']);
+
$post_IDs = array_map( 'intval', (array) $post_data['post'] );
$reset = array( 'post_author', 'post_status', 'post_password', 'post_parent', 'page_template', 'comment_status', 'ping_status', 'keep_private', 'tags_input', 'post_category', 'sticky' );
$post_data['ID'] = $post_ID;
$updated[] = wp_update_post( $post_data );
- if ( current_user_can( 'edit_others_posts' ) && isset( $post_data['sticky'] ) ) {
+ if ( isset( $post_data['sticky'] ) && current_user_can( 'edit_others_posts' ) ) {
if ( 'sticky' == $post_data['sticky'] )
stick_post( $post_ID );
else
* @return unknown
*/
function get_default_post_to_edit() {
+
+ $post_title = '';
if ( !empty( $_REQUEST['post_title'] ) )
$post_title = esc_html( stripslashes( $_REQUEST['post_title'] ));
- else if ( !empty( $_REQUEST['popuptitle'] ) ) {
- $post_title = esc_html( stripslashes( $_REQUEST['popuptitle'] ));
- $post_title = funky_javascript_fix( $post_title );
- } else {
- $post_title = '';
- }
$post_content = '';
if ( !empty( $_REQUEST['content'] ) )
$post_content = esc_html( stripslashes( $_REQUEST['content'] ));
- else if ( !empty( $post_title ) ) {
- $text = esc_html( stripslashes( urldecode( $_REQUEST['text'] ) ) );
- $text = funky_javascript_fix( $text);
- $popupurl = esc_url($_REQUEST['popupurl']);
- $post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text";
- }
+ $post_excerpt = '';
if ( !empty( $_REQUEST['excerpt'] ) )
$post_excerpt = esc_html( stripslashes( $_REQUEST['excerpt'] ));
- else
- $post_excerpt = '';
$post->ID = 0;
$post->post_name = '';
$metakeyselect = isset($_POST['metakeyselect']) ? stripslashes( trim( $_POST['metakeyselect'] ) ) : '';
$metakeyinput = isset($_POST['metakeyinput']) ? stripslashes( trim( $_POST['metakeyinput'] ) ) : '';
- $metavalue = isset($_POST['metavalue']) ? maybe_serialize( stripslashes( trim( $_POST['metavalue'] ) ) ) : '';
+ $metavalue = isset($_POST['metavalue']) ? maybe_serialize( stripslashes_deep( $_POST['metavalue'] ) ) : '';
+ if ( is_string($metavalue) )
+ $metavalue = trim( $metavalue );
if ( ('0' === $metavalue || !empty ( $metavalue ) ) && ((('#NONE#' != $metakeyselect) && !empty ( $metakeyselect) ) || !empty ( $metakeyinput) ) ) {
// We have a key/value pair. If both the select and the
wp_cache_delete($post_ID, 'post_meta');
$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->postmeta (post_id,meta_key,meta_value ) VALUES (%s, %s, %s)", $post_ID, $metakey, $metavalue) );
+ do_action( 'added_postmeta', $wpdb->insert_id, $post_ID, $metakey, $metavalue );
+
return $wpdb->insert_id;
}
return false;
$mid = (int) $mid;
$post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
+
+ do_action( 'delete_postmeta', $mid );
wp_cache_delete($post_id, 'post_meta');
+ $rval = $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
+ do_action( 'deleted_postmeta', $mid );
- return $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
+ return $rval;
}
/**
return false;
$post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $meta_id) );
- wp_cache_delete($post_id, 'post_meta');
- $meta_value = maybe_serialize( stripslashes( $meta_value ) );
+ $meta_value = maybe_serialize( stripslashes_deep( $meta_value ) );
$meta_id = (int) $meta_id;
$data = compact( 'meta_key', 'meta_value' );
$where = compact( 'meta_id' );
- return $wpdb->update( $wpdb->postmeta, $data, $where );
+ do_action( 'update_postmeta', $meta_id, $post_id, $meta_key, $meta_value );
+ $rval = $wpdb->update( $wpdb->postmeta, $data, $where );
+ wp_cache_delete($post_id, 'post_meta');
+ do_action( 'updated_postmeta', $meta_id, $post_id, $meta_key, $meta_value );
+
+ return $rval;
}
//
* @return unknown
*/
function _fix_attachment_links( $post_ID ) {
+ global $_fix_attachment_link_id;
$post = & get_post( $post_ID, ARRAY_A );
}
$post_search[$i] = $anchor;
- $post_replace[$i] = preg_replace( "#href=(\"|')[^'\"]*\\1#e", "stripslashes( 'href=\\1' ).get_attachment_link( $id ).stripslashes( '\\1' )", $anchor );
+ $_fix_attachment_link_id = $id;
+ $post_replace[$i] = preg_replace_callback( "#href=(\"|')[^'\"]*\\1#", '_fix_attachment_links_replace_cb', $anchor );
++$i;
}
return wp_update_post( $post);
}
+function _fix_attachment_links_replace_cb($match) {
+ global $_fix_attachment_link_id;
+ return stripslashes( 'href='.$match[1] ).get_attachment_link( $_fix_attachment_link_id ).stripslashes( $match[1] );
+}
+
/**
* Move child posts to a new parent.
*
global $wpdb;
$old_ID = (int) $old_ID;
$new_ID = (int) $new_ID;
- return $wpdb->update($wpdb->posts, array('post_parent' => $new_ID), array('post_parent' => $old_ID) );
+
+ $children = $wpdb->get_col( $wpdb->prepare("
+ SELECT post_id
+ FROM $wpdb->postmeta
+ WHERE meta_key = '_wp_attachment_temp_parent'
+ AND meta_value = %d", $old_ID) );
+
+ foreach ( $children as $child_id ) {
+ $wpdb->update($wpdb->posts, array('post_parent' => $new_ID), array('ID' => $child_id) );
+ delete_post_meta($child_id, '_wp_attachment_temp_parent');
+ }
}
/**
'pending' => array(_x('Pending Review', 'post'), __('Pending posts'), _n_noop('Pending Review <span class="count">(%s)</span>', 'Pending Review <span class="count">(%s)</span>')),
'draft' => array(_x('Draft', 'post'), _x('Drafts', 'manage posts header'), _n_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>')),
'private' => array(_x('Private', 'post'), __('Private posts'), _n_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>')),
+ 'trash' => array(_x('Trash', 'post'), __('Trash posts'), _n_noop('Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>')),
);
$post_stati = apply_filters('post_stati', $post_stati);
$orderby = 'date';
}
- $posts_per_page = get_user_option('edit_per_page');
- if ( empty($posts_per_page) )
+ $posts_per_page = (int) get_user_option( 'edit_per_page', 0, false );
+ if ( empty( $posts_per_page ) || $posts_per_page < 1 )
$posts_per_page = 15;
- $posts_per_page = apply_filters('edit_posts_per_page', $posts_per_page);
+ $posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page );
wp("post_type=post&$post_status_q&posts_per_page=$posts_per_page&order=$order&orderby=$orderby");
return array($post_stati, $avail_post_stati);
}
+/**
+ * Get default post mime types
+ *
+ * @since 2.9.0
+ *
+ * @return array
+ */
+function get_post_mime_types() {
+ $post_mime_types = array( // array( adj, noun )
+ 'image' => array(__('Images'), __('Manage Images'), _n_noop('Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>')),
+ 'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>')),
+ 'video' => array(__('Video'), __('Manage Video'), _n_noop('Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>')),
+ );
+
+ return apply_filters('post_mime_types', $post_mime_types);
+}
+
/**
* {@internal Missing Short Description}}
*
$q['m'] = isset( $q['m'] ) ? (int) $q['m'] : 0;
$q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0;
$q['post_type'] = 'attachment';
- $q['post_status'] = 'any';
- $media_per_page = get_user_option('upload_per_page');
- if ( empty($media_per_page) )
+ $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : 'inherit';
+ $media_per_page = (int) get_user_option( 'upload_per_page', 0, false );
+ if ( empty( $media_per_page ) || $media_per_page < 1 )
$media_per_page = 20;
- $q['posts_per_page'] = $media_per_page;
- $post_mime_types = array( // array( adj, noun )
- 'image' => array(__('Images'), __('Manage Images'), _n_noop('Image <span class="count">(%s)</span>', 'Images <span class="count">(%s)</span>')),
- 'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio <span class="count">(%s)</span>', 'Audio <span class="count">(%s)</span>')),
- 'video' => array(__('Video'), __('Manage Video'), _n_noop('Video <span class="count">(%s)</span>', 'Video <span class="count">(%s)</span>')),
- );
- $post_mime_types = apply_filters('post_mime_types', $post_mime_types);
+ $q['posts_per_page'] = apply_filters( 'upload_per_page', $media_per_page );
+ $post_mime_types = get_post_mime_types();
$avail_post_mime_types = get_available_post_mime_types('attachment');
if ( isset($q['post_mime_type']) && !array_intersect( (array) $q['post_mime_type'], array_keys($post_mime_types) ) )
*
* @since unknown
*
- * @param unknown_type $id
- * @param unknown_type $title
- * @param unknown_type $name
- * @return unknown
+ * @param int|object $id Post ID or post object.
+ * @param string $title (optional) Title
+ * @param string $name (optional) Name
+ * @return array With two entries of type string
*/
-function get_sample_permalink($id, $title=null, $name = null) {
+function get_sample_permalink($id, $title = null, $name = null) {
$post = &get_post($id);
if (!$post->ID) {
return array('', '');
// drafts, so we will fake, that our post is published
if (in_array($post->post_status, array('draft', 'pending'))) {
$post->post_status = 'publish';
- $post->post_name = sanitize_title($post->post_name? $post->post_name : $post->post_title, $post->ID);
+ $post->post_name = sanitize_title($post->post_name ? $post->post_name : $post->post_title, $post->ID);
}
$post->post_name = wp_unique_post_slug($post->post_name, $post->ID, $post->post_status, $post->post_type, $post->post_parent);
// If the user wants to set a new name -- override the current one
// Note: if empty name is supplied -- use the title instead, see #6072
if (!is_null($name)) {
- $post->post_name = sanitize_title($name? $name : $title, $post->ID);
+ $post->post_name = sanitize_title($name ? $name : $title, $post->ID);
}
$post->filter = 'sample';
}
/**
- * {@internal Missing Short Description}}
+ * sample permalink html
*
+ * intended to be used for the inplace editor of the permalink post slug on in the post (and page?) editor.
+ *
* @since unknown
*
- * @param unknown_type $id
- * @param unknown_type $new_title
- * @param unknown_type $new_slug
- * @return unknown
+ * @param int|object $id Post ID or post object.
+ * @param string $new_title (optional) New title
+ * @param string $new_slug (optional) New slug
+ * @return string intended to be used for the inplace editor of the permalink post slug on in the post (and page?) editor.
*/
function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
$post = &get_post($id);
list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);
- if ( 'publish' == $post->post_status )
+
+ if ( 'publish' == $post->post_status ) {
$view_post = 'post' == $post->post_type ? __('View Post') : __('View Page');
+ $title = __('Click to edit this part of the permalink');
+ } else {
+ $title = __('Temporary permalink. Click to edit this part.');
+ }
if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) {
$return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink">' . $permalink . "</span>\n";
- if ( current_user_can( 'manage_options' ) )
+ if ( current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) )
$return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button" target="_blank">' . __('Change Permalinks') . "</a></span>\n";
if ( isset($view_post) )
$return .= "<span id='view-post-btn'><a href='$permalink' class='button' target='_blank'>$view_post</a></span>\n";
+ $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug);
+
return $return;
}
- $title = __('Click to edit this part of the permalink');
- if (function_exists('mb_strlen')) {
- if (mb_strlen($post_name) > 30) {
+ if ( function_exists('mb_strlen') ) {
+ if ( mb_strlen($post_name) > 30 ) {
$post_name_abridged = mb_substr($post_name, 0, 14). '…' . mb_substr($post_name, -14);
} else {
$post_name_abridged = $post_name;
}
} else {
- if (strlen($post_name) > 30) {
+ if ( strlen($post_name) > 30 ) {
$post_name_abridged = substr($post_name, 0, 14). '…' . substr($post_name, -14);
} else {
$post_name_abridged = $post_name;
$display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink);
$view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink);
$return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink">' . $display_link . "</span>\n";
- $return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button hide-if-no-js" onclick="edit_permalink(' . $id . '); return false;">' . __('Edit') . "</a></span>\n";
+ $return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __('Edit') . "</a></span>\n";
$return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
if ( isset($view_post) )
$return .= "<span id='view-post-btn'><a href='$view_link' class='button' target='_blank'>$view_post</a></span>\n";
+ $return = apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug);
+
return $return;
}
/**
- * {@internal Missing Short Description}}
+ * Output HTML for the post thumbnail meta-box.
*
- * @since unknown
+ * @since 2.9.0
+ *
+ * @param int $thumbnail_id ID of the attachment used for thumbnail
+ * @return string html
+ */
+function _wp_post_thumbnail_html( $thumbnail_id = NULL ) {
+ global $content_width, $_wp_additional_image_sizes;
+ $content = '<p class="hide-if-no-js"><a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . esc_html__( 'Set thumbnail' ) . '</a></p>';
+
+ if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
+ $old_content_width = $content_width;
+ $content_width = 266;
+ if ( !isset( $_wp_additional_image_sizes['post-thumbnail'] ) )
+ $thumbnail_html = wp_get_attachment_image( $thumbnail_id, array( $content_width, $content_width ) );
+ else
+ $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-thumbnail' );
+ if ( !empty( $thumbnail_html ) ) {
+ $content = '<a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . $thumbnail_html . '</a>';
+ $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail();return false;">' . esc_html__( 'Remove thumbnail' ) . '</a></p>';
+ }
+ $content_width = $old_content_width;
+ }
+
+ return apply_filters( 'admin_post_thumbnail_html', $content );
+}
+
+/**
+ * Check to see if the post is currently being edited by another user.
*
- * @param unknown_type $post_id
+ * @since 2.5.0
+ *
+ * @param int $post_id ID of the post to check for editing
* @return bool|int False: not locked or locked by current user. Int: user ID of user with lock.
*/
function wp_check_post_lock( $post_id ) {
}
/**
- * {@internal Missing Short Description}}
+ * Mark the post as currently being edited by the current user
*
- * @since unknown
+ * @since 2.5.0
*
- * @param unknown_type $post_id
- * @return unknown
+ * @param int $post_id ID of the post to being edited
+ * @return bool Returns false if the post doesn't exist of there is no current user
*/
function wp_set_post_lock( $post_id ) {
global $current_user;
/**
* Outputs the notice message to say that someone else is editing this post at the moment.
- *
+ *
* @since 2.8.5
* @return none
*/
global $post;
$last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) );
$last_user_name = $last_user ? $last_user->display_name : __('Somebody');
-
+
switch ($post->post_type) {
case 'post':
$message = __( 'Warning: %s is currently editing this post' );
default:
$message = __( 'Warning: %s is currently editing this.' );
}
-
+
$message = sprintf( $message, esc_html( $last_user_name ) );
- echo "<div class='error'><p>$message</p></div>";
+ echo "<div class='error'><p>$message</p></div>";
}
/**
if ( $old_autosave = wp_get_post_autosave( $post_id ) ) {
$new_autosave = _wp_post_revision_fields( $_POST, true );
$new_autosave['ID'] = $old_autosave->ID;
+ $current_user = wp_get_current_user();
+ $new_autosave['post_author'] = $current_user->ID;
return wp_update_post( $new_autosave );
}
* to the URL when queueing them with the mce_external_plugins filter.
*
* @param bool $teeny optional Output a trimmed down version used in Press This.
+ * @param mixed $settings optional An array that can add to or overwrite the default TinyMCE settings.
*/
-function wp_tiny_mce( $teeny = false ) {
+function wp_tiny_mce( $teeny = false, $settings = false ) {
global $concatenate_scripts, $compress_scripts, $tinymce_version;
if ( ! user_can_richedit() )
$mce_spellchecker_languages = apply_filters('mce_spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv');
if ( $teeny ) {
- $plugins = apply_filters( 'teeny_mce_plugins', array('safari', 'inlinepopups', 'media', 'autosave', 'fullscreen') );
+ $plugins = apply_filters( 'teeny_mce_plugins', array('safari', 'inlinepopups', 'media', 'fullscreen', 'wordpress') );
$ext_plugins = '';
} else {
$plugins = array( 'safari', 'inlinepopups', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage', 'wpgallery', 'tabfocus' );
'accessibility_focus' => true,
'tabfocus_elements' => 'major-publishing-actions',
'media_strict' => false,
- 'save_callback' => 'switchEditors.saveCallback',
+ 'paste_remove_styles' => true,
+ 'paste_remove_spans' => true,
+ 'paste_strip_class_attributes' => 'all',
'wpeditimage_disable_captions' => $no_captions,
'plugins' => "$plugins"
);
if ( ! empty($mce_css) )
$initArray['content_css'] = "$mce_css";
+ if ( is_array($settings) )
+ $initArray = array_merge($initArray, $settings);
+
// For people who really REALLY know what they're doing with TinyMCE
// You can modify initArray to add, remove, change elements of the config before tinyMCE.init
// Setting "valid_elements", "invalid_elements" and "extended_valid_elements" can be done through "tiny_mce_before_init".
// Declare these as global in case schema.php is included from a function.
global $wpdb, $wp_queries;
-if ( $wpdb->has_cap( 'collation' ) ) {
- if ( ! empty($wpdb->charset) )
- $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
- if ( ! empty($wpdb->collate) )
- $charset_collate .= " COLLATE $wpdb->collate";
-}
+if ( ! empty($wpdb->charset) )
+ $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
+if ( ! empty($wpdb->collate) )
+ $charset_collate .= " COLLATE $wpdb->collate";
/** Create WordPress database tables SQL */
$wp_queries = "CREATE TABLE $wpdb->terms (
PRIMARY KEY (object_id,term_taxonomy_id),
KEY term_taxonomy_id (term_taxonomy_id)
) $charset_collate;
+CREATE TABLE $wpdb->commentmeta (
+ meta_id bigint(20) unsigned NOT NULL auto_increment,
+ comment_id bigint(20) unsigned NOT NULL default '0',
+ meta_key varchar(255) default NULL,
+ meta_value longtext,
+ PRIMARY KEY (meta_id),
+ KEY comment_id (comment_id),
+ KEY meta_key (meta_key)
+) $charset_collate;
CREATE TABLE $wpdb->comments (
comment_ID bigint(20) unsigned NOT NULL auto_increment,
comment_post_ID bigint(20) unsigned NOT NULL default '0',
option_name varchar(64) NOT NULL default '',
option_value longtext NOT NULL,
autoload varchar(20) NOT NULL default 'yes',
- PRIMARY KEY (option_id,blog_id,option_name),
- KEY option_name (option_name)
+ PRIMARY KEY (option_id),
+ UNIQUE KEY option_name (option_name)
) $charset_collate;
CREATE TABLE $wpdb->postmeta (
meta_id bigint(20) unsigned NOT NULL auto_increment,
do_action('populate_options');
if ( ini_get('safe_mode') ) {
- // Safe mode screws up mkdir(), so we must use a flat structure.
+ // Safe mode can break mkdir() so use a flat structure by default.
$uploads_use_yearmonth_folders = 0;
- $upload_path = WP_CONTENT_DIR;
} else {
$uploads_use_yearmonth_folders = 1;
- $upload_path = WP_CONTENT_DIR . '/uploads';
}
$options = array(
'require_name_email' => 1,
'comments_notify' => 1,
'posts_per_rss' => 10,
- 'rss_excerpt_length' => 50,
'rss_use_excerpt' => 0,
'mailserver_url' => 'mail.example.com',
'mailserver_login' => 'login@example.com',
// 2.0.1
'uploads_use_yearmonth_folders' => $uploads_use_yearmonth_folders,
- 'upload_path' => $upload_path,
+ 'upload_path' => '',
// 2.0.3
'secret' => wp_generate_password(64),
'widget_rss' => array(),
// 2.8
- 'timezone_string' => ''
+ 'timezone_string' => '',
+
+ // 2.9
+ 'embed_autourls' => 1,
+ 'embed_size_w' => '',
+ 'embed_size_h' => 600,
);
// Set autoload to no for these options
// Delete unused options
$unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', 'can_compress_scripts',
- 'page_uris', 'rewrite_rules', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed');
+ 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length');
foreach ($unusedoptions as $option)
delete_option($option);
+
+ // delete obsolete magpie stuff
+ $wpdb->query("DELETE FROM $wpdb->options WHERE option_name REGEXP '^rss_[0-9a-f]{32}(_ts)?$'");
}
/**
$output .= "<td $attributes>$edit";
$output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
$output .= '<div class="name">' . $qe_data->name . '</div>';
- $output .= '<div class="slug">' . $qe_data->slug . '</div>';
+ $output .= '<div class="slug">' . apply_filters('editable_slug', $qe_data->slug) . '</div>';
$output .= '<div class="cat_parent">' . $qe_data->parent . '</div></div></td>';
break;
case 'description':
$output .= "<td $attributes>$category->description</td>";
break;
case 'slug':
- $output .= "<td $attributes>$category->slug</td>";
+ $output .= "<td $attributes>" . apply_filters('editable_slug', $category->slug) . "</td>";
break;
case 'posts':
$attributes = 'class="posts column-posts num"' . $style;
$output .= "<td $attributes>$edit";
$output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
$output .= '<div class="name">' . $qe_data->name . '</div>';
- $output .= '<div class="slug">' . $qe_data->slug . '</div>';
+ $output .= '<div class="slug">' . apply_filters('editable_slug', $qe_data->slug) . '</div>';
$output .= '<div class="cat_parent">' . $qe_data->parent . '</div></div></td>';
break;
case 'description':
$output .= "<td $attributes>$category->description</td>";
break;
case 'slug':
- $output .= "<td $attributes>$category->slug</td>";
+ $output .= "<td $attributes>" . apply_filters('editable_slug', $category->slug) . "</td>";
break;
case 'links':
$attributes = 'class="links column-links num"' . $style;
*
* Compares the first two arguments and if identical marks as checked
*
- * @since 2.8
+ * @since 1.0
*
* @param any $checked One of the values to compare
* @param any $current (true) The other value to compare if not just true
*
* Compares the first two arguments and if identical marks as selected
*
- * @since 2.8
+ * @since 1.0
*
* @param any selected One of the values to compare
* @param any $current (true) The other value to compare if not just true
* @param string $type The type of checked|selected we are doing.
*/
function __checked_selected_helper( $helper, $current, $echo, $type) {
- if ( $helper == $current)
+ if ( (string) $helper === (string) $current)
$result = " $type='$type'";
else
$result = '';
* @param unknown_type $selected_cats
* @param unknown_type $popular_cats
*/
-function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null ) {
+function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
if ( empty($walker) || !is_a($walker, 'Walker') )
$walker = new Walker_Category_Checklist;
$categories = get_categories('get=all');
}
- // Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
- $checked_categories = array();
- $keys = array_keys( $categories );
+ if ( $checked_ontop ) {
+ // Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
+ $checked_categories = array();
+ $keys = array_keys( $categories );
- foreach( $keys as $k ) {
- if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) {
- $checked_categories[] = $categories[$k];
- unset( $categories[$k] );
+ foreach( $keys as $k ) {
+ if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) {
+ $checked_categories[] = $categories[$k];
+ unset( $categories[$k] );
+ }
}
- }
- // Put checked cats on top
- echo call_user_func_array(array(&$walker, 'walk'), array($checked_categories, 0, $args));
+ // Put checked cats on top
+ echo call_user_func_array(array(&$walker, 'walk'), array($checked_categories, 0, $args));
+ }
// Then the rest of them
echo call_user_func_array(array(&$walker, 'walk'), array($categories, 0, $args));
}
*/
function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) {
global $post_ID;
+
if ( $post_ID )
$checked_categories = wp_get_post_categories($post_ID);
else
$checked_categories = array();
+
$categories = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false ) );
$popular_ids = array();
if ( !$echo ) // hack for AJAX use
continue;
$id = "popular-category-$category->term_id";
+ $checked = in_array( $category->term_id, $checked_categories ) ? 'checked="checked"' : '';
?>
<li id="<?php echo $id; ?>" class="popular-category">
<label class="selectit">
- <input id="in-<?php echo $id; ?>" type="checkbox" value="<?php echo (int) $category->term_id; ?>" />
+ <input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $category->term_id; ?>" />
<?php echo esc_html( apply_filters( 'the_category', $category->name ) ); ?>
</label>
</li>
$actions = array();
$actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
$actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
- $actions['delete'] = "<a class='delete:the-list:tag-$tag->term_id submitdelete' href='" . wp_nonce_url("edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "'>" . __('Delete') . "</a>";
+ $actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url("edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "'>" . __('Delete') . "</a>";
$actions = apply_filters('tag_row_actions', $actions, $tag);
$action_count = count($actions);
$i = 0;
$out .= '</div>';
$out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
$out .= '<div class="name">' . $qe_data->name . '</div>';
- $out .= '<div class="slug">' . $qe_data->slug . '</div></div></td>';
+ $out .= '<div class="slug">' . apply_filters('editable_slug', $qe_data->slug) . '</div></div></td>';
break;
case 'description':
$out .= "<td $attributes>$tag->description</td>";
break;
case 'slug':
- $out .= "<td $attributes>$tag->slug</td>";
+ $out .= "<td $attributes>" . apply_filters('editable_slug', $tag->slug) . "</td>";
break;
case 'posts':
$attributes = 'class="posts column-posts num"' . $style;
$out = '';
$count = 0;
foreach( $tags as $tag )
- $out .= _tag_row( $tag, ++$count % 2 ? ' class="iedit alternate"' : ' class="iedit"', $taxonomy );
+ $out .= _tag_row( $tag, ++$count % 2 ? ' class="alternate"' : '', $taxonomy );
// filter and send to screen
echo $out;
$posts_columns['author'] = __('Author');
$posts_columns['categories'] = __('Categories');
$posts_columns['tags'] = __('Tags');
- if ( !isset($_GET['post_status']) || !in_array($_GET['post_status'], array('pending', 'draft', 'future')) )
+ $post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all';
+ if ( !in_array( $post_status, array('pending', 'draft', 'future') ) )
$posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>';
$posts_columns['date'] = __('Date');
$posts_columns = apply_filters('manage_posts_columns', $posts_columns);
$posts_columns['cb'] = '<input type="checkbox" />';
$posts_columns['title'] = __('Title');
$posts_columns['author'] = __('Author');
- $post_status = 'all';
- if ( !empty($_GET['post_status']) )
- $post_status = $_GET['post_status'];
- if ( !in_array($post_status, array('pending', 'draft', 'future')) )
+ $post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all';
+ if ( !in_array( $post_status, array('pending', 'draft', 'future') ) )
$posts_columns['comments'] = '<div class="vers"><img alt="" src="images/comment-grey-bubble.png" /></div>';
$posts_columns['date'] = __('Date');
$posts_columns = apply_filters('manage_pages_columns', $posts_columns);
<?php endif; // $bulk
- ob_start();
$authors = get_editable_user_ids( $current_user->id, true, $type ); // TODO: ROLE SYSTEM
+ $authors_dropdown = '';
if ( $authors && count( $authors ) > 1 ) :
- $users_opt = array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors', 'multi' => 1);
+ $users_opt = array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors', 'multi' => 1, 'echo' => 0);
if ( $bulk )
$users_opt['show_option_none'] = __('- No Change -');
-?>
- <label>
- <span class="title"><?php _e( 'Author' ); ?></span>
- <?php wp_dropdown_users( $users_opt ); ?>
- </label>
+ $authors_dropdown = '<label>';
+ $authors_dropdown .= '<span class="title">' . __( 'Author' ) . '</span>';
+ $authors_dropdown .= wp_dropdown_users( $users_opt );
+ $authors_dropdown .= '</label>';
-<?php
endif; // authors
- $authors_dropdown = ob_get_clean();
?>
<?php if ( !$bulk ) : echo $authors_dropdown; ?>
echo '
<div class="hidden" id="inline_' . $post->ID . '">
<div class="post_title">' . $title . '</div>
- <div class="post_name">' . $post->post_name . '</div>
+ <div class="post_name">' . apply_filters('editable_slug', $post->post_name) . '</div>
<div class="post_author">' . $post->post_author . '</div>
<div class="comment_status">' . $post->comment_status . '</div>
<div class="ping_status">' . $post->ping_status . '</div>
* @param unknown_type $mode
*/
function _post_row($a_post, $pending_comments, $mode) {
- global $post;
+ global $post, $current_user;
static $rowclass;
$global_post = $post;
setup_postdata($post);
$rowclass = 'alternate' == $rowclass ? '' : 'alternate';
- global $current_user;
$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
$edit_link = get_edit_post_link( $post->ID );
$title = _draft_or_post_title();
case 'title':
$attributes = 'class="post-title column-title"' . $style;
?>
- <td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; }; _post_states($post); ?></strong>
+ <td <?php echo $attributes ?>><strong><?php if ( current_user_can('edit_post', $post->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; }; _post_states($post); ?></strong>
<?php
if ( 'excerpt' == $mode )
the_excerpt();
$actions = array();
- if ( current_user_can('edit_post', $post->ID) ) {
+ if ( current_user_can('edit_post', $post->ID) && 'trash' != $post->post_status ) {
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this post')) . '">' . __('Edit') . '</a>';
$actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this post inline')) . '">' . __('Quick Edit') . '</a>';
}
if ( current_user_can('delete_post', $post->ID) ) {
- $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post')) . "' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
+ if ( 'trash' == $post->post_status )
+ $actions['untrash'] = "<a title='" . esc_attr(__('Restore this post from the Trash')) . "' href='" . wp_nonce_url("post.php?action=untrash&post=$post->ID", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>";
+ elseif ( EMPTY_TRASH_DAYS )
+ $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this post to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>";
+ if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
+ $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
}
if ( in_array($post->post_status, array('pending', 'draft')) ) {
if ( current_user_can('edit_post', $post->ID) )
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
- } else {
+ } elseif ( 'trash' != $post->post_status ) {
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
}
$actions = apply_filters('post_row_actions', $actions, $post);
$attributes = 'class="post-title page-title column-title"' . $style;
$edit_link = get_edit_post_link( $page->ID );
?>
- <td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_page', $page->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . __('Parent Page: ') . esc_html($parent_name) : ''; ?></strong>
+ <td <?php echo $attributes ?>><strong><?php if ( current_user_can('edit_page', $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . __('Parent Page: ') . esc_html($parent_name) : ''; ?></strong>
<?php
$actions = array();
- if ( current_user_can('edit_page', $page->ID) ) {
+ if ( current_user_can('edit_page', $page->ID) && $post->post_status != 'trash' ) {
$actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>';
$actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
}
if ( current_user_can('delete_page', $page->ID) ) {
- $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
+ if ( $post->post_status == 'trash' )
+ $actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("page.php?action=untrash&post=$page->ID", 'untrash-page_' . $page->ID) . "'>" . __('Restore') . "</a>";
+ elseif ( EMPTY_TRASH_DAYS )
+ $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($page->ID) . "'>" . __('Trash') . "</a>";
+ if ( $post->post_status == 'trash' || !EMPTY_TRASH_DAYS )
+ $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>";
}
if ( in_array($post->post_status, array('pending', 'draft')) ) {
if ( current_user_can('edit_page', $page->ID) )
$actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
- } else {
+ } elseif ( $post->post_status != 'trash' ) {
$actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
}
$actions = apply_filters('page_row_actions', $actions, $page);
if ( !( is_object( $user_object) && is_a( $user_object, 'WP_User' ) ) )
$user_object = new WP_User( (int) $user_object );
+ $user_object = sanitize_user_object($user_object, 'display');
$email = $user_object->user_email;
$url = $user_object->user_url;
$short_url = str_replace( 'http://', '', $url );
*
* @since unknown
*
- * @param unknown_type $status
- * @param unknown_type $s
- * @param unknown_type $start
- * @param unknown_type $num
- * @param unknown_type $post
- * @param unknown_type $type
- * @return unknown
+ * @param string $status Comment status (approved, spam, trash, etc)
+ * @param string $s Term to search for
+ * @param int $start Offset to start at for pagination
+ * @param int $num Maximum number of comments to return
+ * @param int $post Post ID or 0 to return all comments
+ * @param string $type Comment type (comment, trackback, pingback, etc)
+ * @return array [0] contains the comments and [1] contains the total number of comments that match (ignoring $start and $num)
*/
function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) {
global $wpdb;
$index = '';
if ( 'moderated' == $status ) {
- $approved = "comment_approved = '0'";
+ $approved = "c.comment_approved = '0'";
$total = $count->moderated;
} elseif ( 'approved' == $status ) {
- $approved = "comment_approved = '1'";
+ $approved = "c.comment_approved = '1'";
$total = $count->approved;
} elseif ( 'spam' == $status ) {
- $approved = "comment_approved = 'spam'";
+ $approved = "c.comment_approved = 'spam'";
$total = $count->spam;
+ } elseif ( 'trash' == $status ) {
+ $approved = "c.comment_approved = 'trash'";
+ $total = $count->trash;
} else {
- $approved = "( comment_approved = '0' OR comment_approved = '1' )";
+ $approved = "( c.comment_approved = '0' OR c.comment_approved = '1' )";
$total = $count->moderated + $count->approved;
- $index = 'USE INDEX (comment_date_gmt)';
+ $index = 'USE INDEX (c.comment_date_gmt)';
}
if ( $post ) {
$total = '';
- $post = " AND comment_post_ID = '$post'";
- $orderby = "ORDER BY comment_date_gmt ASC LIMIT $start, $num";
+ $post = " AND c.comment_post_ID = '$post'";
} else {
$post = '';
- $orderby = "ORDER BY comment_date_gmt DESC LIMIT $start, $num";
}
+ $orderby = "ORDER BY c.comment_date_gmt DESC LIMIT $start, $num";
+
if ( 'comment' == $type )
- $typesql = "AND comment_type = ''";
- elseif ( 'pingback' == $type )
- $typesql = "AND comment_type = 'pingback'";
- elseif ( 'trackback' == $type )
- $typesql = "AND comment_type = 'trackback'";
+ $typesql = "AND c.comment_type = ''";
elseif ( 'pings' == $type )
- $typesql = "AND ( comment_type = 'pingback' OR comment_type = 'trackback' )";
+ $typesql = "AND ( c.comment_type = 'pingback' OR c.comment_type = 'trackback' )";
+ elseif ( 'all' == $type )
+ $typesql = '';
+ elseif ( !empty($type) )
+ $typesql = $wpdb->prepare("AND c.comment_type = %s", $type);
else
$typesql = '';
if ( !empty($type) )
$total = '';
+ $query = "FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ";
if ( $s ) {
$total = '';
$s = $wpdb->escape($s);
- $query = "FROM $wpdb->comments WHERE
- (comment_author LIKE '%$s%' OR
- comment_author_email LIKE '%$s%' OR
- comment_author_url LIKE ('%$s%') OR
- comment_author_IP LIKE ('%$s%') OR
- comment_content LIKE ('%$s%') ) AND
+ $query .= "AND
+ (c.comment_author LIKE '%$s%' OR
+ c.comment_author_email LIKE '%$s%' OR
+ c.comment_author_url LIKE ('%$s%') OR
+ c.comment_author_IP LIKE ('%$s%') OR
+ c.comment_content LIKE ('%$s%') ) AND
$approved
$typesql";
} else {
- $query = "FROM $wpdb->comments $index WHERE $approved $post $typesql";
+ $query .= "AND $approved $post $typesql";
}
$comments = $wpdb->get_results("SELECT * $query $orderby");
if ( '' === $total )
- $total = $wpdb->get_var("SELECT COUNT(comment_ID) $query");
+ $total = $wpdb->get_var("SELECT COUNT(c.comment_ID) $query");
update_comment_cache($comments);
else
$ptime = mysql2date(__('Y/m/d \a\t g:i A'), $comment->comment_date );
- $delete_url = esc_url( wp_nonce_url( "comment.php?action=deletecomment&p=$post->ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
- $approve_url = esc_url( wp_nonce_url( "comment.php?action=approvecomment&p=$post->ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) );
- $unapprove_url = esc_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$post->ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) );
- $spam_url = esc_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$post->ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
+ if ( $user_can ) {
+ $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
+ $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );
+
+ $approve_url = esc_url( "comment.php?action=approvecomment&p=$post->ID&c=$comment->comment_ID&$approve_nonce" );
+ $unapprove_url = esc_url( "comment.php?action=unapprovecomment&p=$post->ID&c=$comment->comment_ID&$approve_nonce" );
+ $spam_url = esc_url( "comment.php?action=spamcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
+ $unspam_url = esc_url( "comment.php?action=unspamcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
+ $trash_url = esc_url( "comment.php?action=trashcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
+ $untrash_url = esc_url( "comment.php?action=untrashcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
+ $delete_url = esc_url( "comment.php?action=deletecomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
+ }
echo "<tr id='comment-$comment->comment_ID' class='$the_comment_status'>";
$columns = get_column_headers('edit-comments');
echo '<div id="submitted-on">';
printf(__('Submitted on <a href="%1$s">%2$s at %3$s</a>'), get_comment_link($comment->comment_ID), get_comment_date(__('Y/m/d')), get_comment_date(__('g:ia')));
echo '</div>';
- comment_text(); ?>
+ comment_text();
+ if ( $user_can ) { ?>
<div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
- <textarea class="comment" rows="3" cols="10"><?php echo $comment->comment_content; ?></textarea>
- <div class="author-email"><?php if ( $user_can ) echo esc_attr( $comment->comment_author_email ); ?></div>
- <div class="author"><?php if ( $user_can ) echo esc_attr( $comment->comment_author ); ?></div>
+ <textarea class="comment" rows="1" cols="1"><?php echo htmlspecialchars( apply_filters('comment_edit_pre', $comment->comment_content), ENT_QUOTES ); ?></textarea>
+ <div class="author-email"><?php echo esc_attr( $comment->comment_author_email ); ?></div>
+ <div class="author"><?php echo esc_attr( $comment->comment_author ); ?></div>
<div class="author-url"><?php echo esc_attr( $comment->comment_author_url ); ?></div>
<div class="comment_status"><?php echo $comment->comment_approved; ?></div>
</div>
<?php
- $actions = array();
+ }
if ( $user_can ) {
- $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
- $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
+ // preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash
+ $actions = array(
+ 'approve' => '', 'unapprove' => '',
+ 'reply' => '',
+ 'quickedit' => '',
+ 'edit' => '',
+ 'spam' => '', 'unspam' => '',
+ 'trash' => '', 'untrash' => '', 'delete' => ''
+ );
+
if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments
- if ( 'approved' == $the_comment_status ) {
+ if ( 'approved' == $the_comment_status )
$actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved vim-u vim-destructive' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
- unset($actions['approve']);
- } else {
+ else if ( 'unapproved' == $the_comment_status )
$actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved vim-a vim-destructive' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
- unset($actions['unapprove']);
- }
+ } else {
+ $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
+ $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
}
- if ( 'spam' != $the_comment_status )
+
+ if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {
$actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
- $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
- $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
- $actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>';
- if ( 'spam' != $the_comment_status )
- $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\');return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
+ } elseif ( 'spam' == $the_comment_status ) {
+ $actions['unspam'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1 vim-z vim-destructive'>" . __( 'Not Spam' ) . '</a>';
+ } elseif ( 'trash' == $the_comment_status ) {
+ $actions['untrash'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1 vim-z vim-destructive'>" . __( 'Restore' ) . '</a>';
+ }
+
+ if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) {
+ $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::delete=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
+ } else {
+ $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . __( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
+ }
+
+ if ( 'trash' != $the_comment_status ) {
+ $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
+ $actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>';
+ if ( 'spam' != $the_comment_status )
+ $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\');return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
+ }
- $actions = apply_filters( 'comment_row_actions', $actions, $comment );
+ $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
$i = 0;
echo '<div class="row-actions">';
// Reply and quickedit need a hide-if-no-js span when not added with ajax
if ( ('reply' == $action || 'quickedit' == $action) && ! $from_ajax )
$action .= ' hide-if-no-js';
+ elseif ( ($action == 'untrash' && $the_comment_status == 'trash') || ($action == 'unspam' && $the_comment_status == 'spam') ) {
+ if ('1' == get_comment_meta($comment_id, '_wp_trash_meta_status', true))
+ $action .= ' approve';
+ else
+ $action .= ' unapprove';
+ }
echo "<span class='$action'>$sep$link</span>";
}
?>
<form method="get" action="">
<?php if ( $table_row ) : ?>
-<table style="display:none;"><tbody id="com-reply"><tr id="replyrow"><td colspan="<?php echo $col_count; ?>">
+<table style="display:none;"><tbody id="com-reply"><tr id="replyrow" style="display:none;"><td colspan="<?php echo $col_count; ?>">
<?php else : ?>
-<div id="com-reply" style="display:none;"><div id="replyrow">
+<div id="com-reply" style="display:none;"><div id="replyrow" style="display:none;">
<?php endif; ?>
<div id="replyhead" style="display:none;"><?php _e('Reply to Comment'); ?></div>
<?php
}
+/**
+ * Output 'undo move to trash' text for comments
+ *
+ * @since 2.9.0
+ */
+function wp_comment_trashnotice() {
+?>
+<div class="hidden" id="trash-undo-holder">
+ <div class="trash-undo-inside"><?php printf(__('Comment by %s moved to the trash.'), '<strong></strong>'); ?> <span class="undo untrash"><a href="#"><?php _e('Undo'); ?></a></span></div>
+</div>
+<div class="hidden" id="spam-undo-holder">
+ <div class="spam-undo-inside"><?php printf(__('Comment by %s marked as spam.'), '<strong></strong>'); ?> <span class="undo unspam"><a href="#"><?php _e('Undo'); ?></a></span></div>
+</div>
+<?php
+}
+
/**
* {@internal Missing Short Description}}
*
$year = '<input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" />';
$hour = '<input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
$minute = '<input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
+
+ echo '<div class="timestamp-wrap">';
/* translators: 1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input */
printf(__('%1$s%2$s, %3$s @ %4$s : %5$s'), $month, $day, $year, $hour, $minute);
- echo '<input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
+ echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
if ( $multi ) return;
}
/**
- * {@internal Missing Short Description}}
+ * Outputs the form used by the importers to accept the data to be imported
*
- * @since unknown
+ * @since 2.0
*
- * @param unknown_type $action
+ * @param string $action The action attribute for the form.
*/
function wp_import_upload_form( $action ) {
$bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
<p><strong><?php echo $upload_dir['error']; ?></strong></p></div><?php
else :
?>
-<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo esc_attr($action) ?>">
+<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo esc_attr(wp_nonce_url($action, 'import-upload')); ?>">
<p>
-<?php wp_nonce_field('import-upload'); ?>
<label for="upload"><?php _e( 'Choose a file from your computer:' ); ?></label> (<?php printf( __('Maximum size: %s' ), $size ); ?>)
<input type="file" id="upload" name="import" size="25" />
<input type="hidden" name="action" value="save" />
// Hide slug boxes by default
if ( empty($hidden[0]) ) {
- if ( 'page' == $page )
- $hidden = array('pageslugdiv');
- elseif ( 'post' == $page )
- $hidden = array('slugdiv');
+ $hidden = array('slugdiv');
}
return $hidden;
else
echo '<th scope="row">' . $field['title'] . '</th>';
echo '<td>';
- call_user_func($field['callback']);
+ call_user_func($field['callback'], $field['args']);
echo '</td>';
echo '</tr>';
}
return '';
}
- $option = str_replace('-', '_', "${screen}_per_page");
- $per_page = get_user_option($option);
- if ( empty($per_page) ) {
+ $option = str_replace( '-', '_', "${screen}_per_page" );
+ $per_page = (int) get_user_option( $option, 0, false );
+ if ( empty( $per_page ) || $per_page < 1 ) {
if ( 'plugins' == $screen )
$per_page = 999;
else
$per_page = 20;
}
+ if ( 'edit_comments_per_page' == $option )
+ $per_page = apply_filters( 'comments_per_page', $per_page, isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all' );
+ elseif ( 'categories' == $option )
+ $per_page = apply_filters( 'edit_categories_per_page', $per_page );
+ else
+ $per_page = apply_filters( $option, $per_page );
$return = '<h5>' . __('Options') . "</h5>\n";
$return .= "<div class='screen-options'>\n";
$ct->description = $themes[$current_theme]['Description'];
$ct->author = $themes[$current_theme]['Author'];
$ct->tags = $themes[$current_theme]['Tags'];
+ $ct->theme_root = $themes[$current_theme]['Theme Root'];
+ $ct->theme_root_uri = $themes[$current_theme]['Theme Root URI'];
return $ct;
}
}
/**
- * {@internal Missing Short Description}}
+ * Get the Page Templates available in this theme
*
* @since unknown
*
- * @return unknown
+ * @return array Key is template name, Value is template name
*/
function get_page_templates() {
$themes = get_themes();
$theme = get_current_theme();
$templates = $themes[$theme]['Template Files'];
- $page_templates = array ();
+ $page_templates = array();
if ( is_array( $templates ) ) {
+ $base = array( trailingslashit(get_template_directory()), trailingslashit(get_stylesheet_directory()) );
+
foreach ( $templates as $template ) {
- $template_data = implode( '', file( WP_CONTENT_DIR.$template ));
+ $basename = str_replace($base, '', $template);
+
+ // don't allow template files in subdirectories
+ if ( false !== strpos($basename, '/') )
+ continue;
+
+ $template_data = implode( '', file( $template ));
$name = '';
if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ) )
$name = _cleanup_header_comment($name[1]);
if ( !empty( $name ) ) {
- $page_templates[trim( $name )] = basename( $template );
+ $page_templates[trim( $name )] = $basename;
}
}
}
return $page_templates;
}
+/**
+ * Tidies a filename for url display by the theme editor.
+ *
+ * @since 2.9.0
+ * @private
+ *
+ * @param string $fullpath Full path to the theme file
+ * @param string $containingfolder Path of the theme parent folder
+ * @return string
+ */
+function _get_template_edit_filename($fullpath, $containingfolder) {
+ return str_replace(dirname(dirname( $containingfolder )) , '', $fullpath);
+}
+
?>
'wp-admin/js/link-cat.js',
'wp-admin/js/forms.js',
'wp-admin/js/upload.js',
+'wp-admin/js/set-post-thumbnail-handler.js',
+'wp-admin/js/set-post-thumbnail-handler.dev.js',
+'wp-admin/js/page.js',
+'wp-admin/js/page.dev.js',
+'wp-admin/js/slug.js',
+'wp-admin/js/slug.dev.js',
'wp-admin/profile-update.php',
'wp-admin/templates.php',
'wp-includes/images/audio.png',
'wp-images/smilies',
'wp-images/wp-small.png',
'wp-images/wpminilogo.png',
-'wp.php'
+'wp.php',
+'wp-includes/gettext.php',
+'wp-includes/streams.php'
);
/**
* @return WP_Error|null WP_Error on failure, null on success.
*/
function update_core($from, $to) {
- global $wp_filesystem, $_old_files;
+ global $wp_filesystem, $_old_files, $wpdb;
@set_time_limit( 300 );
+ $php_version = phpversion();
+ $mysql_version = $wpdb->db_version();
+ $required_php_version = '4.3';
+ $required_mysql_version = '4.1.2';
+ $wp_version = '2.9';
+ $php_compat = version_compare( $php_version, $required_php_version, '>=' );
+ $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
+
+ if ( !$mysql_compat && !$php_compat )
+ return new WP_Error( 'php_mysql_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) );
+ elseif ( !$php_compat )
+ return new WP_Error( 'php_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version ) );
+ elseif ( !$mysql_compat )
+ return new WP_Error( 'mysql_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ) );
+
// Sanity check the unzipped distribution
apply_filters('update_feedback', __('Verifying the unpacked files'));
if ( !$wp_filesystem->exists($from . '/wordpress/wp-settings.php') || !$wp_filesystem->exists($from . '/wordpress/wp-admin/admin.php') ||
* WordPress Administration Update API
*
* @package WordPress
- * @subpackage Admin
+ * @subpackage Administration
*/
// The admin side of our 1.1 update system
echo "<span id='wp-version-message'>$msg</span>";
}
+function get_plugin_updates() {
+ $all_plugins = get_plugins();
+ $upgrade_plugins = array();
+ $current = get_transient( 'update_plugins' );
+ foreach ( (array)$all_plugins as $plugin_file => $plugin_data) {
+ if ( isset( $current->response[ $plugin_file ] ) ) {
+ $upgrade_plugins[ $plugin_file ] = (object) $plugin_data;
+ $upgrade_plugins[ $plugin_file ]->update = $current->response[ $plugin_file ];
+ }
+ }
+
+ return $upgrade_plugins;
+}
+
+function wp_plugin_update_rows() {
+ $plugins = get_transient( 'update_plugins' );
+ if ( isset($plugins->response) && is_array($plugins->response) ) {
+ $plugins = array_keys( $plugins->response );
+ foreach( $plugins as $plugin_file ) {
+ add_action( "after_plugin_row_$plugin_file", 'wp_plugin_update_row', 10, 2 );
+ }
+ }
+}
+add_action( 'admin_init', 'wp_plugin_update_rows' );
+
function wp_plugin_update_row( $file, $plugin_data ) {
$current = get_transient( 'update_plugins' );
if ( !isset( $current->response[ $file ] ) )
echo '</div></td></tr>';
}
-add_action( 'after_plugin_row', 'wp_plugin_update_row', 10, 2 );
function wp_update_plugin($plugin, $feedback = '') {
return $upgrader->upgrade($plugin);
}
+function get_theme_updates() {
+ $themes = get_themes();
+ $current = get_transient('update_themes');
+ $update_themes = array();
+
+ foreach ( $themes as $theme ) {
+ $theme = (object) $theme;
+ if ( isset($current->response[ $theme->Stylesheet ]) ) {
+ $update_themes[$theme->Stylesheet] = $theme;
+ $update_themes[$theme->Stylesheet]->update = $current->response[ $theme->Stylesheet ];
+ }
+ }
+
+ return $update_themes;
+}
+
function wp_update_theme($theme, $feedback = '') {
if ( !empty($feedback) )
wp_check_mysql_version();
wp_cache_flush();
+ pre_schema_upgrade();
make_db_current_silent();
upgrade_all();
wp_cache_flush();
if ( $wp_current_db_version < 10360 )
upgrade_280();
+ if ( $wp_current_db_version < 11958 )
+ upgrade_290();
+
maybe_disable_automattic_widgets();
update_option( 'db_version', $wp_db_version );
if ( 1 != $option->dupes ) { // Could this be done in the query?
$limit = $option->dupes - 1;
$dupe_ids = $wpdb->get_col( $wpdb->prepare("SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d", $option->option_name, $limit) );
- $dupe_ids = join($dupe_ids, ',');
- $wpdb->query("DELETE FROM $wpdb->options WHERE option_id IN ($dupe_ids)");
+ if ( $dupe_ids ) {
+ $dupe_ids = join($dupe_ids, ',');
+ $wpdb->query("DELETE FROM $wpdb->options WHERE option_id IN ($dupe_ids)");
+ }
}
}
populate_roles_280();
}
+/**
+ * Execute changes made in WordPress 2.9.
+ *
+ * @since 2.9.0
+ */
+function upgrade_290() {
+ global $wp_current_db_version;
+
+ if ( $wp_current_db_version < 11958 ) {
+ // Previously, setting depth to 1 would redundantly disable threading, but now 2 is the minimum depth to avoid confusion
+ if ( get_option( 'thread_comments_depth' ) == '1' ) {
+ update_option( 'thread_comments_depth', 2 );
+ update_option( 'thread_comments', 0 );
+ }
+ }
+}
+
// The functions we use to actually do stuff
}
}
+/**
+ * Runs before the schema is upgraded.
+ */
+function pre_schema_upgrade() {
+ global $wp_current_db_version, $wp_db_version, $wpdb;
+
+ // Upgrade versions prior to 2.9
+ if ( $wp_current_db_version < 11557 ) {
+ // Delete duplicate options. Keep the option with the highest option_id.
+ $delete_options = $wpdb->get_col("SELECT o1.option_id FROM $wpdb->options AS o1 JOIN $wpdb->options AS o2 ON o2.option_name = o1.option_name AND o2.option_id > o1.option_id");
+ if ( !empty($delete_options) ) {
+ $delete_options = implode(',', $delete_options);
+ $wpdb->query("DELETE FROM $wpdb->options WHERE option_id IN ($delete_options)");
+ }
+
+ // Drop the old primary key and add the new.
+ $wpdb->query("ALTER TABLE $wpdb->options DROP PRIMARY KEY, ADD PRIMARY KEY(option_id)");
+
+ // Drop the old option_name index. dbDelta() doesn't do the drop.
+ $wpdb->query("ALTER TABLE $wpdb->options DROP INDEX option_name");
+ }
+
+}
+
?>
* Creates a new user from the "Users" form using $_POST information.
*
* It seems that the first half is for backwards compatibility, but only
- * has the ability to alter the user's role. Wordpress core seems to
+ * has the ability to alter the user's role. WordPress core seems to
* use this function only in the second way, running edit_user() with
* no id so as to create a new user.
*
$user_id = (int) func_get_arg( 0 );
if ( isset( $_POST['role'] ) ) {
+ $new_role = sanitize_text_field( $_POST['role'] );
// Don't let anyone with 'edit_users' (admins) edit their own role to something without it.
- if( $user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap( 'edit_users' ) ) {
+ if ( $user_id != $current_user->id || $wp_roles->role_objects[$new_role]->has_cap( 'edit_users' ) ) {
// If the new role isn't editable by the logged-in user die with error
$editable_roles = get_editable_roles();
- if (!$editable_roles[$_POST['role']])
+ if ( !$editable_roles[$new_role] )
wp_die(__('You can’t give users that role.'));
$user = new WP_User( $user_id );
- $user->set_role( $_POST['role'] );
+ $user->set_role( $new_role );
}
}
} else {
$user = '';
}
- if ( isset( $_POST['user_login'] ))
- $user->user_login = esc_html( trim( $_POST['user_login'] ));
+ if ( !$update && isset( $_POST['user_login'] ) )
+ $user->user_login = sanitize_user($_POST['user_login'], true);
$pass1 = $pass2 = '';
if ( isset( $_POST['pass1'] ))
$pass2 = $_POST['pass2'];
if ( isset( $_POST['role'] ) && current_user_can( 'edit_users' ) ) {
-
+ $new_role = sanitize_text_field( $_POST['role'] );
// Don't let anyone with 'edit_users' (admins) edit their own role to something without it.
- if( $user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap( 'edit_users' ))
- $user->role = $_POST['role'];
+ if( $user_id != $current_user->id || $wp_roles->role_objects[$new_role]->has_cap( 'edit_users' ))
+ $user->role = $new_role;
// If the new role isn't editable by the logged-in user die with error
$editable_roles = get_editable_roles();
- if (!$editable_roles[$_POST['role']])
+ if ( !$editable_roles[$new_role] )
wp_die(__('You can’t give users that role.'));
}
if ( isset( $_POST['email'] ))
- $user->user_email = esc_html( trim( $_POST['email'] ));
+ $user->user_email = sanitize_text_field( $_POST['email'] );
if ( isset( $_POST['url'] ) ) {
if ( empty ( $_POST['url'] ) || $_POST['url'] == 'http://' ) {
$user->user_url = '';
} else {
- $user->user_url = esc_url( trim( $_POST['url'] ));
+ $user->user_url = sanitize_url( $_POST['url'] );
$user->user_url = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url;
}
}
- if ( isset( $_POST['first_name'] ))
- $user->first_name = esc_html( trim( $_POST['first_name'] ));
- if ( isset( $_POST['last_name'] ))
- $user->last_name = esc_html( trim( $_POST['last_name'] ));
- if ( isset( $_POST['nickname'] ))
- $user->nickname = esc_html( trim( $_POST['nickname'] ));
- if ( isset( $_POST['display_name'] ))
- $user->display_name = esc_html( trim( $_POST['display_name'] ));
- if ( isset( $_POST['description'] ))
+ if ( isset( $_POST['first_name'] ) )
+ $user->first_name = sanitize_text_field( $_POST['first_name'] );
+ if ( isset( $_POST['last_name'] ) )
+ $user->last_name = sanitize_text_field( $_POST['last_name'] );
+ if ( isset( $_POST['nickname'] ) )
+ $user->nickname = sanitize_text_field( $_POST['nickname'] );
+ if ( isset( $_POST['display_name'] ) )
+ $user->display_name = sanitize_text_field( $_POST['display_name'] );
+
+ if ( isset( $_POST['description'] ) )
$user->description = trim( $_POST['description'] );
- if ( isset( $_POST['jabber'] ))
- $user->jabber = esc_html( trim( $_POST['jabber'] ));
- if ( isset( $_POST['aim'] ))
- $user->aim = esc_html( trim( $_POST['aim'] ));
- if ( isset( $_POST['yim'] ))
- $user->yim = esc_html( trim( $_POST['yim'] ));
- if ( !$update )
- $user->rich_editing = 'true'; // Default to true for new users.
- else if ( isset( $_POST['rich_editing'] ) )
- $user->rich_editing = $_POST['rich_editing'];
- else
- $user->rich_editing = 'true';
- $user->comment_shortcuts = isset( $_POST['comment_shortcuts'] )? $_POST['comment_shortcuts'] : '';
+ foreach ( _wp_get_user_contactmethods() as $method => $name ) {
+ if ( isset( $_POST[$method] ))
+ $user->$method = sanitize_text_field( $_POST[$method] );
+ }
+
+ if ( $update ) {
+ $user->rich_editing = isset( $_POST['rich_editing'] ) && 'false' == $_POST['rich_editing'] ? 'false' : 'true';
+ $user->admin_color = isset( $_POST['admin_color'] ) ? sanitize_text_field( $_POST['admin_color'] ) : 'fresh';
+ }
+
+ $user->comment_shortcuts = isset( $_POST['comment_shortcuts'] ) && 'true' == $_POST['comment_shortcuts'] ? 'true' : '';
$user->use_ssl = 0;
if ( !empty($_POST['use_ssl']) )
$user->use_ssl = 1;
- if ( !$update )
- $user->admin_color = 'fresh'; // Default to fresh for new users.
- else if ( isset( $_POST['admin_color'] ) )
- $user->admin_color = $_POST['admin_color'];
- else
- $user->admin_color = 'fresh';
-
$errors = new WP_Error();
/* checking that username has been typed */
if ( $pass1 != $pass2 )
$errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter the same password in the two password fields.' ), array( 'form-field' => 'pass1' ) );
- if (!empty ( $pass1 ))
+ if ( !empty( $pass1 ) )
$user->user_pass = $pass1;
if ( !$update && !validate_username( $user->user_login ) )
$errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is invalid. Please enter a valid username.' ));
- if (!$update && username_exists( $user->user_login ))
+ if ( !$update && username_exists( $user->user_login ) )
$errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ));
/* checking e-mail address */
- if ( empty ( $user->user_email ) ) {
+ if ( empty( $user->user_email ) ) {
$errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please enter an e-mail address.' ), array( 'form-field' => 'email' ) );
- } elseif (!is_email( $user->user_email ) ) {
+ } elseif ( !is_email( $user->user_email ) ) {
$errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The e-mail address isn’t correct.' ), array( 'form-field' => 'email' ) );
} elseif ( ( $owner_id = email_exists($user->user_email) ) && $owner_id != $user->ID ) {
$errors->add( 'email_exists', __('<strong>ERROR</strong>: This email is already registered, please choose another one.'), array( 'form-field' => 'email' ) );
}
- // Allow plugins to return there own errors.
+ // Allow plugins to return their own errors.
do_action_ref_array('user_profile_update_errors', array ( &$errors, $update, &$user ) );
if ( $errors->get_error_codes() )
return $errors;
if ( $update ) {
- $user_id = wp_update_user( get_object_vars( $user ));
+ $user_id = wp_update_user( get_object_vars( $user ) );
} else {
- $user_id = wp_insert_user( get_object_vars( $user ));
+ $user_id = wp_insert_user( get_object_vars( $user ) );
wp_new_user_notification( $user_id, isset($_POST['send_password']) ? $pass1 : '' );
}
return $user_id;
*/
function get_user_to_edit( $user_id ) {
$user = new WP_User( $user_id );
- $user->user_login = esc_attr($user->user_login);
- $user->user_email = esc_attr($user->user_email);
- $user->user_url = esc_url($user->user_url);
- $user->first_name = esc_attr($user->first_name);
- $user->last_name = esc_attr($user->last_name);
- $user->display_name = esc_attr($user->display_name);
- $user->nickname = esc_attr($user->nickname);
- $user->aim = isset( $user->aim ) && !empty( $user->aim ) ? esc_attr($user->aim) : '';
- $user->yim = isset( $user->yim ) && !empty( $user->yim ) ? esc_attr($user->yim) : '';
- $user->jabber = isset( $user->jabber ) && !empty( $user->jabber ) ? esc_attr($user->jabber) : '';
- $user->description = isset( $user->description ) && !empty( $user->description ) ? esc_html($user->description) : '';
+
+ $user_contactmethods = _wp_get_user_contactmethods();
+ foreach ($user_contactmethods as $method => $name) {
+ if ( empty( $user->{$method} ) )
+ $user->{$method} = '';
+ }
+
+ if ( empty($user->description) )
+ $user->description = '';
+
+ $user = sanitize_user_object($user, 'edit');
return $user;
}
}
/**
- * {@internal Missing Short Description}}
+ * Show the widgets and their settings for a sidebar.
+ * Used in the the admin widget config screen.
*
* @since unknown
*
- * @param string $sidebar
+ * @param string $sidebar id slug of the sidebar
*/
function wp_list_widget_controls( $sidebar ) {
add_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' );
- echo "\t<div id='$sidebar' class='widgets-sortables'>\n";
+ echo "<div id='$sidebar' class='widgets-sortables'>\n";
+
+ $description = wp_sidebar_description( $sidebar );
+
+ if ( !empty( $description ) ) {
+ echo "<div class='sidebar-description'>\n";
+ echo "\t<p class='description'>$description</p>";
+ echo "</div>\n";
+ }
+
dynamic_sidebar( $sidebar );
- echo "\t</div>\n";
+ echo "</div>\n";
}
/**
</div>
<input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr($id_format); ?>" />
<input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr($id_base); ?>" />
- <input type="hidden" name="widget-width" class="widget-width" value="<?php echo esc_attr($control['width']); ?>" />
- <input type="hidden" name="widget-height" class="widget-height" value="<?php echo esc_attr($control['height']); ?>" />
+ <input type="hidden" name="widget-width" class="widget-width" value="<?php if (isset( $control['width'] )) echo esc_attr($control['width']); ?>" />
+ <input type="hidden" name="widget-height" class="widget-height" value="<?php if (isset( $control['height'] )) echo esc_attr($control['height']); ?>" />
<input type="hidden" name="widget_number" class="widget_number" value="<?php echo esc_attr($widget_number); ?>" />
<input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr($multi_number); ?>" />
<input type="hidden" name="add_new" class="add_new" value="<?php echo esc_attr($add_new); ?>" />
<div class="widget-control-actions">
<div class="alignleft">
- <a class="widget-control-remove" href="#remove"><?php _e('Remove'); ?></a> |
+ <a class="widget-control-remove" href="#remove"><?php _e('Delete'); ?></a> |
<a class="widget-control-close" href="#close"><?php _e('Close'); ?></a>
</div>
<div class="alignright<?php if ( 'noform' === $has_form ) echo ' widget-control-noform'; ?>">
if ( isset($_POST) && !empty($_POST) ) {
$blog_public = isset($_POST['blog_public']);
}
-
+
if ( ! is_null( $error ) ) {
?>
<p><?php printf( __('<strong>ERROR</strong>: %s'), $error); ?></p>
<tr>
<th scope="row"><label for="admin_email"><?php _e('Your E-mail'); ?></label></th>
<td><input name="admin_email" type="text" id="admin_email" size="25" value="<?php echo ( isset($_POST['admin_email']) ? esc_attr($_POST['admin_email']) : '' ); ?>" /><br />
- <?php _e('Double-check your email address before continuing.'); ?>
+ <?php _e('Double-check your email address before continuing.'); ?></td>
</tr>
<tr>
<td colspan="2"><label><input type="checkbox" name="blog_public" value="1" <?php checked($blog_public); ?> /> <?php _e('Allow my blog to appear in search engines like Google and Technorati.'); ?></label></td>
jQuery(document).ready(function($) {
- var options = false, addAfter, addAfter2, delBefore, delAfter;
+ var options = false, addAfter, delBefore, delAfter;
if ( document.forms['addcat'].category_parent )
options = document.forms['addcat'].category_parent.options;
addAfter = function( r, settings ) {
var name, id;
- name = $("<span>" + $('name', r).text() + "</span>").html();
+ name = $("<span>" + $('name', r).text() + "</span>").text();
id = $('cat', r).attr('id');
options[options.length] = new Option(name, id);
-
- addAfter2( r, settings );
- }
-
- addAfter2 = function( x, r ) {
- var t = $(r.parsed.responses[0].data);
- if ( t.length == 1 )
- inlineEditTax.addEvents($(t.id));
}
delAfter = function( r, settings ) {
if ( options )
$('#the-list').wpList( { addAfter: addAfter, delBefore: delBefore, delAfter: delAfter } );
else
- $('#the-list').wpList({ addAfter: addAfter2, delBefore: delBefore });
+ $('#the-list').wpList({ delBefore: delBefore });
- $('.delete a[class^="delete"]').click(function(){return false;});
+ $('.delete a[class^="delete"]').live('click', function(){return false;});
});
-jQuery(document).ready(function(d){var b=false,f,e,c,a;if(document.forms.addcat.category_parent){b=document.forms.addcat.category_parent.options}f=function(i,h){var g,j;g=d("<span>"+d("name",i).text()+"</span>").html();j=d("cat",i).attr("id");b[b.length]=new Option(g,j);e(i,h)};e=function(g,i){var h=d(i.parsed.responses[0].data);if(h.length==1){inlineEditTax.addEvents(d(h.id))}};a=function(h,g){var j=d("cat",h).attr("id"),i;for(i=0;i<b.length;i++){if(j==b[i].value){b[i]=null}}};c=function(g){if("undefined"!=showNotice){return showNotice.warn()?g:false}return g};if(b){d("#the-list").wpList({addAfter:f,delBefore:c,delAfter:a})}else{d("#the-list").wpList({addAfter:e,delBefore:c})}d('.delete a[class^="delete"]').click(function(){return false})});
\ No newline at end of file
+jQuery(document).ready(function(d){var b=false,e,c,a;if(document.forms.addcat.category_parent){b=document.forms.addcat.category_parent.options}e=function(h,g){var f,i;f=d("<span>"+d("name",h).text()+"</span>").text();i=d("cat",h).attr("id");b[b.length]=new Option(f,i)};a=function(g,f){var i=d("cat",g).attr("id"),h;for(h=0;h<b.length;h++){if(i==b[h].value){b[h]=null}}};c=function(f){if("undefined"!=showNotice){return showNotice.warn()?f:false}return f};if(b){d("#the-list").wpList({addAfter:e,delBefore:c,delAfter:a})}else{d("#the-list").wpList({delBefore:c})}d('.delete a[class^="delete"]').live("click",function(){return false})});
\ No newline at end of file
});
$('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels
+ var aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(),
+ newD = new Date( aa, mm - 1, jj, hh, mn );
+
+ if ( newD.getFullYear() != aa || (1 + newD.getMonth()) != mm || newD.getDate() != jj || newD.getMinutes() != mn ) {
+ $('.timestamp-wrap', '#timestampdiv').addClass('form-invalid');
+ return false;
+ } else {
+ $('.timestamp-wrap', '#timestampdiv').removeClass('form-invalid');
+ }
+
$('#timestampdiv').slideUp("normal");
$('.edit-timestamp').show();
$('#timestamp').html(
commentL10n.submittedOn + ' <b>' +
- $( '#mm option[value=' + $('#mm').val() + ']' ).text() + ' ' +
- $('#jj').val() + ', ' +
- $('#aa').val() + ' @ ' +
- $('#hh').val() + ':' +
- $('#mn').val() + '</b> '
+ $( '#mm option[value=' + mm + ']' ).text() + ' ' +
+ jj + ', ' +
+ aa + ' @ ' +
+ hh + ':' +
+ mn + '</b> '
);
return false;
});
-jQuery(document).ready(function(b){var a=b("#timestamp").html();b(".edit-timestamp").click(function(){if(b("#timestampdiv").is(":hidden")){b("#timestampdiv").slideDown("normal");b(".edit-timestamp").hide()}return false});b(".cancel-timestamp").click(function(){b("#timestampdiv").slideUp("normal");b("#mm").val(b("#hidden_mm").val());b("#jj").val(b("#hidden_jj").val());b("#aa").val(b("#hidden_aa").val());b("#hh").val(b("#hidden_hh").val());b("#mn").val(b("#hidden_mn").val());b("#timestamp").html(a);b(".edit-timestamp").show();return false});b(".save-timestamp").click(function(){b("#timestampdiv").slideUp("normal");b(".edit-timestamp").show();b("#timestamp").html(commentL10n.submittedOn+" <b>"+b("#mm option[value="+b("#mm").val()+"]").text()+" "+b("#jj").val()+", "+b("#aa").val()+" @ "+b("#hh").val()+":"+b("#mn").val()+"</b> ");return false})});
\ No newline at end of file
+jQuery(document).ready(function(b){var a=b("#timestamp").html();b(".edit-timestamp").click(function(){if(b("#timestampdiv").is(":hidden")){b("#timestampdiv").slideDown("normal");b(".edit-timestamp").hide()}return false});b(".cancel-timestamp").click(function(){b("#timestampdiv").slideUp("normal");b("#mm").val(b("#hidden_mm").val());b("#jj").val(b("#hidden_jj").val());b("#aa").val(b("#hidden_aa").val());b("#hh").val(b("#hidden_hh").val());b("#mn").val(b("#hidden_mn").val());b("#timestamp").html(a);b(".edit-timestamp").show();return false});b(".save-timestamp").click(function(){var g=b("#aa").val(),h=b("#mm").val(),d=b("#jj").val(),c=b("#hh").val(),f=b("#mn").val(),e=new Date(g,h-1,d,c,f);if(e.getFullYear()!=g||(1+e.getMonth())!=h||e.getDate()!=d||e.getMinutes()!=f){b(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{b(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}b("#timestampdiv").slideUp("normal");b(".edit-timestamp").show();b("#timestamp").html(commentL10n.submittedOn+" <b>"+b("#mm option[value="+h+"]").text()+" "+d+", "+g+" @ "+c+":"+f+"</b> ");return false})});
\ No newline at end of file
-var showNotice, adminMenu, columns;
+var showNotice, adminMenu, columns, validateForm;
(function($){
// sidebar admin menu
adminMenu = {
-
init : function() {
- $('#adminmenu div.wp-menu-toggle').each( function() {
- if ( $(this).siblings('.wp-submenu').length )
- $(this).click(function(){ adminMenu.toggle( $(this).siblings('.wp-submenu') ); });
+ var menu = $('#adminmenu');
+
+ $('.wp-menu-toggle', menu).each( function() {
+ var t = $(this), sub = t.siblings('.wp-submenu');
+ if ( sub.length )
+ t.click(function(){ adminMenu.toggle( sub ); });
else
- $(this).hide();
+ t.hide();
});
this.favorites();
- $('a.separator').click(function(){
+ $('.separator', menu).click(function(){
if ( $('body').hasClass('folded') ) {
adminMenu.fold(1);
deleteUserSetting( 'mfold' );
return false;
});
- if ( $('body').hasClass('folded') ) {
+ if ( $('body').hasClass('folded') )
this.fold();
- }
+
this.restoreMenuState();
},
restoreMenuState : function() {
- $('#adminmenu li.wp-has-submenu').each(function(i, e) {
+ $('li.wp-has-submenu', '#adminmenu').each(function(i, e) {
var v = getUserSetting( 'm'+i );
- if ( $(e).hasClass('wp-has-current-submenu') ) return true; // leave the current parent open
+ if ( $(e).hasClass('wp-has-current-submenu') )
+ return true; // leave the current parent open
- if ( 'o' == v ) $(e).addClass('wp-menu-open');
- else if ( 'c' == v ) $(e).removeClass('wp-menu-open');
+ if ( 'o' == v )
+ $(e).addClass('wp-menu-open');
+ else if ( 'c' == v )
+ $(e).removeClass('wp-menu-open');
});
},
toggle : function(el) {
-
- el['slideToggle'](150, function(){el.css('display','');}).parent().toggleClass( 'wp-menu-open' );
-
- $('#adminmenu li.wp-has-submenu').each(function(i, e) {
- var v = $(e).hasClass('wp-menu-open') ? 'o' : 'c';
- setUserSetting( 'm'+i, v );
- });
+ var id = el.slideToggle(150, function() {
+ el.css('display','');
+ }).parent().toggleClass( 'wp-menu-open' ).attr('id');
+
+ if ( id ) {
+ $('li.wp-has-submenu', '#adminmenu').each(function(i, e) {
+ if ( id == e.id ) {
+ var v = $(e).hasClass('wp-menu-open') ? 'o' : 'c';
+ setUserSetting( 'm'+i, v );
+ }
+ });
+ }
return false;
},
over: function(e){
var m, b, h, o, f;
m = $(this).find('.wp-submenu');
- b = m.parent().offset().top + m.height() + 1; // Bottom offset of the menu
+ b = $(this).offset().top + m.height() + 1; // Bottom offset of the menu
h = $('#wpwrap').height(); // Height of the entire page
o = 60 + b - h;
- f = $(window).height() + $('body').scrollTop() - 15; // The fold
- if (f < (b - o)) {
+ f = $(window).height() + $(window).scrollTop() - 15; // The fold
+ if ( f < (b - o) ) {
o = b - f;
}
- if (o > 1) {
+ if ( o > 1 ) {
m.css({'marginTop':'-'+o+'px'});
} else if ( m.css('marginTop') ) {
m.css({'marginTop':''});
},
favorites : function() {
- $('#favorite-inside').width($('#favorite-actions').width()-4);
- $('#favorite-toggle, #favorite-inside').bind( 'mouseenter', function(){$('#favorite-inside').removeClass('slideUp').addClass('slideDown'); setTimeout(function(){if ( $('#favorite-inside').hasClass('slideDown') ) { $('#favorite-inside').slideDown(100); $('#favorite-first').addClass('slide-down'); }}, 200) } );
-
- $('#favorite-toggle, #favorite-inside').bind( 'mouseleave', function(){$('#favorite-inside').removeClass('slideDown').addClass('slideUp'); setTimeout(function(){if ( $('#favorite-inside').hasClass('slideUp') ) { $('#favorite-inside').slideUp(100, function(){ $('#favorite-first').removeClass('slide-down'); } ); }}, 300) } );
+ $('#favorite-inside').width( $('#favorite-actions').width() - 4 );
+ $('#favorite-toggle, #favorite-inside').bind('mouseenter', function() {
+ $('#favorite-inside').removeClass('slideUp').addClass('slideDown');
+ setTimeout(function() {
+ if ( $('#favorite-inside').hasClass('slideDown') ) {
+ $('#favorite-inside').slideDown(100);
+ $('#favorite-first').addClass('slide-down');
+ }
+ }, 200);
+ }).bind('mouseleave', function() {
+ $('#favorite-inside').removeClass('slideDown').addClass('slideUp');
+ setTimeout(function() {
+ if ( $('#favorite-inside').hasClass('slideUp') ) {
+ $('#favorite-inside').slideUp(100, function() {
+ $('#favorite-first').removeClass('slide-down');
+ });
+ }
+ }, 300);
+ });
}
};
-$(document).ready(function(){adminMenu.init();});
+$(document).ready(function(){ adminMenu.init(); });
// show/hide/save table columns
columns = {
init : function() {
- $('.hide-column-tog').click( function() {
- var column = $(this).val(), show = $(this).attr('checked');
- if ( show ) {
+ $('.hide-column-tog', '#adv-settings').click( function() {
+ var column = $(this).val();
+ if ( $(this).attr('checked') )
$('.column-' + column).show();
- } else {
+ else
$('.column-' + column).hide();
- }
+
columns.save_manage_columns_state();
- } );
+ });
},
save_manage_columns_state : function() {
$(document).ready(function(){columns.init();});
+validateForm = function( form ) {
+ return !$( form ).find('.form-required').filter( function() { return $('input:visible', this).val() == ''; } ).addClass( 'form-invalid' ).find('input:visible').change( function() { $(this).closest('.form-invalid').removeClass( 'form-invalid' ); } ).size();
+}
+
})(jQuery);
// stub for doing better warnings
jQuery(document).ready( function($) {
var lastClicked = false, checks, first, last, checked;
- // pulse
- $('.fade').animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300).animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300);
-
// Move .updated and .error alert boxes
- $('div.wrap h2 ~ div.updated, div.wrap h2 ~ div.error').addClass('below-h2');
- $('div.updated, div.error').not('.below-h2').insertAfter('div.wrap h2:first');
-
- // show warnings
- $('#doaction, #doaction2').click(function(){
- if ( $('select[name="action"]').val() == 'delete' || $('select[name="action2"]').val() == 'delete' ) {
- return showNotice.warn();
- }
- });
+ $('div.wrap h2:first').nextAll('div.updated, div.error').addClass('below-h2');
+ $('div.updated, div.error').not('.below-h2').insertAfter( $('div.wrap h2:first') );
// screen settings tab
$('#show-settings-link').click(function () {
- if ( ! $('#screen-options-wrap').hasClass('screen-options-open') ) {
+ if ( ! $('#screen-options-wrap').hasClass('screen-options-open') )
$('#contextual-help-link-wrap').css('visibility', 'hidden');
- }
+
$('#screen-options-wrap').slideToggle('fast', function(){
if ( $(this).hasClass('screen-options-open') ) {
$('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right.gif")'});
// help tab
$('#contextual-help-link').click(function () {
- if ( ! $('#contextual-help-wrap').hasClass('contextual-help-open') ) {
+ if ( ! $('#contextual-help-wrap').hasClass('contextual-help-open') )
$('#screen-options-link-wrap').css('visibility', 'hidden');
- }
- $('#contextual-help-wrap').slideToggle('fast', function(){
+
+ $('#contextual-help-wrap').slideToggle('fast', function() {
if ( $(this).hasClass('contextual-help-open') ) {
$('#contextual-help-link').css({'backgroundImage':'url("images/screen-options-right.gif")'});
$('#screen-options-link-wrap').css('visibility', '');
});
return false;
});
- $('#contextual-help-link-wrap, #screen-options-link-wrap').show();
// check all checkboxes
- $( 'table:visible tbody .check-column :checkbox' ).click( function(e) {
+ $('tbody').children().children('.check-column').find(':checkbox').click( function(e) {
if ( 'undefined' == e.shiftKey ) { return true; }
if ( e.shiftKey ) {
if ( !lastClicked ) { return true; }
- checks = $( lastClicked ).parents( 'form:first' ).find( ':checkbox' );
+ checks = $( lastClicked ).closest( 'form' ).find( ':checkbox' );
first = checks.index( lastClicked );
last = checks.index( this );
checked = $(this).attr('checked');
if ( 0 < first && 0 < last && first != last ) {
checks.slice( first, last ).attr( 'checked', function(){
- if ( $(this).parents('tr').is(':visible') )
+ if ( $(this).closest('tr').is(':visible') )
return checked ? 'checked' : '';
return '';
}
lastClicked = this;
return true;
- } );
- $( 'thead :checkbox, tfoot :checkbox' ).click( function(e) {
- var c = $(this).attr('checked'), kbtoggle = 'undefined' == typeof toggleWithKeyboard ? false : toggleWithKeyboard, toggle = e.shiftKey || kbtoggle;
+ });
+ $('thead, tfoot').find(':checkbox').click( function(e) {
+ var c = $(this).attr('checked'),
+ kbtoggle = 'undefined' == typeof toggleWithKeyboard ? false : toggleWithKeyboard,
+ toggle = e.shiftKey || kbtoggle;
- $(this).parents( 'form:first' ).find( 'table tbody:visible' ).find( '.check-column :checkbox' ).attr( 'checked', function() {
- if ( $(this).parents('tr').is(':hidden') )
+ $(this).closest( 'table' ).children( 'tbody' ).filter(':visible')
+ .children().children('.check-column').find(':checkbox')
+ .attr('checked', function() {
+ if ( $(this).closest('tr').is(':hidden') )
return '';
if ( toggle )
return $(this).attr( 'checked' ) ? '' : 'checked';
return 'checked';
return '';
});
- $(this).parents( 'form:first' ).find( 'table thead:visible, table tfoot:visible').find( '.check-column :checkbox' ).attr( 'checked', function() {
+
+ $(this).closest('table').children('thead, tfoot').filter(':visible')
+ .children().children('.check-column').find(':checkbox')
+ .attr('checked', function() {
if ( toggle )
return '';
else if (c)
return '';
});
});
+
$('#default-password-nag-no').click( function() {
setUserSetting('default_password_nag', 'hide');
$('div.default-password-nag').hide();
return false;
});
-
-
});
jQuery(document).ready( function($){
- var turboNag = $('.turbo-nag');
+ var turboNag = $('span.turbo-nag', '#user_info');
if ( !turboNag.length || ('undefined' != typeof(google) && google.gears) )
return;
}
turboNag.show();
-
});
-var showNotice,adminMenu,columns;(function(a){adminMenu={init:function(){a("#adminmenu div.wp-menu-toggle").each(function(){if(a(this).siblings(".wp-submenu").length){a(this).click(function(){adminMenu.toggle(a(this).siblings(".wp-submenu"))})}else{a(this).hide()}});this.favorites();a("a.separator").click(function(){if(a("body").hasClass("folded")){adminMenu.fold(1);deleteUserSetting("mfold")}else{adminMenu.fold();setUserSetting("mfold","f")}return false});if(a("body").hasClass("folded")){this.fold()}this.restoreMenuState()},restoreMenuState:function(){a("#adminmenu li.wp-has-submenu").each(function(c,d){var b=getUserSetting("m"+c);if(a(d).hasClass("wp-has-current-submenu")){return true}if("o"==b){a(d).addClass("wp-menu-open")}else{if("c"==b){a(d).removeClass("wp-menu-open")}}})},toggle:function(b){b.slideToggle(150,function(){b.css("display","")}).parent().toggleClass("wp-menu-open");a("#adminmenu li.wp-has-submenu").each(function(d,f){var c=a(f).hasClass("wp-menu-open")?"o":"c";setUserSetting("m"+d,c)});return false},fold:function(b){if(b){a("body").removeClass("folded");a("#adminmenu li.wp-has-submenu").unbind()}else{a("body").addClass("folded");a("#adminmenu li.wp-has-submenu").hoverIntent({over:function(j){var d,c,g,k,i;d=a(this).find(".wp-submenu");c=d.parent().offset().top+d.height()+1;g=a("#wpwrap").height();k=60+c-g;i=a(window).height()+a("body").scrollTop()-15;if(i<(c-k)){k=c-i}if(k>1){d.css({marginTop:"-"+k+"px"})}else{if(d.css("marginTop")){d.css({marginTop:""})}}d.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open").css({marginTop:""})},timeout:220,sensitivity:8,interval:100})}},favorites:function(){a("#favorite-inside").width(a("#favorite-actions").width()-4);a("#favorite-toggle, #favorite-inside").bind("mouseenter",function(){a("#favorite-inside").removeClass("slideUp").addClass("slideDown");setTimeout(function(){if(a("#favorite-inside").hasClass("slideDown")){a("#favorite-inside").slideDown(100);a("#favorite-first").addClass("slide-down")}},200)});a("#favorite-toggle, #favorite-inside").bind("mouseleave",function(){a("#favorite-inside").removeClass("slideDown").addClass("slideUp");setTimeout(function(){if(a("#favorite-inside").hasClass("slideUp")){a("#favorite-inside").slideUp(100,function(){a("#favorite-first").removeClass("slide-down")})}},300)})}};a(document).ready(function(){adminMenu.init()});columns={init:function(){a(".hide-column-tog").click(function(){var c=a(this).val(),b=a(this).attr("checked");if(b){a(".column-"+c).show()}else{a(".column-"+c).hide()}columns.save_manage_columns_state()})},save_manage_columns_state:function(){var b=a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})}};a(document).ready(function(){columns.init()})})(jQuery);showNotice={warn:function(){var a=commonL10n.warnDelete||"";if(confirm(a)){return true}return false},note:function(a){alert(a)}};jQuery(document).ready(function(d){var f=false,a,e,c,b;d(".fade").animate({backgroundColor:"#ffffe0"},300).animate({backgroundColor:"#fffbcc"},300).animate({backgroundColor:"#ffffe0"},300).animate({backgroundColor:"#fffbcc"},300);d("div.wrap h2 ~ div.updated, div.wrap h2 ~ div.error").addClass("below-h2");d("div.updated, div.error").not(".below-h2").insertAfter("div.wrap h2:first");d("#doaction, #doaction2").click(function(){if(d('select[name="action"]').val()=="delete"||d('select[name="action2"]').val()=="delete"){return showNotice.warn()}});d("#show-settings-link").click(function(){if(!d("#screen-options-wrap").hasClass("screen-options-open")){d("#contextual-help-link-wrap").css("visibility","hidden")}d("#screen-options-wrap").slideToggle("fast",function(){if(d(this).hasClass("screen-options-open")){d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#contextual-help-link-wrap").css("visibility","");d(this).removeClass("screen-options-open")}else{d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("screen-options-open")}});return false});d("#contextual-help-link").click(function(){if(!d("#contextual-help-wrap").hasClass("contextual-help-open")){d("#screen-options-link-wrap").css("visibility","hidden")}d("#contextual-help-wrap").slideToggle("fast",function(){if(d(this).hasClass("contextual-help-open")){d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#screen-options-link-wrap").css("visibility","");d(this).removeClass("contextual-help-open")}else{d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("contextual-help-open")}});return false});d("#contextual-help-link-wrap, #screen-options-link-wrap").show();d("table:visible tbody .check-column :checkbox").click(function(g){if("undefined"==g.shiftKey){return true}if(g.shiftKey){if(!f){return true}a=d(f).parents("form:first").find(":checkbox");e=a.index(f);c=a.index(this);b=d(this).attr("checked");if(0<e&&0<c&&e!=c){a.slice(e,c).attr("checked",function(){if(d(this).parents("tr").is(":visible")){return b?"checked":""}return""})}}f=this;return true});d("thead :checkbox, tfoot :checkbox").click(function(i){var j=d(this).attr("checked"),h="undefined"==typeof toggleWithKeyboard?false:toggleWithKeyboard,g=i.shiftKey||h;d(this).parents("form:first").find("table tbody:visible").find(".check-column :checkbox").attr("checked",function(){if(d(this).parents("tr").is(":hidden")){return""}if(g){return d(this).attr("checked")?"":"checked"}else{if(j){return"checked"}}return""});d(this).parents("form:first").find("table thead:visible, table tfoot:visible").find(".check-column :checkbox").attr("checked",function(){if(g){return""}else{if(j){return"checked"}}return""})});d("#default-password-nag-no").click(function(){setUserSetting("default_password_nag","hide");d("div.default-password-nag").hide();return false})});jQuery(document).ready(function(b){var a=b(".turbo-nag");if(!a.length||("undefined"!=typeof(google)&&google.gears)){return}if("undefined"!=typeof GearsFactory){return}else{try{if(("undefined"!=typeof window.ActiveXObject&&ActiveXObject("Gears.Factory"))||("undefined"!=typeof navigator.mimeTypes&&navigator.mimeTypes["application/x-googlegears"])){return}}catch(c){}}a.show()});
\ No newline at end of file
+var showNotice,adminMenu,columns,validateForm;(function(a){adminMenu={init:function(){var b=a("#adminmenu");a(".wp-menu-toggle",b).each(function(){var c=a(this),d=c.siblings(".wp-submenu");if(d.length){c.click(function(){adminMenu.toggle(d)})}else{c.hide()}});this.favorites();a(".separator",b).click(function(){if(a("body").hasClass("folded")){adminMenu.fold(1);deleteUserSetting("mfold")}else{adminMenu.fold();setUserSetting("mfold","f")}return false});if(a("body").hasClass("folded")){this.fold()}this.restoreMenuState()},restoreMenuState:function(){a("li.wp-has-submenu","#adminmenu").each(function(c,d){var b=getUserSetting("m"+c);if(a(d).hasClass("wp-has-current-submenu")){return true}if("o"==b){a(d).addClass("wp-menu-open")}else{if("c"==b){a(d).removeClass("wp-menu-open")}}})},toggle:function(b){var c=b.slideToggle(150,function(){b.css("display","")}).parent().toggleClass("wp-menu-open").attr("id");if(c){a("li.wp-has-submenu","#adminmenu").each(function(f,g){if(c==g.id){var d=a(g).hasClass("wp-menu-open")?"o":"c";setUserSetting("m"+f,d)}})}return false},fold:function(b){if(b){a("body").removeClass("folded");a("#adminmenu li.wp-has-submenu").unbind()}else{a("body").addClass("folded");a("#adminmenu li.wp-has-submenu").hoverIntent({over:function(j){var d,c,g,k,i;d=a(this).find(".wp-submenu");c=a(this).offset().top+d.height()+1;g=a("#wpwrap").height();k=60+c-g;i=a(window).height()+a(window).scrollTop()-15;if(i<(c-k)){k=c-i}if(k>1){d.css({marginTop:"-"+k+"px"})}else{if(d.css("marginTop")){d.css({marginTop:""})}}d.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open").css({marginTop:""})},timeout:220,sensitivity:8,interval:100})}},favorites:function(){a("#favorite-inside").width(a("#favorite-actions").width()-4);a("#favorite-toggle, #favorite-inside").bind("mouseenter",function(){a("#favorite-inside").removeClass("slideUp").addClass("slideDown");setTimeout(function(){if(a("#favorite-inside").hasClass("slideDown")){a("#favorite-inside").slideDown(100);a("#favorite-first").addClass("slide-down")}},200)}).bind("mouseleave",function(){a("#favorite-inside").removeClass("slideDown").addClass("slideUp");setTimeout(function(){if(a("#favorite-inside").hasClass("slideUp")){a("#favorite-inside").slideUp(100,function(){a("#favorite-first").removeClass("slide-down")})}},300)})}};a(document).ready(function(){adminMenu.init()});columns={init:function(){a(".hide-column-tog","#adv-settings").click(function(){var b=a(this).val();if(a(this).attr("checked")){a(".column-"+b).show()}else{a(".column-"+b).hide()}columns.save_manage_columns_state()})},save_manage_columns_state:function(){var b=a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(".form-required").filter(function(){return a("input:visible",this).val()==""}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()}})(jQuery);showNotice={warn:function(){var a=commonL10n.warnDelete||"";if(confirm(a)){return true}return false},note:function(a){alert(a)}};jQuery(document).ready(function(d){var f=false,a,e,c,b;d("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");d("div.updated, div.error").not(".below-h2").insertAfter(d("div.wrap h2:first"));d("#show-settings-link").click(function(){if(!d("#screen-options-wrap").hasClass("screen-options-open")){d("#contextual-help-link-wrap").css("visibility","hidden")}d("#screen-options-wrap").slideToggle("fast",function(){if(d(this).hasClass("screen-options-open")){d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#contextual-help-link-wrap").css("visibility","");d(this).removeClass("screen-options-open")}else{d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("screen-options-open")}});return false});d("#contextual-help-link").click(function(){if(!d("#contextual-help-wrap").hasClass("contextual-help-open")){d("#screen-options-link-wrap").css("visibility","hidden")}d("#contextual-help-wrap").slideToggle("fast",function(){if(d(this).hasClass("contextual-help-open")){d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#screen-options-link-wrap").css("visibility","");d(this).removeClass("contextual-help-open")}else{d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("contextual-help-open")}});return false});d("tbody").children().children(".check-column").find(":checkbox").click(function(g){if("undefined"==g.shiftKey){return true}if(g.shiftKey){if(!f){return true}a=d(f).closest("form").find(":checkbox");e=a.index(f);c=a.index(this);b=d(this).attr("checked");if(0<e&&0<c&&e!=c){a.slice(e,c).attr("checked",function(){if(d(this).closest("tr").is(":visible")){return b?"checked":""}return""})}}f=this;return true});d("thead, tfoot").find(":checkbox").click(function(i){var j=d(this).attr("checked"),h="undefined"==typeof toggleWithKeyboard?false:toggleWithKeyboard,g=i.shiftKey||h;d(this).closest("table").children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").attr("checked",function(){if(d(this).closest("tr").is(":hidden")){return""}if(g){return d(this).attr("checked")?"":"checked"}else{if(j){return"checked"}}return""});d(this).closest("table").children("thead, tfoot").filter(":visible").children().children(".check-column").find(":checkbox").attr("checked",function(){if(g){return""}else{if(j){return"checked"}}return""})});d("#default-password-nag-no").click(function(){setUserSetting("default_password_nag","hide");d("div.default-password-nag").hide();return false})});jQuery(document).ready(function(b){var a=b("span.turbo-nag","#user_info");if(!a.length||("undefined"!=typeof(google)&&google.gears)){return}if("undefined"!=typeof GearsFactory){return}else{try{if(("undefined"!=typeof window.ActiveXObject&&ActiveXObject("Gears.Factory"))||("undefined"!=typeof navigator.mimeTypes&&navigator.mimeTypes["application/x-googlegears"])){return}}catch(c){}}a.show()});
\ No newline at end of file
setCommentsList = function() {
var totalInput, perPageInput, pageInput, lastConfidentTime = 0, dimAfter, delBefore, updateTotalCount, delAfter;
- totalInput = $('#comments-form .tablenav :input[name="_total"]');
- perPageInput = $('#comments-form .tablenav :input[name="_per_page"]');
- pageInput = $('#comments-form .tablenav :input[name="_page"]');
+ totalInput = $('.tablenav input[name="_total"]', '#comments-form');
+ perPageInput = $('.tablenav input[name="_per_page"]', '#comments-form');
+ pageInput = $('.tablenav input[name="_page"]', '#comments-form');
dimAfter = function( r, settings ) {
var c = $('#' + settings.element);
c.find('div.comment_status').html('1')
$('span.pending-count').each( function() {
- var a = $(this), n;
- n = a.html().replace(/[ ,.]+/g, '');
+ var a = $(this), n, dif;
+ n = a.html().replace(/[^0-9]+/g, '');
n = parseInt(n,10);
if ( isNaN(n) ) return;
- n = n + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
+ dif = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1;
+ n = n + dif;
if ( n < 0 ) { n = 0; }
- a.parents('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
- n = n.toString();
- if ( n.length > 3 )
- n = n.substr(0, n.length-3)+' '+n.substr(-3);
- a.html(n);
+ a.closest('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
+ updateCount(a, n);
+ dashboardTotals();
});
};
// Send current total, page, per_page and url
- delBefore = function( settings ) {
- settings.data._total = totalInput.val();
- settings.data._per_page = perPageInput.val();
- settings.data._page = pageInput.val();
+ delBefore = function( settings, list ) {
+ var cl = $(settings.target).attr('className'), id, el, n, h, a, author, action = false;
+
+ settings.data._total = totalInput.val() || 0;
+ settings.data._per_page = perPageInput.val() || 0;
+ settings.data._page = pageInput.val() || 0;
settings.data._url = document.location.href;
- if ( 'undefined' != showNotice && settings.data.action && settings.data.action == 'delete-comment' && !settings.data.spam )
- return showNotice.warn() ? settings : false;
+ if ( cl.indexOf(':trash=1') != -1 )
+ action = 'trash';
+ else if ( cl.indexOf(':spam=1') != -1 )
+ action = 'spam';
+
+ if ( action ) {
+ id = cl.replace(/.*?comment-([0-9]+).*/, '$1');
+ el = $('#comment-' + id);
+ note = $('#' + action + '-undo-holder').html();
+
+ if ( el.siblings('#replyrow').length && commentReply.cid == id )
+ commentReply.close();
+
+ if ( el.is('tr') ) {
+ n = el.children(':visible').length;
+ author = $('.author strong', el).text();
+ h = $('<tr id="undo-' + id + '" class="undo un' + action + '" style="display:none;"><td colspan="' + n + '">' + note + '</td></tr>');
+ } else {
+ author = $('.comment-author', el).text();
+ h = $('<div id="undo-' + id + '" style="display:none;" class="undo un' + action + '">' + note + '</div>');
+ }
+
+ el.before(h);
+
+ $('strong', '#undo-' + id).text(author + ' ');
+ a = $('.undo a', '#undo-' + id);
+ a.attr('href', 'comment.php?action=un' + action + 'comment&c=' + id + '&_wpnonce=' + settings.data._ajax_nonce);
+ a.attr('className', 'delete:the-comment-list:comment-' + id + '::un' + action + '=1 vim-z vim-destructive');
+ $('.avatar', el).clone().prependTo('#undo-' + id + ' .' + action + '-undo-inside');
+
+ a.click(function(){
+ list.wpList.del(this);
+ $('#undo-' + id).css( {backgroundColor:'#ceb'} ).fadeOut(350, function(){
+ $(this).remove();
+ $('#comment-' + id).css('backgroundColor', '').fadeIn(300, function(){ $(this).show() });
+ });
+ return false;
+ });
+ }
return settings;
};
- /* Updates the current total (as displayed visibly)
- */
+ // Updates the current total (as displayed visibly)
updateTotalCount = function( total, time, setConfidentTime ) {
- if ( time < lastConfidentTime ) {
+ if ( time < lastConfidentTime )
return;
- }
- totalInput.val( total.toString() );
- if ( setConfidentTime ) {
+
+ if ( setConfidentTime )
lastConfidentTime = time;
- }
+
+ totalInput.val( total.toString() );
$('span.total-type-count').each( function() {
- var a = $(this), n;
- n = totalInput.val().toString();
- if ( n.length > 3 )
- n = n.substr(0, n.length-3)+' '+n.substr(-3);
- a.html(n);
+ updateCount( $(this), total );
});
-
};
+ function dashboardTotals(n) {
+ var dash = $('#dashboard_right_now'), total, appr, totalN, apprN;
+
+ n = n || 0;
+ if ( isNaN(n) || !dash.length )
+ return;
+
+ total = $('span.total-count', dash);
+ appr = $('span.approved-count', dash);
+ totalN = getCount(total);
+
+ totalN = totalN + n;
+ apprN = totalN - getCount( $('span.pending-count', dash) ) - getCount( $('span.spam-count', dash) );
+ updateCount(total, totalN);
+ updateCount(appr, apprN);
+
+ }
+
+ function getCount(el) {
+ var n = parseInt( el.html().replace(/[^0-9]+/g, ''), 10 );
+ if ( isNaN(n) )
+ return 0;
+ return n;
+ }
+
+ function updateCount(el, n) {
+ var n1 = '';
+ if ( isNaN(n) )
+ return;
+ n = n < 1 ? '0' : n.toString();
+ if ( n.length > 3 ) {
+ while ( n.length > 3 ) {
+ n1 = thousandsSeparator + n.substr(n.length - 3) + n1;
+ n = n.substr(0, n.length - 3);
+ }
+ n = n + n1;
+ }
+ el.html(n);
+ }
+
// In admin-ajax.php, we send back the unix time stamp instead of 1 on success
delAfter = function( r, settings ) {
+ var total, pageLinks, N, untrash = $(settings.target).parent().is('span.untrash'), unspam = $(settings.target).parent().is('span.unspam'), spam, trash;
+
+ function getUpdate(s) {
+ if ( $(settings.target).parent().is('span.' + s) )
+ return 1;
+ else if ( $('#' + settings.element).is('.' + s) )
+ return -1;
+
+ return 0;
+ }
+ spam = getUpdate('spam');
+ trash = getUpdate('trash');
+
+ if ( untrash )
+ trash = -1;
+ if ( unspam )
+ spam = -1;
+
$('span.pending-count').each( function() {
- var a = $(this), n;
- n = a.html().replace(/[ ,.]+/g, '');
- n = parseInt(n,10);
- if ( isNaN(n) ) return;
- if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment
- n = n - 1;
- } else if ( $(settings.target).parents( 'span.unapprove' ).size() ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove"
+ var a = $(this), n = getCount(a), unapproved = $('#' + settings.element).is('.unapproved');
+
+ if ( $(settings.target).parent().is('span.unapprove') || ( ( untrash || unspam ) && unapproved ) ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove"
n = n + 1;
+ } else if ( unapproved ) { // we deleted a formerly unapproved comment
+ n = n - 1;
}
if ( n < 0 ) { n = 0; }
- a.parents('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
- n = n.toString();
- if ( n.length > 3 )
- n = n.substr(0, n.length-3)+' '+n.substr(-3);
- a.html(n);
+ a.closest('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
+ updateCount(a, n);
+ dashboardTotals();
});
$('span.spam-count').each( function() {
- var a = $(this), n;
- n = a.html().replace(/[ ,.]+/g, '');
- n = parseInt(n,10);
- if ( isNaN(n) ) return;
- if ( $(settings.target).parents( 'span.spam' ).size() ) { // we marked a comment as spam
- n = n + 1;
- } else if ( $('#' + settings.element).is('.spam') ) { // we approved or deleted a comment marked as spam
- n = n - 1;
- }
- if ( n < 0 ) { n = 0; }
- n = n.toString();
- if ( n.length > 3 )
- n = n.substr(0, n.length-3)+' '+n.substr(-3);
- a.html(n);
+ var a = $(this), n = getCount(a) + spam;
+ updateCount(a, n);
});
+ $('span.trash-count').each( function() {
+ var a = $(this), n = getCount(a) + trash;
+ updateCount(a, n);
+ });
- // XML response
- if ( ( 'object' == typeof r ) && lastConfidentTime < settings.parsed.responses[0].supplemental.time ) {
- // Set the total to the known good value (even if this value is a little old, newer values should only be a few less, and so shouldn't mess up the page links)
- updateTotalCount( settings.parsed.responses[0].supplemental.total, settings.parsed.responses[0].supplemental.time, true );
- if ( $.trim( settings.parsed.responses[0].supplemental.pageLinks ) ) {
- $('.tablenav-pages').find( '.page-numbers' ).remove().end().append( $( settings.parsed.responses[0].supplemental.pageLinks ) );
- } else if ( 'undefined' != typeof settings.parsed.responses[0].supplemental.pageLinks ) {
- $('.tablenav-pages').find( '.page-numbers' ).remove();
- }
+ if ( $('#dashboard_right_now').length ) {
+ N = trash ? -1 * trash : 0;
+ dashboardTotals(N);
} else {
- // Decrement the total
- var total = parseInt( totalInput.val(), 10 );
- if ( total-- < 0 )
+ total = totalInput.val() ? parseInt( totalInput.val(), 10 ) : 0;
+ total = total - spam - trash;
+ if ( total < 0 )
total = 0;
- updateTotalCount( total, r, false );
+
+ if ( ( 'object' == typeof r ) && lastConfidentTime < settings.parsed.responses[0].supplemental.time ) {
+ pageLinks = settings.parsed.responses[0].supplemental.pageLinks || '';
+ if ( $.trim( pageLinks ) )
+ $('.tablenav-pages').find( '.page-numbers' ).remove().end().append( $( pageLinks ) );
+ else
+ $('.tablenav-pages').find( '.page-numbers' ).remove();
+
+ updateTotalCount( total, settings.parsed.responses[0].supplemental.time, true );
+ } else {
+ updateTotalCount( total, r, false );
+ }
}
- if ( theExtraList.size() == 0 || theExtraList.children().size() == 0 ) {
+ if ( theExtraList.size() == 0 || theExtraList.children().size() == 0 || untrash ) {
return;
}
};
theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
- theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } );
+ theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } )
+ .bind('wpListDelEnd', function(e, s){
+ var id = s.element.replace(/[^0-9]+/g, '');
+ if ( s.target.className.indexOf(':trash=1') != -1 || s.target.className.indexOf(':spam=1') != -1 )
+ $('#undo-' + id).fadeIn(300, function(){ $(this).show() });
+ });
};
commentReply = {
+ cid : '',
+ act : '',
init : function() {
var row = $('#replyrow');
},
close : function() {
- $(this.o).fadeIn('fast').css('backgroundColor', '');
- $('#com-reply').append( $('#replyrow') );
- $('#replycontent').val('');
- $('#edithead input').val('');
- $('#replysubmit .error').html('').hide();
- $('#replysubmit .waiting').hide();
- if ( $.browser.msie )
- $('#replycontainer, #replycontent').css('height', '120px');
- else
- $('#replycontainer').resizable('destroy').css('height', '120px');
+ var c;
+
+ if ( this.cid ) {
+ c = $('#comment-' + this.cid);
+
+ if ( this.act == 'edit-comment' )
+ c.fadeIn(300, function(){ c.show() }).css('backgroundColor', '');
+
+ $('#replyrow').hide();
+ $('#com-reply').append( $('#replyrow') );
+ $('#replycontent').val('');
+ $('input', '#edithead').val('');
+ $('.error', '#replysubmit').html('').hide();
+ $('.waiting', '#replysubmit').hide();
+
+ if ( $.browser.msie )
+ $('#replycontainer, #replycontent').css('height', '120px');
+ else
+ $('#replycontainer').resizable('destroy').css('height', '120px');
+
+ this.cid = '';
+ }
},
open : function(id, p, a) {
- var t = this, editRow, act, h;
+ var t = this, editRow, rowData, act, h, c = $('#comment-' + id);
t.close();
- t.o = '#comment-'+id;
+ t.cid = id;
- $('#replyrow td').attr('colspan', $('.widefat thead th:visible').length);
- editRow = $('#replyrow'), rowData = $('#inline-'+id);
+ $('td', '#replyrow').attr('colspan', $('table.widefat thead th:visible').length);
+ editRow = $('#replyrow');
+ rowData = $('#inline-'+id);
act = t.act = (a == 'edit') ? 'edit-comment' : 'replyto-comment';
$('#action', editRow).val(act);
$('#edithead, #savebtn', editRow).show();
$('#replyhead, #replybtn', editRow).hide();
- h = $(t.o).height();
+ h = c.height();
if ( h > 220 )
if ( $.browser.msie )
$('#replycontainer, #replycontent', editRow).height(h-105);
else
$('#replycontainer', editRow).height(h-105);
- $(t.o).after(editRow.hide()).fadeOut('fast', function(){
- $('#replyrow').fadeIn('fast');
+ c.after( editRow ).fadeOut('fast', function(){
+ $('#replyrow').fadeIn(300, function(){ $(this).show() });
});
} else {
$('#edithead, #savebtn', editRow).hide();
$('#replyhead, #replybtn', editRow).show();
- $(t.o).after(editRow);
- $('#replyrow').hide().fadeIn('fast');
+ c.after(editRow);
+ $('#replyrow').fadeIn(300, function(){ $(this).show() });
}
if ( ! $.browser.msie )
window.scroll(0, rtop - 35);
$('#replycontent').focus().keyup(function(e){
- if (e.which == 27) commentReply.revert(); // close on Escape
+ if ( e.which == 27 )
+ commentReply.revert(); // close on Escape
});
}, 600);
$.ajax({
type : 'POST',
- url : wpListL10n.url,
+ url : ajaxurl,
data : post,
success : function(x) { commentReply.show(x); },
error : function(r) { commentReply.error(r); }
return false;
}
- if ( 'edit-comment' == this.act )
- $(this.o).remove();
-
r = r.responses[0];
c = r.data;
+ id = '#comment-' + r.id;
+ if ( 'edit-comment' == this.act )
+ $(id).remove();
$(c).hide()
$('#replyrow').after(c);
- this.o = id = '#comment-'+r.id;
this.revert();
this.addEvents($(id));
bg = $(id).hasClass('unapproved') ? '#ffffe0' : '#fff';
window.location = l[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g, '')+'&hotkeys_highlight_'+first_last+'=1';
}
};
+
edit_comment = function(event, current_row) {
window.location = $('span.edit a', current_row).attr('href');
};
+
toggle_all = function() {
toggleWithKeyboard = true;
- $('#comments-form thead #cb input:checkbox').click().attr('checked', '');
+ $('input:checkbox', '#cb').click().attr('checked', '');
toggleWithKeyboard = false;
- }
+ };
+
make_bulk = function(value) {
- return function(event, _) {
- $('option[value='+value+']').attr('selected', 'selected');
- $('form#comments-form')[0].submit();
+ return function() {
+ var scope = $('select[name="action"]');
+ $('option[value='+value+']', scope).attr('selected', 'selected');
+ $('#comments-form').submit();
}
};
- $.table_hotkeys($('table.widefat'),['a', 'u', 's', 'd', 'r', 'q', ['e', edit_comment],
- ['shift+a', make_bulk('approve')], ['shift+s', make_bulk('markspam')],
- ['shift+d', make_bulk('delete')], ['shift+x', toggle_all],
- ['shift+u', make_bulk('unapprove')]],
- {highlight_first: adminCommentsL10n.hotkeys_highlight_first, highlight_last: adminCommentsL10n.hotkeys_highlight_last,
- prev_page_link_cb: make_hotkeys_redirect('prev'), next_page_link_cb: make_hotkeys_redirect('next')}
+
+ $.table_hotkeys(
+ $('table.widefat'),
+ ['a', 'u', 's', 'd', 'r', 'q', 'z', ['e', edit_comment], ['shift+x', toggle_all],
+ ['shift+a', make_bulk('approve')], ['shift+s', make_bulk('markspam')],
+ ['shift+d', make_bulk('delete')], ['shift+t', make_bulk('trash')],
+ ['shift+z', make_bulk('untrash')], ['shift+u', make_bulk('unapprove')]],
+ { highlight_first: adminCommentsL10n.hotkeys_highlight_first, highlight_last: adminCommentsL10n.hotkeys_highlight_last,
+ prev_page_link_cb: make_hotkeys_redirect('prev'), next_page_link_cb: make_hotkeys_redirect('next') }
);
}
});
-var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var g,i,h,f=0,c,e,d,b;g=a('#comments-form .tablenav :input[name="_total"]');i=a('#comments-form .tablenav :input[name="_per_page"]');h=a('#comments-form .tablenav :input[name="_page"]');c=function(k,j){var l=a("#"+j.element);if(l.is(".unapproved")){l.find("div.comment_status").html("0")}else{l.find("div.comment_status").html("1")}a("span.pending-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}o=o+(a("#"+j.element).is("."+j.dimClass)?1:-1);if(o<0){o=0}m.parents("#awaiting-mod")[0==o?"addClass":"removeClass"]("count-0");o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)})};e=function(j){j.data._total=g.val();j.data._per_page=i.val();j.data._page=h.val();j.data._url=document.location.href;if("undefined"!=showNotice&&j.data.action&&j.data.action=="delete-comment"&&!j.data.spam){return showNotice.warn()?j:false}return j};d=function(j,k,l){if(k<f){return}g.val(j.toString());if(l){f=k}a("span.total-type-count").each(function(){var m=a(this),o;o=g.val().toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)})};b=function(l,j){a("span.pending-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}if(a("#"+j.element).is(".unapproved")){o=o-1}else{if(a(j.target).parents("span.unapprove").size()){o=o+1}}if(o<0){o=0}m.parents("#awaiting-mod")[0==o?"addClass":"removeClass"]("count-0");o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)});a("span.spam-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}if(a(j.target).parents("span.spam").size()){o=o+1}else{if(a("#"+j.element).is(".spam")){o=o-1}}if(o<0){o=0}o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)});if(("object"==typeof l)&&f<j.parsed.responses[0].supplemental.time){d(j.parsed.responses[0].supplemental.total,j.parsed.responses[0].supplemental.time,true);if(a.trim(j.parsed.responses[0].supplemental.pageLinks)){a(".tablenav-pages").find(".page-numbers").remove().end().append(a(j.parsed.responses[0].supplemental.pageLinks))}else{if("undefined"!=typeof j.parsed.responses[0].supplemental.pageLinks){a(".tablenav-pages").find(".page-numbers").remove()}}}else{var k=parseInt(g.val(),10);if(k--<0){k=0}d(k,l,false)}if(theExtraList.size()==0||theExtraList.children().size()==0){return}theList.get(0).wpList.add(theExtraList.children(":eq(0)").remove().clone());a("#get-extra-comments").submit()};theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"});theList=a("#the-comment-list").wpList({alt:"",delBefore:e,dimAfter:c,delAfter:b,addColor:"none"})};commentReply={init:function(){var b=a("#replyrow");a("a.cancel",b).click(function(){return commentReply.revert()});a("a.save",b).click(function(){return commentReply.send()});a("input#author, input#author-email, input#author-url",b).keypress(function(c){if(c.which==13){commentReply.send();c.preventDefault();return false}});a("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())});a("#doaction, #doaction2, #post-query-submit").click(function(c){if(a("#the-comment-list #replyrow").length>0){commentReply.close()}});this.comments_listing=a('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(b){b.each(function(){a(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css("display")!="none"){a(b).find("a.vim-q").click()}},revert:function(){if(a("#the-comment-list #replyrow").length<1){return false}a("#replyrow").fadeOut("fast",function(){commentReply.close()});return false},close:function(){a(this.o).fadeIn("fast").css("backgroundColor","");a("#com-reply").append(a("#replyrow"));a("#replycontent").val("");a("#edithead input").val("");a("#replysubmit .error").html("").hide();a("#replysubmit .waiting").hide();if(a.browser.msie){a("#replycontainer, #replycontent").css("height","120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}},open:function(i,g,c){var e=this,d,b,f;e.close();e.o="#comment-"+i;a("#replyrow td").attr("colspan",a(".widefat thead th:visible").length);d=a("#replyrow"),rowData=a("#inline-"+i);b=e.act=(c=="edit")?"edit-comment":"replyto-comment";a("#action",d).val(b);a("#comment_post_ID",d).val(g);a("#comment_ID",d).val(i);if(c=="edit"){a("#author",d).val(a("div.author",rowData).text());a("#author-email",d).val(a("div.author-email",rowData).text());a("#author-url",d).val(a("div.author-url",rowData).text());a("#status",d).val(a("div.comment_status",rowData).text());a("#replycontent",d).val(a("textarea.comment",rowData).val());a("#edithead, #savebtn",d).show();a("#replyhead, #replybtn",d).hide();f=a(e.o).height();if(f>220){if(a.browser.msie){a("#replycontainer, #replycontent",d).height(f-105)}else{a("#replycontainer",d).height(f-105)}}a(e.o).after(d.hide()).fadeOut("fast",function(){a("#replyrow").fadeIn("fast")})}else{a("#edithead, #savebtn",d).hide();a("#replyhead, #replybtn",d).show();a(e.o).after(d);a("#replyrow").hide().fadeIn("fast")}if(!a.browser.msie){a("#replycontainer").resizable({handles:"s",axis:"y",minHeight:80,stop:function(){a("#replycontainer").width("auto")}})}setTimeout(function(){var l,j,m,h,k;l=a("#replyrow").offset().top;j=l+a("#replyrow").height();m=window.pageYOffset||document.documentElement.scrollTop;h=document.documentElement.clientHeight||self.innerHeight||0;k=m+h;if(k-20<j){window.scroll(0,j-h+35)}else{if(l-20<m){window.scroll(0,l-35)}}a("#replycontent").focus().keyup(function(n){if(n.which==27){commentReply.revert()}})},600);return false},send:function(){var b={};a("#replysubmit .waiting").show();a("#replyrow input").each(function(){b[a(this).attr("name")]=a(this).val()});b.content=a("#replycontent").val();b.id=b.comment_post_ID;b.comments_listing=this.comments_listing;a.ajax({type:"POST",url:wpListL10n.url,data:b,success:function(c){commentReply.show(c)},error:function(c){commentReply.error(c)}});return false},show:function(b){var e,g,f,d;if(typeof(b)=="string"){this.error({responseText:b});return false}e=wpAjax.parseAjaxResponse(b);if(e.errors){this.error({responseText:wpAjax.broken});return false}if("edit-comment"==this.act){a(this.o).remove()}e=e.responses[0];g=e.data;a(g).hide();a("#replyrow").after(g);this.o=f="#comment-"+e.id;this.revert();this.addEvents(a(f));d=a(f).hasClass("unapproved")?"#ffffe0":"#fff";a(f).animate({backgroundColor:"#CCEEBB"},600).animate({backgroundColor:d},600);a.fn.wpList.process(a(f))},error:function(b){var c=b.statusText;a("#replysubmit .waiting").hide();if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#replysubmit .error").html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a("span.delete a.delete").click(function(){return false});if(typeof QTags!="undefined"){ed_reply=new QTags("ed_reply","replycontent","replycontainer","more")}if(typeof a.table_hotkeys!="undefined"){e=function(f){return function(){var h,g;h="next"==f?"first":"last";g=a("."+f+".page-numbers");if(g.length){window.location=g[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+h+"=1"}}};b=function(g,f){window.location=a("span.edit a",f).attr("href")};c=function(){toggleWithKeyboard=true;a("#comments-form thead #cb input:checkbox").click().attr("checked","");toggleWithKeyboard=false};d=function(f){return function(h,g){a("option[value="+f+"]").attr("selected","selected");a("form#comments-form")[0].submit()}};a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q",["e",b],["shift+a",d("approve")],["shift+s",d("markspam")],["shift+d",d("delete")],["shift+x",c],["shift+u",d("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e("prev"),next_page_link_cb:e("next")})}})})(jQuery);
\ No newline at end of file
+var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var c,e,h,l=0,g,i,d,k;c=a('.tablenav input[name="_total"]',"#comments-form");e=a('.tablenav input[name="_per_page"]',"#comments-form");h=a('.tablenav input[name="_page"]',"#comments-form");g=function(n,m){var o=a("#"+m.element);if(o.is(".unapproved")){o.find("div.comment_status").html("0")}else{o.find("div.comment_status").html("1")}a("span.pending-count").each(function(){var p=a(this),r,q;r=p.html().replace(/[^0-9]+/g,"");r=parseInt(r,10);if(isNaN(r)){return}q=a("#"+m.element).is("."+m.dimClass)?1:-1;r=r+q;if(r<0){r=0}p.closest("#awaiting-mod")[0==r?"addClass":"removeClass"]("count-0");f(p,r);j()})};i=function(q,u){var w=a(q.target).attr("className"),m,o,p,t,v,s,r=false;q.data._total=c.val()||0;q.data._per_page=e.val()||0;q.data._page=h.val()||0;q.data._url=document.location.href;if(w.indexOf(":trash=1")!=-1){r="trash"}else{if(w.indexOf(":spam=1")!=-1){r="spam"}}if(r){m=w.replace(/.*?comment-([0-9]+).*/,"$1");o=a("#comment-"+m);note=a("#"+r+"-undo-holder").html();if(o.siblings("#replyrow").length&&commentReply.cid==m){commentReply.close()}if(o.is("tr")){p=o.children(":visible").length;s=a(".author strong",o).text();t=a('<tr id="undo-'+m+'" class="undo un'+r+'" style="display:none;"><td colspan="'+p+'">'+note+"</td></tr>")}else{s=a(".comment-author",o).text();t=a('<div id="undo-'+m+'" style="display:none;" class="undo un'+r+'">'+note+"</div>")}o.before(t);a("strong","#undo-"+m).text(s+" ");v=a(".undo a","#undo-"+m);v.attr("href","comment.php?action=un"+r+"comment&c="+m+"&_wpnonce="+q.data._ajax_nonce);v.attr("className","delete:the-comment-list:comment-"+m+"::un"+r+"=1 vim-z vim-destructive");a(".avatar",o).clone().prependTo("#undo-"+m+" ."+r+"-undo-inside");v.click(function(){u.wpList.del(this);a("#undo-"+m).css({backgroundColor:"#ceb"}).fadeOut(350,function(){a(this).remove();a("#comment-"+m).css("backgroundColor","").fadeIn(300,function(){a(this).show()})});return false})}return q};d=function(m,n,o){if(n<l){return}if(o){l=n}c.val(m.toString());a("span.total-type-count").each(function(){f(a(this),m)})};function j(s){var r=a("#dashboard_right_now"),o,q,p,m;s=s||0;if(isNaN(s)||!r.length){return}o=a("span.total-count",r);q=a("span.approved-count",r);p=b(o);p=p+s;m=p-b(a("span.pending-count",r))-b(a("span.spam-count",r));f(o,p);f(q,m)}function b(m){var o=parseInt(m.html().replace(/[^0-9]+/g,""),10);if(isNaN(o)){return 0}return o}function f(o,p){var m="";if(isNaN(p)){return}p=p<1?"0":p.toString();if(p.length>3){while(p.length>3){m=thousandsSeparator+p.substr(p.length-3)+m;p=p.substr(0,p.length-3)}p=p+m}o.html(p)}k=function(m,o){var t,p,q,v=a(o.target).parent().is("span.untrash"),n=a(o.target).parent().is("span.unspam"),u,s;function w(r){if(a(o.target).parent().is("span."+r)){return 1}else{if(a("#"+o.element).is("."+r)){return -1}}return 0}u=w("spam");s=w("trash");if(v){s=-1}if(n){u=-1}a("span.pending-count").each(function(){var r=a(this),y=b(r),x=a("#"+o.element).is(".unapproved");if(a(o.target).parent().is("span.unapprove")||((v||n)&&x)){y=y+1}else{if(x){y=y-1}}if(y<0){y=0}r.closest("#awaiting-mod")[0==y?"addClass":"removeClass"]("count-0");f(r,y);j()});a("span.spam-count").each(function(){var r=a(this),x=b(r)+u;f(r,x)});a("span.trash-count").each(function(){var r=a(this),x=b(r)+s;f(r,x)});if(a("#dashboard_right_now").length){q=s?-1*s:0;j(q)}else{t=c.val()?parseInt(c.val(),10):0;t=t-u-s;if(t<0){t=0}if(("object"==typeof m)&&l<o.parsed.responses[0].supplemental.time){p=o.parsed.responses[0].supplemental.pageLinks||"";if(a.trim(p)){a(".tablenav-pages").find(".page-numbers").remove().end().append(a(p))}else{a(".tablenav-pages").find(".page-numbers").remove()}d(t,o.parsed.responses[0].supplemental.time,true)}else{d(t,m,false)}}if(theExtraList.size()==0||theExtraList.children().size()==0||v){return}theList.get(0).wpList.add(theExtraList.children(":eq(0)").remove().clone());a("#get-extra-comments").submit()};theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"});theList=a("#the-comment-list").wpList({alt:"",delBefore:i,dimAfter:g,delAfter:k,addColor:"none"}).bind("wpListDelEnd",function(n,m){var o=m.element.replace(/[^0-9]+/g,"");if(m.target.className.indexOf(":trash=1")!=-1||m.target.className.indexOf(":spam=1")!=-1){a("#undo-"+o).fadeIn(300,function(){a(this).show()})}})};commentReply={cid:"",act:"",init:function(){var b=a("#replyrow");a("a.cancel",b).click(function(){return commentReply.revert()});a("a.save",b).click(function(){return commentReply.send()});a("input#author, input#author-email, input#author-url",b).keypress(function(c){if(c.which==13){commentReply.send();c.preventDefault();return false}});a("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())});a("#doaction, #doaction2, #post-query-submit").click(function(c){if(a("#the-comment-list #replyrow").length>0){commentReply.close()}});this.comments_listing=a('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(b){b.each(function(){a(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css("display")!="none"){a(b).find("a.vim-q").click()}},revert:function(){if(a("#the-comment-list #replyrow").length<1){return false}a("#replyrow").fadeOut("fast",function(){commentReply.close()});return false},close:function(){var b;if(this.cid){b=a("#comment-"+this.cid);if(this.act=="edit-comment"){b.fadeIn(300,function(){b.show()}).css("backgroundColor","")}a("#replyrow").hide();a("#com-reply").append(a("#replyrow"));a("#replycontent").val("");a("input","#edithead").val("");a(".error","#replysubmit").html("").hide();a(".waiting","#replysubmit").hide();if(a.browser.msie){a("#replycontainer, #replycontent").css("height","120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}this.cid=""}},open:function(b,d,k){var l=this,e,f,i,g,j=a("#comment-"+b);l.close();l.cid=b;a("td","#replyrow").attr("colspan",a("table.widefat thead th:visible").length);e=a("#replyrow");f=a("#inline-"+b);i=l.act=(k=="edit")?"edit-comment":"replyto-comment";a("#action",e).val(i);a("#comment_post_ID",e).val(d);a("#comment_ID",e).val(b);if(k=="edit"){a("#author",e).val(a("div.author",f).text());a("#author-email",e).val(a("div.author-email",f).text());a("#author-url",e).val(a("div.author-url",f).text());a("#status",e).val(a("div.comment_status",f).text());a("#replycontent",e).val(a("textarea.comment",f).val());a("#edithead, #savebtn",e).show();a("#replyhead, #replybtn",e).hide();g=j.height();if(g>220){if(a.browser.msie){a("#replycontainer, #replycontent",e).height(g-105)}else{a("#replycontainer",e).height(g-105)}}j.after(e).fadeOut("fast",function(){a("#replyrow").fadeIn(300,function(){a(this).show()})})}else{a("#edithead, #savebtn",e).hide();a("#replyhead, #replybtn",e).show();j.after(e);a("#replyrow").fadeIn(300,function(){a(this).show()})}if(!a.browser.msie){a("#replycontainer").resizable({handles:"s",axis:"y",minHeight:80,stop:function(){a("#replycontainer").width("auto")}})}setTimeout(function(){var n,h,o,c,m;n=a("#replyrow").offset().top;h=n+a("#replyrow").height();o=window.pageYOffset||document.documentElement.scrollTop;c=document.documentElement.clientHeight||self.innerHeight||0;m=o+c;if(m-20<h){window.scroll(0,h-c+35)}else{if(n-20<o){window.scroll(0,n-35)}}a("#replycontent").focus().keyup(function(p){if(p.which==27){commentReply.revert()}})},600);return false},send:function(){var b={};a("#replysubmit .waiting").show();a("#replyrow input").each(function(){b[a(this).attr("name")]=a(this).val()});b.content=a("#replycontent").val();b.id=b.comment_post_ID;b.comments_listing=this.comments_listing;a.ajax({type:"POST",url:ajaxurl,data:b,success:function(c){commentReply.show(c)},error:function(c){commentReply.error(c)}});return false},show:function(b){var e,g,f,d;if(typeof(b)=="string"){this.error({responseText:b});return false}e=wpAjax.parseAjaxResponse(b);if(e.errors){this.error({responseText:wpAjax.broken});return false}e=e.responses[0];g=e.data;f="#comment-"+e.id;if("edit-comment"==this.act){a(f).remove()}a(g).hide();a("#replyrow").after(g);this.revert();this.addEvents(a(f));d=a(f).hasClass("unapproved")?"#ffffe0":"#fff";a(f).animate({backgroundColor:"#CCEEBB"},600).animate({backgroundColor:d},600);a.fn.wpList.process(a(f))},error:function(b){var c=b.statusText;a("#replysubmit .waiting").hide();if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#replysubmit .error").html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a("span.delete a.delete").click(function(){return false});if(typeof QTags!="undefined"){ed_reply=new QTags("ed_reply","replycontent","replycontainer","more")}if(typeof a.table_hotkeys!="undefined"){e=function(f){return function(){var h,g;h="next"==f?"first":"last";g=a("."+f+".page-numbers");if(g.length){window.location=g[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+h+"=1"}}};b=function(g,f){window.location=a("span.edit a",f).attr("href")};c=function(){toggleWithKeyboard=true;a("input:checkbox","#cb").click().attr("checked","");toggleWithKeyboard=false};d=function(f){return function(){var g=a('select[name="action"]');a("option[value="+f+"]",g).attr("selected","selected");a("#comments-form").submit()}};a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q","z",["e",b],["shift+x",c],["shift+a",d("approve")],["shift+s",d("markspam")],["shift+d",d("delete")],["shift+t",d("trash")],["shift+z",d("untrash")],["shift+u",d("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e("prev"),next_page_link_cb:e("next")})}})})(jQuery);
\ No newline at end of file
if ( h )
$('#content').css('height', h.ch - 15 + 'px');
} else {
- $('#content').css('color', 'white');
- $('#quicktags').hide();
+ if ( typeof tinyMCE != 'object' ) {
+ $('#content').css('color', '#000');
+ } else {
+ $('#quicktags').hide();
+ }
}
});
return document.getElementById(e);
},
- edInit : function() {
- },
-
- saveCallback : function(el, content, body) {
-
- if ( tinyMCE.activeEditor.isHidden() )
- content = this.I(el).value;
- else
- content = this.pre_wpautop(content);
-
- return content;
- },
-
- pre_wpautop : function(content) {
+ _wp_Nop : function(content) {
var blocklist1, blocklist2;
// Protect pre|script tags
});
// Pretty it up for the source editor
- blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6]|p';
- content = content.replace(new RegExp('\\s*</('+blocklist1+')>\\s*', 'mg'), '</$1>\n');
- content = content.replace(new RegExp('\\s*<(('+blocklist1+')[^>]*)>', 'mg'), '\n<$1>');
+ blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset';
+ content = content.replace(new RegExp('\\s*</('+blocklist1+')>\\s*', 'g'), '</$1>\n');
+ content = content.replace(new RegExp('\\s*<(('+blocklist1+')[^>]*)>', 'g'), '\n<$1>');
// Mark </p> if it has any attributes.
- content = content.replace(new RegExp('(<p [^>]+>.*?)</p>', 'mg'), '$1</p#>');
+ content = content.replace(/(<p [^>]+>.*?)<\/p>/g, '$1</p#>');
// Sepatate <div> containing <p>
- content = content.replace(new RegExp('<div([^>]*)>\\s*<p>', 'mgi'), '<div$1>\n\n');
+ content = content.replace(/<div([^>]*)>\s*<p>/gi, '<div$1>\n\n');
// Remove <p> and <br />
- content = content.replace(new RegExp('\\s*<p>', 'mgi'), '');
- content = content.replace(new RegExp('\\s*</p>\\s*', 'mgi'), '\n\n');
- content = content.replace(new RegExp('\\n\\s*\\n', 'mgi'), '\n\n');
- content = content.replace(new RegExp('\\s*<br ?/?>\\s*', 'gi'), '\n');
+ content = content.replace(/\s*<p>/gi, '');
+ content = content.replace(/\s*<\/p>\s*/gi, '\n\n');
+ content = content.replace(/\n[\s\u00a0]+\n/g, '\n\n');
+ content = content.replace(/\s*<br ?\/?>\s*/gi, '\n');
// Fix some block element newline issues
- content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div');
- content = content.replace(new RegExp('</div>\\s*', 'mg'), '</div>\n');
- content = content.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n');
- content = content.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption');
+ content = content.replace(/\s*<div/g, '\n<div');
+ content = content.replace(/<\/div>\s*/g, '</div>\n');
+ content = content.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi, '\n\n[caption$1[/caption]\n\n');
+ content = content.replace(/caption\]\n\n+\[caption/g, 'caption]\n\n[caption');
- blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre';
- content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'mg'), '\n<$1>');
- content = content.replace(new RegExp('\\s*</('+blocklist2+')>\\s*', 'mg'), '</$1>\n');
- content = content.replace(new RegExp('<li([^>]*)>', 'g'), '\t<li$1>');
+ blocklist2 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset';
+ content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'g'), '\n<$1>');
+ content = content.replace(new RegExp('\\s*</('+blocklist2+')>\\s*', 'g'), '</$1>\n');
+ content = content.replace(/<li([^>]*)>/g, '\t<li$1>');
if ( content.indexOf('<object') != -1 ) {
content = content.replace(/<object[\s\S]+?<\/object>/g, function(a){
}
// Unmark special paragraph closing tags
- content = content.replace(new RegExp('</p#>', 'g'), '</p>\n');
- content = content.replace(new RegExp('\\s*(<p [^>]+>.*</p>)', 'mg'), '\n$1');
+ content = content.replace(/<\/p#>/g, '</p>\n');
+ content = content.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g, '\n$1');
// Trim whitespace
- content = content.replace(new RegExp('^\\s*', ''), '');
- content = content.replace(new RegExp('[\\s\\u00a0]*$', ''), '');
+ content = content.replace(/^\s+/, '');
+ content = content.replace(/[\s\u00a0]+$/, '');
// put back the line breaks in pre|script
content = content.replace(/<wp_temp>/g, '\n');
- // Hope.
return content;
},
edCloseAllTags(); // :-(
qt.style.display = 'none';
+ ta.style.color = '#FFF';
ta.value = this.wpautop(ta.value);
- if ( ed ) {
- ed.show();
- } else {
- try{tinyMCE.execCommand("mceAddControl", false, id);}
- catch(e){}
- }
+ try {
+ if ( ed )
+ ed.show();
+ else
+ tinyMCE.execCommand("mceAddControl", false, id);
+ } catch(e) {}
+
+ ta.style.color = '#000';
} else {
setUserSetting( 'editor', 'html' );
ta.style.color = '#000';
return false;
},
- wpautop : function(pee) {
- var blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]';
+ _wp_Autop : function(pee) {
+ var blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|fieldset|legend';
if ( pee.indexOf('<object') != -1 ) {
pee = pee.replace(/<object[\s\S]+?<\/object>/g, function(a){
return a.replace(/[\r\n]+/g, ' ');
});
- pee = pee + "\n\n";
- pee = pee.replace(new RegExp('<br />\\s*<br />', 'gi'), "\n\n");
- pee = pee.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)', 'gi'), "\n$1");
- pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), "$1\n\n");
- pee = pee.replace(new RegExp("\\r\\n|\\r", 'g'), "\n");
- pee = pee.replace(new RegExp("\\n\\s*\\n+", 'g'), "\n\n");
- pee = pee.replace(new RegExp('([\\s\\S]+?)\\n\\n', 'mg'), "<p>$1</p>\n");
- pee = pee.replace(new RegExp('<p>\\s*?</p>', 'gi'), '');
+ pee = pee + '\n\n';
+ pee = pee.replace(/<br \/>\s*<br \/>/gi, '\n\n');
+ pee = pee.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)', 'gi'), '\n$1');
+ pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), '$1\n\n');
+ pee = pee.replace(/\r\n|\r/g, '\n');
+ pee = pee.replace(/\n\s*\n+/g, '\n\n');
+ pee = pee.replace(/([\s\S]+?)\n\n/g, '<p>$1</p>\n');
+ pee = pee.replace(/<p>\s*?<\/p>/gi, '');
pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
- pee = pee.replace(new RegExp("<p>(<li.+?)</p>", 'gi'), "$1");
- pee = pee.replace(new RegExp('<p>\\s*<blockquote([^>]*)>', 'gi'), "<blockquote$1><p>");
- pee = pee.replace(new RegExp('</blockquote>\\s*</p>', 'gi'), '</p></blockquote>');
+ pee = pee.replace(/<p>(<li.+?)<\/p>/gi, '$1');
+ pee = pee.replace(/<p>\s*<blockquote([^>]*)>/gi, '<blockquote$1><p>');
+ pee = pee.replace(/<\/blockquote>\s*<\/p>/gi, '</p></blockquote>');
pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)', 'gi'), "$1");
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
- pee = pee.replace(new RegExp('\\s*\\n', 'gi'), "<br />\n");
+ pee = pee.replace(/\s*\n/gi, '<br />\n');
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
- pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');
- pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[caption$1[/caption]');
+ pee = pee.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi, '$1');
+ pee = pee.replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi, '[caption$1[/caption]');
+
+ pee = pee.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g, function(a, b, c) {
+ if ( c.match(/<p( [^>]+)?>/) )
+ return a;
+
+ return b + '<p>' + c + '</p>';
+ });
// Fix the pre|script tags
pee = pee.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
});
return pee;
+ },
+
+ pre_wpautop : function(content) {
+ var t = this, o = { o: t, data: content, unfiltered: content };
+
+ jQuery('body').trigger('beforePreWpautop', [o]);
+ o.data = t._wp_Nop(o.data);
+ jQuery('body').trigger('afterPreWpautop', [o]);
+ return o.data;
+ },
+
+ wpautop : function(pee) {
+ var t = this, o = { o: t, data: pee, unfiltered: pee };
+
+ jQuery('body').trigger('beforeWpautop', [o]);
+ o.data = t._wp_Autop(o.data);
+ jQuery('body').trigger('afterWpautop', [o]);
+ return o.data;
}
};
-jQuery(document).ready(function(b){var a=wpCookies.getHash("TinyMCE_content_size");if(getUserSetting("editor")=="html"){if(a){b("#content").css("height",a.ch-15+"px")}}else{b("#content").css("color","white");b("#quicktags").hide()}});var switchEditors={mode:"",I:function(a){return document.getElementById(a)},edInit:function(){},saveCallback:function(b,c,a){if(tinyMCE.activeEditor.isHidden()){c=this.I(b).value}else{c=this.pre_wpautop(c)}return c},pre_wpautop:function(b){var c,a;b=b.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(d){d=d.replace(/<br ?\/?>[\r\n]*/g,"<wp_temp>");return d.replace(/<\/?p( [^>]*)?>[\r\n]*/g,"<wp_temp>")});c="blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6]|p";b=b.replace(new RegExp("\\s*</("+c+")>\\s*","mg"),"</$1>\n");b=b.replace(new RegExp("\\s*<(("+c+")[^>]*)>","mg"),"\n<$1>");b=b.replace(new RegExp("(<p [^>]+>.*?)</p>","mg"),"$1</p#>");b=b.replace(new RegExp("<div([^>]*)>\\s*<p>","mgi"),"<div$1>\n\n");b=b.replace(new RegExp("\\s*<p>","mgi"),"");b=b.replace(new RegExp("\\s*</p>\\s*","mgi"),"\n\n");b=b.replace(new RegExp("\\n\\s*\\n","mgi"),"\n\n");b=b.replace(new RegExp("\\s*<br ?/?>\\s*","gi"),"\n");b=b.replace(new RegExp("\\s*<div","mg"),"\n<div");b=b.replace(new RegExp("</div>\\s*","mg"),"</div>\n");b=b.replace(new RegExp("\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*","gi"),"\n\n[caption$1[/caption]\n\n");b=b.replace(new RegExp("caption\\]\\n\\n+\\[caption","g"),"caption]\n\n[caption");a="blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre";b=b.replace(new RegExp("\\s*<(("+a+") ?[^>]*)\\s*>","mg"),"\n<$1>");b=b.replace(new RegExp("\\s*</("+a+")>\\s*","mg"),"</$1>\n");b=b.replace(new RegExp("<li([^>]*)>","g"),"\t<li$1>");if(b.indexOf("<object")!=-1){b=b.replace(/<object[\s\S]+?<\/object>/g,function(d){return d.replace(/[\r\n]+/g,"")})}b=b.replace(new RegExp("</p#>","g"),"</p>\n");b=b.replace(new RegExp("\\s*(<p [^>]+>.*</p>)","mg"),"\n$1");b=b.replace(new RegExp("^\\s*",""),"");b=b.replace(new RegExp("[\\s\\u00a0]*$",""),"");b=b.replace(/<wp_temp>/g,"\n");return b},go:function(i,g){i=i||"content";g=g||this.mode||"";var b,h=this.I("quicktags"),c=this.I("edButtonHTML"),d=this.I("edButtonPreview"),a=this.I(i);try{b=tinyMCE.get(i)}catch(f){b=false}if("tinymce"==g){if(b&&!b.isHidden()){return false}setUserSetting("editor","tinymce");this.mode="html";d.className="active";c.className="";edCloseAllTags();h.style.display="none";a.value=this.wpautop(a.value);if(b){b.show()}else{try{tinyMCE.execCommand("mceAddControl",false,i)}catch(f){}}}else{setUserSetting("editor","html");a.style.color="#000";this.mode="tinymce";c.className="active";d.className="";if(b&&!b.isHidden()){a.style.height=b.getContentAreaContainer().offsetHeight+24+"px";b.hide()}h.style.display="block"}return false},wpautop:function(a){var b="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]";if(a.indexOf("<object")!=-1){a=a.replace(/<object[\s\S]+?<\/object>/g,function(c){return c.replace(/[\r\n]+/g,"")})}a=a.replace(/<[^<>]+>/g,function(c){return c.replace(/[\r\n]+/g," ")});a=a+"\n\n";a=a.replace(new RegExp("<br />\\s*<br />","gi"),"\n\n");a=a.replace(new RegExp("(<(?:"+b+")[^>]*>)","gi"),"\n$1");a=a.replace(new RegExp("(</(?:"+b+")>)","gi"),"$1\n\n");a=a.replace(new RegExp("\\r\\n|\\r","g"),"\n");a=a.replace(new RegExp("\\n\\s*\\n+","g"),"\n\n");a=a.replace(new RegExp("([\\s\\S]+?)\\n\\n","mg"),"<p>$1</p>\n");a=a.replace(new RegExp("<p>\\s*?</p>","gi"),"");a=a.replace(new RegExp("<p>\\s*(</?(?:"+b+")[^>]*>)\\s*</p>","gi"),"$1");a=a.replace(new RegExp("<p>(<li.+?)</p>","gi"),"$1");a=a.replace(new RegExp("<p>\\s*<blockquote([^>]*)>","gi"),"<blockquote$1><p>");a=a.replace(new RegExp("</blockquote>\\s*</p>","gi"),"</p></blockquote>");a=a.replace(new RegExp("<p>\\s*(</?(?:"+b+")[^>]*>)","gi"),"$1");a=a.replace(new RegExp("(</?(?:"+b+")[^>]*>)\\s*</p>","gi"),"$1");a=a.replace(new RegExp("\\s*\\n","gi"),"<br />\n");a=a.replace(new RegExp("(</?(?:"+b+")[^>]*>)\\s*<br />","gi"),"$1");a=a.replace(new RegExp("<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)","gi"),"$1");a=a.replace(new RegExp("(?:<p>|<br ?/?>)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:</p>|<br ?/?>)*","gi"),"[caption$1[/caption]");a=a.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(c){c=c.replace(/<br ?\/?>[\r\n]*/g,"\n");return c.replace(/<\/?p( [^>]*)?>[\r\n]*/g,"\n")});return a}};
\ No newline at end of file
+jQuery(document).ready(function(b){var a=wpCookies.getHash("TinyMCE_content_size");if(getUserSetting("editor")=="html"){if(a){b("#content").css("height",a.ch-15+"px")}}else{if(typeof tinyMCE!="object"){b("#content").css("color","#000")}else{b("#quicktags").hide()}}});var switchEditors={mode:"",I:function(a){return document.getElementById(a)},_wp_Nop:function(b){var c,a;b=b.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(d){d=d.replace(/<br ?\/?>[\r\n]*/g,"<wp_temp>");return d.replace(/<\/?p( [^>]*)?>[\r\n]*/g,"<wp_temp>")});c="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset";b=b.replace(new RegExp("\\s*</("+c+")>\\s*","g"),"</$1>\n");b=b.replace(new RegExp("\\s*<(("+c+")[^>]*)>","g"),"\n<$1>");b=b.replace(/(<p [^>]+>.*?)<\/p>/g,"$1</p#>");b=b.replace(/<div([^>]*)>\s*<p>/gi,"<div$1>\n\n");b=b.replace(/\s*<p>/gi,"");b=b.replace(/\s*<\/p>\s*/gi,"\n\n");b=b.replace(/\n[\s\u00a0]+\n/g,"\n\n");b=b.replace(/\s*<br ?\/?>\s*/gi,"\n");b=b.replace(/\s*<div/g,"\n<div");b=b.replace(/<\/div>\s*/g,"</div>\n");b=b.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n");b=b.replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption");a="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset";b=b.replace(new RegExp("\\s*<(("+a+") ?[^>]*)\\s*>","g"),"\n<$1>");b=b.replace(new RegExp("\\s*</("+a+")>\\s*","g"),"</$1>\n");b=b.replace(/<li([^>]*)>/g,"\t<li$1>");if(b.indexOf("<object")!=-1){b=b.replace(/<object[\s\S]+?<\/object>/g,function(d){return d.replace(/[\r\n]+/g,"")})}b=b.replace(/<\/p#>/g,"</p>\n");b=b.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1");b=b.replace(/^\s+/,"");b=b.replace(/[\s\u00a0]+$/,"");b=b.replace(/<wp_temp>/g,"\n");return b},go:function(i,g){i=i||"content";g=g||this.mode||"";var b,h=this.I("quicktags"),c=this.I("edButtonHTML"),d=this.I("edButtonPreview"),a=this.I(i);try{b=tinyMCE.get(i)}catch(f){b=false}if("tinymce"==g){if(b&&!b.isHidden()){return false}setUserSetting("editor","tinymce");this.mode="html";d.className="active";c.className="";edCloseAllTags();h.style.display="none";a.style.color="#FFF";a.value=this.wpautop(a.value);try{if(b){b.show()}else{tinyMCE.execCommand("mceAddControl",false,i)}}catch(f){}a.style.color="#000"}else{setUserSetting("editor","html");a.style.color="#000";this.mode="tinymce";c.className="active";d.className="";if(b&&!b.isHidden()){a.style.height=b.getContentAreaContainer().offsetHeight+24+"px";b.hide()}h.style.display="block"}return false},_wp_Autop:function(a){var b="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|fieldset|legend";if(a.indexOf("<object")!=-1){a=a.replace(/<object[\s\S]+?<\/object>/g,function(c){return c.replace(/[\r\n]+/g,"")})}a=a.replace(/<[^<>]+>/g,function(c){return c.replace(/[\r\n]+/g," ")});a=a+"\n\n";a=a.replace(/<br \/>\s*<br \/>/gi,"\n\n");a=a.replace(new RegExp("(<(?:"+b+")[^>]*>)","gi"),"\n$1");a=a.replace(new RegExp("(</(?:"+b+")>)","gi"),"$1\n\n");a=a.replace(/\r\n|\r/g,"\n");a=a.replace(/\n\s*\n+/g,"\n\n");a=a.replace(/([\s\S]+?)\n\n/g,"<p>$1</p>\n");a=a.replace(/<p>\s*?<\/p>/gi,"");a=a.replace(new RegExp("<p>\\s*(</?(?:"+b+")[^>]*>)\\s*</p>","gi"),"$1");a=a.replace(/<p>(<li.+?)<\/p>/gi,"$1");a=a.replace(/<p>\s*<blockquote([^>]*)>/gi,"<blockquote$1><p>");a=a.replace(/<\/blockquote>\s*<\/p>/gi,"</p></blockquote>");a=a.replace(new RegExp("<p>\\s*(</?(?:"+b+")[^>]*>)","gi"),"$1");a=a.replace(new RegExp("(</?(?:"+b+")[^>]*>)\\s*</p>","gi"),"$1");a=a.replace(/\s*\n/gi,"<br />\n");a=a.replace(new RegExp("(</?(?:"+b+")[^>]*>)\\s*<br />","gi"),"$1");a=a.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi,"$1");a=a.replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi,"[caption$1[/caption]");a=a.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g,function(e,d,f){if(f.match(/<p( [^>]+)?>/)){return e}return d+"<p>"+f+"</p>"});a=a.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(c){c=c.replace(/<br ?\/?>[\r\n]*/g,"\n");return c.replace(/<\/?p( [^>]*)?>[\r\n]*/g,"\n")});return a},pre_wpautop:function(b){var a=this,c={o:a,data:b,unfiltered:b};jQuery("body").trigger("beforePreWpautop",[c]);c.data=a._wp_Nop(c.data);jQuery("body").trigger("afterPreWpautop",[c]);return c.data},wpautop:function(b){var a=this,c={o:a,data:b,unfiltered:b};jQuery("body").trigger("beforeWpautop",[c]);c.data=a._wp_Autop(c.data);jQuery("body").trigger("afterWpautop",[c]);return c.data}};
\ No newline at end of file
gallerySortableInit = function() {
gallerySortable = $('#media-items').sortable( {
- items: '.media-item',
+ items: 'div.media-item',
placeholder: 'sorthelper',
axis: 'y',
distance: 2,
+ handle: 'div.filename',
stop: function(e, ui) {
// When an update has occurred, adjust the order for each item
var all = $('#media-items').sortable('toArray'), len = all.length;
-jQuery(document).ready(function(c){var b,e,a,d=false;e=function(){b=c("#media-items").sortable({items:".media-item",placeholder:"sorthelper",axis:"y",distance:2,stop:function(i,h){var g=c("#media-items").sortable("toArray"),f=g.length;c.each(g,function(k,l){var j=d?(f-k):(1+k);c("#"+l+" .menu_order input").val(j)})}})};sortIt=function(){var g=c(".menu_order_input"),f=g.length;g.each(function(j){var h=d?(f-j):(1+j);c(this).val(h)})};clearAll=function(f){f=f||0;c(".menu_order_input").each(function(){if(this.value=="0"||f){this.value=""}})};c("#asc").click(function(){d=false;sortIt();return false});c("#desc").click(function(){d=true;sortIt();return false});c("#clear").click(function(){clearAll(1);return false});c("#showall").click(function(){c("#sort-buttons span a").toggle();c("a.describe-toggle-on").hide();c("a.describe-toggle-off, table.slidetoggle").show();return false});c("#hideall").click(function(){c("#sort-buttons span a").toggle();c("a.describe-toggle-on").show();c("a.describe-toggle-off, table.slidetoggle").hide();return false});e();clearAll();if(c("#media-items>*").length>1){a=wpgallery.getWin();c("#save-all, #gallery-settings").show();if(typeof a.tinyMCE!="undefined"&&a.tinyMCE.activeEditor&&!a.tinyMCE.activeEditor.isHidden()){wpgallery.mcemode=true;wpgallery.init()}else{c("#insert-gallery").show()}}});jQuery(window).unload(function(){tinymce=tinyMCE=wpgallery=null});var tinymce=null,tinyMCE,wpgallery;wpgallery={mcemode:false,editor:{},dom:{},is_update:false,el:{},I:function(a){return document.getElementById(a)},init:function(){var d=this,a,f,c,e,b=d.getWin();if(!d.mcemode){return}a=(""+document.location.search).replace(/^\?/,"").split("&");f={};for(c=0;c<a.length;c++){e=a[c].split("=");f[unescape(e[0])]=unescape(e[1])}if(f.mce_rdomain){document.domain=f.mce_rdomain}tinymce=b.tinymce;tinyMCE=b.tinyMCE;d.editor=tinymce.EditorManager.activeEditor;d.setup()},getWin:function(){return window.dialogArguments||opener||parent||top},restoreSelection:function(){var a=this;if(tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},setup:function(){var f=this,c,d=f.editor,i,e,h,b,j;if(!f.mcemode){return}f.restoreSelection();f.el=d.selection.getNode();if(f.el.nodeName!="IMG"||!d.dom.hasClass(f.el,"wpGallery")){if((i=d.dom.select("img.wpGallery"))&&i[0]){f.el=i[0]}else{if(getUserSetting("galfile")=="1"){f.I("linkto-file").checked="checked"}if(getUserSetting("galdesc")=="1"){f.I("order-desc").checked="checked"}if(getUserSetting("galcols")){f.I("columns").value=getUserSetting("galcols")}if(getUserSetting("galord")){f.I("orderby").value=getUserSetting("galord")}jQuery("#insert-gallery").show();return}}c=d.dom.getAttrib(f.el,"title");c=d.dom.decode(c);if(c){jQuery("#update-gallery").show();f.is_update=true;e=c.match(/columns=['"]([0-9]+)['"]/);h=c.match(/link=['"]([^'"]+)['"]/i);b=c.match(/order=['"]([^'"]+)['"]/i);j=c.match(/orderby=['"]([^'"]+)['"]/i);if(h&&h[1]){f.I("linkto-file").checked="checked"}if(b&&b[1]){f.I("order-desc").checked="checked"}if(e&&e[1]){f.I("columns").value=""+e[1]}if(j&&j[1]){f.I("orderby").value=j[1]}}else{jQuery("#insert-gallery").show()}},update:function(){var b=this,a=b.editor,d="",c;if(!b.mcemode||!b.is_update){c="[gallery"+b.getSettings()+"]";b.getWin().send_to_editor(c);return}if(b.el.nodeName!="IMG"){return}d=a.dom.decode(a.dom.getAttrib(b.el,"title"));d=d.replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi,"");d+=b.getSettings();a.dom.setAttrib(b.el,"title",d);b.getWin().tb_remove()},getSettings:function(){var a=this.I,b="";if(a("linkto-file").checked){b+=' link="file"';setUserSetting("galfile","1")}if(a("order-desc").checked){b+=' order="DESC"';setUserSetting("galdesc","1")}if(a("columns").value!=3){b+=' columns="'+a("columns").value+'"';setUserSetting("galcols",a("columns").value)}if(a("orderby").value!="menu_order"){b+=' orderby="'+a("orderby").value+'"';setUserSetting("galord",a("orderby").value)}return b}};
\ No newline at end of file
+jQuery(document).ready(function(c){var b,e,a,d=false;e=function(){b=c("#media-items").sortable({items:"div.media-item",placeholder:"sorthelper",axis:"y",distance:2,handle:"div.filename",stop:function(i,h){var g=c("#media-items").sortable("toArray"),f=g.length;c.each(g,function(k,l){var j=d?(f-k):(1+k);c("#"+l+" .menu_order input").val(j)})}})};sortIt=function(){var g=c(".menu_order_input"),f=g.length;g.each(function(j){var h=d?(f-j):(1+j);c(this).val(h)})};clearAll=function(f){f=f||0;c(".menu_order_input").each(function(){if(this.value=="0"||f){this.value=""}})};c("#asc").click(function(){d=false;sortIt();return false});c("#desc").click(function(){d=true;sortIt();return false});c("#clear").click(function(){clearAll(1);return false});c("#showall").click(function(){c("#sort-buttons span a").toggle();c("a.describe-toggle-on").hide();c("a.describe-toggle-off, table.slidetoggle").show();return false});c("#hideall").click(function(){c("#sort-buttons span a").toggle();c("a.describe-toggle-on").show();c("a.describe-toggle-off, table.slidetoggle").hide();return false});e();clearAll();if(c("#media-items>*").length>1){a=wpgallery.getWin();c("#save-all, #gallery-settings").show();if(typeof a.tinyMCE!="undefined"&&a.tinyMCE.activeEditor&&!a.tinyMCE.activeEditor.isHidden()){wpgallery.mcemode=true;wpgallery.init()}else{c("#insert-gallery").show()}}});jQuery(window).unload(function(){tinymce=tinyMCE=wpgallery=null});var tinymce=null,tinyMCE,wpgallery;wpgallery={mcemode:false,editor:{},dom:{},is_update:false,el:{},I:function(a){return document.getElementById(a)},init:function(){var d=this,a,f,c,e,b=d.getWin();if(!d.mcemode){return}a=(""+document.location.search).replace(/^\?/,"").split("&");f={};for(c=0;c<a.length;c++){e=a[c].split("=");f[unescape(e[0])]=unescape(e[1])}if(f.mce_rdomain){document.domain=f.mce_rdomain}tinymce=b.tinymce;tinyMCE=b.tinyMCE;d.editor=tinymce.EditorManager.activeEditor;d.setup()},getWin:function(){return window.dialogArguments||opener||parent||top},restoreSelection:function(){var a=this;if(tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},setup:function(){var f=this,c,d=f.editor,i,e,h,b,j;if(!f.mcemode){return}f.restoreSelection();f.el=d.selection.getNode();if(f.el.nodeName!="IMG"||!d.dom.hasClass(f.el,"wpGallery")){if((i=d.dom.select("img.wpGallery"))&&i[0]){f.el=i[0]}else{if(getUserSetting("galfile")=="1"){f.I("linkto-file").checked="checked"}if(getUserSetting("galdesc")=="1"){f.I("order-desc").checked="checked"}if(getUserSetting("galcols")){f.I("columns").value=getUserSetting("galcols")}if(getUserSetting("galord")){f.I("orderby").value=getUserSetting("galord")}jQuery("#insert-gallery").show();return}}c=d.dom.getAttrib(f.el,"title");c=d.dom.decode(c);if(c){jQuery("#update-gallery").show();f.is_update=true;e=c.match(/columns=['"]([0-9]+)['"]/);h=c.match(/link=['"]([^'"]+)['"]/i);b=c.match(/order=['"]([^'"]+)['"]/i);j=c.match(/orderby=['"]([^'"]+)['"]/i);if(h&&h[1]){f.I("linkto-file").checked="checked"}if(b&&b[1]){f.I("order-desc").checked="checked"}if(e&&e[1]){f.I("columns").value=""+e[1]}if(j&&j[1]){f.I("orderby").value=j[1]}}else{jQuery("#insert-gallery").show()}},update:function(){var b=this,a=b.editor,d="",c;if(!b.mcemode||!b.is_update){c="[gallery"+b.getSettings()+"]";b.getWin().send_to_editor(c);return}if(b.el.nodeName!="IMG"){return}d=a.dom.decode(a.dom.getAttrib(b.el,"title"));d=d.replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi,"");d+=b.getSettings();a.dom.setAttrib(b.el,"title",d);b.getWin().tb_remove()},getSettings:function(){var a=this.I,b="";if(a("linkto-file").checked){b+=' link="file"';setUserSetting("galfile","1")}if(a("order-desc").checked){b+=' order="DESC"';setUserSetting("galdesc","1")}if(a("columns").value!=3){b+=' columns="'+a("columns").value+'"';setUserSetting("galcols",a("columns").value)}if(a("orderby").value!="menu_order"){b+=' orderby="'+a("orderby").value+'"';setUserSetting("galord",a("orderby").value)}return b}};
\ No newline at end of file
--- /dev/null
+var imageEdit;
+
+(function($) {
+imageEdit = {
+ iasapi : {},
+ hold : {},
+ postid : '',
+
+ intval : function(f) {
+ return f | 0;
+ },
+
+ setDisabled : function(el, s) {
+ if ( s ) {
+ el.removeClass('disabled');
+ $('input', el).removeAttr('disabled');
+ } else {
+ el.addClass('disabled');
+ $('input', el).attr('disabled', 'disabled');
+ }
+ },
+
+ init : function(postid, nonce) {
+ var t = this, old = $('#image-editor-' + t.postid),
+ x = t.intval( $('#imgedit-x-' + postid).val() ),
+ y = t.intval( $('#imgedit-y-' + postid).val() );
+
+ if ( t.postid != postid && old.length )
+ t.close(t.postid);
+
+ t.hold['w'] = t.hold['ow'] = x;
+ t.hold['h'] = t.hold['oh'] = y;
+ t.hold['xy_ratio'] = x / y;
+ t.hold['sizer'] = parseFloat( $('#imgedit-sizer-' + postid).val() );
+ t.postid = postid;
+ $('#imgedit-response-' + postid).empty();
+
+ $('input[type="text"]', '#imgedit-panel-' + postid).keypress(function(e) {
+ var k = e.keyCode;
+
+ if ( 36 < k && k < 41 )
+ $(this).blur()
+
+ if ( 13 == k ) {
+ e.preventDefault();
+ e.stopPropagation();
+ return false;
+ }
+ });
+ },
+
+ toggleEditor : function(postid, toggle) {
+ var wait = $('#imgedit-wait-' + postid);
+
+ if ( toggle )
+ wait.height( $('#imgedit-panel-' + postid).height() ).fadeIn('fast');
+ else
+ wait.fadeOut('fast');
+ },
+
+ toggleHelp : function(el) {
+ $(el).siblings('.imgedit-help').slideToggle('fast');
+ return false;
+ },
+
+ getTarget : function(postid) {
+ return $('input[name=imgedit-target-' + postid + ']:checked', '#imgedit-save-target-' + postid).val() || 'full';
+ },
+
+ scaleChanged : function(postid, x) {
+ var w = $('#imgedit-scale-width-' + postid), h = $('#imgedit-scale-height-' + postid),
+ warn = $('#imgedit-scale-warn-' + postid), w1 = '', h1 = '';
+
+ if ( x ) {
+ h1 = (w.val() != '') ? this.intval( w.val() / this.hold['xy_ratio'] ) : '';
+ h.val( h1 );
+ } else {
+ w1 = (h.val() != '') ? this.intval( h.val() * this.hold['xy_ratio'] ) : '';
+ w.val( w1 );
+ }
+
+ if ( ( h1 && h1 > this.hold['oh'] ) || ( w1 && w1 > this.hold['ow'] ) )
+ warn.css('visibility', 'visible');
+ else
+ warn.css('visibility', 'hidden');
+ },
+
+ getSelRatio : function(postid) {
+ var x = this.hold['w'], y = this.hold['h'],
+ X = this.intval( $('#imgedit-crop-width-' + postid).val() ),
+ Y = this.intval( $('#imgedit-crop-height-' + postid).val() );
+
+ if ( X && Y )
+ return X + ':' + Y;
+
+ if ( x && y )
+ return x + ':' + y;
+
+ return '1:1';
+ },
+
+ filterHistory : function(postid, setSize) {
+ // apply undo state to history
+ var history = $('#imgedit-history-' + postid).val(), pop, n, o, i, op = [];
+
+ if ( history != '' ) {
+ history = JSON.parse(history);
+ pop = this.intval( $('#imgedit-undone-' + postid).val() );
+ if ( pop > 0 ) {
+ while ( pop > 0 ) {
+ history.pop();
+ pop--;
+ }
+ }
+
+ if ( setSize ) {
+ if ( !history.length ) {
+ this.hold['w'] = this.hold['ow'];
+ this.hold['h'] = this.hold['oh'];
+ return '';
+ }
+
+ // restore
+ o = history[history.length - 1];
+ o = o.c || o.r || o.f || false;
+
+ if ( o ) {
+ this.hold['w'] = o.fw;
+ this.hold['h'] = o.fh;
+ }
+ }
+
+ // filter the values
+ for ( n in history ) {
+ i = history[n];
+ if ( i.hasOwnProperty('c') ) {
+ op[n] = { 'c': { 'x': i.c.x, 'y': i.c.y, 'w': i.c.w, 'h': i.c.h } };
+ } else if ( i.hasOwnProperty('r') ) {
+ op[n] = { 'r': i.r.r };
+ } else if ( i.hasOwnProperty('f') ) {
+ op[n] = { 'f': i.f.f };
+ }
+ }
+ return JSON.stringify(op);
+ }
+ return '';
+ },
+
+ refreshEditor : function(postid, nonce, callback) {
+ var t = this, data, img;
+
+ t.toggleEditor(postid, 1);
+ data = {
+ 'action': 'imgedit-preview',
+ '_ajax_nonce': nonce,
+ 'postid': postid,
+ 'history': t.filterHistory(postid, 1),
+ 'rand': t.intval(Math.random() * 1000000)
+ };
+
+ img = $('<img id="image-preview-' + postid + '" />');
+ img.load( function() {
+ var max1, max2, parent = $('#imgedit-crop-' + postid), t = imageEdit;
+
+ parent.empty().append(img);
+
+ // w, h are the new full size dims
+ max1 = Math.max( t.hold.w, t.hold.h );
+ max2 = Math.max( $(img).width(), $(img).height() );
+ t.hold['sizer'] = max1 > max2 ? max2 / max1 : 1;
+
+ t.initCrop(postid, img, parent);
+ t.setCropSelection(postid, 0);
+
+ if ( (typeof callback != "unknown") && callback != null )
+ callback();
+
+ if ( $('#imgedit-history-' + postid).val() && $('#imgedit-undone-' + postid).val() == 0 )
+ $('input.imgedit-submit-btn', '#imgedit-panel-' + postid).removeAttr('disabled');
+ else
+ $('input.imgedit-submit-btn', '#imgedit-panel-' + postid).attr('disabled', 'disabled');
+
+ t.toggleEditor(postid, 0);
+ }).attr('src', ajaxurl + '?' + $.param(data));
+ },
+
+ action : function(postid, nonce, action) {
+ var t = this, data, w, h, fw, fh;
+
+ if ( t.notsaved(postid) )
+ return false;
+
+ data = {
+ 'action': 'image-editor',
+ '_ajax_nonce': nonce,
+ 'postid': postid
+ };
+
+ if ( 'scale' == action ) {
+ w = $('#imgedit-scale-width-' + postid),
+ h = $('#imgedit-scale-height-' + postid),
+ fw = t.intval(w.val()),
+ fh = t.intval(h.val());
+
+ if ( fw < 1 ) {
+ w.focus();
+ return false;;
+ } else if ( fh < 1 ) {
+ h.focus();
+ return false;;
+ }
+
+ if ( fw == t.hold.ow || fh == t.hold.oh )
+ return false;
+
+ data['do'] = 'scale';
+ data['fwidth'] = fw;
+ data['fheight'] = fh;
+ } else if ( 'restore' == action ) {
+ data['do'] = 'restore';
+ } else {
+ return false;
+ }
+
+ t.toggleEditor(postid, 1);
+ $.post(ajaxurl, data, function(r) {
+ $('#image-editor-' + postid).empty().append(r);
+ t.toggleEditor(postid, 0);
+ });
+ },
+
+ save : function(postid, nonce) {
+ var data, target = this.getTarget(postid), history = this.filterHistory(postid, 0);
+
+ if ( '' == history )
+ return false;
+
+ this.toggleEditor(postid, 1);
+ data = {
+ 'action': 'image-editor',
+ '_ajax_nonce': nonce,
+ 'postid': postid,
+ 'history': history,
+ 'target': target,
+ 'do': 'save'
+ };
+
+ $.post(ajaxurl, data, function(r) {
+ var ret = JSON.parse(r);
+
+ if ( ret.error ) {
+ $('#imgedit-response-' + postid).html('<div class="error"><p>' + ret.error + '</p><div>');
+ imageEdit.close(postid);
+ return;
+ }
+
+ if ( ret.fw && ret.fh )
+ $('#media-dims-' + postid).html( ret.fw + ' × ' + ret.fh );
+
+ if ( ret.thumbnail )
+ $('.thumbnail', '#thumbnail-head-' + postid).attr('src', ''+ret.thumbnail);
+
+ if ( ret.msg )
+ $('#imgedit-response-' + postid).html('<div class="updated"><p>' + ret.msg + '</p></div>');
+
+ imageEdit.close(postid);
+ });
+ },
+
+ open : function(postid, nonce) {
+ var data, elem = $('#image-editor-' + postid), head = $('#media-head-' + postid),
+ btn = $('#imgedit-open-btn-' + postid), spin = btn.siblings('img');
+
+ btn.attr('disabled', 'disabled');
+ spin.css('visibility', 'visible');
+
+ data = {
+ 'action': 'image-editor',
+ '_ajax_nonce': nonce,
+ 'postid': postid,
+ 'do': 'open'
+ };
+
+ elem.load(ajaxurl, data, function() {
+ elem.fadeIn('fast');
+ head.fadeOut('fast', function(){
+ btn.removeAttr('disabled');
+ spin.css('visibility', 'hidden');
+ });
+ });
+ },
+
+ imgLoaded : function(postid) {
+ var img = $('#image-preview-' + postid), parent = $('#imgedit-crop-' + postid);
+
+ this.initCrop(postid, img, parent);
+ this.setCropSelection(postid, 0);
+ this.toggleEditor(postid, 0);
+ },
+
+ initCrop : function(postid, image, parent) {
+ var t = this, selW = $('#imgedit-sel-width-' + postid),
+ selH = $('#imgedit-sel-height-' + postid);
+
+ t.iasapi = $(image).imgAreaSelect({
+ parent: parent,
+ instance: true,
+ handles: true,
+ keys: true,
+ minWidth: 3,
+ minHeight: 3,
+
+ onInit: function(img, c) {
+ parent.children().mousedown(function(e){
+ var ratio = false, sel, defRatio;
+
+ if ( e.shiftKey ) {
+ sel = t.iasapi.getSelection();
+ defRatio = t.getSelRatio(postid);
+ ratio = ( sel && sel.width && sel.height ) ? sel.width + ':' + sel.height : defRatio;
+ }
+
+ t.iasapi.setOptions({
+ aspectRatio: ratio
+ });
+ });
+ },
+
+ onSelectStart: function(img, c) {
+ imageEdit.setDisabled($('#imgedit-crop-sel-' + postid), 1);
+ },
+
+ onSelectEnd: function(img, c) {
+ imageEdit.setCropSelection(postid, c);
+ },
+
+ onSelectChange: function(img, c) {
+ var sizer = imageEdit.hold.sizer;
+ selW.val( imageEdit.round(c.width / sizer) );
+ selH.val( imageEdit.round(c.height / sizer) );
+ }
+ });
+ },
+
+ setCropSelection : function(postid, c) {
+ var sel, min = $('#imgedit-minthumb-' + postid).val() || '128:128',
+ sizer = this.hold['sizer'];
+ min = min.split(':');
+ c = c || 0;
+
+ if ( !c || ( c.width < 3 && c.height < 3 ) ) {
+ this.setDisabled($('.imgedit-crop', '#imgedit-panel-' + postid), 0);
+ this.setDisabled($('#imgedit-crop-sel-' + postid), 0);
+ $('#imgedit-sel-width-' + postid).val('');
+ $('#imgedit-sel-height-' + postid).val('');
+ $('#imgedit-selection-' + postid).val('');
+ return false;
+ }
+
+ if ( c.width < (min[0] * sizer) && c.height < (min[1] * sizer) ) {
+ this.setDisabled($('.imgedit-crop', '#imgedit-panel-' + postid), 0);
+ $('#imgedit-selection-' + postid).val('');
+ return false;
+ }
+
+ sel = { 'x': c.x1, 'y': c.y1, 'w': c.width, 'h': c.height };
+ this.setDisabled($('.imgedit-crop', '#imgedit-panel-' + postid), 1);
+ $('#imgedit-selection-' + postid).val( JSON.stringify(sel) );
+ },
+
+ close : function(postid, warn) {
+ warn = warn || false;
+
+ if ( warn && this.notsaved(postid) )
+ return false;
+
+ this.iasapi = {};
+ this.hold = {};
+ $('#image-editor-' + postid).fadeOut('fast', function() {
+ $('#media-head-' + postid).fadeIn('fast');
+ $(this).empty();
+ });
+ },
+
+ notsaved : function(postid) {
+ var h = $('#imgedit-history-' + postid).val(),
+ history = (h != '') ? JSON.parse(h) : new Array(),
+ pop = this.intval( $('#imgedit-undone-' + postid).val() );
+
+ if ( pop < history.length ) {
+ if ( confirm( $('#imgedit-leaving-' + postid).html() ) )
+ return false;
+ return true;
+ }
+ return false;
+ },
+
+ addStep : function(op, postid, nonce) {
+ var t = this, elem = $('#imgedit-history-' + postid),
+ history = (elem.val() != '') ? JSON.parse(elem.val()) : new Array(),
+ undone = $('#imgedit-undone-' + postid),
+ pop = t.intval(undone.val());
+
+ while ( pop > 0 ) {
+ history.pop();
+ pop--;
+ }
+ undone.val(0); // reset
+
+ history.push(op);
+ elem.val( JSON.stringify(history) );
+
+ t.refreshEditor(postid, nonce, function() {
+ t.setDisabled($('#image-undo-' + postid), true);
+ t.setDisabled($('#image-redo-' + postid), false);
+ });
+ },
+
+ rotate : function(angle, postid, nonce, t) {
+ if ( $(t).hasClass('disabled') )
+ return false;
+
+ this.addStep({ 'r': { 'r': angle, 'fw': this.hold['h'], 'fh': this.hold['w'] }}, postid, nonce);
+ },
+
+ flip : function (axis, postid, nonce, t) {
+ if ( $(t).hasClass('disabled') )
+ return false;
+
+ this.addStep({ 'f': { 'f': axis, 'fw': this.hold['w'], 'fh': this.hold['h'] }}, postid, nonce);
+ },
+
+ crop : function (postid, nonce, t) {
+ var sel = $('#imgedit-selection-' + postid).val(),
+ w = this.intval( $('#imgedit-sel-width-' + postid).val() ),
+ h = this.intval( $('#imgedit-sel-height-' + postid).val() );
+
+ if ( $(t).hasClass('disabled') || sel == '' )
+ return false;
+
+ sel = JSON.parse(sel);
+ if ( sel.w > 0 && sel.h > 0 && w > 0 && h > 0 ) {
+ sel['fw'] = w;
+ sel['fh'] = h;
+ this.addStep({ 'c': sel }, postid, nonce);
+ }
+ },
+
+ undo : function (postid, nonce) {
+ var t = this, button = $('#image-undo-' + postid), elem = $('#imgedit-undone-' + postid),
+ pop = t.intval( elem.val() ) + 1;
+
+ if ( button.hasClass('disabled') )
+ return;
+
+ elem.val(pop);
+ t.refreshEditor(postid, nonce, function() {
+ var elem = $('#imgedit-history-' + postid),
+ history = (elem.val() != '') ? JSON.parse(elem.val()) : new Array();
+
+ t.setDisabled($('#image-redo-' + postid), true);
+ t.setDisabled(button, pop < history.length);
+ });
+ },
+
+ redo : function(postid, nonce) {
+ var t = this, button = $('#image-redo-' + postid), elem = $('#imgedit-undone-' + postid),
+ pop = t.intval( elem.val() ) - 1;
+
+ if ( button.hasClass('disabled') )
+ return;
+
+ elem.val(pop);
+ t.refreshEditor(postid, nonce, function() {
+ t.setDisabled($('#image-undo-' + postid), true);
+ t.setDisabled(button, pop > 0);
+ });
+ },
+
+ setNumSelection : function(postid) {
+ var sel, elX = $('#imgedit-sel-width-' + postid), elY = $('#imgedit-sel-height-' + postid),
+ x = this.intval( elX.val() ), y = this.intval( elY.val() ),
+ img = $('#image-preview-' + postid), imgh = img.height(), imgw = img.width(),
+ sizer = this.hold['sizer'], x1, y1, x2, y2, ias = this.iasapi;
+
+ if ( x < 1 ) {
+ elX.val('');
+ return false;
+ }
+
+ if ( y < 1 ) {
+ elY.val('');
+ return false;
+ }
+
+ if ( x && y && ( sel = ias.getSelection() ) ) {
+ x2 = sel.x1 + Math.round( x * sizer );
+ y2 = sel.y1 + Math.round( y * sizer );
+ x1 = sel.x1;
+ y1 = sel.y1;
+
+ if ( x2 > imgw ) {
+ x1 = 0;
+ x2 = imgw;
+ elX.val( Math.round( x2 / sizer ) );
+ }
+
+ if ( y2 > imgh ) {
+ y1 = 0;
+ y2 = imgh;
+ elY.val( Math.round( y2 / sizer ) );
+ }
+
+ ias.setSelection( x1, y1, x2, y2 );
+ ias.update();
+ this.setCropSelection(postid, ias.getSelection());
+ }
+ },
+
+ round : function(num) {
+ var s;
+ num = Math.round(num);
+
+ if ( this.hold.sizer > 0.6 )
+ return num;
+
+ s = num.toString().slice(-1);
+
+ if ( '1' == s )
+ return num - 1;
+ else if ( '9' == s )
+ return num + 1;
+
+ return num;
+ },
+
+ setRatioSelection : function(postid, n, el) {
+ var sel, r, x = this.intval( $('#imgedit-crop-width-' + postid).val() ),
+ y = this.intval( $('#imgedit-crop-height-' + postid).val() ),
+ h = $('#image-preview-' + postid).height();
+
+ if ( !this.intval( $(el).val() ) ) {
+ $(el).val('');
+ return;
+ }
+
+ if ( x && y ) {
+ this.iasapi.setOptions({
+ aspectRatio: x + ':' + y
+ });
+
+ if ( sel = this.iasapi.getSelection(true) ) {
+ r = Math.ceil( sel.y1 + ((sel.x2 - sel.x1) / (x / y)) );
+
+ if ( r > h ) {
+ r = h;
+ if ( n )
+ $('#imgedit-crop-height-' + postid).val('');
+ else
+ $('#imgedit-crop-width-' + postid).val('');
+ }
+
+ this.iasapi.setSelection( sel.x1, sel.y1, sel.x2, r );
+ this.iasapi.update();
+ }
+ }
+ }
+}
+})(jQuery);
--- /dev/null
+var imageEdit;(function(a){imageEdit={iasapi:{},hold:{},postid:"",intval:function(b){return b|0},setDisabled:function(c,b){if(b){c.removeClass("disabled");a("input",c).removeAttr("disabled")}else{c.addClass("disabled");a("input",c).attr("disabled","disabled")}},init:function(g,e){var d=this,c=a("#image-editor-"+d.postid),b=d.intval(a("#imgedit-x-"+g).val()),f=d.intval(a("#imgedit-y-"+g).val());if(d.postid!=g&&c.length){d.close(d.postid)}d.hold.w=d.hold.ow=b;d.hold.h=d.hold.oh=f;d.hold.xy_ratio=b/f;d.hold.sizer=parseFloat(a("#imgedit-sizer-"+g).val());d.postid=g;a("#imgedit-response-"+g).empty();a('input[type="text"]',"#imgedit-panel-"+g).keypress(function(i){var h=i.keyCode;if(36<h&&h<41){a(this).blur()}if(13==h){i.preventDefault();i.stopPropagation();return false}})},toggleEditor:function(d,b){var c=a("#imgedit-wait-"+d);if(b){c.height(a("#imgedit-panel-"+d).height()).fadeIn("fast")}else{c.fadeOut("fast")}},toggleHelp:function(b){a(b).siblings(".imgedit-help").slideToggle("fast");return false},getTarget:function(b){return a("input[name=imgedit-target-"+b+"]:checked","#imgedit-save-target-"+b).val()||"full"},scaleChanged:function(i,b){var d=a("#imgedit-scale-width-"+i),f=a("#imgedit-scale-height-"+i),g=a("#imgedit-scale-warn-"+i),c="",e="";if(b){e=(d.val()!="")?this.intval(d.val()/this.hold.xy_ratio):"";f.val(e)}else{c=(f.val()!="")?this.intval(f.val()*this.hold.xy_ratio):"";d.val(c)}if((e&&e>this.hold.oh)||(c&&c>this.hold.ow)){g.css("visibility","visible")}else{g.css("visibility","hidden")}},getSelRatio:function(f){var b=this.hold.w,e=this.hold.h,d=this.intval(a("#imgedit-crop-width-"+f).val()),c=this.intval(a("#imgedit-crop-height-"+f).val());if(d&&c){return d+":"+c}if(b&&e){return b+":"+e}return"1:1"},filterHistory:function(j,f){var d=a("#imgedit-history-"+j).val(),b,h,e,c,g=[];if(d!=""){d=JSON.parse(d);b=this.intval(a("#imgedit-undone-"+j).val());if(b>0){while(b>0){d.pop();b--}}if(f){if(!d.length){this.hold.w=this.hold.ow;this.hold.h=this.hold.oh;return""}e=d[d.length-1];e=e.c||e.r||e.f||false;if(e){this.hold.w=e.fw;this.hold.h=e.fh}}for(h in d){c=d[h];if(c.hasOwnProperty("c")){g[h]={c:{x:c.c.x,y:c.c.y,w:c.c.w,h:c.c.h}}}else{if(c.hasOwnProperty("r")){g[h]={r:c.r.r}}else{if(c.hasOwnProperty("f")){g[h]={f:c.f.f}}}}}return JSON.stringify(g)}return""},refreshEditor:function(g,d,f){var c=this,e,b;c.toggleEditor(g,1);e={action:"imgedit-preview",_ajax_nonce:d,postid:g,history:c.filterHistory(g,1),rand:c.intval(Math.random()*1000000)};b=a('<img id="image-preview-'+g+'" />');b.load(function(){var i,h,k=a("#imgedit-crop-"+g),j=imageEdit;k.empty().append(b);i=Math.max(j.hold.w,j.hold.h);h=Math.max(a(b).width(),a(b).height());j.hold.sizer=i>h?h/i:1;j.initCrop(g,b,k);j.setCropSelection(g,0);if((typeof f!="unknown")&&f!=null){f()}if(a("#imgedit-history-"+g).val()&&a("#imgedit-undone-"+g).val()==0){a("input.imgedit-submit-btn","#imgedit-panel-"+g).removeAttr("disabled")}else{a("input.imgedit-submit-btn","#imgedit-panel-"+g).attr("disabled","disabled")}j.toggleEditor(g,0)}).attr("src",ajaxurl+"?"+a.param(e))},action:function(b,g,c){var j=this,e,i,f,d,k;if(j.notsaved(b)){return false}e={action:"image-editor",_ajax_nonce:g,postid:b};if("scale"==c){i=a("#imgedit-scale-width-"+b),f=a("#imgedit-scale-height-"+b),d=j.intval(i.val()),k=j.intval(f.val());if(d<1){i.focus();return false}else{if(k<1){f.focus();return false}}if(d==j.hold.ow||k==j.hold.oh){return false}e["do"]="scale";e.fwidth=d;e.fheight=k}else{if("restore"==c){e["do"]="restore"}else{return false}}j.toggleEditor(b,1);a.post(ajaxurl,e,function(h){a("#image-editor-"+b).empty().append(h);j.toggleEditor(b,0)})},save:function(f,b){var c,e=this.getTarget(f),d=this.filterHistory(f,0);if(""==d){return false}this.toggleEditor(f,1);c={action:"image-editor",_ajax_nonce:b,postid:f,history:d,target:e,"do":"save"};a.post(ajaxurl,c,function(h){var g=JSON.parse(h);if(g.error){a("#imgedit-response-"+f).html('<div class="error"><p>'+g.error+"</p><div>");imageEdit.close(f);return}if(g.fw&&g.fh){a("#media-dims-"+f).html(g.fw+" × "+g.fh)}if(g.thumbnail){a(".thumbnail","#thumbnail-head-"+f).attr("src",""+g.thumbnail)}if(g.msg){a("#imgedit-response-"+f).html('<div class="updated"><p>'+g.msg+"</p></div>")}imageEdit.close(f)})},open:function(h,d){var f,e=a("#image-editor-"+h),c=a("#media-head-"+h),b=a("#imgedit-open-btn-"+h),g=b.siblings("img");b.attr("disabled","disabled");g.css("visibility","visible");f={action:"image-editor",_ajax_nonce:d,postid:h,"do":"open"};e.load(ajaxurl,f,function(){e.fadeIn("fast");c.fadeOut("fast",function(){b.removeAttr("disabled");g.css("visibility","hidden")})})},imgLoaded:function(d){var b=a("#image-preview-"+d),c=a("#imgedit-crop-"+d);this.initCrop(d,b,c);this.setCropSelection(d,0);this.toggleEditor(d,0)},initCrop:function(g,e,c){var b=this,d=a("#imgedit-sel-width-"+g),f=a("#imgedit-sel-height-"+g);b.iasapi=a(e).imgAreaSelect({parent:c,instance:true,handles:true,keys:true,minWidth:3,minHeight:3,onInit:function(h,i){c.children().mousedown(function(m){var k=false,l,j;if(m.shiftKey){l=b.iasapi.getSelection();j=b.getSelRatio(g);k=(l&&l.width&&l.height)?l.width+":"+l.height:j}b.iasapi.setOptions({aspectRatio:k})})},onSelectStart:function(h,i){imageEdit.setDisabled(a("#imgedit-crop-sel-"+g),1)},onSelectEnd:function(h,i){imageEdit.setCropSelection(g,i)},onSelectChange:function(h,j){var i=imageEdit.hold.sizer;d.val(imageEdit.round(j.width/i));f.val(imageEdit.round(j.height/i))}})},setCropSelection:function(g,f){var e,b=a("#imgedit-minthumb-"+g).val()||"128:128",d=this.hold.sizer;b=b.split(":");f=f||0;if(!f||(f.width<3&&f.height<3)){this.setDisabled(a(".imgedit-crop","#imgedit-panel-"+g),0);this.setDisabled(a("#imgedit-crop-sel-"+g),0);a("#imgedit-sel-width-"+g).val("");a("#imgedit-sel-height-"+g).val("");a("#imgedit-selection-"+g).val("");return false}if(f.width<(b[0]*d)&&f.height<(b[1]*d)){this.setDisabled(a(".imgedit-crop","#imgedit-panel-"+g),0);a("#imgedit-selection-"+g).val("");return false}e={x:f.x1,y:f.y1,w:f.width,h:f.height};this.setDisabled(a(".imgedit-crop","#imgedit-panel-"+g),1);a("#imgedit-selection-"+g).val(JSON.stringify(e))},close:function(c,b){b=b||false;if(b&&this.notsaved(c)){return false}this.iasapi={};this.hold={};a("#image-editor-"+c).fadeOut("fast",function(){a("#media-head-"+c).fadeIn("fast");a(this).empty()})},notsaved:function(e){var c=a("#imgedit-history-"+e).val(),d=(c!="")?JSON.parse(c):new Array(),b=this.intval(a("#imgedit-undone-"+e).val());if(b<d.length){if(confirm(a("#imgedit-leaving-"+e).html())){return false}return true}return false},addStep:function(i,h,d){var c=this,e=a("#imgedit-history-"+h),g=(e.val()!="")?JSON.parse(e.val()):new Array(),f=a("#imgedit-undone-"+h),b=c.intval(f.val());while(b>0){g.pop();b--}f.val(0);g.push(i);e.val(JSON.stringify(g));c.refreshEditor(h,d,function(){c.setDisabled(a("#image-undo-"+h),true);c.setDisabled(a("#image-redo-"+h),false)})},rotate:function(d,e,c,b){if(a(b).hasClass("disabled")){return false}this.addStep({r:{r:d,fw:this.hold.h,fh:this.hold.w}},e,c)},flip:function(d,e,c,b){if(a(b).hasClass("disabled")){return false}this.addStep({f:{f:d,fw:this.hold.w,fh:this.hold.h}},e,c)},crop:function(g,e,c){var f=a("#imgedit-selection-"+g).val(),b=this.intval(a("#imgedit-sel-width-"+g).val()),d=this.intval(a("#imgedit-sel-height-"+g).val());if(a(c).hasClass("disabled")||f==""){return false}f=JSON.parse(f);if(f.w>0&&f.h>0&&b>0&&d>0){f.fw=b;f.fh=d;this.addStep({c:f},g,e)}},undo:function(g,e){var d=this,c=a("#image-undo-"+g),f=a("#imgedit-undone-"+g),b=d.intval(f.val())+1;if(c.hasClass("disabled")){return}f.val(b);d.refreshEditor(g,e,function(){var h=a("#imgedit-history-"+g),i=(h.val()!="")?JSON.parse(h.val()):new Array();d.setDisabled(a("#image-redo-"+g),true);d.setDisabled(c,b<i.length)})},redo:function(g,e){var d=this,c=a("#image-redo-"+g),f=a("#imgedit-undone-"+g),b=d.intval(f.val())-1;if(c.hasClass("disabled")){return}f.val(b);d.refreshEditor(g,e,function(){d.setDisabled(a("#image-undo-"+g),true);d.setDisabled(c,b>0)})},setNumSelection:function(c){var g,k=a("#imgedit-sel-width-"+c),j=a("#imgedit-sel-height-"+c),o=this.intval(k.val()),m=this.intval(j.val()),i=a("#image-preview-"+c),p=i.height(),h=i.width(),b=this.hold.sizer,f,n,e,l,d=this.iasapi;if(o<1){k.val("");return false}if(m<1){j.val("");return false}if(o&&m&&(g=d.getSelection())){e=g.x1+Math.round(o*b);l=g.y1+Math.round(m*b);f=g.x1;n=g.y1;if(e>h){f=0;e=h;k.val(Math.round(e/b))}if(l>p){n=0;l=p;j.val(Math.round(l/b))}d.setSelection(f,n,e,l);d.update();this.setCropSelection(c,d.getSelection())}},round:function(b){var c;b=Math.round(b);if(this.hold.sizer>0.6){return b}c=b.toString().slice(-1);if("1"==c){return b-1}else{if("9"==c){return b+1}}return b},setRatioSelection:function(j,i,d){var f,e,b=this.intval(a("#imgedit-crop-width-"+j).val()),g=this.intval(a("#imgedit-crop-height-"+j).val()),c=a("#image-preview-"+j).height();if(!this.intval(a(d).val())){a(d).val("");return}if(b&&g){this.iasapi.setOptions({aspectRatio:b+":"+g});if(f=this.iasapi.getSelection(true)){e=Math.ceil(f.y1+((f.x2-f.x1)/(b/g)));if(e>c){e=c;if(i){a("#imgedit-crop-height-"+j).val("")}else{a("#imgedit-crop-width-"+j).val("")}}this.iasapi.setSelection(f.x1,f.y1,f.x2,e);this.iasapi.update()}}}}})(jQuery);
\ No newline at end of file
t.type = $('table.widefat').hasClass('page') ? 'page' : 'post';
t.what = '#'+t.type+'-';
- // get all editable rows
- t.rows = $('tr.iedit');
-
// prepare the edit rows
qeRow.keyup(function(e) { if(e.which == 27) return inlineEditPost.revert(); });
bulkRow.keyup(function(e) { if (e.which == 27) return inlineEditPost.revert(); });
});
// add events
- t.addEvents(t.rows);
+ $('a.editinline').live('click', function() { inlineEditPost.edit(this); return false; });
$('#bulk-title-div').parents('fieldset').after(
$('#inline-edit fieldset.inline-edit-categories').clone()
$(t.what+t.getId(el)).css('display') == 'none' ? t.revert() : t.edit(el);
},
- addEvents : function(r) {
- r.each(function() {
- var row = $(this);
- $('a.editinline', row).click(function() { inlineEditPost.edit(this); return false; });
- });
- },
-
setBulk : function() {
- var te = '', type = this.type, tax;
+ var te = '', type = this.type, tax, c = true;
this.revert();
$('#bulk-edit td').attr('colspan', $('.widefat:first thead th:visible').length);
$('tbody th.check-column input[type="checkbox"]').each(function(i){
if ( $(this).attr('checked') ) {
+ c = false;
var id = $(this).val(), theTitle;
theTitle = $('#inline_'+id+' .post_title').text() || inlineEditL10n.notitle;
te += '<div id="ttle'+id+'"><a id="_'+id+'" class="ntdelbutton" title="'+inlineEditL10n.ntdeltitle+'">X</a>'+theTitle+'</div>';
}
});
+ if ( c )
+ return this.revert();
+
$('#bulk-titles').html(te);
$('#bulk-titles a').click(function() {
var id = $(this).attr('id').substr(1);
// populate the data
rowData = $('#inline_'+id);
+ if ( !$(':input[name="post_author"] option[value=' + $('.post_author', rowData).text() + ']', editRow).val() ) {
+ // author no longer has edit caps, so we need to add them to the list of authors
+ $(':input[name="post_author"]', editRow).prepend('<option value="' + $('.post_author', rowData).text() + '">' + $('#' + t.type + '-' + id + ' .author').text() + '</option>');
+ }
+
for ( f = 0; f < fields.length; f++ ) {
$(':input[name="'+fields[f]+'"]', editRow).val( $('.'+fields[f], rowData).text() );
}
},
save : function(id) {
- var params, fields;
+ var params, fields, page = $('.post_status_page').val() || '';
if( typeof(id) == 'object' )
id = this.getId(id);
action: 'inline-save',
post_type: this.type,
post_ID: id,
- edit_date: 'true'
+ edit_date: 'true',
+ post_status: page
};
- fields = $('#edit-'+id+' :input').fieldSerialize();
+ fields = $('#edit-'+id+' :input').serialize();
params = fields + '&' + $.param(params);
// make ajax request
if ( -1 != r.indexOf('<tr') ) {
$(inlineEditPost.what+id).remove();
$('#edit-'+id).before(r).remove();
-
- var row = $(inlineEditPost.what+id);
- row.hide();
-
- if ( 'draft' == $('input[name="post_status"]').val() )
- row.find('td.column-comments').hide();
-
- inlineEditPost.addEvents(row);
- row.fadeIn();
+ $(inlineEditPost.what+id).hide().fadeIn();
} else {
r = r.replace( /<.[^<>]*?>/g, '' );
$('#edit-'+id+' .inline-edit-save').append('<span class="error">'+r+'</span>');
-(function(a){inlineEditPost={init:function(){var c=this,d=a("#inline-edit"),b=a("#bulk-edit");c.type=a("table.widefat").hasClass("page")?"page":"post";c.what="#"+c.type+"-";c.rows=a("tr.iedit");d.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});b.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});a("a.cancel",d).click(function(){return inlineEditPost.revert()});a("a.save",d).click(function(){return inlineEditPost.save(this)});a("td",d).keydown(function(f){if(f.which==13){return inlineEditPost.save(this)}});a("a.cancel",b).click(function(){return inlineEditPost.revert()});a("#inline-edit .inline-edit-private input[value=private]").click(function(){var e=a("input.inline-edit-password-input");if(a(this).attr("checked")){e.val("").attr("disabled","disabled")}else{e.attr("disabled","")}});c.addEvents(c.rows);a("#bulk-title-div").parents("fieldset").after(a("#inline-edit fieldset.inline-edit-categories").clone()).siblings("fieldset:last").prepend(a("#inline-edit label.inline-edit-tags").clone());a("span.catshow").click(function(){a(".inline-editor ul.cat-checklist").addClass("cat-hover");a(".inline-editor span.cathide").show();a(this).hide()});a("span.cathide").click(function(){a(".inline-editor ul.cat-checklist").removeClass("cat-hover");a(".inline-editor span.catshow").show();a(this).hide()});a('select[name="_status"] option[value="future"]',b).remove();a("#doaction, #doaction2").click(function(f){var g=a(this).attr("id").substr(2);if(a('select[name="'+g+'"]').val()=="edit"){f.preventDefault();c.setBulk()}else{if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}}});a("#post-query-submit").click(function(f){if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},addEvents:function(b){b.each(function(){var c=a(this);a("a.editinline",c).click(function(){inlineEditPost.edit(this);return false})})},setBulk:function(){var d="",c=this.type,b;this.revert();a("#bulk-edit td").attr("colspan",a(".widefat:first thead th:visible").length);a("table.widefat tbody").prepend(a("#bulk-edit"));a("#bulk-edit").addClass("inline-editor").show();a('tbody th.check-column input[type="checkbox"]').each(function(f){if(a(this).attr("checked")){var g=a(this).val(),e;e=a("#inline_"+g+" .post_title").text()||inlineEditL10n.notitle;d+='<div id="ttle'+g+'"><a id="_'+g+'" class="ntdelbutton" title="'+inlineEditL10n.ntdeltitle+'">X</a>'+e+"</div>"}});a("#bulk-titles").html(d);a("#bulk-titles a").click(function(){var e=a(this).attr("id").substr(1);a('table.widefat input[value="'+e+'"]').attr("checked","");a("#ttle"+e).remove()});if(c=="post"){b="post_tag";a('tr.inline-editor textarea[name="tags_input"]').suggest("admin-ajax.php?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:true,multipleSep:", "})}},edit:function(b){var o=this,j,d,g,n,i,h,k,m,l,c=true,p,e;o.revert();if(typeof(b)=="object"){b=o.getId(b)}j=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password"];if(o.type=="page"){j.push("post_parent","menu_order","page_template")}if(o.type=="post"){j.push("tags_input")}d=a("#inline-edit").clone(true);a("td",d).attr("colspan",a(".widefat:first thead th:visible").length);if(a(o.what+b).hasClass("alternate")){a(d).addClass("alternate")}a(o.what+b).hide().after(d);g=a("#inline_"+b);for(k=0;k<j.length;k++){a(':input[name="'+j[k]+'"]',d).val(a("."+j[k],g).text())}if(a(".comment_status",g).text()=="open"){a('input[name="comment_status"]',d).attr("checked","checked")}if(a(".ping_status",g).text()=="open"){a('input[name="ping_status"]',d).attr("checked","checked")}if(a(".sticky",g).text()=="sticky"){a('input[name="sticky"]',d).attr("checked","checked")}if(n=a(".post_category",g).text()){a("ul.cat-checklist :checkbox",d).val(n.split(","))}i=a("._status",g).text();if(i!="future"){a('select[name="_status"] option[value="future"]',d).remove()}if(i=="private"){a('input[name="keep_private"]',d).attr("checked","checked");a("input.inline-edit-password-input").val("").attr("disabled","disabled")}h=a('select[name="post_parent"] option[value="'+b+'"]',d);if(h.length>0){m=h[0].className.split("-")[1];l=h;while(c){l=l.next("option");if(l.length==0){break}p=l[0].className.split("-")[1];if(p<=m){c=false}else{l.remove();l=h}}h.remove()}a(d).attr("id","edit-"+b).addClass("inline-editor").show();a(".ptitle",d).focus();if(o.type=="post"){e="post_tag";a('tr.inline-editor textarea[name="tags_input"]').suggest("admin-ajax.php?action=ajax-tag-search&tax="+e,{delay:500,minchars:2,multiple:true,multipleSep:", "})}return false},save:function(d){var c,b;if(typeof(d)=="object"){d=this.getId(d)}a("table.widefat .inline-edit-save .waiting").show();c={action:"inline-save",post_type:this.type,post_ID:d,edit_date:"true"};b=a("#edit-"+d+" :input").fieldSerialize();c=b+"&"+a.param(c);a.post("admin-ajax.php",c,function(e){a("table.widefat .inline-edit-save .waiting").hide();if(e){if(-1!=e.indexOf("<tr")){a(inlineEditPost.what+d).remove();a("#edit-"+d).before(e).remove();var f=a(inlineEditPost.what+d);f.hide();if("draft"==a('input[name="post_status"]').val()){f.find("td.column-comments").hide()}inlineEditPost.addEvents(f);f.fadeIn()}else{e=e.replace(/<.[^<>]*?>/g,"");a("#edit-"+d+" .inline-edit-save").append('<span class="error">'+e+"</span>")}}else{a("#edit-"+d+" .inline-edit-save").append('<span class="error">'+inlineEditL10n.error+"</span>")}},"html");return false},revert:function(){var b;if(b=a("table.widefat tr.inline-editor").attr("id")){a("table.widefat .inline-edit-save .waiting").hide();if("bulk-edit"==b){a("table.widefat #bulk-edit").removeClass("inline-editor").hide();a("#bulk-titles").html("");a("#inlineedit").append(a("#bulk-edit"))}else{a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}}return false},getId:function(c){var d=c.tagName=="TR"?c.id:a(c).parents("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditPost.init()})})(jQuery);
\ No newline at end of file
+(function(a){inlineEditPost={init:function(){var c=this,d=a("#inline-edit"),b=a("#bulk-edit");c.type=a("table.widefat").hasClass("page")?"page":"post";c.what="#"+c.type+"-";d.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});b.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});a("a.cancel",d).click(function(){return inlineEditPost.revert()});a("a.save",d).click(function(){return inlineEditPost.save(this)});a("td",d).keydown(function(f){if(f.which==13){return inlineEditPost.save(this)}});a("a.cancel",b).click(function(){return inlineEditPost.revert()});a("#inline-edit .inline-edit-private input[value=private]").click(function(){var e=a("input.inline-edit-password-input");if(a(this).attr("checked")){e.val("").attr("disabled","disabled")}else{e.attr("disabled","")}});a("a.editinline").live("click",function(){inlineEditPost.edit(this);return false});a("#bulk-title-div").parents("fieldset").after(a("#inline-edit fieldset.inline-edit-categories").clone()).siblings("fieldset:last").prepend(a("#inline-edit label.inline-edit-tags").clone());a("span.catshow").click(function(){a(".inline-editor ul.cat-checklist").addClass("cat-hover");a(".inline-editor span.cathide").show();a(this).hide()});a("span.cathide").click(function(){a(".inline-editor ul.cat-checklist").removeClass("cat-hover");a(".inline-editor span.catshow").show();a(this).hide()});a('select[name="_status"] option[value="future"]',b).remove();a("#doaction, #doaction2").click(function(f){var g=a(this).attr("id").substr(2);if(a('select[name="'+g+'"]').val()=="edit"){f.preventDefault();c.setBulk()}else{if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}}});a("#post-query-submit").click(function(f){if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},setBulk:function(){var e="",d=this.type,b,f=true;this.revert();a("#bulk-edit td").attr("colspan",a(".widefat:first thead th:visible").length);a("table.widefat tbody").prepend(a("#bulk-edit"));a("#bulk-edit").addClass("inline-editor").show();a('tbody th.check-column input[type="checkbox"]').each(function(g){if(a(this).attr("checked")){f=false;var h=a(this).val(),c;c=a("#inline_"+h+" .post_title").text()||inlineEditL10n.notitle;e+='<div id="ttle'+h+'"><a id="_'+h+'" class="ntdelbutton" title="'+inlineEditL10n.ntdeltitle+'">X</a>'+c+"</div>"}});if(f){return this.revert()}a("#bulk-titles").html(e);a("#bulk-titles a").click(function(){var c=a(this).attr("id").substr(1);a('table.widefat input[value="'+c+'"]').attr("checked","");a("#ttle"+c).remove()});if(d=="post"){b="post_tag";a('tr.inline-editor textarea[name="tags_input"]').suggest("admin-ajax.php?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:true,multipleSep:", "})}},edit:function(b){var o=this,j,d,g,n,i,h,k,m,l,c=true,p,e;o.revert();if(typeof(b)=="object"){b=o.getId(b)}j=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password"];if(o.type=="page"){j.push("post_parent","menu_order","page_template")}if(o.type=="post"){j.push("tags_input")}d=a("#inline-edit").clone(true);a("td",d).attr("colspan",a(".widefat:first thead th:visible").length);if(a(o.what+b).hasClass("alternate")){a(d).addClass("alternate")}a(o.what+b).hide().after(d);g=a("#inline_"+b);if(!a(':input[name="post_author"] option[value='+a(".post_author",g).text()+"]",d).val()){a(':input[name="post_author"]',d).prepend('<option value="'+a(".post_author",g).text()+'">'+a("#"+o.type+"-"+b+" .author").text()+"</option>")}for(k=0;k<j.length;k++){a(':input[name="'+j[k]+'"]',d).val(a("."+j[k],g).text())}if(a(".comment_status",g).text()=="open"){a('input[name="comment_status"]',d).attr("checked","checked")}if(a(".ping_status",g).text()=="open"){a('input[name="ping_status"]',d).attr("checked","checked")}if(a(".sticky",g).text()=="sticky"){a('input[name="sticky"]',d).attr("checked","checked")}if(n=a(".post_category",g).text()){a("ul.cat-checklist :checkbox",d).val(n.split(","))}i=a("._status",g).text();if(i!="future"){a('select[name="_status"] option[value="future"]',d).remove()}if(i=="private"){a('input[name="keep_private"]',d).attr("checked","checked");a("input.inline-edit-password-input").val("").attr("disabled","disabled")}h=a('select[name="post_parent"] option[value="'+b+'"]',d);if(h.length>0){m=h[0].className.split("-")[1];l=h;while(c){l=l.next("option");if(l.length==0){break}p=l[0].className.split("-")[1];if(p<=m){c=false}else{l.remove();l=h}}h.remove()}a(d).attr("id","edit-"+b).addClass("inline-editor").show();a(".ptitle",d).focus();if(o.type=="post"){e="post_tag";a('tr.inline-editor textarea[name="tags_input"]').suggest("admin-ajax.php?action=ajax-tag-search&tax="+e,{delay:500,minchars:2,multiple:true,multipleSep:", "})}return false},save:function(e){var d,b,c=a(".post_status_page").val()||"";if(typeof(e)=="object"){e=this.getId(e)}a("table.widefat .inline-edit-save .waiting").show();d={action:"inline-save",post_type:this.type,post_ID:e,edit_date:"true",post_status:c};b=a("#edit-"+e+" :input").serialize();d=b+"&"+a.param(d);a.post("admin-ajax.php",d,function(f){a("table.widefat .inline-edit-save .waiting").hide();if(f){if(-1!=f.indexOf("<tr")){a(inlineEditPost.what+e).remove();a("#edit-"+e).before(f).remove();a(inlineEditPost.what+e).hide().fadeIn()}else{f=f.replace(/<.[^<>]*?>/g,"");a("#edit-"+e+" .inline-edit-save").append('<span class="error">'+f+"</span>")}}else{a("#edit-"+e+" .inline-edit-save").append('<span class="error">'+inlineEditL10n.error+"</span>")}},"html");return false},revert:function(){var b;if(b=a("table.widefat tr.inline-editor").attr("id")){a("table.widefat .inline-edit-save .waiting").hide();if("bulk-edit"==b){a("table.widefat #bulk-edit").removeClass("inline-editor").hide();a("#bulk-titles").html("");a("#inlineedit").append(a("#bulk-edit"))}else{a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}}return false},getId:function(c){var d=c.tagName=="TR"?c.id:a(c).parents("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditPost.init()})})(jQuery);
\ No newline at end of file
t.type = $('#the-list').attr('className').substr(5);
t.what = '#'+t.type+'-';
- // get all editable rows
- t.rows = $('tr.iedit');
+ $('.editinline').live('click', function(){
+ inlineEditTax.edit(this);
+ return false;
+ });
// prepare the edit row
row.keyup(function(e) { if(e.which == 27) return inlineEditTax.revert(); });
$('a.save', row).click(function() { return inlineEditTax.save(this); });
$('input, select', row).keydown(function(e) { if(e.which == 13) return inlineEditTax.save(this); });
- // add events
- t.addEvents(t.rows);
-
$('#posts-filter input[type="submit"]').click(function(e){
if ( $('form#posts-filter tr.inline-editor').length > 0 )
t.revert();
$(t.what+t.getId(el)).css('display') == 'none' ? t.revert() : t.edit(el);
},
- addEvents : function(r) {
- r.each(function() {
- $(this).find('a.editinline').click(function() { inlineEditTax.edit(this); return false; });
- });
- },
-
edit : function(id) {
var t = this, editRow;
t.revert();
taxonomy: tax
};
- fields = $('#edit-'+id+' :input').fieldSerialize();
+ fields = $('#edit-'+id+' :input').serialize();
params = fields + '&' + $.param(params);
// make ajax request
$('#edit-'+id).before(r).remove();
row = new_id ? $('#'+new_id) : $(inlineEditTax.what+id);
- row.hide();
-
- inlineEditTax.addEvents(row);
- row.fadeIn();
+ row.hide().fadeIn();
} else
$('#edit-'+id+' .inline-edit-save .error').html(r).show();
} else
-(function(a){inlineEditTax={init:function(){var b=this,c=a("#inline-edit");b.type=a("#the-list").attr("className").substr(5);b.what="#"+b.type+"-";b.rows=a("tr.iedit");c.keyup(function(d){if(d.which==27){return inlineEditTax.revert()}});a("a.cancel",c).click(function(){return inlineEditTax.revert()});a("a.save",c).click(function(){return inlineEditTax.save(this)});a("input, select",c).keydown(function(d){if(d.which==13){return inlineEditTax.save(this)}});b.addEvents(b.rows);a('#posts-filter input[type="submit"]').click(function(d){if(a("form#posts-filter tr.inline-editor").length>0){b.revert()}})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},addEvents:function(b){b.each(function(){a(this).find("a.editinline").click(function(){inlineEditTax.edit(this);return false})})},edit:function(d){var c=this,b;c.revert();if(typeof(d)=="object"){d=c.getId(d)}b=a("#inline-edit").clone(true),rowData=a("#inline_"+d);a("td",b).attr("colspan",a(".widefat:first thead th:visible").length);if(a(c.what+d).hasClass("alternate")){a(b).addClass("alternate")}a(c.what+d).hide().after(b);a(':input[name="name"]',b).val(a(".name",rowData).text());a(':input[name="slug"]',b).val(a(".slug",rowData).text());a(b).attr("id","edit-"+d).addClass("inline-editor").show();a(".ptitle",b).eq(0).focus();return false},save:function(e){var d,b,c=a('input[name="taxonomy"]').val()||"";if(typeof(e)=="object"){e=this.getId(e)}a("table.widefat .inline-edit-save .waiting").show();d={action:"inline-save-tax",tax_type:this.type,tax_ID:e,taxonomy:c};b=a("#edit-"+e+" :input").fieldSerialize();d=b+"&"+a.param(d);a.post("admin-ajax.php",d,function(g){var h,f;a("table.widefat .inline-edit-save .waiting").hide();if(g){if(-1!=g.indexOf("<tr")){a(inlineEditTax.what+e).remove();f=a(g).attr("id");a("#edit-"+e).before(g).remove();h=f?a("#"+f):a(inlineEditTax.what+e);h.hide();inlineEditTax.addEvents(h);h.fadeIn()}else{a("#edit-"+e+" .inline-edit-save .error").html(g).show()}}else{a("#edit-"+e+" .inline-edit-save .error").html(inlineEditL10n.error).show()}});return false},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");if(b){a("table.widefat .inline-edit-save .waiting").hide();a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}return false},getId:function(c){var d=c.tagName=="TR"?c.id:a(c).parents("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditTax.init()})})(jQuery);
\ No newline at end of file
+(function(a){inlineEditTax={init:function(){var b=this,c=a("#inline-edit");b.type=a("#the-list").attr("className").substr(5);b.what="#"+b.type+"-";a(".editinline").live("click",function(){inlineEditTax.edit(this);return false});c.keyup(function(d){if(d.which==27){return inlineEditTax.revert()}});a("a.cancel",c).click(function(){return inlineEditTax.revert()});a("a.save",c).click(function(){return inlineEditTax.save(this)});a("input, select",c).keydown(function(d){if(d.which==13){return inlineEditTax.save(this)}});a('#posts-filter input[type="submit"]').click(function(d){if(a("form#posts-filter tr.inline-editor").length>0){b.revert()}})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},edit:function(d){var c=this,b;c.revert();if(typeof(d)=="object"){d=c.getId(d)}b=a("#inline-edit").clone(true),rowData=a("#inline_"+d);a("td",b).attr("colspan",a(".widefat:first thead th:visible").length);if(a(c.what+d).hasClass("alternate")){a(b).addClass("alternate")}a(c.what+d).hide().after(b);a(':input[name="name"]',b).val(a(".name",rowData).text());a(':input[name="slug"]',b).val(a(".slug",rowData).text());a(b).attr("id","edit-"+d).addClass("inline-editor").show();a(".ptitle",b).eq(0).focus();return false},save:function(e){var d,b,c=a('input[name="taxonomy"]').val()||"";if(typeof(e)=="object"){e=this.getId(e)}a("table.widefat .inline-edit-save .waiting").show();d={action:"inline-save-tax",tax_type:this.type,tax_ID:e,taxonomy:c};b=a("#edit-"+e+" :input").serialize();d=b+"&"+a.param(d);a.post("admin-ajax.php",d,function(g){var h,f;a("table.widefat .inline-edit-save .waiting").hide();if(g){if(-1!=g.indexOf("<tr")){a(inlineEditTax.what+e).remove();f=a(g).attr("id");a("#edit-"+e).before(g).remove();h=f?a("#"+f):a(inlineEditTax.what+e);h.hide().fadeIn()}else{a("#edit-"+e+" .inline-edit-save .error").html(g).show()}}else{a("#edit-"+e+" .inline-edit-save .error").html(inlineEditL10n.error).show()}});return false},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");if(b){a("table.widefat .inline-edit-save .waiting").hide();a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}return false},getId:function(c){var d=c.tagName=="TR"?c.id:a(c).parents("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditTax.init()})})(jQuery);
\ No newline at end of file
if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
ed.focus();
- if (tinymce.isIE)
+ if ( tinymce.isIE )
ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);
if ( h.indexOf('[caption') === 0 ) {
} else if ( h.indexOf('[gallery') === 0 ) {
if ( ed.plugins.wpgallery )
h = ed.plugins.wpgallery._do_gallery(h);
+ } else if ( h.indexOf('[embed') === 0 ) {
+ if ( ed.plugins.wordpress )
+ h = ed.plugins.wordpress._setEmbed(h);
}
ed.execCommand('mceInsertContent', false, h);
-function send_to_editor(b){var a;if(typeof tinyMCE!="undefined"&&(a=tinyMCE.activeEditor)&&!a.isHidden()){a.focus();if(tinymce.isIE){a.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark)}if(b.indexOf("[caption")===0){if(a.plugins.wpeditimage){b=a.plugins.wpeditimage._do_shcode(b)}}else{if(b.indexOf("[gallery")===0){if(a.plugins.wpgallery){b=a.plugins.wpgallery._do_gallery(b)}}}a.execCommand("mceInsertContent",false,b)}else{if(typeof edInsertContent=="function"){edInsertContent(edCanvas,b)}else{jQuery(edCanvas).val(jQuery(edCanvas).val()+b)}}tb_remove()}var tb_position;(function(a){tb_position=function(){var e=a("#TB_window"),d=a(window).width(),c=a(window).height(),b=(720<d)?720:d;if(e.size()){e.width(b-50).height(c-45);a("#TB_iframeContent").width(b-50).height(c-75);e.css({"margin-left":"-"+parseInt(((b-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){e.css({top:"20px","margin-top":"0"})}}return a("a.thickbox").each(function(){var f=a(this).attr("href");if(!f){return}f=f.replace(/&width=[0-9]+/g,"");f=f.replace(/&height=[0-9]+/g,"");a(this).attr("href",f+"&width="+(b-80)+"&height="+(c-85))})};a(window).resize(function(){tb_position()})})(jQuery);jQuery(document).ready(function(a){a("a.thickbox").click(function(){if(typeof tinyMCE!="undefined"&&tinyMCE.activeEditor){tinyMCE.get("content").focus();tinyMCE.activeEditor.windowManager.bookmark=tinyMCE.activeEditor.selection.getBookmark("simple")}})});
\ No newline at end of file
+function send_to_editor(b){var a;if(typeof tinyMCE!="undefined"&&(a=tinyMCE.activeEditor)&&!a.isHidden()){a.focus();if(tinymce.isIE){a.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark)}if(b.indexOf("[caption")===0){if(a.plugins.wpeditimage){b=a.plugins.wpeditimage._do_shcode(b)}}else{if(b.indexOf("[gallery")===0){if(a.plugins.wpgallery){b=a.plugins.wpgallery._do_gallery(b)}}else{if(b.indexOf("[embed")===0){if(a.plugins.wordpress){b=a.plugins.wordpress._setEmbed(b)}}}}a.execCommand("mceInsertContent",false,b)}else{if(typeof edInsertContent=="function"){edInsertContent(edCanvas,b)}else{jQuery(edCanvas).val(jQuery(edCanvas).val()+b)}}tb_remove()}var tb_position;(function(a){tb_position=function(){var e=a("#TB_window"),d=a(window).width(),c=a(window).height(),b=(720<d)?720:d;if(e.size()){e.width(b-50).height(c-45);a("#TB_iframeContent").width(b-50).height(c-75);e.css({"margin-left":"-"+parseInt(((b-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){e.css({top:"20px","margin-top":"0"})}}return a("a.thickbox").each(function(){var f=a(this).attr("href");if(!f){return}f=f.replace(/&width=[0-9]+/g,"");f=f.replace(/&height=[0-9]+/g,"");a(this).attr("href",f+"&width="+(b-80)+"&height="+(c-85))})};a(window).resize(function(){tb_position()})})(jQuery);jQuery(document).ready(function(a){a("a.thickbox").click(function(){if(typeof tinyMCE!="undefined"&&tinyMCE.activeEditor){tinyMCE.get("content").focus();tinyMCE.activeEditor.windowManager.bookmark=tinyMCE.activeEditor.selection.getBookmark("simple")}})});
\ No newline at end of file
_ajax_nonce: $('#_ajax_nonce').val()
};
- if ( $('#find-posts-pages:checked').val() ) {
+ if ( $('#find-posts-pages').is(':checked') ) {
post['pages'] = 1;
} else {
post['posts'] = 1;
-var findPosts;(function(a){findPosts={open:function(d,c){var b=document.documentElement.scrollTop||a(document).scrollTop();if(d&&c){a("#affected").attr("name",d).val(c)}a("#find-posts").show().draggable({handle:"#find-posts-head"}).css({top:b+50+"px",left:"50%",marginLeft:"-250px"});a("#find-posts-input").focus().keyup(function(f){if(f.which==27){findPosts.close()}});return false},close:function(){a("#find-posts-response").html("");a("#find-posts").draggable("destroy").hide()},send:function(){var b={ps:a("#find-posts-input").val(),action:"find_posts",_ajax_nonce:a("#_ajax_nonce").val()};if(a("#find-posts-pages:checked").val()){b.pages=1}else{b.posts=1}a.ajax({type:"POST",url:ajaxurl,data:b,success:function(c){findPosts.show(c)},error:function(c){findPosts.error(c)}})},show:function(b){if(typeof(b)=="string"){this.error({responseText:b});return}var c=wpAjax.parseAjaxResponse(b);if(c.errors){this.error({responseText:wpAjax.broken})}c=c.responses[0];a("#find-posts-response").html(c.data)},error:function(b){var c=b.statusText;if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#find-posts-response").html(c)}}};a(document).ready(function(){a("#find-posts-submit").click(function(b){if(""==a("#find-posts-response").html()){b.preventDefault()}});a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){if(a(this).val()=="attach"){b.preventDefault();findPosts.open()}})})})})(jQuery);
\ No newline at end of file
+var findPosts;(function(a){findPosts={open:function(d,c){var b=document.documentElement.scrollTop||a(document).scrollTop();if(d&&c){a("#affected").attr("name",d).val(c)}a("#find-posts").show().draggable({handle:"#find-posts-head"}).css({top:b+50+"px",left:"50%",marginLeft:"-250px"});a("#find-posts-input").focus().keyup(function(f){if(f.which==27){findPosts.close()}});return false},close:function(){a("#find-posts-response").html("");a("#find-posts").draggable("destroy").hide()},send:function(){var b={ps:a("#find-posts-input").val(),action:"find_posts",_ajax_nonce:a("#_ajax_nonce").val()};if(a("#find-posts-pages").is(":checked")){b.pages=1}else{b.posts=1}a.ajax({type:"POST",url:ajaxurl,data:b,success:function(c){findPosts.show(c)},error:function(c){findPosts.error(c)}})},show:function(b){if(typeof(b)=="string"){this.error({responseText:b});return}var c=wpAjax.parseAjaxResponse(b);if(c.errors){this.error({responseText:wpAjax.broken})}c=c.responses[0];a("#find-posts-response").html(c.data)},error:function(b){var c=b.statusText;if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#find-posts-response").html(c)}}};a(document).ready(function(){a("#find-posts-submit").click(function(b){if(""==a("#find-posts-response").html()){b.preventDefault()}});a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){if(a(this).val()=="attach"){b.preventDefault();findPosts.open()}})})})})(jQuery);
\ No newline at end of file
+++ /dev/null
-jQuery(document).ready( function($) {
- postboxes.add_postbox_toggles('page');
- make_slugedit_clickable();
-
- $('#title').blur( function() { if ( ($("#post_ID").val() > 0) || ($("#title").val().length == 0) ) return; autosave(); } );
-
- var stamp = $('#timestamp').html(), visibility = $('#post-visibility-display').html();
-
- function updateVisibility() {
- if ( $('#post-visibility-select input:radio:checked').val() != 'public' ) {
- $('#sticky').attr('checked', false);
- $('#sticky-span').hide();
- } else {
- $('#sticky-span').show();
- }
- if ( $('#post-visibility-select input:radio:checked').val() != 'password' ) {
- $('#password-span').hide();
- } else {
- $('#password-span').show();
- }
- }
-
- function updateText() {
- var attemptedDate, originalDate, currentDate, publishOn;
-
- attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val());
- originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val());
- currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val());
- if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) {
- publishOn = postL10n.publishOnFuture;
- $('#publish').val( postL10n.schedule );
- } else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) {
- publishOn = postL10n.publishOn;
- $('#publish').val( postL10n.publish );
- } else {
- publishOn = postL10n.publishOnPast;
- $('#publish').val( postL10n.update );
- }
- if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) { //hack
- $('#timestamp').html(stamp);
- } else {
- $('#timestamp').html(
- publishOn + ' <b>' +
- $( '#mm option[value=' + $('#mm').val() + ']' ).text() + ' ' +
- $('#jj').val() + ', ' +
- $('#aa').val() + ' @ ' +
- $('#hh').val() + ':' +
- $('#mn').val() + '</b> '
- );
- }
-
- if ( $('#post-visibility-select input:radio:checked').val() == 'private' ) {
- $('#publish').val( postL10n.update );
- if ( $('#post_status option[value=publish]').length == 0 ) {
- $('#post_status').append('<option value="publish">' + postL10n.privatelyPublished + '</option>');
- }
- $('#post_status option[value=publish]').html( postL10n.privatelyPublished );
- $('#post_status option[value=publish]').attr('selected', true);
- $('.edit-post-status').hide();
- } else {
- if ( $('#original_post_status').val() == 'future' || $('#original_post_status').val() == 'draft' ) {
- if ( $('#post_status option[value=publish]').length != 0 ) {
- $('#post_status option[value=publish]').remove();
- $('#post_status').val($('#hidden_post_status').val());
- }
- } else {
- $('#post_status option[value=publish]').html( postL10n.published );
- }
- $('.edit-post-status').show();
- }
- $('#post-status-display').html($('#post_status :selected').text());
- if ( $('#post_status :selected').val() == 'private' || $('#post_status :selected').val() == 'publish' ) {
- $('#save-post').hide();
- } else {
- $('#save-post').show();
- if ( $('#post_status :selected').val() == 'pending' ) {
- $('#save-post').show().val( postL10n.savePending );
- } else {
- $('#save-post').show().val( postL10n.saveDraft );
- }
- }
- }
-
- $('.edit-visibility').click(function () {
- if ($('#post-visibility-select').is(":hidden")) {
- updateVisibility();
- $('#post-visibility-select').slideDown("normal");
- $('.edit-visibility').hide();
- }
- return false;
- });
-
- $('.cancel-post-visibility').click(function () {
- $('#post-visibility-select').slideUp("normal");
- $('#visibility-radio-' + $('#hidden-post-visibility').val()).attr('checked', true);
- $('#post_password').val($('#hidden_post_password').val());
- $('#post-visibility-display').html(visibility);
- $('.edit-visibility').show();
- updateText();
- return false;
- });
-
- $('.save-post-visibility').click(function () { // crazyhorse - multiple ok cancels
- $('#post-visibility-select').slideUp("normal");
- $('.edit-visibility').show();
- updateText();
-
- $('#post-visibility-display').html(
- postL10n[$('#post-visibility-select input:radio:checked').val()]
- );
-
- return false;
- });
-
- $('#post-visibility-select input:radio').change(function() {
- updateVisibility();
- });
-
- $('.edit-timestamp').click(function () {
- if ($('#timestampdiv').is(":hidden")) {
- $('#timestampdiv').slideDown("normal");
- $('.edit-timestamp').hide();
- }
-
- return false;
- });
-
- $('.cancel-timestamp').click(function() {
- $('#timestampdiv').slideUp("normal");
- $('#mm').val($('#hidden_mm').val());
- $('#jj').val($('#hidden_jj').val());
- $('#aa').val($('#hidden_aa').val());
- $('#hh').val($('#hidden_hh').val());
- $('#mn').val($('#hidden_mn').val());
- $('.edit-timestamp').show();
-
- updateText();
- return false;
- });
-
- $('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels
- $('#timestampdiv').slideUp("normal");
- $('.edit-timestamp').show();
- updateText();
-
- return false;
- });
-
- $('.edit-post-status').click(function() {
- if ($('#post-status-select').is(":hidden")) {
- $('#post-status-select').slideDown("normal");
- $(this).hide();
- }
-
- return false;
- });
-
- $('.save-post-status').click(function() {
- $('#post-status-select').slideUp("normal");
- $('.edit-post-status').show();
- updateText();
- return false;
- });
-
- $('.cancel-post-status').click(function() {
- $('#post-status-select').slideUp("normal");
- $('#post_status').val($('#hidden_post_status').val());
- $('.edit-post-status').show();
-
- updateText();
- return false;
- });
-
- // Custom Fields
- $('#the-list').wpList( { addAfter: function( xml, s ) {
- $('table#list-table').show();
- if ( $.isFunction( autosave_update_post_ID ) ) {
- autosave_update_post_ID(s.parsed.responses[0].supplemental.postid);
- }
- }, addBefore: function( s ) {
- s.data += '&post_id=' + $('#post_ID').val();
- return s;
- }
- });
-});
+++ /dev/null
-jQuery(document).ready(function(e){postboxes.add_postbox_toggles("page");make_slugedit_clickable();e("#title").blur(function(){if((e("#post_ID").val()>0)||(e("#title").val().length==0)){return}autosave()});var b=e("#timestamp").html(),a=e("#post-visibility-display").html();function d(){if(e("#post-visibility-select input:radio:checked").val()!="public"){e("#sticky").attr("checked",false);e("#sticky-span").hide()}else{e("#sticky-span").show()}if(e("#post-visibility-select input:radio:checked").val()!="password"){e("#password-span").hide()}else{e("#password-span").show()}}function c(){var f,h,g,i;f=new Date(e("#aa").val(),e("#mm").val()-1,e("#jj").val(),e("#hh").val(),e("#mn").val());h=new Date(e("#hidden_aa").val(),e("#hidden_mm").val()-1,e("#hidden_jj").val(),e("#hidden_hh").val(),e("#hidden_mn").val());g=new Date(e("#cur_aa").val(),e("#cur_mm").val()-1,e("#cur_jj").val(),e("#cur_hh").val(),e("#cur_mn").val());if(f>g&&e("#original_post_status").val()!="future"){i=postL10n.publishOnFuture;e("#publish").val(postL10n.schedule)}else{if(f<=g&&e("#original_post_status").val()!="publish"){i=postL10n.publishOn;e("#publish").val(postL10n.publish)}else{i=postL10n.publishOnPast;e("#publish").val(postL10n.update)}}if(h.toUTCString()==f.toUTCString()){e("#timestamp").html(b)}else{e("#timestamp").html(i+" <b>"+e("#mm option[value="+e("#mm").val()+"]").text()+" "+e("#jj").val()+", "+e("#aa").val()+" @ "+e("#hh").val()+":"+e("#mn").val()+"</b> ")}if(e("#post-visibility-select input:radio:checked").val()=="private"){e("#publish").val(postL10n.update);if(e("#post_status option[value=publish]").length==0){e("#post_status").append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}e("#post_status option[value=publish]").html(postL10n.privatelyPublished);e("#post_status option[value=publish]").attr("selected",true);e(".edit-post-status").hide()}else{if(e("#original_post_status").val()=="future"||e("#original_post_status").val()=="draft"){if(e("#post_status option[value=publish]").length!=0){e("#post_status option[value=publish]").remove();e("#post_status").val(e("#hidden_post_status").val())}}else{e("#post_status option[value=publish]").html(postL10n.published)}e(".edit-post-status").show()}e("#post-status-display").html(e("#post_status :selected").text());if(e("#post_status :selected").val()=="private"||e("#post_status :selected").val()=="publish"){e("#save-post").hide()}else{e("#save-post").show();if(e("#post_status :selected").val()=="pending"){e("#save-post").show().val(postL10n.savePending)}else{e("#save-post").show().val(postL10n.saveDraft)}}}e(".edit-visibility").click(function(){if(e("#post-visibility-select").is(":hidden")){d();e("#post-visibility-select").slideDown("normal");e(".edit-visibility").hide()}return false});e(".cancel-post-visibility").click(function(){e("#post-visibility-select").slideUp("normal");e("#visibility-radio-"+e("#hidden-post-visibility").val()).attr("checked",true);e("#post_password").val(e("#hidden_post_password").val());e("#post-visibility-display").html(a);e(".edit-visibility").show();c();return false});e(".save-post-visibility").click(function(){e("#post-visibility-select").slideUp("normal");e(".edit-visibility").show();c();e("#post-visibility-display").html(postL10n[e("#post-visibility-select input:radio:checked").val()]);return false});e("#post-visibility-select input:radio").change(function(){d()});e(".edit-timestamp").click(function(){if(e("#timestampdiv").is(":hidden")){e("#timestampdiv").slideDown("normal");e(".edit-timestamp").hide()}return false});e(".cancel-timestamp").click(function(){e("#timestampdiv").slideUp("normal");e("#mm").val(e("#hidden_mm").val());e("#jj").val(e("#hidden_jj").val());e("#aa").val(e("#hidden_aa").val());e("#hh").val(e("#hidden_hh").val());e("#mn").val(e("#hidden_mn").val());e(".edit-timestamp").show();c();return false});e(".save-timestamp").click(function(){e("#timestampdiv").slideUp("normal");e(".edit-timestamp").show();c();return false});e(".edit-post-status").click(function(){if(e("#post-status-select").is(":hidden")){e("#post-status-select").slideDown("normal");e(this).hide()}return false});e(".save-post-status").click(function(){e("#post-status-select").slideUp("normal");e(".edit-post-status").show();c();return false});e(".cancel-post-status").click(function(){e("#post-status-select").slideUp("normal");e("#post_status").val(e("#hidden_post_status").val());e(".edit-post-status").show();c();return false});e("#the-list").wpList({addAfter:function(f,g){e("table#list-table").show();if(e.isFunction(autosave_update_post_ID)){autosave_update_post_ID(g.parsed.responses[0].supplemental.postid)}},addBefore:function(f){f.data+="&post_id="+e("#post_ID").val();return f}})});
\ No newline at end of file
+var tagBox, commentsBox, editPermalink, makeSlugeditClickable, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail;
+
// return an array with any duplicate, whitespace or values removed
function array_unique_noempty(a) {
var out = [];
return out;
}
-function new_tag_remove_tag() {
- var id = jQuery( this ).attr( 'id' ), num = id.split('-check-num-')[1], taxbox = jQuery(this).parents('.tagsdiv'), current_tags = taxbox.find( '.the-tags' ).val().split(','), new_tags = [];
- delete current_tags[num];
+(function($){
- jQuery.each( current_tags, function(key, val) {
- val = jQuery.trim(val);
- if ( val ) {
- new_tags.push(val);
- }
- });
+tagBox = {
+ clean : function(tags) {
+ return tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, '');
+ },
- taxbox.find('.the-tags').val( new_tags.join(',').replace(/\s*,+\s*/, ',').replace(/,+/, ',').replace(/,+\s+,+/, ',').replace(/,+\s*$/, '').replace(/^\s*,+/, '') );
+ parseTags : function(el) {
+ var id = el.id, num = id.split('-check-num-')[1], taxbox = $(el).closest('.tagsdiv'), thetags = taxbox.find('.the-tags'), current_tags = thetags.val().split(','), new_tags = [];
+ delete current_tags[num];
- tag_update_quickclicks(taxbox);
- return false;
-}
+ $.each( current_tags, function(key, val) {
+ val = $.trim(val);
+ if ( val ) {
+ new_tags.push(val);
+ }
+ });
-function tag_update_quickclicks(taxbox) {
- if ( jQuery(taxbox).find('.the-tags').length == 0 )
- return;
+ thetags.val( this.clean( new_tags.join(',') ) );
- var current_tags = jQuery(taxbox).find('.the-tags').val().split(',');
- jQuery(taxbox).find('.tagchecklist').empty();
- shown = false;
+ this.quickClicks(taxbox);
+ return false;
+ },
- jQuery.each( current_tags, function( key, val ) {
- var txt, button_id;
+ quickClicks : function(el) {
+ var thetags = $('.the-tags', el), tagchecklist = $('.tagchecklist', el), current_tags;
- val = jQuery.trim(val);
- if ( !val.match(/^\s+$/) && '' != val ) {
- button_id = jQuery(taxbox).attr('id') + '-check-num-' + key;
- txt = '<span><a id="' + button_id + '" class="ntdelbutton">X</a> ' + val + '</span> ';
- jQuery(taxbox).find('.tagchecklist').append(txt);
- jQuery( '#' + button_id ).click( new_tag_remove_tag );
- }
- });
- if ( shown )
- jQuery(taxbox).find('.tagchecklist').prepend('<strong>'+postL10n.tagsUsed+'</strong><br />');
-}
+ if ( !thetags.length )
+ return;
-function tag_flush_to_text(id, a) {
- a = a || false;
- var taxbox, text, tags, newtags;
+ current_tags = thetags.val().split(',');
+ tagchecklist.empty();
- taxbox = jQuery('#'+id);
- text = a ? jQuery(a).text() : taxbox.find('input.newtag').val();
+ $.each( current_tags, function( key, val ) {
+ var txt, button_id, id = $(el).attr('id');
- // is the input box empty (i.e. showing the 'Add new tag' tip)?
- if ( taxbox.find('input.newtag').hasClass('form-input-tip') && ! a )
- return false;
+ val = $.trim(val);
+ if ( !val.match(/^\s+$/) && '' != val ) {
+ button_id = id + '-check-num-' + key;
+ txt = '<span><a id="' + button_id + '" class="ntdelbutton">X</a> ' + val + '</span> ';
+ tagchecklist.append(txt);
+ $( '#' + button_id ).click( function(){ tagBox.parseTags(this); });
+ }
+ });
+ },
- tags = taxbox.find('.the-tags').val();
- newtags = tags ? tags + ',' + text : text;
+ flushTags : function(el, a, f) {
+ a = a || false;
+ var text, tags = $('.the-tags', el), newtag = $('input.newtag', el), newtags;
- // massage
- newtags = newtags.replace(/\s+,+\s*/g, ',').replace(/,+/g, ',').replace(/,+\s+,+/g, ',').replace(/,+\s*$/g, '').replace(/^\s*,+/g, '');
- newtags = array_unique_noempty(newtags.split(',')).join(',');
- taxbox.find('.the-tags').val(newtags);
- tag_update_quickclicks(taxbox);
+ text = a ? $(a).text() : newtag.val();
+ tagsval = tags.val();
+ newtags = tagsval ? tagsval + ',' + text : text;
- if ( ! a )
- taxbox.find('input.newtag').val('').focus();
+ newtags = this.clean( newtags );
+ newtags = array_unique_noempty( newtags.split(',') ).join(',');
+ tags.val(newtags);
+ this.quickClicks(el);
- return false;
-}
+ if ( !a )
+ newtag.val('');
+ if ( 'undefined' == typeof(f) )
+ newtag.focus();
-function tag_save_on_publish() {
- jQuery('.tagsdiv').each( function(i) {
- if ( !jQuery(this).find('input.newtag').hasClass('form-input-tip') )
- tag_flush_to_text(jQuery(this).parents('.tagsdiv').attr('id'));
- } );
-}
-
-function tag_press_key( e ) {
- if ( 13 == e.which ) {
- tag_flush_to_text(jQuery(e.target).parents('.tagsdiv').attr('id'));
return false;
- }
-};
+ },
-function tag_init() {
-
- jQuery('.ajaxtag').show();
- jQuery('.tagsdiv').each( function(i) {
- tag_update_quickclicks(this);
- } );
-
- // add the quickadd form
- jQuery('.ajaxtag input.tagadd').click(function(){tag_flush_to_text(jQuery(this).parents('.tagsdiv').attr('id'));});
- jQuery('.ajaxtag input.newtag').focus(function() {
- if ( !this.cleared ) {
- this.cleared = true;
- jQuery(this).val( '' ).removeClass( 'form-input-tip' );
- }
- });
-
- jQuery('.ajaxtag input.newtag').blur(function() {
- if ( this.value == '' ) {
- this.cleared = false;
- jQuery(this).val( postL10n.addTag ).addClass( 'form-input-tip' );
- }
- });
-
- // auto-save tags on post save/publish
- jQuery('#publish').click( tag_save_on_publish );
- jQuery('#save-post').click( tag_save_on_publish );
-
- // catch the enter key
- jQuery('.ajaxtag input.newtag').keypress( tag_press_key );
-}
+ get : function(id) {
+ var tax = id.substr(id.indexOf('-')+1);
-var commentsBox, tagCloud;
-(function($){
+ $.post(ajaxurl, {'action':'get-tagcloud','tax':tax}, function(r, stat) {
+ if ( 0 == r || 'success' != stat )
+ r = wpAjax.broken;
- commentsBox = {
- st : 0,
-
- get : function(total, num) {
- var st = this.st, data;
- if ( ! num )
- num = 20;
-
- this.st += num;
- this.total = total;
- $('#commentsdiv img.waiting').show();
-
- data = {
- 'action' : 'get-comments',
- 'mode' : 'single',
- '_ajax_nonce' : $('#add_comment_nonce').val(),
- 'post_ID' : $('#post_ID').val(),
- 'start' : st,
- 'num' : num
- };
-
- $.post(ajaxurl, data,
- function(r) {
- r = wpAjax.parseAjaxResponse(r);
- $('#commentsdiv .widefat').show();
- $('#commentsdiv img.waiting').hide();
-
- if ( 'object' == typeof r && r.responses[0] ) {
- $('#the-comment-list').append( r.responses[0].data );
-
- theList = theExtraList = null;
- $("a[className*=':']").unbind();
- setCommentsList();
-
- if ( commentsBox.st > commentsBox.total )
- $('#show-comments').hide();
- else
- $('#show-comments').html(postL10n.showcomm);
- return;
- } else if ( 1 == r ) {
- $('#show-comments').parent().html(postL10n.endcomm);
- return;
- }
+ r = $('<p id="tagcloud-'+tax+'" class="the-tagcloud">'+r+'</p>');
+ $('a', r).click(function(){
+ tagBox.flushTags( $(this).closest('.inside').children('.tagsdiv'), this);
+ return false;
+ });
- $('#the-comment-list').append('<tr><td colspan="5">'+wpAjax.broken+'</td></tr>');
- }
- );
+ $('#'+id).after(r);
+ });
+ },
+
+ init : function() {
+ var t = this, ajaxtag = $('div.ajaxtag');
+
+ $('.tagsdiv').each( function() {
+ tagBox.quickClicks(this);
+ });
+
+ $('input.tagadd', ajaxtag).click(function(){
+ t.flushTags( $(this).closest('.tagsdiv') );
+ });
+
+ $('div.taghint', ajaxtag).click(function(){
+ $(this).css('visibility', 'hidden').siblings('.newtag').focus();
+ });
+
+ $('input.newtag', ajaxtag).blur(function() {
+ if ( this.value == '' )
+ $(this).siblings('.taghint').css('visibility', '');
+ }).focus(function(){
+ $(this).siblings('.taghint').css('visibility', 'hidden');
+ }).keyup(function(e){
+ if ( 13 == e.which ) {
+ tagBox.flushTags( $(this).closest('.tagsdiv') );
+ return false;
+ }
+ }).keypress(function(e){
+ if ( 13 == e.which ) {
+ e.preventDefault();
+ return false;
+ }
+ }).each(function(){
+ var tax = $(this).closest('div.tagsdiv').attr('id');
+ $(this).suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
+ });
+
+ // save tags on post save/publish
+ $('#post').submit(function(){
+ $('div.tagsdiv').each( function() {
+ tagBox.flushTags(this, false, 1);
+ });
+ });
- return false;
- }
- };
-
- tagCloud = {
- init : function() {
- $('.tagcloud-link').click(function(){
- tagCloud.get($(this).attr('id'));
- $(this).unbind().click(function(){
- $(this).siblings('.the-tagcloud').toggle();
- return false;
- });
+ // tag cloud
+ $('a.tagcloud-link').click(function(){
+ tagBox.get( $(this).attr('id') );
+ $(this).unbind().click(function(){
+ $(this).siblings('.the-tagcloud').toggle();
return false;
});
- },
+ return false;
+ });
+ }
+};
- get : function(id) {
- var tax = id.substr(id.indexOf('-')+1);
+commentsBox = {
+ st : 0,
+
+ get : function(total, num) {
+ var st = this.st, data;
+ if ( ! num )
+ num = 20;
+
+ this.st += num;
+ this.total = total;
+ $('#commentsdiv img.waiting').show();
+
+ data = {
+ 'action' : 'get-comments',
+ 'mode' : 'single',
+ '_ajax_nonce' : $('#add_comment_nonce').val(),
+ 'post_ID' : $('#post_ID').val(),
+ 'start' : st,
+ 'num' : num
+ };
+
+ $.post(ajaxurl, data,
+ function(r) {
+ r = wpAjax.parseAjaxResponse(r);
+ $('#commentsdiv .widefat').show();
+ $('#commentsdiv img.waiting').hide();
+
+ if ( 'object' == typeof r && r.responses[0] ) {
+ $('#the-comment-list').append( r.responses[0].data );
+
+ theList = theExtraList = null;
+ $("a[className*=':']").unbind();
+ setCommentsList();
+
+ if ( commentsBox.st > commentsBox.total )
+ $('#show-comments').hide();
+ else
+ $('#show-comments').html(postL10n.showcomm);
+ return;
+ } else if ( 1 == r ) {
+ $('#show-comments').parent().html(postL10n.endcomm);
+ return;
+ }
- $.post(ajaxurl, {'action':'get-tagcloud','tax':tax}, function(r, stat) {
- if ( 0 == r || 'success' != stat )
- r = wpAjax.broken;
+ $('#the-comment-list').append('<tr><td colspan="2">'+wpAjax.broken+'</td></tr>');
+ }
+ );
- r = $('<p id="tagcloud-'+tax+'" class="the-tagcloud">'+r+'</p>');
- $('a', r).click(function(){
- var id = $(this).parents('p').attr('id');
- tag_flush_to_text(id.substr(id.indexOf('-')+1), this);
- return false;
- });
+ return false;
+ }
+};
- $('#'+id).after(r);
- });
+WPSetThumbnailHTML = function(html){
+ $('.inside', '#postimagediv').html(html);
+};
+
+WPSetThumbnailID = function(id){
+ var field = $('input[value=_thumbnail_id]', '#list-table');
+ if ( field.size() > 0 ) {
+ $('#meta\\[' + field.attr('id').match(/[0-9]+/) + '\\]\\[value\\]').text(id);
+ }
+};
+
+WPRemoveThumbnail = function(){
+ $.post(ajaxurl, {
+ action:"set-post-thumbnail", post_id: $('#post_ID').val(), thumbnail_id: -1, cookie: encodeURIComponent(document.cookie)
+ }, function(str){
+ if ( str == '0' ) {
+ alert( setPostThumbnailL10n.error );
+ } else {
+ WPSetThumbnailHTML(str);
}
- };
+ }
+ );
+};
- $(document).ready(function(){tagCloud.init();});
})(jQuery);
jQuery(document).ready( function($) {
- var noSyncChecks = false, syncChecks, catAddAfter, stamp = $('#timestamp').html(), visibility = $('#post-visibility-display').html(), sticky = '';
+ var catAddAfter, stamp, visibility, sticky = '', post = 'post' == pagenow || 'post-new' == pagenow, page = 'page' == pagenow || 'page-new' == pagenow;
// postboxes
- postboxes.add_postbox_toggles('post');
-
- // Editable slugs
- make_slugedit_clickable();
+ if ( post )
+ postboxes.add_postbox_toggles('post');
+ else if ( page )
+ postboxes.add_postbox_toggles('page');
+
+ // multi-taxonomies
+ if ( $('#tagsdiv-post_tag').length ) {
+ tagBox.init();
+ } else {
+ $('#side-sortables, #normal-sortables, #advanced-sortables').children('div.postbox').each(function(){
+ if ( this.id.indexOf('tagsdiv-') === 0 ) {
+ tagBox.init();
+ return false;
+ }
+ });
+ }
- // prepare the tag UI
- tag_init();
+ // categories
+ if ( $('#categorydiv').length ) {
+ // TODO: move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.dev.js
+ $('a', '#category-tabs').click(function(){
+ var t = $(this).attr('href');
+ $(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
+ $('#category-tabs').siblings('.tabs-panel').hide();
+ $(t).show();
+ if ( '#categories-all' == t )
+ deleteUserSetting('cats');
+ else
+ setUserSetting('cats','pop');
+ return false;
+ });
+ if ( getUserSetting('cats') )
+ $('a[href="#categories-pop"]', '#category-tabs').click();
- $('#title').blur( function() {
- if ( ($("#post_ID").val() > 0) || ($("#title").val().length == 0) )
- return;
+ // Ajax Cat
+ $('#newcat').one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ) } );
+ $('#category-add-sumbit').click( function(){ $('#newcat').focus(); } );
- if ( typeof(autosave) != 'undefined' )
- autosave();
- });
-
- // auto-suggest stuff
- $('.newtag').each(function(){
- var tax = $(this).parents('div.tagsdiv').attr('id');
- $(this).suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+tax, { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
- });
-
- // category tabs
- $('#category-tabs a').click(function(){
- var t = $(this).attr('href');
- $(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
- $('.tabs-panel').hide();
- $(t).show();
- if ( '#categories-all' == t )
- deleteUserSetting('cats');
- else
- setUserSetting('cats','pop');
- return false;
- });
- if ( getUserSetting('cats') )
- $('#category-tabs a[href="#categories-pop"]').click();
+ catAddBefore = function( s ) {
+ if ( !$('#newcat').val() )
+ return false;
+ s.data += '&' + $( ':checked', '#categorychecklist' ).serialize();
+ return s;
+ };
- // Ajax Cat
- $('#newcat').one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ) } );
- $('#category-add-sumbit').click(function(){$('#newcat').focus();});
+ catAddAfter = function( r, s ) {
+ var sup, drop = $('#newcat_parent');
- syncChecks = function() {
- if ( noSyncChecks )
- return;
- noSyncChecks = true;
- var th = jQuery(this), c = th.is(':checked'), id = th.val().toString();
- $('#in-category-' + id + ', #in-popular-category-' + id).attr( 'checked', c );
- noSyncChecks = false;
- };
-
- popularCats = $('#categorychecklist-pop :checkbox').map( function() { return parseInt(jQuery(this).val(), 10); } ).get().join(',');
- catAddBefore = function( s ) {
- if ( !$('#newcat').val() )
+ if ( 'undefined' != s.parsed.responses[0] && (sup = s.parsed.responses[0].supplemental.newcat_parent) ) {
+ drop.before(sup);
+ drop.remove();
+ }
+ };
+
+ $('#categorychecklist').wpList({
+ alt: '',
+ response: 'category-ajax-response',
+ addBefore: catAddBefore,
+ addAfter: catAddAfter
+ });
+
+ $('#category-add-toggle').click( function() {
+ $('#category-adder').toggleClass( 'wp-hidden-children' );
+ $('a[href="#categories-all"]', '#category-tabs').click();
return false;
- s.data += '&popular_ids=' + popularCats + '&' + jQuery( '#categorychecklist :checked' ).serialize();
- return s;
- };
-
- catAddAfter = function( r, s ) {
- var newCatParent = jQuery('#newcat_parent'), newCatParentOption = newCatParent.find( 'option[value="-1"]' );
- $(s.what + ' response_data', r).each( function() {
- var t = $($(this).text());
- t.find( 'label' ).each( function() {
- var th = $(this), val = th.find('input').val(), id = th.find('input')[0].id, name, o;
- $('#' + id).change( syncChecks ).change();
- if ( newCatParent.find( 'option[value="' + val + '"]' ).size() )
- return;
- name = $.trim( th.text() );
- o = $( '<option value="' + parseInt( val, 10 ) + '"></option>' ).text( name );
- newCatParent.prepend( o );
- } );
- newCatParentOption.attr( 'selected', 'selected' );
- } );
- };
-
- $('#categorychecklist').wpList( {
- alt: '',
- response: 'category-ajax-response',
- addBefore: catAddBefore,
- addAfter: catAddAfter
- } );
-
- $('#category-add-toggle').click( function() {
- $('#category-adder').toggleClass( 'wp-hidden-children' );
- $('#category-tabs a[href="#categories-all"]').click();
- return false;
- } );
+ });
- $('.categorychecklist .popular-category :checkbox').change( syncChecks ).filter( ':checked' ).change(), sticky = '';
+ $('#categorychecklist').children('li.popular-category').add( $('#categorychecklist-pop').children() ).find(':checkbox').live( 'click', function(){
+ var t = $(this), c = t.is(':checked'), id = t.val();
+ $('#in-category-' + id + ', #in-popular-category-' + id).attr( 'checked', c );
+ });
- function updateVisibility() {
- if ( $('#post-visibility-select input:radio:checked').val() != 'public' ) {
- $('#sticky').attr('checked', false);
- $('#sticky-span').hide();
- } else {
- $('#sticky-span').show();
- }
- if ( $('#post-visibility-select input:radio:checked').val() != 'password' ) {
- $('#password-span').hide();
- } else {
- $('#password-span').show();
+ } // end cats
+
+ // Custom Fields
+ if ( $('#postcustom').length ) {
+ $('#the-list').wpList( { addAfter: function( xml, s ) {
+ $('table#list-table').show();
+ if ( typeof( autosave_update_post_ID ) != 'undefined' ) {
+ autosave_update_post_ID(s.parsed.responses[0].supplemental.postid);
+ }
+ }, addBefore: function( s ) {
+ s.data += '&post_id=' + $('#post_ID').val();
+ return s;
}
+ });
}
- function updateText() {
- var attemptedDate, originalDate, currentDate, publishOn;
-
- attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val());
- originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val());
- currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val());
- if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) {
- publishOn = postL10n.publishOnFuture;
- $('#publish').val( postL10n.schedule );
- } else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) {
- publishOn = postL10n.publishOn;
- $('#publish').val( postL10n.publish );
- } else {
- publishOn = postL10n.publishOnPast;
- $('#publish').val( postL10n.update );
- }
- if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) { //hack
- $('#timestamp').html(stamp);
- } else {
- $('#timestamp').html(
- publishOn + ' <b>' +
- $( '#mm option[value=' + $('#mm').val() + ']' ).text() + ' ' +
- $('#jj').val() + ', ' +
- $('#aa').val() + ' @ ' +
- $('#hh').val() + ':' +
- $('#mn').val() + '</b> '
- );
+ // submitdiv
+ if ( $('#submitdiv').length ) {
+ stamp = $('#timestamp').html();
+ visibility = $('#post-visibility-display').html();
+
+ function updateVisibility() {
+ var pvSelect = $('#post-visibility-select');
+ if ( $('input:radio:checked', pvSelect).val() != 'public' ) {
+ $('#sticky').attr('checked', false);
+ $('#sticky-span').hide();
+ } else {
+ $('#sticky-span').show();
+ }
+ if ( $('input:radio:checked', pvSelect).val() != 'password' ) {
+ $('#password-span').hide();
+ } else {
+ $('#password-span').show();
+ }
}
- if ( $('#post-visibility-select input:radio:checked').val() == 'private' ) {
- $('#publish').val( postL10n.update );
- if ( $('#post_status option[value=publish]').length == 0 ) {
- $('#post_status').append('<option value="publish">' + postL10n.privatelyPublished + '</option>');
+ function updateText() {
+ var attemptedDate, originalDate, currentDate, publishOn, postStatus = $('#post_status'),
+ optPublish = $('option[value=publish]', postStatus), aa = $('#aa').val(),
+ mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val();
+
+ attemptedDate = new Date( aa, mm - 1, jj, hh, mn );
+ originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val() );
+ currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val() );
+
+ if ( attemptedDate.getFullYear() != aa || (1 + attemptedDate.getMonth()) != mm || attemptedDate.getDate() != jj || attemptedDate.getMinutes() != mn ) {
+ $('.timestamp-wrap', '#timestampdiv').addClass('form-invalid');
+ return false;
+ } else {
+ $('.timestamp-wrap', '#timestampdiv').removeClass('form-invalid');
}
- $('#post_status option[value=publish]').html( postL10n.privatelyPublished );
- $('#post_status option[value=publish]').attr('selected', true);
- $('.edit-post-status').hide();
- } else {
- if ( $('#original_post_status').val() == 'future' || $('#original_post_status').val() == 'draft' ) {
- if ( $('#post_status option[value=publish]').length != 0 ) {
- $('#post_status option[value=publish]').remove();
- $('#post_status').val($('#hidden_post_status').val());
+
+ if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) {
+ publishOn = postL10n.publishOnFuture;
+ $('#publish').val( postL10n.schedule );
+ } else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) {
+ publishOn = postL10n.publishOn;
+ $('#publish').val( postL10n.publish );
+ } else {
+ publishOn = postL10n.publishOnPast;
+ if ( page )
+ $('#publish').val( postL10n.updatePage );
+ else
+ $('#publish').val( postL10n.updatePost );
+ }
+ if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) { //hack
+ $('#timestamp').html(stamp);
+ } else {
+ $('#timestamp').html(
+ publishOn + ' <b>' +
+ $('option[value=' + $('#mm').val() + ']', '#mm').text() + ' ' +
+ jj + ', ' +
+ aa + ' @ ' +
+ hh + ':' +
+ mn + '</b> '
+ );
+ }
+
+ if ( $('input:radio:checked', '#post-visibility-select').val() == 'private' ) {
+ if ( page )
+ $('#publish').val( postL10n.updatePage );
+ else
+ $('#publish').val( postL10n.updatePost );
+ if ( optPublish.length == 0 ) {
+ postStatus.append('<option value="publish">' + postL10n.privatelyPublished + '</option>');
+ } else {
+ optPublish.html( postL10n.privatelyPublished );
}
+ $('option[value=publish]', postStatus).attr('selected', true);
+ $('.edit-post-status', '#misc-publishing-actions').hide();
} else {
- $('#post_status option[value=publish]').html( postL10n.published );
+ if ( $('#original_post_status').val() == 'future' || $('#original_post_status').val() == 'draft' ) {
+ if ( optPublish.length ) {
+ optPublish.remove();
+ postStatus.val($('#hidden_post_status').val());
+ }
+ } else {
+ optPublish.html( postL10n.published );
+ }
+ if ( postStatus.is(':hidden') )
+ $('.edit-post-status', '#misc-publishing-actions').show();
}
- $('.edit-post-status').show();
- }
- $('#post-status-display').html($('#post_status :selected').text());
- if ( $('#post_status :selected').val() == 'private' || $('#post_status :selected').val() == 'publish' ) {
- $('#save-post').hide();
- } else {
- $('#save-post').show();
- if ( $('#post_status :selected').val() == 'pending' ) {
- $('#save-post').show().val( postL10n.savePending );
+ $('#post-status-display').html($('option:selected', postStatus).text());
+ if ( $('option:selected', postStatus).val() == 'private' || $('option:selected', postStatus).val() == 'publish' ) {
+ $('#save-post').hide();
} else {
- $('#save-post').show().val( postL10n.saveDraft );
+ $('#save-post').show();
+ if ( $('option:selected', postStatus).val() == 'pending' ) {
+ $('#save-post').show().val( postL10n.savePending );
+ } else {
+ $('#save-post').show().val( postL10n.saveDraft );
+ }
}
+ return true;
}
- }
- $('.edit-visibility').click(function () {
- if ($('#post-visibility-select').is(":hidden")) {
- updateVisibility();
- $('#post-visibility-select').slideDown("normal");
- $('.edit-visibility').hide();
- }
- return false;
- });
-
- $('.cancel-post-visibility').click(function () {
- $('#post-visibility-select').slideUp("normal");
- $('#visibility-radio-' + $('#hidden-post-visibility').val()).attr('checked', true);
- $('#post_password').val($('#hidden_post_password').val());
- $('#sticky').attr('checked', $('#hidden-post-sticky').attr('checked'));
- $('#post-visibility-display').html(visibility);
- $('.edit-visibility').show();
- updateText();
- return false;
- });
-
- $('.save-post-visibility').click(function () { // crazyhorse - multiple ok cancels
- $('#post-visibility-select').slideUp("normal");
- $('.edit-visibility').show();
- updateText();
- if ( $('#post-visibility-select input:radio:checked').val() != 'public' ) {
- $('#sticky').attr('checked', false);
- }
+ $('.edit-visibility', '#visibility').click(function () {
+ if ($('#post-visibility-select').is(":hidden")) {
+ updateVisibility();
+ $('#post-visibility-select').slideDown("normal");
+ $(this).hide();
+ }
+ return false;
+ });
+
+ $('.cancel-post-visibility', '#post-visibility-select').click(function () {
+ $('#post-visibility-select').slideUp("normal");
+ $('#visibility-radio-' + $('#hidden-post-visibility').val()).attr('checked', true);
+ $('#post_password').val($('#hidden_post_password').val());
+ $('#sticky').attr('checked', $('#hidden-post-sticky').attr('checked'));
+ $('#post-visibility-display').html(visibility);
+ $('.edit-visibility', '#visibility').show();
+ updateText();
+ return false;
+ });
- if ( true == $('#sticky').attr('checked') ) {
- sticky = 'Sticky';
- } else {
- sticky = '';
- }
+ $('.save-post-visibility', '#post-visibility-select').click(function () { // crazyhorse - multiple ok cancels
+ var pvSelect = $('#post-visibility-select');
- $('#post-visibility-display').html(
- postL10n[$('#post-visibility-select input:radio:checked').val() + sticky]
- );
+ pvSelect.slideUp("normal");
+ $('.edit-visibility', '#visibility').show();
+ updateText();
- return false;
- });
+ if ( $('input:radio:checked', pvSelect).val() != 'public' ) {
+ $('#sticky').attr('checked', false);
+ }
- $('#post-visibility-select input:radio').change(function() {
- updateVisibility();
- });
+ if ( true == $('#sticky').attr('checked') ) {
+ sticky = 'Sticky';
+ } else {
+ sticky = '';
+ }
- $('.edit-timestamp').click(function () {
- if ($('#timestampdiv').is(":hidden")) {
- $('#timestampdiv').slideDown("normal");
- $('.edit-timestamp').hide();
- }
+ $('#post-visibility-display').html( postL10n[$('input:radio:checked', pvSelect).val() + sticky] );
+ return false;
+ });
- return false;
- });
-
- $('.cancel-timestamp').click(function() {
- $('#timestampdiv').slideUp("normal");
- $('#mm').val($('#hidden_mm').val());
- $('#jj').val($('#hidden_jj').val());
- $('#aa').val($('#hidden_aa').val());
- $('#hh').val($('#hidden_hh').val());
- $('#mn').val($('#hidden_mn').val());
- $('.edit-timestamp').show();
- updateText();
- return false;
- });
+ $('input:radio', '#post-visibility-select').change(function() {
+ updateVisibility();
+ });
- $('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels
- $('#timestampdiv').slideUp("normal");
- $('.edit-timestamp').show();
- updateText();
+ $('#timestampdiv').siblings('a.edit-timestamp').click(function() {
+ if ($('#timestampdiv').is(":hidden")) {
+ $('#timestampdiv').slideDown("normal");
+ $(this).hide();
+ }
+ return false;
+ });
+
+ $('.cancel-timestamp', '#timestampdiv').click(function() {
+ $('#timestampdiv').slideUp("normal");
+ $('#mm').val($('#hidden_mm').val());
+ $('#jj').val($('#hidden_jj').val());
+ $('#aa').val($('#hidden_aa').val());
+ $('#hh').val($('#hidden_hh').val());
+ $('#mn').val($('#hidden_mn').val());
+ $('#timestampdiv').siblings('a.edit-timestamp').show();
+ updateText();
+ return false;
+ });
- return false;
- });
+ $('.save-timestamp', '#timestampdiv').click(function () { // crazyhorse - multiple ok cancels
+ if ( updateText() ) {
+ $('#timestampdiv').slideUp("normal");
+ $('#timestampdiv').siblings('a.edit-timestamp').show();
+ }
+ return false;
+ });
- $('.edit-post-status').click(function() {
- if ($('#post-status-select').is(":hidden")) {
- $('#post-status-select').slideDown("normal");
- $(this).hide();
- }
+ $('#post-status-select').siblings('a.edit-post-status').click(function() {
+ if ($('#post-status-select').is(":hidden")) {
+ $('#post-status-select').slideDown("normal");
+ $(this).hide();
+ }
+ return false;
+ });
- return false;
- });
+ $('.save-post-status', '#post-status-select').click(function() {
+ $('#post-status-select').slideUp("normal");
+ $('#post-status-select').siblings('a.edit-post-status').show();
+ updateText();
+ return false;
+ });
- $('.save-post-status').click(function() {
- $('#post-status-select').slideUp("normal");
- $('.edit-post-status').show();
- updateText();
- return false;
- });
+ $('.cancel-post-status', '#post-status-select').click(function() {
+ $('#post-status-select').slideUp("normal");
+ $('#post_status').val($('#hidden_post_status').val());
+ $('#post-status-select').siblings('a.edit-post-status').show();
+ updateText();
+ return false;
+ });
+ } // end submitdiv
+
+ // permalink
+ if ( $('#edit-slug-box').length ) {
+ editPermalink = function(post_id) {
+ var i, c = 0, e = $('#editable-post-name'), revert_e = e.html(), real_slug = $('#post_name'), revert_slug = real_slug.html(), b = $('#edit-slug-buttons'), revert_b = b.html(), full = $('#editable-post-name-full').html();
+
+ $('#view-post-btn').hide();
+ b.html('<a href="#" class="save button">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+'</a>');
+ b.children('.save').click(function() {
+ var new_slug = e.children('input').val();
+ $.post(ajaxurl, {
+ action: 'sample-permalink',
+ post_id: post_id,
+ new_slug: new_slug,
+ new_title: $('#title').val(),
+ samplepermalinknonce: $('#samplepermalinknonce').val()
+ }, function(data) {
+ $('#edit-slug-box').html(data);
+ b.html(revert_b);
+ real_slug.attr('value', new_slug);
+ makeSlugeditClickable();
+ $('#view-post-btn').show();
+ });
+ return false;
+ });
- $('.cancel-post-status').click(function() {
- $('#post-status-select').slideUp("normal");
- $('#post_status').val($('#hidden_post_status').val());
- $('.edit-post-status').show();
- updateText();
- return false;
- });
+ $('.cancel', '#edit-slug-buttons').click(function() {
+ $('#view-post-btn').show();
+ e.html(revert_e);
+ b.html(revert_b);
+ real_slug.attr('value', revert_slug);
+ return false;
+ });
- // Custom Fields
- $('#the-list').wpList( { addAfter: function( xml, s ) {
- $('table#list-table').show();
- if ( typeof( autosave_update_post_ID ) != 'undefined' ) {
- autosave_update_post_ID(s.parsed.responses[0].supplemental.postid);
+ for ( i = 0; i < full.length; ++i ) {
+ if ( '%' == full.charAt(i) )
+ c++;
+ }
+
+ slug_value = ( c > full.length / 4 ) ? '' : full;
+ e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children('input').keypress(function(e){
+ var key = e.keyCode || 0;
+ // on enter, just save the new slug, don't save the post
+ if ( 13 == key ) {
+ b.children('.save').click();
+ return false;
+ }
+ if ( 27 == key ) {
+ b.children('.cancel').click();
+ return false;
+ }
+ real_slug.attr('value', this.value);
+ }).focus();
+ }
+
+ makeSlugeditClickable = function() {
+ $('#editable-post-name').click(function() {
+ $('#edit-slug-buttons').children('.edit-slug').click();
+ });
}
- }, addBefore: function( s ) {
- s.data += '&post_id=' + $('#post_ID').val();
- return s;
+ makeSlugeditClickable();
}
- });
});
-function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}function new_tag_remove_tag(){var e=jQuery(this).attr("id"),a=e.split("-check-num-")[1],c=jQuery(this).parents(".tagsdiv"),b=c.find(".the-tags").val().split(","),d=[];delete b[a];jQuery.each(b,function(f,g){g=jQuery.trim(g);if(g){d.push(g)}});c.find(".the-tags").val(d.join(",").replace(/\s*,+\s*/,",").replace(/,+/,",").replace(/,+\s+,+/,",").replace(/,+\s*$/,"").replace(/^\s*,+/,""));tag_update_quickclicks(c);return false}function tag_update_quickclicks(b){if(jQuery(b).find(".the-tags").length==0){return}var a=jQuery(b).find(".the-tags").val().split(",");jQuery(b).find(".tagchecklist").empty();shown=false;jQuery.each(a,function(e,f){var c,d;f=jQuery.trim(f);if(!f.match(/^\s+$/)&&""!=f){d=jQuery(b).attr("id")+"-check-num-"+e;c='<span><a id="'+d+'" class="ntdelbutton">X</a> '+f+"</span> ";jQuery(b).find(".tagchecklist").append(c);jQuery("#"+d).click(new_tag_remove_tag)}});if(shown){jQuery(b).find(".tagchecklist").prepend("<strong>"+postL10n.tagsUsed+"</strong><br />")}}function tag_flush_to_text(g,b){b=b||false;var e,f,c,d;e=jQuery("#"+g);f=b?jQuery(b).text():e.find("input.newtag").val();if(e.find("input.newtag").hasClass("form-input-tip")&&!b){return false}c=e.find(".the-tags").val();d=c?c+","+f:f;d=d.replace(/\s+,+\s*/g,",").replace(/,+/g,",").replace(/,+\s+,+/g,",").replace(/,+\s*$/g,"").replace(/^\s*,+/g,"");d=array_unique_noempty(d.split(",")).join(",");e.find(".the-tags").val(d);tag_update_quickclicks(e);if(!b){e.find("input.newtag").val("").focus()}return false}function tag_save_on_publish(){jQuery(".tagsdiv").each(function(a){if(!jQuery(this).find("input.newtag").hasClass("form-input-tip")){tag_flush_to_text(jQuery(this).parents(".tagsdiv").attr("id"))}})}function tag_press_key(a){if(13==a.which){tag_flush_to_text(jQuery(a.target).parents(".tagsdiv").attr("id"));return false}}function tag_init(){jQuery(".ajaxtag").show();jQuery(".tagsdiv").each(function(a){tag_update_quickclicks(this)});jQuery(".ajaxtag input.tagadd").click(function(){tag_flush_to_text(jQuery(this).parents(".tagsdiv").attr("id"))});jQuery(".ajaxtag input.newtag").focus(function(){if(!this.cleared){this.cleared=true;jQuery(this).val("").removeClass("form-input-tip")}});jQuery(".ajaxtag input.newtag").blur(function(){if(this.value==""){this.cleared=false;jQuery(this).val(postL10n.addTag).addClass("form-input-tip")}});jQuery("#publish").click(tag_save_on_publish);jQuery("#save-post").click(tag_save_on_publish);jQuery(".ajaxtag input.newtag").keypress(tag_press_key)}var commentsBox,tagCloud;(function(a){commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv img.waiting").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),post_ID:a("#post_ID").val(),start:b,num:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv img.waiting").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();setCommentsList();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").parent().html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="5">'+wpAjax.broken+"</td></tr>")});return false}};tagCloud={init:function(){a(".tagcloud-link").click(function(){tagCloud.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){var f=a(this).parents("p").attr("id");tag_flush_to_text(f.substr(f.indexOf("-")+1),this);return false});a("#"+c).after(e)})}};a(document).ready(function(){tagCloud.init()})})(jQuery);jQuery(document).ready(function(g){var d=false,i,e,a=g("#timestamp").html(),b=g("#post-visibility-display").html(),h="";postboxes.add_postbox_toggles("post");make_slugedit_clickable();tag_init();g("#title").blur(function(){if((g("#post_ID").val()>0)||(g("#title").val().length==0)){return}if(typeof(autosave)!="undefined"){autosave()}});g(".newtag").each(function(){var j=g(this).parents("div.tagsdiv").attr("id");g(this).suggest("admin-ajax.php?action=ajax-tag-search&tax="+j,{delay:500,minchars:2,multiple:true,multipleSep:", "})});g("#category-tabs a").click(function(){var j=g(this).attr("href");g(this).parent().addClass("tabs").siblings("li").removeClass("tabs");g(".tabs-panel").hide();g(j).show();if("#categories-all"==j){deleteUserSetting("cats")}else{setUserSetting("cats","pop")}return false});if(getUserSetting("cats")){g('#category-tabs a[href="#categories-pop"]').click()}g("#newcat").one("focus",function(){g(this).val("").removeClass("form-input-tip")});g("#category-add-sumbit").click(function(){g("#newcat").focus()});i=function(){if(d){return}d=true;var j=jQuery(this),l=j.is(":checked"),k=j.val().toString();g("#in-category-"+k+", #in-popular-category-"+k).attr("checked",l);d=false};popularCats=g("#categorychecklist-pop :checkbox").map(function(){return parseInt(jQuery(this).val(),10)}).get().join(",");catAddBefore=function(j){if(!g("#newcat").val()){return false}j.data+="&popular_ids="+popularCats+"&"+jQuery("#categorychecklist :checked").serialize();return j};e=function(m,k){var j=jQuery("#newcat_parent"),l=j.find('option[value="-1"]');g(k.what+" response_data",m).each(function(){var n=g(g(this).text());n.find("label").each(function(){var q=g(this),s=q.find("input").val(),t=q.find("input")[0].id,p,r;g("#"+t).change(i).change();if(j.find('option[value="'+s+'"]').size()){return}p=g.trim(q.text());r=g('<option value="'+parseInt(s,10)+'"></option>').text(p);j.prepend(r)});l.attr("selected","selected")})};g("#categorychecklist").wpList({alt:"",response:"category-ajax-response",addBefore:catAddBefore,addAfter:e});g("#category-add-toggle").click(function(){g("#category-adder").toggleClass("wp-hidden-children");g('#category-tabs a[href="#categories-all"]').click();return false});g(".categorychecklist .popular-category :checkbox").change(i).filter(":checked").change(),h="";function f(){if(g("#post-visibility-select input:radio:checked").val()!="public"){g("#sticky").attr("checked",false);g("#sticky-span").hide()}else{g("#sticky-span").show()}if(g("#post-visibility-select input:radio:checked").val()!="password"){g("#password-span").hide()}else{g("#password-span").show()}}function c(){var j,l,k,m;j=new Date(g("#aa").val(),g("#mm").val()-1,g("#jj").val(),g("#hh").val(),g("#mn").val());l=new Date(g("#hidden_aa").val(),g("#hidden_mm").val()-1,g("#hidden_jj").val(),g("#hidden_hh").val(),g("#hidden_mn").val());k=new Date(g("#cur_aa").val(),g("#cur_mm").val()-1,g("#cur_jj").val(),g("#cur_hh").val(),g("#cur_mn").val());if(j>k&&g("#original_post_status").val()!="future"){m=postL10n.publishOnFuture;g("#publish").val(postL10n.schedule)}else{if(j<=k&&g("#original_post_status").val()!="publish"){m=postL10n.publishOn;g("#publish").val(postL10n.publish)}else{m=postL10n.publishOnPast;g("#publish").val(postL10n.update)}}if(l.toUTCString()==j.toUTCString()){g("#timestamp").html(a)}else{g("#timestamp").html(m+" <b>"+g("#mm option[value="+g("#mm").val()+"]").text()+" "+g("#jj").val()+", "+g("#aa").val()+" @ "+g("#hh").val()+":"+g("#mn").val()+"</b> ")}if(g("#post-visibility-select input:radio:checked").val()=="private"){g("#publish").val(postL10n.update);if(g("#post_status option[value=publish]").length==0){g("#post_status").append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}g("#post_status option[value=publish]").html(postL10n.privatelyPublished);g("#post_status option[value=publish]").attr("selected",true);g(".edit-post-status").hide()}else{if(g("#original_post_status").val()=="future"||g("#original_post_status").val()=="draft"){if(g("#post_status option[value=publish]").length!=0){g("#post_status option[value=publish]").remove();g("#post_status").val(g("#hidden_post_status").val())}}else{g("#post_status option[value=publish]").html(postL10n.published)}g(".edit-post-status").show()}g("#post-status-display").html(g("#post_status :selected").text());if(g("#post_status :selected").val()=="private"||g("#post_status :selected").val()=="publish"){g("#save-post").hide()}else{g("#save-post").show();if(g("#post_status :selected").val()=="pending"){g("#save-post").show().val(postL10n.savePending)}else{g("#save-post").show().val(postL10n.saveDraft)}}}g(".edit-visibility").click(function(){if(g("#post-visibility-select").is(":hidden")){f();g("#post-visibility-select").slideDown("normal");g(".edit-visibility").hide()}return false});g(".cancel-post-visibility").click(function(){g("#post-visibility-select").slideUp("normal");g("#visibility-radio-"+g("#hidden-post-visibility").val()).attr("checked",true);g("#post_password").val(g("#hidden_post_password").val());g("#sticky").attr("checked",g("#hidden-post-sticky").attr("checked"));g("#post-visibility-display").html(b);g(".edit-visibility").show();c();return false});g(".save-post-visibility").click(function(){g("#post-visibility-select").slideUp("normal");g(".edit-visibility").show();c();if(g("#post-visibility-select input:radio:checked").val()!="public"){g("#sticky").attr("checked",false)}if(true==g("#sticky").attr("checked")){h="Sticky"}else{h=""}g("#post-visibility-display").html(postL10n[g("#post-visibility-select input:radio:checked").val()+h]);return false});g("#post-visibility-select input:radio").change(function(){f()});g(".edit-timestamp").click(function(){if(g("#timestampdiv").is(":hidden")){g("#timestampdiv").slideDown("normal");g(".edit-timestamp").hide()}return false});g(".cancel-timestamp").click(function(){g("#timestampdiv").slideUp("normal");g("#mm").val(g("#hidden_mm").val());g("#jj").val(g("#hidden_jj").val());g("#aa").val(g("#hidden_aa").val());g("#hh").val(g("#hidden_hh").val());g("#mn").val(g("#hidden_mn").val());g(".edit-timestamp").show();c();return false});g(".save-timestamp").click(function(){g("#timestampdiv").slideUp("normal");g(".edit-timestamp").show();c();return false});g(".edit-post-status").click(function(){if(g("#post-status-select").is(":hidden")){g("#post-status-select").slideDown("normal");g(this).hide()}return false});g(".save-post-status").click(function(){g("#post-status-select").slideUp("normal");g(".edit-post-status").show();c();return false});g(".cancel-post-status").click(function(){g("#post-status-select").slideUp("normal");g("#post_status").val(g("#hidden_post_status").val());g(".edit-post-status").show();c();return false});g("#the-list").wpList({addAfter:function(j,k){g("table#list-table").show();if(typeof(autosave_update_post_ID)!="undefined"){autosave_update_post_ID(k.parsed.responses[0].supplemental.postid)}},addBefore:function(j){j.data+="&post_id="+g("#post_ID").val();return j}})});
\ No newline at end of file
+var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail;function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}(function(a){tagBox={clean:function(b){return b.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"")},parseTags:function(e){var h=e.id,b=h.split("-check-num-")[1],d=a(e).closest(".tagsdiv"),g=d.find(".the-tags"),c=g.val().split(","),f=[];delete c[b];a.each(c,function(i,j){j=a.trim(j);if(j){f.push(j)}});g.val(this.clean(f.join(",")));this.quickClicks(d);return false},quickClicks:function(c){var e=a(".the-tags",c),d=a(".tagchecklist",c),b;if(!e.length){return}b=e.val().split(",");d.empty();a.each(b,function(h,i){var f,g,j=a(c).attr("id");i=a.trim(i);if(!i.match(/^\s+$/)&&""!=i){g=j+"-check-num-"+h;f='<span><a id="'+g+'" class="ntdelbutton">X</a> '+i+"</span> ";d.append(f);a("#"+g).click(function(){tagBox.parseTags(this)})}})},flushTags:function(e,b,g){b=b||false;var i,c=a(".the-tags",e),h=a("input.newtag",e),d;i=b?a(b).text():h.val();tagsval=c.val();d=tagsval?tagsval+","+i:i;d=this.clean(d);d=array_unique_noempty(d.split(",")).join(",");c.val(d);this.quickClicks(e);if(!b){h.val("")}if("undefined"==typeof(g)){h.focus()}return false},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this);return false});a("#"+c).after(e)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)});a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))});a("div.taghint",c).click(function(){a(this).css("visibility","hidden").siblings(".newtag").focus()});a("input.newtag",c).blur(function(){if(this.value==""){a(this).siblings(".taghint").css("visibility","")}}).focus(function(){a(this).siblings(".taghint").css("visibility","hidden")}).keyup(function(d){if(13==d.which){tagBox.flushTags(a(this).closest(".tagsdiv"));return false}}).keypress(function(d){if(13==d.which){d.preventDefault();return false}}).each(function(){var d=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+d,{delay:500,minchars:2,multiple:true,multipleSep:", "})});a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,false,1)})});a("a.tagcloud-link").click(function(){tagBox.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})}};commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv img.waiting").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),post_ID:a("#post_ID").val(),start:b,num:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv img.waiting").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();setCommentsList();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").parent().html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>")});return false}};WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)};WPSetThumbnailID=function(c){var b=a("input[value=_thumbnail_id]","#list-table");if(b.size()>0){a("#meta\\["+b.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(c)}};WPRemoveThumbnail=function(){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,cookie:encodeURIComponent(document.cookie)},function(b){if(b=="0"){alert(setPostThumbnailL10n.error)}else{WPSetThumbnailHTML(b)}})}})(jQuery);jQuery(document).ready(function(f){var d,a,b,h="",i="post"==pagenow||"post-new"==pagenow,g="page"==pagenow||"page-new"==pagenow;if(i){postboxes.add_postbox_toggles("post")}else{if(g){postboxes.add_postbox_toggles("page")}}if(f("#tagsdiv-post_tag").length){tagBox.init()}else{f("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){if(this.id.indexOf("tagsdiv-")===0){tagBox.init();return false}})}if(f("#categorydiv").length){f("a","#category-tabs").click(function(){var j=f(this).attr("href");f(this).parent().addClass("tabs").siblings("li").removeClass("tabs");f("#category-tabs").siblings(".tabs-panel").hide();f(j).show();if("#categories-all"==j){deleteUserSetting("cats")}else{setUserSetting("cats","pop")}return false});if(getUserSetting("cats")){f('a[href="#categories-pop"]',"#category-tabs").click()}f("#newcat").one("focus",function(){f(this).val("").removeClass("form-input-tip")});f("#category-add-sumbit").click(function(){f("#newcat").focus()});catAddBefore=function(j){if(!f("#newcat").val()){return false}j.data+="&"+f(":checked","#categorychecklist").serialize();return j};d=function(m,l){var k,j=f("#newcat_parent");if("undefined"!=l.parsed.responses[0]&&(k=l.parsed.responses[0].supplemental.newcat_parent)){j.before(k);j.remove()}};f("#categorychecklist").wpList({alt:"",response:"category-ajax-response",addBefore:catAddBefore,addAfter:d});f("#category-add-toggle").click(function(){f("#category-adder").toggleClass("wp-hidden-children");f('a[href="#categories-all"]',"#category-tabs").click();return false});f("#categorychecklist").children("li.popular-category").add(f("#categorychecklist-pop").children()).find(":checkbox").live("click",function(){var j=f(this),l=j.is(":checked"),k=j.val();f("#in-category-"+k+", #in-popular-category-"+k).attr("checked",l)})}if(f("#postcustom").length){f("#the-list").wpList({addAfter:function(j,k){f("table#list-table").show();if(typeof(autosave_update_post_ID)!="undefined"){autosave_update_post_ID(k.parsed.responses[0].supplemental.postid)}},addBefore:function(j){j.data+="&post_id="+f("#post_ID").val();return j}})}if(f("#submitdiv").length){a=f("#timestamp").html();b=f("#post-visibility-display").html();function e(){var j=f("#post-visibility-select");if(f("input:radio:checked",j).val()!="public"){f("#sticky").attr("checked",false);f("#sticky-span").hide()}else{f("#sticky-span").show()}if(f("input:radio:checked",j).val()!="password"){f("#password-span").hide()}else{f("#password-span").show()}}function c(){var q,r,k,t,s=f("#post_status"),l=f("option[value=publish]",s),j=f("#aa").val(),o=f("#mm").val(),p=f("#jj").val(),n=f("#hh").val(),m=f("#mn").val();q=new Date(j,o-1,p,n,m);r=new Date(f("#hidden_aa").val(),f("#hidden_mm").val()-1,f("#hidden_jj").val(),f("#hidden_hh").val(),f("#hidden_mn").val());k=new Date(f("#cur_aa").val(),f("#cur_mm").val()-1,f("#cur_jj").val(),f("#cur_hh").val(),f("#cur_mn").val());if(q.getFullYear()!=j||(1+q.getMonth())!=o||q.getDate()!=p||q.getMinutes()!=m){f(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{f(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}if(q>k&&f("#original_post_status").val()!="future"){t=postL10n.publishOnFuture;f("#publish").val(postL10n.schedule)}else{if(q<=k&&f("#original_post_status").val()!="publish"){t=postL10n.publishOn;f("#publish").val(postL10n.publish)}else{t=postL10n.publishOnPast;if(g){f("#publish").val(postL10n.updatePage)}else{f("#publish").val(postL10n.updatePost)}}}if(r.toUTCString()==q.toUTCString()){f("#timestamp").html(a)}else{f("#timestamp").html(t+" <b>"+f("option[value="+f("#mm").val()+"]","#mm").text()+" "+p+", "+j+" @ "+n+":"+m+"</b> ")}if(f("input:radio:checked","#post-visibility-select").val()=="private"){if(g){f("#publish").val(postL10n.updatePage)}else{f("#publish").val(postL10n.updatePost)}if(l.length==0){s.append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}else{l.html(postL10n.privatelyPublished)}f("option[value=publish]",s).attr("selected",true);f(".edit-post-status","#misc-publishing-actions").hide()}else{if(f("#original_post_status").val()=="future"||f("#original_post_status").val()=="draft"){if(l.length){l.remove();s.val(f("#hidden_post_status").val())}}else{l.html(postL10n.published)}if(s.is(":hidden")){f(".edit-post-status","#misc-publishing-actions").show()}}f("#post-status-display").html(f("option:selected",s).text());if(f("option:selected",s).val()=="private"||f("option:selected",s).val()=="publish"){f("#save-post").hide()}else{f("#save-post").show();if(f("option:selected",s).val()=="pending"){f("#save-post").show().val(postL10n.savePending)}else{f("#save-post").show().val(postL10n.saveDraft)}}return true}f(".edit-visibility","#visibility").click(function(){if(f("#post-visibility-select").is(":hidden")){e();f("#post-visibility-select").slideDown("normal");f(this).hide()}return false});f(".cancel-post-visibility","#post-visibility-select").click(function(){f("#post-visibility-select").slideUp("normal");f("#visibility-radio-"+f("#hidden-post-visibility").val()).attr("checked",true);f("#post_password").val(f("#hidden_post_password").val());f("#sticky").attr("checked",f("#hidden-post-sticky").attr("checked"));f("#post-visibility-display").html(b);f(".edit-visibility","#visibility").show();c();return false});f(".save-post-visibility","#post-visibility-select").click(function(){var j=f("#post-visibility-select");j.slideUp("normal");f(".edit-visibility","#visibility").show();c();if(f("input:radio:checked",j).val()!="public"){f("#sticky").attr("checked",false)}if(true==f("#sticky").attr("checked")){h="Sticky"}else{h=""}f("#post-visibility-display").html(postL10n[f("input:radio:checked",j).val()+h]);return false});f("input:radio","#post-visibility-select").change(function(){e()});f("#timestampdiv").siblings("a.edit-timestamp").click(function(){if(f("#timestampdiv").is(":hidden")){f("#timestampdiv").slideDown("normal");f(this).hide()}return false});f(".cancel-timestamp","#timestampdiv").click(function(){f("#timestampdiv").slideUp("normal");f("#mm").val(f("#hidden_mm").val());f("#jj").val(f("#hidden_jj").val());f("#aa").val(f("#hidden_aa").val());f("#hh").val(f("#hidden_hh").val());f("#mn").val(f("#hidden_mn").val());f("#timestampdiv").siblings("a.edit-timestamp").show();c();return false});f(".save-timestamp","#timestampdiv").click(function(){if(c()){f("#timestampdiv").slideUp("normal");f("#timestampdiv").siblings("a.edit-timestamp").show()}return false});f("#post-status-select").siblings("a.edit-post-status").click(function(){if(f("#post-status-select").is(":hidden")){f("#post-status-select").slideDown("normal");f(this).hide()}return false});f(".save-post-status","#post-status-select").click(function(){f("#post-status-select").slideUp("normal");f("#post-status-select").siblings("a.edit-post-status").show();c();return false});f(".cancel-post-status","#post-status-select").click(function(){f("#post-status-select").slideUp("normal");f("#post_status").val(f("#hidden_post_status").val());f("#post-status-select").siblings("a.edit-post-status").show();c();return false})}if(f("#edit-slug-box").length){editPermalink=function(j){var k,n=0,m=f("#editable-post-name"),o=m.html(),r=f("#post_name"),s=r.html(),p=f("#edit-slug-buttons"),q=p.html(),l=f("#editable-post-name-full").html();f("#view-post-btn").hide();p.html('<a href="#" class="save button">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+"</a>");p.children(".save").click(function(){var t=m.children("input").val();f.post(ajaxurl,{action:"sample-permalink",post_id:j,new_slug:t,new_title:f("#title").val(),samplepermalinknonce:f("#samplepermalinknonce").val()},function(u){f("#edit-slug-box").html(u);p.html(q);r.attr("value",t);makeSlugeditClickable();f("#view-post-btn").show()});return false});f(".cancel","#edit-slug-buttons").click(function(){f("#view-post-btn").show();m.html(o);p.html(q);r.attr("value",s);return false});for(k=0;k<l.length;++k){if("%"==l.charAt(k)){n++}}slug_value=(n>l.length/4)?"":l;m.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children("input").keypress(function(u){var t=u.keyCode||0;if(13==t){p.children(".save").click();return false}if(27==t){p.children(".cancel").click();return false}r.attr("value",this.value)}).focus()};makeSlugeditClickable=function(){f("#editable-post-name").click(function(){f("#edit-slug-buttons").children(".edit-slug").click()})};makeSlugeditClickable()}});
\ No newline at end of file
save_state : function(page) {
var closed = $('.postbox').filter('.closed').map(function() { return this.id; }).get().join(','),
hidden = $('.postbox').filter(':hidden').map(function() { return this.id; }).get().join(',');
- $.post(postboxL10n.requestFile, {
+ $.post(ajaxurl, {
action: 'closed-postboxes',
closed: closed,
hidden: hidden,
$('.meta-box-sortables').each( function() {
postVars["order[" + this.id.split('-')[0] + "]"] = $(this).sortable( 'toArray' ).join(',');
} );
- $.post( postboxL10n.requestFile, postVars );
+ $.post( ajaxurl, postVars );
},
/* Callbacks */
-var postboxes;(function(a){postboxes={add_postbox_toggles:function(c,b){this.init(c,b);a(".postbox h3, .postbox .handlediv").click(function(){var e=a(this).parent(".postbox"),f=e.attr("id");e.toggleClass("closed");postboxes.save_state(c);if(f){if(!e.hasClass("closed")&&a.isFunction(postboxes.pbshow)){postboxes.pbshow(f)}else{if(e.hasClass("closed")&&a.isFunction(postboxes.pbhide)){postboxes.pbhide(f)}}}});a(".postbox h3 a").click(function(f){f.stopPropagation()});a(".hide-postbox-tog").click(function(){var e=a(this).val();if(a(this).attr("checked")){a("#"+e).show();if(a.isFunction(postboxes.pbshow)){postboxes.pbshow(e)}}else{a("#"+e).hide();if(a.isFunction(postboxes.pbhide)){postboxes.pbhide(e)}}postboxes.save_state(c)});a('.columns-prefs input[type="radio"]').click(function(){var e=a(this).val(),f,g,h=a("#poststuff");if(h.length){if(e==2){h.addClass("has-right-sidebar");a("#side-sortables").addClass("temp-border")}else{if(e==1){h.removeClass("has-right-sidebar");a("#normal-sortables").append(a("#side-sortables").children(".postbox"))}}}else{for(f=4;(f>e&&f>1);f--){g=a("#"+d(f)+"-sortables");a("#"+d(f-1)+"-sortables").append(g.children(".postbox"));g.parent().hide()}for(f=1;f<=e;f++){g=a("#"+d(f)+"-sortables");if(g.parent().is(":hidden")){g.addClass("temp-border").parent().show()}}a(".postbox-container:visible").css("width",98/e+"%")}postboxes.save_order(c)});function d(e){switch(e){case 1:return"normal";break;case 2:return"side";break;case 3:return"column3";break;case 4:return"column4";break;default:return""}}},init:function(c,b){a.extend(this,b||{});a("#wpbody-content").css("overflow","hidden");a(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",distance:2,tolerance:"pointer",forcePlaceholderSize:true,helper:"clone",opacity:0.65,start:function(f,d){a("body").css({WebkitUserSelect:"none",KhtmlUserSelect:"none"})},stop:function(f,d){postboxes.save_order(c);d.item.parent().removeClass("temp-border");a("body").css({WebkitUserSelect:"",KhtmlUserSelect:""})}})},save_state:function(d){var b=a(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),c=a(".postbox").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(postboxL10n.requestFile,{action:"closed-postboxes",closed:b,hidden:c,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:d})},save_order:function(c){var b,d=a(".columns-prefs input:checked").val()||0;b={action:"meta-box-order",_ajax_nonce:a("#meta-box-order-nonce").val(),page_columns:d,page:c};a(".meta-box-sortables").each(function(){b["order["+this.id.split("-")[0]+"]"]=a(this).sortable("toArray").join(",")});a.post(postboxL10n.requestFile,b)},pbshow:false,pbhide:false}}(jQuery));
\ No newline at end of file
+var postboxes;(function(a){postboxes={add_postbox_toggles:function(c,b){this.init(c,b);a(".postbox h3, .postbox .handlediv").click(function(){var e=a(this).parent(".postbox"),f=e.attr("id");e.toggleClass("closed");postboxes.save_state(c);if(f){if(!e.hasClass("closed")&&a.isFunction(postboxes.pbshow)){postboxes.pbshow(f)}else{if(e.hasClass("closed")&&a.isFunction(postboxes.pbhide)){postboxes.pbhide(f)}}}});a(".postbox h3 a").click(function(f){f.stopPropagation()});a(".hide-postbox-tog").click(function(){var e=a(this).val();if(a(this).attr("checked")){a("#"+e).show();if(a.isFunction(postboxes.pbshow)){postboxes.pbshow(e)}}else{a("#"+e).hide();if(a.isFunction(postboxes.pbhide)){postboxes.pbhide(e)}}postboxes.save_state(c)});a('.columns-prefs input[type="radio"]').click(function(){var e=a(this).val(),f,g,h=a("#poststuff");if(h.length){if(e==2){h.addClass("has-right-sidebar");a("#side-sortables").addClass("temp-border")}else{if(e==1){h.removeClass("has-right-sidebar");a("#normal-sortables").append(a("#side-sortables").children(".postbox"))}}}else{for(f=4;(f>e&&f>1);f--){g=a("#"+d(f)+"-sortables");a("#"+d(f-1)+"-sortables").append(g.children(".postbox"));g.parent().hide()}for(f=1;f<=e;f++){g=a("#"+d(f)+"-sortables");if(g.parent().is(":hidden")){g.addClass("temp-border").parent().show()}}a(".postbox-container:visible").css("width",98/e+"%")}postboxes.save_order(c)});function d(e){switch(e){case 1:return"normal";break;case 2:return"side";break;case 3:return"column3";break;case 4:return"column4";break;default:return""}}},init:function(c,b){a.extend(this,b||{});a("#wpbody-content").css("overflow","hidden");a(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",distance:2,tolerance:"pointer",forcePlaceholderSize:true,helper:"clone",opacity:0.65,start:function(f,d){a("body").css({WebkitUserSelect:"none",KhtmlUserSelect:"none"})},stop:function(f,d){postboxes.save_order(c);d.item.parent().removeClass("temp-border");a("body").css({WebkitUserSelect:"",KhtmlUserSelect:""})}})},save_state:function(d){var b=a(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),c=a(".postbox").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(ajaxurl,{action:"closed-postboxes",closed:b,hidden:c,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:d})},save_order:function(c){var b,d=a(".columns-prefs input:checked").val()||0;b={action:"meta-box-order",_ajax_nonce:a("#meta-box-order-nonce").val(),page_columns:d,page:c};a(".meta-box-sortables").each(function(){b["order["+this.id.split("-")[0]+"]"]=a(this).sortable("toArray").join(",")});a.post(ajaxurl,b)},pbshow:false,pbhide:false}}(jQuery));
\ No newline at end of file
--- /dev/null
+function WPSetAsThumbnail(id){
+ var $link = jQuery('a#wp-post-thumbnail-' + id);
+
+ $link.text( setPostThumbnailL10n.saving );
+ jQuery.post(ajaxurl, {
+ action:"set-post-thumbnail", post_id: post_id, thumbnail_id: id, cookie: encodeURIComponent(document.cookie)
+ }, function(str){
+ var win = window.dialogArguments || opener || parent || top;
+ $link.text( setPostThumbnailL10n.setThumbnail );
+ if ( str == '0' ) {
+ alert( setPostThumbnailL10n.error );
+ } else {
+ jQuery('a.wp-post-thumbnail').show();
+ $link.text( setPostThumbnailL10n.done );
+ $link.fadeOut( 2000 );
+ win.WPSetThumbnailID(id);
+ win.WPSetThumbnailHTML(str);
+ }
+ }
+ );
+}
--- /dev/null
+function WPSetAsThumbnail(id){var $link=jQuery("a#wp-post-thumbnail-"+id);$link.text(setPostThumbnailL10n.saving);jQuery.post(ajaxurl,{action:"set-post-thumbnail",post_id:post_id,thumbnail_id:id,cookie:encodeURIComponent(document.cookie)},function(str){var win=window.dialogArguments||opener||parent||top;$link.text(setPostThumbnailL10n.setThumbnail);if(str=="0"){alert(setPostThumbnailL10n.error)}else{jQuery("a.wp-post-thumbnail").show();$link.text(setPostThumbnailL10n.done);$link.fadeOut(2000);win.WPSetThumbnailID(id);win.WPSetThumbnailHTML(str)}})};
\ No newline at end of file
+++ /dev/null
-function edit_permalink(post_id) {
- var i, c = 0, e = jQuery('#editable-post-name'), revert_e = e.html(), real_slug = jQuery('#post_name'), revert_slug = real_slug.html(), b = jQuery('#edit-slug-buttons'), revert_b = b.html(), full = jQuery('#editable-post-name-full').html();
-
- jQuery('#view-post-btn').hide();
- b.html('<a href="#" class="save button">'+slugL10n.save+'</a> <a class="cancel" href="#">'+slugL10n.cancel+'</a>');
- b.children('.save').click(function() {
- var new_slug = e.children('input').val();
- jQuery.post(slugL10n.requestFile, {
- action: 'sample-permalink',
- post_id: post_id,
- new_slug: new_slug,
- new_title: jQuery('#title').val(),
- samplepermalinknonce: jQuery('#samplepermalinknonce').val()}, function(data) {
- jQuery('#edit-slug-box').html(data);
- b.html(revert_b);
- real_slug.attr('value', new_slug);
- make_slugedit_clickable();
- jQuery('#view-post-btn').show();
- });
- return false;
- });
- jQuery('#edit-slug-buttons .cancel').click(function() {
- jQuery('#view-post-btn').show();
- e.html(revert_e);
- b.html(revert_b);
- real_slug.attr('value', revert_slug);
- return false;
- });
- for(i=0; i < full.length; ++i) {
- if ('%' == full.charAt(i)) c++;
- }
- slug_value = (c > full.length/4)? '' : full;
- e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children('input').keypress(function(e){
- var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
- // on enter, just save the new slug, don't save the post
- if (13 == key) {b.children('.save').click();return false;}
- if (27 == key) {b.children('.cancel').click();return false;}
- real_slug.attr('value', this.value)}).focus();
-}
-
-function make_slugedit_clickable() {
- jQuery('#editable-post-name').click(function() {jQuery('#edit-slug-buttons').children('.edit-slug').click()});
-}
-
+++ /dev/null
-function edit_permalink(a){var d,h=0,g=jQuery("#editable-post-name"),j=g.html(),m=jQuery("#post_name"),n=m.html(),k=jQuery("#edit-slug-buttons"),l=k.html(),f=jQuery("#editable-post-name-full").html();jQuery("#view-post-btn").hide();k.html('<a href="#" class="save button">'+slugL10n.save+'</a> <a class="cancel" href="#">'+slugL10n.cancel+"</a>");k.children(".save").click(function(){var b=g.children("input").val();jQuery.post(slugL10n.requestFile,{action:"sample-permalink",post_id:a,new_slug:b,new_title:jQuery("#title").val(),samplepermalinknonce:jQuery("#samplepermalinknonce").val()},function(c){jQuery("#edit-slug-box").html(c);k.html(l);m.attr("value",b);make_slugedit_clickable();jQuery("#view-post-btn").show()});return false});jQuery("#edit-slug-buttons .cancel").click(function(){jQuery("#view-post-btn").show();g.html(j);k.html(l);m.attr("value",n);return false});for(d=0;d<f.length;++d){if("%"==f.charAt(d)){h++}}slug_value=(h>f.length/4)?"":f;g.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children("input").keypress(function(c){var b=c.charCode?c.charCode:c.keyCode?c.keyCode:0;if(13==b){k.children(".save").click();return false}if(27==b){k.children(".cancel").click();return false}m.attr("value",this.value)}).focus()}function make_slugedit_clickable(){jQuery("#editable-post-name").click(function(){jQuery("#edit-slug-buttons").children(".edit-slug").click()})};
\ No newline at end of file
jQuery(document).ready(function($) {
- var options = false, addAfter, addAfter2, delBefore, delAfter;
-
- addAfter = function( r, settings ) {
- var name = $("<span>" + $('name', r).text() + "</span>").html(), id = $('tag', r).attr('id');
- options[options.length] = new Option(name, id);
- }
-
- addAfter2 = function( x, r ) {
- var t = $(r.parsed.responses[0].data);
- if ( t.length == 1 )
- inlineEditTax.addEvents($(t.id));
- }
-
- delAfter = function( r, settings ) {
- var id = $('tag', r).attr('id'), o;
- for ( o = 0; o < options.length; o++ )
- if ( id == options[o].value )
- options[o] = null;
- }
-
- delBefore = function(s) {
- s.data.taxonomy = $('input[name="taxonomy"]').val();
+ $('.delete-tag').live('click', function(e){
+ var t = $(this), tr = t.parents('tr'), r = true, data;
if ( 'undefined' != showNotice )
- return showNotice.warn() ? s : false;
-
- return s;
- }
-
- if ( options )
- $('#the-list').wpList( { addAfter: addAfter, delBefore: delBefore, delAfter: delAfter } );
- else
- $('#the-list').wpList({ addAfter: addAfter2, delBefore: delBefore });
-
- $('.delete a[class^="delete"]').click(function(){return false;});
-});
\ No newline at end of file
+ r = showNotice.warn();
+ if ( r ) {
+ data = t.attr('href').replace(/[^?]*\?/, '').replace(/action=delete/, 'action=delete-tag');
+ $.post(ajaxurl, data, function(r){
+ if ( '1' == r ) {
+ $('#ajax-response').empty();
+ tr.fadeOut('normal', function(){ tr.remove(); });
+ } else if ( '-1' == r ) {
+ $('#ajax-response').empty().append('<div class="error"><p>' + tagsl10n.noPerm + '</p></div>');
+ tr.children().css('backgroundColor', '');
+ } else {
+ $('#ajax-response').empty().append('<div class="error"><p>' + tagsl10n.broken + '</p></div>');
+ tr.children().css('backgroundColor', '');
+ }
+ });
+ tr.children().css('backgroundColor', '#f33');
+ }
+ return false;
+ });
+
+ $('#submit').click(function(){
+ var form = $(this).parents('form');
+
+ if ( !validateForm( form ) )
+ return false;
+
+ $.post(ajaxurl, $('#addtag').serialize(), function(r){
+ if ( r.indexOf('<div class="error"') === 0 ) {
+ $('#ajax-response').append(r);
+ } else {
+ $('#ajax-response').empty();
+ $('#the-list').prepend(r);
+ $('input[type="text"]:visible, textarea:visible', form).val('');
+ }
+ });
+
+ return false;
+ });
+
+});
-jQuery(document).ready(function(d){var b=false,f,e,c,a;f=function(i,h){var g=d("<span>"+d("name",i).text()+"</span>").html(),j=d("tag",i).attr("id");b[b.length]=new Option(g,j)};e=function(g,i){var h=d(i.parsed.responses[0].data);if(h.length==1){inlineEditTax.addEvents(d(h.id))}};a=function(h,g){var j=d("tag",h).attr("id"),i;for(i=0;i<b.length;i++){if(j==b[i].value){b[i]=null}}};c=function(g){g.data.taxonomy=d('input[name="taxonomy"]').val();if("undefined"!=showNotice){return showNotice.warn()?g:false}return g};if(b){d("#the-list").wpList({addAfter:f,delBefore:c,delAfter:a})}else{d("#the-list").wpList({addAfter:e,delBefore:c})}d('.delete a[class^="delete"]').click(function(){return false})});
\ No newline at end of file
+jQuery(document).ready(function(a){a(".delete-tag").live("click",function(g){var b=a(this),f=b.parents("tr"),c=true,d;if("undefined"!=showNotice){c=showNotice.warn()}if(c){d=b.attr("href").replace(/[^?]*\?/,"").replace(/action=delete/,"action=delete-tag");a.post(ajaxurl,d,function(e){if("1"==e){a("#ajax-response").empty();f.fadeOut("normal",function(){f.remove()})}else{if("-1"==e){a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.noPerm+"</p></div>");f.children().css("backgroundColor","")}else{a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.broken+"</p></div>");f.children().css("backgroundColor","")}}});f.children().css("backgroundColor","#f33")}return false});a("#submit").click(function(){var b=a(this).parents("form");if(!validateForm(b)){return false}a.post(ajaxurl,a("#addtag").serialize(),function(c){if(c.indexOf('<div class="error"')===0){a("#ajax-response").append(c)}else{a("#ajax-response").empty();a("#the-list").prepend(c);a('input[type="text"]:visible, textarea:visible',b).val("")}});return false})});
\ No newline at end of file
-
var wpWidgets;
(function($) {
wpWidgets = {
- init : function() {
- var rem;
- if ( $('body').hasClass('widgets_access') ) {
- return;
- }
+ init : function() {
+ var rem, sidebars = $('div.widgets-sortables');
- $('#widgets-right div.sidebar-name').click(function(){
- var c = $(this).siblings('.widgets-sortables');
- if ( c.is(':visible') ) {
+ $('#widgets-right').children('.widgets-holder-wrap').children('.sidebar-name').click(function(){
+ var c = $(this).siblings('.widgets-sortables'), p = $(this).parent();
+ if ( !p.hasClass('closed') ) {
c.sortable('disable');
- $(this).parent().addClass('closed');
+ p.addClass('closed');
} else {
- $(this).parent().removeClass('closed');
+ p.removeClass('closed');
c.sortable('enable').sortable('refresh');
}
- });
+ });
+
+ $('#widgets-left').children('.widgets-holder-wrap').children('.sidebar-name').click(function() {
+ $(this).siblings('.widget-holder').parent().toggleClass('closed');
+ });
+
+ sidebars.not('#wp_inactive_widgets').each(function(){
+ var h = 50, H = $(this).children('.widget').length;
+ h = h + parseInt(H * 48, 10);
+ $(this).css( 'minHeight', h + 'px' );
+ });
- $('#widgets-left div.sidebar-name').click(function(){
- if ( $(this).siblings('.widget-holder').is(':visible') ) {
- $(this).parent().addClass('closed');
+ $('a.widget-action').live('click', function(){
+ var css = {}, widget = $(this).closest('div.widget'), inside = widget.children('.widget-inside'), w = parseInt( widget.find('input.widget-width').val(), 10 );
+
+ if ( inside.is(':hidden') ) {
+ if ( w > 250 && inside.closest('div.widgets-sortables').length ) {
+ css['width'] = w + 30 + 'px';
+ if ( inside.closest('div.widget-liquid-right').length )
+ css['marginLeft'] = 235 - w + 'px';
+ widget.css(css);
+ }
+ wpWidgets.fixLabels(widget);
+ inside.slideDown('fast');
} else {
- $(this).parent().removeClass('closed');
+ inside.slideUp('fast', function() {
+ widget.css({'width':'','marginLeft':''});
+ });
}
- });
+ return false;
+ });
- $('#widgets-right .widget, #wp_inactive_widgets .widget').each(function(){
- wpWidgets.appendTitle(this);
+ $('input.widget-control-save').live('click', function(){
+ wpWidgets.save( $(this).closest('div.widget'), 0, 1, 0 );
+ return false;
});
- this.addEvents();
- $('.widget-error').parents('.widget').find('a.widget-action').click();
+ $('a.widget-control-remove').live('click', function(){
+ wpWidgets.save( $(this).closest('div.widget'), 1, 1, 0 );
+ return false;
+ });
- $('#available-widgets').droppable({
- tolerance: 'pointer',
- accept: function(o){
- return $(o).parent().attr('id') != 'widget-list';
- },
- drop: function(e,ui) {
- ui.draggable.addClass('deleting');
- $('#removing-widget').hide().children('span').html('');
- },
- over: function(e,ui) {
- ui.draggable.addClass('deleting');
- $('.widget-placeholder').hide();
+ $('a.widget-control-close').live('click', function(){
+ wpWidgets.close( $(this).closest('div.widget') );
+ return false;
+ });
- if ( ui.draggable.hasClass('ui-sortable-helper') )
- $('#removing-widget').show().children('span').html( ui.draggable.find('.widget-title h4').html() );
- },
- out: function(e,ui) {
- ui.draggable.removeClass('deleting');
- $('.widget-placeholder').show();
- $('#removing-widget').hide().children('span').html('');
- }
+ sidebars.children('.widget').each(function() {
+ wpWidgets.appendTitle(this);
+ if ( $('p.widget-error', this).length )
+ $('a.widget-action', this).click();
});
- $('#widget-list .widget').draggable({
- connectToSortable: '.widgets-sortables',
- handle: '.widget-title',
+ $('#widget-list').children('.widget').draggable({
+ connectToSortable: 'div.widgets-sortables',
+ handle: '> .widget-top > .widget-title',
distance: 2,
helper: 'clone',
zIndex: 5,
containment: 'document',
start: function(e,ui) {
wpWidgets.fixWebkit(1);
- ui.helper.find('.widget-description').hide();
+ ui.helper.find('div.widget-description').hide();
},
stop: function(e,ui) {
if ( rem )
}
});
- $('.widgets-sortables').sortable({
+ sidebars.sortable({
placeholder: 'widget-placeholder',
- connectWith: '.widgets-sortables',
- items: '.widget',
- handle: '.widget-title',
+ items: '> .widget',
+ handle: '> .widget-top > .widget-title',
cursor: 'move',
distance: 2,
containment: 'document',
start: function(e,ui) {
wpWidgets.fixWebkit(1);
- ui.item.find('.widget-inside').hide();
+ ui.item.children('.widget-inside').hide();
ui.item.css({'marginLeft':'','width':''});
},
stop: function(e,ui) {
return;
}
- var add = ui.item.find('input.add_new').val(), n = ui.item.find('input.multi_number').val(), id = ui.item.attr('id'), sb = $(this).attr('id');
+ var add = ui.item.find('input.add_new').val(),
+ n = ui.item.find('input.multi_number').val(),
+ id = ui.item.attr('id'),
+ sb = $(this).attr('id');
ui.item.css({'marginLeft':'','width':''});
wpWidgets.fixWebkit();
ui.item.attr( 'id', 'new-' + id );
rem = 'div#' + id;
}
- wpWidgets.addEvents(ui.item);
wpWidgets.save( ui.item, 0, 0, 1 );
ui.item.find('input.add_new').val('');
ui.item.find('a.widget-action').click();
if ( !$(this).is(':visible') )
$(this).sortable('cancel');
}
- }).not(':visible').sortable('disable');
- wpWidgets.resize();
- wpWidgets.fixLabels();
+ }).sortable('option', 'connectWith', 'div.widgets-sortables').parent().filter('.closed').children('.widgets-sortables').sortable('disable');
+
+ $('#available-widgets').droppable({
+ tolerance: 'pointer',
+ accept: function(o){
+ return $(o).parent().attr('id') != 'widget-list';
+ },
+ drop: function(e,ui) {
+ ui.draggable.addClass('deleting');
+ $('#removing-widget').hide().children('span').html('');
+ },
+ over: function(e,ui) {
+ ui.draggable.addClass('deleting');
+ $('div.widget-placeholder').hide();
+
+ if ( ui.draggable.hasClass('ui-sortable-helper') )
+ $('#removing-widget').show().children('span')
+ .html( ui.draggable.find('div.widget-title').children('h4').html() );
+ },
+ out: function(e,ui) {
+ ui.draggable.removeClass('deleting');
+ $('div.widget-placeholder').show();
+ $('#removing-widget').hide().children('span').html('');
+ }
+ });
},
saveOrder : function(sb) {
if ( sb )
- $('#' + sb).parents('.widgets-holder-wrap').find('.ajax-feedback').css('visibility', 'visible');
+ $('#' + sb).closest('div.widgets-holder-wrap').find('img.ajax-feedback').css('visibility', 'visible');
var a = {
action: 'widgets-order',
sidebars: []
};
- $('.widgets-sortables').each( function() {
+ $('div.widgets-sortables').each( function() {
a['sidebars[' + $(this).attr('id') + ']'] = $(this).sortable('toArray').join(',');
});
$.post( ajaxurl, a, function() {
- $('.ajax-feedback').css('visibility', 'hidden');
+ $('img.ajax-feedback').css('visibility', 'hidden');
});
+
this.resize();
},
save : function(widget, del, animate, order) {
- var sb = widget.parents('.widgets-sortables').attr('id'), data = widget.find('form').serialize(), a;
+ var sb = widget.closest('div.widgets-sortables').attr('id'), data = widget.find('form').serialize(), a;
widget = $(widget);
- widget.find('.ajax-feedback').css('visibility', 'visible');
+ $('.ajax-feedback', widget).css('visibility', 'visible');
a = {
action: 'save-widget',
var id;
if ( del ) {
- if ( !$('.widget_number', widget).val() ) {
- id = $('.widget-id', widget).val();
- $('#available-widgets .widget-id').each(function(){
+ if ( !$('input.widget_number', widget).val() ) {
+ id = $('input.widget-id', widget).val();
+ $('#available-widgets').find('input.widget-id').each(function(){
if ( $(this).val() == id )
- $(this).parents('.widget').show();
+ $(this).closest('div.widget').show();
});
}
} else {
$('.ajax-feedback').css('visibility', 'hidden');
if ( r && r.length > 2 ) {
- $('.widget-content', widget).html(r);
+ $('div.widget-content', widget).html(r);
wpWidgets.appendTitle(widget);
wpWidgets.fixLabels(widget);
}
},
appendTitle : function(widget) {
- $('input[type="text"]', widget).each(function(){
- var title;
- if ( this.id.indexOf('title') != -1 ) {
- title = $(this).val().replace(/<[^<>]+>/g, '').replace(/</g, '<').replace(/>/g, '>');
- if ( title )
- $('.widget-title .in-widget-title', widget).html(': ' + title);
- return false;
- }
- });
+ var title = $('input[id*="-title"]', widget);
+ if ( title = title.val() ) {
+ title = title.replace(/<[^<>]+>/g, '').replace(/</g, '<').replace(/>/g, '>');
+ $(widget).children('.widget-top').children('.widget-title').children()
+ .children('.in-widget-title').html(': ' + title);
+ }
},
resize : function() {
- $('.widgets-sortables').not('#wp_inactive_widgets').each(function(){
- var h = 50, H = $('.widget', this).length;
+ $('div.widgets-sortables').not('#wp_inactive_widgets').each(function(){
+ var h = 50, H = $(this).children('.widget').length;
h = h + parseInt(H * 48, 10);
$(this).css( 'minHeight', h + 'px' );
});
KhtmlUserSelect: n
});
},
-
- fixLabels : function(sc) {
- sc = sc || document;
- $('.widget-inside label', sc).each(function(){
+ fixLabels : function(widget) {
+ widget.children('.widget-inside').find('label').each(function(){
var f = $(this).attr('for');
-
if ( f && f == $('input', this).attr('id') )
$(this).removeAttr('for');
});
},
-
+
close : function(widget) {
- widget.find('.widget-inside').slideUp('fast', function(){
+ widget.children('.widget-inside').slideUp('fast', function(){
widget.css({'width':'','marginLeft':''});
});
- },
-
- addEvents : function(sc) {
- sc = sc || document;
- $('a.widget-action', sc).click(function(){
- var w = parseInt( $(this).parents('.widget').find('.widget-width').val(), 10 ), css = {}, inside = $(this).parents('.widget-top').siblings('.widget-inside');
- if ( inside.is(':hidden') ) {
- if ( w > 250 && inside.parents('.widgets-sortables').length ) {
- css['width'] = w + 30 + 'px';
- if ( inside.parents('.widget-liquid-right').length )
- css['marginLeft'] = 235 - w + 'px';
- inside.parents('.widget').css(css);
- }
- inside.slideDown('fast');
- } else {
- inside.slideUp('fast', function(){ inside.parents('.widget').css({'width':'','marginLeft':''}); });
- }
- return false;
- });
- $('.widget-control-save', sc).click(function(){
- wpWidgets.save( $(this).parents('.widget'), 0, 1, 0 );
- return false;
- });
- $('.widget-control-remove', sc).click(function(){
- wpWidgets.save( $(this).parents('.widget'), 1, 1, 0 );
- return false;
- });
- $('.widget-control-close', sc).click(function(){
- wpWidgets.close( $(this).parents('.widget') );
- return false;
- });
}
};
-$(document).ready(function(){wpWidgets.init();});
+
+$(document).ready(function($){ wpWidgets.init(); });
})(jQuery);
-var wpWidgets;(function(a){wpWidgets={init:function(){var b;if(a("body").hasClass("widgets_access")){return}a("#widgets-right div.sidebar-name").click(function(){var d=a(this).siblings(".widgets-sortables");if(d.is(":visible")){d.sortable("disable");a(this).parent().addClass("closed")}else{a(this).parent().removeClass("closed");d.sortable("enable").sortable("refresh")}});a("#widgets-left div.sidebar-name").click(function(){if(a(this).siblings(".widget-holder").is(":visible")){a(this).parent().addClass("closed")}else{a(this).parent().removeClass("closed")}});a("#widgets-right .widget, #wp_inactive_widgets .widget").each(function(){wpWidgets.appendTitle(this)});this.addEvents();a(".widget-error").parents(".widget").find("a.widget-action").click();a("#available-widgets").droppable({tolerance:"pointer",accept:function(c){return a(c).parent().attr("id")!="widget-list"},drop:function(d,c){c.draggable.addClass("deleting");a("#removing-widget").hide().children("span").html("")},over:function(d,c){c.draggable.addClass("deleting");a(".widget-placeholder").hide();if(c.draggable.hasClass("ui-sortable-helper")){a("#removing-widget").show().children("span").html(c.draggable.find(".widget-title h4").html())}},out:function(d,c){c.draggable.removeClass("deleting");a(".widget-placeholder").show();a("#removing-widget").hide().children("span").html("")}});a("#widget-list .widget").draggable({connectToSortable:".widgets-sortables",handle:".widget-title",distance:2,helper:"clone",zIndex:5,containment:"document",start:function(d,c){wpWidgets.fixWebkit(1);c.helper.find(".widget-description").hide()},stop:function(d,c){if(b){a(b).hide()}b="";wpWidgets.fixWebkit()}});a(".widgets-sortables").sortable({placeholder:"widget-placeholder",connectWith:".widgets-sortables",items:".widget",handle:".widget-title",cursor:"move",distance:2,containment:"document",start:function(d,c){wpWidgets.fixWebkit(1);c.item.find(".widget-inside").hide();c.item.css({marginLeft:"",width:""})},stop:function(f,c){if(c.item.hasClass("ui-draggable")){c.item.draggable("destroy")}if(c.item.hasClass("deleting")){wpWidgets.save(c.item,1,0,1);c.item.remove();return}var d=c.item.find("input.add_new").val(),i=c.item.find("input.multi_number").val(),h=c.item.attr("id"),g=a(this).attr("id");c.item.css({marginLeft:"",width:""});wpWidgets.fixWebkit();if(d){if("multi"==d){c.item.html(c.item.html().replace(/<[^<>]+>/g,function(e){return e.replace(/__i__|%i%/g,i)}));c.item.attr("id",h.replace(/__i__|%i%/g,i));i++;a("div#"+h).find("input.multi_number").val(i)}else{if("single"==d){c.item.attr("id","new-"+h);b="div#"+h}}wpWidgets.addEvents(c.item);wpWidgets.save(c.item,0,0,1);c.item.find("input.add_new").val("");c.item.find("a.widget-action").click();return}wpWidgets.saveOrder(g)},receive:function(d,c){if(!a(this).is(":visible")){a(this).sortable("cancel")}}}).not(":visible").sortable("disable");wpWidgets.resize();wpWidgets.fixLabels()},saveOrder:function(c){if(c){a("#"+c).parents(".widgets-holder-wrap").find(".ajax-feedback").css("visibility","visible")}var b={action:"widgets-order",savewidgets:a("#_wpnonce_widgets").val(),sidebars:[]};a(".widgets-sortables").each(function(){b["sidebars["+a(this).attr("id")+"]"]=a(this).sortable("toArray").join(",")});a.post(ajaxurl,b,function(){a(".ajax-feedback").css("visibility","hidden")});this.resize()},save:function(g,d,e,b){var h=g.parents(".widgets-sortables").attr("id"),f=g.find("form").serialize(),c;g=a(g);g.find(".ajax-feedback").css("visibility","visible");c={action:"save-widget",savewidgets:a("#_wpnonce_widgets").val(),sidebar:h};if(d){c.delete_widget=1}f+="&"+a.param(c);a.post(ajaxurl,f,function(i){var j;if(d){if(!a(".widget_number",g).val()){j=a(".widget-id",g).val();a("#available-widgets .widget-id").each(function(){if(a(this).val()==j){a(this).parents(".widget").show()}})}if(e){b=0;g.slideUp("fast",function(){a(this).remove();wpWidgets.saveOrder()})}else{g.remove();wpWidgets.resize()}}else{a(".ajax-feedback").css("visibility","hidden");if(i&&i.length>2){a(".widget-content",g).html(i);wpWidgets.appendTitle(g);wpWidgets.fixLabels(g)}}if(b){wpWidgets.saveOrder()}})},appendTitle:function(b){a('input[type="text"]',b).each(function(){var c;if(this.id.indexOf("title")!=-1){c=a(this).val().replace(/<[^<>]+>/g,"").replace(/</g,"<").replace(/>/g,">");if(c){a(".widget-title .in-widget-title",b).html(": "+c)}return false}})},resize:function(){a(".widgets-sortables").not("#wp_inactive_widgets").each(function(){var c=50,b=a(".widget",this).length;c=c+parseInt(b*48,10);a(this).css("minHeight",c+"px")})},fixWebkit:function(b){b=b?"none":"";a("body").css({WebkitUserSelect:b,KhtmlUserSelect:b})},fixLabels:function(b){b=b||document;a(".widget-inside label",b).each(function(){var c=a(this).attr("for");if(c&&c==a("input",this).attr("id")){a(this).removeAttr("for")}})},close:function(b){b.find(".widget-inside").slideUp("fast",function(){b.css({width:"",marginLeft:""})})},addEvents:function(b){b=b||document;a("a.widget-action",b).click(function(){var d=parseInt(a(this).parents(".widget").find(".widget-width").val(),10),e={},c=a(this).parents(".widget-top").siblings(".widget-inside");if(c.is(":hidden")){if(d>250&&c.parents(".widgets-sortables").length){e.width=d+30+"px";if(c.parents(".widget-liquid-right").length){e.marginLeft=235-d+"px"}c.parents(".widget").css(e)}c.slideDown("fast")}else{c.slideUp("fast",function(){c.parents(".widget").css({width:"",marginLeft:""})})}return false});a(".widget-control-save",b).click(function(){wpWidgets.save(a(this).parents(".widget"),0,1,0);return false});a(".widget-control-remove",b).click(function(){wpWidgets.save(a(this).parents(".widget"),1,1,0);return false});a(".widget-control-close",b).click(function(){wpWidgets.close(a(this).parents(".widget"));return false})}};a(document).ready(function(){wpWidgets.init()})})(jQuery);
\ No newline at end of file
+var wpWidgets;(function(a){wpWidgets={init:function(){var c,b=a("div.widgets-sortables");a("#widgets-right").children(".widgets-holder-wrap").children(".sidebar-name").click(function(){var e=a(this).siblings(".widgets-sortables"),d=a(this).parent();if(!d.hasClass("closed")){e.sortable("disable");d.addClass("closed")}else{d.removeClass("closed");e.sortable("enable").sortable("refresh")}});a("#widgets-left").children(".widgets-holder-wrap").children(".sidebar-name").click(function(){a(this).siblings(".widget-holder").parent().toggleClass("closed")});b.not("#wp_inactive_widgets").each(function(){var e=50,d=a(this).children(".widget").length;e=e+parseInt(d*48,10);a(this).css("minHeight",e+"px")});a("a.widget-action").live("click",function(){var f={},g=a(this).closest("div.widget"),d=g.children(".widget-inside"),e=parseInt(g.find("input.widget-width").val(),10);if(d.is(":hidden")){if(e>250&&d.closest("div.widgets-sortables").length){f.width=e+30+"px";if(d.closest("div.widget-liquid-right").length){f.marginLeft=235-e+"px"}g.css(f)}wpWidgets.fixLabels(g);d.slideDown("fast")}else{d.slideUp("fast",function(){g.css({width:"",marginLeft:""})})}return false});a("input.widget-control-save").live("click",function(){wpWidgets.save(a(this).closest("div.widget"),0,1,0);return false});a("a.widget-control-remove").live("click",function(){wpWidgets.save(a(this).closest("div.widget"),1,1,0);return false});a("a.widget-control-close").live("click",function(){wpWidgets.close(a(this).closest("div.widget"));return false});b.children(".widget").each(function(){wpWidgets.appendTitle(this);if(a("p.widget-error",this).length){a("a.widget-action",this).click()}});a("#widget-list").children(".widget").draggable({connectToSortable:"div.widgets-sortables",handle:"> .widget-top > .widget-title",distance:2,helper:"clone",zIndex:5,containment:"document",start:function(f,d){wpWidgets.fixWebkit(1);d.helper.find("div.widget-description").hide()},stop:function(f,d){if(c){a(c).hide()}c="";wpWidgets.fixWebkit()}});b.sortable({placeholder:"widget-placeholder",items:"> .widget",handle:"> .widget-top > .widget-title",cursor:"move",distance:2,containment:"document",start:function(f,d){wpWidgets.fixWebkit(1);d.item.children(".widget-inside").hide();d.item.css({marginLeft:"",width:""})},stop:function(g,d){if(d.item.hasClass("ui-draggable")){d.item.draggable("destroy")}if(d.item.hasClass("deleting")){wpWidgets.save(d.item,1,0,1);d.item.remove();return}var f=d.item.find("input.add_new").val(),j=d.item.find("input.multi_number").val(),i=d.item.attr("id"),h=a(this).attr("id");d.item.css({marginLeft:"",width:""});wpWidgets.fixWebkit();if(f){if("multi"==f){d.item.html(d.item.html().replace(/<[^<>]+>/g,function(e){return e.replace(/__i__|%i%/g,j)}));d.item.attr("id",i.replace(/__i__|%i%/g,j));j++;a("div#"+i).find("input.multi_number").val(j)}else{if("single"==f){d.item.attr("id","new-"+i);c="div#"+i}}wpWidgets.save(d.item,0,0,1);d.item.find("input.add_new").val("");d.item.find("a.widget-action").click();return}wpWidgets.saveOrder(h)},receive:function(f,d){if(!a(this).is(":visible")){a(this).sortable("cancel")}}}).sortable("option","connectWith","div.widgets-sortables").parent().filter(".closed").children(".widgets-sortables").sortable("disable");a("#available-widgets").droppable({tolerance:"pointer",accept:function(d){return a(d).parent().attr("id")!="widget-list"},drop:function(f,d){d.draggable.addClass("deleting");a("#removing-widget").hide().children("span").html("")},over:function(f,d){d.draggable.addClass("deleting");a("div.widget-placeholder").hide();if(d.draggable.hasClass("ui-sortable-helper")){a("#removing-widget").show().children("span").html(d.draggable.find("div.widget-title").children("h4").html())}},out:function(f,d){d.draggable.removeClass("deleting");a("div.widget-placeholder").show();a("#removing-widget").hide().children("span").html("")}})},saveOrder:function(c){if(c){a("#"+c).closest("div.widgets-holder-wrap").find("img.ajax-feedback").css("visibility","visible")}var b={action:"widgets-order",savewidgets:a("#_wpnonce_widgets").val(),sidebars:[]};a("div.widgets-sortables").each(function(){b["sidebars["+a(this).attr("id")+"]"]=a(this).sortable("toArray").join(",")});a.post(ajaxurl,b,function(){a("img.ajax-feedback").css("visibility","hidden")});this.resize()},save:function(g,d,e,b){var h=g.closest("div.widgets-sortables").attr("id"),f=g.find("form").serialize(),c;g=a(g);a(".ajax-feedback",g).css("visibility","visible");c={action:"save-widget",savewidgets:a("#_wpnonce_widgets").val(),sidebar:h};if(d){c.delete_widget=1}f+="&"+a.param(c);a.post(ajaxurl,f,function(i){var j;if(d){if(!a("input.widget_number",g).val()){j=a("input.widget-id",g).val();a("#available-widgets").find("input.widget-id").each(function(){if(a(this).val()==j){a(this).closest("div.widget").show()}})}if(e){b=0;g.slideUp("fast",function(){a(this).remove();wpWidgets.saveOrder()})}else{g.remove();wpWidgets.resize()}}else{a(".ajax-feedback").css("visibility","hidden");if(i&&i.length>2){a("div.widget-content",g).html(i);wpWidgets.appendTitle(g);wpWidgets.fixLabels(g)}}if(b){wpWidgets.saveOrder()}})},appendTitle:function(b){var c=a('input[id*="-title"]',b);if(c=c.val()){c=c.replace(/<[^<>]+>/g,"").replace(/</g,"<").replace(/>/g,">");a(b).children(".widget-top").children(".widget-title").children().children(".in-widget-title").html(": "+c)}},resize:function(){a("div.widgets-sortables").not("#wp_inactive_widgets").each(function(){var c=50,b=a(this).children(".widget").length;c=c+parseInt(b*48,10);a(this).css("minHeight",c+"px")})},fixWebkit:function(b){b=b?"none":"";a("body").css({WebkitUserSelect:b,KhtmlUserSelect:b})},fixLabels:function(b){b.children(".widget-inside").find("label").each(function(){var c=a(this).attr("for");if(c&&c==a("input",this).attr("id")){a(this).removeAttr("for")}})},close:function(b){b.children(".widget-inside").slideUp("fast",function(){b.css({width:"",marginLeft:""})})}};a(document).ready(function(b){wpWidgets.init()})})(jQuery);
\ No newline at end of file
},
storeName : function() {
- var name = window.location.protocol + window.location.host;
+ var name, host = window.location.host;
- name = name.replace(/[\/\\:*"?<>|;,]+/g, '_'); // gears beta doesn't allow certain chars in the store name
+ if ( host.match(/[^a-z0-9._-]/i) )
+ host = encodeURIComponent(host);
+
+ name = window.location.protocol + host;
+ name = name.replace(/[^a-z0-9._-]+/gi, '_');
name = 'wp_' + name.substring(0, 60); // max length of name is 64 chars
return name;
-var 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(3)},getPermission:function(){var a=true;if("undefined"!=typeof google&&google.gears){if(!google.gears.factory.hasPermission){a=google.gears.factory.getPermission("WordPress","images/logo.gif")}if(a){try{this.createStore()}catch(b){this.message()}}else{this.message(4)}}},storeName:function(){var a=window.location.protocol+window.location.host;a=a.replace(/[\/\\:*"?<>|;,]+/g,"_");a="wp_"+a.substring(0,60);return a},message:function(a){var d=this,g=d.I("gears-msg1"),f=d.I("gears-msg2"),e=d.I("gears-msg3"),c=d.I("gears-msg4"),b=d.I("gears-upd-number"),h=d.I("gears-wait");if(!g){return}if("undefined"!=typeof google&&google.gears){if(a&&a==4){g.style.display=f.style.display=e.style.display="none";c.style.display="block"}else{if(google.gears.factory.hasPermission){g.style.display=f.style.display=c.style.display="none";e.style.display="block";if("undefined"==typeof store){d.createStore()}store.oncomplete=function(){h.innerHTML=(" "+wpGearsL10n.updateCompleted)};store.onerror=function(){h.innerHTML=(" "+wpGearsL10n.error+" "+store.lastErrorMessage)};store.onprogress=function(i){if(b){b.innerHTML=(" "+i.filesComplete+" / "+i.filesTotal)}}}else{g.style.display=e.style.display=c.style.display="none";f.style.display="block"}}}},I:function(a){return document.getElementById(a)}};(function(){if("undefined"!=typeof google&&google.gears){return}var a=false;if("undefined"!=typeof GearsFactory){a=new GearsFactory()}else{try{a=new ActiveXObject("Gears.Factory");if(factory.getBuildInfo().indexOf("ie_mobile")!=-1){a.privateSetGlobalObject(this)}}catch(b){if(("undefined"!=typeof navigator.mimeTypes)&&navigator.mimeTypes["application/x-googlegears"]){a=document.createElement("object");a.style.display="none";a.width=0;a.height=0;a.type="application/x-googlegears";document.documentElement.appendChild(a)}}}if(!a){return}if("undefined"==typeof google){google={}}if(!google.gears){google.gears={factory:a}}})();
\ No newline at end of file
+var 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(3)},getPermission:function(){var a=true;if("undefined"!=typeof google&&google.gears){if(!google.gears.factory.hasPermission){a=google.gears.factory.getPermission("WordPress","images/logo.gif")}if(a){try{this.createStore()}catch(b){this.message()}}else{this.message(4)}}},storeName:function(){var a,b=window.location.host;if(b.match(/[^a-z0-9._-]/i)){b=encodeURIComponent(b)}a=window.location.protocol+b;a=a.replace(/[^a-z0-9._-]+/gi,"_");a="wp_"+a.substring(0,60);return a},message:function(a){var d=this,g=d.I("gears-msg1"),f=d.I("gears-msg2"),e=d.I("gears-msg3"),c=d.I("gears-msg4"),b=d.I("gears-upd-number"),h=d.I("gears-wait");if(!g){return}if("undefined"!=typeof google&&google.gears){if(a&&a==4){g.style.display=f.style.display=e.style.display="none";c.style.display="block"}else{if(google.gears.factory.hasPermission){g.style.display=f.style.display=c.style.display="none";e.style.display="block";if("undefined"==typeof store){d.createStore()}store.oncomplete=function(){h.innerHTML=(" "+wpGearsL10n.updateCompleted)};store.onerror=function(){h.innerHTML=(" "+wpGearsL10n.error+" "+store.lastErrorMessage)};store.onprogress=function(i){if(b){b.innerHTML=(" "+i.filesComplete+" / "+i.filesTotal)}}}else{g.style.display=e.style.display=c.style.display="none";f.style.display="block"}}}},I:function(a){return document.getElementById(a)}};(function(){if("undefined"!=typeof google&&google.gears){return}var a=false;if("undefined"!=typeof GearsFactory){a=new GearsFactory()}else{try{a=new ActiveXObject("Gears.Factory");if(factory.getBuildInfo().indexOf("ie_mobile")!=-1){a.privateSetGlobalObject(this)}}catch(b){if(("undefined"!=typeof navigator.mimeTypes)&&navigator.mimeTypes["application/x-googlegears"]){a=document.createElement("object");a.style.display="none";a.width=0;a.height=0;a.type="application/x-googlegears";document.documentElement.appendChild(a)}}}if(!a){return}if("undefined"==typeof google){google={}}if(!google.gears){google.gears={factory:a}}})();
\ No newline at end of file
wp_die( __('You do not have sufficient permissions to edit the links for this blog.') );
if ( 'delete' == $doaction ) {
- foreach ( (array) $_GET['linkcheck'] as $link_id ) {
+ $bulklinks = (array) $_GET['linkcheck'];
+ foreach ( $bulklinks as $link_id ) {
$link_id = (int) $link_id;
wp_delete_link($link_id);
}
- wp_redirect( wp_get_referer() );
+ wp_safe_redirect( wp_get_referer() );
exit;
}
} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
<div class="wrap nosubsub">
<?php screen_icon(); ?>
-<h2><?php echo esc_html( $title );
+<h2><?php echo esc_html( $title ); ?> <a href="link-add.php" class="button add-new-h2"><?php esc_html_e('Add New'); ?></a> <?php
if ( isset($_GET['s']) && $_GET['s'] )
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( stripslashes($_GET['s']) ) ); ?>
</h2>
header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
header("Cache-Control: public, max-age=$expires_offset");
-if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') ) {
+if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
header('Vary: Accept-Encoding'); // Handle proxies
if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
header('Content-Encoding: deflate');
header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
header("Cache-Control: public, max-age=$expires_offset");
-if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') ) {
+if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
header('Vary: Accept-Encoding'); // Handle proxies
if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
header('Content-Encoding: deflate');
--- /dev/null
+<?php
+
+define('WP_REPAIRING', true);
+
+require_once('../../wp-load.php');
+
+header( 'Content-Type: text/html; charset=utf-8' );
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title><?php _e('WordPress › Database Repair'); ?></title>
+ <?php wp_admin_css( 'install', true ); ?>
+</head>
+<body>
+<h1 id="logo"><img alt="WordPress" src="../images/wordpress-logo.png" /></h1>
+
+<?php
+
+if ( !defined('WP_ALLOW_REPAIR') ) {
+ _e("<p>To allow use of this page to automatically repair database problems, please add the following line to your wp-config.php file. Once this line is added to your config, reload this page.</p><code>define('WP_ALLOW_REPAIR', true);</code>");
+} elseif ( isset($_GET['repair']) ) {
+ $problems = array();
+ check_admin_referer('repair_db');
+
+ if ( 2 == $_GET['repair'] )
+ $optimize = true;
+ else
+ $optimize = false;
+
+ $okay = true;
+
+ // Loop over the WP tables, checking and repairing as needed.
+ foreach ($wpdb->tables as $table) {
+ if ( in_array($table, $wpdb->old_tables) )
+ continue;
+
+ $check = $wpdb->get_row("CHECK TABLE {$wpdb->prefix}$table");
+ if ( 'OK' == $check->Msg_text ) {
+ echo "<p>The {$wpdb->prefix}$table table is okay.";
+ } else {
+ echo "<p>The {$wpdb->prefix}$table table is not okay. It is reporting the following error: <code>$check->Msg_text</code>. WordPress will attempt to repair this table…";
+ $repair = $wpdb->get_row("REPAIR TABLE {$wpb->prefix}$table");
+ if ( 'OK' == $check->Msg_text ) {
+ echo "<br /> Sucessfully repaired the {$wpb->prefix}$table table.";
+ } else {
+ echo "<br /> Failed to repair the {$wpdb->prefix}$table table. Error: $check->Msg_text<br />";
+ $problems["{$wpdb->prefix}$table"] = $check->Msg_text;
+ $okay = false;
+ }
+ }
+ if ( $okay && $optimize ) {
+ $check = $wpdb->get_row("ANALYZE TABLE {$wpdb->prefix}$table");
+ if ( 'Table is already up to date' == $check->Msg_text ) {
+ echo "<br /> The {$wpb->prefix}$table table is already optimized.";
+ } else {
+ $check = $wpdb->get_row("OPTIMIZE TABLE {$wpdb->prefix}$table");
+ if ( 'OK' == $check->Msg_text || 'Table is already up to date' == $check->Msg_text )
+ echo "<br /> Sucessfully optimized the {$wpb->prefix}$table table.";
+ else
+ echo "<br /> Failed to optimize the {$wpdb->prefix}$table table. Error: $check->Msg_text";
+ }
+ }
+ echo '</p>';
+ }
+
+ if ( !empty($problems) ) {
+ printf(__('<p>Some database problems could not be repaired. Please copy-and-paste the following list of errors to the <a href="%s">WordPress support forums</a> to get additional assistance.</p>'), 'http://wordpress.org/support/forum/3');
+ $problem_output = array();
+ foreach ( $problems as $table => $problem )
+ $problem_output[] = "$table: $problem";
+ echo '<textarea name="errors" id="errors" rows="20" cols="60">' . format_to_edit(implode("\n", $problem_output)) . '</textarea>';
+ } else {
+ _e("<p>Repairs complete. Please remove the following line from wp-config.php to prevent this page from being used by unauthorized users.</p><code>define('WP_ALLOW_REPAIR', true);</code>");
+ }
+} else {
+ if ( isset($_GET['referrer']) && 'is_blog_installed' == $_GET['referrer'] )
+ _e('One or more database tables is unavailable. To allow WordPress to attempt to repair these tables, press the "Repair Database" button. Repairing can take awhile, so please be patient.');
+ else
+ _e('WordPress can automatically look for some common database problems and repair them. Repairing can take awhile, so please be patient.')
+?>
+ <p class="step"><a class="button" href="<?php echo wp_nonce_url('repair.php?repair=1', 'repair_db') ?>"><?php _e( 'Repair Database' ); ?></a></p>
+ <?php _e('WordPress can also attempt to optimize the database. This improves performance in some situations. Repairing and optimizing the database can take a long time and the database will be locked while optimizing.'); ?>
+ <p class="step"><a class="button" href="<?php echo wp_nonce_url('repair.php?repair=2', 'repair_db') ?>"><?php _e( 'Repair and Optimize Database' ); ?></a></p>
+<?php
+}
+?>
+</body>
+</html>
\ No newline at end of file
wp_enqueue_script('swfupload-all');
wp_enqueue_script('swfupload-handlers');
+wp_enqueue_script('image-edit');
+wp_enqueue_script('set-post-thumbnail' );
+wp_enqueue_style('imgareaselect');
@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
$att = get_post($att_id);
+ if ( empty($att->ID) ) wp_die( __('You attempted to edit an attachment that doesn’t exist. Perhaps it was deleted?') );
+ if ( $att->post_status == 'trash' ) wp_die( __('You can’t edit this attachment because it is in the Trash. Please move it out of the Trash and try again.') );
+
add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2);
wp_enqueue_script( 'wp-ajax-response' );
+ wp_enqueue_script('image-edit');
+ wp_enqueue_style('imgareaselect');
require( 'admin-header.php' );
if ( ( ('index.php' != $sub_item[2]) && file_exists(WP_PLUGIN_DIR . "/$sub_file") ) || ! empty($menu_hook) ) {
// If admin.php is the current page or if the parent exists as a file in the plugins or admin dir
-
+
$parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/$menu_file") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($menu_file);
if ( $parent_exists )
echo "<li$class><a href='{$item[2]}?page={$sub_item[2]}'$class$tabindex>{$sub_item[0]}</a></li>";
if ( current_user_can('edit_users') ) {
$_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php.
$submenu['users.php'][5] = array(__('Authors & Users'), 'edit_users', 'users.php');
- $submenu['users.php'][10] = array(__('Add New'), 'create_users', 'user-new.php');
+ $submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php');
$submenu['users.php'][15] = array(__('Your Profile'), 'read', 'profile.php');
} else {
$_wp_real_parent_file['users.php'] = 'profile.php';
$maxdeep = (int) apply_filters( 'thread_comments_depth_max', 10 );
$thread_comments_depth = '</label><select name="thread_comments_depth" id="thread_comments_depth">';
-for ( $i = 1; $i <= $maxdeep; $i++ ) {
+for ( $i = 2; $i <= $maxdeep; $i++ ) {
$thread_comments_depth .= "<option value='" . esc_attr($i) . "'";
if ( get_option('thread_comments_depth') == $i ) $thread_comments_depth .= " selected='selected'";
$thread_comments_depth .= ">$i</option>";
if ( 'oldest' == get_option('default_comments_page') ) $default_comments_page .= ' selected="selected"';
$default_comments_page .= '>' . __('first') . '</option></select>';
-printf( __('Break comments into pages with %1$s comments per page and the %2$s page displayed by default'), '</label><label for="comments_per_page"><input name="comments_per_page" type="text" id="comments_per_page" value="' . esc_attr(get_option('comments_per_page')) . '" class="small-text" />', $default_comments_page );
+printf( __('Break comments into pages with %1$s top level comments per page and the %2$s page displayed by default'), '</label><label for="comments_per_page"><input name="comments_per_page" type="text" id="comments_per_page" value="' . esc_attr(get_option('comments_per_page')) . '" class="small-text" />', $default_comments_page );
?></label>
<br />
<tr valign="top">
<th scope="row"><?php _e('Medium size') ?></th>
-<td><fieldset><legend class="screen-reader-text"><span><?php _e('Medium size') ?></span></legend>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e('Medium size'); ?></span></legend>
<label for="medium_size_w"><?php _e('Max Width'); ?></label>
<input name="medium_size_w" type="text" id="medium_size_w" value="<?php form_option('medium_size_w'); ?>" class="small-text" />
<label for="medium_size_h"><?php _e('Max Height'); ?></label>
<tr valign="top">
<th scope="row"><?php _e('Large size') ?></th>
-<td><fieldset><legend class="screen-reader-text"><span><?php _e('Large size') ?></span></legend>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e('Large size'); ?></span></legend>
<label for="large_size_w"><?php _e('Max Width'); ?></label>
<input name="large_size_w" type="text" id="large_size_w" value="<?php form_option('large_size_w'); ?>" class="small-text" />
<label for="large_size_h"><?php _e('Max Height'); ?></label>
<?php do_settings_fields('media', 'default'); ?>
</table>
+<h3><?php _e('Embeds') ?></h3>
+
+<table class="form-table">
+
+<tr valign="top">
+<th scope="row"><?php _e('Auto-embeds'); ?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e('Attempt to automatically embed all plain text URLs'); ?></span></legend>
+<label for="embed_autourls"><input name="embed_autourls" type="checkbox" id="embed_autourls" value="1" <?php checked( '1', get_option('embed_autourls') ); ?>/> <?php _e('Attempt to automatically embed all plain text URLs'); ?></label>
+</fieldset></td>
+</tr>
+
+<tr valign="top">
+<th scope="row"><?php _e('Maximum embed size') ?></th>
+<td>
+<label for="embed_size_w"><?php _e('Width'); ?></label>
+<input name="embed_size_w" type="text" id="embed_size_w" value="<?php form_option('embed_size_w'); ?>" class="small-text" />
+<label for="embed_size_h"><?php _e('Height'); ?></label>
+<input name="embed_size_h" type="text" id="embed_size_h" value="<?php form_option('embed_size_h'); ?>" class="small-text" />
+<?php if ( !empty($content_width) ) echo '<br />' . __("If the width value is left blank, embeds will default to the max width of your theme."); ?>
+</td>
+</tr>
+
+<?php do_settings_fields('media', 'embeds'); ?>
+</table>
+
<?php do_settings_sections('media'); ?>
<p class="submit">
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="upload_path"><?php _e('Store uploads in this folder'); ?></label></th>
-<td><input name="upload_path" type="text" id="upload_path" value="<?php echo esc_attr(str_replace(ABSPATH, '', get_option('upload_path'))); ?>" class="regular-text code" />
+<td><input name="upload_path" type="text" id="upload_path" value="<?php echo esc_attr(get_option('upload_path')); ?>" class="regular-text code" />
<span class="description"><?php _e('Default is <code>wp-content/uploads</code>'); ?></span>
</td>
</tr>
</label>
</th>
</tr>
-<tr>
</table>
</p>
</form>
<?php if ($iis7_permalinks) :
- if ( isset($_POST['submit']) && $permalink_structure && ! $usingpi && ! $writable ) : ?>
+ if ( isset($_POST['submit']) && $permalink_structure && ! $usingpi && ! $writable ) :
+ if ( file_exists($home_path . 'web.config') ) : ?>
<p><?php _e('If your <code>web.config</code> file were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn’t so this is the url rewrite rule you should have in your <code>web.config</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this rule inside of the <code>/<configuration>/<system.webServer>/<rewrite>/<rules></code> element in <code>web.config</code> file.') ?></p>
<form action="options-permalink.php" method="post">
<?php wp_nonce_field('update-permalink') ?>
- <p><textarea rows="10" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_html($wp_rewrite->iis7_url_rewrite_rules()); ?></textarea></p>
+ <p><textarea rows="9" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_html($wp_rewrite->iis7_url_rewrite_rules()); ?></textarea></p>
</form>
<p><?php _e('If you temporarily make your <code>web.config</code> file writable for us to generate rewrite rules automatically, do not forget to revert the permissions after rule has been saved.') ?></p>
+ <?php else : ?>
+<p><?php _e('If the root directory of your site were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn’t so this is the url rewrite rule you should have in your <code>web.config</code> file. Create a new file, called <code>web.config</code> in the root directory of your site. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this code into the <code>web.config</code> file.') ?></p>
+<form action="options-permalink.php" method="post">
+<?php wp_nonce_field('update-permalink') ?>
+ <p><textarea rows="18" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_html($wp_rewrite->iis7_url_rewrite_rules(true)); ?></textarea></p>
+</form>
+<p><?php _e('If you temporarily make your site’s root directory writable for us to generate the <code>web.config</code> file automatically, do not forget to revert the permissions after the file has been created.') ?></p>
+ <?php endif; ?>
<?php endif; ?>
<?php else :
if ( $permalink_structure && ! $usingpi && ! $writable ) : ?>
<th scope="row"><?php _e('Blog Visibility') ?> </th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Blog Visibility') ?> </span></legend>
<p><input id="blog-public" type="radio" name="blog_public" value="1" <?php checked('1', get_option('blog_public')); ?> />
-<label for="blog-public"><?php _e('I would like my blog to be visible to everyone, including search engines (like Google, Sphere, Technorati) and archivers');?></label></p>
+<label for="blog-public"><?php _e('I would like my blog to be visible to everyone, including search engines (like Google, Bing, Technorati) and archivers');?></label></p>
<p><input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> />
<label for="blog-norobots"><?php _e('I would like to block search engines, but allow normal visitors'); ?></label></p>
<?php do_action('blog_privacy_selector'); ?>
<tr valign="top">
<th scope="row"><label for="blog_charset"><?php _e('Encoding for pages and feeds') ?></label></th>
<td><input name="blog_charset" type="text" id="blog_charset" value="<?php form_option('blog_charset'); ?>" class="regular-text" />
-<span class="description"><?php _e('The character encoding you write your blog in (UTF-8 is <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></span></td>
+<span class="description"><?php _e('The <a href="http://codex.wordpress.org/Glossary#Character_set">character encoding</a> of your blog (UTF-8 is recommended, if you are adventurous there are some <a href="http://en.wikipedia.org/wiki/Character_set">other encodings</a>)') ?></span></td>
</tr>
<?php do_settings_fields('reading', 'default'); ?>
</table>
'general' => array( 'blogname', 'blogdescription', 'admin_email', 'users_can_register', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'default_role', 'timezone_string' ),
'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ),
'misc' => array( 'use_linksupdate', 'uploads_use_yearmonth_folders', 'upload_path', 'upload_url_path' ),
- 'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ),
+ 'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type', 'embed_autourls', 'embed_size_w', 'embed_size_h' ),
'privacy' => array( 'blog_public' ),
'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts' ),
'writing' => array( 'default_post_edit_rows', 'use_smilies', 'ping_sites', 'mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'enable_app', 'enable_xmlrpc' ),
<?php
+include('admin-footer.php');
break;
} // end switch
-include('admin-footer.php');
?>
$parent_file = 'edit-pages.php';
$editing = true;
wp_enqueue_script('autosave');
-wp_enqueue_script('page');
+wp_enqueue_script('post');
if ( user_can_richedit() )
wp_enqueue_script('editor');
add_thickbox();
}
$referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer());
- if ( 'post' == $_POST['originalaction'] && !empty($_POST['mode']) && 'bookmarklet' == $_POST['mode'] ) {
- $location = $_POST['referredby'];
- } elseif ( 'post' == $_POST['originalaction'] && !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
+ if ( 'post' == $_POST['originalaction'] && !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
$location = 'sidebar.php?a=b';
- } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) {
+ } elseif ( isset($_POST['save']) || isset($_POST['publish']) ) {
+ $status = get_post_status( $page_ID );
+
if ( isset( $_POST['publish'] ) ) {
- if ( 'pending' == get_post_status( $page_ID ) )
- $location = add_query_arg( 'message', 6, get_edit_post_link( $page_ID, 'url' ) );
- else
- $location = add_query_arg( 'message', 5, get_edit_post_link( $page_ID, 'url' ) );
+ switch ( $status ) {
+ case 'pending':
+ $message = 6;
+ break;
+ case 'future':
+ $message = 7;
+ break;
+ default:
+ $message = 4;
+ }
} else {
- $location = add_query_arg( 'message', 1, get_edit_post_link( $page_ID, 'url' ) );
+ $message = 'draft' == $status ? 8 : 1;
}
+
+ $location = add_query_arg( 'message', $message, get_edit_post_link( $page_ID, 'url' ) );
} elseif ( isset($_POST['addmeta']) ) {
$location = add_query_arg( 'message', 2, wp_get_referer() );
$location = explode('#', $location);
$location = add_query_arg( 'message', 3, wp_get_referer() );
$location = explode('#', $location);
$location = $location[0] . '#postcustom';
- } elseif ($action == 'editattachment') {
- $location = 'attachments.php';
} else {
$location = add_query_arg( 'message', 1, get_edit_post_link( $page_ID, 'url' ) );
}
- wp_redirect($location);
+ wp_redirect( apply_filters( 'redirect_page_location', $location, $page_ID ) );
}
if (isset($_POST['deletepost']))
elseif ( isset($_POST['wp-preview']) && 'dopreview' == $_POST['wp-preview'] )
$action = 'preview';
+$sendback = wp_get_referer();
+if ( strpos($sendback, 'page.php') !== false || strpos($sendback, 'page-new.php') !== false )
+ $sendback = admin_url('edit-pages.php');
+else
+ $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), $sendback );
+
switch($action) {
case 'post':
check_admin_referer('add-page');
$page_ID = $post_ID = $p = (int) $_GET['post'];
$post = get_post_to_edit($page_ID);
- if ( empty($post->ID) ) wp_die( __('You attempted to edit a page that doesn’t exist. Perhaps it was deleted?') );
+ if ( empty($post->ID) )
+ wp_die( __('You attempted to edit a page that doesn’t exist. Perhaps it was deleted?') );
+
+ if ( !current_user_can('edit_page', $page_ID) )
+ wp_die( __('You are not allowed to edit this page.') );
+
+ if ( 'trash' == $post->post_status )
+ wp_die( __('You can’t edit this page because it is in the Trash. Please move it out of the Trash and try again.') );
if ( 'page' != $post->post_type ) {
wp_redirect( get_edit_post_link( $post_ID, 'url' ) );
exit();
}
- wp_enqueue_script('page');
+ wp_enqueue_script('post');
if ( user_can_richedit() )
wp_enqueue_script('editor');
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 ) ) {
- add_action('admin_notices', '_admin_notice_post_locked' );
- } else {
- wp_set_post_lock( $post->ID );
- wp_enqueue_script('autosave');
- }
+ if ( $last = wp_check_post_lock( $post->ID ) ) {
+ add_action('admin_notices', '_admin_notice_post_locked' );
+ } else {
+ wp_set_post_lock( $post->ID );
+ wp_enqueue_script('autosave');
}
- if ( !current_user_can('edit_page', $page_ID) )
- die ( __('You are not allowed to edit this page.') );
-
include('edit-page-form.php');
break;
exit();
break;
+case 'trash':
+ $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']);
+ check_admin_referer('trash-page_' . $post_id);
+
+ $post = & get_post($post_id);
+
+ if ( !current_user_can('delete_page', $post_id) )
+ wp_die( __('You are not allowed to move this page to the trash.') );
+
+ if ( !wp_trash_post($post_id) )
+ wp_die( __('Error in moving to trash...') );
+
+ wp_redirect( add_query_arg( array('trashed' => 1, 'ids' => $post_id), $sendback ) );
+ exit();
+ break;
+
+case 'untrash':
+ $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']);
+ check_admin_referer('untrash-page_' . $post_id);
+
+ $post = & get_post($post_id);
+
+ if ( !current_user_can('delete_page', $post_id) )
+ wp_die( __('You are not allowed to move this page out of the trash.') );
+
+ if ( !wp_untrash_post($post_id) )
+ wp_die( __('Error in restoring from trash...') );
+
+ wp_redirect( add_query_arg('untrashed', 1, $sendback) );
+ exit();
+ break;
+
case 'delete':
- $page_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']);
+ $page_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']);
check_admin_referer('delete-page_' . $page_id);
$page = & get_post($page_id);
wp_die( __('Error in deleting...') );
}
- $sendback = wp_get_referer();
- if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('edit-pages.php?deleted=1');
- elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
- else $sendback = add_query_arg('deleted', 1, $sendback);
- wp_redirect($sendback);
+ wp_redirect( add_query_arg('deleted', 1, $sendback) );
exit();
break;
/** WordPress Administration Bootstrap */
require_once('admin.php');
+if ( !current_user_can('edit_plugins') )
+ wp_die('<p>'.__('You do not have sufficient permissions to edit plugins for this blog.').'</p>');
+
$title = __("Edit Plugins");
$parent_file = 'plugins.php';
$plugins = get_plugins();
if ( isset($_REQUEST['file']) )
- $plugin = $_REQUEST['file'];
+ $plugin = stripslashes($_REQUEST['file']);
if ( empty($plugin) ) {
$plugin = array_keys($plugins);
if ( empty($file) )
$file = $plugin_files[0];
+else
+ $file = stripslashes($file);
$file = validate_file_to_edit($file, $plugin_files);
$real_file = WP_PLUGIN_DIR . '/' . $file;
+$scrollto = isset($_REQUEST['scrollto']) ? (int) $_REQUEST['scrollto'] : 0;
switch ( $action ) {
check_admin_referer('edit-plugin_' . $file);
- if ( !current_user_can('edit_plugins') )
- wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>');
-
$newcontent = stripslashes($_POST['newcontent']);
if ( is_writeable($real_file) ) {
$f = fopen($real_file, 'w+');
if ( is_plugin_active($file) || isset($_POST['phperror']) ) {
if ( is_plugin_active($file) )
deactivate_plugins($file, true);
- wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1"));
+ wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1&scrollto=$scrollto"));
exit;
}
- wp_redirect("plugin-editor.php?file=$file&a=te");
+ wp_redirect("plugin-editor.php?file=$file&a=te&scrollto=$scrollto");
} else {
- wp_redirect("plugin-editor.php?file=$file");
+ wp_redirect("plugin-editor.php?file=$file&scrollto=$scrollto");
}
exit;
default:
- if ( !current_user_can('edit_plugins') )
- wp_die('<p>'.__('You do not have sufficient permissions to edit plugins for this blog.').'</p>');
-
if ( isset($_GET['liveupdate']) ) {
check_admin_referer('edit-plugin-test_' . $file);
if ( ! is_plugin_active($file) )
activate_plugin($file, "plugin-editor.php?file=$file&phperror=1"); // we'll override this later if the plugin can be included without fatal error
- wp_redirect("plugin-editor.php?file=$file&a=te");
+ wp_redirect("plugin-editor.php?file=$file&a=te&scrollto=$scrollto");
exit;
}
<input type="hidden" name="action" value="update" />
<input type="hidden" name="file" value="<?php echo esc_attr($file) ?>" />
<input type="hidden" name="plugin" value="<?php echo esc_attr($plugin) ?>" />
+ <input type="hidden" name="scrollto" id="scrollto" value="<?php echo $scrollto; ?>" />
</div>
<?php if ( !empty( $docs_select ) ) : ?>
<div id="documentation"><label for="docs-list"><?php _e('Documentation:') ?></label> <?php echo $docs_select ?> <input type="button" class="button" value="<?php esc_attr_e( 'Lookup' ) ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&locale=<?php echo urlencode( get_locale() ) ?>&version=<?php echo urlencode( $wp_version ) ?>&redirect=true'); }" /></div>
</form>
<br class="clear" />
</div>
+<script type="text/javascript">
+/* <![CDATA[ */
+jQuery(document).ready(function($){
+ $('#template').submit(function(){ $('#scrollto').val( $('#newcontent').scrollTop() ); });
+ $('#newcontent').scrollTop( $('#scrollto').val() );
+});
+/* ]]> */
+</script>
<?php
break;
}
if ( 'search' == $tab )
$tabs['search'] = __('Search Results');
$tabs['upload'] = __('Upload');
-$tabs['featured'] = __('Featured');
-$tabs['popular'] = __('Popular');
-$tabs['new'] = __('Newest');
-$tabs['updated'] = __('Recently Updated');
+$tabs['featured'] = _x('Featured','Plugin Installer');
+$tabs['popular'] = _x('Popular','Plugin Installer');
+$tabs['new'] = _x('Newest','Plugin Installer');
+$tabs['updated'] = _x('Recently Updated','Plugin Installer');
$nonmenu_tabs = array('plugin-information'); //Valid actions to perform which do not have a Menu item.
case 'activate-selected':
if ( ! current_user_can('activate_plugins') )
wp_die(__('You do not have sufficient permissions to activate plugins for this blog.'));
-
+
check_admin_referer('bulk-manage-plugins');
- $plugins = (array) $_POST['checked'];
+ $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
$plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); //Only activate plugins which are not already active.
if ( empty($plugins) ) {
wp_redirect("plugins.php?plugin_status=$status&paged=$page");
if ( is_wp_error($valid) )
wp_die($valid);
- error_reporting( E_ALL ^ E_NOTICE );
+ if ( defined('E_RECOVERABLE_ERROR') )
+ error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR);
+ else
+ error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING);
+
@ini_set('display_errors', true); //Ensure that Fatal errors are displayed.
include(WP_PLUGIN_DIR . '/' . $plugin);
do_action('activate_' . $plugin);
check_admin_referer('bulk-manage-plugins');
- $plugins = (array) $_POST['checked'];
+ $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
$plugins = array_filter($plugins, 'is_plugin_active'); //Do not deactivate plugins which are already deactivated.
if ( empty($plugins) ) {
wp_redirect("plugins.php?plugin_status=$status&paged=$page");
check_admin_referer('bulk-manage-plugins');
- $plugins = (array) $_REQUEST['checked']; //$_POST = from the plugin form; $_GET = from the FTP details screen.
+ //$_POST = from the plugin form; $_GET = from the FTP details screen.
+ $plugins = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
$plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); //Do not allow to delete Activated plugins.
if ( empty($plugins) ) {
wp_redirect("plugins.php?plugin_status=$status&paged=$page");
<div class="wrap">
<?php screen_icon(); ?>
-<h2><?php echo esc_html( $title ); ?></h2>
+<h2><?php echo esc_html( $title ); ?> <a href="plugin-install.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'plugin'); ?></a></h2>
<?php
//Paging.
$total_this_page = "total_{$status}_plugins";
$total_this_page = $$total_this_page;
-$plugins_per_page = get_user_option('plugins_per_page');
-if ( empty($plugins_per_page) )
+$plugins_per_page = (int) get_user_option( 'plugins_per_page', 0, false );
+if ( empty( $plugins_per_page ) || $plugins_per_page < 1 )
$plugins_per_page = 999;
-$plugins_per_page = apply_filters('plugins_per_page', $plugins_per_page);
+$plugins_per_page = apply_filters( 'plugins_per_page', $plugins_per_page );
$start = ($page - 1) * $plugins_per_page;
}
$referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer());
- if ( !empty($_POST['mode']) && 'bookmarklet' == $_POST['mode'] ) {
- $location = $_POST['referredby'];
- } elseif ( !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
+ if ( !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
if ( isset($_POST['saveasdraft']) )
$location = 'sidebar.php?a=c';
elseif ( isset($_POST['publish']) )
$location = 'sidebar.php?a=b';
- } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) {
+ } elseif ( isset($_POST['save']) || isset($_POST['publish']) ) {
+ $status = get_post_status( $post_ID );
+
if ( isset( $_POST['publish'] ) ) {
- if ( 'pending' == get_post_status( $post_ID ) )
- $location = add_query_arg( 'message', 8, get_edit_post_link( $post_ID, 'url' ) );
- else
- $location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) );
+ switch ( $status ) {
+ case 'pending':
+ $message = 8;
+ break;
+ case 'future':
+ $message = 9;
+ break;
+ default:
+ $message = 6;
+ }
} else {
- $location = add_query_arg( 'message', 1, get_edit_post_link( $post_ID, 'url' ) );
+ $message = 'draft' == $status ? 10 : 1;
}
- } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) {
+
+ $location = add_query_arg( 'message', $message, get_edit_post_link( $post_ID, 'url' ) );
+ } elseif ( isset($_POST['addmeta']) && $_POST['addmeta'] ) {
$location = add_query_arg( 'message', 2, wp_get_referer() );
$location = explode('#', $location);
$location = $location[0] . '#postcustom';
- } elseif (isset($_POST['deletemeta']) && $_POST['deletemeta']) {
+ } elseif ( isset($_POST['deletemeta']) && $_POST['deletemeta'] ) {
$location = add_query_arg( 'message', 3, wp_get_referer() );
$location = explode('#', $location);
$location = $location[0] . '#postcustom';
- } elseif ($action == 'editattachment') {
- $location = 'attachments.php';
} elseif ( 'post-quickpress-save-cont' == $_POST['action'] ) {
$location = "post.php?action=edit&post=$post_ID&message=7";
} else {
$location = add_query_arg( 'message', 4, get_edit_post_link( $post_ID, 'url' ) );
}
- wp_redirect( $location );
+ wp_redirect( apply_filters( 'redirect_post_location', $location, $post_ID ) );
}
if ( isset( $_POST['deletepost'] ) )
elseif ( isset($_POST['wp-preview']) && 'dopreview' == $_POST['wp-preview'] )
$action = 'preview';
+$sendback = wp_get_referer();
+if ( strpos($sendback, 'post.php') !== false || strpos($sendback, 'post-new.php') !== false )
+ $sendback = admin_url('edit.php');
+else
+ $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), $sendback );
+
switch($action) {
case 'postajaxpost':
case 'post':
$post_ID = $p = (int) $_GET['post'];
$post = get_post($post_ID);
- if ( empty($post->ID) ) wp_die( __('You attempted to edit a post that doesn’t exist. Perhaps it was deleted?') );
+ if ( empty($post->ID) )
+ wp_die( __('You attempted to edit a post that doesn’t exist. Perhaps it was deleted?') );
+
+ if ( !current_user_can('edit_post', $post_ID) )
+ wp_die( __('You are not allowed to edit this post.') );
+
+ if ( 'trash' == $post->post_status )
+ wp_die( __('You can’t edit this post because it is in the Trash. Please restore it and try again.') );
if ( 'post' != $post->post_type ) {
wp_redirect( get_edit_post_link( $post->ID, 'url' ) );
wp_enqueue_script( 'admin-comments' );
enqueue_comment_hotkeys_js();
- if ( current_user_can('edit_post', $post_ID) ) {
- if ( $last = wp_check_post_lock( $post->ID ) ) {
- add_action('admin_notices', '_admin_notice_post_locked' );
- } else {
- wp_set_post_lock( $post->ID );
- wp_enqueue_script('autosave');
- }
+ if ( $last = wp_check_post_lock( $post->ID ) ) {
+ add_action('admin_notices', '_admin_notice_post_locked' );
+ } else {
+ wp_set_post_lock( $post->ID );
+ wp_enqueue_script('autosave');
}
$title = __('Edit Post');
-
- if ( !current_user_can('edit_post', $post_ID) )
- die ( __('You are not allowed to edit this post.') );
-
$post = get_post_to_edit($post_ID);
include('edit-form-advanced.php');
exit();
break;
+case 'trash':
+ $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']);
+ check_admin_referer('trash-post_' . $post_id);
+
+ $post = & get_post($post_id);
+
+ if ( !current_user_can('delete_post', $post_id) )
+ wp_die( __('You are not allowed to move this post to the trash.') );
+
+ if ( ! wp_trash_post($post_id) )
+ wp_die( __('Error in moving to trash...') );
+
+ wp_redirect( add_query_arg( array('trashed' => 1, 'ids' => $post_id), $sendback ) );
+ exit();
+ break;
+
+case 'untrash':
+ $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']);
+ check_admin_referer('untrash-post_' . $post_id);
+
+ $post = & get_post($post_id);
+
+ if ( !current_user_can('delete_post', $post_id) )
+ wp_die( __('You are not allowed to move this post out of the trash.') );
+
+ if ( ! wp_untrash_post($post_id) )
+ wp_die( __('Error in restoring from trash...') );
+
+ wp_redirect( add_query_arg('untrashed', 1, $sendback) );
+ exit();
+ break;
+
case 'delete':
$post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']);
check_admin_referer('delete-post_' . $post_id);
if ( !current_user_can('delete_post', $post_id) )
wp_die( __('You are not allowed to delete this post.') );
+ $force = !EMPTY_TRASH_DAYS;
if ( $post->post_type == 'attachment' ) {
- if ( ! wp_delete_attachment($post_id) )
+ $force = ( $force || !MEDIA_TRASH );
+ if ( ! wp_delete_attachment($post_id, $force) )
wp_die( __('Error in deleting...') );
} else {
- if ( !wp_delete_post($post_id) )
+ if ( !wp_delete_post($post_id, $force) )
wp_die( __('Error in deleting...') );
}
- $sendback = wp_get_referer();
- if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('edit.php?deleted=1');
- elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
- else $sendback = add_query_arg('deleted', 1, $sendback);
- wp_redirect($sendback);
+ wp_redirect( add_query_arg('deleted', 1, $sendback) );
exit();
break;
function press_it() {
// define some basic variables
$quick['post_status'] = 'draft'; // set as draft first
- $quick['post_category'] = isset($_REQUEST['post_category']) ? $_REQUEST['post_category'] : null;
- $quick['tax_input'] = isset($_REQUEST['tax_input']) ? $_REQUEST['tax_input'] : '';
- $quick['post_title'] = isset($_REQUEST['title']) ? $_REQUEST['title'] : '';
- $quick['post_content'] = '';
+ $quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null;
+ $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null;
+ $quick['post_title'] = ( trim($_POST['title']) != '' ) ? $_POST['title'] : ' ';
+ $quick['post_content'] = isset($_POST['post_content']) ? $_POST['post_content'] : '';
// insert the post with nothing in it, to get an ID
$post_ID = wp_insert_post($quick, true);
- $content = isset($_REQUEST['content']) ? $_REQUEST['content'] : '';
+ if ( is_wp_error($post_ID) )
+ wp_die($post_ID);
+
+ $content = isset($_POST['content']) ? $_POST['content'] : '';
$upload = false;
- if( !empty($_REQUEST['photo_src']) && current_user_can('upload_files') )
- foreach( (array) $_REQUEST['photo_src'] as $key => $image)
+ if( !empty($_POST['photo_src']) && current_user_can('upload_files') ) {
+ foreach( (array) $_POST['photo_src'] as $key => $image) {
// see if files exist in content - we don't want to upload non-used selected files.
- if( strpos($_REQUEST['content'], $image) !== false ) {
- $desc = isset($_REQUEST['photo_description'][$key]) ? $_REQUEST['photo_description'][$key] : '';
+ if ( strpos($_POST['content'], htmlspecialchars($image)) !== false ) {
+ $desc = isset($_POST['photo_description'][$key]) ? $_POST['photo_description'][$key] : '';
$upload = media_sideload_image($image, $post_ID, $desc);
// Replace the POSTED content <img> with correct uploaded ones. Regex contains fix for Magic Quotes
- if( !is_wp_error($upload) ) $content = preg_replace('/<img ([^>]*)src=\\\?(\"|\')'.preg_quote($image, '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content);
+ if( !is_wp_error($upload) )
+ $content = preg_replace('/<img ([^>]*)src=\\\?(\"|\')'.preg_quote(htmlspecialchars($image), '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content);
}
-
+ }
+ }
// set the post_content and status
- $quick['post_status'] = isset($_REQUEST['publish']) ? 'publish' : 'draft';
+ $quick['post_status'] = isset($_POST['publish']) ? 'publish' : 'draft';
$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);
+ if ( is_wp_error($upload) ) {
wp_delete_post($post_ID);
+ wp_die($upload);
} else {
$quick['ID'] = $post_ID;
wp_update_post($quick);
}
// Set Variables
-$title = isset($_GET['t']) ? esc_html(aposfix(stripslashes($_GET['t']))) : '';
-$selection = isset($_GET['s']) ? trim( aposfix( stripslashes($_GET['s']) ) ) : '';
+$title = isset( $_GET['t'] ) ? trim( strip_tags( aposfix( stripslashes( $_GET['t'] ) ) ) ) : '';
+$selection = isset( $_GET['s'] ) ? trim( htmlspecialchars( html_entity_decode( aposfix( stripslashes( $_GET['s'] ) ) ) ) ) : '';
if ( ! empty($selection) ) {
$selection = preg_replace('/(\r?\n|\r)/', '</p><p>', $selection);
$selection = '<p>'.str_replace('<p></p>', '', $selection).'</p>';
}
+
$url = isset($_GET['u']) ? esc_url($_GET['u']) : '';
$image = isset($_GET['i']) ? $_GET['i'] : '';
if ( !empty($_REQUEST['ajax']) ) {
-switch ($_REQUEST['ajax']) {
- case 'video': ?>
- <script type="text/javascript" charset="utf-8">
- jQuery('.select').click(function() {
- append_editor(jQuery('#embed-code').val());
- jQuery('#extra_fields').hide();
- jQuery('#extra_fields').html('');
- });
- jQuery('.close').click(function() {
- jQuery('#extra_fields').hide();
- jQuery('#extra_fields').html('');
- });
- </script>
- <div class="postbox">
- <h2><label for="embed-code"><?php _e('Embed Code') ?></label></h2>
- <div class="inside">
- <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo format_to_edit($selection, true); ?></textarea>
- <p id="options"><a href="#" class="select button"><?php _e('Insert Video'); ?></a> <a href="#" class="close button"><?php _e('Cancel'); ?></a></p>
- </div>
- </div>
- <?php break;
-
- case 'photo_thickbox': ?>
- <script type="text/javascript" charset="utf-8">
- jQuery('.cancel').click(function() {
- tb_remove();
- });
- jQuery('.select').click(function() {
- image_selector();
- });
- </script>
- <h3 class="tb"><label for="this_photo_description"><?php _e('Description') ?></label></h3>
- <div class="titlediv">
- <div class="titlewrap">
- <input id="this_photo_description" name="photo_description" class="tbtitle text" onkeypress="if(event.keyCode==13) image_selector();" value="<?php echo esc_attr($title);?>"/>
- </div>
- </div>
-
- <p class="centered"><input type="hidden" name="this_photo" value="<?php echo esc_attr($image); ?>" id="this_photo" />
- <a href="#" class="select"><img src="<?php echo esc_url($image); ?>" alt="<?php echo esc_attr(__('Click to insert.')); ?>" title="<?php echo esc_attr(__('Click to insert.')); ?>" /></a></p>
-
- <p id="options"><a href="#" class="select button"><?php _e('Insert Image'); ?></a> <a href="#" class="cancel button"><?php _e('Cancel'); ?></a></p>
-
-
- <?php break;
+ switch ($_REQUEST['ajax']) {
+ case 'video': ?>
+ <script type="text/javascript" charset="utf-8">
+ /* <![CDATA[ */
+ jQuery('.select').click(function() {
+ append_editor(jQuery('#embed-code').val());
+ jQuery('#extra-fields').hide();
+ jQuery('#extra-fields').html('');
+ });
+ jQuery('.close').click(function() {
+ jQuery('#extra-fields').hide();
+ jQuery('#extra-fields').html('');
+ });
+ /* ]]> */
+ </script>
+ <div class="postbox">
+ <h2><label for="embed-code"><?php _e('Embed Code') ?></label></h2>
+ <div class="inside">
+ <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo wp_htmledit_pre( $selection ); ?></textarea>
+ <p id="options"><a href="#" class="select button"><?php _e('Insert Video'); ?></a> <a href="#" class="close button"><?php _e('Cancel'); ?></a></p>
+ </div>
+ </div>
+ <?php break;
- case 'photo_thickbox_url': ?>
- <script type="text/javascript" charset="utf-8">
- jQuery('.cancel').click(function() {
- tb_remove();
- });
-
- jQuery('.select').click(function() {
- image_selector();
- });
- </script>
- <h3 class="tb"><label for="this_photo"><?php _e('URL') ?></label></h3>
- <div class="titlediv">
- <div class="titlewrap">
- <input id="this_photo" name="this_photo" class="tbtitle text" onkeypress="if(event.keyCode==13) image_selector();" />
+ case 'photo_thickbox': ?>
+ <script type="text/javascript" charset="utf-8">
+ /* <![CDATA[ */
+ jQuery('.cancel').click(function() {
+ tb_remove();
+ });
+ jQuery('.select').click(function() {
+ image_selector();
+ });
+ /* ]]> */
+ </script>
+ <h3 class="tb"><label for="this_photo_description"><?php _e('Description') ?></label></h3>
+ <div class="titlediv">
+ <div class="titlewrap">
+ <input id="this_photo_description" name="photo_description" class="tbtitle text" onkeypress="if(event.keyCode==13) image_selector();" value="<?php echo esc_attr($title);?>"/>
+ </div>
</div>
- </div>
+ <p class="centered">
+ <input type="hidden" name="this_photo" value="<?php echo esc_attr($image); ?>" id="this_photo" />
+ <a href="#" class="select">
+ <img src="<?php echo esc_url($image); ?>" alt="<?php echo esc_attr(__('Click to insert.')); ?>" title="<?php echo esc_attr(__('Click to insert.')); ?>" />
+ </a>
+ </p>
+
+ <p id="options"><a href="#" class="select button"><?php _e('Insert Image'); ?></a> <a href="#" class="cancel button"><?php _e('Cancel'); ?></a></p>
+ <?php break;
+
+ case 'photo_thickbox_url': ?>
+ <script type="text/javascript" charset="utf-8">
+ /* <![CDATA[ */
+ jQuery('.cancel').click(function() {
+ tb_remove();
+ });
- <h3 class="tb"><label for="photo_description"><?php _e('Description') ?></label></h3>
- <div id="titlediv">
- <div class="titlewrap">
- <input id="this_photo_description" name="photo_description" class="tbtitle text" onkeypress="if(event.keyCode==13) image_selector();" value="<?php echo esc_attr($title);?>"/>
+ jQuery('.select').click(function() {
+ image_selector();
+ });
+ /* ]]> */
+ </script>
+ <h3 class="tb"><label for="this_photo"><?php _e('URL') ?></label></h3>
+ <div class="titlediv">
+ <div class="titlewrap">
+ <input id="this_photo" name="this_photo" class="tbtitle text" onkeypress="if(event.keyCode==13) image_selector();" />
+ </div>
+ </div>
+ <h3 class="tb"><label for="photo_description"><?php _e('Description') ?></label></h3>
+ <div id="titlediv">
+ <div class="titlewrap">
+ <input id="this_photo_description" name="photo_description" class="tbtitle text" onkeypress="if(event.keyCode==13) image_selector();" value="<?php echo esc_attr($title);?>"/>
+ </div>
</div>
- </div>
- <p id="options"><a href="#" class="select"><?php _e('Insert Image'); ?></a> | <a href="#" class="cancel"><?php _e('Cancel'); ?></a></p>
- <?php break;
+ <p id="options"><a href="#" class="select"><?php _e('Insert Image'); ?></a> | <a href="#" class="cancel"><?php _e('Cancel'); ?></a></p>
+ <?php break;
case 'photo_images':
/**
* Retrieve all image URLs from given URI.
* @return string
*/
function get_images_from_uri($uri) {
+ $uri = preg_replace('/\/#.+?$/','', $uri);
if( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') )
- return "'".$uri."'";
+ return "'" . esc_attr( html_entity_decode($uri) ) . "'";
$content = wp_remote_fopen($uri);
if ( false === $content )
return '';
$host = parse_url($uri);
- $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))[^<>\'\"]*(\2)([^>\/]*)\/*>/is';
+ $pattern = '/<img ([^>]*)src=(\"|\')([^<>\'\"]+)(\2)([^>]*)\/*>/i';
+ $content = str_replace(array("\n","\t","\r"), '', $content);
preg_match_all($pattern, $content, $matches);
if ( empty($matches[0]) )
return '';
$src = 'http://'.str_replace('//','/', $host['host'].'/'.$src);
else
$src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src);
- $sources[] = esc_url($src);
+ $sources[] = esc_attr($src);
}
return "'" . implode("','", $sources) . "'";
}
- $url = urldecode($url);
- $url = str_replace(' ', '%20', $url);
+ $url = wp_kses(urldecode($url), null);
echo 'new Array('.get_images_from_uri($url).')';
-
break;
case 'photo_js': ?>
// gather images and load some default JS
var last = null
var img, img_tag, aspect, w, h, skip, i, strtoappend = "";
+ if(photostorage == false) {
+ var my_src = eval(
+ jQuery.ajax({
+ type: "GET",
+ url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
+ cache : false,
+ async : false,
+ data: "ajax=photo_images&u=<?php echo urlencode($url); ?>",
+ dataType : "script"
+ }).responseText
+ );
+ if(my_src.length == 0) {
var my_src = eval(
jQuery.ajax({
- type: "GET",
- url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
+ type: "GET",
+ url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
cache : false,
async : false,
- data: "ajax=photo_images&u=<?php echo urlencode($url); ?>",
+ data: "ajax=photo_images&u=<?php echo urlencode($url); ?>",
dataType : "script"
}).responseText
);
if(my_src.length == 0) {
- var my_src = eval(
- jQuery.ajax({
- type: "GET",
- url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
- cache : false,
- async : false,
- data: "ajax=photo_images&u=<?php echo urlencode($url); ?>",
- dataType : "script"
- }).responseText
- );
- if(my_src.length == 0) {
- strtoappend = '<?php _e('Unable to retrieve images or no images on page.'); ?>';
- }
+ strtoappend = '<?php _e('Unable to retrieve images or no images on page.'); ?>';
}
-
+ }
+ }
for (i = 0; i < my_src.length; i++) {
img = new Image();
img.src = my_src[i];
desc = jQuery('#this_photo_description').val();
src = jQuery('#this_photo').val();
pick(src, desc);
- jQuery('#extra_fields').hide();
- jQuery('#extra_fields').html('');
+ jQuery('#extra-fields').hide();
+ jQuery('#extra-fields').html('');
return false;
}
-
- jQuery(document).ready(function() {
- jQuery('#extra_fields').html('<div class="postbox"><h2>Photo <small id="photo_directions">(<?php _e("click images to select") ?>)</small></h2><ul id="actions"><li><a href="#" id="photo_add_url" class="thickbox button"><?php _e("Add from URL") ?> +</a></li></ul><div class="inside"><div class="titlewrap"><div id="img_container"></div></div><p id="options"><a href="#" class="close button"><?php _e('Cancel'); ?></a><a href="#" class="refresh button"><?php _e('Refresh'); ?></a></p></div>');
- jQuery('.close').click(function() {
- jQuery('#extra_fields').hide();
- jQuery('#extra_fields').html('');
- });
- jQuery('.refresh').click(function() {
- show('photo');
- });
+ jQuery('#extra-fields').html('<div class="postbox"><h2>Add Photos <small id="photo_directions">(<?php _e("click images to select") ?>)</small></h2><ul class="actions"><li><a href="#" id="photo-add-url" class="thickbox button"><?php _e("Add from URL") ?> +</a></li></ul><div class="inside"><div class="titlewrap"><div id="img_container"></div></div><p id="options"><a href="#" class="close button"><?php _e('Cancel'); ?></a><a href="#" class="refresh button"><?php _e('Refresh'); ?></a></p></div>');
jQuery('#img_container').html(strtoappend);
- jQuery('#photo_add_url').attr('href', '?ajax=photo_thickbox_url&height=200&width=500');
- tb_init('#extra_fields .thickbox');
-
-
- });
<?php break;
}
die;
<?php
add_thickbox();
- wp_enqueue_style('press-this');
- wp_enqueue_style('press-this-ie');
+ wp_enqueue_style( 'press-this' );
+ wp_enqueue_style( 'press-this-ie');
wp_enqueue_style( 'colors' );
wp_enqueue_script( 'post' );
- wp_enqueue_script('editor');
+ wp_enqueue_script( 'editor' );
?>
<script type="text/javascript">
//<![CDATA[
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'};
-var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
+var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'press-this';
+var photostorage = false;
//]]>
</script>
do_action('admin_print_scripts');
do_action('admin_head');
- if ( user_can_richedit() ) {
- add_filter( 'teeny_mce_before_init', create_function( '$a', '$a["height"] = "400"; $a["onpageload"] = ""; $a["mode"] = "textareas"; $a["editor_selector"] = "mceEditor"; return $a;' ) );
- wp_tiny_mce( true );
- }
+ if ( user_can_richedit() )
+ wp_tiny_mce( true, array( 'height' => '370' ) );
?>
<script type="text/javascript">
function insert_plain_editor(text) {
}
function show(tab_name) {
- jQuery('#extra_fields').html('');
- jQuery('#extra_fields').show();
+ jQuery('#extra-fields').html('');
switch(tab_name) {
case 'video' :
- jQuery('#extra_fields').load('<?php echo esc_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s: '<?php echo esc_attr($selection); ?>'}, function() {
+ jQuery('#extra-fields').load('<?php echo esc_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s: '<?php echo esc_attr($selection); ?>'}, function() {
<?php
$content = '';
if ( preg_match("/youtube\.com\/watch/i", $url) ) {
?>
jQuery('#embed-code').prepend('<?php echo htmlentities($content); ?>');
});
+ jQuery('#extra-fields').show();
return false;
break;
case 'photo' :
- jQuery('#extra_fields').before('<p id="waiting"><img src="images/wpspin_light.gif" alt="" /> <?php echo esc_js( __( 'Loading...' ) ); ?></p>');
- jQuery.ajax({
- type: "GET",
- cache : false,
- url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
- data: "ajax=photo_js&u=<?php echo urlencode($url)?>",
- dataType : "script",
- success : function() {
- jQuery('#waiting').remove();
- }
- });
+ function setup_photo_actions() {
+ jQuery('.close').click(function() {
+ jQuery('#extra-fields').hide();
+ jQuery('#extra-fields').html('');
+ });
+ jQuery('.refresh').click(function() {
+ photostorage = false;
+ show('photo');
+ });
+ jQuery('#photo-add-url').attr('href', '?ajax=photo_thickbox_url&height=200&width=500');
+ tb_init('#extra-fields .thickbox');
+ jQuery('#waiting').hide();
+ jQuery('#extra-fields').show();
+ }
+ jQuery('#extra-fields').before('<div id="waiting"><img src="images/wpspin_light.gif" alt="" /> <?php echo esc_js( __( 'Loading...' ) ); ?></div>');
+
+ if(photostorage == false) {
+ jQuery.ajax({
+ type: "GET",
+ cache : false,
+ url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
+ data: "ajax=photo_js&u=<?php echo urlencode($url)?>",
+ dataType : "script",
+ success : function(data) {
+ eval(data);
+ photostorage = jQuery('#extra-fields').html();
+ setup_photo_actions();
+ }
+ });
+ } else {
+ jQuery('#extra-fields').html(photostorage);
+ setup_photo_actions();
+ }
return false;
break;
}
}
- jQuery(document).ready(function() {
+ jQuery(document).ready(function($) {
//resize screen
- window.resizeTo(720,570);
+ window.resizeTo(720,540);
// set button actions
jQuery('#photo_button').click(function() { show('photo'); return false; });
jQuery('#video_button').click(function() { show('video'); return false; });
<?php } ?>
jQuery('#title').unbind();
jQuery('#publish, #save').click(function() { jQuery('#saving').css('display', 'inline'); });
+
+ $('#tagsdiv-post_tag, #categorydiv').children('h3, .handlediv').click(function(){
+ $(this).siblings('.inside').toggle();
+ });
});
</script>
</head>
-<body class="press-this">
+<body class="press-this wp-admin">
<div id="wphead"></div>
<form action="press-this.php?action=post" method="post">
<div id="poststuff" class="metabox-holder">
<div id="side-info-column">
<div class="sleeve">
- <h1 id="viewsite"><a class="button" href="<?php echo get_option('home'); ?>/" target="_blank"><?php bloginfo('name'); ?> › <?php _e('Press This') ?></a></span></h1>
+ <h1 id="viewsite"><a href="<?php echo get_option('home'); ?>/" target="_blank"><?php bloginfo('name'); ?> › <?php _e('Press This') ?></a></span></h1>
<?php wp_nonce_field('press-this') ?>
<input type="hidden" name="post_type" id="post_type" value="text"/>
<div class="photolist"></div>
<div id="submitdiv" class="stuffbox">
+ <div class="handlediv" title="<?php _e( 'Click to toggle' ); ?>">
+ <br/>
+ </div>
<h3><?php _e('Publish') ?></h3>
<div class="inside">
<p>
</div>
<div id="categorydiv" class="stuffbox">
+ <div class="handlediv" title="<?php _e( 'Click to toggle' ); ?>">
+ <br/>
+ </div>
<h3><?php _e('Categories') ?></h3>
<div class="inside">
<div id="categories-all" class="tabs-panel">
+
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
<?php wp_category_checklist($post_ID, false) ?>
</ul>
</div>
<div id="tagsdiv-post_tag" class="stuffbox" >
+ <div class="handlediv" title="<?php _e( 'Click to toggle' ); ?>">
+ <br/>
+ </div>
<h3><span><?php _e('Post Tags'); ?></span></h3>
<div class="inside">
<div class="tagsdiv" id="post_tag">
<p class="jaxtag">
<label class="screen-reader-text" for="newtag"><?php _e('Post Tags'); ?></label>
<input type="hidden" name="tax_input[post_tag]" class="the-tags" id="tax-input[post_tag]" value="" />
- <span class="ajaxtag" style="display:none;">
- <input type="text" name="newtag[post_tag]" class="newtag form-input-tip" size="16" autocomplete="off" value="<?php esc_attr_e('Add new tag'); ?>" />
+ <div class="ajaxtag">
+ <input type="text" name="newtag[post_tag]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
<input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" tabindex="3" />
- </span>
+ </div>
</p>
<div class="tagchecklist"></div>
</div>
</div>
</div>
</div>
-
<div class="posting">
<?php if ( isset($posted) && intval($posted) ) { $post_ID = intval($posted); ?>
<div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_permalink( $post_ID); ?>"><?php _e('View post'); ?></a> | <a href="<?php echo get_edit_post_link( $post_ID ); ?>" onclick="window.opener.location.replace(this.href); window.close();"><?php _e('Edit post'); ?></a> | <a href="#" onclick="window.close();"><?php _e('Close Window'); ?></a></p></div>
</div>
</div>
- <div id="extra_fields" style="display: none"></div>
+ <div id="extra-fields" style="display: none"></div>
<div class="postdivrich">
- <ul id="actions">
+ <ul id="actions" class="actions">
<li id="photo_button">
Add: <?php if ( current_user_can('upload_files') ) { ?><a title="<?php _e('Insert an Image'); ?>" href="#">
</ul>
<div id="quicktags"></div>
<div class="editor-container">
- <textarea name="content" id="content" style="width:100%;" class="mceEditor" rows="15">
- <?php if ($selection) echo wp_richedit_pre(htmlspecialchars_decode($selection)); ?>
- <?php if ($url) { echo '<p>'; if($selection) _e('via '); echo "<a href='$url'>$title</a>."; echo '</p>'; } ?>
- </textarea>
+ <textarea name="content" id="content" style="width:100%;" class="theEditor" rows="15"><?php
+ if ( $selection )
+ echo wp_richedit_pre($selection);
+ if ( $url ) {
+ echo '<p>';
+ if ( $selection )
+ _e('via ');
+ printf( "<a href='%s'>%s</a>.</p>", esc_url( $url ), esc_html( $title ) );
+ }
+ ?></textarea>
</div>
</div>
</div>
-/* 0 - 200
-=================================== */
-td.available-theme {
- text-align: right;
-}
-#current-theme img {
- float: right;
- margin-right: 0;
- margin-left: 1em;
-}
-.quicktags, .search {
- font-family: Tahoma, "Times New Roman";
-}
-/* 200 - 500
-=================================== */
-#save-post {
- float: right;
-}
-.preview {
- float: left;
-}
-#sticky-span {
- margin-left: 0;
- margin-right: 18px;
-}
-#post-body .misc-pub-section {
- border-right-width: 0;
- border-left-width: 1;
- border-right-style: none;
- border-left-style: solid;
- float: right;
-}
-#post-body .misc-pub-section-last {
- border-left: 0;
-}
-#delete-action {
- text-align: right;
- float: right;
-}
-#publishing-action {
- text-align: left;
- float: left;
-}
-.side-info ul {
- padding-left: 0;
- padding-right: 18px;
-}
-.submit input,
-.button,
-.button-primary,
-.button-secondary,
-.button-highlighted,
-#postcustomstuff .submit input {
- font-family: Tahoma, "Times New Roman";
-}
-#wpcontent select {
- font-family: Tahoma, "Times New Roman";
-}
-#quicktags {
- background-position: right top;
-}
-/* 500 - 700
-=================================== */
-#template div {
- margin-right: 0;
- margin-left: 190px;
-}
-* html #template div {
- margin-left: 0;
-}
-#your-profile legend {
- font-family: "Times New Roman", Tahoma;
-}
-#ajax-response.alignleft {
- margin-left: 0;
- margin-right: 2em;
-}
-.page-numbers {
- margin-right: 0;
- margin-left: 1px;
-}
-.column-author img, .column-username img {
- float: right;
- margin-right: 0;
- margin-left: 10px;
-}
-.tablenav a.button-secondary {
- margin: 8px 0 0 8px;
-}
-.tablenav .tablenav-pages {
- float: left;
-}
-.tablenav .displaying-num {
- margin-right: 0;
- margin-left: 10px;
- font-family: Tahoma, "Times New Roman";
-}
-#postcustomstuff table input,
-#postcustomstuff table select,
-#postcustomstuff table textarea {
- margin: 8px 8px 8px 0;
-}
-/* 700 - 1000
-=================================== */
-#pass-strength-result {
- float: right;
- margin: 12px 1px 5px 5px;
-}
-/* Admin Header */
-#user_info {
- float: left;
-}
-#header-logo {
- float: right;
- margin: 7px 15px 0 0;
-}
-#wphead h1 {
- font-family: "Times New Roman", Tahoma;
- float: right;
-}
-#wphead h1.long-title {
- font-family: "Times New Roman", Tahoma;
-}
-#adminmenu .wp-submenu a {
- padding-left: 0;
- padding-right: 12px;
- border-width: 0 0 0 1px;
- border-style: none none none solid;
- font-family: Tahoma, "Times New Roman";
-}
-#adminmenu a.menu-top,
-#adminmenu .wp-submenu-head {
- font-family: Tahoma, "Times New Roman";
-}
-#adminmenu img.wp-menu-image {
- float: right;
-}
-.folded #adminmenu img.wp-menu-image {
- padding: 7px 6px 0 0;
-}
-#adminmenu a.separator {
- cursor: e-resize;
-}
-.folded #adminmenu a.separator {
- cursor: w-resize;
-}
-#adminmenu .wp-submenu .wp-submenu-head {
- padding: 6px 10px 6px 4px;
-}
-.folded #adminmenu .wp-submenu {
- margin: -1px 28px 0 0;
-}
-.folded #adminmenu .wp-submenu a {
- padding-left: 0;
- padding-right: 10px;
-}
-.folded #adminmenu a.wp-has-submenu {
- margin-left: 0;
- margin-right: 40px;
-}
-#adminmenu .wp-menu-toggle {
- float: left;
- padding: 1px 0 0 2px;
- clear: left;
-}
-#adminmenu div.wp-menu-image {
- float: right;
-}
-#wphead-info {
- margin: 0 15px 0 0;
- padding-right:0;
- padding-left: 15px;
-}
-/* end side admin menu */
-/* 1000 - 1300
-=================================== */
-#adminmenu #awaiting-mod,
-#adminmenu span.update-plugins,
-#sidemenu li a span.update-plugins {
- font-family: tahoma;
- margin-left: 0;
- margin-right: 2px;
-}
-#adminmenu li #awaiting-mod span,
-#adminmenu li span.update-plugins span,
-#sidemenu li a span.update-plugins span {
- float: right;
-}
-.post-com-count-wrapper {
- font-family: tahoma;
-}
-.column-response .post-com-count {
- float: right;
- margin-right: 0;
- margin-left: 5px;
-}
-/* Tables used on comment.php and option/setting pages */
-.form-table th,
-#wpbody-content .describe th {
- text-align: right;
-}
-.form-table input.tog {
- margin-right: 0;
- margin-left: 2px;
- float: right;
-}
-.form-table table.color-palette {
- float: right;
-}
-#profile-page .form-table #rich_editing {
- margin-right: 0;
- margin-left: 5px;
-}
-/* Post Screen */
-/* 1300 - 1500
-=================================== */
-#normal-sortables .postbox .submit {
- float: left;
-}
-#post-body .tagsdiv #newtag {
- margin-right: 0;
- margin-left: 5px;
-}
-#post-status-info {
- padding: 0 7px 0 15px;
-}
-#comment-status-radio input {
- margin: 2px 0 5px 3px;
-}
-.tagchecklist {
- margin-left: 0;
- margin-right: 10px;
-}
-.tagchecklist strong {
- margin-left: 0;
- margin-right: -8px;
-}
-.tagchecklist span {
- float: right;
-}
-.tagchecklist span a {
- margin: 6px -9px 0 0;
- float: right;
-}
-.ac_results li {
- text-align: right;
-}
-#poststuff h2 {
- clear: right;
-}
-.description, .form-wrap p {
- font-family: Tahoma, Arial;
-}
-/* 1500 - 1800
-=================================== */
-.meta-box-sortables .postbox .handlediv {
- float: left;
-}
-.howto {
- font-family: Tahoma, Arial;
-}
-.postarea h3 label {
- float: right;
-}
-.postarea #add-media-button {
- float: left;
- right: auto;
- left: 10px;
-}
-.wp_themeSkin tr.mceFirst td.mceToolbar {
- background-position: right top;
-}
-#poststuff #edButtonPreview,
-#poststuff #edButtonHTML {
- margin: 5px 0 0 5px;
- float: left;
-}
-#poststuff #edButtonHTML {
- margin-right: 0;
- margin-left: 15px;
-}
-#media-buttons a {
- padding: 0 10px 5px 0;
-}
-.submitbox .submit {
- text-align: right;
-}
-
-.inside-submitbox #post_status {
- margin: 2px -2px 2px 0;
-}
-.submitbox .submit input {
- margin-right: 0;
- margin-left: 4px;
-}
-/* Categories */
-#category-adder {
- margin-left: 0;
- margin-right: 120px;
-}
-#post-body ul#category-tabs li.tabs {
- -moz-border-radius: 0 3px 3px 0;
- -webkit-border-top-left-radius: 0;
- -webkit-border-top-right-radius: 3px;
- -webkit-border-bottom-left-radius: 0;
- -webkit-border-bottom-right-radius: 3px;
- border-top-left-radius: 0;
- border-top-right-radius: 3px;
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 3px;
-}
-#post-body ul#category-tabs {
- float: right;
- text-align: left;
- margin: 0 0 0 -120px;
-}
-#post-body #categorydiv div.tabs-panel,
-#post-body #linkcategorydiv div.tabs-panel {
- margin: 0 120px 0 5px;
-}
-/* 1800 - 2000
-=================================== */
-#side-sortables #category-tabs li {
- padding-right: 0;
- padding-left: 8px;
-}
-#categorydiv ul.categorychecklist ul,
-#linkcategorydiv ul.categorychecklist ul {
- margin-left: 0;
- margin-right: 18px;
-}
-/* positioning etc. */
-p.search-box {
- float: left;
-}
-#posts-filter fieldset {
- float: right;
- margin: 0 0 1em 1.5ex;
-}
-#posts-filter fieldset legend {
- padding: 0 1px .2em 0;
-}
-.view-switch {
- float: left;
-}
-.filter {
- float: right;
- margin: -5px 10px 0 0;
-}
-#the-comment-list td.comment p.comment-author {
- margin-right: 0;
-}
-#the-comment-list p.comment-author img {
- float: right;
- margin-right: 0;
- margin-left: 8px;
-}
-.tablenav .delete {
- margin-right: 0;
- margin-left: 20px;
-}
-td.action-links, th.action-links {
- text-align: left;
-}
-/* 2000 - 2300
-=================================== */
-.filter .subsubsub {
- margin-left: 0;
- margin-right: -10px;
-}
-#wp-word-count {
- margin-right: 10px;
-}
-.tool-box .title {
- font-family: "Times New Roman", Tahoma;
-}
-.settings-toggle {
- text-align: left;
- margin: 5px 0 15px 7px;
-}
-.curtime #timestamp {
- background-position: right top;
- padding-left: 0;
- padding-right: 18px;
-}
-/* media popup 0819 */
-#sidemenu {
- margin: -30px 315px 0 15px;
- float: left;
- padding-left: 0;
- padding-right: 10px;
-}
-#sidemenu a {
- float: right;
-}
-#replysubmit .button {
- margin-right: 0;
- margin-left: 5px;
-}
-/* 2300 - 2500
-=================================== */
-#edithead .inside {
- float: right;
- margin: 3px 5px 2px 0;
-}
-#replyrow #ed_reply_toolbar input {
- margin: 1px 1px 1px 2px;
-}
-/* show/hide settings */
-#screen-meta-links {
- margin: 0 0 0 9px;
-}
-#screen-options-link-wrap,
-#contextual-help-link-wrap {
- float: left;
- font-family: Tahoma, "Times New Roman";
- margin: 0 0 0 6px;
-}
-.metabox-prefs label {
- padding-right: 0;
- padding-left: 15px;
-}
-.metabox-prefs label input {
- margin: 0 2px 0 5px;
-}
-.inline-editor .save,
-.inline-editor .cancel {
- margin-right: 0;
- margin-left: 5px;
-}
-/* 2500 - 2700
-=================================== */
-#bulk-titles div a {
- float: right;
- margin: 3px -2px 0 3px;
-}
-#wpbody-content .filename {
- margin-left: 0;
- margin-right: 10px;
-}
-#wpbody-content .inline-edit-row fieldset {
- float: right;
-}
-#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col {
- border-left: 0 none;
- border-right: 1px solid;
-}
-#wpbody-content .bulk-edit-row .inline-edit-col-bottom {
- float: left;
-}
-.inline-edit-row fieldset label span.title {
- float: right;
-}
-.inline-edit-row fieldset label span.input-text-wrap {
- margin-left: 0;
- margin-right: 5em;
-}
-.quick-edit-row-post fieldset.inline-edit-col-right label span.title {
- padding-right: 0;
- padding-left: 0.5em;
-}
-#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child {
- margin-right: 0;
- margin-left: 0.5em;
-}
-/* 2700 - 3000
-=================================== */
-.inline-edit-row fieldset span.title,
-.inline-edit-row fieldset span.checkbox-title {
- font-family: Tahoma, "Times New Roman";
-}
-.inline-edit-row fieldset .inline-edit-date {
- float: right;
-}
-.inline-edit-row fieldset ul.cat-checklist label,
-.inline-edit-row .catshow,
-.inline-edit-row .cathide,
-.inline-edit-row #bulk-titles div {
- font-family: Tahoma, "Times New Roman";
-}
-.quick-edit-row-post fieldset label.inline-edit-status {
- float: right;
-}
-.describe-toggle-on, .describe-toggle-off {
- float: left;
- margin-right: 0;
- margin-left: 20px;
-}
-#wpbody-content #media-items .filename {
- float: right;
- margin-left: 0;
- margin-right: 10px;
-}
-.media-item .pinkynail {
- float: right;
-}
-#find-posts-response .found-radio {
- padding: 8px 8px 0 0;
-}
-.find-box-buttons {
- left: auto;
- right: 12px;
-}
-.find-box-search label {
- padding-right: 0;
- padding-left: 6px;
-}
-/* favorite-actions */
-#favorite-actions {
- float: left;
-}
-#favorite-first {
- padding: 3px 12px 4px 30px;
-}
-#favorite-inside {
-}
-#favorite-inside a {
- padding: 3px 10px 3px 5px;
-}
-#favorite-toggle {
- right: auto;
- left: 0;
- background:transparent url(images/fav-arrow-rtl.gif) no-repeat 10px -4px;
-}
-#utc-time, #local-time {
- padding-left: 0;
- padding-right: 25px;
- font-family: Tahoma, Arial;
-}
-.icon32 {
- float: right;
- margin: 14px 0 0 6px;
-}
-.subtitle {
- padding-left: 0;
- padding-right: 25px;
-}
-
-ol {
- list-style-type:decimal;
- margin-left:0;
- margin-right:2em;
-}
-
-
-/* TinyMCE
-=================================== */
-.clearlooks2 .mceTop .mceLeft {
- width:100% !important;
-}
-/* ltr
-=================================== */
-#author-email, #author-url, #rss-url-1, #edit-slug-box, #post_name, #trackback_url, #metakeyinput, #post_password, #slug, #category_nicename, #link_url, #link_image, #rss_uri, #menu_order, #email, #newcomment_author_url, #pages-exclude, #template textarea, #user_login, #url, #pass1, #pass2, #aim, #yim, #jabber, #siteurl, #home, #admin_email, #gmt_offset, #default_post_edit_rows, #mailserver_url, #mailserver_login, #mailserver_pass, #mailserver_port, #ping_sites, #posts_per_page, #posts_per_rss, #blog_charset, #close_comments_days_old, #comments_per_page, #comment_max_links, #moderation_keys, #blacklist_keys, #thumbnail_size_w, #thumbnail_size_h, #medium_size_w, #medium_size_h, #large_size_w, #large_size_h, #permalink_structure, #category_base, #tag_base, #upload_path, #upload_url_path, #rules {
- direction: ltr;
-}
+td.available-theme{text-align:right;}#current-theme img{float:right;margin-right:0;margin-left:1em;}.quicktags,.search{font-family:Tahoma,Arial,sans-serif;}#save-post{float:right;}.preview{float:left;}#sticky-span{margin-left:0;margin-right:18px;}#post-body .misc-pub-section{border-right-width:0;border-left-width:1;border-right-style:none;border-left-style:solid;float:right;}#post-body .misc-pub-section-last{border-left:0;}#delete-action{text-align:right;float:right;}#publishing-action{text-align:left;float:left;}.side-info ul{padding-left:0;padding-right:18px;}.submit input,.button,.button-primary,.button-secondary,.button-highlighted,#postcustomstuff .submit input{font-family:Tahoma,Arial,sans-serif;}#wpcontent select{font-family:Tahoma,Arial,sans-serif;}#quicktags{background-position:right top;}#template div{margin-right:0;margin-left:190px;}* html #template div{margin-left:0;}#your-profile legend{font-family:Tahoma,Arial,sans-serif;}#ajax-response.alignleft{margin-left:0;margin-right:2em;}.page-numbers{margin-right:0;margin-left:1px;}.column-author img,.column-username img{float:right;margin-right:0;margin-left:10px;}.tablenav a.button-secondary{margin:8px 0 0 8px;}.tablenav .tablenav-pages{float:left;}.tablenav .displaying-num{margin-right:0;margin-left:10px;font-family:Tahoma,Arial,sans-serif;}#postcustomstuff table input,#postcustomstuff table select,#postcustomstuff table textarea{margin:8px 8px 8px 0;}#pass-strength-result{float:right;margin:12px 1px 5px 5px;}#user_info{float:left;}#header-logo{float:right;margin:7px 15px 0 0;}#wphead h1{font-family:Tahoma,Arial,sans-serif;float:right;}#wphead h1.long-title{font-family:Tahoma,Arial,sans-serif;}#adminmenu .wp-submenu a{padding-left:0;padding-right:12px;border-width:0 0 0 1px;border-style:none none none solid;font-family:Tahoma,Arial,sans-serif;}#adminmenu a.menu-top,#adminmenu .wp-submenu-head{font-family:Tahoma,Arial,sans-serif;}#adminmenu img.wp-menu-image{float:right;}.folded #adminmenu img.wp-menu-image{padding:7px 6px 0 0;}#adminmenu a.separator{cursor:e-resize;}.folded #adminmenu a.separator{cursor:w-resize;}#adminmenu .wp-submenu .wp-submenu-head{padding:6px 10px 6px 4px;}.folded #adminmenu .wp-submenu{margin:-1px 28px 0 0;}.folded #adminmenu .wp-submenu a{padding-left:0;padding-right:10px;}.folded #adminmenu a.wp-has-submenu{margin-left:0;margin-right:40px;}#adminmenu .wp-menu-toggle{float:left;padding:1px 0 0 2px;clear:left;}#adminmenu div.wp-menu-image{float:right;}#wphead-info{margin:0 15px 0 0;padding-right:0;padding-left:15px;}#adminmenu #awaiting-mod,#adminmenu span.update-plugins,#sidemenu li a span.update-plugins{font-family:Tahoma,Arial,sans-serif;margin-left:0;margin-right:2px;}#adminmenu li #awaiting-mod span,#adminmenu li span.update-plugins span,#sidemenu li a span.update-plugins span{float:right;}.post-com-count-wrapper{font-family:Tahoma,Arial,sans-serif;}.column-response .post-com-count{float:right;margin-right:0;margin-left:5px;}.form-table th,#wpbody-content .describe th{text-align:right;}.form-table input.tog{margin-right:0;margin-left:2px;float:right;}.form-table table.color-palette{float:right;}#profile-page .form-table #rich_editing{margin-right:0;margin-left:5px;}#normal-sortables .postbox .submit{float:left;}#post-body .tagsdiv #newtag{margin-right:0;margin-left:5px;}#post-status-info{padding:0 7px 0 15px;}#comment-status-radio input{margin:2px 0 5px 3px;}.tagchecklist{margin-left:0;margin-right:10px;}.tagchecklist strong{margin-left:0;margin-right:-8px;}.tagchecklist span{float:right;}.tagchecklist span a{margin:6px -9px 0 0;float:right;}.ac_results li{text-align:right;}#poststuff h2{clear:right;}.description,.form-wrap p{font-family:Tahoma,Arial,sans-serif;}.meta-box-sortables .postbox .handlediv{float:left;}.howto{font-family:Tahoma,Arial,sans-serif;}.postarea h3 label{float:right;}.postarea #add-media-button{float:left;right:auto;left:10px;}.wp_themeSkin tr.mceFirst td.mceToolbar{background-position:right top;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{margin:5px 0 0 5px;float:left;}#poststuff #edButtonHTML{margin-right:0;margin-left:15px;}#media-buttons a{padding:0 10px 5px 0;}.submitbox .submit{text-align:right;}.inside-submitbox #post_status{margin:2px -2px 2px 0;}.submitbox .submit input{margin-right:0;margin-left:4px;}#category-adder{margin-left:0;margin-right:120px;}#post-body ul#category-tabs li.tabs{-moz-border-radius:0 3px 3px 0;-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:3px;border-top-left-radius:0;border-top-right-radius:3px;border-bottom-left-radius:0;border-bottom-right-radius:3px;}#post-body ul#category-tabs{float:right;text-align:left;margin:0 0 0 -120px;}#post-body #categorydiv div.tabs-panel,#post-body #linkcategorydiv div.tabs-panel{margin:0 120px 0 5px;}#side-sortables #category-tabs li{padding-right:0;padding-left:8px;}#categorydiv ul.categorychecklist ul,#linkcategorydiv ul.categorychecklist ul{margin-left:0;margin-right:18px;}p.search-box{float:left;}#posts-filter fieldset{float:right;margin:0 0 1em 1.5ex;}#posts-filter fieldset legend{padding:0 1px .2em 0;}.view-switch{float:left;}.filter{float:right;margin:-5px 10px 0 0;}#the-comment-list td.comment p.comment-author{margin-right:0;}#the-comment-list p.comment-author img{float:right;margin-right:0;margin-left:8px;}.tablenav .delete{margin-right:0;margin-left:20px;}td.action-links,th.action-links{text-align:left;}.filter .subsubsub{margin-left:0;margin-right:-10px;}#wp-word-count{margin-right:10px;}.tool-box .title{font-family:Tahoma,Arial,sans-serif;}.settings-toggle{text-align:left;margin:5px 0 15px 7px;}.curtime #timestamp{background-position:right top;padding-left:0;padding-right:18px;}#sidemenu{margin:-30px 315px 0 15px;float:left;padding-left:0;padding-right:10px;}#sidemenu a{float:right;}#replysubmit .button{margin-right:0;margin-left:5px;}#edithead .inside{float:right;margin:3px 5px 2px 0;}#replyrow #ed_reply_toolbar input{margin:1px 1px 1px 2px;}#screen-meta-links{margin:0 0 0 9px;}#screen-options-link-wrap,#contextual-help-link-wrap{float:left;font-family:Tahoma,Arial,sans-serif;margin:0 0 0 6px;}.metabox-prefs label{padding-right:0;padding-left:15px;}.metabox-prefs label input{margin:0 2px 0 5px;}.inline-editor .save,.inline-editor .cancel{margin-right:0;margin-left:5px;}#bulk-titles div a{float:right;margin:3px -2px 0 3px;}#wpbody-content .filename{margin-left:0;margin-right:10px;}#wpbody-content .inline-edit-row fieldset{float:right;}#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col{border-left:0 none;border-right:1px solid;}#wpbody-content .bulk-edit-row .inline-edit-col-bottom{float:left;}.inline-edit-row fieldset label span.title{float:right;}.inline-edit-row fieldset label span.input-text-wrap{margin-left:0;margin-right:5em;}.quick-edit-row-post fieldset.inline-edit-col-right label span.title{padding-right:0;padding-left:.5em;}#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child{margin-right:0;margin-left:.5em;}.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title{font-family:Tahoma,Arial,sans-serif;}.inline-edit-row fieldset .inline-edit-date{float:right;}.inline-edit-row fieldset ul.cat-checklist label,.inline-edit-row .catshow,.inline-edit-row .cathide,.inline-edit-row #bulk-titles div{font-family:Tahoma,Arial,sans-serif;}.quick-edit-row-post fieldset label.inline-edit-status{float:right;}.describe-toggle-on,.describe-toggle-off{float:left;margin-right:0;margin-left:20px;}#wpbody-content #media-items .filename{float:right;margin-left:0;margin-right:10px;}.media-item .pinkynail{float:right;}#find-posts-response .found-radio{padding:8px 8px 0 0;}.find-box-buttons{left:auto;right:12px;}.find-box-search label{padding-right:0;padding-left:6px;}#favorite-actions{float:left;}#favorite-first{padding:3px 12px 4px 30px;}#favorite-inside a{padding:3px 10px 3px 5px;}#favorite-toggle{right:auto;left:0;background:transparent url(images/fav-arrow-rtl.gif) no-repeat 10px -4px;}#utc-time,#local-time{padding-left:0;padding-right:25px;font-family:Tahoma,Arial;}.icon32{float:right;margin:14px 0 0 6px;}.subtitle{padding-left:0;padding-right:25px;}ol{list-style-type:decimal;margin-left:0;margin-right:2em;}.postbox-container{float:right;padding-left:.5%;padding-right:0;}.clearlooks2 .mceTop .mceLeft{width:100%!important;}#author-email,#author-url,#rss-url-1,#edit-slug-box,#post_name,#trackback_url,#metakeyinput,#post_password,#slug,#category_nicename,#link_url,#link_image,#rss_uri,#menu_order,#email,#newcomment_author_url,#pages-exclude,#template textarea,#user_login,#url,#pass1,#pass2,#aim,#yim,#jabber,#siteurl,#home,#admin_email,#gmt_offset,#default_post_edit_rows,#mailserver_url,#mailserver_login,#mailserver_pass,#mailserver_port,#ping_sites,#posts_per_page,#posts_per_rss,#blog_charset,#close_comments_days_old,#comments_per_page,#comment_max_links,#moderation_keys,#blacklist_keys,#thumbnail_size_w,#thumbnail_size_h,#medium_size_w,#medium_size_h,#large_size_w,#large_size_h,#permalink_structure,#category_base,#tag_base,#upload_path,#upload_url_path,#rules{direction:ltr;}
\ No newline at end of file
--- /dev/null
+/* 0 - 200
+=================================== */
+td.available-theme {
+ text-align: right;
+}
+#current-theme img {
+ float: right;
+ margin-right: 0;
+ margin-left: 1em;
+}
+.quicktags, .search {
+ font-family: Tahoma, Arial, sans-serif;
+}
+/* 200 - 500
+=================================== */
+#save-post {
+ float: right;
+}
+.preview {
+ float: left;
+}
+#sticky-span {
+ margin-left: 0;
+ margin-right: 18px;
+}
+#post-body .misc-pub-section {
+ border-right-width: 0;
+ border-left-width: 1;
+ border-right-style: none;
+ border-left-style: solid;
+ float: right;
+}
+#post-body .misc-pub-section-last {
+ border-left: 0;
+}
+#delete-action {
+ text-align: right;
+ float: right;
+}
+#publishing-action {
+ text-align: left;
+ float: left;
+}
+.side-info ul {
+ padding-left: 0;
+ padding-right: 18px;
+}
+.submit input,
+.button,
+.button-primary,
+.button-secondary,
+.button-highlighted,
+#postcustomstuff .submit input {
+ font-family: Tahoma, Arial, sans-serif;
+}
+#wpcontent select {
+ font-family: Tahoma, Arial, sans-serif;
+}
+#quicktags {
+ background-position: right top;
+}
+/* 500 - 700
+=================================== */
+#template div {
+ margin-right: 0;
+ margin-left: 190px;
+}
+* html #template div {
+ margin-left: 0;
+}
+#your-profile legend {
+ font-family: Tahoma, Arial, sans-serif;
+}
+#ajax-response.alignleft {
+ margin-left: 0;
+ margin-right: 2em;
+}
+.page-numbers {
+ margin-right: 0;
+ margin-left: 1px;
+}
+.column-author img, .column-username img {
+ float: right;
+ margin-right: 0;
+ margin-left: 10px;
+}
+.tablenav a.button-secondary {
+ margin: 8px 0 0 8px;
+}
+.tablenav .tablenav-pages {
+ float: left;
+}
+.tablenav .displaying-num {
+ margin-right: 0;
+ margin-left: 10px;
+ font-family: Tahoma, Arial, sans-serif;
+}
+#postcustomstuff table input,
+#postcustomstuff table select,
+#postcustomstuff table textarea {
+ margin: 8px 8px 8px 0;
+}
+/* 700 - 1000
+=================================== */
+#pass-strength-result {
+ float: right;
+ margin: 12px 1px 5px 5px;
+}
+/* Admin Header */
+#user_info {
+ float: left;
+}
+#header-logo {
+ float: right;
+ margin: 7px 15px 0 0;
+}
+#wphead h1 {
+ font-family: Tahoma, Arial, sans-serif;
+ float: right;
+}
+#wphead h1.long-title {
+ font-family: Tahoma, Arial, sans-serif;
+}
+#adminmenu .wp-submenu a {
+ padding-left: 0;
+ padding-right: 12px;
+ border-width: 0 0 0 1px;
+ border-style: none none none solid;
+ font-family: Tahoma, Arial, sans-serif;
+}
+#adminmenu a.menu-top,
+#adminmenu .wp-submenu-head {
+ font-family: Tahoma, Arial, sans-serif;
+}
+#adminmenu img.wp-menu-image {
+ float: right;
+}
+.folded #adminmenu img.wp-menu-image {
+ padding: 7px 6px 0 0;
+}
+#adminmenu a.separator {
+ cursor: e-resize;
+}
+.folded #adminmenu a.separator {
+ cursor: w-resize;
+}
+#adminmenu .wp-submenu .wp-submenu-head {
+ padding: 6px 10px 6px 4px;
+}
+.folded #adminmenu .wp-submenu {
+ margin: -1px 28px 0 0;
+}
+.folded #adminmenu .wp-submenu a {
+ padding-left: 0;
+ padding-right: 10px;
+}
+.folded #adminmenu a.wp-has-submenu {
+ margin-left: 0;
+ margin-right: 40px;
+}
+#adminmenu .wp-menu-toggle {
+ float: left;
+ padding: 1px 0 0 2px;
+ clear: left;
+}
+#adminmenu div.wp-menu-image {
+ float: right;
+}
+#wphead-info {
+ margin: 0 15px 0 0;
+ padding-right:0;
+ padding-left: 15px;
+}
+/* end side admin menu */
+/* 1000 - 1300
+=================================== */
+#adminmenu #awaiting-mod,
+#adminmenu span.update-plugins,
+#sidemenu li a span.update-plugins {
+ font-family: Tahoma, Arial, sans-serif;
+ margin-left: 0;
+ margin-right: 2px;
+}
+#adminmenu li #awaiting-mod span,
+#adminmenu li span.update-plugins span,
+#sidemenu li a span.update-plugins span {
+ float: right;
+}
+.post-com-count-wrapper {
+ font-family: Tahoma, Arial, sans-serif;
+}
+.column-response .post-com-count {
+ float: right;
+ margin-right: 0;
+ margin-left: 5px;
+}
+/* Tables used on comment.php and option/setting pages */
+.form-table th,
+#wpbody-content .describe th {
+ text-align: right;
+}
+.form-table input.tog {
+ margin-right: 0;
+ margin-left: 2px;
+ float: right;
+}
+.form-table table.color-palette {
+ float: right;
+}
+#profile-page .form-table #rich_editing {
+ margin-right: 0;
+ margin-left: 5px;
+}
+/* Post Screen */
+/* 1300 - 1500
+=================================== */
+#normal-sortables .postbox .submit {
+ float: left;
+}
+#post-body .tagsdiv #newtag {
+ margin-right: 0;
+ margin-left: 5px;
+}
+#post-status-info {
+ padding: 0 7px 0 15px;
+}
+#comment-status-radio input {
+ margin: 2px 0 5px 3px;
+}
+.tagchecklist {
+ margin-left: 0;
+ margin-right: 10px;
+}
+.tagchecklist strong {
+ margin-left: 0;
+ margin-right: -8px;
+}
+.tagchecklist span {
+ float: right;
+}
+.tagchecklist span a {
+ margin: 6px -9px 0 0;
+ float: right;
+}
+.ac_results li {
+ text-align: right;
+}
+#poststuff h2 {
+ clear: right;
+}
+.description, .form-wrap p {
+ font-family: Tahoma, Arial, sans-serif;
+}
+/* 1500 - 1800
+=================================== */
+.meta-box-sortables .postbox .handlediv {
+ float: left;
+}
+.howto {
+ font-family: Tahoma, Arial, sans-serif;
+}
+.postarea h3 label {
+ float: right;
+}
+.postarea #add-media-button {
+ float: left;
+ right: auto;
+ left: 10px;
+}
+.wp_themeSkin tr.mceFirst td.mceToolbar {
+ background-position: right top;
+}
+#poststuff #edButtonPreview,
+#poststuff #edButtonHTML {
+ margin: 5px 0 0 5px;
+ float: left;
+}
+#poststuff #edButtonHTML {
+ margin-right: 0;
+ margin-left: 15px;
+}
+#media-buttons a {
+ padding: 0 10px 5px 0;
+}
+.submitbox .submit {
+ text-align: right;
+}
+
+.inside-submitbox #post_status {
+ margin: 2px -2px 2px 0;
+}
+.submitbox .submit input {
+ margin-right: 0;
+ margin-left: 4px;
+}
+/* Categories */
+#category-adder {
+ margin-left: 0;
+ margin-right: 120px;
+}
+#post-body ul#category-tabs li.tabs {
+ -moz-border-radius: 0 3px 3px 0;
+ -webkit-border-top-left-radius: 0;
+ -webkit-border-top-right-radius: 3px;
+ -webkit-border-bottom-left-radius: 0;
+ -webkit-border-bottom-right-radius: 3px;
+ border-top-left-radius: 0;
+ border-top-right-radius: 3px;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 3px;
+}
+#post-body ul#category-tabs {
+ float: right;
+ text-align: left;
+ margin: 0 0 0 -120px;
+}
+#post-body #categorydiv div.tabs-panel,
+#post-body #linkcategorydiv div.tabs-panel {
+ margin: 0 120px 0 5px;
+}
+/* 1800 - 2000
+=================================== */
+#side-sortables #category-tabs li {
+ padding-right: 0;
+ padding-left: 8px;
+}
+#categorydiv ul.categorychecklist ul,
+#linkcategorydiv ul.categorychecklist ul {
+ margin-left: 0;
+ margin-right: 18px;
+}
+/* positioning etc. */
+p.search-box {
+ float: left;
+}
+#posts-filter fieldset {
+ float: right;
+ margin: 0 0 1em 1.5ex;
+}
+#posts-filter fieldset legend {
+ padding: 0 1px .2em 0;
+}
+.view-switch {
+ float: left;
+}
+.filter {
+ float: right;
+ margin: -5px 10px 0 0;
+}
+#the-comment-list td.comment p.comment-author {
+ margin-right: 0;
+}
+#the-comment-list p.comment-author img {
+ float: right;
+ margin-right: 0;
+ margin-left: 8px;
+}
+.tablenav .delete {
+ margin-right: 0;
+ margin-left: 20px;
+}
+td.action-links, th.action-links {
+ text-align: left;
+}
+/* 2000 - 2300
+=================================== */
+.filter .subsubsub {
+ margin-left: 0;
+ margin-right: -10px;
+}
+#wp-word-count {
+ margin-right: 10px;
+}
+.tool-box .title {
+ font-family: Tahoma, Arial, sans-serif;
+}
+.settings-toggle {
+ text-align: left;
+ margin: 5px 0 15px 7px;
+}
+.curtime #timestamp {
+ background-position: right top;
+ padding-left: 0;
+ padding-right: 18px;
+}
+/* media popup 0819 */
+#sidemenu {
+ margin: -30px 315px 0 15px;
+ float: left;
+ padding-left: 0;
+ padding-right: 10px;
+}
+#sidemenu a {
+ float: right;
+}
+#replysubmit .button {
+ margin-right: 0;
+ margin-left: 5px;
+}
+/* 2300 - 2500
+=================================== */
+#edithead .inside {
+ float: right;
+ margin: 3px 5px 2px 0;
+}
+#replyrow #ed_reply_toolbar input {
+ margin: 1px 1px 1px 2px;
+}
+/* show/hide settings */
+#screen-meta-links {
+ margin: 0 0 0 9px;
+}
+#screen-options-link-wrap,
+#contextual-help-link-wrap {
+ float: left;
+ font-family: Tahoma, Arial, sans-serif;
+ margin: 0 0 0 6px;
+}
+.metabox-prefs label {
+ padding-right: 0;
+ padding-left: 15px;
+}
+.metabox-prefs label input {
+ margin: 0 2px 0 5px;
+}
+.inline-editor .save,
+.inline-editor .cancel {
+ margin-right: 0;
+ margin-left: 5px;
+}
+/* 2500 - 2700
+=================================== */
+#bulk-titles div a {
+ float: right;
+ margin: 3px -2px 0 3px;
+}
+#wpbody-content .filename {
+ margin-left: 0;
+ margin-right: 10px;
+}
+#wpbody-content .inline-edit-row fieldset {
+ float: right;
+}
+#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col {
+ border-left: 0 none;
+ border-right: 1px solid;
+}
+#wpbody-content .bulk-edit-row .inline-edit-col-bottom {
+ float: left;
+}
+.inline-edit-row fieldset label span.title {
+ float: right;
+}
+.inline-edit-row fieldset label span.input-text-wrap {
+ margin-left: 0;
+ margin-right: 5em;
+}
+.quick-edit-row-post fieldset.inline-edit-col-right label span.title {
+ padding-right: 0;
+ padding-left: 0.5em;
+}
+#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child {
+ margin-right: 0;
+ margin-left: 0.5em;
+}
+/* 2700 - 3000
+=================================== */
+.inline-edit-row fieldset span.title,
+.inline-edit-row fieldset span.checkbox-title {
+ font-family: Tahoma, Arial, sans-serif;
+}
+.inline-edit-row fieldset .inline-edit-date {
+ float: right;
+}
+.inline-edit-row fieldset ul.cat-checklist label,
+.inline-edit-row .catshow,
+.inline-edit-row .cathide,
+.inline-edit-row #bulk-titles div {
+ font-family: Tahoma, Arial, sans-serif;
+}
+.quick-edit-row-post fieldset label.inline-edit-status {
+ float: right;
+}
+.describe-toggle-on, .describe-toggle-off {
+ float: left;
+ margin-right: 0;
+ margin-left: 20px;
+}
+#wpbody-content #media-items .filename {
+ float: right;
+ margin-left: 0;
+ margin-right: 10px;
+}
+.media-item .pinkynail {
+ float: right;
+}
+#find-posts-response .found-radio {
+ padding: 8px 8px 0 0;
+}
+.find-box-buttons {
+ left: auto;
+ right: 12px;
+}
+.find-box-search label {
+ padding-right: 0;
+ padding-left: 6px;
+}
+/* favorite-actions */
+#favorite-actions {
+ float: left;
+}
+#favorite-first {
+ padding: 3px 12px 4px 30px;
+}
+#favorite-inside {
+}
+#favorite-inside a {
+ padding: 3px 10px 3px 5px;
+}
+#favorite-toggle {
+ right: auto;
+ left: 0;
+ background:transparent url(images/fav-arrow-rtl.gif) no-repeat 10px -4px;
+}
+#utc-time, #local-time {
+ padding-left: 0;
+ padding-right: 25px;
+ font-family: Tahoma, Arial;
+}
+.icon32 {
+ float: right;
+ margin: 14px 0 0 6px;
+}
+.subtitle {
+ padding-left: 0;
+ padding-right: 25px;
+}
+
+ol {
+ list-style-type:decimal;
+ margin-left:0;
+ margin-right:2em;
+}
+
+.postbox-container {
+ float: right;
+ padding-left: 0.5%;
+ padding-right: 0;
+}
+
+/* TinyMCE
+=================================== */
+.clearlooks2 .mceTop .mceLeft {
+ width:100% !important;
+}
+/* ltr
+=================================== */
+#author-email, #author-url, #rss-url-1, #edit-slug-box, #post_name, #trackback_url, #metakeyinput, #post_password, #slug, #category_nicename, #link_url, #link_image, #rss_uri, #menu_order, #email, #newcomment_author_url, #pages-exclude, #template textarea, #user_login, #url, #pass1, #pass2, #aim, #yim, #jabber, #siteurl, #home, #admin_email, #gmt_offset, #default_post_edit_rows, #mailserver_url, #mailserver_login, #mailserver_pass, #mailserver_port, #ping_sites, #posts_per_page, #posts_per_rss, #blog_charset, #close_comments_days_old, #comments_per_page, #comment_max_links, #moderation_keys, #blacklist_keys, #thumbnail_size_w, #thumbnail_size_h, #medium_size_w, #medium_size_h, #large_size_w, #large_size_h, #permalink_structure, #category_base, #tag_base, #upload_path, #upload_url_path, #rules {
+ direction: ltr;
+}
*/
define('WP_INSTALLING', true);
+/**
+ * Disable error reporting
+ *
+ * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) f
+or debugging
+ */
+error_reporting(0);
+
/**#@+
* These three defines are required to allow us to use require_wp_db() to load
* the database class while being wp-content/db.php aware.
$configFile = file(ABSPATH . 'wp-config-sample.php');
-if ( !is_writable(ABSPATH))
- wp_die("Sorry, I can't write to the directory. You'll have to either change the permissions on your WordPress directory or create your wp-config.php manually.");
-
// Check if wp-config.php has been created
if (file_exists(ABSPATH . 'wp-config.php'))
wp_die("<p>The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");
if (file_exists(ABSPATH . '../wp-config.php') && ! file_exists(ABSPATH . '../wp-settings.php'))
wp_die("<p>The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");
+if ( version_compare( '4.3', phpversion(), '>' ) )
+ wp_die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %s but WordPress requires at least 4.3.'/*/WP_I18N_OLD_PHP*/, phpversion() ) );
+
+if ( !extension_loaded('mysql') && !file_exists(ABSPATH . 'wp-content/db.php') )
+ wp_die( /*WP_I18N_OLD_MYSQL*/'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.'/*/WP_I18N_OLD_MYSQL*/ );
+
if (isset($_GET['step']))
$step = $_GET['step'];
else
if ( !empty($wpdb->error) )
wp_die($wpdb->error->get_error_message());
- $handle = fopen(ABSPATH . 'wp-config.php', 'w');
-
foreach ($configFile as $line_num => $line) {
switch (substr($line,0,16)) {
case "define('DB_NAME'":
- fwrite($handle, str_replace("putyourdbnamehere", $dbname, $line));
+ $configFile[$line_num] = str_replace("putyourdbnamehere", $dbname, $line);
break;
case "define('DB_USER'":
- fwrite($handle, str_replace("'usernamehere'", "'$uname'", $line));
+ $configFile[$line_num] = str_replace("'usernamehere'", "'$uname'", $line);
break;
case "define('DB_PASSW":
- fwrite($handle, str_replace("'yourpasswordhere'", "'$passwrd'", $line));
+ $configFile[$line_num] = str_replace("'yourpasswordhere'", "'$passwrd'", $line);
break;
case "define('DB_HOST'":
- fwrite($handle, str_replace("localhost", $dbhost, $line));
+ $configFile[$line_num] = str_replace("localhost", $dbhost, $line);
break;
case '$table_prefix =':
- fwrite($handle, str_replace('wp_', $prefix, $line));
+ $configFile[$line_num] = str_replace('wp_', $prefix, $line);
break;
- default:
- fwrite($handle, $line);
}
}
- fclose($handle);
- chmod(ABSPATH . 'wp-config.php', 0666);
-
- display_header();
+ if ( ! is_writable(ABSPATH) ) :
+ display_header();
+?>
+<p>Sorry, but I can't write the <code>wp-config.php</code> file.</p>
+<p>You can create the <code>wp-config.php</code> manually and paste the following text into it.</p>
+<textarea cols="90" rows="15"><?php
+ foreach( $configFile as $line ) {
+ echo htmlentities($line);
+ }
+?></textarea>
+<p>After you've done that, click "Run the install."</p>
+<p class="step"><a href="install.php" class="button">Run the install</a></p>
+<?php
+ else :
+ $handle = fopen(ABSPATH . 'wp-config.php', 'w');
+ foreach( $configFile as $line ) {
+ fwrite($handle, $line);
+ }
+ fclose($handle);
+ chmod(ABSPATH . 'wp-config.php', 0666);
+ display_header();
?>
<p>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…</p>
<p class="step"><a href="install.php" class="button">Run the install</a></p>
<?php
+ endif;
break;
}
?>
/** WordPress Administration Bootstrap */
require_once('admin.php');
+if ( !current_user_can('edit_themes') )
+ wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>');
+
$title = __("Edit Themes");
$parent_file = 'themes.php';
-wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'theme'));
+wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'theme', 'dir'));
wp_admin_css( 'theme-editor' );
if (empty($file)) {
$file = $allowed_files[0];
+} else {
+ $file = stripslashes($file);
+ if ( 'theme' == $dir ) {
+ $file = dirname(dirname($themes[$theme]['Template Dir'])) . $file ;
+ } else if ( 'style' == $dir) {
+ $file = dirname(dirname($themes[$theme]['Stylesheet Dir'])) . $file ;
+ }
}
-$file = validate_file_to_edit($file, $allowed_files);
-$real_file = get_real_file_to_edit($file);
-
+validate_file_to_edit($file, $allowed_files);
+$scrollto = isset($_REQUEST['scrollto']) ? (int) $_REQUEST['scrollto'] : 0;
$file_show = basename( $file );
switch($action) {
check_admin_referer('edit-theme_' . $file . $theme);
- if ( !current_user_can('edit_themes') )
- wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>');
-
$newcontent = stripslashes($_POST['newcontent']);
$theme = urlencode($theme);
- if (is_writeable($real_file)) {
+ if (is_writeable($file)) {
//is_writable() not always reliable, check return value. see comments @ http://uk.php.net/is_writable
- $f = fopen($real_file, 'w+');
+ $f = fopen($file, 'w+');
if ($f !== FALSE) {
fwrite($f, $newcontent);
fclose($f);
- $location = "theme-editor.php?file=$file&theme=$theme&a=te";
+ $location = "theme-editor.php?file=$file&theme=$theme&a=te&scrollto=$scrollto";
} else {
- $location = "theme-editor.php?file=$file&theme=$theme";
+ $location = "theme-editor.php?file=$file&theme=$theme&scrollto=$scrollto";
}
} else {
- $location = "theme-editor.php?file=$file&theme=$theme";
+ $location = "theme-editor.php?file=$file&theme=$theme&scrollto=$scrollto";
}
$location = wp_kses_no_null($location);
default:
- if ( !current_user_can('edit_themes') )
- wp_die('<p>'.__('You do not have sufficient permissions to edit themes for this blog.').'</p>');
-
require_once('admin-header.php');
update_recently_edited($file);
- if ( !is_file($real_file) )
+ if ( !is_file($file) )
$error = 1;
- if ( !$error && filesize($real_file) > 0 ) {
- $f = fopen($real_file, 'r');
- $content = fread($f, filesize($real_file));
+ if ( !$error && filesize($file) > 0 ) {
+ $f = fopen($file, 'r');
+ $content = fread($f, filesize($file));
- if ( '.php' == substr( $real_file, strrpos( $real_file, '.' ) ) ) {
+ if ( '.php' == substr( $file, strrpos( $file, '.' ) ) ) {
$functions = wp_doc_link_parse( $content );
$docs_select = '<select name="docs-list" id="docs-list">';
}
$content = htmlspecialchars( $content );
- $codepress_lang = codepress_get_lang($real_file);
+ $codepress_lang = codepress_get_lang($file);
}
?>
</div>
<br class="clear" />
</div>
-
-<div id="templateside">
+<br class="clear" />
+ <div id="templateside">
<h3><?php _e("Theme Files"); ?></h3>
<?php
// This means that we display the correct files for child themes which overload Templates as well as Styles
if( array_key_exists($description, $template_mapping ) ) {
if ( false !== strpos( $template_file, $template_dir ) ) {
- $template_mapping[ $description ] = array( $template_file, $filedesc );
+ $template_mapping[ $description ] = array( _get_template_edit_filename($template_file, $template_dir), $filedesc );
}
} else {
- $template_mapping[ $description ] = array( $template_file, $filedesc );
+ $template_mapping[ $description ] = array( _get_template_edit_filename($template_file, $template_dir), $filedesc );
}
}
ksort( $template_mapping );
while ( list( $template_sorted_key, list( $template_file, $filedesc ) ) = each( $template_mapping ) ) :
?>
- <li><a href="theme-editor.php?file=<?php echo "$template_file"; ?>&theme=<?php echo urlencode($theme) ?>"><?php echo $filedesc ?></a></li>
+ <li><a href="theme-editor.php?file=<?php echo "$template_file"; ?>&theme=<?php echo urlencode($theme) ?>&dir=theme"><?php echo $filedesc ?></a></li>
<?php endwhile; ?>
</ul>
<h4><?php /* translators: Theme stylesheets in theme editor */ echo _x('Styles', 'Theme stylesheets in theme editor'); ?></h4>
<ul>
<?php
$template_mapping = array();
+ $stylesheet_dir = $themes[$theme]['Stylesheet Dir'];
foreach ( $themes[$theme]['Stylesheet Files'] as $style_file ) {
$description = trim( get_file_description($style_file) );
$style_show = basename($style_file);
$filedesc = ( $description != $style_file ) ? "$description <span class='nonessential'>($style_show)</span>" : "$description";
$filedesc = ( $style_file == $file ) ? "<span class='highlight'>$description <span class='nonessential'>($style_show)</span></span>" : $filedesc;
- $template_mapping[ $description ] = array( $style_file, $filedesc );
+ $template_mapping[ $description ] = array( _get_template_edit_filename($style_file, $stylesheet_dir), $filedesc );
}
ksort( $template_mapping );
while ( list( $template_sorted_key, list( $style_file, $filedesc ) ) = each( $template_mapping ) ) :
?>
- <li><a href="theme-editor.php?file=<?php echo "$style_file"; ?>&theme=<?php echo urlencode($theme) ?>"><?php echo $filedesc ?></a></li>
+ <li><a href="theme-editor.php?file=<?php echo "$style_file"; ?>&theme=<?php echo urlencode($theme) ?>&dir=style"><?php echo $filedesc ?></a></li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
</div>
-
<?php if (!$error) { ?>
-<form name="template" id="template" action="theme-editor.php" method="post">
+ <form name="template" id="template" action="theme-editor.php" method="post">
<?php wp_nonce_field('edit-theme_' . $file . $theme) ?>
<div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1" class="codepress <?php echo $codepress_lang ?>"><?php echo $content ?></textarea>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="file" value="<?php echo esc_attr($file) ?>" />
<input type="hidden" name="theme" value="<?php echo esc_attr($theme) ?>" />
+ <input type="hidden" name="scrollto" id="scrollto" value="<?php echo $scrollto; ?>" />
</div>
<?php if ( isset($functions ) && count($functions) ) { ?>
<div id="documentation">
<?php } ?>
<div>
-<?php if ( is_writeable($real_file) ) : ?>
+<?php if ( is_writeable($file) ) : ?>
<p class="submit">
<?php
echo "<input type='submit' name='submit' class='button-primary' value='" . esc_attr__('Update File') . "' tabindex='2' />";
<p><em><?php _e('You need to make this file writable before you can save your changes. See <a href="http://codex.wordpress.org/Changing_File_Permissions">the Codex</a> for more information.'); ?></em></p>
<?php endif; ?>
</div>
-</form>
+ </form>
<?php
} else {
echo '<div class="error"><p>' . __('Oops, no such file exists! Double check the name and try again, merci.') . '</p></div>';
?>
<br class="clear" />
</div>
+<script type="text/javascript">
+/* <![CDATA[ */
+jQuery(document).ready(function($){
+ $('#template').submit(function(){ $('#scrollto').val( $('#newcontent').scrollTop() ); });
+ $('#newcontent').scrollTop( $('#scrollto').val() );
+});
+/* ]]> */
+</script>
<?php
break;
}
if ( 'search' == $tab )
$tabs['search'] = __('Search Results');
$tabs['upload'] = __('Upload');
-$tabs['featured'] = __('Featured');
-//$tabs['popular'] = __('Popular');
-$tabs['new'] = __('Newest');
-$tabs['updated'] = __('Recently Updated');
+$tabs['featured'] = _x('Featured','Theme Installer');
+//$tabs['popular'] = _x('Popular','Theme Installer');
+$tabs['new'] = _x('Newest','Theme Installer');
+$tabs['updated'] = _x('Recently Updated','Theme Installer');
$nonmenu_tabs = array('theme-information'); //Valid actions to perform which do not have a Menu item.
<div class="wrap">
<?php screen_icon(); ?>
-<h2><?php echo esc_html( $title ); ?></h2>
+<h2><?php echo esc_html( $title ); ?> <a href="theme-install.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'theme'); ?></a></h2>
<h3><?php _e('Current Theme'); ?></h3>
<div id="current-theme">
<?php if ( $ct->screenshot ) : ?>
-<img src="<?php echo content_url($ct->stylesheet_dir . '/' . $ct->screenshot); ?>" alt="<?php _e('Current theme preview'); ?>" />
+<img src="<?php echo $ct->theme_root_uri . '/' . $ct->stylesheet . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" />
<?php endif; ?>
<h4><?php
/* translators: 1: theme title, 2: theme version, 3: theme author */
printf(__('%1$s %2$s by %3$s'), $ct->title, $ct->version, $ct->author) ; ?></h4>
<p class="theme-description"><?php echo $ct->description; ?></p>
<?php if ($ct->parent_theme) { ?>
- <p><?php printf(__('The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. Changes made to the templates will affect both themes.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir, $ct->title, $ct->parent_theme); ?></p>
+ <p><?php printf(__('The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. Changes made to the templates will affect both themes.'), $ct->title, str_replace( WP_CONTENT_DIR, '', $ct->template_dir ), str_replace( WP_CONTENT_DIR, '', $ct->stylesheet_dir ), $ct->title, $ct->parent_theme); ?></p>
<?php } else { ?>
- <p><?php printf(__('All of this theme’s files are located in <code>%2$s</code>.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir); ?></p>
+ <p><?php printf(__('All of this theme’s files are located in <code>%2$s</code>.'), $ct->title, str_replace( WP_CONTENT_DIR, '', $ct->template_dir ), str_replace( WP_CONTENT_DIR, '', $ct->stylesheet_dir ) ); ?></p>
<?php } ?>
<?php if ( $ct->tags ) : ?>
<p><?php _e('Tags:'); ?> <?php echo join(', ', $ct->tags); ?></p>
$stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
$template_dir = $themes[$theme_name]['Template Dir'];
$parent_theme = $themes[$theme_name]['Parent Theme'];
+ $theme_root = $themes[$theme_name]['Theme Root'];
+ $theme_root_uri = $themes[$theme_name]['Theme Root URI'];
$preview_link = esc_url(get_option('home') . '/');
if ( is_ssl() )
$preview_link = str_replace( 'http://', 'https://', $preview_link );
?>
<a href="<?php echo $preview_link; ?>" class="<?php echo $thickbox_class; ?> screenshot">
<?php if ( $screenshot ) : ?>
- <img src="<?php echo content_url($stylesheet_dir . '/' . $screenshot); ?>" alt="" />
+ <img src="<?php echo $theme_root_uri . '/' . $stylesheet . '/' . $screenshot; ?>" alt="" />
<?php endif; ?>
</a>
<h3><?php
<span class='action-links'><?php echo $actions ?></span>
<?php if ($parent_theme) {
/* translators: 1: theme title, 2: template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */ ?>
- <p><?php printf(__('The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. Changes made to the templates will affect both themes.'), $title, $template_dir, $stylesheet_dir, $title, $parent_theme); ?></p>
+ <p><?php printf(__('The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. Changes made to the templates will affect both themes.'), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ), $title, $parent_theme); ?></p>
<?php } else { ?>
- <p><?php printf(__('All of this theme’s files are located in <code>%2$s</code>.'), $title, $template_dir, $stylesheet_dir); ?></p>
+ <p><?php printf(__('All of this theme’s files are located in <code>%2$s</code>.'), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ) ); ?></p>
<?php } ?>
<?php if ( $tags ) : ?>
<p><?php _e('Tags:'); ?> <?php echo join(', ', $tags); ?></p>
<h2><?php _e('Broken Themes'); ?></h2>
<p><?php _e('The following themes are installed but incomplete. Themes must have a stylesheet and a template.'); ?></p>
-<table width="100%" cellpadding="3" cellspacing="3">
+<table id="broken-themes">
<tr>
<th><?php _e('Name'); ?></th>
<th><?php _e('Description'); ?></th>
require_once('admin-header.php');
-screen_icon();
?>
<div class="wrap">
+<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<div class="tool-box">
* @return null
*/
function core_upgrade_preamble() {
+ global $upgrade_error;
+
$updates = get_core_updates();
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php _e('Upgrade WordPress'); ?></h2>
<?php
+ if ( $upgrade_error ) {
+ echo '<div class="error"><p>';
+ _e('Please select one or more plugins to upgrade.');
+ echo '</p></div>';
+ }
+
if ( !isset($updates[0]->response) || 'latest' == $updates[0]->response ) {
echo '<h3>';
_e('You have the latest version of WordPress. You do not need to upgrade');
}
echo '</ul>';
dismissed_updates();
+
+ list_plugin_updates();
+ //list_theme_updates();
+ do_action('core_upgrade_preamble');
echo '</div>';
}
+function list_plugin_updates() {
+ global $wp_version;
+
+ $cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
+
+ require_once(ABSPATH . 'wp-admin/includes/plugin-install.php');
+ $plugins = get_plugin_updates();
+ if ( empty($plugins) )
+ return;
+ $form_action = 'update-core.php?action=do-plugin-upgrade';
+
+ $core_updates = get_core_updates();
+ if ( !isset($core_updates[0]->response) || 'latest' == $core_updates[0]->response || 'development' == $core_updates[0]->response )
+ $core_update_version = false;
+ else
+ $core_update_version = $core_updates[0]->current;
+ ?>
+<h3><?php _e('Plugins'); ?></h3>
+<p><?php _e('The following plugins have new versions available. Check the ones you want to upgrade and then click "Upgrade Plugins".'); ?><p>
+<form method="post" action="<?php echo $form_action; ?>" name="upgrade-plugins" class="upgrade">
+<?php wp_nonce_field('upgrade-core'); ?>
+<p><input id="upgrade-plugins" class="button" type="submit" value="<?php esc_attr_e('Upgrade Plugins'); ?>" name="upgrade" /></p>
+<table class="widefat" cellspacing="0" id="update-plugins-table">
+ <thead>
+ <tr>
+ <th scope="col" class="manage-column check-column"><input type="checkbox" /></th>
+ <th scope="col" class="manage-column"><?php _e('Select All'); ?></th>
+ </tr>
+ </thead>
+
+ <tfoot>
+ <tr>
+ <th scope="col" class="manage-column check-column"><input type="checkbox" /></th>
+ <th scope="col" class="manage-column"><?php _e('Select All'); ?></th>
+ </tr>
+ </tfoot>
+ <tbody class="plugins">
+<?php
+ foreach ( (array) $plugins as $plugin_file => $plugin_data) {
+ $info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug ));
+ // Get plugin compat for running version of WordPress.
+ if ( isset($info->tested) && version_compare($info->tested, $cur_wp_version, '>=') ) {
+ $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $cur_wp_version);
+ } elseif ( isset($info->compatibility[$cur_wp_version][$plugin_data->update->new_version]) ) {
+ $compat = $info->compatibility[$cur_wp_version][$plugin_data->update->new_version];
+ $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $cur_wp_version, $compat[0], $compat[2], $compat[1]);
+ } else {
+ $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $cur_wp_version);
+ }
+ // Get plugin compat for updated version of WordPress.
+ if ( $core_update_version ) {
+ if ( isset($info->compatibility[$core_update_version][$plugin_data->update->new_version]) ) {
+ $update_compat = $info->compatibility[$core_update_version][$plugin_data->update->new_version];
+ $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $core_update_version, $update_compat[0], $update_compat[2], $update_compat[1]);
+ } else {
+ $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $core_update_version);
+ }
+ }
+ // Get the upgrade notice for the new plugin version.
+ if ( isset($plugin_data->update->upgrade_notice) ) {
+ $upgrade_notice = '<br />' . strip_tags($plugin_data->update->upgrade_notice);
+ } else {
+ $upgrade_notice = '';
+ }
+ echo "
+ <tr class='active'>
+ <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th>
+ <td class='plugin-title'><strong>{$plugin_data->Name}</strong>" . sprintf(__('You are running version %1$s. Upgrade to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . "</td>
+ </tr>";
+ }
+?>
+ </tbody>
+</table>
+<p><input id="upgrade-plugins-2" class="button" type="submit" value="<?php esc_attr_e('Upgrade Plugins'); ?>" name="upgrade" /></p>
+</form>
+<?php
+}
+
+function list_theme_updates() {
+ $themes = get_theme_updates();
+ if ( empty($themes) )
+ return;
+?>
+<h3><?php _e('Themes'); ?></h3>
+<table class="widefat" cellspacing="0" id="update-themes-table">
+ <thead>
+ <tr>
+ <th scope="col" class="manage-column check-column"><input type="checkbox" /></th>
+ <th scope="col" class="manage-column"><?php _e('Name'); ?></th>
+ </tr>
+ </thead>
+
+ <tfoot>
+ <tr>
+ <th scope="col" class="manage-column check-column"><input type="checkbox" /></th>
+ <th scope="col" class="manage-column"><?php _e('Name'); ?></th>
+ </tr>
+ </tfoot>
+ <tbody class="plugins">
+<?php
+ foreach ( (array) $themes as $stylesheet => $theme_data) {
+ echo "
+ <tr class='active'>
+ <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($stylesheet) . "' /></th>
+ <td class='plugin-title'><strong>{$theme_data->Name}</strong></td>
+ </tr>";
+ }
+?>
+ </tbody>
+</table>
+<?php
+}
/**
* Upgrade WordPress core display.
wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') );
}
+function no_update_actions($actions) {
+ return '';
+}
+
+function do_plugin_upgrade() {
+ include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
+
+ if ( isset($_GET['plugins']) ) {
+ $plugins = explode(',', $_GET['plugins']);
+ } elseif ( isset($_POST['checked']) ) {
+ $plugins = (array) $_POST['checked'];
+ } else {
+ // Nothing to do.
+ return;
+ }
+ $url = 'update-core.php?action=do-plugin-upgrade&plugins=' . urlencode(join(',', $plugins));
+ $title = __('Upgrade Plugins');
+ $nonce = 'upgrade-core';
+ $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) );
+ $upgrader->bulk_upgrade($plugins);
+}
+
$action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core';
+$upgrade_error = false;
+if ( 'do-plugin-upgrade' == $action && !isset($_GET['plugins']) && !isset($_POST['checked']) ) {
+ $upgrade_error = true;
+ $action = 'upgrade-core';
+}
+
+$title = __('Upgrade WordPress');
+$parent_file = 'tools.php';
+
if ( 'upgrade-core' == $action ) {
wp_version_check();
- $title = __('Upgrade WordPress');
- $parent_file = 'tools.php';
require_once('admin-header.php');
core_upgrade_preamble();
- include('admin-footer.php');
} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
check_admin_referer('upgrade-core');
- $title = __('Upgrade WordPress');
- $parent_file = 'tools.php';
// do the (un)dismiss actions before headers,
// so that they can redirect
if ( isset( $_POST['dismiss'] ) )
$reinstall = false;
if ( isset( $_POST['upgrade'] ) )
do_core_upgrade($reinstall);
- include('admin-footer.php');
+} elseif ( 'do-plugin-upgrade' == $action ) {
+ check_admin_referer('upgrade-core');
+ require_once('admin-header.php');
+ do_plugin_upgrade();
+}
-}?>
+include('admin-footer.php');
foreach ($returns as $return) {
$time = substr($return, 0, 19);
$uri = preg_replace('/(.*?) | (.*?)/', '$2', $return);
- $wdpdb->update( $wpdb->links, array('link_updated' => $time), array('link_url' => $uri) );
+ $wpdb->update( $wpdb->links, array('link_updated' => $time), array('link_url' => $uri) );
}
?>
if( isset($_GET['failure']) ){
echo '<p>' . __('Plugin failed to reactivate due to a fatal error.') . '</p>';
- error_reporting( E_ALL ^ E_NOTICE );
+
+ if ( defined('E_RECOVERABLE_ERROR') )
+ error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR);
+ else
+ error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING);
+
@ini_set('display_errors', true); //Ensure that Fatal errors are displayed.
include(WP_PLUGIN_DIR . '/' . $plugin);
}
break;
case 1:
wp_upgrade();
-
+
$backto = empty($_GET['backto']) ? '' : $_GET['backto'] ;
$backto = stripslashes( urldecode( $backto ) );
$backto = esc_url_raw( $backto );
wp_enqueue_script( 'wp-ajax-response' );
wp_enqueue_script( 'jquery-ui-draggable' );
-if (!current_user_can('upload_files'))
+if ( !current_user_can('upload_files') )
wp_die(__('You do not have permission to upload files.'));
-if ( isset($_GET['find_detached'] ) ) {
+if ( isset($_GET['find_detached']) ) {
check_admin_referer('bulk-media');
- if ( ! current_user_can('edit_posts') )
+ if ( !current_user_can('edit_posts') )
wp_die( __('You are not allowed to scan for lost attachments.') );
$all_posts = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'post' OR post_type = 'page'");
$location = $referer;
}
- $location = add_query_arg( array( 'detached' => 1, 'attached' => $attached ) , $location );
+ $location = add_query_arg( array( 'attached' => $attached ) , $location );
wp_redirect($location);
exit;
}
-} elseif ( isset($_GET['action']) && isset($_GET['media']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
+} elseif ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
check_admin_referer('bulk-media');
- $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
- if ( 'delete' == $doaction ) {
- foreach( (array) $_GET['media'] as $post_id_del ) {
- $post_del = & get_post($post_id_del);
-
- if ( !current_user_can('delete_post', $post_id_del) )
- wp_die( __('You are not allowed to delete this post.') );
+ if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
+ $post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='attachment' AND post_status = 'trash'" );
+ $doaction = 'delete';
+ } elseif ( ( $_GET['action'] != -1 || $_GET['action2'] != -1 ) && ( isset($_GET['media']) || isset($_GET['ids']) ) ) {
+ $post_ids = isset($_GET['media']) ? $_GET['media'] : explode(',', $_GET['ids']);
+ $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
+ } else {
+ wp_redirect($_SERVER['HTTP_REFERER']);
+ }
- if ( $post_del->post_type == 'attachment' )
- if ( ! wp_delete_attachment($post_id_del) )
- wp_die( __('Error in deleting...') );
- }
+ $location = 'upload.php';
+ if ( $referer = wp_get_referer() ) {
+ if ( false !== strpos($referer, 'upload.php') )
+ $location = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'message', 'ids', 'posted'), $referer );
+ }
- $location = 'upload.php';
- if ( $referer = wp_get_referer() ) {
- if ( false !== strpos($referer, 'upload.php') )
- $location = $referer;
- }
+ switch ( $doaction ) {
+ case 'trash':
+ foreach( (array) $post_ids as $post_id ) {
+ if ( !current_user_can('delete_post', $post_id) )
+ wp_die( __('You are not allowed to move this post to the trash.') );
- $location = add_query_arg('message', 2, $location);
- $location = remove_query_arg('posted', $location);
- wp_redirect($location);
- exit;
+ if ( !wp_trash_post($post_id) )
+ wp_die( __('Error in moving to trash...') );
+ }
+ $location = add_query_arg( array( 'message' => 4, 'ids' => join(',', $post_ids) ), $location );
+ break;
+ case 'untrash':
+ foreach( (array) $post_ids as $post_id ) {
+ if ( !current_user_can('delete_post', $post_id) )
+ wp_die( __('You are not allowed to move this post out of the trash.') );
+
+ if ( !wp_untrash_post($post_id) )
+ wp_die( __('Error in restoring from trash...') );
+ }
+ $location = add_query_arg('message', 5, $location);
+ break;
+ case 'delete':
+ foreach( (array) $post_ids as $post_id_del ) {
+ if ( !current_user_can('delete_post', $post_id_del) )
+ wp_die( __('You are not allowed to delete this post.') );
+
+ if ( !wp_delete_attachment($post_id_del) )
+ wp_die( __('Error in deleting...') );
+ }
+ $location = add_query_arg('message', 2, $location);
+ break;
}
+
+ wp_redirect($location);
+ exit;
} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
exit;
if ( isset($_GET['detached']) ) {
+ $media_per_page = (int) get_user_option( 'upload_per_page', 0, false );
+ if ( empty($media_per_page) || $media_per_page < 1 )
+ $media_per_page = 20;
+ $media_per_page = apply_filters( 'upload_per_page', $media_per_page );
+
if ( !empty($lost) ) {
- $start = ( $_GET['paged'] - 1 ) * 50;
- $page_links_total = ceil(count($lost) / 50);
+ $start = ( (int) $_GET['paged'] - 1 ) * $media_per_page;
+ $page_links_total = ceil(count($lost) / $media_per_page);
$lost = implode(',', $lost);
- $orphans = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_type = 'attachment' AND ID IN ($lost) LIMIT $start, 50" );
+ $orphans = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_type = 'attachment' AND ID IN (%s) LIMIT %d, %d", $lost, $start, $media_per_page ) );
} else {
- $start = ( $_GET['paged'] - 1 ) * 25;
- $orphans = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent < 1 LIMIT $start, 25" );
- $page_links_total = ceil($wpdb->get_var( "SELECT FOUND_ROWS()" ) / 25);
+ $start = ( (int) $_GET['paged'] - 1 ) * $media_per_page;
+ $orphans = $wpdb->get_results( $wpdb->prepare( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1 LIMIT %d, %d", $start, $media_per_page ) );
+ $page_links_total = ceil($wpdb->get_var( "SELECT FOUND_ROWS()" ) / $media_per_page);
}
- $post_mime_types = array(
- 'image' => array(__('Images'), __('Manage Images'), _n_noop('Image (%s)', 'Images (%s)')),
- 'audio' => array(__('Audio'), __('Manage Audio'), _n_noop('Audio (%s)', 'Audio (%s)')),
- 'video' => array(__('Video'), __('Manage Video'), _n_noop('Video (%s)', 'Video (%s)')),
- );
- $post_mime_types = apply_filters('post_mime_types', $post_mime_types);
-
+ $post_mime_types = get_post_mime_types();
$avail_post_mime_types = get_available_post_mime_types('attachment');
if ( isset($_GET['post_mime_type']) && !array_intersect( (array) $_GET['post_mime_type'], array_keys($post_mime_types) ) )
list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
}
+$is_trash = ( isset($_GET['status']) && $_GET['status'] == 'trash' );
+
wp_enqueue_script('media');
-require_once('admin-header.php'); ?>
+require_once('admin-header.php');
+
+do_action('restrict_manage_posts');
+?>
+
+<div class="wrap">
+<?php screen_icon(); ?>
+<h2><?php echo esc_html( $title ); ?> <a href="media-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a> <?php
+if ( isset($_GET['s']) && $_GET['s'] )
+ printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( get_search_query() ) ); ?>
+</h2>
<?php
+$message = '';
if ( isset($_GET['posted']) && (int) $_GET['posted'] ) {
$_GET['message'] = '1';
$_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
$_SERVER['REQUEST_URI'] = remove_query_arg(array('attached'), $_SERVER['REQUEST_URI']);
}
+if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
+ $_GET['message'] = '2';
+ $_SERVER['REQUEST_URI'] = remove_query_arg(array('deleted'), $_SERVER['REQUEST_URI']);
+}
+
+if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) {
+ $_GET['message'] = '4';
+ $_SERVER['REQUEST_URI'] = remove_query_arg(array('trashed'), $_SERVER['REQUEST_URI']);
+}
+
+if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) {
+ $_GET['message'] = '5';
+ $_SERVER['REQUEST_URI'] = remove_query_arg(array('untrashed'), $_SERVER['REQUEST_URI']);
+}
+
$messages[1] = __('Media attachment updated.');
-$messages[2] = __('Media deleted.');
+$messages[2] = __('Media permanently deleted.');
$messages[3] = __('Error saving media attachment.');
+$messages[4] = __('Media moved to the trash.') . ' <a href="' . esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids='.(isset($_GET['ids']) ? $_GET['ids'] : ''), "bulk-media" ) ) . '">' . __('Undo') . '</a>';
+$messages[5] = __('Media restored from the trash.');
if ( isset($_GET['message']) && (int) $_GET['message'] ) {
$message = $messages[$_GET['message']];
$_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
}
-?>
-
-<?php do_action('restrict_manage_posts'); ?>
-
-<div class="wrap">
-<?php screen_icon(); ?>
-<h2><?php echo esc_html( $title );
-if ( isset($_GET['s']) && $_GET['s'] )
- printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( get_search_query() ) ); ?>
-</h2>
-<?php
-if ( isset($message) ) { ?>
+if ( !empty($message) ) { ?>
<div id="message" class="updated fade"><p><?php echo $message; ?></p></div>
-<?php
-}
-?>
+<?php } ?>
<ul class="subsubsub">
<?php
$type_links = array();
$_num_posts = (array) wp_count_attachments();
-$_total_posts = array_sum( $_num_posts );
+$_total_posts = array_sum($_num_posts) - $_num_posts['trash'];
$matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));
foreach ( $matches as $type => $reals )
foreach ( $reals as $real )
$num_posts[$type] = ( isset( $num_posts[$type] ) ) ? $num_posts[$type] + $_num_posts[$real] : $_num_posts[$real];
-$class = empty($_GET['post_mime_type']) && ! isset($_GET['detached']) ? ' class="current"' : '';
+$class = ( empty($_GET['post_mime_type']) && !isset($_GET['detached']) && !isset($_GET['status']) ) ? ' class="current"' : '';
$type_links[] = "<li><a href='upload.php'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $_total_posts, 'uploaded files' ), number_format_i18n( $_total_posts ) ) . '</a>';
foreach ( $post_mime_types as $mime_type => $label ) {
$class = '';
$type_links[] = "<li><a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';
}
-$class = isset($_GET['detached']) ? ' class="current"' : '';
-$type_links[] = '<li><a href="upload.php?detached=1"' . $class . '>' . __('Unattached') . '</a>';
+$type_links[] = '<li><a href="upload.php?detached=1"' . ( isset($_GET['detached']) ? ' class="current"' : '' ) . '>' . __('Unattached') . '</a>';
+if ( EMPTY_TRASH_DAYS && ( MEDIA_TRASH || !empty($_num_posts['trash']) ) )
+ $type_links[] = '<li><a href="upload.php?status=trash"' . ( (isset($_GET['status']) && $_GET['status'] == 'trash' ) ? ' class="current"' : '') . '>' . sprintf( _nx( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', $_num_posts['trash'], 'uploaded files' ), number_format_i18n( $_num_posts['trash'] ) ) . '</a>';
echo implode( " |</li>\n", $type_links) . '</li>';
unset($type_links);
<div class="alignleft actions">
<select name="action" class="select-action">
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<option value="delete"><?php _e('Delete'); ?></option>
-<?php if ( isset($orphans) ) { ?>
+<?php if ( $is_trash ) { ?>
+<option value="untrash"><?php _e('Restore'); ?></option>
+<?php } if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) { ?>
+<option value="delete"><?php _e('Delete Permanently'); ?></option>
+<?php } else { ?>
+<option value="trash"><?php _e('Move to Trash'); ?></option>
+<?php } if ( isset($orphans) ) { ?>
<option value="attach"><?php _e('Attach to a post'); ?></option>
<?php } ?>
</select>
<?php wp_nonce_field('bulk-media'); ?>
<?php
-if ( ! is_singular() && ! isset($_GET['detached']) ) {
+if ( !is_singular() && !isset($_GET['detached']) && !$is_trash ) {
$arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC";
$arc_result = $wpdb->get_results( $arc_query );
if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) : ?>
<select name='m'>
-<option<?php selected( @$_GET['m'], 0 ); ?> value='0'><?php _e('Show all dates'); ?></option>
+<option value='0'><?php _e('Show all dates'); ?></option>
<?php
foreach ($arc_result as $arc_row) {
if ( $arc_row->yyear == 0 )
continue;
$arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
- if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] )
+ if ( isset($_GET['m']) && ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] ) )
$default = ' selected="selected"';
else
$default = '';
<?php if ( isset($_GET['detached']) ) { ?>
<input type="submit" id="find_detached" name="find_detached" value="<?php esc_attr_e('Scan for lost attachments'); ?>" class="button-secondary" />
+<?php } elseif ( isset($_GET['status']) && $_GET['status'] == 'trash' && current_user_can('edit_others_posts') ) { ?>
+ <input type="submit" id="delete_all" name="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
<?php } ?>
</div>
$att_title = esc_html( _draft_or_post_title($post->ID) );
?>
<tr id='post-<?php echo $post->ID; ?>' class='<?php echo $class; ?>' valign="top">
- <th scope="row" class="check-column"><input type="checkbox" name="media[]" value="<?php echo esc_attr($post->ID); ?>" /></th>
+ <th scope="row" class="check-column"><?php if ( current_user_can('edit_post', $post->ID) ) { ?><input type="checkbox" name="media[]" value="<?php echo esc_attr($post->ID); ?>" /><?php } ?></th>
<td class="media-icon"><?php
if ( $thumb = wp_get_attachment_image( $post->ID, array(80, 60), true ) ) { ?>
if ( current_user_can('edit_post', $post->ID) )
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
if ( current_user_can('delete_post', $post->ID) )
- $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
+ if ( EMPTY_TRASH_DAYS && MEDIA_TRASH )
+ $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>";
+ else
+ $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
if ( current_user_can('edit_post', $post->ID) )
- $actions['attach'] = '<a href="#the-list" onclick="findPosts.open(\'media[]\',\''.$post->ID.'\');return false;">'.__('Attach').'</a>';
+ $actions['attach'] = '<a href="#the-list" onclick="findPosts.open(\'media[]\',\''.$post->ID.'\');return false;" class="hide-if-no-js">'.__('Attach').'</a>';
$actions = apply_filters( 'media_row_actions', $actions, $post );
$action_count = count($actions);
$i = 0;
</tbody>
</table>
-<?php find_posts_div();
+<?php
} else {
include( 'edit-attachment-rows.php' );
<div class="alignleft actions">
<select name="action2" class="select-action">
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<option value="delete"><?php _e('Delete'); ?></option>
-<?php if ( isset($orphans) ) { ?>
+<?php if ($is_trash) { ?>
+<option value="untrash"><?php _e('Restore'); ?></option>
+<?php } if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) { ?>
+<option value="delete"><?php _e('Delete Permanently'); ?></option>
+<?php } else { ?>
+<option value="trash"><?php _e('Move to Trash'); ?></option>
+<?php } if (isset($orphans)) { ?>
<option value="attach"><?php _e('Attach to a post'); ?></option>
<?php } ?>
</select>
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
+
+<?php if ( isset($_GET['status']) && $_GET['status'] == 'trash' && current_user_can('edit_others_posts') ) { ?>
+ <input type="submit" id="delete_all2" name="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
+<?php } ?>
</div>
<br class="clear" />
</div>
+<?php find_posts_div(); ?>
</form>
<br class="clear" />
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
-<form id="your-profile" action="" method="post">
+<form id="your-profile" action="<?php if ( IS_PROFILE_PAGE ) { echo admin_url('profile.php'); } else { echo admin_url('user-edit.php'); } ?>" method="post">
<?php wp_nonce_field('update-user_' . $user_id) ?>
<?php if ( $wp_http_referer ) : ?>
<input type="hidden" name="wp_http_referer" value="<?php echo esc_url($wp_http_referer); ?>" />
<td><input type="text" name="url" id="url" value="<?php echo esc_attr($profileuser->user_url) ?>" class="regular-text code" /></td>
</tr>
+<?php
+ foreach (_wp_get_user_contactmethods() as $name => $desc) {
+?>
<tr>
- <th><label for="aim"><?php echo apply_filters('user_aim_label', __('AIM')); ?></label></th>
- <td><input type="text" name="aim" id="aim" value="<?php echo esc_attr($profileuser->aim) ?>" class="regular-text" /></td>
-</tr>
-
-<tr>
- <th><label for="yim"><?php echo apply_filters('user_yim_label', __('Yahoo IM')); ?></label></th>
- <td><input type="text" name="yim" id="yim" value="<?php echo esc_attr($profileuser->yim) ?>" class="regular-text" /></td>
-</tr>
-
-<tr>
- <th><label for="jabber"><?php echo apply_filters('user_jabber_label', __('Jabber / Google Talk')); ?></label></th>
- <td><input type="text" name="jabber" id="jabber" value="<?php echo esc_attr($profileuser->jabber) ?>" class="regular-text" /></td>
+ <th><label for="<?php echo $name; ?>"><?php echo apply_filters('user_'.$name.'_label', $desc); ?></label></th>
+ <td><input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr($profileuser->$name) ?>" class="regular-text" /></td>
</tr>
+<?php
+ }
+?>
</table>
<h3><?php IS_PROFILE_PAGE ? _e('About Yourself') : _e('About the user'); ?></h3>
<table class="form-table">
<tr>
<th><label for="description"><?php _e('Biographical Info'); ?></label></th>
- <td><textarea name="description" id="description" rows="5" cols="30"><?php echo $profileuser->description ?></textarea><br />
+ <td><textarea name="description" id="description" rows="5" cols="30"><?php echo esc_html($profileuser->description); ?></textarea><br />
<span class="description"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></span></td>
</tr>
}
?>
-<?php if (count($profileuser->caps) > count($profileuser->roles) && apply_filters('additional_capabilities_display', true, $profileuser)): ?>
+<?php if ( count($profileuser->caps) > count($profileuser->roles) && apply_filters('additional_capabilities_display', true, $profileuser) ) { ?>
<br class="clear" />
<table width="99%" style="border: none;" cellspacing="2" cellpadding="3" class="editform">
<tr>
<th scope="row"><?php _e('Additional Capabilities') ?></th>
<td><?php
$output = '';
- foreach($profileuser->caps as $cap => $value) {
- if(!$wp_roles->is_role($cap)) {
- if($output != '') $output .= ', ';
+ foreach ( $profileuser->caps as $cap => $value ) {
+ if ( !$wp_roles->is_role($cap) ) {
+ if ( $output != '' )
+ $output .= ', ';
$output .= $value ? $cap : "Denied: {$cap}";
}
}
?></td>
</tr>
</table>
-<?php endif; ?>
+<?php } ?>
<p class="submit">
<input type="hidden" name="action" value="update" />
<div class="wrap">
<?php screen_icon(); ?>
-<h2><?php echo esc_html( $title );
+<h2><?php echo esc_html( $title ); ?> <a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'user'); ?></a> <?php
if ( isset($_GET['usersearch']) && $_GET['usersearch'] )
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( $_GET['usersearch'] ) ); ?>
</h2>
</form>
</div>
-<?php
- foreach ( array('user_login' => 'user_login', 'first_name' => 'user_firstname', 'last_name' => 'user_lastname', 'email' => 'user_email', 'url' => 'user_uri', 'role' => 'user_role') as $formpost => $var ) {
- $var = 'new_' . $var;
- $$var = isset($_REQUEST[$formpost]) ? esc_attr(stripslashes($_REQUEST[$formpost])) : '';
- }
- unset($name);
-?>
-
<br class="clear" />
<?php
break;
if ( ! current_user_can('switch_themes') )
wp_die( __( 'Cheatin’ uh?' ));
-wp_enqueue_script('admin-widgets');
wp_admin_css( 'widgets' );
+$widgets_access = get_user_setting( 'widgets_access' );
+if ( isset($_GET['widgets-access']) ) {
+ $widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
+ set_user_setting( 'widgets_access', $widgets_access );
+}
+
+if ( 'on' == $widgets_access )
+ add_filter( 'admin_body_class', create_function('', '{return " widgets_access ";}') );
+else
+ wp_enqueue_script('admin-widgets');
+
do_action( 'sidebar_admin_setup' );
$title = __( 'Widgets' );
register_sidebar(array(
'name' => __('Inactive Widgets'),
'id' => 'wp_inactive_widgets',
+ 'description' => '',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
<p class="describe"><?php _e('Select both the sidebar for this widget and the position of the widget in that sidebar.'); ?></p>
<div class="widget-position">
<table class="widefat"><thead><tr><th><?php _e('Sidebar'); ?></th><th><?php _e('Position'); ?></th></tr></thead><tbody>
-<?php foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
+<?php
+ foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr($sbname) . "'" . checked( $sbname, $sidebar, false ) . " /> $sbvalue[name]</label></td><td>";
if ( 'wp_inactive_widgets' == $sbname ) {
echo ' ';
} else {
if ( !isset($sidebars_widgets[$sbname]) || !is_array($sidebars_widgets[$sbname]) ) {
$j = 1;
+ $sidebars_widgets[$sbname] = array();
} else {
$j = count($sidebars_widgets[$sbname]);
if ( isset($_GET['addnew']) || !in_array($widget_id, $sidebars_widgets[$sbname], true) )
<?php if ( isset($_GET['addnew']) ) { ?>
<a href="widgets.php" class="button alignleft"><?php _e('Cancel'); ?></a>
<?php } else { ?>
- <input type="submit" name="removewidget" class="button alignleft" value="<?php esc_attr_e('Remove'); ?>" />
+ <input type="submit" name="removewidget" class="button alignleft" value="<?php esc_attr_e('Delete'); ?>" />
<?php } ?>
<input type="submit" name="savewidget" class="button-primary alignright" value="<?php esc_attr_e('Save Widget'); ?>" />
<input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr($widget_id); ?>" />
exit;
}
-$widgets_access = get_user_setting( 'widgets_access' );
-if ( isset($_GET['widgets-access']) ) {
- $widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
- set_user_setting( 'widgets_access', $widgets_access );
-}
-
-if ( 'on' == $widgets_access )
- add_filter( 'admin_body_class', create_function('', '{return " widgets_access ";}') );
-
$messages = array(
__('Changes saved.')
);
-textarea,
-input,
-select {
- border-width: 1px;
- border-style: solid;
- -moz-border-radius: 4px;
- -khtml-border-radius: 4px;
- -webkit-border-radius: 4px;
- border-radius: 4px;
-}
-
-input[type="checkbox"],
-input[type="radio"],
-input[type="image"] {
- border: 0 none;
-}
-
-p,
-ul,
-ol,
-blockquote,
-input,
-select {
- font-size: 12px;
-}
-
-select option {
- padding: 2px;
-}
-
-.plugins .name,
-#pass-strength-result.strong,
-#pass-strength-result.short,
-.button-highlighted,
-#quicktags #ed_strong,
-#ed_reply_toolbar #ed_reply_strong {
- font-weight: bold;
-}
-
-.plugins p {
- margin: 0 4px;
- padding: 0;
-}
-
-.plugins .desc p {
- margin: 0 0 8px;
-}
-
-.plugins td.desc {
- line-height: 1.5em;
-}
-
-.plugins .desc ul,
-.plugins .desc ol {
- margin: 0 0 0 2em;
-}
-
-.plugins .desc ul {
- list-style-type: disc;
-}
-
-.plugins .action-links {
- white-space: nowrap;
-}
-
-.plugins .row-actions-visible {
- padding: 0;
-}
-
-.widefat tbody.plugins th.check-column {
- padding: 7px 0;
-}
-
-.widefat .plugins td,
-.widefat .plugins th {
- border-bottom: 0 none;
-}
-
-#install-plugins .plugins td,
-#install-plugins .plugins th {
- border-bottom-style: solid;
- border-bottom-width: 1px;
-}
-
-.plugins .inactive td,
-.plugins .inactive th,
-.plugins .active td,
-.plugins .active th {
- border-top-style: solid;
- border-top-width: 1px;
- padding: 5px 7px 0;
-}
-
-#wpbody-content .plugins .plugin-title {
- padding-right: 12px;
-}
-
-.plugins .second td,
-.plugins .second th {
- border-top: 0 none;
- padding: 0 7px 5px;
-}
-
-.plugins-php .widefat tfoot th,
-.plugins-php .widefat tfoot td {
- border-top-style: solid;
- border-top-width: 1px;
-}
-
-.import-system {
- font-size: 16px;
-}
-
-.anchors {
- margin: 10px 20px 10px 20px;
-}
-
-table#availablethemes {
- border-spacing: 0;
- border-width: 1px 0;
- border-style: solid none;
- margin: 10px auto;
- width: 100%;
-}
-
-td.available-theme {
- vertical-align: top;
- width: 240px;
- margin: 0;
- padding: 20px;
- text-align: left;
-}
-
-table#availablethemes td {
- border-width: 0 1px 1px;
- border-style: none solid solid;
-}
-
-table#availablethemes td.right,
-table#availablethemes td.left {
- border-right: 0 none;
- border-left: 0 none;
-}
-
-table#availablethemes td.bottom {
- border-bottom: 0 none;
-}
-
-.available-theme a.screenshot {
- width: 240px;
- height: 180px;
- display: block;
- border-width: 1px;
- border-style: solid;
- margin-bottom: 10px;
- overflow: hidden;
-}
-
-.available-theme img {
- width: 240px;
-}
-
-.available-theme h3 {
- margin: 15px 0 5px;
-}
-
-#current-theme {
- margin: 1em 0 1.5em;
-}
-
-#current-theme a {
- border-bottom: none;
-}
-
-#current-theme h3 {
- font-size: 17px;
- font-weight: normal;
- margin: 0;
-}
-
-#current-theme .theme-description {
- margin-top: 5px;
-}
-
-#current-theme img {
- float: left;
- border-width: 1px;
- border-style: solid;
- margin-right: 1em;
- margin-bottom: 1.5em;
- width: 150px;
-}
-
-#TB_window #TB_title a.tb-theme-preview-link,
-#TB_window #TB_title a.tb-theme-preview-link:visited {
- font-weight: bold;
- text-decoration: none;
-}
-
-#TB_window #TB_title {
- background-color: #222;
- color: #cfcfcf;
-}
-
-.checkbox {
- border: none;
- margin: 0;
- padding: 0;
-}
-
-.code, code {
- font-family: Consolas, Monaco, Courier, monospace;
-}
-
-kbd, code {
- padding: 1px 3px;
- margin: 0 1px;
- font-size: 11px;
-}
-
-.commentlist li {
- padding: 1em 1em .2em;
- margin: 0;
- border-bottom-width: 1px;
- border-bottom-style: solid;
-}
-
-.commentlist li li {
- border-bottom: 0;
- padding: 0;
-}
-
-.commentlist p {
- padding: 0;
- margin: 0 0 .8em;
-}
-
-.post-categories {
- display: inline;
- margin: 0;
- padding: 0;
-}
-
-.post-categories li {
- display: inline;
-}
-
-.quicktags, .search {
- font: 12px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
-}
-
-.submit {
- padding: 1.5em 0;
- margin: 5px 0;
- -moz-border-radius: 0 0 3px 3px;
- -webkit-border-bottom-left-radius: 3px;
- -webkit-border-bottom-right-radius: 3px;
- -khtml-border-bottom-left-radius: 3px;
- -khtml-border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
-form p.submit a.cancel:hover {
- text-decoration: none;
-}
-
-#submitdiv h3,
-#pagesubmitdiv h3 {
- margin-bottom: 0 !important;
-}
-
-#misc-publishing-actions {
- padding: 6px 0 16px 0;
-}
-
-.misc-pub-section {
- padding: 6px;
- border-bottom-width: 1px;
- border-bottom-style: solid;
-}
-
-.misc-pub-section-last {
- border-bottom: 0 none;
-}
-
-#minor-publishing-actions {
- padding: 6px;
- text-align: right;
-}
-
-#minor-publishing {
- border-bottom-width: 1px;
- border-bottom-style: solid;
-}
-
-#save-post {
- float: left;
-}
-
-.preview {
- float: right;
-}
-
-#major-publishing-actions {
- padding: 6px;
- clear: both;
- border-top: none;
-}
-
-#minor-publishing-actions input,
-#major-publishing-actions input,
-#minor-publishing-actions .preview {
- min-width: 80px;
- text-align: center;
-}
-
-#delete-action {
- line-height: 25px;
- vertical-align: middle;
- text-align: left;
- float: left;
-}
-
-#publishing-action {
- text-align: right;
- float: right;
-}
-
-#post-body #minor-publishing {
- padding-bottom: 10px;
-}
-
-#post-body #misc-publishing-actions {
- padding: 0;
-}
-
-#post-body .misc-pub-section {
- border-right-width: 1px;
- border-right-style: solid;
- border-bottom: 0 none;
- min-height: 30px;
- float: left;
- max-width: 32%;
-}
-
-#post-body .misc-pub-section-last {
- border-right: 0;
-}
-
-#sticky-span {
- margin-left: 18px;
-}
-
-#post-status-display,
-#post-visibility-display {
- font-weight: bold;
-}
-
-.side-info {
- margin: 0;
- padding: 4px;
- font-size: 11px;
-}
-
-.side-info h5 {
- padding-bottom: 7px;
- font-size: 14px;
- margin: 12px 2px 5px;
- border-bottom-width: 1px;
- border-bottom-style: solid;
-}
-
-.side-info ul {
- margin: 0;
- padding-left: 18px;
- list-style: square;
-}
-
-.submit input,
-.button,
-.button-primary,
-.button-secondary,
-.button-highlighted,
-#postcustomstuff .submit input {
- text-decoration: none;
- font-size: 11px !important;
- line-height: 16px;
- padding: 2px 8px;
- cursor: pointer;
- border-width: 1px;
- border-style: solid;
- -moz-border-radius: 11px;
- -khtml-border-radius: 11px;
- -webkit-border-radius: 11px;
- border-radius: 11px;
- -moz-box-sizing: content-box;
- -webkit-box-sizing: content-box;
- -khtml-box-sizing: content-box;
- box-sizing: content-box;
-}
-
-a.button,
-a.button-primary,
-a.button-secondary {
- line-height: 1.2em;
- -webkit-border-radius: 10px;
- padding: 4px 10px;
- white-space: nowrap;
-}
-
-#doaction,
-#doaction2 {
- margin-right: 8px;
-}
-
-.tablenav select[name="action"],
-.tablenav select[name="action2"] {
- width: 120px;
-}
-
-.tablenav select[name="m"] {
- width: 120px;
-}
-
-.tablenav select#cat {
- width: 150px;
-}
-
-#wpcontent select {
- padding: 2px;
- height: 2em;
- font-size: 11px;
-}
-
-#wpcontent option {
- padding: 2px;
-}
-
-#timezone_string option {
- margin-left: 1em;
-}
-
-.approve {
- display: none;
-}
-
-.unapproved .approve, .spam .approve {
- display: inline;
-}
-
-.unapproved .unapprove {
- display: none;
-}
-
-.narrow {
- width: 70%;
- margin-bottom: 40px;
-}
-
-.narrow p {
- line-height: 150%;
-}
-
-textarea.all-options, input.all-options {
- width: 250px;
-}
-
-#namediv table {
- width: 100%;
-}
-
-#namediv td.first {
- width: 10px;
- white-space: nowrap;
-}
-
-#namediv input {
- width: 98%;
-}
-
-#namediv p {
- margin: 10px 0;
-}
-
-#wpbody-content .metabox-holder {
- padding-top: 10px;
-}
-
-#content {
- margin: 0;
- width: 100%;
-}
-
-#editorcontainer #content {
- padding: 6px;
- line-height: 150%;
- border: 0 none;
- outline: none;
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- -khtml-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-#editorcontainer,
-#quicktags {
- border-style: solid;
- border-width: 1px;
- border-collapse: separate;
- -moz-border-radius: 6px 6px 0 0;
- -webkit-border-top-right-radius: 6px;
- -webkit-border-top-left-radius: 6px;
- -khtml-border-top-right-radius: 6px;
- -khtml-border-top-left-radius: 6px;
- border-top-right-radius: 6px;
- border-top-left-radius: 6px;
-}
-
-#quicktags {
- padding: 0;
- margin-bottom: -3px;
- border-bottom-width: 3px;
- background-image: url("images/ed-bg.gif");
- background-position: left top;
- background-repeat: repeat-x;
-}
-
-#quicktags #ed_toolbar {
- padding: 2px 4px 0;
-}
-
-#ed_toolbar input,
-#ed_reply_toolbar input {
- margin: 3px 1px 4px;
- line-height: 18px;
- display: inline-block;
- min-width: 26px;
- padding: 2px 4px;
- font-size: 12px;
-}
-
-#ed_reply_toolbar input {
- margin: 1px 2px 1px 1px;
-}
-
-#quicktags #ed_link,
-#ed_reply_toolbar #ed_reply_link {
- text-decoration: underline;
-}
-
-#quicktags #ed_del,
-#ed_reply_toolbar #ed_reply_del {
- text-decoration: line-through;
-}
-
-#quicktags #ed_em,
-#ed_reply_toolbar #ed_reply_em {
- font-style: italic;
-}
-
-#excerpt, .attachmentlinks {
- margin: 0;
- height: 4em;
- width: 98%;
-}
-
-/* post meta postbox */
-#postcustomstuff table,
-#postcustomstuff input,
-#postcustomstuff textarea {
- border-width: 1px;
- border-style: solid;
- -moz-border-radius: 3px;
- -khtml-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-#postcustomstuff .updatemeta,
-#postcustomstuff .deletemeta {
- margin: auto;
-}
-
-#postcustomstuff thead th {
- padding: 5px 8px 8px;
-}
-
-#postcustom #postcustomstuff .submit,
-#pagecustomdiv #postcustomstuff .submit {
- border: 0 none;
- float: none;
- padding: 5px 8px;
-}
-
-#side-sortables #postcustom #postcustomstuff .submit,
-#side-sortables #pagecustomdiv #postcustomstuff .submit {
- padding: 0 5px;
-}
-
-#side-sortables #postcustom #postcustomstuff td.left input,
-#side-sortables #pagecustomdiv #postcustomstuff td.left input {
- margin: 3px 3px 0;
-}
-
-#side-sortables #postcustom #postcustomstuff #the-list textarea,
-#side-sortables #pagecustomdiv #postcustomstuff #the-list textarea {
- height: 85px;
- margin: 3px;
-}
-
-#postcustomstuff table {
- margin: 0;
- width: 100%;
- border-width: 1px;
- border-style: solid;
- border-spacing: 0;
-}
-
-#postcustomstuff table input,
-#postcustomstuff table select,
-#postcustomstuff table textarea {
- width: 95%;
- margin: 8px 0 8px 8px;
-}
-
-#postcustomstuff th.left,
-#postcustomstuff td.left {
- width: 38%;
-}
-
-#postcustomstuff .submit input {
- width: auto;
-}
-
-#postcustomstuff #newmeta .submit {
- padding: 0 8px;
-}
-
-#postcustomstuff table #addmetasub {
- width: auto;
-}
-
-#postcustomstuff #newmetaleft {
- vertical-align: top;
-}
-
-#postcustomstuff #newmetaleft a {
- padding: 0 10px;
- text-decoration: none;
-}
-
-#save {
- width: 15em;
-}
-
-#template div {
- margin-right: 190px;
-}
-
-* html #template div {
- margin-right: 0;
-}
-
-/* A handy div class for hiding controls.
-Some browsers will disable them when you
-set display: none; */
-.zerosize {
- height: 0;
- width: 0;
- margin: 0;
- border: 0;
- padding: 0;
- overflow: hidden;
- position: absolute;
-}
-
-* html #themeselect {
- padding: 0 3px;
- height: 22px;
-}
-
-#your-profile legend {
- font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
- font-size: 22px;
-}
-
-#your-profile #rich_editing {
- border: none;
-}
-
-#howto {
- font-size: 11px;
- margin: 0 5px;
- display: block;
-}
-
-#ajax-response.alignleft {
- margin-left: 2em;
-}
-
-div.nav {
- height: 2em;
- padding: 7px 10px;
- vertical-align: text-top;
- margin: 5px 0;
-}
-
-.nav .button-secondary {
- padding: 2px 4px;
-}
-
-a.page-numbers {
- border-bottom-style: solid;
- border-bottom-width: 2px;
- font-weight: bold;
- margin-right: 1px;
- padding: 0 2px;
-}
-
-p.pagenav {
- margin: 0;
- display: inline;
-}
-
-.pagenav span {
- font-weight: bold;
- margin: 0 6px;
-}
-
-.row-title {
- font-size: 12px !important;
- font-weight: bold;
-}
-
-.column-comment p {
- margin: 0.6em 0;
-}
-
-.column-author img, .column-username img {
- float: left;
- margin-right: 10px;
- margin-top: 3px;
-}
-
-.tablenav a.button-secondary {
- display: block;
- margin: 3px 8px 0 0;
-}
-
-.tablenav {
- clear: both;
- height: 30px;
- margin: 6px 0 4px;
- vertical-align: middle;
-}
-
-.tablenav .tablenav-pages {
- float: right;
- display: block;
- cursor: default;
- height: 30px;
- line-height: 30px;
- font-size: 11px;
-}
-
-.tablenav .tablenav-pages a,
-.tablenav-pages span.current {
- text-decoration: none;
- border: none;
- padding: 3px 6px;
- border-width: 1px;
- border-style: solid;
- -moz-border-radius: 5px;
- -khtml-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
-}
-
-.tablenav .displaying-num {
- margin-right: 10px;
- font-size: 12px;
- font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
- font-style: italic;
-}
-
-.tablenav .actions {
- padding: 2px 8px 0 0;
-}
-
-td.media-icon {
- vertical-align: middle;
- text-align: center;
- width: 80px;
-}
-
-td.media-icon img {
- max-width: 80px;
- max-height: 60px;
-}
-
-#update-nag {
- line-height: 29px;
- font-size: 12px;
- text-align: center;
-}
-
-#update-nag {
- border-width: 1px 0;
- border-style: solid none;
-}
-
-.plugins .plugin-update {
- padding: 0;
-}
-
-.plugin-update .update-message {
- margin: 0 10px 8px 31px;
- font-weight: bold;
-}
-
-#pass-strength-result {
- border-style: solid;
- border-width: 1px;
- float: left;
- margin: 12px 5px 5px 1px;
- padding: 3px 5px;
- text-align: center;
- width: 200px;
-}
-
-.row-actions {
- visibility: hidden;
- padding: 2px 0 0;
-}
-
-tr:hover .row-actions,
-div.comment-item:hover .row-actions {
- visibility: visible;
-}
-
-.row-actions-visible {
- padding: 2px 0 0;
- cursor: pointer;
-}
-
-/* Admin Header */
-#wphead-info {
- margin: 0 0 0 15px;
- padding-right: 15px;
-}
-
-#user_info {
- float: right;
- font-size: 12px;
- line-height: 46px;
- height: 46px;
-}
-
-#user_info p {
- margin: 0;
- padding: 0;
- line-height: 46px;
-}
-
-#wphead {
- height: 46px;
-}
-
-#wphead a,
-#adminmenu a,
-#sidemenu a,
-#taglist a,
-#catlist a,
-#show-settings a {
- text-decoration: none;
-}
-
-#header-logo {
- float: left;
- margin: 7px 0 0 15px;
-}
-
-#wphead h1 {
- font: normal 22px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
- padding: 10px 8px 5px;
- margin: 0;
- float: left;
-}
-
-#wphead h1.long-title {
- font: normal 18px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
- padding: 12px 10px 5px;
-}
-
-#wphead #site-visit-button {
- background-repeat:repeat-x;
- background-position:0 0;
- -moz-border-radius:3px;
- -webkit-border-radius:3px;
- -khtml-border-radius:3px;
- border-radius:3px;
- cursor:pointer; /* to keep IE happy */
- display:-moz-inline-stack; /* to keep FF2 happy */
- display:inline-block;
- font-size: 50%;
- font-style:normal;
- line-height:17px;
- margin-left:5px;
- padding:0 6px;
- vertical-align:middle;
-}
-
-#wphead h1 a:hover {
- text-decoration:none;
-}
-#wphead h1 a:hover #site-title {
- text-decoration:underline;
-}
-
-/* side admin menu */
-#adminmenu * {
- -webkit-user-select: none;
- -moz-user-select: none;
- -khtml-user-select: none;
- user-select: none;
-}
-
-#adminmenu .wp-submenu {
- display: none;
- list-style: none;
- padding: 0;
- margin: 0;
- position: relative;
- z-index: 2;
- border-width: 1px 0 0;
- border-style: solid none none;
-}
-
-#adminmenu .wp-submenu a {
- font: normal 11px/18px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
-}
-
-#adminmenu .wp-submenu li.current,
-#adminmenu .wp-submenu li.current a,
-#adminmenu .wp-submenu li.current a:hover {
- font-weight: bold;
-}
-
-#adminmenu a.menu-top,
-#adminmenu .wp-submenu-head {
- font: normal 13px/18px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
-}
-
-#adminmenu div.wp-submenu-head {
- display: none;
-}
-
-.folded #adminmenu div.wp-submenu-head,
-.folded #adminmenu li.wp-has-submenu div.sub-open {
- display: block;
-}
-
-.folded #adminmenu a.menu-top,
-.folded #adminmenu .wp-submenu,
-.folded #adminmenu li.wp-menu-open .wp-submenu,
-.folded #adminmenu div.wp-menu-toggle {
- display: none;
-}
-
-#adminmenu li.wp-menu-open .wp-submenu,
-.no-js #adminmenu .open-if-no-js .wp-submenu {
- display: block;
-}
-
-#adminmenu div.wp-menu-image {
- float: left;
- width: 28px;
- height: 28px;
-}
-
-#adminmenu li {
- margin: 0;
- padding: 0;
- cursor: pointer;
-}
-
-#adminmenu a {
- display: block;
- line-height: 18px;
- padding: 1px 5px 3px;
-}
-
-#adminmenu li.menu-top {
- min-height: 26px;
-}
-
-#adminmenu a.menu-top {
- line-height: 18px;
- min-width: 10em;
- padding: 5px 5px;
- border-width: 1px 1px 0;
- border-style: solid solid none;
-}
-
-#adminmenu .wp-submenu a {
- margin: 0;
- padding-left: 12px;
- border-width: 0 1px 0 0;
- border-style: none solid none none;
-}
-
-#adminmenu .menu-top-last ul.wp-submenu {
- border-width: 0 0 1px;
- border-style: none none solid;
-}
-
-#adminmenu .wp-submenu li {
- padding: 0;
- margin: 0;
-}
-
-.folded #adminmenu li.menu-top {
- width: 28px;
- height: 30px;
- overflow: hidden;
- border-width: 1px 1px 0;
- border-style: solid solid none;
-}
-
-#adminmenu .menu-top-first a.menu-top,
-.folded #adminmenu li.menu-top-first,
-#adminmenu .wp-submenu .wp-submenu-head {
- border-width: 1px 1px 0;
- border-style: solid solid none;
- -moz-border-radius-topleft :6px;
- -moz-border-radius-topright: 6px;
- -webkit-border-top-right-radius: 6px;
- -webkit-border-top-left-radius: 6px;
- -khtml-border-top-right-radius: 6px;
- -khtml-border-top-left-radius: 6px;
- border-top-right-radius: 6px;
- border-top-left-radius: 6px;
-}
-
-#adminmenu .menu-top-last a.menu-top,
-.folded #adminmenu li.menu-top-last {
- border-width: 1px;
- border-style: solid;
- -moz-border-radius-bottomleft: 6px;
- -moz-border-radius-bottomright: 6px;
- -webkit-border-bottom-right-radius: 6px;
- -webkit-border-bottom-left-radius: 6px;
- -khtml-border-bottom-right-radius: 6px;
- -khtml-border-bottom-left-radius: 6px;
- border-bottom-right-radius: 6px;
- border-bottom-left-radius: 6px;
-}
-
-#adminmenu li.wp-menu-open a.menu-top-last {
- border-bottom: 0 none;
- -moz-border-radius-bottomright: 0;
- -moz-border-radius-bottomleft: 0;
- -webkit-border-bottom-right-radius: 0;
- -webkit-border-bottom-left-radius: 0;
- -khtml-border-bottom-right-radius: 0;
- -khtml-border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 0;
-}
-
-#adminmenu img.wp-menu-image {
- float: left;
- padding: 8px 6px 0;
- opacity: 0.6;
- filter: alpha(opacity=60);
-}
-
-#adminmenu li.menu-top:hover img.wp-menu-image,
-#adminmenu li.wp-has-current-submenu img.wp-menu-image {
- opacity: 1;
- filter: alpha(opacity=100);
-}
-
-.folded #adminmenu img.wp-menu-image {
- padding: 7px 0 0 6px;
-}
-
-#adminmenu li.wp-menu-separator {
- height: 21px;
- padding: 0;
- margin: 0;
-}
-
-#adminmenu a.separator {
- cursor: w-resize;
- height: 20px;
- padding: 0;
-}
-
-.folded #adminmenu a.separator {
- cursor: e-resize;
-}
-
-#adminmenu .wp-menu-separator-last {
- height: 10px;
- width: 1px;
-}
-
-#adminmenu .wp-submenu .wp-submenu-head {
- border-width: 1px;
- border-style: solid;
- padding: 6px 4px 6px 10px;
- cursor: default;
-}
-
-.folded #adminmenu .wp-submenu {
- position: absolute;
- margin: -1px 0 0 28px;
- padding: 0 8px 8px;
- z-index: 999;
- border: 0 none;
-}
-
-.folded #adminmenu .wp-submenu ul {
- width: 140px;
- border-width: 0 0 1px;
- border-style: none none solid;
-}
-
-.folded #adminmenu .wp-submenu li.wp-first-item {
- border-top: 0 none;
-}
-
-.folded #adminmenu .wp-submenu a {
- padding-left: 10px;
-}
-
-.folded #adminmenu a.wp-has-submenu {
- margin-left: 40px;
-}
-
-#adminmenu li.menu-top-last .wp-submenu ul {
- border-width: 0 0 1px;
- border-style: none none solid;
-}
-
-#adminmenu .wp-menu-toggle {
- width: 22px;
- clear: right;
- float: right;
- margin: 1px 0 0;
- height: 27px;
- padding: 1px 2px 0 0;
- cursor: default;
-}
-
-#adminmenu li.wp-has-current-submenu ul {
- border-bottom-width: 1px;
- border-bottom-style: solid;
-}
-
-#adminmenu .wp-menu-image a {
- height: 24px;
-}
-
-#adminmenu .wp-menu-image img {
- padding: 6px 0 0 1px;
-}
-
-/* end side admin menu */
-
-/* comments/plugins bubble in menu */
-#adminmenu #awaiting-mod,
-#adminmenu span.update-plugins,
-#sidemenu li a span.update-plugins {
- position: absolute;
- font-family: Helvetica, Arial, sans-serif;
- font-size: 7pt;
- font-weight: bold;
- margin-top: 2px;
- margin-left: 2px;
- -moz-border-radius: 7px;
- -khtml-border-radius: 7px;
- -webkit-border-radius: 7px;
- border-radius: 7px;
-}
-
-#adminmenu li #awaiting-mod span,
-#adminmenu li span.update-plugins span,
-#sidemenu li a span.update-plugins span {
- float: left;
- display: block;
- height: 1.6em;
- line-height: 1.6em;
- padding: 0 6px;
-}
-
-#adminmenu li span.count-0,
-#sidemenu li a .count-0 {
- display: none;
-}
-/* end menu stuff */
-
-/* comments bubble */
-.post-com-count-wrapper {
- min-width: 22px;
- font-family: Helvetica, Arial, sans-serif;
-}
-
-.post-com-count {
- height: 1.3em;
- line-height: 1.1em;
- display: block;
- text-decoration: none;
- padding: 0 0 6px;
- cursor: pointer;
- background-position: center -80px;
- background-repeat: no-repeat;
-}
-
-.post-com-count span {
- font-size: 9px;
- font-weight: bold;
- height: 1.7em;
- line-height: 1.70em;
- min-width: 0.7em;
- padding: 0 6px;
- display: inline-block;
- cursor: pointer;
- -moz-border-radius: 5px;
- -khtml-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
-}
-
-strong .post-com-count {
- background-position: center -55px;
-}
-
-.post-com-count:hover {
- background-position: center -3px;
-}
-
-.column-response .post-com-count {
- float: left;
- margin-right: 5px;
- text-align: center;
-}
-
-.response-links {
- float: left;
-}
-
-#the-comment-list .attachment-80x60 {
- padding: 4px 8px;
-}
-
-/* Admin Footer */
-#footer {
- margin-top: -45px;
-}
-
-#footer,
-#footer a {
- font-size: 12px;
- font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
- font-style: italic;
-}
-
-#footer p {
- margin: 0;
- padding: 15px;
- line-height: 15px;
-}
-
-#footer a {
- text-decoration: none;
-}
-
-#footer a:hover {
- text-decoration: underline;
-}
-
-/* Tables used on comment.php and option/setting pages */
-
-.form-table {
- border-collapse: collapse;
- margin-top: 0.5em;
- width: 100%;
- margin-bottom: -8px;
- clear: both;
-}
-
-.form-table td,
-#wpbody-content .describe td {
- margin-bottom: 9px;
- padding: 4px 10px 12px;
- line-height: 20px;
- font-size: 11px;
-}
-
-.form-table th,
-.form-wrap label {
- font-weight: normal;
- text-shadow: rgba(255,255,255,1) 0 1px 0;
-}
-
-.form-table th,
-#wpbody-content .describe th {
- vertical-align: top;
- text-align: left;
- padding: 10px;
- width: 200px;
-}
-
-.form-table th.th-full {
- width: auto;
-}
-
-.form-table input,
-.form-table textarea,
-#wpbody-content .describe input,
-#wpbody-content .describe textarea {
- border-width: 1px;
- border-style: solid;
-}
-
-.form-table div.color-option {
- display: block;
- clear: both;
- margin-top: 12px;
-}
-
-.form-table input.tog {
- margin-top: 2px;
- margin-right: 2px;
- float: left;
-}
-
-.form-table table.color-palette {
- vertical-align: bottom;
- float: left;
- margin: -12px 3px 11px;
-}
-
-.form-table .color-palette td {
- border-width: 1px 1px 0;
- border-style: solid solid none;
- height: 10px;
- line-height: 20px;
- width: 10px;
-}
-
-textarea.large-text {
- width: 99%;
-}
-
-.form-table input.regular-text,
-#adduser .form-field input {
- width: 25em;
-}
-
-.form-table input.small-text {
- width: 50px;
-}
-
-#profile-page .form-table textarea {
- width: 500px;
- margin-bottom: 6px;
-}
-
-#profile-page .form-table #rich_editing {
- margin-right: 5px
-}
-
-.form-table .pre {
- padding: 8px;
- margin: 0;
-}
-
-.pre {
- /* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */
- white-space: pre-wrap; /* css-3 */
- white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
- white-space: -pre-wrap; /* Opera 4-6 */
- white-space: -o-pre-wrap; /* Opera 7 */
- word-wrap: break-word; /* Internet Explorer 5.5+ */
-}
-
-table.form-table td .updated {
- font-size: 13px;
-}
-
-/* divs for cats and tags pages */
-
-.form-wrap {
- margin: 10px 0;
- width: 97%;
-}
-
-.form-wrap p,
-.form-wrap label {
- font-size: 11px;
-}
-
-.form-wrap label {
- display: block;
- padding: 2px;
- font-size: 12px;
-}
-
-.form-field input,
-.form-field textarea {
- border-style: solid;
- border-width: 1px;
- width: 95%;
-}
-
-p.description,
-.form-wrap p {
- margin: 2px 0 5px;
-}
-
-p.help,
-p.description,
-span.description,
-.form-wrap p {
- font-size: 12px;
- font-style: italic;
- font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
-}
-
-.form-wrap .form-field {
- margin: 0 0 10px;
- padding: 8px;
-}
-
-.col-wrap h3 {
- margin: 12px 0;
- font-size: 1.1em;
-}
-
-.col-wrap p.submit {
- margin-top: -10px;
-}
-
-.tagcloud {
- width: 97%;
- margin: 0 0 40px;
- text-align: justify;
-}
-
-.tagcloud h3 {
- margin: 2px 0 12px;
-}
-
-/* Post Screen */
-#post-body #normal-sortables {
- min-height: 50px;
-}
-
-#post-body #advanced-sortables {
- min-height: 20px;
-}
-
-.postbox {
- position: relative;
- min-width: 255px;
- width: 99.5%;
-}
-
-#trackback_url {
- width: 99%;
-}
-
-#normal-sortables .postbox .submit {
- background: transparent none;
- border: 0 none;
- float: right;
- padding: 0 12px;
- margin: 0;
-}
-
-#normal-sortables .postbox #replyrow .submit {
- float: none;
- margin: 0;
- padding: 3px 7px;
-}
-
-#side-sortables .submitbox .submit input,
-#side-sortables .submitbox .submit .preview,
-#side-sortables .submitbox .submit a.preview:hover {
- border: 0 none;
-}
-
-#side-sortables .inside-submitbox .insidebox,
-.stuffbox .insidebox {
- margin: 11px 0;
-}
-
-#side-sortables .comments-box,
-#normal-sortables .comments-box {
- border: 0 none;
-}
-
-#side-sortables .comments-box thead th,
-#normal-sortables .comments-box thead th {
- background: transparent;
- padding: 0 7px 4px;
- font-style: italic;
-}
-
-#commentsdiv img.waiting {
- padding-left: 5px;
- vertical-align: middle;
-}
-
-#post-body .tagsdiv #newtag {
- margin-right: 5px;
- width: 16em;
-}
-
-#side-sortables input#post_password {
- width: 94%
-}
-
-#side-sortables .tagsdiv #newtag {
- width: 68%;
-}
-
-#post-status-info {
- border-width: 0 1px 1px;
- border-style: none solid solid;
- width: 100%;
- -moz-border-radius: 0 0 6px 6px;
- -webkit-border-bottom-left-radius: 6px;
- -webkit-border-bottom-right-radius: 6px;
- -khtml-border-bottom-left-radius: 6px;
- -khtml-border-bottom-right-radius: 6px;
- border-bottom-left-radius: 6px;
- border-bottom-right-radius: 6px;
-}
-
-#post-status-info td {
- font-size: 11px;
-}
-
-.autosave-info {
- padding: 2px 15px 2px 2px;
- text-align: right;
-}
-
-#editorcontent #post-status-info {
- border: none;
-}
-
-#post-body .wp_themeSkin .mceStatusbar a.mceResize {
- display: block;
- background: transparent url(images/resize.gif) no-repeat scroll right bottom;
- width: 12px;
- cursor: se-resize;
- margin: 0 2px;
- position: relative;
- top: 22px;
-}
-
-
-#pagesubmitdiv div.inside,
-#linksubmitdiv div.inside,
- div.inside {
- padding: 0;
- margin: 0;
-}
-
-#comment-status-radio p {
- margin: 3px 0 5px;
-}
-
-#comment-status-radio input {
- margin: 2px 3px 5px 0;
- vertical-align: middle;
-}
-
-#comment-status-radio label {
- padding: 5px 0;
-}
-
-.tagchecklist {
- margin-left: 10px;
- font-size: 12px;
- overflow: auto;
-}
-
-.tagchecklist strong {
- margin-left: -8px;
- position: absolute;
-}
-
-.tagchecklist span {
- margin-right: 25px;
- display: block;
- float: left;
- font-size: 11px;
- line-height: 1.8em;
- white-space: nowrap;
- cursor: default;
-}
-
-.tagchecklist span a {
- margin: 6px 0pt 0pt -9px;
- cursor: pointer;
- width: 10px;
- height: 10px;
- display: block;
- float: left;
- text-indent: -9999px;
- overflow: hidden;
- position: absolute;
-}
-
-.howto {
- font-style: italic;
- display: block;
- font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
-}
-
-.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;
-}
-
-#poststuff h2 {
- margin-top: 20px;
- font-size: 1.5em;
- margin-bottom: 15px;
- padding: 0 0 3px;
- clear: left;
-}
-
-.widget .widget-top,
-.postbox h3 {
- cursor: move;
- -webkit-user-select: none;
- -moz-user-select: none;
- -khtml-user-select: none;
- user-select: none;
-}
-
-.postbox .hndle span {
- padding: 6px 0;
-}
-
-.postbox .hndle {
- cursor: move;
-}
-
-.hndle a {
- font-size: 11px;
- font-weight: normal;
-}
-
-#dashboard-widgets .meta-box-sortables {
- margin: 0 5px;
-}
-
-.postbox .handlediv {
- float: right;
- width: 23px;
- height: 26px;
-}
-
-.sortable-placeholder {
- border-width: 1px;
- border-style: dashed;
- margin-bottom: 20px;
-}
-
-#poststuff h3,
-.metabox-holder h3 {
- font-size: 12px;
- font-weight: bold;
- padding: 7px 9px;
- margin: 0;
- line-height: 1;
-}
-
-.widget,
-.postbox,
-.stuffbox {
- margin-bottom: 20px;
- border-width: 1px;
- border-style: solid;
- line-height: 1;
- -moz-border-radius: 6px;
- -khtml-border-radius: 6px;
- -webkit-border-radius: 6px;
- border-radius: 6px;
-}
-
-.widget .widget-top,
-.postbox h3,
-.postbox h3,
-.stuffbox h3 {
- -moz-border-radius: 6px 6px 0 0;
- -webkit-border-top-right-radius: 6px;
- -webkit-border-top-left-radius: 6px;
- -khtml-border-top-right-radius: 6px;
- -khtml-border-top-left-radius: 6px;
- border-top-right-radius: 6px;
- border-top-left-radius: 6px;
-}
-
-.postbox.closed h3 {
- -moz-border-radius-bottomleft:4px;
- -webkit-border-bottom-left-radius: 4px;
- -khtml-border-bottom-left-radius: 4px;
- border-bottom-left-radius: 4px;
- -moz-border-radius-bottomright:4px;
- -webkit-border-bottom-right-radius: 4px;
- -khtml-border-bottom-right-radius: 4px;
- border-bottom-right-radius: 4px;
-}
-
-.postbox table.form-table {
- margin-bottom: 0;
-}
-
-.postbox input[type="text"],
-.postbox textarea,
-.stuffbox input[type="text"],
-.stuffbox textarea {
- border-width: 1px;
- border-style: solid;
-}
-
-#poststuff .inside,
-#poststuff .inside p {
- font-size: 11px;
- margin: 6px;
-}
-
-#poststuff .inside .submitbox p {
- margin: 1em 0;
-}
-
-#post-visibility-select {
- line-height: 1.5em;
- margin-top: 3px;
-}
-
-#poststuff #submitdiv .inside {
- margin: 0;
-}
-
-#titlediv, #poststuff .postarea {
- margin-bottom: 20px;
-}
-
-#titlediv {
- margin-bottom: 20px;
-}
-#titlediv label { cursor: text; }
-
-#titlediv div.inside {
- margin: 0;
-}
-
-#poststuff #titlewrap {
- border: 0;
- padding: 0;
-
-}
-
-#titlediv #title {
- padding: 3px 4px;
- border-width: 1px;
- border-style: solid;
- -moz-border-radius: 6px;
- -khtml-border-radius: 6px;
- -webkit-border-radius: 6px;
- border-radius: 6px;
- font-size: 1.7em;
- width: 100%;
- outline: none;
-}
-
-#poststuff .inside-submitbox,
-#side-sortables .inside-submitbox {
- margin: 0 3px;
- font-size: 11px;
-}
-
-input#link_description,
-input#link_url {
- width: 98%;
-}
-
-#pending {
- background: 0 none;
- border: 0 none;
- padding: 0;
- font-size: 11px;
- margin-top: -1px;
-}
-
-#edit-slug-box {
- height: 1em;
- margin-top: 8px;
- padding: 0 7px;
-}
-
-#editable-post-name-full {
- display: none;
-}
-
-#editable-post-name input {
- width: 16em;
-}
-
-.postarea h3 label {
- float: left;
-}
-
-.postarea #add-media-button {
- float: right;
- margin: 7px 0pt 0pt;
- position: relative;
- right: 10px;
-}
-
-#poststuff #editor-toolbar {
- height: 30px;
-}
-
-.wp_themeSkin tr.mceFirst td.mceToolbar {
- border-width: 0 0 1px;
- border-style: none none solid;
-}
-
-#edButtonPreview,
-#edButtonHTML {
- height: 18px;
- margin: 5px 5px 0 0;
- padding: 4px 5px 2px;
- float: right;
- cursor: pointer;
- border-width: 1px;
- border-style: solid;
- -moz-border-radius: 3px 3px 0 0;
- -webkit-border-top-right-radius: 3px;
- -webkit-border-top-left-radius: 3px;
- -khtml-border-top-right-radius: 3px;
- -khtml-border-top-left-radius: 3px;
- border-top-right-radius: 3px;
- border-top-left-radius: 3px;
-}
-
-.js .theEditor {
- color: white;
-}
-
-#poststuff #edButtonHTML {
- margin-right: 15px;
-}
-
-#media-buttons {
- cursor: default;
- padding: 8px 8px 0;
-}
-
-#media-buttons a {
- cursor: pointer;
- padding: 0 0 5px 10px;
-}
-
-#media-buttons img {
- vertical-align: middle;
-}
-
-.submitbox .submit {
- text-align: left;
- padding: 12px 10px 10px;
- font-size: 11px;
-}
-
-.submitbox .submitdelete {
- border-bottom-width: 1px;
- border-bottom-style: solid;
- text-decoration: none;
- padding: 1px 2px;
-}
-
-.inside-submitbox #post_status {
- margin: 2px 0 2px -2px;
-}
-
-.submitbox .submit a:hover {
- border-bottom-width: 1px;
- border-bottom-style: solid;
-}
-
-.submitbox .submit input {
- margin-bottom: 8px;
- margin-right: 4px;
- padding: 6px;
-}
-
-#post-status-select {
- line-height: 2.5em;
- margin-top: 3px;
-}
-
-/* Categories */
-
-#category-adder {
- margin-left: 120px;
- padding: 4px 0;
-}
-
-#category-adder h4 {
- margin: 0 0 8px;
-}
-
-#side-sortables #category-adder {
- margin: 0;
-}
-
-#post-body #category-add input, #category-add select {
- width: 30%;
-}
-
-#side-sortables #category-add input {
- width: 94%;
-}
-
-#side-sortables #category-add select {
- width: 100%;
-}
-
-#category-add input#category-add-sumbit {
- width: auto;
-}
-
-#post-body ul#category-tabs {
- float: left;
- width: 120px;
- text-align: right;
- /* Negative margin for the sake of those without JS: all tabs display */
- margin: 0 -120px 0 5px;
- padding: 0;
-}
-
-#post-body ul#category-tabs li {
- padding: 8px;
-}
-
-#post-body ul#category-tabs li.tabs {
- -moz-border-radius: 3px 0 0 3px;
- -webkit-border-top-left-radius: 3px;
- -webkit-border-bottom-left-radius: 3px;
- -khtml-border-top-left-radius: 3px;
- -khtml-border-bottom-left-radius: 3px;
- border-top-left-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-
-#post-body ul#category-tabs li.tabs a {
- font-weight: bold;
- text-decoration: none;
-}
-
-#categorydiv div.tabs-panel,
-#linkcategorydiv div.tabs-panel {
- height: 150px;
- overflow: auto;
- padding: 0.5em 0.9em;
- border-style: solid;
- border-width: 1px;
-}
-
-#post-body #categorydiv div.tabs-panel,
-#post-body #linkcategorydiv div.tabs-panel {
- margin: 0 5px 0 125px;
-}
-
-#side-sortables #category-tabs li {
- display: inline;
- padding-right: 8px;
-}
-
-#side-sortables #category-tabs a {
- text-decoration: none;
-}
-
-#side-sortables #category-tabs {
- margin-bottom: 3px;
-}
-
-#categorydiv ul,
-#linkcategorydiv ul {
- list-style: none;
- padding: 0;
- margin: 0;
-}
-
-#categorydiv ul.categorychecklist ul,
-#linkcategorydiv ul.categorychecklist ul {
- margin-left: 18px;
-}
-
-ul.categorychecklist li {
- margin: 0;
- padding: 0;
- line-height: 19px;
-}
-
-#category-adder h4 {
- margin-top: 4px;
- margin-bottom: 0px;
-}
-
-#categorydiv .tabs-panel {
- border-width: 3px;
- border-style: solid;
-}
-
-ul#category-tabs {
- margin-top: 12px;
-}
-
-ul#category-tabs li.tabs {
- border-style: solid solid none;
- border-width: 1px 1px 0;
-}
-
-#post-body #category-tabs li.tabs {
- border-style: solid none solid solid;
- border-width: 1px 0 1px 1px;
- margin-right: -1px;
-}
-
-ul#category-tabs li {
- padding: 5px 8px;
- -moz-border-radius: 3px 3px 0 0;
- -webkit-border-top-left-radius: 3px;
- -webkit-border-top-right-radius: 3px;
- -khtml-border-top-left-radius: 3px;
- -khtml-border-top-right-radius: 3px;
- border-top-left-radius: 3px;
- border-top-right-radius: 3px;
-}
-
-/* positioning etc. */
-
-form#tags-filter {
- position: relative;
-}
-
-p.search-box {
- float: right;
- margin: -5px 0 0;
-}
-
-.screen-per-page {
- width: 3em;
-}
-
-#posts-filter fieldset {
- float: left;
- margin: 0 1.5ex 1em 0;
- padding: 0;
-}
-
-#posts-filter fieldset legend {
- padding: 0 0 .2em 1px;
-}
-
-/* Edit posts */
-
-td.post-title strong, td.plugin-title strong {
- display: block;
- margin-bottom: .2em;
-}
-
-td.post-title p, td.plugin-title p {
- margin: 6px 0;
-}
-
-td.plugin-title {
- white-space: nowrap;
-}
-
-/* Global classes */
-
-.wp-hidden-children .wp-hidden-child,
-.ui-tabs-hide,
-#codepress-off {
- display: none;
-}
-
-.commentlist .avatar {
- vertical-align: text-top;
-}
-
-.defaultavatarpicker .avatar {
- margin: 2px 0;
- vertical-align: middle;
-}
-
-body.wp-admin {
- min-width: 785px;
-}
-
-.view-switch {
- float: right;
- margin: 6px 8px 0;
-}
-
-.view-switch a {
- text-decoration: none;
-}
-
-.filter {
- float: left;
- margin: -5px 0 0 10px;
-}
-
-.filter .subsubsub {
- margin-left: -10px;
- margin-top: 13px;
-}
-
-#the-comment-list td.comment p.comment-author {
- margin-top: 0;
- margin-left: 0;
-}
-
-#the-comment-list p.comment-author img {
- float: left;
- margin-right: 8px;
-}
-
-#the-comment-list p.comment-author strong a {
- border: none;
-}
-
-#the-comment-list td {
- vertical-align: top;
-}
-
-#the-comment-list td.comment {
- word-wrap: break-word;
-}
-
-#the-comment-list .check-column {
- padding-top: 8px;
-}
-
-#templateside ul li a {
- text-decoration: none;
-}
-
-.indicator-hint {
- padding-top: 8px;
-}
-
-#display_name {
- width: 15em;
-}
-
-.tablenav .delete {
- margin-right: 20px;
-}
-
-td.action-links,
-th.action-links {
- text-align: right;
-}
-
-/* Diff */
-
-table.diff {
- width: 100%;
-}
-
-table.diff col.content {
- width: 50%;
-}
-
-table.diff tr {
- background-color: transparent;
-}
-
-table.diff td, table.diff th {
- padding: .5em;
- font-family: Consolas, Monaco, Courier, monospace;
- border: none;
-}
-
-table.diff .diff-deletedline del, table.diff .diff-addedline ins {
- text-decoration: none;
-}
-
-#wp-word-count {
- display: block;
- padding: 2px 7px;
-}
-
-fieldset {
- border: 0;
- padding: 0;
- margin: 0;
-}
-
-.tool-box {
- margin: 15px 0 35px;
-}
-
-.tool-box .buttons {
- margin: 15px 0;
-}
-
-.tool-box .title {
- margin: 8px 0;
- font: 18px/24px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
-}
-
-.pressthis a {
- font-size: 1.2em;
-}
-
-#wp_editbtns,
-#wp_gallerybtns {
- padding: 2px;
- position: absolute;
- display: none;
- z-index: 999998;
-}
-
-#wp_editimgbtn,
-#wp_delimgbtn,
-#wp_editgallery,
-#wp_delgallery {
- margin: 2px;
- padding: 2px;
- border-width: 1px;
- border-style: solid;
- -moz-border-radius: 3px;
- -khtml-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-.settings-toggle {
- text-align: right;
- margin: 5px 7px 15px 0;
- font-size: 12px;
-}
-
-.settings-toggle h3 {
- margin: 0;
-}
-
-#timestampdiv select {
- height: 20px;
- line-height: 20px;
- padding: 0;
-}
-
-#jj, #hh, #mn {
- width: 2em;
- padding: 1px;
- font-size: 12px;
-}
-
-#aa {
- width: 3.4em;
- padding: 1px;
- font-size: 12px;
-}
-
-.curtime #timestamp {
- background-repeat: no-repeat;
- background-position: left top;
- padding-left: 18px;
-}
-
-#timestampdiv {
- padding-top: 5px;
- line-height: 23px;
-}
-
-#timestampdiv p {
- margin: 8px 0 6px;
-}
-
-#timestampdiv input {
- border-width: 1px;
- border-style: solid;
-}
-
-/* media popup 0819 */
-#sidemenu {
- margin: -30px 15px 0 315px;
- list-style: none;
- position: relative;
- float: right;
- padding-left: 10px;
- font-size: 12px;
-}
-
-#sidemenu a {
- padding: 0 7px;
- display: block;
- float: left;
- line-height: 28px;
- border-top-width: 1px;
- border-top-style: solid;
- border-bottom-width: 1px;
- border-bottom-style: solid;
-}
-
-#sidemenu li {
- display: inline;
- line-height: 200%;
- list-style: none;
- text-align: center;
- white-space: nowrap;
- margin: 0;
- padding: 0;
-}
-
-#sidemenu a.current {
- font-weight: normal;
- padding-left: 6px;
- padding-right: 6px;
- -moz-border-radius: 4px 4px 0 0;
- -webkit-border-top-left-radius: 4px;
- -webkit-border-top-right-radius: 4px;
- -khtml-border-top-left-radius: 4px;
- -khtml-border-top-right-radius: 4px;
- border-top-left-radius: 4px;
- border-top-right-radius: 4px;
- border-width: 1px;
- border-style: solid;
-}
-
-#sidemenu {
- margin: -30px 15px 0 315px;
- list-style: none;
- position: relative;
- float: right;
- padding-left: 10px;
- font-size: 12px;
-}
-
-#sidemenu a {
- padding: 0 7px;
- display: block;
- float: left;
- line-height: 28px;
- border-top-width: 1px;
- border-top-style: solid;
- border-bottom-width: 1px;
- border-bottom-style: solid;
-}
-
-#sidemenu li a .count-0 {
- display: none;
-}
-
-/* reply to comments */
-#replyrow {
- font-size: 11px;
-}
-
-#replyrow input {
- border-width: 1px;
- border-style: solid;
-}
-
-#replyrow td {
- padding: 2px;
-}
-
-#replyrow #editorcontainer {
- border: 0 none;
-}
-
-#replysubmit {
- margin: 0;
- padding: 3px 7px;
-}
-
-#replysubmit img.waiting,
-.inline-edit-save img.waiting,
-#commentstatusdiv img.waiting {
- padding: 0 10px;
- vertical-align: top;
-}
-
-#replysubmit .button {
- margin-right: 5px;
-}
-
-#replyrow #editor-toolbar {
- display: none;
-}
-
-#replyhead {
- font-size: 12px;
- font-weight: bold;
- padding: 2px 10px 4px;
-}
-
-#edithead .inside {
- float: left;
- padding: 3px 0 2px 5px;
- margin: 0;
- text-align: center;
- font-size: 11px;
-}
-
-#edithead .inside input {
- width: 180px;
- font-size: 11px;
-}
-
-#edithead label {
- padding: 2px 0;
-}
-
-#replycontainer {
- padding: 5px;
- border: 0 none;
- height: 120px;
- overflow: hidden;
- position: relative;
-}
-
-#replycontent {
- resize: none;
- margin: 0;
- width: 100%;
- height: 100%;
- padding: 0;
- line-height: 150%;
- border: 0 none;
- outline: none;
- font-size: 12px;
-}
-
-#replyrow #ed_reply_toolbar {
- margin: 0;
- padding: 2px 3px;
-}
-
-/* show/hide settings */
-#screen-meta {
- position: relative;
- clear: both;
-}
-
-#screen-meta-links {
- margin: 0 9px 0 0;
-}
-
-#screen-meta .screen-reader-text {
- visibility: hidden;
-}
-
-#screen-options-link-wrap,
-#contextual-help-link-wrap {
- float: right;
- background: transparent url( images/screen-options-left.gif ) no-repeat 0 0;
- font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
- height: 22px;
- padding: 0;
- margin: 0 6px 0 0;
-}
-
-#screen-meta a.show-settings {
- text-decoration: none;
- z-index: 1;
- padding: 0 16px 0 6px;
- height: 22px;
- line-height: 22px;
- font-size: 10px;
- display: block;
- background-repeat: no-repeat;
- background-position: right bottom;
-}
-
-#screen-meta a.show-settings {
- background-image: url( images/screen-options-right.gif );
-}
-
-#screen-meta a.show-settings:hover {
- text-decoration: none;
-}
-
-#screen-options-wrap h5,
-#contextual-help-wrap h5 {
- margin: 8px 0;
- font-size: 13px;
-}
-
-#screen-options-wrap,
-#contextual-help-wrap {
- border-style: none solid solid;
- border-top: 0 none;
- border-width: 0 1px 1px;
- margin: 0 15px;
- padding: 8px 12px 12px;
- -moz-border-radius: 0 0 0 4px;
- -webkit-border-bottom-left-radius: 4px;
- -khtml-border-bottom-left-radius: 4px;
- border-bottom-left-radius: 4px;
-}
-
-.metabox-prefs label {
- padding-right: 15px;
- white-space: nowrap;
- line-height: 30px;
-}
-
-.metabox-prefs label input {
- margin: 0 5px 0 2px;
-}
-
-.metabox-prefs label a {
- display: none;
-}
-
-/* Inline Editor
- .quick-edit* is for Quick Edit
- .bulk-edit* is for Bulk Edit
- .inline-edit* is for everything
-*/
-/* Layout */
-tr.inline-edit-row td {
- padding: 0 0.5em;
-}
-
-#wpbody-content .inline-edit-row fieldset {
- font-size: 12px;
- float: left;
- margin: 0;
- padding: 0;
- width: 100%;
-}
-
-#wpbody-content .inline-edit-row fieldset .inline-edit-col {
- padding: 0 0.5em;
-}
-
-#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col {
- border-width: 0 0 0 1px;
- border-style: none none none solid;
-}
-
-#wpbody-content .quick-edit-row-post .inline-edit-col-left {
- width: 40%;
-}
-
-#wpbody-content .quick-edit-row-post .inline-edit-col-right {
- width: 39%;
-}
-
-#wpbody-content .inline-edit-row-post .inline-edit-col-center {
- width: 20%;
-}
-
-#wpbody-content .quick-edit-row-page .inline-edit-col-left {
- width: 50%;
-}
-
-#wpbody-content .quick-edit-row-page .inline-edit-col-right,
-#wpbody-content .bulk-edit-row-post .inline-edit-col-right {
- width: 49%;
-}
-
-#wpbody-content .bulk-edit-row .inline-edit-col-left {
- width: 30%;
-}
-
-#wpbody-content .bulk-edit-row-page .inline-edit-col-right {
- width: 69%;
-}
-
-#wpbody-content .bulk-edit-row .inline-edit-col-bottom {
- float: right;
- width: 69%;
-}
-
-#wpbody-content .inline-edit-row-page .inline-edit-col-right,
-#owpbody-content .bulk-edit-row-post .inline-edit-col-right {
- margin-top: 27px;
-}
-
-.inline-edit-row fieldset .inline-edit-group {
- clear: both;
-}
-
-.inline-edit-row fieldset .inline-edit-group:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
-}
-
-.inline-edit-row p.submit {
- clear: both;
- padding: 0.5em;
- margin: 0.5em 0 0;
-}
-
-.inline-edit-row span.error {
- line-height: 22px;
- margin: 0 15px;
- padding: 3px 5px;
-}
-
-/* Positioning */
-.inline-edit-row h4 {
- margin: .2em 0;
- padding: 0;
- line-height: 23px;
-}
-.inline-edit-row fieldset span.title,
-.inline-edit-row fieldset span.checkbox-title {
- margin: 0;
- padding: 0;
- line-height: 27px;
-}
-
-.inline-edit-row fieldset label,
-.inline-edit-row fieldset span.inline-edit-categories-label {
- display: block;
- margin: .2em 0;
-}
-
-.inline-edit-row fieldset label.inline-edit-tags {
- margin-top: 0;
-}
-
-.inline-edit-row fieldset label.inline-edit-tags span.title {
- margin: .2em 0;
-}
-
-.inline-edit-row fieldset label span.title {
- display: block;
- float: left;
- width: 5em;
-}
-
-.inline-edit-row fieldset label span.input-text-wrap {
- display: block;
- margin-left: 5em;
-}
-
-.quick-edit-row-post fieldset.inline-edit-col-right label span.title {
- width: auto;
- padding-right: 0.5em;
-}
-
-.inline-edit-row .input-text-wrap input[type=text] {
- width: 100%;
-}
-
-.inline-edit-row fieldset label input[type=checkbox] {
- vertical-align: text-bottom;
-}
-
-.inline-edit-row fieldset label textarea {
- width: 100%;
- height: 4em;
-}
-
-#wpbody-content .bulk-edit-row fieldset .inline-edit-group label {
- max-width: 50%;
-}
-
-#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child {
- margin-right: 0.5em
-}
-
-/* Styling */
-.inline-edit-row h4 {
- text-transform: uppercase;
-}
-
-.inline-edit-row fieldset span.title,
-.inline-edit-row fieldset span.checkbox-title {
- font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
- font-style: italic;
- line-height: 1.8em;
-}
-
-/* Specific Elements */
-.inline-edit-row fieldset input[type="text"],
-.inline-edit-row fieldset textarea {
- border-style: solid;
- border-width: 1px;
-}
-
-.inline-edit-row fieldset .inline-edit-date {
- float: left;
-}
-
-.inline-edit-row fieldset input[name=jj],
-.inline-edit-row fieldset input[name=hh],
-.inline-edit-row fieldset input[name=mn] {
- font-size: 12px;
- width: 2.1em;
-}
-
-.inline-edit-row fieldset input[name=aa] {
- font-size: 12px;
- width: 3.5em;
-}
-
-.inline-edit-row fieldset label input.inline-edit-password-input {
- width: 8em;
-}
-
-.inline-edit-row .catshow,
-.inline-edit-row .cathide {
- cursor: pointer;
-}
-
-ul.cat-checklist {
- height: 12em;
- border-style: solid;
- border-width: 1px;
- overflow-y: scroll;
- padding: 0 5px;
- margin: 0;
-}
-
-#bulk-titles {
- display: block;
- height: 12em;
- border-style: solid;
- border-width: 1px;
- overflow-y: scroll;
- padding: 0 5px;
- margin: 0 0 5px;
-}
-
-.inline-edit-row fieldset ul.cat-checklist li,
-.inline-edit-row fieldset ul.cat-checklist input {
- margin: 0;
-}
-
-.inline-edit-row fieldset ul.cat-checklist label,
-.inline-edit-row .catshow,
-.inline-edit-row .cathide,
-.inline-edit-row #bulk-titles div {
- font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
- font-style: normal;
- font-size: 11px;
-}
-
-table .inline-edit-row fieldset ul.cat-hover {
- height: auto;
- max-height: 30em;
- overflow-y: auto;
- position: absolute;
-}
-
-.inline-edit-row fieldset label input.inline-edit-menu-order-input {
- width: 3em;
-}
-
-.inline-edit-row fieldset label input.inline-edit-slug-input {
- width: 75%;
-}
-
-.quick-edit-row-post fieldset label.inline-edit-status {
- float: left;
-}
-
-#bulk-titles {
- line-height: 140%;
-}
-#bulk-titles div {
- margin: 0.2em 0.3em;
-}
-
-#bulk-titles div a {
- cursor: pointer;
- display: block;
- float: left;
- height: 10px;
- margin: 3px 3px 0 -2px;
- overflow: hidden;
- position: relative;
- text-indent: -9999px;
- width: 10px;
-}
-
-/* Media library */
-#wpbody-content #media-items .describe {
- border-collapse: collapse;
- width: 100%;
- border-top-style: solid;
- border-top-width: 1px;
- clear: both;
- cursor: default;
- padding: 5px;
- width: 100%;
-}
-
-#wpbody-content .describe .media-item-info tr {
- background-color: transparent;
-}
-
-#wpbody-content .filename {
- padding: 0 10px;
-}
-
-#wpbody-content .media-item .thumbnail {
- max-height: 128px;
- max-width: 128px;
-}
-
-#wpbody-content .media-upload-form label {
- display: block;
- font-size: 13px;
- margin: 0.5em;
-}
-
-abbr.required {
- border: medium none;
- text-decoration: none;
-}
-
-#wpbody-content .describe input[type="text"],
-#wpbody-content .describe textarea {
- width: 460px;
-}
-
-#wpbody-content .describe p.help {
- margin: 0;
- padding: 0 0 0 5px;
-}
-
-.describe-toggle-on, .describe-toggle-off {
- display: block;
- line-height: 36px;
- float: right;
- margin-right: 20px;
-}
-
-.describe-toggle-off {
- display: none;
-}
-
-#wpbody-content .media-item {
- border-bottom-style: solid;
- border-bottom-width: 1px;
- min-height: 36px;
- position: relative;
- width: 100%;
-}
-
-#wpbody-content #media-items {
- border-style: solid solid none;
- border-width: 1px;
- width: 670px;
-}
-
-#wpbody-content #media-items .filename {
- line-height: 36px;
- overflow: hidden;
-}
-
-.media-item .pinkynail {
- float: left;
- height: 32px;
- margin: 2px;
- max-width: 40px;
- max-height: 40px;
-}
-
-.media-item .startopen,
-.media-item .startclosed {
- display: none;
-}
-
-.media-item .original {
- position: relative;
- height: 34px;
- text-align: center;
-}
-
-.media-item .percent {
- font-weight: bold;
-}
-
-.crunching {
- display: block;
- line-height: 32px;
- text-align: right;
- margin-right: 5px;
-}
-
-button.dismiss {
- position: absolute;
- top: 7px;
- right: 5px;
- z-index: 4;
- width: 8em;
-}
-
-.file-error {
- float: left;
- font-weight: bold;
- padding: 10px;
-}
-
-.progress {
- position: relative;
- margin-bottom: -36px;
- height: 36px;
-}
-
-.bar {
- width: 0;
- height: 100%;
- border-right-width: 3px;
- border-right-style: solid;
-}
-
-#media-items a.delete,
-#media-items a.del-link {
- padding: 1px 4px 2px;
-}
-
-
-/* find posts */
-.find-box {
- width: 500px;
- height: 300px;
- overflow: hidden;
- padding: 33px 5px 40px;
- position: absolute;
- z-index: 1000;
-}
-
-.find-box-head {
- cursor: move;
- font-weight: bold;
- height: 2em;
- line-height: 2em;
- padding: 1px 12px;
- position: absolute;
- top: 5px;
- width: 100%;
-}
-
-.find-box-inside {
- overflow: auto;
- width: 100%;
- height: 100%;
-}
-
-.find-box-search {
- padding: 12px;
- border-width: 1px;
- border-style: none none solid;
-}
-
-#find-posts-response {
- margin: 8px 0;
- padding: 0 1px;
-}
-
-#find-posts-response table {
- width: 100%;
-}
-
-#find-posts-response .found-radio {
- padding: 5px 0 0 8px;
- width: 15px;
-}
-
-.find-box-buttons {
- width: 480px;
- margin: 8px;
-}
-
-.find-box-search label {
- padding-right: 6px;
-}
-
-.find-box #resize-se {
- position: absolute;
- right: 1px;
- bottom: 1px;
-}
-
-/* favorite-actions */
-#favorite-actions {
- float: right;
- margin: 11px 12px 0;
- min-width: 130px;
- position: relative;
-}
-
-#favorite-first {
- -moz-border-radius: 12px;
- -khtml-border-radius: 12px;
- -webkit-border-radius: 12px;
- border-radius: 12px;
- line-height: 15px;
- padding: 3px 30px 4px 12px;
- border-width: 1px;
- border-style: solid;
-}
-
-#favorite-inside {
- margin: 0 0 0 0px;
- padding: 0 1px 6px 1px;
- border-width: 1px;
- border-style: solid;
- position: absolute;
- z-index: 11;
- display: none;
- -moz-border-radius: 0 0 12px 12px;
- -webkit-border-bottom-right-radius: 12px;
- -webkit-border-bottom-left-radius: 12px;
- -khtml-border-bottom-right-radius: 12px;
- -khtml-border-bottom-left-radius: 12px;
- border-bottom-right-radius: 12px;
- border-bottom-left-radius: 12px;
-}
-
-#favorite-actions a {
- display: block;
- text-decoration: none;
- font-size: 11px;
-}
-
-#favorite-inside a {
- padding: 3px 5px 3px 10px;
-}
-
-#favorite-toggle {
- height: 22px;
- position: absolute;
- right: 0;
- top: 1px;
- width: 28px;
-}
-
-#favorite-actions .slide-down {
- -moz-border-radius: 12px 12px 0 0;
- -webkit-border-bottom-right-radius: 0;
- -webkit-border-bottom-left-radius: 0;
- -khtml-border-bottom-right-radius: 0;
- -khtml-border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 0;
- border-bottom-width: 1px;
- border-bottom-style: solid;
-}
-
-#utc-time, #local-time {
- padding-left: 25px;
- font-style: italic;
- font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
-}
-
-ul#dismissed-updates {
- display: none;
-}
-form.upgrade {
- margin-top: 8px;
-}
-
-form.upgrade .hint {
- font-style: italic;
- font-size: 85%;
- margin: -0.5em 0 2em 0;
-}
-
-#poststuff .inside .the-tagcloud {
- margin: 5px 0 10px;
- padding: 8px;
- border-width: 1px;
- border-style: solid;
- line-height: 1.8em;
- word-spacing: 3px;
- -moz-border-radius: 6px;
- -khtml-border-radius: 6px;
- -webkit-border-radius: 6px;
- border-radius: 6px;
-}
-
-br.clear {
- height: 2px;
- line-height: 2px;
-}
-
-.swfupload {
- margin: 5px 10px;
- vertical-align: middle;
-}
-
-/* table.fixed column width */
-table.fixed {
- table-layout: fixed;
-}
-
-.fixed .column-rating,
-.fixed .column-visible {
- width: 8%;
-}
-
-.fixed .column-date,
-.fixed .column-parent,
-.fixed .column-links {
- width: 10%;
-}
-
-.fixed .column-response,
-.fixed .column-author,
-.fixed .column-categories,
-.fixed .column-tags,
-.fixed .column-rel,
-.fixed .column-role {
- width: 15%;
-}
-
-.fixed .column-comments {
- width: 4em;
- padding-top: 8px;
-}
-
-.fixed .column-slug {
- width: 25%;
-}
-
-.fixed .column-posts {
- width: 10%;
-}
-
-.fixed .column-icon {
- width: 80px;
-}
-
-#commentstatusdiv .fixed .column-author,
-#comments-form .fixed .column-author,
-#commentstatusdiv .fixed .column-date {
- width: 20%;
-}
-
-.widefat th,
-.widefat td {
- overflow: hidden;
-}
-
-.widefat td p {
- margin: 2px 0 0.8em;
-}
-
-table .vers,
-table .column-visible,
-table .column-rating {
- text-align: center;
-}
-
-.icon32 {
- float: left;
- height: 36px;
- margin: 14px 6px 0 0;
- width: 36px;
-}
-
-.key-labels label {
- line-height: 24px;
-}
-
-.subtitle {
- font-size: 0.75em;
- line-height: 1;
- padding-left: 25px;
-}
-
-ol {
- list-style-type: decimal;
- margin-left: 2em;
-}
-
-.postbox-container {
- float: left;
- padding-right: 0.5%;
-}
-
-.postbox-container .meta-box-sortables {
- min-height: 300px;
-}
-
-.temp-border {
- border: 1px dotted #ccc;
-}
-
-.columns-prefs label {
- padding: 0 5px;
-}
-
-.theme-install-php h4,
-.plugin-install-php h4 {
- margin: 2.5em 0 8px;
-}
-
-p.install-help {
- margin: 8px 0;
- font-style: italic;
-}
-
-p.popular-tags {
- -moz-border-radius: 8px;
- -khtml-border-radius: 8px;
- -webkit-border-radius: 8px;
- border-radius: 8px;
- border-width: 1px;
- border-style: solid;
- line-height: 2em;
- padding: 8px 12px 12px;
- text-align: justify;
-}
-
-p.popular-tags a {
- padding: 0 3px;
-}
-
-.stuffbox .editcomment {
- clear: none;
-}
-
-.ajax-feedback {
- visibility: hidden;
- vertical-align: bottom;
-}
-
-.tagsdiv .newtag {
- width: 180px;
-}
-
-.tagsdiv .the-tags {
- display: block;
- height: 60px;
- margin: 0 auto;
- overflow: auto;
- width: 260px;
-}
-
-#post-body-content .tagsdiv .the-tags {
- margin: 0 5px;
-}
-
-label,
-#your-profile label + a {
- vertical-align: middle;
-}
-
-.plugin-update-tr .update-message {
- margin: 5px;
- padding: 3px 5px;
- border-width: 1px;
- border-style: solid;
- -moz-border-radius: 5px;
- -khtml-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
-}
+textarea,input[type="text"],input[type="password"],input[type="file"],input[type="button"],input[type="submit"],input[type="reset"],select{border-width:1px;border-style:solid;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}p,ul,ol,blockquote,input,select{font-size:12px;}select option{padding:2px;}.plugins .name,#pass-strength-result.strong,#pass-strength-result.short,.button-highlighted,#quicktags #ed_strong,#ed_reply_toolbar #ed_reply_strong{font-weight:bold;}.plugins p{margin:0 4px;padding:0;}.plugins .desc p{margin:0 0 8px;}.plugins td.desc{line-height:1.5em;}.plugins .desc ul,.plugins .desc ol{margin:0 0 0 2em;}.plugins .desc ul{list-style-type:disc;}.plugins .action-links{white-space:nowrap;}.plugins .row-actions-visible{padding:0;}.widefat tbody.plugins th.check-column{padding:7px 0;}.widefat .plugins td,.widefat .plugins th{border-bottom:0 none;}#install-plugins .plugins td,#install-plugins .plugins th{border-bottom-style:solid;border-bottom-width:1px;}.plugins .inactive td,.plugins .inactive th,.plugins .active td,.plugins .active th{border-top-style:solid;border-top-width:1px;padding:5px 7px 0;}#wpbody-content .plugins .plugin-title{padding-right:12px;}.plugins .second td,.plugins .second th{border-top:0 none;padding:0 7px 5px;}.plugins-php .widefat tfoot th,.plugins-php .widefat tfoot td{border-top-style:solid;border-top-width:1px;}.import-system{font-size:16px;}.anchors{margin:10px 20px 10px 20px;}table#availablethemes{border-spacing:0;border-width:1px 0;border-style:solid none;margin:10px auto;width:100%;}td.available-theme{vertical-align:top;width:240px;margin:0;padding:20px;text-align:left;}table#availablethemes td{border-width:0 1px 1px;border-style:none solid solid;}table#availablethemes td.right,table#availablethemes td.left{border-right:0 none;border-left:0 none;}table#availablethemes td.bottom{border-bottom:0 none;}.available-theme a.screenshot{width:240px;height:180px;display:block;border-width:1px;border-style:solid;margin-bottom:10px;overflow:hidden;}.available-theme img{width:240px;}.available-theme h3{margin:15px 0 5px;}#current-theme{margin:1em 0 1.5em;}#current-theme a{border-bottom:none;}#current-theme h3{font-size:17px;font-weight:normal;margin:0;}#current-theme .theme-description{margin-top:5px;}#current-theme img{float:left;border-width:1px;border-style:solid;margin-right:1em;margin-bottom:1.5em;width:150px;}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{font-weight:bold;text-decoration:none;}#TB_window #TB_title{background-color:#222;color:#cfcfcf;}.checkbox{border:none;margin:0;padding:0;}.code,code{font-family:Consolas,Monaco,Courier,monospace;}kbd,code{padding:1px 3px;margin:0 1px;font-size:11px;}.commentlist li{padding:1em 1em .2em;margin:0;border-bottom-width:1px;border-bottom-style:solid;}.commentlist li li{border-bottom:0;padding:0;}.commentlist p{padding:0;margin:0 0 .8em;}.post-categories{display:inline;margin:0;padding:0;}.post-categories li{display:inline;}.quicktags,.search{font:12px Georgia,"Times New Roman","Bitstream Charter",Times,serif;}.submit{padding:1.5em 0;margin:5px 0;-moz-border-radius:0 0 3px 3px;-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;-khtml-border-bottom-left-radius:3px;-khtml-border-bottom-right-radius:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px;}form p.submit a.cancel:hover{text-decoration:none;}#submitdiv h3{margin-bottom:0!important;}#misc-publishing-actions{padding:6px 0 16px 0;}.misc-pub-section{padding:6px;border-bottom-width:1px;border-bottom-style:solid;}.misc-pub-section-last{border-bottom:0 none;}#minor-publishing-actions{padding:6px;text-align:right;}#minor-publishing{border-bottom-width:1px;border-bottom-style:solid;}#save-post{float:left;}.preview{float:right;}#major-publishing-actions{padding:6px;clear:both;border-top:none;}#minor-publishing-actions input,#major-publishing-actions input,#minor-publishing-actions .preview{min-width:80px;text-align:center;}#delete-action{line-height:25px;vertical-align:middle;text-align:left;float:left;}#publishing-action{text-align:right;float:right;line-height:23px;}#post-body #minor-publishing{padding-bottom:10px;}#post-body #misc-publishing-actions{padding:0;}#post-body .misc-pub-section{border-right-width:1px;border-right-style:solid;border-bottom:0 none;min-height:30px;float:left;max-width:32%;}#post-body .misc-pub-section-last{border-right:0;}#sticky-span{margin-left:18px;}#post-status-display,#post-visibility-display{font-weight:bold;}.side-info{margin:0;padding:4px;font-size:11px;}.side-info h5{padding-bottom:7px;font-size:14px;margin:12px 2px 5px;border-bottom-width:1px;border-bottom-style:solid;}.side-info ul{margin:0;padding-left:18px;list-style:square;}.submit input,.button,.button-primary,.button-secondary,.button-highlighted,#postcustomstuff .submit input{text-decoration:none;font-size:11px!important;line-height:14px;padding:2px 8px;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-khtml-box-sizing:content-box;box-sizing:content-box;}a.button,a.button-primary,a.button-secondary{line-height:15px;padding:3px 10px;white-space:nowrap;-webkit-border-radius:10px;}#doaction,#doaction2,#post-query-submit{margin-right:8px;}.tablenav select[name="action"],.tablenav select[name="action2"]{width:130px;}.tablenav select[name="m"]{width:155px;}.tablenav select#cat{width:170px;}#wpcontent select{padding:2px;height:2em;font-size:11px;}#wpcontent option{padding:2px;}#timezone_string option{margin-left:1em;}.approve{display:none;}.unapproved .approve,.spam .approve,.trash .approve{display:inline;}.unapproved .unapprove{display:none;}.narrow{width:70%;margin-bottom:40px;}.narrow p{line-height:150%;}textarea.all-options,input.all-options{width:250px;}#namediv table{width:100%;}#namediv td.first{width:10px;white-space:nowrap;}#namediv input{width:98%;}#namediv p{margin:10px 0;}#wpbody-content .metabox-holder{padding-top:10px;}#content{margin:0;width:100%;}#editorcontainer #content{padding:6px;line-height:150%;border:0 none;outline:none;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-khtml-box-sizing:border-box;box-sizing:border-box;}#editorcontainer,#quicktags{border-style:solid;border-width:1px;border-collapse:separate;-moz-border-radius:6px 6px 0 0;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-right-radius:6px;-khtml-border-top-left-radius:6px;border-top-right-radius:6px;border-top-left-radius:6px;}#quicktags{padding:0;margin-bottom:-3px;border-bottom-width:3px;background-image:url("images/ed-bg.gif");background-position:left top;background-repeat:repeat-x;}#quicktags #ed_toolbar{padding:2px 4px 0;}#ed_toolbar input,#ed_reply_toolbar input{margin:3px 1px 4px;line-height:18px;display:inline-block;min-width:26px;padding:2px 4px;font-size:12px;}#ed_reply_toolbar input{margin:1px 2px 1px 1px;}#quicktags #ed_link,#ed_reply_toolbar #ed_reply_link{text-decoration:underline;}#quicktags #ed_del,#ed_reply_toolbar #ed_reply_del{text-decoration:line-through;}#quicktags #ed_em,#ed_reply_toolbar #ed_reply_em{font-style:italic;}#excerpt,.attachmentlinks{margin:0;height:4em;width:98%;}#postcustomstuff table,#postcustomstuff input,#postcustomstuff textarea{border-width:1px;border-style:solid;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}#postcustomstuff .updatemeta,#postcustomstuff .deletemeta{margin:auto;}#postcustomstuff thead th{padding:5px 8px 8px;}#postcustom #postcustomstuff .submit{border:0 none;float:none;padding:5px 8px;}#side-sortables #postcustom #postcustomstuff .submit{padding:0 5px;}#side-sortables #postcustom #postcustomstuff td.left input{margin:3px 3px 0;}#side-sortables #postcustom #postcustomstuff #the-list textarea{height:85px;margin:3px;}#postcustomstuff table{margin:0;width:100%;border-width:1px;border-style:solid;border-spacing:0;}#postcustomstuff table input,#postcustomstuff table select,#postcustomstuff table textarea{width:95%;margin:8px 0 8px 8px;}#postcustomstuff th.left,#postcustomstuff td.left{width:38%;}#postcustomstuff .submit input{width:auto;}#postcustomstuff #newmeta .submit{padding:0 8px;}#postcustomstuff table #addmetasub{width:auto;}#postcustomstuff #newmetaleft{vertical-align:top;}#postcustomstuff #newmetaleft a{padding:0 10px;text-decoration:none;}#save{width:15em;}#template div{margin-right:190px;}* html #template div{margin-right:0;}.zerosize{height:0;width:0;margin:0;border:0;padding:0;overflow:hidden;position:absolute;}* html #themeselect{padding:0 3px;height:22px;}#your-profile legend{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:22px;}#your-profile #rich_editing{border:none;}#howto{font-size:11px;margin:0 5px;display:block;}#ajax-response.alignleft{margin-left:2em;}div.nav{height:2em;padding:7px 10px;vertical-align:text-top;margin:5px 0;}.nav .button-secondary{padding:2px 4px;}a.page-numbers{border-bottom-style:solid;border-bottom-width:2px;font-weight:bold;margin-right:1px;padding:0 2px;}p.pagenav{margin:0;display:inline;}.pagenav span{font-weight:bold;margin:0 6px;}.row-title{font-size:12px!important;font-weight:bold;}.widefat .column-comment p{margin:.6em 0;}.column-author img,.column-username img{float:left;margin-right:10px;margin-top:3px;}.tablenav a.button-secondary{display:block;margin:3px 8px 0 0;}.tablenav{clear:both;height:30px;margin:6px 0 4px;vertical-align:middle;}.tablenav .tablenav-pages{float:right;display:block;cursor:default;height:30px;line-height:30px;font-size:11px;}.tablenav .tablenav-pages a,.tablenav-pages span.current{text-decoration:none;border:none;padding:3px 6px;border-width:1px;border-style:solid;-moz-border-radius:5px;-khtml-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;}.tablenav .displaying-num{margin-right:10px;font-size:12px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-style:italic;}.tablenav .actions{padding:2px 8px 0 0;}td.media-icon{text-align:center;width:80px;padding-top:8px;}td.media-icon img{max-width:80px;max-height:60px;}#update-nag{line-height:29px;font-size:12px;text-align:center;}#update-nag{border-width:1px 0;border-style:solid none;}.plugins .plugin-update{padding:0;}.plugin-update .update-message{margin:0 10px 8px 31px;font-weight:bold;}#pass-strength-result{border-style:solid;border-width:1px;float:left;margin:12px 5px 5px 1px;padding:3px 5px;text-align:center;width:200px;}.row-actions{visibility:hidden;padding:2px 0 0;}tr:hover .row-actions,div.comment-item:hover .row-actions{visibility:visible;}.row-actions-visible{padding:2px 0 0;cursor:pointer;}#wphead-info{margin:0 0 0 15px;padding-right:15px;}#user_info{float:right;font-size:12px;line-height:46px;height:46px;}#user_info p{margin:0;padding:0;line-height:46px;}#wphead{height:46px;}#wphead a,#adminmenu a,#sidemenu a,#taglist a,#catlist a,#show-settings a{text-decoration:none;}#header-logo{float:left;margin:7px 0 0 15px;}#wphead h1{font:normal 22px Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding:10px 8px 5px;margin:0;float:left;}#wphead h1.long-title{font:normal 18px Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding:12px 10px 5px;}#wphead #site-visit-button{background-repeat:repeat-x;background-position:0 0;-moz-border-radius:3px;-webkit-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;cursor:pointer;display:-moz-inline-stack;display:inline-block;font-size:50%;font-style:normal;line-height:17px;margin-left:5px;padding:0 6px;vertical-align:middle;}#wphead h1 a:hover{text-decoration:none;}#wphead h1 a:hover #site-title{text-decoration:underline;}#adminmenu *{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;user-select:none;}#adminmenu .wp-submenu{display:none;list-style:none;padding:0;margin:0;position:relative;z-index:2;border-width:1px 0 0;border-style:solid none none;}#adminmenu .wp-submenu a{font:normal 11px/18px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{font-weight:bold;}#adminmenu a.menu-top,#adminmenu .wp-submenu-head{font:normal 13px/18px Georgia,"Times New Roman","Bitstream Charter",Times,serif;}#adminmenu div.wp-submenu-head{display:none;}.folded #adminmenu div.wp-submenu-head,.folded #adminmenu li.wp-has-submenu div.sub-open{display:block;}.folded #adminmenu a.menu-top,.folded #adminmenu .wp-submenu,.folded #adminmenu li.wp-menu-open .wp-submenu,.folded #adminmenu div.wp-menu-toggle{display:none;}#adminmenu li.wp-menu-open .wp-submenu,.no-js #adminmenu .open-if-no-js .wp-submenu{display:block;}#adminmenu div.wp-menu-image{float:left;width:28px;height:28px;}#adminmenu li{margin:0;padding:0;cursor:pointer;}#adminmenu a{display:block;line-height:18px;padding:1px 5px 3px;}#adminmenu li.menu-top{min-height:26px;}#adminmenu a.menu-top{line-height:18px;min-width:10em;padding:5px 5px;border-width:1px 1px 0;border-style:solid solid none;}#adminmenu .wp-submenu a{margin:0;padding-left:12px;border-width:0 1px 0 0;border-style:none solid none none;}#adminmenu .menu-top-last ul.wp-submenu{border-width:0 0 1px;border-style:none none solid;}#adminmenu .wp-submenu li{padding:0;margin:0;}.folded #adminmenu li.menu-top{width:28px;height:30px;overflow:hidden;border-width:1px 1px 0;border-style:solid solid none;}#adminmenu .menu-top-first a.menu-top,.folded #adminmenu li.menu-top-first,#adminmenu .wp-submenu .wp-submenu-head{border-width:1px 1px 0;border-style:solid solid none;-moz-border-radius-topleft:6px;-moz-border-radius-topright:6px;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-right-radius:6px;-khtml-border-top-left-radius:6px;border-top-right-radius:6px;border-top-left-radius:6px;}#adminmenu .menu-top-last a.menu-top,.folded #adminmenu li.menu-top-last{border-width:1px;border-style:solid;-moz-border-radius-bottomleft:6px;-moz-border-radius-bottomright:6px;-webkit-border-bottom-right-radius:6px;-webkit-border-bottom-left-radius:6px;-khtml-border-bottom-right-radius:6px;-khtml-border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-bottom-left-radius:6px;}#adminmenu li.wp-menu-open a.menu-top-last{border-bottom:0 none;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;}#adminmenu .wp-menu-image img{float:left;padding:8px 6px 0;opacity:.6;filter:alpha(opacity=60);}#adminmenu li.menu-top:hover .wp-menu-image img,#adminmenu li.wp-has-current-submenu .wp-menu-image img{opacity:1;filter:alpha(opacity=100);}#adminmenu li.wp-menu-separator{height:21px;padding:0;margin:0;}#adminmenu a.separator{cursor:w-resize;height:20px;padding:0;}.folded #adminmenu a.separator{cursor:e-resize;}#adminmenu .wp-menu-separator-last{height:10px;width:1px;}#adminmenu .wp-submenu .wp-submenu-head{border-width:1px;border-style:solid;padding:6px 4px 6px 10px;cursor:default;}.folded #adminmenu .wp-submenu{position:absolute;margin:-1px 0 0 28px;padding:0 8px 8px;z-index:999;border:0 none;}.folded #adminmenu .wp-submenu ul{width:140px;border-width:0 0 1px;border-style:none none solid;}.folded #adminmenu .wp-submenu li.wp-first-item{border-top:0 none;}.folded #adminmenu .wp-submenu a{padding-left:10px;}.folded #adminmenu a.wp-has-submenu{margin-left:40px;}#adminmenu li.menu-top-last .wp-submenu ul{border-width:0 0 1px;border-style:none none solid;}#adminmenu .wp-menu-toggle{width:22px;clear:right;float:right;margin:1px 0 0;height:27px;padding:1px 2px 0 0;cursor:default;}#adminmenu li.wp-has-current-submenu ul{border-bottom-width:1px;border-bottom-style:solid;}#adminmenu .wp-menu-image a{height:24px;}#adminmenu .wp-menu-image img{padding:6px 0 0 1px;}#adminmenu #awaiting-mod,#adminmenu span.update-plugins,#sidemenu li a span.update-plugins{position:absolute;font-family:Helvetica,Arial,sans-serif;font-size:7pt;font-weight:bold;margin-top:2px;margin-left:2px;-moz-border-radius:7px;-khtml-border-radius:7px;-webkit-border-radius:7px;border-radius:7px;}#adminmenu li #awaiting-mod span,#adminmenu li span.update-plugins span,#sidemenu li a span.update-plugins span{float:left;display:block;height:1.6em;line-height:1.6em;padding:0 6px;}#adminmenu li span.count-0,#sidemenu li a .count-0{display:none;}.post-com-count-wrapper{min-width:22px;font-family:Helvetica,Arial,sans-serif;}.post-com-count{height:1.3em;line-height:1.1em;display:block;text-decoration:none;padding:0 0 6px;cursor:pointer;background-position:center -80px;background-repeat:no-repeat;}.post-com-count span{font-size:9px;font-weight:bold;height:1.7em;line-height:1.70em;min-width:.7em;padding:0 6px;display:inline-block;cursor:pointer;-moz-border-radius:5px;-khtml-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;}strong .post-com-count{background-position:center -55px;}.post-com-count:hover{background-position:center -3px;}.column-response .post-com-count{float:left;margin-right:5px;text-align:center;}.response-links{float:left;}#the-comment-list .attachment-80x60{padding:4px 8px;}#footer{margin-top:-45px;}#footer,#footer a{font-size:12px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-style:italic;}#footer p{margin:0;padding:15px;line-height:15px;}#footer a{text-decoration:none;}#footer a:hover{text-decoration:underline;}.form-table{border-collapse:collapse;margin-top:.5em;width:100%;margin-bottom:-8px;clear:both;}.form-table td{margin-bottom:9px;padding:8px 10px;line-height:20px;font-size:11px;}.form-table th,.form-wrap label{font-weight:normal;text-shadow:rgba(255,255,255,1) 0 1px 0;}.form-table th{vertical-align:top;text-align:left;padding:10px;width:200px;}.form-table th.th-full{width:auto;}.form-table div.color-option{display:block;clear:both;margin-top:12px;}.form-table input.tog{margin-top:2px;margin-right:2px;float:left;}.form-table table.color-palette{vertical-align:bottom;float:left;margin:-12px 3px 11px;}.form-table .color-palette td{border-width:1px 1px 0;border-style:solid solid none;height:10px;line-height:20px;width:10px;}textarea.large-text{width:99%;}.form-table input.regular-text,#adduser .form-field input{width:25em;}.form-table input.small-text{width:50px;}#profile-page .form-table textarea{width:500px;margin-bottom:6px;}#profile-page .form-table #rich_editing{margin-right:5px;}.form-table .pre{padding:8px;margin:0;}.pre{white-space:pre-wrap;white-space:-moz-pre-wrap!important;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;}table.form-table td .updated{font-size:13px;}.form-wrap{margin:10px 0;width:97%;}.form-wrap p,.form-wrap label{font-size:11px;}.form-wrap label{display:block;padding:2px;font-size:12px;}.form-field input,.form-field textarea{border-style:solid;border-width:1px;width:95%;}p.description,.form-wrap p{margin:2px 0 5px;}p.help,p.description,span.description,.form-wrap p{font-size:12px;font-style:italic;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}.form-wrap .form-field{margin:0 0 10px;padding:8px;}.col-wrap h3{margin:12px 0;font-size:1.1em;}.col-wrap p.submit{margin-top:-10px;}.tagcloud{width:97%;margin:0 0 40px;text-align:justify;}.tagcloud h3{margin:2px 0 12px;}#post-body #normal-sortables{min-height:50px;}#post-body #advanced-sortables{min-height:20px;}.postbox{position:relative;min-width:255px;width:99.5%;}#trackback_url{width:99%;}#normal-sortables .postbox .submit{background:transparent none;border:0 none;float:right;padding:0 12px;margin:0;}#normal-sortables .postbox #replyrow .submit{float:none;margin:0;padding:3px 7px;}#side-sortables .submitbox .submit input,#side-sortables .submitbox .submit .preview,#side-sortables .submitbox .submit a.preview:hover{border:0 none;}#side-sortables .inside-submitbox .insidebox,.stuffbox .insidebox{margin:11px 0;}#side-sortables .comments-box,#normal-sortables .comments-box{border:0 none;}#side-sortables .comments-box thead th,#normal-sortables .comments-box thead th{background:transparent;padding:0 7px 4px;font-style:italic;}#commentsdiv img.waiting{padding-left:5px;vertical-align:middle;}#post-body .tagsdiv #newtag{margin-right:5px;width:16em;}#side-sortables input#post_password{width:94%;}#side-sortables .tagsdiv #newtag{width:68%;}#post-status-info{border-width:0 1px 1px;border-style:none solid solid;width:100%;-moz-border-radius:0 0 6px 6px;-webkit-border-bottom-left-radius:6px;-webkit-border-bottom-right-radius:6px;-khtml-border-bottom-left-radius:6px;-khtml-border-bottom-right-radius:6px;border-bottom-left-radius:6px;border-bottom-right-radius:6px;}#post-status-info td{font-size:11px;}.autosave-info{padding:2px 15px 2px 2px;text-align:right;}#editorcontent #post-status-info{border:none;}#post-body .wp_themeSkin .mceStatusbar a.mceResize{display:block;background:transparent url(images/resize.gif) no-repeat scroll right bottom;width:12px;cursor:se-resize;margin:0 2px;position:relative;top:22px;}#linksubmitdiv div.inside,div.inside{padding:0;margin:0;}#comment-status-radio p{margin:3px 0 5px;}#comment-status-radio input{margin:2px 3px 5px 0;vertical-align:middle;}#comment-status-radio label{padding:5px 0;}.tagchecklist{margin-left:14px;font-size:12px;overflow:auto;}.tagchecklist strong{margin-left:-8px;position:absolute;}.tagchecklist span{margin-right:25px;display:block;float:left;font-size:11px;line-height:1.8em;white-space:nowrap;cursor:default;}.tagchecklist span a{margin:6px 0 0 -9px;cursor:pointer;width:10px;height:10px;display:block;float:left;text-indent:-9999px;overflow:hidden;position:absolute;}.howto{font-style:italic;display:block;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}.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;}#poststuff h2{margin-top:20px;font-size:1.5em;margin-bottom:15px;padding:0 0 3px;clear:left;}.widget .widget-top,.postbox h3{cursor:move;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;user-select:none;}.postbox .hndle span{padding:6px 0;}.postbox .hndle{cursor:move;}.hndle a{font-size:11px;font-weight:normal;}#dashboard-widgets .meta-box-sortables{margin:0 5px;}.postbox .handlediv{float:right;width:23px;height:26px;}.sortable-placeholder{border-width:1px;border-style:dashed;margin-bottom:20px;}#poststuff h3,.metabox-holder h3{font-size:12px;font-weight:bold;padding:7px 9px;margin:0;line-height:1;}.widget,.postbox,.stuffbox{margin-bottom:20px;border-width:1px;border-style:solid;line-height:1;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.widget .widget-top,.postbox h3,.postbox h3,.stuffbox h3{-moz-border-radius:6px 6px 0 0;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-right-radius:6px;-khtml-border-top-left-radius:6px;border-top-right-radius:6px;border-top-left-radius:6px;}.postbox.closed h3{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;-khtml-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;-khtml-border-bottom-right-radius:4px;border-bottom-right-radius:4px;}.postbox table.form-table{margin-bottom:0;}.postbox input[type="text"],.postbox textarea,.stuffbox input[type="text"],.stuffbox textarea{border-width:1px;border-style:solid;}#poststuff .inside,#poststuff .inside p{font-size:11px;margin:6px 6px 8px;}#poststuff .inside .submitbox p{margin:1em 0;}#post-visibility-select{line-height:1.5em;margin-top:3px;}#poststuff #submitdiv .inside{margin:0;}#titlediv,#poststuff .postarea{margin-bottom:20px;}#titlediv{margin-bottom:20px;}#titlediv label{cursor:text;}#titlediv div.inside{margin:0;}#poststuff #titlewrap{border:0;padding:0;}#titlediv #title{padding:3px 4px;border-width:1px;border-style:solid;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;font-size:1.7em;width:100%;outline:none;}#poststuff .inside-submitbox,#side-sortables .inside-submitbox{margin:0 3px;font-size:11px;}input#link_description,input#link_url{width:98%;}#pending{background:0 none;border:0 none;padding:0;font-size:11px;margin-top:-1px;}#edit-slug-box{height:1em;margin-top:8px;padding:0 7px;}#editable-post-name-full{display:none;}#editable-post-name input{width:16em;}.postarea h3 label{float:left;}.postarea #add-media-button{float:right;margin:7px 0 0;position:relative;right:10px;}#poststuff #editor-toolbar{height:30px;}.wp_themeSkin tr.mceFirst td.mceToolbar{border-width:0 0 1px;border-style:none none solid;}#edButtonPreview,#edButtonHTML{height:18px;margin:5px 5px 0 0;padding:4px 5px 2px;float:right;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;}.js .theEditor{color:white;}#poststuff #edButtonHTML{margin-right:15px;}#media-buttons{cursor:default;padding:8px 8px 0;}#media-buttons a{cursor:pointer;padding:0 0 5px 10px;}#media-buttons img,#submitpost #ajax-loading{vertical-align:middle;}.submitbox .submit{text-align:left;padding:12px 10px 10px;font-size:11px;}.submitbox .submitdelete{border-bottom-width:1px;border-bottom-style:solid;text-decoration:none;padding:1px 2px;}.inside-submitbox #post_status{margin:2px 0 2px -2px;}.submitbox .submit a:hover{border-bottom-width:1px;border-bottom-style:solid;}.submitbox .submit input{margin-bottom:8px;margin-right:4px;padding:6px;}#post-status-select{line-height:2.5em;margin-top:3px;}#category-adder{margin-left:120px;padding:4px 0;}#category-adder h4{margin:0 0 8px;}#side-sortables #category-adder{margin:0;}#post-body #category-add input,#category-add select{width:30%;}#side-sortables #category-add input{width:94%;}#side-sortables #category-add select{width:100%;}#category-add input#category-add-sumbit{width:auto;}#post-body ul#category-tabs{float:left;width:120px;text-align:right;margin:0 -120px 0 5px;padding:0;}#post-body ul#category-tabs li{padding:8px;}#post-body ul#category-tabs li.tabs{-moz-border-radius:3px 0 0 3px;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-top-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-top-left-radius:3px;border-bottom-left-radius:3px;}#post-body ul#category-tabs li.tabs a{font-weight:bold;text-decoration:none;}#categorydiv div.tabs-panel,#linkcategorydiv div.tabs-panel{height:200px;overflow:auto;padding:.5em .9em;border-style:solid;border-width:1px;}#post-body #categorydiv div.tabs-panel,#post-body #linkcategorydiv div.tabs-panel{margin:0 5px 0 125px;}#side-sortables #category-tabs li{display:inline;padding-right:8px;}#side-sortables #category-tabs a{text-decoration:none;}#side-sortables #category-tabs{margin-bottom:3px;}#categorydiv ul,#linkcategorydiv ul{list-style:none;padding:0;margin:0;}#categorydiv ul.categorychecklist ul,#linkcategorydiv ul.categorychecklist ul{margin-left:18px;}ul.categorychecklist li{margin:0;padding:0;line-height:19px;}#category-adder h4{margin-top:4px;margin-bottom:0;}#categorydiv .tabs-panel{border-width:3px;border-style:solid;}ul#category-tabs{margin-top:12px;}ul#category-tabs li.tabs{border-style:solid solid none;border-width:1px 1px 0;}#post-body #category-tabs li.tabs{border-style:solid none solid solid;border-width:1px 0 1px 1px;margin-right:-1px;}ul#category-tabs li{padding:5px 8px;-moz-border-radius:3px 3px 0 0;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px;}form#tags-filter{position:relative;}p.search-box{float:right;margin:-5px 0 0;}.screen-per-page{width:3em;}#posts-filter fieldset{float:left;margin:0 1.5ex 1em 0;padding:0;}#posts-filter fieldset legend{padding:0 0 .2em 1px;}td.post-title strong,td.plugin-title strong{display:block;margin-bottom:.2em;}td.post-title p,td.plugin-title p{margin:6px 0;}td.plugin-title{white-space:nowrap;}.wp-hidden-children .wp-hidden-child,.ui-tabs-hide,#codepress-off{display:none;}.commentlist .avatar{vertical-align:text-top;}.defaultavatarpicker .avatar{margin:2px 0;vertical-align:middle;}body.wp-admin{min-width:785px;}.view-switch{float:right;margin:6px 8px 0;}.view-switch a{text-decoration:none;}.filter{float:left;margin:-5px 0 0 10px;}.filter .subsubsub{margin-left:-10px;margin-top:13px;}#the-comment-list td.comment p.comment-author{margin-top:0;margin-left:0;}#the-comment-list p.comment-author img{float:left;margin-right:8px;}#the-comment-list p.comment-author strong a{border:none;}#the-comment-list td{vertical-align:top;}#the-comment-list td.comment{word-wrap:break-word;}#the-comment-list .check-column{padding-top:8px;}#templateside ul li a{text-decoration:none;}.indicator-hint{padding-top:8px;}#display_name{width:15em;}.tablenav .delete{margin-right:20px;}td.action-links,th.action-links{text-align:right;}table.diff{width:100%;}table.diff col.content{width:50%;}table.diff tr{background-color:transparent;}table.diff td,table.diff th{padding:.5em;font-family:Consolas,Monaco,Courier,monospace;border:none;}table.diff .diff-deletedline del,table.diff .diff-addedline ins{text-decoration:none;}#wp-word-count{display:block;padding:2px 7px;}fieldset{border:0;padding:0;margin:0;}.tool-box{margin:15px 0 35px;}.tool-box .buttons{margin:15px 0;}.tool-box .title{margin:8px 0;font:18px/24px Georgia,"Times New Roman","Bitstream Charter",Times,serif;}.pressthis a{font-size:1.2em;}#wp_editbtns,#wp_gallerybtns{padding:2px;position:absolute;display:none;z-index:999998;}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{margin:2px;padding:2px;border-width:1px;border-style:solid;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.settings-toggle{text-align:right;margin:5px 7px 15px 0;font-size:12px;}.settings-toggle h3{margin:0;}#timestampdiv select{height:20px;line-height:14px;padding:0;vertical-align:top;}#jj,#hh,#mn{width:2em;padding:1px;font-size:12px;}#aa{width:3.4em;padding:1px;font-size:12px;}.curtime #timestamp{background-repeat:no-repeat;background-position:left top;padding-left:18px;}#timestampdiv{padding-top:5px;line-height:23px;}#timestampdiv p{margin:8px 0 6px;}#timestampdiv input{border-width:1px;border-style:solid;}#sidemenu{margin:-30px 15px 0 315px;list-style:none;position:relative;float:right;padding-left:10px;font-size:12px;}#sidemenu a{padding:0 7px;display:block;float:left;line-height:28px;border-top-width:1px;border-top-style:solid;border-bottom-width:1px;border-bottom-style:solid;}#sidemenu li{display:inline;line-height:200%;list-style:none;text-align:center;white-space:nowrap;margin:0;padding:0;}#sidemenu a.current{font-weight:normal;padding-left:6px;padding-right:6px;-moz-border-radius:4px 4px 0 0;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-khtml-border-top-left-radius:4px;-khtml-border-top-right-radius:4px;border-top-left-radius:4px;border-top-right-radius:4px;border-width:1px;border-style:solid;}#sidemenu{margin:-30px 15px 0 315px;list-style:none;position:relative;float:right;padding-left:10px;font-size:12px;}#sidemenu a{padding:0 7px;display:block;float:left;line-height:28px;border-top-width:1px;border-top-style:solid;border-bottom-width:1px;border-bottom-style:solid;}#sidemenu li a .count-0{display:none;}#replyrow{font-size:11px;}#replyrow input{border-width:1px;border-style:solid;}#replyrow td{padding:2px;}#replyrow #editorcontainer{border:0 none;}#replysubmit{margin:0;padding:3px 7px;}#replysubmit img.waiting,.inline-edit-save img.waiting{padding:2px 10px 0;vertical-align:top;}#replysubmit .button{margin-right:5px;}#replyrow #editor-toolbar{display:none;}#replyhead{font-size:12px;font-weight:bold;padding:2px 10px 4px;}#edithead .inside{float:left;padding:3px 0 2px 5px;margin:0;text-align:center;font-size:11px;}#edithead .inside input{width:180px;font-size:11px;}#edithead label{padding:2px 0;}#replycontainer{padding:5px;border:0 none;height:120px;overflow:hidden;position:relative;}#replycontent{resize:none;margin:0;width:100%;height:100%;padding:0;line-height:150%;border:0 none;outline:none;font-size:12px;}#replyrow #ed_reply_toolbar{margin:0;padding:2px 3px;}#screen-meta{position:relative;clear:both;}#screen-meta-links{margin:0 9px 0 0;}#screen-meta .screen-reader-text{visibility:hidden;}#screen-options-link-wrap,#contextual-help-link-wrap{float:right;background:transparent url(images/screen-options-left.gif) no-repeat 0 0;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;height:22px;padding:0;margin:0 6px 0 0;}#screen-meta a.show-settings{text-decoration:none;z-index:1;padding:0 16px 0 6px;height:22px;line-height:22px;font-size:10px;display:block;background-repeat:no-repeat;background-position:right bottom;}#screen-meta a.show-settings{background-image:url(images/screen-options-right.gif);}#screen-meta a.show-settings:hover{text-decoration:none;}#screen-options-wrap h5,#contextual-help-wrap h5{margin:8px 0;font-size:13px;}#screen-options-wrap,#contextual-help-wrap{border-style:none solid solid;border-top:0 none;border-width:0 1px 1px;margin:0 15px;padding:8px 12px 12px;-moz-border-radius:0 0 0 4px;-webkit-border-bottom-left-radius:4px;-khtml-border-bottom-left-radius:4px;border-bottom-left-radius:4px;}.metabox-prefs label{padding-right:15px;white-space:nowrap;line-height:30px;}.metabox-prefs label input{margin:0 5px 0 2px;}.metabox-prefs label a{display:none;}tr.inline-edit-row td{padding:0 .5em;}#wpbody-content .inline-edit-row fieldset{font-size:12px;float:left;margin:0;padding:0;width:100%;}#wpbody-content .inline-edit-row fieldset .inline-edit-col{padding:0 .5em;}#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col{border-width:0 0 0 1px;border-style:none none none solid;}#wpbody-content .quick-edit-row-post .inline-edit-col-left{width:40%;}#wpbody-content .quick-edit-row-post .inline-edit-col-right{width:39%;}#wpbody-content .inline-edit-row-post .inline-edit-col-center{width:20%;}#wpbody-content .quick-edit-row-page .inline-edit-col-left{width:50%;}#wpbody-content .quick-edit-row-page .inline-edit-col-right,#wpbody-content .bulk-edit-row-post .inline-edit-col-right{width:49%;}#wpbody-content .bulk-edit-row .inline-edit-col-left{width:30%;}#wpbody-content .bulk-edit-row-page .inline-edit-col-right{width:69%;}#wpbody-content .bulk-edit-row .inline-edit-col-bottom{float:right;width:69%;}#wpbody-content .inline-edit-row-page .inline-edit-col-right,#owpbody-content .bulk-edit-row-post .inline-edit-col-right{margin-top:27px;}.inline-edit-row fieldset .inline-edit-group{clear:both;}.inline-edit-row fieldset .inline-edit-group:after{content:".";display:block;height:0;clear:both;visibility:hidden;}.inline-edit-row p.submit{clear:both;padding:.5em;margin:.5em 0 0;}.inline-edit-row span.error{line-height:22px;margin:0 15px;padding:3px 5px;}.inline-edit-row h4{margin:.2em 0;padding:0;line-height:23px;}.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title{margin:0;padding:0;line-height:27px;}.inline-edit-row fieldset label,.inline-edit-row fieldset span.inline-edit-categories-label{display:block;margin:.2em 0;}.inline-edit-row fieldset label.inline-edit-tags{margin-top:0;}.inline-edit-row fieldset label.inline-edit-tags span.title{margin:.2em 0;}.inline-edit-row fieldset label span.title{display:block;float:left;width:5em;}.inline-edit-row fieldset label span.input-text-wrap{display:block;margin-left:5em;}.quick-edit-row-post fieldset.inline-edit-col-right label span.title{width:auto;padding-right:.5em;}.inline-edit-row .input-text-wrap input[type=text]{width:100%;}.inline-edit-row fieldset label input[type=checkbox]{vertical-align:text-bottom;}.inline-edit-row fieldset label textarea{width:100%;height:4em;}#wpbody-content .bulk-edit-row fieldset .inline-edit-group label{max-width:50%;}#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child{margin-right:.5em;}.inline-edit-row h4{text-transform:uppercase;}.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-style:italic;line-height:1.8em;}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea{border-style:solid;border-width:1px;}.inline-edit-row fieldset .inline-edit-date{float:left;}.inline-edit-row fieldset input[name=jj],.inline-edit-row fieldset input[name=hh],.inline-edit-row fieldset input[name=mn]{font-size:12px;width:2.1em;}.inline-edit-row fieldset input[name=aa]{font-size:12px;width:3.5em;}.inline-edit-row fieldset label input.inline-edit-password-input{width:8em;}.inline-edit-row .catshow,.inline-edit-row .cathide{cursor:pointer;}ul.cat-checklist{height:12em;border-style:solid;border-width:1px;overflow-y:scroll;padding:0 5px;margin:0;}#bulk-titles{display:block;height:12em;border-style:solid;border-width:1px;overflow-y:scroll;padding:0 5px;margin:0 0 5px;}.inline-edit-row fieldset ul.cat-checklist li,.inline-edit-row fieldset ul.cat-checklist input{margin:0;}.inline-edit-row fieldset ul.cat-checklist label,.inline-edit-row .catshow,.inline-edit-row .cathide,.inline-edit-row #bulk-titles div{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-style:normal;font-size:11px;}table .inline-edit-row fieldset ul.cat-hover{height:auto;max-height:30em;overflow-y:auto;position:absolute;}.inline-edit-row fieldset label input.inline-edit-menu-order-input{width:3em;}.inline-edit-row fieldset label input.inline-edit-slug-input{width:75%;}.quick-edit-row-post fieldset label.inline-edit-status{float:left;}#bulk-titles{line-height:140%;}#bulk-titles div{margin:.2em .3em;}#bulk-titles div a{cursor:pointer;display:block;float:left;height:10px;margin:3px 3px 0 -2px;overflow:hidden;position:relative;text-indent:-9999px;width:10px;}#wpbody-content #media-items .describe{border-collapse:collapse;width:100%;border-top-style:solid;border-top-width:1px;clear:both;cursor:default;padding:5px;}#wpbody-content .describe th{vertical-align:top;text-align:left;padding:10px;width:140px;}#wpbody-content .describe .media-item-info tr{background-color:transparent;}#wpbody-content .describe .media-item-info td{padding:4px 10px 0;}.describe .media-item-info .A1B1{padding:0 15px 8px 0;}#wpbody-content .filename{padding:0 10px;}#wpbody-content .media-item .thumbnail{max-height:128px;max-width:128px;}#wpbody-content #async-upload-wrap a{display:none;}.media-upload-form td label{margin-right:6px;margin-left:2px;}.media-upload-form .align .field label{display:inline;padding:0 0 0 22px;margin:0 1em 0 0;font-weight:bold;}.media-upload-form tr.image-size label{margin:0 0 0 3px;font-weight:bold;}.media-upload-form th.label label{font-weight:bold;margin:.5em;font-size:13px;}.media-upload-form th.label label span{padding:0 5px;}abbr.required{border:medium none;text-decoration:none;}#wpbody-content .describe input[type="text"],#wpbody-content .describe textarea{width:460px;}#wpbody-content .describe p.help{margin:0;padding:0 0 0 5px;}.describe-toggle-on,.describe-toggle-off{display:block;line-height:36px;float:right;margin-right:20px;}.describe-toggle-off{display:none;}#wpbody-content .media-item{border-bottom-style:solid;border-bottom-width:1px;min-height:36px;position:relative;width:100%;}#wpbody-content .media-single .media-item{border-bottom-style:none;border-bottom-width:0;}#wpbody-content #media-items{border-style:solid solid none;border-width:1px;width:670px;}#wpbody-content #media-items .filename{line-height:36px;overflow:hidden;}.media-item .pinkynail{float:left;margin:2px;max-width:40px;max-height:32px;}.media-item .startopen,.media-item .startclosed{display:none;}.media-item .original{position:relative;height:34px;text-align:center;}.media-item .percent{font-weight:bold;}.crunching{display:block;line-height:32px;text-align:right;margin-right:5px;}button.dismiss{position:absolute;top:7px;right:5px;z-index:4;width:8em;}.file-error{float:left;font-weight:bold;padding:10px;}.progress{position:relative;margin-bottom:-36px;height:36px;}.bar{width:0;height:100%;border-right-width:3px;border-right-style:solid;}.upload-php .fixed .column-parent{width:25%;}.find-box{width:500px;height:300px;overflow:hidden;padding:33px 5px 40px;position:absolute;z-index:1000;}.find-box-head{cursor:move;font-weight:bold;height:2em;line-height:2em;padding:1px 12px;position:absolute;top:5px;width:100%;}.find-box-inside{overflow:auto;width:100%;height:100%;}.find-box-search{padding:12px;border-width:1px;border-style:none none solid;}#find-posts-response{margin:8px 0;padding:0 1px;}#find-posts-response table{width:100%;}#find-posts-response .found-radio{padding:5px 0 0 8px;width:15px;}.find-box-buttons{width:480px;margin:8px;}.find-box-search label{padding-right:6px;}.find-box #resize-se{position:absolute;right:1px;bottom:1px;}#favorite-actions{float:right;margin:11px 12px 0;min-width:130px;position:relative;}#favorite-first{-moz-border-radius:12px;-khtml-border-radius:12px;-webkit-border-radius:12px;border-radius:12px;line-height:15px;padding:3px 30px 4px 12px;border-width:1px;border-style:solid;}#favorite-inside{margin:0;padding:0 1px 6px 1px;border-width:1px;border-style:solid;position:absolute;z-index:11;display:none;-moz-border-radius:0 0 12px 12px;-webkit-border-bottom-right-radius:12px;-webkit-border-bottom-left-radius:12px;-khtml-border-bottom-right-radius:12px;-khtml-border-bottom-left-radius:12px;border-bottom-right-radius:12px;border-bottom-left-radius:12px;}#favorite-actions a{display:block;text-decoration:none;font-size:11px;}#favorite-inside a{padding:3px 5px 3px 10px;}#favorite-toggle{height:22px;position:absolute;right:0;top:1px;width:28px;}#favorite-actions .slide-down{-moz-border-radius:12px 12px 0 0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;border-bottom-width:1px;border-bottom-style:solid;}#utc-time,#local-time{padding-left:25px;font-style:italic;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}ul#dismissed-updates{display:none;}form.upgrade{margin-top:8px;}form.upgrade .hint{font-style:italic;font-size:85%;margin:-0.5em 0 2em 0;}#poststuff .inside .the-tagcloud{margin:5px 0 10px;padding:8px;border-width:1px;border-style:solid;line-height:1.8em;word-spacing:3px;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}br.clear{height:2px;line-height:2px;}.swfupload{margin:5px 10px;vertical-align:middle;}table.fixed{table-layout:fixed;}.fixed .column-rating,.fixed .column-visible{width:8%;}.fixed .column-date,.fixed .column-parent,.fixed .column-links{width:10%;}.fixed .column-response,.fixed .column-author,.fixed .column-categories,.fixed .column-tags,.fixed .column-rel,.fixed .column-role{width:15%;}.fixed .column-comments{width:4em;padding-top:8px;}.fixed .column-slug{width:25%;}.fixed .column-posts{width:10%;}.fixed .column-icon{width:80px;}#commentsdiv .fixed .column-author,#comments-form .fixed .column-author{width:20%;}.widefat th,.widefat td{overflow:hidden;}.widefat td p{margin:2px 0 .8em;}table .vers,table .column-visible,table .column-rating{text-align:center;}.icon32{float:left;height:36px;margin:14px 6px 0 0;width:36px;}.key-labels label{line-height:24px;}.subtitle{font-size:.75em;line-height:1;padding-left:25px;}ol{list-style-type:decimal;margin-left:2em;}.postbox-container{float:left;padding-right:.5%;}.postbox-container .meta-box-sortables{min-height:300px;}.temp-border{border:1px dotted #ccc;}.columns-prefs label{padding:0 5px;}.theme-install-php h4,.plugin-install-php h4{margin:2.5em 0 8px;}p.install-help{margin:8px 0;font-style:italic;}p.popular-tags{-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;border-width:1px;border-style:solid;line-height:2em;padding:8px 12px 12px;text-align:justify;}p.popular-tags a{padding:0 3px;}.stuffbox .editcomment{clear:none;}.ajax-feedback{visibility:hidden;vertical-align:bottom;}.tagsdiv .newtag{width:180px;}.tagsdiv .the-tags{display:block;height:60px;margin:0 auto;overflow:auto;width:260px;}#post-body-content .tagsdiv .the-tags{margin:0 5px;}label,#your-profile label+a{vertical-align:middle;}#misc-publishing-actions label{vertical-align:baseline;}.plugin-update-tr .update-message{margin:5px;padding:3px 5px;border-width:1px;border-style:solid;-moz-border-radius:5px;-khtml-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;}.add-new-h2{font-style:normal;margin:0 6px;position:relative;top:-3px;}.describe .image-editor{vertical-align:top;}.imgedit-wrap{position:relative;}.imgedit-settings p{margin:8px 0;}.describe .imgedit-wrap table td{vertical-align:top;padding-top:0;}.imgedit-wrap p,.describe .imgedit-wrap table td{font-size:11px;line-height:18px;}.describe .imgedit-wrap table td.imgedit-settings{padding:0 5px;}td.imgedit-settings input{vertical-align:middle;}.imgedit-wait{position:absolute;top:0;background:#FFF url(images/wpspin_light.gif) no-repeat scroll 22px 10px;opacity:.7;filter:alpha(opacity=70);width:100%;height:500px;display:none;}.media-disabled,.imgedit-settings .disabled{color:grey;}.imgedit-wait-spin{padding:0 4px 4px;vertical-align:bottom;visibility:hidden;}.imgedit-menu{margin:0 0 12px;min-width:300px;}.imgedit-menu div{float:left;width:32px;height:32px;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;border-width:1px;border-style:solid;}.imgedit-crop-wrap{position:relative;}.imgedit-crop{background:transparent url(images/imgedit-icons.png) no-repeat scroll -9px -31px;margin:0 8px 0 0;}.imgedit-crop.disabled:hover{background-position:-9px -31px;}.imgedit-crop:hover{background-position:-9px -1px;}.imgedit-rleft{background:transparent url(images/imgedit-icons.png) no-repeat scroll -46px -31px;margin:0 3px;}.imgedit-rleft.disabled:hover{background-position:-46px -31px;}.imgedit-rleft:hover{background-position:-46px -1px;}.imgedit-rright{background:transparent url(images/imgedit-icons.png) no-repeat scroll -77px -31px;margin:0 8px 0 3px;}.imgedit-rright.disabled:hover{background-position:-77px -31px;}.imgedit-rright:hover{background-position:-77px -1px;}.imgedit-flipv{background:transparent url(images/imgedit-icons.png) no-repeat scroll -115px -31px;margin:0 3px;}.imgedit-flipv.disabled:hover{background-position:-115px -31px;}.imgedit-flipv:hover{background-position:-115px -1px;}.imgedit-fliph{background:transparent url(images/imgedit-icons.png) no-repeat scroll -147px -31px;margin:0 8px 0 3px;}.imgedit-fliph.disabled:hover{background-position:-147px -31px;}.imgedit-fliph:hover{background-position:-147px -1px;}.imgedit-undo{background:transparent url(images/imgedit-icons.png) no-repeat scroll -184px -31px;margin:0 3px;}.imgedit-undo.disabled:hover{background-position:-184px -31px;}.imgedit-undo:hover{background-position:-184px -1px;}.imgedit-redo{background:transparent url(images/imgedit-icons.png) no-repeat scroll -215px -31px;margin:0 8px 0 3px;}.imgedit-redo.disabled:hover{background-position:-215px -31px;}.imgedit-redo:hover{background-position:-215px -1px;}.imgedit-applyto img{margin:0 8px 0 0;}.imgedit-group-top{margin:5px 0;}.imgedit-applyto .imgedit-label{padding:2px 0 0;display:block;}.imgedit-help{display:none;font-style:italic;margin-bottom:8px;}.imgedit-help ul li{font-size:11px;}a.imgedit-help-toggle{text-decoration:none;}#wpbody-content .imgedit-response div{width:600px;margin:8px;}.form-table td.imgedit-response{padding:0;}.imgedit-submit{margin:8px 0;}.imgedit-submit-btn{margin-left:20px;}.imgedit-wrap .nowrap{white-space:nowrap;}span.imgedit-scale-warn{color:red;font-size:20px;font-style:normal;visibility:hidden;vertical-align:middle;}.imgedit-group{border-width:1px;border-style:solid;-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;margin-bottom:8px;padding:2px 10px;}#dashboard_recent_comments div.undo{border-top-style:solid;border-top-width:1px;margin:0 -10px;padding:3px 8px;font-size:11px;}.trash-undo-inside,.spam-undo-inside{margin:1px 8px 1px 0;line-height:16px;}.spam-undo-inside .avatar,.trash-undo-inside .avatar{height:20px;width:20px;margin-right:8px;vertical-align:middle;}.taghint{color:#aaa;margin:14px 0 -17px 8px;}#poststuff .tagsdiv .howto{margin:0 0 6px 8px;}.ajaxtag .newtag{background:transparent;position:relative;}#broken-themes{text-align:left;width:50%;border-spacing:3px;padding:3px;}.describe .del-link{padding-left:5px;}.comment-ays{margin-bottom:0;border-style:solid;border-width:1px;}.comment-ays th{border-right-style:solid;border-right-width:1px;}
\ No newline at end of file
--- /dev/null
+textarea,
+input[type="text"],
+input[type="password"],
+input[type="file"],
+input[type="button"],
+input[type="submit"],
+input[type="reset"],
+select {
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 4px;
+ -khtml-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ border-radius: 4px;
+}
+
+p,
+ul,
+ol,
+blockquote,
+input,
+select {
+ font-size: 12px;
+}
+
+select option {
+ padding: 2px;
+}
+
+.plugins .name,
+#pass-strength-result.strong,
+#pass-strength-result.short,
+.button-highlighted,
+#quicktags #ed_strong,
+#ed_reply_toolbar #ed_reply_strong {
+ font-weight: bold;
+}
+
+.plugins p {
+ margin: 0 4px;
+ padding: 0;
+}
+
+.plugins .desc p {
+ margin: 0 0 8px;
+}
+
+.plugins td.desc {
+ line-height: 1.5em;
+}
+
+.plugins .desc ul,
+.plugins .desc ol {
+ margin: 0 0 0 2em;
+}
+
+.plugins .desc ul {
+ list-style-type: disc;
+}
+
+.plugins .action-links {
+ white-space: nowrap;
+}
+
+.plugins .row-actions-visible {
+ padding: 0;
+}
+
+.widefat tbody.plugins th.check-column {
+ padding: 7px 0;
+}
+
+.widefat .plugins td,
+.widefat .plugins th {
+ border-bottom: 0 none;
+}
+
+#install-plugins .plugins td,
+#install-plugins .plugins th {
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+}
+
+.plugins .inactive td,
+.plugins .inactive th,
+.plugins .active td,
+.plugins .active th {
+ border-top-style: solid;
+ border-top-width: 1px;
+ padding: 5px 7px 0;
+}
+
+#wpbody-content .plugins .plugin-title {
+ padding-right: 12px;
+}
+
+.plugins .second td,
+.plugins .second th {
+ border-top: 0 none;
+ padding: 0 7px 5px;
+}
+
+.plugins-php .widefat tfoot th,
+.plugins-php .widefat tfoot td {
+ border-top-style: solid;
+ border-top-width: 1px;
+}
+
+.import-system {
+ font-size: 16px;
+}
+
+.anchors {
+ margin: 10px 20px 10px 20px;
+}
+
+table#availablethemes {
+ border-spacing: 0;
+ border-width: 1px 0;
+ border-style: solid none;
+ margin: 10px auto;
+ width: 100%;
+}
+
+td.available-theme {
+ vertical-align: top;
+ width: 240px;
+ margin: 0;
+ padding: 20px;
+ text-align: left;
+}
+
+table#availablethemes td {
+ border-width: 0 1px 1px;
+ border-style: none solid solid;
+}
+
+table#availablethemes td.right,
+table#availablethemes td.left {
+ border-right: 0 none;
+ border-left: 0 none;
+}
+
+table#availablethemes td.bottom {
+ border-bottom: 0 none;
+}
+
+.available-theme a.screenshot {
+ width: 240px;
+ height: 180px;
+ display: block;
+ border-width: 1px;
+ border-style: solid;
+ margin-bottom: 10px;
+ overflow: hidden;
+}
+
+.available-theme img {
+ width: 240px;
+}
+
+.available-theme h3 {
+ margin: 15px 0 5px;
+}
+
+#current-theme {
+ margin: 1em 0 1.5em;
+}
+
+#current-theme a {
+ border-bottom: none;
+}
+
+#current-theme h3 {
+ font-size: 17px;
+ font-weight: normal;
+ margin: 0;
+}
+
+#current-theme .theme-description {
+ margin-top: 5px;
+}
+
+#current-theme img {
+ float: left;
+ border-width: 1px;
+ border-style: solid;
+ margin-right: 1em;
+ margin-bottom: 1.5em;
+ width: 150px;
+}
+
+#TB_window #TB_title a.tb-theme-preview-link,
+#TB_window #TB_title a.tb-theme-preview-link:visited {
+ font-weight: bold;
+ text-decoration: none;
+}
+
+#TB_window #TB_title {
+ background-color: #222;
+ color: #cfcfcf;
+}
+
+.checkbox {
+ border: none;
+ margin: 0;
+ padding: 0;
+}
+
+.code, code {
+ font-family: Consolas, Monaco, Courier, monospace;
+}
+
+kbd, code {
+ padding: 1px 3px;
+ margin: 0 1px;
+ font-size: 11px;
+}
+
+.commentlist li {
+ padding: 1em 1em .2em;
+ margin: 0;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+}
+
+.commentlist li li {
+ border-bottom: 0;
+ padding: 0;
+}
+
+.commentlist p {
+ padding: 0;
+ margin: 0 0 .8em;
+}
+
+.post-categories {
+ display: inline;
+ margin: 0;
+ padding: 0;
+}
+
+.post-categories li {
+ display: inline;
+}
+
+.quicktags, .search {
+ font: 12px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+}
+
+.submit {
+ padding: 1.5em 0;
+ margin: 5px 0;
+ -moz-border-radius: 0 0 3px 3px;
+ -webkit-border-bottom-left-radius: 3px;
+ -webkit-border-bottom-right-radius: 3px;
+ -khtml-border-bottom-left-radius: 3px;
+ -khtml-border-bottom-right-radius: 3px;
+ border-bottom-left-radius: 3px;
+ border-bottom-right-radius: 3px;
+}
+
+form p.submit a.cancel:hover {
+ text-decoration: none;
+}
+
+#submitdiv h3 {
+ margin-bottom: 0 !important;
+}
+
+#misc-publishing-actions {
+ padding: 6px 0 16px 0;
+}
+
+.misc-pub-section {
+ padding: 6px;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+}
+
+.misc-pub-section-last {
+ border-bottom: 0 none;
+}
+
+#minor-publishing-actions {
+ padding: 6px;
+ text-align: right;
+}
+
+#minor-publishing {
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+}
+
+#save-post {
+ float: left;
+}
+
+.preview {
+ float: right;
+}
+
+#major-publishing-actions {
+ padding: 6px;
+ clear: both;
+ border-top: none;
+}
+
+#minor-publishing-actions input,
+#major-publishing-actions input,
+#minor-publishing-actions .preview {
+ min-width: 80px;
+ text-align: center;
+}
+
+#delete-action {
+ line-height: 25px;
+ vertical-align: middle;
+ text-align: left;
+ float: left;
+}
+
+#publishing-action {
+ text-align: right;
+ float: right;
+ line-height: 23px;
+}
+
+#post-body #minor-publishing {
+ padding-bottom: 10px;
+}
+
+#post-body #misc-publishing-actions {
+ padding: 0;
+}
+
+#post-body .misc-pub-section {
+ border-right-width: 1px;
+ border-right-style: solid;
+ border-bottom: 0 none;
+ min-height: 30px;
+ float: left;
+ max-width: 32%;
+}
+
+#post-body .misc-pub-section-last {
+ border-right: 0;
+}
+
+#sticky-span {
+ margin-left: 18px;
+}
+
+#post-status-display,
+#post-visibility-display {
+ font-weight: bold;
+}
+
+.side-info {
+ margin: 0;
+ padding: 4px;
+ font-size: 11px;
+}
+
+.side-info h5 {
+ padding-bottom: 7px;
+ font-size: 14px;
+ margin: 12px 2px 5px;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+}
+
+.side-info ul {
+ margin: 0;
+ padding-left: 18px;
+ list-style: square;
+}
+
+.submit input,
+.button,
+.button-primary,
+.button-secondary,
+.button-highlighted,
+#postcustomstuff .submit input {
+ text-decoration: none;
+ font-size: 11px !important;
+ line-height: 14px;
+ padding: 2px 8px;
+ cursor: pointer;
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 11px;
+ -khtml-border-radius: 11px;
+ -webkit-border-radius: 11px;
+ border-radius: 11px;
+ -moz-box-sizing: content-box;
+ -webkit-box-sizing: content-box;
+ -khtml-box-sizing: content-box;
+ box-sizing: content-box;
+}
+
+a.button,
+a.button-primary,
+a.button-secondary {
+ line-height: 15px;
+ padding: 3px 10px;
+ white-space: nowrap;
+ -webkit-border-radius: 10px;
+}
+
+#doaction,
+#doaction2,
+#post-query-submit {
+ margin-right: 8px;
+}
+
+.tablenav select[name="action"],
+.tablenav select[name="action2"] {
+ width: 130px;
+}
+
+.tablenav select[name="m"] {
+ width: 155px;
+}
+
+.tablenav select#cat {
+ width: 170px;
+}
+
+#wpcontent select {
+ padding: 2px;
+ height: 2em;
+ font-size: 11px;
+}
+
+#wpcontent option {
+ padding: 2px;
+}
+
+#timezone_string option {
+ margin-left: 1em;
+}
+
+.approve {
+ display: none;
+}
+
+.unapproved .approve,
+.spam .approve,
+.trash .approve {
+ display: inline;
+}
+
+.unapproved .unapprove {
+ display: none;
+}
+
+.narrow {
+ width: 70%;
+ margin-bottom: 40px;
+}
+
+.narrow p {
+ line-height: 150%;
+}
+
+textarea.all-options, input.all-options {
+ width: 250px;
+}
+
+#namediv table {
+ width: 100%;
+}
+
+#namediv td.first {
+ width: 10px;
+ white-space: nowrap;
+}
+
+#namediv input {
+ width: 98%;
+}
+
+#namediv p {
+ margin: 10px 0;
+}
+
+#wpbody-content .metabox-holder {
+ padding-top: 10px;
+}
+
+#content {
+ margin: 0;
+ width: 100%;
+}
+
+#editorcontainer #content {
+ padding: 6px;
+ line-height: 150%;
+ border: 0 none;
+ outline: none;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ -khtml-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+#editorcontainer,
+#quicktags {
+ border-style: solid;
+ border-width: 1px;
+ border-collapse: separate;
+ -moz-border-radius: 6px 6px 0 0;
+ -webkit-border-top-right-radius: 6px;
+ -webkit-border-top-left-radius: 6px;
+ -khtml-border-top-right-radius: 6px;
+ -khtml-border-top-left-radius: 6px;
+ border-top-right-radius: 6px;
+ border-top-left-radius: 6px;
+}
+
+#quicktags {
+ padding: 0;
+ margin-bottom: -3px;
+ border-bottom-width: 3px;
+ background-image: url("images/ed-bg.gif");
+ background-position: left top;
+ background-repeat: repeat-x;
+}
+
+#quicktags #ed_toolbar {
+ padding: 2px 4px 0;
+}
+
+#ed_toolbar input,
+#ed_reply_toolbar input {
+ margin: 3px 1px 4px;
+ line-height: 18px;
+ display: inline-block;
+ min-width: 26px;
+ padding: 2px 4px;
+ font-size: 12px;
+}
+
+#ed_reply_toolbar input {
+ margin: 1px 2px 1px 1px;
+}
+
+#quicktags #ed_link,
+#ed_reply_toolbar #ed_reply_link {
+ text-decoration: underline;
+}
+
+#quicktags #ed_del,
+#ed_reply_toolbar #ed_reply_del {
+ text-decoration: line-through;
+}
+
+#quicktags #ed_em,
+#ed_reply_toolbar #ed_reply_em {
+ font-style: italic;
+}
+
+#excerpt, .attachmentlinks {
+ margin: 0;
+ height: 4em;
+ width: 98%;
+}
+
+/* post meta postbox */
+#postcustomstuff table,
+#postcustomstuff input,
+#postcustomstuff textarea {
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 3px;
+ -khtml-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+}
+
+#postcustomstuff .updatemeta,
+#postcustomstuff .deletemeta {
+ margin: auto;
+}
+
+#postcustomstuff thead th {
+ padding: 5px 8px 8px;
+}
+
+#postcustom #postcustomstuff .submit {
+ border: 0 none;
+ float: none;
+ padding: 5px 8px;
+}
+
+#side-sortables #postcustom #postcustomstuff .submit {
+ padding: 0 5px;
+}
+
+#side-sortables #postcustom #postcustomstuff td.left input {
+ margin: 3px 3px 0;
+}
+
+#side-sortables #postcustom #postcustomstuff #the-list textarea {
+ height: 85px;
+ margin: 3px;
+}
+
+#postcustomstuff table {
+ margin: 0;
+ width: 100%;
+ border-width: 1px;
+ border-style: solid;
+ border-spacing: 0;
+}
+
+#postcustomstuff table input,
+#postcustomstuff table select,
+#postcustomstuff table textarea {
+ width: 95%;
+ margin: 8px 0 8px 8px;
+}
+
+#postcustomstuff th.left,
+#postcustomstuff td.left {
+ width: 38%;
+}
+
+#postcustomstuff .submit input {
+ width: auto;
+}
+
+#postcustomstuff #newmeta .submit {
+ padding: 0 8px;
+}
+
+#postcustomstuff table #addmetasub {
+ width: auto;
+}
+
+#postcustomstuff #newmetaleft {
+ vertical-align: top;
+}
+
+#postcustomstuff #newmetaleft a {
+ padding: 0 10px;
+ text-decoration: none;
+}
+
+#save {
+ width: 15em;
+}
+
+#template div {
+ margin-right: 190px;
+}
+
+* html #template div {
+ margin-right: 0;
+}
+
+/* A handy div class for hiding controls.
+Some browsers will disable them when you
+set display: none; */
+.zerosize {
+ height: 0;
+ width: 0;
+ margin: 0;
+ border: 0;
+ padding: 0;
+ overflow: hidden;
+ position: absolute;
+}
+
+* html #themeselect {
+ padding: 0 3px;
+ height: 22px;
+}
+
+#your-profile legend {
+ font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ font-size: 22px;
+}
+
+#your-profile #rich_editing {
+ border: none;
+}
+
+#howto {
+ font-size: 11px;
+ margin: 0 5px;
+ display: block;
+}
+
+#ajax-response.alignleft {
+ margin-left: 2em;
+}
+
+div.nav {
+ height: 2em;
+ padding: 7px 10px;
+ vertical-align: text-top;
+ margin: 5px 0;
+}
+
+.nav .button-secondary {
+ padding: 2px 4px;
+}
+
+a.page-numbers {
+ border-bottom-style: solid;
+ border-bottom-width: 2px;
+ font-weight: bold;
+ margin-right: 1px;
+ padding: 0 2px;
+}
+
+p.pagenav {
+ margin: 0;
+ display: inline;
+}
+
+.pagenav span {
+ font-weight: bold;
+ margin: 0 6px;
+}
+
+.row-title {
+ font-size: 12px !important;
+ font-weight: bold;
+}
+
+.widefat .column-comment p {
+ margin: 0.6em 0;
+}
+
+.column-author img, .column-username img {
+ float: left;
+ margin-right: 10px;
+ margin-top: 3px;
+}
+
+.tablenav a.button-secondary {
+ display: block;
+ margin: 3px 8px 0 0;
+}
+
+.tablenav {
+ clear: both;
+ height: 30px;
+ margin: 6px 0 4px;
+ vertical-align: middle;
+}
+
+.tablenav .tablenav-pages {
+ float: right;
+ display: block;
+ cursor: default;
+ height: 30px;
+ line-height: 30px;
+ font-size: 11px;
+}
+
+.tablenav .tablenav-pages a,
+.tablenav-pages span.current {
+ text-decoration: none;
+ border: none;
+ padding: 3px 6px;
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 5px;
+ -khtml-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+}
+
+.tablenav .displaying-num {
+ margin-right: 10px;
+ font-size: 12px;
+ font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ font-style: italic;
+}
+
+.tablenav .actions {
+ padding: 2px 8px 0 0;
+}
+
+td.media-icon {
+ text-align: center;
+ width: 80px;
+ padding-top: 8px;
+}
+
+td.media-icon img {
+ max-width: 80px;
+ max-height: 60px;
+}
+
+#update-nag {
+ line-height: 29px;
+ font-size: 12px;
+ text-align: center;
+}
+
+#update-nag {
+ border-width: 1px 0;
+ border-style: solid none;
+}
+
+.plugins .plugin-update {
+ padding: 0;
+}
+
+.plugin-update .update-message {
+ margin: 0 10px 8px 31px;
+ font-weight: bold;
+}
+
+#pass-strength-result {
+ border-style: solid;
+ border-width: 1px;
+ float: left;
+ margin: 12px 5px 5px 1px;
+ padding: 3px 5px;
+ text-align: center;
+ width: 200px;
+}
+
+.row-actions {
+ visibility: hidden;
+ padding: 2px 0 0;
+}
+
+tr:hover .row-actions,
+div.comment-item:hover .row-actions {
+ visibility: visible;
+}
+
+.row-actions-visible {
+ padding: 2px 0 0;
+ cursor: pointer;
+}
+
+/* Admin Header */
+#wphead-info {
+ margin: 0 0 0 15px;
+ padding-right: 15px;
+}
+
+#user_info {
+ float: right;
+ font-size: 12px;
+ line-height: 46px;
+ height: 46px;
+}
+
+#user_info p {
+ margin: 0;
+ padding: 0;
+ line-height: 46px;
+}
+
+#wphead {
+ height: 46px;
+}
+
+#wphead a,
+#adminmenu a,
+#sidemenu a,
+#taglist a,
+#catlist a,
+#show-settings a {
+ text-decoration: none;
+}
+
+#header-logo {
+ float: left;
+ margin: 7px 0 0 15px;
+}
+
+#wphead h1 {
+ font: normal 22px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ padding: 10px 8px 5px;
+ margin: 0;
+ float: left;
+}
+
+#wphead h1.long-title {
+ font: normal 18px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ padding: 12px 10px 5px;
+}
+
+#wphead #site-visit-button {
+ background-repeat:repeat-x;
+ background-position:0 0;
+ -moz-border-radius:3px;
+ -webkit-border-radius:3px;
+ -khtml-border-radius:3px;
+ border-radius:3px;
+ cursor:pointer; /* to keep IE happy */
+ display:-moz-inline-stack; /* to keep FF2 happy */
+ display:inline-block;
+ font-size: 50%;
+ font-style:normal;
+ line-height:17px;
+ margin-left:5px;
+ padding:0 6px;
+ vertical-align:middle;
+}
+
+#wphead h1 a:hover {
+ text-decoration:none;
+}
+#wphead h1 a:hover #site-title {
+ text-decoration:underline;
+}
+
+/* side admin menu */
+#adminmenu * {
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -khtml-user-select: none;
+ user-select: none;
+}
+
+#adminmenu .wp-submenu {
+ display: none;
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ position: relative;
+ z-index: 2;
+ border-width: 1px 0 0;
+ border-style: solid none none;
+}
+
+#adminmenu .wp-submenu a {
+ font: normal 11px/18px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+}
+
+#adminmenu .wp-submenu li.current,
+#adminmenu .wp-submenu li.current a,
+#adminmenu .wp-submenu li.current a:hover {
+ font-weight: bold;
+}
+
+#adminmenu a.menu-top,
+#adminmenu .wp-submenu-head {
+ font: normal 13px/18px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+}
+
+#adminmenu div.wp-submenu-head {
+ display: none;
+}
+
+.folded #adminmenu div.wp-submenu-head,
+.folded #adminmenu li.wp-has-submenu div.sub-open {
+ display: block;
+}
+
+.folded #adminmenu a.menu-top,
+.folded #adminmenu .wp-submenu,
+.folded #adminmenu li.wp-menu-open .wp-submenu,
+.folded #adminmenu div.wp-menu-toggle {
+ display: none;
+}
+
+#adminmenu li.wp-menu-open .wp-submenu,
+.no-js #adminmenu .open-if-no-js .wp-submenu {
+ display: block;
+}
+
+#adminmenu div.wp-menu-image {
+ float: left;
+ width: 28px;
+ height: 28px;
+}
+
+#adminmenu li {
+ margin: 0;
+ padding: 0;
+ cursor: pointer;
+}
+
+#adminmenu a {
+ display: block;
+ line-height: 18px;
+ padding: 1px 5px 3px;
+}
+
+#adminmenu li.menu-top {
+ min-height: 26px;
+}
+
+#adminmenu a.menu-top {
+ line-height: 18px;
+ min-width: 10em;
+ padding: 5px 5px;
+ border-width: 1px 1px 0;
+ border-style: solid solid none;
+}
+
+#adminmenu .wp-submenu a {
+ margin: 0;
+ padding-left: 12px;
+ border-width: 0 1px 0 0;
+ border-style: none solid none none;
+}
+
+#adminmenu .menu-top-last ul.wp-submenu {
+ border-width: 0 0 1px;
+ border-style: none none solid;
+}
+
+#adminmenu .wp-submenu li {
+ padding: 0;
+ margin: 0;
+}
+
+.folded #adminmenu li.menu-top {
+ width: 28px;
+ height: 30px;
+ overflow: hidden;
+ border-width: 1px 1px 0;
+ border-style: solid solid none;
+}
+
+#adminmenu .menu-top-first a.menu-top,
+.folded #adminmenu li.menu-top-first,
+#adminmenu .wp-submenu .wp-submenu-head {
+ border-width: 1px 1px 0;
+ border-style: solid solid none;
+ -moz-border-radius-topleft :6px;
+ -moz-border-radius-topright: 6px;
+ -webkit-border-top-right-radius: 6px;
+ -webkit-border-top-left-radius: 6px;
+ -khtml-border-top-right-radius: 6px;
+ -khtml-border-top-left-radius: 6px;
+ border-top-right-radius: 6px;
+ border-top-left-radius: 6px;
+}
+
+#adminmenu .menu-top-last a.menu-top,
+.folded #adminmenu li.menu-top-last {
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius-bottomleft: 6px;
+ -moz-border-radius-bottomright: 6px;
+ -webkit-border-bottom-right-radius: 6px;
+ -webkit-border-bottom-left-radius: 6px;
+ -khtml-border-bottom-right-radius: 6px;
+ -khtml-border-bottom-left-radius: 6px;
+ border-bottom-right-radius: 6px;
+ border-bottom-left-radius: 6px;
+}
+
+#adminmenu li.wp-menu-open a.menu-top-last {
+ border-bottom: 0 none;
+ -moz-border-radius-bottomright: 0;
+ -moz-border-radius-bottomleft: 0;
+ -webkit-border-bottom-right-radius: 0;
+ -webkit-border-bottom-left-radius: 0;
+ -khtml-border-bottom-right-radius: 0;
+ -khtml-border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+ border-bottom-left-radius: 0;
+}
+
+#adminmenu .wp-menu-image img {
+ float: left;
+ padding: 8px 6px 0;
+ opacity: 0.6;
+ filter: alpha(opacity=60);
+}
+
+#adminmenu li.menu-top:hover .wp-menu-image img,
+#adminmenu li.wp-has-current-submenu .wp-menu-image img {
+ opacity: 1;
+ filter: alpha(opacity=100);
+}
+
+#adminmenu li.wp-menu-separator {
+ height: 21px;
+ padding: 0;
+ margin: 0;
+}
+
+#adminmenu a.separator {
+ cursor: w-resize;
+ height: 20px;
+ padding: 0;
+}
+
+.folded #adminmenu a.separator {
+ cursor: e-resize;
+}
+
+#adminmenu .wp-menu-separator-last {
+ height: 10px;
+ width: 1px;
+}
+
+#adminmenu .wp-submenu .wp-submenu-head {
+ border-width: 1px;
+ border-style: solid;
+ padding: 6px 4px 6px 10px;
+ cursor: default;
+}
+
+.folded #adminmenu .wp-submenu {
+ position: absolute;
+ margin: -1px 0 0 28px;
+ padding: 0 8px 8px;
+ z-index: 999;
+ border: 0 none;
+}
+
+.folded #adminmenu .wp-submenu ul {
+ width: 140px;
+ border-width: 0 0 1px;
+ border-style: none none solid;
+}
+
+.folded #adminmenu .wp-submenu li.wp-first-item {
+ border-top: 0 none;
+}
+
+.folded #adminmenu .wp-submenu a {
+ padding-left: 10px;
+}
+
+.folded #adminmenu a.wp-has-submenu {
+ margin-left: 40px;
+}
+
+#adminmenu li.menu-top-last .wp-submenu ul {
+ border-width: 0 0 1px;
+ border-style: none none solid;
+}
+
+#adminmenu .wp-menu-toggle {
+ width: 22px;
+ clear: right;
+ float: right;
+ margin: 1px 0 0;
+ height: 27px;
+ padding: 1px 2px 0 0;
+ cursor: default;
+}
+
+#adminmenu li.wp-has-current-submenu ul {
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+}
+
+#adminmenu .wp-menu-image a {
+ height: 24px;
+}
+
+#adminmenu .wp-menu-image img {
+ padding: 6px 0 0 1px;
+}
+
+/* end side admin menu */
+
+/* comments/plugins bubble in menu */
+#adminmenu #awaiting-mod,
+#adminmenu span.update-plugins,
+#sidemenu li a span.update-plugins {
+ position: absolute;
+ font-family: Helvetica, Arial, sans-serif;
+ font-size: 7pt;
+ font-weight: bold;
+ margin-top: 2px;
+ margin-left: 2px;
+ -moz-border-radius: 7px;
+ -khtml-border-radius: 7px;
+ -webkit-border-radius: 7px;
+ border-radius: 7px;
+}
+
+#adminmenu li #awaiting-mod span,
+#adminmenu li span.update-plugins span,
+#sidemenu li a span.update-plugins span {
+ float: left;
+ display: block;
+ height: 1.6em;
+ line-height: 1.6em;
+ padding: 0 6px;
+}
+
+#adminmenu li span.count-0,
+#sidemenu li a .count-0 {
+ display: none;
+}
+/* end menu stuff */
+
+/* comments bubble */
+.post-com-count-wrapper {
+ min-width: 22px;
+ font-family: Helvetica, Arial, sans-serif;
+}
+
+.post-com-count {
+ height: 1.3em;
+ line-height: 1.1em;
+ display: block;
+ text-decoration: none;
+ padding: 0 0 6px;
+ cursor: pointer;
+ background-position: center -80px;
+ background-repeat: no-repeat;
+}
+
+.post-com-count span {
+ font-size: 9px;
+ font-weight: bold;
+ height: 1.7em;
+ line-height: 1.70em;
+ min-width: 0.7em;
+ padding: 0 6px;
+ display: inline-block;
+ cursor: pointer;
+ -moz-border-radius: 5px;
+ -khtml-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+}
+
+strong .post-com-count {
+ background-position: center -55px;
+}
+
+.post-com-count:hover {
+ background-position: center -3px;
+}
+
+.column-response .post-com-count {
+ float: left;
+ margin-right: 5px;
+ text-align: center;
+}
+
+.response-links {
+ float: left;
+}
+
+#the-comment-list .attachment-80x60 {
+ padding: 4px 8px;
+}
+
+/* Admin Footer */
+#footer {
+ margin-top: -45px;
+}
+
+#footer,
+#footer a {
+ font-size: 12px;
+ font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ font-style: italic;
+}
+
+#footer p {
+ margin: 0;
+ padding: 15px;
+ line-height: 15px;
+}
+
+#footer a {
+ text-decoration: none;
+}
+
+#footer a:hover {
+ text-decoration: underline;
+}
+
+/* Tables used on comment.php and option/setting pages */
+
+.form-table {
+ border-collapse: collapse;
+ margin-top: 0.5em;
+ width: 100%;
+ margin-bottom: -8px;
+ clear: both;
+}
+
+.form-table td {
+ margin-bottom: 9px;
+ padding: 8px 10px;
+ line-height: 20px;
+ font-size: 11px;
+}
+
+.form-table th,
+.form-wrap label {
+ font-weight: normal;
+ text-shadow: rgba(255,255,255,1) 0 1px 0;
+}
+
+.form-table th {
+ vertical-align: top;
+ text-align: left;
+ padding: 10px;
+ width: 200px;
+}
+
+.form-table th.th-full {
+ width: auto;
+}
+
+.form-table div.color-option {
+ display: block;
+ clear: both;
+ margin-top: 12px;
+}
+
+.form-table input.tog {
+ margin-top: 2px;
+ margin-right: 2px;
+ float: left;
+}
+
+.form-table table.color-palette {
+ vertical-align: bottom;
+ float: left;
+ margin: -12px 3px 11px;
+}
+
+.form-table .color-palette td {
+ border-width: 1px 1px 0;
+ border-style: solid solid none;
+ height: 10px;
+ line-height: 20px;
+ width: 10px;
+}
+
+textarea.large-text {
+ width: 99%;
+}
+
+.form-table input.regular-text,
+#adduser .form-field input {
+ width: 25em;
+}
+
+.form-table input.small-text {
+ width: 50px;
+}
+
+#profile-page .form-table textarea {
+ width: 500px;
+ margin-bottom: 6px;
+}
+
+#profile-page .form-table #rich_editing {
+ margin-right: 5px
+}
+
+.form-table .pre {
+ padding: 8px;
+ margin: 0;
+}
+
+.pre {
+ /* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */
+ white-space: pre-wrap; /* css-3 */
+ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
+ white-space: -pre-wrap; /* Opera 4-6 */
+ white-space: -o-pre-wrap; /* Opera 7 */
+ word-wrap: break-word; /* Internet Explorer 5.5+ */
+}
+
+table.form-table td .updated {
+ font-size: 13px;
+}
+
+/* divs for cats and tags pages */
+
+.form-wrap {
+ margin: 10px 0;
+ width: 97%;
+}
+
+.form-wrap p,
+.form-wrap label {
+ font-size: 11px;
+}
+
+.form-wrap label {
+ display: block;
+ padding: 2px;
+ font-size: 12px;
+}
+
+.form-field input,
+.form-field textarea {
+ border-style: solid;
+ border-width: 1px;
+ width: 95%;
+}
+
+p.description,
+.form-wrap p {
+ margin: 2px 0 5px;
+}
+
+p.help,
+p.description,
+span.description,
+.form-wrap p {
+ font-size: 12px;
+ font-style: italic;
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+}
+
+.form-wrap .form-field {
+ margin: 0 0 10px;
+ padding: 8px;
+}
+
+.col-wrap h3 {
+ margin: 12px 0;
+ font-size: 1.1em;
+}
+
+.col-wrap p.submit {
+ margin-top: -10px;
+}
+
+.tagcloud {
+ width: 97%;
+ margin: 0 0 40px;
+ text-align: justify;
+}
+
+.tagcloud h3 {
+ margin: 2px 0 12px;
+}
+
+/* Post Screen */
+#post-body #normal-sortables {
+ min-height: 50px;
+}
+
+#post-body #advanced-sortables {
+ min-height: 20px;
+}
+
+.postbox {
+ position: relative;
+ min-width: 255px;
+ width: 99.5%;
+}
+
+#trackback_url {
+ width: 99%;
+}
+
+#normal-sortables .postbox .submit {
+ background: transparent none;
+ border: 0 none;
+ float: right;
+ padding: 0 12px;
+ margin: 0;
+}
+
+#normal-sortables .postbox #replyrow .submit {
+ float: none;
+ margin: 0;
+ padding: 3px 7px;
+}
+
+#side-sortables .submitbox .submit input,
+#side-sortables .submitbox .submit .preview,
+#side-sortables .submitbox .submit a.preview:hover {
+ border: 0 none;
+}
+
+#side-sortables .inside-submitbox .insidebox,
+.stuffbox .insidebox {
+ margin: 11px 0;
+}
+
+#side-sortables .comments-box,
+#normal-sortables .comments-box {
+ border: 0 none;
+}
+
+#side-sortables .comments-box thead th,
+#normal-sortables .comments-box thead th {
+ background: transparent;
+ padding: 0 7px 4px;
+ font-style: italic;
+}
+
+#commentsdiv img.waiting {
+ padding-left: 5px;
+ vertical-align: middle;
+}
+
+#post-body .tagsdiv #newtag {
+ margin-right: 5px;
+ width: 16em;
+}
+
+#side-sortables input#post_password {
+ width: 94%
+}
+
+#side-sortables .tagsdiv #newtag {
+ width: 68%;
+}
+
+#post-status-info {
+ border-width: 0 1px 1px;
+ border-style: none solid solid;
+ width: 100%;
+ -moz-border-radius: 0 0 6px 6px;
+ -webkit-border-bottom-left-radius: 6px;
+ -webkit-border-bottom-right-radius: 6px;
+ -khtml-border-bottom-left-radius: 6px;
+ -khtml-border-bottom-right-radius: 6px;
+ border-bottom-left-radius: 6px;
+ border-bottom-right-radius: 6px;
+}
+
+#post-status-info td {
+ font-size: 11px;
+}
+
+.autosave-info {
+ padding: 2px 15px 2px 2px;
+ text-align: right;
+}
+
+#editorcontent #post-status-info {
+ border: none;
+}
+
+#post-body .wp_themeSkin .mceStatusbar a.mceResize {
+ display: block;
+ background: transparent url(images/resize.gif) no-repeat scroll right bottom;
+ width: 12px;
+ cursor: se-resize;
+ margin: 0 2px;
+ position: relative;
+ top: 22px;
+}
+
+#linksubmitdiv div.inside,
+div.inside {
+ padding: 0;
+ margin: 0;
+}
+
+#comment-status-radio p {
+ margin: 3px 0 5px;
+}
+
+#comment-status-radio input {
+ margin: 2px 3px 5px 0;
+ vertical-align: middle;
+}
+
+#comment-status-radio label {
+ padding: 5px 0;
+}
+
+.tagchecklist {
+ margin-left: 14px;
+ font-size: 12px;
+ overflow: auto;
+}
+
+.tagchecklist strong {
+ margin-left: -8px;
+ position: absolute;
+}
+
+.tagchecklist span {
+ margin-right: 25px;
+ display: block;
+ float: left;
+ font-size: 11px;
+ line-height: 1.8em;
+ white-space: nowrap;
+ cursor: default;
+}
+
+.tagchecklist span a {
+ margin: 6px 0pt 0pt -9px;
+ cursor: pointer;
+ width: 10px;
+ height: 10px;
+ display: block;
+ float: left;
+ text-indent: -9999px;
+ overflow: hidden;
+ position: absolute;
+}
+
+.howto {
+ font-style: italic;
+ display: block;
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+}
+
+.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;
+}
+
+#poststuff h2 {
+ margin-top: 20px;
+ font-size: 1.5em;
+ margin-bottom: 15px;
+ padding: 0 0 3px;
+ clear: left;
+}
+
+.widget .widget-top,
+.postbox h3 {
+ cursor: move;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -khtml-user-select: none;
+ user-select: none;
+}
+
+.postbox .hndle span {
+ padding: 6px 0;
+}
+
+.postbox .hndle {
+ cursor: move;
+}
+
+.hndle a {
+ font-size: 11px;
+ font-weight: normal;
+}
+
+#dashboard-widgets .meta-box-sortables {
+ margin: 0 5px;
+}
+
+.postbox .handlediv {
+ float: right;
+ width: 23px;
+ height: 26px;
+}
+
+.sortable-placeholder {
+ border-width: 1px;
+ border-style: dashed;
+ margin-bottom: 20px;
+}
+
+#poststuff h3,
+.metabox-holder h3 {
+ font-size: 12px;
+ font-weight: bold;
+ padding: 7px 9px;
+ margin: 0;
+ line-height: 1;
+}
+
+.widget,
+.postbox,
+.stuffbox {
+ margin-bottom: 20px;
+ border-width: 1px;
+ border-style: solid;
+ line-height: 1;
+ -moz-border-radius: 6px;
+ -khtml-border-radius: 6px;
+ -webkit-border-radius: 6px;
+ border-radius: 6px;
+}
+
+.widget .widget-top,
+.postbox h3,
+.postbox h3,
+.stuffbox h3 {
+ -moz-border-radius: 6px 6px 0 0;
+ -webkit-border-top-right-radius: 6px;
+ -webkit-border-top-left-radius: 6px;
+ -khtml-border-top-right-radius: 6px;
+ -khtml-border-top-left-radius: 6px;
+ border-top-right-radius: 6px;
+ border-top-left-radius: 6px;
+}
+
+.postbox.closed h3 {
+ -moz-border-radius-bottomleft:4px;
+ -webkit-border-bottom-left-radius: 4px;
+ -khtml-border-bottom-left-radius: 4px;
+ border-bottom-left-radius: 4px;
+ -moz-border-radius-bottomright:4px;
+ -webkit-border-bottom-right-radius: 4px;
+ -khtml-border-bottom-right-radius: 4px;
+ border-bottom-right-radius: 4px;
+}
+
+.postbox table.form-table {
+ margin-bottom: 0;
+}
+
+.postbox input[type="text"],
+.postbox textarea,
+.stuffbox input[type="text"],
+.stuffbox textarea {
+ border-width: 1px;
+ border-style: solid;
+}
+
+#poststuff .inside,
+#poststuff .inside p {
+ font-size: 11px;
+ margin: 6px 6px 8px;
+}
+
+#poststuff .inside .submitbox p {
+ margin: 1em 0;
+}
+
+#post-visibility-select {
+ line-height: 1.5em;
+ margin-top: 3px;
+}
+
+#poststuff #submitdiv .inside {
+ margin: 0;
+}
+
+#titlediv, #poststuff .postarea {
+ margin-bottom: 20px;
+}
+
+#titlediv {
+ margin-bottom: 20px;
+}
+#titlediv label { cursor: text; }
+
+#titlediv div.inside {
+ margin: 0;
+}
+
+#poststuff #titlewrap {
+ border: 0;
+ padding: 0;
+
+}
+
+#titlediv #title {
+ padding: 3px 4px;
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 6px;
+ -khtml-border-radius: 6px;
+ -webkit-border-radius: 6px;
+ border-radius: 6px;
+ font-size: 1.7em;
+ width: 100%;
+ outline: none;
+}
+
+#poststuff .inside-submitbox,
+#side-sortables .inside-submitbox {
+ margin: 0 3px;
+ font-size: 11px;
+}
+
+input#link_description,
+input#link_url {
+ width: 98%;
+}
+
+#pending {
+ background: 0 none;
+ border: 0 none;
+ padding: 0;
+ font-size: 11px;
+ margin-top: -1px;
+}
+
+#edit-slug-box {
+ height: 1em;
+ margin-top: 8px;
+ padding: 0 7px;
+}
+
+#editable-post-name-full {
+ display: none;
+}
+
+#editable-post-name input {
+ width: 16em;
+}
+
+.postarea h3 label {
+ float: left;
+}
+
+.postarea #add-media-button {
+ float: right;
+ margin: 7px 0pt 0pt;
+ position: relative;
+ right: 10px;
+}
+
+#poststuff #editor-toolbar {
+ height: 30px;
+}
+
+.wp_themeSkin tr.mceFirst td.mceToolbar {
+ border-width: 0 0 1px;
+ border-style: none none solid;
+}
+
+#edButtonPreview,
+#edButtonHTML {
+ height: 18px;
+ margin: 5px 5px 0 0;
+ padding: 4px 5px 2px;
+ float: right;
+ cursor: pointer;
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 3px 3px 0 0;
+ -webkit-border-top-right-radius: 3px;
+ -webkit-border-top-left-radius: 3px;
+ -khtml-border-top-right-radius: 3px;
+ -khtml-border-top-left-radius: 3px;
+ border-top-right-radius: 3px;
+ border-top-left-radius: 3px;
+}
+
+.js .theEditor {
+ color: white;
+}
+
+#poststuff #edButtonHTML {
+ margin-right: 15px;
+}
+
+#media-buttons {
+ cursor: default;
+ padding: 8px 8px 0;
+}
+
+#media-buttons a {
+ cursor: pointer;
+ padding: 0 0 5px 10px;
+}
+
+#media-buttons img,
+#submitpost #ajax-loading {
+ vertical-align: middle;
+}
+
+.submitbox .submit {
+ text-align: left;
+ padding: 12px 10px 10px;
+ font-size: 11px;
+}
+
+.submitbox .submitdelete {
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+ text-decoration: none;
+ padding: 1px 2px;
+}
+
+.inside-submitbox #post_status {
+ margin: 2px 0 2px -2px;
+}
+
+.submitbox .submit a:hover {
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+}
+
+.submitbox .submit input {
+ margin-bottom: 8px;
+ margin-right: 4px;
+ padding: 6px;
+}
+
+#post-status-select {
+ line-height: 2.5em;
+ margin-top: 3px;
+}
+
+/* Categories */
+
+#category-adder {
+ margin-left: 120px;
+ padding: 4px 0;
+}
+
+#category-adder h4 {
+ margin: 0 0 8px;
+}
+
+#side-sortables #category-adder {
+ margin: 0;
+}
+
+#post-body #category-add input, #category-add select {
+ width: 30%;
+}
+
+#side-sortables #category-add input {
+ width: 94%;
+}
+
+#side-sortables #category-add select {
+ width: 100%;
+}
+
+#category-add input#category-add-sumbit {
+ width: auto;
+}
+
+#post-body ul#category-tabs {
+ float: left;
+ width: 120px;
+ text-align: right;
+ /* Negative margin for the sake of those without JS: all tabs display */
+ margin: 0 -120px 0 5px;
+ padding: 0;
+}
+
+#post-body ul#category-tabs li {
+ padding: 8px;
+}
+
+#post-body ul#category-tabs li.tabs {
+ -moz-border-radius: 3px 0 0 3px;
+ -webkit-border-top-left-radius: 3px;
+ -webkit-border-bottom-left-radius: 3px;
+ -khtml-border-top-left-radius: 3px;
+ -khtml-border-bottom-left-radius: 3px;
+ border-top-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+
+#post-body ul#category-tabs li.tabs a {
+ font-weight: bold;
+ text-decoration: none;
+}
+
+#categorydiv div.tabs-panel,
+#linkcategorydiv div.tabs-panel {
+ height: 200px;
+ overflow: auto;
+ padding: 0.5em 0.9em;
+ border-style: solid;
+ border-width: 1px;
+}
+
+#post-body #categorydiv div.tabs-panel,
+#post-body #linkcategorydiv div.tabs-panel {
+ margin: 0 5px 0 125px;
+}
+
+#side-sortables #category-tabs li {
+ display: inline;
+ padding-right: 8px;
+}
+
+#side-sortables #category-tabs a {
+ text-decoration: none;
+}
+
+#side-sortables #category-tabs {
+ margin-bottom: 3px;
+}
+
+#categorydiv ul,
+#linkcategorydiv ul {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+}
+
+#categorydiv ul.categorychecklist ul,
+#linkcategorydiv ul.categorychecklist ul {
+ margin-left: 18px;
+}
+
+ul.categorychecklist li {
+ margin: 0;
+ padding: 0;
+ line-height: 19px;
+}
+
+#category-adder h4 {
+ margin-top: 4px;
+ margin-bottom: 0px;
+}
+
+#categorydiv .tabs-panel {
+ border-width: 3px;
+ border-style: solid;
+}
+
+ul#category-tabs {
+ margin-top: 12px;
+}
+
+ul#category-tabs li.tabs {
+ border-style: solid solid none;
+ border-width: 1px 1px 0;
+}
+
+#post-body #category-tabs li.tabs {
+ border-style: solid none solid solid;
+ border-width: 1px 0 1px 1px;
+ margin-right: -1px;
+}
+
+ul#category-tabs li {
+ padding: 5px 8px;
+ -moz-border-radius: 3px 3px 0 0;
+ -webkit-border-top-left-radius: 3px;
+ -webkit-border-top-right-radius: 3px;
+ -khtml-border-top-left-radius: 3px;
+ -khtml-border-top-right-radius: 3px;
+ border-top-left-radius: 3px;
+ border-top-right-radius: 3px;
+}
+
+/* positioning etc. */
+
+form#tags-filter {
+ position: relative;
+}
+
+p.search-box {
+ float: right;
+ margin: -5px 0 0;
+}
+
+.screen-per-page {
+ width: 3em;
+}
+
+#posts-filter fieldset {
+ float: left;
+ margin: 0 1.5ex 1em 0;
+ padding: 0;
+}
+
+#posts-filter fieldset legend {
+ padding: 0 0 .2em 1px;
+}
+
+/* Edit posts */
+
+td.post-title strong, td.plugin-title strong {
+ display: block;
+ margin-bottom: .2em;
+}
+
+td.post-title p, td.plugin-title p {
+ margin: 6px 0;
+}
+
+td.plugin-title {
+ white-space: nowrap;
+}
+
+/* Global classes */
+
+.wp-hidden-children .wp-hidden-child,
+.ui-tabs-hide,
+#codepress-off {
+ display: none;
+}
+
+.commentlist .avatar {
+ vertical-align: text-top;
+}
+
+.defaultavatarpicker .avatar {
+ margin: 2px 0;
+ vertical-align: middle;
+}
+
+body.wp-admin {
+ min-width: 785px;
+}
+
+.view-switch {
+ float: right;
+ margin: 6px 8px 0;
+}
+
+.view-switch a {
+ text-decoration: none;
+}
+
+.filter {
+ float: left;
+ margin: -5px 0 0 10px;
+}
+
+.filter .subsubsub {
+ margin-left: -10px;
+ margin-top: 13px;
+}
+
+#the-comment-list td.comment p.comment-author {
+ margin-top: 0;
+ margin-left: 0;
+}
+
+#the-comment-list p.comment-author img {
+ float: left;
+ margin-right: 8px;
+}
+
+#the-comment-list p.comment-author strong a {
+ border: none;
+}
+
+#the-comment-list td {
+ vertical-align: top;
+}
+
+#the-comment-list td.comment {
+ word-wrap: break-word;
+}
+
+#the-comment-list .check-column {
+ padding-top: 8px;
+}
+
+#templateside ul li a {
+ text-decoration: none;
+}
+
+.indicator-hint {
+ padding-top: 8px;
+}
+
+#display_name {
+ width: 15em;
+}
+
+.tablenav .delete {
+ margin-right: 20px;
+}
+
+td.action-links,
+th.action-links {
+ text-align: right;
+}
+
+/* Diff */
+
+table.diff {
+ width: 100%;
+}
+
+table.diff col.content {
+ width: 50%;
+}
+
+table.diff tr {
+ background-color: transparent;
+}
+
+table.diff td, table.diff th {
+ padding: .5em;
+ font-family: Consolas, Monaco, Courier, monospace;
+ border: none;
+}
+
+table.diff .diff-deletedline del, table.diff .diff-addedline ins {
+ text-decoration: none;
+}
+
+#wp-word-count {
+ display: block;
+ padding: 2px 7px;
+}
+
+fieldset {
+ border: 0;
+ padding: 0;
+ margin: 0;
+}
+
+.tool-box {
+ margin: 15px 0 35px;
+}
+
+.tool-box .buttons {
+ margin: 15px 0;
+}
+
+.tool-box .title {
+ margin: 8px 0;
+ font: 18px/24px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+}
+
+.pressthis a {
+ font-size: 1.2em;
+}
+
+#wp_editbtns,
+#wp_gallerybtns {
+ padding: 2px;
+ position: absolute;
+ display: none;
+ z-index: 999998;
+}
+
+#wp_editimgbtn,
+#wp_delimgbtn,
+#wp_editgallery,
+#wp_delgallery {
+ margin: 2px;
+ padding: 2px;
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 3px;
+ -khtml-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+}
+
+.settings-toggle {
+ text-align: right;
+ margin: 5px 7px 15px 0;
+ font-size: 12px;
+}
+
+.settings-toggle h3 {
+ margin: 0;
+}
+
+#timestampdiv select {
+ height: 20px;
+ line-height: 14px;
+ padding: 0;
+ vertical-align: top;
+}
+
+#jj, #hh, #mn {
+ width: 2em;
+ padding: 1px;
+ font-size: 12px;
+}
+
+#aa {
+ width: 3.4em;
+ padding: 1px;
+ font-size: 12px;
+}
+
+.curtime #timestamp {
+ background-repeat: no-repeat;
+ background-position: left top;
+ padding-left: 18px;
+}
+
+#timestampdiv {
+ padding-top: 5px;
+ line-height: 23px;
+}
+
+#timestampdiv p {
+ margin: 8px 0 6px;
+}
+
+#timestampdiv input {
+ border-width: 1px;
+ border-style: solid;
+}
+
+/* media popup 0819 */
+#sidemenu {
+ margin: -30px 15px 0 315px;
+ list-style: none;
+ position: relative;
+ float: right;
+ padding-left: 10px;
+ font-size: 12px;
+}
+
+#sidemenu a {
+ padding: 0 7px;
+ display: block;
+ float: left;
+ line-height: 28px;
+ border-top-width: 1px;
+ border-top-style: solid;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+}
+
+#sidemenu li {
+ display: inline;
+ line-height: 200%;
+ list-style: none;
+ text-align: center;
+ white-space: nowrap;
+ margin: 0;
+ padding: 0;
+}
+
+#sidemenu a.current {
+ font-weight: normal;
+ padding-left: 6px;
+ padding-right: 6px;
+ -moz-border-radius: 4px 4px 0 0;
+ -webkit-border-top-left-radius: 4px;
+ -webkit-border-top-right-radius: 4px;
+ -khtml-border-top-left-radius: 4px;
+ -khtml-border-top-right-radius: 4px;
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+ border-width: 1px;
+ border-style: solid;
+}
+
+#sidemenu {
+ margin: -30px 15px 0 315px;
+ list-style: none;
+ position: relative;
+ float: right;
+ padding-left: 10px;
+ font-size: 12px;
+}
+
+#sidemenu a {
+ padding: 0 7px;
+ display: block;
+ float: left;
+ line-height: 28px;
+ border-top-width: 1px;
+ border-top-style: solid;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+}
+
+#sidemenu li a .count-0 {
+ display: none;
+}
+
+/* reply to comments */
+#replyrow {
+ font-size: 11px;
+}
+
+#replyrow input {
+ border-width: 1px;
+ border-style: solid;
+}
+
+#replyrow td {
+ padding: 2px;
+}
+
+#replyrow #editorcontainer {
+ border: 0 none;
+}
+
+#replysubmit {
+ margin: 0;
+ padding: 3px 7px;
+}
+
+#replysubmit img.waiting,
+.inline-edit-save img.waiting {
+ padding: 2px 10px 0;
+ vertical-align: top;
+}
+
+#replysubmit .button {
+ margin-right: 5px;
+}
+
+#replyrow #editor-toolbar {
+ display: none;
+}
+
+#replyhead {
+ font-size: 12px;
+ font-weight: bold;
+ padding: 2px 10px 4px;
+}
+
+#edithead .inside {
+ float: left;
+ padding: 3px 0 2px 5px;
+ margin: 0;
+ text-align: center;
+ font-size: 11px;
+}
+
+#edithead .inside input {
+ width: 180px;
+ font-size: 11px;
+}
+
+#edithead label {
+ padding: 2px 0;
+}
+
+#replycontainer {
+ padding: 5px;
+ border: 0 none;
+ height: 120px;
+ overflow: hidden;
+ position: relative;
+}
+
+#replycontent {
+ resize: none;
+ margin: 0;
+ width: 100%;
+ height: 100%;
+ padding: 0;
+ line-height: 150%;
+ border: 0 none;
+ outline: none;
+ font-size: 12px;
+}
+
+#replyrow #ed_reply_toolbar {
+ margin: 0;
+ padding: 2px 3px;
+}
+
+/* show/hide settings */
+#screen-meta {
+ position: relative;
+ clear: both;
+}
+
+#screen-meta-links {
+ margin: 0 9px 0 0;
+}
+
+#screen-meta .screen-reader-text {
+ visibility: hidden;
+}
+
+#screen-options-link-wrap,
+#contextual-help-link-wrap {
+ float: right;
+ background: transparent url( images/screen-options-left.gif ) no-repeat 0 0;
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+ height: 22px;
+ padding: 0;
+ margin: 0 6px 0 0;
+}
+
+#screen-meta a.show-settings {
+ text-decoration: none;
+ z-index: 1;
+ padding: 0 16px 0 6px;
+ height: 22px;
+ line-height: 22px;
+ font-size: 10px;
+ display: block;
+ background-repeat: no-repeat;
+ background-position: right bottom;
+}
+
+#screen-meta a.show-settings {
+ background-image: url( images/screen-options-right.gif );
+}
+
+#screen-meta a.show-settings:hover {
+ text-decoration: none;
+}
+
+#screen-options-wrap h5,
+#contextual-help-wrap h5 {
+ margin: 8px 0;
+ font-size: 13px;
+}
+
+#screen-options-wrap,
+#contextual-help-wrap {
+ border-style: none solid solid;
+ border-top: 0 none;
+ border-width: 0 1px 1px;
+ margin: 0 15px;
+ padding: 8px 12px 12px;
+ -moz-border-radius: 0 0 0 4px;
+ -webkit-border-bottom-left-radius: 4px;
+ -khtml-border-bottom-left-radius: 4px;
+ border-bottom-left-radius: 4px;
+}
+
+.metabox-prefs label {
+ padding-right: 15px;
+ white-space: nowrap;
+ line-height: 30px;
+}
+
+.metabox-prefs label input {
+ margin: 0 5px 0 2px;
+}
+
+.metabox-prefs label a {
+ display: none;
+}
+
+/* Inline Editor
+ .quick-edit* is for Quick Edit
+ .bulk-edit* is for Bulk Edit
+ .inline-edit* is for everything
+*/
+/* Layout */
+tr.inline-edit-row td {
+ padding: 0 0.5em;
+}
+
+#wpbody-content .inline-edit-row fieldset {
+ font-size: 12px;
+ float: left;
+ margin: 0;
+ padding: 0;
+ width: 100%;
+}
+
+#wpbody-content .inline-edit-row fieldset .inline-edit-col {
+ padding: 0 0.5em;
+}
+
+#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col {
+ border-width: 0 0 0 1px;
+ border-style: none none none solid;
+}
+
+#wpbody-content .quick-edit-row-post .inline-edit-col-left {
+ width: 40%;
+}
+
+#wpbody-content .quick-edit-row-post .inline-edit-col-right {
+ width: 39%;
+}
+
+#wpbody-content .inline-edit-row-post .inline-edit-col-center {
+ width: 20%;
+}
+
+#wpbody-content .quick-edit-row-page .inline-edit-col-left {
+ width: 50%;
+}
+
+#wpbody-content .quick-edit-row-page .inline-edit-col-right,
+#wpbody-content .bulk-edit-row-post .inline-edit-col-right {
+ width: 49%;
+}
+
+#wpbody-content .bulk-edit-row .inline-edit-col-left {
+ width: 30%;
+}
+
+#wpbody-content .bulk-edit-row-page .inline-edit-col-right {
+ width: 69%;
+}
+
+#wpbody-content .bulk-edit-row .inline-edit-col-bottom {
+ float: right;
+ width: 69%;
+}
+
+#wpbody-content .inline-edit-row-page .inline-edit-col-right,
+#owpbody-content .bulk-edit-row-post .inline-edit-col-right {
+ margin-top: 27px;
+}
+
+.inline-edit-row fieldset .inline-edit-group {
+ clear: both;
+}
+
+.inline-edit-row fieldset .inline-edit-group:after {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+}
+
+.inline-edit-row p.submit {
+ clear: both;
+ padding: 0.5em;
+ margin: 0.5em 0 0;
+}
+
+.inline-edit-row span.error {
+ line-height: 22px;
+ margin: 0 15px;
+ padding: 3px 5px;
+}
+
+/* Positioning */
+.inline-edit-row h4 {
+ margin: .2em 0;
+ padding: 0;
+ line-height: 23px;
+}
+.inline-edit-row fieldset span.title,
+.inline-edit-row fieldset span.checkbox-title {
+ margin: 0;
+ padding: 0;
+ line-height: 27px;
+}
+
+.inline-edit-row fieldset label,
+.inline-edit-row fieldset span.inline-edit-categories-label {
+ display: block;
+ margin: .2em 0;
+}
+
+.inline-edit-row fieldset label.inline-edit-tags {
+ margin-top: 0;
+}
+
+.inline-edit-row fieldset label.inline-edit-tags span.title {
+ margin: .2em 0;
+}
+
+.inline-edit-row fieldset label span.title {
+ display: block;
+ float: left;
+ width: 5em;
+}
+
+.inline-edit-row fieldset label span.input-text-wrap {
+ display: block;
+ margin-left: 5em;
+}
+
+.quick-edit-row-post fieldset.inline-edit-col-right label span.title {
+ width: auto;
+ padding-right: 0.5em;
+}
+
+.inline-edit-row .input-text-wrap input[type=text] {
+ width: 100%;
+}
+
+.inline-edit-row fieldset label input[type=checkbox] {
+ vertical-align: text-bottom;
+}
+
+.inline-edit-row fieldset label textarea {
+ width: 100%;
+ height: 4em;
+}
+
+#wpbody-content .bulk-edit-row fieldset .inline-edit-group label {
+ max-width: 50%;
+}
+
+#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child {
+ margin-right: 0.5em
+}
+
+/* Styling */
+.inline-edit-row h4 {
+ text-transform: uppercase;
+}
+
+.inline-edit-row fieldset span.title,
+.inline-edit-row fieldset span.checkbox-title {
+ font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ font-style: italic;
+ line-height: 1.8em;
+}
+
+/* Specific Elements */
+.inline-edit-row fieldset input[type="text"],
+.inline-edit-row fieldset textarea {
+ border-style: solid;
+ border-width: 1px;
+}
+
+.inline-edit-row fieldset .inline-edit-date {
+ float: left;
+}
+
+.inline-edit-row fieldset input[name=jj],
+.inline-edit-row fieldset input[name=hh],
+.inline-edit-row fieldset input[name=mn] {
+ font-size: 12px;
+ width: 2.1em;
+}
+
+.inline-edit-row fieldset input[name=aa] {
+ font-size: 12px;
+ width: 3.5em;
+}
+
+.inline-edit-row fieldset label input.inline-edit-password-input {
+ width: 8em;
+}
+
+.inline-edit-row .catshow,
+.inline-edit-row .cathide {
+ cursor: pointer;
+}
+
+ul.cat-checklist {
+ height: 12em;
+ border-style: solid;
+ border-width: 1px;
+ overflow-y: scroll;
+ padding: 0 5px;
+ margin: 0;
+}
+
+#bulk-titles {
+ display: block;
+ height: 12em;
+ border-style: solid;
+ border-width: 1px;
+ overflow-y: scroll;
+ padding: 0 5px;
+ margin: 0 0 5px;
+}
+
+.inline-edit-row fieldset ul.cat-checklist li,
+.inline-edit-row fieldset ul.cat-checklist input {
+ margin: 0;
+}
+
+.inline-edit-row fieldset ul.cat-checklist label,
+.inline-edit-row .catshow,
+.inline-edit-row .cathide,
+.inline-edit-row #bulk-titles div {
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+ font-style: normal;
+ font-size: 11px;
+}
+
+table .inline-edit-row fieldset ul.cat-hover {
+ height: auto;
+ max-height: 30em;
+ overflow-y: auto;
+ position: absolute;
+}
+
+.inline-edit-row fieldset label input.inline-edit-menu-order-input {
+ width: 3em;
+}
+
+.inline-edit-row fieldset label input.inline-edit-slug-input {
+ width: 75%;
+}
+
+.quick-edit-row-post fieldset label.inline-edit-status {
+ float: left;
+}
+
+#bulk-titles {
+ line-height: 140%;
+}
+#bulk-titles div {
+ margin: 0.2em 0.3em;
+}
+
+#bulk-titles div a {
+ cursor: pointer;
+ display: block;
+ float: left;
+ height: 10px;
+ margin: 3px 3px 0 -2px;
+ overflow: hidden;
+ position: relative;
+ text-indent: -9999px;
+ width: 10px;
+}
+
+/* Media library */
+#wpbody-content #media-items .describe {
+ border-collapse: collapse;
+ width: 100%;
+ border-top-style: solid;
+ border-top-width: 1px;
+ clear: both;
+ cursor: default;
+ padding: 5px;
+}
+
+#wpbody-content .describe th {
+ vertical-align: top;
+ text-align: left;
+ padding: 10px;
+ width: 140px;
+}
+
+#wpbody-content .describe .media-item-info tr {
+ background-color: transparent;
+}
+
+#wpbody-content .describe .media-item-info td {
+ padding: 4px 10px 0;
+}
+
+.describe .media-item-info .A1B1 {
+ padding: 0 15px 8px 0;
+}
+
+#wpbody-content .filename {
+ padding: 0 10px;
+}
+
+#wpbody-content .media-item .thumbnail {
+ max-height: 128px;
+ max-width: 128px;
+}
+
+#wpbody-content #async-upload-wrap a {
+ display: none;
+}
+
+.media-upload-form td label {
+ margin-right: 6px;
+ margin-left: 2px;
+}
+
+.media-upload-form .align .field label {
+ display: inline;
+ padding: 0 0 0 22px;
+ margin: 0 1em 0 0;
+ font-weight: bold;
+}
+
+.media-upload-form tr.image-size label {
+ margin: 0 0 0 3px;
+ font-weight: bold;
+}
+
+.media-upload-form th.label label {
+ font-weight: bold;
+ margin: 0.5em;
+ font-size: 13px;
+}
+
+.media-upload-form th.label label span {
+ padding: 0 5px;
+}
+
+abbr.required {
+ border: medium none;
+ text-decoration: none;
+}
+
+#wpbody-content .describe input[type="text"],
+#wpbody-content .describe textarea {
+ width: 460px;
+}
+
+#wpbody-content .describe p.help {
+ margin: 0;
+ padding: 0 0 0 5px;
+}
+
+.describe-toggle-on,
+.describe-toggle-off {
+ display: block;
+ line-height: 36px;
+ float: right;
+ margin-right: 20px;
+}
+
+.describe-toggle-off {
+ display: none;
+}
+
+#wpbody-content .media-item {
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+ min-height: 36px;
+ position: relative;
+ width: 100%;
+}
+
+#wpbody-content .media-single .media-item {
+ border-bottom-style: none;
+ border-bottom-width: 0;
+}
+
+#wpbody-content #media-items {
+ border-style: solid solid none;
+ border-width: 1px;
+ width: 670px;
+}
+
+#wpbody-content #media-items .filename {
+ line-height: 36px;
+ overflow: hidden;
+}
+
+.media-item .pinkynail {
+ float: left;
+ margin: 2px;
+ max-width: 40px;
+ max-height: 32px;
+}
+
+.media-item .startopen,
+.media-item .startclosed {
+ display: none;
+}
+
+.media-item .original {
+ position: relative;
+ height: 34px;
+ text-align: center;
+}
+
+.media-item .percent {
+ font-weight: bold;
+}
+
+.crunching {
+ display: block;
+ line-height: 32px;
+ text-align: right;
+ margin-right: 5px;
+}
+
+button.dismiss {
+ position: absolute;
+ top: 7px;
+ right: 5px;
+ z-index: 4;
+ width: 8em;
+}
+
+.file-error {
+ float: left;
+ font-weight: bold;
+ padding: 10px;
+}
+
+.progress {
+ position: relative;
+ margin-bottom: -36px;
+ height: 36px;
+}
+
+.bar {
+ width: 0;
+ height: 100%;
+ border-right-width: 3px;
+ border-right-style: solid;
+}
+
+.upload-php .fixed .column-parent {
+ width: 25%;
+}
+
+/* find posts */
+.find-box {
+ width: 500px;
+ height: 300px;
+ overflow: hidden;
+ padding: 33px 5px 40px;
+ position: absolute;
+ z-index: 1000;
+}
+
+.find-box-head {
+ cursor: move;
+ font-weight: bold;
+ height: 2em;
+ line-height: 2em;
+ padding: 1px 12px;
+ position: absolute;
+ top: 5px;
+ width: 100%;
+}
+
+.find-box-inside {
+ overflow: auto;
+ width: 100%;
+ height: 100%;
+}
+
+.find-box-search {
+ padding: 12px;
+ border-width: 1px;
+ border-style: none none solid;
+}
+
+#find-posts-response {
+ margin: 8px 0;
+ padding: 0 1px;
+}
+
+#find-posts-response table {
+ width: 100%;
+}
+
+#find-posts-response .found-radio {
+ padding: 5px 0 0 8px;
+ width: 15px;
+}
+
+.find-box-buttons {
+ width: 480px;
+ margin: 8px;
+}
+
+.find-box-search label {
+ padding-right: 6px;
+}
+
+.find-box #resize-se {
+ position: absolute;
+ right: 1px;
+ bottom: 1px;
+}
+
+/* favorite-actions */
+#favorite-actions {
+ float: right;
+ margin: 11px 12px 0;
+ min-width: 130px;
+ position: relative;
+}
+
+#favorite-first {
+ -moz-border-radius: 12px;
+ -khtml-border-radius: 12px;
+ -webkit-border-radius: 12px;
+ border-radius: 12px;
+ line-height: 15px;
+ padding: 3px 30px 4px 12px;
+ border-width: 1px;
+ border-style: solid;
+}
+
+#favorite-inside {
+ margin: 0 0 0 0px;
+ padding: 0 1px 6px 1px;
+ border-width: 1px;
+ border-style: solid;
+ position: absolute;
+ z-index: 11;
+ display: none;
+ -moz-border-radius: 0 0 12px 12px;
+ -webkit-border-bottom-right-radius: 12px;
+ -webkit-border-bottom-left-radius: 12px;
+ -khtml-border-bottom-right-radius: 12px;
+ -khtml-border-bottom-left-radius: 12px;
+ border-bottom-right-radius: 12px;
+ border-bottom-left-radius: 12px;
+}
+
+#favorite-actions a {
+ display: block;
+ text-decoration: none;
+ font-size: 11px;
+}
+
+#favorite-inside a {
+ padding: 3px 5px 3px 10px;
+}
+
+#favorite-toggle {
+ height: 22px;
+ position: absolute;
+ right: 0;
+ top: 1px;
+ width: 28px;
+}
+
+#favorite-actions .slide-down {
+ -moz-border-radius: 12px 12px 0 0;
+ -webkit-border-bottom-right-radius: 0;
+ -webkit-border-bottom-left-radius: 0;
+ -khtml-border-bottom-right-radius: 0;
+ -khtml-border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+ border-bottom-left-radius: 0;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+}
+
+#utc-time, #local-time {
+ padding-left: 25px;
+ font-style: italic;
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+}
+
+ul#dismissed-updates {
+ display: none;
+}
+form.upgrade {
+ margin-top: 8px;
+}
+
+form.upgrade .hint {
+ font-style: italic;
+ font-size: 85%;
+ margin: -0.5em 0 2em 0;
+}
+
+#poststuff .inside .the-tagcloud {
+ margin: 5px 0 10px;
+ padding: 8px;
+ border-width: 1px;
+ border-style: solid;
+ line-height: 1.8em;
+ word-spacing: 3px;
+ -moz-border-radius: 6px;
+ -khtml-border-radius: 6px;
+ -webkit-border-radius: 6px;
+ border-radius: 6px;
+}
+
+br.clear {
+ height: 2px;
+ line-height: 2px;
+}
+
+.swfupload {
+ margin: 5px 10px;
+ vertical-align: middle;
+}
+
+/* table.fixed column width */
+table.fixed {
+ table-layout: fixed;
+}
+
+.fixed .column-rating,
+.fixed .column-visible {
+ width: 8%;
+}
+
+.fixed .column-date,
+.fixed .column-parent,
+.fixed .column-links {
+ width: 10%;
+}
+
+.fixed .column-response,
+.fixed .column-author,
+.fixed .column-categories,
+.fixed .column-tags,
+.fixed .column-rel,
+.fixed .column-role {
+ width: 15%;
+}
+
+.fixed .column-comments {
+ width: 4em;
+ padding-top: 8px;
+}
+
+.fixed .column-slug {
+ width: 25%;
+}
+
+.fixed .column-posts {
+ width: 10%;
+}
+
+.fixed .column-icon {
+ width: 80px;
+}
+
+#commentsdiv .fixed .column-author,
+#comments-form .fixed .column-author {
+ width: 20%;
+}
+
+.widefat th,
+.widefat td {
+ overflow: hidden;
+}
+
+.widefat td p {
+ margin: 2px 0 0.8em;
+}
+
+table .vers,
+table .column-visible,
+table .column-rating {
+ text-align: center;
+}
+
+.icon32 {
+ float: left;
+ height: 36px;
+ margin: 14px 6px 0 0;
+ width: 36px;
+}
+
+.key-labels label {
+ line-height: 24px;
+}
+
+.subtitle {
+ font-size: 0.75em;
+ line-height: 1;
+ padding-left: 25px;
+}
+
+ol {
+ list-style-type: decimal;
+ margin-left: 2em;
+}
+
+.postbox-container {
+ float: left;
+ padding-right: 0.5%;
+}
+
+.postbox-container .meta-box-sortables {
+ min-height: 300px;
+}
+
+.temp-border {
+ border: 1px dotted #ccc;
+}
+
+.columns-prefs label {
+ padding: 0 5px;
+}
+
+.theme-install-php h4,
+.plugin-install-php h4 {
+ margin: 2.5em 0 8px;
+}
+
+p.install-help {
+ margin: 8px 0;
+ font-style: italic;
+}
+
+p.popular-tags {
+ -moz-border-radius: 8px;
+ -khtml-border-radius: 8px;
+ -webkit-border-radius: 8px;
+ border-radius: 8px;
+ border-width: 1px;
+ border-style: solid;
+ line-height: 2em;
+ padding: 8px 12px 12px;
+ text-align: justify;
+}
+
+p.popular-tags a {
+ padding: 0 3px;
+}
+
+.stuffbox .editcomment {
+ clear: none;
+}
+
+.ajax-feedback {
+ visibility: hidden;
+ vertical-align: bottom;
+}
+
+.tagsdiv .newtag {
+ width: 180px;
+}
+
+.tagsdiv .the-tags {
+ display: block;
+ height: 60px;
+ margin: 0 auto;
+ overflow: auto;
+ width: 260px;
+}
+
+#post-body-content .tagsdiv .the-tags {
+ margin: 0 5px;
+}
+
+label,
+#your-profile label + a {
+ vertical-align: middle;
+}
+
+#misc-publishing-actions label {
+ vertical-align: baseline;
+}
+
+.plugin-update-tr .update-message {
+ margin: 5px;
+ padding: 3px 5px;
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 5px;
+ -khtml-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+}
+
+.add-new-h2 {
+ font-style: normal;
+ margin: 0 6px;
+ position: relative;
+ top: -3px;
+}
+
+.describe .image-editor {
+ vertical-align: top;
+}
+
+.imgedit-wrap {
+ position: relative;
+}
+
+.imgedit-settings p {
+ margin: 8px 0;
+}
+
+.describe .imgedit-wrap table td {
+ vertical-align: top;
+ padding-top: 0;
+}
+
+.imgedit-wrap p,
+.describe .imgedit-wrap table td {
+ font-size: 11px;
+ line-height: 18px;
+}
+
+.describe .imgedit-wrap table td.imgedit-settings {
+ padding: 0 5px;
+}
+
+td.imgedit-settings input {
+ vertical-align: middle;
+}
+
+.imgedit-wait {
+ position: absolute;
+ top: 0;
+ background: #FFFFFF url(images/wpspin_light.gif) no-repeat scroll 22px 10px;
+ opacity: 0.7;
+ filter: alpha(opacity=70);
+ width: 100%;
+ height: 500px;
+ display: none;
+}
+
+.media-disabled,
+.imgedit-settings .disabled {
+ color: grey;
+}
+
+.imgedit-wait-spin {
+ padding: 0 4px 4px;
+ vertical-align: bottom;
+ visibility: hidden;
+}
+
+.imgedit-menu {
+ margin: 0 0 12px;
+ min-width: 300px;
+}
+
+.imgedit-menu div {
+ float: left;
+ width: 32px;
+ height: 32px;
+ -moz-border-radius: 4px;
+ -khtml-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ border-radius: 4px;
+ border-width: 1px;
+ border-style: solid;
+}
+
+.imgedit-crop-wrap {
+ position: relative;
+}
+
+.imgedit-crop {
+ background: transparent url(images/imgedit-icons.png) no-repeat scroll -9px -31px;
+ margin: 0 8px 0 0;
+}
+
+.imgedit-crop.disabled:hover {
+ background-position: -9px -31px;
+}
+
+.imgedit-crop:hover {
+ background-position: -9px -1px;
+}
+
+.imgedit-rleft {
+ background: transparent url(images/imgedit-icons.png) no-repeat scroll -46px -31px;
+ margin: 0 3px;
+}
+
+.imgedit-rleft.disabled:hover {
+ background-position: -46px -31px;
+}
+
+.imgedit-rleft:hover {
+ background-position: -46px -1px;
+}
+
+.imgedit-rright {
+ background: transparent url(images/imgedit-icons.png) no-repeat scroll -77px -31px;
+ margin: 0 8px 0 3px;
+}
+
+.imgedit-rright.disabled:hover {
+ background-position: -77px -31px;
+}
+
+.imgedit-rright:hover {
+ background-position: -77px -1px;
+}
+
+.imgedit-flipv {
+ background: transparent url(images/imgedit-icons.png) no-repeat scroll -115px -31px;
+ margin: 0 3px;
+}
+
+.imgedit-flipv.disabled:hover {
+ background-position: -115px -31px;
+}
+
+.imgedit-flipv:hover {
+ background-position: -115px -1px;
+}
+
+.imgedit-fliph {
+ background: transparent url(images/imgedit-icons.png) no-repeat scroll -147px -31px;
+ margin: 0 8px 0 3px;
+}
+
+.imgedit-fliph.disabled:hover {
+ background-position: -147px -31px;
+}
+
+.imgedit-fliph:hover {
+ background-position: -147px -1px;
+}
+
+.imgedit-undo {
+ background: transparent url(images/imgedit-icons.png) no-repeat scroll -184px -31px;
+ margin: 0 3px;
+}
+
+.imgedit-undo.disabled:hover {
+ background-position: -184px -31px;
+}
+
+.imgedit-undo:hover {
+ background-position: -184px -1px;
+}
+
+.imgedit-redo {
+ background: transparent url(images/imgedit-icons.png) no-repeat scroll -215px -31px;
+ margin: 0 8px 0 3px;
+}
+
+.imgedit-redo.disabled:hover {
+ background-position: -215px -31px;
+}
+
+.imgedit-redo:hover {
+ background-position: -215px -1px;
+}
+
+.imgedit-applyto img {
+ margin: 0 8px 0 0;
+}
+
+.imgedit-group-top {
+ margin: 5px 0;
+}
+
+.imgedit-applyto .imgedit-label {
+ padding: 2px 0 0;
+ display: block;
+}
+
+.imgedit-help {
+ display: none;
+ font-style: italic;
+ margin-bottom: 8px;
+}
+
+.imgedit-help ul li {
+ font-size: 11px;
+}
+
+a.imgedit-help-toggle {
+ text-decoration: none;
+}
+
+#wpbody-content .imgedit-response div {
+ width: 600px;
+ margin: 8px;
+}
+
+.form-table td.imgedit-response {
+ padding: 0;
+}
+
+.imgedit-submit {
+ margin: 8px 0;
+}
+
+.imgedit-submit-btn {
+ margin-left: 20px;
+}
+
+.imgedit-wrap .nowrap {
+ white-space: nowrap;
+}
+
+span.imgedit-scale-warn {
+ color: red;
+ font-size: 20px;
+ font-style: normal;
+ visibility: hidden;
+ vertical-align: middle;
+}
+
+.imgedit-group {
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 8px;
+ -khtml-border-radius: 8px;
+ -webkit-border-radius: 8px;
+ border-radius: 8px;
+ margin-bottom: 8px;
+ padding: 2px 10px;
+}
+
+#dashboard_recent_comments div.undo {
+ border-top-style: solid;
+ border-top-width: 1px;
+ margin: 0 -10px;
+ padding: 3px 8px;
+ font-size: 11px;
+}
+
+.trash-undo-inside,
+.spam-undo-inside {
+ margin: 1px 8px 1px 0;
+ line-height: 16px;
+}
+
+.spam-undo-inside .avatar,
+.trash-undo-inside .avatar {
+ height: 20px;
+ width: 20px;
+ margin-right: 8px;
+ vertical-align: middle;
+}
+
+/* tag hints */
+.taghint {
+ color: #aaa;
+ margin: 14px 0 -17px 8px;
+}
+
+#poststuff .tagsdiv .howto {
+ margin: 0 0 6px 8px;
+}
+
+.ajaxtag .newtag {
+ background: transparent;
+ position: relative;
+}
+
+#broken-themes {
+ text-align: left;
+ width: 50%;
+ border-spacing: 3px;
+ padding: 3px;
+}
+
+.describe .del-link {
+ padding-left: 5px;
+}
+
+.comment-ays {
+ margin-bottom: 0;
+ border-style: solid;
+ border-width: 1px;
+}
+
+.comment-ays th {
+ border-right-style: solid;
+ border-right-width: 1px;
+}
/** Set up WordPress environment */
require_once('./wp-load.php');
-/** Post Template API */
-require_once(ABSPATH . WPINC . '/post-template.php');
-
/** Atom Publishing Protocol Class */
require_once(ABSPATH . WPINC . '/atomlib.php');
-/** Feed Handling API */
-require_once(ABSPATH . WPINC . '/feed.php');
-
/** Admin Image API for metadata updating */
require_once(ABSPATH . '/wp-admin/includes/image.php');
}
}
-if ( !function_exists('wp_set_current_user') ) :
-/**
- * @ignore
- */
-function wp_set_current_user($id, $name = '') {
- global $current_user;
-
- if ( isset($current_user) && ($id == $current_user->ID) )
- return $current_user;
-
- $current_user = new WP_User($id, $name);
-
- return $current_user;
-}
-endif;
-
/**
* Filter to add more post statuses.
*
$entries_url = esc_attr($this->get_entries_url());
$categories_url = esc_attr($this->get_categories_url());
$media_url = esc_attr($this->get_attachments_url());
+ $accepted_media_types = '';
foreach ($this->media_content_types as $med) {
$accepted_media_types = $accepted_media_types . "<accept>" . $med . "</accept>";
}
}
$location = get_post_meta($entry['ID'], '_wp_attached_file', true);
- $location = get_option ('upload_path') . '/' . $location;
+ $location = get_option ('upload_path') . '/' . $location;
$filetype = wp_check_filetype($location);
if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']))
header('Content-Type: ' . $entry['post_mime_type']);
header('Connection: close');
- if ($fp = fopen($location, "rb")) {
- status_header('200');
- header('Content-Type: ' . $entry['post_mime_type']);
+ if ($fp = fopen($location, "rb")) {
+ status_header('200');
+ header('Content-Type: ' . $entry['post_mime_type']);
header('Connection: close');
while(!feof($fp)) {
* @return string
*/
function get_entries_url($page = null) {
- if($GLOBALS['post_type'] == 'attachment') {
+ if ( isset($GLOBALS['post_type']) && ( $GLOBALS['post_type'] == 'attachment' ) ) {
$path = $this->MEDIA_PATH;
} else {
$path = $this->ENTRIES_PATH;
log_app('Status','204: No Content');
header('Content-Type: text/plain');
status_header('204');
- echo "Deleted.";
+ echo "Moved to Trash.";
exit;
}
// If Basic Auth is working...
if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
log_app("Basic Auth",$_SERVER['PHP_AUTH_USER']);
- }
- $user = wp_authenticate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
- if ( $user && !is_wp_error($user) ) {
- wp_set_current_user($user->ID);
- log_app("authenticate()", $user->user_login);
- return true;
+ $user = wp_authenticate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
+ if ( $user && !is_wp_error($user) ) {
+ wp_set_current_user($user->ID);
+ log_app("authenticate()", $user->user_login);
+ return true;
+ }
}
return false;
nocache_headers();
-$comment_post_ID = (int) $_POST['comment_post_ID'];
+$comment_post_ID = isset($_POST['comment_post_ID']) ? (int) $_POST['comment_post_ID'] : 0;
$status = $wpdb->get_row( $wpdb->prepare("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = %d", $comment_post_ID) );
} elseif ( in_array($status->post_status, array('draft', 'pending') ) ) {
do_action('comment_on_draft', $comment_post_ID);
exit;
+} elseif ( 'trash' == $status->post_status ) {
+ do_action('comment_on_trash', $comment_post_ID);
+ exit;
} else {
do_action('pre_comment_on_post', $comment_post_ID);
}
\r
/* That's all, stop editing! Happy blogging. */\r
\r
-/** WordPress absolute path to the Wordpress directory. */\r
+/** Absolute path to the WordPress directory. */\r
if ( !defined('ABSPATH') )\r
define('ABSPATH', dirname(__FILE__) . '/');\r
\r
\r
/* That's all, stop editing! Happy blogging. */\r
\r
-/** WordPress absolute path to the Wordpress directory. */\r
+/** Absolute path to the WordPress directory. */\r
if ( !defined('ABSPATH') )\r
define('ABSPATH', dirname(__FILE__) . '/');\r
\r
Plugin Name: Akismet
Plugin URI: http://akismet.com/
Description: Akismet checks your comments against the Akismet web service to see if they look like spam or not. You need a <a href="http://wordpress.com/api-keys/">WordPress.com API key</a> to use it. You can review the spam it catches under "Comments." To show off your Akismet stats just put <code><?php akismet_counter(); ?></code> in your template. See also: <a href="http://wordpress.org/extend/plugins/stats/">WP Stats plugin</a>.
-Version: 2.2.6
+Version: 2.2.7
Author: Matt Mullenweg
Author URI: http://ma.tt/
*/
-define('AKISMET_VERSION', '2.2.6');
+define('AKISMET_VERSION', '2.2.7');
// If you hardcode a WP.com API key here, all key config screens will be hidden
if ( defined('WPCOM_API_KEY') )
// Returns true if server connectivity was OK at the last check, false if there was a problem that needs to be fixed.
function akismet_server_connectivity_ok() {
+ // skip the check on WPMU because the status page is hidden
+ global $wpcom_api_key;
+ if ( $wpcom_api_key )
+ return true;
$servers = akismet_get_server_connectivity();
return !( empty($servers) || !count($servers) || count( array_filter($servers) ) < count($servers) );
}
// filter handler used to return a spam result to pre_comment_approved
function akismet_result_spam( $approved ) {
// bump the counter here instead of when the filter is added to reduce the possibility of overcounting
- update_option( 'akismet_spam_count', get_option('akismet_spam_count') + 1 );
+ if ( $incr = apply_filters('akismet_spam_count_incr', 1) )
+ update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr );
return 'spam';
}
if ( $post->post_type == 'post' && $diff > 30 && get_option( 'akismet_discard_month' ) == 'true' ) {
// akismet_result_spam() won't be called so bump the counter here
- update_option( 'akismet_spam_count', get_option('akismet_spam_count') + 1 );
+ if ( $incr = apply_filters('akismet_spam_count_incr', 1) )
+ update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr );
die;
}
}
=== Akismet ===
-Contributors: matt, ryan, andy, mdawaffe, tellyworth
+Contributors: matt, ryan, andy, mdawaffe, tellyworth, automattic
Tags: akismet, comments, spam
Requires at least: 2.0
-Tested up to: 2.8.4
+Tested up to: 2.9
Akismet checks your comments against the Akismet web service to see if they look like spam or not.
= 2.2.7 =
* Add a new AKISMET_VERSION constant
+* Reduce the possibility of over-counting spam when another spam filter plugin is in use
+* Disable the connectivity check when the API key is hard-coded for WPMU
= 2.2.6 =
<!--<p><small><strong>XHTML:</strong> <?php printf(__('You can use these tags: %s'), allowed_tags()); ?></small></p>-->
-<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
+<p><textarea name="comment" id="comment" cols="58" rows="10" tabindex="4"></textarea></p>
<p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php esc_attr_e('Submit Comment'); ?>" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
<!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
-<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
+<p><textarea name="comment" id="comment" cols="58" rows="10" tabindex="4"></textarea></p>
<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
<?php comment_id_fields(); ?>
* @subpackage Default_Theme
*/
+$content_width = 450;
+
automatic_feed_links();
if ( function_exists('register_sidebar') ) {
width: 100%;
display: <?php echo kubrick_header_display_string(); ?>;
}
+
+ .description {
+ margin-top: 16px;
+ color: #fff;
+ }
+
#jsForm {
display: none;
text-align: center;
</div>
<?php endwhile; endif; ?>
<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
+
+ <?php comments_template(); ?>
+
</div>
<?php get_sidebar(); ?>
/*
Theme name: WordPress Default - kubrick -
Editors: Navid Kashani
-Persian Wordpress Project : wp-persian.com
+Persian WordPress Project : wp-persian.com
*/
body, .commentlist li, #commentform input, #commentform textarea, #commentform p, #sidebar, #wp-calendar caption {
font-family:tahoma, arial;
<?php /* If this is a category archive */ } elseif (is_category()) { ?>
<p>You are currently browsing the archives for the <?php single_cat_title(''); ?> category.</p>
- <?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
- <p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
+ <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
+ <p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a> blog archives
for the day <?php the_time('l, F jS, Y'); ?>.</p>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
- <p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
+ <p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a> blog archives
for <?php the_time('F, Y'); ?>.</p>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
- <p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
+ <p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a> blog archives
for the year <?php the_time('Y'); ?>.</p>
- <?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
- <p>You have searched the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
+ <?php /* If this is a search result */ } elseif (is_search()) { ?>
+ <p>You have searched the <a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a> blog archives
for <strong>'<?php the_search_query(); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p>
- <?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
- <p>You are currently browsing the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives.</p>
+ <?php /* If this set is paginated */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
+ <p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a> blog archives.</p>
<?php } ?>
if ( isset($keys[0]) && $keys[0] > $local_time )
die();
-foreach ($crons as $timestamp => $cronhooks) {
+foreach ($crons as $timestamp => $cronhooks) {
if ( $timestamp > $local_time )
break;
*/
function get_the_author($deprecated = '') {
global $authordata;
- return apply_filters('the_author', $authordata->display_name);
+ return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
}
/**
else
$value = isset($authordata->$field) ? $authordata->$field : '';
- return apply_filters('get_the_author_' . $field, $value);
+ return apply_filters('get_the_author_' . $field, $value, $user_id);
}
/**
* @echo string The author's field from the current author's DB object.
*/
function the_author_meta($field = '', $user_id = false) {
- echo apply_filters('the_author_' . $field, get_the_author_meta($field, $user_id));
+ echo apply_filters('the_author_' . $field, get_the_author_meta($field, $user_id), $user_id);
}
/**
*/
function the_author_posts_link($deprecated = '') {
global $authordata;
- printf(
+ $link = sprintf(
'<a href="%1$s" title="%2$s">%3$s</a>',
get_author_posts_url( $authordata->ID, $authordata->user_nicename ),
esc_attr( sprintf( __( 'Posts by %s' ), get_the_author() ) ),
get_the_author()
);
+ echo apply_filters( 'the_author_posts_link', $link );
}
/**
$join = " INNER JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id";
}
- if (get_option('links_recently_updated_time')) {
+ if ( $show_updated && get_option('links_recently_updated_time') ) {
$recently_updated_test = ", IF (DATE_ADD(link_updated, INTERVAL " . get_option('links_recently_updated_time') . " MINUTE) >= NOW(), 1,0) as recently_updated ";
} else {
$recently_updated_test = '';
$redirect_url = redirect_guess_404_permalink();
} elseif ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) {
// rewriting of old ?p=X, ?m=2004, ?m=200401, ?m=20040101
- if ( is_single() && !empty($_GET['p']) && ! $redirect_url ) {
+ if ( is_attachment() && !empty($_GET['attachment_id']) && ! $redirect_url ) {
+ if ( $redirect_url = get_attachment_link(get_query_var('attachment_id')) )
+ $redirect['query'] = remove_query_arg('attachment_id', $redirect['query']);
+ } elseif ( is_single() && !empty($_GET['p']) && ! $redirect_url ) {
if ( $redirect_url = get_permalink(get_query_var('p')) )
$redirect['query'] = remove_query_arg('p', $redirect['query']);
if ( get_query_var( 'page' ) ) {
$redirect_url = trailingslashit( $redirect_url ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' );
$redirect['query'] = remove_query_arg( 'page', $redirect['query'] );
}
+ } elseif ( is_single() && !empty($_GET['name']) && ! $redirect_url ) {
+ if ( $redirect_url = get_permalink( $wp_query->get_queried_object_id() ) )
+ $redirect['query'] = remove_query_arg('name', $redirect['query']);
} elseif ( is_page() && !empty($_GET['page_id']) && ! $redirect_url ) {
if ( $redirect_url = get_permalink(get_query_var('page_id')) )
$redirect['query'] = remove_query_arg('page_id', $redirect['query']);
} elseif ( is_category() && !empty($_GET['cat']) && preg_match( '|^[0-9]+$|', $_GET['cat'] ) ) {
if ( $redirect_url = get_category_link(get_query_var('cat')) )
$redirect['query'] = remove_query_arg('cat', $redirect['query']);
- } elseif ( is_author() && !empty($_GET['author']) ) {
+ } elseif ( is_author() && !empty($_GET['author']) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) {
$author = get_userdata(get_query_var('author'));
if ( false !== $author && $redirect_url = get_author_posts_url($author->ID, $author->user_nicename) )
$redirect['query'] = remove_query_arg('author', $redirect['author']);
*
* Updates the list of roles, if the role doesn't already exist.
*
+ * The capabilities are defined in the following format `array( 'read' => true );`
+ * To explicitly deny a role a capability you set the value for that capability to false.
+ *
* @since 2.0.0
* @access public
*
* @param string $role Role name.
* @param string $display_name Role display name.
- * @param array $capabilities List of role capabilities.
+ * @param array $capabilities List of role capabilities in the above format.
* @return null|WP_Role WP_Role object if role is added, null if already exists.
*/
function add_role( $role, $display_name, $capabilities = array() ) {
*
* @param string $role Role name.
* @param string $cap Capability name.
- * @param bool $grant Optional, default is true. Whether role is capable of preforming capability.
+ * @param bool $grant Optional, default is true. Whether role is capable of performing capability.
*/
function add_cap( $role, $cap, $grant = true ) {
$this->roles[$role]['capabilities'][$cap] = $grant;
*/
var $last_name = '';
+ /**
+ * The filter context applied to user data fields.
+ *
+ * @since 2.9.0
+ * @access private
+ * @var string
+ */
+ var $filter = null;
+
/**
* PHP4 Constructor - Sets up the object properties.
*
update_usermeta( $this->ID, $this->cap_key, $this->caps );
$this->get_role_caps();
$this->update_user_level_from_caps();
+ do_action( 'set_user_role', $this->ID, $role );
}
/**
$args = array_merge( array( 'delete_page', $user_id ), $args );
return call_user_func_array( 'map_meta_cap', $args );
}
- $post_author_data = get_userdata( $post->post_author );
- //echo "current user id : $user_id, post author id: " . $post_author_data->ID . "<br />";
+
+ if ('' != $post->post_author) {
+ $post_author_data = get_userdata( $post->post_author );
+ } else {
+ //No author set yet so default to current user for cap checks
+ $post_author_data = $author_data;
+ }
+
// If the user is the author...
if ( $user_id == $post_author_data->ID ) {
// If the post is published...
- if ( 'publish' == $post->post_status )
+ if ( 'publish' == $post->post_status ) {
$caps[] = 'delete_published_posts';
- else
+ } elseif ( 'trash' == $post->post_status ) {
+ if ('publish' == get_post_meta($post->ID, '_wp_trash_meta_status', true) )
+ $caps[] = 'delete_published_posts';
+ } else {
// If the post is draft...
$caps[] = 'delete_posts';
+ }
} else {
// The user is trying to edit someone else's post.
$caps[] = 'delete_others_posts';
$page_author_data = get_userdata( $page->post_author );
//echo "current user id : $user_id, page author id: " . $page_author_data->ID . "<br />";
// If the user is the author...
+
+ if ('' != $page->post_author) {
+ $page_author_data = get_userdata( $page->post_author );
+ } else {
+ //No author set yet so default to current user for cap checks
+ $page_author_data = $author_data;
+ }
+
if ( $user_id == $page_author_data->ID ) {
// If the page is published...
- if ( $page->post_status == 'publish' )
+ if ( $page->post_status == 'publish' ) {
$caps[] = 'delete_published_pages';
- else
+ } elseif ( 'trash' == $page->post_status ) {
+ if ('publish' == get_post_meta($page->ID, '_wp_trash_meta_status', true) )
+ $caps[] = 'delete_published_pages';
+ } else {
// If the page is draft...
$caps[] = 'delete_pages';
+ }
} else {
// The user is trying to edit someone else's page.
$caps[] = 'delete_others_pages';
// If the user is the author...
if ( $user_id == $post_author_data->ID ) {
// If the post is published...
- if ( 'publish' == $post->post_status )
+ if ( 'publish' == $post->post_status ) {
$caps[] = 'edit_published_posts';
- else
+ } elseif ( 'trash' == $post->post_status ) {
+ if ('publish' == get_post_meta($post->ID, '_wp_trash_meta_status', true) )
+ $caps[] = 'edit_published_posts';
+ } else {
// If the post is draft...
$caps[] = 'edit_posts';
+ }
} else {
// The user is trying to edit someone else's post.
$caps[] = 'edit_others_posts';
// If the user is the author...
if ( $user_id == $page_author_data->ID ) {
// If the page is published...
- if ( 'publish' == $page->post_status )
+ if ( 'publish' == $page->post_status ) {
$caps[] = 'edit_published_pages';
- else
+ } elseif ( 'trash' == $page->post_status ) {
+ if ('publish' == get_post_meta($page->ID, '_wp_trash_meta_status', true) )
+ $caps[] = 'edit_published_pages';
+ } else {
// If the page is draft...
$caps[] = 'edit_pages';
+ }
} else {
// The user is trying to edit someone else's page.
$caps[] = 'edit_others_pages';
return call_user_func_array( array( &$current_user, 'has_cap' ), $args );
}
+/**
+ * Whether author of supplied post has capability or role.
+ *
+ * @since 2.9.0
+ *
+ * @param int|object $post Post ID or post object.
+ * @param string $capability Capability or role name.
+ * @return bool
+ */
+function author_can( $post, $capability ) {
+ if ( !$post = get_post($post) )
+ return false;
+
+ $author = new WP_User( $post->post_author );
+
+ if ( empty( $author ) )
+ return false;
+
+ $args = array_slice( func_get_args(), 2 );
+ $args = array_merge( array( $capability ), $args );
+
+ return call_user_func_array( array( &$author, 'has_cap' ), $args );
+}
+
/**
* Retrieve role object.
*
$defaults['selected'] = ( is_category() ) ? get_query_var( 'cat' ) : 0;
$r = wp_parse_args( $args, $defaults );
+
+ if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) {
+ $r['pad_counts'] = true;
+ }
+
$r['include_last_update_time'] = $r['show_last_update'];
extract( $r );
function wp_tag_cloud( $args = '' ) {
$defaults = array(
'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45,
- 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC',
+ 'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' => 'ASC',
'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag', 'echo' => true
);
$args = wp_parse_args( $args, $defaults );
return sprintf( _n('%s topic', '%s topics', $count), number_format_i18n( $count ) );
}
+/**
+ * Default topic count scaling for tag links
+ *
+ * @param integer $count number of posts with that tag
+ * @return integer scaled count
+ */
+function default_topic_count_scale( $count ) {
+ return round(log10($count + 1) * 100);
+}
+
+
/**
* Generates a tag cloud (heatmap) from provided data.
*
* 'format' argument will format the tags in a UL HTML list. The array value for
* the 'format' argument will return in PHP array type format.
*
- * The 'tag_cloud_sort' filter allows you to override the sorting done
- * by the 'orderby' argument; passed to the filter: $tags array and $args array.
+ * The 'tag_cloud_sort' filter allows you to override the sorting.
+ * Passed to the filter: $tags array and $args array, has to return the $tags array
+ * after sorting it.
*
* The 'orderby' argument will accept 'name' or 'count' and defaults to 'name'.
* The 'order' is the direction to sort, defaults to 'ASC' and can be 'DESC' or
global $wp_rewrite;
$defaults = array(
'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 0,
- 'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC',
+ 'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' => 'ASC',
'topic_count_text_callback' => 'default_topic_count_text',
- 'filter' => 1,
+ 'topic_count_scale_callback' => 'default_topic_count_scale', 'filter' => 1,
);
if ( !isset( $args['topic_count_text_callback'] ) && isset( $args['single_text'] ) && isset( $args['multiple_text'] ) ) {
$body = 'return sprintf (
- _n('.var_export($args['single_text'], true).', '.var_export($args['multiple_text'], true).', $count),
+ _n(' . var_export($args['single_text'], true) . ', ' . var_export($args['multiple_text'], true) . ', $count),
number_format_i18n( $count ));';
$args['topic_count_text_callback'] = create_function('$count', $body);
}
$args = wp_parse_args( $args, $defaults );
-
extract( $args );
if ( empty( $tags ) )
return;
- // SQL cannot save you; this is a second (potentially different) sort on a subset of data.
- if ( 'name' == $orderby )
- uasort( $tags, create_function('$a, $b', 'return strnatcasecmp($a->name, $b->name);') );
- else
- uasort( $tags, create_function('$a, $b', 'return ($a->count > $b->count);') );
-
- $tags = apply_filters( 'tag_cloud_sort', $tags, $args );
-
- if ( 'DESC' == $order )
- $tags = array_reverse( $tags, true );
- elseif ( 'RAND' == $order ) {
- $keys = (array) array_rand( $tags, count( $tags ) );
- $temp = array();
- foreach ( $keys as $key )
- $temp[$key] = $tags[$key];
+ $tags_sorted = apply_filters( 'tag_cloud_sort', $tags, $args );
+ if ( $tags_sorted != $tags ) { // the tags have been sorted by a plugin
+ $tags = $tags_sorted;
+ unset($tags_sorted);
+ } else {
+ if ( 'RAND' == $order ) {
+ shuffle($tags);
+ } else {
+ // SQL cannot save you; this is a second (potentially different) sort on a subset of data.
+ if ( 'name' == $orderby )
+ uasort( $tags, create_function('$a, $b', 'return strnatcasecmp($a->name, $b->name);') );
+ else
+ uasort( $tags, create_function('$a, $b', 'return ($a->count > $b->count);') );
- $tags = $temp;
- $temp = null;
- unset( $temp );
+ if ( 'DESC' == $order )
+ $tags = array_reverse( $tags, true );
+ }
}
if ( $number > 0 )
$tags = array_slice($tags, 0, $number);
$counts = array();
- foreach ( (array) $tags as $key => $tag )
- $counts[ $key ] = $tag->count;
+ $real_counts = array(); // For the alt tag
+ foreach ( (array) $tags as $key => $tag ) {
+ $real_counts[ $key ] = $tag->count;
+ $counts[ $key ] = $topic_count_scale_callback($tag->count);
+ }
$min_count = min( $counts );
$spread = max( $counts ) - $min_count;
$a = array();
- $rel = ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) ? ' rel="tag"' : '';
-
foreach ( $tags as $key => $tag ) {
$count = $counts[ $key ];
+ $real_count = $real_counts[ $key ];
$tag_link = '#' != $tag->link ? esc_url( $tag->link ) : '#';
$tag_id = isset($tags[ $key ]->id) ? $tags[ $key ]->id : $key;
$tag_name = $tags[ $key ]->name;
- $a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . esc_attr( $topic_count_text_callback( $count ) ) . "'$rel style='font-size: " .
+ $a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . esc_attr( $topic_count_text_callback( $real_count ) ) . "' style='font-size: " .
( $smallest + ( ( $count - $min_count ) * $font_step ) )
. "$unit;'>$tag_name</a>";
}
$return .= "</li>\n</ul>\n";
break;
default :
- $return = join( "\n", $a );
+ $return = join( $separator, $a );
break;
endswitch;
$id = (int) $id;
- if ( ! $id && ! in_the_loop() )
- return false; // in-the-loop function
-
- if ( !$id )
- $id = (int) $post->ID;
+ if ( !$id ) {
+ if ( !$post->ID )
+ return false;
+ else
+ $id = (int) $post->ID;
+ }
$terms = get_object_term_cache( $id, $taxonomy );
if ( false === $terms )
}
/**
- * Retrieve terms as a list with specified format.
+ * Retrieve a post's terms as a list with specified format.
*
* @since 2.5.0
*
- * @param int $id Term ID.
+ * @param int $id Post ID.
* @param string $taxonomy Taxonomy name.
* @param string $before Optional. Before list.
* @param string $sep Optional. Separate items using this.
* @param string $after Optional. After list.
* @return null|bool False on WordPress error. Returns null when displaying.
*/
-function the_terms( $id, $taxonomy, $before = '', $sep = '', $after = '' ) {
- $return = get_the_term_list( $id, $taxonomy, $before, $sep, $after );
- if ( is_wp_error( $return ) )
+function the_terms( $id, $taxonomy, $before = '', $sep = ', ', $after = '' ) {
+ $term_list = get_the_term_list( $id, $taxonomy, $before, $sep, $after );
+
+ if ( is_wp_error( $term_list ) )
return false;
- else
- echo $return;
+
+ echo apply_filters('the_terms', $term_list, $taxonomy, $before, $sep, $after);
}
/**
var $_currentTagContents;
// The XML parser
var $_parser;
- function IXR_Message ($message) {
- $this->message = $message;
+ function IXR_Message (&$message) {
+ $this->message = &$message;
}
function parse() {
- // first remove the XML declaration
- $this->message = preg_replace('/<\?xml.*?\?'.'>/', '', $this->message);
+ // first remove the XML declaration
+ // this method avoids the RAM usage of preg_replace on very large messages
+ $header = preg_replace( '/<\?xml.*?\?'.'>/', '', substr( $this->message, 0, 100 ), 1 );
+ $this->message = substr_replace($this->message, $header, 0, 100);
if (trim($this->message) == '') {
return false;
- }
+ }
$this->_parser = xml_parser_create();
// Set XML parser to take the case of tags in to account
xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false);
// Set XML parser callback functions
xml_set_object($this->_parser, $this);
xml_set_element_handler($this->_parser, 'tag_open', 'tag_close');
- xml_set_character_data_handler($this->_parser, 'cdata');
- if (!xml_parse($this->_parser, $this->message)) {
- /* die(sprintf('XML error: %s at line %d',
- xml_error_string(xml_get_error_code($this->_parser)),
- xml_get_current_line_number($this->_parser))); */
- return false;
- }
- xml_parser_free($this->_parser);
+ xml_set_character_data_handler($this->_parser, 'cdata');
+ $chunk_size = 262144; // 256Kb, parse in chunks to avoid the RAM usage on very large messages
+ do {
+ if ( strlen($this->message) <= $chunk_size )
+ $final=true;
+ $part = substr( $this->message, 0, $chunk_size );
+ $this->message = substr( $this->message, $chunk_size );
+ if ( !xml_parse( $this->_parser, $part, $final ) )
+ return false;
+ if ( $final )
+ break;
+ } while ( true );
+ xml_parser_free($this->_parser);
// Grab the error messages, if any
if ($this->messageType == 'fault') {
$this->faultCode = $this->params[0]['faultCode'];
$this->faultString = $this->params[0]['faultString'];
- }
+ }
return true;
}
function tag_open($parser, $tag, $attr) {
header( 'Content-Type: text/plain' );
die('XML-RPC server accepts POST requests only.');
}
- $data = $HTTP_RAW_POST_DATA;
+ $data = &$HTTP_RAW_POST_DATA;
}
$this->message = new IXR_Message($data);
if (!$this->message->parse()) {
function WP_Feed_Cache_Transient($location, $filename, $extension) {
$this->name = 'feed_' . $filename;
$this->mod_name = 'feed_mod_' . $filename;
- $this->lifetime = apply_filters('wp_feed_cache_transient_lifetime', $this->lifetime);
+ $this->lifetime = apply_filters('wp_feed_cache_transient_lifetime', $this->lifetime, $filename);
}
function save($data) {
--- /dev/null
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+/**
+ * Converts to and from JSON format.
+ *
+ * JSON (JavaScript Object Notation) is a lightweight data-interchange
+ * format. It is easy for humans to read and write. It is easy for machines
+ * to parse and generate. It is based on a subset of the JavaScript
+ * Programming Language, Standard ECMA-262 3rd Edition - December 1999.
+ * This feature can also be found in Python. JSON is a text format that is
+ * completely language independent but uses conventions that are familiar
+ * to programmers of the C-family of languages, including C, C++, C#, Java,
+ * JavaScript, Perl, TCL, and many others. These properties make JSON an
+ * ideal data-interchange language.
+ *
+ * This package provides a simple encoder and decoder for JSON notation. It
+ * is intended for use with client-side Javascript applications that make
+ * use of HTTPRequest to perform server communication functions - data can
+ * be encoded into JSON notation for use in a client-side javascript, or
+ * decoded from incoming Javascript requests. JSON format is native to
+ * Javascript, and can be directly eval()'ed with no further parsing
+ * overhead
+ *
+ * All strings should be in ASCII or UTF-8 format!
+ *
+ * LICENSE: Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met: Redistributions of source code must retain the
+ * above copyright notice, this list of conditions and the following
+ * disclaimer. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * @category
+ * @package Services_JSON
+ * @author Michal Migurski <mike-json@teczno.com>
+ * @author Matt Knapp <mdknapp[at]gmail[dot]com>
+ * @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
+ * @copyright 2005 Michal Migurski
+ * @version CVS: $Id: JSON.php,v 1.3 2009/05/22 23:51:00 alan_k Exp $
+ * @license http://www.opensource.org/licenses/bsd-license.php
+ * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198
+ */
+
+/**
+ * Marker constant for Services_JSON::decode(), used to flag stack state
+ */
+define('SERVICES_JSON_SLICE', 1);
+
+/**
+ * Marker constant for Services_JSON::decode(), used to flag stack state
+ */
+define('SERVICES_JSON_IN_STR', 2);
+
+/**
+ * Marker constant for Services_JSON::decode(), used to flag stack state
+ */
+define('SERVICES_JSON_IN_ARR', 3);
+
+/**
+ * Marker constant for Services_JSON::decode(), used to flag stack state
+ */
+define('SERVICES_JSON_IN_OBJ', 4);
+
+/**
+ * Marker constant for Services_JSON::decode(), used to flag stack state
+ */
+define('SERVICES_JSON_IN_CMT', 5);
+
+/**
+ * Behavior switch for Services_JSON::decode()
+ */
+define('SERVICES_JSON_LOOSE_TYPE', 16);
+
+/**
+ * Behavior switch for Services_JSON::decode()
+ */
+define('SERVICES_JSON_SUPPRESS_ERRORS', 32);
+
+/**
+ * Converts to and from JSON format.
+ *
+ * Brief example of use:
+ *
+ * <code>
+ * // create a new instance of Services_JSON
+ * $json = new Services_JSON();
+ *
+ * // convert a complexe value to JSON notation, and send it to the browser
+ * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4)));
+ * $output = $json->encode($value);
+ *
+ * print($output);
+ * // prints: ["foo","bar",[1,2,"baz"],[3,[4]]]
+ *
+ * // accept incoming POST data, assumed to be in JSON notation
+ * $input = file_get_contents('php://input', 1000000);
+ * $value = $json->decode($input);
+ * </code>
+ */
+class Services_JSON
+{
+ /**
+ * constructs a new JSON instance
+ *
+ * @param int $use object behavior flags; combine with boolean-OR
+ *
+ * possible values:
+ * - SERVICES_JSON_LOOSE_TYPE: loose typing.
+ * "{...}" syntax creates associative arrays
+ * instead of objects in decode().
+ * - SERVICES_JSON_SUPPRESS_ERRORS: error suppression.
+ * Values which can't be encoded (e.g. resources)
+ * appear as NULL instead of throwing errors.
+ * By default, a deeply-nested resource will
+ * bubble up with an error, so all return values
+ * from encode() should be checked with isError()
+ */
+ function Services_JSON($use = 0)
+ {
+ $this->use = $use;
+ }
+
+ /**
+ * convert a string from one UTF-16 char to one UTF-8 char
+ *
+ * Normally should be handled by mb_convert_encoding, but
+ * provides a slower PHP-only method for installations
+ * that lack the multibye string extension.
+ *
+ * @param string $utf16 UTF-16 character
+ * @return string UTF-8 character
+ * @access private
+ */
+ function utf162utf8($utf16)
+ {
+ // oh please oh please oh please oh please oh please
+ if(function_exists('mb_convert_encoding')) {
+ return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
+ }
+
+ $bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
+
+ switch(true) {
+ case ((0x7F & $bytes) == $bytes):
+ // this case should never be reached, because we are in ASCII range
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ return chr(0x7F & $bytes);
+
+ case (0x07FF & $bytes) == $bytes:
+ // return a 2-byte UTF-8 character
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ return chr(0xC0 | (($bytes >> 6) & 0x1F))
+ . chr(0x80 | ($bytes & 0x3F));
+
+ case (0xFFFF & $bytes) == $bytes:
+ // return a 3-byte UTF-8 character
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ return chr(0xE0 | (($bytes >> 12) & 0x0F))
+ . chr(0x80 | (($bytes >> 6) & 0x3F))
+ . chr(0x80 | ($bytes & 0x3F));
+ }
+
+ // ignoring UTF-32 for now, sorry
+ return '';
+ }
+
+ /**
+ * convert a string from one UTF-8 char to one UTF-16 char
+ *
+ * Normally should be handled by mb_convert_encoding, but
+ * provides a slower PHP-only method for installations
+ * that lack the multibye string extension.
+ *
+ * @param string $utf8 UTF-8 character
+ * @return string UTF-16 character
+ * @access private
+ */
+ function utf82utf16($utf8)
+ {
+ // oh please oh please oh please oh please oh please
+ if(function_exists('mb_convert_encoding')) {
+ return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
+ }
+
+ switch(strlen($utf8)) {
+ case 1:
+ // this case should never be reached, because we are in ASCII range
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ return $utf8;
+
+ case 2:
+ // return a UTF-16 character from a 2-byte UTF-8 char
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ return chr(0x07 & (ord($utf8{0}) >> 2))
+ . chr((0xC0 & (ord($utf8{0}) << 6))
+ | (0x3F & ord($utf8{1})));
+
+ case 3:
+ // return a UTF-16 character from a 3-byte UTF-8 char
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ return chr((0xF0 & (ord($utf8{0}) << 4))
+ | (0x0F & (ord($utf8{1}) >> 2)))
+ . chr((0xC0 & (ord($utf8{1}) << 6))
+ | (0x7F & ord($utf8{2})));
+ }
+
+ // ignoring UTF-32 for now, sorry
+ return '';
+ }
+
+ /**
+ * encodes an arbitrary variable into JSON format (and sends JSON Header)
+ *
+ * @param mixed $var any number, boolean, string, array, or object to be encoded.
+ * see argument 1 to Services_JSON() above for array-parsing behavior.
+ * if var is a strng, note that encode() always expects it
+ * to be in ASCII or UTF-8 format!
+ *
+ * @return mixed JSON string representation of input var or an error if a problem occurs
+ * @access public
+ */
+ function encode($var)
+ {
+ header('Content-type: application/x-javascript');
+ return $this->_encode($var);
+ }
+ /**
+ * encodes an arbitrary variable into JSON format without JSON Header - warning - may allow CSS!!!!)
+ *
+ * @param mixed $var any number, boolean, string, array, or object to be encoded.
+ * see argument 1 to Services_JSON() above for array-parsing behavior.
+ * if var is a strng, note that encode() always expects it
+ * to be in ASCII or UTF-8 format!
+ *
+ * @return mixed JSON string representation of input var or an error if a problem occurs
+ * @access public
+ */
+ function encodeUnsafe($var)
+ {
+ return $this->_encode($var);
+ }
+ /**
+ * PRIVATE CODE that does the work of encodes an arbitrary variable into JSON format
+ *
+ * @param mixed $var any number, boolean, string, array, or object to be encoded.
+ * see argument 1 to Services_JSON() above for array-parsing behavior.
+ * if var is a strng, note that encode() always expects it
+ * to be in ASCII or UTF-8 format!
+ *
+ * @return mixed JSON string representation of input var or an error if a problem occurs
+ * @access public
+ */
+ function _encode($var)
+ {
+
+ switch (gettype($var)) {
+ case 'boolean':
+ return $var ? 'true' : 'false';
+
+ case 'NULL':
+ return 'null';
+
+ case 'integer':
+ return (int) $var;
+
+ case 'double':
+ case 'float':
+ return (float) $var;
+
+ case 'string':
+ // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
+ $ascii = '';
+ $strlen_var = strlen($var);
+
+ /*
+ * Iterate over every character in the string,
+ * escaping with a slash or encoding to UTF-8 where necessary
+ */
+ for ($c = 0; $c < $strlen_var; ++$c) {
+
+ $ord_var_c = ord($var{$c});
+
+ switch (true) {
+ case $ord_var_c == 0x08:
+ $ascii .= '\b';
+ break;
+ case $ord_var_c == 0x09:
+ $ascii .= '\t';
+ break;
+ case $ord_var_c == 0x0A:
+ $ascii .= '\n';
+ break;
+ case $ord_var_c == 0x0C:
+ $ascii .= '\f';
+ break;
+ case $ord_var_c == 0x0D:
+ $ascii .= '\r';
+ break;
+
+ case $ord_var_c == 0x22:
+ case $ord_var_c == 0x2F:
+ case $ord_var_c == 0x5C:
+ // double quote, slash, slosh
+ $ascii .= '\\'.$var{$c};
+ break;
+
+ case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
+ // characters U-00000000 - U-0000007F (same as ASCII)
+ $ascii .= $var{$c};
+ break;
+
+ case (($ord_var_c & 0xE0) == 0xC0):
+ // characters U-00000080 - U-000007FF, mask 110XXXXX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ if ($c+1 >= $strlen_var) {
+ $c += 1;
+ $ascii .= '?';
+ break;
+ }
+
+ $char = pack('C*', $ord_var_c, ord($var{$c + 1}));
+ $c += 1;
+ $utf16 = $this->utf82utf16($char);
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
+ break;
+
+ case (($ord_var_c & 0xF0) == 0xE0):
+ if ($c+2 >= $strlen_var) {
+ $c += 2;
+ $ascii .= '?';
+ break;
+ }
+ // characters U-00000800 - U-0000FFFF, mask 1110XXXX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $char = pack('C*', $ord_var_c,
+ @ord($var{$c + 1}),
+ @ord($var{$c + 2}));
+ $c += 2;
+ $utf16 = $this->utf82utf16($char);
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
+ break;
+
+ case (($ord_var_c & 0xF8) == 0xF0):
+ if ($c+3 >= $strlen_var) {
+ $c += 3;
+ $ascii .= '?';
+ break;
+ }
+ // characters U-00010000 - U-001FFFFF, mask 11110XXX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $char = pack('C*', $ord_var_c,
+ ord($var{$c + 1}),
+ ord($var{$c + 2}),
+ ord($var{$c + 3}));
+ $c += 3;
+ $utf16 = $this->utf82utf16($char);
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
+ break;
+
+ case (($ord_var_c & 0xFC) == 0xF8):
+ // characters U-00200000 - U-03FFFFFF, mask 111110XX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ if ($c+4 >= $strlen_var) {
+ $c += 4;
+ $ascii .= '?';
+ break;
+ }
+ $char = pack('C*', $ord_var_c,
+ ord($var{$c + 1}),
+ ord($var{$c + 2}),
+ ord($var{$c + 3}),
+ ord($var{$c + 4}));
+ $c += 4;
+ $utf16 = $this->utf82utf16($char);
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
+ break;
+
+ case (($ord_var_c & 0xFE) == 0xFC):
+ if ($c+5 >= $strlen_var) {
+ $c += 5;
+ $ascii .= '?';
+ break;
+ }
+ // characters U-04000000 - U-7FFFFFFF, mask 1111110X
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $char = pack('C*', $ord_var_c,
+ ord($var{$c + 1}),
+ ord($var{$c + 2}),
+ ord($var{$c + 3}),
+ ord($var{$c + 4}),
+ ord($var{$c + 5}));
+ $c += 5;
+ $utf16 = $this->utf82utf16($char);
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
+ break;
+ }
+ }
+ return '"'.$ascii.'"';
+
+ case 'array':
+ /*
+ * As per JSON spec if any array key is not an integer
+ * we must treat the the whole array as an object. We
+ * also try to catch a sparsely populated associative
+ * array with numeric keys here because some JS engines
+ * will create an array with empty indexes up to
+ * max_index which can cause memory issues and because
+ * the keys, which may be relevant, will be remapped
+ * otherwise.
+ *
+ * As per the ECMA and JSON specification an object may
+ * have any string as a property. Unfortunately due to
+ * a hole in the ECMA specification if the key is a
+ * ECMA reserved word or starts with a digit the
+ * parameter is only accessible using ECMAScript's
+ * bracket notation.
+ */
+
+ // treat as a JSON object
+ if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
+ $properties = array_map(array($this, 'name_value'),
+ array_keys($var),
+ array_values($var));
+
+ foreach($properties as $property) {
+ if(Services_JSON::isError($property)) {
+ return $property;
+ }
+ }
+
+ return '{' . join(',', $properties) . '}';
+ }
+
+ // treat it like a regular array
+ $elements = array_map(array($this, '_encode'), $var);
+
+ foreach($elements as $element) {
+ if(Services_JSON::isError($element)) {
+ return $element;
+ }
+ }
+
+ return '[' . join(',', $elements) . ']';
+
+ case 'object':
+ $vars = get_object_vars($var);
+
+ $properties = array_map(array($this, 'name_value'),
+ array_keys($vars),
+ array_values($vars));
+
+ foreach($properties as $property) {
+ if(Services_JSON::isError($property)) {
+ return $property;
+ }
+ }
+
+ return '{' . join(',', $properties) . '}';
+
+ default:
+ return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
+ ? 'null'
+ : new Services_JSON_Error(gettype($var)." can not be encoded as JSON string");
+ }
+ }
+
+ /**
+ * array-walking function for use in generating JSON-formatted name-value pairs
+ *
+ * @param string $name name of key to use
+ * @param mixed $value reference to an array element to be encoded
+ *
+ * @return string JSON-formatted name-value pair, like '"name":value'
+ * @access private
+ */
+ function name_value($name, $value)
+ {
+ $encoded_value = $this->_encode($value);
+
+ if(Services_JSON::isError($encoded_value)) {
+ return $encoded_value;
+ }
+
+ return $this->_encode(strval($name)) . ':' . $encoded_value;
+ }
+
+ /**
+ * reduce a string by removing leading and trailing comments and whitespace
+ *
+ * @param $str string string value to strip of comments and whitespace
+ *
+ * @return string string value stripped of comments and whitespace
+ * @access private
+ */
+ function reduce_string($str)
+ {
+ $str = preg_replace(array(
+
+ // eliminate single line comments in '// ...' form
+ '#^\s*//(.+)$#m',
+
+ // eliminate multi-line comments in '/* ... */' form, at start of string
+ '#^\s*/\*(.+)\*/#Us',
+
+ // eliminate multi-line comments in '/* ... */' form, at end of string
+ '#/\*(.+)\*/\s*$#Us'
+
+ ), '', $str);
+
+ // eliminate extraneous space
+ return trim($str);
+ }
+
+ /**
+ * decodes a JSON string into appropriate variable
+ *
+ * @param string $str JSON-formatted string
+ *
+ * @return mixed number, boolean, string, array, or object
+ * corresponding to given JSON input string.
+ * See argument 1 to Services_JSON() above for object-output behavior.
+ * Note that decode() always returns strings
+ * in ASCII or UTF-8 format!
+ * @access public
+ */
+ function decode($str)
+ {
+ $str = $this->reduce_string($str);
+
+ switch (strtolower($str)) {
+ case 'true':
+ return true;
+
+ case 'false':
+ return false;
+
+ case 'null':
+ return null;
+
+ default:
+ $m = array();
+
+ if (is_numeric($str)) {
+ // Lookie-loo, it's a number
+
+ // This would work on its own, but I'm trying to be
+ // good about returning integers where appropriate:
+ // return (float)$str;
+
+ // Return float or int, as appropriate
+ return ((float)$str == (integer)$str)
+ ? (integer)$str
+ : (float)$str;
+
+ } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) {
+ // STRINGS RETURNED IN UTF-8 FORMAT
+ $delim = substr($str, 0, 1);
+ $chrs = substr($str, 1, -1);
+ $utf8 = '';
+ $strlen_chrs = strlen($chrs);
+
+ for ($c = 0; $c < $strlen_chrs; ++$c) {
+
+ $substr_chrs_c_2 = substr($chrs, $c, 2);
+ $ord_chrs_c = ord($chrs{$c});
+
+ switch (true) {
+ case $substr_chrs_c_2 == '\b':
+ $utf8 .= chr(0x08);
+ ++$c;
+ break;
+ case $substr_chrs_c_2 == '\t':
+ $utf8 .= chr(0x09);
+ ++$c;
+ break;
+ case $substr_chrs_c_2 == '\n':
+ $utf8 .= chr(0x0A);
+ ++$c;
+ break;
+ case $substr_chrs_c_2 == '\f':
+ $utf8 .= chr(0x0C);
+ ++$c;
+ break;
+ case $substr_chrs_c_2 == '\r':
+ $utf8 .= chr(0x0D);
+ ++$c;
+ break;
+
+ case $substr_chrs_c_2 == '\\"':
+ case $substr_chrs_c_2 == '\\\'':
+ case $substr_chrs_c_2 == '\\\\':
+ case $substr_chrs_c_2 == '\\/':
+ if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
+ ($delim == "'" && $substr_chrs_c_2 != '\\"')) {
+ $utf8 .= $chrs{++$c};
+ }
+ break;
+
+ case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):
+ // single, escaped unicode character
+ $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))
+ . chr(hexdec(substr($chrs, ($c + 4), 2)));
+ $utf8 .= $this->utf162utf8($utf16);
+ $c += 5;
+ break;
+
+ case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
+ $utf8 .= $chrs{$c};
+ break;
+
+ case ($ord_chrs_c & 0xE0) == 0xC0:
+ // characters U-00000080 - U-000007FF, mask 110XXXXX
+ //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $utf8 .= substr($chrs, $c, 2);
+ ++$c;
+ break;
+
+ case ($ord_chrs_c & 0xF0) == 0xE0:
+ // characters U-00000800 - U-0000FFFF, mask 1110XXXX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $utf8 .= substr($chrs, $c, 3);
+ $c += 2;
+ break;
+
+ case ($ord_chrs_c & 0xF8) == 0xF0:
+ // characters U-00010000 - U-001FFFFF, mask 11110XXX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $utf8 .= substr($chrs, $c, 4);
+ $c += 3;
+ break;
+
+ case ($ord_chrs_c & 0xFC) == 0xF8:
+ // characters U-00200000 - U-03FFFFFF, mask 111110XX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $utf8 .= substr($chrs, $c, 5);
+ $c += 4;
+ break;
+
+ case ($ord_chrs_c & 0xFE) == 0xFC:
+ // characters U-04000000 - U-7FFFFFFF, mask 1111110X
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $utf8 .= substr($chrs, $c, 6);
+ $c += 5;
+ break;
+
+ }
+
+ }
+
+ return $utf8;
+
+ } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
+ // array, or object notation
+
+ if ($str{0} == '[') {
+ $stk = array(SERVICES_JSON_IN_ARR);
+ $arr = array();
+ } else {
+ if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
+ $stk = array(SERVICES_JSON_IN_OBJ);
+ $obj = array();
+ } else {
+ $stk = array(SERVICES_JSON_IN_OBJ);
+ $obj = new stdClass();
+ }
+ }
+
+ array_push($stk, array('what' => SERVICES_JSON_SLICE,
+ 'where' => 0,
+ 'delim' => false));
+
+ $chrs = substr($str, 1, -1);
+ $chrs = $this->reduce_string($chrs);
+
+ if ($chrs == '') {
+ if (reset($stk) == SERVICES_JSON_IN_ARR) {
+ return $arr;
+
+ } else {
+ return $obj;
+
+ }
+ }
+
+ //print("\nparsing {$chrs}\n");
+
+ $strlen_chrs = strlen($chrs);
+
+ for ($c = 0; $c <= $strlen_chrs; ++$c) {
+
+ $top = end($stk);
+ $substr_chrs_c_2 = substr($chrs, $c, 2);
+
+ if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
+ // found a comma that is not inside a string, array, etc.,
+ // OR we've reached the end of the character list
+ $slice = substr($chrs, $top['where'], ($c - $top['where']));
+ array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
+ //print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
+
+ if (reset($stk) == SERVICES_JSON_IN_ARR) {
+ // we are in an array, so just push an element onto the stack
+ array_push($arr, $this->decode($slice));
+
+ } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
+ // we are in an object, so figure
+ // out the property name and set an
+ // element in an associative array,
+ // for now
+ $parts = array();
+
+ if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
+ // "name":value pair
+ $key = $this->decode($parts[1]);
+ $val = $this->decode($parts[2]);
+
+ if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
+ $obj[$key] = $val;
+ } else {
+ $obj->$key = $val;
+ }
+ } elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
+ // name:value pair, where name is unquoted
+ $key = $parts[1];
+ $val = $this->decode($parts[2]);
+
+ if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
+ $obj[$key] = $val;
+ } else {
+ $obj->$key = $val;
+ }
+ }
+
+ }
+
+ } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
+ // found a quote, and we are not inside a string
+ array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
+ //print("Found start of string at {$c}\n");
+
+ } elseif (($chrs{$c} == $top['delim']) &&
+ ($top['what'] == SERVICES_JSON_IN_STR) &&
+ ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
+ // found a quote, we're in a string, and it's not escaped
+ // we know that it's not escaped becase there is _not_ an
+ // odd number of backslashes at the end of the string so far
+ array_pop($stk);
+ //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
+
+ } elseif (($chrs{$c} == '[') &&
+ in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
+ // found a left-bracket, and we are in an array, object, or slice
+ array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
+ //print("Found start of array at {$c}\n");
+
+ } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
+ // found a right-bracket, and we're in an array
+ array_pop($stk);
+ //print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
+
+ } elseif (($chrs{$c} == '{') &&
+ in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
+ // found a left-brace, and we are in an array, object, or slice
+ array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
+ //print("Found start of object at {$c}\n");
+
+ } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
+ // found a right-brace, and we're in an object
+ array_pop($stk);
+ //print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
+
+ } elseif (($substr_chrs_c_2 == '/*') &&
+ in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
+ // found a comment start, and we are in an array, object, or slice
+ array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
+ $c++;
+ //print("Found start of comment at {$c}\n");
+
+ } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
+ // found a comment end, and we're in one now
+ array_pop($stk);
+ $c++;
+
+ for ($i = $top['where']; $i <= $c; ++$i)
+ $chrs = substr_replace($chrs, ' ', $i, 1);
+
+ //print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
+
+ }
+
+ }
+
+ if (reset($stk) == SERVICES_JSON_IN_ARR) {
+ return $arr;
+
+ } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
+ return $obj;
+
+ }
+
+ }
+ }
+ }
+
+ /**
+ * @todo Ultimately, this should just call PEAR::isError()
+ */
+ function isError($data, $code = null)
+ {
+ if (class_exists('pear')) {
+ return PEAR::isError($data, $code);
+ } elseif (is_object($data) && (get_class($data) == 'services_json_error' ||
+ is_subclass_of($data, 'services_json_error'))) {
+ return true;
+ }
+
+ return false;
+ }
+}
+
+if (class_exists('PEAR_Error')) {
+
+ class Services_JSON_Error extends PEAR_Error
+ {
+ function Services_JSON_Error($message = 'unknown error', $code = null,
+ $mode = null, $options = null, $userinfo = null)
+ {
+ parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
+ }
+ }
+
+} else {
+
+ /**
+ * @todo Ultimately, this class shall be descended from PEAR_Error
+ */
+ class Services_JSON_Error
+ {
+ function Services_JSON_Error($message = 'unknown error', $code = null,
+ $mode = null, $options = null, $userinfo = null)
+ {
+
+ }
+ }
+
+}
--- /dev/null
+<?php
+/**
+ * API for fetching the HTML to embed remote content based on a provided URL.
+ * Used internally by the {@link WP_Embed} class, but is designed to be generic.
+ *
+ * @link http://codex.wordpress.org/oEmbed oEmbed Codex Article
+ * @link http://oembed.com/ oEmbed Homepage
+ *
+ * @package WordPress
+ * @subpackage oEmbed
+ */
+
+/**
+ * oEmbed class.
+ *
+ * @package WordPress
+ * @subpackage oEmbed
+ * @since 2.9.0
+ */
+class WP_oEmbed {
+ var $providers = array();
+
+ /**
+ * PHP4 constructor
+ */
+ function WP_oEmbed() {
+ return $this->__construct();
+ }
+
+ /**
+ * PHP5 constructor
+ *
+ * @uses apply_filters() Filters a list of pre-defined oEmbed providers.
+ */
+ function __construct() {
+ // List out some popular sites that support oEmbed.
+ // The WP_Embed class disables discovery for non-unfiltered_html users, so only providers in this array will be used for them.
+ // Add to this list using the wp_oembed_add_provider() function (see it's PHPDoc for details).
+ $this->providers = apply_filters( 'oembed_providers', array(
+ '#http://(www\.)?youtube.com/watch.*#i' => array( 'http://www.youtube.com/oembed', true ),
+ 'http://blip.tv/file/*' => array( 'http://blip.tv/oembed/', false ),
+ '#http://(www\.)?vimeo\.com/.*#i' => array( 'http://www.vimeo.com/api/oembed.{format}', true ),
+ '#http://(www\.)?dailymotion\.com/.*#i' => array( 'http://www.dailymotion.com/api/oembed', true ),
+ '#http://(www\.)?flickr\.com/.*#i' => array( 'http://www.flickr.com/services/oembed/', true ),
+ '#http://(www\.)?hulu\.com/watch/.*#i' => array( 'http://www.hulu.com/api/oembed.{format}', true ),
+ '#http://(www\.)?viddler\.com/.*#i' => array( 'http://lab.viddler.com/services/oembed/', true ),
+ 'http://qik.com/*' => array( 'http://qik.com/api/oembed.{format}', false ),
+ 'http://revision3.com/*' => array( 'http://revision3.com/api/oembed/', false ),
+ 'http://i*.photobucket.com/albums/*' => array( 'http://photobucket.com/oembed', false ),
+ 'http://gi*.photobucket.com/groups/*' => array( 'http://photobucket.com/oembed', false ),
+ '#http://(www\.)?scribd\.com/.*#i' => array( 'http://www.scribd.com/services/oembed', true ),
+ 'http://wordpress.tv/*' => array( 'http://wordpress.tv/oembed/', false ),
+ ) );
+
+ // Fix Scribd embeds. They contain new lines in the middle of the HTML which breaks wpautop().
+ add_filter( 'oembed_dataparse', array(&$this, 'strip_scribd_newlines'), 10, 3 );
+ }
+
+ /**
+ * The do-it-all function that takes a URL and attempts to return the HTML.
+ *
+ * @see WP_oEmbed::discover()
+ * @see WP_oEmbed::fetch()
+ * @see WP_oEmbed::data2html()
+ *
+ * @param string $url The URL to the content that should be attempted to be embedded.
+ * @param array $args Optional arguments. Usually passed from a shortcode.
+ * @return bool|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
+ */
+ function get_html( $url, $args = '' ) {
+ $provider = false;
+
+ if ( !isset($args['discover']) )
+ $args['discover'] = true;
+
+ foreach ( $this->providers as $matchmask => $data ) {
+ list( $providerurl, $regex ) = $data;
+
+ // Turn the asterisk-type provider URLs into regex
+ if ( !$regex )
+ $matchmask = '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $matchmask ), '#' ) ) . '#i';
+
+ if ( preg_match( $matchmask, $url ) ) {
+ $provider = str_replace( '{format}', 'json', $providerurl ); // JSON is easier to deal with than XML
+ break;
+ }
+ }
+
+ if ( !$provider && $args['discover'] )
+ $provider = $this->discover( $url );
+
+ if ( !$provider || false === $data = $this->fetch( $provider, $url, $args ) )
+ return false;
+
+ return apply_filters( 'oembed_result', $this->data2html( $data, $url ), $url, $args );
+ }
+
+ /**
+ * Attempts to find oEmbed provider discovery <link> tags at the given URL.
+ *
+ * @param string $url The URL that should be inspected for discovery <link> tags.
+ * @return bool|string False on failure, otherwise the oEmbed provider URL.
+ */
+ function discover( $url ) {
+ $providers = array();
+
+ // Fetch URL content
+ if ( $html = wp_remote_retrieve_body( wp_remote_get( $url ) ) ) {
+
+ // <link> types that contain oEmbed provider URLs
+ $linktypes = apply_filters( 'oembed_linktypes', array(
+ 'application/json+oembed' => 'json',
+ 'text/xml+oembed' => 'xml',
+ 'application/xml+oembed' => 'xml', // Incorrect, but used by at least Vimeo
+ ) );
+
+ // Strip <body>
+ $html = substr( $html, 0, stripos( $html, '</head>' ) );
+
+ // Do a quick check
+ $tagfound = false;
+ foreach ( $linktypes as $linktype => $format ) {
+ if ( stripos($html, $linktype) ) {
+ $tagfound = true;
+ break;
+ }
+ }
+
+ if ( $tagfound && preg_match_all( '/<link([^<>]+)>/i', $html, $links ) ) {
+ foreach ( $links[1] as $link ) {
+ $atts = shortcode_parse_atts( $link );
+
+ if ( !empty($atts['type']) && !empty($linktypes[$atts['type']]) && !empty($atts['href']) ) {
+ $providers[$linktypes[$atts['type']]] = $atts['href'];
+
+ // Stop here if it's JSON (that's all we need)
+ if ( 'json' == $linktypes[$atts['type']] )
+ break;
+ }
+ }
+ }
+ }
+
+ // JSON is preferred to XML
+ if ( !empty($providers['json']) )
+ return $providers['json'];
+ elseif ( !empty($providers['xml']) )
+ return $providers['xml'];
+ else
+ return false;
+ }
+
+ /**
+ * Connects to a oEmbed provider and returns the result.
+ *
+ * @param string $provider The URL to the oEmbed provider.
+ * @param string $url The URL to the content that is desired to be embedded.
+ * @param array $args Optional arguments. Usually passed from a shortcode.
+ * @return bool|object False on failure, otherwise the result in the form of an object.
+ */
+ function fetch( $provider, $url, $args = '' ) {
+ $args = wp_parse_args( $args, wp_embed_defaults() );
+
+ $provider = add_query_arg( 'format', 'json', $provider ); // JSON is easier to deal with than XML
+
+ $provider = add_query_arg( 'maxwidth', $args['width'], $provider );
+ $provider = add_query_arg( 'maxheight', $args['height'], $provider );
+ $provider = add_query_arg( 'url', urlencode($url), $provider );
+
+ if ( !$result = wp_remote_retrieve_body( wp_remote_get( $provider ) ) )
+ return false;
+
+ $result = trim( $result );
+
+ // JSON?
+ // Example content: http://vimeo.com/api/oembed.json?url=http%3A%2F%2Fvimeo.com%2F240975
+ if ( $data = json_decode($result) ) {
+ return $data;
+ }
+
+ // Must be XML. Only parse it if PHP5 is installed. (PHP4 isn't worth the trouble.)
+ // Example content: http://vimeo.com/api/oembed.xml?url=http%3A%2F%2Fvimeo.com%2F240975
+ elseif ( function_exists('simplexml_load_string') ) {
+ $errors = libxml_use_internal_errors( 'true' );
+
+ $data = simplexml_load_string( $result );
+
+ libxml_use_internal_errors( $errors );
+
+ if ( is_object($data) )
+ return $data;
+ }
+
+ return false;
+ }
+
+ /**
+ * Converts a data object from {@link WP_oEmbed::fetch()} and returns the HTML.
+ *
+ * @param object $data A data object result from an oEmbed provider.
+ * @param string $url The URL to the content that is desired to be embedded.
+ * @return bool|string False on error, otherwise the HTML needed to embed.
+ */
+ function data2html( $data, $url ) {
+ if ( !is_object($data) || empty($data->type) )
+ return false;
+
+ switch ( $data->type ) {
+ case 'photo':
+ if ( empty($data->url) || empty($data->width) || empty($data->height) )
+ return false;
+
+ $title = ( !empty($data->title) ) ? $data->title : '';
+ $return = '<img src="' . esc_attr( clean_url( $data->url ) ) . '" alt="' . esc_attr($title) . '" width="' . esc_attr($data->width) . '" height="' . esc_attr($data->height) . '" />';
+ break;
+
+ case 'video':
+ case 'rich':
+ $return = ( !empty($data->html) ) ? $data->html : false;
+ break;
+
+ case 'link':
+ $return = ( !empty($data->title) ) ? '<a href="' . clean_url($url) . '">' . esc_html($data->title) . '</a>' : false;
+ break;
+
+ default;
+ $return = false;
+ }
+
+ // You can use this filter to add support for custom data types or to filter the result
+ return apply_filters( 'oembed_dataparse', $return, $data, $url );
+ }
+
+ /**
+ * Strip new lines from the HTML if it's a Scribd embed.
+ *
+ * @param string $html Existing HTML.
+ * @param object $data Data object from WP_oEmbed::data2html()
+ * @param string $url The original URL passed to oEmbed.
+ * @return string Possibly modified $html
+ */
+ function strip_scribd_newlines( $html, $data, $url ) {
+ if ( preg_match( '#http://(www\.)?scribd.com/.*#i', $url ) )
+ $html = str_replace( array( "\r\n", "\n" ), '', $html );
+
+ return $html;
+ }
+}
+
+/**
+ * Returns the initialized {@link WP_oEmbed} object
+ *
+ * @since 2.9.0
+ * @access private
+ *
+ * @see WP_oEmbed
+ * @uses WP_oEmbed
+ *
+ * @return WP_oEmbed object.
+ */
+function &_wp_oembed_get_object() {
+ static $wp_oembed;
+
+ if ( is_null($wp_oembed) )
+ $wp_oembed = new WP_oEmbed();
+
+ return $wp_oembed;
+}
+
+?>
\ No newline at end of file
* A PHP-Based RSS and Atom Feed Framework.
* Takes the hard work out of managing a complete RSS/Atom solution.
*
- * Copyright (c) 2004-2008, Ryan Parman and Geoffrey Sneddon
+ * Copyright (c) 2004-2009, Ryan Parman and Geoffrey Sneddon
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* POSSIBILITY OF SUCH DAMAGE.
*
* @package SimplePie
- * @version 1.1.3
- * @copyright 2004-2008 Ryan Parman, Geoffrey Sneddon
+ * @version 1.2
+ * @copyright 2004-2009 Ryan Parman, Geoffrey Sneddon
* @author Ryan Parman
* @author Geoffrey Sneddon
* @link http://simplepie.org/ SimplePie
/**
* SimplePie Version
*/
-define('SIMPLEPIE_VERSION', '1.1.3');
+define('SIMPLEPIE_VERSION', '1.2');
/**
* SimplePie Build
*/
-define('SIMPLEPIE_BUILD', 20081219);
+define('SIMPLEPIE_BUILD', '20090627192103');
/**
* SimplePie Website URL
*/
define('SIMPLEPIE_CONSTRUCT_ALL', 63);
+/**
+ * Don't change case
+ */
+define('SIMPLEPIE_SAME_CASE', 1);
+
+/**
+ * Change to lowercase
+ */
+define('SIMPLEPIE_LOWERCASE', 2);
+
+/**
+ * Change to uppercase
+ */
+define('SIMPLEPIE_UPPERCASE', 4);
+
/**
* PCRE for HTML attributes
*/
* SimplePie
*
* @package SimplePie
- * @version "Razzleberry"
- * @copyright 2004-2007 Ryan Parman, Geoffrey Sneddon
- * @author Ryan Parman
- * @author Geoffrey Sneddon
- * @todo Option for type of fetching (cache, not modified header, fetch, etc.)
*/
class SimplePie
{
*/
var $max_checked_feeds = 10;
+ /**
+ * @var array All the feeds found during the autodiscovery process
+ * @see SimplePie::get_all_discovered_feeds()
+ * @access private
+ */
+ var $all_discovered_feeds = array();
+
/**
* @var string Web-accessible path to the handler_favicon.php file.
* @see SimplePie::set_favicon_handler()
*/
function set_favicon_handler($page = false, $qs = 'i')
{
- if ($page != false)
+ if ($page !== false)
{
$this->favicon_handler = $page . '?' . $qs . '=';
}
*/
function set_image_handler($page = false, $qs = 'i')
{
- if ($page != false)
+ if ($page !== false)
{
$this->sanitize->set_image_handler($page . '?' . $qs . '=');
}
function init()
{
+ // Check absolute bare minimum requirements.
if ((function_exists('version_compare') && version_compare(PHP_VERSION, '4.3.0', '<')) || !extension_loaded('xml') || !extension_loaded('pcre'))
{
return false;
}
- if (isset($_GET[$this->javascript]))
+ // Then check the xml extension is sane (i.e., libxml 2.7.x issue on PHP < 5.2.9 and libxml 2.7.0 to 2.7.2 on any version) if we don't have xmlreader.
+ elseif (!extension_loaded('xmlreader'))
{
- if (function_exists('ob_gzhandler'))
+ static $xml_is_sane = null;
+ if ($xml_is_sane === null)
{
- ob_start('ob_gzhandler');
+ $parser_check = xml_parser_create();
+ xml_parse_into_struct($parser_check, '<foo>&</foo>', $values);
+ xml_parser_free($parser_check);
+ $xml_is_sane = isset($values[0]['value']);
}
- header('Content-type: text/javascript; charset: UTF-8');
- header('Cache-Control: must-revalidate');
- header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days
- ?>
-function embed_odeo(link) {
- document.writeln('<embed src="http://odeo.com/flash/audio_player_fullsize.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="440" height="80" wmode="transparent" allowScriptAccess="any" flashvars="valid_sample_rate=true&external_url='+link+'"></embed>');
-}
-
-function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) {
- if (placeholder != '') {
- document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" href="'+link+'" src="'+placeholder+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="false" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
- }
- else {
- document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" src="'+link+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="true" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
- }
-}
-
-function embed_flash(bgcolor, width, height, link, loop, type) {
- document.writeln('<embed src="'+link+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="'+type+'" quality="high" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" loop="'+loop+'"></embed>');
-}
-
-function embed_flv(width, height, link, placeholder, loop, player) {
- document.writeln('<embed src="'+player+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="'+width+'" height="'+height+'" wmode="transparent" flashvars="file='+link+'&autostart=false&repeat='+loop+'&showdigits=true&showfsbutton=false"></embed>');
-}
+ if (!$xml_is_sane)
+ {
+ return false;
+ }
+ }
-function embed_wmedia(width, height, link) {
- document.writeln('<embed type="application/x-mplayer2" src="'+link+'" autosize="1" width="'+width+'" height="'+height+'" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="0"></embed>');
-}
- <?php
+ if (isset($_GET[$this->javascript]))
+ {
+ SimplePie_Misc::output_javascript();
exit;
}
if (!empty($this->data))
{
// If the cache is for an outdated build of SimplePie
- if (!isset($this->data['build']) || $this->data['build'] != SIMPLEPIE_BUILD)
+ if (!isset($this->data['build']) || $this->data['build'] !== SIMPLEPIE_BUILD)
{
$cache->unlink();
$this->data = array();
}
// If we've hit a collision just rerun it with caching disabled
- elseif (isset($this->data['url']) && $this->data['url'] != $this->feed_url)
+ elseif (isset($this->data['url']) && $this->data['url'] !== $this->feed_url)
{
$cache = false;
$this->data = array();
if ($cache->mtime() + $this->autodiscovery_cache_duration > time())
{
// Do not need to do feed autodiscovery yet.
- if ($this->data['feed_url'] == $this->data['url'])
+ if ($this->data['feed_url'] === $this->data['url'])
{
$cache->unlink();
$this->data = array();
$file =& new $this->file_class($this->feed_url, $this->timeout/10, 5, $headers, $this->useragent, $this->force_fsockopen);
if ($file->success)
{
- if ($file->status_code == 304)
+ if ($file->status_code === 304)
{
$cache->touch();
return true;
// If we don't already have the file (it'll only exist if we've opened it to check if the cache has been modified), open it.
if (!isset($file))
{
- if (is_a($this->file, 'SimplePie_File') && $this->file->url == $this->feed_url)
+ if (is_a($this->file, 'SimplePie_File') && $this->file->url === $this->feed_url)
{
$file =& $this->file;
}
}
}
// If the file connection has an error, set SimplePie::error to that and quit
- if (!$file->success)
+ if (!$file->success && !($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)))
{
$this->error = $file->error;
if (!empty($this->data))
{
// We need to unset this so that if SimplePie::set_file() has been called that object is untouched
unset($file);
- if ($file = $locate->find($this->autodiscovery))
+ if ($file = $locate->find($this->autodiscovery, $this->all_discovered_feeds))
{
if ($cache)
{
$this->data = array('url' => $this->feed_url, 'feed_url' => $file->url, 'build' => SIMPLEPIE_BUILD);
if (!$cache->save($this))
{
- trigger_error("$cache->name is not writeable", E_USER_WARNING);
+ trigger_error("$this->cache_location is not writeable", E_USER_WARNING);
}
$cache = call_user_func(array($this->cache_class, 'create'), $this->cache_location, call_user_func($this->cache_name_function, $file->url), 'spc');
}
}
}
}
- // We have an error, just set SimplePie::error to it and quit
- $this->error = sprintf('XML error: %s at line %d, column %d', $parser->get_error_string(), $parser->get_current_line(), $parser->get_current_column());
+ if(isset($parser))
+ {
+ // We have an error, just set SimplePie_Misc::error to it and quit
+ $this->error = sprintf('XML error: %s at line %d, column %d', $parser->get_error_string(), $parser->get_current_line(), $parser->get_current_column());
+ }
+ else
+ {
+ $this->error = 'The data could not be converted to UTF-8';
+ }
SimplePie_Misc::error($this->error, E_USER_NOTICE, __FILE__, __LINE__);
return false;
}
$this->data['type'] &= SIMPLEPIE_TYPE_RSS_090;
}
}
- elseif (isset($this->data['child']['']['rss']))
+ elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss']))
{
$this->data['type'] &= SIMPLEPIE_TYPE_RSS_ALL;
- if (isset($this->data['child']['']['rss'][0]['attribs']['']['version']))
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version']))
{
- switch (trim($this->data['child']['']['rss'][0]['attribs']['']['version']))
+ switch (trim($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version']))
{
case '0.91':
$this->data['type'] &= SIMPLEPIE_TYPE_RSS_091;
- if (isset($this->data['child']['']['rss'][0]['child']['']['skiphours']['hour'][0]['data']))
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['skiphours']['hour'][0]['data']))
{
- switch (trim($this->data['child']['']['rss'][0]['child']['']['skiphours']['hour'][0]['data']))
+ switch (trim($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['skiphours']['hour'][0]['data']))
{
case '0':
$this->data['type'] &= SIMPLEPIE_TYPE_RSS_091_NETSCAPE;
{
$file =& new $this->file_class($favicon, $this->timeout / 10, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen);
- if ($file->success && ($file->status_code == 200 || ($file->status_code > 206 && $file->status_code < 300)) && strlen($file->body) > 0)
+ if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)) && strlen($file->body) > 0)
{
$sniffer =& new $this->content_type_sniffer_class($file);
if (substr($sniffer->get_type(), 0, 6) === 'image/')
return $this->sanitize($favicon, SIMPLEPIE_CONSTRUCT_IRI);
}
}
+ // not an image
+ else
+ {
+ return false;
+ }
}
}
}
{
if ($this->feed_url !== null)
{
- return 'outlook' . $this->sanitize(SimplePie_Misc::fix_protocol($this->feed_url, 2), SIMPLEPIE_CONSTRUCT_IRI);
+ return $this->sanitize('outlook' . SimplePie_Misc::fix_protocol($this->feed_url, 2), SIMPLEPIE_CONSTRUCT_IRI);
}
else
{
{
if ($this->subscribe_url())
{
- $return = $this->sanitize($feed_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->feed_url);
+ $return = $feed_url . rawurlencode($this->feed_url);
if ($site_url !== null && $this->get_link() !== null)
{
- $return .= $this->sanitize($site_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->get_link());
+ $return .= $site_url . rawurlencode($this->get_link());
}
- return $return;
+ return $this->sanitize($return, SIMPLEPIE_CONSTRUCT_IRI);
}
else
{
function subscribe_bloglines()
{
- return urldecode($this->subscribe_service('http://www.bloglines.com/sub/'));
+ return $this->subscribe_service('http://www.bloglines.com/sub/');
}
function subscribe_eskobo()
}
if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)
{
- if (isset($this->data['child']['']['rss'][0]['child'][$namespace][$tag]))
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag]))
{
- return $this->data['child']['']['rss'][0]['child'][$namespace][$tag];
+ return $this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag];
}
}
return null;
}
if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)
{
- if ($channel = $this->get_feed_tags('', 'channel'))
+ if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'channel'))
{
if (isset($channel[0]['child'][$namespace][$tag]))
{
}
if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)
{
- if ($image = $this->get_channel_tags('', 'image'))
+ if ($image = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'image'))
{
if (isset($image[0]['child'][$namespace][$tag]))
{
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
}
- elseif ($return = $this->get_channel_tags('', 'title'))
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
}
}
$categories[] =& new $this->category_class($term, $scheme, $label);
}
- foreach ((array) $this->get_channel_tags('', 'category') as $category)
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category)
{
- $categories[] =& new $this->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ // This is really the label, but keep this as the term also for BC.
+ // Label will also work on retrieving because that falls back to term.
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ if (isset($category['attribs']['']['domain']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = null;
+ }
+ $categories[] =& new $this->category_class($term, $scheme, null);
}
foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category)
{
{
$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
}
- if ($links = $this->get_channel_tags('', 'link'))
+ if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))
{
$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
}
$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
}
}
- elseif (substr($key, 0, 41) == SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
+ elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
{
$this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
}
}
}
+ function get_all_discovered_feeds()
+ {
+ return $this->all_discovered_feeds;
+ }
+
function get_description()
{
if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
}
- elseif ($return = $this->get_channel_tags('', 'description'))
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description'))
{
- return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
}
elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description'))
{
{
return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0]));
}
- elseif ($return = $this->get_channel_tags('', 'copyright'))
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
function get_language()
{
- if ($return = $this->get_channel_tags('', 'language'))
+ if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- elseif ($return = $this->get_image_tags('', 'title'))
+ elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
}
- elseif ($return = $this->get_image_tags('', 'url'))
+ elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
}
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
}
- elseif ($return = $this->get_image_tags('', 'link'))
+ elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
}
function get_image_width()
{
- if ($return = $this->get_image_tags('', 'width'))
+ if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'width'))
{
return round($return[0]['data']);
}
- elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags('', 'url'))
+ elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))
{
return 88.0;
}
function get_image_height()
{
- if ($return = $this->get_image_tags('', 'height'))
+ if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'height'))
{
return round($return[0]['data']);
}
- elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags('', 'url'))
+ elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))
{
return 31.0;
}
function get_item_quantity($max = 0)
{
+ $max = (int) $max;
$qty = count($this->get_items());
- if ($max == 0)
+ if ($max === 0)
{
return $qty;
}
function get_items($start = 0, $end = 0)
{
- if (!empty($this->multifeed_objects))
+ if (!isset($this->data['items']))
{
- return SimplePie::merge_items($this->multifeed_objects, $start, $end, $this->item_limit);
- }
- elseif (!isset($this->data['items']))
- {
- if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'entry'))
+ if (!empty($this->multifeed_objects))
{
- $keys = array_keys($items);
- foreach ($keys as $key)
- {
- $this->data['items'][] =& new $this->item_class($this, $items[$key]);
- }
+ $this->data['items'] = SimplePie::merge_items($this->multifeed_objects, $start, $end, $this->item_limit);
}
- if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'entry'))
+ else
{
- $keys = array_keys($items);
- foreach ($keys as $key)
+ $this->data['items'] = array();
+ if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'entry'))
{
- $this->data['items'][] =& new $this->item_class($this, $items[$key]);
+ $keys = array_keys($items);
+ foreach ($keys as $key)
+ {
+ $this->data['items'][] =& new $this->item_class($this, $items[$key]);
+ }
}
- }
- if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'item'))
- {
- $keys = array_keys($items);
- foreach ($keys as $key)
+ if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'entry'))
{
- $this->data['items'][] =& new $this->item_class($this, $items[$key]);
+ $keys = array_keys($items);
+ foreach ($keys as $key)
+ {
+ $this->data['items'][] =& new $this->item_class($this, $items[$key]);
+ }
}
- }
- if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'item'))
- {
- $keys = array_keys($items);
- foreach ($keys as $key)
+ if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'item'))
{
- $this->data['items'][] =& new $this->item_class($this, $items[$key]);
+ $keys = array_keys($items);
+ foreach ($keys as $key)
+ {
+ $this->data['items'][] =& new $this->item_class($this, $items[$key]);
+ }
}
- }
- if ($items = $this->get_channel_tags('', 'item'))
- {
- $keys = array_keys($items);
- foreach ($keys as $key)
+ if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'item'))
+ {
+ $keys = array_keys($items);
+ foreach ($keys as $key)
+ {
+ $this->data['items'][] =& new $this->item_class($this, $items[$key]);
+ }
+ }
+ if ($items = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'item'))
{
- $this->data['items'][] =& new $this->item_class($this, $items[$key]);
+ $keys = array_keys($items);
+ foreach ($keys as $key)
+ {
+ $this->data['items'][] =& new $this->item_class($this, $items[$key]);
+ }
}
}
}
if (!empty($this->data['items']))
{
// If we want to order it by date, check if all items have a date, and then sort it
- if ($this->order_by_date)
+ if ($this->order_by_date && empty($this->multifeed_objects))
{
if (!isset($this->data['ordered_items']))
{
}
// Slice the data as desired
- if ($end == 0)
+ if ($end === 0)
{
return array_slice($items, $start);
}
}
}
+ /**
+ * @static
+ */
function sort_items($a, $b)
{
return $a->get_date('U') <= $b->get_date('U');
}
+ /**
+ * @static
+ */
function merge_items($urls, $start = 0, $end = 0, $limit = 0)
{
if (is_array($urls) && sizeof($urls) > 0)
usort($items, array('SimplePie', 'sort_items'));
}
- if ($end == 0)
+ if ($end === 0)
{
return array_slice($items, $start);
}
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- elseif ($return = $this->get_item_tags('', 'guid'))
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
{
$this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
}
- elseif ($return = $this->get_item_tags('', 'title'))
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))
{
$this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
}
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
}
- elseif ($return = $this->get_item_tags('', 'description'))
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
}
}
$categories[] =& new $this->feed->category_class($term, $scheme, $label);
}
- foreach ((array) $this->get_item_tags('', 'category') as $category)
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category)
{
- $categories[] =& new $this->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ // This is really the label, but keep this as the term also for BC.
+ // Label will also work on retrieving because that falls back to term.
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ if (isset($category['attribs']['']['domain']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = null;
+ }
+ $categories[] =& new $this->feed->category_class($term, $scheme, null);
}
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category)
{
}
}
- /**
- * @todo Atom inheritance (item author, source author, feed author)
- */
function get_authors()
{
$authors = array();
$authors[] =& new $this->feed->author_class($name, $url, $email);
}
}
- if ($author = $this->get_item_tags('', 'author'))
+ if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'author'))
{
$authors[] =& new $this->feed->author_class(null, null, $this->sanitize($author[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
}
{
$this->data['date']['raw'] = $return[0]['data'];
}
- elseif ($return = $this->get_item_tags('', 'pubDate'))
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate'))
{
$this->data['date']['raw'] = $return[0]['data'];
}
{
$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
}
- if ($links = $this->get_item_tags('', 'link'))
+ if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))
{
$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
}
- if ($links = $this->get_item_tags('', 'guid'))
+ if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid'))
{
- if (!isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) == 'true')
+ if (!isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) === 'true')
{
$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
}
$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
}
}
- elseif (substr($key, 0, 41) == SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
+ elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
{
$this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
}
$restriction_relationship = 'allow';
$restriction_type = null;
$restriction_value = 'itunes';
- if (isset($restriction['data']) && strtolower($restriction['data']) == 'yes')
+ if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes')
{
$restriction_relationship = 'deny';
}
$restriction_relationship = 'allow';
$restriction_type = null;
$restriction_value = 'itunes';
- if (isset($restriction['data']) && strtolower($restriction['data']) == 'yes')
+ if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes')
{
$restriction_relationship = 'deny';
}
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link)
{
- if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] == 'enclosure')
+ if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')
{
// Attributes
$bitrate = null;
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link)
{
- if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] == 'enclosure')
+ if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')
{
// Attributes
$bitrate = null;
}
}
- if ($enclosure = $this->get_item_tags('', 'enclosure'))
+ if ($enclosure = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'enclosure'))
{
if (isset($enclosure[0]['attribs']['']['url']))
{
}
}
- if (sizeof($this->data['enclosures']) == 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width))
+ if (sizeof($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width))
{
// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
$this->data['enclosures'][] =& new $this->feed->enclosure_class($url, $type, $length, $this->feed->javascript, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width);
{
if ($this->get_permalink() !== null)
{
- $return = $this->sanitize($item_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->get_permalink());
+ $return = $item_url . rawurlencode($this->get_permalink());
if ($title_url !== null && $this->get_title() !== null)
{
- $return .= $this->sanitize($title_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->get_title());
+ $return .= $title_url . rawurlencode($this->get_title());
}
if ($summary_url !== null && $this->get_description() !== null)
{
- $return .= $this->sanitize($summary_url, SIMPLEPIE_CONSTRUCT_IRI) . rawurlencode($this->get_description());
+ $return .= $summary_url . rawurlencode($this->get_description());
}
- return $return;
+ return $this->sanitize($return, SIMPLEPIE_CONSTRUCT_IRI);
}
else
{
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
}
- elseif ($return = $this->get_source_tags('', 'title'))
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
}
}
$categories[] =& new $this->item->feed->category_class($term, $scheme, $label);
}
- foreach ((array) $this->get_source_tags('', 'category') as $category)
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category)
{
- $categories[] =& new $this->item->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ // This is really the label, but keep this as the term also for BC.
+ // Label will also work on retrieving because that falls back to term.
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ if (isset($category['attribs']['']['domain']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = null;
+ }
+ $categories[] =& new $this->item->feed->category_class($term, $scheme, null);
}
foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category)
{
{
$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
}
- if ($links = $this->get_source_tags('', 'link'))
+ if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))
{
$this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
}
$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
}
}
- elseif (substr($key, 0, 41) == SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
+ elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
{
$this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
}
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
}
- elseif ($return = $this->get_source_tags('', 'description'))
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
}
{
return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0]));
}
- elseif ($return = $this->get_source_tags('', 'copyright'))
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
function get_language()
{
- if ($return = $this->get_source_tags('', 'language'))
+ if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language'))
{
return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
$mime = $mime[0];
// Process values for 'auto'
- if ($width == 'auto')
+ if ($width === 'auto')
{
- if ($mime == 'video')
+ if ($mime === 'video')
{
- if ($height == 'auto')
+ if ($height === 'auto')
{
$width = 480;
}
}
}
- if ($height == 'auto')
+ if ($height === 'auto')
{
- if ($mime == 'audio')
+ if ($mime === 'audio')
{
$height = 0;
}
- elseif ($mime == 'video')
+ elseif ($mime === 'video')
{
- if ($width == 'auto')
+ if ($width === 'auto')
{
if ($widescreen)
{
$height = 376;
}
}
- elseif ($mime == 'audio')
+ elseif ($mime === 'audio')
{
$height = 0;
}
// Set proper placeholder value
- if ($mime == 'audio')
+ if ($mime === 'audio')
{
$placeholder = $audio;
}
- elseif ($mime == 'video')
+ elseif ($mime === 'video')
{
$placeholder = $video;
}
}
// Odeo Feed MP3's
- if ($handler == 'odeo')
+ if ($handler === 'odeo')
{
if ($native)
{
}
// Flash
- elseif ($handler == 'flash')
+ elseif ($handler === 'flash')
{
if ($native)
{
// Flash Media Player file types.
// Preferred handler for MP3 file types.
- elseif ($handler == 'fmedia' || ($handler == 'mp3' && $mediaplayer != ''))
+ elseif ($handler === 'fmedia' || ($handler === 'mp3' && $mediaplayer !== ''))
{
$height += 20;
if ($native)
// QuickTime 7 file types. Need to test with QuickTime 6.
// Only handle MP3's if the Flash Media Player is not present.
- elseif ($handler == 'quicktime' || ($handler == 'mp3' && $mediaplayer == ''))
+ elseif ($handler === 'quicktime' || ($handler === 'mp3' && $mediaplayer === ''))
{
$height += 16;
if ($native)
{
- if ($placeholder != ""){
+ if ($placeholder !== '')
+ {
$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"" . $this->get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
}
- else {
+ else
+ {
$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" src=\"" . $this->get_link() . "\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
}
}
}
// Windows Media
- elseif ($handler == 'wmedia')
+ elseif ($handler === 'wmedia')
{
$height += 45;
if ($native)
function get_real_type($find_handler = false)
{
// If it's Odeo, let's get it out of the way.
- if (substr(strtolower($this->get_link()), 0, 15) == 'http://odeo.com')
+ if (substr(strtolower($this->get_link()), 0, 15) === 'http://odeo.com')
{
return 'odeo';
}
}
$this->headers = curl_exec($fp);
- if (curl_errno($fp) == 23 || curl_errno($fp) == 61)
+ if (curl_errno($fp) === 23 || curl_errno($fp) === 61)
{
curl_setopt($fp, CURLOPT_ENCODING, 'none');
$this->headers = curl_exec($fp);
$this->headers = $parser->headers;
$this->body = $parser->body;
$this->status_code = $parser->status_code;
- if (($this->status_code == 300 || $this->status_code == 301 || $this->status_code == 302 || $this->status_code == 303 || $this->status_code == 307 || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects)
+ if ((in_array($this->status_code, array(300, 301, 302, 303, 307)) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects)
{
$this->redirects++;
$location = SimplePie_Misc::absolutize_url($this->headers['location'], $url);
{
$this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_FSOCKOPEN;
$url_parts = parse_url($url);
- if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) == 'https')
+ if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https')
{
$url_parts['host'] = "ssl://$url_parts[host]";
$url_parts['port'] = 443;
$this->headers = $parser->headers;
$this->body = $parser->body;
$this->status_code = $parser->status_code;
- if (($this->status_code == 300 || $this->status_code == 301 || $this->status_code == 302 || $this->status_code == 303 || $this->status_code == 307 || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects)
+ if ((in_array($this->status_code, array(300, 301, 302, 303, 307)) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects)
{
$this->redirects++;
$location = SimplePie_Misc::absolutize_url($this->headers['location'], $url);
if ($this->flags & 8)
{
// Get the length of the filename
- $len = strspn($this->compressed_data, "\x00", $this->position);
+ $len = strcspn($this->compressed_data, "\x00", $this->position);
// Check the length of the string is still valid
$this->min_compressed_size += $len + 1;
if ($this->flags & 16)
{
// Get the length of the comment
- $len = strspn($this->compressed_data, "\x00", $this->position);
+ $len = strcspn($this->compressed_data, "\x00", $this->position);
// Check the length of the string is still valid
$this->min_compressed_size += $len + 1;
*/
function create($location, $filename, $extension)
{
- return new SimplePie_Cache_File($location, $filename, $extension);
+ $location_iri =& new SimplePie_IRI($location);
+ switch ($location_iri->get_scheme())
+ {
+ case 'mysql':
+ if (extension_loaded('mysql'))
+ {
+ return new SimplePie_Cache_MySQL($location_iri, $filename, $extension);
+ }
+ break;
+
+ default:
+ return new SimplePie_Cache_File($location, $filename, $extension);
+ }
}
}
function SimplePie_Cache_File($location, $filename, $extension)
{
$this->location = $location;
- $this->filename = rawurlencode($filename);
- $this->extension = rawurlencode($extension);
- $this->name = "$location/$this->filename.$this->extension";
+ $this->filename = $filename;
+ $this->extension = $extension;
+ $this->name = "$this->location/$this->filename.$this->extension";
}
function save($data)
}
}
-class SimplePie_Misc
+class SimplePie_Cache_DB
{
- function time_hms($seconds)
+ function prepare_simplepie_object_for_cache($data)
{
- $time = '';
+ $items = $data->get_items();
+ $items_by_id = array();
- $hours = floor($seconds / 3600);
- $remainder = $seconds % 3600;
- if ($hours > 0)
+ if (!empty($items))
{
- $time .= $hours.':';
+ foreach ($items as $item)
+ {
+ $items_by_id[$item->get_id()] = $item;
+ }
+
+ if (count($items_by_id) !== count($items))
+ {
+ $items_by_id = array();
+ foreach ($items as $item)
+ {
+ $items_by_id[$item->get_id(true)] = $item;
+ }
+ }
+
+ if (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]))
+ {
+ $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0];
+ }
+ elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]))
+ {
+ $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0];
+ }
+ elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]))
+ {
+ $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0];
+ }
+ elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0]))
+ {
+ $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0];
+ }
+ else
+ {
+ $channel = null;
+ }
+
+ if ($channel !== null)
+ {
+ if (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry']))
+ {
+ unset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry']);
+ }
+ if (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry']))
+ {
+ unset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry']);
+ }
+ if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item']))
+ {
+ unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item']);
+ }
+ if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item']))
+ {
+ unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item']);
+ }
+ if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item']))
+ {
+ unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item']);
+ }
+ }
+ if (isset($data->data['items']))
+ {
+ unset($data->data['items']);
+ }
+ if (isset($data->data['ordered_items']))
+ {
+ unset($data->data['ordered_items']);
+ }
}
+ return array(serialize($data->data), $items_by_id);
+ }
+}
- $minutes = floor($remainder / 60);
- $seconds = $remainder % 60;
- if ($minutes < 10 && $hours > 0)
+class SimplePie_Cache_MySQL extends SimplePie_Cache_DB
+{
+ var $mysql;
+ var $options;
+ var $id;
+
+ function SimplePie_Cache_MySQL($mysql_location, $name, $extension)
+ {
+ $host = $mysql_location->get_host();
+ if (SimplePie_Misc::stripos($host, 'unix(') === 0 && substr($host, -1) === ')')
{
- $minutes = '0' . $minutes;
+ $server = ':' . substr($host, 5, -1);
}
- if ($seconds < 10)
+ else
{
- $seconds = '0' . $seconds;
+ $server = $host;
+ if ($mysql_location->get_port() !== null)
+ {
+ $server .= ':' . $mysql_location->get_port();
+ }
}
- $time .= $minutes.':';
- $time .= $seconds;
+ if (strpos($mysql_location->get_userinfo(), ':') !== false)
+ {
+ list($username, $password) = explode(':', $mysql_location->get_userinfo(), 2);
+ }
+ else
+ {
+ $username = $mysql_location->get_userinfo();
+ $password = null;
+ }
- return $time;
+ if ($this->mysql = mysql_connect($server, $username, $password))
+ {
+ $this->id = $name . $extension;
+ $this->options = SimplePie_Misc::parse_str($mysql_location->get_query());
+ if (!isset($this->options['prefix'][0]))
+ {
+ $this->options['prefix'][0] = '';
+ }
+
+ if (mysql_select_db(ltrim($mysql_location->get_path(), '/'))
+ && mysql_query('SET NAMES utf8')
+ && ($query = mysql_unbuffered_query('SHOW TABLES')))
+ {
+ $db = array();
+ while ($row = mysql_fetch_row($query))
+ {
+ $db[] = $row[0];
+ }
+
+ if (!in_array($this->options['prefix'][0] . 'cache_data', $db))
+ {
+ if (!mysql_query('CREATE TABLE `' . $this->options['prefix'][0] . 'cache_data` (`id` TEXT CHARACTER SET utf8 NOT NULL, `items` SMALLINT NOT NULL DEFAULT 0, `data` BLOB NOT NULL, `mtime` INT UNSIGNED NOT NULL, UNIQUE (`id`(125)))'))
+ {
+ $this->mysql = null;
+ }
+ }
+
+ if (!in_array($this->options['prefix'][0] . 'items', $db))
+ {
+ if (!mysql_query('CREATE TABLE `' . $this->options['prefix'][0] . 'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` TEXT CHARACTER SET utf8 NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))'))
+ {
+ $this->mysql = null;
+ }
+ }
+ }
+ else
+ {
+ $this->mysql = null;
+ }
+ }
}
- function absolutize_url($relative, $base)
+ function save($data)
{
- if ($relative !== '')
+ if ($this->mysql)
{
- $relative = SimplePie_Misc::parse_url($relative);
- if ($relative['scheme'] !== '')
- {
- $target = $relative;
- }
- elseif ($base !== '')
+ $feed_id = "'" . mysql_real_escape_string($this->id) . "'";
+
+ if (is_a($data, 'SimplePie'))
{
- $base = SimplePie_Misc::parse_url($base);
- $target = SimplePie_Misc::parse_url('');
- if ($relative['authority'] !== '')
+ if (SIMPLEPIE_PHP5)
{
- $target = $relative;
- $target['scheme'] = $base['scheme'];
+ // This keyword needs to defy coding standards for PHP4 compatibility
+ $data = clone($data);
}
- else
+
+ $prepared = $this->prepare_simplepie_object_for_cache($data);
+
+ if ($query = mysql_query('SELECT `id` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = ' . $feed_id, $this->mysql))
{
- $target['scheme'] = $base['scheme'];
- $target['authority'] = $base['authority'];
- if ($relative['path'] !== '')
+ if (mysql_num_rows($query))
{
- if (strpos($relative['path'], '/') === 0)
- {
- $target['path'] = $relative['path'];
- }
- elseif ($base['authority'] !== '' && $base['path'] === '')
+ $items = count($prepared[1]);
+ if ($items)
{
- $target['path'] = '/' . $relative['path'];
+ $sql = 'UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `items` = ' . $items . ', `data` = \'' . mysql_real_escape_string($prepared[0]) . '\', `mtime` = ' . time() . ' WHERE `id` = ' . $feed_id;
}
- elseif (($last_segment = strrpos($base['path'], '/')) !== false)
+ else
{
- $target['path'] = substr($base['path'], 0, $last_segment + 1) . $relative['path'];
+ $sql = 'UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `data` = \'' . mysql_real_escape_string($prepared[0]) . '\', `mtime` = ' . time() . ' WHERE `id` = ' . $feed_id;
}
- else
+
+ if (!mysql_query($sql, $this->mysql))
{
- $target['path'] = $relative['path'];
+ return false;
}
- $target['query'] = $relative['query'];
}
- else
+ elseif (!mysql_query('INSERT INTO `' . $this->options['prefix'][0] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(' . $feed_id . ', ' . count($prepared[1]) . ', \'' . mysql_real_escape_string($prepared[0]) . '\', ' . time() . ')', $this->mysql))
+ {
+ return false;
+ }
+
+ $ids = array_keys($prepared[1]);
+ if (!empty($ids))
{
- $target['path'] = $base['path'];
- if ($relative['query'] !== '')
+ foreach ($ids as $id)
{
- $target['query'] = $relative['query'];
+ $database_ids[] = mysql_real_escape_string($id);
}
- elseif ($base['query'] !== '')
+
+ if ($query = mysql_unbuffered_query('SELECT `id` FROM `' . $this->options['prefix'][0] . 'items` WHERE `id` = \'' . implode('\' OR `id` = \'', $database_ids) . '\' AND `feed_id` = ' . $feed_id, $this->mysql))
{
- $target['query'] = $base['query'];
+ $existing_ids = array();
+ while ($row = mysql_fetch_row($query))
+ {
+ $existing_ids[] = $row[0];
+ }
+
+ $new_ids = array_diff($ids, $existing_ids);
+
+ foreach ($new_ids as $new_id)
+ {
+ if (!($date = $prepared[1][$new_id]->get_date('U')))
+ {
+ $date = time();
+ }
+
+ if (!mysql_query('INSERT INTO `' . $this->options['prefix'][0] . 'items` (`feed_id`, `id`, `data`, `posted`) VALUES(' . $feed_id . ', \'' . mysql_real_escape_string($new_id) . '\', \'' . mysql_real_escape_string(serialize($prepared[1][$new_id]->data)) . '\', ' . $date . ')', $this->mysql))
+ {
+ return false;
+ }
+ }
+ return true;
}
}
+ else
+ {
+ return true;
+ }
}
- $target['fragment'] = $relative['fragment'];
}
- else
+ elseif ($query = mysql_query('SELECT `id` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = ' . $feed_id, $this->mysql))
{
- // No base URL, just return the relative URL
- $target = $relative;
+ if (mysql_num_rows($query))
+ {
+ if (mysql_query('UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `items` = 0, `data` = \'' . mysql_real_escape_string(serialize($data)) . '\', `mtime` = ' . time() . ' WHERE `id` = ' . $feed_id, $this->mysql))
+ {
+ return true;
+ }
+ }
+ elseif (mysql_query('INSERT INTO `' . $this->options['prefix'][0] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(\'' . mysql_real_escape_string($this->id) . '\', 0, \'' . mysql_real_escape_string(serialize($data)) . '\', ' . time() . ')', $this->mysql))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ function load()
+ {
+ if ($this->mysql && ($query = mysql_query('SELECT `items`, `data` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && ($row = mysql_fetch_row($query)))
+ {
+ $data = unserialize($row[1]);
+
+ if (isset($this->options['items'][0]))
+ {
+ $items = (int) $this->options['items'][0];
+ }
+ else
+ {
+ $items = (int) $row[0];
+ }
+
+ if ($items !== 0)
+ {
+ if (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]))
+ {
+ $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0];
+ }
+ elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]))
+ {
+ $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0];
+ }
+ elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]))
+ {
+ $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0];
+ }
+ elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]))
+ {
+ $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0];
+ }
+ else
+ {
+ $feed = null;
+ }
+
+ if ($feed !== null)
+ {
+ $sql = 'SELECT `data` FROM `' . $this->options['prefix'][0] . 'items` WHERE `feed_id` = \'' . mysql_real_escape_string($this->id) . '\' ORDER BY `posted` DESC';
+ if ($items > 0)
+ {
+ $sql .= ' LIMIT ' . $items;
+ }
+
+ if ($query = mysql_unbuffered_query($sql, $this->mysql))
+ {
+ while ($row = mysql_fetch_row($query))
+ {
+ $feed['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry'][] = unserialize($row[0]);
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
}
- $return = SimplePie_Misc::compress_parse_url($target['scheme'], $target['authority'], $target['path'], $target['query'], $target['fragment']);
+ return $data;
+ }
+ return false;
+ }
+
+ function mtime()
+ {
+ if ($this->mysql && ($query = mysql_query('SELECT `mtime` FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && ($row = mysql_fetch_row($query)))
+ {
+ return $row[0];
}
else
{
- $return = $base;
+ return false;
}
- $return = SimplePie_Misc::normalize_url($return);
- return $return;
+ }
+
+ function touch()
+ {
+ if ($this->mysql && ($query = mysql_query('UPDATE `' . $this->options['prefix'][0] . 'cache_data` SET `mtime` = ' . time() . ' WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && mysql_affected_rows($this->mysql))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ function unlink()
+ {
+ if ($this->mysql && ($query = mysql_query('DELETE FROM `' . $this->options['prefix'][0] . 'cache_data` WHERE `id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)) && ($query2 = mysql_query('DELETE FROM `' . $this->options['prefix'][0] . 'items` WHERE `feed_id` = \'' . mysql_real_escape_string($this->id) . "'", $this->mysql)))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
+
+class SimplePie_Misc
+{
+ function time_hms($seconds)
+ {
+ $time = '';
+
+ $hours = floor($seconds / 3600);
+ $remainder = $seconds % 3600;
+ if ($hours > 0)
+ {
+ $time .= $hours.':';
+ }
+
+ $minutes = floor($remainder / 60);
+ $seconds = $remainder % 60;
+ if ($minutes < 10 && $hours > 0)
+ {
+ $minutes = '0' . $minutes;
+ }
+ if ($seconds < 10)
+ {
+ $seconds = '0' . $seconds;
+ }
+
+ $time .= $minutes.':';
+ $time .= $seconds;
+
+ return $time;
+ }
+
+ function absolutize_url($relative, $base)
+ {
+ $iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative);
+ return $iri->get_iri();
}
function remove_dot_segments($input)
{
$output = '';
- while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input == '.' || $input == '..')
+ while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..')
{
// A: If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise,
if (strpos($input, '../') === 0)
{
$input = substr_replace($input, '/', 0, 3);
}
- elseif ($input == '/.')
+ elseif ($input === '/.')
{
$input = '/';
}
$input = substr_replace($input, '/', 0, 4);
$output = substr_replace($output, '', strrpos($output, '/'));
}
- elseif ($input == '/..')
+ elseif ($input === '/..')
{
$input = '/';
$output = substr_replace($output, '', strrpos($output, '/'));
}
// D: if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise,
- elseif ($input == '.' || $input == '..')
+ elseif ($input === '.' || $input === '..')
{
$input = '';
}
{
for ($j = 0, $total_attribs = count($attribs); $j < $total_attribs; $j++)
{
- if (count($attribs[$j]) == 2)
+ if (count($attribs[$j]) === 2)
{
$attribs[$j][2] = $attribs[$j][1];
}
function error($message, $level, $file, $line)
{
- switch ($level)
+ if ((ini_get('error_reporting') & $level) > 0)
{
- case E_USER_ERROR:
- $note = 'PHP Error';
- break;
- case E_USER_WARNING:
- $note = 'PHP Warning';
- break;
- case E_USER_NOTICE:
- $note = 'PHP Notice';
- break;
- default:
- $note = 'Unknown Error';
- break;
+ switch ($level)
+ {
+ case E_USER_ERROR:
+ $note = 'PHP Error';
+ break;
+ case E_USER_WARNING:
+ $note = 'PHP Warning';
+ break;
+ case E_USER_NOTICE:
+ $note = 'PHP Notice';
+ break;
+ default:
+ $note = 'Unknown Error';
+ break;
+ }
+ error_log("$note: $message in $file on line $line", 0);
}
- error_log("$note: $message in $file on line $line", 0);
return $message;
}
{
$url = SimplePie_Misc::normalize_url($url);
$parsed = SimplePie_Misc::parse_url($url);
- if ($parsed['scheme'] !== '' && $parsed['scheme'] != 'http' && $parsed['scheme'] != 'https')
+ if ($parsed['scheme'] !== '' && $parsed['scheme'] !== 'http' && $parsed['scheme'] !== 'https')
{
return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['authority'], $parsed['path'], $parsed['query'], $parsed['fragment']), $http);
}
return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['path'], '', $parsed['query'], $parsed['fragment']), $http);
}
- if ($http == 2 && $parsed['scheme'] !== '')
+ if ($http === 2 && $parsed['scheme'] !== '')
{
return "feed:$url";
}
- elseif ($http == 3 && strtolower($parsed['scheme']) == 'http')
+ elseif ($http === 3 && strtolower($parsed['scheme']) === 'http')
{
return substr_replace($url, 'podcast', 0, 4);
}
- elseif ($http == 4 && strtolower($parsed['scheme']) == 'http')
+ elseif ($http === 4 && strtolower($parsed['scheme']) === 'http')
{
return substr_replace($url, 'itpc', 0, 4);
}
function parse_url($url)
{
- preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $url, $match);
- for ($i = count($match); $i <= 9; $i++)
- {
- $match[$i] = '';
- }
- return array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]);
+ $iri =& new SimplePie_IRI($url);
+ return array(
+ 'scheme' => (string) $iri->get_scheme(),
+ 'authority' => (string) $iri->get_authority(),
+ 'path' => (string) $iri->get_path(),
+ 'query' => (string) $iri->get_query(),
+ 'fragment' => (string) $iri->get_fragment()
+ );
}
function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '')
{
- $return = '';
- if ($scheme !== '')
- {
- $return .= "$scheme:";
- }
- if ($authority !== '')
- {
- $return .= "//$authority";
- }
- if ($path !== '')
- {
- $return .= $path;
- }
- if ($query !== '')
- {
- $return .= "?$query";
- }
- if ($fragment !== '')
- {
- $return .= "#$fragment";
- }
- return $return;
+ $iri =& new SimplePie_IRI('');
+ $iri->set_scheme($scheme);
+ $iri->set_authority($authority);
+ $iri->set_path($path);
+ $iri->set_query($query);
+ $iri->set_fragment($fragment);
+ return $iri->get_iri();
}
function normalize_url($url)
{
- $url = preg_replace_callback('/%([0-9A-Fa-f]{2})/', array('SimplePie_Misc', 'percent_encoding_normalization'), $url);
- $url = SimplePie_Misc::parse_url($url);
- $url['scheme'] = strtolower($url['scheme']);
- if ($url['authority'] !== '')
- {
- $url['authority'] = strtolower($url['authority']);
- $url['path'] = SimplePie_Misc::remove_dot_segments($url['path']);
- }
- return SimplePie_Misc::compress_parse_url($url['scheme'], $url['authority'], $url['path'], $url['query'], $url['fragment']);
+ $iri =& new SimplePie_IRI($url);
+ return $iri->get_iri();
}
function percent_encoding_normalization($match)
{
$integer = hexdec($match[1]);
- if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer == 0x2D || $integer == 0x2E || $integer == 0x5F || $integer == 0x7E)
+ if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E)
{
return chr($integer);
}
{
return SimplePie_Misc::windows_1252_to_utf8($data);
}
- // This is second, as behaviour of this varies only with PHP version
- elseif (function_exists('mb_convert_encoding') && ($return = @mb_convert_encoding($data, $output, $input)))
+ // This is second, as behaviour of this varies only with PHP version (the middle part of this expression checks the encoding is supported).
+ elseif (function_exists('mb_convert_encoding') && @mb_convert_encoding("\x80", 'UTF-16BE', $input) !== "\x00\x80" && ($return = @mb_convert_encoding($data, $output, $input)))
{
return $return;
}
function encoding($charset)
{
- /* Character sets are case-insensitive, and also need some further
- normalization in the real world (though we'll return them in the form given
- in their registration). */
- switch (strtolower(preg_replace('/[\x09-\x0D\x20-\x2F\x3A-\x40\x5B-\x60\x7B-\x7E]/', '', $charset)))
+ // Normalization from UTS #22
+ switch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset)))
{
case 'adobestandardencoding':
case 'csadobestandardencoding':
return 'Adobe-Symbol-Encoding';
case 'ami1251':
- case 'ami1251':
- case 'amiga1251':
case 'amiga1251':
return 'Amiga-1251';
case 'arabic7':
case 'asmo449':
case 'csiso89asmo449':
- case 'isoir89':
case 'iso9036':
+ case 'isoir89':
return 'ASMO_449';
case 'big5':
case 'bs4730':
case 'csiso4unitedkingdom':
case 'gb':
- case 'isoir4':
case 'iso646gb':
+ case 'isoir4':
case 'uk':
return 'BS_4730';
case 'csa71':
case 'csaz243419851':
case 'csiso121canadian1':
- case 'isoir121':
case 'iso646ca':
+ case 'isoir121':
return 'CSA_Z243.4-1985-1';
case 'csa72':
case 'csaz243419852':
case 'csiso122canadian2':
- case 'isoir122':
case 'iso646ca2':
+ case 'isoir122':
return 'CSA_Z243.4-1985-2';
case 'csaz24341985gr':
case 'csiso21german':
case 'de':
case 'din66003':
- case 'isoir21':
case 'iso646de':
+ case 'isoir21':
return 'DIN_66003';
case 'csdkus':
case 'csiso646danish':
case 'dk':
case 'ds2089':
- case 'ds2089':
case 'iso646dk':
return 'DS_2089';
case 'csiso17spanish':
case 'es':
- case 'isoir17':
case 'iso646es':
+ case 'isoir17':
return 'ES';
case 'csiso85spanish2':
case 'es2':
- case 'isoir85':
case 'iso646es2':
+ case 'isoir85':
return 'ES2';
case 'cseucfixwidjapanese':
case 'gb18030':
return 'GB18030';
+ case 'chinese':
case 'cp936':
- case 'gbk':
- case 'ms936':
- case 'windows936':
case 'csgb2312':
- case 'gb2312':
- case 'chinese':
case 'csiso58gb231280':
+ case 'gb2312':
case 'gb231280':
+ case 'gbk':
case 'isoir58':
+ case 'ms936':
+ case 'windows936':
return 'GBK';
case 'cn':
case 'csiso57gb1988':
case 'gb198880':
- case 'isoir57':
case 'iso646cn':
+ case 'isoir57':
return 'GB_1988-80';
case 'csiso153gost1976874':
case 'ibmthai':
return 'IBM-Thai';
- case 'ccsid00858':
- case 'cp00858':
- case 'ibm00858':
+ case 'ccsid858':
+ case 'cp858':
+ case 'ibm858':
case 'pcmultilingual850euro':
return 'IBM00858';
- case 'ccsid00924':
- case 'cp00924':
+ case 'ccsid924':
+ case 'cp924':
case 'ebcdiclatin9euro':
- case 'ibm00924':
+ case 'ibm924':
return 'IBM00924';
- case 'ccsid01140':
- case 'cp01140':
+ case 'ccsid1140':
+ case 'cp1140':
case 'ebcdicus37euro':
- case 'ibm01140':
+ case 'ibm1140':
return 'IBM01140';
- case 'ccsid01141':
- case 'cp01141':
+ case 'ccsid1141':
+ case 'cp1141':
case 'ebcdicde273euro':
- case 'ibm01141':
+ case 'ibm1141':
return 'IBM01141';
- case 'ccsid01142':
- case 'cp01142':
+ case 'ccsid1142':
+ case 'cp1142':
case 'ebcdicdk277euro':
case 'ebcdicno277euro':
- case 'ibm01142':
+ case 'ibm1142':
return 'IBM01142';
- case 'ccsid01143':
- case 'cp01143':
+ case 'ccsid1143':
+ case 'cp1143':
case 'ebcdicfi278euro':
case 'ebcdicse278euro':
- case 'ibm01143':
+ case 'ibm1143':
return 'IBM01143';
- case 'ccsid01144':
- case 'cp01144':
+ case 'ccsid1144':
+ case 'cp1144':
case 'ebcdicit280euro':
- case 'ibm01144':
+ case 'ibm1144':
return 'IBM01144';
- case 'ccsid01145':
- case 'cp01145':
+ case 'ccsid1145':
+ case 'cp1145':
case 'ebcdices284euro':
- case 'ibm01145':
+ case 'ibm1145':
return 'IBM01145';
- case 'ccsid01146':
- case 'cp01146':
+ case 'ccsid1146':
+ case 'cp1146':
case 'ebcdicgb285euro':
- case 'ibm01146':
+ case 'ibm1146':
return 'IBM01146';
- case 'ccsid01147':
- case 'cp01147':
+ case 'ccsid1147':
+ case 'cp1147':
case 'ebcdicfr297euro':
- case 'ibm01147':
+ case 'ibm1147':
return 'IBM01147';
- case 'ccsid01148':
- case 'cp01148':
+ case 'ccsid1148':
+ case 'cp1148':
case 'ebcdicinternational500euro':
- case 'ibm01148':
+ case 'ibm1148':
return 'IBM01148';
- case 'ccsid01149':
- case 'cp01149':
+ case 'ccsid1149':
+ case 'cp1149':
case 'ebcdicis871euro':
- case 'ibm01149':
+ case 'ibm1149':
return 'IBM01149';
- case 'cp037':
- case 'csibm037':
+ case 'cp37':
+ case 'csibm37':
case 'ebcdiccpca':
case 'ebcdiccpnl':
case 'ebcdiccpus':
case 'ebcdiccpwt':
- case 'ibm037':
+ case 'ibm37':
return 'IBM037';
- case 'cp038':
- case 'csibm038':
+ case 'cp38':
+ case 'csibm38':
case 'ebcdicint':
- case 'ibm038':
+ case 'ibm38':
return 'IBM038';
case 'cp273':
return 'IBM860';
case '861':
- case 'cpis':
case 'cp861':
+ case 'cpis':
case 'csibm861':
case 'ibm861':
return 'IBM861';
case 'ibm866':
return 'IBM866';
- case 'cpar':
case 'cp868':
+ case 'cpar':
case 'csibm868':
case 'ibm868':
return 'IBM868';
case '869':
- case 'cpgr':
case 'cp869':
+ case 'cpgr':
case 'csibm869':
case 'ibm869':
return 'IBM869';
case 'ibm1026':
return 'IBM1026';
- case 'ibm1047':
case 'ibm1047':
return 'IBM1047';
case 'csisolatin2':
case 'iso88592':
- case 'isoir101':
- case 'iso88592':
case 'iso885921987':
+ case 'isoir101':
case 'l2':
case 'latin2':
return 'ISO-8859-2';
case 'csisolatin3':
case 'iso88593':
- case 'isoir109':
- case 'iso88593':
case 'iso885931988':
+ case 'isoir109':
case 'l3':
case 'latin3':
return 'ISO-8859-3';
case 'csisolatin4':
case 'iso88594':
- case 'isoir110':
- case 'iso88594':
case 'iso885941988':
+ case 'isoir110':
case 'l4':
case 'latin4':
return 'ISO-8859-4';
case 'csisolatincyrillic':
case 'cyrillic':
case 'iso88595':
- case 'isoir144':
- case 'iso88595':
case 'iso885951988':
+ case 'isoir144':
return 'ISO-8859-5';
case 'arabic':
case 'csisolatinarabic':
case 'ecma114':
case 'iso88596':
- case 'isoir127':
- case 'iso88596':
case 'iso885961987':
+ case 'isoir127':
return 'ISO-8859-6';
case 'csiso88596e':
- case 'iso88596e':
case 'iso88596e':
return 'ISO-8859-6-E';
case 'csiso88596i':
- case 'iso88596i':
case 'iso88596i':
return 'ISO-8859-6-I';
case 'greek':
case 'greek8':
case 'iso88597':
- case 'isoir126':
- case 'iso88597':
case 'iso885971987':
+ case 'isoir126':
return 'ISO-8859-7';
case 'csisolatinhebrew':
case 'hebrew':
case 'iso88598':
- case 'isoir138':
- case 'iso88598':
case 'iso885981988':
+ case 'isoir138':
return 'ISO-8859-8';
case 'csiso88598e':
- case 'iso88598e':
case 'iso88598e':
return 'ISO-8859-8-E';
case 'csiso88598i':
- case 'iso88598i':
case 'iso88598i':
return 'ISO-8859-8-I';
case 'csisolatin6':
case 'iso885910':
- case 'isoir157':
case 'iso8859101992':
+ case 'isoir157':
case 'l6':
case 'latin6':
return 'ISO-8859-10';
return 'ISO-8859-13';
case 'iso885914':
+ case 'iso8859141998':
case 'isoceltic':
case 'isoir199':
- case 'iso885914':
- case 'iso8859141998':
case 'l8':
case 'latin8':
return 'ISO-8859-14';
- case 'iso885915':
case 'iso885915':
case 'latin9':
return 'ISO-8859-15';
- case 'iso885916':
- case 'isoir226':
case 'iso885916':
case 'iso8859162001':
+ case 'isoir226':
case 'l10':
case 'latin10':
return 'ISO-8859-16';
case 'csiso115481':
case 'iso115481':
- case 'iso115481':
case 'isotr115481':
return 'ISO-11548-1';
case 'csiso2intlrefversion':
case 'irv':
- case 'isoir2':
case 'iso646irv1983':
+ case 'isoir2':
return 'ISO_646.irv:1983';
case 'csiso2033':
case 'e13b':
- case 'isoir98':
case 'iso20331983':
+ case 'isoir98':
return 'ISO_2033-1983';
case 'csiso5427cyrillic':
- case 'isoir37':
case 'iso5427':
+ case 'isoir37':
return 'ISO_5427';
- case 'isoir54':
case 'iso5427cyrillic1981':
case 'iso54271981':
+ case 'isoir54':
return 'ISO_5427:1981';
case 'csiso5428greek':
- case 'isoir55':
case 'iso54281980':
+ case 'isoir55':
return 'ISO_5428:1980';
case 'csiso6937add':
- case 'isoir152':
case 'iso6937225':
+ case 'isoir152':
return 'ISO_6937-2-25';
case 'csisotextcomm':
- case 'isoir142':
case 'iso69372add':
+ case 'isoir142':
return 'ISO_6937-2-add';
case 'csiso8859supp':
- case 'isoir154':
case 'iso8859supp':
+ case 'isoir154':
case 'latin125':
return 'ISO_8859-supp';
case 'csiso10367box':
- case 'isoir155':
case 'iso10367box':
+ case 'isoir155':
return 'ISO_10367-box';
case 'csiso15italian':
- case 'isoir15':
case 'iso646it':
+ case 'isoir15':
case 'it':
return 'IT';
case 'jisc62201969':
case 'jisc62201969jp':
case 'katakana':
- case 'x02017':
+ case 'x2017':
return 'JIS_C6220-1969-jp';
case 'csiso14jisc6220ro':
- case 'isoir14':
case 'iso646jp':
+ case 'isoir14':
case 'jisc62201969ro':
case 'jp':
return 'JIS_C6220-1969-ro';
case 'jisc62261978':
return 'JIS_C6226-1978';
- case 'csiso87jisx0208':
+ case 'csiso87jisx208':
case 'isoir87':
case 'jisc62261983':
- case 'jisx02081983':
- case 'x0208':
+ case 'jisx2081983':
+ case 'x208':
return 'JIS_C6226-1983';
case 'csiso91jisc62291984a':
return 'JIS_C6229-1984-a';
case 'csiso92jisc62991984b':
- case 'isoir92':
case 'iso646jpocrb':
+ case 'isoir92':
case 'jisc62291984b':
case 'jpocrb':
return 'JIS_C6229-1984-b';
return 'JIS_Encoding';
case 'cshalfwidthkatakana':
- case 'jisx0201':
- case 'x0201':
+ case 'jisx201':
+ case 'x201':
return 'JIS_X0201';
- case 'csiso159jisx02121990':
+ case 'csiso159jisx2121990':
case 'isoir159':
- case 'jisx02121990':
- case 'x0212':
+ case 'jisx2121990':
+ case 'x212':
return 'JIS_X0212-1990';
case 'csiso141jusib1002':
- case 'isoir141':
case 'iso646yu':
+ case 'isoir141':
case 'js':
case 'jusib1002':
case 'yu':
case 'csiso86hungarian':
case 'hu':
- case 'isoir86':
case 'iso646hu':
+ case 'isoir86':
case 'msz77953':
return 'MSZ_7795.3';
case 'csiso151cuba':
case 'cuba':
- case 'isoir151':
case 'iso646cu':
- case 'ncnc001081':
+ case 'isoir151':
+ case 'ncnc1081':
return 'NC_NC00-10:81';
case 'csiso69french':
case 'fr':
- case 'isoir69':
case 'iso646fr':
+ case 'isoir69':
case 'nfz62010':
return 'NF_Z_62-010';
case 'csiso25french':
- case 'isoir25':
case 'iso646fr1':
+ case 'isoir25':
case 'nfz620101973':
return 'NF_Z_62-010_(1973)';
case 'csiso60danishnorwegian':
case 'csiso60norwegian1':
- case 'isoir60':
case 'iso646no':
+ case 'isoir60':
case 'no':
case 'ns45511':
return 'NS_4551-1';
case 'csiso61norwegian2':
- case 'isoir61':
case 'iso646no2':
+ case 'isoir61':
case 'no2':
case 'ns45512':
return 'NS_4551-2';
- case 'osdebcdicdf03irv':
+ case 'osdebcdicdf3irv':
return 'OSD_EBCDIC_DF03_IRV';
- case 'osdebcdicdf041':
+ case 'osdebcdicdf41':
return 'OSD_EBCDIC_DF04_1';
- case 'osdebcdicdf0415':
+ case 'osdebcdicdf415':
return 'OSD_EBCDIC_DF04_15';
case 'cspc8danishnorwegian':
return 'PC8-Turkish';
case 'csiso16portuguese':
- case 'isoir16':
case 'iso646pt':
+ case 'isoir16':
case 'pt':
return 'PT';
case 'csiso84portuguese2':
- case 'isoir84':
case 'iso646pt2':
+ case 'isoir84':
case 'pt2':
return 'PT2';
case 'csiso10swedish':
case 'fi':
- case 'isoir10':
case 'iso646fi':
case 'iso646se':
+ case 'isoir10':
case 'se':
case 'sen850200b':
return 'SEN_850200_B';
case 'csiso11swedishfornames':
- case 'isoir11':
case 'iso646se2':
+ case 'isoir11':
case 'se2':
case 'sen850200c':
return 'SEN_850200_C';
case 'cp367':
case 'csascii':
case 'ibm367':
- case 'isoir6':
- case 'iso646us':
case 'iso646irv1991':
+ case 'iso646us':
+ case 'isoir6':
case 'us':
case 'usascii':
return 'US-ASCII';
case 'iso885911':
case 'tis620':
- return 'Windows-874';
+ return 'windows-874';
case 'cseuckr':
- case 'euckr':
- case 'windows949':
case 'csksc56011987':
+ case 'euckr':
case 'isoir149':
case 'korean':
case 'ksc5601':
case 'ksc56011987':
case 'ksc56011989':
- return 'Windows-949';
+ case 'windows949':
+ return 'windows-949';
case 'windows1250':
return 'windows-1250';
case 'csisolatin1':
case 'ibm819':
case 'iso88591':
- case 'isoir100':
case 'iso885911987':
+ case 'isoir100':
case 'l1':
case 'latin1':
- case 'windows1252':
- return 'Windows-1252';
-
case 'windows1252':
return 'windows-1252';
case 'csisolatin5':
case 'iso88599':
- case 'isoir148':
case 'iso885991989':
+ case 'isoir148':
case 'l5':
case 'latin5':
- case 'windows1254':
- return 'Windows-1254';
-
case 'windows1254':
return 'windows-1254';
{
$curl = $curl['version'];
}
- elseif (substr($curl, 0, 5) == 'curl/')
+ elseif (substr($curl, 0, 5) === 'curl/')
{
$curl = substr($curl, 5, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 5));
}
- elseif (substr($curl, 0, 8) == 'libcurl/')
+ elseif (substr($curl, 0, 8) === 'libcurl/')
{
$curl = substr($curl, 8, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 8));
}
function is_subclass_of($class1, $class2)
{
- if (func_num_args() != 2)
+ if (func_num_args() !== 2)
{
trigger_error('Wrong parameter count for SimplePie_Misc::is_subclass_of()', E_USER_WARNING);
}
$class2 = strtolower($class2);
while ($class1 = strtolower(get_parent_class($class1)))
{
- if ($class1 == $class2)
+ if ($class1 === $class2)
{
return true;
}
function atom_03_construct_type($attribs)
{
- if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) == 'base64'))
+ if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64'))
{
$mode = SIMPLEPIE_CONSTRUCT_BASE64;
}
case 'xhtml':
return SIMPLEPIE_CONSTRUCT_XHTML;
}
- if (in_array(substr($type, -4), array('+xml', '/xml')) || substr($type, 0, 5) == 'text/')
+ if (in_array(substr($type, -4), array('+xml', '/xml')) || substr($type, 0, 5) === 'text/')
{
return SIMPLEPIE_CONSTRUCT_NONE;
}
}
return $encoding;
}
+
+ function output_javascript()
+ {
+ if (function_exists('ob_gzhandler'))
+ {
+ ob_start('ob_gzhandler');
+ }
+ header('Content-type: text/javascript; charset: UTF-8');
+ header('Cache-Control: must-revalidate');
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days
+ ?>
+function embed_odeo(link) {
+ document.writeln('<embed src="http://odeo.com/flash/audio_player_fullsize.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="440" height="80" wmode="transparent" allowScriptAccess="any" flashvars="valid_sample_rate=true&external_url='+link+'"></embed>');
+}
+
+function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) {
+ if (placeholder != '') {
+ document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" href="'+link+'" src="'+placeholder+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="false" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
+ }
+ else {
+ document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" src="'+link+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="true" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
+ }
+}
+
+function embed_flash(bgcolor, width, height, link, loop, type) {
+ document.writeln('<embed src="'+link+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="'+type+'" quality="high" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" loop="'+loop+'"></embed>');
+}
+
+function embed_flv(width, height, link, placeholder, loop, player) {
+ document.writeln('<embed src="'+player+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="'+width+'" height="'+height+'" wmode="transparent" flashvars="file='+link+'&autostart=false&repeat='+loop+'&showdigits=true&showfsbutton=false"></embed>');
+}
+
+function embed_wmedia(width, height, link) {
+ document.writeln('<embed type="application/x-mplayer2" src="'+link+'" autosize="1" width="'+width+'" height="'+height+'" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="0"></embed>');
+}
+ <?php
+ }
}
/**
var $consumed = '';
/**
- * Position of the current byte being parsed
+ * Position of the current byte being parsed
+ *
+ * @access private
+ * @var int
+ */
+ var $position = 0;
+
+ /**
+ * Create an instance of the class with the input data
+ *
+ * @access public
+ * @param string $data Input data
+ */
+ function SimplePie_Decode_HTML_Entities($data)
+ {
+ $this->data = $data;
+ }
+
+ /**
+ * Parse the input data
+ *
+ * @access public
+ * @return string Output data
+ */
+ function parse()
+ {
+ while (($this->position = strpos($this->data, '&', $this->position)) !== false)
+ {
+ $this->consume();
+ $this->entity();
+ $this->consumed = '';
+ }
+ return $this->data;
+ }
+
+ /**
+ * Consume the next byte
+ *
+ * @access private
+ * @return mixed The next byte, or false, if there is no more data
+ */
+ function consume()
+ {
+ if (isset($this->data[$this->position]))
+ {
+ $this->consumed .= $this->data[$this->position];
+ return $this->data[$this->position++];
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Consume a range of characters
+ *
+ * @access private
+ * @param string $chars Characters to consume
+ * @return mixed A series of characters that match the range, or false
+ */
+ function consume_range($chars)
+ {
+ if ($len = strspn($this->data, $chars, $this->position))
+ {
+ $data = substr($this->data, $this->position, $len);
+ $this->consumed .= $data;
+ $this->position += $len;
+ return $data;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Unconsume one byte
+ *
+ * @access private
+ */
+ function unconsume()
+ {
+ $this->consumed = substr($this->consumed, 0, -1);
+ $this->position--;
+ }
+
+ /**
+ * Decode an entity
+ *
+ * @access private
+ */
+ function entity()
+ {
+ switch ($this->consume())
+ {
+ case "\x09":
+ case "\x0A":
+ case "\x0B":
+ case "\x0B":
+ case "\x0C":
+ case "\x20":
+ case "\x3C":
+ case "\x26":
+ case false:
+ break;
+
+ case "\x23":
+ switch ($this->consume())
+ {
+ case "\x78":
+ case "\x58":
+ $range = '0123456789ABCDEFabcdef';
+ $hex = true;
+ break;
+
+ default:
+ $range = '0123456789';
+ $hex = false;
+ $this->unconsume();
+ break;
+ }
+
+ if ($codepoint = $this->consume_range($range))
+ {
+ static $windows_1252_specials = array(0x0D => "\x0A", 0x80 => "\xE2\x82\xAC", 0x81 => "\xEF\xBF\xBD", 0x82 => "\xE2\x80\x9A", 0x83 => "\xC6\x92", 0x84 => "\xE2\x80\x9E", 0x85 => "\xE2\x80\xA6", 0x86 => "\xE2\x80\xA0", 0x87 => "\xE2\x80\xA1", 0x88 => "\xCB\x86", 0x89 => "\xE2\x80\xB0", 0x8A => "\xC5\xA0", 0x8B => "\xE2\x80\xB9", 0x8C => "\xC5\x92", 0x8D => "\xEF\xBF\xBD", 0x8E => "\xC5\xBD", 0x8F => "\xEF\xBF\xBD", 0x90 => "\xEF\xBF\xBD", 0x91 => "\xE2\x80\x98", 0x92 => "\xE2\x80\x99", 0x93 => "\xE2\x80\x9C", 0x94 => "\xE2\x80\x9D", 0x95 => "\xE2\x80\xA2", 0x96 => "\xE2\x80\x93", 0x97 => "\xE2\x80\x94", 0x98 => "\xCB\x9C", 0x99 => "\xE2\x84\xA2", 0x9A => "\xC5\xA1", 0x9B => "\xE2\x80\xBA", 0x9C => "\xC5\x93", 0x9D => "\xEF\xBF\xBD", 0x9E => "\xC5\xBE", 0x9F => "\xC5\xB8");
+
+ if ($hex)
+ {
+ $codepoint = hexdec($codepoint);
+ }
+ else
+ {
+ $codepoint = intval($codepoint);
+ }
+
+ if (isset($windows_1252_specials[$codepoint]))
+ {
+ $replacement = $windows_1252_specials[$codepoint];
+ }
+ else
+ {
+ $replacement = SimplePie_Misc::codepoint_to_utf8($codepoint);
+ }
+
+ if (!in_array($this->consume(), array(';', false), true))
+ {
+ $this->unconsume();
+ }
+
+ $consumed_length = strlen($this->consumed);
+ $this->data = substr_replace($this->data, $replacement, $this->position - $consumed_length, $consumed_length);
+ $this->position += strlen($replacement) - $consumed_length;
+ }
+ break;
+
+ default:
+ static $entities = array('Aacute' => "\xC3\x81", 'aacute' => "\xC3\xA1", 'Aacute;' => "\xC3\x81", 'aacute;' => "\xC3\xA1", 'Acirc' => "\xC3\x82", 'acirc' => "\xC3\xA2", 'Acirc;' => "\xC3\x82", 'acirc;' => "\xC3\xA2", 'acute' => "\xC2\xB4", 'acute;' => "\xC2\xB4", 'AElig' => "\xC3\x86", 'aelig' => "\xC3\xA6", 'AElig;' => "\xC3\x86", 'aelig;' => "\xC3\xA6", 'Agrave' => "\xC3\x80", 'agrave' => "\xC3\xA0", 'Agrave;' => "\xC3\x80", 'agrave;' => "\xC3\xA0", 'alefsym;' => "\xE2\x84\xB5", 'Alpha;' => "\xCE\x91", 'alpha;' => "\xCE\xB1", 'AMP' => "\x26", 'amp' => "\x26", 'AMP;' => "\x26", 'amp;' => "\x26", 'and;' => "\xE2\x88\xA7", 'ang;' => "\xE2\x88\xA0", 'apos;' => "\x27", 'Aring' => "\xC3\x85", 'aring' => "\xC3\xA5", 'Aring;' => "\xC3\x85", 'aring;' => "\xC3\xA5", 'asymp;' => "\xE2\x89\x88", 'Atilde' => "\xC3\x83", 'atilde' => "\xC3\xA3", 'Atilde;' => "\xC3\x83", 'atilde;' => "\xC3\xA3", 'Auml' => "\xC3\x84", 'auml' => "\xC3\xA4", 'Auml;' => "\xC3\x84", 'auml;' => "\xC3\xA4", 'bdquo;' => "\xE2\x80\x9E", 'Beta;' => "\xCE\x92", 'beta;' => "\xCE\xB2", 'brvbar' => "\xC2\xA6", 'brvbar;' => "\xC2\xA6", 'bull;' => "\xE2\x80\xA2", 'cap;' => "\xE2\x88\xA9", 'Ccedil' => "\xC3\x87", 'ccedil' => "\xC3\xA7", 'Ccedil;' => "\xC3\x87", 'ccedil;' => "\xC3\xA7", 'cedil' => "\xC2\xB8", 'cedil;' => "\xC2\xB8", 'cent' => "\xC2\xA2", 'cent;' => "\xC2\xA2", 'Chi;' => "\xCE\xA7", 'chi;' => "\xCF\x87", 'circ;' => "\xCB\x86", 'clubs;' => "\xE2\x99\xA3", 'cong;' => "\xE2\x89\x85", 'COPY' => "\xC2\xA9", 'copy' => "\xC2\xA9", 'COPY;' => "\xC2\xA9", 'copy;' => "\xC2\xA9", 'crarr;' => "\xE2\x86\xB5", 'cup;' => "\xE2\x88\xAA", 'curren' => "\xC2\xA4", 'curren;' => "\xC2\xA4", 'Dagger;' => "\xE2\x80\xA1", 'dagger;' => "\xE2\x80\xA0", 'dArr;' => "\xE2\x87\x93", 'darr;' => "\xE2\x86\x93", 'deg' => "\xC2\xB0", 'deg;' => "\xC2\xB0", 'Delta;' => "\xCE\x94", 'delta;' => "\xCE\xB4", 'diams;' => "\xE2\x99\xA6", 'divide' => "\xC3\xB7", 'divide;' => "\xC3\xB7", 'Eacute' => "\xC3\x89", 'eacute' => "\xC3\xA9", 'Eacute;' => "\xC3\x89", 'eacute;' => "\xC3\xA9", 'Ecirc' => "\xC3\x8A", 'ecirc' => "\xC3\xAA", 'Ecirc;' => "\xC3\x8A", 'ecirc;' => "\xC3\xAA", 'Egrave' => "\xC3\x88", 'egrave' => "\xC3\xA8", 'Egrave;' => "\xC3\x88", 'egrave;' => "\xC3\xA8", 'empty;' => "\xE2\x88\x85", 'emsp;' => "\xE2\x80\x83", 'ensp;' => "\xE2\x80\x82", 'Epsilon;' => "\xCE\x95", 'epsilon;' => "\xCE\xB5", 'equiv;' => "\xE2\x89\xA1", 'Eta;' => "\xCE\x97", 'eta;' => "\xCE\xB7", 'ETH' => "\xC3\x90", 'eth' => "\xC3\xB0", 'ETH;' => "\xC3\x90", 'eth;' => "\xC3\xB0", 'Euml' => "\xC3\x8B", 'euml' => "\xC3\xAB", 'Euml;' => "\xC3\x8B", 'euml;' => "\xC3\xAB", 'euro;' => "\xE2\x82\xAC", 'exist;' => "\xE2\x88\x83", 'fnof;' => "\xC6\x92", 'forall;' => "\xE2\x88\x80", 'frac12' => "\xC2\xBD", 'frac12;' => "\xC2\xBD", 'frac14' => "\xC2\xBC", 'frac14;' => "\xC2\xBC", 'frac34' => "\xC2\xBE", 'frac34;' => "\xC2\xBE", 'frasl;' => "\xE2\x81\x84", 'Gamma;' => "\xCE\x93", 'gamma;' => "\xCE\xB3", 'ge;' => "\xE2\x89\xA5", 'GT' => "\x3E", 'gt' => "\x3E", 'GT;' => "\x3E", 'gt;' => "\x3E", 'hArr;' => "\xE2\x87\x94", 'harr;' => "\xE2\x86\x94", 'hearts;' => "\xE2\x99\xA5", 'hellip;' => "\xE2\x80\xA6", 'Iacute' => "\xC3\x8D", 'iacute' => "\xC3\xAD", 'Iacute;' => "\xC3\x8D", 'iacute;' => "\xC3\xAD", 'Icirc' => "\xC3\x8E", 'icirc' => "\xC3\xAE", 'Icirc;' => "\xC3\x8E", 'icirc;' => "\xC3\xAE", 'iexcl' => "\xC2\xA1", 'iexcl;' => "\xC2\xA1", 'Igrave' => "\xC3\x8C", 'igrave' => "\xC3\xAC", 'Igrave;' => "\xC3\x8C", 'igrave;' => "\xC3\xAC", 'image;' => "\xE2\x84\x91", 'infin;' => "\xE2\x88\x9E", 'int;' => "\xE2\x88\xAB", 'Iota;' => "\xCE\x99", 'iota;' => "\xCE\xB9", 'iquest' => "\xC2\xBF", 'iquest;' => "\xC2\xBF", 'isin;' => "\xE2\x88\x88", 'Iuml' => "\xC3\x8F", 'iuml' => "\xC3\xAF", 'Iuml;' => "\xC3\x8F", 'iuml;' => "\xC3\xAF", 'Kappa;' => "\xCE\x9A", 'kappa;' => "\xCE\xBA", 'Lambda;' => "\xCE\x9B", 'lambda;' => "\xCE\xBB", 'lang;' => "\xE3\x80\x88", 'laquo' => "\xC2\xAB", 'laquo;' => "\xC2\xAB", 'lArr;' => "\xE2\x87\x90", 'larr;' => "\xE2\x86\x90", 'lceil;' => "\xE2\x8C\x88", 'ldquo;' => "\xE2\x80\x9C", 'le;' => "\xE2\x89\xA4", 'lfloor;' => "\xE2\x8C\x8A", 'lowast;' => "\xE2\x88\x97", 'loz;' => "\xE2\x97\x8A", 'lrm;' => "\xE2\x80\x8E", 'lsaquo;' => "\xE2\x80\xB9", 'lsquo;' => "\xE2\x80\x98", 'LT' => "\x3C", 'lt' => "\x3C", 'LT;' => "\x3C", 'lt;' => "\x3C", 'macr' => "\xC2\xAF", 'macr;' => "\xC2\xAF", 'mdash;' => "\xE2\x80\x94", 'micro' => "\xC2\xB5", 'micro;' => "\xC2\xB5", 'middot' => "\xC2\xB7", 'middot;' => "\xC2\xB7", 'minus;' => "\xE2\x88\x92", 'Mu;' => "\xCE\x9C", 'mu;' => "\xCE\xBC", 'nabla;' => "\xE2\x88\x87", 'nbsp' => "\xC2\xA0", 'nbsp;' => "\xC2\xA0", 'ndash;' => "\xE2\x80\x93", 'ne;' => "\xE2\x89\xA0", 'ni;' => "\xE2\x88\x8B", 'not' => "\xC2\xAC", 'not;' => "\xC2\xAC", 'notin;' => "\xE2\x88\x89", 'nsub;' => "\xE2\x8A\x84", 'Ntilde' => "\xC3\x91", 'ntilde' => "\xC3\xB1", 'Ntilde;' => "\xC3\x91", 'ntilde;' => "\xC3\xB1", 'Nu;' => "\xCE\x9D", 'nu;' => "\xCE\xBD", 'Oacute' => "\xC3\x93", 'oacute' => "\xC3\xB3", 'Oacute;' => "\xC3\x93", 'oacute;' => "\xC3\xB3", 'Ocirc' => "\xC3\x94", 'ocirc' => "\xC3\xB4", 'Ocirc;' => "\xC3\x94", 'ocirc;' => "\xC3\xB4", 'OElig;' => "\xC5\x92", 'oelig;' => "\xC5\x93", 'Ograve' => "\xC3\x92", 'ograve' => "\xC3\xB2", 'Ograve;' => "\xC3\x92", 'ograve;' => "\xC3\xB2", 'oline;' => "\xE2\x80\xBE", 'Omega;' => "\xCE\xA9", 'omega;' => "\xCF\x89", 'Omicron;' => "\xCE\x9F", 'omicron;' => "\xCE\xBF", 'oplus;' => "\xE2\x8A\x95", 'or;' => "\xE2\x88\xA8", 'ordf' => "\xC2\xAA", 'ordf;' => "\xC2\xAA", 'ordm' => "\xC2\xBA", 'ordm;' => "\xC2\xBA", 'Oslash' => "\xC3\x98", 'oslash' => "\xC3\xB8", 'Oslash;' => "\xC3\x98", 'oslash;' => "\xC3\xB8", 'Otilde' => "\xC3\x95", 'otilde' => "\xC3\xB5", 'Otilde;' => "\xC3\x95", 'otilde;' => "\xC3\xB5", 'otimes;' => "\xE2\x8A\x97", 'Ouml' => "\xC3\x96", 'ouml' => "\xC3\xB6", 'Ouml;' => "\xC3\x96", 'ouml;' => "\xC3\xB6", 'para' => "\xC2\xB6", 'para;' => "\xC2\xB6", 'part;' => "\xE2\x88\x82", 'permil;' => "\xE2\x80\xB0", 'perp;' => "\xE2\x8A\xA5", 'Phi;' => "\xCE\xA6", 'phi;' => "\xCF\x86", 'Pi;' => "\xCE\xA0", 'pi;' => "\xCF\x80", 'piv;' => "\xCF\x96", 'plusmn' => "\xC2\xB1", 'plusmn;' => "\xC2\xB1", 'pound' => "\xC2\xA3", 'pound;' => "\xC2\xA3", 'Prime;' => "\xE2\x80\xB3", 'prime;' => "\xE2\x80\xB2", 'prod;' => "\xE2\x88\x8F", 'prop;' => "\xE2\x88\x9D", 'Psi;' => "\xCE\xA8", 'psi;' => "\xCF\x88", 'QUOT' => "\x22", 'quot' => "\x22", 'QUOT;' => "\x22", 'quot;' => "\x22", 'radic;' => "\xE2\x88\x9A", 'rang;' => "\xE3\x80\x89", 'raquo' => "\xC2\xBB", 'raquo;' => "\xC2\xBB", 'rArr;' => "\xE2\x87\x92", 'rarr;' => "\xE2\x86\x92", 'rceil;' => "\xE2\x8C\x89", 'rdquo;' => "\xE2\x80\x9D", 'real;' => "\xE2\x84\x9C", 'REG' => "\xC2\xAE", 'reg' => "\xC2\xAE", 'REG;' => "\xC2\xAE", 'reg;' => "\xC2\xAE", 'rfloor;' => "\xE2\x8C\x8B", 'Rho;' => "\xCE\xA1", 'rho;' => "\xCF\x81", 'rlm;' => "\xE2\x80\x8F", 'rsaquo;' => "\xE2\x80\xBA", 'rsquo;' => "\xE2\x80\x99", 'sbquo;' => "\xE2\x80\x9A", 'Scaron;' => "\xC5\xA0", 'scaron;' => "\xC5\xA1", 'sdot;' => "\xE2\x8B\x85", 'sect' => "\xC2\xA7", 'sect;' => "\xC2\xA7", 'shy' => "\xC2\xAD", 'shy;' => "\xC2\xAD", 'Sigma;' => "\xCE\xA3", 'sigma;' => "\xCF\x83", 'sigmaf;' => "\xCF\x82", 'sim;' => "\xE2\x88\xBC", 'spades;' => "\xE2\x99\xA0", 'sub;' => "\xE2\x8A\x82", 'sube;' => "\xE2\x8A\x86", 'sum;' => "\xE2\x88\x91", 'sup;' => "\xE2\x8A\x83", 'sup1' => "\xC2\xB9", 'sup1;' => "\xC2\xB9", 'sup2' => "\xC2\xB2", 'sup2;' => "\xC2\xB2", 'sup3' => "\xC2\xB3", 'sup3;' => "\xC2\xB3", 'supe;' => "\xE2\x8A\x87", 'szlig' => "\xC3\x9F", 'szlig;' => "\xC3\x9F", 'Tau;' => "\xCE\xA4", 'tau;' => "\xCF\x84", 'there4;' => "\xE2\x88\xB4", 'Theta;' => "\xCE\x98", 'theta;' => "\xCE\xB8", 'thetasym;' => "\xCF\x91", 'thinsp;' => "\xE2\x80\x89", 'THORN' => "\xC3\x9E", 'thorn' => "\xC3\xBE", 'THORN;' => "\xC3\x9E", 'thorn;' => "\xC3\xBE", 'tilde;' => "\xCB\x9C", 'times' => "\xC3\x97", 'times;' => "\xC3\x97", 'TRADE;' => "\xE2\x84\xA2", 'trade;' => "\xE2\x84\xA2", 'Uacute' => "\xC3\x9A", 'uacute' => "\xC3\xBA", 'Uacute;' => "\xC3\x9A", 'uacute;' => "\xC3\xBA", 'uArr;' => "\xE2\x87\x91", 'uarr;' => "\xE2\x86\x91", 'Ucirc' => "\xC3\x9B", 'ucirc' => "\xC3\xBB", 'Ucirc;' => "\xC3\x9B", 'ucirc;' => "\xC3\xBB", 'Ugrave' => "\xC3\x99", 'ugrave' => "\xC3\xB9", 'Ugrave;' => "\xC3\x99", 'ugrave;' => "\xC3\xB9", 'uml' => "\xC2\xA8", 'uml;' => "\xC2\xA8", 'upsih;' => "\xCF\x92", 'Upsilon;' => "\xCE\xA5", 'upsilon;' => "\xCF\x85", 'Uuml' => "\xC3\x9C", 'uuml' => "\xC3\xBC", 'Uuml;' => "\xC3\x9C", 'uuml;' => "\xC3\xBC", 'weierp;' => "\xE2\x84\x98", 'Xi;' => "\xCE\x9E", 'xi;' => "\xCE\xBE", 'Yacute' => "\xC3\x9D", 'yacute' => "\xC3\xBD", 'Yacute;' => "\xC3\x9D", 'yacute;' => "\xC3\xBD", 'yen' => "\xC2\xA5", 'yen;' => "\xC2\xA5", 'yuml' => "\xC3\xBF", 'Yuml;' => "\xC5\xB8", 'yuml;' => "\xC3\xBF", 'Zeta;' => "\xCE\x96", 'zeta;' => "\xCE\xB6", 'zwj;' => "\xE2\x80\x8D", 'zwnj;' => "\xE2\x80\x8C");
+
+ for ($i = 0, $match = null; $i < 9 && $this->consume() !== false; $i++)
+ {
+ $consumed = substr($this->consumed, 1);
+ if (isset($entities[$consumed]))
+ {
+ $match = $consumed;
+ }
+ }
+
+ if ($match !== null)
+ {
+ $this->data = substr_replace($this->data, $entities[$match], $this->position - strlen($consumed) - 1, strlen($match) + 1);
+ $this->position += strlen($entities[$match]) - strlen($consumed) - 1;
+ }
+ break;
+ }
+ }
+}
+
+/**
+ * IRI parser/serialiser
+ *
+ * @package SimplePie
+ */
+class SimplePie_IRI
+{
+ /**
+ * Scheme
+ *
+ * @access private
+ * @var string
+ */
+ var $scheme;
+
+ /**
+ * User Information
+ *
+ * @access private
+ * @var string
+ */
+ var $userinfo;
+
+ /**
+ * Host
+ *
+ * @access private
+ * @var string
+ */
+ var $host;
+
+ /**
+ * Port
+ *
+ * @access private
+ * @var string
+ */
+ var $port;
+
+ /**
+ * Path
+ *
+ * @access private
+ * @var string
+ */
+ var $path;
+
+ /**
+ * Query
+ *
+ * @access private
+ * @var string
+ */
+ var $query;
+
+ /**
+ * Fragment
+ *
+ * @access private
+ * @var string
+ */
+ var $fragment;
+
+ /**
+ * Whether the object represents a valid IRI
+ *
+ * @access private
+ * @var array
+ */
+ var $valid = array();
+
+ /**
+ * Return the entire IRI when you try and read the object as a string
+ *
+ * @access public
+ * @return string
+ */
+ function __toString()
+ {
+ return $this->get_iri();
+ }
+
+ /**
+ * Create a new IRI object, from a specified string
+ *
+ * @access public
+ * @param string $iri
+ * @return SimplePie_IRI
+ */
+ function SimplePie_IRI($iri)
+ {
+ $iri = (string) $iri;
+ if ($iri !== '')
+ {
+ $parsed = $this->parse_iri($iri);
+ $this->set_scheme($parsed['scheme']);
+ $this->set_authority($parsed['authority']);
+ $this->set_path($parsed['path']);
+ $this->set_query($parsed['query']);
+ $this->set_fragment($parsed['fragment']);
+ }
+ }
+
+ /**
+ * Create a new IRI object by resolving a relative IRI
+ *
+ * @static
+ * @access public
+ * @param SimplePie_IRI $base Base IRI
+ * @param string $relative Relative IRI
+ * @return SimplePie_IRI
+ */
+ function absolutize($base, $relative)
+ {
+ $relative = (string) $relative;
+ if ($relative !== '')
+ {
+ $relative =& new SimplePie_IRI($relative);
+ if ($relative->get_scheme() !== null)
+ {
+ $target = $relative;
+ }
+ elseif ($base->get_iri() !== null)
+ {
+ if ($relative->get_authority() !== null)
+ {
+ $target = $relative;
+ $target->set_scheme($base->get_scheme());
+ }
+ else
+ {
+ $target =& new SimplePie_IRI('');
+ $target->set_scheme($base->get_scheme());
+ $target->set_userinfo($base->get_userinfo());
+ $target->set_host($base->get_host());
+ $target->set_port($base->get_port());
+ if ($relative->get_path() !== null)
+ {
+ if (strpos($relative->get_path(), '/') === 0)
+ {
+ $target->set_path($relative->get_path());
+ }
+ elseif (($base->get_userinfo() !== null || $base->get_host() !== null || $base->get_port() !== null) && $base->get_path() === null)
+ {
+ $target->set_path('/' . $relative->get_path());
+ }
+ elseif (($last_segment = strrpos($base->get_path(), '/')) !== false)
+ {
+ $target->set_path(substr($base->get_path(), 0, $last_segment + 1) . $relative->get_path());
+ }
+ else
+ {
+ $target->set_path($relative->get_path());
+ }
+ $target->set_query($relative->get_query());
+ }
+ else
+ {
+ $target->set_path($base->get_path());
+ if ($relative->get_query() !== null)
+ {
+ $target->set_query($relative->get_query());
+ }
+ elseif ($base->get_query() !== null)
+ {
+ $target->set_query($base->get_query());
+ }
+ }
+ }
+ $target->set_fragment($relative->get_fragment());
+ }
+ else
+ {
+ // No base URL, just return the relative URL
+ $target = $relative;
+ }
+ }
+ else
+ {
+ $target = $base;
+ }
+ return $target;
+ }
+
+ /**
+ * Parse an IRI into scheme/authority/path/query/fragment segments
+ *
+ * @access private
+ * @param string $iri
+ * @return array
+ */
+ function parse_iri($iri)
+ {
+ preg_match('/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/', $iri, $match);
+ for ($i = count($match); $i <= 9; $i++)
+ {
+ $match[$i] = '';
+ }
+ return array('scheme' => $match[2], 'authority' => $match[4], 'path' => $match[5], 'query' => $match[7], 'fragment' => $match[9]);
+ }
+
+ /**
+ * Remove dot segments from a path
+ *
+ * @access private
+ * @param string $input
+ * @return string
+ */
+ function remove_dot_segments($input)
+ {
+ $output = '';
+ while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..')
+ {
+ // A: If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise,
+ if (strpos($input, '../') === 0)
+ {
+ $input = substr($input, 3);
+ }
+ elseif (strpos($input, './') === 0)
+ {
+ $input = substr($input, 2);
+ }
+ // B: if the input buffer begins with a prefix of "/./" or "/.", where "." is a complete path segment, then replace that prefix with "/" in the input buffer; otherwise,
+ elseif (strpos($input, '/./') === 0)
+ {
+ $input = substr_replace($input, '/', 0, 3);
+ }
+ elseif ($input === '/.')
+ {
+ $input = '/';
+ }
+ // C: if the input buffer begins with a prefix of "/../" or "/..", where ".." is a complete path segment, then replace that prefix with "/" in the input buffer and remove the last segment and its preceding "/" (if any) from the output buffer; otherwise,
+ elseif (strpos($input, '/../') === 0)
+ {
+ $input = substr_replace($input, '/', 0, 4);
+ $output = substr_replace($output, '', strrpos($output, '/'));
+ }
+ elseif ($input === '/..')
+ {
+ $input = '/';
+ $output = substr_replace($output, '', strrpos($output, '/'));
+ }
+ // D: if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise,
+ elseif ($input === '.' || $input === '..')
+ {
+ $input = '';
+ }
+ // E: move the first path segment in the input buffer to the end of the output buffer, including the initial "/" character (if any) and any subsequent characters up to, but not including, the next "/" character or the end of the input buffer
+ elseif (($pos = strpos($input, '/', 1)) !== false)
+ {
+ $output .= substr($input, 0, $pos);
+ $input = substr_replace($input, '', 0, $pos);
+ }
+ else
+ {
+ $output .= $input;
+ $input = '';
+ }
+ }
+ return $output . $input;
+ }
+
+ /**
+ * Replace invalid character with percent encoding
+ *
+ * @access private
+ * @param string $string Input string
+ * @param string $valid_chars Valid characters
+ * @param int $case Normalise case
+ * @return string
+ */
+ function replace_invalid_with_pct_encoding($string, $valid_chars, $case = SIMPLEPIE_SAME_CASE)
+ {
+ // Normalise case
+ if ($case & SIMPLEPIE_LOWERCASE)
+ {
+ $string = strtolower($string);
+ }
+ elseif ($case & SIMPLEPIE_UPPERCASE)
+ {
+ $string = strtoupper($string);
+ }
+
+ // Store position and string length (to avoid constantly recalculating this)
+ $position = 0;
+ $strlen = strlen($string);
+
+ // Loop as long as we have invalid characters, advancing the position to the next invalid character
+ while (($position += strspn($string, $valid_chars, $position)) < $strlen)
+ {
+ // If we have a % character
+ if ($string[$position] === '%')
+ {
+ // If we have a pct-encoded section
+ if ($position + 2 < $strlen && strspn($string, '0123456789ABCDEFabcdef', $position + 1, 2) === 2)
+ {
+ // Get the the represented character
+ $chr = chr(hexdec(substr($string, $position + 1, 2)));
+
+ // If the character is valid, replace the pct-encoded with the actual character while normalising case
+ if (strpos($valid_chars, $chr) !== false)
+ {
+ if ($case & SIMPLEPIE_LOWERCASE)
+ {
+ $chr = strtolower($chr);
+ }
+ elseif ($case & SIMPLEPIE_UPPERCASE)
+ {
+ $chr = strtoupper($chr);
+ }
+ $string = substr_replace($string, $chr, $position, 3);
+ $strlen -= 2;
+ $position++;
+ }
+
+ // Otherwise just normalise the pct-encoded to uppercase
+ else
+ {
+ $string = substr_replace($string, strtoupper(substr($string, $position + 1, 2)), $position + 1, 2);
+ $position += 3;
+ }
+ }
+ // If we don't have a pct-encoded section, just replace the % with its own esccaped form
+ else
+ {
+ $string = substr_replace($string, '%25', $position, 1);
+ $strlen += 2;
+ $position += 3;
+ }
+ }
+ // If we have an invalid character, change into its pct-encoded form
+ else
+ {
+ $replacement = sprintf("%%%02X", ord($string[$position]));
+ $string = str_replace($string[$position], $replacement, $string);
+ $strlen = strlen($string);
+ }
+ }
+ return $string;
+ }
+
+ /**
+ * Check if the object represents a valid IRI
+ *
+ * @access public
+ * @return bool
+ */
+ function is_valid()
+ {
+ return array_sum($this->valid) === count($this->valid);
+ }
+
+ /**
+ * Set the scheme. Returns true on success, false on failure (if there are
+ * any invalid characters).
+ *
+ * @access public
+ * @param string $scheme
+ * @return bool
+ */
+ function set_scheme($scheme)
+ {
+ if ($scheme === null || $scheme === '')
+ {
+ $this->scheme = null;
+ }
+ else
+ {
+ $len = strlen($scheme);
+ switch (true)
+ {
+ case $len > 1:
+ if (!strspn($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-.', 1))
+ {
+ $this->scheme = null;
+ $this->valid[__FUNCTION__] = false;
+ return false;
+ }
+
+ case $len > 0:
+ if (!strspn($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', 0, 1))
+ {
+ $this->scheme = null;
+ $this->valid[__FUNCTION__] = false;
+ return false;
+ }
+ }
+ $this->scheme = strtolower($scheme);
+ }
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+
+ /**
+ * Set the authority. Returns true on success, false on failure (if there are
+ * any invalid characters).
+ *
+ * @access public
+ * @param string $authority
+ * @return bool
+ */
+ function set_authority($authority)
+ {
+ if (($userinfo_end = strrpos($authority, '@')) !== false)
+ {
+ $userinfo = substr($authority, 0, $userinfo_end);
+ $authority = substr($authority, $userinfo_end + 1);
+ }
+ else
+ {
+ $userinfo = null;
+ }
+
+ if (($port_start = strpos($authority, ':')) !== false)
+ {
+ $port = substr($authority, $port_start + 1);
+ $authority = substr($authority, 0, $port_start);
+ }
+ else
+ {
+ $port = null;
+ }
+
+ return $this->set_userinfo($userinfo) && $this->set_host($authority) && $this->set_port($port);
+ }
+
+ /**
+ * Set the userinfo.
+ *
+ * @access public
+ * @param string $userinfo
+ * @return bool
+ */
+ function set_userinfo($userinfo)
+ {
+ if ($userinfo === null || $userinfo === '')
+ {
+ $this->userinfo = null;
+ }
+ else
+ {
+ $this->userinfo = $this->replace_invalid_with_pct_encoding($userinfo, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=:');
+ }
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+
+ /**
+ * Set the host. Returns true on success, false on failure (if there are
+ * any invalid characters).
+ *
+ * @access public
+ * @param string $host
+ * @return bool
+ */
+ function set_host($host)
+ {
+ if ($host === null || $host === '')
+ {
+ $this->host = null;
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+ elseif ($host[0] === '[' && substr($host, -1) === ']')
+ {
+ if (Net_IPv6::checkIPv6(substr($host, 1, -1)))
+ {
+ $this->host = $host;
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+ else
+ {
+ $this->host = null;
+ $this->valid[__FUNCTION__] = false;
+ return false;
+ }
+ }
+ else
+ {
+ $this->host = $this->replace_invalid_with_pct_encoding($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=', SIMPLEPIE_LOWERCASE);
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+ }
+
+ /**
+ * Set the port. Returns true on success, false on failure (if there are
+ * any invalid characters).
+ *
+ * @access public
+ * @param string $port
+ * @return bool
+ */
+ function set_port($port)
+ {
+ if ($port === null || $port === '')
+ {
+ $this->port = null;
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+ elseif (strspn($port, '0123456789') === strlen($port))
+ {
+ $this->port = (int) $port;
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+ else
+ {
+ $this->port = null;
+ $this->valid[__FUNCTION__] = false;
+ return false;
+ }
+ }
+
+ /**
+ * Set the path.
+ *
+ * @access public
+ * @param string $path
+ * @return bool
+ */
+ function set_path($path)
+ {
+ if ($path === null || $path === '')
+ {
+ $this->path = null;
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+ elseif (substr($path, 0, 2) === '//' && $this->userinfo === null && $this->host === null && $this->port === null)
+ {
+ $this->path = null;
+ $this->valid[__FUNCTION__] = false;
+ return false;
+ }
+ else
+ {
+ $this->path = $this->replace_invalid_with_pct_encoding($path, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=@/');
+ if ($this->scheme !== null)
+ {
+ $this->path = $this->remove_dot_segments($this->path);
+ }
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+ }
+
+ /**
+ * Set the query.
+ *
+ * @access public
+ * @param string $query
+ * @return bool
+ */
+ function set_query($query)
+ {
+ if ($query === null || $query === '')
+ {
+ $this->query = null;
+ }
+ else
+ {
+ $this->query = $this->replace_invalid_with_pct_encoding($query, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=:@/?');
+ }
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+
+ /**
+ * Set the fragment.
+ *
+ * @access public
+ * @param string $fragment
+ * @return bool
+ */
+ function set_fragment($fragment)
+ {
+ if ($fragment === null || $fragment === '')
+ {
+ $this->fragment = null;
+ }
+ else
+ {
+ $this->fragment = $this->replace_invalid_with_pct_encoding($fragment, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$&\'()*+,;=:@/?');
+ }
+ $this->valid[__FUNCTION__] = true;
+ return true;
+ }
+
+ /**
+ * Get the complete IRI
+ *
+ * @access public
+ * @return string
+ */
+ function get_iri()
+ {
+ $iri = '';
+ if ($this->scheme !== null)
+ {
+ $iri .= $this->scheme . ':';
+ }
+ if (($authority = $this->get_authority()) !== null)
+ {
+ $iri .= '//' . $authority;
+ }
+ if ($this->path !== null)
+ {
+ $iri .= $this->path;
+ }
+ if ($this->query !== null)
+ {
+ $iri .= '?' . $this->query;
+ }
+ if ($this->fragment !== null)
+ {
+ $iri .= '#' . $this->fragment;
+ }
+
+ if ($iri !== '')
+ {
+ return $iri;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Get the scheme
+ *
+ * @access public
+ * @return string
+ */
+ function get_scheme()
+ {
+ return $this->scheme;
+ }
+
+ /**
+ * Get the complete authority
+ *
+ * @access public
+ * @return string
+ */
+ function get_authority()
+ {
+ $authority = '';
+ if ($this->userinfo !== null)
+ {
+ $authority .= $this->userinfo . '@';
+ }
+ if ($this->host !== null)
+ {
+ $authority .= $this->host;
+ }
+ if ($this->port !== null)
+ {
+ $authority .= ':' . $this->port;
+ }
+
+ if ($authority !== '')
+ {
+ return $authority;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Get the user information
+ *
+ * @access public
+ * @return string
+ */
+ function get_userinfo()
+ {
+ return $this->userinfo;
+ }
+
+ /**
+ * Get the host
+ *
+ * @access public
+ * @return string
+ */
+ function get_host()
+ {
+ return $this->host;
+ }
+
+ /**
+ * Get the port
+ *
+ * @access public
+ * @return string
+ */
+ function get_port()
+ {
+ return $this->port;
+ }
+
+ /**
+ * Get the path
*
- * @access private
- * @var int
+ * @access public
+ * @return string
*/
- var $position = 0;
+ function get_path()
+ {
+ return $this->path;
+ }
/**
- * Create an instance of the class with the input data
+ * Get the query
*
* @access public
- * @param string $data Input data
+ * @return string
*/
- function SimplePie_Decode_HTML_Entities($data)
+ function get_query()
{
- $this->data = $data;
+ return $this->query;
}
/**
- * Parse the input data
+ * Get the fragment
*
* @access public
- * @return string Output data
+ * @return string
*/
- function parse()
+ function get_fragment()
{
- while (($this->position = strpos($this->data, '&', $this->position)) !== false)
- {
- $this->consume();
- $this->entity();
- $this->consumed = '';
- }
- return $this->data;
+ return $this->fragment;
}
+}
+/**
+ * Class to validate and to work with IPv6 addresses.
+ *
+ * @package SimplePie
+ * @copyright 2003-2005 The PHP Group
+ * @license http://www.opensource.org/licenses/bsd-license.php
+ * @link http://pear.php.net/package/Net_IPv6
+ * @author Alexander Merz <alexander.merz@web.de>
+ * @author elfrink at introweb dot nl
+ * @author Josh Peck <jmp at joshpeck dot org>
+ * @author Geoffrey Sneddon <geoffers@gmail.com>
+ */
+class SimplePie_Net_IPv6
+{
/**
- * Consume the next byte
+ * Removes a possible existing netmask specification of an IP address.
*
- * @access private
- * @return mixed The next byte, or false, if there is no more data
+ * @param string $ip the (compressed) IP as Hex representation
+ * @return string the IP the without netmask
+ * @since 1.1.0
+ * @access public
+ * @static
*/
- function consume()
+ function removeNetmaskSpec($ip)
{
- if (isset($this->data[$this->position]))
+ if (strpos($ip, '/') !== false)
{
- $this->consumed .= $this->data[$this->position];
- return $this->data[$this->position++];
+ list($addr, $nm) = explode('/', $ip);
}
else
{
- $this->consumed = false;
- return false;
+ $addr = $ip;
}
+ return $addr;
}
/**
- * Consume a range of characters
+ * Uncompresses an IPv6 address
*
- * @access private
- * @param string $chars Characters to consume
- * @return mixed A series of characters that match the range, or false
+ * RFC 2373 allows you to compress zeros in an address to '::'. This
+ * function expects an valid IPv6 address and expands the '::' to
+ * the required zeros.
+ *
+ * Example: FF01::101 -> FF01:0:0:0:0:0:0:101
+ * ::1 -> 0:0:0:0:0:0:0:1
+ *
+ * @access public
+ * @static
+ * @param string $ip a valid IPv6-address (hex format)
+ * @return string the uncompressed IPv6-address (hex format)
*/
- function consume_range($chars)
+ function Uncompress($ip)
{
- if ($len = strspn($this->data, $chars, $this->position))
- {
- $data = substr($this->data, $this->position, $len);
- $this->consumed .= $data;
- $this->position += $len;
- return $data;
- }
- else
+ $uip = SimplePie_Net_IPv6::removeNetmaskSpec($ip);
+ $c1 = -1;
+ $c2 = -1;
+ if (strpos($ip, '::') !== false)
{
- $this->consumed = false;
- return false;
+ list($ip1, $ip2) = explode('::', $ip);
+ if ($ip1 === '')
+ {
+ $c1 = -1;
+ }
+ else
+ {
+ $pos = 0;
+ if (($pos = substr_count($ip1, ':')) > 0)
+ {
+ $c1 = $pos;
+ }
+ else
+ {
+ $c1 = 0;
+ }
+ }
+ if ($ip2 === '')
+ {
+ $c2 = -1;
+ }
+ else
+ {
+ $pos = 0;
+ if (($pos = substr_count($ip2, ':')) > 0)
+ {
+ $c2 = $pos;
+ }
+ else
+ {
+ $c2 = 0;
+ }
+ }
+ if (strstr($ip2, '.'))
+ {
+ $c2++;
+ }
+ // ::
+ if ($c1 === -1 && $c2 === -1)
+ {
+ $uip = '0:0:0:0:0:0:0:0';
+ }
+ // ::xxx
+ else if ($c1 === -1)
+ {
+ $fill = str_repeat('0:', 7 - $c2);
+ $uip = str_replace('::', $fill, $uip);
+ }
+ // xxx::
+ else if ($c2 === -1)
+ {
+ $fill = str_repeat(':0', 7 - $c1);
+ $uip = str_replace('::', $fill, $uip);
+ }
+ // xxx::xxx
+ else
+ {
+ $fill = str_repeat(':0:', 6 - $c2 - $c1);
+ $uip = str_replace('::', $fill, $uip);
+ $uip = str_replace('::', ':', $uip);
+ }
}
+ return $uip;
}
/**
- * Unconsume one byte
+ * Splits an IPv6 address into the IPv6 and a possible IPv4 part
*
- * @access private
+ * RFC 2373 allows you to note the last two parts of an IPv6 address as
+ * an IPv4 compatible address
+ *
+ * Example: 0:0:0:0:0:0:13.1.68.3
+ * 0:0:0:0:0:FFFF:129.144.52.38
+ *
+ * @access public
+ * @static
+ * @param string $ip a valid IPv6-address (hex format)
+ * @return array [0] contains the IPv6 part, [1] the IPv4 part (hex format)
*/
- function unconsume()
+ function SplitV64($ip)
{
- $this->consumed = substr($this->consumed, 0, -1);
- $this->position--;
+ $ip = SimplePie_Net_IPv6::Uncompress($ip);
+ if (strstr($ip, '.'))
+ {
+ $pos = strrpos($ip, ':');
+ $ip[$pos] = '_';
+ $ipPart = explode('_', $ip);
+ return $ipPart;
+ }
+ else
+ {
+ return array($ip, '');
+ }
}
/**
- * Decode an entity
+ * Checks an IPv6 address
*
- * @access private
+ * Checks if the given IP is IPv6-compatible
+ *
+ * @access public
+ * @static
+ * @param string $ip a valid IPv6-address
+ * @return bool true if $ip is an IPv6 address
*/
- function entity()
+ function checkIPv6($ip)
{
- switch ($this->consume())
+ $ipPart = SimplePie_Net_IPv6::SplitV64($ip);
+ $count = 0;
+ if (!empty($ipPart[0]))
{
- case "\x09":
- case "\x0A":
- case "\x0B":
- case "\x0B":
- case "\x0C":
- case "\x20":
- case "\x3C":
- case "\x26":
- case false:
- break;
-
- case "\x23":
- switch ($this->consume())
+ $ipv6 = explode(':', $ipPart[0]);
+ for ($i = 0; $i < count($ipv6); $i++)
+ {
+ $dec = hexdec($ipv6[$i]);
+ $hex = strtoupper(preg_replace('/^[0]{1,3}(.*[0-9a-fA-F])$/', '\\1', $ipv6[$i]));
+ if ($ipv6[$i] >= 0 && $dec <= 65535 && $hex === strtoupper(dechex($dec)))
{
- case "\x78":
- case "\x58":
- $range = '0123456789ABCDEFabcdef';
- $hex = true;
- break;
-
- default:
- $range = '0123456789';
- $hex = false;
- $this->unconsume();
- break;
+ $count++;
}
-
- if ($codepoint = $this->consume_range($range))
+ }
+ if ($count === 8)
+ {
+ return true;
+ }
+ elseif ($count === 6 && !empty($ipPart[1]))
+ {
+ $ipv4 = explode('.', $ipPart[1]);
+ $count = 0;
+ foreach ($ipv4 as $ipv4_part)
{
- static $windows_1252_specials = array(0x0D => "\x0A", 0x80 => "\xE2\x82\xAC", 0x81 => "\xEF\xBF\xBD", 0x82 => "\xE2\x80\x9A", 0x83 => "\xC6\x92", 0x84 => "\xE2\x80\x9E", 0x85 => "\xE2\x80\xA6", 0x86 => "\xE2\x80\xA0", 0x87 => "\xE2\x80\xA1", 0x88 => "\xCB\x86", 0x89 => "\xE2\x80\xB0", 0x8A => "\xC5\xA0", 0x8B => "\xE2\x80\xB9", 0x8C => "\xC5\x92", 0x8D => "\xEF\xBF\xBD", 0x8E => "\xC5\xBD", 0x8F => "\xEF\xBF\xBD", 0x90 => "\xEF\xBF\xBD", 0x91 => "\xE2\x80\x98", 0x92 => "\xE2\x80\x99", 0x93 => "\xE2\x80\x9C", 0x94 => "\xE2\x80\x9D", 0x95 => "\xE2\x80\xA2", 0x96 => "\xE2\x80\x93", 0x97 => "\xE2\x80\x94", 0x98 => "\xCB\x9C", 0x99 => "\xE2\x84\xA2", 0x9A => "\xC5\xA1", 0x9B => "\xE2\x80\xBA", 0x9C => "\xC5\x93", 0x9D => "\xEF\xBF\xBD", 0x9E => "\xC5\xBE", 0x9F => "\xC5\xB8");
-
- if ($hex)
- {
- $codepoint = hexdec($codepoint);
- }
- else
- {
- $codepoint = intval($codepoint);
- }
-
- if (isset($windows_1252_specials[$codepoint]))
- {
- $replacement = $windows_1252_specials[$codepoint];
- }
- else
- {
- $replacement = SimplePie_Misc::codepoint_to_utf8($codepoint);
- }
-
- if ($this->consume() != ';')
+ if ($ipv4_part >= 0 && $ipv4_part <= 255 && preg_match('/^\d{1,3}$/', $ipv4_part))
{
- $this->unconsume();
+ $count++;
}
-
- $consumed_length = strlen($this->consumed);
- $this->data = substr_replace($this->data, $replacement, $this->position - $consumed_length, $consumed_length);
- $this->position += strlen($replacement) - $consumed_length;
}
- break;
-
- default:
- static $entities = array('Aacute' => "\xC3\x81", 'aacute' => "\xC3\xA1", 'Aacute;' => "\xC3\x81", 'aacute;' => "\xC3\xA1", 'Acirc' => "\xC3\x82", 'acirc' => "\xC3\xA2", 'Acirc;' => "\xC3\x82", 'acirc;' => "\xC3\xA2", 'acute' => "\xC2\xB4", 'acute;' => "\xC2\xB4", 'AElig' => "\xC3\x86", 'aelig' => "\xC3\xA6", 'AElig;' => "\xC3\x86", 'aelig;' => "\xC3\xA6", 'Agrave' => "\xC3\x80", 'agrave' => "\xC3\xA0", 'Agrave;' => "\xC3\x80", 'agrave;' => "\xC3\xA0", 'alefsym;' => "\xE2\x84\xB5", 'Alpha;' => "\xCE\x91", 'alpha;' => "\xCE\xB1", 'AMP' => "\x26", 'amp' => "\x26", 'AMP;' => "\x26", 'amp;' => "\x26", 'and;' => "\xE2\x88\xA7", 'ang;' => "\xE2\x88\xA0", 'apos;' => "\x27", 'Aring' => "\xC3\x85", 'aring' => "\xC3\xA5", 'Aring;' => "\xC3\x85", 'aring;' => "\xC3\xA5", 'asymp;' => "\xE2\x89\x88", 'Atilde' => "\xC3\x83", 'atilde' => "\xC3\xA3", 'Atilde;' => "\xC3\x83", 'atilde;' => "\xC3\xA3", 'Auml' => "\xC3\x84", 'auml' => "\xC3\xA4", 'Auml;' => "\xC3\x84", 'auml;' => "\xC3\xA4", 'bdquo;' => "\xE2\x80\x9E", 'Beta;' => "\xCE\x92", 'beta;' => "\xCE\xB2", 'brvbar' => "\xC2\xA6", 'brvbar;' => "\xC2\xA6", 'bull;' => "\xE2\x80\xA2", 'cap;' => "\xE2\x88\xA9", 'Ccedil' => "\xC3\x87", 'ccedil' => "\xC3\xA7", 'Ccedil;' => "\xC3\x87", 'ccedil;' => "\xC3\xA7", 'cedil' => "\xC2\xB8", 'cedil;' => "\xC2\xB8", 'cent' => "\xC2\xA2", 'cent;' => "\xC2\xA2", 'Chi;' => "\xCE\xA7", 'chi;' => "\xCF\x87", 'circ;' => "\xCB\x86", 'clubs;' => "\xE2\x99\xA3", 'cong;' => "\xE2\x89\x85", 'COPY' => "\xC2\xA9", 'copy' => "\xC2\xA9", 'COPY;' => "\xC2\xA9", 'copy;' => "\xC2\xA9", 'crarr;' => "\xE2\x86\xB5", 'cup;' => "\xE2\x88\xAA", 'curren' => "\xC2\xA4", 'curren;' => "\xC2\xA4", 'Dagger;' => "\xE2\x80\xA1", 'dagger;' => "\xE2\x80\xA0", 'dArr;' => "\xE2\x87\x93", 'darr;' => "\xE2\x86\x93", 'deg' => "\xC2\xB0", 'deg;' => "\xC2\xB0", 'Delta;' => "\xCE\x94", 'delta;' => "\xCE\xB4", 'diams;' => "\xE2\x99\xA6", 'divide' => "\xC3\xB7", 'divide;' => "\xC3\xB7", 'Eacute' => "\xC3\x89", 'eacute' => "\xC3\xA9", 'Eacute;' => "\xC3\x89", 'eacute;' => "\xC3\xA9", 'Ecirc' => "\xC3\x8A", 'ecirc' => "\xC3\xAA", 'Ecirc;' => "\xC3\x8A", 'ecirc;' => "\xC3\xAA", 'Egrave' => "\xC3\x88", 'egrave' => "\xC3\xA8", 'Egrave;' => "\xC3\x88", 'egrave;' => "\xC3\xA8", 'empty;' => "\xE2\x88\x85", 'emsp;' => "\xE2\x80\x83", 'ensp;' => "\xE2\x80\x82", 'Epsilon;' => "\xCE\x95", 'epsilon;' => "\xCE\xB5", 'equiv;' => "\xE2\x89\xA1", 'Eta;' => "\xCE\x97", 'eta;' => "\xCE\xB7", 'ETH' => "\xC3\x90", 'eth' => "\xC3\xB0", 'ETH;' => "\xC3\x90", 'eth;' => "\xC3\xB0", 'Euml' => "\xC3\x8B", 'euml' => "\xC3\xAB", 'Euml;' => "\xC3\x8B", 'euml;' => "\xC3\xAB", 'euro;' => "\xE2\x82\xAC", 'exist;' => "\xE2\x88\x83", 'fnof;' => "\xC6\x92", 'forall;' => "\xE2\x88\x80", 'frac12' => "\xC2\xBD", 'frac12;' => "\xC2\xBD", 'frac14' => "\xC2\xBC", 'frac14;' => "\xC2\xBC", 'frac34' => "\xC2\xBE", 'frac34;' => "\xC2\xBE", 'frasl;' => "\xE2\x81\x84", 'Gamma;' => "\xCE\x93", 'gamma;' => "\xCE\xB3", 'ge;' => "\xE2\x89\xA5", 'GT' => "\x3E", 'gt' => "\x3E", 'GT;' => "\x3E", 'gt;' => "\x3E", 'hArr;' => "\xE2\x87\x94", 'harr;' => "\xE2\x86\x94", 'hearts;' => "\xE2\x99\xA5", 'hellip;' => "\xE2\x80\xA6", 'Iacute' => "\xC3\x8D", 'iacute' => "\xC3\xAD", 'Iacute;' => "\xC3\x8D", 'iacute;' => "\xC3\xAD", 'Icirc' => "\xC3\x8E", 'icirc' => "\xC3\xAE", 'Icirc;' => "\xC3\x8E", 'icirc;' => "\xC3\xAE", 'iexcl' => "\xC2\xA1", 'iexcl;' => "\xC2\xA1", 'Igrave' => "\xC3\x8C", 'igrave' => "\xC3\xAC", 'Igrave;' => "\xC3\x8C", 'igrave;' => "\xC3\xAC", 'image;' => "\xE2\x84\x91", 'infin;' => "\xE2\x88\x9E", 'int;' => "\xE2\x88\xAB", 'Iota;' => "\xCE\x99", 'iota;' => "\xCE\xB9", 'iquest' => "\xC2\xBF", 'iquest;' => "\xC2\xBF", 'isin;' => "\xE2\x88\x88", 'Iuml' => "\xC3\x8F", 'iuml' => "\xC3\xAF", 'Iuml;' => "\xC3\x8F", 'iuml;' => "\xC3\xAF", 'Kappa;' => "\xCE\x9A", 'kappa;' => "\xCE\xBA", 'Lambda;' => "\xCE\x9B", 'lambda;' => "\xCE\xBB", 'lang;' => "\xE3\x80\x88", 'laquo' => "\xC2\xAB", 'laquo;' => "\xC2\xAB", 'lArr;' => "\xE2\x87\x90", 'larr;' => "\xE2\x86\x90", 'lceil;' => "\xE2\x8C\x88", 'ldquo;' => "\xE2\x80\x9C", 'le;' => "\xE2\x89\xA4", 'lfloor;' => "\xE2\x8C\x8A", 'lowast;' => "\xE2\x88\x97", 'loz;' => "\xE2\x97\x8A", 'lrm;' => "\xE2\x80\x8E", 'lsaquo;' => "\xE2\x80\xB9", 'lsquo;' => "\xE2\x80\x98", 'LT' => "\x3C", 'lt' => "\x3C", 'LT;' => "\x3C", 'lt;' => "\x3C", 'macr' => "\xC2\xAF", 'macr;' => "\xC2\xAF", 'mdash;' => "\xE2\x80\x94", 'micro' => "\xC2\xB5", 'micro;' => "\xC2\xB5", 'middot' => "\xC2\xB7", 'middot;' => "\xC2\xB7", 'minus;' => "\xE2\x88\x92", 'Mu;' => "\xCE\x9C", 'mu;' => "\xCE\xBC", 'nabla;' => "\xE2\x88\x87", 'nbsp' => "\xC2\xA0", 'nbsp;' => "\xC2\xA0", 'ndash;' => "\xE2\x80\x93", 'ne;' => "\xE2\x89\xA0", 'ni;' => "\xE2\x88\x8B", 'not' => "\xC2\xAC", 'not;' => "\xC2\xAC", 'notin;' => "\xE2\x88\x89", 'nsub;' => "\xE2\x8A\x84", 'Ntilde' => "\xC3\x91", 'ntilde' => "\xC3\xB1", 'Ntilde;' => "\xC3\x91", 'ntilde;' => "\xC3\xB1", 'Nu;' => "\xCE\x9D", 'nu;' => "\xCE\xBD", 'Oacute' => "\xC3\x93", 'oacute' => "\xC3\xB3", 'Oacute;' => "\xC3\x93", 'oacute;' => "\xC3\xB3", 'Ocirc' => "\xC3\x94", 'ocirc' => "\xC3\xB4", 'Ocirc;' => "\xC3\x94", 'ocirc;' => "\xC3\xB4", 'OElig;' => "\xC5\x92", 'oelig;' => "\xC5\x93", 'Ograve' => "\xC3\x92", 'ograve' => "\xC3\xB2", 'Ograve;' => "\xC3\x92", 'ograve;' => "\xC3\xB2", 'oline;' => "\xE2\x80\xBE", 'Omega;' => "\xCE\xA9", 'omega;' => "\xCF\x89", 'Omicron;' => "\xCE\x9F", 'omicron;' => "\xCE\xBF", 'oplus;' => "\xE2\x8A\x95", 'or;' => "\xE2\x88\xA8", 'ordf' => "\xC2\xAA", 'ordf;' => "\xC2\xAA", 'ordm' => "\xC2\xBA", 'ordm;' => "\xC2\xBA", 'Oslash' => "\xC3\x98", 'oslash' => "\xC3\xB8", 'Oslash;' => "\xC3\x98", 'oslash;' => "\xC3\xB8", 'Otilde' => "\xC3\x95", 'otilde' => "\xC3\xB5", 'Otilde;' => "\xC3\x95", 'otilde;' => "\xC3\xB5", 'otimes;' => "\xE2\x8A\x97", 'Ouml' => "\xC3\x96", 'ouml' => "\xC3\xB6", 'Ouml;' => "\xC3\x96", 'ouml;' => "\xC3\xB6", 'para' => "\xC2\xB6", 'para;' => "\xC2\xB6", 'part;' => "\xE2\x88\x82", 'permil;' => "\xE2\x80\xB0", 'perp;' => "\xE2\x8A\xA5", 'Phi;' => "\xCE\xA6", 'phi;' => "\xCF\x86", 'Pi;' => "\xCE\xA0", 'pi;' => "\xCF\x80", 'piv;' => "\xCF\x96", 'plusmn' => "\xC2\xB1", 'plusmn;' => "\xC2\xB1", 'pound' => "\xC2\xA3", 'pound;' => "\xC2\xA3", 'Prime;' => "\xE2\x80\xB3", 'prime;' => "\xE2\x80\xB2", 'prod;' => "\xE2\x88\x8F", 'prop;' => "\xE2\x88\x9D", 'Psi;' => "\xCE\xA8", 'psi;' => "\xCF\x88", 'QUOT' => "\x22", 'quot' => "\x22", 'QUOT;' => "\x22", 'quot;' => "\x22", 'radic;' => "\xE2\x88\x9A", 'rang;' => "\xE3\x80\x89", 'raquo' => "\xC2\xBB", 'raquo;' => "\xC2\xBB", 'rArr;' => "\xE2\x87\x92", 'rarr;' => "\xE2\x86\x92", 'rceil;' => "\xE2\x8C\x89", 'rdquo;' => "\xE2\x80\x9D", 'real;' => "\xE2\x84\x9C", 'REG' => "\xC2\xAE", 'reg' => "\xC2\xAE", 'REG;' => "\xC2\xAE", 'reg;' => "\xC2\xAE", 'rfloor;' => "\xE2\x8C\x8B", 'Rho;' => "\xCE\xA1", 'rho;' => "\xCF\x81", 'rlm;' => "\xE2\x80\x8F", 'rsaquo;' => "\xE2\x80\xBA", 'rsquo;' => "\xE2\x80\x99", 'sbquo;' => "\xE2\x80\x9A", 'Scaron;' => "\xC5\xA0", 'scaron;' => "\xC5\xA1", 'sdot;' => "\xE2\x8B\x85", 'sect' => "\xC2\xA7", 'sect;' => "\xC2\xA7", 'shy' => "\xC2\xAD", 'shy;' => "\xC2\xAD", 'Sigma;' => "\xCE\xA3", 'sigma;' => "\xCF\x83", 'sigmaf;' => "\xCF\x82", 'sim;' => "\xE2\x88\xBC", 'spades;' => "\xE2\x99\xA0", 'sub;' => "\xE2\x8A\x82", 'sube;' => "\xE2\x8A\x86", 'sum;' => "\xE2\x88\x91", 'sup;' => "\xE2\x8A\x83", 'sup1' => "\xC2\xB9", 'sup1;' => "\xC2\xB9", 'sup2' => "\xC2\xB2", 'sup2;' => "\xC2\xB2", 'sup3' => "\xC2\xB3", 'sup3;' => "\xC2\xB3", 'supe;' => "\xE2\x8A\x87", 'szlig' => "\xC3\x9F", 'szlig;' => "\xC3\x9F", 'Tau;' => "\xCE\xA4", 'tau;' => "\xCF\x84", 'there4;' => "\xE2\x88\xB4", 'Theta;' => "\xCE\x98", 'theta;' => "\xCE\xB8", 'thetasym;' => "\xCF\x91", 'thinsp;' => "\xE2\x80\x89", 'THORN' => "\xC3\x9E", 'thorn' => "\xC3\xBE", 'THORN;' => "\xC3\x9E", 'thorn;' => "\xC3\xBE", 'tilde;' => "\xCB\x9C", 'times' => "\xC3\x97", 'times;' => "\xC3\x97", 'TRADE;' => "\xE2\x84\xA2", 'trade;' => "\xE2\x84\xA2", 'Uacute' => "\xC3\x9A", 'uacute' => "\xC3\xBA", 'Uacute;' => "\xC3\x9A", 'uacute;' => "\xC3\xBA", 'uArr;' => "\xE2\x87\x91", 'uarr;' => "\xE2\x86\x91", 'Ucirc' => "\xC3\x9B", 'ucirc' => "\xC3\xBB", 'Ucirc;' => "\xC3\x9B", 'ucirc;' => "\xC3\xBB", 'Ugrave' => "\xC3\x99", 'ugrave' => "\xC3\xB9", 'Ugrave;' => "\xC3\x99", 'ugrave;' => "\xC3\xB9", 'uml' => "\xC2\xA8", 'uml;' => "\xC2\xA8", 'upsih;' => "\xCF\x92", 'Upsilon;' => "\xCE\xA5", 'upsilon;' => "\xCF\x85", 'Uuml' => "\xC3\x9C", 'uuml' => "\xC3\xBC", 'Uuml;' => "\xC3\x9C", 'uuml;' => "\xC3\xBC", 'weierp;' => "\xE2\x84\x98", 'Xi;' => "\xCE\x9E", 'xi;' => "\xCE\xBE", 'Yacute' => "\xC3\x9D", 'yacute' => "\xC3\xBD", 'Yacute;' => "\xC3\x9D", 'yacute;' => "\xC3\xBD", 'yen' => "\xC2\xA5", 'yen;' => "\xC2\xA5", 'yuml' => "\xC3\xBF", 'Yuml;' => "\xC5\xB8", 'yuml;' => "\xC3\xBF", 'Zeta;' => "\xCE\x96", 'zeta;' => "\xCE\xB6", 'zwj;' => "\xE2\x80\x8D", 'zwnj;' => "\xE2\x80\x8C");
-
- for ($i = 0, $match = null; $i < 9 && $this->consume() !== false; $i++)
+ if ($count === 4)
{
- $consumed = substr($this->consumed, 1);
- if (isset($entities[$consumed]))
- {
- $match = $consumed;
- }
+ return true;
}
+ }
+ else
+ {
+ return false;
+ }
- if ($match !== null)
- {
- $this->data = substr_replace($this->data, $entities[$match], $this->position - strlen($consumed) - 1, strlen($match) + 1);
- $this->position += strlen($entities[$match]) - strlen($consumed) - 1;
- }
- break;
+ }
+ else
+ {
+ return false;
}
}
}
$this->content_type_sniffer_class = $content_type_sniffer_class;
}
- function find($type = SIMPLEPIE_LOCATOR_ALL)
+ function find($type = SIMPLEPIE_LOCATOR_ALL, &$working)
{
if ($this->is_feed($this->file))
{
if ($type & SIMPLEPIE_LOCATOR_AUTODISCOVERY && $working = $this->autodiscovery())
{
- return $working;
+ return $working[0];
}
if ($type & (SIMPLEPIE_LOCATOR_LOCAL_EXTENSION | SIMPLEPIE_LOCATOR_LOCAL_BODY | SIMPLEPIE_LOCATOR_REMOTE_EXTENSION | SIMPLEPIE_LOCATOR_REMOTE_BODY) && $this->get_links())
{
$links = array_merge(SimplePie_Misc::get_element('link', $this->file->body), SimplePie_Misc::get_element('a', $this->file->body), SimplePie_Misc::get_element('area', $this->file->body));
$done = array();
+ $feeds = array();
foreach ($links as $link)
{
- if ($this->checked_feeds == $this->max_checked_feeds)
+ if ($this->checked_feeds === $this->max_checked_feeds)
{
break;
}
$href = SimplePie_Misc::absolutize_url(trim($link['attribs']['href']['data']), $this->http_base);
}
- if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !empty($link['attribs']['type']['data']) && in_array(strtolower(SimplePie_Misc::parse_mime($link['attribs']['type']['data'])), array('application/rss+xml', 'application/atom+xml'))))
+ if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !empty($link['attribs']['type']['data']) && in_array(strtolower(SimplePie_Misc::parse_mime($link['attribs']['type']['data'])), array('application/rss+xml', 'application/atom+xml'))) && !isset($feeds[$href]))
{
$this->checked_feeds++;
$feed =& new $this->file_class($href, $this->timeout, 5, null, $this->useragent);
- if ($this->is_feed($feed))
+ if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed))
{
- return $feed;
+ $feeds[$href] = $feed;
}
}
$done[] = $href;
}
}
- return null;
+
+ if (!empty($feeds))
+ {
+ return array_values($feeds);
+ }
+ else {
+ return null;
+ }
}
function get_links()
$current = SimplePie_Misc::parse_url($this->file->url);
- if ($parsed['authority'] === '' || $parsed['authority'] == $current['authority'])
+ if ($parsed['authority'] === '' || $parsed['authority'] === $current['authority'])
{
$this->local[] = $href;
}
{
foreach ($array as $key => $value)
{
- if ($this->checked_feeds == $this->max_checked_feeds)
+ if ($this->checked_feeds === $this->max_checked_feeds)
{
break;
}
{
$this->checked_feeds++;
$feed =& new $this->file_class($value, $this->timeout, 5, null, $this->useragent);
- if ($this->is_feed($feed))
+ if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed))
{
return $feed;
}
{
foreach ($array as $key => $value)
{
- if ($this->checked_feeds == $this->max_checked_feeds)
+ if ($this->checked_feeds === $this->max_checked_feeds)
{
break;
}
{
$this->checked_feeds++;
$feed =& new $this->file_class($value, $this->timeout, 5, null, $this->useragent);
- if ($this->is_feed($feed))
+ if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed))
{
return $feed;
}
var $current_column;
var $current_byte;
var $separator = ' ';
- var $feed = false;
var $namespace = array('');
var $element = array('');
var $xml_base = array('');
function parse(&$data, $encoding)
{
// Use UTF-8 if we get passed US-ASCII, as every US-ASCII character is a UTF-8 character
- if (strtoupper($encoding) == 'US-ASCII')
+ if (strtoupper($encoding) === 'US-ASCII')
{
$this->encoding = 'UTF-8';
}
}
}
- // Work around libxml bug
- $data = str_replace('<', '<', $data);
- $data = str_replace('>', '>', $data);
- $data = str_replace('&', '&', $data);
- $data = str_replace(''', ''', $data);
- $data = str_replace('"', '"', $data);
-
$return = true;
+ static $xml_is_sane = null;
+ if ($xml_is_sane === null)
+ {
+ $parser_check = xml_parser_create();
+ xml_parse_into_struct($parser_check, '<foo>&</foo>', $values);
+ xml_parser_free($parser_check);
+ $xml_is_sane = isset($values[0]['value']);
+ }
+
// Create the parser
- $xml = xml_parser_create_ns($this->encoding, $this->separator);
- xml_parser_set_option($xml, XML_OPTION_SKIP_WHITE, 1);
- xml_parser_set_option($xml, XML_OPTION_CASE_FOLDING, 0);
- xml_set_object($xml, $this);
- xml_set_character_data_handler($xml, 'cdata');
- xml_set_element_handler($xml, 'tag_open', 'tag_close');
-
- // Parse!
- if (!xml_parse($xml, $data, true))
- {
- $this->error_code = xml_get_error_code($xml);
- $this->error_string = xml_error_string($this->error_code);
- $return = false;
- }
- $this->current_line = xml_get_current_line_number($xml);
- $this->current_column = xml_get_current_column_number($xml);
- $this->current_byte = xml_get_current_byte_index($xml);
- xml_parser_free($xml);
- return $return;
+ if ($xml_is_sane)
+ {
+ $xml = xml_parser_create_ns($this->encoding, $this->separator);
+ xml_parser_set_option($xml, XML_OPTION_SKIP_WHITE, 1);
+ xml_parser_set_option($xml, XML_OPTION_CASE_FOLDING, 0);
+ xml_set_object($xml, $this);
+ xml_set_character_data_handler($xml, 'cdata');
+ xml_set_element_handler($xml, 'tag_open', 'tag_close');
+
+ // Parse!
+ if (!xml_parse($xml, $data, true))
+ {
+ $this->error_code = xml_get_error_code($xml);
+ $this->error_string = xml_error_string($this->error_code);
+ $return = false;
+ }
+ $this->current_line = xml_get_current_line_number($xml);
+ $this->current_column = xml_get_current_column_number($xml);
+ $this->current_byte = xml_get_current_byte_index($xml);
+ xml_parser_free($xml);
+ return $return;
+ }
+ else
+ {
+ libxml_clear_errors();
+ $xml =& new XMLReader();
+ $xml->xml($data);
+ while (@$xml->read())
+ {
+ switch ($xml->nodeType)
+ {
+
+ case constant('XMLReader::END_ELEMENT'):
+ if ($xml->namespaceURI !== '')
+ {
+ $tagName = "{$xml->namespaceURI}{$this->separator}{$xml->localName}";
+ }
+ else
+ {
+ $tagName = $xml->localName;
+ }
+ $this->tag_close(null, $tagName);
+ break;
+ case constant('XMLReader::ELEMENT'):
+ $empty = $xml->isEmptyElement;
+ if ($xml->namespaceURI !== '')
+ {
+ $tagName = "{$xml->namespaceURI}{$this->separator}{$xml->localName}";
+ }
+ else
+ {
+ $tagName = $xml->localName;
+ }
+ $attributes = array();
+ while ($xml->moveToNextAttribute())
+ {
+ if ($xml->namespaceURI !== '')
+ {
+ $attrName = "{$xml->namespaceURI}{$this->separator}{$xml->localName}";
+ }
+ else
+ {
+ $attrName = $xml->localName;
+ }
+ $attributes[$attrName] = $xml->value;
+ }
+ $this->tag_open(null, $tagName, $attributes);
+ if ($empty)
+ {
+ $this->tag_close(null, $tagName);
+ }
+ break;
+ case constant('XMLReader::TEXT'):
+
+ case constant('XMLReader::CDATA'):
+ $this->cdata(null, $xml->value);
+ break;
+ }
+ }
+ if ($error = libxml_get_last_error())
+ {
+ $this->error_code = $error->code;
+ $this->error_string = $error->message;
+ $this->current_line = $error->line;
+ $this->current_column = $error->column;
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
}
function get_error_code()
function tag_open($parser, $tag, $attributes)
{
- if ($this->feed === 0)
- {
- return;
- }
- elseif ($this->feed == false)
- {
- if (in_array($tag, array(
- SIMPLEPIE_NAMESPACE_ATOM_10 . $this->separator . 'feed',
- SIMPLEPIE_NAMESPACE_ATOM_03 . $this->separator . 'feed',
- 'rss',
- SIMPLEPIE_NAMESPACE_RDF . $this->separator . 'RDF'
- )))
- {
- $this->feed = 1;
- }
- }
- else
- {
- $this->feed++;
- }
-
list($this->namespace[], $this->element[]) = $this->split_ns($tag);
$attribs = array();
if ($this->current_xhtml_construct >= 0)
{
$this->current_xhtml_construct++;
- if (end($this->namespace) == SIMPLEPIE_NAMESPACE_XHTML)
+ if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML)
{
$this->data['data'] .= '<' . end($this->element);
if (isset($attribs['']))
$this->datas[] =& $this->data;
$this->data =& $this->data['child'][end($this->namespace)][end($this->element)][];
$this->data = array('data' => '', 'attribs' => $attribs, 'xml_base' => end($this->xml_base), 'xml_base_explicit' => end($this->xml_base_explicit), 'xml_lang' => end($this->xml_lang));
- if ((end($this->namespace) == SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] == 'xml')
- || (end($this->namespace) == SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] == 'xhtml'))
+ if ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml')
+ || (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml'))
{
$this->current_xhtml_construct = 0;
}
{
$this->data['data'] .= htmlspecialchars($cdata, ENT_QUOTES, $this->encoding);
}
- elseif ($this->feed > 1)
+ else
{
$this->data['data'] .= $cdata;
}
function tag_close($parser, $tag)
{
- if (!$this->feed)
- {
- return;
- }
-
if ($this->current_xhtml_construct >= 0)
{
$this->current_xhtml_construct--;
- if (end($this->namespace) == SIMPLEPIE_NAMESPACE_XHTML && !in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param')))
+ if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML && !in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param')))
{
$this->data['data'] .= '</' . end($this->element) . '>';
}
}
- if ($this->current_xhtml_construct == -1)
+ if ($this->current_xhtml_construct === -1)
{
- $this->data =& $this->datas[$this->feed];
+ $this->data =& $this->datas[count($this->datas) - 1];
array_pop($this->datas);
}
array_pop($this->xml_base);
array_pop($this->xml_base_explicit);
array_pop($this->xml_lang);
- $this->feed--;
}
function split_ns($string)
$file =& new $this->file_class($img['attribs']['src']['data'], $this->timeout, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen);
$headers = $file->headers;
- if ($file->success && ($file->status_code == 200 || ($file->status_code > 206 && $file->status_code < 300)))
+ if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)))
{
if ($cache->save(array('headers' => $file->headers, 'body' => $file->body)))
{
}
else
{
- trigger_error("$cache->name is not writeable", E_USER_WARNING);
+ trigger_error("$this->cache_location is not writeable", E_USER_WARNING);
}
}
}
$data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8');
}
- if ($this->output_encoding != 'UTF-8')
+ if ($this->output_encoding !== 'UTF-8')
{
$data = SimplePie_Misc::change_encoding($data, 'UTF-8', $this->output_encoding);
}
}
function dequeue( $handles ) {
- foreach ( (array) $handles as $handle )
- unset( $this->queue[$handle] );
+ foreach ( (array) $handles as $handle ) {
+ $handle = explode('?', $handle);
+ $key = array_search($handle[0], $this->queue);
+ if ( false !== $key ) {
+ unset($this->queue[$key]);
+ unset($this->args[$handle[0]]);
+ }
+ }
}
function query( $handle, $list = 'registered' ) { // registered, queue, done, to_do
// Trim the query of everything up to the '?'.
$query = preg_replace("!^.+\?!", '', $query);
-
+
// Substitute the substring matches into the query.
$query = addslashes(WP_MatchesMapRegex::apply($query, $matches));
/**
* Helper class to remove the need to use eval to replace $matches[] in query strings.
- *
+ *
* @since 2.9.0
*/
class WP_MatchesMapRegex {
/**
* store for matches
- *
+ *
* @access private
* @var array
*/
var $_matches;
-
+
/**
* store for mapping result
- *
+ *
* @access public
* @var string
*/
var $output;
-
+
/**
* subject to perform mapping on (query string containing $matches[] references
- *
+ *
* @access private
* @var string
*/
var $_subject;
-
+
/**
- * regexp pattern to match $matches[] references
- *
+ * regexp pattern to match $matches[] references
+ *
* @var string
*/
var $_pattern = '(\$matches\[[1-9]+[0-9]*\])'; // magic number
-
+
/**
* constructor
- *
+ *
* @param string $subject subject if regex
* @param array $matches data to use in map
* @return self
- */
+ */
function WP_MatchesMapRegex($subject, $matches) {
$this->_subject = $subject;
$this->_matches = $matches;
- $this->output = $this->_map();
+ $this->output = $this->_map();
}
-
+
/**
* Substitute substring matches in subject.
- *
+ *
* static helper function to ease use
- *
+ *
* @access public
* @param string $subject subject
* @param array $matches data used for subsitution
*/
function apply($subject, $matches) {
$oSelf =& new WP_MatchesMapRegex($subject, $matches);
- return $oSelf->output;
+ return $oSelf->output;
}
-
+
/**
- * do the actual mapping
- *
+ * do the actual mapping
+ *
* @access private
* @return string
*/
$callback = array(&$this, 'callback');
return preg_replace_callback($this->_pattern, $callback, $this->_subject);
}
-
+
/**
* preg_replace_callback hook
- *
+ *
* @access public
* @param array $matches preg_replace regexp matches
* @return string
$index = intval(substr($matches[0], 9, -1));
return ( isset( $this->_matches[$index] ) ? $this->_matches[$index] : '' );
}
-
+
}
?>
else
$count = $post->comment_count;
- return apply_filters('get_comments_number', $count);
+ return apply_filters('get_comments_number', $count, $post_id);
}
/**
*/
function get_comment_time( $d = '', $gmt = false, $translate = true ) {
global $comment;
- $comment_date = $gmt? $comment->comment_date_gmt : $comment->comment_date;
+ $comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date;
if ( '' == $d )
$date = mysql2date(get_option('time_format'), $comment_date, $translate);
else
$date = mysql2date($d, $comment_date, $translate);
- return apply_filters('get_comment_time', $date, $d, $gmt);
+ return apply_filters('get_comment_time', $date, $d, $gmt, $translate);
}
/**
function comments_template( $file = '/comments.php', $separate_comments = false ) {
global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;
- if ( ! (is_single() || is_page() || $withcomments) )
+ if ( !(is_single() || is_page() || $withcomments) || empty($post) )
return;
if ( empty($file) )
/**
* The email address of the current comment author escaped for use in attributes.
- */
+ */
$comment_author_email = $commenter['comment_author_email']; // Escaped by sanitize_comment_cookies()
/**
* The url of the current comment author escaped for use in attributes.
- */
+ */
$comment_author_url = esc_url($commenter['comment_author_url']);
/** @todo Use API instead of SELECTs. */
if ( !empty( $css_class ) ) {
echo ' class="'.$css_class.'" ';
}
- $title = esc_attr( get_the_title() );
+ $title = the_title_attribute( 'echo=0' );
echo apply_filters( 'comments_popup_link_attributes', '' );
}
?>
<<?php echo $tag ?> <?php comment_class(empty( $args['has_children'] ) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>">
- <?php if ( 'ul' == $args['style'] ) : ?>
+ <?php if ( 'div' != $args['style'] ) : ?>
<div id="div-comment-<?php comment_ID() ?>" class="comment-body">
<?php endif; ?>
<div class="comment-author vcard">
<div class="reply">
<?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>
- <?php if ( 'ul' == $args['style'] ) : ?>
+ <?php if ( 'div' != $args['style'] ) : ?>
</div>
<?php endif; ?>
<?php
*/
function &get_comment(&$comment, $output = OBJECT) {
global $wpdb;
+ $null = null;
if ( empty($comment) ) {
if ( isset($GLOBALS['comment']) )
$_comment = & $GLOBALS['comment'];
} elseif ( ! $_comment = wp_cache_get($comment, 'comment') ) {
$_comment = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment));
+ if ( ! $_comment )
+ return $null;
wp_cache_add($_comment->comment_ID, $_comment, 'comment');
}
}
$approved = "comment_approved = '1'";
elseif ( 'spam' == $status )
$approved = "comment_approved = 'spam'";
+ elseif ( 'trash' == $status )
+ $approved = "comment_approved = 'trash'";
else
$approved = "( comment_approved = '0' OR comment_approved = '1' )";
return $comment_count;
}
+//
+// Comment meta functions
+//
+
+/**
+ * Add meta data field to a comment.
+ *
+ * @since 2.9
+ * @uses add_metadata
+ * @link http://codex.wordpress.org/Function_Reference/add_comment_meta
+ *
+ * @param int $comment_id Comment ID.
+ * @param string $key Metadata name.
+ * @param mixed $value Metadata value.
+ * @param bool $unique Optional, default is false. Whether the same key should not be added.
+ * @return bool False for failure. True for success.
+ */
+function add_comment_meta($comment_id, $meta_key, $meta_value, $unique = false) {
+ return add_metadata('comment', $comment_id, $meta_key, $meta_value, $unique);
+}
+
+/**
+ * Remove metadata matching criteria from a comment.
+ *
+ * You can match based on the key, or key and value. Removing based on key and
+ * value, will keep from removing duplicate metadata with the same key. It also
+ * allows removing all metadata matching key, if needed.
+ *
+ * @since 2.9
+ * @uses delete_metadata
+ * @link http://codex.wordpress.org/Function_Reference/delete_comment_meta
+ *
+ * @param int $comment_id comment ID
+ * @param string $meta_key Metadata name.
+ * @param mixed $meta_value Optional. Metadata value.
+ * @return bool False for failure. True for success.
+ */
+function delete_comment_meta($comment_id, $meta_key, $meta_value = '') {
+ return delete_metadata('comment', $comment_id, $meta_key, $meta_value);
+}
+
+/**
+ * Retrieve comment meta field for a comment.
+ *
+ * @since 2.9
+ * @uses get_metadata
+ * @link http://codex.wordpress.org/Function_Reference/get_comment_meta
+ *
+ * @param int $comment_id Comment ID.
+ * @param string $key The meta key to retrieve.
+ * @param bool $single Whether to return a single value.
+ * @return mixed Will be an array if $single is false. Will be value of meta data field if $single
+ * is true.
+ */
+function get_comment_meta($comment_id, $key, $single = false) {
+ return get_metadata('comment', $comment_id, $key, $single);
+}
+
+/**
+ * Update comment meta field based on comment ID.
+ *
+ * Use the $prev_value parameter to differentiate between meta fields with the
+ * same key and comment ID.
+ *
+ * If the meta field for the comment does not exist, it will be added.
+ *
+ * @since 2.9
+ * @uses update_metadata
+ * @link http://codex.wordpress.org/Function_Reference/update_comment_meta
+ *
+ * @param int $comment_id Comment ID.
+ * @param string $key Metadata key.
+ * @param mixed $value Metadata value.
+ * @param mixed $prev_value Optional. Previous value to check before removing.
+ * @return bool False on failure, true if success.
+ */
+function update_comment_meta($comment_id, $meta_key, $meta_value, $prev_value = '') {
+ return update_metadata('comment', $comment_id, $meta_key, $meta_value, $prev_value);
+}
+
/**
* Sanitizes the cookies sent to the user already.
*
// Simple duplicate check
// expected_slashed ($comment_post_ID, $comment_author, $comment_author_email, $comment_content)
- $dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND ( comment_author = '$comment_author' ";
+ $dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND comment_approved != 'trash' AND ( comment_author = '$comment_author' ";
if ( $comment_author_email )
$dupe .= "OR comment_author_email = '$comment_author_email' ";
$dupe .= ") AND comment_content = '$comment_content' LIMIT 1";
do_action( 'check_comment_flood', $comment_author_IP, $comment_author_email, $comment_date_gmt );
- if ( $user_id ) {
+ if ( isset($user_id) && $user_id) {
$userdata = get_userdata($user_id);
$user = new WP_User($user_id);
$post_author = $wpdb->get_var($wpdb->prepare("SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1", $comment_post_ID));
global $wpdb;
if ( current_user_can( 'manage_options' ) )
return; // don't throttle admins
- 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) ) ) {
+ $hour_ago = gmdate( 'Y-m-d H:i:s', time() - 3600 );
+ if ( $lasttime = $wpdb->get_var( $wpdb->prepare( "SELECT `comment_date_gmt` FROM `$wpdb->comments` WHERE `comment_date_gmt` >= %s AND ( `comment_author_IP` = %s OR `comment_author_email` = %s ) ORDER BY `comment_date_gmt` DESC LIMIT 1", $hour_ago, $ip, $email ) ) ) {
$time_lastcomment = mysql2date('U', $lasttime, false);
$time_newcomment = mysql2date('U', $date, false);
$flood_die = apply_filters('comment_flood_filter', false, $time_lastcomment, $time_newcomment);
function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent) {
do_action('wp_blacklist_check', $author, $email, $url, $comment, $user_ip, $user_agent);
- if ( preg_match_all('/&#(\d+);/', $comment . $author . $url, $chars) ) {
- foreach ( (array) $chars[1] as $char ) {
- // If it's an encoded char in the normal ASCII set, reject
- if ( 38 == $char )
- continue; // Unless it's &
- if ( $char < 128 )
- return true;
- }
- }
-
$mod_keys = trim( get_option('blacklist_keys') );
if ( '' == $mod_keys )
return false; // If moderation keys are empty
return $count;
$where = '';
- if( $post_id > 0 )
+ 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;
- $approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam');
+ $approved = array('0' => 'moderated', '1' => 'approved', 'spam' => 'spam', 'trash' => 'trash', 'post-trashed' => 'post-trashed');
$known_types = array_keys( $approved );
foreach( (array) $count as $row_num => $row ) {
- $total += $row['num_comments'];
+ // Don't count post-trashed toward totals
+ if ( 'post-trashed' != $row['comment_approved'] && 'trash' != $row['comment_approved'] )
+ $total += $row['num_comments'];
if ( in_array( $row['comment_approved'], $known_types ) )
$stats[$approved[$row['comment_approved']]] = $row['num_comments'];
}
* @since 2.0.0
* @uses $wpdb
* @uses do_action() Calls 'delete_comment' hook on comment ID
+ * @uses do_action() Calls 'deleted_comment' hook on comment ID after deletion, on success
* @uses do_action() Calls 'wp_set_comment_status' hook on comment ID with 'delete' set for the second parameter
* @uses wp_transition_comment_status() Passes new and old comment status along with $comment object
*
*/
function wp_delete_comment($comment_id) {
global $wpdb;
- do_action('delete_comment', $comment_id);
+ if (!$comment = get_comment($comment_id))
+ return false;
- $comment = get_comment($comment_id);
+ if (wp_get_comment_status($comment_id) != 'trash' && wp_get_comment_status($comment_id) != 'spam' && EMPTY_TRASH_DAYS > 0)
+ return wp_trash_comment($comment_id);
- if ( ! $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment_id) ) )
- return false;
+ do_action('delete_comment', $comment_id);
// Move children up a level.
$children = $wpdb->get_col( $wpdb->prepare("SELECT comment_ID FROM $wpdb->comments WHERE comment_parent = %d", $comment_id) );
clean_comment_cache($children);
}
+ // Delete metadata
+ $meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->commentmeta WHERE comment_id = %d ", $comment_id ) );
+ if ( !empty($meta_ids) ) {
+ do_action( 'delete_commentmeta', $meta_ids );
+ $in_meta_ids = "'" . implode("', '", $meta_ids) . "'";
+ $wpdb->query( "DELETE FROM $wpdb->commentmeta WHERE meta_id IN ($in_meta_ids)" );
+ do_action( 'deleted_commentmeta', $meta_ids );
+ }
+
+ if ( ! $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment_id) ) )
+ return false;
+ do_action('deleted_comment', $comment_id);
+
$post_id = $comment->comment_post_ID;
if ( $post_id && $comment->comment_approved == 1 )
wp_update_comment_count($post_id);
return true;
}
+/**
+ * Moves a comment to the Trash
+ *
+ * @since 2.9.0
+ * @uses do_action() on 'trash_comment' before trashing
+ * @uses do_action() on 'trashed_comment' after trashing
+ *
+ * @param int $comment_id Comment ID.
+ * @return mixed False on failure
+ */
+function wp_trash_comment($comment_id) {
+ if ( EMPTY_TRASH_DAYS == 0 )
+ return wp_delete_comment($comment_id);
+
+ if ( !$comment = get_comment($comment_id) )
+ return false;
+
+ do_action('trash_comment', $comment_id);
+
+ if ( wp_set_comment_status($comment_id, 'trash') ) {
+ add_comment_meta($comment_id, '_wp_trash_meta_status', $comment->comment_approved);
+ add_comment_meta($comment_id, '_wp_trash_meta_time', time() );
+ do_action('trashed_comment', $comment_id);
+ return true;
+ }
+
+ return false;
+}
+
+/**
+ * Removes a comment from the Trash
+ *
+ * @since 2.9.0
+ * @uses do_action() on 'untrash_comment' before untrashing
+ * @uses do_action() on 'untrashed_comment' after untrashing
+ *
+ * @param int $comment_id Comment ID.
+ * @return mixed False on failure
+ */
+function wp_untrash_comment($comment_id) {
+ if ( ! (int)$comment_id )
+ return false;
+
+ do_action('untrash_comment', $comment_id);
+
+ $status = (string) get_comment_meta($comment_id, '_wp_trash_meta_status', true);
+ if ( empty($status) )
+ $status = '0';
+
+ if ( wp_set_comment_status($comment_id, $status) ) {
+ delete_comment_meta($comment_id, '_wp_trash_meta_time');
+ delete_comment_meta($comment_id, '_wp_trash_meta_status');
+ do_action('untrashed_comment', $comment_id);
+ return true;
+ }
+
+ return false;
+}
+
+/**
+ * Marks a comment as Spam
+ *
+ * @since 2.9.0
+ * @uses do_action() on 'spam_comment' before spamming
+ * @uses do_action() on 'spammed_comment' after spamming
+ *
+ * @param int $comment_id Comment ID.
+ * @return mixed False on failure
+ */
+function wp_spam_comment($comment_id) {
+ if ( !$comment = get_comment($comment_id) )
+ return false;
+
+ do_action('spam_comment', $comment_id);
+
+ if ( wp_set_comment_status($comment_id, 'spam') ) {
+ add_comment_meta($comment_id, '_wp_trash_meta_status', $comment->comment_approved);
+ do_action('spammed_comment', $comment_id);
+ return true;
+ }
+
+ return false;
+}
+
+/**
+ * Removes a comment from the Spam
+ *
+ * @since 2.9.0
+ * @uses do_action() on 'unspam_comment' before unspamming
+ * @uses do_action() on 'unspammed_comment' after unspamming
+ *
+ * @param int $comment_id Comment ID.
+ * @return mixed False on failure
+ */
+function wp_unspam_comment($comment_id) {
+ if ( ! (int)$comment_id )
+ return false;
+
+ do_action('unspam_comment', $comment_id);
+
+ $status = (string) get_comment_meta($comment_id, '_wp_trash_meta_status', true);
+ if ( empty($status) )
+ $status = '0';
+
+ if ( wp_set_comment_status($comment_id, $status) ) {
+ delete_comment_meta($comment_id, '_wp_trash_meta_status');
+ do_action('unspammed_comment', $comment_id);
+ return true;
+ }
+
+ return false;
+}
+
/**
* The status of a comment by ID.
*
* @since 1.0.0
*
* @param int $comment_id Comment ID
- * @return string|bool Status might be 'deleted', 'approved', 'unapproved', 'spam'. False on failure.
+ * @return string|bool Status might be 'trash', 'approved', 'unapproved', 'spam'. False on failure.
*/
function wp_get_comment_status($comment_id) {
$comment = get_comment($comment_id);
$approved = $comment->comment_approved;
if ( $approved == NULL )
- return 'deleted';
+ return false;
elseif ( $approved == '1' )
return 'approved';
elseif ( $approved == '0' )
return 'unapproved';
elseif ( $approved == 'spam' )
return 'spam';
+ elseif ( $approved == 'trash' )
+ return 'trash';
else
return false;
}
* @return array Parsed comment information.
*/
function wp_filter_comment($commentdata) {
- $commentdata['user_id'] = apply_filters('pre_user_id', $commentdata['user_ID']);
+ if ( isset($commentdata['user_ID']) )
+ $commentdata['user_id'] = apply_filters('pre_user_id', $commentdata['user_ID']);
+ elseif ( isset($commentdata['user_id']) )
+ $commentdata['user_id'] = apply_filters('pre_user_id', $commentdata['user_id']);
$commentdata['comment_agent'] = apply_filters('pre_comment_user_agent', $commentdata['comment_agent']);
$commentdata['comment_author'] = apply_filters('pre_comment_author_name', $commentdata['comment_author']);
$commentdata['comment_content'] = apply_filters('pre_comment_content', $commentdata['comment_content']);
$commentdata = apply_filters('preprocess_comment', $commentdata);
$commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID'];
- $commentdata['user_ID'] = (int) $commentdata['user_ID'];
+ if ( isset($commentdata['user_ID']) )
+ $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID'];
+ elseif ( isset($commentdata['user_id']) )
+ $commentdata['user_id'] = (int) $commentdata['user_id'];
- $commentdata['comment_parent'] = absint($commentdata['comment_parent']);
+ $commentdata['comment_parent'] = isset($commentdata['comment_parent']) ? absint($commentdata['comment_parent']) : 0;
$parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status($commentdata['comment_parent']) : '';
$commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0;
$commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );
- $commentdata['comment_agent'] = $_SERVER['HTTP_USER_AGENT'];
+ $commentdata['comment_agent'] = substr($_SERVER['HTTP_USER_AGENT'], 0, 254);
$commentdata['comment_date'] = current_time('mysql');
$commentdata['comment_date_gmt'] = current_time('mysql', 1);
$post = &get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment
- if ( get_option('comments_notify') && $commentdata['comment_approved'] && $post->post_author != $commentdata['user_ID'] )
+ if ( get_option('comments_notify') && $commentdata['comment_approved'] && $post->post_author != $commentdata['user_id'] )
wp_notify_postauthor($comment_ID, $commentdata['comment_type']);
}
$status = '0';
switch ( $comment_status ) {
case 'hold':
+ case '0':
$status = '0';
break;
case 'approve':
+ case '1':
$status = '1';
if ( get_option('comments_notify') ) {
$comment = get_comment($comment_id);
case 'spam':
$status = 'spam';
break;
- case 'delete':
- return wp_delete_comment($comment_id);
+ case 'trash':
+ $status = 'trash';
break;
default:
return false;
}
+ $comment_old = wp_clone(get_comment($comment_id));
+
if ( !$wpdb->update( $wpdb->comments, array('comment_approved' => $status), array('comment_ID' => $comment_id) ) ) {
if ( $wp_error )
return new WP_Error('db_update_error', __('Could not update comment status'), $wpdb->last_error);
$comment = get_comment($comment_id);
do_action('wp_set_comment_status', $comment_id, $comment_status);
- wp_transition_comment_status($comment_status, $comment->comment_approved, $comment);
+ wp_transition_comment_status($comment_status, $comment_old->comment_approved, $comment);
wp_update_comment_count($comment->comment_post_ID);
$comment = get_comment($commentarr['comment_ID'], ARRAY_A);
// Escape data pulled from DB.
- $comment = $wpdb->escape($comment);
+ $comment = esc_sql($comment);
$old_status = $comment['comment_approved'];
// Do pingbacks
while ($ping = $wpdb->get_row("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_pingme' LIMIT 1")) {
- $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$ping->ID} AND meta_key = '_pingme';");
+ $mid = $wpdb->get_var( "SELECT meta_id FROM {$wpdb->postmeta} WHERE post_id = {$ping->ID} AND meta_key = '_pingme' LIMIT 1");
+ do_action( 'delete_postmeta', $mid );
+ $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->postmeta} WHERE meta_id = %d", $mid ) );
+ do_action( 'deleted_postmeta', $mid );
pingback($ping->post_content, $ping->ID);
}
// 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( $wpdb->prepare("DELETE FROM {$wpdb->postmeta} WHERE post_id = %d AND meta_key = '_encloseme';", $enclosure->ID) );
+ $mid = $wpdb->get_var( $wpdb->prepare("SELECT meta_id FROM {$wpdb->postmeta} WHERE post_id = %d AND meta_key = '_encloseme'", $enclosure->ID) );
+ do_action( 'delete_postmeta', $mid );
+ $wpdb->query( $wpdb->prepare("DELETE FROM {$wpdb->postmeta} WHERE meta_id = %d", $mid) );
+ do_action( 'deleted_postmeta', $mid );
do_enclose($enclosure->post_content, $enclosure->ID);
}
// using a timeout of 3 seconds should be enough to cover slow servers
$client = new IXR_Client($pingback_server_url);
$client->timeout = 3;
- $client->useragent .= ' -- WordPress/' . $wp_version;
-
+ $client->useragent = apply_filters( 'pingback_useragent', $client->useragent . ' -- WordPress/' . $wp_version, $client->useragent, $pingback_server_url, $pagelinkedto, $pagelinkedfrom);
// when set to true, this outputs debug messages by itself
$client->debug = false;
}
}
-if ( ! function_exists('hash_hmac') ):
+if ( !function_exists('hash_hmac') ):
function hash_hmac($algo, $data, $key, $raw_output = false) {
+ return _hash_hmac($algo, $data, $key, $raw_output);
+}
+endif;
+
+function _hash_hmac($algo, $data, $key, $raw_output = false) {
$packs = array('md5' => 'H32', 'sha1' => 'H40');
if ( !isset($packs[$algo]) )
if (strlen($key) > 64)
$key = pack($pack, $algo($key));
- else if (strlen($key) < 64)
- $key = str_pad($key, 64, chr(0));
+
+ $key = str_pad($key, 64, chr(0));
$ipad = (substr($key, 0, 64) ^ str_repeat(chr(0x36), 64));
$opad = (substr($key, 0, 64) ^ str_repeat(chr(0x5C), 64));
- return $algo($opad . pack($pack, $algo($ipad . $data)));
+ $hmac = $algo($opad . pack($pack, $algo($ipad . $data)));
+
+ if ( $raw_output )
+ return pack( $pack, $hmac );
+ return $hmac;
}
-endif;
-if ( ! function_exists('mb_substr') ):
+if ( !function_exists('mb_substr') ):
function mb_substr( $str, $start, $length=null, $encoding=null ) {
return _mb_substr($str, $start, $length, $encoding);
}
}
}
-?>
+// For PHP < 5.2.0
+if ( !function_exists('json_encode') ) {
+ function json_encode( $string ) {
+ global $wp_json;
+
+ if ( !is_a($wp_json, 'Services_JSON') ) {
+ require_once( 'class-json.php' );
+ $wp_json = new Services_JSON();
+ }
+
+ return $wp_json->encode( $string );
+ }
+}
+
+if ( !function_exists('json_decode') ) {
+ function json_decode( $string ) {
+ global $wp_json;
+
+ if ( !is_a($wp_json, 'Services_JSON') ) {
+ require_once( 'class-json.php' );
+ $wp_json = new Services_JSON();
+ }
+
+ return $wp_json->decode( $string );
+ }
+}
+
+// pathinfo that fills 'filename' without extension like in PHP 5.2+
+function pathinfo52($path) {
+ $parts = pathinfo($path);
+ if ( !isset($parts['filename']) ) {
+ $parts['filename'] = substr( $parts['basename'], 0, strrpos($parts['basename'], '.') );
+ if ( empty($parts['filename']) ) // there's no extension
+ $parts['filename'] = $parts['basename'];
+ }
+ return $parts;
+}
/**
* Schedules a hook to run only once.
*
- * Schedules a hook which will be executed once by the Wordpress actions core at
+ * Schedules a hook which will be executed once by the WordPress actions core at
* a time which you specify. The action will fire off when someone visits your
* WordPress site, if the schedule time has passed.
*
function check_server_timer( $local_time ) {
return true;
}
-
-?>
--- /dev/null
+<?php
+
+/**
+ * Default Embed Handlers
+ *
+ * @package WordPress
+ * @subpackage Embeds
+ */
+
+/**
+ * The Google Video embed handler callback. Google Video does not support oEmbed.
+ *
+ * @see WP_Embed::register_handler()
+ * @see WP_Embed::shortcode()
+ *
+ * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.
+ * @param array $attr Embed attributes.
+ * @param string $url The original URL that was matched by the regex.
+ * @param array $rawattr The original unmodified attributes.
+ * @return string The embed HTML.
+ */
+function wp_embed_handler_googlevideo( $matches, $attr, $url, $rawattr ) {
+ // If the user supplied a fixed width AND height, use it
+ if ( !empty($rawattr['width']) && !empty($rawattr['height']) ) {
+ $width = (int) $rawattr['width'];
+ $height = (int) $rawattr['height'];
+ } else {
+ list( $width, $height ) = wp_expand_dimensions( 425, 344, $attr['width'], $attr['height'] );
+ }
+
+ return apply_filters( 'embed_googlevideo', '<embed type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=' . esc_attr($matches[2]) . '&hl=en&fs=true" style="width:' . esc_attr($width) . 'px;height:' . esc_attr($height) . 'px" allowFullScreen="true" allowScriptAccess="always"></embed>', $matches, $attr, $url, $rawattr );
+}
+wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' );
+
+/**
+ * The PollDaddy.com embed handler callback. PollDaddy does not support oEmbed, at least not yet.
+ *
+ * @see WP_Embed::register_handler()
+ * @see WP_Embed::shortcode()
+ *
+ * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.
+ * @param array $attr Embed attributes.
+ * @param string $url The original URL that was matched by the regex.
+ * @param array $rawattr The original unmodified attributes.
+ * @return string The embed HTML.
+ */
+function wp_embed_handler_polldaddy( $matches, $attr, $url, $rawattr ) {
+ return apply_filters( 'embed_polldaddy', '<script type="text/javascript" charset="utf8" src="http://s3.polldaddy.com/p/' . esc_attr($matches[1]) . '"></script>', $matches, $attr, $url, $rawattr );
+}
+wp_embed_register_handler( 'polldaddy', '#http://answers.polldaddy.com/poll/(\d+)(.*?)#i', 'wp_embed_handler_polldaddy' );
+
+?>
\ No newline at end of file
*/
// Strip, trim, kses, special chars for string saves
-$filters = array('pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target',
- 'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name',
- 'pre_user_nickname');
-foreach ( $filters as $filter ) {
- add_filter($filter, 'strip_tags');
- add_filter($filter, 'trim');
- add_filter($filter, 'wp_filter_kses');
- add_filter($filter, '_wp_specialchars', 30);
+foreach ( array( 'pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target', 'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name', 'pre_user_nickname' ) as $filter ) {
+ add_filter( $filter, 'sanitize_text_field' );
+ add_filter( $filter, 'wp_filter_kses' );
+ add_filter( $filter, '_wp_specialchars', 30 );
+}
+
+// Strip, kses, special chars for string display
+foreach ( array( 'term_name', 'comment_author_name', 'link_name', 'link_target', 'link_rel', 'user_display_name', 'user_first_name', 'user_last_name', 'user_nickname' ) as $filter ) {
+ add_filter( $filter, 'sanitize_text_field' );
+ add_filter( $filter, 'wp_kses_data' );
+ add_filter( $filter, '_wp_specialchars', 30 );
}
// Kses only for textarea saves
-$filters = array('pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description');
-foreach ( $filters as $filter ) {
- add_filter($filter, 'wp_filter_kses');
+foreach ( array( 'pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description' ) as $filter ) {
+ add_filter( $filter, 'wp_filter_kses' );
+}
+
+// Kses only for textarea saves displays
+foreach ( array( 'term_description', 'link_description', 'link_notes', 'user_description' ) as $filter ) {
+ add_filter( $filter, 'wp_kses_data' );
}
-// Email
-$filters = array('pre_comment_author_email', 'pre_user_email');
-foreach ( $filters as $filter ) {
- add_filter($filter, 'trim');
- add_filter($filter, 'sanitize_email');
- add_filter($filter, 'wp_filter_kses');
+// Email saves
+foreach ( array( 'pre_comment_author_email', 'pre_user_email' ) as $filter ) {
+ add_filter( $filter, 'trim' );
+ add_filter( $filter, 'sanitize_email' );
+ add_filter( $filter, 'wp_filter_kses' );
+}
+
+// Email display
+foreach ( array( 'comment_author_email', 'user_email' ) as $filter ) {
+ add_filter( $filter, 'sanitize_email' );
+ add_filter( $filter, 'wp_kses_data' );
}
// Save URL
-$filters = array('pre_comment_author_url', 'pre_user_url', 'pre_link_url', 'pre_link_image',
- 'pre_link_rss');
-foreach ( $filters as $filter ) {
- add_filter($filter, 'strip_tags');
- add_filter($filter, 'trim');
- add_filter($filter, 'esc_url_raw');
- add_filter($filter, 'wp_filter_kses');
+foreach ( array( 'pre_comment_author_url', 'pre_user_url', 'pre_link_url', 'pre_link_image',
+ 'pre_link_rss' ) as $filter ) {
+ add_filter( $filter, 'wp_strip_all_tags' );
+ add_filter( $filter, 'esc_url_raw' );
+ add_filter( $filter, 'wp_filter_kses' );
}
// Display URL
-$filters = array('user_url', 'link_url', 'link_image', 'link_rss', 'comment_url');
-foreach ( $filters as $filter ) {
- add_filter($filter, 'strip_tags');
- add_filter($filter, 'trim');
- add_filter($filter, 'esc_url');
- add_filter($filter, 'wp_filter_kses');
+foreach ( array( 'user_url', 'link_url', 'link_image', 'link_rss', 'comment_url' ) as $filter ) {
+ add_filter( $filter, 'wp_strip_all_tags' );
+ add_filter( $filter, 'esc_url' );
+ add_filter( $filter, 'wp_kses_data' );
}
// Slugs
-$filters = array('pre_term_slug');
-foreach ( $filters as $filter ) {
- add_filter($filter, 'sanitize_title');
+foreach ( array( 'pre_term_slug' ) as $filter ) {
+ add_filter( $filter, 'sanitize_title' );
}
// Keys
-$filters = array('pre_post_type');
-foreach ( $filters as $filter ) {
- add_filter($filter, 'sanitize_user');
+foreach ( array( 'pre_post_type' ) as $filter ) {
+ add_filter( $filter, 'sanitize_user' );
}
// Places to balance tags on input
-$filters = array('content_save_pre', 'excerpt_save_pre', 'comment_save_pre', 'pre_comment_content');
-foreach ( $filters as $filter ) {
- add_filter( $filter, 'balanceTags', 50);
+foreach ( array( 'content_save_pre', 'excerpt_save_pre', 'comment_save_pre', 'pre_comment_content' ) as $filter ) {
+ add_filter( $filter, 'balanceTags', 50 );
}
// Format strings for display.
-$filters = array('comment_author', 'term_name', 'link_name', 'link_description',
- 'link_notes', 'bloginfo', 'wp_title', 'widget_title');
-foreach ( $filters as $filter ) {
- add_filter($filter, 'wptexturize');
- add_filter($filter, 'convert_chars');
- add_filter($filter, 'esc_html');
+foreach ( array( 'comment_author', 'term_name', 'link_name', 'link_description', 'link_notes', 'bloginfo', 'wp_title', 'widget_title' ) as $filter ) {
+ add_filter( $filter, 'wptexturize' );
+ add_filter( $filter, 'convert_chars' );
+ add_filter( $filter, 'esc_html' );
}
// Format text area for display.
-$filters = array('term_description');
-foreach ( $filters as $filter ) {
- add_filter($filter, 'wptexturize');
- add_filter($filter, 'convert_chars');
- add_filter($filter, 'wpautop');
+foreach ( array( 'term_description' ) as $filter ) {
+ add_filter( $filter, 'wptexturize' );
+ add_filter( $filter, 'convert_chars' );
+ add_filter( $filter, 'wpautop' );
+ add_filter( $filter, 'shortcode_unautop');
}
// Format for RSS
-$filters = array('term_name_rss');
-foreach ( $filters as $filter ) {
- add_filter($filter, 'convert_chars');
+foreach ( array( 'term_name_rss' ) as $filter ) {
+ add_filter( $filter, 'convert_chars' );
}
// Display filters
-add_filter('the_title', 'wptexturize');
-add_filter('the_title', 'convert_chars');
-add_filter('the_title', 'trim');
-
-add_filter('the_content', 'wptexturize');
-add_filter('the_content', 'convert_smilies');
-add_filter('the_content', 'convert_chars');
-add_filter('the_content', 'wpautop');
-add_filter('the_content', 'prepend_attachment');
-
-add_filter('the_excerpt', 'wptexturize');
-add_filter('the_excerpt', 'convert_smilies');
-add_filter('the_excerpt', 'convert_chars');
-add_filter('the_excerpt', 'wpautop');
-add_filter('get_the_excerpt', 'wp_trim_excerpt');
-
-add_filter('comment_text', 'wptexturize');
-add_filter('comment_text', 'convert_chars');
-add_filter('comment_text', 'make_clickable', 9);
-add_filter('comment_text', 'force_balance_tags', 25);
-add_filter('comment_text', 'convert_smilies', 20);
-add_filter('comment_text', 'wpautop', 30);
-
-add_filter('comment_excerpt', 'convert_chars');
-
-add_filter('list_cats', 'wptexturize');
-add_filter('single_post_title', 'wptexturize');
-
-add_filter('wp_sprintf', 'wp_sprintf_l', 10, 2);
+add_filter( 'the_title', 'wptexturize' );
+add_filter( 'the_title', 'convert_chars' );
+add_filter( 'the_title', 'trim' );
+
+add_filter( 'the_content', 'wptexturize' );
+add_filter( 'the_content', 'convert_smilies' );
+add_filter( 'the_content', 'convert_chars' );
+add_filter( 'the_content', 'wpautop' );
+add_filter( 'the_content', 'shortcode_unautop' );
+add_filter( 'the_content', 'prepend_attachment' );
+
+add_filter( 'the_excerpt', 'wptexturize' );
+add_filter( 'the_excerpt', 'convert_smilies' );
+add_filter( 'the_excerpt', 'convert_chars' );
+add_filter( 'the_excerpt', 'wpautop' );
+add_filter( 'the_excerpt', 'shortcode_unautop');
+add_filter( 'get_the_excerpt', 'wp_trim_excerpt' );
+
+add_filter( 'comment_text', 'wptexturize' );
+add_filter( 'comment_text', 'convert_chars' );
+add_filter( 'comment_text', 'make_clickable', 9 );
+add_filter( 'comment_text', 'force_balance_tags', 25 );
+add_filter( 'comment_text', 'convert_smilies', 20 );
+add_filter( 'comment_text', 'wpautop', 30 );
+
+add_filter( 'comment_excerpt', 'convert_chars' );
+
+add_filter( 'list_cats', 'wptexturize' );
+add_filter( 'single_post_title', 'wptexturize' );
+
+add_filter( 'wp_sprintf', 'wp_sprintf_l', 10, 2 );
// RSS filters
-add_filter('the_title_rss', 'strip_tags');
-add_filter('the_title_rss', 'ent2ncr', 8);
-add_filter('the_title_rss', 'esc_html');
-add_filter('the_content_rss', 'ent2ncr', 8);
-add_filter('the_excerpt_rss', 'convert_chars');
-add_filter('the_excerpt_rss', 'ent2ncr', 8);
-add_filter('comment_author_rss', 'ent2ncr', 8);
-add_filter('comment_text_rss', 'ent2ncr', 8);
-add_filter('comment_text_rss', 'esc_html');
-add_filter('bloginfo_rss', 'ent2ncr', 8);
-add_filter('the_author', 'ent2ncr', 8);
+add_filter( 'the_title_rss', 'strip_tags' );
+add_filter( 'the_title_rss', 'ent2ncr', 8 );
+add_filter( 'the_title_rss', 'esc_html' );
+add_filter( 'the_content_rss', 'ent2ncr', 8 );
+add_filter( 'the_excerpt_rss', 'convert_chars' );
+add_filter( 'the_excerpt_rss', 'ent2ncr', 8 );
+add_filter( 'comment_author_rss', 'ent2ncr', 8 );
+add_filter( 'comment_text_rss', 'ent2ncr', 8 );
+add_filter( 'comment_text_rss', 'esc_html' );
+add_filter( 'bloginfo_rss', 'ent2ncr', 8 );
+add_filter( 'the_author', 'ent2ncr', 8 );
// Misc filters
-add_filter('option_ping_sites', 'privacy_ping_filter');
-add_filter('option_blog_charset', '_wp_specialchars'); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop
-add_filter('option_home', '_config_wp_home');
-add_filter('option_siteurl', '_config_wp_siteurl');
-add_filter('tiny_mce_before_init', '_mce_set_direction');
-add_filter('pre_kses', 'wp_pre_kses_less_than');
-add_filter('sanitize_title', 'sanitize_title_with_dashes');
-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');
-add_filter( 'the_posts', '_close_comments_for_old_posts' );
-add_filter( 'comments_open', '_close_comments_for_old_post', 10, 2 );
-add_filter( 'pings_open', '_close_comments_for_old_post', 10, 2 );
-add_filter( 'editable_slug', 'urldecode' );
+add_filter( 'option_ping_sites', 'privacy_ping_filter' );
+add_filter( 'option_blog_charset', '_wp_specialchars' ); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop
+add_filter( 'option_home', '_config_wp_home' );
+add_filter( 'option_siteurl', '_config_wp_siteurl' );
+add_filter( 'tiny_mce_before_init', '_mce_set_direction' );
+add_filter( 'pre_kses', 'wp_pre_kses_less_than' );
+add_filter( 'sanitize_title', 'sanitize_title_with_dashes' );
+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' );
+add_filter( 'the_posts', '_close_comments_for_old_posts' );
+add_filter( 'comments_open', '_close_comments_for_old_post', 10, 2 );
+add_filter( 'pings_open', '_close_comments_for_old_post', 10, 2 );
+add_filter( 'editable_slug', 'urldecode' );
// Atom SSL support
-add_filter('atom_service_url','atom_service_url_filter');
+add_filter( 'atom_service_url','atom_service_url_filter' );
// Actions
-add_action('wp_head', 'wp_enqueue_scripts', 1);
-add_action('wp_head', 'feed_links_extra', 3);
-add_action('wp_head', 'rsd_link');
-add_action('wp_head', 'wlwmanifest_link');
-add_action('wp_head', 'index_rel_link');
-add_action('wp_head', 'parent_post_rel_link', 10, 0);
-add_action('wp_head', 'start_post_rel_link', 10, 0);
-add_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
-add_action('wp_head', 'locale_stylesheet');
-add_action('publish_future_post', 'check_and_publish_future_post', 10, 1);
-add_action('wp_head', 'noindex', 1);
-add_action('wp_head', 'wp_print_styles', 8);
-add_action('wp_head', 'wp_print_head_scripts', 9);
-add_action('wp_head', 'wp_generator');
-add_action('wp_footer', 'wp_print_footer_scripts');
-if(!defined('DOING_CRON'))
- add_action('sanitize_comment_cookies', 'wp_cron');
-add_action('do_feed_rdf', 'do_feed_rdf', 10, 1);
-add_action('do_feed_rss', 'do_feed_rss', 10, 1);
-add_action('do_feed_rss2', 'do_feed_rss2', 10, 1);
-add_action('do_feed_atom', 'do_feed_atom', 10, 1);
-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', 'print_head_scripts', 20);
-add_action('admin_print_footer_scripts', 'print_footer_scripts', 20);
-add_action('admin_print_styles', 'print_admin_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);
-add_action('save_post', '_save_post_hook', 5, 2);
-add_action('transition_post_status', '_transition_post_status', 5, 3);
-add_action('comment_form', 'wp_comment_form_unfiltered_html_nonce');
-// Redirect Old Slugs
-add_action('template_redirect', 'wp_old_slug_redirect');
-add_action('edit_post', 'wp_check_for_changed_slugs');
-add_action('edit_form_advanced', 'wp_remember_old_slug');
-add_action('init', '_show_post_preview');
+add_action( 'wp_head', 'wp_enqueue_scripts', 1 );
+add_action( 'wp_head', 'feed_links_extra', 3 );
+add_action( 'wp_head', 'rsd_link' );
+add_action( 'wp_head', 'wlwmanifest_link' );
+add_action( 'wp_head', 'index_rel_link' );
+add_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
+add_action( 'wp_head', 'start_post_rel_link', 10, 0 );
+add_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 );
+add_action( 'wp_head', 'locale_stylesheet' );
+add_action( 'publish_future_post', 'check_and_publish_future_post', 10, 1 );
+add_action( 'wp_head', 'noindex', 1 );
+add_action( 'wp_head', 'wp_print_styles', 8 );
+add_action( 'wp_head', 'wp_print_head_scripts', 9 );
+add_action( 'wp_head', 'wp_generator' );
+add_action( 'wp_head', 'rel_canonical' );
+add_action( 'wp_footer', 'wp_print_footer_scripts' );
+
+// WP Cron
+if ( !defined( 'DOING_CRON' ) )
+ add_action( 'sanitize_comment_cookies', 'wp_cron' );
+
+// 2 Actions 2 Furious
+add_action( 'do_feed_rdf', 'do_feed_rdf', 10, 1 );
+add_action( 'do_feed_rss', 'do_feed_rss', 10, 1 );
+add_action( 'do_feed_rss2', 'do_feed_rss2', 10, 1 );
+add_action( 'do_feed_atom', 'do_feed_atom', 10, 1 );
+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', 'print_head_scripts', 20 );
+add_action( 'admin_print_footer_scripts', 'print_footer_scripts', 20 );
+add_action( 'admin_print_styles', 'print_admin_styles', 20 );
+add_action( 'init', 'smilies_init', 5 );
+add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 );
+add_action( 'plugins_loaded', 'wp_maybe_load_embeds', 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 );
+add_action( 'save_post', '_save_post_hook', 5, 2 );
+add_action( 'transition_post_status', '_transition_post_status', 5, 3 );
+add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' );
+add_action( 'wp_scheduled_delete', 'wp_scheduled_delete' );
+
+// Post Thumbnail CSS class filtering
+add_action( 'begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add' );
+add_action( 'end_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_remove' );
-add_filter('pre_option_gmt_offset','wp_timezone_override_offset');
+// Redirect Old Slugs
+add_action( 'template_redirect', 'wp_old_slug_redirect' );
+add_action( 'edit_post', 'wp_check_for_changed_slugs' );
+add_action( 'edit_form_advanced', 'wp_remember_old_slug' );
+add_action( 'init', '_show_post_preview' );
-?>
+// Timezone
+add_filter( 'pre_option_gmt_offset','wp_timezone_override_offset' );
function widget( $args, $instance ) {
extract($args);
- $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title']);
- $text = apply_filters( 'widget_text', $instance['text'] );
+ $title = apply_filters( 'widget_title', empty($instance['title']) ? '' : $instance['title'], $instance );
+ $text = apply_filters( 'widget_text', $instance['text'], $instance );
echo $before_widget;
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?>
<div class="textwidget"><?php echo $instance['filter'] ? wpautop($text) : $text; ?></div>
if ( current_user_can('unfiltered_html') )
$instance['text'] = $new_instance['text'];
else
- $instance['text'] = wp_filter_post_kses( $new_instance['text'] );
+ $instance['text'] = stripslashes( wp_filter_post_kses( addslashes($new_instance['text']) ) ); // wp_filter_post_kses() expects slashed
$instance['filter'] = isset($new_instance['filter']);
return $instance;
}
<textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>"><?php echo $text; ?></textarea>
- <p><input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked($instance['filter']); ?> /> <label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Automatically add paragraphs.'); ?></label></p>
+ <p><input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked(isset($instance['filter']) ? $instance['filter'] : 0); ?> /> <label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Automatically add paragraphs.'); ?></label></p>
<?php
}
}
//Defaults
$instance = wp_parse_args( (array) $instance, array( 'title' => '') );
$title = esc_attr( $instance['title'] );
- $count = (bool) $instance['count'];
- $hierarchical = (bool) $instance['hierarchical'];
- $dropdown = (bool) $instance['dropdown'];
+ $count = isset($instance['count']) ? (bool) $instance['count'] :false;
+ $hierarchical = isset( $instance['hierarchical'] ) ? (bool) $instance['hierarchical'] : false;
+ $dropdown = isset( $instance['dropdown'] ) ? (bool) $instance['dropdown'] : false;
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
}
function form( $instance ) {
- $title = esc_attr($instance['title']);
- if ( !$number = (int) $instance['number'] )
+ $title = isset($instance['title']) ? esc_attr($instance['title']) : '';
+ if ( !isset($instance['number']) || !$number = (int) $instance['number'] )
$number = 5;
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
add_action( 'wp_head', array(&$this, 'recent_comments_style') );
add_action( 'comment_post', array(&$this, 'flush_widget_cache') );
- add_action( 'wp_set_comment_status', array(&$this, 'flush_widget_cache') );
+ add_action( 'transition_comment_status', array(&$this, 'flush_widget_cache') );
}
function recent_comments_style() { ?>
$number = 15;
if ( !$comments = wp_cache_get( 'recent_comments', 'widget' ) ) {
- $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 15");
+ $comments = $wpdb->get_results("SELECT $wpdb->comments.* FROM $wpdb->comments JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID WHERE comment_approved = '1' AND post_status = 'publish' ORDER BY comment_date_gmt DESC LIMIT 15");
wp_cache_add( 'recent_comments', $comments, 'widget' );
}
echo $before_title . $title . $after_title;
wp_widget_rss_output( $rss, $instance );
echo $after_widget;
+ $rss->__destruct();
+ unset($rss);
}
function update($new_instance, $old_instance) {
if ( is_wp_error($rss) ) {
if ( is_admin() || current_user_can('manage_options') )
echo '<p>' . sprintf( __('<strong>RSS Error</strong>: %s'), $rss->get_error_message() ) . '</p>';
-
return;
}
if ( !$rss->get_item_quantity() ) {
echo '<ul><li>' . __( 'An error has occurred; the feed is probably down. Try again later.' ) . '</li></ul>';
+ $rss->__destruct();
+ unset($rss);
return;
}
}
}
echo '</ul>';
+ $rss->__destruct();
+ unset($rss);
}
$link = esc_url(strip_tags($rss->get_permalink()));
while ( stristr($link, 'http') != $link )
$link = substr($link, 1);
+
+ $rss->__destruct();
+ unset($rss);
}
}
function form( $instance ) {
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
- <input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" /></p>
+ <input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php if (isset ( $instance['title'])) {echo esc_attr( $instance['title'] );} ?>" /></p>
<?php
}
}
the_author_meta('ID');
}
+/**
+ * Display the post content for the feed.
+ *
+ * For encoding the html or the $encode_html parameter, there are three possible
+ * values. '0' will make urls footnotes and use make_url_footnote(). '1' will
+ * encode special characters and automatically display all of the content. The
+ * value of '2' will strip all HTML tags from the content.
+ *
+ * Also note that you cannot set the amount of words and not set the html
+ * encoding. If that is the case, then the html encoding will default to 2,
+ * which will strip all HTML tags.
+ *
+ * To restrict the amount of words of the content, you can use the cut
+ * parameter. If the content is less than the amount, then there won't be any
+ * dots added to the end. If there is content left over, then dots will be added
+ * and the rest of the content will be removed.
+ *
+ * @package WordPress
+ * @subpackage Feed
+ * @since 0.71
+ * @uses apply_filters() Calls 'the_content_rss' on the content before processing.
+ * @see get_the_content() For the $more_link_text, $stripteaser, and $more_file
+ * parameters.
+ *
+ * @deprecated 2.9.0
+ *
+ * @param string $more_link_text Optional. Text to display when more content is available but not displayed.
+ * @param int|bool $stripteaser Optional. Default is 0.
+ * @param string $more_file Optional.
+ * @param int $cut Optional. Amount of words to keep for the content.
+ * @param int $encode_html Optional. How to encode the content.
+ */
+function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
+ _deprecated_function(__FUNCTION__, '2.9', 'the_content_feed' );
+ $content = get_the_content($more_link_text, $stripteaser, $more_file);
+ $content = apply_filters('the_content_rss', $content);
+ if ( $cut && !$encode_html )
+ $encode_html = 2;
+ if ( 1== $encode_html ) {
+ $content = esc_html($content);
+ $cut = 0;
+ } elseif ( 0 == $encode_html ) {
+ $content = make_url_footnote($content);
+ } elseif ( 2 == $encode_html ) {
+ $content = strip_tags($content);
+ }
+ if ( $cut ) {
+ $blah = explode(' ', $content);
+ if ( count($blah) > $cut ) {
+ $k = $cut;
+ $use_dotdotdot = 1;
+ } else {
+ $k = count($blah);
+ $use_dotdotdot = 0;
+ }
+
+ /** @todo Check performance, might be faster to use array slice instead. */
+ for ( $i=0; $i<$k; $i++ )
+ $excerpt .= $blah[$i].' ';
+ $excerpt .= ($use_dotdotdot) ? '...' : '';
+ $content = $excerpt;
+ }
+ $content = str_replace(']]>', ']]>', $content);
+ echo $content;
+}
+
+/**
+ * Strip HTML and put links at the bottom of stripped content.
+ *
+ * Searches for all of the links, strips them out of the content, and places
+ * them at the bottom of the content with numbers.
+ *
+ * @since 0.71
+ * @deprecated 2.9.0
+ *
+ * @param string $content Content to get links
+ * @return string HTML stripped out of content with links at the bottom.
+ */
+function make_url_footnote( $content ) {
+ _deprecated_function(__FUNCTION__, '2.9', '' );
+ preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches );
+ $links_summary = "\n";
+ for ( $i=0; $i<count($matches[0]); $i++ ) {
+ $link_match = $matches[0][$i];
+ $link_number = '['.($i+1).']';
+ $link_url = $matches[2][$i];
+ $link_text = $matches[4][$i];
+ $content = str_replace( $link_match, $link_text . ' ' . $link_number, $content );
+ $link_url = ( ( strtolower( substr( $link_url, 0, 7 ) ) != 'http://' ) && ( strtolower( substr( $link_url, 0, 8 ) ) != 'https://' ) ) ? get_option( 'home' ) . $link_url : $link_url;
+ $links_summary .= "\n" . $link_number . ' ' . $link_url;
+ }
+ $content = strip_tags( $content );
+ $content .= $links_summary;
+ return $content;
+}
+
+/**
+ * Retrieve translated string with vertical bar context
+ *
+ * Quite a few times, there will be collisions with similar translatable text
+ * found in more than two places but with different translated context.
+ *
+ * In order to use the separate contexts, the _c() function is used and the
+ * translatable string uses a pipe ('|') which has the context the string is in.
+ *
+ * When the translated string is returned, it is everything before the pipe, not
+ * including the pipe character. If there is no pipe in the translated text then
+ * everything is returned.
+ *
+ * @since 2.2.0
+ * @deprecated 2.9.0
+ *
+ * @param string $text Text to translate
+ * @param string $domain Optional. Domain to retrieve the translated text
+ * @return string Translated context string without pipe
+ */
+function _c( $text, $domain = 'default' ) {
+ _deprecated_function(__FUNCTION__, '2.9', '_x' );
+ return translate_with_context( $text, $domain );
+}
?>
\ No newline at end of file
<?php the_category_rss('atom') ?>
<summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
<?php if ( !get_option('rss_use_excerpt') ) : ?>
- <content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content>
+ <content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><![CDATA[<?php the_content_feed('atom') ?>]]></content>
<?php endif; ?>
<?php atom_enclosure(); ?>
<?php do_action('atom_entry'); ?>
<?php if (get_option('rss_use_excerpt')) : ?>
<description><?php the_excerpt_rss() ?></description>
<?php else : ?>
- <description><?php the_content_rss('', 0, '', get_option('rss_excerpt_length'), 2) ?></description>
- <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
+ <description><?php the_excerpt_rss() ?></description>
+ <content:encoded><![CDATA[<?php the_content_feed('rdf') ?>]]></content:encoded>
<?php endif; ?>
<?php do_action('rdf_item'); ?>
</item>
<?php while (have_posts()) : the_post(); ?>
<item>
<title><?php the_title_rss() ?></title>
-<?php if (get_option('rss_use_excerpt')) { ?>
<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
-<?php } else { // use content ?>
- <description><?php the_content_rss('', 0, '', get_option('rss_excerpt_length')) ?></description>
-<?php } ?>
<link><?php the_permalink_rss() ?></link>
<?php do_action('rss_item'); ?>
</item>
<?php else : ?>
<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
<?php if ( strlen( $post->post_content ) > 0 ) : ?>
- <content:encoded><![CDATA[<?php the_content() ?>]]></content:encoded>
+ <content:encoded><![CDATA[<?php the_content_feed('rss2') ?>]]></content:encoded>
<?php else : ?>
<content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
<?php endif; ?>
<?php endif; ?>
- <wfw:commentRss><?php echo get_post_comments_feed_link(); ?></wfw:commentRss>
+ <wfw:commentRss><?php echo get_post_comments_feed_link(null, 'rss2'); ?></wfw:commentRss>
<slash:comments><?php echo get_comments_number(); ?></slash:comments>
<?php rss_enclosure(); ?>
<?php do_action('rss2_item'); ?>
}
/**
- * Display the post content for the feed.
- *
- * For encoding the html or the $encode_html parameter, there are three possible
- * values. '0' will make urls footnotes and use make_url_footnote(). '1' will
- * encode special characters and automatically display all of the content. The
- * value of '2' will strip all HTML tags from the content.
- *
- * Also note that you cannot set the amount of words and not set the html
- * encoding. If that is the case, then the html encoding will default to 2,
- * which will strip all HTML tags.
- *
- * To restrict the amount of words of the content, you can use the cut
- * parameter. If the content is less than the amount, then there won't be any
- * dots added to the end. If there is content left over, then dots will be added
- * and the rest of the content will be removed.
+ * Retrieve the post content for feeds.
*
* @package WordPress
* @subpackage Feed
- * @since 0.71
- * @uses apply_filters() Calls 'the_content_rss' on the content before processing.
- * @see get_the_content() For the $more_link_text, $stripteaser, and $more_file
- * parameters.
- *
- * @param string $more_link_text Optional. Text to display when more content is available but not displayed.
- * @param int|bool $stripteaser Optional. Default is 0.
- * @param string $more_file Optional.
- * @param int $cut Optional. Amount of words to keep for the content.
- * @param int $encode_html Optional. How to encode the content.
+ * @since 2.9.0
+ * @uses apply_filters() Calls 'the_content_feed' on the content before processing.
+ * @see get_the_content()
+ *
+ * @param string $feed_type The type of feed. rss2 | atom | rss | rdf
*/
-function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
- $content = get_the_content($more_link_text, $stripteaser, $more_file);
- $content = apply_filters('the_content_rss', $content);
- if ( $cut && !$encode_html )
- $encode_html = 2;
- if ( 1== $encode_html ) {
- $content = esc_html($content);
- $cut = 0;
- } elseif ( 0 == $encode_html ) {
- $content = make_url_footnote($content);
- } elseif ( 2 == $encode_html ) {
- $content = strip_tags($content);
- }
- if ( $cut ) {
- $blah = explode(' ', $content);
- if ( count($blah) > $cut ) {
- $k = $cut;
- $use_dotdotdot = 1;
- } else {
- $k = count($blah);
- $use_dotdotdot = 0;
- }
+function get_the_content_feed($feed_type = null) {
+ if ( !$feed_type )
+ $feed_type = get_default_feed();
- /** @todo Check performance, might be faster to use array slice instead. */
- for ( $i=0; $i<$k; $i++ )
- $excerpt .= $blah[$i].' ';
- $excerpt .= ($use_dotdotdot) ? '...' : '';
- $content = $excerpt;
- }
+ $content = apply_filters('the_content', get_the_content());
$content = str_replace(']]>', ']]>', $content);
- echo $content;
+ return apply_filters('the_content_feed', $content, $feed_type);
+}
+
+/**
+ * Display the post content for feeds.
+ *
+ * @package WordPress
+ * @subpackage Feed
+ * @since 2.9.0
+ * @uses apply_filters() Calls 'the_content_feed' on the content before processing.
+ * @see get_the_content()
+ *
+ * @param string $feed_type The type of feed. rss2 | atom | rss | rdf
+ */
+function the_content_feed($feed_type = null) {
+ echo get_the_content_feed();
}
/**
* @since 2.1.0
* @uses apply_filters()
*
- * @param string $type Optional, default is 'rss'. Either 'rss', 'atom', or 'rdf'.
+ * @param string $type Optional, default is the type returned by get_default_feed().
* @return string All of the post categories for displaying in the feed.
*/
-function get_the_category_rss($type = 'rss') {
+function get_the_category_rss($type = null) {
+ if ( empty($type) )
+ $type = get_default_feed();
$categories = get_the_category();
$tags = get_the_tags();
$the_list = '';
* @since 0.71
* @see get_the_category_rss() For better explanation.
*
- * @param string $type Optional, default is 'rss'. Either 'rss', 'atom', or 'rdf'.
+ * @param string $type Optional, default is the type returned by get_default_feed().
*/
-function the_category_rss($type = 'rss') {
+function the_category_rss($type = null) {
echo get_the_category_rss($type);
}
<?php
/**
- * Main Wordpress Formatting API.
+ * Main WordPress Formatting API.
*
* Handles many functions for formatting output.
*
*/
function wptexturize($text) {
global $wp_cockneyreplace;
+ static $static_setup = false, $opening_quote, $closing_quote, $default_no_texturize_tags, $default_no_texturize_shortcodes, $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements;
$output = '';
$curl = '';
$textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
$stop = count($textarr);
- /* translators: opening curly quote */
- $opening_quote = _x('“', 'opening curly quote');
- /* translators: closing curly quote */
- $closing_quote = _x('”', 'closing curly quote');
-
- $no_texturize_tags = apply_filters('no_texturize_tags', array('pre', 'code', 'kbd', 'style', 'script', 'tt'));
- $no_texturize_shortcodes = apply_filters('no_texturize_shortcodes', array('code'));
- $no_texturize_tags_stack = array();
- $no_texturize_shortcodes_stack = array();
+ // No need to setup these variables more than once
+ if (!$static_setup) {
+ /* translators: opening curly quote */
+ $opening_quote = _x('“', 'opening curly quote');
+ /* translators: closing curly quote */
+ $closing_quote = _x('”', 'closing curly quote');
+
+ $default_no_texturize_tags = array('pre', 'code', 'kbd', 'style', 'script', 'tt');
+ $default_no_texturize_shortcodes = array('code');
+
+ // if a plugin has provided an autocorrect array, use it
+ if ( isset($wp_cockneyreplace) ) {
+ $cockney = array_keys($wp_cockneyreplace);
+ $cockneyreplace = array_values($wp_cockneyreplace);
+ } else {
+ $cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause");
+ $cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round","’cause");
+ }
- // if a plugin has provided an autocorrect array, use it
- if ( isset($wp_cockneyreplace) ) {
- $cockney = array_keys($wp_cockneyreplace);
- $cockneyreplace = array_values($wp_cockneyreplace);
- } else {
- $cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause");
- $cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round","’cause");
+ $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney);
+ $static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', $opening_quote, '’s', $closing_quote, ' ™'), $cockneyreplace);
+
+ $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|[([{<]|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A|[([{<])"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/');
+ $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '’$1', '$1×$2');
+
+ $static_setup = true;
}
- $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney);
- $static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', $opening_quote, '’s', $closing_quote, ' ™'), $cockneyreplace);
+ // Transform into regexp sub-expression used in _wptexturize_pushpop_element
+ // Must do this everytime in case plugins use these filters in a context sensitive manner
+ $no_texturize_tags = '(' . implode('|', apply_filters('no_texturize_tags', $default_no_texturize_tags) ) . ')';
+ $no_texturize_shortcodes = '(' . implode('|', apply_filters('no_texturize_shortcodes', $default_no_texturize_shortcodes) ) . ')';
- $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/');
- $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '’$1', '$1×$2');
+ $no_texturize_tags_stack = array();
+ $no_texturize_shortcodes_stack = array();
for ( $i = 0; $i < $stop; $i++ ) {
$curl = $textarr[$i];
if ( !empty($curl) && '<' != $curl{0} && '[' != $curl{0}
- && empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) { // If it's not a tag
+ && empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) {
+ // This is not a tag, nor is the texturization disabled
// static strings
$curl = str_replace($static_characters, $static_replacements, $curl);
// regular expressions
$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
- } else {
- wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>');
- wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']');
+ } elseif (!empty($curl)) {
+ /*
+ * Only call _wptexturize_pushpop_element if first char is correct
+ * tag opening
+ */
+ if ('<' == $curl{0})
+ _wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>');
+ elseif ('[' == $curl{0})
+ _wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']');
}
$curl = preg_replace('/&([^#])(?![a-zA-Z1-4]{1,8};)/', '&$1', $curl);
return $output;
}
-function wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') {
- $o = preg_quote($opening, '/');
- $c = preg_quote($closing, '/');
- foreach($disabled_elements as $element) {
- if (preg_match('/^'.$o.$element.'\b/', $text)) array_push($stack, $element);
- if (preg_match('/^'.$o.'\/'.$element.$c.'/', $text)) {
+/**
+ * Search for disabled element tags. Push element to stack on tag open and pop
+ * on tag close. Assumes first character of $text is tag opening.
+ *
+ * @access private
+ * @since 2.9.0
+ *
+ * @param string $text Text to check. First character is assumed to be $opening
+ * @param array $stack Array used as stack of opened tag elements
+ * @param string $disabled_elements Tags to match against formatted as regexp sub-expression
+ * @param string $opening Tag opening character, assumed to be 1 character long
+ * @param string $opening Tag closing character
+ * @return object
+ */
+function _wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') {
+ // Check if it is a closing tag -- otherwise assume opening tag
+ if (strncmp($opening . '/', $text, 2)) {
+ // Opening? Check $text+1 against disabled elements
+ if (preg_match('/^' . $disabled_elements . '\b/', substr($text, 1), $matches)) {
+ /*
+ * This disables texturize until we find a closing tag of our type
+ * (e.g. <pre>) even if there was invalid nesting before that
+ *
+ * Example: in the case <pre>sadsadasd</code>"baba"</pre>
+ * "baba" won't be texturize
+ */
+
+ array_push($stack, $matches[1]);
+ }
+ } else {
+ // Closing? Check $text+2 against disabled elements
+ $c = preg_quote($closing, '/');
+ if (preg_match('/^' . $disabled_elements . $c . '/', substr($text, 2), $matches)) {
$last = array_pop($stack);
- // disable texturize until we find a closing tag of our type (e.g. <pre>)
- // even if there was invalid nesting before that
- // Example: in the case <pre>sadsadasd</code>"baba"</pre> "baba" won't be texturized
- if ($last != $element) array_push($stack, $last);
+
+ // Make sure it matches the opening tag
+ if ($last != $matches[1])
+ array_push($stack, $last);
}
}
}
* @return string Text which has been converted into correct paragraph tags.
*/
function wpautop($pee, $br = 1) {
+
if ( trim($pee) === '' )
return '';
$pee = $pee . "\n"; // just to make things a little easier, pad the end
$pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee);
// Space things out a little
- $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr)';
+ $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr|fieldset|legend)';
$pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee);
$pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
$pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
if (strpos($pee, '<pre') !== false)
$pee = preg_replace_callback('!(<pre[^>]*>)(.*?)</pre>!is', 'clean_pre', $pee );
$pee = preg_replace( "|\n</p>$|", '</p>', $pee );
- $pee = preg_replace('/<p>\s*?(' . get_shortcode_regex() . ')\s*<\/p>/s', '$1', $pee); // don't auto-p wrap shortcodes that stand alone
+
+ return $pee;
+}
+
+/**
+ * Don't auto-p wrap shortcodes that stand alone
+ *
+ * Ensures that shortcodes are not wrapped in <<p>>...<</p>>.
+ *
+ * @since 2.9.0
+ *
+ * @param string $pee The content.
+ * @return string The filtered content.
+ */
+function shortcode_unautop($pee) {
+ global $shortcode_tags;
+
+ if ( !empty($shortcode_tags) && is_array($shortcode_tags) ) {
+ $tagnames = array_keys($shortcode_tags);
+ $tagregexp = join( '|', array_map('preg_quote', $tagnames) );
+ $pee = preg_replace('/<p>\\s*?(\\[(' . $tagregexp . ')\\b.*?\\/?\\](?:.+?\\[\\/\\2\\])?)\\s*<\\/p>/s', '$1', $pee);
+ }
return $pee;
}
$filename = str_replace($special_chars, '', $filename);
$filename = preg_replace('/[\s-]+/', '-', $filename);
$filename = trim($filename, '.-_');
+
+ // Split the filename into a base and extension[s]
+ $parts = explode('.', $filename);
+
+ // Return if only one extension
+ if ( count($parts) <= 2 )
+ return apply_filters('sanitize_file_name', $filename, $filename_raw);
+
+ // Process multiple extensions
+ $filename = array_shift($parts);
+ $extension = array_pop($parts);
+ $mimes = get_allowed_mime_types();
+
+ // Loop over any intermediate extensions. Munge them with a trailing underscore if they are a 2 - 5 character
+ // long alpha string not in the extension whitelist.
+ foreach ( (array) $parts as $part) {
+ $filename .= '.' . $part;
+
+ if ( preg_match("/^[a-zA-Z]{2,5}\d?$/", $part) ) {
+ $allowed = false;
+ foreach ( $mimes as $ext_preg => $mime_match ) {
+ $ext_preg = '!(^' . $ext_preg . ')$!i';
+ if ( preg_match( $ext_preg, $part ) ) {
+ $allowed = true;
+ break;
+ }
+ }
+ if ( !$allowed )
+ $filename .= '_';
+ }
+ }
+ $filename .= '.' . $extension;
+
return apply_filters('sanitize_file_name', $filename, $filename_raw);
}
*/
function sanitize_user( $username, $strict = false ) {
$raw_username = $username;
- $username = strip_tags($username);
+ $username = wp_strip_all_tags($username);
// Kill octets
$username = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $username);
$username = preg_replace('/&.+?;/', '', $username); // Kill entities
$gpc = stripslashes($gpc);
}
- return $wpdb->escape($gpc);
+ return esc_sql($gpc);
}
/**
*/
function _make_url_clickable_cb($matches) {
$url = $matches[2];
+
$url = esc_url($url);
if ( empty($url) )
return $matches[0];
+
return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>";
}
$dest = esc_url($dest);
if ( empty($dest) )
return $matches[0];
- // removed trailing [,;:] from URL
- if ( in_array(substr($dest, -1), array('.', ',', ';', ':')) === true ) {
+
+ // removed trailing [.,;:)] from URL
+ if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
$ret = substr($dest, -1);
$dest = substr($dest, 0, strlen($dest)-1);
}
- return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>" . $ret;
+ return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>$ret";
}
/**
function make_clickable($ret) {
$ret = ' ' . $ret;
// in testing, using arrays here was found to be faster
- $ret = preg_replace_callback('#(?<=[\s>])(\()?([\w]+?://(?:[\w\\x80-\\xff\#$%&~/\-=?@\[\](+]|[.,;:](?![\s<])|(?(1)\)(?![\s<])|\)))+)#is', '_make_url_clickable_cb', $ret);
+ $ret = preg_replace_callback('#(?<=[\s>])(\()?([\w]+?://(?:[\w\\x80-\\xff\#$%&~/=?@\[\](+-]|[.,;:](?![\s<]|(\))?([\s]|$))|(?(1)\)(?![\s<.,;:]|$)|\)))+)#is', '_make_url_clickable_cb', $ret);
$ret = preg_replace_callback('#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]+)#is', '_make_web_ftp_clickable_cb', $ret);
$ret = preg_replace_callback('#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret);
// this one is not in an array because we need it to run last, for cleanup of accidental links within links
// This is a pre save filter, so text is already escaped.
$text = stripslashes($text);
$text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text);
- $text = $wpdb->escape($text);
+ $text = esc_sql($text);
return $text;
}
$img = $wpsmiliestrans[$smiley];
$smiley_masked = esc_attr($smiley);
- return " <img src='$siteurl/wp-includes/images/smilies/$img' alt='$smiley_masked' class='wp-smiley' /> ";
+ $srcurl = apply_filters('smilies_src', "$siteurl/wp-includes/images/smilies/$img", $img, $siteurl);
+
+ return " <img src='$srcurl' alt='$smiley_masked' class='wp-smiley' /> ";
}
* Generates an excerpt from the content, if needed.
*
* The excerpt word amount will be 55 words and if the amount is greater than
- * that, then the string '[...]' will be appended to the excerpt. If the string
+ * that, then the string ' [...]' will be appended to the excerpt. If the string
* is less than 55 words, then the content will be returned as is.
*
+ * The 55 word limit can be modified by plugins/themes using the excerpt_length filter
+ * The ' [...]' string can be modified by plugins/themes using the excerpt_more filter
+ *
* @since 1.5.0
*
- * @param string $text The exerpt. If set to empty an excerpt is generated.
+ * @param string $text The excerpt. If set to empty an excerpt is generated.
* @return string The excerpt.
*/
function wp_trim_excerpt($text) {
$text = str_replace(']]>', ']]>', $text);
$text = strip_tags($text);
$excerpt_length = apply_filters('excerpt_length', 55);
+ $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
$words = explode(' ', $text, $excerpt_length + 1);
if (count($words) > $excerpt_length) {
array_pop($words);
- array_push($words, '[...]');
$text = implode(' ', $words);
+ $text = $text . $excerpt_more;
}
}
return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
/**
* Perform a deep string replace operation to ensure the values in $search are no longer present
- *
+ *
* Repeats the replacement operation until it no longer replaces anything so as to remove "nested" values
* e.g. $subject = '%0%0%0DDD', $search ='%0D', $result ='' rather than the '%0%0DD' that
* str_replace would return
- *
+ *
* @since 2.8.1
* @access private
- *
+ *
* @param string|array $search
* @param string $subject
* @return string The processed string
}
}
}
-
+
return $subject;
}
}
/**
- * Escape single quotes, specialchar double quotes, and fix line endings.
+ * Escape single quotes, htmlspecialchar " < > &, and fix line endings.
*
+ * Escapes text strings for echoing in JS, both inline (for example in onclick="...")
+ * and inside <script> tag. Note that the strings have to be in single quotes.
* The filter 'js_escape' is also applied here.
*
* @since 2.8.0
$safe_text = wp_check_invalid_utf8( $text );
$safe_text = _wp_specialchars( $safe_text, ENT_COMPAT );
$safe_text = preg_replace( '/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes( $safe_text ) );
- $safe_text = preg_replace( "/\r?\n/", "\\n", addslashes( $safe_text ) );
+ $safe_text = str_replace( "\r", '', $safe_text );
+ $safe_text = str_replace( "\n", '\\n', addslashes( $safe_text ) );
return apply_filters( 'js_escape', $safe_text, $text );
}
$safe_text = wp_check_invalid_utf8( $text );
$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
return apply_filters( 'esc_html', $safe_text, $text );
- return $text;
}
/**
case 'medium_size_h':
case 'large_size_w':
case 'large_size_h':
+ case 'embed_size_h':
case 'default_post_edit_rows':
case 'mailserver_port':
case 'comment_max_links':
case 'close_comments_days_old':
case 'comments_per_page':
case 'thread_comments_depth':
- $value = abs((int) $value);
+ case 'users_can_register':
+ $value = absint( $value );
+ break;
+
+ case 'embed_size_w':
+ if ( '' !== $value )
+ $value = absint( $value );
break;
case 'posts_per_page':
* @return string The excerpt.
*/
function wp_html_excerpt( $str, $count ) {
- $str = strip_tags( $str );
+ $str = wp_strip_all_tags( $str, true );
$str = mb_substr( $str, 0, $count );
// remove part of an entity at the end
$str = preg_replace( '/&[^;\s]{0,6}$/', '', $str );
create_function('$m', 'return _links_add_target($m, "' . $target . '");'),
$content);
}
+
/**
* Callback to add a target attribute to all links in passed content.
*
return $str;
}
+/**
+ * Properly strip all HTML tags including script and style
+ *
+ * @since 2.9.0
+ *
+ * @param string $string String containing HTML tags
+ * @param bool $remove_breaks optional Whether to remove left over line breaks and white space chars
+ * @return string The processed string.
+ */
+function wp_strip_all_tags($string, $remove_breaks = false) {
+ $string = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string );
+ $string = strip_tags($string);
+
+ if ( $remove_breaks )
+ $string = preg_replace('/\s+/', ' ', $string);
+
+ return trim($string);
+}
+
+/**
+ * Sanitize a string from user input or from the db
+ *
+ * check for invalid UTF-8,
+ * Convert single < characters to entity,
+ * strip all tags,
+ * remove line breaks, tabs and extra whitre space,
+ * strip octets.
+ *
+ * @since 2.9
+ *
+ * @param string $str
+ * @return string
+ */
+function sanitize_text_field($str) {
+ $filtered = wp_check_invalid_utf8( $str );
+
+ if ( strpos($filtered, '<') !== false ) {
+ $filtered = wp_pre_kses_less_than( $filtered );
+ $filtered = wp_strip_all_tags( $filtered, true );
+ } else {
+ $filtered = trim( preg_replace('/\s+/', ' ', $filtered) );
+ }
+
+ $match = array();
+ while ( preg_match('/%[a-f0-9]{2}/i', $filtered, $match) )
+ $filtered = str_replace($match[0], '', $filtered);
+
+ return apply_filters('sanitize_text_field', $filtered, $str);
+}
+
?>
wp_protect_special_option( $option_name );
- $safe_option_name = $wpdb->escape( $option_name );
+ $safe_option_name = esc_sql( $option_name );
$newvalue = sanitize_option( $option_name, $newvalue );
$oldvalue = get_option( $safe_option_name );
$_newvalue = $newvalue;
$newvalue = maybe_serialize( $newvalue );
+ do_action( 'update_option', $option_name, $oldvalue, $newvalue );
$alloptions = wp_load_alloptions();
if ( isset( $alloptions[$option_name] ) ) {
$alloptions[$option_name] = $newvalue;
if ( $wpdb->rows_affected == 1 ) {
do_action( "update_option_{$option_name}", $oldvalue, $_newvalue );
+ do_action( 'updated_option', $option_name, $oldvalue, $_newvalue );
return true;
}
return false;
global $wpdb;
wp_protect_special_option( $name );
- $safe_name = $wpdb->escape( $name );
+ $safe_name = esc_sql( $name );
$value = sanitize_option( $name, $value );
// Make sure the option doesn't already exist. We can check the 'notoptions' cache before we ask for a db query
$value = maybe_serialize( $value );
$autoload = ( 'no' === $autoload ) ? 'no' : 'yes';
-
+ do_action( 'add_option', $name, $value );
if ( 'yes' == $autoload ) {
$alloptions = wp_load_alloptions();
$alloptions[$name] = $value;
wp_cache_set( 'notoptions', $notoptions, 'options' );
}
- $wpdb->insert($wpdb->options, array('option_name' => $name, 'option_value' => $value, 'autoload' => $autoload) );
+ $wpdb->query( $wpdb->prepare( "INSERT INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, %s) ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)", $name, $value, $autoload ) );
do_action( "add_option_{$name}", $name, $value );
+ do_action( 'added_option', $name, $value );
+
return;
}
// Get the ID, if no ID then return
// expected_slashed ($name)
- $option = $wpdb->get_row( "SELECT option_id, autoload FROM $wpdb->options WHERE option_name = '$name'" );
- if ( is_null($option) || !$option->option_id )
+ $option = $wpdb->get_row( "SELECT autoload FROM $wpdb->options WHERE option_name = '$name'" );
+ if ( is_null($option) )
return false;
+ do_action( 'delete_option', $name );
// expected_slashed ($name)
$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name = '$name'" );
if ( 'yes' == $option->autoload ) {
} else {
wp_cache_delete( $name, 'options' );
}
+ do_action( 'deleted_option', $name );
return true;
}
if ( $_wp_using_ext_object_cache ) {
return wp_cache_delete($transient, 'transient');
} else {
- $transient = '_transient_' . $wpdb->escape($transient);
+ $transient = '_transient_' . esc_sql($transient);
return delete_option($transient);
}
}
if ( $_wp_using_ext_object_cache ) {
$value = wp_cache_get($transient, 'transient');
} else {
- $transient_option = '_transient_' . $wpdb->escape($transient);
+ $transient_option = '_transient_' . esc_sql($transient);
// If option is not in alloptions, it is not autoloaded and thus has a timeout
$alloptions = wp_load_alloptions();
if ( !isset( $alloptions[$transient_option] ) ) {
- $transient_timeout = '_transient_timeout_' . $wpdb->escape($transient);
+ $transient_timeout = '_transient_timeout_' . esc_sql($transient);
if ( get_option($transient_timeout) < time() ) {
delete_option($transient_option);
delete_option($transient_timeout);
} else {
$transient_timeout = '_transient_timeout_' . $transient;
$transient = '_transient_' . $transient;
- $safe_transient = $wpdb->escape($transient);
+ $safe_transient = esc_sql($transient);
if ( false === get_option( $safe_transient ) ) {
$autoload = 'yes';
if ( 0 != $expiration ) {
return $data;
}
-/**
- * Strip HTML and put links at the bottom of stripped content.
- *
- * Searches for all of the links, strips them out of the content, and places
- * them at the bottom of the content with numbers.
- *
- * @since 0.71
- *
- * @param string $content Content to get links
- * @return string HTML stripped out of content with links at the bottom.
- */
-function make_url_footnote( $content ) {
- preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches );
- $links_summary = "\n";
- for ( $i=0; $i<count($matches[0]); $i++ ) {
- $link_match = $matches[0][$i];
- $link_number = '['.($i+1).']';
- $link_url = $matches[2][$i];
- $link_text = $matches[4][$i];
- $content = str_replace( $link_match, $link_text . ' ' . $link_number, $content );
- $link_url = ( ( strtolower( substr( $link_url, 0, 7 ) ) != 'http://' ) && ( strtolower( substr( $link_url, 0, 8 ) ) != 'https://' ) ) ? get_option( 'home' ) . $link_url : $link_url;
- $links_summary .= "\n" . $link_number . ' ' . $link_url;
- }
- $content = strip_tags( $content );
- $content .= $links_summary;
- return $content;
-}
-
/**
* Retrieve post title from XMLRPC XML.
*
foreach ( $pung as $link_test ) {
if ( !in_array( $link_test, $post_links_temp[0] ) ) { // link no longer in post
- $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE (%s)", $post_ID, $link_test . '%') );
+ $mid = $wpdb->get_col( $wpdb->prepare("SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE (%s)", $post_ID, $link_test . '%') );
+ do_action( 'delete_postmeta', $mid );
+ $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE post_id IN(%s)", implode( ',', $mid ) ) );
+ do_action( 'deleted_postmeta', $mid );
}
}
if ( in_array( substr( $type, 0, strpos( $type, "/" ) ), $allowed_types ) ) {
$meta_value = "$url\n$len\n$type\n";
$wpdb->insert($wpdb->postmeta, array('post_id' => $post_ID, 'meta_key' => 'enclosure', 'meta_value' => $meta_value) );
+ do_action( 'added_postmeta', $wpdb->insert_id, $post_ID, 'enclosure', $meta_value );
}
}
}
if ( is_array( $v ) ) {
$array[$k] = add_magic_quotes( $v );
} else {
- $array[$k] = $wpdb->escape( $v );
+ $array[$k] = esc_sql( $v );
}
}
return $array;
$installed = !empty( $installed );
wp_cache_set( 'is_blog_installed', $installed );
- return $installed;
+ if ( $installed )
+ return true;
+
+ $suppress = $wpdb->suppress_errors();
+ $tables = $wpdb->get_col('SHOW TABLES');
+ $wpdb->suppress_errors( $suppress );
+
+ // Loop over the WP tables. If none exist, then scratch install is allowed.
+ // If one or more exist, suggest table repair since we got here because the options
+ // table could not be accessed.
+ foreach ($wpdb->tables as $table) {
+ // If one of the WP tables exist, then we are in an insane state.
+ if ( in_array($wpdb->prefix . $table, $tables) ) {
+ // If visiting repair.php, return true and let it take over.
+ if ( defined('WP_REPAIRING') )
+ return true;
+ // Die with a DB error.
+ $wpdb->error = __('One or more database tables are unavailable. The database may need to be <a href="maint/repair.php?referrer=is_blog_installed">repaired</a>.');
+ dead_db();
+ }
+ }
+
+ wp_cache_set( 'is_blog_installed', false );
+
+ return false;
}
/**
$siteurl = get_option( 'siteurl' );
$upload_path = get_option( 'upload_path' );
$upload_path = trim($upload_path);
- if ( empty($upload_path) )
+ if ( empty($upload_path) ) {
$dir = WP_CONTENT_DIR . '/uploads';
- else
+ } else {
$dir = $upload_path;
-
- // $dir is absolute, $path is (maybe) relative to ABSPATH
- $dir = path_join( ABSPATH, $dir );
+ if ( 'wp-content/uploads' == $upload_path ) {
+ $dir = WP_CONTENT_DIR . '/uploads';
+ } elseif ( 0 !== strpos($dir, ABSPATH) ) {
+ // $dir is absolute, $upload_path is (maybe) relative to ABSPATH
+ $dir = path_join( ABSPATH, $dir );
+ }
+ }
if ( !$url = get_option( 'upload_url_path' ) ) {
- if ( empty($upload_path) or ( $upload_path == $dir ) )
+ if ( empty($upload_path) || ( 'wp-content/uploads' == $upload_path ) || ( $upload_path == $dir ) )
$url = WP_CONTENT_URL . '/uploads';
else
$url = trailingslashit( $siteurl ) . $upload_path;
// separate the filename into a name and extension
$info = pathinfo($filename);
- $ext = !empty($info['extension']) ? $info['extension'] : '';
- $name = basename($filename, ".{$ext}");
+ $ext = !empty($info['extension']) ? '.' . $info['extension'] : '';
+ $name = basename($filename, $ext);
// edge case: if file is named '.ext', treat as an empty name
- if( $name === ".$ext" )
+ if( $name === $ext )
$name = '';
// Increment the file number until we have a unique file to save in $dir. Use $override['unique_filename_callback'] if supplied.
} else {
$number = '';
- if ( !empty( $ext ) )
- $ext = ".$ext";
+ // change '.ext' to lower case
+ if ( $ext && strtolower($ext) != $ext ) {
+ $ext2 = strtolower($ext);
+ $filename2 = preg_replace( '|' . preg_quote($ext) . '$|', $ext2, $filename );
+
+ // check for both lower and upper case extension or image sub-sizes may be overwritten
+ while ( file_exists($dir . "/$filename") || file_exists($dir . "/$filename2") ) {
+ $new_number = $number + 1;
+ $filename = str_replace( "$number$ext", "$new_number$ext", $filename );
+ $filename2 = str_replace( "$number$ext2", "$new_number$ext2", $filename2 );
+ $number = $new_number;
+ }
+ return $filename2;
+ }
while ( file_exists( $dir . "/$filename" ) ) {
if ( '' == "$number$ext" )
* @return array Values with extension first and mime type.
*/
function wp_check_filetype( $filename, $mimes = null ) {
- // Accepted MIME types are set here as PCRE unless provided.
- $mimes = ( is_array( $mimes ) ) ? $mimes : apply_filters( 'upload_mimes', array(
+ if ( empty($mimes) )
+ $mimes = get_allowed_mime_types();
+ $type = false;
+ $ext = false;
+
+ foreach ( $mimes as $ext_preg => $mime_match ) {
+ $ext_preg = '!\.(' . $ext_preg . ')$!i';
+ if ( preg_match( $ext_preg, $filename, $ext_matches ) ) {
+ $type = $mime_match;
+ $ext = $ext_matches[1];
+ break;
+ }
+ }
+
+ return compact( 'ext', 'type' );
+}
+
+/**
+ * Retrieve list of allowed mime types and file extensions.
+ *
+ * @since 2.8.6
+ *
+ * @return array Array of mime types keyed by the file extension regex corresponding to those types.
+ */
+function get_allowed_mime_types() {
+ static $mimes = false;
+
+ if ( !$mimes ) {
+ // Accepted MIME types are set here as PCRE unless provided.
+ $mimes = apply_filters( 'upload_mimes', array(
'jpg|jpeg|jpe' => 'image/jpeg',
'gif' => 'image/gif',
'png' => 'image/png',
'asf|asx|wax|wmv|wmx' => 'video/asf',
'avi' => 'video/avi',
'divx' => 'video/divx',
+ 'flv' => 'video/x-flv',
'mov|qt' => 'video/quicktime',
'mpeg|mpg|mpe' => 'video/mpeg',
'txt|c|cc|h' => 'text/plain',
'odc' => 'application/vnd.oasis.opendocument.chart',
'odb' => 'application/vnd.oasis.opendocument.database',
'odf' => 'application/vnd.oasis.opendocument.formula',
- )
- );
-
- $type = false;
- $ext = false;
-
- foreach ( $mimes as $ext_preg => $mime_match ) {
- $ext_preg = '!\.(' . $ext_preg . ')$!i';
- if ( preg_match( $ext_preg, $filename, $ext_matches ) ) {
- $type = $mime_match;
- $ext = $ext_matches[1];
- break;
- }
+ ) );
}
- return compact( 'ext', 'type' );
+ return $mimes;
}
/**
}
}
- return apply_filters( 'explain_nonce_' . $verb . '-' . $noun, __( 'Are you sure you want to do this?' ), $matches[4] );
+ return apply_filters( 'explain_nonce_' . $verb . '-' . $noun, __( 'Are you sure you want to do this?' ), isset($matches[4]) ? $matches[4] : '' );
} else {
return apply_filters( 'explain_nonce_' . $action, __( 'Are you sure you want to do this?' ) );
}
function wp_nonce_ays( $action ) {
$title = __( 'WordPress Failure Notice' );
$html = esc_html( wp_explain_nonce( $action ) );
- if ( wp_get_referer() )
- $html .= "</p><p><a href='" . esc_url( remove_query_arg( 'updated', wp_get_referer() ) ) . "'>" . __( 'Please try again.' ) . "</a>";
- elseif ( 'log-out' == $action )
+ if ( 'log-out' == $action )
$html .= "</p><p>" . sprintf( __( "Do you really want to <a href='%s'>log out</a>?"), wp_logout_url() );
+ elseif ( wp_get_referer() )
+ $html .= "</p><p><a href='" . esc_url( remove_query_arg( 'updated', wp_get_referer() ) ) . "'>" . __( 'Please try again.' ) . "</a>";
- wp_die( $html, $title);
+ wp_die( $html, $title, array('response' => 403) );
}
/**
if ( ( $wp_locale ) && ( 'rtl' == $wp_locale->text_direction ) ) $text_direction = 'rtl';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- Ticket #11289, IE bug fix: always pad the error page with enough characters such that it is greater than 512 bytes, even after gzip compression abcdefghijklmnopqrstuvwxyz1234567890aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz11223344556677889900abacbcbdcdcededfefegfgfhghgihihjijikjkjlklkmlmlnmnmononpopoqpqprqrqsrsrtstsubcbcdcdedefefgfabcadefbghicjkldmnoepqrfstugvwxhyz1i234j567k890laabmbccnddeoeffpgghqhiirjjksklltmmnunoovppqwqrrxsstytuuzvvw0wxx1yyz2z113223434455666777889890091abc2def3ghi4jkl5mno6pqr7stu8vwx9yz11aab2bcc3dd4ee5ff6gg7hh8ii9j0jk1kl2lmm3nnoo4p5pq6qrr7ss8tt9uuvv0wwx1x2yyzz13aba4cbcb5dcdc6dedfef8egf9gfh0ghg1ihi2hji3jik4jkj5lkl6kml7mln8mnm9ono -->
<html xmlns="http://www.w3.org/1999/xhtml" <?php if ( function_exists( 'language_attributes' ) ) language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php endif; ?>
<?php echo $message; ?>
</body>
-<!-- Ticket #8942, IE bug fix: always pad the error page with enough characters such that it is greater than 512 bytes, even after gzip compression abcdefghijklmnopqrstuvwxyz1234567890aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz11223344556677889900abacbcbdcdcededfefegfgfhghgihihjijikjkjlklkmlmlnmnmononpopoqpqprqrqsrsrtstsubcbcdcdedefefgfabcadefbghicjkldmnoepqrfstugvwxhyz1i234j567k890laabmbccnddeoeffpgghqhiirjjksklltmmnunoovppqwqrrxsstytuuzvvw0wxx1yyz2z113223434455666777889890091abc2def3ghi4jkl5mno6pqr7stu8vwx9yz11aab2bcc3dd4ee5ff6gg7hh8ii9j0jk1kl2lmm3nnoo4p5pq6qrr7ss8tt9uuvv0wwx1x2yyzz13aba4cbcb5dcdc6dedfef8egf9gfh0ghg1ihi2hji3jik4jkj5lkl6kml7mln8mnm9ono -->
</html>
<?php
die();
return $r;
}
+/**
+ * Determines if default embed handlers should be loaded.
+ *
+ * Checks to make sure that the embeds library hasn't already been loaded. If
+ * it hasn't, then it will load the embeds library.
+ *
+ * @since 2.9
+ */
+function wp_maybe_load_embeds() {
+ if ( ! apply_filters('load_default_embeds', true) )
+ return;
+ require_once( ABSPATH . WPINC . '/default-embeds.php' );
+}
+
/**
* Determines if Widgets library should be loaded.
*
* 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 true.
*
* This function is to be used in every function in depreceated.php
*
do_action('deprecated_function_run', $function, $replacement);
// Allow plugin to filter the output error trigger
- if( defined('WP_DEBUG') && ( true === WP_DEBUG ) && apply_filters( 'deprecated_function_trigger_error', true )) {
+ if( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true )) {
if( !is_null($replacement) )
trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
else
* 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 true.
*
* This function is to be used in every file that is depreceated
*
do_action('deprecated_file_included', $file, $replacement);
// Allow plugin to filter the output error trigger
- if( defined('WP_DEBUG') && ( true === WP_DEBUG ) && apply_filters( 'deprecated_file_trigger_error', true )) {
+ if( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) {
if( !is_null($replacement) )
trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) );
else
if ( false !== strpos( $file, './' ))
return 1;
- if (':' == substr( $file, 1, 1 ))
- return 2;
-
if (!empty ( $allowed_files ) && (!in_array( $file, $allowed_files ) ) )
return 3;
+ if (':' == substr( $file, 1, 1 ))
+ return 2;
+
return 0;
}
* @param string|bool $force Optional.
* @return bool True if forced, false if not forced.
*/
-function force_ssl_login($force = '') {
- static $forced;
+function force_ssl_login( $force = null ) {
+ static $forced = false;
- if ( '' != $force ) {
+ if ( !is_null( $force ) ) {
$old_forced = $forced;
$forced = $force;
return $old_forced;
* @param string|bool $force
* @return bool True if forced, false if not forced.
*/
-function force_ssl_admin($force = '') {
- static $forced;
+function force_ssl_admin( $force = null ) {
+ static $forced = false;
- if ( '' != $force ) {
+ if ( !is_null( $force ) ) {
$old_forced = $forced;
$forced = $force;
return $old_forced;
}
function get_site_option( $key, $default = false, $use_cache = true ) {
- return get_option($key, $default);
+ // Allow plugins to short-circuit site options.
+ $pre = apply_filters( 'pre_site_option_' . $key, false );
+ if ( false !== $pre )
+ return $pre;
+
+ $value = get_option($key, $default);
+
+ return apply_filters( 'site_option_' . $key, $value );
}
// expects $key, $value not to be SQL escaped
function add_site_option( $key, $value ) {
- return add_option($key, $value);
+ $value = apply_filters( 'pre_add_site_option_' . $key, $value );
+ $result = add_option($key, $value);
+ do_action( "add_site_option_{$key}", $key, $value );
+ return $result;
+}
+
+function delete_site_option( $key ) {
+ $result = delete_option($key);
+ do_action( "delete_site_option_{$key}", $key );
+ return $result;
}
// expects $key, $value not to be SQL escaped
function update_site_option( $key, $value ) {
- return update_option($key, $value);
+ $oldvalue = get_site_option( $key );
+ $value = apply_filters( 'pre_update_site_option_' . $key, $value, $oldvalue );
+ $result = update_option($key, $value);
+ do_action( "update_site_option_{$key}", $key, $value );
+ return $result;
+}
+
+/**
+ * Delete a site transient
+ *
+ * @since 2.890
+ * @package WordPress
+ * @subpackage Transient
+ *
+ * @param string $transient Transient name. Expected to not be SQL-escaped
+ * @return bool true if successful, false otherwise
+ */
+function delete_site_transient($transient) {
+ global $_wp_using_ext_object_cache, $wpdb;
+
+ if ( $_wp_using_ext_object_cache ) {
+ return wp_cache_delete($transient, 'site-transient');
+ } else {
+ $transient = '_site_transient_' . esc_sql($transient);
+ return delete_site_option($transient);
+ }
+}
+
+/**
+ * Get the value of a site transient
+ *
+ * If the transient does not exist or does not have a value, then the return value
+ * will be false.
+ *
+ * @since 2.9.0
+ * @package WordPress
+ * @subpackage Transient
+ *
+ * @param string $transient Transient name. Expected to not be SQL-escaped
+ * @return mixed Value of transient
+ */
+function get_site_transient($transient) {
+ global $_wp_using_ext_object_cache, $wpdb;
+
+ $pre = apply_filters( 'pre_site_transient_' . $transient, false );
+ if ( false !== $pre )
+ return $pre;
+
+ if ( $_wp_using_ext_object_cache ) {
+ $value = wp_cache_get($transient, 'site-transient');
+ } else {
+ $transient_option = '_site_transient_' . esc_sql($transient);
+ $transient_timeout = '_site_transient_timeout_' . esc_sql($transient);
+ if ( get_site_option($transient_timeout) < time() ) {
+ delete_site_option($transient_option);
+ delete_site_option($transient_timeout);
+ return false;
+ }
+
+ $value = get_site_option($transient_option);
+ }
+
+ return apply_filters('site_transient_' . $transient, $value);
+}
+
+/**
+ * Set/update the value of a site transient
+ *
+ * You do not need to serialize values, if the value needs to be serialize, then
+ * it will be serialized before it is set.
+ *
+ * @since 2.9.0
+ * @package WordPress
+ * @subpackage Transient
+ *
+ * @param string $transient Transient name. Expected to not be SQL-escaped
+ * @param mixed $value Transient value.
+ * @param int $expiration Time until expiration in seconds, default 0
+ * @return bool False if value was not set and true if value was set.
+ */
+function set_site_transient($transient, $value, $expiration = 0) {
+ global $_wp_using_ext_object_cache, $wpdb;
+
+ if ( $_wp_using_ext_object_cache ) {
+ return wp_cache_set($transient, $value, 'site-transient', $expiration);
+ } else {
+ $transient_timeout = '_site_transient_timeout_' . $transient;
+ $transient = '_site_transient_' . $transient;
+ $safe_transient = esc_sql($transient);
+ if ( false === get_site_option( $safe_transient ) ) {
+ if ( 0 != $expiration )
+ add_site_option($transient_timeout, time() + $expiration);
+ return add_site_option($transient, $value);
+ } else {
+ if ( 0 != $expiration )
+ update_site_option($transient_timeout, time() + $expiration);
+ return update_site_option($transient, $value);
+ }
+ }
}
/**
$display = $zone['t_continent'];
} else {
// It's inside a continent group
-
+
// Continent optgroup
if ( !isset( $zonen[$key - 1] ) || $zonen[$key - 1]['continent'] !== $zone['continent'] ) {
$label = ( 'Etc' === $zone['continent'] ) ? __( 'Manual offsets' ) : $zone['t_continent'];
$structure[] = '<optgroup label="'. esc_attr( $label ) .'">';
}
-
+
// Add the city to the value
$value[] = $zone['city'];
if ( 'Etc' === $zone['continent'] ) {
$selected = 'selected="selected" ';
}
$structure[] = '<option ' . $selected . 'value="' . esc_attr( $value ) . '">' . esc_html( $display ) . "</option>";
-
+
// Close continent optgroup
if ( !empty( $zone['city'] ) && ( !isset($zonen[$key + 1]) || (isset( $zonen[$key + 1] ) && $zonen[$key + 1]['continent'] !== $zone['continent']) ) ) {
$structure[] = '</optgroup>';
return join( "\n", $structure );
}
-
-
/**
* Strip close comment and close php tags from file headers used by WP
* See http://core.trac.wordpress.org/ticket/8497
function _cleanup_header_comment($str) {
return trim(preg_replace("/\s*(?:\*\/|\?>).*/", '', $str));
}
+
+/**
+ * Permanently deletes posts, pages, attachments, and comments which have been in the trash for EMPTY_TRASH_DAYS.
+ *
+ * @since 2.9.0
+ *
+ * @return void
+ */
+function wp_scheduled_delete() {
+ global $wpdb;
+
+ $delete_timestamp = time() - (60*60*24*EMPTY_TRASH_DAYS);
+
+ $posts_to_delete = $wpdb->get_results($wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < '%d'", $delete_timestamp), ARRAY_A);
+
+ foreach ( (array) $posts_to_delete as $post ) {
+ $post_id = (int) $post['post_id'];
+ if ( !$post_id )
+ continue;
+
+ $del_post = get_post($post_id);
+
+ if ( !$del_post || 'trash' != $del_post->post_status ) {
+ delete_post_meta($post_id, '_wp_trash_meta_status');
+ delete_post_meta($post_id, '_wp_trash_meta_time');
+ } else {
+ wp_delete_post($post_id);
+ }
+ }
+
+ $comments_to_delete = $wpdb->get_results($wpdb->prepare("SELECT comment_id FROM $wpdb->commentmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < '%d'", $delete_timestamp), ARRAY_A);
+
+ foreach ( (array) $comments_to_delete as $comment ) {
+ $comment_id = (int) $comment['comment_id'];
+ if ( !$comment_id )
+ continue;
+
+ $del_comment = get_comment($comment_id);
+
+ if ( !$del_comment || 'trash' != $del_comment->comment_approved ) {
+ delete_comment_meta($comment_id, '_wp_trash_meta_time');
+ delete_comment_meta($comment_id, '_wp_trash_meta_status');
+ } else {
+ wp_delete_comment($comment_id);
+ }
+ }
+}
+
+/**
+ * Parse the file contents to retrieve its metadata.
+ *
+ * Searches for metadata for a file, such as a plugin or theme. Each piece of
+ * metadata must be on its own line. For a field spanning multple lines, it
+ * must not have any newlines or only parts of it will be displayed.
+ *
+ * Some users have issues with opening large files and manipulating the contents
+ * for want is usually the first 1kiB or 2kiB. This function stops pulling in
+ * the file contents when it has all of the required data.
+ *
+ * The first 8kiB of the file will be pulled in and if the file data is not
+ * within that first 8kiB, then the author should correct their plugin file
+ * and move the data headers to the top.
+ *
+ * The file is assumed to have permissions to allow for scripts to read
+ * the file. This is not checked however and the file is only opened for
+ * reading.
+ *
+ * @since 2.9.0
+ *
+ * @param string $file Path to the file
+ * @param bool $markup If the returned data should have HTML markup applied
+ * @param string $context If specified adds filter hook "extra_<$context>_headers"
+ */
+function get_file_data( $file, $default_headers, $context = '' ) {
+ // We don't need to write to the file, so just open for reading.
+ $fp = fopen( $file, 'r' );
+
+ // Pull only the first 8kiB of the file in.
+ $file_data = fread( $fp, 8192 );
+
+ // PHP will close file handle, but we are good citizens.
+ fclose( $fp );
+
+ if( $context != '' ) {
+ $extra_headers = apply_filters( "extra_$context".'_headers', array() );
+
+ $extra_headers = array_flip( $extra_headers );
+ foreach( $extra_headers as $key=>$value ) {
+ $extra_headers[$key] = $key;
+ }
+ $all_headers = array_merge($extra_headers, $default_headers);
+ } else {
+ $all_headers = $default_headers;
+ }
+
+
+ foreach ( $all_headers as $field => $regex ) {
+ preg_match( '/' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, ${$field});
+ if ( !empty( ${$field} ) )
+ ${$field} = _cleanup_header_comment( ${$field}[1] );
+ else
+ ${$field} = '';
+ }
+
+ $file_data = compact( array_keys( $all_headers ) );
+
+ return $file_data;
+}
+/*
+ * Used internally to tidy up the search terms
+ *
+ * @private
+ * @since 2.9.0
+ */
+function _search_terms_tidy($t) {
+ return trim($t, "\"\'\n\r ");
+}
?>
function wp_logout_url($redirect = '') {
$args = array( 'action' => 'logout' );
if ( !empty($redirect) ) {
- $args['redirect_to'] = $redirect;
+ $args['redirect_to'] = urlencode( $redirect );
}
$logout_url = add_query_arg($args, site_url('wp-login.php', 'login'));
$afterafter = $after;
foreach ( (array) $arcresults as $arcresult ) {
$url = get_month_link( $arcresult->year, $arcresult->month );
+ /* translators: 1: month name, 2: 4-digit year */
$text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year);
if ( $show_post_count )
$after = ' ('.$arcresult->posts.')' . $afterafter;
add_action( 'delete_post', 'delete_get_calendar_cache' );
add_action( 'update_option_start_of_week', 'delete_get_calendar_cache' );
add_action( 'update_option_gmt_offset', 'delete_get_calendar_cache' );
-add_action( 'update_option_start_of_week', 'delete_get_calendar_cache' );
/**
* Display all of the allowed tags in HTML format with attributes.
* @return string
*/
function get_search_query() {
- return apply_filters( 'get_search_query', stripslashes( get_query_var( 's' ) ) );
+ return apply_filters( 'get_search_query', get_query_var( 's' ) );
}
/**
return apply_filters( "get_the_generator_{$type}", $gen, $type );
}
-?>
+?>
\ No newline at end of file
+++ /dev/null
-<?php
-/**
- * PHP-Gettext External Library: gettext_reader class
- *
- * @package External
- * @subpackage PHP-gettext
- *
- * @internal
- Copyright (c) 2003 Danilo Segan <danilo@kvota.net>.
- Copyright (c) 2005 Nico Kaiser <nico@siriux.net>
-
- This file is part of PHP-gettext.
-
- PHP-gettext is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PHP-gettext is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PHP-gettext; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-/**
- * Provides a simple gettext replacement that works independently from
- * the system's gettext abilities.
- * It can read MO files and use them for translating strings.
- * The files are passed to gettext_reader as a Stream (see streams.php)
- *
- * This version has the ability to cache all strings and translations to
- * speed up the string lookup.
- * While the cache is enabled by default, it can be switched off with the
- * second parameter in the constructor (e.g. whenusing very large MO files
- * that you don't want to keep in memory)
- */
-class gettext_reader {
- //public:
- var $error = 0; // public variable that holds error code (0 if no error)
-
- //private:
- var $BYTEORDER = 0; // 0: low endian, 1: big endian
- var $STREAM = NULL;
- var $short_circuit = false;
- var $enable_cache = false;
- var $originals = NULL; // offset of original table
- var $translations = NULL; // offset of translation table
- var $pluralheader = NULL; // cache header field for plural forms
- var $select_string_function = NULL; // cache function, which chooses plural forms
- var $total = 0; // total string count
- var $table_originals = NULL; // table for original strings (offsets)
- var $table_translations = NULL; // table for translated strings (offsets)
- var $cache_translations = NULL; // original -> translation mapping
-
-
- /* Methods */
-
-
- /**
- * Reads a 32bit Integer from the Stream
- *
- * @access private
- * @return Integer from the Stream
- */
- function readint() {
- if ($this->BYTEORDER == 0) {
- // low endian
- $low_end = unpack('V', $this->STREAM->read(4));
- return array_shift($low_end);
- } else {
- // big endian
- $big_end = unpack('N', $this->STREAM->read(4));
- return array_shift($big_end);
- }
- }
-
- /**
- * Reads an array of Integers from the Stream
- *
- * @param int count How many elements should be read
- * @return Array of Integers
- */
- function readintarray($count) {
- if ($this->BYTEORDER == 0) {
- // low endian
- return unpack('V'.$count, $this->STREAM->read(4 * $count));
- } else {
- // big endian
- return unpack('N'.$count, $this->STREAM->read(4 * $count));
- }
- }
-
- /**
- * Constructor
- *
- * @param object Reader the StreamReader object
- * @param boolean enable_cache Enable or disable caching of strings (default on)
- */
- function gettext_reader($Reader, $enable_cache = true) {
- // If there isn't a StreamReader, turn on short circuit mode.
- if (! $Reader || isset($Reader->error) ) {
- $this->short_circuit = true;
- return;
- }
-
- // Caching can be turned off
- $this->enable_cache = $enable_cache;
-
- // $MAGIC1 = (int)0x950412de; //bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565
- $MAGIC1 = (int) - 1794895138;
- // $MAGIC2 = (int)0xde120495; //bug
- $MAGIC2 = (int) - 569244523;
- // 64-bit fix
- $MAGIC3 = (int) 2500072158;
-
- $this->STREAM = $Reader;
- $magic = $this->readint();
- if ($magic == $MAGIC1 || $magic == $MAGIC3) { // to make sure it works for 64-bit platforms
- $this->BYTEORDER = 0;
- } elseif ($magic == ($MAGIC2 & 0xFFFFFFFF)) {
- $this->BYTEORDER = 1;
- } else {
- $this->error = 1; // not MO file
- return false;
- }
-
- // FIXME: Do we care about revision? We should.
- $revision = $this->readint();
-
- $this->total = $this->readint();
- $this->originals = $this->readint();
- $this->translations = $this->readint();
- }
-
- /**
- * Loads the translation tables from the MO file into the cache
- * If caching is enabled, also loads all strings into a cache
- * to speed up translation lookups
- *
- * @access private
- */
- function load_tables() {
- if (is_array($this->cache_translations) &&
- is_array($this->table_originals) &&
- is_array($this->table_translations))
- return;
-
- /* get original and translations tables */
- $this->STREAM->seekto($this->originals);
- $this->table_originals = $this->readintarray($this->total * 2);
- $this->STREAM->seekto($this->translations);
- $this->table_translations = $this->readintarray($this->total * 2);
-
- if ($this->enable_cache) {
- $this->cache_translations = array ();
- /* read all strings in the cache */
- for ($i = 0; $i < $this->total; $i++) {
- $this->STREAM->seekto($this->table_originals[$i * 2 + 2]);
- $original = $this->STREAM->read($this->table_originals[$i * 2 + 1]);
- $this->STREAM->seekto($this->table_translations[$i * 2 + 2]);
- $translation = $this->STREAM->read($this->table_translations[$i * 2 + 1]);
- $this->cache_translations[$original] = $translation;
- }
- }
- }
-
- /**
- * Returns a string from the "originals" table
- *
- * @access private
- * @param int num Offset number of original string
- * @return string Requested string if found, otherwise ''
- */
- function get_original_string($num) {
- $length = $this->table_originals[$num * 2 + 1];
- $offset = $this->table_originals[$num * 2 + 2];
- if (! $length)
- return '';
- $this->STREAM->seekto($offset);
- $data = $this->STREAM->read($length);
- return (string)$data;
- }
-
- /**
- * Returns a string from the "translations" table
- *
- * @access private
- * @param int num Offset number of original string
- * @return string Requested string if found, otherwise ''
- */
- function get_translation_string($num) {
- $length = $this->table_translations[$num * 2 + 1];
- $offset = $this->table_translations[$num * 2 + 2];
- if (! $length)
- return '';
- $this->STREAM->seekto($offset);
- $data = $this->STREAM->read($length);
- return (string)$data;
- }
-
- /**
- * Binary search for string
- *
- * @access private
- * @param string string
- * @param int start (internally used in recursive function)
- * @param int end (internally used in recursive function)
- * @return int string number (offset in originals table)
- */
- function find_string($string, $start = -1, $end = -1) {
- if (($start == -1) or ($end == -1)) {
- // find_string is called with only one parameter, set start end end
- $start = 0;
- $end = $this->total;
- }
- if (abs($start - $end) <= 1) {
- // We're done, now we either found the string, or it doesn't exist
- $txt = $this->get_original_string($start);
- if ($string == $txt)
- return $start;
- else
- return -1;
- } else if ($start > $end) {
- // start > end -> turn around and start over
- return $this->find_string($string, $end, $start);
- } else {
- // Divide table in two parts
- $half = (int)(($start + $end) / 2);
- $cmp = strcmp($string, $this->get_original_string($half));
- if ($cmp == 0)
- // string is exactly in the middle => return it
- return $half;
- else if ($cmp < 0)
- // The string is in the upper half
- return $this->find_string($string, $start, $half);
- else
- // The string is in the lower half
- return $this->find_string($string, $half, $end);
- }
- }
-
- /**
- * Translates a string
- *
- * @access public
- * @param string string to be translated
- * @return string translated string (or original, if not found)
- */
- function translate($string) {
- if ($this->short_circuit)
- return $string;
- $this->load_tables();
-
- if ($this->enable_cache) {
- // Caching enabled, get translated string from cache
- if (array_key_exists($string, $this->cache_translations))
- return $this->cache_translations[$string];
- else
- return $string;
- } else {
- // Caching not enabled, try to find string
- $num = $this->find_string($string);
- if ($num == -1)
- return $string;
- else
- return $this->get_translation_string($num);
- }
- }
-
- /**
- * Get possible plural forms from MO header
- *
- * @access private
- * @return string plural form header
- */
- function get_plural_forms() {
- // lets assume message number 0 is header
- // this is true, right?
- $this->load_tables();
-
- // cache header field for plural forms
- if (! is_string($this->pluralheader)) {
- if ($this->enable_cache) {
- $header = $this->cache_translations[""];
- } else {
- $header = $this->get_translation_string(0);
- }
- $header .= "\n"; //make sure our regex matches
- if (eregi("plural-forms: ([^\n]*)\n", $header, $regs))
- $expr = $regs[1];
- else
- $expr = "nplurals=2; plural=n == 1 ? 0 : 1;";
-
- // add parentheses
- // important since PHP's ternary evaluates from left to right
- $expr.= ';';
- $res= '';
- $p= 0;
- for ($i= 0; $i < strlen($expr); $i++) {
- $ch= $expr[$i];
- switch ($ch) {
- case '?':
- $res.= ' ? (';
- $p++;
- break;
- case ':':
- $res.= ') : (';
- break;
- case ';':
- $res.= str_repeat( ')', $p) . ';';
- $p= 0;
- break;
- default:
- $res.= $ch;
- }
- }
- $this->pluralheader = $res;
- }
-
- return $this->pluralheader;
- }
-
- /**
- * Detects which plural form to take
- *
- * @access private
- * @param n count
- * @return int array index of the right plural form
- */
- function select_string($n) {
- if (is_null($this->select_string_function)) {
- $string = $this->get_plural_forms();
- if (preg_match("/nplurals\s*=\s*(\d+)\s*\;\s*plural\s*=\s*(.*?)\;+/", $string, $matches)) {
- $nplurals = $matches[1];
- $expression = $matches[2];
- $expression = str_replace("n", '$n', $expression);
- } else {
- $nplurals = 2;
- $expression = ' $n == 1 ? 0 : 1 ';
- }
- $func_body = "
- \$plural = ($expression);
- return (\$plural <= $nplurals)? \$plural : \$plural - 1;";
- $this->select_string_function = create_function('$n', $func_body);
- }
- return call_user_func($this->select_string_function, $n);
- }
-
- /**
- * Plural version of gettext
- *
- * @access public
- * @param string single
- * @param string plural
- * @param string number
- * @return translated plural form
- */
- function ngettext($single, $plural, $number) {
- if ($this->short_circuit) {
- if ($number != 1)
- return $plural;
- else
- return $single;
- }
-
- // find out the appropriate form
- $select = $this->select_string($number);
-
- // this should contains all strings separated by NULLs
- $key = $single.chr(0).$plural;
-
-
- if ($this->enable_cache) {
- if (! array_key_exists($key, $this->cache_translations)) {
- return ($number != 1) ? $plural : $single;
- } else {
- $result = $this->cache_translations[$key];
- $list = explode(chr(0), $result);
- return $list[$select];
- }
- } else {
- $num = $this->find_string($key);
- if ($num == -1) {
- return ($number != 1) ? $plural : $single;
- } else {
- $result = $this->get_translation_string($num);
- $list = explode(chr(0), $result);
- return $list[$select];
- }
- }
- }
-
-}
-
-?>
\ No newline at end of file
}
}
- if ( has_filter('http_transport_get_debug') )
- do_action('http_transport_get_debug', $working_transport, $blocking_transport, $nonblocking_transport);
+ do_action( 'http_transport_get_debug', $working_transport, $blocking_transport, $nonblocking_transport );
if ( isset($args['blocking']) && !$args['blocking'] )
return $nonblocking_transport;
}
}
- if ( has_filter('http_transport_post_debug') )
- do_action('http_transport_post_debug', $working_transport, $blocking_transport, $nonblocking_transport);
+ do_action( 'http_transport_post_debug', $working_transport, $blocking_transport, $nonblocking_transport );
if ( isset($args['blocking']) && !$args['blocking'] )
return $nonblocking_transport;
*
* @access public
* @since 2.7.0
+ * @todo Refactor this code. The code in this method extends the scope of its original purpose
+ * and should be refactored to allow for cleaner abstraction and reduce duplication of the
+ * code. One suggestion is to create a class specifically for the arguments, however
+ * preliminary refactoring to this affect has affect more than just the scope of the
+ * arguments. Something to ponder at least.
*
* @param string $url URI resource.
* @param str|array $args Optional. Override the defaults.
$r = wp_parse_args( $args, $defaults );
$r = apply_filters( 'http_request_args', $r, $url );
+ // Allow plugins to short-circuit the request
+ $pre = apply_filters( 'pre_http_request', false, $r, $url );
+ if ( false !== $pre )
+ return $pre;
+
$arrURL = parse_url($url);
if ( $this->block_request( $url ) )
if ( WP_Http_Encoding::is_available() )
$r['headers']['Accept-Encoding'] = WP_Http_Encoding::accept_encoding();
- if ( is_null($r['body']) ) {
- // Some servers fail when sending content without the content-length
- // header being set.
- $r['headers']['Content-Length'] = 0;
+ if ( empty($r['body']) ) {
+ // Some servers fail when sending content without the content-length header being set.
+ // Also, to fix another bug, we only send when doing POST and PUT and the content-length
+ // header isn't already set.
+ if( ($r['method'] == 'POST' || $r['method'] == 'PUT') && ! isset($r['headers']['Content-Length']) )
+ $r['headers']['Content-Length'] = 0;
+
+ // The method is ambiguous, because we aren't talking about HTTP methods, the "get" in
+ // this case is simply that we aren't sending any bodies and to get the transports that
+ // don't support sending bodies along with those which do.
$transports = WP_Http::_getTransport($r);
} else {
if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) {
if ( ! isset( $r['headers']['Content-Length'] ) && ! isset( $r['headers']['content-length'] ) )
$r['headers']['Content-Length'] = strlen($r['body']);
+ // The method is ambiguous, because we aren't talking about HTTP methods, the "post" in
+ // this case is simply that we are sending HTTP body and to get the transports that do
+ // support sending the body. Not all do, depending on the limitations of the PHP core
+ // limitations.
$transports = WP_Http::_postTransport($r);
}
- if ( has_action('http_api_debug') )
- do_action('http_api_debug', $transports, 'transports_list');
+ do_action( 'http_api_debug', $transports, 'transports_list' );
$response = array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() );
foreach ( (array) $transports as $transport ) {
$response = $transport->request($url, $r);
- if ( has_action('http_api_debug') )
- do_action( 'http_api_debug', $response, 'response', get_class($transport) );
+ do_action( 'http_api_debug', $response, 'response', get_class($transport) );
if ( ! is_wp_error($response) )
- return $response;
+ return apply_filters( 'http_response', $response, $r, $url );
}
return $response;
}
}
+ //fsockopen has issues with 'localhost' with IPv6 with certain versions of PHP, It attempts to connect to ::1,
+ // which fails when the server is not setup for it. For compatibility, always connect to the IPv4 address.
+ if ( 'localhost' == strtolower($fsockopen_host) )
+ $fsockopen_host = '127.0.0.1';
+
// There are issues with the HTTPS and SSL protocols that cause errors that can be safely
// ignored and should be ignored.
if ( true === $secure_transport )
$proxy = new WP_HTTP_Proxy();
- if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) ) {
+ if ( !WP_DEBUG ) {
if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) )
$handle = @fsockopen( $proxy->host(), $proxy->port(), $iError, $strError, $r['timeout'] );
else
if ( false === $handle )
return new WP_Error('http_request_failed', $iError . ': ' . $strError);
- stream_set_timeout($handle, $r['timeout'] );
+ $timeout = (int) floor( $r['timeout'] );
+ $utimeout = $timeout == $r['timeout'] ? 0 : 1000000 * $r['timeout'] % 1000000;
+ stream_set_timeout( $handle, $timeout, $utimeout );
if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) //Some proxies require full URL in this field.
$requestPath = $url;
if ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] )
$url = str_replace($arrURL['scheme'], 'http', $url);
- if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) )
+ if ( !WP_DEBUG )
$handle = @fopen($url, 'r');
else
$handle = fopen($url, 'r');
if (! $handle)
return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url));
- stream_set_timeout($handle, $r['timeout'] );
+ $timeout = (int) floor( $r['timeout'] );
+ $utimeout = $timeout == $r['timeout'] ? 0 : 1000000 * $r['timeout'] % 1000000;
+ stream_set_timeout( $handle, $timeout, $utimeout );
if ( ! $r['blocking'] ) {
fclose($handle);
$context = stream_context_create($arrContext);
- if ( ! defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) )
+ if ( !WP_DEBUG )
$handle = @fopen($url, 'r', false, $context);
else
$handle = fopen($url, 'r', false, $context);
if ( ! $handle)
return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url));
- // WordPress supports PHP 4.3, which has this function. Removed sanity checking for
- // performance reasons.
- stream_set_timeout($handle, $r['timeout'] );
+ $timeout = (int) floor( $r['timeout'] );
+ $utimeout = $timeout == $r['timeout'] ? 0 : 1000000 * $r['timeout'] % 1000000;
+ stream_set_timeout( $handle, $timeout, $utimeout );
if ( ! $r['blocking'] ) {
stream_set_blocking($handle, 0);
case 'HEAD':
$r['method'] = HTTP_METH_HEAD;
break;
+ case 'PUT':
+ $r['method'] = HTTP_METH_PUT;
+ break;
case 'GET':
default:
$r['method'] = HTTP_METH_GET;
elseif ( ! $is_local )
$ssl_verify = apply_filters('https_ssl_verify', $ssl_verify);
+ $r['timeout'] = (int) ceil( $r['timeout'] );
+
$options = array(
'timeout' => $r['timeout'],
'connecttimeout' => $r['timeout'],
}
}
- if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) ) //Emits warning level notices for max redirects and timeouts
+ if ( !WP_DEBUG ) //Emits warning level notices for max redirects and timeouts
$strResponse = @http_request($r['method'], $url, $r['body'], $options, $info);
else
$strResponse = http_request($r['method'], $url, $r['body'], $options, $info); //Emits warning level notices for max redirects and timeouts
$theHeaders = WP_Http::processHeaders($theHeaders);
if ( ! empty( $theBody ) && isset( $theHeaders['headers']['transfer-encoding'] ) && 'chunked' == $theHeaders['headers']['transfer-encoding'] ) {
- if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) )
+ if ( !WP_DEBUG )
$theBody = @http_chunked_decode($theBody);
else
$theBody = http_chunked_decode($theBody);
// Construct Cookie: header if any cookies are set.
WP_Http::buildCookieHeader( $r );
- // cURL extension will sometimes fail when the timeout is less than 1 as it may round down
- // to 0, which gives it unlimited timeout.
- if ( $r['timeout'] > 0 && $r['timeout'] < 1 )
- $r['timeout'] = 1;
-
$handle = curl_init();
// cURL offers really easy proxy support.
elseif ( ! $is_local )
$ssl_verify = apply_filters('https_ssl_verify', $ssl_verify);
+
+ // CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT expect integers. Have to use ceil since
+ // a value of 0 will allow an ulimited timeout.
+ // Use _MS if available.
+ if ( defined( 'CURLOPT_TIMEOUT_MS' ) ) {
+ $timeout_ms = (int) ceil( 1000 * $r['timeout'] );
+ curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT_MS, $timeout_ms );
+ curl_setopt( $handle, CURLOPT_TIMEOUT_MS, $timeout_ms );
+ } else {
+ $timeout = (int) ceil( $r['timeout'] );
+ curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout );
+ curl_setopt( $handle, CURLOPT_TIMEOUT, $timeout );
+ }
+
curl_setopt( $handle, CURLOPT_URL, $url);
curl_setopt( $handle, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, $ssl_verify );
curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, $ssl_verify );
curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] );
- curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $r['timeout'] );
- curl_setopt( $handle, CURLOPT_TIMEOUT, $r['timeout'] );
curl_setopt( $handle, CURLOPT_MAXREDIRS, $r['redirection'] );
switch ( $r['method'] ) {
curl_setopt( $handle, CURLOPT_POST, true );
curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
break;
+ case 'PUT':
+ curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, 'PUT' );
+ curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
+ break;
}
if ( true === $r['blocking'] )
$theResponse = curl_exec( $handle );
if ( !empty($theResponse) ) {
- $parts = explode("\r\n\r\n", $theResponse);
-
$headerLength = curl_getinfo($handle, CURLINFO_HEADER_SIZE);
$theHeaders = trim( substr($theResponse, 0, $headerLength) );
$theBody = substr( $theResponse, $headerLength );
* @return string|bool False on failure.
*/
function decompress( $compressed, $length = null ) {
- $decompressed = gzinflate( $compressed );
+ $decompressed = WP_Http_Encoding::compatible_gzinflate( $compressed );
if ( false !== $decompressed )
return $decompressed;
return $compressed;
}
+ /**
+ * Decompression of deflated string while staying compatible with the majority of servers.
+ *
+ * Certain Servers will return deflated data with headers which PHP's gziniflate()
+ * function cannot handle out of the box. The following function lifted from
+ * http://au2.php.net/manual/en/function.gzinflate.php#77336 will attempt to deflate
+ * the various return forms used.
+ *
+ * @since 2.8.1
+ * @link http://au2.php.net/manual/en/function.gzinflate.php#77336
+ *
+ * @param string $gzData String to decompress.
+ * @return string|bool False on failure.
+ */
+ function compatible_gzinflate($gzData) {
+ if ( substr($gzData, 0, 3) == "\x1f\x8b\x08" ) {
+ $i = 10;
+ $flg = ord( substr($gzData, 3, 1) );
+ if ( $flg > 0 ) {
+ if ( $flg & 4 ) {
+ list($xlen) = unpack('v', substr($gzData, $i, 2) );
+ $i = $i + 2 + $xlen;
+ }
+ if ( $flg & 8 )
+ $i = strpos($gzData, "\0", $i) + 1;
+ if ( $flg & 16 )
+ $i = strpos($gzData, "\0", $i) + 1;
+ if ( $flg & 2 )
+ $i = $i + 2;
+ }
+ return gzinflate( substr($gzData, $i, -8) );
+ } else {
+ return false;
+ }
+ }
+
/**
* What encoding types to accept and their priority values.
*
-var autosave, autosaveLast = '', autosavePeriodical, autosaveOldMessage = '', autosaveDelayPreview = false, notSaved = true;
+var autosave, autosaveLast = '', autosavePeriodical, autosaveOldMessage = '', autosaveDelayPreview = false, notSaved = true, blockSave = false, interimLogin = false;
jQuery(document).ready( function($) {
var dotabkey = true;
autosavePeriodical = $.schedule({time: autosaveL10n.autosaveInterval * 1000, func: function() { autosave(); }, repeat: true, protect: true});
//Disable autosave after the form has been submitted
- $("#post").submit(function() { $.cancel(autosavePeriodical); });
+ $("#post").submit(function() {
+ $.cancel(autosavePeriodical);
+ });
- $('.submitbox input[type="submit"], .submitbox a.submitdelete').click(function(){window.onbeforeunload = null;});
+ $('input[type="submit"], a.submitdelete', '#submitpost').click(function(){
+ blockSave = true;
+ window.onbeforeunload = null;
+ $(':button, :submit', '#submitpost').each(function(){
+ var t = $(this);
+ if ( t.hasClass('button-primary') )
+ t.addClass('button-primary-disabled');
+ else
+ t.addClass('button-disabled');
+ });
+ $('#ajax-loading').css('visibility', 'visible');
+ });
window.onbeforeunload = function(){
var mce = typeof(tinyMCE) != 'undefined' ? tinyMCE.activeEditor : false, title, content;
}
});
}
+
+ // autosave new posts after a title is typed but not if Publish or Save Draft is clicked
+ if ( 0 > $('#post_ID').val() ) {
+ $('#title').blur( function() {
+ if ( !this.value || 0 < $('#post_ID').val() )
+ return;
+
+ delayed_autosave();
+ });
+ }
});
function autosave_parse_response(response) {
- var res = wpAjax.parseAjaxResponse(response, 'autosave'), message = '', postID;
+ var res = wpAjax.parseAjaxResponse(response, 'autosave'), message = '', postID, sup, url;
if ( res && res.responses && res.responses.length ) {
message = res.responses[0].data; // The saved message or error.
// someone else is editing: disable autosave, set errors
if ( res.responses[0].supplemental ) {
- if ( 'disable' == res.responses[0].supplemental['disable_autosave'] ) {
+ sup = res.responses[0].supplemental;
+ if ( 'disable' == sup['disable_autosave'] ) {
autosave = function() {};
res = { errors: true };
}
- jQuery.each(res.responses[0].supplemental, function(selector, value) {
+ if ( sup['session_expired'] && (url = sup['session_expired']) ) {
+ if ( !interimLogin || interimLogin.closed ) {
+ interimLogin = window.open(url, 'login', 'width=600,height=450,resizable=yes,scrollbars=yes,status=yes');
+ interimLogin.focus();
+ }
+ delete sup['session_expired'];
+ }
+ jQuery.each(sup, function(selector, value) {
if ( selector.match(/^replace-/) ) {
jQuery('#'+selector.replace('replace-', '')).val(value);
}
autosavenonce: jQuery('#autosavenonce').val(),
post_type: jQuery('#post_type').val()
}, function(html) {
- jQuery('#_wpnonce').val(html);
+ jQuery('#_wpnonce').val(html.updateNonce);
+ jQuery('#delete-action a.submitdelete').attr('href', html.deleteURL);
autosave_enable_buttons(); // re-enable disabled form buttons
- });
+ jQuery('#delete-action a.submitdelete').fadeIn();
+ },
+ 'json');
jQuery('#hiddenaction').val('editpost');
}
}
function autosave_update_slug(post_id) {
// create slug area only if not already there
- if ( jQuery.isFunction(make_slugedit_clickable) && !jQuery('#edit-slug-box > *').size() ) {
+ if ( 'undefined' != makeSlugeditClickable && jQuery.isFunction(makeSlugeditClickable) && !jQuery('#edit-slug-box > *').size() ) {
jQuery.post(
- slugL10n.requestFile,
+ ajaxurl,
{
action: 'sample-permalink',
post_id: post_id,
},
function(data) {
jQuery('#edit-slug-box').html(data);
- make_slugedit_clickable();
+ makeSlugeditClickable();
}
);
}
}
function autosave_enable_buttons() {
- jQuery(".submitbox :button:disabled, .submitbox :submit:disabled").attr('disabled', '');
+ // delay that a bit to avoid some rare collisions while the DOM is being updated.
+ setTimeout(function(){
+ jQuery(':button, :submit', '#submitpost').removeAttr('disabled');
+ jQuery('#ajax-loading').css('visibility', 'hidden');
+ }, 500);
}
function autosave_disable_buttons() {
- jQuery(".submitbox :button:enabled, .submitbox :submit:enabled").attr('disabled', 'disabled');
+ jQuery(':button, :submit', '#submitpost').attr('disabled', 'disabled');
// Re-enable 5 sec later. Just gives autosave a head start to avoid collisions.
setTimeout(autosave_enable_buttons, 5000);
}
+function delayed_autosave() {
+ setTimeout(function(){
+ if ( blockSave )
+ return;
+ autosave();
+ }, 200);
+}
+
autosave = function() {
// (bool) is rich editor enabled and active
var rich = (typeof tinyMCE != "undefined") && tinyMCE.activeEditor && !tinyMCE.activeEditor.isHidden(), post_data, doAutoSave, ed, origStatus, successCallback;
+ autosave_disable_buttons();
+
post_data = {
action: "autosave",
post_ID: jQuery("#post_ID").val() || 0,
post_title: jQuery("#title").val() || "",
autosavenonce: jQuery('#autosavenonce').val(),
- //tags_input: jQuery("#tags-input").val() || "",
post_type: jQuery('#post_type').val() || "",
autosave: 1
};
doAutoSave = false;
/* Gotta do this up here so we can check the length when tinyMCE is in use */
- if ( rich ) {
+ if ( rich && doAutoSave ) {
ed = tinyMCE.activeEditor;
- if ( 'mce_fullscreen' == ed.id )
- tinyMCE.get('content').setContent(ed.getContent({format : 'raw'}), {format : 'raw'});
- tinyMCE.get('content').save();
+ // Don't run while the TinyMCE spellcheck is on. It resets all found words.
+ if ( ed.plugins.spellchecker && ed.plugins.spellchecker.active ) {
+ doAutoSave = false;
+ } else {
+ 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();
post_data["post_name"] = jQuery('#post_name').val();
// Nothing to save or no change.
- if( ( post_data["post_title"].length == 0 && post_data["content"].length == 0 ) || post_data["post_title"] + post_data["content"] == autosaveLast) {
+ if ( ( post_data["post_title"].length == 0 && post_data["content"].length == 0 ) || post_data["post_title"] + post_data["content"] == autosaveLast ) {
doAutoSave = false;
}
- autosave_disable_buttons();
-
origStatus = jQuery('#original_post_status').val();
- autosaveLast = jQuery("#title").val()+jQuery("#content").val();
goodcats = ([]);
jQuery("[name='post_category[]']:checked").each( function(i) {
goodcats.push(this.value);
post_data["post_author"] = jQuery("#post_author").val();
post_data["user_ID"] = jQuery("#user-id").val();
- // Don't run while the TinyMCE spellcheck is on. It resets all found words.
- if ( rich && tinyMCE.activeEditor.plugins.spellchecker && tinyMCE.activeEditor.plugins.spellchecker.active ) {
- doAutoSave = false;
+ if ( doAutoSave ) {
+ autosaveLast = jQuery("#title").val()+jQuery("#content").val();
+ } else {
+ post_data['autosave'] = 0;
}
if ( parseInt(post_data["post_ID"], 10) < 1 ) {
successCallback = autosave_saved; // pre-existing post
}
- if ( !doAutoSave ) {
- post_data['autosave'] = 0;
- }
-
autosaveOldMessage = jQuery('#autosave').html();
jQuery.ajax({
-var autosave,autosaveLast="",autosavePeriodical,autosaveOldMessage="",autosaveDelayPreview=false,notSaved=true;jQuery(document).ready(function(b){var a=true;autosaveLast=b("#post #title").val()+b("#post #content").val();autosavePeriodical=b.schedule({time:autosaveL10n.autosaveInterval*1000,func:function(){autosave()},repeat:true,protect:true});b("#post").submit(function(){b.cancel(autosavePeriodical)});b('.submitbox input[type="submit"], .submitbox a.submitdelete').click(function(){window.onbeforeunload=null});window.onbeforeunload=function(){var c=typeof(tinyMCE)!="undefined"?tinyMCE.activeEditor:false,e,d;if(c&&!c.isHidden()){if(c.isDirty()){return autosaveL10n.saveAlert}}else{e=b("#post #title").val(),d=b("#post #content").val();if((e||d)&&e+d!=autosaveLast){return autosaveL10n.saveAlert}}};b("#post-preview").click(function(){if(1>b("#post_ID").val()&¬Saved){autosaveDelayPreview=true;autosave();return false}doPreview();return false});doPreview=function(){b("input#wp-preview").val("dopreview");b("form#post").attr("target","wp-preview").submit().attr("target","");b("input#wp-preview").val("")};if(typeof tinyMCE!="undefined"){b("#title")[b.browser.opera?"keypress":"keydown"](function(c){if(c.which==9&&!c.shiftKey&&!c.controlKey&&!c.altKey){if((b("#post_ID").val()<1)&&(b("#title").val().length>0)){autosave()}if(tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden()&&a){c.preventDefault();a=false;tinyMCE.activeEditor.focus();return false}}})}});function autosave_parse_response(b){var c=wpAjax.parseAjaxResponse(b,"autosave"),d="",a;if(c&&c.responses&&c.responses.length){d=c.responses[0].data;if(c.responses[0].supplemental){if("disable"==c.responses[0].supplemental.disable_autosave){autosave=function(){};c={errors:true}}jQuery.each(c.responses[0].supplemental,function(e,f){if(e.match(/^replace-/)){jQuery("#"+e.replace("replace-","")).val(f)}})}if(!c.errors){a=parseInt(c.responses[0].id,10);if(!isNaN(a)&&a>0){autosave_update_slug(a)}}}if(d){jQuery("#autosave").html(d)}else{if(autosaveOldMessage&&c){jQuery("#autosave").html(autosaveOldMessage)}}return c}function autosave_saved(a){autosave_parse_response(a);autosave_enable_buttons()}function autosave_saved_new(b){var d=autosave_parse_response(b),c,a;if(d&&d.responses.length&&!d.errors){c=jQuery("#post_ID").val();a=parseInt(d.responses[0].id,10);autosave_update_post_ID(a);if(c<0&&a>0){notSaved=false;jQuery("#media-buttons a").each(function(){this.href=this.href.replace(c,a)})}if(autosaveDelayPreview){autosaveDelayPreview=false;doPreview()}}else{autosave_enable_buttons()}}function autosave_update_post_ID(a){if(!isNaN(a)&&a>0){if(a==parseInt(jQuery("#post_ID").val(),10)){return}jQuery("#post_ID").attr({name:"post_ID"});jQuery("#post_ID").val(a);jQuery.post(autosaveL10n.requestFile,{action:"autosave-generate-nonces",post_ID:a,autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()},function(b){jQuery("#_wpnonce").val(b);autosave_enable_buttons()});jQuery("#hiddenaction").val("editpost")}}function autosave_update_slug(a){if(jQuery.isFunction(make_slugedit_clickable)&&!jQuery("#edit-slug-box > *").size()){jQuery.post(slugL10n.requestFile,{action:"sample-permalink",post_id:a,new_title:jQuery("#title").val(),samplepermalinknonce:jQuery("#samplepermalinknonce").val()},function(b){jQuery("#edit-slug-box").html(b);make_slugedit_clickable()})}}function autosave_loading(){jQuery("#autosave").html(autosaveL10n.savingText)}function autosave_enable_buttons(){jQuery(".submitbox :button:disabled, .submitbox :submit:disabled").attr("disabled","")}function autosave_disable_buttons(){jQuery(".submitbox :button:enabled, .submitbox :submit:enabled").attr("disabled","disabled");setTimeout(autosave_enable_buttons,5000)}autosave=function(){var c=(typeof tinyMCE!="undefined")&&tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden(),d,f,b,e,a;d={action:"autosave",post_ID:jQuery("#post_ID").val()||0,post_title:jQuery("#title").val()||"",autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()||"",autosave:1};jQuery(".tags-input").each(function(){d[this.name]=this.value});f=true;if(jQuery("#TB_window").css("display")=="block"){f=false}if(c){b=tinyMCE.activeEditor;if("mce_fullscreen"==b.id){tinyMCE.get("content").setContent(b.getContent({format:"raw"}),{format:"raw"})}tinyMCE.get("content").save()}d.content=jQuery("#content").val();if(jQuery("#post_name").val()){d.post_name=jQuery("#post_name").val()}if((d.post_title.length==0&&d.content.length==0)||d.post_title+d.content==autosaveLast){f=false}autosave_disable_buttons();e=jQuery("#original_post_status").val();autosaveLast=jQuery("#title").val()+jQuery("#content").val();goodcats=([]);jQuery("[name='post_category[]']:checked").each(function(g){goodcats.push(this.value)});d.catslist=goodcats.join(",");if(jQuery("#comment_status").attr("checked")){d.comment_status="open"}if(jQuery("#ping_status").attr("checked")){d.ping_status="open"}if(jQuery("#excerpt").size()){d.excerpt=jQuery("#excerpt").val()}if(jQuery("#post_author").size()){d.post_author=jQuery("#post_author").val()}d.user_ID=jQuery("#user-id").val();if(c&&tinyMCE.activeEditor.plugins.spellchecker&&tinyMCE.activeEditor.plugins.spellchecker.active){f=false}if(parseInt(d.post_ID,10)<1){d.temp_ID=d.post_ID;a=autosave_saved_new}else{a=autosave_saved}if(!f){d.autosave=0}autosaveOldMessage=jQuery("#autosave").html();jQuery.ajax({data:d,beforeSend:f?autosave_loading:null,type:"POST",url:autosaveL10n.requestFile,success:a})};
\ No newline at end of file
+var autosave,autosaveLast="",autosavePeriodical,autosaveOldMessage="",autosaveDelayPreview=false,notSaved=true,blockSave=false,interimLogin=false;jQuery(document).ready(function(b){var a=true;autosaveLast=b("#post #title").val()+b("#post #content").val();autosavePeriodical=b.schedule({time:autosaveL10n.autosaveInterval*1000,func:function(){autosave()},repeat:true,protect:true});b("#post").submit(function(){b.cancel(autosavePeriodical)});b('input[type="submit"], a.submitdelete',"#submitpost").click(function(){blockSave=true;window.onbeforeunload=null;b(":button, :submit","#submitpost").each(function(){var c=b(this);if(c.hasClass("button-primary")){c.addClass("button-primary-disabled")}else{c.addClass("button-disabled")}});b("#ajax-loading").css("visibility","visible")});window.onbeforeunload=function(){var c=typeof(tinyMCE)!="undefined"?tinyMCE.activeEditor:false,e,d;if(c&&!c.isHidden()){if(c.isDirty()){return autosaveL10n.saveAlert}}else{e=b("#post #title").val(),d=b("#post #content").val();if((e||d)&&e+d!=autosaveLast){return autosaveL10n.saveAlert}}};b("#post-preview").click(function(){if(1>b("#post_ID").val()&¬Saved){autosaveDelayPreview=true;autosave();return false}doPreview();return false});doPreview=function(){b("input#wp-preview").val("dopreview");b("form#post").attr("target","wp-preview").submit().attr("target","");b("input#wp-preview").val("")};if(typeof tinyMCE!="undefined"){b("#title")[b.browser.opera?"keypress":"keydown"](function(c){if(c.which==9&&!c.shiftKey&&!c.controlKey&&!c.altKey){if((b("#post_ID").val()<1)&&(b("#title").val().length>0)){autosave()}if(tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden()&&a){c.preventDefault();a=false;tinyMCE.activeEditor.focus();return false}}})}if(0>b("#post_ID").val()){b("#title").blur(function(){if(!this.value||0<b("#post_ID").val()){return}delayed_autosave()})}});function autosave_parse_response(c){var e=wpAjax.parseAjaxResponse(c,"autosave"),f="",a,b,d;if(e&&e.responses&&e.responses.length){f=e.responses[0].data;if(e.responses[0].supplemental){b=e.responses[0].supplemental;if("disable"==b.disable_autosave){autosave=function(){};e={errors:true}}if(b.session_expired&&(d=b.session_expired)){if(!interimLogin||interimLogin.closed){interimLogin=window.open(d,"login","width=600,height=450,resizable=yes,scrollbars=yes,status=yes");interimLogin.focus()}delete b.session_expired}jQuery.each(b,function(g,h){if(g.match(/^replace-/)){jQuery("#"+g.replace("replace-","")).val(h)}})}if(!e.errors){a=parseInt(e.responses[0].id,10);if(!isNaN(a)&&a>0){autosave_update_slug(a)}}}if(f){jQuery("#autosave").html(f)}else{if(autosaveOldMessage&&e){jQuery("#autosave").html(autosaveOldMessage)}}return e}function autosave_saved(a){autosave_parse_response(a);autosave_enable_buttons()}function autosave_saved_new(b){var d=autosave_parse_response(b),c,a;if(d&&d.responses.length&&!d.errors){c=jQuery("#post_ID").val();a=parseInt(d.responses[0].id,10);autosave_update_post_ID(a);if(c<0&&a>0){notSaved=false;jQuery("#media-buttons a").each(function(){this.href=this.href.replace(c,a)})}if(autosaveDelayPreview){autosaveDelayPreview=false;doPreview()}}else{autosave_enable_buttons()}}function autosave_update_post_ID(a){if(!isNaN(a)&&a>0){if(a==parseInt(jQuery("#post_ID").val(),10)){return}jQuery("#post_ID").attr({name:"post_ID"});jQuery("#post_ID").val(a);jQuery.post(autosaveL10n.requestFile,{action:"autosave-generate-nonces",post_ID:a,autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()},function(b){jQuery("#_wpnonce").val(b.updateNonce);jQuery("#delete-action a.submitdelete").attr("href",b.deleteURL);autosave_enable_buttons();jQuery("#delete-action a.submitdelete").fadeIn()},"json");jQuery("#hiddenaction").val("editpost")}}function autosave_update_slug(a){if("undefined"!=makeSlugeditClickable&&jQuery.isFunction(makeSlugeditClickable)&&!jQuery("#edit-slug-box > *").size()){jQuery.post(ajaxurl,{action:"sample-permalink",post_id:a,new_title:jQuery("#title").val(),samplepermalinknonce:jQuery("#samplepermalinknonce").val()},function(b){jQuery("#edit-slug-box").html(b);makeSlugeditClickable()})}}function autosave_loading(){jQuery("#autosave").html(autosaveL10n.savingText)}function autosave_enable_buttons(){setTimeout(function(){jQuery(":button, :submit","#submitpost").removeAttr("disabled");jQuery("#ajax-loading").css("visibility","hidden")},500)}function autosave_disable_buttons(){jQuery(":button, :submit","#submitpost").attr("disabled","disabled");setTimeout(autosave_enable_buttons,5000)}function delayed_autosave(){setTimeout(function(){if(blockSave){return}autosave()},200)}autosave=function(){var c=(typeof tinyMCE!="undefined")&&tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden(),d,f,b,e,a;autosave_disable_buttons();d={action:"autosave",post_ID:jQuery("#post_ID").val()||0,post_title:jQuery("#title").val()||"",autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()||"",autosave:1};jQuery(".tags-input").each(function(){d[this.name]=this.value});f=true;if(jQuery("#TB_window").css("display")=="block"){f=false}if(c&&f){b=tinyMCE.activeEditor;if(b.plugins.spellchecker&&b.plugins.spellchecker.active){f=false}else{if("mce_fullscreen"==b.id){tinyMCE.get("content").setContent(b.getContent({format:"raw"}),{format:"raw"})}tinyMCE.get("content").save()}}d.content=jQuery("#content").val();if(jQuery("#post_name").val()){d.post_name=jQuery("#post_name").val()}if((d.post_title.length==0&&d.content.length==0)||d.post_title+d.content==autosaveLast){f=false}e=jQuery("#original_post_status").val();goodcats=([]);jQuery("[name='post_category[]']:checked").each(function(g){goodcats.push(this.value)});d.catslist=goodcats.join(",");if(jQuery("#comment_status").attr("checked")){d.comment_status="open"}if(jQuery("#ping_status").attr("checked")){d.ping_status="open"}if(jQuery("#excerpt").size()){d.excerpt=jQuery("#excerpt").val()}if(jQuery("#post_author").size()){d.post_author=jQuery("#post_author").val()}d.user_ID=jQuery("#user-id").val();if(f){autosaveLast=jQuery("#title").val()+jQuery("#content").val()}else{d.autosave=0}if(parseInt(d.post_ID,10)<1){d.temp_ID=d.post_ID;a=autosave_saved_new}else{a=autosave_saved}autosaveOldMessage=jQuery("#autosave").html();jQuery.ajax({data:d,beforeSend:f?autosave_loading:null,type:"POST",url:autosaveL10n.requestFile,success:a})};
\ No newline at end of file
--- /dev/null
+/*
+ * imgAreaSelect animated border style
+ */
+
+.imgareaselect-border1 {
+ background: url(border-anim-v.gif) repeat-y left top;
+}
+
+.imgareaselect-border2 {
+ background: url(border-anim-h.gif) repeat-x left top;
+}
+
+.imgareaselect-border3 {
+ background: url(border-anim-v.gif) repeat-y right top;
+}
+
+.imgareaselect-border4 {
+ background: url(border-anim-h.gif) repeat-x left bottom;
+}
+
+.imgareaselect-border1, .imgareaselect-border2,
+.imgareaselect-border3, .imgareaselect-border4 {
+ opacity: 0.5;
+ filter: alpha(opacity=50);
+}
+
+.imgareaselect-handle {
+ background-color: #fff;
+ border: solid 1px #000;
+ opacity: 0.4;
+ filter: alpha(opacity=40);
+}
+
+.imgareaselect-outer {
+ background-color: #000;
+ opacity: 0.4;
+ filter: alpha(opacity=40);
+}
+
+.imgareaselect-selection {
+}
--- /dev/null
+/*
+ * imgAreaSelect jQuery plugin
+ * version 0.9.1
+ *
+ * Copyright (c) 2008-2009 Michal Wojciechowski (odyniec.net)
+ *
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://odyniec.net/projects/imgareaselect/
+ *
+ */
+
+(function($) {
+
+var abs = Math.abs,
+ max = Math.max,
+ min = Math.min,
+ round = Math.round;
+
+function div() {
+ return $('<div/>');
+}
+
+$.imgAreaSelect = function (img, options) {
+ var
+
+ $img = $(img),
+
+ imgLoaded,
+
+ $box = div(),
+ $area = div(),
+ $border = div().add(div()).add(div()).add(div()),
+ $outer = div().add(div()).add(div()).add(div()),
+ $handles = $([]),
+
+ $areaOpera,
+
+ left, top,
+
+ imgOfs,
+
+ imgWidth, imgHeight,
+
+ $parent,
+
+ parOfs,
+
+ zIndex = 0,
+
+ position = 'absolute',
+
+ startX, startY,
+
+ scaleX, scaleY,
+
+ resizeMargin = 10,
+
+ resize,
+
+ aspectRatio,
+
+ shown,
+
+ x1, y1, x2, y2,
+
+ selection = { x1: 0, y1: 0, x2: 0, y2: 0, width: 0, height: 0 },
+
+ $p, d, i, o, w, h, adjusted;
+
+ function viewX(x) {
+ return x + imgOfs.left - parOfs.left;
+ }
+
+ function viewY(y) {
+ return y + imgOfs.top - parOfs.top;
+ }
+
+ function selX(x) {
+ return x - imgOfs.left + parOfs.left;
+ }
+
+ function selY(y) {
+ return y - imgOfs.top + parOfs.top;
+ }
+
+ function evX(event) {
+ return event.pageX - parOfs.left;
+ }
+
+ function evY(event) {
+ return event.pageY - parOfs.top;
+ }
+
+ function getSelection(noScale) {
+ var sx = noScale || scaleX, sy = noScale || scaleY;
+
+ return { x1: round(selection.x1 * sx),
+ y1: round(selection.y1 * sy),
+ x2: round(selection.x2 * sx),
+ y2: round(selection.y2 * sy),
+ width: round(selection.x2 * sx) - round(selection.x1 * sx),
+ height: round(selection.y2 * sy) - round(selection.y1 * sy) };
+ }
+
+ function setSelection(x1, y1, x2, y2, noScale) {
+ var sx = noScale || scaleX, sy = noScale || scaleY;
+
+ selection = {
+ x1: round(x1 / sx),
+ y1: round(y1 / sy),
+ x2: round(x2 / sx),
+ y2: round(y2 / sy)
+ };
+
+ selection.width = (x2 = viewX(selection.x2)) - (x1 = viewX(selection.x1));
+ selection.height = (y2 = viewX(selection.y2)) - (y1 = viewX(selection.y1));
+ }
+
+ function adjust() {
+ if (!$img.width())
+ return;
+
+ imgOfs = { left: round($img.offset().left), top: round($img.offset().top) };
+
+ imgWidth = $img.width();
+ imgHeight = $img.height();
+
+ if ($().jquery == '1.3.2' && $.browser.safari && position == 'fixed') {
+ imgOfs.top += max(document.documentElement.scrollTop, $('body').scrollTop());
+
+ imgOfs.left += max(document.documentElement.scrollLeft, $('body').scrollLeft());
+ }
+
+ parOfs = $.inArray($parent.css('position'), ['absolute', 'relative']) + 1 ?
+ { left: round($parent.offset().left) - $parent.scrollLeft(),
+ top: round($parent.offset().top) - $parent.scrollTop() } :
+ position == 'fixed' ?
+ { left: $(document).scrollLeft(), top: $(document).scrollTop() } :
+ { left: 0, top: 0 };
+
+ left = viewX(0);
+ top = viewY(0);
+ }
+
+ function update(resetKeyPress) {
+ if (!shown) return;
+
+ $box.css({ left: viewX(selection.x1), top: viewY(selection.y1) })
+ .add($area).width(w = selection.width).height(h = selection.height);
+
+ $area.add($border).add($handles).css({ left: 0, top: 0 });
+
+ $border
+ .width(max(w - $border.outerWidth() + $border.innerWidth(), 0))
+ .height(max(h - $border.outerHeight() + $border.innerHeight(), 0));
+
+ $($outer[0]).css({ left: left, top: top,
+ width: selection.x1, height: imgHeight });
+ $($outer[1]).css({ left: left + selection.x1, top: top,
+ width: w, height: selection.y1 });
+ $($outer[2]).css({ left: left + selection.x2, top: top,
+ width: imgWidth - selection.x2, height: imgHeight });
+ $($outer[3]).css({ left: left + selection.x1, top: top + selection.y2,
+ width: w, height: imgHeight - selection.y2 });
+
+ w -= $handles.outerWidth();
+ h -= $handles.outerHeight();
+
+ switch ($handles.length) {
+ case 8:
+ $($handles[4]).css({ left: w / 2 });
+ $($handles[5]).css({ left: w, top: h / 2 });
+ $($handles[6]).css({ left: w / 2, top: h });
+ $($handles[7]).css({ top: h / 2 });
+ case 4:
+ $handles.slice(1,3).css({ left: w });
+ $handles.slice(2,4).css({ top: h });
+ }
+
+ if (resetKeyPress !== false) {
+ if ($.imgAreaSelect.keyPress != docKeyPress)
+ $(document).unbind($.imgAreaSelect.keyPress,
+ $.imgAreaSelect.onKeyPress);
+
+ if (options.keys)
+ $(document)[$.imgAreaSelect.keyPress](
+ $.imgAreaSelect.onKeyPress = docKeyPress);
+ }
+
+ if ($.browser.msie && $border.outerWidth() - $border.innerWidth() == 2) {
+ $border.css('margin', 0);
+ setTimeout(function () { $border.css('margin', 'auto'); }, 0);
+ }
+ }
+
+ function doUpdate(resetKeyPress) {
+ adjust();
+ update(resetKeyPress);
+ x1 = viewX(selection.x1); y1 = viewY(selection.y1);
+ x2 = viewX(selection.x2); y2 = viewY(selection.y2);
+ }
+
+ function hide($elem, fn) {
+ options.fadeSpeed ? $elem.fadeOut(options.fadeSpeed, fn) : $elem.hide();
+
+ }
+
+ function areaMouseMove(event) {
+ var x = selX(evX(event)) - selection.x1,
+ y = selY(evY(event)) - selection.y1;
+
+ if (!adjusted) {
+ adjust();
+ adjusted = true;
+
+ $box.one('mouseout', function () { adjusted = false; });
+ }
+
+ resize = '';
+
+ if (options.resizable) {
+ if (y <= resizeMargin)
+ resize = 'n';
+ else if (y >= selection.height - resizeMargin)
+ resize = 's';
+ if (x <= resizeMargin)
+ resize += 'w';
+ else if (x >= selection.width - resizeMargin)
+ resize += 'e';
+ }
+
+ $box.css('cursor', resize ? resize + '-resize' :
+ options.movable ? 'move' : '');
+ if ($areaOpera)
+ $areaOpera.toggle();
+ }
+
+ function docMouseUp(event) {
+ $('body').css('cursor', '');
+
+ if (options.autoHide || selection.width * selection.height == 0)
+ hide($box.add($outer), function () { $(this).hide(); });
+
+ options.onSelectEnd(img, getSelection());
+
+ $(document).unbind('mousemove', selectingMouseMove);
+ $box.mousemove(areaMouseMove);
+ }
+
+ function areaMouseDown(event) {
+ if (event.which != 1) return false;
+
+ adjust();
+
+ if (resize) {
+ $('body').css('cursor', resize + '-resize');
+
+ x1 = viewX(selection[/w/.test(resize) ? 'x2' : 'x1']);
+ y1 = viewY(selection[/n/.test(resize) ? 'y2' : 'y1']);
+
+ $(document).mousemove(selectingMouseMove)
+ .one('mouseup', docMouseUp);
+ $box.unbind('mousemove', areaMouseMove);
+ }
+ else if (options.movable) {
+ startX = left + selection.x1 - evX(event);
+ startY = top + selection.y1 - evY(event);
+
+ $box.unbind('mousemove', areaMouseMove);
+
+ $(document).mousemove(movingMouseMove)
+ .one('mouseup', function () {
+ options.onSelectEnd(img, getSelection());
+
+ $(document).unbind('mousemove', movingMouseMove);
+ $box.mousemove(areaMouseMove);
+ });
+ }
+ else
+ $img.mousedown(event);
+
+ return false;
+ }
+
+ function aspectRatioXY() {
+ x2 = max(left, min(left + imgWidth,
+ x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1)));
+
+ y2 = round(max(top, min(top + imgHeight,
+ y1 + abs(x2 - x1) / aspectRatio * (y2 > y1 || -1))));
+ x2 = round(x2);
+ }
+
+ function aspectRatioYX() {
+ y2 = max(top, min(top + imgHeight,
+ y1 + abs(x2 - x1) / aspectRatio * (y2 > y1 || -1)));
+ x2 = round(max(left, min(left + imgWidth,
+ x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1))));
+ y2 = round(y2);
+ }
+
+ function doResize() {
+ if (abs(x2 - x1) < options.minWidth) {
+ x2 = x1 - options.minWidth * (x2 < x1 || -1);
+
+ if (x2 < left)
+ x1 = left + options.minWidth;
+ else if (x2 > left + imgWidth)
+ x1 = left + imgWidth - options.minWidth;
+ }
+
+ if (abs(y2 - y1) < options.minHeight) {
+ y2 = y1 - options.minHeight * (y2 < y1 || -1);
+
+ if (y2 < top)
+ y1 = top + options.minHeight;
+ else if (y2 > top + imgHeight)
+ y1 = top + imgHeight - options.minHeight;
+ }
+
+ x2 = max(left, min(x2, left + imgWidth));
+ y2 = max(top, min(y2, top + imgHeight));
+
+ if (aspectRatio)
+ if (abs(x2 - x1) / aspectRatio > abs(y2 - y1))
+ aspectRatioYX();
+ else
+ aspectRatioXY();
+
+ if (abs(x2 - x1) > options.maxWidth) {
+ x2 = x1 - options.maxWidth * (x2 < x1 || -1);
+ if (aspectRatio) aspectRatioYX();
+ }
+
+ if (abs(y2 - y1) > options.maxHeight) {
+ y2 = y1 - options.maxHeight * (y2 < y1 || -1);
+ if (aspectRatio) aspectRatioXY();
+ }
+
+ selection = { x1: selX(min(x1, x2)), x2: selX(max(x1, x2)),
+ y1: selY(min(y1, y2)), y2: selY(max(y1, y2)),
+ width: abs(x2 - x1), height: abs(y2 - y1) };
+
+ update();
+
+ options.onSelectChange(img, getSelection());
+ }
+
+ function selectingMouseMove(event) {
+ x2 = resize == '' || /w|e/.test(resize) || aspectRatio ? evX(event) : viewX(selection.x2);
+ y2 = resize == '' || /n|s/.test(resize) || aspectRatio ? evY(event) : viewY(selection.y2);
+
+ doResize();
+
+ return false;
+
+ }
+
+ function doMove(newX1, newY1) {
+ x2 = (x1 = newX1) + selection.width;
+ y2 = (y1 = newY1) + selection.height;
+
+ selection = $.extend(selection, { x1: selX(x1), y1: selY(y1),
+ x2: selX(x2), y2: selY(y2) });
+
+ update();
+
+ options.onSelectChange(img, getSelection());
+ }
+
+ function movingMouseMove(event) {
+ x1 = max(left, min(startX + evX(event), left + imgWidth - selection.width));
+ y1 = max(top, min(startY + evY(event), top + imgHeight - selection.height));
+
+ doMove(x1, y1);
+
+ event.preventDefault();
+
+ return false;
+ }
+
+ function startSelection() {
+ adjust();
+
+ x2 = x1;
+ y2 = y1;
+
+ doResize();
+
+ resize = '';
+
+ if ($outer.is(':not(:visible)'))
+ $box.add($outer).hide().fadeIn(options.fadeSpeed||0);
+
+ shown = true;
+
+ $(document).unbind('mouseup', cancelSelection)
+ .mousemove(selectingMouseMove).one('mouseup', docMouseUp);
+ $box.unbind('mousemove', areaMouseMove);
+
+ options.onSelectStart(img, getSelection());
+ }
+
+ function cancelSelection() {
+ $(document).unbind('mousemove', startSelection);
+ hide($box.add($outer));
+
+ selection = { x1: selX(x1), y1: selY(y1), x2: selX(x1), y2: selY(y1),
+ width: 0, height: 0 };
+
+ options.onSelectChange(img, getSelection());
+ options.onSelectEnd(img, getSelection());
+ }
+
+ function imgMouseDown(event) {
+ if (event.which != 1 || $outer.is(':animated')) return false;
+
+ adjust();
+ startX = x1 = evX(event);
+ startY = y1 = evY(event);
+
+ $(document).one('mousemove', startSelection)
+ .one('mouseup', cancelSelection);
+
+ return false;
+ }
+
+ function parentScroll() {
+ doUpdate(false);
+ }
+
+ function imgLoad() {
+ imgLoaded = true;
+
+ setOptions(options = $.extend({
+ classPrefix: 'imgareaselect',
+ movable: true,
+ resizable: true,
+ parent: 'body',
+ onInit: function () {},
+ onSelectStart: function () {},
+ onSelectChange: function () {},
+ onSelectEnd: function () {}
+ }, options));
+
+ $box.add($outer).css({ visibility: '' });
+
+ if (options.show) {
+ shown = true;
+ adjust();
+ update();
+ $box.add($outer).hide().fadeIn(options.fadeSpeed||0);
+ }
+
+ setTimeout(function () { options.onInit(img, getSelection()); }, 0);
+ }
+
+ var docKeyPress = function(event) {
+ var k = options.keys, d, t, key = event.keyCode || event.which;
+
+ d = !isNaN(k.alt) && (event.altKey || event.originalEvent.altKey) ? k.alt :
+ !isNaN(k.ctrl) && event.ctrlKey ? k.ctrl :
+ !isNaN(k.shift) && event.shiftKey ? k.shift :
+ !isNaN(k.arrows) ? k.arrows : 10;
+
+ if (k.arrows == 'resize' || (k.shift == 'resize' && event.shiftKey) ||
+ (k.ctrl == 'resize' && event.ctrlKey) ||
+ (k.alt == 'resize' && (event.altKey || event.originalEvent.altKey)))
+ {
+ switch (key) {
+ case 37:
+ d = -d;
+ case 39:
+ t = max(x1, x2);
+ x1 = min(x1, x2);
+ x2 = max(t + d, x1);
+ if (aspectRatio) aspectRatioYX();
+ break;
+ case 38:
+ d = -d;
+ case 40:
+ t = max(y1, y2);
+ y1 = min(y1, y2);
+ y2 = max(t + d, y1);
+ if (aspectRatio) aspectRatioXY();
+ break;
+ default:
+ return;
+ }
+
+ doResize();
+ }
+ else {
+ x1 = min(x1, x2);
+ y1 = min(y1, y2);
+
+ switch (key) {
+ case 37:
+ doMove(max(x1 - d, left), y1);
+ break;
+ case 38:
+ doMove(x1, max(y1 - d, top));
+ break;
+ case 39:
+ doMove(x1 + min(d, imgWidth - selX(x2)), y1);
+ break;
+ case 40:
+ doMove(x1, y1 + min(d, imgHeight - selY(y2)));
+ break;
+ default:
+ return;
+ }
+ }
+
+ return false;
+ };
+
+ function styleOptions($elem, props) {
+ for (option in props)
+ if (options[option] !== undefined)
+ $elem.css(props[option], options[option]);
+ }
+
+ function setOptions(newOptions) {
+ if (newOptions.parent)
+ ($parent = $(newOptions.parent)).append($box.add($outer));
+
+ options = $.extend(options, newOptions);
+
+ adjust();
+
+ if (newOptions.handles != null) {
+ $handles.remove();
+ $handles = $([]);
+
+ i = newOptions.handles ? newOptions.handles == 'corners' ? 4 : 8 : 0;
+
+ while (i--)
+ $handles = $handles.add(div());
+
+ $handles.addClass(options.classPrefix + '-handle').css({
+ position: 'absolute',
+ fontSize: 0,
+ zIndex: zIndex + 1 || 1
+ });
+
+ if (!parseInt($handles.css('width')))
+ $handles.width(5).height(5);
+
+ if (o = options.borderWidth)
+ $handles.css({ borderWidth: o, borderStyle: 'solid' });
+
+ styleOptions($handles, { borderColor1: 'border-color',
+ borderColor2: 'background-color',
+ borderOpacity: 'opacity' });
+ }
+
+ scaleX = options.imageWidth / imgWidth || 1;
+ scaleY = options.imageHeight / imgHeight || 1;
+
+ if (newOptions.x1 != null) {
+ setSelection(newOptions.x1, newOptions.y1, newOptions.x2,
+ newOptions.y2);
+ newOptions.show = !newOptions.hide;
+ }
+
+ if (newOptions.keys)
+ options.keys = $.extend({ shift: 1, ctrl: 'resize' },
+ newOptions.keys);
+
+ $outer.addClass(options.classPrefix + '-outer');
+ $area.addClass(options.classPrefix + '-selection');
+ for (i = 0; i++ < 4;)
+ $($border[i-1]).addClass(options.classPrefix + '-border' + i);
+
+ styleOptions($area, { selectionColor: 'background-color',
+ selectionOpacity: 'opacity' });
+ styleOptions($border, { borderOpacity: 'opacity',
+ borderWidth: 'border-width' });
+ styleOptions($outer, { outerColor: 'background-color',
+ outerOpacity: 'opacity' });
+ if (o = options.borderColor1)
+ $($border[0]).css({ borderStyle: 'solid', borderColor: o });
+ if (o = options.borderColor2)
+ $($border[1]).css({ borderStyle: 'dashed', borderColor: o });
+
+ $box.append($area.add($border).add($handles).add($areaOpera));
+
+ if ($.browser.msie) {
+ if (o = $outer.css('filter').match(/opacity=([0-9]+)/))
+ $outer.css('opacity', o[1]/100);
+ if (o = $border.css('filter').match(/opacity=([0-9]+)/))
+ $border.css('opacity', o[1]/100);
+ }
+
+ if (newOptions.hide)
+ hide($box.add($outer));
+ else if (newOptions.show && imgLoaded) {
+ shown = true;
+ $box.add($outer).fadeIn(options.fadeSpeed||0);
+ doUpdate();
+ }
+
+ aspectRatio = (d = (options.aspectRatio || '').split(/:/))[0] / d[1];
+
+ if (options.disable || options.enable === false) {
+ $box.unbind('mousemove', areaMouseMove).unbind('mousedown', areaMouseDown);
+ $img.add($outer).unbind('mousedown', imgMouseDown);
+ $(window).unbind('resize', parentScroll);
+ $img.add($img.parents()).unbind('scroll', parentScroll);
+ }
+ else if (options.enable || options.disable === false) {
+ if (options.resizable || options.movable)
+ $box.mousemove(areaMouseMove).mousedown(areaMouseDown);
+
+ if (!options.persistent)
+ $img.add($outer).mousedown(imgMouseDown);
+ $(window).resize(parentScroll);
+ $img.add($img.parents()).scroll(parentScroll);
+ }
+
+ options.enable = options.disable = undefined;
+ }
+
+ this.getOptions = function () { return options; };
+
+ this.setOptions = setOptions;
+
+ this.getSelection = getSelection;
+
+ this.setSelection = setSelection;
+
+ this.update = doUpdate;
+
+ $p = $img;
+
+ while ($p.length && !$p.is('body')) {
+ if (!isNaN($p.css('z-index')) && $p.css('z-index') > zIndex)
+ zIndex = $p.css('z-index');
+ if ($p.css('position') == 'fixed')
+ position = 'fixed';
+
+ $p = $p.parent();
+ }
+
+ if (!isNaN(options.zIndex))
+ zIndex = options.zIndex;
+
+ if ($.browser.msie)
+ $img.attr('unselectable', 'on');
+
+ $.imgAreaSelect.keyPress = $.browser.msie ||
+ $.browser.safari ? 'keydown' : 'keypress';
+
+ if ($.browser.opera)
+ $areaOpera = div().css({ width: '100%', height: '100%',
+ position: 'absolute', zIndex: zIndex + 2 || 2 });
+
+ $box.add($outer).css({ visibility: 'hidden', position: position,
+ overflow: 'hidden', zIndex: zIndex || '0' });
+ $box.css({ zIndex: zIndex + 2 || 2 });
+ $area.add($border).css({ position: 'absolute' });
+
+ img.complete || img.readyState == 'complete' || !$img.is('img') ?
+ imgLoad() : $img.one('load', imgLoad);
+
+};
+
+$.fn.imgAreaSelect = function (options) {
+ options = options || {};
+
+ this.each(function () {
+ if ($(this).data('imgAreaSelect'))
+ $(this).data('imgAreaSelect').setOptions(options);
+ else {
+ if (options.enable === undefined && options.disable === undefined)
+ options.enable = true;
+
+ $(this).data('imgAreaSelect', new $.imgAreaSelect(this, options));
+ }
+ });
+
+ if (options.instance)
+ return $(this).data('imgAreaSelect');
+
+ return this;
+};
+
+})(jQuery);
--- /dev/null
+(function($){var abs=Math.abs,max=Math.max,min=Math.min,round=Math.round;function div(){return $('<div/>')}$.imgAreaSelect=function(img,options){var $img=$(img),imgLoaded,$box=div(),$area=div(),$border=div().add(div()).add(div()).add(div()),$outer=div().add(div()).add(div()).add(div()),$handles=$([]),$areaOpera,left,top,imgOfs,imgWidth,imgHeight,$parent,parOfs,zIndex=0,position='absolute',startX,startY,scaleX,scaleY,resizeMargin=10,resize,aspectRatio,shown,x1,y1,x2,y2,selection={x1:0,y1:0,x2:0,y2:0,width:0,height:0},$p,d,i,o,w,h,adjusted;function viewX(x){return x+imgOfs.left-parOfs.left}function viewY(y){return y+imgOfs.top-parOfs.top}function selX(x){return x-imgOfs.left+parOfs.left}function selY(y){return y-imgOfs.top+parOfs.top}function evX(event){return event.pageX-parOfs.left}function evY(event){return event.pageY-parOfs.top}function getSelection(noScale){var sx=noScale||scaleX,sy=noScale||scaleY;return{x1:round(selection.x1*sx),y1:round(selection.y1*sy),x2:round(selection.x2*sx),y2:round(selection.y2*sy),width:round(selection.x2*sx)-round(selection.x1*sx),height:round(selection.y2*sy)-round(selection.y1*sy)}}function setSelection(x1,y1,x2,y2,noScale){var sx=noScale||scaleX,sy=noScale||scaleY;selection={x1:round(x1/sx),y1:round(y1/sy),x2:round(x2/sx),y2:round(y2/sy)};selection.width=(x2=viewX(selection.x2))-(x1=viewX(selection.x1));selection.height=(y2=viewX(selection.y2))-(y1=viewX(selection.y1))}function adjust(){if(!$img.width())return;imgOfs={left:round($img.offset().left),top:round($img.offset().top)};imgWidth=$img.width();imgHeight=$img.height();if($().jquery=='1.3.2'&&$.browser.safari&&position=='fixed'){imgOfs.top+=max(document.documentElement.scrollTop,$('body').scrollTop());imgOfs.left+=max(document.documentElement.scrollLeft,$('body').scrollLeft())}parOfs=$.inArray($parent.css('position'),['absolute','relative'])+1?{left:round($parent.offset().left)-$parent.scrollLeft(),top:round($parent.offset().top)-$parent.scrollTop()}:position=='fixed'?{left:$(document).scrollLeft(),top:$(document).scrollTop()}:{left:0,top:0};left=viewX(0);top=viewY(0)}function update(resetKeyPress){if(!shown)return;$box.css({left:viewX(selection.x1),top:viewY(selection.y1)}).add($area).width(w=selection.width).height(h=selection.height);$area.add($border).add($handles).css({left:0,top:0});$border.width(max(w-$border.outerWidth()+$border.innerWidth(),0)).height(max(h-$border.outerHeight()+$border.innerHeight(),0));$($outer[0]).css({left:left,top:top,width:selection.x1,height:imgHeight});$($outer[1]).css({left:left+selection.x1,top:top,width:w,height:selection.y1});$($outer[2]).css({left:left+selection.x2,top:top,width:imgWidth-selection.x2,height:imgHeight});$($outer[3]).css({left:left+selection.x1,top:top+selection.y2,width:w,height:imgHeight-selection.y2});w-=$handles.outerWidth();h-=$handles.outerHeight();switch($handles.length){case 8:$($handles[4]).css({left:w/2});$($handles[5]).css({left:w,top:h/2});$($handles[6]).css({left:w/2,top:h});$($handles[7]).css({top:h/2});case 4:$handles.slice(1,3).css({left:w});$handles.slice(2,4).css({top:h})}if(resetKeyPress!==false){if($.imgAreaSelect.keyPress!=docKeyPress)$(document).unbind($.imgAreaSelect.keyPress,$.imgAreaSelect.onKeyPress);if(options.keys)$(document)[$.imgAreaSelect.keyPress]($.imgAreaSelect.onKeyPress=docKeyPress)}if($.browser.msie&&$border.outerWidth()-$border.innerWidth()==2){$border.css('margin',0);setTimeout(function(){$border.css('margin','auto')},0)}}function doUpdate(resetKeyPress){adjust();update(resetKeyPress);x1=viewX(selection.x1);y1=viewY(selection.y1);x2=viewX(selection.x2);y2=viewY(selection.y2)}function hide($elem,fn){options.fadeSpeed?$elem.fadeOut(options.fadeSpeed,fn):$elem.hide()}function areaMouseMove(event){var x=selX(evX(event))-selection.x1,y=selY(evY(event))-selection.y1;if(!adjusted){adjust();adjusted=true;$box.one('mouseout',function(){adjusted=false})}resize='';if(options.resizable){if(y<=resizeMargin)resize='n';else if(y>=selection.height-resizeMargin)resize='s';if(x<=resizeMargin)resize+='w';else if(x>=selection.width-resizeMargin)resize+='e'}$box.css('cursor',resize?resize+'-resize':options.movable?'move':'');if($areaOpera)$areaOpera.toggle()}function docMouseUp(event){$('body').css('cursor','');if(options.autoHide||selection.width*selection.height==0)hide($box.add($outer),function(){$(this).hide()});options.onSelectEnd(img,getSelection());$(document).unbind('mousemove',selectingMouseMove);$box.mousemove(areaMouseMove)}function areaMouseDown(event){if(event.which!=1)return false;adjust();if(resize){$('body').css('cursor',resize+'-resize');x1=viewX(selection[/w/.test(resize)?'x2':'x1']);y1=viewY(selection[/n/.test(resize)?'y2':'y1']);$(document).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove)}else if(options.movable){startX=left+selection.x1-evX(event);startY=top+selection.y1-evY(event);$box.unbind('mousemove',areaMouseMove);$(document).mousemove(movingMouseMove).one('mouseup',function(){options.onSelectEnd(img,getSelection());$(document).unbind('mousemove',movingMouseMove);$box.mousemove(areaMouseMove)})}else $img.mousedown(event);return false}function aspectRatioXY(){x2=max(left,min(left+imgWidth,x1+abs(y2-y1)*aspectRatio*(x2>x1||-1)));y2=round(max(top,min(top+imgHeight,y1+abs(x2-x1)/aspectRatio*(y2>y1||-1))));x2=round(x2)}function aspectRatioYX(){y2=max(top,min(top+imgHeight,y1+abs(x2-x1)/aspectRatio*(y2>y1||-1)));x2=round(max(left,min(left+imgWidth,x1+abs(y2-y1)*aspectRatio*(x2>x1||-1))));y2=round(y2)}function doResize(){if(abs(x2-x1)<options.minWidth){x2=x1-options.minWidth*(x2<x1||-1);if(x2<left)x1=left+options.minWidth;else if(x2>left+imgWidth)x1=left+imgWidth-options.minWidth}if(abs(y2-y1)<options.minHeight){y2=y1-options.minHeight*(y2<y1||-1);if(y2<top)y1=top+options.minHeight;else if(y2>top+imgHeight)y1=top+imgHeight-options.minHeight}x2=max(left,min(x2,left+imgWidth));y2=max(top,min(y2,top+imgHeight));if(aspectRatio)if(abs(x2-x1)/aspectRatio>abs(y2-y1))aspectRatioYX();else aspectRatioXY();if(abs(x2-x1)>options.maxWidth){x2=x1-options.maxWidth*(x2<x1||-1);if(aspectRatio)aspectRatioYX()}if(abs(y2-y1)>options.maxHeight){y2=y1-options.maxHeight*(y2<y1||-1);if(aspectRatio)aspectRatioXY()}selection={x1:selX(min(x1,x2)),x2:selX(max(x1,x2)),y1:selY(min(y1,y2)),y2:selY(max(y1,y2)),width:abs(x2-x1),height:abs(y2-y1)};update();options.onSelectChange(img,getSelection())}function selectingMouseMove(event){x2=resize==''||/w|e/.test(resize)||aspectRatio?evX(event):viewX(selection.x2);y2=resize==''||/n|s/.test(resize)||aspectRatio?evY(event):viewY(selection.y2);doResize();return false}function doMove(newX1,newY1){x2=(x1=newX1)+selection.width;y2=(y1=newY1)+selection.height;selection=$.extend(selection,{x1:selX(x1),y1:selY(y1),x2:selX(x2),y2:selY(y2)});update();options.onSelectChange(img,getSelection())}function movingMouseMove(event){x1=max(left,min(startX+evX(event),left+imgWidth-selection.width));y1=max(top,min(startY+evY(event),top+imgHeight-selection.height));doMove(x1,y1);event.preventDefault();return false}function startSelection(){adjust();x2=x1;y2=y1;doResize();resize='';if($outer.is(':not(:visible)'))$box.add($outer).hide().fadeIn(options.fadeSpeed||0);shown=true;$(document).unbind('mouseup',cancelSelection).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove);options.onSelectStart(img,getSelection())}function cancelSelection(){$(document).unbind('mousemove',startSelection);hide($box.add($outer));selection={x1:selX(x1),y1:selY(y1),x2:selX(x1),y2:selY(y1),width:0,height:0};options.onSelectChange(img,getSelection());options.onSelectEnd(img,getSelection())}function imgMouseDown(event){if(event.which!=1||$outer.is(':animated'))return false;adjust();startX=x1=evX(event);startY=y1=evY(event);$(document).one('mousemove',startSelection).one('mouseup',cancelSelection);return false}function parentScroll(){doUpdate(false)}function imgLoad(){imgLoaded=true;setOptions(options=$.extend({classPrefix:'imgareaselect',movable:true,resizable:true,parent:'body',onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},options));$box.add($outer).css({visibility:''});if(options.show){shown=true;adjust();update();$box.add($outer).hide().fadeIn(options.fadeSpeed||0)}setTimeout(function(){options.onInit(img,getSelection())},0)}var docKeyPress=function(event){var k=options.keys,d,t,key=event.keyCode||event.which;d=!isNaN(k.alt)&&(event.altKey||event.originalEvent.altKey)?k.alt:!isNaN(k.ctrl)&&event.ctrlKey?k.ctrl:!isNaN(k.shift)&&event.shiftKey?k.shift:!isNaN(k.arrows)?k.arrows:10;if(k.arrows=='resize'||(k.shift=='resize'&&event.shiftKey)||(k.ctrl=='resize'&&event.ctrlKey)||(k.alt=='resize'&&(event.altKey||event.originalEvent.altKey))){switch(key){case 37:d=-d;case 39:t=max(x1,x2);x1=min(x1,x2);x2=max(t+d,x1);if(aspectRatio)aspectRatioYX();break;case 38:d=-d;case 40:t=max(y1,y2);y1=min(y1,y2);y2=max(t+d,y1);if(aspectRatio)aspectRatioXY();break;default:return}doResize()}else{x1=min(x1,x2);y1=min(y1,y2);switch(key){case 37:doMove(max(x1-d,left),y1);break;case 38:doMove(x1,max(y1-d,top));break;case 39:doMove(x1+min(d,imgWidth-selX(x2)),y1);break;case 40:doMove(x1,y1+min(d,imgHeight-selY(y2)));break;default:return}}return false};function styleOptions($elem,props){for(option in props)if(options[option]!==undefined)$elem.css(props[option],options[option])}function setOptions(newOptions){if(newOptions.parent)($parent=$(newOptions.parent)).append($box.add($outer));options=$.extend(options,newOptions);adjust();if(newOptions.handles!=null){$handles.remove();$handles=$([]);i=newOptions.handles?newOptions.handles=='corners'?4:8:0;while(i--)$handles=$handles.add(div());$handles.addClass(options.classPrefix+'-handle').css({position:'absolute',fontSize:0,zIndex:zIndex+1||1});if(!parseInt($handles.css('width')))$handles.width(5).height(5);if(o=options.borderWidth)$handles.css({borderWidth:o,borderStyle:'solid'});styleOptions($handles,{borderColor1:'border-color',borderColor2:'background-color',borderOpacity:'opacity'})}scaleX=options.imageWidth/imgWidth||1;scaleY=options.imageHeight/imgHeight||1;if(newOptions.x1!=null){setSelection(newOptions.x1,newOptions.y1,newOptions.x2,newOptions.y2);newOptions.show=!newOptions.hide}if(newOptions.keys)options.keys=$.extend({shift:1,ctrl:'resize'},newOptions.keys);$outer.addClass(options.classPrefix+'-outer');$area.addClass(options.classPrefix+'-selection');for(i=0;i++<4;)$($border[i-1]).addClass(options.classPrefix+'-border'+i);styleOptions($area,{selectionColor:'background-color',selectionOpacity:'opacity'});styleOptions($border,{borderOpacity:'opacity',borderWidth:'border-width'});styleOptions($outer,{outerColor:'background-color',outerOpacity:'opacity'});if(o=options.borderColor1)$($border[0]).css({borderStyle:'solid',borderColor:o});if(o=options.borderColor2)$($border[1]).css({borderStyle:'dashed',borderColor:o});$box.append($area.add($border).add($handles).add($areaOpera));if($.browser.msie){if(o=$outer.css('filter').match(/opacity=([0-9]+)/))$outer.css('opacity',o[1]/100);if(o=$border.css('filter').match(/opacity=([0-9]+)/))$border.css('opacity',o[1]/100)}if(newOptions.hide)hide($box.add($outer));else if(newOptions.show&&imgLoaded){shown=true;$box.add($outer).fadeIn(options.fadeSpeed||0);doUpdate()}aspectRatio=(d=(options.aspectRatio||'').split(/:/))[0]/d[1];if(options.disable||options.enable===false){$box.unbind('mousemove',areaMouseMove).unbind('mousedown',areaMouseDown);$img.add($outer).unbind('mousedown',imgMouseDown);$(window).unbind('resize',parentScroll);$img.add($img.parents()).unbind('scroll',parentScroll)}else if(options.enable||options.disable===false){if(options.resizable||options.movable)$box.mousemove(areaMouseMove).mousedown(areaMouseDown);if(!options.persistent)$img.add($outer).mousedown(imgMouseDown);$(window).resize(parentScroll);$img.add($img.parents()).scroll(parentScroll)}options.enable=options.disable=undefined}this.getOptions=function(){return options};this.setOptions=setOptions;this.getSelection=getSelection;this.setSelection=setSelection;this.update=doUpdate;$p=$img;while($p.length&&!$p.is('body')){if(!isNaN($p.css('z-index'))&&$p.css('z-index')>zIndex)zIndex=$p.css('z-index');if($p.css('position')=='fixed')position='fixed';$p=$p.parent()}if(!isNaN(options.zIndex))zIndex=options.zIndex;if($.browser.msie)$img.attr('unselectable','on');$.imgAreaSelect.keyPress=$.browser.msie||$.browser.safari?'keydown':'keypress';if($.browser.opera)$areaOpera=div().css({width:'100%',height:'100%',position:'absolute',zIndex:zIndex+2||2});$box.add($outer).css({visibility:'hidden',position:position,overflow:'hidden',zIndex:zIndex||'0'});$box.css({zIndex:zIndex+2||2});$area.add($border).css({position:'absolute'});img.complete||img.readyState=='complete'||!$img.is('img')?imgLoad():$img.one('load',imgLoad)};$.fn.imgAreaSelect=function(options){options=options||{};this.each(function(){if($(this).data('imgAreaSelect'))$(this).data('imgAreaSelect').setOptions(options);else{if(options.enable===undefined&&options.disable===undefined)options.enable=true;$(this).data('imgAreaSelect',new $.imgAreaSelect(this,options))}});if(options.instance)return $(this).data('imgAreaSelect');return this}})(jQuery);
\ No newline at end of file
--- /dev/null
+/*
+ http://www.JSON.org/json2.js
+ 2009-08-17
+
+ Public Domain.
+
+ NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+ See http://www.JSON.org/js.html
+
+ This file creates a global JSON object containing two methods: stringify
+ and parse.
+
+ JSON.stringify(value, replacer, space)
+ value any JavaScript value, usually an object or array.
+
+ replacer an optional parameter that determines how object
+ values are stringified for objects. It can be a
+ function or an array of strings.
+
+ space an optional parameter that specifies the indentation
+ of nested structures. If it is omitted, the text will
+ be packed without extra whitespace. If it is a number,
+ it will specify the number of spaces to indent at each
+ level. If it is a string (such as '\t' or ' '),
+ it contains the characters used to indent at each level.
+
+ This method produces a JSON text from a JavaScript value.
+
+ When an object value is found, if the object contains a toJSON
+ method, its toJSON method will be called and the result will be
+ stringified. A toJSON method does not serialize: it returns the
+ value represented by the name/value pair that should be serialized,
+ or undefined if nothing should be serialized. The toJSON method
+ will be passed the key associated with the value, and this will be
+ bound to the value
+
+ For example, this would serialize Dates as ISO strings.
+
+ Date.prototype.toJSON = function (key) {
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ return this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z';
+ };
+
+ You can provide an optional replacer method. It will be passed the
+ key and value of each member, with this bound to the containing
+ object. The value that is returned from your method will be
+ serialized. If your method returns undefined, then the member will
+ be excluded from the serialization.
+
+ If the replacer parameter is an array of strings, then it will be
+ used to select the members to be serialized. It filters the results
+ such that only members with keys listed in the replacer array are
+ stringified.
+
+ Values that do not have JSON representations, such as undefined or
+ functions, will not be serialized. Such values in objects will be
+ dropped; in arrays they will be replaced with null. You can use
+ a replacer function to replace those with JSON values.
+ JSON.stringify(undefined) returns undefined.
+
+ The optional space parameter produces a stringification of the
+ value that is filled with line breaks and indentation to make it
+ easier to read.
+
+ If the space parameter is a non-empty string, then that string will
+ be used for indentation. If the space parameter is a number, then
+ the indentation will be that many spaces.
+
+ Example:
+
+ text = JSON.stringify(['e', {pluribus: 'unum'}]);
+ // text is '["e",{"pluribus":"unum"}]'
+
+
+ text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
+ // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
+
+ text = JSON.stringify([new Date()], function (key, value) {
+ return this[key] instanceof Date ?
+ 'Date(' + this[key] + ')' : value;
+ });
+ // text is '["Date(---current time---)"]'
+
+
+ JSON.parse(text, reviver)
+ This method parses a JSON text to produce an object or array.
+ It can throw a SyntaxError exception.
+
+ The optional reviver parameter is a function that can filter and
+ transform the results. It receives each of the keys and values,
+ and its return value is used instead of the original value.
+ If it returns what it received, then the structure is not modified.
+ If it returns undefined then the member is deleted.
+
+ Example:
+
+ // Parse the text. Values that look like ISO date strings will
+ // be converted to Date objects.
+
+ myData = JSON.parse(text, function (key, value) {
+ var a;
+ if (typeof value === 'string') {
+ a =
+/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
+ if (a) {
+ return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+ +a[5], +a[6]));
+ }
+ }
+ return value;
+ });
+
+ myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
+ var d;
+ if (typeof value === 'string' &&
+ value.slice(0, 5) === 'Date(' &&
+ value.slice(-1) === ')') {
+ d = new Date(value.slice(5, -1));
+ if (d) {
+ return d;
+ }
+ }
+ return value;
+ });
+
+
+ This is a reference implementation. You are free to copy, modify, or
+ redistribute.
+
+ This code should be minified before deployment.
+ See http://javascript.crockford.com/jsmin.html
+
+ USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
+ NOT CONTROL.
+*/
+
+/*jslint evil: true */
+
+/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
+ call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
+ getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
+ lastIndex, length, parse, prototype, push, replace, slice, stringify,
+ test, toJSON, toString, valueOf
+*/
+
+"use strict";
+
+// Create a JSON object only if one does not already exist. We create the
+// methods in a closure to avoid creating global variables.
+
+if (!this.JSON) {
+ this.JSON = {};
+}
+
+(function () {
+
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ if (typeof Date.prototype.toJSON !== 'function') {
+
+ Date.prototype.toJSON = function (key) {
+
+ return isFinite(this.valueOf()) ?
+ this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z' : null;
+ };
+
+ String.prototype.toJSON =
+ Number.prototype.toJSON =
+ Boolean.prototype.toJSON = function (key) {
+ return this.valueOf();
+ };
+ }
+
+ var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ gap,
+ indent,
+ meta = { // table of character substitutions
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '"' : '\\"',
+ '\\': '\\\\'
+ },
+ rep;
+
+
+ function quote(string) {
+
+// If the string contains no control characters, no quote characters, and no
+// backslash characters, then we can safely slap some quotes around it.
+// Otherwise we must also replace the offending characters with safe escape
+// sequences.
+
+ escapable.lastIndex = 0;
+ return escapable.test(string) ?
+ '"' + string.replace(escapable, function (a) {
+ var c = meta[a];
+ return typeof c === 'string' ? c :
+ '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ }) + '"' :
+ '"' + string + '"';
+ }
+
+
+ function str(key, holder) {
+
+// Produce a string from holder[key].
+
+ var i, // The loop counter.
+ k, // The member key.
+ v, // The member value.
+ length,
+ mind = gap,
+ partial,
+ value = holder[key];
+
+// If the value has a toJSON method, call it to obtain a replacement value.
+
+ if (value && typeof value === 'object' &&
+ typeof value.toJSON === 'function') {
+ value = value.toJSON(key);
+ }
+
+// If we were called with a replacer function, then call the replacer to
+// obtain a replacement value.
+
+ if (typeof rep === 'function') {
+ value = rep.call(holder, key, value);
+ }
+
+// What happens next depends on the value's type.
+
+ switch (typeof value) {
+ case 'string':
+ return quote(value);
+
+ case 'number':
+
+// JSON numbers must be finite. Encode non-finite numbers as null.
+
+ return isFinite(value) ? String(value) : 'null';
+
+ case 'boolean':
+ case 'null':
+
+// If the value is a boolean or null, convert it to a string. Note:
+// typeof null does not produce 'null'. The case is included here in
+// the remote chance that this gets fixed someday.
+
+ return String(value);
+
+// If the type is 'object', we might be dealing with an object or an array or
+// null.
+
+ case 'object':
+
+// Due to a specification blunder in ECMAScript, typeof null is 'object',
+// so watch out for that case.
+
+ if (!value) {
+ return 'null';
+ }
+
+// Make an array to hold the partial results of stringifying this object value.
+
+ gap += indent;
+ partial = [];
+
+// Is the value an array?
+
+ if (Object.prototype.toString.apply(value) === '[object Array]') {
+
+// The value is an array. Stringify every element. Use null as a placeholder
+// for non-JSON values.
+
+ length = value.length;
+ for (i = 0; i < length; i += 1) {
+ partial[i] = str(i, value) || 'null';
+ }
+
+// Join all of the elements together, separated with commas, and wrap them in
+// brackets.
+
+ v = partial.length === 0 ? '[]' :
+ gap ? '[\n' + gap +
+ partial.join(',\n' + gap) + '\n' +
+ mind + ']' :
+ '[' + partial.join(',') + ']';
+ gap = mind;
+ return v;
+ }
+
+// If the replacer is an array, use it to select the members to be stringified.
+
+ if (rep && typeof rep === 'object') {
+ length = rep.length;
+ for (i = 0; i < length; i += 1) {
+ k = rep[i];
+ if (typeof k === 'string') {
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ } else {
+
+// Otherwise, iterate through all of the keys in the object.
+
+ for (k in value) {
+ if (Object.hasOwnProperty.call(value, k)) {
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ }
+
+// Join all of the member texts together, separated with commas,
+// and wrap them in braces.
+
+ v = partial.length === 0 ? '{}' :
+ gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
+ mind + '}' : '{' + partial.join(',') + '}';
+ gap = mind;
+ return v;
+ }
+ }
+
+// If the JSON object does not yet have a stringify method, give it one.
+
+ if (typeof JSON.stringify !== 'function') {
+ JSON.stringify = function (value, replacer, space) {
+
+// The stringify method takes a value and an optional replacer, and an optional
+// space parameter, and returns a JSON text. The replacer can be a function
+// that can replace values, or an array of strings that will select the keys.
+// A default replacer method can be provided. Use of the space parameter can
+// produce text that is more easily readable.
+
+ var i;
+ gap = '';
+ indent = '';
+
+// If the space parameter is a number, make an indent string containing that
+// many spaces.
+
+ if (typeof space === 'number') {
+ for (i = 0; i < space; i += 1) {
+ indent += ' ';
+ }
+
+// If the space parameter is a string, it will be used as the indent string.
+
+ } else if (typeof space === 'string') {
+ indent = space;
+ }
+
+// If there is a replacer, it must be a function or an array.
+// Otherwise, throw an error.
+
+ rep = replacer;
+ if (replacer && typeof replacer !== 'function' &&
+ (typeof replacer !== 'object' ||
+ typeof replacer.length !== 'number')) {
+ throw new Error('JSON.stringify');
+ }
+
+// Make a fake root object containing our value under the key of ''.
+// Return the result of stringifying the value.
+
+ return str('', {'': value});
+ };
+ }
+
+
+// If the JSON object does not yet have a parse method, give it one.
+
+ if (typeof JSON.parse !== 'function') {
+ JSON.parse = function (text, reviver) {
+
+// The parse method takes a text and an optional reviver function, and returns
+// a JavaScript value if the text is a valid JSON text.
+
+ var j;
+
+ function walk(holder, key) {
+
+// The walk method is used to recursively walk the resulting structure so
+// that modifications can be made.
+
+ var k, v, value = holder[key];
+ if (value && typeof value === 'object') {
+ for (k in value) {
+ if (Object.hasOwnProperty.call(value, k)) {
+ v = walk(value, k);
+ if (v !== undefined) {
+ value[k] = v;
+ } else {
+ delete value[k];
+ }
+ }
+ }
+ }
+ return reviver.call(holder, key, value);
+ }
+
+
+// Parsing happens in four stages. In the first stage, we replace certain
+// Unicode characters with escape sequences. JavaScript handles many characters
+// incorrectly, either silently deleting them, or treating them as line endings.
+
+ cx.lastIndex = 0;
+ if (cx.test(text)) {
+ text = text.replace(cx, function (a) {
+ return '\\u' +
+ ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ });
+ }
+
+// In the second stage, we run the text against regular expressions that look
+// for non-JSON patterns. We are especially concerned with '()' and 'new'
+// because they can cause invocation, and '=' because it can cause mutation.
+// But just to be safe, we want to reject all unexpected forms.
+
+// We split the second stage into 4 regexp operations in order to work around
+// crippling inefficiencies in IE's and Safari's regexp engines. First we
+// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
+// replace all simple value tokens with ']' characters. Third, we delete all
+// open brackets that follow a colon or comma or that begin the text. Finally,
+// we look to see that the remaining characters are only whitespace or ']' or
+// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
+
+ if (/^[\],:{}\s]*$/.
+test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
+replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
+replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
+
+// In the third stage we use the eval function to compile the text into a
+// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
+// in JavaScript: it can begin a block or an object literal. We wrap the text
+// in parens to eliminate the ambiguity.
+
+ j = eval('(' + text + ')');
+
+// In the optional fourth stage, we recursively walk the new structure, passing
+// each name/value pair to a reviver function for possible transformation.
+
+ return typeof reviver === 'function' ?
+ walk({'': j}, '') : j;
+ }
+
+// If the text is not JSON parseable, then a SyntaxError is thrown.
+
+ throw new SyntaxError('JSON.parse');
+ };
+ }
+}());
+
--- /dev/null
+/*
+ http://www.JSON.org/json2.js
+ 2009-08-17
+
+ Public Domain.
+
+ NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+ See http://www.JSON.org/js.html
+*/
+if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
// Get rid of unused form
jQuery('.media-blank').remove();
// Collapse a single item
- if ( jQuery('.type-form #media-items>*').length == 1 && jQuery('#media-items .hidden').length > 0 ) {
+ if ( jQuery('form.type-form #media-items').children().length == 1 && jQuery('.hidden', '#media-items').length > 0 ) {
jQuery('.describe-toggle-on').show();
jQuery('.describe-toggle-off').hide();
jQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden');
// Create a progress bar containing the filename
jQuery('#media-items').append('<div id="media-item-' + fileObj.id + '" class="media-item child-of-' + post_id + '"><div class="progress"><div class="bar"></div></div><div class="filename original"><span class="percent"></span> ' + fileObj.name + '</div></div>');
// Display the progress div
- jQuery('#media-item-' + fileObj.id + ' .progress').show();
+ jQuery('.progress', '#media-item-' + fileObj.id).show();
// Disable submit and enable cancel
jQuery('#insert-gallery').attr('disabled', 'disabled');
function uploadProgress(fileObj, bytesDone, bytesTotal) {
// Lengthen the progress bar
- var w = jQuery('#media-items').width() - 2;
- jQuery('#media-item-' + fileObj.id + ' .bar').width( w * bytesDone / bytesTotal );
- jQuery('#media-item-' + fileObj.id + ' .percent').html( Math.ceil(bytesDone / bytesTotal * 100) + '%' );
+ var w = jQuery('#media-items').width() - 2, item = jQuery('#media-item-' + fileObj.id);
+ jQuery('.bar', item).width( w * bytesDone / bytesTotal );
+ jQuery('.percent', item).html( Math.ceil(bytesDone / bytesTotal * 100) + '%' );
if ( bytesDone == bytesTotal )
- jQuery('#media-item-' + fileObj.id + ' .bar').html('<strong class="crunching">' + swfuploadL10n.crunching + '</strong>');
+ jQuery('.bar', item).html('<strong class="crunching">' + swfuploadL10n.crunching + '</strong>');
}
function prepareMediaItem(fileObj, serverData) {
+ var f = ( typeof shortform == 'undefined' ) ? 1 : 2, item = jQuery('#media-item-' + fileObj.id);
// Move the progress bar to 100%
- jQuery('#media-item-' + fileObj.id + ' .bar').remove();
- jQuery('#media-item-' + fileObj.id + ' .progress').hide();
+ jQuery('.bar', item).remove();
+ jQuery('.progress', item).hide();
- var f = ( typeof shortform == 'undefined' ) ? 1 : 2;
// Old style: Append the HTML returned by the server -- thumbnail and form inputs
if ( isNaN(serverData) || !serverData ) {
- jQuery('#media-item-' + fileObj.id).append(serverData);
+ item.append(serverData);
prepareMediaItemInit(fileObj);
}
// New style: server data is just the attachment ID, fetch the thumbnail and form html from the server
else {
- jQuery('#media-item-' + fileObj.id).load('async-upload.php', {attachment_id:serverData, fetch:f}, function(){prepareMediaItemInit(fileObj);updateMediaForm()});
+ item.load('async-upload.php', {attachment_id:serverData, fetch:f}, function(){prepareMediaItemInit(fileObj);updateMediaForm()});
}
}
-
-function prepareMediaItemInit(fileObj) {
+function prepareMediaItemInit(fileObj) {
+ var item = jQuery('#media-item-' + fileObj.id);
// Clone the thumbnail as a "pinkynail" -- a tiny image to the left of the filename
- jQuery('#media-item-' + fileObj.id + ' .thumbnail').clone().attr('className', 'pinkynail toggle').prependTo('#media-item-' + fileObj.id);
+ jQuery('.thumbnail', item).clone().attr('className', 'pinkynail toggle').prependTo(item);
// Replace the original filename with the new (unique) one assigned during upload
- jQuery('#media-item-' + fileObj.id + ' .filename.original').replaceWith(jQuery('#media-item-' + fileObj.id + ' .filename.new'));
+ jQuery('.filename.original', item).replaceWith( jQuery('.filename.new', item) );
// Also bind toggle to the links
- jQuery('#media-item-' + fileObj.id + ' a.toggle').click(function(){
- jQuery(this).siblings('.slidetoggle').slideToggle(150, function(){
- var o = jQuery(this).offset();
- window.scrollTo(0, o.top-36);
+ jQuery('a.toggle', item).click(function(){
+ jQuery(this).siblings('.slidetoggle').slideToggle(350, function(){
+ var w = jQuery(window).height(), t = jQuery(this).offset().top, h = jQuery(this).height(), b;
+
+ if ( w && t && h ) {
+ b = t + h;
+
+ if ( b > w && (h + 48) < w )
+ window.scrollBy(0, b - w + 13);
+ else if ( b > w )
+ window.scrollTo(0, t - 36);
+ }
});
- jQuery(this).parent().children('.toggle').toggle();
+ jQuery(this).siblings('.toggle').andSelf().toggle();
jQuery(this).siblings('a.toggle').focus();
return false;
});
// Bind AJAX to the new Delete button
- jQuery('#media-item-' + fileObj.id + ' a.delete').click(function(){
+ jQuery('a.delete', item).click(function(){
// Tell the server to delete it. TODO: handle exceptions
- jQuery.ajax({url:'admin-ajax.php',type:'post',success:deleteSuccess,error:deleteError,id:fileObj.id,data:{
- id : this.id.replace(/[^0-9]/g,''),
- action : 'delete-post',
- _ajax_nonce : this.href.replace(/^.*wpnonce=/,'')}
- });
+ jQuery.ajax({
+ url: 'admin-ajax.php',
+ type: 'post',
+ success: deleteSuccess,
+ error: deleteError,
+ id: fileObj.id,
+ data: {
+ id : this.id.replace(/[^0-9]/g, ''),
+ action : 'trash-post',
+ _ajax_nonce : this.href.replace(/^.*wpnonce=/,'')
+ }
+ });
+ return false;
+ });
+
+ // Bind AJAX to the new Undo button
+ jQuery('a.undo', item).click(function(){
+ // Tell the server to untrash it. TODO: handle exceptions
+ jQuery.ajax({
+ url: 'admin-ajax.php',
+ type: 'post',
+ id: fileObj.id,
+ data: {
+ id : this.id.replace(/[^0-9]/g,''),
+ action: 'untrash-post',
+ _ajax_nonce: this.href.replace(/^.*wpnonce=/,'')
+ },
+ success: function(data, textStatus){
+ var item = jQuery('#media-item-' + fileObj.id);
+
+ if ( type = jQuery('#type-of-' + fileObj.id).val() )
+ jQuery('#' + type + '-counter').text(jQuery('#' + type + '-counter').text()-0+1);
+ if ( item.hasClass('child-of-'+post_id) )
+ jQuery('#attachments-count').text(jQuery('#attachments-count').text()-0+1);
+
+ jQuery('.filename .trashnotice', item).remove();
+ jQuery('.filename .title', item).css('font-weight','normal');
+ jQuery('a.undo', item).addClass('hidden');
+ jQuery('a.describe-toggle-on, .menu_order_input', item).show();
+ item.css( {backgroundColor:'#ceb'} ).animate( {backgroundColor: '#fff'}, { queue: false, duration: 500, complete: function(){ jQuery(this).css({backgroundColor:''}); } }).removeClass('undo');
+ }
+ });
return false;
});
// Open this item if it says to start open (e.g. to display an error)
- jQuery('#media-item-' + fileObj.id + '.startopen').removeClass('startopen').slideToggle(500).parent().children('.toggle').toggle();
+ jQuery('#media-item-' + fileObj.id + '.startopen').removeClass('startopen').slideToggle(500).siblings('.toggle').toggle();
}
function itemAjaxError(id, html) {
if ( data == '0' )
return itemAjaxError(this.id, 'Could not be deleted. Has it been deleted already?');
- var item = jQuery('#media-item-' + this.id);
+ var id = this.id, item = jQuery('#media-item-' + id);
// Decrement the counters.
- if ( type = jQuery('#type-of-' + this.id).val() )
- jQuery('#' + type + '-counter').text(jQuery('#' + type + '-counter').text()-1);
+ if ( type = jQuery('#type-of-' + id).val() )
+ jQuery('#' + type + '-counter').text( jQuery('#' + type + '-counter').text() - 1 );
if ( item.hasClass('child-of-'+post_id) )
- jQuery('#attachments-count').text(jQuery('#attachments-count').text()-1);
+ jQuery('#attachments-count').text( jQuery('#attachments-count').text() - 1 );
- if ( jQuery('.type-form #media-items>*').length == 1 && jQuery('#media-items .hidden').length > 0 ) {
+ if ( jQuery('form.type-form #media-items').children().length == 1 && jQuery('.hidden', '#media-items').length > 0 ) {
jQuery('.toggle').toggle();
jQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden');
}
// Vanish it.
- jQuery('#media-item-' + this.id + ' .filename:empty').remove();
- jQuery('#media-item-' + this.id + ' .filename').append(' <span class="file-error">'+swfuploadL10n.deleted+'</span>').siblings('a.toggle').remove();
- jQuery('#media-item-' + this.id).children('.describe').css({backgroundColor:'#fff'}).end()
- .animate({backgroundColor:'#ffc0c0'}, {queue:false,duration:50})
- .animate({minHeight:0,height:36}, 400, null, function(){jQuery(this).children('.describe').remove()})
- .animate({backgroundColor:'#fff'}, 400)
- .animate({height:0}, 800, null, function(){jQuery(this).remove();updateMediaForm();});
+ jQuery('.toggle', item).toggle();
+ jQuery('.slidetoggle', item).slideUp(200).siblings().removeClass('hidden');
+ item.css( {backgroundColor:'#faa'} ).animate( {backgroundColor:'#f4f4f4'}, {queue:false, duration:500} ).addClass('undo');
+
+ jQuery('.filename:empty', item).remove();
+ jQuery('.filename .title', item).css('font-weight','bold');
+ jQuery('.filename', item).append('<span class="trashnotice"> ' + swfuploadL10n.deleted + ' </span>').siblings('a.toggle').hide();
+ jQuery('.filename', item).append( jQuery('a.undo', item).removeClass('hidden') );
+ jQuery('.menu_order_input', item).hide();
return;
}
}
function updateMediaForm() {
- storeState();
+ var one = jQuery('form.type-form #media-items').children(), items = jQuery('#media-items').children();
+
// Just one file, no need for collapsible part
- if ( jQuery('.type-form #media-items>*').length == 1 ) {
- jQuery('#media-items .slidetoggle').slideDown(500).parent().eq(0).children('.toggle').toggle();
- jQuery('.type-form .slidetoggle').siblings().addClass('hidden');
+ if ( one.length == 1 ) {
+ jQuery('.slidetoggle', one).slideDown(500).siblings().addClass('hidden').filter('.toggle').toggle();
}
// Only show Save buttons when there is at least one file.
- if ( jQuery('#media-items>*').not('.media-blank').length > 0 )
+ if ( items.not('.media-blank').length > 0 )
jQuery('.savebutton').show();
else
jQuery('.savebutton').hide();
// Only show Gallery button when there are at least two files.
- if ( jQuery('#media-items>*').length > 1 )
+ if ( items.length > 1 )
jQuery('.insert-gallery').show();
else
jQuery('.insert-gallery').hide();
}
function uploadError(fileObj, errorCode, message) {
-
+
switch (errorCode) {
case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:
wpFileError(fileObj, swfuploadL10n.missing_upload_url);
}
// remember the last used image size, alignment and url
-var storeState;
-(function($){
-
-storeState = function(){
- var align = getUserSetting('align') || '', imgsize = getUserSetting('imgsize') || '';
-
- $('tr.align input[type="radio"]').click(function(){
- setUserSetting('align', $(this).val());
- }).filter(function(){
- if ( $(this).val() == align )
- return true;
- return false;
- }).attr('checked','checked');
-
- $('tr.image-size input[type="radio"]').click(function(){
- setUserSetting('imgsize', $(this).val());
- }).filter(function(){
- if ( $(this).attr('disabled') || $(this).val() != imgsize )
- return false;
- return true;
- }).attr('checked','checked');
-
- $('tr.url button').click(function(){
- var c = this.className || '';
- c = c.replace(/.*?(url[^ '"]+).*/, '$1');
- if (c) setUserSetting('urlbutton', c);
- $(this).siblings('.urlfield').val( $(this).attr('title') );
+jQuery(document).ready(function($){
+ $('input[type="radio"]', '#media-items').live('click', function(){
+ var tr = $(this).closest('tr');
+
+ if ( $(tr).hasClass('align') )
+ setUserSetting('align', $(this).val());
+ else if ( $(tr).hasClass('image-size') )
+ setUserSetting('imgsize', $(this).val());
});
- $('tr.url .urlfield').each(function(){
- var b = getUserSetting('urlbutton');
- $(this).val( $(this).siblings('button.'+b).attr('title') );
+ $('button.button', '#media-items').live('click', function(){
+ var c = this.className || '';
+ c = c.match(/url([^ '"]+)/);
+ if ( c && c[1] ) {
+ setUserSetting('urlbutton', c[1]);
+ $(this).siblings('.urlfield').val( $(this).attr('title') );
+ }
});
-}
-})(jQuery);
+});
-function fileDialogStart(){jQuery("#media-upload-error").empty()}function fileQueued(a){jQuery(".media-blank").remove();if(jQuery(".type-form #media-items>*").length==1&&jQuery("#media-items .hidden").length>0){jQuery(".describe-toggle-on").show();jQuery(".describe-toggle-off").hide();jQuery(".slidetoggle").slideUp(200).siblings().removeClass("hidden")}jQuery("#media-items").append('<div id="media-item-'+a.id+'" class="media-item child-of-'+post_id+'"><div class="progress"><div class="bar"></div></div><div class="filename original"><span class="percent"></span> '+a.name+"</div></div>");jQuery("#media-item-"+a.id+" .progress").show();jQuery("#insert-gallery").attr("disabled","disabled");jQuery("#cancel-upload").attr("disabled","")}function uploadStart(a){return true}function uploadProgress(d,b,c){var a=jQuery("#media-items").width()-2;jQuery("#media-item-"+d.id+" .bar").width(a*b/c);jQuery("#media-item-"+d.id+" .percent").html(Math.ceil(b/c*100)+"%");if(b==c){jQuery("#media-item-"+d.id+" .bar").html('<strong class="crunching">'+swfuploadL10n.crunching+"</strong>")}}function prepareMediaItem(b,a){jQuery("#media-item-"+b.id+" .bar").remove();jQuery("#media-item-"+b.id+" .progress").hide();var c=(typeof shortform=="undefined")?1:2;if(isNaN(a)||!a){jQuery("#media-item-"+b.id).append(a);prepareMediaItemInit(b)}else{jQuery("#media-item-"+b.id).load("async-upload.php",{attachment_id:a,fetch:c},function(){prepareMediaItemInit(b);updateMediaForm()})}}function prepareMediaItemInit(a){jQuery("#media-item-"+a.id+" .thumbnail").clone().attr("className","pinkynail toggle").prependTo("#media-item-"+a.id);jQuery("#media-item-"+a.id+" .filename.original").replaceWith(jQuery("#media-item-"+a.id+" .filename.new"));jQuery("#media-item-"+a.id+" a.toggle").click(function(){jQuery(this).siblings(".slidetoggle").slideToggle(150,function(){var b=jQuery(this).offset();window.scrollTo(0,b.top-36)});jQuery(this).parent().children(".toggle").toggle();jQuery(this).siblings("a.toggle").focus();return false});jQuery("#media-item-"+a.id+" a.delete").click(function(){jQuery.ajax({url:"admin-ajax.php",type:"post",success:deleteSuccess,error:deleteError,id:a.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"delete-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")}});return false});jQuery("#media-item-"+a.id+".startopen").removeClass("startopen").slideToggle(500).parent().children(".toggle").toggle()}function itemAjaxError(c,b){var a=jQuery("#media-item-error"+c);a.html('<div class="file-error"><button type="button" id="dismiss-'+c+'" class="button dismiss">'+swfuploadL10n.dismiss+"</button>"+b+"</div>");jQuery("#dismiss-"+c).click(function(){jQuery(this).parents(".file-error").slideUp(200,function(){jQuery(this).empty()})})}function deleteSuccess(b,c){if(b=="-1"){return itemAjaxError(this.id,"You do not have permission. Has your session expired?")}if(b=="0"){return itemAjaxError(this.id,"Could not be deleted. Has it been deleted already?")}var a=jQuery("#media-item-"+this.id);if(type=jQuery("#type-of-"+this.id).val()){jQuery("#"+type+"-counter").text(jQuery("#"+type+"-counter").text()-1)}if(a.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(jQuery("#attachments-count").text()-1)}if(jQuery(".type-form #media-items>*").length==1&&jQuery("#media-items .hidden").length>0){jQuery(".toggle").toggle();jQuery(".slidetoggle").slideUp(200).siblings().removeClass("hidden")}jQuery("#media-item-"+this.id+" .filename:empty").remove();jQuery("#media-item-"+this.id+" .filename").append(' <span class="file-error">'+swfuploadL10n.deleted+"</span>").siblings("a.toggle").remove();jQuery("#media-item-"+this.id).children(".describe").css({backgroundColor:"#fff"}).end().animate({backgroundColor:"#ffc0c0"},{queue:false,duration:50}).animate({minHeight:0,height:36},400,null,function(){jQuery(this).children(".describe").remove()}).animate({backgroundColor:"#fff"},400).animate({height:0},800,null,function(){jQuery(this).remove();updateMediaForm()});return}function deleteError(c,b,a){}function updateMediaForm(){storeState();if(jQuery(".type-form #media-items>*").length==1){jQuery("#media-items .slidetoggle").slideDown(500).parent().eq(0).children(".toggle").toggle();jQuery(".type-form .slidetoggle").siblings().addClass("hidden")}if(jQuery("#media-items>*").not(".media-blank").length>0){jQuery(".savebutton").show()}else{jQuery(".savebutton").hide()}if(jQuery("#media-items>*").length>1){jQuery(".insert-gallery").show()}else{jQuery(".insert-gallery").hide()}}function uploadSuccess(b,a){if(a.match("media-upload-error")){jQuery("#media-item-"+b.id).html(a);return}prepareMediaItem(b,a);updateMediaForm();if(jQuery("#media-item-"+b.id).hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(1*jQuery("#attachments-count").text()+1)}}function uploadComplete(a){if(swfu.getStats().files_queued==0){jQuery("#cancel-upload").attr("disabled","disabled");jQuery("#insert-gallery").attr("disabled","")}}function wpQueueError(a){jQuery("#media-upload-error").show().text(a)}function wpFileError(b,a){jQuery("#media-item-"+b.id+" .filename").after('<div class="file-error"><button type="button" id="dismiss-'+b.id+'" class="button dismiss">'+swfuploadL10n.dismiss+"</button>"+a+"</div>").siblings(".toggle").remove();jQuery("#dismiss-"+b.id).click(function(){jQuery(this).parents(".media-item").slideUp(200,function(){jQuery(this).remove()})})}function fileQueueError(c,a,b){if(a==SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED){wpQueueError(swfuploadL10n.queue_limit_exceeded)}else{if(a==SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT){fileQueued(c);wpFileError(c,swfuploadL10n.file_exceeds_size_limit)}else{if(a==SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE){fileQueued(c);wpFileError(c,swfuploadL10n.zero_byte_file)}else{if(a==SWFUpload.QUEUE_ERROR.INVALID_FILETYPE){fileQueued(c);wpFileError(c,swfuploadL10n.invalid_filetype)}else{wpQueueError(swfuploadL10n.default_error)}}}}}function fileDialogComplete(b){try{if(b>0){this.startUpload()}}catch(a){this.debug(a)}}function switchUploader(b){var c=document.getElementById(swfu.customSettings.swfupload_element_id),a=document.getElementById(swfu.customSettings.degraded_element_id);if(b){c.style.display="block";a.style.display="none"}else{c.style.display="none";a.style.display="block"}}function swfuploadPreLoad(){if(!uploaderMode){switchUploader(1)}else{switchUploader(0)}}function swfuploadLoadFailed(){switchUploader(0);jQuery(".upload-html-bypass").hide()}function uploadError(b,c,a){switch(c){case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:wpFileError(b,swfuploadL10n.missing_upload_url);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:wpFileError(b,swfuploadL10n.upload_limit_exceeded);break;case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:wpQueueError(swfuploadL10n.http_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:wpQueueError(swfuploadL10n.upload_failed);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:wpQueueError(swfuploadL10n.io_error);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:wpQueueError(swfuploadL10n.security_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:jQuery("#media-item-"+b.id).remove();break;default:wpFileError(b,swfuploadL10n.default_error)}}function cancelUpload(){swfu.cancelQueue()}var storeState;(function(a){storeState=function(){var c=getUserSetting("align")||"",b=getUserSetting("imgsize")||"";a('tr.align input[type="radio"]').click(function(){setUserSetting("align",a(this).val())}).filter(function(){if(a(this).val()==c){return true}return false}).attr("checked","checked");a('tr.image-size input[type="radio"]').click(function(){setUserSetting("imgsize",a(this).val())}).filter(function(){if(a(this).attr("disabled")||a(this).val()!=b){return false}return true}).attr("checked","checked");a("tr.url button").click(function(){var d=this.className||"";d=d.replace(/.*?(url[^ '"]+).*/,"$1");if(d){setUserSetting("urlbutton",d)}a(this).siblings(".urlfield").val(a(this).attr("title"))});a("tr.url .urlfield").each(function(){var d=getUserSetting("urlbutton");a(this).val(a(this).siblings("button."+d).attr("title"))})}})(jQuery);
\ No newline at end of file
+function fileDialogStart(){jQuery("#media-upload-error").empty()}function fileQueued(a){jQuery(".media-blank").remove();if(jQuery("form.type-form #media-items").children().length==1&&jQuery(".hidden","#media-items").length>0){jQuery(".describe-toggle-on").show();jQuery(".describe-toggle-off").hide();jQuery(".slidetoggle").slideUp(200).siblings().removeClass("hidden")}jQuery("#media-items").append('<div id="media-item-'+a.id+'" class="media-item child-of-'+post_id+'"><div class="progress"><div class="bar"></div></div><div class="filename original"><span class="percent"></span> '+a.name+"</div></div>");jQuery(".progress","#media-item-"+a.id).show();jQuery("#insert-gallery").attr("disabled","disabled");jQuery("#cancel-upload").attr("disabled","")}function uploadStart(a){return true}function uploadProgress(e,b,d){var a=jQuery("#media-items").width()-2,c=jQuery("#media-item-"+e.id);jQuery(".bar",c).width(a*b/d);jQuery(".percent",c).html(Math.ceil(b/d*100)+"%");if(b==d){jQuery(".bar",c).html('<strong class="crunching">'+swfuploadL10n.crunching+"</strong>")}}function prepareMediaItem(c,a){var d=(typeof shortform=="undefined")?1:2,b=jQuery("#media-item-"+c.id);jQuery(".bar",b).remove();jQuery(".progress",b).hide();if(isNaN(a)||!a){b.append(a);prepareMediaItemInit(c)}else{b.load("async-upload.php",{attachment_id:a,fetch:d},function(){prepareMediaItemInit(c);updateMediaForm()})}}function prepareMediaItemInit(b){var a=jQuery("#media-item-"+b.id);jQuery(".thumbnail",a).clone().attr("className","pinkynail toggle").prependTo(a);jQuery(".filename.original",a).replaceWith(jQuery(".filename.new",a));jQuery("a.toggle",a).click(function(){jQuery(this).siblings(".slidetoggle").slideToggle(350,function(){var d=jQuery(window).height(),e=jQuery(this).offset().top,f=jQuery(this).height(),c;if(d&&e&&f){c=e+f;if(c>d&&(f+48)<d){window.scrollBy(0,c-d+13)}else{if(c>d){window.scrollTo(0,e-36)}}}});jQuery(this).siblings(".toggle").andSelf().toggle();jQuery(this).siblings("a.toggle").focus();return false});jQuery("a.delete",a).click(function(){jQuery.ajax({url:"admin-ajax.php",type:"post",success:deleteSuccess,error:deleteError,id:b.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"trash-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")}});return false});jQuery("a.undo",a).click(function(){jQuery.ajax({url:"admin-ajax.php",type:"post",id:b.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"untrash-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")},success:function(d,e){var c=jQuery("#media-item-"+b.id);if(type=jQuery("#type-of-"+b.id).val()){jQuery("#"+type+"-counter").text(jQuery("#"+type+"-counter").text()-0+1)}if(c.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(jQuery("#attachments-count").text()-0+1)}jQuery(".filename .trashnotice",c).remove();jQuery(".filename .title",c).css("font-weight","normal");jQuery("a.undo",c).addClass("hidden");jQuery("a.describe-toggle-on, .menu_order_input",c).show();c.css({backgroundColor:"#ceb"}).animate({backgroundColor:"#fff"},{queue:false,duration:500,complete:function(){jQuery(this).css({backgroundColor:""})}}).removeClass("undo")}});return false});jQuery("#media-item-"+b.id+".startopen").removeClass("startopen").slideToggle(500).siblings(".toggle").toggle()}function itemAjaxError(c,b){var a=jQuery("#media-item-error"+c);a.html('<div class="file-error"><button type="button" id="dismiss-'+c+'" class="button dismiss">'+swfuploadL10n.dismiss+"</button>"+b+"</div>");jQuery("#dismiss-"+c).click(function(){jQuery(this).parents(".file-error").slideUp(200,function(){jQuery(this).empty()})})}function deleteSuccess(b,d){if(b=="-1"){return itemAjaxError(this.id,"You do not have permission. Has your session expired?")}if(b=="0"){return itemAjaxError(this.id,"Could not be deleted. Has it been deleted already?")}var c=this.id,a=jQuery("#media-item-"+c);if(type=jQuery("#type-of-"+c).val()){jQuery("#"+type+"-counter").text(jQuery("#"+type+"-counter").text()-1)}if(a.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(jQuery("#attachments-count").text()-1)}if(jQuery("form.type-form #media-items").children().length==1&&jQuery(".hidden","#media-items").length>0){jQuery(".toggle").toggle();jQuery(".slidetoggle").slideUp(200).siblings().removeClass("hidden")}jQuery(".toggle",a).toggle();jQuery(".slidetoggle",a).slideUp(200).siblings().removeClass("hidden");a.css({backgroundColor:"#faa"}).animate({backgroundColor:"#f4f4f4"},{queue:false,duration:500}).addClass("undo");jQuery(".filename:empty",a).remove();jQuery(".filename .title",a).css("font-weight","bold");jQuery(".filename",a).append('<span class="trashnotice"> '+swfuploadL10n.deleted+" </span>").siblings("a.toggle").hide();jQuery(".filename",a).append(jQuery("a.undo",a).removeClass("hidden"));jQuery(".menu_order_input",a).hide();return}function deleteError(c,b,a){}function updateMediaForm(){var b=jQuery("form.type-form #media-items").children(),a=jQuery("#media-items").children();if(b.length==1){jQuery(".slidetoggle",b).slideDown(500).siblings().addClass("hidden").filter(".toggle").toggle()}if(a.not(".media-blank").length>0){jQuery(".savebutton").show()}else{jQuery(".savebutton").hide()}if(a.length>1){jQuery(".insert-gallery").show()}else{jQuery(".insert-gallery").hide()}}function uploadSuccess(b,a){if(a.match("media-upload-error")){jQuery("#media-item-"+b.id).html(a);return}prepareMediaItem(b,a);updateMediaForm();if(jQuery("#media-item-"+b.id).hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(1*jQuery("#attachments-count").text()+1)}}function uploadComplete(a){if(swfu.getStats().files_queued==0){jQuery("#cancel-upload").attr("disabled","disabled");jQuery("#insert-gallery").attr("disabled","")}}function wpQueueError(a){jQuery("#media-upload-error").show().text(a)}function wpFileError(b,a){jQuery("#media-item-"+b.id+" .filename").after('<div class="file-error"><button type="button" id="dismiss-'+b.id+'" class="button dismiss">'+swfuploadL10n.dismiss+"</button>"+a+"</div>").siblings(".toggle").remove();jQuery("#dismiss-"+b.id).click(function(){jQuery(this).parents(".media-item").slideUp(200,function(){jQuery(this).remove()})})}function fileQueueError(c,a,b){if(a==SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED){wpQueueError(swfuploadL10n.queue_limit_exceeded)}else{if(a==SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT){fileQueued(c);wpFileError(c,swfuploadL10n.file_exceeds_size_limit)}else{if(a==SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE){fileQueued(c);wpFileError(c,swfuploadL10n.zero_byte_file)}else{if(a==SWFUpload.QUEUE_ERROR.INVALID_FILETYPE){fileQueued(c);wpFileError(c,swfuploadL10n.invalid_filetype)}else{wpQueueError(swfuploadL10n.default_error)}}}}}function fileDialogComplete(b){try{if(b>0){this.startUpload()}}catch(a){this.debug(a)}}function switchUploader(b){var c=document.getElementById(swfu.customSettings.swfupload_element_id),a=document.getElementById(swfu.customSettings.degraded_element_id);if(b){c.style.display="block";a.style.display="none"}else{c.style.display="none";a.style.display="block"}}function swfuploadPreLoad(){if(!uploaderMode){switchUploader(1)}else{switchUploader(0)}}function swfuploadLoadFailed(){switchUploader(0);jQuery(".upload-html-bypass").hide()}function uploadError(b,c,a){switch(c){case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:wpFileError(b,swfuploadL10n.missing_upload_url);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:wpFileError(b,swfuploadL10n.upload_limit_exceeded);break;case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:wpQueueError(swfuploadL10n.http_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:wpQueueError(swfuploadL10n.upload_failed);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:wpQueueError(swfuploadL10n.io_error);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:wpQueueError(swfuploadL10n.security_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:jQuery("#media-item-"+b.id).remove();break;default:wpFileError(b,swfuploadL10n.default_error)}}function cancelUpload(){swfu.cancelQueue()}jQuery(document).ready(function(a){a('input[type="radio"]',"#media-items").live("click",function(){var b=a(this).closest("tr");if(a(b).hasClass("align")){setUserSetting("align",a(this).val())}else{if(a(b).hasClass("image-size")){setUserSetting("imgsize",a(this).val())}}});a("button.button","#media-items").live("click",function(){var b=this.className||"";b=b.match(/url([^ '"]+)/);if(b&&b[1]){setUserSetting("urlbutton",b[1]);a(this).siblings(".urlfield").val(a(this).attr("title"))}})});
\ No newline at end of file
-/*\r
- Speed Plug-in\r
- \r
- Features:\r
- *Adds several properties to the 'file' object indicated upload speed, time left, upload time, etc.\r
- - currentSpeed -- String indicating the upload speed, bytes per second\r
- - averageSpeed -- Overall average upload speed, bytes per second\r
- - movingAverageSpeed -- Speed over averaged over the last several measurements, bytes per second\r
- - timeRemaining -- Estimated remaining upload time in seconds\r
- - timeElapsed -- Number of seconds passed for this upload\r
- - percentUploaded -- Percentage of the file uploaded (0 to 100)\r
- - sizeUploaded -- Formatted size uploaded so far, bytes\r
- \r
- *Adds setting 'moving_average_history_size' for defining the window size used to calculate the moving average speed.\r
- \r
- *Adds several Formatting functions for formatting that values provided on the file object.\r
- - SWFUpload.speed.formatBPS(bps) -- outputs string formatted in the best units (Gbps, Mbps, Kbps, bps)\r
- - SWFUpload.speed.formatTime(seconds) -- outputs string formatted in the best units (x Hr y M z S)\r
- - SWFUpload.speed.formatSize(bytes) -- outputs string formatted in the best units (w GB x MB y KB z B )\r
- - SWFUpload.speed.formatPercent(percent) -- outputs string formatted with a percent sign (x.xx %)\r
- - SWFUpload.speed.formatUnits(baseNumber, divisionArray, unitLabelArray, fractionalBoolean)\r
- - Formats a number using the division array to determine how to apply the labels in the Label Array\r
- - factionalBoolean indicates whether the number should be returned as a single fractional number with a unit (speed)\r
- or as several numbers labeled with units (time)\r
- */\r
-\r
-var SWFUpload;\r
-if (typeof(SWFUpload) === "function") {\r
- SWFUpload.speed = {};\r
- \r
- SWFUpload.prototype.initSettings = (function (oldInitSettings) {\r
- return function () {\r
- if (typeof(oldInitSettings) === "function") {\r
- oldInitSettings.call(this);\r
- }\r
- \r
- this.ensureDefault = function (settingName, defaultValue) {\r
- this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];\r
- };\r
-\r
- // List used to keep the speed stats for the files we are tracking\r
- this.fileSpeedStats = {};\r
- this.speedSettings = {};\r
-\r
- this.ensureDefault("moving_average_history_size", "10");\r
- \r
- this.speedSettings.user_file_queued_handler = this.settings.file_queued_handler;\r
- this.speedSettings.user_file_queue_error_handler = this.settings.file_queue_error_handler;\r
- this.speedSettings.user_upload_start_handler = this.settings.upload_start_handler;\r
- this.speedSettings.user_upload_error_handler = this.settings.upload_error_handler;\r
- this.speedSettings.user_upload_progress_handler = this.settings.upload_progress_handler;\r
- this.speedSettings.user_upload_success_handler = this.settings.upload_success_handler;\r
- this.speedSettings.user_upload_complete_handler = this.settings.upload_complete_handler;\r
- \r
- this.settings.file_queued_handler = SWFUpload.speed.fileQueuedHandler;\r
- this.settings.file_queue_error_handler = SWFUpload.speed.fileQueueErrorHandler;\r
- this.settings.upload_start_handler = SWFUpload.speed.uploadStartHandler;\r
- this.settings.upload_error_handler = SWFUpload.speed.uploadErrorHandler;\r
- this.settings.upload_progress_handler = SWFUpload.speed.uploadProgressHandler;\r
- this.settings.upload_success_handler = SWFUpload.speed.uploadSuccessHandler;\r
- this.settings.upload_complete_handler = SWFUpload.speed.uploadCompleteHandler;\r
- \r
- delete this.ensureDefault;\r
- };\r
- })(SWFUpload.prototype.initSettings);\r
-\r
- \r
- SWFUpload.speed.fileQueuedHandler = function (file) {\r
- if (typeof this.speedSettings.user_file_queued_handler === "function") {\r
- file = SWFUpload.speed.extendFile(file);\r
- \r
- return this.speedSettings.user_file_queued_handler.call(this, file);\r
- }\r
- };\r
- \r
- SWFUpload.speed.fileQueueErrorHandler = function (file, errorCode, message) {\r
- if (typeof this.speedSettings.user_file_queue_error_handler === "function") {\r
- file = SWFUpload.speed.extendFile(file);\r
- \r
- return this.speedSettings.user_file_queue_error_handler.call(this, file, errorCode, message);\r
- }\r
- };\r
-\r
- SWFUpload.speed.uploadStartHandler = function (file) {\r
- if (typeof this.speedSettings.user_upload_start_handler === "function") {\r
- file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);\r
- return this.speedSettings.user_upload_start_handler.call(this, file);\r
- }\r
- };\r
- \r
- SWFUpload.speed.uploadErrorHandler = function (file, errorCode, message) {\r
- file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);\r
- SWFUpload.speed.removeTracking(file, this.fileSpeedStats);\r
-\r
- if (typeof this.speedSettings.user_upload_error_handler === "function") {\r
- return this.speedSettings.user_upload_error_handler.call(this, file, errorCode, message);\r
- }\r
- };\r
- SWFUpload.speed.uploadProgressHandler = function (file, bytesComplete, bytesTotal) {\r
- this.updateTracking(file, bytesComplete);\r
- file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);\r
-\r
- if (typeof this.speedSettings.user_upload_progress_handler === "function") {\r
- return this.speedSettings.user_upload_progress_handler.call(this, file, bytesComplete, bytesTotal);\r
- }\r
- };\r
- \r
- SWFUpload.speed.uploadSuccessHandler = function (file, serverData) {\r
- if (typeof this.speedSettings.user_upload_success_handler === "function") {\r
- file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);\r
- return this.speedSettings.user_upload_success_handler.call(this, file, serverData);\r
- }\r
- };\r
- SWFUpload.speed.uploadCompleteHandler = function (file) {\r
- file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);\r
- SWFUpload.speed.removeTracking(file, this.fileSpeedStats);\r
-\r
- if (typeof this.speedSettings.user_upload_complete_handler === "function") {\r
- return this.speedSettings.user_upload_complete_handler.call(this, file);\r
- }\r
- };\r
- \r
- // Private: extends the file object with the speed plugin values\r
- SWFUpload.speed.extendFile = function (file, trackingList) {\r
- var tracking;\r
- \r
- if (trackingList) {\r
- tracking = trackingList[file.id];\r
- }\r
- \r
- if (tracking) {\r
- file.currentSpeed = tracking.currentSpeed;\r
- file.averageSpeed = tracking.averageSpeed;\r
- file.movingAverageSpeed = tracking.movingAverageSpeed;\r
- file.timeRemaining = tracking.timeRemaining;\r
- file.timeElapsed = tracking.timeElapsed;\r
- file.percentUploaded = tracking.percentUploaded;\r
- file.sizeUploaded = tracking.bytesUploaded;\r
-\r
- } else {\r
- file.currentSpeed = 0;\r
- file.averageSpeed = 0;\r
- file.movingAverageSpeed = 0;\r
- file.timeRemaining = 0;\r
- file.timeElapsed = 0;\r
- file.percentUploaded = 0;\r
- file.sizeUploaded = 0;\r
- }\r
- \r
- return file;\r
- };\r
- \r
- // Private: Updates the speed tracking object, or creates it if necessary\r
- SWFUpload.prototype.updateTracking = function (file, bytesUploaded) {\r
- var tracking = this.fileSpeedStats[file.id];\r
- if (!tracking) {\r
- this.fileSpeedStats[file.id] = tracking = {};\r
- }\r
- \r
- // Sanity check inputs\r
- bytesUploaded = bytesUploaded || tracking.bytesUploaded || 0;\r
- if (bytesUploaded < 0) {\r
- bytesUploaded = 0;\r
- }\r
- if (bytesUploaded > file.size) {\r
- bytesUploaded = file.size;\r
- }\r
- \r
- var tickTime = (new Date()).getTime();\r
- if (!tracking.startTime) {\r
- tracking.startTime = (new Date()).getTime();\r
- tracking.lastTime = tracking.startTime;\r
- tracking.currentSpeed = 0;\r
- tracking.averageSpeed = 0;\r
- tracking.movingAverageSpeed = 0;\r
- tracking.movingAverageHistory = [];\r
- tracking.timeRemaining = 0;\r
- tracking.timeElapsed = 0;\r
- tracking.percentUploaded = bytesUploaded / file.size;\r
- tracking.bytesUploaded = bytesUploaded;\r
- } else if (tracking.startTime > tickTime) {\r
- this.debug("When backwards in time");\r
- } else {\r
- // Get time and deltas\r
- var now = (new Date()).getTime();\r
- var lastTime = tracking.lastTime;\r
- var deltaTime = now - lastTime;\r
- var deltaBytes = bytesUploaded - tracking.bytesUploaded;\r
- \r
- if (deltaBytes === 0 || deltaTime === 0) {\r
- return tracking;\r
- }\r
- \r
- // Update tracking object\r
- tracking.lastTime = now;\r
- tracking.bytesUploaded = bytesUploaded;\r
- \r
- // Calculate speeds\r
- tracking.currentSpeed = (deltaBytes * 8 ) / (deltaTime / 1000);\r
- tracking.averageSpeed = (tracking.bytesUploaded * 8) / ((now - tracking.startTime) / 1000);\r
-\r
- // Calculate moving average\r
- tracking.movingAverageHistory.push(tracking.currentSpeed);\r
- if (tracking.movingAverageHistory.length > this.settings.moving_average_history_size) {\r
- tracking.movingAverageHistory.shift();\r
- }\r
- \r
- tracking.movingAverageSpeed = SWFUpload.speed.calculateMovingAverage(tracking.movingAverageHistory);\r
- \r
- // Update times\r
- tracking.timeRemaining = (file.size - tracking.bytesUploaded) * 8 / tracking.movingAverageSpeed;\r
- tracking.timeElapsed = (now - tracking.startTime) / 1000;\r
- \r
- // Update percent\r
- tracking.percentUploaded = (tracking.bytesUploaded / file.size * 100);\r
- }\r
- \r
- return tracking;\r
- };\r
- SWFUpload.speed.removeTracking = function (file, trackingList) {\r
- try {\r
- trackingList[file.id] = null;\r
- delete trackingList[file.id];\r
- } catch (ex) {\r
- }\r
- };\r
- \r
- SWFUpload.speed.formatUnits = function (baseNumber, unitDivisors, unitLabels, singleFractional) {\r
- var i, unit, unitDivisor, unitLabel;\r
-\r
- if (baseNumber === 0) {\r
- return "0 " + unitLabels[unitLabels.length - 1];\r
- }\r
- \r
- if (singleFractional) {\r
- unit = baseNumber;\r
- unitLabel = unitLabels.length >= unitDivisors.length ? unitLabels[unitDivisors.length - 1] : "";\r
- for (i = 0; i < unitDivisors.length; i++) {\r
- if (baseNumber >= unitDivisors[i]) {\r
- unit = (baseNumber / unitDivisors[i]).toFixed(2);\r
- unitLabel = unitLabels.length >= i ? " " + unitLabels[i] : "";\r
- break;\r
- }\r
- }\r
- \r
- return unit + unitLabel;\r
- } else {\r
- var formattedStrings = [];\r
- var remainder = baseNumber;\r
- \r
- for (i = 0; i < unitDivisors.length; i++) {\r
- unitDivisor = unitDivisors[i];\r
- unitLabel = unitLabels.length > i ? " " + unitLabels[i] : "";\r
- \r
- unit = remainder / unitDivisor;\r
- if (i < unitDivisors.length -1) {\r
- unit = Math.floor(unit);\r
- } else {\r
- unit = unit.toFixed(2);\r
- }\r
- if (unit > 0) {\r
- remainder = remainder % unitDivisor;\r
- \r
- formattedStrings.push(unit + unitLabel);\r
- }\r
- }\r
- \r
- return formattedStrings.join(" ");\r
- }\r
- };\r
- \r
- SWFUpload.speed.formatBPS = function (baseNumber) {\r
- var bpsUnits = [1073741824, 1048576, 1024, 1], bpsUnitLabels = ["Gbps", "Mbps", "Kbps", "bps"];\r
- return SWFUpload.speed.formatUnits(baseNumber, bpsUnits, bpsUnitLabels, true);\r
- \r
- };\r
- SWFUpload.speed.formatTime = function (baseNumber) {\r
- var timeUnits = [86400, 3600, 60, 1], timeUnitLabels = ["d", "h", "m", "s"];\r
- return SWFUpload.speed.formatUnits(baseNumber, timeUnits, timeUnitLabels, false);\r
- \r
- };\r
- SWFUpload.speed.formatBytes = function (baseNumber) {\r
- var sizeUnits = [1073741824, 1048576, 1024, 1], sizeUnitLabels = ["GB", "MB", "KB", "bytes"];\r
- return SWFUpload.speed.formatUnits(baseNumber, sizeUnits, sizeUnitLabels, true);\r
- \r
- };\r
- SWFUpload.speed.formatPercent = function (baseNumber) {\r
- return baseNumber.toFixed(2) + " %";\r
- };\r
- \r
- SWFUpload.speed.calculateMovingAverage = function (history) {\r
- var vals = [], size, sum = 0.0, mean = 0.0, varianceTemp = 0.0, variance = 0.0, standardDev = 0.0;\r
- var i;\r
- var mSum = 0, mCount = 0;\r
- \r
- size = history.length;\r
- \r
- // Check for sufficient data\r
- if (size >= 8) {\r
- // Clone the array and Calculate sum of the values \r
- for (i = 0; i < size; i++) {\r
- vals[i] = history[i];\r
- sum += vals[i];\r
- }\r
-\r
- mean = sum / size;\r
-\r
- // Calculate variance for the set\r
- for (i = 0; i < size; i++) {\r
- varianceTemp += Math.pow((vals[i] - mean), 2);\r
- }\r
-\r
- variance = varianceTemp / size;\r
- standardDev = Math.sqrt(variance);\r
- \r
- //Standardize the Data\r
- for (i = 0; i < size; i++) {\r
- vals[i] = (vals[i] - mean) / standardDev;\r
- }\r
-\r
- // Calculate the average excluding outliers\r
- var deviationRange = 2.0;\r
- for (i = 0; i < size; i++) {\r
- \r
- if (vals[i] <= deviationRange && vals[i] >= -deviationRange) {\r
- mCount++;\r
- mSum += history[i];\r
- }\r
- }\r
- \r
- } else {\r
- // Calculate the average (not enough data points to remove outliers)\r
- mCount = size;\r
- for (i = 0; i < size; i++) {\r
- mSum += history[i];\r
- }\r
- }\r
-\r
- return mSum / mCount;\r
- };\r
- \r
+/*
+ Speed Plug-in
+
+ Features:
+ *Adds several properties to the 'file' object indicated upload speed, time left, upload time, etc.
+ - currentSpeed -- String indicating the upload speed, bytes per second
+ - averageSpeed -- Overall average upload speed, bytes per second
+ - movingAverageSpeed -- Speed over averaged over the last several measurements, bytes per second
+ - timeRemaining -- Estimated remaining upload time in seconds
+ - timeElapsed -- Number of seconds passed for this upload
+ - percentUploaded -- Percentage of the file uploaded (0 to 100)
+ - sizeUploaded -- Formatted size uploaded so far, bytes
+
+ *Adds setting 'moving_average_history_size' for defining the window size used to calculate the moving average speed.
+
+ *Adds several Formatting functions for formatting that values provided on the file object.
+ - SWFUpload.speed.formatBPS(bps) -- outputs string formatted in the best units (Gbps, Mbps, Kbps, bps)
+ - SWFUpload.speed.formatTime(seconds) -- outputs string formatted in the best units (x Hr y M z S)
+ - SWFUpload.speed.formatSize(bytes) -- outputs string formatted in the best units (w GB x MB y KB z B )
+ - SWFUpload.speed.formatPercent(percent) -- outputs string formatted with a percent sign (x.xx %)
+ - SWFUpload.speed.formatUnits(baseNumber, divisionArray, unitLabelArray, fractionalBoolean)
+ - Formats a number using the division array to determine how to apply the labels in the Label Array
+ - factionalBoolean indicates whether the number should be returned as a single fractional number with a unit (speed)
+ or as several numbers labeled with units (time)
+ */
+
+var SWFUpload;
+if (typeof(SWFUpload) === "function") {
+ SWFUpload.speed = {};
+
+ SWFUpload.prototype.initSettings = (function (oldInitSettings) {
+ return function () {
+ if (typeof(oldInitSettings) === "function") {
+ oldInitSettings.call(this);
+ }
+
+ this.ensureDefault = function (settingName, defaultValue) {
+ this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];
+ };
+
+ // List used to keep the speed stats for the files we are tracking
+ this.fileSpeedStats = {};
+ this.speedSettings = {};
+
+ this.ensureDefault("moving_average_history_size", "10");
+
+ this.speedSettings.user_file_queued_handler = this.settings.file_queued_handler;
+ this.speedSettings.user_file_queue_error_handler = this.settings.file_queue_error_handler;
+ this.speedSettings.user_upload_start_handler = this.settings.upload_start_handler;
+ this.speedSettings.user_upload_error_handler = this.settings.upload_error_handler;
+ this.speedSettings.user_upload_progress_handler = this.settings.upload_progress_handler;
+ this.speedSettings.user_upload_success_handler = this.settings.upload_success_handler;
+ this.speedSettings.user_upload_complete_handler = this.settings.upload_complete_handler;
+
+ this.settings.file_queued_handler = SWFUpload.speed.fileQueuedHandler;
+ this.settings.file_queue_error_handler = SWFUpload.speed.fileQueueErrorHandler;
+ this.settings.upload_start_handler = SWFUpload.speed.uploadStartHandler;
+ this.settings.upload_error_handler = SWFUpload.speed.uploadErrorHandler;
+ this.settings.upload_progress_handler = SWFUpload.speed.uploadProgressHandler;
+ this.settings.upload_success_handler = SWFUpload.speed.uploadSuccessHandler;
+ this.settings.upload_complete_handler = SWFUpload.speed.uploadCompleteHandler;
+
+ delete this.ensureDefault;
+ };
+ })(SWFUpload.prototype.initSettings);
+
+
+ SWFUpload.speed.fileQueuedHandler = function (file) {
+ if (typeof this.speedSettings.user_file_queued_handler === "function") {
+ file = SWFUpload.speed.extendFile(file);
+
+ return this.speedSettings.user_file_queued_handler.call(this, file);
+ }
+ };
+
+ SWFUpload.speed.fileQueueErrorHandler = function (file, errorCode, message) {
+ if (typeof this.speedSettings.user_file_queue_error_handler === "function") {
+ file = SWFUpload.speed.extendFile(file);
+
+ return this.speedSettings.user_file_queue_error_handler.call(this, file, errorCode, message);
+ }
+ };
+
+ SWFUpload.speed.uploadStartHandler = function (file) {
+ if (typeof this.speedSettings.user_upload_start_handler === "function") {
+ file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);
+ return this.speedSettings.user_upload_start_handler.call(this, file);
+ }
+ };
+
+ SWFUpload.speed.uploadErrorHandler = function (file, errorCode, message) {
+ file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);
+ SWFUpload.speed.removeTracking(file, this.fileSpeedStats);
+
+ if (typeof this.speedSettings.user_upload_error_handler === "function") {
+ return this.speedSettings.user_upload_error_handler.call(this, file, errorCode, message);
+ }
+ };
+ SWFUpload.speed.uploadProgressHandler = function (file, bytesComplete, bytesTotal) {
+ this.updateTracking(file, bytesComplete);
+ file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);
+
+ if (typeof this.speedSettings.user_upload_progress_handler === "function") {
+ return this.speedSettings.user_upload_progress_handler.call(this, file, bytesComplete, bytesTotal);
+ }
+ };
+
+ SWFUpload.speed.uploadSuccessHandler = function (file, serverData) {
+ if (typeof this.speedSettings.user_upload_success_handler === "function") {
+ file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);
+ return this.speedSettings.user_upload_success_handler.call(this, file, serverData);
+ }
+ };
+ SWFUpload.speed.uploadCompleteHandler = function (file) {
+ file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);
+ SWFUpload.speed.removeTracking(file, this.fileSpeedStats);
+
+ if (typeof this.speedSettings.user_upload_complete_handler === "function") {
+ return this.speedSettings.user_upload_complete_handler.call(this, file);
+ }
+ };
+
+ // Private: extends the file object with the speed plugin values
+ SWFUpload.speed.extendFile = function (file, trackingList) {
+ var tracking;
+
+ if (trackingList) {
+ tracking = trackingList[file.id];
+ }
+
+ if (tracking) {
+ file.currentSpeed = tracking.currentSpeed;
+ file.averageSpeed = tracking.averageSpeed;
+ file.movingAverageSpeed = tracking.movingAverageSpeed;
+ file.timeRemaining = tracking.timeRemaining;
+ file.timeElapsed = tracking.timeElapsed;
+ file.percentUploaded = tracking.percentUploaded;
+ file.sizeUploaded = tracking.bytesUploaded;
+
+ } else {
+ file.currentSpeed = 0;
+ file.averageSpeed = 0;
+ file.movingAverageSpeed = 0;
+ file.timeRemaining = 0;
+ file.timeElapsed = 0;
+ file.percentUploaded = 0;
+ file.sizeUploaded = 0;
+ }
+
+ return file;
+ };
+
+ // Private: Updates the speed tracking object, or creates it if necessary
+ SWFUpload.prototype.updateTracking = function (file, bytesUploaded) {
+ var tracking = this.fileSpeedStats[file.id];
+ if (!tracking) {
+ this.fileSpeedStats[file.id] = tracking = {};
+ }
+
+ // Sanity check inputs
+ bytesUploaded = bytesUploaded || tracking.bytesUploaded || 0;
+ if (bytesUploaded < 0) {
+ bytesUploaded = 0;
+ }
+ if (bytesUploaded > file.size) {
+ bytesUploaded = file.size;
+ }
+
+ var tickTime = (new Date()).getTime();
+ if (!tracking.startTime) {
+ tracking.startTime = (new Date()).getTime();
+ tracking.lastTime = tracking.startTime;
+ tracking.currentSpeed = 0;
+ tracking.averageSpeed = 0;
+ tracking.movingAverageSpeed = 0;
+ tracking.movingAverageHistory = [];
+ tracking.timeRemaining = 0;
+ tracking.timeElapsed = 0;
+ tracking.percentUploaded = bytesUploaded / file.size;
+ tracking.bytesUploaded = bytesUploaded;
+ } else if (tracking.startTime > tickTime) {
+ this.debug("When backwards in time");
+ } else {
+ // Get time and deltas
+ var now = (new Date()).getTime();
+ var lastTime = tracking.lastTime;
+ var deltaTime = now - lastTime;
+ var deltaBytes = bytesUploaded - tracking.bytesUploaded;
+
+ if (deltaBytes === 0 || deltaTime === 0) {
+ return tracking;
+ }
+
+ // Update tracking object
+ tracking.lastTime = now;
+ tracking.bytesUploaded = bytesUploaded;
+
+ // Calculate speeds
+ tracking.currentSpeed = (deltaBytes * 8 ) / (deltaTime / 1000);
+ tracking.averageSpeed = (tracking.bytesUploaded * 8) / ((now - tracking.startTime) / 1000);
+
+ // Calculate moving average
+ tracking.movingAverageHistory.push(tracking.currentSpeed);
+ if (tracking.movingAverageHistory.length > this.settings.moving_average_history_size) {
+ tracking.movingAverageHistory.shift();
+ }
+
+ tracking.movingAverageSpeed = SWFUpload.speed.calculateMovingAverage(tracking.movingAverageHistory);
+
+ // Update times
+ tracking.timeRemaining = (file.size - tracking.bytesUploaded) * 8 / tracking.movingAverageSpeed;
+ tracking.timeElapsed = (now - tracking.startTime) / 1000;
+
+ // Update percent
+ tracking.percentUploaded = (tracking.bytesUploaded / file.size * 100);
+ }
+
+ return tracking;
+ };
+ SWFUpload.speed.removeTracking = function (file, trackingList) {
+ try {
+ trackingList[file.id] = null;
+ delete trackingList[file.id];
+ } catch (ex) {
+ }
+ };
+
+ SWFUpload.speed.formatUnits = function (baseNumber, unitDivisors, unitLabels, singleFractional) {
+ var i, unit, unitDivisor, unitLabel;
+
+ if (baseNumber === 0) {
+ return "0 " + unitLabels[unitLabels.length - 1];
+ }
+
+ if (singleFractional) {
+ unit = baseNumber;
+ unitLabel = unitLabels.length >= unitDivisors.length ? unitLabels[unitDivisors.length - 1] : "";
+ for (i = 0; i < unitDivisors.length; i++) {
+ if (baseNumber >= unitDivisors[i]) {
+ unit = (baseNumber / unitDivisors[i]).toFixed(2);
+ unitLabel = unitLabels.length >= i ? " " + unitLabels[i] : "";
+ break;
+ }
+ }
+
+ return unit + unitLabel;
+ } else {
+ var formattedStrings = [];
+ var remainder = baseNumber;
+
+ for (i = 0; i < unitDivisors.length; i++) {
+ unitDivisor = unitDivisors[i];
+ unitLabel = unitLabels.length > i ? " " + unitLabels[i] : "";
+
+ unit = remainder / unitDivisor;
+ if (i < unitDivisors.length -1) {
+ unit = Math.floor(unit);
+ } else {
+ unit = unit.toFixed(2);
+ }
+ if (unit > 0) {
+ remainder = remainder % unitDivisor;
+
+ formattedStrings.push(unit + unitLabel);
+ }
+ }
+
+ return formattedStrings.join(" ");
+ }
+ };
+
+ SWFUpload.speed.formatBPS = function (baseNumber) {
+ var bpsUnits = [1073741824, 1048576, 1024, 1], bpsUnitLabels = ["Gbps", "Mbps", "Kbps", "bps"];
+ return SWFUpload.speed.formatUnits(baseNumber, bpsUnits, bpsUnitLabels, true);
+
+ };
+ SWFUpload.speed.formatTime = function (baseNumber) {
+ var timeUnits = [86400, 3600, 60, 1], timeUnitLabels = ["d", "h", "m", "s"];
+ return SWFUpload.speed.formatUnits(baseNumber, timeUnits, timeUnitLabels, false);
+
+ };
+ SWFUpload.speed.formatBytes = function (baseNumber) {
+ var sizeUnits = [1073741824, 1048576, 1024, 1], sizeUnitLabels = ["GB", "MB", "KB", "bytes"];
+ return SWFUpload.speed.formatUnits(baseNumber, sizeUnits, sizeUnitLabels, true);
+
+ };
+ SWFUpload.speed.formatPercent = function (baseNumber) {
+ return baseNumber.toFixed(2) + " %";
+ };
+
+ SWFUpload.speed.calculateMovingAverage = function (history) {
+ var vals = [], size, sum = 0.0, mean = 0.0, varianceTemp = 0.0, variance = 0.0, standardDev = 0.0;
+ var i;
+ var mSum = 0, mCount = 0;
+
+ size = history.length;
+
+ // Check for sufficient data
+ if (size >= 8) {
+ // Clone the array and Calculate sum of the values
+ for (i = 0; i < size; i++) {
+ vals[i] = history[i];
+ sum += vals[i];
+ }
+
+ mean = sum / size;
+
+ // Calculate variance for the set
+ for (i = 0; i < size; i++) {
+ varianceTemp += Math.pow((vals[i] - mean), 2);
+ }
+
+ variance = varianceTemp / size;
+ standardDev = Math.sqrt(variance);
+
+ //Standardize the Data
+ for (i = 0; i < size; i++) {
+ vals[i] = (vals[i] - mean) / standardDev;
+ }
+
+ // Calculate the average excluding outliers
+ var deviationRange = 2.0;
+ for (i = 0; i < size; i++) {
+
+ if (vals[i] <= deviationRange && vals[i] >= -deviationRange) {
+ mCount++;
+ mSum += history[i];
+ }
+ }
+
+ } else {
+ // Calculate the average (not enough data points to remove outliers)
+ mCount = size;
+ for (i = 0; i < size; i++) {
+ mSum += history[i];
+ }
+ }
+
+ return mSum / mCount;
+ };
+
}
\ No newline at end of file
* Copyright (c) 2007 cody lindley
* Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/
-
-var tb_pathToImage = "../wp-includes/js/thickbox/loadingAnimation.gif";
-var tb_closeImage = "../wp-includes/js/thickbox/tb-close.png";
+
+if ( typeof tb_pathToImage != 'string' ) {
+ var tb_pathToImage = "../wp-includes/js/thickbox/loadingAnimation.gif";
+}
+if ( typeof tb_closeImage != 'string' ) {
+ var tb_closeImage = "../wp-includes/js/thickbox/tb-close.png";
+}
/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
//on page load call tb_init
-jQuery(document).ready(function(){
+jQuery(document).ready(function(){
tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
imgLoader = new Image();// preload image
imgLoader.src = tb_pathToImage;
jQuery("#TB_overlay").click(tb_remove);
}
}
-
+
if(tb_detectMacXFF()){
jQuery("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
}else{
jQuery("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
}
-
+
if(caption===null){caption="";}
jQuery("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
jQuery('#TB_load').show();//show loader
-
+
var baseURL;
if(url.indexOf("?")!==-1){ //ff there is a query string involved
baseURL = url.substr(0, url.indexOf("?"));
- }else{
+ }else{
baseURL = url;
}
-
+
var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
var urlType = baseURL.toLowerCase().match(urlString);
if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images
-
+
TB_PrevCaption = "";
TB_PrevURL = "";
TB_PrevHTML = "";
TB_TempArray = jQuery("a[rel="+imageGroup+"]").get();
for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) {
var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
- if (!(TB_TempArray[TB_Counter].href == url)) {
+ if (!(TB_TempArray[TB_Counter].href == url)) {
if (TB_FoundURL) {
TB_NextCaption = TB_TempArray[TB_Counter].title;
TB_NextURL = TB_TempArray[TB_Counter].href;
- TB_NextHTML = "<span id='TB_next'> <a href='#'>Next ></a></span>";
+ TB_NextHTML = "<span id='TB_next'> <a href='#'>"+thickboxL10n.next+"</a></span>";
} else {
TB_PrevCaption = TB_TempArray[TB_Counter].title;
TB_PrevURL = TB_TempArray[TB_Counter].href;
- TB_PrevHTML = "<span id='TB_prev'> <a href='#'>< Prev</a></span>";
+ TB_PrevHTML = "<span id='TB_prev'> <a href='#'>"+thickboxL10n.prev+"</a></span>";
}
} else {
TB_FoundURL = true;
- TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length);
+ TB_imageCount = thickboxL10n.image + ' ' + (TB_Counter + 1) + ' ' + thickboxL10n.of + ' ' + (TB_TempArray.length);
}
}
}
imgPreloader = new Image();
- imgPreloader.onload = function(){
+ imgPreloader.onload = function(){
imgPreloader.onload = null;
-
+
// Resizing large images - orginal by Christian Montoya edited by me.
var pagesize = tb_getPageSize();
var x = pagesize[0] - 150;
var imageWidth = imgPreloader.width;
var imageHeight = imgPreloader.height;
if (imageWidth > x) {
- imageHeight = imageHeight * (x / imageWidth);
- imageWidth = x;
- if (imageHeight > y) {
- imageWidth = imageWidth * (y / imageHeight);
- imageHeight = y;
+ imageHeight = imageHeight * (x / imageWidth);
+ imageWidth = x;
+ if (imageHeight > y) {
+ imageWidth = imageWidth * (y / imageHeight);
+ imageHeight = y;
}
- } else if (imageHeight > y) {
- imageWidth = imageWidth * (y / imageHeight);
- imageHeight = y;
- if (imageWidth > x) {
- imageHeight = imageHeight * (x / imageWidth);
+ } else if (imageHeight > y) {
+ imageWidth = imageWidth * (y / imageHeight);
+ imageHeight = y;
+ if (imageWidth > x) {
+ imageHeight = imageHeight * (x / imageWidth);
imageWidth = x;
}
}
// End Resizing
-
+
TB_WIDTH = imageWidth + 30;
TB_HEIGHT = imageHeight + 60;
- jQuery("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'><img src='" + tb_closeImage + "' /></a></div>");
-
+ jQuery("#TB_window").append("<a href='' id='TB_ImageOff' title='"+thickboxL10n.close+"'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='"+thickboxL10n.close+"'><img src='" + tb_closeImage + "' /></a></div>");
+
jQuery("#TB_closeWindowButton").click(tb_remove);
-
+
if (!(TB_PrevHTML === "")) {
function goPrev(){
if(jQuery(document).unbind("click",goPrev)){jQuery(document).unbind("click",goPrev);}
jQuery("#TB_window").remove();
jQuery("body").append("<div id='TB_window'></div>");
tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
- return false;
+ return false;
}
jQuery("#TB_prev").click(goPrev);
}
-
- if (!(TB_NextHTML === "")) {
+
+ if (!(TB_NextHTML === "")) {
function goNext(){
jQuery("#TB_window").remove();
jQuery("body").append("<div id='TB_window'></div>");
- tb_show(TB_NextCaption, TB_NextURL, imageGroup);
- return false;
+ tb_show(TB_NextCaption, TB_NextURL, imageGroup);
+ return false;
}
jQuery("#TB_next").click(goNext);
-
+
}
- document.onkeydown = function(e){
+ document.onkeydown = function(e){
if (e == null) { // ie
keycode = event.keyCode;
} else { // mozilla
document.onkeydown = "";
goPrev();
}
- }
+ }
};
-
+
tb_position();
jQuery("#TB_load").remove();
jQuery("#TB_ImageOff").click(tb_remove);
jQuery("#TB_window").css({display:"block"}); //for safari using css instead of show
};
-
+
imgPreloader.src = url;
}else{//code to show html
-
+
var queryString = url.replace(/^[^\?]+\??/,'');
var params = tb_parseQuery( queryString );
TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
ajaxContentW = TB_WIDTH - 30;
ajaxContentH = TB_HEIGHT - 45;
-
- if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window
+
+ if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window
urlNoQuery = url.split('TB_');
jQuery("#TB_iframeContent").remove();
if(params['modal'] != "true"){//iframe no modal
- jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'><img src='" + tb_closeImage + "' /></a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' > </iframe>");
+ jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='"+thickboxL10n.close+"'><img src='" + tb_closeImage + "' /></a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' > </iframe>");
}else{//iframe modal
jQuery("#TB_overlay").unbind();
jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'> </iframe>");
jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'><img src='" + tb_closeImage + "' /></a></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
}else{//ajax modal
jQuery("#TB_overlay").unbind();
- jQuery("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");
+ jQuery("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");
}
}else{//this means the window is already up, we are just loading new content via ajax
jQuery("#TB_ajaxContent")[0].style.width = ajaxContentW +"px";
jQuery("#TB_ajaxWindowTitle").html(caption);
}
}
-
+
jQuery("#TB_closeWindowButton").click(tb_remove);
-
- if(url.indexOf('TB_inline') != -1){
+
+ if(url.indexOf('TB_inline') != -1){
jQuery("#TB_ajaxContent").append(jQuery('#' + params['inlineId']).children());
jQuery("#TB_window").unload(function () {
jQuery('#' + params['inlineId']).append( jQuery("#TB_ajaxContent").children() ); // move elements back when you're finished
});
tb_position();
jQuery("#TB_load").remove();
- jQuery("#TB_window").css({display:"block"});
+ jQuery("#TB_window").css({display:"block"});
}else if(url.indexOf('TB_iframe') != -1){
tb_position();
if($.browser.safari){//safari needs help because it will not fire iframe onload
jQuery("#TB_window").css({display:"block"});
});
}
-
+
}
if(!params['modal']){
- document.onkeyup = function(e){
+ document.onkeyup = function(e){
if (e == null) { // ie
keycode = event.keyCode;
} else { // mozilla
}
if(keycode == 27){ // close
tb_remove();
- }
+ }
};
}
-
+
} catch(e) {
//nothing here
}
return true;
}
}
-
-
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <script type="text/javascript" src="../../tiny_mce.js?ver=3241-1141"></script>
+ <script type="text/javascript" src="../../tiny_mce.js?ver=327-1235"></script>
<script type="text/javascript">
function patchCallback(settings, key) {
if (settings[key])
-(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(r,j){var y=this,i,k="",q=y.editor,g=0,s=0,h,m,n,o,l,v,x;r=r||{};j=j||{};if(!r.inline){return y.parent(r,j)}if(!r.type){y.bookmark=q.selection.getBookmark("simple")}i=d.uniqueId();h=d.getViewPort();r.width=parseInt(r.width||320);r.height=parseInt(r.height||240)+(tinymce.isIE?8:0);r.min_width=parseInt(r.min_width||150);r.min_height=parseInt(r.min_height||100);r.max_width=parseInt(r.max_width||2000);r.max_height=parseInt(r.max_height||2000);r.left=r.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(r.width/2)));r.top=r.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(r.height/2)));r.movable=r.resizable=true;j.mce_width=r.width;j.mce_height=r.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=r.auto_focus;y.features=r;y.params=j;y.onOpen.dispatch(y,r,j);if(r.type){k+=" mceModal";if(r.type){k+=" mce"+r.type.substring(0,1).toUpperCase()+r.type.substring(1)}r.resizable=false}if(r.statusbar){k+=" mceStatusbar"}if(r.resizable){k+=" mceResizable"}if(r.minimizable){k+=" mceMinimizable"}if(r.maximizable){k+=" mceMaximizable"}if(r.movable){k+=" mceMovable"}y._addAll(d.doc.body,["div",{id:i,"class":q.settings.inlinepopups_skin||"clearlooks2",style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},r.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!r.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;s+=d.get(i+"_top").clientHeight;s+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:r.top,left:r.left,width:r.width+g,height:r.height+s});x=r.url||r.file;if(x){if(tinymce.relaxedDomain){x+=(x.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}x=tinymce._addVer(x)}if(!r.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:r.width,height:r.height});d.setAttrib(i+"_ifr","src",x)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(r.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",r.content.replace("\n","<br />"))}n=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=y.windows[i];y.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return y._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return y._startDrag(i,t,u.className.substring(13))}}}}}});o=a.add(i,"click",function(f){var p=f.target;y.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":y.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":r.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});v=y.windows[i]={id:i,mousedown_func:n,click_func:o,element:new b(i,{blocker:1,container:q.getContainer()}),iframeElement:new b(i+"_ifr"),features:r,deltaWidth:g,deltaHeight:s};v.iframeElement.on("focus",function(){y.focus(i)});if(y.count==0&&y.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(y.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:y.zIndex-1}});d.show("mceModalBlocker")}else{d.setStyle("mceModalBlocker","z-index",y.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}y.focus(i);y._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}y.count++;return v},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;g<h.length;g++){f._addAll(k,h[g])}}}},_startDrag:function(v,G,E){var o=this,u,z,C=d.doc,f,l=o.windows[v],h=l.element,y=h.getXY(),x,q,F,g,A,s,r,j,i,m,k,n,B;g={x:0,y:0};A=d.getViewPort();A.w-=2;A.h-=2;j=G.screenX;i=G.screenY;m=k=n=B=0;u=a.add(C,"mouseup",function(p){a.remove(C,"mouseup",u);a.remove(C,"mousemove",z);if(f){f.remove()}h.moveBy(m,k);h.resizeBy(n,B);q=h.getSize();d.setStyles(v+"_ifr",{width:q.w-l.deltaWidth,height:q.h-l.deltaHeight});o._fixIELayout(v,1);return a.cancel(p)});if(E!="Move"){D()}function D(){if(f){return}o._fixIELayout(v,0);d.add(C.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(o.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:o.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceEventBlocker",{position:"absolute",left:A.x,top:A.y,width:A.w-2,height:A.h-2})}f=new b("mceEventBlocker");f.update();x=h.getXY();q=h.getSize();s=g.x+x.x-A.x;r=g.y+x.y-A.y;d.add(f.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:s,top:r,width:q.w,height:q.h}});F=new b("mcePlaceHolder")}z=a.add(C,"mousemove",function(w){var p,H,t;D();p=w.screenX-j;H=w.screenY-i;switch(E){case"ResizeW":m=p;n=0-p;break;case"ResizeE":n=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(E=="ResizeNW"){m=p;n=0-p}else{if(E=="ResizeNE"){n=p}}k=H;B=0-H;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(E=="ResizeSW"){m=p;n=0-p}else{if(E=="ResizeSE"){n=p}}B=H;break;case"mceMove":m=p;k=H;break}if(n<(t=l.features.min_width-q.w)){if(m!==0){m+=n-t}n=t}if(B<(t=l.features.min_height-q.h)){if(k!==0){k+=B-t}B=t}n=Math.min(n,l.features.max_width-q.w);B=Math.min(B,l.features.max_height-q.h);m=Math.max(m,A.x-(s+A.x));k=Math.max(k,A.y-(r+A.y));m=Math.min(m,(A.w+A.x)-(s+q.w+A.x));k=Math.min(k,(A.h+A.y)-(r+q.h+A.y));if(m+k!==0){if(s+m<0){m=0}if(r+k<0){k=0}F.moveTo(s+m,r+k)}if(n+B!==0){F.resizeTo(q.w+n,q.h+B)}return a.cancel(w)});return a.cancel(G)},resizeBy:function(g,h,i){var f=this.windows[i];if(f){f.element.resizeBy(g,h);f.iframeElement.resizeBy(g,h)}},close:function(j,l){var h=this,g,k=d.doc,f=0,i,l;l=h._findId(l||j);if(!h.windows[l]){h.parent(j);return}h.count--;if(h.count==0){d.remove("mceModalBlocker")}if(g=h.windows[l]){h.onClose.dispatch(h);a.remove(k,"mousedown",g.mousedownFunc);a.remove(k,"click",g.clickFunc);a.clear(l);a.clear(l+"_ifr");d.setAttrib(l+"_ifr","src",'javascript:""');g.element.remove();delete h.windows[l];e(h.windows,function(m){if(m.zIndex>f){i=m;f=m.zIndex}});if(i){h.focus(i.id)}}},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();
\ No newline at end of file
+(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(r,j){var y=this,i,k="",q=y.editor,g=0,s=0,h,m,n,o,l,v,x;r=r||{};j=j||{};if(!r.inline){return y.parent(r,j)}if(!r.type){y.bookmark=q.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();r.width=parseInt(r.width||320);r.height=parseInt(r.height||240)+(tinymce.isIE?8:0);r.min_width=parseInt(r.min_width||150);r.min_height=parseInt(r.min_height||100);r.max_width=parseInt(r.max_width||2000);r.max_height=parseInt(r.max_height||2000);r.left=r.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(r.width/2)));r.top=r.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(r.height/2)));r.movable=r.resizable=true;j.mce_width=r.width;j.mce_height=r.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=r.auto_focus;y.features=r;y.params=j;y.onOpen.dispatch(y,r,j);if(r.type){k+=" mceModal";if(r.type){k+=" mce"+r.type.substring(0,1).toUpperCase()+r.type.substring(1)}r.resizable=false}if(r.statusbar){k+=" mceStatusbar"}if(r.resizable){k+=" mceResizable"}if(r.minimizable){k+=" mceMinimizable"}if(r.maximizable){k+=" mceMaximizable"}if(r.movable){k+=" mceMovable"}y._addAll(d.doc.body,["div",{id:i,"class":q.settings.inlinepopups_skin||"clearlooks2",style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},r.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!r.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;s+=d.get(i+"_top").clientHeight;s+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:r.top,left:r.left,width:r.width+g,height:r.height+s});x=r.url||r.file;if(x){if(tinymce.relaxedDomain){x+=(x.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}x=tinymce._addVer(x)}if(!r.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:r.width,height:r.height});d.setAttrib(i+"_ifr","src",x)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(r.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",r.content.replace("\n","<br />"))}n=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=y.windows[i];y.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return y._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return y._startDrag(i,t,u.className.substring(13))}}}}}});o=a.add(i,"click",function(f){var p=f.target;y.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":y.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":r.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});v=y.windows[i]={id:i,mousedown_func:n,click_func:o,element:new b(i,{blocker:1,container:q.getContainer()}),iframeElement:new b(i+"_ifr"),features:r,deltaWidth:g,deltaHeight:s};v.iframeElement.on("focus",function(){y.focus(i)});if(y.count==0&&y.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(y.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:y.zIndex-1}});d.show("mceModalBlocker")}else{d.setStyle("mceModalBlocker","z-index",y.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}y.focus(i);y._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}y.count++;return v},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;g<h.length;g++){f._addAll(k,h[g])}}}},_startDrag:function(v,G,E){var o=this,u,z,C=d.doc,f,l=o.windows[v],h=l.element,y=h.getXY(),x,q,F,g,A,s,r,j,i,m,k,n,B;g={x:0,y:0};A=d.getViewPort();A.w-=2;A.h-=2;j=G.screenX;i=G.screenY;m=k=n=B=0;u=a.add(C,"mouseup",function(p){a.remove(C,"mouseup",u);a.remove(C,"mousemove",z);if(f){f.remove()}h.moveBy(m,k);h.resizeBy(n,B);q=h.getSize();d.setStyles(v+"_ifr",{width:q.w-l.deltaWidth,height:q.h-l.deltaHeight});o._fixIELayout(v,1);return a.cancel(p)});if(E!="Move"){D()}function D(){if(f){return}o._fixIELayout(v,0);d.add(C.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(o.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:o.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceEventBlocker",{position:"absolute",left:A.x,top:A.y,width:A.w-2,height:A.h-2})}f=new b("mceEventBlocker");f.update();x=h.getXY();q=h.getSize();s=g.x+x.x-A.x;r=g.y+x.y-A.y;d.add(f.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:s,top:r,width:q.w,height:q.h}});F=new b("mcePlaceHolder")}z=a.add(C,"mousemove",function(w){var p,H,t;D();p=w.screenX-j;H=w.screenY-i;switch(E){case"ResizeW":m=p;n=0-p;break;case"ResizeE":n=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(E=="ResizeNW"){m=p;n=0-p}else{if(E=="ResizeNE"){n=p}}k=H;B=0-H;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(E=="ResizeSW"){m=p;n=0-p}else{if(E=="ResizeSE"){n=p}}B=H;break;case"mceMove":m=p;k=H;break}if(n<(t=l.features.min_width-q.w)){if(m!==0){m+=n-t}n=t}if(B<(t=l.features.min_height-q.h)){if(k!==0){k+=B-t}B=t}n=Math.min(n,l.features.max_width-q.w);B=Math.min(B,l.features.max_height-q.h);m=Math.max(m,A.x-(s+A.x));k=Math.max(k,A.y-(r+A.y));m=Math.min(m,(A.w+A.x)-(s+q.w+A.x));k=Math.min(k,(A.h+A.y)-(r+q.h+A.y));if(m+k!==0){if(s+m<0){m=0}if(r+k<0){k=0}F.moveTo(s+m,r+k)}if(n+B!==0){F.resizeTo(q.w+n,q.h+B)}return a.cancel(w)});return a.cancel(G)},resizeBy:function(g,h,i){var f=this.windows[i];if(f){f.element.resizeBy(g,h);f.iframeElement.resizeBy(g,h)}},close:function(j,l){var h=this,g,k=d.doc,f=0,i,l;l=h._findId(l||j);if(!h.windows[l]){h.parent(j);return}h.count--;if(h.count==0){d.remove("mceModalBlocker")}if(g=h.windows[l]){h.onClose.dispatch(h);a.remove(k,"mousedown",g.mousedownFunc);a.remove(k,"click",g.clickFunc);a.clear(l);a.clear(l+"_ifr");d.setAttrib(l+"_ifr","src",'javascript:""');g.element.remove();delete h.windows[l];e(h.windows,function(m){if(m.zIndex>f){i=m;f=m.zIndex}});if(i){h.focus(i.id)}}},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();
\ No newline at end of file
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Template for dialogs</title>
-<link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css?ver=3241-1141" />
+<link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css?ver=327-1235" />
</head>
<body>
-(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.MediaPlugin",{init:function(b,c){var e=this;e.editor=b;e.url=c;function f(g){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(g.className)}b.onPreInit.add(function(){b.serializer.addRules("param[name|value|_mce_value]")});b.addCommand("mceMedia",function(){b.windowManager.open({file:c+"/media.htm",width:430+parseInt(b.getLang("media.delta_width",0)),height:470+parseInt(b.getLang("media.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("media",{title:"media.desc",cmd:"mceMedia"});b.onNodeChange.add(function(h,g,i){g.setActive("media",i.nodeName=="IMG"&&f(i))});b.onInit.add(function(){var g={mceItemFlash:"flash",mceItemShockWave:"shockwave",mceItemWindowsMedia:"windowsmedia",mceItemQuickTime:"quicktime",mceItemRealMedia:"realmedia"};b.selection.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.selection.onBeforeSetContent.add(e._objectsToSpans,e);if(b.settings.content_css!==false){b.dom.loadCSS(c+"/css/content.css")}if(b.theme.onResolveName){b.theme.onResolveName.add(function(h,i){if(i.name=="img"){a(g,function(l,j){if(b.dom.hasClass(i.node,j)){i.name=l;i.title=b.dom.getAttrib(i.node,"title");return false}})}})}if(b&&b.plugins.contextmenu){b.plugins.contextmenu.onContextMenu.add(function(i,h,j){if(j.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(j.className)){h.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});b.onBeforeSetContent.add(e._objectsToSpans,e);b.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.onPreProcess.add(function(g,i){var h=g.dom;if(i.set){e._spansToImgs(i.node);a(h.select("IMG",i.node),function(k){var j;if(f(k)){j=e._parse(k.title);h.setAttrib(k,"width",h.getAttrib(k,"width",j.width||100));h.setAttrib(k,"height",h.getAttrib(k,"height",j.height||100))}})}if(i.get){a(h.select("IMG",i.node),function(m){var l,j,k;if(g.getParam("media_use_script")){if(f(m)){m.className=m.className.replace(/mceItem/g,"mceTemp")}return}switch(m.className){case"mceItemFlash":l="d27cdb6e-ae6d-11cf-96b8-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="application/x-shockwave-flash";break;case"mceItemShockWave":l="166b1bca-3f9c-11cf-8075-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0";k="application/x-director";break;case"mceItemWindowsMedia":l=g.getParam("media_wmp6_compatible")?"05589fa1-c356-11ce-bf01-00aa0055595a":"6bf52a52-394a-11d3-b153-00c04f79faa6";j="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";k="application/x-mplayer2";break;case"mceItemQuickTime":l="02bf25d5-8c17-4b23-bc80-d3488abddc6b";j="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0";k="video/quicktime";break;case"mceItemRealMedia":l="cfcdaa03-8be4-11cf-b84b-0020afbbccfa";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="audio/x-pn-realaudio-plugin";break}if(l){h.replace(e._buildObj({classid:l,codebase:j,type:k},m),m)}})}});b.onPostProcess.add(function(g,h){h.content=h.content.replace(/_mce_value=/g,"value=")});function d(g,h){h=new RegExp(h+'="([^"]+)"',"g").exec(g);return h?b.dom.decode(h[1]):""}b.onPostProcess.add(function(g,h){if(g.getParam("media_use_script")){h.content=h.content.replace(/<img[^>]+>/g,function(j){var i=d(j,"class");if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(i)){at=e._parse(d(j,"title"));at.width=d(j,"width");at.height=d(j,"height");j='<script type="text/javascript">write'+i.substring(7)+"({"+e._serialize(at)+"});<\/script>"}return j})}})},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}},_objectsToSpans:function(b,e){var c=this,d=e.content;d=d.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(g,f,i){var h=c._parse(i);return'<img class="mceItem'+f+'" title="'+b.dom.encode(i)+'" src="'+c.url+'/img/trans.gif" width="'+h.width+'" height="'+h.height+'" />'});d=d.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');d=d.replace(/<embed([^>]*)\/?>/gi,'<span class="mceItemEmbed" $1></span>');d=d.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');d=d.replace(/<\/(object)([^>]*)>/gi,"</span>");d=d.replace(/<\/embed>/gi,"");d=d.replace(/<param([^>]*)>/gi,function(g,f){return"<span "+f.replace(/value=/gi,"_mce_value=")+' class="mceItemParam"></span>'});d=d.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');e.content=d},_buildObj:function(g,h){var d,c=this.editor,f=c.dom,e=this._parse(h.title),b;b=c.getParam("media_strict",true)&&g.type=="application/x-shockwave-flash";e.width=g.width=f.getAttrib(h,"width")||100;e.height=g.height=f.getAttrib(h,"height")||100;if(e.src){e.src=c.convertURL(e.src,"src",h)}if(b){d=f.create("span",{id:e.id,mce_name:"object",type:"application/x-shockwave-flash",data:e.src,style:f.getAttrib(h,"style"),width:g.width,height:g.height})}else{d=f.create("span",{id:e.id,mce_name:"object",classid:"clsid:"+g.classid,style:f.getAttrib(h,"style"),codebase:g.codebase,width:g.width,height:g.height})}a(e,function(j,i){if(!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(i)){if(g.type=="application/x-mplayer2"&&i=="src"&&!e.url){i="url"}if(j){f.add(d,"span",{mce_name:"param",name:i,_mce_value:j})}}});if(!b){f.add(d,"span",tinymce.extend({mce_name:"embed",type:g.type,style:f.getAttrib(h,"style")},e))}return d},_spansToImgs:function(e){var d=this,f=d.editor.dom,b,c;a(f.select("span",e),function(g){if(f.getAttrib(g,"class")=="mceItemObject"){c=f.getAttrib(g,"classid").toLowerCase().replace(/\s+/g,"");switch(c){case"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000":f.replace(d._createImg("mceItemFlash",g),g);break;case"clsid:166b1bca-3f9c-11cf-8075-444553540000":f.replace(d._createImg("mceItemShockWave",g),g);break;case"clsid:6bf52a52-394a-11d3-b153-00c04f79faa6":case"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95":case"clsid:05589fa1-c356-11ce-bf01-00aa0055595a":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}return}if(f.getAttrib(g,"class")=="mceItemEmbed"){switch(f.getAttrib(g,"type")){case"application/x-shockwave-flash":f.replace(d._createImg("mceItemFlash",g),g);break;case"application/x-director":f.replace(d._createImg("mceItemShockWave",g),g);break;case"application/x-mplayer2":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"video/quicktime":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"audio/x-pn-realaudio-plugin":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}}})},_createImg:function(c,h){var b,g=this.editor.dom,f={},e="",d;d=["id","name","width","height","bgcolor","align","flashvars","src","wmode","allowfullscreen","quality"];b=g.create("img",{src:this.url+"/img/trans.gif",width:g.getAttrib(h,"width")||100,height:g.getAttrib(h,"height")||100,style:g.getAttrib(h,"style"),"class":c});a(d,function(i){var j=g.getAttrib(h,i);if(j){f[i]=j}});a(g.select("span",h),function(i){if(g.hasClass(i,"mceItemParam")){f[g.getAttrib(i,"name")]=g.getAttrib(i,"_mce_value")}});if(f.movie){f.src=f.movie;delete f.movie}h=g.select(".mceItemEmbed",h)[0];if(h){a(d,function(i){var j=g.getAttrib(h,i);if(j&&!f[i]){f[i]=j}})}delete f.width;delete f.height;b.title=this._serialize(f);return b},_parse:function(b){return tinymce.util.JSON.parse("{"+b+"}")},_serialize:function(b){return tinymce.util.JSON.serialize(b).replace(/[{}]/g,"")}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();
\ No newline at end of file
+(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.MediaPlugin",{init:function(b,c){var e=this;e.editor=b;e.url=c;function f(g){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(g.className)}b.onPreInit.add(function(){b.serializer.addRules("param[name|value|_mce_value]")});b.addCommand("mceMedia",function(){b.windowManager.open({file:c+"/media.htm",width:430+parseInt(b.getLang("media.delta_width",0)),height:470+parseInt(b.getLang("media.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("media",{title:"media.desc",cmd:"mceMedia"});b.onNodeChange.add(function(h,g,i){g.setActive("media",i.nodeName=="IMG"&&f(i))});b.onInit.add(function(){var g={mceItemFlash:"flash",mceItemShockWave:"shockwave",mceItemWindowsMedia:"windowsmedia",mceItemQuickTime:"quicktime",mceItemRealMedia:"realmedia"};b.selection.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.selection.onBeforeSetContent.add(e._objectsToSpans,e);if(b.settings.content_css!==false){b.dom.loadCSS(c+"/css/content.css")}if(b.theme&&b.theme.onResolveName){b.theme.onResolveName.add(function(h,i){if(i.name=="img"){a(g,function(l,j){if(b.dom.hasClass(i.node,j)){i.name=l;i.title=b.dom.getAttrib(i.node,"title");return false}})}})}if(b&&b.plugins.contextmenu){b.plugins.contextmenu.onContextMenu.add(function(i,h,j){if(j.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(j.className)){h.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});b.onBeforeSetContent.add(e._objectsToSpans,e);b.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.onPreProcess.add(function(g,i){var h=g.dom;if(i.set){e._spansToImgs(i.node);a(h.select("IMG",i.node),function(k){var j;if(f(k)){j=e._parse(k.title);h.setAttrib(k,"width",h.getAttrib(k,"width",j.width||100));h.setAttrib(k,"height",h.getAttrib(k,"height",j.height||100))}})}if(i.get){a(h.select("IMG",i.node),function(m){var l,j,k;if(g.getParam("media_use_script")){if(f(m)){m.className=m.className.replace(/mceItem/g,"mceTemp")}return}switch(m.className){case"mceItemFlash":l="d27cdb6e-ae6d-11cf-96b8-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="application/x-shockwave-flash";break;case"mceItemShockWave":l="166b1bca-3f9c-11cf-8075-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0";k="application/x-director";break;case"mceItemWindowsMedia":l=g.getParam("media_wmp6_compatible")?"05589fa1-c356-11ce-bf01-00aa0055595a":"6bf52a52-394a-11d3-b153-00c04f79faa6";j="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";k="application/x-mplayer2";break;case"mceItemQuickTime":l="02bf25d5-8c17-4b23-bc80-d3488abddc6b";j="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0";k="video/quicktime";break;case"mceItemRealMedia":l="cfcdaa03-8be4-11cf-b84b-0020afbbccfa";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="audio/x-pn-realaudio-plugin";break}if(l){h.replace(e._buildObj({classid:l,codebase:j,type:k},m),m)}})}});b.onPostProcess.add(function(g,h){h.content=h.content.replace(/_mce_value=/g,"value=")});function d(g,h){h=new RegExp(h+'="([^"]+)"',"g").exec(g);return h?b.dom.decode(h[1]):""}b.onPostProcess.add(function(g,h){if(g.getParam("media_use_script")){h.content=h.content.replace(/<img[^>]+>/g,function(j){var i=d(j,"class");if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(i)){at=e._parse(d(j,"title"));at.width=d(j,"width");at.height=d(j,"height");j='<script type="text/javascript">write'+i.substring(7)+"({"+e._serialize(at)+"});<\/script>"}return j})}})},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}},_objectsToSpans:function(b,e){var c=this,d=e.content;d=d.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(g,f,i){var h=c._parse(i);return'<img class="mceItem'+f+'" title="'+b.dom.encode(i)+'" src="'+c.url+'/img/trans.gif" width="'+h.width+'" height="'+h.height+'" />'});d=d.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');d=d.replace(/<embed([^>]*)\/?>/gi,'<span class="mceItemEmbed" $1></span>');d=d.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');d=d.replace(/<\/(object)([^>]*)>/gi,"</span>");d=d.replace(/<\/embed>/gi,"");d=d.replace(/<param([^>]*)>/gi,function(g,f){return"<span "+f.replace(/value=/gi,"_mce_value=")+' class="mceItemParam"></span>'});d=d.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');e.content=d},_buildObj:function(g,h){var d,c=this.editor,f=c.dom,e=this._parse(h.title),b;b=c.getParam("media_strict",true)&&g.type=="application/x-shockwave-flash";e.width=g.width=f.getAttrib(h,"width")||100;e.height=g.height=f.getAttrib(h,"height")||100;if(e.src){e.src=c.convertURL(e.src,"src",h)}if(b){d=f.create("span",{id:e.id,mce_name:"object",type:"application/x-shockwave-flash",data:e.src,style:f.getAttrib(h,"style"),width:g.width,height:g.height})}else{d=f.create("span",{id:e.id,mce_name:"object",classid:"clsid:"+g.classid,style:f.getAttrib(h,"style"),codebase:g.codebase,width:g.width,height:g.height})}a(e,function(j,i){if(!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(i)){if(g.type=="application/x-mplayer2"&&i=="src"&&!e.url){i="url"}if(j){f.add(d,"span",{mce_name:"param",name:i,_mce_value:j})}}});if(!b){f.add(d,"span",tinymce.extend({mce_name:"embed",type:g.type,style:f.getAttrib(h,"style")},e))}return d},_spansToImgs:function(e){var d=this,f=d.editor.dom,b,c;a(f.select("span",e),function(g){if(f.getAttrib(g,"class")=="mceItemObject"){c=f.getAttrib(g,"classid").toLowerCase().replace(/\s+/g,"");switch(c){case"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000":f.replace(d._createImg("mceItemFlash",g),g);break;case"clsid:166b1bca-3f9c-11cf-8075-444553540000":f.replace(d._createImg("mceItemShockWave",g),g);break;case"clsid:6bf52a52-394a-11d3-b153-00c04f79faa6":case"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95":case"clsid:05589fa1-c356-11ce-bf01-00aa0055595a":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}return}if(f.getAttrib(g,"class")=="mceItemEmbed"){switch(f.getAttrib(g,"type")){case"application/x-shockwave-flash":f.replace(d._createImg("mceItemFlash",g),g);break;case"application/x-director":f.replace(d._createImg("mceItemShockWave",g),g);break;case"application/x-mplayer2":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"video/quicktime":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"audio/x-pn-realaudio-plugin":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}}})},_createImg:function(c,h){var b,g=this.editor.dom,f={},e="",d;d=["id","name","width","height","bgcolor","align","flashvars","src","wmode","allowfullscreen","quality","data"];b=g.create("img",{src:this.url+"/img/trans.gif",width:g.getAttrib(h,"width")||100,height:g.getAttrib(h,"height")||100,style:g.getAttrib(h,"style"),"class":c});a(d,function(i){var j=g.getAttrib(h,i);if(j){f[i]=j}});a(g.select("span",h),function(i){if(g.hasClass(i,"mceItemParam")){f[g.getAttrib(i,"name")]=g.getAttrib(i,"_mce_value")}});if(f.movie){f.src=f.movie;delete f.movie}if(!f.src){f.src=f.data;delete f.data}h=g.select(".mceItemEmbed",h)[0];if(h){a(d,function(i){var j=g.getAttrib(h,i);if(j&&!f[i]){f[i]=j}})}delete f.width;delete f.height;b.title=this._serialize(f);return b},_parse:function(b){return tinymce.util.JSON.parse("{"+b+"}")},_serialize:function(b){return tinymce.util.JSON.serialize(b).replace(/[{}]/g,"")}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();
\ No newline at end of file
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#media_dlg.title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3241-1141"></script>
- <script type="text/javascript" src="js/media.js?ver=3241-1141"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
- <script type="text/javascript" src="../../utils/validate.js?ver=3241-1141"></script>
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
- <script type="text/javascript" src="../../utils/editable_selects.js?ver=3241-1141"></script>
- <link href="css/media.css?ver=3241-1141" rel="stylesheet" type="text/css" />
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
+ <script type="text/javascript" src="js/media.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../utils/validate.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../utils/editable_selects.js?ver=327-1235"></script>
+ <link href="css/media.css?ver=327-1235" rel="stylesheet" type="text/css" />
</head>
<body style="display: none">
<form onsubmit="insertMedia();return false;" action="#">
-(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.PastePlugin",{init:function(c,d){var e=this,b;e.editor=c;e.url=d;e.onPreProcess=new tinymce.util.Dispatcher(e);e.onPostProcess=new tinymce.util.Dispatcher(e);e.onPreProcess.add(e._preProcess);e.onPostProcess.add(e._postProcess);e.onPreProcess.add(function(h,i){c.execCallback("paste_preprocess",h,i)});e.onPostProcess.add(function(h,i){c.execCallback("paste_postprocess",h,i)});function g(i){var k=c.dom,j={content:i};e.onPreProcess.dispatch(e,j);j.node=k.create("div",0,j.content);e.onPostProcess.dispatch(e,j);j.content=c.serializer.serialize(j.node,{getInner:1});if(/<(p|h[1-6]|ul|ol)/.test(j.content)){e._insertBlockContent(c,k,j.content)}else{e._insert(j.content)}}c.addCommand("mceInsertClipboardContent",function(i,h){g(h)});function f(l){var p,k,i,j=c.selection,o=c.dom,h=c.getBody(),m;if(o.get("_mcePaste")){return}p=o.add(h,"div",{id:"_mcePaste"}," ");if(h!=c.getDoc().body){m=o.getPos(c.selection.getStart(),h).y}else{m=h.scrollTop}o.setStyles(p,{position:"absolute",left:-10000,top:m,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){i=o.doc.body.createTextRange();i.moveToElementText(p);i.execCommand("Paste");o.remove(p);g(p.innerHTML);return tinymce.dom.Event.cancel(l)}else{k=c.selection.getRng();p=p.firstChild;i=c.getDoc().createRange();i.setStart(p,0);i.setEnd(p,1);j.setRng(i);window.setTimeout(function(){var r=o.get("_mcePaste"),q;r.id="_mceRemoved";o.remove(r);r=o.get("_mcePaste")||r;q=(o.select("> span.Apple-style-span div",r)[0]||o.select("> span.Apple-style-span",r)[0]||r).innerHTML;o.remove(r);if(k){j.setRng(k)}g(q)},0)}}if(c.getParam("paste_auto_cleanup_on_paste",true)){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){c.onKeyDown.add(function(h,i){if(((tinymce.isMac?i.metaKey:i.ctrlKey)&&i.keyCode==86)||(i.shiftKey&&i.keyCode==45)){f(i)}})}else{c.onPaste.addToTop(function(h,i){return f(i)})}}if(c.getParam("paste_block_drop")){c.onInit.add(function(){c.dom.bind(c.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(h){h.preventDefault();h.stopPropagation();return false})})}e._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(d,g){var b=this.editor,c=g.content,f,e;function f(h){a(h,function(i){if(i.constructor==RegExp){c=c.replace(i,"")}else{c=c.replace(i[0],i[1])}})}f([/^\s*( )+/g,/( |<br[^>]*>)+\s*$/g]);if(/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(c)){g.wordContent=true;if(b.getParam("paste_convert_middot_lists",true)){f([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+:\s*symbol[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<span[^>]+mso-list:[^>]+>)/gi,"$1__MCE_ITEM__"]])}f([/<!--[\s\S]+?-->/gi,/<\/?(img|font|meta|link|style|div|v:\w+)[^>]*>/gi,/<\\?\?xml[^>]*>/gi,/<\/?o:[^>]*>/gi,/ (id|name|language|type|on\w+|v:\w+)=\"([^\"]*)\"/gi,/ (id|name|language|type|on\w+|v:\w+)=(\w+)/gi,[/<(\/?)s>/gi,"<$1strike>"],/<script[^>]+>[\s\S]*?<\/script>/gi,[/ /g,"\u00a0"]]);if(!b.getParam("paste_retain_style_properties")){f([/<\/?(span)[^>]*>/gi])}}e=b.getParam("paste_strip_class_attributes","all");if(e!="none"){if(e=="all"){f([/ class=\"([^\"]*)\"/gi,/ class=(\w+)/gi])}else{f([/ class=\"(mso[^\"]*)\"/gi,/ class=(mso\w+)/gi])}}if(b.getParam("paste_remove_spans")){f([/<\/?(span)[^>]*>/gi])}g.content=c},_postProcess:function(e,g){var d=this,c=d.editor,f=c.dom,b;if(g.wordContent){a(f.select("a",g.node),function(h){if(!h.href||h.href.indexOf("#_Toc")!=-1){f.remove(h,1)}});if(d.editor.getParam("paste_convert_middot_lists",true)){d._convertLists(e,g)}b=c.getParam("paste_retain_style_properties");if(tinymce.is(b,"string")){b=tinymce.explode(b)}a(f.select("*",g.node),function(l){var m={},j=0,k,n,h;if(b){for(k=0;k<b.length;k++){n=b[k];h=f.getStyle(l,n);if(h){m[n]=h;j++}}}f.setAttrib(l,"style","");if(b&&j>0){f.setStyles(l,m)}else{if(l.nodeName=="SPAN"&&!l.className){f.remove(l,true)}}})}if(c.getParam("paste_remove_styles")||(c.getParam("paste_remove_styles_if_webkit")&&tinymce.isWebKit)){a(f.select("*[style]",g.node),function(h){h.removeAttribute("style");h.removeAttribute("mce_style")})}else{if(tinymce.isWebKit){a(f.select("*",g.node),function(h){h.removeAttribute("mce_style")})}}},_convertLists:function(e,c){var g=e.editor.dom,f,j,b=-1,d,k=[],i,h;a(g.select("p",c.node),function(r){var n,s="",q,o,l,m;for(n=r.firstChild;n&&n.nodeType==3;n=n.nextSibling){s+=n.nodeValue}s=r.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(s)){q="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(s)){q="ol"}if(q){d=parseFloat(r.style.marginLeft||0);if(d>b){k.push(d)}if(!f||q!=i){f=g.create(q);g.insertAfter(f,r)}else{if(d>b){f=j.appendChild(g.create(q))}else{if(d<b){l=tinymce.inArray(k,d);m=g.getParents(f.parentNode,q);f=m[m.length-1-l]||f}}}a(g.select("span",r),function(t){var p=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(q=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){g.remove(t)}else{if(/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){g.remove(t)}}});o=r.innerHTML;if(q=="ul"){o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/,"")}else{o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}j=f.appendChild(g.create("li",0,o));g.remove(r);b=d;i=q}else{f=b=0}});h=c.node.innerHTML;if(h.indexOf("__MCE_ITEM__")!=-1){c.node.innerHTML=h.replace(/__MCE_ITEM__/g,"")}},_insertBlockContent:function(h,e,i){var c,g,d=h.selection,m,j,b,k,f;function l(p){var o;if(tinymce.isIE){o=h.getDoc().body.createTextRange();o.moveToElementText(p);o.collapse(false);o.select()}else{d.select(p,1);d.collapse(false)}}this._insert('<span id="_marker"> </span>',1);g=e.get("_marker");c=e.getParent(g,"p,h1,h2,h3,h4,h5,h6,ul,ol");if(c){g=e.split(c,g);a(e.create("div",0,i).childNodes,function(o){m=g.parentNode.insertBefore(o.cloneNode(true),g)});l(m)}else{e.setOuterHTML(g,i);d.select(h.getBody(),1);d.collapse(0)}e.remove("_marker");j=d.getStart();b=e.getViewPort(h.getWin());k=h.dom.getPos(j).y;f=j.clientHeight;if(k<b.y||k+f>b.y+b.h){h.getDoc().body.scrollTop=k<b.y?k:k-b.h+25}},_insert:function(d,b){var c=this.editor;if(!c.selection.isCollapsed()){c.getDoc().execCommand("Delete",false,null)}c.execCommand(tinymce.isGecko?"insertHTML":"mceInsertContent",false,d,{skip_undo:b})},_legacySupport:function(){var c=this,b=c.editor;a(["mcePasteText","mcePasteWord"],function(d){b.addCommand(d,function(){b.windowManager.open({file:c.url+(d=="mcePasteText"?"/pastetext.htm":"/pasteword.htm"),width:parseInt(b.getParam("paste_dialog_width","450")),height:parseInt(b.getParam("paste_dialog_height","400")),inline:1})})});b.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});b.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"});b.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
\ No newline at end of file
+(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.PastePlugin",{init:function(c,d){var e=this,b;e.editor=c;e.url=d;e.onPreProcess=new tinymce.util.Dispatcher(e);e.onPostProcess=new tinymce.util.Dispatcher(e);e.onPreProcess.add(e._preProcess);e.onPostProcess.add(e._postProcess);e.onPreProcess.add(function(h,i){c.execCallback("paste_preprocess",h,i)});e.onPostProcess.add(function(h,i){c.execCallback("paste_postprocess",h,i)});function g(i){var h=c.dom;e.onPreProcess.dispatch(e,i);i.node=h.create("div",0,i.content);e.onPostProcess.dispatch(e,i);i.content=c.serializer.serialize(i.node,{getInner:1});if(/<(p|h[1-6]|ul|ol)/.test(i.content)){e._insertBlockContent(c,h,i.content)}else{e._insert(i.content)}}c.addCommand("mceInsertClipboardContent",function(h,i){g(i)});function f(l){var p,k,i,j=c.selection,o=c.dom,h=c.getBody(),m;if(o.get("_mcePaste")){return}p=o.add(h,"div",{id:"_mcePaste"},"\uFEFF");if(h!=c.getDoc().body){m=o.getPos(c.selection.getStart(),h).y}else{m=h.scrollTop}o.setStyles(p,{position:"absolute",left:-10000,top:m,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){i=o.doc.body.createTextRange();i.moveToElementText(p);i.execCommand("Paste");o.remove(p);if(p.innerHTML==="\uFEFF"){c.execCommand("mcePasteWord");l.preventDefault();return}g({content:p.innerHTML});return tinymce.dom.Event.cancel(l)}else{k=c.selection.getRng();p=p.firstChild;i=c.getDoc().createRange();i.setStart(p,0);i.setEnd(p,1);j.setRng(i);window.setTimeout(function(){var q="",n=o.select("div[id=_mcePaste]");a(n,function(r){q+=(o.select("> span.Apple-style-span div",r)[0]||o.select("> span.Apple-style-span",r)[0]||r).innerHTML});a(n,function(r){o.remove(r)});if(k){j.setRng(k)}g({content:q})},0)}}if(c.getParam("paste_auto_cleanup_on_paste",true)){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){c.onKeyDown.add(function(h,i){if(((tinymce.isMac?i.metaKey:i.ctrlKey)&&i.keyCode==86)||(i.shiftKey&&i.keyCode==45)){f(i)}})}else{c.onPaste.addToTop(function(h,i){return f(i)})}}if(c.getParam("paste_block_drop")){c.onInit.add(function(){c.dom.bind(c.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(h){h.preventDefault();h.stopPropagation();return false})})}e._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(d,i){var b=this.editor,c=i.content,g,f;function g(h){a(h,function(j){if(j.constructor==RegExp){c=c.replace(j,"")}else{c=c.replace(j[0],j[1])}})}if(/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(c)||i.wordContent){i.wordContent=true;g([/^\s*( )+/g,/( |<br[^>]*>)+\s*$/g]);if(b.getParam("paste_convert_middot_lists",true)){g([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+:\s*symbol[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<span[^>]+mso-list:[^>]+>)/gi,"$1__MCE_ITEM__"]])}g([/<!--[\s\S]+?-->/gi,/<\/?(img|font|meta|link|style|div|v:\w+)[^>]*>/gi,/<\\?\?xml[^>]*>/gi,/<\/?o:[^>]*>/gi,/ (id|name|language|type|on\w+|v:\w+)=\"([^\"]*)\"/gi,/ (id|name|language|type|on\w+|v:\w+)=(\w+)/gi,[/<(\/?)s>/gi,"<$1strike>"],/<script[^>]+>[\s\S]*?<\/script>/gi,[/ /g,"\u00a0"]]);if(!b.getParam("paste_retain_style_properties")){g([/<\/?(span)[^>]*>/gi])}}f=b.getParam("paste_strip_class_attributes");if(f!="none"){function e(l,h){var k,j="";if(f=="all"){return""}h=tinymce.explode(h," ");for(k=h.length-1;k>=0;k--){if(!/^(Mso)/i.test(h[k])){j+=(!j?"":" ")+h[k]}}return' class="'+j+'"'}g([[/ class=\"([^\"]*)\"/gi,e],[/ class=(\w+)/gi,e]])}if(b.getParam("paste_remove_spans")){g([/<\/?(span)[^>]*>/gi])}i.content=c},_postProcess:function(e,g){var d=this,c=d.editor,f=c.dom,b;if(g.wordContent){a(f.select("a",g.node),function(h){if(!h.href||h.href.indexOf("#_Toc")!=-1){f.remove(h,1)}});if(d.editor.getParam("paste_convert_middot_lists",true)){d._convertLists(e,g)}b=c.getParam("paste_retain_style_properties");if(tinymce.is(b,"string")){b=tinymce.explode(b)}a(f.select("*",g.node),function(l){var m={},j=0,k,n,h;if(b){for(k=0;k<b.length;k++){n=b[k];h=f.getStyle(l,n);if(h){m[n]=h;j++}}}f.setAttrib(l,"style","");if(b&&j>0){f.setStyles(l,m)}else{if(l.nodeName=="SPAN"&&!l.className){f.remove(l,true)}}})}if(c.getParam("paste_remove_styles")||(c.getParam("paste_remove_styles_if_webkit")&&tinymce.isWebKit)){a(f.select("*[style]",g.node),function(h){h.removeAttribute("style");h.removeAttribute("mce_style")})}else{if(tinymce.isWebKit){a(f.select("*",g.node),function(h){h.removeAttribute("mce_style")})}}},_convertLists:function(e,c){var g=e.editor.dom,f,j,b=-1,d,k=[],i,h;a(g.select("p",c.node),function(r){var n,s="",q,o,l,m;for(n=r.firstChild;n&&n.nodeType==3;n=n.nextSibling){s+=n.nodeValue}s=r.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(s)){q="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(s)){q="ol"}if(q){d=parseFloat(r.style.marginLeft||0);if(d>b){k.push(d)}if(!f||q!=i){f=g.create(q);g.insertAfter(f,r)}else{if(d>b){f=j.appendChild(g.create(q))}else{if(d<b){l=tinymce.inArray(k,d);m=g.getParents(f.parentNode,q);f=m[m.length-1-l]||f}}}a(g.select("span",r),function(t){var p=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(q=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){g.remove(t)}else{if(/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){g.remove(t)}}});o=r.innerHTML;if(q=="ul"){o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/,"")}else{o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}j=f.appendChild(g.create("li",0,o));g.remove(r);b=d;i=q}else{f=b=0}});h=c.node.innerHTML;if(h.indexOf("__MCE_ITEM__")!=-1){c.node.innerHTML=h.replace(/__MCE_ITEM__/g,"")}},_insertBlockContent:function(h,e,i){var c,g,d=h.selection,m,j,b,k,f;function l(p){var o;if(tinymce.isIE){o=h.getDoc().body.createTextRange();o.moveToElementText(p);o.collapse(false);o.select()}else{d.select(p,1);d.collapse(false)}}this._insert('<span id="_marker"> </span>',1);g=e.get("_marker");c=e.getParent(g,"p,h1,h2,h3,h4,h5,h6,ul,ol,th,td");if(c&&!/TD|TH/.test(c.nodeName)){g=e.split(c,g);a(e.create("div",0,i).childNodes,function(o){m=g.parentNode.insertBefore(o.cloneNode(true),g)});l(m)}else{e.setOuterHTML(g,i);d.select(h.getBody(),1);d.collapse(0)}e.remove("_marker");j=d.getStart();b=e.getViewPort(h.getWin());k=h.dom.getPos(j).y;f=j.clientHeight;if(k<b.y||k+f>b.y+b.h){h.getDoc().body.scrollTop=k<b.y?k:k-b.h+25}},_insert:function(d,b){var c=this.editor;if(!c.selection.isCollapsed()){c.getDoc().execCommand("Delete",false,null)}c.execCommand(tinymce.isGecko?"insertHTML":"mceInsertContent",false,d,{skip_undo:b})},_legacySupport:function(){var c=this,b=c.editor;a(["mcePasteText","mcePasteWord"],function(d){b.addCommand(d,function(){b.windowManager.open({file:c.url+(d=="mcePasteText"?"/pastetext.htm":"/pasteword.htm"),width:parseInt(b.getParam("paste_dialog_width","450")),height:parseInt(b.getParam("paste_dialog_height","400")),inline:1})})});b.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});b.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"});b.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
\ No newline at end of file
}
}
- tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, h);
+ tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h});
tinyMCEPopup.close();
},
css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")];
css = css.concat(tinymce.explode(ed.settings.content_css) || []);
tinymce.each(css, function(u) {
- cssHTML += '<link href="' + ed.documentBaseURI.toAbsolute(u) + '" rel="stylesheet" type="text/css" />';
+ cssHTML += '<link href="' + ed.documentBaseURI.toAbsolute('' + u) + '" rel="stylesheet" type="text/css" />';
});
// Write content into iframe
insert : function() {
var h = document.getElementById('iframe').contentWindow.document.body.innerHTML;
- tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, h);
+ tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true});
tinyMCEPopup.close();
},
<head>
<title>{#paste.paste_text_desc}</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3241-1141"></script>
- <script type="text/javascript" src="js/pastetext.js?ver=3241-1141"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
+ <script type="text/javascript" src="js/pastetext.js?ver=327-1235"></script>
</head>
<body onresize="PasteTextDialog.resize();" style="display:none; overflow:hidden;">
<form name="source" onsubmit="return PasteTextDialog.insert();" action="#">
</div>
</form>
</body>
-</html>
+</html>
\ No newline at end of file
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{#paste.paste_word_desc}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3241-1141"></script>
- <script type="text/javascript" src="js/pasteword.js?ver=3241-1141"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
+ <script type="text/javascript" src="js/pasteword.js?ver=327-1235"></script>
</head>
<body onresize="PasteWordDialog.resize();" style="display:none; overflow:hidden;">
<form name="source" onsubmit="return PasteWordDialog.insert();" action="#">
}
.mceWPnextpage {
background: #ffffff url(../img/page_bug.gif) no-repeat right top;
-}
\ No newline at end of file
+}
+
+img.wpGallery {
+ border: 1px dashed #888;
+ background: #f2f8ff url("../../wpgallery/img/gallery.png") no-repeat scroll center center;
+ width: 99%;
+ height: 250px;
+}
+
+img.wp-oembed {
+ border: 1px dashed #888;
+ background: #f7f5f2 url("../img/embedded.png") no-repeat scroll center center;
+ width: 300px;
+ height: 250px;
+}
var DOM = tinymce.DOM;
tinymce.create('tinymce.plugins.WordPress', {
+ mceTout : 0,
+
init : function(ed, url) {
var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML;
moreHTML = '<img src="' + url + '/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
// Hides the specified toolbar and resizes the iframe
ed.onPostRender.add(function() {
- if ( ed.getParam('wordpress_adv_hidden', 1) ) {
- DOM.hide(ed.controlManager.get(tbId).id);
+ var adv_toolbar = ed.controlManager.get(tbId);
+ if ( ed.getParam('wordpress_adv_hidden', 1) && adv_toolbar ) {
+ DOM.hide(adv_toolbar.id);
t._resizeIframe(ed, tbId, 28);
}
});
});
ed.addCommand('WP_Adv', function() {
- var id = ed.controlManager.get(tbId).id, cm = ed.controlManager;
+ var cm = ed.controlManager, id = cm.get(tbId).id;
+
+ if ( 'undefined' == id )
+ return;
- if (DOM.isHidden(id)) {
+ if ( DOM.isHidden(id) ) {
cm.setActive('wp_adv', 1);
DOM.show(id);
t._resizeIframe(ed, tbId, -28);
// Add Media buttons to fullscreen
ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) {
+ var DOM = tinymce.DOM;
if ( 'mceFullScreen' != cmd ) return;
- if ( 'mce_fullscreen' != ed.id )
+ if ( 'mce_fullscreen' != ed.id && DOM.get('add_audio') && DOM.get('add_video') && DOM.get('add_image') && DOM.get('add_media') )
ed.settings.theme_advanced_buttons1 += ',|,add_image,add_video,add_audio,add_media';
});
});
};
+ ed.onSaveContent.add(function(ed, o) {
+ if ( typeof(switchEditors) == 'object' ) {
+ if ( ed.isHidden() )
+ o.content = o.element.value;
+ else
+ o.content = switchEditors.pre_wpautop(o.content);
+ }
+ });
+
+ /* disable for now
+ ed.onBeforeSetContent.add(function(ed, o) {
+ o.content = t._setEmbed(o.content);
+ });
+
+ ed.onPostProcess.add(function(ed, o) {
+ if ( o.get )
+ o.content = t._getEmbed(o.content);
+ });
+ */
+
// Add listeners to handle more break
t._handleMoreBreak(ed, url);
ed.addShortcut('alt+shift+b', ed.getLang('bold_desc'), 'Bold');
ed.addShortcut('alt+shift+i', ed.getLang('italic_desc'), 'Italic');
}
+
+ ed.onInit.add(function(ed) {
+ tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) {
+ ed.plugins.wordpress._hideButtons();
+ });
+ tinymce.dom.Event.add(ed.getBody(), 'dragstart', function(e) {
+ ed.plugins.wordpress._hideButtons();
+ });
+ });
+
+ ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) {
+ ed.plugins.wordpress._hideButtons();
+ });
+
+ ed.onSaveContent.add(function(ed, o) {
+ ed.plugins.wordpress._hideButtons();
+ });
+
+ ed.onMouseDown.add(function(ed, e) {
+ if ( e.target.nodeName != 'IMG' )
+ ed.plugins.wordpress._hideButtons();
+ });
},
getInfo : function() {
},
// Internal functions
+ _setEmbed : function(c) {
+ return c.replace(/\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g, function(a,b){
+ return '<img width="300" height="200" src="' + tinymce.baseURL + '/plugins/wordpress/img/trans.gif" class="wp-oembed mceItemNoResize" alt="'+b+'" title="'+b+'" />';
+ });
+ },
+
+ _getEmbed : function(c) {
+ return c.replace(/<img[^>]+>/g, function(a) {
+ if ( a.indexOf('class="wp-oembed') != -1 ) {
+ var u = a.match(/alt="([^\"]+)"/);
+ if ( u[1] )
+ a = '[embed]' + u[1] + '[/embed]';
+ }
+ return a;
+ });
+ },
+
+ _showButtons : function(n, id) {
+ var ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y;
+
+ 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(id, {
+ 'top' : Y+5+'px',
+ 'left' : X+5+'px',
+ 'display' : 'block'
+ });
+
+ if ( this.mceTout )
+ clearTimeout(this.mceTout);
+
+ this.mceTout = setTimeout( function(){ed.plugins.wordpress._hideButtons();}, 5000 );
+ },
+
+ _hideButtons : function() {
+ if ( !this.mceTout )
+ return;
+
+ if ( document.getElementById('wp_editbtns') )
+ tinymce.DOM.hide('wp_editbtns');
+
+ if ( document.getElementById('wp_gallerybtns') )
+ tinymce.DOM.hide('wp_gallerybtns');
+
+ clearTimeout(this.mceTout);
+ this.mceTout = 0;
+ },
+
do_align : function(n, a) {
var P, DL, DIV, cls, c, ed = tinyMCE.activeEditor;
_handleMoreBreak : function(ed, url) {
var moreHTML, nextpageHTML;
-
+
moreHTML = '<img src="' + url + '/img/trans.gif" alt="$1" class="mceWPmore mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
-(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.WordPress",{init:function(c,d){var e=this,h=c.getParam("wordpress_adv_toolbar","toolbar2"),g=0,f,b;f='<img src="'+d+'/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+c.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+c.getLang("wordpress.wp_page_alt")+'" />';if(getUserSetting("hidetb","0")=="1"){c.settings.wordpress_adv_hidden=0}c.onPostRender.add(function(){if(c.getParam("wordpress_adv_hidden",1)){a.hide(c.controlManager.get(h).id);e._resizeIframe(c,h,28)}});c.addCommand("WP_More",function(){c.execCommand("mceInsertContent",0,f)});c.addCommand("WP_Page",function(){c.execCommand("mceInsertContent",0,b)});c.addCommand("WP_Help",function(){c.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",width:450,height:420,inline:1})});c.addCommand("WP_Adv",function(){var j=c.controlManager.get(h).id,i=c.controlManager;if(a.isHidden(j)){i.setActive("wp_adv",1);a.show(j);e._resizeIframe(c,h,-28);c.settings.wordpress_adv_hidden=0;setUserSetting("hidetb","1")}else{i.setActive("wp_adv",0);a.hide(j);e._resizeIframe(c,h,28);c.settings.wordpress_adv_hidden=1;setUserSetting("hidetb","0")}});c.addButton("wp_more",{title:"wordpress.wp_more_desc",image:d+"/img/more.gif",cmd:"WP_More"});c.addButton("wp_page",{title:"wordpress.wp_page_desc",image:d+"/img/page.gif",cmd:"WP_Page"});c.addButton("wp_help",{title:"wordpress.wp_help_desc",image:d+"/img/help.gif",cmd:"WP_Help"});c.addButton("wp_adv",{title:"wordpress.wp_adv_desc",image:d+"/img/toolbars.gif",cmd:"WP_Adv"});c.addButton("add_media",{title:"wordpress.add_media",image:d+"/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")}});c.addButton("add_image",{title:"wordpress.add_image",image:d+"/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")}});c.addButton("add_video",{title:"wordpress.add_video",image:d+"/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")}});c.addButton("add_audio",{title:"wordpress.add_audio",image:d+"/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")}});c.onBeforeExecCommand.add(function(i,k,j,l){if("mceFullScreen"!=k){return}if("mce_fullscreen"!=i.id){i.settings.theme_advanced_buttons1+=",|,add_image,add_video,add_audio,add_media"}});c.addCommand("JustifyLeft",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyLeft","left")}else{c.plugins.wordpress.do_align(i,"alignleft")}});c.addCommand("JustifyRight",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyRight","right")}else{c.plugins.wordpress.do_align(i,"alignright")}});c.addCommand("JustifyCenter",function(){var k=c.selection.getNode(),j=c.dom.getParent(k,"p"),i=c.dom.getParent(k,"dl");if(k.nodeName=="IMG"&&(j||i)){c.plugins.wordpress.do_align(k,"aligncenter")}else{c.editorCommands.mceJustify("JustifyCenter","center")}});if("undefined"!=typeof wpWordCount){c.onKeyUp.add(function(i,j){if(j.keyCode==g){return}if(13==j.keyCode||8==g||46==g){wpWordCount.wc(i.getContent({format:"raw"}))}g=j.keyCode})}e._handleMoreBreak(c,d);c.addShortcut("alt+shift+c",c.getLang("justifycenter_desc"),"JustifyCenter");c.addShortcut("alt+shift+r",c.getLang("justifyright_desc"),"JustifyRight");c.addShortcut("alt+shift+l",c.getLang("justifyleft_desc"),"JustifyLeft");c.addShortcut("alt+shift+j",c.getLang("justifyfull_desc"),"JustifyFull");c.addShortcut("alt+shift+q",c.getLang("blockquote_desc"),"mceBlockQuote");c.addShortcut("alt+shift+u",c.getLang("bullist_desc"),"InsertUnorderedList");c.addShortcut("alt+shift+o",c.getLang("numlist_desc"),"InsertOrderedList");c.addShortcut("alt+shift+d",c.getLang("striketrough_desc"),"Strikethrough");c.addShortcut("alt+shift+n",c.getLang("spellchecker.desc"),"mceSpellCheck");c.addShortcut("alt+shift+a",c.getLang("link_desc"),"mceLink");c.addShortcut("alt+shift+s",c.getLang("unlink_desc"),"unlink");c.addShortcut("alt+shift+m",c.getLang("image_desc"),"mceImage");c.addShortcut("alt+shift+g",c.getLang("fullscreen.desc"),"mceFullScreen");c.addShortcut("alt+shift+z",c.getLang("wp_adv_desc"),"WP_Adv");c.addShortcut("alt+shift+h",c.getLang("help_desc"),"WP_Help");c.addShortcut("alt+shift+t",c.getLang("wp_more_desc"),"WP_More");c.addShortcut("alt+shift+p",c.getLang("wp_page_desc"),"WP_Page");c.addShortcut("ctrl+s",c.getLang("save_desc"),function(){if("function"==typeof autosave){autosave()}});if(tinymce.isWebKit){c.addShortcut("alt+shift+b",c.getLang("bold_desc"),"Bold");c.addShortcut("alt+shift+i",c.getLang("italic_desc"),"Italic")}},getInfo:function(){return{longname:"WordPress Plugin",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"3.0"}},do_align:function(j,d){var h,f,g,b,i,e=tinyMCE.activeEditor;if(/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(j.className)){return}h=e.dom.getParent(j,"p");f=e.dom.getParent(j,"dl");g=e.dom.getParent(j,"div");if(f&&g){b=e.dom.hasClass(f,d)?"alignnone":d;f.className=f.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(f,b);i=(b=="aligncenter")?e.dom.addClass(g,"mceIEcenter"):e.dom.removeClass(g,"mceIEcenter")}else{if(h){b=e.dom.hasClass(j,d)?"alignnone":d;j.className=j.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(j,b);if(b=="aligncenter"){e.dom.setStyle(h,"textAlign","center")}else{if(h.style&&h.style.textAlign=="center"){e.dom.setStyle(h,"textAlign","")}}}}e.execCommand("mceRepaint")},_resizeIframe:function(c,e,b){var d=c.getContentAreaContainer().firstChild;a.setStyle(d,"height",d.clientHeight+b);c.theme.deltaHeight+=b},_handleMoreBreak:function(c,d){var e,b;e='<img src="'+d+'/img/trans.gif" alt="$1" class="mceWPmore mceItemNoResize" title="'+c.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+c.getLang("wordpress.wp_page_alt")+'" />';c.onInit.add(function(){c.dom.loadCSS(d+"/css/content.css")});c.onPostRender.add(function(){if(c.theme.onResolveName){c.theme.onResolveName.add(function(f,g){if(g.node.nodeName=="IMG"){if(c.dom.hasClass(g.node,"mceWPmore")){g.name="wpmore"}if(c.dom.hasClass(g.node,"mceWPnextpage")){g.name="wppage"}}})}});c.onBeforeSetContent.add(function(f,g){g.content=g.content.replace(/<!--more(.*?)-->/g,e);g.content=g.content.replace(/<!--nextpage-->/g,b)});c.onPostProcess.add(function(f,g){if(g.get){g.content=g.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mceWPmore')!==-1){var h,j=(h=i.match(/alt="(.*?)"/))?h[1]:"";i="<!--more"+j+"-->"}if(i.indexOf('class="mceWPnextpage')!==-1){i="<!--nextpage-->"}return i})}});c.onNodeChange.add(function(g,f,h){f.setActive("wp_page",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPnextpage"));f.setActive("wp_more",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPmore"))})}});tinymce.PluginManager.add("wordpress",tinymce.plugins.WordPress)})();
\ No newline at end of file
+(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.WordPress",{mceTout:0,init:function(c,d){var e=this,h=c.getParam("wordpress_adv_toolbar","toolbar2"),g=0,f,b;f='<img src="'+d+'/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+c.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+c.getLang("wordpress.wp_page_alt")+'" />';if(getUserSetting("hidetb","0")=="1"){c.settings.wordpress_adv_hidden=0}c.onPostRender.add(function(){var i=c.controlManager.get(h);if(c.getParam("wordpress_adv_hidden",1)&&i){a.hide(i.id);e._resizeIframe(c,h,28)}});c.addCommand("WP_More",function(){c.execCommand("mceInsertContent",0,f)});c.addCommand("WP_Page",function(){c.execCommand("mceInsertContent",0,b)});c.addCommand("WP_Help",function(){c.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",width:450,height:420,inline:1})});c.addCommand("WP_Adv",function(){var i=c.controlManager,j=i.get(h).id;if("undefined"==j){return}if(a.isHidden(j)){i.setActive("wp_adv",1);a.show(j);e._resizeIframe(c,h,-28);c.settings.wordpress_adv_hidden=0;setUserSetting("hidetb","1")}else{i.setActive("wp_adv",0);a.hide(j);e._resizeIframe(c,h,28);c.settings.wordpress_adv_hidden=1;setUserSetting("hidetb","0")}});c.addButton("wp_more",{title:"wordpress.wp_more_desc",image:d+"/img/more.gif",cmd:"WP_More"});c.addButton("wp_page",{title:"wordpress.wp_page_desc",image:d+"/img/page.gif",cmd:"WP_Page"});c.addButton("wp_help",{title:"wordpress.wp_help_desc",image:d+"/img/help.gif",cmd:"WP_Help"});c.addButton("wp_adv",{title:"wordpress.wp_adv_desc",image:d+"/img/toolbars.gif",cmd:"WP_Adv"});c.addButton("add_media",{title:"wordpress.add_media",image:d+"/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")}});c.addButton("add_image",{title:"wordpress.add_image",image:d+"/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")}});c.addButton("add_video",{title:"wordpress.add_video",image:d+"/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")}});c.addButton("add_audio",{title:"wordpress.add_audio",image:d+"/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")}});c.onBeforeExecCommand.add(function(i,l,k,m){var j=tinymce.DOM;if("mceFullScreen"!=l){return}if("mce_fullscreen"!=i.id&&j.get("add_audio")&&j.get("add_video")&&j.get("add_image")&&j.get("add_media")){i.settings.theme_advanced_buttons1+=",|,add_image,add_video,add_audio,add_media"}});c.addCommand("JustifyLeft",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyLeft","left")}else{c.plugins.wordpress.do_align(i,"alignleft")}});c.addCommand("JustifyRight",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyRight","right")}else{c.plugins.wordpress.do_align(i,"alignright")}});c.addCommand("JustifyCenter",function(){var k=c.selection.getNode(),j=c.dom.getParent(k,"p"),i=c.dom.getParent(k,"dl");if(k.nodeName=="IMG"&&(j||i)){c.plugins.wordpress.do_align(k,"aligncenter")}else{c.editorCommands.mceJustify("JustifyCenter","center")}});if("undefined"!=typeof wpWordCount){c.onKeyUp.add(function(i,j){if(j.keyCode==g){return}if(13==j.keyCode||8==g||46==g){wpWordCount.wc(i.getContent({format:"raw"}))}g=j.keyCode})}c.onSaveContent.add(function(i,j){if(typeof(switchEditors)=="object"){if(i.isHidden()){j.content=j.element.value}else{j.content=switchEditors.pre_wpautop(j.content)}}});e._handleMoreBreak(c,d);c.addShortcut("alt+shift+c",c.getLang("justifycenter_desc"),"JustifyCenter");c.addShortcut("alt+shift+r",c.getLang("justifyright_desc"),"JustifyRight");c.addShortcut("alt+shift+l",c.getLang("justifyleft_desc"),"JustifyLeft");c.addShortcut("alt+shift+j",c.getLang("justifyfull_desc"),"JustifyFull");c.addShortcut("alt+shift+q",c.getLang("blockquote_desc"),"mceBlockQuote");c.addShortcut("alt+shift+u",c.getLang("bullist_desc"),"InsertUnorderedList");c.addShortcut("alt+shift+o",c.getLang("numlist_desc"),"InsertOrderedList");c.addShortcut("alt+shift+d",c.getLang("striketrough_desc"),"Strikethrough");c.addShortcut("alt+shift+n",c.getLang("spellchecker.desc"),"mceSpellCheck");c.addShortcut("alt+shift+a",c.getLang("link_desc"),"mceLink");c.addShortcut("alt+shift+s",c.getLang("unlink_desc"),"unlink");c.addShortcut("alt+shift+m",c.getLang("image_desc"),"mceImage");c.addShortcut("alt+shift+g",c.getLang("fullscreen.desc"),"mceFullScreen");c.addShortcut("alt+shift+z",c.getLang("wp_adv_desc"),"WP_Adv");c.addShortcut("alt+shift+h",c.getLang("help_desc"),"WP_Help");c.addShortcut("alt+shift+t",c.getLang("wp_more_desc"),"WP_More");c.addShortcut("alt+shift+p",c.getLang("wp_page_desc"),"WP_Page");c.addShortcut("ctrl+s",c.getLang("save_desc"),function(){if("function"==typeof autosave){autosave()}});if(tinymce.isWebKit){c.addShortcut("alt+shift+b",c.getLang("bold_desc"),"Bold");c.addShortcut("alt+shift+i",c.getLang("italic_desc"),"Italic")}c.onInit.add(function(i){tinymce.dom.Event.add(i.getWin(),"scroll",function(j){i.plugins.wordpress._hideButtons()});tinymce.dom.Event.add(i.getBody(),"dragstart",function(j){i.plugins.wordpress._hideButtons()})});c.onBeforeExecCommand.add(function(i,k,j,l){i.plugins.wordpress._hideButtons()});c.onSaveContent.add(function(i,j){i.plugins.wordpress._hideButtons()});c.onMouseDown.add(function(i,j){if(j.target.nodeName!="IMG"){i.plugins.wordpress._hideButtons()}})},getInfo:function(){return{longname:"WordPress Plugin",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"3.0"}},_setEmbed:function(b){return b.replace(/\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g,function(d,c){return'<img width="300" height="200" src="'+tinymce.baseURL+'/plugins/wordpress/img/trans.gif" class="wp-oembed mceItemNoResize" alt="'+c+'" title="'+c+'" />'})},_getEmbed:function(b){return b.replace(/<img[^>]+>/g,function(c){if(c.indexOf('class="wp-oembed')!=-1){var d=c.match(/alt="([^\"]+)"/);if(d[1]){c="[embed]"+d[1]+"[/embed]"}}return c})},_showButtons:function(f,d){var g=tinyMCE.activeEditor,i,h,b,j=tinymce.DOM,e,c;b=g.dom.getViewPort(g.getWin());i=j.getPos(g.getContentAreaContainer());h=g.dom.getPos(f);e=Math.max(h.x-b.x,0)+i.x;c=Math.max(h.y-b.y,0)+i.y;j.setStyles(d,{top:c+5+"px",left:e+5+"px",display:"block"});if(this.mceTout){clearTimeout(this.mceTout)}this.mceTout=setTimeout(function(){g.plugins.wordpress._hideButtons()},5000)},_hideButtons:function(){if(!this.mceTout){return}if(document.getElementById("wp_editbtns")){tinymce.DOM.hide("wp_editbtns")}if(document.getElementById("wp_gallerybtns")){tinymce.DOM.hide("wp_gallerybtns")}clearTimeout(this.mceTout);this.mceTout=0},do_align:function(j,d){var h,f,g,b,i,e=tinyMCE.activeEditor;if(/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(j.className)){return}h=e.dom.getParent(j,"p");f=e.dom.getParent(j,"dl");g=e.dom.getParent(j,"div");if(f&&g){b=e.dom.hasClass(f,d)?"alignnone":d;f.className=f.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(f,b);i=(b=="aligncenter")?e.dom.addClass(g,"mceIEcenter"):e.dom.removeClass(g,"mceIEcenter")}else{if(h){b=e.dom.hasClass(j,d)?"alignnone":d;j.className=j.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(j,b);if(b=="aligncenter"){e.dom.setStyle(h,"textAlign","center")}else{if(h.style&&h.style.textAlign=="center"){e.dom.setStyle(h,"textAlign","")}}}}e.execCommand("mceRepaint")},_resizeIframe:function(c,e,b){var d=c.getContentAreaContainer().firstChild;a.setStyle(d,"height",d.clientHeight+b);c.theme.deltaHeight+=b},_handleMoreBreak:function(c,d){var e,b;e='<img src="'+d+'/img/trans.gif" alt="$1" class="mceWPmore mceItemNoResize" title="'+c.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+c.getLang("wordpress.wp_page_alt")+'" />';c.onInit.add(function(){c.dom.loadCSS(d+"/css/content.css")});c.onPostRender.add(function(){if(c.theme.onResolveName){c.theme.onResolveName.add(function(f,g){if(g.node.nodeName=="IMG"){if(c.dom.hasClass(g.node,"mceWPmore")){g.name="wpmore"}if(c.dom.hasClass(g.node,"mceWPnextpage")){g.name="wppage"}}})}});c.onBeforeSetContent.add(function(f,g){g.content=g.content.replace(/<!--more(.*?)-->/g,e);g.content=g.content.replace(/<!--nextpage-->/g,b)});c.onPostProcess.add(function(f,g){if(g.get){g.content=g.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mceWPmore')!==-1){var h,j=(h=i.match(/alt="(.*?)"/))?h[1]:"";i="<!--more"+j+"-->"}if(i.indexOf('class="mceWPnextpage')!==-1){i="<!--nextpage-->"}return i})}});c.onNodeChange.add(function(g,f,h){f.setActive("wp_page",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPnextpage"));f.setActive("wp_more",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPmore"))})}});tinymce.PluginManager.add("wordpress",tinymce.plugins.WordPress)})();
\ No newline at end of file
});
ed.onInit.add(function(ed) {
- tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) {
- ed.plugins.wpeditimage.hideButtons();
+ tinymce.dom.Event.add(ed.getBody(), 'dragstart', function(e) {
+ if ( !tinymce.isGecko && e.target.nodeName == 'IMG' && ed.dom.getParent(e.target, 'dl.wp-caption') )
+ return tinymce.dom.Event.cancel(e);
});
});
- ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) {
- ed.plugins.wpeditimage.hideButtons();
- });
+ ed.onMouseUp.add(function(ed, e) {
+ if ( tinymce.isWebKit || tinymce.isOpera )
+ return;
- ed.onSaveContent.add(function(ed, o) {
- ed.plugins.wpeditimage.hideButtons();
- });
+ if ( ed.dom.getParent(e.target, 'div.mceTemp') || ed.dom.is(e.target, 'div.mceTemp') ) {
+ window.setTimeout(function(){
+ var ed = tinyMCE.activeEditor, n = ed.selection.getNode(), DL = ed.dom.getParent(n, 'dl.wp-caption');
- ed.onMouseUp.add(function(ed, e) {
- var n, DL;
-
- if ( tinymce.isOpera ) {
- if ( e.target.nodeName == 'IMG' )
- ed.plugins.wpeditimage.showButtons(e.target);
- } else if ( ! tinymce.isWebKit ) {
- n = ed.selection.getNode();
-
- 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);
- }
+ if ( DL && n.width != ( parseInt(ed.dom.getStyle(DL, 'width'), 10) - 10 ) ) {
+ ed.dom.setStyle(DL, 'width', parseInt(n.width, 10) + 10);
+ ed.execCommand('mceRepaint');
+ }
+ }, 100);
}
});
ed.onMouseDown.add(function(ed, e) {
- if ( tinymce.isOpera || e.target.nodeName != 'IMG' ) {
- t.hideButtons();
- return;
+ var p;
+
+ if ( e.target.nodeName == 'IMG' && ed.dom.getAttrib(e.target, 'class').indexOf('mceItem') == -1 ) {
+ ed.plugins.wordpress._showButtons(e.target, 'wp_editbtns');
+ if ( tinymce.isGecko && (p = ed.dom.getParent(e.target, 'dl.wp-caption')) && ed.dom.hasClass(p.parentNode, 'mceTemp') )
+ ed.selection.select(p.parentNode);
}
- ed.plugins.wpeditimage.showButtons(e.target);
});
ed.onKeyPress.add(function(ed, e) {
var DL, DIV, P;
- if ( e.keyCode == 13 && (DL = ed.dom.getParent(ed.selection.getNode(), 'DL')) ) {
+ if ( e.keyCode == 13 && (DL = ed.dom.getParent(ed.selection.getNode(), 'DL')) && ed.dom.hasClass(DL, 'wp-caption') ) {
P = ed.dom.create('p', {}, ' ');
if ( (DIV = DL.parentNode) && DIV.nodeName == 'DIV' )
ed.dom.insertAfter( P, DIV );
- else ed.dom.insertAfter( P, DL );
+ else
+ ed.dom.insertAfter( P, DL );
+
+ if ( P.firstChild )
+ ed.selection.select(P.firstChild);
+ else
+ ed.selection.select(P);
tinymce.dom.Event.cancel(e);
- ed.selection.select(P);
return false;
}
});
div_cls = (cls == 'aligncenter') ? 'mceTemp mceIEcenter' : 'mceTemp';
- return '<div class="'+div_cls+'"><dl id="'+id+'" class="wp-caption '+cls+'" style="width: '+(10+parseInt(w))+
+ return '<div class="'+div_cls+'" draggable><dl id="'+id+'" class="wp-caption '+cls+'" style="width: '+(10+parseInt(w))+
'px"><dt class="wp-caption-dt">'+c+'</dt><dd class="wp-caption-dd">'+cap+'</dd></dl></div>';
});
},
});
},
- showButtons : function(n) {
- var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y, cls = ed.dom.getAttrib(n, 'class');
-
- if ( cls.indexOf('mceItem') != -1 || cls.indexOf('wpGallery') != -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, wp_editbtns, wp_editimgbtn, wp_delimgbtn;
+ var t = this, ed = tinyMCE.activeEditor, DOM = tinymce.DOM, editButton, dellButton;
DOM.remove('wp_editbtns');
- wp_editbtns = DOM.add(document.body, 'div', {
+ DOM.add(document.body, 'div', {
id : 'wp_editbtns',
style : 'display:none;'
});
- wp_editimgbtn = DOM.add('wp_editbtns', 'img', {
+ editButton = DOM.add('wp_editbtns', 'img', {
src : t.url+'/img/image.png',
id : 'wp_editimgbtn',
width : '24',
title : ed.getLang('wpeditimage.edit_img')
});
- wp_editimgbtn.onmousedown = function(e) {
+ tinymce.dom.Event.add(editButton, 'mousedown', function(e) {
var ed = tinyMCE.activeEditor;
ed.windowManager.bookmark = ed.selection.getBookmark('simple');
ed.execCommand("WP_EditImage");
- this.parentNode.style.display = 'none';
- };
+ });
- wp_delimgbtn = DOM.add('wp_editbtns', 'img', {
+ dellButton = DOM.add('wp_editbtns', 'img', {
src : t.url+'/img/delete.png',
id : 'wp_delimgbtn',
width : '24',
title : ed.getLang('wpeditimage.del_img')
});
- wp_delimgbtn.onmousedown = function(e) {
+ tinymce.dom.Event.add(dellButton, 'mousedown', function(e) {
var ed = tinyMCE.activeEditor, el = ed.selection.getNode(), p;
if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('mceItem') == -1 ) {
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);
+ else
+ ed.dom.remove(el);
- this.parentNode.style.display = 'none';
ed.execCommand('mceRepaint');
return false;
}
- };
+ });
},
getInfo : function() {
-(function(){tinymce.create("tinymce.plugins.wpEditImage",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_EditImage",function(){var h=a.selection.getNode(),f=tinymce.DOM.getViewPort(),g=f.h,d=(720<f.w)?720:f.w,e=a.dom.getAttrib(h,"class");if(e.indexOf("mceItem")!=-1||e.indexOf("wpGallery")!=-1||h.nodeName!="IMG"){return}tb_show("",b+"/editimage.html?ver=321&TB_iframe=true");tinymce.DOM.setStyles("TB_window",{width:(d-50)+"px",height:(g-45)+"px","margin-left":"-"+parseInt(((d-50)/2),10)+"px"});if(!tinymce.isIE6){tinymce.DOM.setStyles("TB_window",{top:"20px",marginTop:"0"})}tinymce.DOM.setStyles("TB_iframeContent",{width:(d-50)+"px",height:(g-75)+"px"});tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")});a.onInit.add(function(d){tinymce.dom.Event.add(d.getWin(),"scroll",function(f){d.plugins.wpeditimage.hideButtons()})});a.onBeforeExecCommand.add(function(d,f,e,g){d.plugins.wpeditimage.hideButtons()});a.onSaveContent.add(function(d,e){d.plugins.wpeditimage.hideButtons()});a.onMouseUp.add(function(d,g){var h,f;if(tinymce.isOpera){if(g.target.nodeName=="IMG"){d.plugins.wpeditimage.showButtons(g.target)}}else{if(!tinymce.isWebKit){h=d.selection.getNode();if(h.nodeName=="IMG"&&(f=d.dom.getParent(h,"DL"))){window.setTimeout(function(){var e=tinyMCE.activeEditor,j=e.selection.getNode(),i=e.dom.getParent(j,"DL");if(j.width!=(parseInt(e.dom.getStyle(i,"width"))-10)){e.dom.setStyle(i,"width",parseInt(j.width)+10);e.execCommand("mceRepaint")}},100)}}}});a.onMouseDown.add(function(d,f){if(tinymce.isOpera||f.target.nodeName!="IMG"){c.hideButtons();return}d.plugins.wpeditimage.showButtons(f.target)});a.onKeyPress.add(function(d,i){var f,h,g;if(i.keyCode==13&&(f=d.dom.getParent(d.selection.getNode(),"DL"))){g=d.dom.create("p",{}," ");if((h=f.parentNode)&&h.nodeName=="DIV"){d.dom.insertAfter(g,h)}else{d.dom.insertAfter(g,f)}tinymce.dom.Event.cancel(i);d.selection.select(g);return false}});a.onBeforeSetContent.add(function(d,e){e.content=c._do_shcode(e.content)});a.onPostProcess.add(function(d,e){if(e.get){e.content=c._get_shcode(e.content)}})},_do_shcode:function(a){return a.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g,function(g,d,k){var j,f,e,h,i;d=d.replace(/\\'|\\'|\\'/g,"'").replace(/\\"|\\"/g,""");k=k.replace(/\\'|\\'/g,"'").replace(/\\"/g,""");j=d.match(/id=['"]([^'"]+)/i);f=d.match(/align=['"]([^'"]+)/i);e=d.match(/width=['"]([0-9]+)/);h=d.match(/caption=['"]([^'"]+)/i);j=(j&&j[1])?j[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";h=(h&&h[1])?h[1]:"";if(!e||!h){return k}i=(f=="aligncenter")?"mceTemp mceIEcenter":"mceTemp";return'<div class="'+i+'"><dl id="'+j+'" class="wp-caption '+f+'" style="width: '+(10+parseInt(e))+'px"><dt class="wp-caption-dt">'+k+'</dt><dd class="wp-caption-dd">'+h+"</dd></dl></div>"})},_get_shcode:function(a){return a.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi,function(g,d,j,h){var i,f,e;i=d.match(/id=['"]([^'"]+)/i);f=d.match(/class=['"]([^'"]+)/i);e=j.match(/width=['"]([0-9]+)/);i=(i&&i[1])?i[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";if(!e||!h){return j}f=f.match(/align[^ '"]+/)||"alignnone";h=h.replace(/<\S[^<>]*>/gi,"").replace(/'/g,"'").replace(/"/g,""");return'[caption id="'+i+'" align="'+f+'" width="'+e+'" caption="'+h+'"]'+j+"[/caption]"})},showButtons:function(d){var j=this,e=tinyMCE.activeEditor,g,f,a,i=tinymce.DOM,c,b,h=e.dom.getAttrib(d,"class");if(h.indexOf("mceItem")!=-1||h.indexOf("wpGallery")!=-1){return}a=e.dom.getViewPort(e.getWin());g=i.getPos(e.getContentAreaContainer());f=e.dom.getPos(d);c=Math.max(f.x-a.x,0)+g.x;b=Math.max(f.y-a.y,0)+g.y;i.setStyles("wp_editbtns",{top:b+5+"px",left:c+5+"px",display:"block"});j.btnsTout=window.setTimeout(function(){e.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 d=this,b=tinyMCE.activeEditor,e=tinymce.DOM,a,c,f;e.remove("wp_editbtns");a=e.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"});c=e.add("wp_editbtns","img",{src:d.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:b.getLang("wpeditimage.edit_img")});c.onmousedown=function(h){var g=tinyMCE.activeEditor;g.windowManager.bookmark=g.selection.getBookmark("simple");g.execCommand("WP_EditImage");this.parentNode.style.display="none"};f=e.add("wp_editbtns","img",{src:d.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:b.getLang("wpeditimage.del_img")});f.onmousedown=function(j){var g=tinyMCE.activeEditor,h=g.selection.getNode(),i;if(h.nodeName=="IMG"&&g.dom.getAttrib(h,"class").indexOf("mceItem")==-1){if((i=g.dom.getParent(h,"div"))&&g.dom.hasClass(i,"mceTemp")){g.dom.remove(i)}else{if((i=g.dom.getParent(h,"A"))&&i.childNodes.length==1){g.dom.remove(i)}else{g.dom.remove(h)}}this.parentNode.style.display="none";g.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)})();
\ No newline at end of file
+(function(){tinymce.create("tinymce.plugins.wpEditImage",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_EditImage",function(){var h=a.selection.getNode(),f=tinymce.DOM.getViewPort(),g=f.h,d=(720<f.w)?720:f.w,e=a.dom.getAttrib(h,"class");if(e.indexOf("mceItem")!=-1||e.indexOf("wpGallery")!=-1||h.nodeName!="IMG"){return}tb_show("",b+"/editimage.html?ver=321&TB_iframe=true");tinymce.DOM.setStyles("TB_window",{width:(d-50)+"px",height:(g-45)+"px","margin-left":"-"+parseInt(((d-50)/2),10)+"px"});if(!tinymce.isIE6){tinymce.DOM.setStyles("TB_window",{top:"20px",marginTop:"0"})}tinymce.DOM.setStyles("TB_iframeContent",{width:(d-50)+"px",height:(g-75)+"px"});tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")});a.onInit.add(function(d){tinymce.dom.Event.add(d.getBody(),"dragstart",function(f){if(!tinymce.isGecko&&f.target.nodeName=="IMG"&&d.dom.getParent(f.target,"dl.wp-caption")){return tinymce.dom.Event.cancel(f)}})});a.onMouseUp.add(function(d,f){if(tinymce.isWebKit||tinymce.isOpera){return}if(d.dom.getParent(f.target,"div.mceTemp")||d.dom.is(f.target,"div.mceTemp")){window.setTimeout(function(){var e=tinyMCE.activeEditor,h=e.selection.getNode(),g=e.dom.getParent(h,"dl.wp-caption");if(g&&h.width!=(parseInt(e.dom.getStyle(g,"width"),10)-10)){e.dom.setStyle(g,"width",parseInt(h.width,10)+10);e.execCommand("mceRepaint")}},100)}});a.onMouseDown.add(function(d,g){var f;if(g.target.nodeName=="IMG"&&d.dom.getAttrib(g.target,"class").indexOf("mceItem")==-1){d.plugins.wordpress._showButtons(g.target,"wp_editbtns");if(tinymce.isGecko&&(f=d.dom.getParent(g.target,"dl.wp-caption"))&&d.dom.hasClass(f.parentNode,"mceTemp")){d.selection.select(f.parentNode)}}});a.onKeyPress.add(function(d,i){var f,h,g;if(i.keyCode==13&&(f=d.dom.getParent(d.selection.getNode(),"DL"))&&d.dom.hasClass(f,"wp-caption")){g=d.dom.create("p",{}," ");if((h=f.parentNode)&&h.nodeName=="DIV"){d.dom.insertAfter(g,h)}else{d.dom.insertAfter(g,f)}if(g.firstChild){d.selection.select(g.firstChild)}else{d.selection.select(g)}tinymce.dom.Event.cancel(i);return false}});a.onBeforeSetContent.add(function(d,e){e.content=c._do_shcode(e.content)});a.onPostProcess.add(function(d,e){if(e.get){e.content=c._get_shcode(e.content)}})},_do_shcode:function(a){return a.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g,function(g,d,k){var j,f,e,h,i;d=d.replace(/\\'|\\'|\\'/g,"'").replace(/\\"|\\"/g,""");k=k.replace(/\\'|\\'/g,"'").replace(/\\"/g,""");j=d.match(/id=['"]([^'"]+)/i);f=d.match(/align=['"]([^'"]+)/i);e=d.match(/width=['"]([0-9]+)/);h=d.match(/caption=['"]([^'"]+)/i);j=(j&&j[1])?j[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";h=(h&&h[1])?h[1]:"";if(!e||!h){return k}i=(f=="aligncenter")?"mceTemp mceIEcenter":"mceTemp";return'<div class="'+i+'" draggable><dl id="'+j+'" class="wp-caption '+f+'" style="width: '+(10+parseInt(e))+'px"><dt class="wp-caption-dt">'+k+'</dt><dd class="wp-caption-dd">'+h+"</dd></dl></div>"})},_get_shcode:function(a){return a.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi,function(g,d,j,h){var i,f,e;i=d.match(/id=['"]([^'"]+)/i);f=d.match(/class=['"]([^'"]+)/i);e=j.match(/width=['"]([0-9]+)/);i=(i&&i[1])?i[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";if(!e||!h){return j}f=f.match(/align[^ '"]+/)||"alignnone";h=h.replace(/<\S[^<>]*>/gi,"").replace(/'/g,"'").replace(/"/g,""");return'[caption id="'+i+'" align="'+f+'" width="'+e+'" caption="'+h+'"]'+j+"[/caption]"})},_createButtons:function(){var b=this,a=tinyMCE.activeEditor,d=tinymce.DOM,e,c;d.remove("wp_editbtns");d.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"});e=d.add("wp_editbtns","img",{src:b.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.edit_img")});tinymce.dom.Event.add(e,"mousedown",function(g){var f=tinyMCE.activeEditor;f.windowManager.bookmark=f.selection.getBookmark("simple");f.execCommand("WP_EditImage")});c=d.add("wp_editbtns","img",{src:b.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.del_img")});tinymce.dom.Event.add(c,"mousedown",function(i){var f=tinyMCE.activeEditor,g=f.selection.getNode(),h;if(g.nodeName=="IMG"&&f.dom.getAttrib(g,"class").indexOf("mceItem")==-1){if((h=f.dom.getParent(g,"div"))&&f.dom.hasClass(h,"mceTemp")){f.dom.remove(h)}else{if((h=f.dom.getParent(g,"A"))&&h.childNodes.length==1){f.dom.remove(h)}else{f.dom.remove(g)}}f.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)})();
\ No newline at end of file
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...');
ed.addCommand('WP_Gallery', function() {
- var el = ed.selection.getNode(), post_id, vp = tinymce.DOM.getViewPort(), H = vp.h - 80, W = ( 640 < vp.w ) ? 640 : vp.w;
+ var el = ed.selection.getNode(), post_id, vp = tinymce.DOM.getViewPort(),
+ H = vp.h - 80, W = ( 640 < vp.w ) ? 640 : vp.w;
if ( el.nodeName != 'IMG' ) return;
if ( ed.dom.getAttrib(el, 'class').indexOf('wpGallery') == -1 ) return;
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.wpgallery.hideButtons();
- });
- });
-
- ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) {
- ed.plugins.wpgallery.hideButtons();
- });
-
- ed.onSaveContent.add(function(ed, o) {
- ed.plugins.wpgallery.hideButtons();
- });
-
- ed.onMouseUp.add(function(ed, e) {
- if ( tinymce.isOpera ) {
- if ( e.target.nodeName == 'IMG' )
- ed.plugins.wpgallery.showButtons(e.target);
- }
-
- });
-
ed.onMouseDown.add(function(ed, e) {
- if ( tinymce.isOpera || e.target.nodeName != 'IMG' ) {
- t.hideButtons();
- return;
- }
- ed.plugins.wpgallery.showButtons(e.target);
+ if ( e.target.nodeName == 'IMG' && ed.dom.hasClass(e.target, 'wpGallery') )
+ ed.plugins.wordpress._showButtons(e.target, 'wp_gallerybtns');
});
ed.onBeforeSetContent.add(function(ed, o) {
});
},
- showButtons : function(n) {
- var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y;
-
- if (ed.dom.getAttrib(n, 'class').indexOf('wpGallery') == -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_gallerybtns', {
- 'top' : Y+5+'px',
- 'left' : X+5+'px',
- 'display' : 'block'
- });
-
- t.btnsTout = window.setTimeout( function(){ed.plugins.wpgallery.hideButtons();}, 5000 );
- },
-
- hideButtons : function() {
- if ( tinymce.DOM.isHidden('wp_gallerybtns') ) return;
-
- tinymce.DOM.hide('wp_gallerybtns');
- window.clearTimeout(this.btnsTout);
- },
-
_createButtons : function() {
- var t = this, ed = tinyMCE.activeEditor, DOM = tinymce.DOM, wp_gallerybtns, wp_editgallery, wp_delgallery;
+ var t = this, ed = tinyMCE.activeEditor, DOM = tinymce.DOM, editButton, dellButton;
DOM.remove('wp_gallerybtns');
- wp_gallerybtns = DOM.add(document.body, 'div', {
+ DOM.add(document.body, 'div', {
id : 'wp_gallerybtns',
style : 'display:none;'
});
- wp_editgallery = DOM.add('wp_gallerybtns', 'img', {
+ editButton = DOM.add('wp_gallerybtns', 'img', {
src : t.url+'/img/edit.png',
id : 'wp_editgallery',
width : '24',
title : ed.getLang('wordpress.editgallery')
});
- wp_editgallery.onmousedown = function(e) {
+ tinymce.dom.Event.add(editButton, 'mousedown', function(e) {
var ed = tinyMCE.activeEditor;
ed.windowManager.bookmark = ed.selection.getBookmark('simple');
ed.execCommand("WP_Gallery");
- this.parentNode.style.display = 'none';
- };
+ });
- wp_delgallery = DOM.add('wp_gallerybtns', 'img', {
+ dellButton = DOM.add('wp_gallerybtns', 'img', {
src : t.url+'/img/delete.png',
id : 'wp_delgallery',
width : '24',
title : ed.getLang('wordpress.delgallery')
});
- wp_delgallery.onmousedown = function(e) {
+ tinymce.dom.Event.add(dellButton, 'mousedown', function(e) {
var ed = tinyMCE.activeEditor, el = ed.selection.getNode();
- if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('wpGallery') != -1 ) {
+ if ( el.nodeName == 'IMG' && ed.dom.hasClass(el, 'wpGallery') ) {
ed.dom.remove(el);
- this.parentNode.style.display = 'none';
ed.execCommand('mceRepaint');
return false;
}
- };
+ });
},
getInfo : function() {
-(function(){tinymce.create("tinymce.plugins.wpGallery",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_Gallery",function(){var h=a.selection.getNode(),f,e=tinymce.DOM.getViewPort(),g=e.h-80,d=(640<e.w)?640:e.w;if(h.nodeName!="IMG"){return}if(a.dom.getAttrib(h,"class").indexOf("wpGallery")==-1){return}f=tinymce.DOM.get("post_ID").value;tb_show("",tinymce.documentBaseURL+"/media-upload.php?post_id="+f+"&tab=gallery&TB_iframe=true&width="+d+"&height="+g);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")});a.onInit.add(function(d){tinymce.dom.Event.add(d.getWin(),"scroll",function(f){d.plugins.wpgallery.hideButtons()})});a.onBeforeExecCommand.add(function(d,f,e,g){d.plugins.wpgallery.hideButtons()});a.onSaveContent.add(function(d,e){d.plugins.wpgallery.hideButtons()});a.onMouseUp.add(function(d,f){if(tinymce.isOpera){if(f.target.nodeName=="IMG"){d.plugins.wpgallery.showButtons(f.target)}}});a.onMouseDown.add(function(d,f){if(tinymce.isOpera||f.target.nodeName!="IMG"){c.hideButtons();return}d.plugins.wpgallery.showButtons(f.target)});a.onBeforeSetContent.add(function(d,e){e.content=c._do_gallery(e.content)});a.onPostProcess.add(function(d,e){if(e.get){e.content=c._get_gallery(e.content)}})},_do_gallery:function(a){return a.replace(/\[gallery([^\]]*)\]/g,function(d,c){return'<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="wpGallery mceItem" title="gallery'+tinymce.DOM.encode(c)+'" />'})},_get_gallery:function(b){function a(c,d){d=new RegExp(d+'="([^"]+)"',"g").exec(c);return d?tinymce.DOM.decode(d[1]):""}return b.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g,function(e,d){var c=a(d,"class");if(c.indexOf("wpGallery")!=-1){return"<p>["+tinymce.trim(a(d,"title"))+"]</p>"}return e})},showButtons:function(d){var i=this,e=tinyMCE.activeEditor,g,f,a,h=tinymce.DOM,c,b;if(e.dom.getAttrib(d,"class").indexOf("wpGallery")==-1){return}a=e.dom.getViewPort(e.getWin());g=h.getPos(e.getContentAreaContainer());f=e.dom.getPos(d);c=Math.max(f.x-a.x,0)+g.x;b=Math.max(f.y-a.y,0)+g.y;h.setStyles("wp_gallerybtns",{top:b+5+"px",left:c+5+"px",display:"block"});i.btnsTout=window.setTimeout(function(){e.plugins.wpgallery.hideButtons()},5000)},hideButtons:function(){if(tinymce.DOM.isHidden("wp_gallerybtns")){return}tinymce.DOM.hide("wp_gallerybtns");window.clearTimeout(this.btnsTout)},_createButtons:function(){var d=this,b=tinyMCE.activeEditor,e=tinymce.DOM,c,f,a;e.remove("wp_gallerybtns");c=e.add(document.body,"div",{id:"wp_gallerybtns",style:"display:none;"});f=e.add("wp_gallerybtns","img",{src:d.url+"/img/edit.png",id:"wp_editgallery",width:"24",height:"24",title:b.getLang("wordpress.editgallery")});f.onmousedown=function(h){var g=tinyMCE.activeEditor;g.windowManager.bookmark=g.selection.getBookmark("simple");g.execCommand("WP_Gallery");this.parentNode.style.display="none"};a=e.add("wp_gallerybtns","img",{src:d.url+"/img/delete.png",id:"wp_delgallery",width:"24",height:"24",title:b.getLang("wordpress.delgallery")});a.onmousedown=function(i){var g=tinyMCE.activeEditor,h=g.selection.getNode();if(h.nodeName=="IMG"&&g.dom.getAttrib(h,"class").indexOf("wpGallery")!=-1){g.dom.remove(h);this.parentNode.style.display="none";g.execCommand("mceRepaint");return false}}},getInfo:function(){return{longname:"Gallery Settings",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpgallery",tinymce.plugins.wpGallery)})();
\ No newline at end of file
+(function(){tinymce.create("tinymce.plugins.wpGallery",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_Gallery",function(){var h=a.selection.getNode(),f,e=tinymce.DOM.getViewPort(),g=e.h-80,d=(640<e.w)?640:e.w;if(h.nodeName!="IMG"){return}if(a.dom.getAttrib(h,"class").indexOf("wpGallery")==-1){return}f=tinymce.DOM.get("post_ID").value;tb_show("",tinymce.documentBaseURL+"/media-upload.php?post_id="+f+"&tab=gallery&TB_iframe=true&width="+d+"&height="+g);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")});a.onMouseDown.add(function(d,f){if(f.target.nodeName=="IMG"&&d.dom.hasClass(f.target,"wpGallery")){d.plugins.wordpress._showButtons(f.target,"wp_gallerybtns")}});a.onBeforeSetContent.add(function(d,e){e.content=c._do_gallery(e.content)});a.onPostProcess.add(function(d,e){if(e.get){e.content=c._get_gallery(e.content)}})},_do_gallery:function(a){return a.replace(/\[gallery([^\]]*)\]/g,function(d,c){return'<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="wpGallery mceItem" title="gallery'+tinymce.DOM.encode(c)+'" />'})},_get_gallery:function(b){function a(c,d){d=new RegExp(d+'="([^"]+)"',"g").exec(c);return d?tinymce.DOM.decode(d[1]):""}return b.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g,function(e,d){var c=a(d,"class");if(c.indexOf("wpGallery")!=-1){return"<p>["+tinymce.trim(a(d,"title"))+"]</p>"}return e})},_createButtons:function(){var b=this,a=tinyMCE.activeEditor,d=tinymce.DOM,e,c;d.remove("wp_gallerybtns");d.add(document.body,"div",{id:"wp_gallerybtns",style:"display:none;"});e=d.add("wp_gallerybtns","img",{src:b.url+"/img/edit.png",id:"wp_editgallery",width:"24",height:"24",title:a.getLang("wordpress.editgallery")});tinymce.dom.Event.add(e,"mousedown",function(g){var f=tinyMCE.activeEditor;f.windowManager.bookmark=f.selection.getBookmark("simple");f.execCommand("WP_Gallery")});c=d.add("wp_gallerybtns","img",{src:b.url+"/img/delete.png",id:"wp_delgallery",width:"24",height:"24",title:a.getLang("wordpress.delgallery")});tinymce.dom.Event.add(c,"mousedown",function(h){var f=tinyMCE.activeEditor,g=f.selection.getNode();if(g.nodeName=="IMG"&&f.dom.hasClass(g,"wpGallery")){f.dom.remove(g);f.execCommand("mceRepaint");return false}})},getInfo:function(){return{longname:"Gallery Settings",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpgallery",tinymce.plugins.wpGallery)})();
\ No newline at end of file
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.about_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3241-1141"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
- <script type="text/javascript" src="js/about.js?ver=3241-1141"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=327-1235"></script>
+ <script type="text/javascript" src="js/about.js?ver=327-1235"></script>
</head>
<body id="about" style="display: none">
<div class="tabs">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.anchor_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3241-1141"></script>
- <script type="text/javascript" src="js/anchor.js?ver=3241-1141"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
+ <script type="text/javascript" src="js/anchor.js?ver=327-1235"></script>
</head>
<body style="display: none">
<form onsubmit="AnchorDialog.update();return false;" action="#">
<head>
<title>{#advanced_dlg.charmap_title}</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3241-1141"></script>
- <script type="text/javascript" src="js/charmap.js?ver=3241-1141"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
+ <script type="text/javascript" src="js/charmap.js?ver=327-1235"></script>
</head>
<body id="charmap" style="display:none">
<table align="center" border="0" cellspacing="0" cellpadding="2">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.colorpicker_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3241-1141"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
- <script type="text/javascript" src="js/color_picker.js?ver=3241-1141"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=327-1235"></script>
+ <script type="text/javascript" src="js/color_picker.js?ver=327-1235"></script>
</head>
<body id="colorpicker" style="display: none">
<form onsubmit="insertAction();return false" action="#">
<fieldset>
<legend>{#advanced_dlg.colorpicker_picker_title}</legend>
<div id="picker">
- <img id="colors" src="img/colorpicker.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" alt=" " />
+ <img id="colors" src="img/colorpicker.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" alt="" />
<div id="light">
<!-- Will be filled with divs -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.image_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3241-1141"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
- <script type="text/javascript" src="js/image.js?ver=3241-1141"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=327-1235"></script>
+ <script type="text/javascript" src="js/image.js?ver=327-1235"></script>
</head>
<body id="image" style="display: none">
<form onsubmit="ImageDialog.update();return false;" action="#">
ed.dom.setAttribs(e, {
href : f.href.value,
title : f.linktitle.value,
- target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null,
- 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null
+ target : f.target_list ? getSelectValue(f, "target_list") : null,
+ 'class' : f.class_list ? getSelectValue(f, "class_list") : null
});
}
});
ed.dom.setAttribs(e, {
href : f.href.value,
title : f.linktitle.value,
- target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null,
- 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null
+ target : f.target_list ? getSelectValue(f, "target_list") : null,
+ 'class' : f.class_list ? getSelectValue(f, "class_list") : null
});
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.link_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3241-1141"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?ver=3241-1141"></script>
- <script type="text/javascript" src="../../utils/form_utils.js?ver=3241-1141"></script>
- <script type="text/javascript" src="../../utils/validate.js?ver=3241-1141"></script>
- <script type="text/javascript" src="js/link.js?ver=3241-1141"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../utils/validate.js?ver=327-1235"></script>
+ <script type="text/javascript" src="js/link.js?ver=327-1235"></script>
</head>
<body id="link" style="display: none">
<form onsubmit="LinkDialog.update();return false;" action="#">
margin: 0;
}
-img.wpGallery {
- border: 1px dotted #cc0000;
- background: #ffffcc url("../../../../plugins/wpgallery/img/gallery.png") no-repeat scroll center center;
- width: 99%;
- height: 250px;
-}
-
body.mceContentBody {
font: 13px/19px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
padding: 0.6em;
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{#advanced_dlg.code_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3241-1141"></script>
- <script type="text/javascript" src="js/source_editor.js?ver=3241-1141"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
+ <script type="text/javascript" src="js/source_editor.js?ver=327-1235"></script>
</head>
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
<form name="source" onsubmit="saveContent();return false;" action="#">
-var tinymce={majorVersion:"3",minorVersion:"2.4.1",releaseDate:"2009-05-25",_init:function(){var o=this,k=document,l=window,j=navigator,b=j.userAgent,h,a,g,f,e,m;o.isOpera=l.opera&&opera.buildNumber;o.isWebKit=/WebKit/.test(b);o.isIE=!o.isWebKit&&!o.isOpera&&(/MSIE/gi).test(b)&&(/Explorer/gi).test(j.appName);o.isIE6=o.isIE&&/MSIE [56]/.test(b);o.isGecko=!o.isWebKit&&/Gecko/.test(b);o.isMac=b.indexOf("Mac")!=-1;o.isAir=/adobeair/i.test(b);if(l.tinyMCEPreInit){o.suffix=tinyMCEPreInit.suffix;o.baseURL=tinyMCEPreInit.base;o.query=tinyMCEPreInit.query;return}o.suffix="";a=k.getElementsByTagName("base");for(h=0;h<a.length;h++){if(m=a[h].href){if(/^https?:\/\/[^\/]+$/.test(m)){m+="/"}f=m?m.match(/.*\//)[0]:""}}function c(d){if(d.src&&/tiny_mce(|_dev|_src|_gzip|_jquery|_prototype).js/.test(d.src)){if(/_(src|dev)\.js/g.test(d.src)){o.suffix="_src"}if((e=d.src.indexOf("?"))!=-1){o.query=d.src.substring(e+1)}o.baseURL=d.src.substring(0,d.src.lastIndexOf("/"));if(f&&o.baseURL.indexOf("://")==-1){o.baseURL=f+o.baseURL}return o.baseURL}return null}a=k.getElementsByTagName("script");for(h=0;h<a.length;h++){if(c(a[h])){return}}g=k.getElementsByTagName("head")[0];if(g){a=g.getElementsByTagName("script");for(h=0;h<a.length;h++){if(c(a[h])){return}}}return},is:function(b,a){var c=typeof(b);if(!a){return c!="undefined"}if(a=="array"&&(b.hasOwnProperty&&b instanceof Array)){return true}return c==a},each:function(d,a,c){var e,b;if(!d){return 0}c=c||d;if(typeof(d.length)!="undefined"){for(e=0,b=d.length;e<b;e++){if(a.call(c,d[e],e,d)===false){return 0}}}else{for(e in d){if(d.hasOwnProperty(e)){if(a.call(c,d[e],e,d)===false){return 0}}}}return 1},map:function(b,c){var d=[];tinymce.each(b,function(a){d.push(c(a))});return d},grep:function(b,c){var d=[];tinymce.each(b,function(a){if(!c||c(a)){d.push(a)}});return d},inArray:function(c,d){var e,b;if(c){for(e=0,b=c.length;e<b;e++){if(c[e]===d){return e}}}return -1},extend:function(f,d){var c,b=arguments;for(c=1;c<b.length;c++){d=b[c];tinymce.each(d,function(a,e){if(typeof(a)!=="undefined"){f[e]=a}})}return f},trim:function(a){return(a?""+a:"").replace(/^\s*|\s*$/g,"")},create:function(j,a){var i=this,b,e,f,g,d,h=0;j=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(j);f=j[3].match(/(^|\.)(\w+)$/i)[2];e=i.createNS(j[3].replace(/\.\w+$/,""));if(e[f]){return}if(j[2]=="static"){e[f]=a;if(this.onCreate){this.onCreate(j[2],j[3],e[f])}return}if(!a[f]){a[f]=function(){};h=1}e[f]=a[f];i.extend(e[f].prototype,a);if(j[5]){b=i.resolve(j[5]).prototype;g=j[5].match(/\.(\w+)$/i)[1];d=e[f];if(h){e[f]=function(){return b[g].apply(this,arguments)}}else{e[f]=function(){this.parent=b[g];return d.apply(this,arguments)}}e[f].prototype[f]=e[f];i.each(b,function(c,k){e[f].prototype[k]=b[k]});i.each(a,function(c,k){if(b[k]){e[f].prototype[k]=function(){this.parent=b[k];return c.apply(this,arguments)}}else{if(k!=f){e[f].prototype[k]=c}}})}i.each(a["static"],function(c,k){e[f][k]=c});if(this.onCreate){this.onCreate(j[2],j[3],e[f].prototype)}},walk:function(c,b,d,a){a=a||this;if(c){if(d){c=c[d]}tinymce.each(c,function(f,e){if(b.call(a,f,e,d)===false){return false}tinymce.walk(f,b,d,a)})}},createNS:function(d,c){var b,a;c=c||window;d=d.split(".");for(b=0;b<d.length;b++){a=d[b];if(!c[a]){c[a]={}}c=c[a]}return c},resolve:function(d,c){var b,a;c=c||window;d=d.split(".");for(b=0,a=d.length;b<a;b++){c=c[d[b]];if(!c){break}}return c},addUnload:function(e,d){var c=this,a=window;e={func:e,scope:d||this};if(!c.unloads){function b(){var f=c.unloads,h,i;if(f){for(i in f){h=f[i];if(h&&h.func){h.func.call(h.scope,1)}}if(a.detachEvent){a.detachEvent("onbeforeunload",g);a.detachEvent("onunload",b)}else{if(a.removeEventListener){a.removeEventListener("unload",b,false)}}c.unloads=h=f=a=b=0;if(window.CollectGarbage){window.CollectGarbage()}}}function g(){var h=document;if(h.readyState=="interactive"){function f(){h.detachEvent("onstop",f);if(b){b()}h=0}if(h){h.attachEvent("onstop",f)}window.setTimeout(function(){if(h){h.detachEvent("onstop",f)}},0)}}if(a.attachEvent){a.attachEvent("onunload",b);a.attachEvent("onbeforeunload",g)}else{if(a.addEventListener){a.addEventListener("unload",b,false)}}c.unloads=[e]}else{c.unloads.push(e)}return e},removeUnload:function(c){var a=this.unloads,b=null;tinymce.each(a,function(e,d){if(e&&e.func==c){a.splice(d,1);b=c;return false}});return b},explode:function(a,b){return a?tinymce.map(a.split(b||","),tinymce.trim):a},_addVer:function(b){var a;if(!this.query){return b}a=(b.indexOf("?")==-1?"?":"&")+this.query;if(b.indexOf("#")==-1){return b+a}return b.replace("#",a+"#")}};window.tinymce=tinymce;tinymce._init();tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(e.indexOf(":/")===-1&&e.indexOf("//")!==0){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,g=[],d;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(h){if(h){g.push(h)}});e=g;for(c=f.length-1,g=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}g.push(f[c])}c=e.length-b;if(c<=0){return"/"+g.reverse().join("/")+d}return"/"+e.slice(0,c).join("/")+"/"+g.reverse().join("/")+d},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c<e.length;c++){a+=(c>0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(c){var e=c.each,b=c.is;var d=c.isWebKit,a=c.isIE;c.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(i,g){var f=this;f.doc=i;f.win=window;f.files={};f.cssFlicker=false;f.counter=0;f.boxModel=!c.isIE||i.compatMode=="CSS1Compat";f.stdMode=i.documentMode===8;f.settings=g=c.extend({keep_values:false,hex_colors:1,process_html:1},g);if(c.isIE6){try{i.execCommand("BackgroundImageCache",false,true)}catch(h){f.cssFlicker=true}}c.addUnload(f.destroy,f)},getRoot:function(){var f=this,g=f.settings;return(g&&f.get(g.root_element))||f.doc.body},getViewPort:function(g){var h,f;g=!g?this.win:g;h=g.document;f=this.boxModel?h.documentElement:h.body;return{x:g.pageXOffset||f.scrollLeft,y:g.pageYOffset||f.scrollTop,w:g.innerWidth||f.clientWidth,h:g.innerHeight||f.clientHeight}},getRect:function(i){var h,f=this,g;i=f.get(i);h=f.getPos(i);g=f.getSize(i);return{x:h.x,y:h.y,w:g.w,h:g.h}},getSize:function(j){var g=this,f,i;j=g.get(j);f=g.getStyle(j,"width");i=g.getStyle(j,"height");if(f.indexOf("px")===-1){f=0}if(i.indexOf("px")===-1){i=0}return{w:parseInt(f)||j.offsetWidth||j.clientWidth,h:parseInt(i)||j.offsetHeight||j.clientHeight}},is:function(g,f){return c.dom.Sizzle.matches(f,g.nodeType?[g]:g).length>0},getParent:function(i,h,g){return this.getParents(i,h,g,false)},getParents:function(p,k,i,m){var h=this,g,j=h.settings,l=[];p=h.get(p);m=m===undefined;if(j.strict_root){i=i||h.getRoot()}if(b(k,"string")){g=k;if(k==="*"){k=function(f){return f.nodeType==1}}else{k=function(f){return h.is(f,g)}}}while(p){if(p==i||!p.nodeType||p.nodeType===9){break}if(!k||k(p)){if(m){l.push(p)}else{return p}}p=p.parentNode}return m?l:null},get:function(f){var g;if(f&&this.doc&&typeof(f)=="string"){g=f;f=this.doc.getElementById(f);if(f&&f.id!==g){return this.doc.getElementsByName(g)[1]}}return f},select:function(h,g){var f=this;return c.dom.Sizzle(h,f.get(g)||f.get(f.settings.root_element)||f.doc,[])},add:function(j,l,f,i,k){var g=this;return this.run(j,function(n){var m,h;m=b(l,"string")?g.doc.createElement(l):l;g.setAttribs(m,f);if(i){if(i.nodeType){m.appendChild(i)}else{g.setHTML(m,i)}}return !k?n.appendChild(m):m})},create:function(i,f,g){return this.add(this.doc.createElement(i),i,f,g,1)},createHTML:function(m,f,j){var l="",i=this,g;l+="<"+m;for(g in f){if(f.hasOwnProperty(g)){l+=" "+g+'="'+i.encode(f[g])+'"'}}if(c.is(j)){return l+">"+j+"</"+m+">"}return l+" />"},remove:function(h,f){var g=this;return this.run(h,function(m){var l,k,j;l=m.parentNode;if(!l){return null}if(f){for(j=m.childNodes.length-1;j>=0;j--){g.insertAfter(m.childNodes[j],m)}}if(g.fixPsuedoLeaks){l=m.cloneNode(true);f="IELeakGarbageBin";k=g.get(f)||g.add(g.doc.body,"div",{id:f,style:"display:none"});k.appendChild(m);k.innerHTML="";return l}return l.removeChild(m)})},setStyle:function(i,f,g){var h=this;return h.run(i,function(l){var k,j;k=l.style;f=f.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(h.pixelStyles.test(f)&&(c.is(g,"number")||/^[\-0-9\.]+$/.test(g))){g+="px"}switch(f){case"opacity":if(a){k.filter=g===""?"":"alpha(opacity="+(g*100)+")";if(!i.currentStyle||!i.currentStyle.hasLayout){k.display="inline-block"}}k[f]=k["-moz-opacity"]=k["-khtml-opacity"]=g||"";break;case"float":a?k.styleFloat=g:k.cssFloat=g;break;default:k[f]=g||""}if(h.settings.update_styles){h.setAttrib(l,"mce_style")}})},getStyle:function(i,f,h){i=this.get(i);if(!i){return false}if(this.doc.defaultView&&h){f=f.replace(/[A-Z]/g,function(j){return"-"+j});try{return this.doc.defaultView.getComputedStyle(i,null).getPropertyValue(f)}catch(g){return null}}f=f.replace(/-(\D)/g,function(k,j){return j.toUpperCase()});if(f=="float"){f=a?"styleFloat":"cssFloat"}if(i.currentStyle&&h){return i.currentStyle[f]}return i.style[f]},setStyles:function(i,j){var g=this,h=g.settings,f;f=h.update_styles;h.update_styles=0;e(j,function(k,l){g.setStyle(i,l,k)});h.update_styles=f;if(h.update_styles){g.setAttrib(i,h.cssText)}},setAttrib:function(h,i,f){var g=this;if(!h||!i){return}if(g.settings.strict){i=i.toLowerCase()}return this.run(h,function(k){var j=g.settings;switch(i){case"style":if(!b(f,"string")){e(f,function(l,m){g.setStyle(k,m,l)});return}if(j.keep_values){if(f&&!g._isRes(f)){k.setAttribute("mce_style",f,2)}else{k.removeAttribute("mce_style",2)}}k.style.cssText=f;break;case"class":k.className=f||"";break;case"src":case"href":if(j.keep_values){if(j.url_converter){f=j.url_converter.call(j.url_converter_scope||g,f,i,k)}g.setAttrib(k,"mce_"+i,f,2)}break;case"shape":k.setAttribute("mce_style",f);break}if(b(f)&&f!==null&&f.length!==0){k.setAttribute(i,""+f,2)}else{k.removeAttribute(i,2)}})},setAttribs:function(g,h){var f=this;return this.run(g,function(i){e(h,function(j,k){f.setAttrib(i,k,j)})})},getAttrib:function(i,j,h){var f,g=this;i=g.get(i);if(!i||i.nodeType!==1){return false}if(!b(h)){h=""}if(/^(src|href|style|coords|shape)$/.test(j)){f=i.getAttribute("mce_"+j);if(f){return f}}if(a&&g.props[j]){f=i[g.props[j]];f=f&&f.nodeValue?f.nodeValue:f}if(!f){f=i.getAttribute(j,2)}if(j==="style"){f=f||i.style.cssText;if(f){f=g.serializeStyle(g.parseStyle(f));if(g.settings.keep_values&&!g._isRes(f)){i.setAttribute("mce_style",f)}}}if(d&&j==="class"&&f){f=f.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(a){switch(j){case"rowspan":case"colspan":if(f===1){f=""}break;case"size":if(f==="+0"||f===20||f===0){f=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(f===0){f=""}break;case"hspace":if(f===-1){f=""}break;case"maxlength":case"tabindex":if(f===32768||f===2147483647||f==="32768"){f=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(f===65535){return j}return h;case"shape":f=f.toLowerCase();break;default:if(j.indexOf("on")===0&&f){f=(""+f).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(f!==undefined&&f!==null&&f!=="")?""+f:h},getPos:function(m,i){var g=this,f=0,l=0,j,k=g.doc,h;m=g.get(m);i=i||k.body;if(m){if(a&&!g.stdMode){m=m.getBoundingClientRect();j=g.boxModel?k.documentElement:k.body;f=g.getStyle(g.select("html")[0],"borderWidth");f=(f=="medium"||g.boxModel&&!g.isIE6)&&2||f;m.top+=g.win.self!=g.win.top?2:0;return{x:m.left+j.scrollLeft-f,y:m.top+j.scrollTop-f}}h=m;while(h&&h!=i&&h.nodeType){f+=h.offsetLeft||0;l+=h.offsetTop||0;h=h.offsetParent}h=m.parentNode;while(h&&h!=i&&h.nodeType){f-=h.scrollLeft||0;l-=h.scrollTop||0;h=h.parentNode}}return{x:f,y:l}},parseStyle:function(h){var i=this,j=i.settings,k={};if(!h){return k}function f(w,q,v){var o,u,m,n;o=k[w+"-top"+q];if(!o){return}u=k[w+"-right"+q];if(o!=u){return}m=k[w+"-bottom"+q];if(u!=m){return}n=k[w+"-left"+q];if(m!=n){return}k[v]=n;delete k[w+"-top"+q];delete k[w+"-right"+q];delete k[w+"-bottom"+q];delete k[w+"-left"+q]}function g(n,m,l,p){var o;o=k[m];if(!o){return}o=k[l];if(!o){return}o=k[p];if(!o){return}k[n]=k[m]+" "+k[l]+" "+k[p];delete k[m];delete k[l];delete k[p]}h=h.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");e(h.split(";"),function(m){var l,n=[];if(m){m=m.replace(/_MCE_SEMI_/g,";");m=m.replace(/url\([^\)]+\)/g,function(o){n.push(o);return"url("+n.length+")"});m=m.split(":");l=c.trim(m[1]);l=l.replace(/url\(([^\)]+)\)/g,function(p,o){return n[parseInt(o)-1]});l=l.replace(/rgb\([^\)]+\)/g,function(o){return i.toHex(o)});if(j.url_converter){l=l.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(o,p){return"url("+j.url_converter.call(j.url_converter_scope||i,i.decode(p),"style",null)+")"})}k[c.trim(m[0]).toLowerCase()]=l}});f("border","","border");f("border","-width","border-width");f("border","-color","border-color");f("border","-style","border-style");f("padding","","padding");f("margin","","margin");g("border","border-width","border-style","border-color");if(a){if(k.border=="medium none"){k.border=""}}return k},serializeStyle:function(g){var f="";e(g,function(i,h){if(h&&i){if(c.isGecko&&h.indexOf("-moz-")===0){return}switch(h){case"color":case"background-color":i=i.toLowerCase();break}f+=(f?" ":"")+h+": "+i+";"}});return f},loadCSS:function(f){var h=this,i=h.doc,g;if(!f){f=""}g=h.select("head")[0];e(f.split(","),function(j){var k;if(h.files[j]){return}h.files[j]=true;k=h.create("link",{rel:"stylesheet",href:c._addVer(j)});if(a&&i.documentMode){k.onload=function(){i.recalc();k.onload=null}}g.appendChild(k)})},addClass:function(f,g){return this.run(f,function(h){var i;if(!g){return 0}if(this.hasClass(h,g)){return h.className}i=this.removeClass(h,g);return h.className=(i!=""?(i+" "):"")+g})},removeClass:function(h,i){var f=this,g;return f.run(h,function(k){var j;if(f.hasClass(k,i)){if(!g){g=new RegExp("(^|\\s+)"+i+"(\\s+|$)","g")}j=k.className.replace(g," ");return k.className=c.trim(j!=" "?j:"")}return k.className})},hasClass:function(g,f){g=this.get(g);if(!g||!f){return false}return(" "+g.className+" ").indexOf(" "+f+" ")!==-1},show:function(f){return this.setStyle(f,"display","block")},hide:function(f){return this.setStyle(f,"display","none")},isHidden:function(f){f=this.get(f);return !f||f.style.display=="none"||this.getStyle(f,"display")=="none"},uniqueId:function(f){return(!f?"mce_":f)+(this.counter++)},setHTML:function(i,g){var f=this;return this.run(i,function(m){var h,k,j,q,l,h;g=f.processHTML(g);if(a){function o(){try{m.innerHTML="<br />"+g;m.removeChild(m.firstChild)}catch(n){while(m.firstChild){m.firstChild.removeNode()}h=f.create("div");h.innerHTML="<br />"+g;e(h.childNodes,function(r,p){if(p){m.appendChild(r)}})}}if(f.settings.fix_ie_paragraphs){g=g.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true"> </p>')}o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("p");for(k=j.length-1,h=0;k>=0;k--){q=j[k];if(!q.hasChildNodes()){if(!q.mce_keep){h=1;break}q.removeAttribute("mce_keep")}}}if(h){g=g.replace(/<p ([^>]+)>|<p>/g,'<div $1 mce_tmp="1">');g=g.replace(/<\/p>/g,"</div>");o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("DIV");for(k=j.length-1;k>=0;k--){q=j[k];if(q.mce_tmp){l=f.doc.createElement("p");q.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(p,n){var r;if(n!=="mce_tmp"){r=q.getAttribute(n);if(!r&&n==="class"){r=q.className}l.setAttribute(n,r)}});for(h=0;h<q.childNodes.length;h++){l.appendChild(q.childNodes[h].cloneNode(true))}q.swapNode(l)}}}}}else{m.innerHTML=g}return g})},processHTML:function(j){var g=this,i=g.settings;if(!i.process_html){return j}if(c.isGecko){j=j.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,"<$1b$2>");j=j.replace(/<(\/?)em>|<em( [^>]+)>/gi,"<$1i$2>")}else{if(a){j=j.replace(/'/g,"'");j=j.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}}j=j.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(i.keep_values){if(/<script|style/.test(j)){function f(h){h=h.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n");h=h.replace(/^[\r\n]*|[\r\n]*$/g,"");h=h.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"");h=h.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"");return h}j=j.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/g,function(h,l,k){if(!l){l=' type="text/javascript"'}l=l.replace(/(type|language)=\"?/,"$&mce-");l=l.replace(/src=\"([^\"]+)\"?/,function(m,n){if(i.url_converter){n=g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(n),"src","script"))}return'mce_src="'+n+'"'});if(c.trim(k)){k="<!--\n"+f(k)+"\n// -->"}return"<mce:script"+l+">"+k+"</mce:script>"});j=j.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/g,function(h,l,k){if(k){k="<!--\n"+f(k)+"\n-->"}return"<mce:style"+l+">"+k+"</mce:style><style "+l+' mce_bogus="1">'+k+"</style>"})}j=j.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->");j=j.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi,function(h,l){function k(o,n,q){var p=q;if(h.indexOf("mce_"+n)!=-1){return o}if(n=="style"){if(g._isRes(q)){return o}if(i.hex_colors){p=p.replace(/rgb\([^\)]+\)/g,function(m){return g.toHex(m)})}if(i.url_converter){p=p.replace(/url\([\'\"]?([^\)\'\"]+)\)/g,function(m,r){return"url("+g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(r),n,l))+")"})}}else{if(n!="coords"&&n!="shape"){if(i.url_converter){p=g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(q),n,l))}}}return" "+n+'="'+q+'" mce_'+n+'="'+p+'"'}h=h.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi,k);h=h.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi,k);return h.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi,k)})}return j},getOuterHTML:function(f){var g;f=this.get(f);if(!f){return null}if(f.outerHTML!==undefined){return f.outerHTML}g=(f.ownerDocument||this.doc).createElement("body");g.appendChild(f.cloneNode(true));return g.innerHTML},setOuterHTML:function(i,g,j){var f=this;return this.run(i,function(h){var l,k;h=f.get(h);j=j||h.ownerDocument||f.doc;if(a&&h.nodeType==1){h.outerHTML=g}else{k=j.createElement("body");k.innerHTML=g;l=k.lastChild;while(l){f.insertAfter(l.cloneNode(true),h);l=l.previousSibling}f.remove(h)}})},decode:function(g){var h,i,f;if(/&[^;]+;/.test(g)){h=this.doc.createElement("div");h.innerHTML=g;i=h.firstChild;f="";if(i){do{f+=i.nodeValue}while(i.nextSibling)}return f||g}return g},encode:function(f){return f?(""+f).replace(/[<>&\"]/g,function(h,g){switch(h){case"&":return"&";case'"':return""";case"<":return"<";case">":return">"}return h}):f},insertAfter:function(h,g){var f=this;g=f.get(g);return this.run(h,function(k){var j,i;j=g.parentNode;i=g.nextSibling;if(i){j.insertBefore(k,i)}else{j.appendChild(k)}return k})},isBlock:function(f){if(f.nodeType&&f.nodeType!==1){return false}f=f.nodeName||f;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TR|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(f)},replace:function(i,h,f){var g=this;if(b(h,"array")){i=i.cloneNode(true)}return g.run(h,function(j){if(f){e(j.childNodes,function(k){i.appendChild(k.cloneNode(true))})}if(g.fixPsuedoLeaks&&j.nodeType===1){j.parentNode.insertBefore(i,j);g.remove(j);return i}return j.parentNode.replaceChild(i,j)})},findCommonAncestor:function(h,f){var i=h,g;while(i){g=f;while(g&&i!=g){g=g.parentNode}if(i==g){break}i=i.parentNode}if(!i&&h.ownerDocument){return h.ownerDocument.documentElement}return i},toHex:function(f){var h=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(f);function g(i){i=parseInt(i).toString(16);return i.length>1?i:"0"+i}if(h){f="#"+g(h[1])+g(h[2])+g(h[3]);return f}return f},getClasses:function(){var l=this,g=[],k,m={},n=l.settings.class_filter,j;if(l.classes){return l.classes}function o(f){e(f.imports,function(i){o(i)});e(f.cssRules||f.rules,function(i){switch(i.type||1){case 1:if(i.selectorText){e(i.selectorText.split(","),function(p){p=p.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(p)||!/\.[\w\-]+$/.test(p)){return}j=p;p=p.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(n&&!(p=n(p,j))){return}if(!m[p]){g.push({"class":p});m[p]=1}})}break;case 3:o(i.styleSheet);break}})}try{e(l.doc.styleSheets,o)}catch(h){}if(g.length>0){l.classes=g}return g},run:function(j,i,h){var g=this,k;if(g.doc&&typeof(j)==="string"){j=g.get(j)}if(!j){return false}h=h||this;if(!j.nodeType&&(j.length||j.length===0)){k=[];e(j,function(l,f){if(l){if(typeof(l)=="string"){l=g.doc.getElementById(l)}k.push(i.call(h,l,f))}});return k}return i.call(h,j)},getAttribs:function(g){var f;g=this.get(g);if(!g){return[]}if(a){f=[];if(g.nodeName=="OBJECT"){return g.attributes}g.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(i,h){f.push({specified:1,nodeName:h})});return f}return g.attributes},destroy:function(g){var f=this;if(f.events){f.events.destroy()}f.win=f.doc=f.root=f.events=null;if(!g){c.removeUnload(f.destroy)}},createRng:function(){var f=this.doc;return f.createRange?f.createRange():new c.dom.Range(this)},split:function(l,k,o){var p=this,f=p.createRng(),m,j,n;function g(r,q){r=r[q];if(r&&r[q]&&r[q].nodeType==1&&i(r[q])){p.remove(r[q])}}function i(q){q=p.getOuterHTML(q);q=q.replace(/<(img|hr|table)/gi,"-");q=q.replace(/<[^>]+>/g,"");return q.replace(/[ \t\r\n]+| | /g,"")==""}function h(r){var q=0;while(r.previousSibling){q++;r=r.previousSibling}return q}if(l&&k){f.setStart(l.parentNode,h(l));f.setEnd(k.parentNode,h(k));m=f.extractContents();f=p.createRng();f.setStart(k.parentNode,h(k)+1);f.setEnd(l.parentNode,h(l)+1);j=f.extractContents();n=l.parentNode;g(m,"lastChild");if(!i(m)){n.insertBefore(m,l)}if(o){n.replaceChild(o,k)}else{n.insertBefore(k,l)}g(j,"firstChild");if(!i(j)){n.insertBefore(j,l)}p.remove(l);return o||k}},bind:function(j,f,i,h){var g=this;if(!g.events){g.events=new c.dom.EventUtils()}return g.events.add(j,f,i,h||this)},unbind:function(i,f,h){var g=this;if(!g.events){g.events=new c.dom.EventUtils()}return g.events.remove(i,f,h)},_isRes:function(f){return/^(top|left|bottom|right|width|height)/i.test(f)||/;\s*(top|left|bottom|right|width|height)/i.test(f)}});c.DOM=new c.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(f){var h=0,c=1,e=2,d=tinymce.extend;function g(m,k){var j,l;if(m.parentNode!=k){return -1}for(l=k.firstChild,j=0;l!=m;l=l.nextSibling){j++}return j}function b(k){var j=0;while(k.previousSibling){j++;k=k.previousSibling}return j}function i(j,k){var l;if(j.nodeType==3){return j}if(k<0){return j}l=j.firstChild;while(l!=null&&k>0){--k;l=l.nextSibling}if(l!=null){return l}return j}function a(k){var j=k.doc;d(this,{dom:k,startContainer:j,startOffset:0,endContainer:j,endOffset:0,collapsed:true,commonAncestorContainer:j,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3})}d(a.prototype,{setStart:function(k,j){this._setEndPoint(true,k,j)},setEnd:function(k,j){this._setEndPoint(false,k,j)},setStartBefore:function(j){this.setStart(j.parentNode,b(j))},setStartAfter:function(j){this.setStart(j.parentNode,b(j)+1)},setEndBefore:function(j){this.setEnd(j.parentNode,b(j))},setEndAfter:function(j){this.setEnd(j.parentNode,b(j)+1)},collapse:function(k){var j=this;if(k){j.endContainer=j.startContainer;j.endOffset=j.startOffset}else{j.startContainer=j.endContainer;j.startOffset=j.endOffset}j.collapsed=true},selectNode:function(j){this.setStartBefore(j);this.setEndAfter(j)},selectNodeContents:function(j){this.setStart(j,0);this.setEnd(j,j.nodeType===1?j.childNodes.length:j.nodeValue.length)},compareBoundaryPoints:function(m,n){var l=this,p=l.startContainer,o=l.startOffset,k=l.endContainer,j=l.endOffset;if(m===0){return l._compareBoundaryPoints(p,o,p,o)}if(m===1){return l._compareBoundaryPoints(p,o,k,j)}if(m===2){return l._compareBoundaryPoints(k,j,k,j)}if(m===3){return l._compareBoundaryPoints(k,j,p,o)}},deleteContents:function(){this._traverse(e)},extractContents:function(){return this._traverse(h)},cloneContents:function(){return this._traverse(c)},insertNode:function(m){var j=this,l,k;if(m.nodeType===3||m.nodeType===4){l=j.startContainer.splitText(j.startOffset);j.startContainer.parentNode.insertBefore(m,l)}else{if(j.startContainer.childNodes.length>0){k=j.startContainer.childNodes[j.startOffset]}j.startContainer.insertBefore(m,k)}},surroundContents:function(l){var j=this,k=j.extractContents();j.insertNode(l);l.appendChild(k);j.selectNode(l)},cloneRange:function(){var j=this;return d(new a(j.dom),{startContainer:j.startContainer,startOffset:j.startOffset,endContainer:j.endContainer,endOffset:j.endOffset,collapsed:j.collapsed,commonAncestorContainer:j.commonAncestorContainer})},_isCollapsed:function(){return(this.startContainer==this.endContainer&&this.startOffset==this.endOffset)},_compareBoundaryPoints:function(m,p,k,o){var q,l,j,r,t,s;if(m==k){if(p==o){return 0}else{if(p<o){return -1}else{return 1}}}q=k;while(q&&q.parentNode!=m){q=q.parentNode}if(q){l=0;j=m.firstChild;while(j!=q&&l<p){l++;j=j.nextSibling}if(p<=l){return -1}else{return 1}}q=m;while(q&&q.parentNode!=k){q=q.parentNode}if(q){l=0;j=k.firstChild;while(j!=q&&l<o){l++;j=j.nextSibling}if(l<o){return -1}else{return 1}}r=this.dom.findCommonAncestor(m,k);t=m;while(t&&t.parentNode!=r){t=t.parentNode}if(!t){t=r}s=k;while(s&&s.parentNode!=r){s=s.parentNode}if(!s){s=r}if(t==s){return 0}j=r.firstChild;while(j){if(j==t){return -1}if(j==s){return 1}j=j.nextSibling}},_setEndPoint:function(k,q,p){var l=this,j,m;if(k){l.startContainer=q;l.startOffset=p}else{l.endContainer=q;l.endOffset=p}j=l.endContainer;while(j.parentNode){j=j.parentNode}m=l.startContainer;while(m.parentNode){m=m.parentNode}if(m!=j){l.collapse(k)}else{if(l._compareBoundaryPoints(l.startContainer,l.startOffset,l.endContainer,l.endOffset)>0){l.collapse(k)}}l.collapsed=l._isCollapsed();l.commonAncestorContainer=l.dom.findCommonAncestor(l.startContainer,l.endContainer)},_traverse:function(r){var s=this,q,m=0,v=0,k,o,l,n,j,u;if(s.startContainer==s.endContainer){return s._traverseSameContainer(r)}for(q=s.endContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.startContainer){return s._traverseCommonStartContainer(q,r)}++m}for(q=s.startContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.endContainer){return s._traverseCommonEndContainer(q,r)}++v}o=v-m;l=s.startContainer;while(o>0){l=l.parentNode;o--}n=s.endContainer;while(o<0){n=n.parentNode;o++}for(j=l.parentNode,u=n.parentNode;j!=u;j=j.parentNode,u=u.parentNode){l=j;n=u}return s._traverseCommonAncestors(l,n,r)},_traverseSameContainer:function(o){var r=this,q,u,j,k,l,p,m;if(o!=e){q=r.dom.doc.createDocumentFragment()}if(r.startOffset==r.endOffset){return q}if(r.startContainer.nodeType==3){u=r.startContainer.nodeValue;j=u.substring(r.startOffset,r.endOffset);if(o!=c){r.startContainer.deleteData(r.startOffset,r.endOffset-r.startOffset);r.collapse(true)}if(o==e){return null}q.appendChild(r.dom.doc.createTextNode(j));return q}k=i(r.startContainer,r.startOffset);l=r.endOffset-r.startOffset;while(l>0){p=k.nextSibling;m=r._traverseFullySelected(k,o);if(q){q.appendChild(m)}--l;k=p}if(o!=c){r.collapse(true)}return q},_traverseCommonStartContainer:function(j,p){var s=this,r,k,l,m,q,o;if(p!=e){r=s.dom.doc.createDocumentFragment()}k=s._traverseRightBoundary(j,p);if(r){r.appendChild(k)}l=g(j,s.startContainer);m=l-s.startOffset;if(m<=0){if(p!=c){s.setEndBefore(j);s.collapse(false)}return r}k=j.previousSibling;while(m>0){q=k.previousSibling;o=s._traverseFullySelected(k,p);if(r){r.insertBefore(o,r.firstChild)}--m;k=q}if(p!=c){s.setEndBefore(j);s.collapse(false)}return r},_traverseCommonEndContainer:function(m,p){var s=this,r,o,j,k,q,l;if(p!=e){r=s.dom.doc.createDocumentFragment()}j=s._traverseLeftBoundary(m,p);if(r){r.appendChild(j)}o=g(m,s.endContainer);++o;k=s.endOffset-o;j=m.nextSibling;while(k>0){q=j.nextSibling;l=s._traverseFullySelected(j,p);if(r){r.appendChild(l)}--k;j=q}if(p!=c){s.setStartAfter(m);s.collapse(true)}return r},_traverseCommonAncestors:function(p,j,s){var w=this,l,v,o,q,r,k,u,m;if(s!=e){v=w.dom.doc.createDocumentFragment()}l=w._traverseLeftBoundary(p,s);if(v){v.appendChild(l)}o=p.parentNode;q=g(p,o);r=g(j,o);++q;k=r-q;u=p.nextSibling;while(k>0){m=u.nextSibling;l=w._traverseFullySelected(u,s);if(v){v.appendChild(l)}u=m;--k}l=w._traverseRightBoundary(j,s);if(v){v.appendChild(l)}if(s!=c){w.setStartAfter(p);w.collapse(true)}return v},_traverseRightBoundary:function(p,q){var s=this,l=i(s.endContainer,s.endOffset-1),r,o,n,j,k;var m=l!=s.endContainer;if(l==p){return s._traverseNode(l,m,false,q)}r=l.parentNode;o=s._traverseNode(r,false,false,q);while(r!=null){while(l!=null){n=l.previousSibling;j=s._traverseNode(l,m,false,q);if(q!=e){o.insertBefore(j,o.firstChild)}m=true;l=n}if(r==p){return o}l=r.previousSibling;r=r.parentNode;k=s._traverseNode(r,false,false,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseLeftBoundary:function(p,q){var s=this,m=i(s.startContainer,s.startOffset);var n=m!=s.startContainer,r,o,l,j,k;if(m==p){return s._traverseNode(m,n,true,q)}r=m.parentNode;o=s._traverseNode(r,false,true,q);while(r!=null){while(m!=null){l=m.nextSibling;j=s._traverseNode(m,n,true,q);if(q!=e){o.appendChild(j)}n=true;m=l}if(r==p){return o}m=r.nextSibling;r=r.parentNode;k=s._traverseNode(r,false,true,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseNode:function(j,o,r,s){var u=this,m,l,p,k,q;if(o){return u._traverseFullySelected(j,s)}if(j.nodeType==3){m=j.nodeValue;if(r){k=u.startOffset;l=m.substring(k);p=m.substring(0,k)}else{k=u.endOffset;l=m.substring(0,k);p=m.substring(k)}if(s!=c){j.nodeValue=p}if(s==e){return null}q=j.cloneNode(false);q.nodeValue=l;return q}if(s==e){return null}return j.cloneNode(false)},_traverseFullySelected:function(l,k){var j=this;if(k!=e){return k==c?l.cloneNode(true):l}l.parentNode.removeChild(l);return null}});f.Range=a})(tinymce.dom);(function(){function a(e){var d=this,h="\uFEFF",b,g;function c(j,i){if(j&&i){if(j.item&&i.item&&j.item(0)===i.item(0)){return 1}if(j.isEqual&&i.isEqual&&i.isEqual(j)){return 1}}return 0}function f(){var m=e.dom,j=e.getRng(),s=m.createRng(),p,k,n,q,o,l;function i(v){var t=v.parentNode.childNodes,u;for(u=t.length-1;u>=0;u--){if(t[u]==v){return u}}return -1}function r(v){var t=j.duplicate(),B,y,u,w,x=0,z=0,A,C;t.collapse(v);B=t.parentElement();t.pasteHTML(h);u=B.childNodes;for(y=0;y<u.length;y++){w=u[y];if(y>0&&(w.nodeType!==3||u[y-1].nodeType!==3)){z++}if(w.nodeType===3){A=w.nodeValue.indexOf(h);if(A!==-1){x+=A;break}x+=w.nodeValue.length}else{x=0}}t.moveStart("character",-1);t.text="";return{index:z,offset:x,parent:B}}n=j.item?j.item(0):j.parentElement();if(n.ownerDocument!=m.doc){return s}if(j.item||!n.hasChildNodes()){s.setStart(n.parentNode,i(n));s.setEnd(s.startContainer,s.startOffset+1);return s}l=e.isCollapsed();p=r(true);k=r(false);p.parent.normalize();k.parent.normalize();q=p.parent.childNodes[Math.min(p.index,p.parent.childNodes.length-1)];if(q.nodeType!=3){s.setStart(p.parent,p.index)}else{s.setStart(p.parent.childNodes[p.index],p.offset)}o=k.parent.childNodes[Math.min(k.index,k.parent.childNodes.length-1)];if(o.nodeType!=3){if(!l){k.index++}s.setEnd(k.parent,k.index)}else{s.setEnd(k.parent.childNodes[k.index],k.offset)}if(!l){q=s.startContainer;if(q.nodeType==1){s.setStart(q,Math.min(s.startOffset,q.childNodes.length))}o=s.endContainer;if(o.nodeType==1){s.setEnd(o,Math.min(s.endOffset,o.childNodes.length))}}d.addRange(s);return s}this.addRange=function(j){var o,m=e.dom.doc.body,p,k,q,l,n,i;q=j.startContainer;l=j.startOffset;n=j.endContainer;i=j.endOffset;o=m.createTextRange();q=q.nodeType==1?q.childNodes[Math.min(l,q.childNodes.length-1)]:q;n=n.nodeType==1?n.childNodes[Math.min(l==i?i:i-1,n.childNodes.length-1)]:n;if(q==n&&q.nodeType==1){if(/^(IMG|TABLE)$/.test(q.nodeName)&&l!=i){o=m.createControlRange();o.addElement(q)}else{o=m.createTextRange();if(!q.hasChildNodes()&&q.canHaveHTML){q.innerHTML=h}o.moveToElementText(q);if(q.innerHTML==h){o.collapse(true);q.removeChild(q.firstChild)}}if(l==i){o.collapse(i<=j.endContainer.childNodes.length-1)}o.select();return}function r(t,v){var u,s,w;if(t.nodeType!=3){return -1}u=t.nodeValue;s=m.createTextRange();t.nodeValue=u.substring(0,v)+h+u.substring(v);s.moveToElementText(t.parentNode);s.findText(h);w=Math.abs(s.moveStart("character",-1048575));t.nodeValue=u;return w}if(j.collapsed){pos=r(q,l);o=m.createTextRange();o.move("character",pos);o.select();return}else{if(q==n&&q.nodeType==3){p=r(q,l);o.move("character",p);o.moveEnd("character",i-l);o.select();return}p=r(q,l);k=r(n,i);o=m.createTextRange();if(p==-1){o.moveToElementText(q);p=0}else{o.move("character",p)}tmpRng=m.createTextRange();if(k==-1){tmpRng.moveToElementText(n)}else{tmpRng.move("character",k)}o.setEndPoint("EndToEnd",tmpRng);o.select();return}};this.getRangeAt=function(){if(!b||!c(g,e.getRng())){b=f();g=e.getRng()}return b};this.destroy=function(){g=b=null}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,i=0,d=Object.prototype.toString,n=false;var b=function(D,t,A,v){A=A||[];var e=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!D||typeof D!=="string"){return A}var B=[],C,y,G,F,z,s,r=true,w=o(t);p.lastIndex=0;while((C=p.exec(D))!==null){B.push(C[1]);if(C[2]){s=RegExp.rightContext;break}}if(B.length>1&&j.exec(D)){if(B.length===2&&f.relative[B[0]]){y=g(B[0]+B[1],t)}else{y=f.relative[B[0]]?[t]:b(B.shift(),t);while(B.length){D=B.shift();if(f.relative[D]){D+=B.shift()}y=g(D,y)}}}else{if(!v&&B.length>1&&t.nodeType===9&&!w&&f.match.ID.test(B[0])&&!f.match.ID.test(B[B.length-1])){var H=b.find(B.shift(),t,w);t=H.expr?b.filter(H.expr,H.set)[0]:H.set[0]}if(t){var H=v?{expr:B.pop(),set:a(v)}:b.find(B.pop(),B.length===1&&(B[0]==="~"||B[0]==="+")&&t.parentNode?t.parentNode:t,w);y=H.expr?b.filter(H.expr,H.set):H.set;if(B.length>0){G=a(y)}else{r=false}while(B.length){var u=B.pop(),x=u;if(!f.relative[u]){u=""}else{x=B.pop()}if(x==null){x=t}f.relative[u](G,x,w)}}else{G=B=[]}}if(!G){G=y}if(!G){throw"Syntax error, unrecognized expression: "+(u||D)}if(d.call(G)==="[object Array]"){if(!r){A.push.apply(A,G)}else{if(t&&t.nodeType===1){for(var E=0;G[E]!=null;E++){if(G[E]&&(G[E]===true||G[E].nodeType===1&&h(t,G[E]))){A.push(y[E])}}}else{for(var E=0;G[E]!=null;E++){if(G[E]&&G[E].nodeType===1){A.push(y[E])}}}}}else{a(G,A)}if(s){b(s,e,A,v);b.uniqueSort(A)}return A};b.uniqueSort=function(r){if(c){n=false;r.sort(c);if(n){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(x,e,y){var w,u;if(!x){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.match[v].exec(x))){var r=RegExp.leftContext;if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");w=f.find[v](u,e,y);if(w!=null){x=x.replace(f.match[v],"");break}}}}if(!w){w=e.getElementsByTagName("*")}return{set:w,expr:x}};b.filter=function(A,z,D,t){var s=A,F=[],x=z,v,e,w=z&&z[0]&&o(z[0]);while(A&&z.length){for(var y in f.filter){if((v=f.match[y].exec(A))!=null){var r=f.filter[y],E,C;e=false;if(x==F){F=[]}if(f.preFilter[y]){v=f.preFilter[y](v,x,D,F,t,w);if(!v){e=E=true}else{if(v===true){continue}}}if(v){for(var u=0;(C=x[u])!=null;u++){if(C){E=r(C,v,u,x);var B=t^!!E;if(D&&E!=null){if(B){e=true}else{x[u]=false}}else{if(B){F.push(C);e=true}}}}}if(E!==undefined){if(!D){x=F}A=A.replace(f.match[y],"");if(!e){return[]}break}}}if(A==s){if(e==null){throw"Syntax error, unrecognized expression: "+A}else{break}}s=A}return x};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(x,e,w){var u=typeof e==="string",y=u&&!/\W/.test(e),v=u&&!y;if(y&&!w){e=e.toUpperCase()}for(var t=0,s=x.length,r;t<s;t++){if((r=x[t])){while((r=r.previousSibling)&&r.nodeType!==1){}x[t]=v||r&&r.nodeName===e?r||false:r===e}}if(v){b.filter(e,x,true)}},">":function(w,r,x){var u=typeof r==="string";if(u&&!/\W/.test(r)){r=x?r:r.toUpperCase();for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){var t=v.parentNode;w[s]=t.nodeName===r?t:false}}}else{for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){w[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,w,true)}}},"":function(t,r,v){var s=i++,e=q;if(!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=i++,e=q;if(typeof r==="string"&&!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v,w){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,w,x){t=" "+t[1].replace(/\\/g,"")+" ";if(x){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(w^(v.className&&(" "+v.className+" ").indexOf(t)>=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){for(var s=0;e[s]===false;s++){}return e[s]&&o(e[s])?r[1]:r[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=i++;return e},ATTR:function(u,r,s,e,v,w){var t=u[1].replace(/\\/g,"");if(!w&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if(u[3].match(p).length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return r<e[3]-0},gt:function(s,r,e){return r>e[3]-0},nth:function(s,r,e){return e[3]-0==r},eq:function(s,r,e){return e[3]-0==r}},filter:{PSEUDO:function(w,s,t,x){var r=s[1],u=f.filters[r];if(u){return u(w,t,s,x)}else{if(r==="contains"){return(w.textContent||w.innerText||"").indexOf(s[3])>=0}else{if(r==="not"){var v=s[3];for(var t=0,e=v.length;t<e;t++){if(v[t]===w){return false}}return true}}}},CHILD:function(e,t){var w=t[1],r=e;switch(w){case"only":case"first":while(r=r.previousSibling){if(r.nodeType===1){return false}}if(w=="first"){return true}r=e;case"last":while(r=r.nextSibling){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],z=t[3];if(s==1&&z==0){return true}var v=t[0],y=e.parentNode;if(y&&(y.sizcache!==v||!e.nodeIndex)){var u=0;for(r=y.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}y.sizcache=v}var x=e.nodeIndex-z;if(s==0){return x==0}else{return(x%s==0&&x/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),w=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?w===r:u==="*="?w.indexOf(r)>=0:u==="~="?(" "+w+" ").indexOf(r)>=0:!r?w&&e!==false:u==="!="?w!=r:u==="^="?w.indexOf(r)===0:u==="$="?w.substr(w.length-r.length)===r:u==="|="?w===r||w.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var j=f.match.POS;for(var l in f.match){f.match[l]=new RegExp(f.match[l].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var a=function(r,e){r=Array.prototype.slice.call(r);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(k){a=function(u,t){var r=t||[];if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var s=0,e=u.length;s<e;s++){r.push(u[s])}}else{for(var s=0;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){n=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){var s=r.sourceIndex-e.sourceIndex;if(s===0){n=true}return s}}else{if(document.createRange){c=function(t,r){var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.setStart(t,0);s.setEnd(t,0);e.setStart(r,0);e.setEnd(r,0);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){n=true}return u}}}}(function(){var r=document.createElement("div"),s="script"+(new Date).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(!!document.getElementById(s)){f.find.ID=function(u,v,w){if(typeof v.getElementById!=="undefined"&&!w){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(w,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!o(v)){try{return a(v.querySelectorAll(w),t)}catch(x){}}return e(w,v,t,u)};for(var r in e){b[r]=e[r]}})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}}})()}function m(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1&&!z){e.sizcache=v;e.sizset=t}if(e.nodeName===w){u=e;break}e=e[r]}A[t]=u}}}function q(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1){if(!z){e.sizcache=v;e.sizset=t}if(typeof w!=="string"){if(e===w){u=true;break}}else{if(b.filter(w,[e]).length>0){u=e;break}}}e=e[r]}A[t]=u}}}var h=document.compareDocumentPosition?function(r,e){return r.compareDocumentPosition(e)&16}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};var o=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,x){var t=[],u="",v,s=x.nodeType?[x]:x;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var w=0,r=s.length;w<r;w++){b(e,s[w],t)}return b.filter(u,t)};window.tinymce.dom.Sizzle=b})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}if(!n.preventDefault){n.preventDefault=function(){n.returnValue=false}}if(!n.stopPropagation){n.stopPropagation=function(){n.cancelBubble=true}}}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){var b=a.each;a.create("tinymce.dom.Element",{Element:function(g,e){var c=this,f,d;e=e||{};c.id=g;c.dom=f=e.dom||a.DOM;c.settings=e;if(!a.isIE){d=c.dom.get(c.id)}b(["getPos","getRect","getParent","add","setStyle","getStyle","setStyles","setAttrib","setAttribs","getAttrib","addClass","removeClass","hasClass","getOuterHTML","setOuterHTML","remove","show","hide","isHidden","setHTML","get"],function(h){c[h]=function(){var j=[g],k;for(k=0;k<arguments.length;k++){j.push(arguments[k])}j=f[h].apply(f,j);c.update(h);return j}})},on:function(e,d,c){return a.dom.Event.add(this.id,e,d,c)},getXY:function(){return{x:parseInt(this.getStyle("left")),y:parseInt(this.getStyle("top"))}},getSize:function(){var c=this.dom.get(this.id);return{w:parseInt(this.getStyle("width")||c.clientWidth),h:parseInt(this.getStyle("height")||c.clientHeight)}},moveTo:function(c,d){this.setStyles({left:c,top:d})},moveBy:function(c,e){var d=this.getXY();this.moveTo(d.x+c,d.y+e)},resizeTo:function(c,d){this.setStyles({width:c,height:d})},resizeBy:function(c,e){var d=this.getSize();this.resizeTo(d.w+c,d.h+e)},update:function(d){var e=this,c,f=e.dom;if(a.isIE6&&e.settings.blocker){d=d||"";if(d.indexOf("get")===0||d.indexOf("has")===0||d.indexOf("is")===0){return}if(d=="remove"){f.remove(e.blocker);return}if(!e.blocker){e.blocker=f.uniqueId();c=f.add(e.settings.container||f.getRoot(),"iframe",{id:e.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});f.setStyle(c,"opacity",0)}else{c=f.get(e.blocker)}f.setStyle(c,"left",e.getStyle("left",1));f.setStyle(c,"top",e.getStyle("top",1));f.setStyle(c,"width",e.getStyle("width",1));f.setStyle(c,"height",e.getStyle("height",1));f.setStyle(c,"display",e.getStyle("display",1));f.setStyle(c,"zIndex",parseInt(e.getStyle("zIndex",1)||0)-1)}}})})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(i,g){var f=this,j=f.getRng(),l,k=f.win.document;g=g||{format:"html"};g.set=true;i=g.content=f.dom.processHTML(i);f.onBeforeSetContent.dispatch(f,g);i=g.content;if(j.insertNode){i+='<span id="__caret">_</span>';j.deleteContents();j.insertNode(f.getRng().createContextualFragment(i));l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndAfter(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(1);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.firstChild}return h}else{h=g.startContainer;if(h.nodeName=="BODY"){return h.firstChild}return f.dom.getParent(h,"*")}},getEnd:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(0);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.lastChild}return h}else{h=g.endContainer;if(h.nodeName=="BODY"){return h.lastChild}return f.dom.getParent(h,"*")}},getBookmark:function(x){var j=this,m=j.getRng(),f,n,l,u=j.dom.getViewPort(j.win),v,p,z,o,w=-16777215,k,h=j.dom.getRoot(),g=0,i=0,y;n=u.x;l=u.y;if(x=="simple"){return{rng:m,scrollX:n,scrollY:l}}if(a){if(m.item){v=m.item(0);d(j.dom.select(v.nodeName),function(s,r){if(v==s){p=r;return false}});return{tag:v.nodeName,index:p,scrollX:n,scrollY:l}}f=j.dom.doc.body.createTextRange();f.moveToElementText(h);f.collapse(true);z=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(true);p=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(false);o=Math.abs(f.move("character",w))-p;return{start:p-z,length:o,scrollX:n,scrollY:l}}v=j.getNode();k=j.getSel();if(!k){return null}if(v&&v.nodeName=="IMG"){return{scrollX:n,scrollY:l}}function q(A,D,t){var s=j.dom.doc.createTreeWalker(A,NodeFilter.SHOW_TEXT,null,false),E,B=0,C={};while((E=s.nextNode())!=null){if(E==D){C.start=B}if(E==t){C.end=B;return C}B+=e(E.nodeValue||"").length}return null}if(k.anchorNode==k.focusNode&&k.anchorOffset==k.focusOffset){v=q(h,k.anchorNode,k.focusNode);if(!v){return{scrollX:n,scrollY:l}}e(k.anchorNode.nodeValue||"").replace(/^\s+/,function(r){g=r.length});return{start:Math.max(v.start+k.anchorOffset-g,0),end:Math.max(v.end+k.focusOffset-g,0),scrollX:n,scrollY:l,beg:k.anchorOffset-g==0}}else{v=q(h,m.startContainer,m.endContainer);if(!v){return{scrollX:n,scrollY:l}}return{start:Math.max(v.start+m.startOffset-g,0),end:Math.max(v.end+m.endOffset-i,0),scrollX:n,scrollY:l,beg:m.startOffset-g==0}}},moveToBookmark:function(n){var o=this,g=o.getRng(),p=o.getSel(),j=o.dom.getRoot(),m,h,k;function i(q,t,D){var B=o.dom.doc.createTreeWalker(q,NodeFilter.SHOW_TEXT,null,false),x,s=0,A={},u,C,z,y;while((x=B.nextNode())!=null){z=y=0;k=x.nodeValue||"";h=e(k).length;s+=h;if(s>=t&&!A.startNode){u=t-(s-h);if(n.beg&&u>=h){continue}A.startNode=x;A.startOffset=u+y}if(s>=D){A.endNode=x;A.endOffset=D-(s-h)+y;return A}}return null}if(!n){return false}o.win.scrollTo(n.scrollX,n.scrollY);if(a){if(g=n.rng){try{g.select()}catch(l){}return true}o.win.focus();if(n.tag){g=j.createControlRange();d(o.dom.select(n.tag),function(r,q){if(q==n.index){g.addElement(r)}})}else{try{if(n.start<0){return true}g=p.createRange();g.moveToElementText(j);g.collapse(true);g.moveStart("character",n.start);g.moveEnd("character",n.length)}catch(f){return true}}try{g.select()}catch(l){}return true}if(!p){return false}if(n.rng){p.removeAllRanges();p.addRange(n.rng)}else{if(b(n.start)&&b(n.end)){try{m=i(j,n.start,n.end);if(m){g=o.dom.doc.createRange();g.setStart(m.startNode,m.startOffset);g.setEnd(m.endNode,m.endOffset);p.removeAllRanges();p.addRange(g)}if(!c.isOpera){o.win.focus()}}catch(l){}}}},select:function(g,l){var p=this,f=p.getRng(),q=p.getSel(),o,m,k,j=p.win.document;function h(u,t){var s,r;if(u){s=j.createTreeWalker(u,NodeFilter.SHOW_TEXT,null,false);while(u=s.nextNode()){r=u;if(c.trim(u.nodeValue).length!=0){if(t){return u}else{r=u}}}}return r}if(a){try{o=j.body;if(/^(IMG|TABLE)$/.test(g.nodeName)){f=o.createControlRange();f.addElement(g)}else{f=o.createTextRange();f.moveToElementText(g)}f.select()}catch(i){}}else{if(l){m=h(g,1)||p.dom.select("br:first",g)[0];k=h(g,0)||p.dom.select("br:last",g)[0];if(m&&k){f=j.createRange();if(m.nodeName=="BR"){f.setStartBefore(m)}else{f.setStart(m,0)}if(k.nodeName=="BR"){f.setEndBefore(k)}else{f.setEnd(k,k.nodeValue.length)}}else{f.selectNode(g)}}else{f.selectNode(g)}p.setRng(f)}return g},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}return !g||h.boundingWidth==0||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i){i=a?g.win.document.body.createTextRange():g.win.document.createRange()}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){h.removeAllRanges();h.addRange(i)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var f=this,h=f.getRng(),g=f.getSel(),i;if(!a){if(!h){return f.dom.getRoot()}i=h.commonAncestorContainer;if(!h.collapsed){if(c.isWebKit&&g.anchorNode&&g.anchorNode.nodeType==1){return g.anchorNode.childNodes[g.anchorOffset]}if(h.startContainer==h.endContainer){if(h.startOffset-h.endOffset<2){if(h.startContainer.hasChildNodes()){i=h.startContainer.childNodes[h.startOffset]}}}}return f.dom.getParent(i,"*")}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,">")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+b+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("<![CDATA["+b+"]]>");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("<!-- "+b+"-->");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"<";case">":return">";case"&":return"&";case'"':return"""}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",bool_attrs:/(checked|disabled|readonly|selected|nowrap)/,valid_elements:"*[*]",extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^<br \/>\s*<\//.test(n)){return"</"+o+">"}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,y,w=["ol","ul"],u,t,q,k=/^(OL|UL)$/,z;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p<o.length;p++){if(r.nodeName==o[p]){return r}}}return null}for(y=0;y<w.length;y++){l=i.dom.select(w[y],s.node);for(u=0;u<l.length;u++){t=l[u];q=t.parentNode;if(k.test(q.nodeName)){z=m(t,"LI");if(!z){z=i.dom.create("li");z.innerHTML=" ";z.appendChild(t);q.insertBefore(z,q.firstChild)}else{z.appendChild(t)}}}}})}if(j.fix_table_elements){i.onPreProcess.add(function(k,l){f(i.dom.select("p table",l.node),function(m){i.dom.split(i.dom.getParent(m,"p"),m)})})}},setEntities:function(p){var n=this,j,m,h={},o="",k;if(n.entityLookup){return}j=p.split(",");for(m=0;m<j.length;m+=2){k=j[m];if(k==34||k==38||k==60||k==62){continue}h[String.fromCharCode(j[m])]=j[m+1];k=parseInt(j[m]).toString(16);o+="\\u"+"0000".substring(k.length)+k}if(!o){n.settings.entity_encoding="raw";return}n.entitiesRE=new RegExp("["+o+"]","g");n.entityLookup=h},setValidChildRules:function(h){this.childRules=null;this.addValidChildRules(h)},addValidChildRules:function(k){var j=this,l,h,i;if(!k){return}l="A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment";h="A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment";i="H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP";f(k.split(","),function(n){var o=n.split(/\[|\]/),m;n="";f(o[1].split("|"),function(p){if(n){n+="|"}switch(p){case"%itrans":p=h;break;case"%itrans_na":p=h.substring(2);break;case"%istrict":p=l;break;case"%istrict_na":p=l.substring(2);break;case"%btrans":p=i;break;case"%bstrict":p=i;break}n+=p});m=new RegExp("^("+n.toLowerCase()+")$","i");f(o[0].split("/"),function(p){j.childRules=j.childRules||{};j.childRules[p]=m})});k="";f(j.childRules,function(n,m){if(k){k+="|"}k+=m});j.parentElementsRE=new RegExp("^("+k.toLowerCase()+")$","i")},setRules:function(i){var h=this;h._setup();h.rules={};h.wildRules=[];h.validElements={};return h.addRules(i)},addRules:function(i){var h=this,j;if(!i){return}h._setup();f(i.split(","),function(m){var q=m.split(/\[|\]/),l=q[0].split("/"),r,k,o,n=[];if(j){k=e.extend([],j.attribs)}if(q.length>1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t<k.length;t++){if(k[t].name==u[2]){k.splice(t,1);return}}}switch(u[3]){case"=":p.defaultVal=u[4]||"";break;case":":p.forcedVal=u[4];break;case"<":p.validVals=u[4].split("?");break}if(/[*.?]/.test(u[2])){o=o||[];p.nameRE=new RegExp("^"+c(u[2])+"$");o.push(p)}else{p.name=u[2];k.push(p)}n.push(u[2])})}f(l,function(v,u){var w=v.charAt(0),t=1,p={};if(j){if(j.noEmpty){p.noEmpty=j.noEmpty}if(j.fullEnd){p.fullEnd=j.fullEnd}if(j.padd){p.padd=j.padd}}switch(w){case"-":p.noEmpty=true;break;case"+":p.fullEnd=true;break;case"#":p.padd=true;break;default:t=0}l[u]=v=v.substring(t);h.validElements[v]=1;if(/[*.?]/.test(l[0])){p.nameRE=new RegExp("^"+c(l[0])+"$");h.wildRules=h.wildRules||{};h.wildRules.push(p)}else{p.name=l[0];if(l[0]=="@"){j=p}h.rules[v]=p}p.attribs=k;if(r){p.requiredAttribs=r}if(o){v="";f(n,function(s){if(v){v+="|"}v+="("+c(s)+")"});p.validAttribsRE=new RegExp("^"+v.toLowerCase()+"$");p.wildAttribs=o}})});i="";f(h.validElements,function(m,l){if(i){i+="|"}if(l!="@"){i+=l}});h.validElementsRE=new RegExp("^("+c(i.toLowerCase())+")$")},findRule:function(m){var j=this,l=j.rules,h,k;j._setup();k=l[m];if(k){return k}l=j.wildRules;for(h=0;h<l.length;h++){if(l[h].nameRE.test(m)){return l[h]}}return null},findAttribRule:function(h,l){var j,k=h.wildAttribs;for(j=0;j<k.length;j++){if(k[j].nameRE.test(l)){return k[j]}}return null},serialize:function(l,k){var j,i=this;i._setup();k=k||{};k.format=k.format||"html";i.processObj=k;l=l.cloneNode(true);i.key=""+(parseInt(i.key)+1);if(!k.no_events){k.node=l;i.onPreProcess.dispatch(i,k)}i.writer.reset();i._serializeNode(l,k.getInner);k.content=i.writer.getContent();if(!k.no_events){i.onPostProcess.dispatch(i,k)}i._postProcess(k);k.node=null;return e.trim(k.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?"<p$1> </p>":"<p$1> </p>");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>");j=j.replace(/(type|language)=\"mce-/g,'$1="');if(k.entity_encoding=="raw"){j=j.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g,"<p$1>\u00a0</p>")}}n.content=j},_serializeNode:function(D,o){var z=this,A=z.settings,x=z.writer,q,j,u,F,E,G,B,h,y,k,r,C,p,m;if(!A.node_filter||A.node_filter(D)){switch(D.nodeType){case 1:if(D.hasAttribute?D.hasAttribute("mce_bogus"):D.getAttribute("mce_bogus")){return}p=false;q=D.hasChildNodes();k=D.getAttribute("mce_name")||D.nodeName.toLowerCase();if(d){if(D.scopeName!=="HTML"&&D.scopeName!=="html"){k=D.scopeName+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!z.validElementsRE||!z.validElementsRE.test(k)||(z.invalidElementsRE&&z.invalidElementsRE.test(k))||o){p=true;break}if(d){if(A.fix_content_duplication){if(D.mce_serialized==z.key){return}D.mce_serialized=z.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(D.nodeName==="BR"&&D.getAttribute("type")=="_moz"){return}}}if(z.childRules){if(z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(k)){p=true;break}}z.elementName=k}r=z.findRule(k);k=r.name||k;m=A.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){G=r.requiredAttribs;for(F=G.length-1;F>=0;F--){if(this.dom.getAttrib(D,G[F])!==""){break}}if(F==-1){p=true;break}}x.writeStartElement(k);if(r.attribs){for(F=0,B=r.attribs,E=B.length;F<E;F++){G=B[F];y=z._getAttrib(D,G);if(y!==null){x.writeAttribute(G.name,y)}}}if(r.validAttribsRE){B=z.dom.getAttribs(D);for(F=B.length-1;F>-1;F--){h=B[F];if(h.specified){G=h.nodeName.toLowerCase();if(A.invalid_attrs.test(G)||!r.validAttribsRE.test(G)){continue}C=z.findAttribRule(r,G);y=z._getAttrib(D,C,G);if(y!==null){x.writeAttribute(G,y)}}}}if(k==="script"&&e.trim(D.innerHTML)){x.writeText("// ");x.writeCDATA(D.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=D.firstChild)&&u.nodeType===1&&D.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("mce_bogus"):u.getAttribute("mce_bogus")){x.writeText("\u00a0")}}else{if(!q){x.writeText("\u00a0")}}}break;case 3:if(z.childRules&&z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(D.nodeName)){return}}return x.writeText(D.nodeValue);case 4:return x.writeCDATA(D.nodeValue);case 8:return x.writeComment(D.nodeValue)}}else{if(D.nodeType==1){q=D.hasChildNodes()}}if(q&&!m){u=D.firstChild;while(u){z._serializeNode(u);z.elementName=k;u=u.nextSibling}}if(!p){if(!m){x.writeFullEndElement()}else{x.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+"<!--mce:"+(j.items.length-1)+"-->"+p}))});return j},_unprotect:function(i,j){i=i.replace(/\<!--mce:([0-9]+)--\>/g,function(k,h){return j.items[parseInt(h)]});j.items=[];return i},_encode:function(m){var j=this,k=j.settings,i;if(k.entity_encoding!=="raw"){if(k.entity_encoding.indexOf("named")!=-1){j.setEntities(k.entities);i=j.entityLookup;m=m.replace(j.entitiesRE,function(h){var l;if(l=i[h]){h="&"+l+";"}return h})}if(k.entity_encoding.indexOf("numeric")!=-1){m=m.replace(/[\u007E-\uFFFF]/g,function(h){return"&#"+h.charCodeAt(0)+";"})}}return m},_setup:function(){var h=this,i=this.settings;if(h.done){return}h.done=1;h.setRules(i.valid_elements);h.addRules(i.extended_valid_elements);h.addValidChildRules(i.valid_child_elements);if(i.invalid_elements){h.invalidElementsRE=new RegExp("^("+c(i.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(i.attrib_value_filter){h.attribValueFilter=i.attribValueFilter}},_getAttrib:function(m,j,h){var l,k;h=h||j.name;if(j.forcedVal&&(k=j.forcedVal)){if(k==="{$uid}"){return this.dom.uniqueId()}return k}k=this.dom.getAttrib(m,h);if(this.settings.bool_attrs.test(h)&&k){k=(""+k).toLowerCase();if(k==="false"||k==="0"){return null}k=h}switch(h){case"rowspan":case"colspan":if(k=="1"){k=""}break}if(this.attribValueFilter){k=this.attribValueFilter(h,k,m)}if(j.validVals){for(l=j.validVals.length-1;l>=0;l--){if(k==j.validVals[l]){break}}if(l==-1){return null}}if(k===""&&typeof(j.defaultVal)!="undefined"){k=j.defaultVal;if(k==="{$uid}"){return this.dom.uniqueId()}return k}else{if(h=="class"&&this.processObj.get){k=k.replace(/\s?mceItem\w+\s?/g,"")}}if(k===""){return null}return k}})})(tinymce);(function(tinymce){var each=tinymce.each,Event=tinymce.dom.Event;tinymce.create("tinymce.dom.ScriptLoader",{ScriptLoader:function(s){this.settings=s||{};this.queue=[];this.lookup={}},isDone:function(u){return this.lookup[u]?this.lookup[u].state==2:0},markDone:function(u){this.lookup[u]={state:2,url:u}},add:function(u,cb,s,pr){var t=this,lo=t.lookup,o;if(o=lo[u]){if(cb&&o.state==2){cb.call(s||this)}return o}o={state:0,url:u,func:cb,scope:s||this};if(pr){t.queue.unshift(o)}else{t.queue.push(o)}lo[u]=o;return o},load:function(u,cb,s){var t=this,o;if(o=t.lookup[u]){if(cb&&o.state==2){cb.call(s||t)}return o}function loadScript(u){if(Event.domLoaded||t.settings.strict_mode){tinymce.util.XHR.send({url:tinymce._addVer(u),error:t.settings.error,async:false,success:function(co){t.eval(co)}})}else{document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"><\/script>')}}if(!tinymce.is(u,"string")){each(u,function(u){loadScript(u)});if(cb){cb.call(s||t)}}else{loadScript(u);if(cb){cb.call(s||t)}}},loadQueue:function(cb,s){var t=this;if(!t.queueLoading){t.queueLoading=1;t.queueCallbacks=[];t.loadScripts(t.queue,function(){t.queueLoading=0;if(cb){cb.call(s||t)}each(t.queueCallbacks,function(o){o.func.call(o.scope)})})}else{if(cb){t.queueCallbacks.push({func:cb,scope:s||t})}}},eval:function(co){var w=window;if(!w.execScript){try{eval.call(w,co)}catch(ex){eval(co,w)}}else{w.execScript(co)}},loadScripts:function(sc,cb,s){var t=this,lo=t.lookup;function done(o){o.state=2;if(o.func){o.func.call(o.scope||t)}}function allDone(){var l;l=sc.length;each(sc,function(o){o=lo[o.url];if(o.state===2){done(o);l--}else{load(o)}});if(l===0&&cb){cb.call(s||t);cb=0}}function load(o){if(o.state>0){return}o.state=1;tinymce.dom.ScriptLoader.loadScript(o.url,function(){done(o);allDone()})}each(sc,function(o){var u=o.url;if(!lo[u]){lo[u]=o;t.queue.push(o)}else{o=lo[u]}if(o.state>0){return}if(!Event.domLoaded&&!t.settings.strict_mode){var ix,ol="";if(cb||o.func){o.state=1;ix=tinymce.dom.ScriptLoader._addOnLoad(function(){done(o);allDone()});if(tinymce.isIE){ol=' onreadystatechange="'}else{ol=' onload="'}ol+="tinymce.dom.ScriptLoader._onLoad(this,'"+u+"',"+ix+');"'}document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"'+ol+"><\/script>");if(!o.func){done(o)}}else{load(o)}});allDone()},"static":{_addOnLoad:function(f){var t=this;t._funcs=t._funcs||[];t._funcs.push(f);return t._funcs.length-1},_onLoad:function(e,u,ix){if(!tinymce.isIE||e.readyState=="complete"){this._funcs[ix].call(this)}},loadScript:function(u,cb){var id=tinymce.DOM.uniqueId(),e;function done(){Event.clear(id);tinymce.DOM.remove(id);if(cb){cb.call(document,u);cb=0}}if(tinymce.isIE){tinymce.util.XHR.send({url:tinymce._addVer(u),async:false,success:function(co){window.execScript(co);done()}})}else{e=tinymce.DOM.create("script",{id:id,type:"text/javascript",src:tinymce._addVer(u)});Event.add(e,"load",done);(document.getElementsByTagName("head")[0]||document.body).appendChild(e)}}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader()})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(w){var h,t,s;w=w.target;if(w&&(w=c.getParent(w,"tr"))){h=z.items[w.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(w&&c.hasClass(w,m+"ItemSub")){t=c.getRect(w);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}z.onShowMenu.dispatch(z);if(A.keyboard_focus){a.add(o,"keydown",z._keyHandler,z);c.select("a","menu_"+z.id)[0].focus();z._focusIdx=0}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000"});k=c.add(g,"div",{id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_keyHandler:function(j){var i=this,h=j.keyCode;function g(m){var k=i._focusIdx+m,l=c.select("a","menu_"+i.id)[k];if(l){i._focusIdx=k;l.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,"td");i=p=c.add(i,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" />'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";i+="</tr></tbody></table>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(h){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(l){var i=-1,j,k=l.keyCode;e(f.items,function(m,n){if(f.selectedValue==m.value){i=n}});if(k==38){j=f.items[i-1]}else{if(k==40){j=f.items[i+1]}else{if(k==13){j=f.selectedValue;f.selectedValue=null;f.settings.onselect(j);return b.cancel(l)}}}if(j){f.hideMenu();f.select(j.value)}})}f._focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return c.get(this.id).options.length-1},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(j){var i=g.items[j.target.selectedIndex-1];if(i&&(i=i.value)){g.onChange.dispatch(g,i);if(g.settings.onselect){g.settings.onselect(i)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(j){var i;b.remove(g.id,"change",h);i=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.remove(g.id,"blur",i)});if(j.keyCode==13||j.keyCode==32){f(j);return b.cancel(j)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}i+="<td>"+b.createHTML("a",{id:f.id+"_action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});i+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},i)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(i){i=i.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+i},mce_color:"#"+i})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(i){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(i)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(i){var m;i=i.target;if(i.nodeName=="A"&&(m=i.getAttribute("mce_color"))){k.setColor(m)}return a.cancel(i)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: relative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new a(this),get:function(d){return this.lookup[d]},requireLangPack:function(f){var d,e=b.EditorManager.settings;if(e&&e.language){d=this.urls[f]+"/langs/"+e.language+".js";if(!b.dom.Event.domLoaded&&!e.strict_mode){b.ScriptLoader.load(d)}else{b.ScriptLoader.add(d)}}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));b.ScriptLoader.add(e,d,g)}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(f){var g=f.each,h=f.extend,e=f.DOM,a=f.dom.Event,c=f.ThemeManager,b=f.PluginManager,d=f.explode;f.create("static tinymce.EditorManager",{editors:{},i18n:{},activeEditor:null,preInit:function(){var i=this,j=window.location;f.documentBaseURL=j.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(f.documentBaseURL)){f.documentBaseURL+="/"}f.baseURL=new f.util.URI(f.documentBaseURL).toAbsolute(f.baseURL);f.EditorManager.baseURI=new f.util.URI(f.baseURL);if(document.domain&&j.hostname!=document.domain){f.relaxedDomain=document.domain}i.onBeforeUnload=new f.util.Dispatcher(i);a.add(window,"beforeunload",function(k){i.onBeforeUnload.dispatch(i,k)})},init:function(q){var p=this,l,k=f.ScriptLoader,o,n,i=[],m;function j(u,v,r){var t=u[v];if(!t){return}if(f.is(t,"string")){r=t.replace(/\.\w+$/,"");r=r?f.resolve(r):0;t=f.resolve(t)}return t.apply(r||this,Array.prototype.slice.call(arguments,2))}q=h({theme:"simple",language:"en",strict_loading_mode:document.contentType=="application/xhtml+xml"},q);p.settings=q;if(!a.domLoaded&&!q.strict_loading_mode){if(q.language){k.add(f.baseURL+"/langs/"+q.language+".js")}if(q.theme&&q.theme.charAt(0)!="-"&&!c.urls[q.theme]){c.load(q.theme,"themes/"+q.theme+"/editor_template"+f.suffix+".js")}if(q.plugins){l=d(q.plugins);if(f.inArray(l,"compat2x")!=-1){b.load("compat2x","plugins/compat2x/editor_plugin"+f.suffix+".js")}g(l,function(r){if(r&&r.charAt(0)!="-"&&!b.urls[r]){if(!f.isWebKit&&r=="safari"){return}b.load(r,"plugins/"+r+"/editor_plugin"+f.suffix+".js")}})}k.loadQueue()}a.add(document,"init",function(){var r,t;j(q,"onpageload");if(q.browsers){r=false;g(d(q.browsers),function(u){switch(u){case"ie":case"msie":if(f.isIE){r=true}break;case"gecko":if(f.isGecko){r=true}break;case"safari":case"webkit":if(f.isWebKit){r=true}break;case"opera":if(f.isOpera){r=true}break}});if(!r){return}}switch(q.mode){case"exact":r=q.elements||"";if(r.length>0){g(d(r),function(u){if(e.get(u)){m=new f.Editor(u,q);i.push(m);m.render(1)}else{o=0;g(document.forms,function(v){g(v.elements,function(w){if(w.name===u){u="mce_editor_"+o;e.setAttrib(w,"id",u);m=new f.Editor(u,q);i.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function s(v,u){return u.constructor===RegExp?u.test(v.className):e.hasClass(v,u)}g(e.select("textarea"),function(u){if(q.editor_deselector&&s(u,q.editor_deselector)){return}if(!q.editor_selector||s(u,q.editor_selector)){n=e.get(u.name);if(!u.id&&!n){u.id=u.name}if(!u.id||p.get(u.id)){u.id=e.uniqueId()}m=new f.Editor(u.id,q);i.push(m);m.render(1)}});break}if(q.oninit){r=t=0;g(i,function(u){t++;if(!u.initialized){u.onInit.add(function(){r++;if(r==t){j(q,"oninit")}})}else{r++}if(r==t){j(q,"oninit")}})}})},get:function(i){return this.editors[i]},getInstanceById:function(i){return this.get(i)},add:function(i){this.editors[i.id]=i;this._setActive(i);return i},remove:function(j){var i=this;if(!i.editors[j.id]){return null}delete i.editors[j.id];if(i.activeEditor==j){g(i.editors,function(k){i._setActive(k);return false})}j.destroy();return j},execCommand:function(o,m,l){var n=this,k=n.get(l),i;switch(o){case"mceFocus":k.focus();return true;case"mceAddEditor":case"mceAddControl":if(!n.get(l)){new f.Editor(l,n.settings).render()}return true;case"mceAddFrameControl":i=l.window;i.tinyMCE=tinyMCE;i.tinymce=f;f.DOM.doc=i.document;f.DOM.win=i;k=new f.Editor(l.element_id,l);k.render();if(f.isIE){function j(){k.destroy();i.detachEvent("onunload",j);i=i.tinyMCE=i.tinymce=null}i.attachEvent("onunload",j)}l.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(k){k.remove()}return true;case"mceToggleEditor":if(!k){n.execCommand("mceAddControl",0,l);return true}if(k.isHidden()){k.show()}else{k.hide()}return true}if(n.activeEditor){return n.activeEditor.execCommand(o,m,l)}return false},execInstanceCommand:function(m,l,k,j){var i=this.get(m);if(i){return i.execCommand(l,k,j)}return false},triggerSave:function(){g(this.editors,function(i){i.save()})},addI18n:function(k,l){var i,j=this.i18n;if(!f.is(k,"string")){g(k,function(n,m){g(n,function(q,p){g(q,function(s,r){if(p==="common"){j[m+"."+r]=s}else{j[m+"."+p+"."+r]=s}})})})}else{g(l,function(n,m){j[k+"."+m]=n})}},_setActive:function(i){this.selectedInstance=this.activeEditor=i}});f.EditorManager.preInit()})(tinymce);var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(n){var o=n.DOM,k=n.dom.Event,f=n.extend,l=n.util.Dispatcher;var j=n.each,a=n.isGecko,b=n.isIE,e=n.isWebKit;var d=n.is,h=n.ThemeManager,c=n.PluginManager,i=n.EditorManager;var p=n.inArray,m=n.grep,g=n.explode;n.create("tinymce.Editor",{Editor:function(u,r){var q=this;q.id=q.editorId=u;q.execCommands={};q.queryStateCommands={};q.queryValueCommands={};q.plugins={};j(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){q[s]=new l(q)});q.settings=r=f({id:u,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:n.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',visual_table_class:"mceItemTable",visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,removeformat_selector:"span,b,strong,em,i,font,u,strike"},r);q.documentBaseURI=new n.util.URI(r.document_base_url||n.documentBaseURL,{base_uri:tinyMCE.baseURI});q.baseURI=i.baseURI;q.execCallback("setup",q)},render:function(u){var v=this,w=v.settings,x=v.id,q=n.ScriptLoader;if(!k.domLoaded){k.add(document,"init",function(){v.render()});return}if(!u){w.strict_loading_mode=1;tinyMCE.settings=w}if(!v.getElement()){return}if(w.strict_loading_mode){q.settings.strict_mode=w.strict_loading_mode;n.DOM.settings.strict=1}if(!/TEXTAREA|INPUT/i.test(v.getElement().nodeName)&&w.hidden_input&&o.getParent(x,"form")){o.insertAfter(o.create("input",{type:"hidden",name:x}),x)}if(n.WindowManager){v.windowManager=new n.WindowManager(v)}if(w.encoding=="xml"){v.onGetContent.add(function(s,t){if(t.save){t.content=o.encode(t.content)}})}if(w.add_form_submit_trigger){v.onSubmit.addToTop(function(){if(v.initialized){v.save();v.isNotDirty=1}})}if(w.add_unload_trigger){v._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(v.initialized&&!v.destroyed&&!v.isHidden()){v.save({format:"raw",no_events:true})}})}n.addUnload(v.destroy,v);if(w.submit_patch){v.onBeforeRenderUI.add(function(){var s=v.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){v.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){i.triggerSave();v.isNotDirty=1;return v.formElement._mceOldSubmit(v.formElement)}}s=null})}function r(){if(w.language){q.add(n.baseURL+"/langs/"+w.language+".js")}if(w.theme&&w.theme.charAt(0)!="-"&&!h.urls[w.theme]){h.load(w.theme,"themes/"+w.theme+"/editor_template"+n.suffix+".js")}j(g(w.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(!e&&s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+n.suffix+".js")}});q.loadQueue(function(){if(!v.removed){v.init()}})}if(w.plugins.indexOf("compat2x")!=-1){c.load("compat2x","plugins/compat2x/editor_plugin"+n.suffix+".js");q.loadQueue(r)}else{r()}},init:function(){var v,F=this,G=F.settings,C,z,B=F.getElement(),r,q,D,y,A,E;i.add(F);if(G.theme){G.theme=G.theme.replace(/-/,"");r=h.get(G.theme);F.theme=new r();if(F.theme.init&&G.init_theme){F.theme.init(F,h.urls[G.theme]||n.documentBaseURL.replace(/\/$/,""))}}j(g(G.plugins.replace(/\-/g,"")),function(w){var H=c.get(w),t=c.urls[w]||n.documentBaseURL.replace(/\/$/,""),s;if(H){s=new H(F,t);F.plugins[w]=s;if(s.init){s.init(F,t)}}});if(G.popup_css!==false){if(G.popup_css){G.popup_css=F.documentBaseURI.toAbsolute(G.popup_css)}else{G.popup_css=F.baseURI.toAbsolute("themes/"+G.theme+"/skins/"+G.skin+"/dialog.css")}}if(G.popup_css_add){G.popup_css+=","+F.documentBaseURI.toAbsolute(G.popup_css_add)}F.controlManager=new n.ControlManager(F);F.undoManager=new n.UndoManager(F);F.undoManager.onAdd.add(function(t,s){if(!s.initial){return F.onChange.dispatch(F,s,t)}});F.undoManager.onUndo.add(function(t,s){return F.onUndo.dispatch(F,s,t)});F.undoManager.onRedo.add(function(t,s){return F.onRedo.dispatch(F,s,t)});if(G.custom_undo_redo){F.onExecCommand.add(function(t,w,u,H,s){if(w!="Undo"&&w!="Redo"&&w!="mceRepaint"&&(!s||!s.skip_undo)){F.undoManager.add()}})}F.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){F.nodeChanged()}});if(a){function x(s,t){if(!t||!t.initial){F.execCommand("mceRepaint")}}F.onUndo.add(x);F.onRedo.add(x);F.onSetContent.add(x)}F.onBeforeRenderUI.dispatch(F,F.controlManager);if(G.render_ui){C=G.width||B.style.width||B.offsetWidth;z=G.height||B.style.height||B.offsetHeight;F.orgDisplay=B.style.display;E=/^[0-9\.]+(|px)$/i;if(E.test(""+C)){C=Math.max(parseInt(C)+(r.deltaWidth||0),100)}if(E.test(""+z)){z=Math.max(parseInt(z)+(r.deltaHeight||0),100)}r=F.theme.renderUI({targetNode:B,width:C,height:z,deltaWidth:G.delta_width,deltaHeight:G.delta_height});F.editorContainer=r.editorContainer}o.setStyles(r.sizeContainer||r.editorContainer,{width:C,height:z});z=(r.iframeHeight||z)+(typeof(z)=="number"?(r.deltaHeight||0):"");if(z<100){z=100}F.iframeHTML=G.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+F.documentBaseURI.getURI()+'" />';F.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(n.relaxedDomain){F.iframeHTML+='<script type="text/javascript">document.domain = "'+n.relaxedDomain+'";<\/script>'}y=G.body_id||"tinymce";if(y.indexOf("=")!=-1){y=F.getParam("body_id","","hash");y=y[F.id]||y}A=G.body_class||"";if(A.indexOf("=")!=-1){A=F.getParam("body_class","","hash");A=A[F.id]||""}F.iframeHTML+='</head><body id="'+y+'" class="mceContentBody '+A+'"></body></html>';if(n.relaxedDomain){if(b||(n.isOpera&&parseFloat(opera.version())>=9.5)){D='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+F.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(n.isOpera){D='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}v=o.add(r.iframeContainer,"iframe",{id:F.id+"_ifr",src:D||'javascript:""',frameBorder:"0",style:{width:"100%",height:z}});F.contentAreaContainer=r.iframeContainer;o.get(r.editorContainer).style.display=F.orgDisplay;o.get(F.id).style.display="none";if(!b||!n.relaxedDomain){F.setupIframe()}B=v=r=null},setupIframe:function(){var z=this,A=z.settings,u=o.get(z.id),v=z.getDoc(),r,x;if(!b||!n.relaxedDomain){v.open();v.write(z.iframeHTML);v.close()}if(!b){try{if(!A.readonly){v.designMode="On"}}catch(w){}}if(b){x=z.getBody();o.hide(x);if(!A.readonly){x.contentEditable=true}o.show(x)}z.dom=new n.DOM.DOMUtils(z.getDoc(),{keep_values:true,url_converter:z.convertURL,url_converter_scope:z,hex_colors:A.force_hex_style_colors,class_filter:A.class_filter,update_styles:1,fix_ie_paragraphs:1});z.serializer=new n.dom.Serializer({entity_encoding:A.entity_encoding,entities:A.entities,valid_elements:A.verify_html===false?"*[*]":A.valid_elements,extended_valid_elements:A.extended_valid_elements,valid_child_elements:A.valid_child_elements,invalid_elements:A.invalid_elements,fix_table_elements:A.fix_table_elements,fix_list_elements:A.fix_list_elements,fix_content_duplication:A.fix_content_duplication,convert_fonts_to_spans:A.convert_fonts_to_spans,font_size_classes:A.font_size_classes,font_size_style_values:A.font_size_style_values,apply_source_formatting:A.apply_source_formatting,remove_linebreaks:A.remove_linebreaks,element_format:A.element_format,dom:z.dom});z.selection=new n.dom.Selection(z.dom,z.getWin(),z.serializer);z.forceBlocks=new n.ForceBlocks(z,{forced_root_block:A.forced_root_block});z.editorCommands=new n.EditorCommands(z);z.serializer.onPreProcess.add(function(s,t){return z.onPreProcess.dispatch(z,t,s)});z.serializer.onPostProcess.add(function(s,t){return z.onPostProcess.dispatch(z,t,s)});z.onPreInit.dispatch(z);if(!A.gecko_spellcheck){z.getBody().spellcheck=0}if(!A.readonly){z._addEvents()}z.controlManager.onPostRender.dispatch(z,z.controlManager);z.onPostRender.dispatch(z);if(A.directionality){z.getBody().dir=A.directionality}if(A.nowrap){z.getBody().style.whiteSpace="nowrap"}if(A.auto_resize){z.onNodeChange.add(z.resizeToContent,z)}if(A.custom_elements){function y(s,t){j(g(A.custom_elements),function(B){var C;if(B.indexOf("~")===0){B=B.substring(1);C="span"}else{C="div"}t.content=t.content.replace(new RegExp("<("+B+")([^>]*)>","g"),"<"+C+' mce_name="$1"$2>');t.content=t.content.replace(new RegExp("</("+B+")>","g"),"</"+C+">")})}z.onBeforeSetContent.add(y);z.onPostProcess.add(function(s,t){if(t.set){y(s,t)}})}if(A.handle_node_change_callback){z.onNodeChange.add(function(t,s,B){z.execCallback("handle_node_change_callback",z.id,B,-1,-1,true,z.selection.isCollapsed())})}if(A.save_callback){z.onSaveContent.add(function(s,B){var t=z.execCallback("save_callback",z.id,B.content,z.getBody());if(t){B.content=t}})}if(A.onchange_callback){z.onChange.add(function(t,s){z.execCallback("onchange_callback",z,s)})}if(A.convert_newlines_to_brs){z.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(A.fix_nesting&&b){z.onBeforeSetContent.add(function(s,t){t.content=z._fixNesting(t.content)})}if(A.preformatted){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(A.verify_css_classes){z.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!z.classesRE){t=z.dom.getClasses();if(t.length>0){C="";j(t,function(s){C+=(C?"|":"")+s["class"]});z.classesRE=new RegExp("("+C+")","gi")}}return !z.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||z.classesRE.test(B)?B:""}return B}}if(A.convert_fonts_to_spans){z._convertFonts()}if(A.inline_styles){z._convertInlineElements()}if(A.cleanup_callback){z.onBeforeSetContent.add(function(s,t){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)});z.onPreProcess.add(function(s,t){if(t.set){z.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){z.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});z.onPostProcess.add(function(s,t){if(t.set){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=z.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(A.save_callback){z.onGetContent.add(function(s,t){if(t.save){t.content=z.execCallback("save_callback",z.id,t.content,z.getBody())}})}if(A.handle_event_callback){z.onEvent.add(function(s,t,B){if(z.execCallback("handle_event_callback",t,s,B)===false){k.cancel(t)}})}z.onSetContent.add(function(){z.addVisual(z.getBody())});if(A.padd_empty_editor){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function q(s,t){j(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{mce_bogus:1})}})}z.onExecCommand.add(function(s,t){if(t==="CreateLink"){q(s)}});z.onSetContent.add(z.selection.onSetContent.add(q));if(!A.readonly){try{v.designMode="Off";v.designMode="On"}catch(w){}}}setTimeout(function(){if(z.removed){return}z.load({initial:true,format:(A.cleanup_on_startup?"html":"raw")});z.startContent=z.getContent({format:"raw"});z.undoManager.add({initial:true});z.initialized=true;z.onInit.dispatch(z);z.execCallback("setupcontent_callback",z.id,z.getBody(),z.getDoc());z.execCallback("init_instance_callback",z);z.focus(true);z.nodeChanged({initial:1});if(A.content_css){n.each(g(A.content_css),function(s){z.dom.loadCSS(z.documentBaseURI.toAbsolute(s))})}if(A.auto_focus){setTimeout(function(){var s=i.get(A.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);u=null},focus:function(r){var u,q=this,s=q.settings.content_editable;if(!r){if(!s&&(!b||q.selection.getNode().ownerDocument!=q.getDoc())){q.getWin().focus()}}if(i.activeEditor!=q){if((u=i.activeEditor)!=null){u.onDeactivate.dispatch(u,q)}q.onActivate.dispatch(q,u)}i._setActive(q)},execCallback:function(v){var q=this,u=q.settings[v],r;if(!u){return}if(q.callbackLookup&&(r=q.callbackLookup[v])){u=r.func;r=r.scope}if(d(u,"string")){r=u.replace(/\.\w+$/,"");r=r?n.resolve(r):0;u=n.resolve(u);q.callbackLookup=q.callbackLookup||{};q.callbackLookup[v]={func:u,scope:r}}return u.apply(r||q,Array.prototype.slice.call(arguments,1))},translate:function(q){var t=this.settings.language||"en",r=i.i18n;if(!q){return""}return r[t+"."+q]||q.replace(/{\#([^}]+)\}/g,function(u,s){return r[t+"."+s]||"{#"+s+"}"})},getLang:function(r,q){return i.i18n[(this.settings.language||"en")+"."+r]||(d(q)?q:"{#"+r+"}")},getParam:function(w,s,q){var t=n.trim,r=d(this.settings[w])?this.settings[w]:s,u;if(q==="hash"){u={};if(d(r,"string")){j(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(x){x=x.split("=");if(x.length>1){u[t(x[0])]=t(x[1])}else{u[t(x[0])]=t(x)}})}else{u=r}return u}return r},nodeChanged:function(u){var q=this,r=q.selection,v=r.getNode()||q.getBody();if(q.initialized){q.onNodeChange.dispatch(q,u?u.controlManager||q.controlManager:q.controlManager,b&&v.ownerDocument!=q.getDoc()?q.getBody():v,r.isCollapsed(),u)}},addButton:function(u,r){var q=this;q.buttons=q.buttons||{};q.buttons[u]=r},addCommand:function(t,r,q){this.execCommands[t]={func:r,scope:q||this}},addQueryStateHandler:function(t,r,q){this.queryStateCommands[t]={func:r,scope:q||this}},addQueryValueHandler:function(t,r,q){this.queryValueCommands[t]={func:r,scope:q||this}},addShortcut:function(s,v,q,u){var r=this,w;if(!r.settings.custom_shortcuts){return false}r.shortcuts=r.shortcuts||{};if(d(q,"string")){w=q;q=function(){r.execCommand(w,false,null)}}if(d(q,"object")){w=q;q=function(){r.execCommand(w[0],w[1],w[2])}}j(g(s),function(t){var x={func:q,scope:u||this,desc:v,alt:false,ctrl:false,shift:false};j(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});r.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,w,z,q){var u=this,v=0,y,r;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!q||!q.skip_focus)){u.focus()}y={};u.onBeforeExecCommand.dispatch(u,x,w,z,y);if(y.terminate){return false}if(u.execCallback("execcommand_callback",u.id,u.selection.getNode(),x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(y=u.execCommands[x]){r=y.func.call(y.scope,w,z);if(r!==true){u.onExecCommand.dispatch(u,x,w,z,q);return r}}j(u.plugins,function(s){if(s.execCommand&&s.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);v=1;return false}});if(v){return true}if(u.theme&&u.theme.execCommand&&u.theme.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(n.GlobalCommands.execCommand(u,x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(u.editorCommands.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}u.getDoc().execCommand(x,w,z);u.onExecCommand.dispatch(u,x,w,z,q)},queryCommandState:function(w){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryStateCommands[w]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandState(w);if(v!==-1){return v}try{return this.getDoc().queryCommandState(w)}catch(q){}},queryCommandValue:function(w){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryValueCommands[w]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandValue(w);if(d(v)){return v}try{return this.getDoc().queryCommandValue(w)}catch(q){}},show:function(){var q=this;o.show(q.getContainer());o.hide(q.id);q.load()},hide:function(){var q=this,r=q.getDoc();if(b&&r){r.execCommand("SelectAll")}q.save();o.hide(q.getContainer());o.setStyle(q.id,"display",q.orgDisplay)},isHidden:function(){return !o.isHidden(this.id)},setProgressState:function(q,r,s){this.onSetProgressState.dispatch(this,q,r,s);return q},resizeToContent:function(){var q=this;o.setStyle(q.id+"_ifr","height",q.getBody().scrollHeight)},load:function(u){var q=this,s=q.getElement(),r;if(s){u=u||{};u.load=true;r=q.setContent(d(s.value)?s.value:s.innerHTML,u);u.element=s;if(!u.no_events){q.onLoadContent.dispatch(q,u)}u.element=s=null;return r}},save:function(v){var q=this,u=q.getElement(),r,s;if(!u||!q.initialized){return}v=v||{};v.save=true;if(!v.no_events){q.undoManager.typing=0;q.undoManager.add()}v.element=u;r=v.content=q.getContent(v);if(!v.no_events){q.onSaveContent.dispatch(q,v)}r=v.content;if(!/TEXTAREA|INPUT/i.test(u.nodeName)){u.innerHTML=r;if(s=o.getParent(q.id,"form")){j(s.elements,function(t){if(t.name==q.id){t.value=r;return false}})}}else{u.value=r}v.element=u=null;return r},setContent:function(r,s){var q=this;s=s||{};s.format=s.format||"html";s.set=true;s.content=r;if(!s.no_events){q.onBeforeSetContent.dispatch(q,s)}if(!n.isIE&&(r.length===0||/^\s+$/.test(r))){s.content=q.dom.setHTML(q.getBody(),'<br mce_bogus="1" />');s.format="raw"}s.content=q.dom.setHTML(q.getBody(),n.trim(s.content));if(s.format!="raw"&&q.settings.cleanup){s.getInner=true;s.content=q.dom.setHTML(q.getBody(),q.serializer.serialize(q.getBody(),s))}if(!s.no_events){q.onSetContent.dispatch(q,s)}return s.content},getContent:function(s){var q=this,r;s=s||{};s.format=s.format||"html";s.get=true;if(!s.no_events){q.onBeforeGetContent.dispatch(q,s)}if(s.format!="raw"&&q.settings.cleanup){s.getInner=true;r=q.serializer.serialize(q.getBody(),s)}else{r=q.getBody().innerHTML}r=r.replace(/^\s*|\s*$/g,"");s.content=r;if(!s.no_events){q.onGetContent.dispatch(q,s)}return s.content},isDirty:function(){var q=this;return n.trim(q.startContent)!=n.trim(q.getContent({format:"raw",no_events:1}))&&!q.isNotDirty},getContainer:function(){var q=this;if(!q.container){q.container=o.get(q.editorContainer||q.id+"_parent")}return q.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return o.get(this.settings.content_element||this.id)},getWin:function(){var q=this,r;if(!q.contentWindow){r=o.get(q.id+"_ifr");if(r){q.contentWindow=r.contentWindow}}return q.contentWindow},getDoc:function(){var r=this,q;if(!r.contentDocument){q=r.getWin();if(q){r.contentDocument=q.document}}return r.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(q,x,w){var r=this,v=r.settings;if(v.urlconverter_callback){return r.execCallback("urlconverter_callback",q,w,true,x)}if(!v.convert_urls||(w&&w.nodeName=="LINK")||q.indexOf("file:")===0){return q}if(v.relative_urls){return r.documentBaseURI.toRelative(q)}q=r.documentBaseURI.toAbsolute(q,v.remove_script_host);return q},addVisual:function(u){var q=this,r=q.settings;u=u||q.getBody();if(!d(q.hasVisual)){q.hasVisual=r.visual}j(q.dom.select("table,a",u),function(t){var s;switch(t.nodeName){case"TABLE":s=q.dom.getAttrib(t,"border");if(!s||s=="0"){if(q.hasVisual){q.dom.addClass(t,r.visual_table_class)}else{q.dom.removeClass(t,r.visual_table_class)}}return;case"A":s=q.dom.getAttrib(t,"name");if(s){if(q.hasVisual){q.dom.addClass(t,"mceItemAnchor")}else{q.dom.removeClass(t,"mceItemAnchor")}}return}});q.onVisualAid.dispatch(q,u,q.hasVisual)},remove:function(){var q=this,r=q.getContainer();q.removed=1;q.hide();q.execCallback("remove_instance_callback",q);q.onRemove.dispatch(q);q.onExecCommand.listeners=[];i.remove(q);o.remove(r)},destroy:function(r){var q=this;if(q.destroyed){return}if(!r){n.removeUnload(q.destroy);tinyMCE.onBeforeUnload.remove(q._beforeUnload);if(q.theme&&q.theme.destroy){q.theme.destroy()}q.controlManager.destroy();q.selection.destroy();q.dom.destroy();if(!q.settings.content_editable){k.clear(q.getWin());k.clear(q.getDoc())}k.clear(q.getBody());k.clear(q.formElement)}if(q.formElement){q.formElement.submit=q.formElement._mceOldSubmit;q.formElement._mceOldSubmit=null}q.contentAreaContainer=q.formElement=q.container=q.settings.content_element=q.bodyElement=q.contentDocument=q.contentWindow=null;if(q.selection){q.selection=q.selection.win=q.selection.dom=q.selection.dom.doc=null}q.destroyed=1},_addEvents:function(){var w=this,v,y=w.settings,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function u(t,A){var s=t.type;if(w.removed){return}if(w.onEvent.dispatch(w,t,A)!==false){w[x[t.fakeType||t.type]].dispatch(w,t,A)}}j(x,function(t,s){switch(s){case"contextmenu":if(n.isOpera){w.dom.bind(w.getBody(),"mousedown",function(A){if(A.ctrlKey){A.fakeType="contextmenu";u(A)}})}else{w.dom.bind(w.getBody(),s,u)}break;case"paste":w.dom.bind(w.getBody(),s,function(A){u(A)});break;case"submit":case"reset":w.dom.bind(w.getElement().form||o.getParent(w.id,"form"),s,u);break;default:w.dom.bind(y.content_editable?w.getBody():w.getDoc(),s,u)}});w.dom.bind(y.content_editable?w.getBody():(a?w.getDoc():w.getWin()),"focus",function(s){w.focus(true)});if(n.isGecko){w.dom.bind(w.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("mce_src"))){t.src=w.documentBaseURI.toAbsolute(s)}})}if(a){function q(){var B=this,D=B.getDoc(),C=B.settings;if(a&&!C.readonly){if(B._isHidden()){try{if(!C.content_editable){D.designMode="On"}}catch(A){}}try{D.execCommand("styleWithCSS",0,false)}catch(A){if(!B._isHidden()){try{D.execCommand("useCSS",0,true)}catch(A){}}}if(!C.table_inline_editing){try{D.execCommand("enableInlineTableEditing",false,false)}catch(A){}}if(!C.object_resizing){try{D.execCommand("enableObjectResizing",false,false)}catch(A){}}}}w.onBeforeExecCommand.add(q);w.onMouseDown.add(q)}w.onMouseUp.add(w.nodeChanged);w.onClick.add(w.nodeChanged);w.onKeyUp.add(function(s,t){var A=t.keyCode;if((A>=33&&A<=36)||(A>=37&&A<=40)||A==13||A==45||A==46||A==8||(n.isMac&&(A==91||A==93))||t.ctrlKey){w.nodeChanged()}});w.onReset.add(function(){w.setContent(w.startContent,{format:"raw"})});if(y.custom_shortcuts){if(y.custom_undo_redo_keyboard_shortcuts){w.addShortcut("ctrl+z",w.getLang("undo_desc"),"Undo");w.addShortcut("ctrl+y",w.getLang("redo_desc"),"Redo")}if(a){w.addShortcut("ctrl+b",w.getLang("bold_desc"),"Bold");w.addShortcut("ctrl+i",w.getLang("italic_desc"),"Italic");w.addShortcut("ctrl+u",w.getLang("underline_desc"),"Underline")}for(v=1;v<=6;v++){w.addShortcut("ctrl+"+v,"",["FormatBlock",false,"<h"+v+">"])}w.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);w.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);w.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function z(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}j(w.shortcuts,function(A){if(n.isMac&&A.ctrl!=t.metaKey){return}else{if(!n.isMac&&A.ctrl!=t.ctrlKey){return}}if(A.alt!=t.altKey){return}if(A.shift!=t.shiftKey){return}if(t.keyCode==A.keyCode||(t.charCode&&t.charCode==A.charCode)){s=A;return false}});return s}w.onKeyUp.add(function(s,t){var A=z(t);if(A){return k.cancel(t)}});w.onKeyPress.add(function(s,t){var A=z(t);if(A){return k.cancel(t)}});w.onKeyDown.add(function(s,t){var A=z(t);if(A){A.func.call(A.scope);return k.cancel(t)}})}if(n.isIE){w.dom.bind(w.getDoc(),"controlselect",function(A){var t=w.resizeInfo,s;A=A.target;if(A.nodeName!=="IMG"){return}if(t){w.dom.unbind(t.node,t.ev,t.cb)}if(!w.dom.hasClass(A,"mceItemNoResize")){ev="resizeend";s=w.dom.bind(A,ev,function(C){var B;C=C.target;if(B=w.dom.getStyle(C,"width")){w.dom.setAttrib(C,"width",B.replace(/[^0-9%]+/g,""));w.dom.setStyle(C,"width","")}if(B=w.dom.getStyle(C,"height")){w.dom.setAttrib(C,"height",B.replace(/[^0-9%]+/g,""));w.dom.setStyle(C,"height","")}})}else{ev="resizestart";s=w.dom.bind(A,"resizestart",k.cancel,k)}t=w.resizeInfo={node:A,ev:ev,cb:s}});w.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(w.selection.getRng().item){w.selection.getRng().item(0).removeNode();return k.cancel(t)}}})}if(n.isOpera){w.onClick.add(function(s,t){k.prevent(t)})}if(y.custom_undo_redo){function r(){w.undoManager.typing=0;w.undoManager.add()}if(n.isIE){w.dom.bind(w.getWin(),"blur",function(s){var t;if(w.selection){t=w.selection.getNode();if(!w.removed&&t.ownerDocument&&t.ownerDocument!=w.getDoc()){r()}}})}else{w.dom.bind(w.getDoc(),"blur",function(){if(w.selection&&!w.removed){r()}})}w.onMouseDown.add(r);w.onKeyUp.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){w.undoManager.typing=0;w.undoManager.add()}});w.onKeyDown.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45){if(w.undoManager.typing){w.undoManager.add();w.undoManager.typing=0}return}if(!w.undoManager.typing){w.undoManager.add();w.undoManager.typing=1}})}},_convertInlineElements:function(){var z=this,B=z.settings,r=z.dom,y,w,u,A,q;function x(s,t){if(!B.inline_styles){return}if(t.get){j(z.dom.select("table,u,strike",t.node),function(v){switch(v.nodeName){case"TABLE":if(y=r.getAttrib(v,"height")){r.setStyle(v,"height",y);r.setAttrib(v,"height","")}break;case"U":case"STRIKE":v.style.textDecoration=v.nodeName=="U"?"underline":"line-through";r.setAttrib(v,"mce_style","");r.setAttrib(v,"mce_name","span");break}})}else{if(t.set){j(z.dom.select("table,span",t.node).reverse(),function(v){if(v.nodeName=="TABLE"){if(y=r.getStyle(v,"height")){r.setAttrib(v,"height",y.replace(/[^0-9%]+/g,""))}}else{if(v.style.textDecoration=="underline"){u="u"}else{if(v.style.textDecoration=="line-through"){u="strike"}else{u=""}}if(u){v.style.textDecoration="";r.setAttrib(v,"mce_style","");w=r.create(u,{style:r.getAttrib(v,"style")});r.replace(w,v,1)}}})}}}z.onPreProcess.add(x);if(!B.cleanup_on_startup){z.onSetContent.add(function(s,t){if(t.initial){x(z,{node:z.getBody(),set:1})}})}},_convertFonts:function(){var w=this,x=w.settings,z=w.dom,v,r,q,u;if(!x.inline_styles){return}v=[8,10,12,14,18,24,36];r=["xx-small","x-small","small","medium","large","x-large","xx-large"];if(q=x.font_size_style_values){q=g(q)}if(u=x.font_size_classes){u=g(u)}function y(B){var C,A,t,s;if(!x.inline_styles){return}t=w.dom.select("font",B);for(s=t.length-1;s>=0;s--){C=t[s];A=z.create("span",{style:z.getAttrib(C,"style"),"class":z.getAttrib(C,"class")});z.setStyles(A,{fontFamily:z.getAttrib(C,"face"),color:z.getAttrib(C,"color"),backgroundColor:C.style.backgroundColor});if(C.size){if(q){z.setStyle(A,"fontSize",q[parseInt(C.size)-1])}else{z.setAttrib(A,"class",u[parseInt(C.size)-1])}}z.setAttrib(A,"mce_style","");z.replace(A,C,1)}}w.onPreProcess.add(function(s,t){if(t.get){y(t.node)}});w.onSetContent.add(function(s,t){if(t.initial){y(t.node)}})},_isHidden:function(){var q;if(!a){return 0}q=this.selection.getSel();return(!q||!q.rangeCount||q.rangeCount==0)},_fixNesting:function(r){var t=[],q;r=r.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(u,s,w){var v;if(s==="/"){if(!t.length){return""}if(w!==t[t.length-1].tag){for(q=t.length-1;q>=0;q--){if(t[q].tag===w){t[q].close=1;break}}return""}else{t.pop();if(t.length&&t[t.length-1].close){u=u+"</"+t[t.length-1].tag+">";t.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(w)){return u}if(/\/>$/.test(u)){return u}t.push({tag:w})}return u});for(q=t.length-1;q>=0;q--){r+="</"+t[q].tag+">"}return r}})})(tinymce);(function(d){var f=d.each,c=d.isIE,a=d.isGecko,b=d.isOpera,e=d.isWebKit;d.create("tinymce.EditorCommands",{EditorCommands:function(g){this.editor=g},execCommand:function(k,j,l){var h=this,g=h.editor,i;switch(k){case"mceResetDesignMode":case"mceBeginUndoLevel":return true;case"unlink":h.UnLink();return true;case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":h.mceJustify(k,k.substring(7).toLowerCase());return true;default:i=this[k];if(i){i.call(this,j,l);return true}}return false},Indent:function(){var g=this.editor,l=g.dom,j=g.selection,k,h,i;h=g.settings.indentation;i=/[a-z%]+$/i.exec(h);h=parseInt(h);if(g.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){f(j.getSelectedBlocks(),function(m){l.setStyle(m,"paddingLeft",(parseInt(m.style.paddingLeft||0)+h)+i)});return}g.getDoc().execCommand("Indent",false,null);if(c){l.getParent(j.getNode(),function(m){if(m.nodeName=="BLOCKQUOTE"){m.dir=m.style.cssText=""}})}},Outdent:function(){var h=this.editor,m=h.dom,k=h.selection,l,g,i,j;i=h.settings.indentation;j=/[a-z%]+$/i.exec(i);i=parseInt(i);if(h.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){f(k.getSelectedBlocks(),function(n){g=Math.max(0,parseInt(n.style.paddingLeft||0)-i);m.setStyle(n,"paddingLeft",g?g+j:"")});return}h.getDoc().execCommand("Outdent",false,null)},mceSetContent:function(h,g){this.editor.setContent(g)},mceToggleVisualAid:function(){var g=this.editor;g.hasVisual=!g.hasVisual;g.addVisual()},mceReplaceContent:function(h,g){var i=this.editor.selection;i.setContent(g.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(i,h){var g=this.editor,j=g.selection,k=g.dom.getParent(j.getNode(),"a");if(d.is(h,"string")){h={href:h}}function l(m){f(h,function(o,n){g.dom.setAttrib(m,n,o)})}if(!k){g.execCommand("CreateLink",false,"javascript:mctmp(0);");f(g.dom.select("a[href=javascript:mctmp(0);]"),function(m){l(m)})}else{if(h.href){l(k)}else{g.dom.remove(k,1)}}},UnLink:function(){var g=this.editor,h=g.selection;if(h.isCollapsed()){h.select(h.getNode())}g.getDoc().execCommand("unlink",false,null);h.collapse(0)},FontName:function(i,h){var j=this,g=j.editor,k=g.selection,l;if(!h){if(k.isCollapsed()){k.select(k.getNode())}}else{if(g.settings.convert_fonts_to_spans){j._applyInlineStyle("span",{style:{fontFamily:h}})}else{g.getDoc().execCommand("FontName",false,h)}}},FontSize:function(j,i){var h=this.editor,l=h.settings,k,g;if(l.convert_fonts_to_spans&&i>=1&&i<=7){g=d.explode(l.font_size_style_values);k=d.explode(l.font_size_classes);if(k){i=k[i-1]||i}else{i=g[i-1]||i}}if(i>=1&&i<=7){h.getDoc().execCommand("FontSize",false,i)}else{this._applyInlineStyle("span",{style:{fontSize:i}})}},queryCommandValue:function(h){var g=this["queryValue"+h];if(g){return g.call(this,h)}return false},queryCommandState:function(h){var g;switch(h){case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":return this.queryStateJustify(h,h.substring(7).toLowerCase());default:if(g=this["queryState"+h]){return g.call(this,h)}}return -1},_queryState:function(h){try{return this.editor.getDoc().queryCommandState(h)}catch(g){}},_queryVal:function(h){try{return this.editor.getDoc().queryCommandValue(h)}catch(g){}},queryValueFontSize:function(){var h=this.editor,g=0,i;if(i=h.dom.getParent(h.selection.getNode(),"span")){g=i.style.fontSize}if(!g&&(b||e)){if(i=h.dom.getParent(h.selection.getNode(),"font")){g=i.size}return g}return g||this._queryVal("FontSize")},queryValueFontName:function(){var h=this.editor,g=0,i;if(i=h.dom.getParent(h.selection.getNode(),"font")){g=i.face}if(i=h.dom.getParent(h.selection.getNode(),"span")){g=i.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}if(!g){g=this._queryVal("FontName")}return g},mceJustify:function(o,p){var k=this.editor,m=k.selection,g=m.getNode(),q=g.nodeName,h,j,i=k.dom,l;if(k.settings.inline_styles&&this.queryStateJustify(o,p)){l=1}h=i.getParent(g,k.dom.isBlock);if(q=="IMG"){if(p=="full"){return}if(l){if(p=="center"){i.setStyle(h||g.parentNode,"textAlign","")}i.setStyle(g,"float","");this.mceRepaint();return}if(p=="center"){if(h&&/^(TD|TH)$/.test(h.nodeName)){h=0}if(!h||h.childNodes.length>1){j=i.create("p");j.appendChild(g.cloneNode(false));if(h){i.insertAfter(j,h)}else{i.insertAfter(j,g)}i.remove(g);g=j.firstChild;h=j}i.setStyle(h,"textAlign",p);i.setStyle(g,"float","")}else{i.setStyle(g,"float",p);i.setStyle(h||g.parentNode,"textAlign","")}this.mceRepaint();return}if(k.settings.inline_styles&&k.settings.forced_root_block){if(l){p=""}f(m.getSelectedBlocks(i.getParent(m.getStart(),i.isBlock),i.getParent(m.getEnd(),i.isBlock)),function(n){i.setAttrib(n,"align","");i.setStyle(n,"textAlign",p=="full"?"justify":p)});return}else{if(!l){k.getDoc().execCommand(o,false,null)}}if(k.settings.inline_styles){if(l){i.getParent(k.selection.getNode(),function(r){if(r.style&&r.style.textAlign){i.setStyle(r,"textAlign","")}});return}f(i.select("*"),function(s){var r=s.align;if(r){if(r=="full"){r="justify"}i.setStyle(s,"textAlign",r);i.setAttrib(s,"align","")}})}},mceSetCSSClass:function(h,g){this.mceSetStyleInfo(0,{command:"setattrib",name:"class",value:g})},getSelectedElement:function(){var w=this,o=w.editor,n=o.dom,s=o.selection,h=s.getRng(),l,k,u,p,j,g,q,i,x,v;if(s.isCollapsed()||h.item){return s.getNode()}v=o.settings.merge_styles_invalid_parents;if(d.is(v,"string")){v=new RegExp(v,"i")}if(c){l=h.duplicate();l.collapse(true);u=l.parentElement();k=h.duplicate();k.collapse(false);p=k.parentElement();if(u!=p){l.move("character",1);u=l.parentElement()}if(u==p){l=h.duplicate();l.moveToElementText(u);if(l.compareEndPoints("StartToStart",h)==0&&l.compareEndPoints("EndToEnd",h)==0){return v&&v.test(u.nodeName)?null:u}}}else{function m(r){return n.getParent(r,"*")}u=h.startContainer;p=h.endContainer;j=h.startOffset;g=h.endOffset;if(!h.collapsed){if(u==p){if(j-g<2){if(u.hasChildNodes()){i=u.childNodes[j];return v&&v.test(i.nodeName)?null:i}}}}if(u.nodeType!=3||p.nodeType!=3){return null}if(j==0){i=m(u);if(i&&i.firstChild!=u){i=null}}if(j==u.nodeValue.length){q=u.nextSibling;if(q&&q.nodeType==1){i=u.nextSibling}}if(g==0){q=p.previousSibling;if(q&&q.nodeType==1){x=q}}if(g==p.nodeValue.length){x=m(p);if(x&&x.lastChild!=p){x=null}}if(i==x){return v&&i&&v.test(i.nodeName)?null:i}}return null},mceSetStyleInfo:function(n,m){var q=this,h=q.editor,j=h.getDoc(),g=h.dom,i,k,r=h.selection,p=m.wrapper||"span",k=r.getBookmark(),o;function l(t,s){if(t.nodeType==1){switch(m.command){case"setattrib":return g.setAttrib(t,m.name,m.value);case"setstyle":return g.setStyle(t,m.name,m.value);case"removeformat":return g.setAttrib(t,"class","")}}}o=h.settings.merge_styles_invalid_parents;if(d.is(o,"string")){o=new RegExp(o,"i")}if((i=q.getSelectedElement())&&!h.settings.force_span_wrappers){l(i,1)}else{j.execCommand("FontName",false,"__");f(g.select("span,font"),function(u){var s,t;if(g.getAttrib(u,"face")=="__"||u.style.fontFamily==="__"){s=g.create(p,{mce_new:"1"});l(s);f(u.childNodes,function(v){s.appendChild(v.cloneNode(true))});g.replace(s,u)}})}f(g.select(p).reverse(),function(t){var s=t.parentNode;if(!g.getAttrib(t,"mce_new")){s=g.getParent(t,"*[mce_new]");if(s){g.remove(t,1)}}});f(g.select(p).reverse(),function(t){var s=t.parentNode;if(!s||!g.getAttrib(t,"mce_new")){return}if(h.settings.force_span_wrappers&&s.nodeName!="SPAN"){return}if(s.nodeName==p.toUpperCase()&&s.childNodes.length==1){return g.remove(s,1)}if(t.nodeType==1&&(!o||!o.test(s.nodeName))&&s.childNodes.length==1){l(s);g.setAttrib(t,"class","")}});f(g.select(p).reverse(),function(s){if(g.getAttrib(s,"mce_new")||(g.getAttribs(s).length<=1&&s.className==="")){if(!g.getAttrib(s,"class")&&!g.getAttrib(s,"style")){return g.remove(s,1)}g.setAttrib(s,"mce_new","")}});r.moveToBookmark(k)},queryStateJustify:function(k,h){var g=this.editor,j=g.selection.getNode(),i=g.dom;if(j&&j.nodeName=="IMG"){if(i.getStyle(j,"float")==h){return 1}return j.parentNode.style.textAlign==h}j=i.getParent(g.selection.getStart(),function(l){return l.nodeType==1&&l.style.textAlign});if(h=="full"){h="justify"}if(g.settings.inline_styles){return(j&&j.style.textAlign==h)}return this._queryState(k)},ForeColor:function(i,h){var g=this.editor;if(g.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{color:h}});return}else{g.getDoc().execCommand("ForeColor",false,h)}},HiliteColor:function(i,k){var h=this,g=h.editor,j=g.getDoc();if(g.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{backgroundColor:k}});return}function l(n){if(!a){return}try{j.execCommand("styleWithCSS",0,n)}catch(m){j.execCommand("useCSS",0,!n)}}if(a||b){l(true);j.execCommand("hilitecolor",false,k);l(false)}else{j.execCommand("BackColor",false,k)}},FormatBlock:function(n,h){var o=this,l=o.editor,p=l.selection,j=l.dom,g,k,m;function i(q){return/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(q.nodeName)}g=j.getParent(p.getNode(),function(q){return i(q)});if(g){if((c&&i(g.parentNode))||g.nodeName=="DIV"){k=l.dom.create(h);f(j.getAttribs(g),function(q){j.setAttrib(k,q.nodeName,j.getAttrib(g,q.nodeName))});m=p.getBookmark();j.replace(k,g,1);p.moveToBookmark(m);l.nodeChanged();return}}h=l.settings.forced_root_block?(h||"<p>"):h;if(h.indexOf("<")==-1){h="<"+h+">"}if(d.isGecko){h=h.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,"$1")}l.getDoc().execCommand("FormatBlock",false,h)},mceCleanup:function(){var h=this.editor,i=h.selection,g=i.getBookmark();h.setContent(h.getContent());i.moveToBookmark(g)},mceRemoveNode:function(j,k){var h=this.editor,i=h.selection,g,l=k||i.getNode();if(l==h.getBody()){return}g=i.getBookmark();h.dom.remove(l,1);i.moveToBookmark(g);h.nodeChanged()},mceSelectNodeDepth:function(i,j){var g=this.editor,h=g.selection,k=0;g.dom.getParent(h.getNode(),function(l){if(l.nodeType==1&&k++==j){h.select(l);g.nodeChanged();return false}},g.getBody())},mceSelectNode:function(h,g){this.editor.selection.select(g)},mceInsertContent:function(g,h){this.editor.selection.setContent(h)},mceInsertRawHTML:function(h,i){var g=this.editor;g.selection.setContent("tiny_mce_marker");g.setContent(g.getContent().replace(/tiny_mce_marker/g,i))},mceRepaint:function(){var i,g,j=this.editor;if(d.isGecko){try{i=j.selection;g=i.getBookmark(true);if(i.getSel()){i.getSel().selectAllChildren(j.getBody())}i.collapse(true);i.moveToBookmark(g)}catch(h){}}},queryStateUnderline:function(){var g=this.editor,h=g.selection.getNode();if(h&&h.nodeName=="A"){return false}return this._queryState("Underline")},queryStateOutdent:function(){var g=this.editor,h;if(g.settings.inline_styles){if((h=g.dom.getParent(g.selection.getStart(),g.dom.isBlock))&&parseInt(h.style.paddingLeft)>0){return true}if((h=g.dom.getParent(g.selection.getEnd(),g.dom.isBlock))&&parseInt(h.style.paddingLeft)>0){return true}}return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList()||(!g.settings.inline_styles&&!!g.dom.getParent(g.selection.getNode(),"BLOCKQUOTE"))},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(g){return g.nodeName==="BLOCKQUOTE"})},_applyInlineStyle:function(o,j,m){var q=this,n=q.editor,l=n.dom,i,p={},k,r;o=o.toUpperCase();if(m&&m.check_classes&&j["class"]){m.check_classes.push(j["class"])}function h(){f(l.select(o).reverse(),function(t){var s=0;f(l.getAttribs(t),function(u){if(u.nodeName.substring(0,1)!="_"&&l.getAttrib(t,u.nodeName)!=""){s++}});if(s==0){l.remove(t,1)}})}function g(){var s;f(l.select("span,font"),function(t){if(t.style.fontFamily=="mceinline"||t.face=="mceinline"){if(!s){s=n.selection.getBookmark()}j._mce_new="1";l.replace(l.create(o,j),t,1)}});f(l.select(o+"[_mce_new]"),function(u){function t(v){if(v.nodeType==1){f(j.style,function(x,w){l.setStyle(v,w,"")});if(j["class"]&&v.className&&m){f(m.check_classes,function(w){if(l.hasClass(v,w)){l.removeClass(v,w)}})}}}f(l.select(o,u),t);if(u.parentNode&&u.parentNode.nodeType==1&&u.parentNode.childNodes.length==1){t(u.parentNode)}l.getParent(u.parentNode,function(v){if(v.nodeType==1){if(j.style){f(j.style,function(y,x){var w;if(!p[x]&&(w=l.getStyle(v,x))){if(w===y){l.setStyle(u,x,"")}p[x]=1}})}if(j["class"]&&v.className&&m){f(m.check_classes,function(w){if(l.hasClass(v,w)){l.removeClass(u,w)}})}}return false});u.removeAttribute("_mce_new")});h();n.selection.moveToBookmark(s);return !!s}n.focus();n.getDoc().execCommand("FontName",false,"mceinline");g();if(k=q._applyInlineStyle.keyhandler){n.onKeyUp.remove(k);n.onKeyPress.remove(k);n.onKeyDown.remove(k);n.onSetContent.remove(q._applyInlineStyle.chandler)}if(n.selection.isCollapsed()){if(!c){f(l.getParents(n.selection.getNode(),"span"),function(s){f(j.style,function(u,t){var w;if(w=l.getStyle(s,t)){if(w==u){l.setStyle(s,t,"");r=2;return false}r=1;return false}});if(r){return false}});if(r==2){i=n.selection.getBookmark();h();n.selection.moveToBookmark(i);window.setTimeout(function(){n.nodeChanged()},1);return}}q._pendingStyles=d.extend(q._pendingStyles||{},j.style);q._applyInlineStyle.chandler=n.onSetContent.add(function(){delete q._pendingStyles});q._applyInlineStyle.keyhandler=k=function(s){if(q._pendingStyles){j.style=q._pendingStyles;delete q._pendingStyles}if(g()){n.onKeyDown.remove(q._applyInlineStyle.keyhandler);n.onKeyPress.remove(q._applyInlineStyle.keyhandler)}if(s.type=="keyup"){n.onKeyUp.remove(q._applyInlineStyle.keyhandler)}};n.onKeyDown.add(k);n.onKeyPress.add(k);n.onKeyUp.add(k)}else{q._pendingStyles=0}}})})(tinymce);(function(a){a.create("tinymce.UndoManager",{index:0,data:null,typing:0,UndoManager:function(c){var d=this,b=a.util.Dispatcher;d.editor=c;d.data=[];d.onAdd=new b(this);d.onUndo=new b(this);d.onRedo=new b(this)},add:function(d){var g=this,f,e=g.editor,c,h=e.settings,j;d=d||{};d.content=d.content||e.getContent({format:"raw",no_events:1});d.content=d.content.replace(/^\s*|\s*$/g,"");j=g.data[g.index>0&&(g.index==0||g.index==g.data.length)?g.index-1:g.index];if(!d.initial&&j&&d.content==j.content){return null}if(h.custom_undo_redo_levels){if(g.data.length>h.custom_undo_redo_levels){for(f=0;f<g.data.length-1;f++){g.data[f]=g.data[f+1]}g.data.length--;g.index=g.data.length}}if(h.custom_undo_redo_restore_selection&&!d.initial){d.bookmark=c=d.bookmark||e.selection.getBookmark()}if(g.index<g.data.length){g.index++}if(g.data.length===0&&!d.initial){return null}g.data.length=g.index+1;g.data[g.index++]=d;if(d.initial){g.index=0}if(g.data.length==2&&g.data[0].initial){g.data[0].bookmark=c}g.onAdd.dispatch(g,d);e.isNotDirty=0;return d},undo:function(){var e=this,c=e.editor,b=b,d;if(e.typing){e.add();e.typing=0}if(e.index>0){if(e.index==e.data.length&&e.index>1){d=e.index;e.typing=0;if(!e.add()){e.index=d}--e.index}b=e.data[--e.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);e.onUndo.dispatch(e,b)}return b},redo:function(){var d=this,c=d.editor,b=null;if(d.index<d.data.length-1){b=d.data[++d.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);d.onRedo.dispatch(d,b)}return b},clear:function(){var b=this;b.data=[];b.index=0;b.typing=0;b.add({initial:true})},hasUndo:function(){return this.index!=0||this.typing},hasRedo:function(){return this.index<this.data.length-1}})})(tinymce);(function(e){var b,d,a,c,f,h;b=e.dom.Event;d=e.isIE;a=e.isGecko;c=e.isOpera;f=e.each;h=e.extend;function g(i){i=i.innerHTML;i=i.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");i=i.replace(/<[^>]+>/g,"");return i.replace(/[ \t\r\n]+/g,"")==""}e.create("tinymce.ForceBlocks",{ForceBlocks:function(j){var k=this,l=j.settings,m;k.editor=j;k.dom=j.dom;m=(l.forced_root_block||"p").toLowerCase();l.element=m.toUpperCase();j.onPreInit.add(k.setup,k);k.reOpera=new RegExp("(\\u00a0| | )</"+m+">","gi");k.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,m),"gi");k.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,m),"gi");k.reNbsp2BR2=new RegExp("<%p()([^>]+)>( | )<\\/%p>|<%p>( | )<\\/%p>".replace(/%p/g,m),"gi");k.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,m),"gi");function i(n,p){if(c){p.content=p.content.replace(k.reOpera,"</"+m+">")}p.content=p.content.replace(k.rePadd,"<"+m+"$1$2$3$4$5$6>\u00a0</"+m+">");if(!d&&!c&&p.set){p.content=p.content.replace(k.reNbsp2BR1,"<"+m+"$1$2><br /></"+m+">");p.content=p.content.replace(k.reNbsp2BR2,"<"+m+"$1$2><br /></"+m+">")}else{p.content=p.content.replace(k.reBR2Nbsp,"<"+m+"$1$2>\u00a0</"+m+">")}}j.onBeforeSetContent.add(i);j.onPostProcess.add(i);if(l.forced_root_block){j.onInit.add(k.forceRoots,k);j.onSetContent.add(k.forceRoots,k);j.onBeforeGetContent.add(k.forceRoots,k)}},setup:function(){var j=this,i=j.editor,k=i.settings;if(k.forced_root_block){i.onKeyUp.add(j.forceRoots,j);i.onPreProcess.add(j.forceRoots,j)}if(k.force_br_newlines){if(d){i.onKeyPress.add(function(m,p){var q,o=m.selection;if(p.keyCode==13&&o.getNode().nodeName!="LI"){o.setContent('<br id="__" /> ',{format:"raw"});q=m.dom.get("__");q.removeAttribute("id");o.select(q);o.collapse();return b.cancel(p)}})}return}if(!d&&k.force_p_newlines){i.onKeyPress.add(function(m,n){if(n.keyCode==13&&!n.shiftKey){if(!j.insertPara(n)){b.cancel(n)}}});if(a){i.onKeyDown.add(function(m,n){if((n.keyCode==8||n.keyCode==46)&&!n.shiftKey){j.backspaceDelete(n,n.keyCode==8)}})}}function l(n,m){var o=i.dom.create(m);f(n.attributes,function(p){if(p.specified&&p.nodeValue){o.setAttribute(p.nodeName.toLowerCase(),p.nodeValue)}});f(n.childNodes,function(p){o.appendChild(p.cloneNode(true))});n.parentNode.replaceChild(o,n);return o}i.onPreProcess.add(function(m,n){f(m.dom.select("p,h1,h2,h3,h4,h5,h6,div",n.node),function(o){if(g(o)){f(m.dom.select("span,em,strong,b,i",n.node),function(p){if(!p.hasChildNodes()){p.appendChild(m.getDoc().createTextNode("\u00a0"));return false}})}})});if(d){if(k.element!="P"){i.onKeyPress.add(function(m,n){j.lastElm=m.selection.getNode().nodeName});i.onKeyUp.add(function(o,q){var s,p=o.selection,r=p.getNode(),m=o.getBody();if(m.childNodes.length===1&&r.nodeName=="P"){r=l(r,k.element);p.select(r);p.collapse();o.nodeChanged()}else{if(q.keyCode==13&&!q.shiftKey&&j.lastElm!="P"){s=o.dom.getParent(r,"p");if(s){l(s,k.element);o.nodeChanged()}}}})}}},find:function(o,k,l){var j=this.editor,i=j.getDoc().createTreeWalker(o,4,null,false),m=-1;while(o=i.nextNode()){m++;if(k==0&&o==l){return m}if(k==1&&m==l){return o}}return -1},forceRoots:function(p,D){var u=this,p=u.editor,H=p.getBody(),E=p.getDoc(),K=p.selection,v=K.getSel(),w=K.getRng(),I=-2,o,B,j,k,F=-16777215;var G,l,J,A,x,m=H.childNodes,z,y,q;for(z=m.length-1;z>=0;z--){G=m[z];if(G.nodeType==3||(!u.dom.isBlock(G)&&G.nodeType!=8)){if(!l){if(G.nodeType!=3||/[^\s]/g.test(G.nodeValue)){if(I==-2&&w){if(!d){if(w.startContainer.nodeType==1&&(y=w.startContainer.childNodes[w.startOffset])&&y.nodeType==1){q=y.getAttribute("id");y.setAttribute("id","__mce")}else{if(p.dom.getParent(w.startContainer,function(i){return i===H})){B=w.startOffset;j=w.endOffset;I=u.find(H,0,w.startContainer);o=u.find(H,0,w.endContainer)}}}else{k=E.body.createTextRange();k.moveToElementText(H);k.collapse(1);J=k.move("character",F)*-1;k=w.duplicate();k.collapse(1);A=k.move("character",F)*-1;k=w.duplicate();k.collapse(0);x=(k.move("character",F)*-1)-A;I=A-J;o=x}}l=p.dom.create(p.settings.forced_root_block);l.appendChild(G.cloneNode(1));G.parentNode.replaceChild(l,G)}}else{if(l.hasChildNodes()){l.insertBefore(G,l.firstChild)}else{l.appendChild(G)}}}else{l=null}}if(I!=-2){if(!d){l=H.getElementsByTagName(p.settings.element)[0];w=E.createRange();if(I!=-1){w.setStart(u.find(H,1,I),B)}else{w.setStart(l,0)}if(o!=-1){w.setEnd(u.find(H,1,o),j)}else{w.setEnd(l,0)}if(v){v.removeAllRanges();v.addRange(w)}}else{try{w=v.createRange();w.moveToElementText(H);w.collapse(1);w.moveStart("character",I);w.moveEnd("character",o);w.select()}catch(C){}}}else{if(!d&&(y=p.dom.get("__mce"))){if(q){y.setAttribute("id",q)}else{y.removeAttribute("id")}w=E.createRange();w.setStartBefore(y);w.setEndBefore(y);K.setRng(w)}}},getParentBlock:function(j){var i=this.dom;return i.getParent(j,i.isBlock)},insertPara:function(M){var A=this,o=A.editor,I=o.dom,N=o.getDoc(),R=o.settings,B=o.selection.getSel(),C=B.getRangeAt(0),Q=N.body;var F,G,D,K,J,l,j,m,q,i,x,P,k,p,E,H=I.getViewPort(o.getWin()),w,z,v;F=N.createRange();F.setStart(B.anchorNode,B.anchorOffset);F.collapse(true);G=N.createRange();G.setStart(B.focusNode,B.focusOffset);G.collapse(true);D=F.compareBoundaryPoints(F.START_TO_END,G)<0;K=D?B.anchorNode:B.focusNode;J=D?B.anchorOffset:B.focusOffset;l=D?B.focusNode:B.anchorNode;j=D?B.focusOffset:B.anchorOffset;if(K===l&&/^(TD|TH)$/.test(K.nodeName)){if(K.firstChild.nodeName=="BR"){I.remove(K.firstChild)}if(K.childNodes.length==0){o.dom.add(K,R.element,null,"<br />");P=o.dom.add(K,R.element,null,"<br />")}else{E=K.innerHTML;K.innerHTML="";o.dom.add(K,R.element,null,E);P=o.dom.add(K,R.element,null,"<br />")}C=N.createRange();C.selectNodeContents(P);C.collapse(1);o.selection.setRng(C);return false}if(K==Q&&l==Q&&Q.firstChild&&o.dom.isBlock(Q.firstChild)){K=l=K.firstChild;J=j=0;F=N.createRange();F.setStart(K,0);G=N.createRange();G.setStart(l,0)}K=K.nodeName=="HTML"?N.body:K;K=K.nodeName=="BODY"?K.firstChild:K;l=l.nodeName=="HTML"?N.body:l;l=l.nodeName=="BODY"?l.firstChild:l;m=A.getParentBlock(K);q=A.getParentBlock(l);i=m?m.nodeName:R.element;if(A.dom.getParent(m,"ol,ul,pre")){return true}if(m&&(m.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(I.getStyle(m,"position",1)))){i=R.element;m=null}if(q&&(q.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(I.getStyle(m,"position",1)))){i=R.element;q=null}if(/(TD|TABLE|TH|CAPTION)/.test(i)||(m&&i=="DIV"&&/left|right/gi.test(I.getStyle(m,"float",1)))){i=R.element;m=q=null}x=(m&&m.nodeName==i)?m.cloneNode(0):o.dom.create(i);P=(q&&q.nodeName==i)?q.cloneNode(0):o.dom.create(i);P.removeAttribute("id");if(/^(H[1-6])$/.test(i)&&K.nodeValue&&J==K.nodeValue.length){P=o.dom.create(R.element)}E=k=K;do{if(E==Q||E.nodeType==9||A.dom.isBlock(E)||/(TD|TABLE|TH|CAPTION)/.test(E.nodeName)){break}k=E}while((E=E.previousSibling?E.previousSibling:E.parentNode));E=p=l;do{if(E==Q||E.nodeType==9||A.dom.isBlock(E)||/(TD|TABLE|TH|CAPTION)/.test(E.nodeName)){break}p=E}while((E=E.nextSibling?E.nextSibling:E.parentNode));if(k.nodeName==i){F.setStart(k,0)}else{F.setStartBefore(k)}F.setEnd(K,J);x.appendChild(F.cloneContents()||N.createTextNode(""));try{G.setEndAfter(p)}catch(L){}G.setStart(l,j);P.appendChild(G.cloneContents()||N.createTextNode(""));C=N.createRange();if(!k.previousSibling&&k.parentNode.nodeName==i){C.setStartBefore(k.parentNode)}else{if(F.startContainer.nodeName==i&&F.startOffset==0){C.setStartBefore(F.startContainer)}else{C.setStart(F.startContainer,F.startOffset)}}if(!p.nextSibling&&p.parentNode.nodeName==i){C.setEndAfter(p.parentNode)}else{C.setEnd(G.endContainer,G.endOffset)}C.deleteContents();if(c){o.getWin().scrollTo(0,H.y)}if(x.firstChild&&x.firstChild.nodeName==i){x.innerHTML=x.firstChild.innerHTML}if(P.firstChild&&P.firstChild.nodeName==i){P.innerHTML=P.firstChild.innerHTML}if(g(x)){x.innerHTML="<br />"}function O(y,s){var r=[],T,S,t;y.innerHTML="";if(R.keep_styles){S=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(S.nodeName)){T=S.cloneNode(false);I.setAttrib(T,"id","");r.push(T)}}while(S=S.parentNode)}if(r.length>0){for(t=r.length-1,T=y;t>=0;t--){T=T.appendChild(r[t])}r[0].innerHTML=c?" ":"<br />";return r[0]}else{y.innerHTML=c?" ":"<br />"}}if(g(P)){v=O(P,l)}if(c&&parseFloat(opera.version())<9.5){C.insertNode(x);C.insertNode(P)}else{C.insertNode(P);C.insertNode(x)}P.normalize();x.normalize();function u(r){return N.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false).nextNode()||r}C=N.createRange();C.selectNodeContents(a?u(v||P):v||P);C.collapse(1);B.removeAllRanges();B.addRange(C);w=o.dom.getPos(P).y;z=P.clientHeight;if(w<H.y||w+z>H.y+H.h){o.getWin().scrollTo(0,w<H.y?w:w-H.h+25)}return false},backspaceDelete:function(l,u){var x=this,k=x.editor,p=k.getBody(),j,m=k.selection,i=m.getRng(),o=i.startContainer,j,q,s;if(o&&k.dom.isBlock(o)&&!/^(TD|TH)$/.test(o.nodeName)&&u){if(o.childNodes.length==0||(o.childNodes.length==1&&o.firstChild.nodeName=="BR")){j=o;while((j=j.previousSibling)&&!k.dom.isBlock(j)){}if(j){if(o!=p.firstChild){q=k.dom.doc.createTreeWalker(j,NodeFilter.SHOW_TEXT,null,false);while(s=q.nextNode()){j=s}i=k.getDoc().createRange();i.setStart(j,j.nodeValue?j.nodeValue.length:0);i.setEnd(j,j.nodeValue?j.nodeValue.length:0);m.setRng(i);k.dom.remove(o)}return b.cancel(l)}}}function v(n){var r;n=n.target;if(n&&n.parentNode&&n.nodeName=="BR"&&(j=x.getParentBlock(n))){r=n.previousSibling;b.remove(p,"DOMNodeInserted",v);if(r&&r.nodeType==3&&/\s+$/.test(r.nodeValue)){return}if(n.previousSibling||n.nextSibling){k.dom.remove(n)}}}b._add(p,"DOMNodeInserted",v);window.setTimeout(function(){b._remove(p,"DOMNodeInserted",v)},1)}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){i.execCommand(p.cmd,p.ui||false,p.value)}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark("simple")});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.CommandManager=function(){var c={},b={},d={};function e(i,h,g,f){if(typeof(h)=="string"){h=[h]}a.each(h,function(j){i[j.toLowerCase()]={func:g,scope:f}})}a.extend(this,{add:function(h,g,f){e(c,h,g,f)},addQueryStateHandler:function(h,g,f){e(b,h,g,f)},addQueryValueHandler:function(h,g,f){e(d,h,g,f)},execCommand:function(g,j,i,h,f){if(j=c[j.toLowerCase()]){if(j.func.call(g||j.scope,i,h,f)!==false){return true}}},queryCommandValue:function(){if(cmd=d[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}},queryCommandState:function(){if(cmd=b[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}}})};a.GlobalCommands=new a.CommandManager()})(tinymce);(function(b){function a(i,d,h,m){var j,g,e,l,f;function k(p,o){do{if(p.parentNode==o){return p}p=p.parentNode}while(p)}function c(o){m(o);b.walk(o,m,"childNodes")}j=i.findCommonAncestor(d,h);e=k(d,j)||d;l=k(h,j)||h;for(g=d;g&&g!=e;g=g.parentNode){for(f=g.nextSibling;f;f=f.nextSibling){c(f)}}if(e!=l){for(g=e.nextSibling;g&&g!=l;g=g.nextSibling){c(g)}}else{c(e)}for(g=h;g&&g!=l;g=g.parentNode){for(f=g.previousSibling;f;f=f.previousSibling){c(f)}}}b.GlobalCommands.add("RemoveFormat",function(){var m=this,l=m.dom,u=m.selection,d=u.getRng(1),e=[],h,f,j,q,g,o,c,i;function k(s){var r;l.getParent(s,function(v){if(l.is(v,m.getParam("removeformat_selector"))){r=v}return l.isBlock(v)},m.getBody());return r}function p(r){if(l.is(r,m.getParam("removeformat_selector"))){e.push(r)}}function t(r){p(r);b.walk(r,p,"childNodes")}h=u.getBookmark();q=d.startContainer;o=d.endContainer;g=d.startOffset;c=d.endOffset;q=q.nodeType==1?q.childNodes[Math.min(g,q.childNodes.length-1)]:q;o=o.nodeType==1?o.childNodes[Math.min(g==c?c:c-1,o.childNodes.length-1)]:o;if(q==o){f=k(q);if(q.nodeType==3){if(f&&f.nodeType==1){i=q.splitText(g);i.splitText(c-g);l.split(f,i);u.moveToBookmark(h)}return}t(l.split(f,q)||q)}else{f=k(q);j=k(o);if(f){if(q.nodeType==3){if(g==q.nodeValue.length){q.nodeValue+="\uFEFF"}q=q.splitText(g)}}if(j){if(o.nodeType==3){o.splitText(c)}}if(f&&f==j){l.replace(l.create("span",{id:"__end"},o.cloneNode(true)),o)}if(f){f=l.split(f,q)}else{f=q}if(i=l.get("__end")){o=i;j=k(o)}if(j){j=l.split(j,o)}else{j=o}a(l,f,j,p);if(q.nodeValue=="\uFEFF"){q.nodeValue=""}t(o);t(q)}b.each(e,function(r){l.remove(r,1)});l.remove("__end",1);u.moveToBookmark(h)})})(tinymce);(function(a){a.GlobalCommands.add("mceBlockQuote",function(){var j=this,o=j.selection,f=j.dom,l,k,e,d,p,c,m,h,b;function g(i){return f.getParent(i,function(q){return q.nodeName==="BLOCKQUOTE"})}l=f.getParent(o.getStart(),f.isBlock);k=f.getParent(o.getEnd(),f.isBlock);if(p=g(l)){if(l!=k||l.childNodes.length>1||(l.childNodes.length==1&&l.firstChild.nodeName!="BR")){d=o.getBookmark()}if(g(k)){m=p.cloneNode(false);while(e=k.nextSibling){m.appendChild(e.parentNode.removeChild(e))}}if(m){f.insertAfter(m,p)}b=o.getSelectedBlocks(l,k);for(h=b.length-1;h>=0;h--){f.insertAfter(b[h],p)}if(/^\s*$/.test(p.innerHTML)){f.remove(p,1)}if(m&&/^\s*$/.test(m.innerHTML)){f.remove(m,1)}if(!d){if(!a.isIE){c=j.getDoc().createRange();c.setStart(l,0);c.setEnd(l,0);o.setRng(c)}else{o.select(l);o.collapse(0);if(f.getParent(o.getStart(),f.isBlock)!=l){c=o.getRng();c.move("character",-1);c.select()}}}else{j.selection.moveToBookmark(d)}return}if(a.isIE&&!l&&!k){j.getDoc().execCommand("Indent");e=g(o.getNode());e.style.margin=e.dir="";return}if(!l||!k){return}if(l!=k||l.childNodes.length>1||(l.childNodes.length==1&&l.firstChild.nodeName!="BR")){d=o.getBookmark()}a.each(o.getSelectedBlocks(g(o.getStart()),g(o.getEnd())),function(i){if(i.nodeName=="BLOCKQUOTE"&&!p){p=i;return}if(!p){p=f.create("blockquote");i.parentNode.insertBefore(p,i)}if(i.nodeName=="BLOCKQUOTE"&&p){e=i.firstChild;while(e){p.appendChild(e.cloneNode(true));e=e.nextSibling}f.remove(i);return}p.appendChild(f.remove(i))});if(!d){if(!a.isIE){c=j.getDoc().createRange();c.setStart(l,0);c.setEnd(l,0);o.setRng(c)}else{o.select(l);o.collapse(1)}}else{o.moveToBookmark(d)}})})(tinymce);(function(a){a.each(["Cut","Copy","Paste"],function(b){a.GlobalCommands.add(b,function(){var c=this,e=c.getDoc();try{e.execCommand(b,false,null);if(!e.queryCommandSupported(b)){throw"Error"}}catch(d){c.windowManager.alert(c.getLang("clipboard_no_support"))}})})})(tinymce);(function(a){a.GlobalCommands.add("InsertHorizontalRule",function(){if(a.isOpera){return this.getDoc().execCommand("InsertHorizontalRule",false,"")}this.selection.setContent("<hr />")})})(tinymce);(function(){var a=tinymce.GlobalCommands;a.add(["mceEndUndoLevel","mceAddUndoLevel"],function(){this.undoManager.add()});a.add("Undo",function(){var b=this;if(b.settings.custom_undo_redo){b.undoManager.undo();b.nodeChanged();return true}return false});a.add("Redo",function(){var b=this;if(b.settings.custom_undo_redo){b.undoManager.redo();b.nodeChanged();return true}return false})})();
+var tinymce={majorVersion:"3",minorVersion:"2.7",releaseDate:"2009-09-22",_init:function(){var o=this,k=document,l=window,j=navigator,b=j.userAgent,h,a,g,f,e,m;o.isOpera=l.opera&&opera.buildNumber;o.isWebKit=/WebKit/.test(b);o.isIE=!o.isWebKit&&!o.isOpera&&(/MSIE/gi).test(b)&&(/Explorer/gi).test(j.appName);o.isIE6=o.isIE&&/MSIE [56]/.test(b);o.isGecko=!o.isWebKit&&/Gecko/.test(b);o.isMac=b.indexOf("Mac")!=-1;o.isAir=/adobeair/i.test(b);if(l.tinyMCEPreInit){o.suffix=tinyMCEPreInit.suffix;o.baseURL=tinyMCEPreInit.base;o.query=tinyMCEPreInit.query;return}o.suffix="";a=k.getElementsByTagName("base");for(h=0;h<a.length;h++){if(m=a[h].href){if(/^https?:\/\/[^\/]+$/.test(m)){m+="/"}f=m?m.match(/.*\//)[0]:""}}function c(d){if(d.src&&/tiny_mce(|_gzip|_jquery|_prototype)(_dev|_src)?.js/.test(d.src)){if(/_(src|dev)\.js/g.test(d.src)){o.suffix="_src"}if((e=d.src.indexOf("?"))!=-1){o.query=d.src.substring(e+1)}o.baseURL=d.src.substring(0,d.src.lastIndexOf("/"));if(f&&o.baseURL.indexOf("://")==-1&&o.baseURL.indexOf("/")!==0){o.baseURL=f+o.baseURL}return o.baseURL}return null}a=k.getElementsByTagName("script");for(h=0;h<a.length;h++){if(c(a[h])){return}}g=k.getElementsByTagName("head")[0];if(g){a=g.getElementsByTagName("script");for(h=0;h<a.length;h++){if(c(a[h])){return}}}return},is:function(b,a){var c=typeof(b);if(!a){return c!="undefined"}if(a=="array"&&(b.hasOwnProperty&&b instanceof Array)){return true}return c==a},each:function(d,a,c){var e,b;if(!d){return 0}c=c||d;if(typeof(d.length)!="undefined"){for(e=0,b=d.length;e<b;e++){if(a.call(c,d[e],e,d)===false){return 0}}}else{for(e in d){if(d.hasOwnProperty(e)){if(a.call(c,d[e],e,d)===false){return 0}}}}return 1},map:function(b,c){var d=[];tinymce.each(b,function(a){d.push(c(a))});return d},grep:function(b,c){var d=[];tinymce.each(b,function(a){if(!c||c(a)){d.push(a)}});return d},inArray:function(c,d){var e,b;if(c){for(e=0,b=c.length;e<b;e++){if(c[e]===d){return e}}}return -1},extend:function(f,d){var c,b=arguments;for(c=1;c<b.length;c++){d=b[c];tinymce.each(d,function(a,e){if(typeof(a)!=="undefined"){f[e]=a}})}return f},trim:function(a){return(a?""+a:"").replace(/^\s*|\s*$/g,"")},create:function(j,a){var i=this,b,e,f,g,d,h=0;j=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(j);f=j[3].match(/(^|\.)(\w+)$/i)[2];e=i.createNS(j[3].replace(/\.\w+$/,""));if(e[f]){return}if(j[2]=="static"){e[f]=a;if(this.onCreate){this.onCreate(j[2],j[3],e[f])}return}if(!a[f]){a[f]=function(){};h=1}e[f]=a[f];i.extend(e[f].prototype,a);if(j[5]){b=i.resolve(j[5]).prototype;g=j[5].match(/\.(\w+)$/i)[1];d=e[f];if(h){e[f]=function(){return b[g].apply(this,arguments)}}else{e[f]=function(){this.parent=b[g];return d.apply(this,arguments)}}e[f].prototype[f]=e[f];i.each(b,function(c,k){e[f].prototype[k]=b[k]});i.each(a,function(c,k){if(b[k]){e[f].prototype[k]=function(){this.parent=b[k];return c.apply(this,arguments)}}else{if(k!=f){e[f].prototype[k]=c}}})}i.each(a["static"],function(c,k){e[f][k]=c});if(this.onCreate){this.onCreate(j[2],j[3],e[f].prototype)}},walk:function(c,b,d,a){a=a||this;if(c){if(d){c=c[d]}tinymce.each(c,function(f,e){if(b.call(a,f,e,d)===false){return false}tinymce.walk(f,b,d,a)})}},createNS:function(d,c){var b,a;c=c||window;d=d.split(".");for(b=0;b<d.length;b++){a=d[b];if(!c[a]){c[a]={}}c=c[a]}return c},resolve:function(d,c){var b,a;c=c||window;d=d.split(".");for(b=0,a=d.length;b<a;b++){c=c[d[b]];if(!c){break}}return c},addUnload:function(e,d){var c=this,a=window;e={func:e,scope:d||this};if(!c.unloads){function b(){var f=c.unloads,h,i;if(f){for(i in f){h=f[i];if(h&&h.func){h.func.call(h.scope,1)}}if(a.detachEvent){a.detachEvent("onbeforeunload",g);a.detachEvent("onunload",b)}else{if(a.removeEventListener){a.removeEventListener("unload",b,false)}}c.unloads=h=f=a=b=0;if(window.CollectGarbage){window.CollectGarbage()}}}function g(){var h=document;if(h.readyState=="interactive"){function f(){h.detachEvent("onstop",f);if(b){b()}h=0}if(h){h.attachEvent("onstop",f)}window.setTimeout(function(){if(h){h.detachEvent("onstop",f)}},0)}}if(a.attachEvent){a.attachEvent("onunload",b);a.attachEvent("onbeforeunload",g)}else{if(a.addEventListener){a.addEventListener("unload",b,false)}}c.unloads=[e]}else{c.unloads.push(e)}return e},removeUnload:function(c){var a=this.unloads,b=null;tinymce.each(a,function(e,d){if(e&&e.func==c){a.splice(d,1);b=c;return false}});return b},explode:function(a,b){return a?tinymce.map(a.split(b||","),tinymce.trim):a},_addVer:function(b){var a;if(!this.query){return b}a=(b.indexOf("?")==-1?"?":"&")+this.query;if(b.indexOf("#")==-1){return b+a}return b.replace("#",a+"#")}};window.tinymce=tinymce;tinymce._init();tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;e=tinymce.trim(e);g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about|data):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^\w*:?\/\//.test(e)){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c<e.length;c++){a+=(c>0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(c){var e=c.each,b=c.is;var d=c.isWebKit,a=c.isIE;c.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(i,g){var f=this;f.doc=i;f.win=window;f.files={};f.cssFlicker=false;f.counter=0;f.boxModel=!c.isIE||i.compatMode=="CSS1Compat";f.stdMode=i.documentMode===8;f.settings=g=c.extend({keep_values:false,hex_colors:1,process_html:1},g);if(c.isIE6){try{i.execCommand("BackgroundImageCache",false,true)}catch(h){f.cssFlicker=true}}c.addUnload(f.destroy,f)},getRoot:function(){var f=this,g=f.settings;return(g&&f.get(g.root_element))||f.doc.body},getViewPort:function(g){var h,f;g=!g?this.win:g;h=g.document;f=this.boxModel?h.documentElement:h.body;return{x:g.pageXOffset||f.scrollLeft,y:g.pageYOffset||f.scrollTop,w:g.innerWidth||f.clientWidth,h:g.innerHeight||f.clientHeight}},getRect:function(i){var h,f=this,g;i=f.get(i);h=f.getPos(i);g=f.getSize(i);return{x:h.x,y:h.y,w:g.w,h:g.h}},getSize:function(j){var g=this,f,i;j=g.get(j);f=g.getStyle(j,"width");i=g.getStyle(j,"height");if(f.indexOf("px")===-1){f=0}if(i.indexOf("px")===-1){i=0}return{w:parseInt(f)||j.offsetWidth||j.clientWidth,h:parseInt(i)||j.offsetHeight||j.clientHeight}},getParent:function(i,h,g){return this.getParents(i,h,g,false)},getParents:function(p,k,i,m){var h=this,g,j=h.settings,l=[];p=h.get(p);m=m===undefined;if(j.strict_root){i=i||h.getRoot()}if(b(k,"string")){g=k;if(k==="*"){k=function(f){return f.nodeType==1}}else{k=function(f){return h.is(f,g)}}}while(p){if(p==i||!p.nodeType||p.nodeType===9){break}if(!k||k(p)){if(m){l.push(p)}else{return p}}p=p.parentNode}return m?l:null},get:function(f){var g;if(f&&this.doc&&typeof(f)=="string"){g=f;f=this.doc.getElementById(f);if(f&&f.id!==g){return this.doc.getElementsByName(g)[1]}}return f},getNext:function(g,f){return this._findSib(g,f,"nextSibling")},getPrev:function(g,f){return this._findSib(g,f,"previousSibling")},select:function(h,g){var f=this;return c.dom.Sizzle(h,f.get(g)||f.get(f.settings.root_element)||f.doc,[])},is:function(g,f){return c.dom.Sizzle.matches(f,g.nodeType?[g]:g).length>0},add:function(j,l,f,i,k){var g=this;return this.run(j,function(n){var m,h;m=b(l,"string")?g.doc.createElement(l):l;g.setAttribs(m,f);if(i){if(i.nodeType){m.appendChild(i)}else{g.setHTML(m,i)}}return !k?n.appendChild(m):m})},create:function(i,f,g){return this.add(this.doc.createElement(i),i,f,g,1)},createHTML:function(m,f,j){var l="",i=this,g;l+="<"+m;for(g in f){if(f.hasOwnProperty(g)){l+=" "+g+'="'+i.encode(f[g])+'"'}}if(c.is(j)){return l+">"+j+"</"+m+">"}return l+" />"},remove:function(h,f){var g=this;return this.run(h,function(m){var l,k,j;l=m.parentNode;if(!l){return null}if(f){for(j=m.childNodes.length-1;j>=0;j--){g.insertAfter(m.childNodes[j],m)}}if(g.fixPsuedoLeaks){l=m.cloneNode(true);f="IELeakGarbageBin";k=g.get(f)||g.add(g.doc.body,"div",{id:f,style:"display:none"});k.appendChild(m);k.innerHTML="";return l}return l.removeChild(m)})},setStyle:function(i,f,g){var h=this;return h.run(i,function(l){var k,j;k=l.style;f=f.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(h.pixelStyles.test(f)&&(c.is(g,"number")||/^[\-0-9\.]+$/.test(g))){g+="px"}switch(f){case"opacity":if(a){k.filter=g===""?"":"alpha(opacity="+(g*100)+")";if(!i.currentStyle||!i.currentStyle.hasLayout){k.display="inline-block"}}k[f]=k["-moz-opacity"]=k["-khtml-opacity"]=g||"";break;case"float":a?k.styleFloat=g:k.cssFloat=g;break;default:k[f]=g||""}if(h.settings.update_styles){h.setAttrib(l,"mce_style")}})},getStyle:function(i,f,h){i=this.get(i);if(!i){return false}if(this.doc.defaultView&&h){f=f.replace(/[A-Z]/g,function(j){return"-"+j});try{return this.doc.defaultView.getComputedStyle(i,null).getPropertyValue(f)}catch(g){return null}}f=f.replace(/-(\D)/g,function(k,j){return j.toUpperCase()});if(f=="float"){f=a?"styleFloat":"cssFloat"}if(i.currentStyle&&h){return i.currentStyle[f]}return i.style[f]},setStyles:function(i,j){var g=this,h=g.settings,f;f=h.update_styles;h.update_styles=0;e(j,function(k,l){g.setStyle(i,l,k)});h.update_styles=f;if(h.update_styles){g.setAttrib(i,h.cssText)}},setAttrib:function(h,i,f){var g=this;if(!h||!i){return}if(g.settings.strict){i=i.toLowerCase()}return this.run(h,function(k){var j=g.settings;switch(i){case"style":if(!b(f,"string")){e(f,function(l,m){g.setStyle(k,m,l)});return}if(j.keep_values){if(f&&!g._isRes(f)){k.setAttribute("mce_style",f,2)}else{k.removeAttribute("mce_style",2)}}k.style.cssText=f;break;case"class":k.className=f||"";break;case"src":case"href":if(j.keep_values){if(j.url_converter){f=j.url_converter.call(j.url_converter_scope||g,f,i,k)}g.setAttrib(k,"mce_"+i,f,2)}break;case"shape":k.setAttribute("mce_style",f);break}if(b(f)&&f!==null&&f.length!==0){k.setAttribute(i,""+f,2)}else{k.removeAttribute(i,2)}})},setAttribs:function(g,h){var f=this;return this.run(g,function(i){e(h,function(j,k){f.setAttrib(i,k,j)})})},getAttrib:function(i,j,h){var f,g=this;i=g.get(i);if(!i||i.nodeType!==1){return false}if(!b(h)){h=""}if(/^(src|href|style|coords|shape)$/.test(j)){f=i.getAttribute("mce_"+j);if(f){return f}}if(a&&g.props[j]){f=i[g.props[j]];f=f&&f.nodeValue?f.nodeValue:f}if(!f){f=i.getAttribute(j,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(j)){if(i[g.props[j]]===true&&f===""){return j}return f?j:""}if(i.nodeName==="FORM"&&i.getAttributeNode(j)){return i.getAttributeNode(j).nodeValue}if(j==="style"){f=f||i.style.cssText;if(f){f=g.serializeStyle(g.parseStyle(f));if(g.settings.keep_values&&!g._isRes(f)){i.setAttribute("mce_style",f)}}}if(d&&j==="class"&&f){f=f.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(a){switch(j){case"rowspan":case"colspan":if(f===1){f=""}break;case"size":if(f==="+0"||f===20||f===0){f=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(f===0){f=""}break;case"hspace":if(f===-1){f=""}break;case"maxlength":case"tabindex":if(f===32768||f===2147483647||f==="32768"){f=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(f===65535){return j}return h;case"shape":f=f.toLowerCase();break;default:if(j.indexOf("on")===0&&f){f=(""+f).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(f!==undefined&&f!==null&&f!=="")?""+f:h},getPos:function(m,i){var g=this,f=0,l=0,j,k=g.doc,h;m=g.get(m);i=i||k.body;if(m){if(a&&!g.stdMode){m=m.getBoundingClientRect();j=g.boxModel?k.documentElement:k.body;f=g.getStyle(g.select("html")[0],"borderWidth");f=(f=="medium"||g.boxModel&&!g.isIE6)&&2||f;m.top+=g.win.self!=g.win.top?2:0;return{x:m.left+j.scrollLeft-f,y:m.top+j.scrollTop-f}}h=m;while(h&&h!=i&&h.nodeType){f+=h.offsetLeft||0;l+=h.offsetTop||0;h=h.offsetParent}h=m.parentNode;while(h&&h!=i&&h.nodeType){f-=h.scrollLeft||0;l-=h.scrollTop||0;h=h.parentNode}}return{x:f,y:l}},parseStyle:function(h){var i=this,j=i.settings,k={};if(!h){return k}function f(w,q,v){var o,u,m,n;o=k[w+"-top"+q];if(!o){return}u=k[w+"-right"+q];if(o!=u){return}m=k[w+"-bottom"+q];if(u!=m){return}n=k[w+"-left"+q];if(m!=n){return}k[v]=n;delete k[w+"-top"+q];delete k[w+"-right"+q];delete k[w+"-bottom"+q];delete k[w+"-left"+q]}function g(n,m,l,p){var o;o=k[m];if(!o){return}o=k[l];if(!o){return}o=k[p];if(!o){return}k[n]=k[m]+" "+k[l]+" "+k[p];delete k[m];delete k[l];delete k[p]}h=h.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");e(h.split(";"),function(m){var l,n=[];if(m){m=m.replace(/_MCE_SEMI_/g,";");m=m.replace(/url\([^\)]+\)/g,function(o){n.push(o);return"url("+n.length+")"});m=m.split(":");l=c.trim(m[1]);l=l.replace(/url\(([^\)]+)\)/g,function(p,o){return n[parseInt(o)-1]});l=l.replace(/rgb\([^\)]+\)/g,function(o){return i.toHex(o)});if(j.url_converter){l=l.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(o,p){return"url("+j.url_converter.call(j.url_converter_scope||i,i.decode(p),"style",null)+")"})}k[c.trim(m[0]).toLowerCase()]=l}});f("border","","border");f("border","-width","border-width");f("border","-color","border-color");f("border","-style","border-style");f("padding","","padding");f("margin","","margin");g("border","border-width","border-style","border-color");if(a){if(k.border=="medium none"){k.border=""}}return k},serializeStyle:function(g){var f="";e(g,function(i,h){if(h&&i){if(c.isGecko&&h.indexOf("-moz-")===0){return}switch(h){case"color":case"background-color":i=i.toLowerCase();break}f+=(f?" ":"")+h+": "+i+";"}});return f},loadCSS:function(f){var h=this,i=h.doc,g;if(!f){f=""}g=h.select("head")[0];e(f.split(","),function(j){var k;if(h.files[j]){return}h.files[j]=true;k=h.create("link",{rel:"stylesheet",href:c._addVer(j)});if(a&&i.documentMode){k.onload=function(){i.recalc();k.onload=null}}g.appendChild(k)})},addClass:function(f,g){return this.run(f,function(h){var i;if(!g){return 0}if(this.hasClass(h,g)){return h.className}i=this.removeClass(h,g);return h.className=(i!=""?(i+" "):"")+g})},removeClass:function(h,i){var f=this,g;return f.run(h,function(k){var j;if(f.hasClass(k,i)){if(!g){g=new RegExp("(^|\\s+)"+i+"(\\s+|$)","g")}j=k.className.replace(g," ");return k.className=c.trim(j!=" "?j:"")}return k.className})},hasClass:function(g,f){g=this.get(g);if(!g||!f){return false}return(" "+g.className+" ").indexOf(" "+f+" ")!==-1},show:function(f){return this.setStyle(f,"display","block")},hide:function(f){return this.setStyle(f,"display","none")},isHidden:function(f){f=this.get(f);return !f||f.style.display=="none"||this.getStyle(f,"display")=="none"},uniqueId:function(f){return(!f?"mce_":f)+(this.counter++)},setHTML:function(i,g){var f=this;return this.run(i,function(m){var h,k,j,q,l,h;g=f.processHTML(g);if(a){function o(){try{m.innerHTML="<br />"+g;m.removeChild(m.firstChild)}catch(n){while(m.firstChild){m.firstChild.removeNode()}h=f.create("div");h.innerHTML="<br />"+g;e(h.childNodes,function(r,p){if(p){m.appendChild(r)}})}}if(f.settings.fix_ie_paragraphs){g=g.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true"> </p>')}o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("p");for(k=j.length-1,h=0;k>=0;k--){q=j[k];if(!q.hasChildNodes()){if(!q.mce_keep){h=1;break}q.removeAttribute("mce_keep")}}}if(h){g=g.replace(/<p ([^>]+)>|<p>/ig,'<div $1 mce_tmp="1">');g=g.replace(/<\/p>/g,"</div>");o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("DIV");for(k=j.length-1;k>=0;k--){q=j[k];if(q.mce_tmp){l=f.doc.createElement("p");q.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(p,n){var r;if(n!=="mce_tmp"){r=q.getAttribute(n);if(!r&&n==="class"){r=q.className}l.setAttribute(n,r)}});for(h=0;h<q.childNodes.length;h++){l.appendChild(q.childNodes[h].cloneNode(true))}q.swapNode(l)}}}}}else{m.innerHTML=g}return g})},processHTML:function(j){var g=this,i=g.settings,k=[];if(!i.process_html){return j}if(c.isGecko){j=j.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,"<$1b$2>");j=j.replace(/<(\/?)em>|<em( [^>]+)>/gi,"<$1i$2>")}else{if(a){j=j.replace(/'/g,"'");j=j.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}}j=j.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(i.keep_values){if(/<script|noscript|style/i.test(j)){function f(h){h=h.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n");h=h.replace(/^[\r\n]*|[\r\n]*$/g,"");h=h.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"");h=h.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"");return h}j=j.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi,function(h,m,l){if(!m){m=' type="text/javascript"'}m=m.replace(/src=\"([^\"]+)\"?/i,function(n,o){if(i.url_converter){o=g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(o),"src","script"))}return'mce_src="'+o+'"'});if(c.trim(l)){k.push(f(l));l="<!--\nMCE_SCRIPT:"+(k.length-1)+"\n// -->"}return"<mce:script"+m+">"+l+"</mce:script>"});j=j.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi,function(h,m,l){if(l){k.push(f(l));l="<!--\nMCE_SCRIPT:"+(k.length-1)+"\n-->"}return"<mce:style"+m+">"+l+"</mce:style><style "+m+' mce_bogus="1">'+l+"</style>"});j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,m,l){return"<mce:noscript"+m+"><!--"+g.encode(l).replace(/--/g,"--")+"--></mce:noscript>"})}j=j.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->");j=j.replace(/<([\w:]+) [^>]*(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)[^>]*>/gi,function(l){function h(o,m,n){if(n==="false"||n==="0"){return""}return" "+m+'="'+m+'"'}l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=[\"]([^\"]+)[\"]/gi,h);l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=[\']([^\']+)[\']/gi,h);l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=([^\s\"\'>]+)/gi,h);l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)([\s>])/gi,' $1="$1"$2');return l});j=j.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi,function(h,m){function l(o,n,q){var p=q;if(h.indexOf("mce_"+n)!=-1){return o}if(n=="style"){if(g._isRes(q)){return o}p=g.encode(g.serializeStyle(g.parseStyle(p)))}else{if(n!="coords"&&n!="shape"){if(i.url_converter){p=g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(q),n,m))}}}return" "+n+'="'+q+'" mce_'+n+'="'+p+'"'}h=h.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi,l);h=h.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi,l);return h.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi,l)});j=j.replace(/MCE_SCRIPT:([0-9]+)/g,function(l,h){return k[h]})}return j},getOuterHTML:function(f){var g;f=this.get(f);if(!f){return null}if(f.outerHTML!==undefined){return f.outerHTML}g=(f.ownerDocument||this.doc).createElement("body");g.appendChild(f.cloneNode(true));return g.innerHTML},setOuterHTML:function(j,g,k){var f=this;function i(m,l,p){var q,o;o=p.createElement("body");o.innerHTML=l;q=o.lastChild;while(q){f.insertAfter(q.cloneNode(true),m);q=q.previousSibling}f.remove(m)}return this.run(j,function(l){l=f.get(l);if(l.nodeType==1){k=k||l.ownerDocument||f.doc;if(a){try{if(a&&l.nodeType==1){l.outerHTML=g}else{i(l,g,k)}}catch(h){i(l,g,k)}}else{i(l,g,k)}}})},decode:function(g){var h,i,f;if(/&[^;]+;/.test(g)){h=this.doc.createElement("div");h.innerHTML=g;i=h.firstChild;f="";if(i){do{f+=i.nodeValue}while(i.nextSibling)}return f||g}return g},encode:function(f){return f?(""+f).replace(/[<>&\"]/g,function(h,g){switch(h){case"&":return"&";case'"':return""";case"<":return"<";case">":return">"}return h}):f},insertAfter:function(h,g){var f=this;g=f.get(g);return this.run(h,function(k){var j,i;j=g.parentNode;i=g.nextSibling;if(i){j.insertBefore(k,i)}else{j.appendChild(k)}return k})},isBlock:function(f){if(f.nodeType&&f.nodeType!==1){return false}f=f.nodeName||f;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TH|TBODY|TR|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(f)},replace:function(i,h,f){var g=this;if(b(h,"array")){i=i.cloneNode(true)}return g.run(h,function(j){if(f){e(j.childNodes,function(k){i.appendChild(k.cloneNode(true))})}if(g.fixPsuedoLeaks&&j.nodeType===1){j.parentNode.insertBefore(i,j);g.remove(j);return i}return j.parentNode.replaceChild(i,j)})},findCommonAncestor:function(h,f){var i=h,g;while(i){g=f;while(g&&i!=g){g=g.parentNode}if(i==g){break}i=i.parentNode}if(!i&&h.ownerDocument){return h.ownerDocument.documentElement}return i},toHex:function(f){var h=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(f);function g(i){i=parseInt(i).toString(16);return i.length>1?i:"0"+i}if(h){f="#"+g(h[1])+g(h[2])+g(h[3]);return f}return f},getClasses:function(){var l=this,g=[],k,m={},n=l.settings.class_filter,j;if(l.classes){return l.classes}function o(f){e(f.imports,function(i){o(i)});e(f.cssRules||f.rules,function(i){switch(i.type||1){case 1:if(i.selectorText){e(i.selectorText.split(","),function(p){p=p.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(p)||!/\.[\w\-]+$/.test(p)){return}j=p;p=p.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(n&&!(p=n(p,j))){return}if(!m[p]){g.push({"class":p});m[p]=1}})}break;case 3:o(i.styleSheet);break}})}try{e(l.doc.styleSheets,o)}catch(h){}if(g.length>0){l.classes=g}return g},run:function(j,i,h){var g=this,k;if(g.doc&&typeof(j)==="string"){j=g.get(j)}if(!j){return false}h=h||this;if(!j.nodeType&&(j.length||j.length===0)){k=[];e(j,function(l,f){if(l){if(typeof(l)=="string"){l=g.doc.getElementById(l)}k.push(i.call(h,l,f))}});return k}return i.call(h,j)},getAttribs:function(g){var f;g=this.get(g);if(!g){return[]}if(a){f=[];if(g.nodeName=="OBJECT"){return g.attributes}if(g.nodeName==="OPTION"&&this.getAttrib(g,"selected")){f.push({specified:1,nodeName:"selected"})}g.cloneNode(false).outerHTML.replace(/<\/?[\w:]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=\w+|>/gi,"").replace(/[\w:]+/gi,function(h){f.push({specified:1,nodeName:h})});return f}return g.attributes},destroy:function(g){var f=this;if(f.events){f.events.destroy()}f.win=f.doc=f.root=f.events=null;if(!g){c.removeUnload(f.destroy)}},createRng:function(){var f=this.doc;return f.createRange?f.createRange():new c.dom.Range(this)},split:function(l,k,o){var p=this,f=p.createRng(),m,j,n;function g(r,q){r=r[q];if(r&&r[q]&&r[q].nodeType==1&&i(r[q])){p.remove(r[q])}}function i(q){q=p.getOuterHTML(q);q=q.replace(/<(img|hr|table)/gi,"-");q=q.replace(/<[^>]+>/g,"");return q.replace(/[ \t\r\n]+| | /g,"")==""}function h(r){var q=0;while(r.previousSibling){q++;r=r.previousSibling}return q}if(l&&k){f.setStart(l.parentNode,h(l));f.setEnd(k.parentNode,h(k));m=f.extractContents();f=p.createRng();f.setStart(k.parentNode,h(k)+1);f.setEnd(l.parentNode,h(l)+1);j=f.extractContents();n=l.parentNode;g(m,"lastChild");if(!i(m)){n.insertBefore(m,l)}if(o){n.replaceChild(o,k)}else{n.insertBefore(k,l)}g(j,"firstChild");if(!i(j)){n.insertBefore(j,l)}p.remove(l);return o||k}},bind:function(j,f,i,h){var g=this;if(!g.events){g.events=new c.dom.EventUtils()}return g.events.add(j,f,i,h||this)},unbind:function(i,f,h){var g=this;if(!g.events){g.events=new c.dom.EventUtils()}return g.events.remove(i,f,h)},_findSib:function(j,g,h){var i=this,k=g;if(j){if(b(k,"string")){k=function(f){return i.is(f,g)}}for(j=j[h];j;j=j[h]){if(k(j)){return j}}}return null},_isRes:function(f){return/^(top|left|bottom|right|width|height)/i.test(f)||/;\s*(top|left|bottom|right|width|height)/i.test(f)}});c.DOM=new c.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(f){var h=0,c=1,e=2,d=tinymce.extend;function g(m,k){var j,l;if(m.parentNode!=k){return -1}for(l=k.firstChild,j=0;l!=m;l=l.nextSibling){j++}return j}function b(k){var j=0;while(k.previousSibling){j++;k=k.previousSibling}return j}function i(j,k){var l;if(j.nodeType==3){return j}if(k<0){return j}l=j.firstChild;while(l!=null&&k>0){--k;l=l.nextSibling}if(l!=null){return l}return j}function a(k){var j=k.doc;d(this,{dom:k,startContainer:j,startOffset:0,endContainer:j,endOffset:0,collapsed:true,commonAncestorContainer:j,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3})}d(a.prototype,{setStart:function(k,j){this._setEndPoint(true,k,j)},setEnd:function(k,j){this._setEndPoint(false,k,j)},setStartBefore:function(j){this.setStart(j.parentNode,b(j))},setStartAfter:function(j){this.setStart(j.parentNode,b(j)+1)},setEndBefore:function(j){this.setEnd(j.parentNode,b(j))},setEndAfter:function(j){this.setEnd(j.parentNode,b(j)+1)},collapse:function(k){var j=this;if(k){j.endContainer=j.startContainer;j.endOffset=j.startOffset}else{j.startContainer=j.endContainer;j.startOffset=j.endOffset}j.collapsed=true},selectNode:function(j){this.setStartBefore(j);this.setEndAfter(j)},selectNodeContents:function(j){this.setStart(j,0);this.setEnd(j,j.nodeType===1?j.childNodes.length:j.nodeValue.length)},compareBoundaryPoints:function(m,n){var l=this,p=l.startContainer,o=l.startOffset,k=l.endContainer,j=l.endOffset;if(m===0){return l._compareBoundaryPoints(p,o,p,o)}if(m===1){return l._compareBoundaryPoints(p,o,k,j)}if(m===2){return l._compareBoundaryPoints(k,j,k,j)}if(m===3){return l._compareBoundaryPoints(k,j,p,o)}},deleteContents:function(){this._traverse(e)},extractContents:function(){return this._traverse(h)},cloneContents:function(){return this._traverse(c)},insertNode:function(m){var j=this,l,k;if(m.nodeType===3||m.nodeType===4){l=j.startContainer.splitText(j.startOffset);j.startContainer.parentNode.insertBefore(m,l)}else{if(j.startContainer.childNodes.length>0){k=j.startContainer.childNodes[j.startOffset]}j.startContainer.insertBefore(m,k)}},surroundContents:function(l){var j=this,k=j.extractContents();j.insertNode(l);l.appendChild(k);j.selectNode(l)},cloneRange:function(){var j=this;return d(new a(j.dom),{startContainer:j.startContainer,startOffset:j.startOffset,endContainer:j.endContainer,endOffset:j.endOffset,collapsed:j.collapsed,commonAncestorContainer:j.commonAncestorContainer})},_isCollapsed:function(){return(this.startContainer==this.endContainer&&this.startOffset==this.endOffset)},_compareBoundaryPoints:function(m,p,k,o){var q,l,j,r,t,s;if(m==k){if(p==o){return 0}else{if(p<o){return -1}else{return 1}}}q=k;while(q&&q.parentNode!=m){q=q.parentNode}if(q){l=0;j=m.firstChild;while(j!=q&&l<p){l++;j=j.nextSibling}if(p<=l){return -1}else{return 1}}q=m;while(q&&q.parentNode!=k){q=q.parentNode}if(q){l=0;j=k.firstChild;while(j!=q&&l<o){l++;j=j.nextSibling}if(l<o){return -1}else{return 1}}r=this.dom.findCommonAncestor(m,k);t=m;while(t&&t.parentNode!=r){t=t.parentNode}if(!t){t=r}s=k;while(s&&s.parentNode!=r){s=s.parentNode}if(!s){s=r}if(t==s){return 0}j=r.firstChild;while(j){if(j==t){return -1}if(j==s){return 1}j=j.nextSibling}},_setEndPoint:function(k,q,p){var l=this,j,m;if(k){l.startContainer=q;l.startOffset=p}else{l.endContainer=q;l.endOffset=p}j=l.endContainer;while(j.parentNode){j=j.parentNode}m=l.startContainer;while(m.parentNode){m=m.parentNode}if(m!=j){l.collapse(k)}else{if(l._compareBoundaryPoints(l.startContainer,l.startOffset,l.endContainer,l.endOffset)>0){l.collapse(k)}}l.collapsed=l._isCollapsed();l.commonAncestorContainer=l.dom.findCommonAncestor(l.startContainer,l.endContainer)},_traverse:function(r){var s=this,q,m=0,v=0,k,o,l,n,j,u;if(s.startContainer==s.endContainer){return s._traverseSameContainer(r)}for(q=s.endContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.startContainer){return s._traverseCommonStartContainer(q,r)}++m}for(q=s.startContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.endContainer){return s._traverseCommonEndContainer(q,r)}++v}o=v-m;l=s.startContainer;while(o>0){l=l.parentNode;o--}n=s.endContainer;while(o<0){n=n.parentNode;o++}for(j=l.parentNode,u=n.parentNode;j!=u;j=j.parentNode,u=u.parentNode){l=j;n=u}return s._traverseCommonAncestors(l,n,r)},_traverseSameContainer:function(o){var r=this,q,u,j,k,l,p,m;if(o!=e){q=r.dom.doc.createDocumentFragment()}if(r.startOffset==r.endOffset){return q}if(r.startContainer.nodeType==3){u=r.startContainer.nodeValue;j=u.substring(r.startOffset,r.endOffset);if(o!=c){r.startContainer.deleteData(r.startOffset,r.endOffset-r.startOffset);r.collapse(true)}if(o==e){return null}q.appendChild(r.dom.doc.createTextNode(j));return q}k=i(r.startContainer,r.startOffset);l=r.endOffset-r.startOffset;while(l>0){p=k.nextSibling;m=r._traverseFullySelected(k,o);if(q){q.appendChild(m)}--l;k=p}if(o!=c){r.collapse(true)}return q},_traverseCommonStartContainer:function(j,p){var s=this,r,k,l,m,q,o;if(p!=e){r=s.dom.doc.createDocumentFragment()}k=s._traverseRightBoundary(j,p);if(r){r.appendChild(k)}l=g(j,s.startContainer);m=l-s.startOffset;if(m<=0){if(p!=c){s.setEndBefore(j);s.collapse(false)}return r}k=j.previousSibling;while(m>0){q=k.previousSibling;o=s._traverseFullySelected(k,p);if(r){r.insertBefore(o,r.firstChild)}--m;k=q}if(p!=c){s.setEndBefore(j);s.collapse(false)}return r},_traverseCommonEndContainer:function(m,p){var s=this,r,o,j,k,q,l;if(p!=e){r=s.dom.doc.createDocumentFragment()}j=s._traverseLeftBoundary(m,p);if(r){r.appendChild(j)}o=g(m,s.endContainer);++o;k=s.endOffset-o;j=m.nextSibling;while(k>0){q=j.nextSibling;l=s._traverseFullySelected(j,p);if(r){r.appendChild(l)}--k;j=q}if(p!=c){s.setStartAfter(m);s.collapse(true)}return r},_traverseCommonAncestors:function(p,j,s){var w=this,l,v,o,q,r,k,u,m;if(s!=e){v=w.dom.doc.createDocumentFragment()}l=w._traverseLeftBoundary(p,s);if(v){v.appendChild(l)}o=p.parentNode;q=g(p,o);r=g(j,o);++q;k=r-q;u=p.nextSibling;while(k>0){m=u.nextSibling;l=w._traverseFullySelected(u,s);if(v){v.appendChild(l)}u=m;--k}l=w._traverseRightBoundary(j,s);if(v){v.appendChild(l)}if(s!=c){w.setStartAfter(p);w.collapse(true)}return v},_traverseRightBoundary:function(p,q){var s=this,l=i(s.endContainer,s.endOffset-1),r,o,n,j,k;var m=l!=s.endContainer;if(l==p){return s._traverseNode(l,m,false,q)}r=l.parentNode;o=s._traverseNode(r,false,false,q);while(r!=null){while(l!=null){n=l.previousSibling;j=s._traverseNode(l,m,false,q);if(q!=e){o.insertBefore(j,o.firstChild)}m=true;l=n}if(r==p){return o}l=r.previousSibling;r=r.parentNode;k=s._traverseNode(r,false,false,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseLeftBoundary:function(p,q){var s=this,m=i(s.startContainer,s.startOffset);var n=m!=s.startContainer,r,o,l,j,k;if(m==p){return s._traverseNode(m,n,true,q)}r=m.parentNode;o=s._traverseNode(r,false,true,q);while(r!=null){while(m!=null){l=m.nextSibling;j=s._traverseNode(m,n,true,q);if(q!=e){o.appendChild(j)}n=true;m=l}if(r==p){return o}m=r.nextSibling;r=r.parentNode;k=s._traverseNode(r,false,true,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseNode:function(j,o,r,s){var u=this,m,l,p,k,q;if(o){return u._traverseFullySelected(j,s)}if(j.nodeType==3){m=j.nodeValue;if(r){k=u.startOffset;l=m.substring(k);p=m.substring(0,k)}else{k=u.endOffset;l=m.substring(0,k);p=m.substring(k)}if(s!=c){j.nodeValue=p}if(s==e){return null}q=j.cloneNode(false);q.nodeValue=l;return q}if(s==e){return null}return j.cloneNode(false)},_traverseFullySelected:function(l,k){var j=this;if(k!=e){return k==c?l.cloneNode(true):l}l.parentNode.removeChild(l);return null}});f.Range=a})(tinymce.dom);(function(){function a(e){var d=this,h="\uFEFF",b,g;function c(j,i){if(j&&i){if(j.item&&i.item&&j.item(0)===i.item(0)){return 1}if(j.isEqual&&i.isEqual&&i.isEqual(j)){return 1}}return 0}function f(){var m=e.dom,j=e.getRng(),s=m.createRng(),p,k,n,q,o,l;function i(v){var t=v.parentNode.childNodes,u;for(u=t.length-1;u>=0;u--){if(t[u]==v){return u}}return -1}function r(v){var t=j.duplicate(),B,y,u,w,x=0,z=0,A,C;t.collapse(v);B=t.parentElement();t.pasteHTML(h);u=B.childNodes;for(y=0;y<u.length;y++){w=u[y];if(y>0&&(w.nodeType!==3||u[y-1].nodeType!==3)){z++}if(w.nodeType===3){A=w.nodeValue.indexOf(h);if(A!==-1){x+=A;break}x+=w.nodeValue.length}else{x=0}}t.moveStart("character",-1);t.text="";return{index:z,offset:x,parent:B}}n=j.item?j.item(0):j.parentElement();if(n.ownerDocument!=m.doc){return s}if(j.item||!n.hasChildNodes()){s.setStart(n.parentNode,i(n));s.setEnd(s.startContainer,s.startOffset+1);return s}l=e.isCollapsed();p=r(true);k=r(false);p.parent.normalize();k.parent.normalize();q=p.parent.childNodes[Math.min(p.index,p.parent.childNodes.length-1)];if(q.nodeType!=3){s.setStart(p.parent,p.index)}else{s.setStart(p.parent.childNodes[p.index],p.offset)}o=k.parent.childNodes[Math.min(k.index,k.parent.childNodes.length-1)];if(o.nodeType!=3){if(!l){k.index++}s.setEnd(k.parent,k.index)}else{s.setEnd(k.parent.childNodes[k.index],k.offset)}if(!l){q=s.startContainer;if(q.nodeType==1){s.setStart(q,Math.min(s.startOffset,q.childNodes.length))}o=s.endContainer;if(o.nodeType==1){s.setEnd(o,Math.min(s.endOffset,o.childNodes.length))}}d.addRange(s);return s}this.addRange=function(j){var o,m=e.dom.doc.body,p,k,q,l,n,i;q=j.startContainer;l=j.startOffset;n=j.endContainer;i=j.endOffset;o=m.createTextRange();q=q.nodeType==1?q.childNodes[Math.min(l,q.childNodes.length-1)]:q;n=n.nodeType==1?n.childNodes[Math.min(l==i?i:i-1,n.childNodes.length-1)]:n;if(q==n&&q.nodeType==1){if(/^(IMG|TABLE)$/.test(q.nodeName)&&l!=i){o=m.createControlRange();o.addElement(q)}else{o=m.createTextRange();if(!q.hasChildNodes()&&q.canHaveHTML){q.innerHTML=h}o.moveToElementText(q);if(q.innerHTML==h){o.collapse(true);q.removeChild(q.firstChild)}}if(l==i){o.collapse(i<=j.endContainer.childNodes.length-1)}o.select();return}function r(t,v){var u,s,w;if(t.nodeType!=3){return -1}u=t.nodeValue;s=m.createTextRange();t.nodeValue=u.substring(0,v)+h+u.substring(v);s.moveToElementText(t.parentNode);s.findText(h);w=Math.abs(s.moveStart("character",-1048575));t.nodeValue=u;return w}if(j.collapsed){pos=r(q,l);o=m.createTextRange();o.move("character",pos);o.select();return}else{if(q==n&&q.nodeType==3){p=r(q,l);o=m.createTextRange();o.move("character",p);o.moveEnd("character",i-l);o.select();return}p=r(q,l);k=r(n,i);o=m.createTextRange();if(p==-1){o.moveToElementText(q);p=0}else{o.move("character",p)}tmpRng=m.createTextRange();if(k==-1){tmpRng.moveToElementText(n)}else{tmpRng.move("character",k)}o.setEndPoint("EndToEnd",tmpRng);o.select();return}};this.getRangeAt=function(){if(!b||!c(g,e.getRng())){b=f();g=e.getRng()}return b};this.destroy=function(){g=b=null}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,i=0,d=Object.prototype.toString,n=false;var b=function(D,t,A,v){A=A||[];var e=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!D||typeof D!=="string"){return A}var B=[],C,y,G,F,z,s,r=true,w=o(t);p.lastIndex=0;while((C=p.exec(D))!==null){B.push(C[1]);if(C[2]){s=RegExp.rightContext;break}}if(B.length>1&&j.exec(D)){if(B.length===2&&f.relative[B[0]]){y=g(B[0]+B[1],t)}else{y=f.relative[B[0]]?[t]:b(B.shift(),t);while(B.length){D=B.shift();if(f.relative[D]){D+=B.shift()}y=g(D,y)}}}else{if(!v&&B.length>1&&t.nodeType===9&&!w&&f.match.ID.test(B[0])&&!f.match.ID.test(B[B.length-1])){var H=b.find(B.shift(),t,w);t=H.expr?b.filter(H.expr,H.set)[0]:H.set[0]}if(t){var H=v?{expr:B.pop(),set:a(v)}:b.find(B.pop(),B.length===1&&(B[0]==="~"||B[0]==="+")&&t.parentNode?t.parentNode:t,w);y=H.expr?b.filter(H.expr,H.set):H.set;if(B.length>0){G=a(y)}else{r=false}while(B.length){var u=B.pop(),x=u;if(!f.relative[u]){u=""}else{x=B.pop()}if(x==null){x=t}f.relative[u](G,x,w)}}else{G=B=[]}}if(!G){G=y}if(!G){throw"Syntax error, unrecognized expression: "+(u||D)}if(d.call(G)==="[object Array]"){if(!r){A.push.apply(A,G)}else{if(t&&t.nodeType===1){for(var E=0;G[E]!=null;E++){if(G[E]&&(G[E]===true||G[E].nodeType===1&&h(t,G[E]))){A.push(y[E])}}}else{for(var E=0;G[E]!=null;E++){if(G[E]&&G[E].nodeType===1){A.push(y[E])}}}}}else{a(G,A)}if(s){b(s,e,A,v);b.uniqueSort(A)}return A};b.uniqueSort=function(r){if(c){n=false;r.sort(c);if(n){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(x,e,y){var w,u;if(!x){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.match[v].exec(x))){var r=RegExp.leftContext;if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");w=f.find[v](u,e,y);if(w!=null){x=x.replace(f.match[v],"");break}}}}if(!w){w=e.getElementsByTagName("*")}return{set:w,expr:x}};b.filter=function(A,z,D,t){var s=A,F=[],x=z,v,e,w=z&&z[0]&&o(z[0]);while(A&&z.length){for(var y in f.filter){if((v=f.match[y].exec(A))!=null){var r=f.filter[y],E,C;e=false;if(x==F){F=[]}if(f.preFilter[y]){v=f.preFilter[y](v,x,D,F,t,w);if(!v){e=E=true}else{if(v===true){continue}}}if(v){for(var u=0;(C=x[u])!=null;u++){if(C){E=r(C,v,u,x);var B=t^!!E;if(D&&E!=null){if(B){e=true}else{x[u]=false}}else{if(B){F.push(C);e=true}}}}}if(E!==undefined){if(!D){x=F}A=A.replace(f.match[y],"");if(!e){return[]}break}}}if(A==s){if(e==null){throw"Syntax error, unrecognized expression: "+A}else{break}}s=A}return x};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(x,e,w){var u=typeof e==="string",y=u&&!/\W/.test(e),v=u&&!y;if(y&&!w){e=e.toUpperCase()}for(var t=0,s=x.length,r;t<s;t++){if((r=x[t])){while((r=r.previousSibling)&&r.nodeType!==1){}x[t]=v||r&&r.nodeName===e?r||false:r===e}}if(v){b.filter(e,x,true)}},">":function(w,r,x){var u=typeof r==="string";if(u&&!/\W/.test(r)){r=x?r:r.toUpperCase();for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){var t=v.parentNode;w[s]=t.nodeName===r?t:false}}}else{for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){w[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,w,true)}}},"":function(t,r,v){var s=i++,e=q;if(!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=i++,e=q;if(typeof r==="string"&&!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v,w){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,w,x){t=" "+t[1].replace(/\\/g,"")+" ";if(x){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(w^(v.className&&(" "+v.className+" ").indexOf(t)>=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){for(var s=0;e[s]===false;s++){}return e[s]&&o(e[s])?r[1]:r[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=i++;return e},ATTR:function(u,r,s,e,v,w){var t=u[1].replace(/\\/g,"");if(!w&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if(u[3].match(p).length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return r<e[3]-0},gt:function(s,r,e){return r>e[3]-0},nth:function(s,r,e){return e[3]-0==r},eq:function(s,r,e){return e[3]-0==r}},filter:{PSEUDO:function(w,s,t,x){var r=s[1],u=f.filters[r];if(u){return u(w,t,s,x)}else{if(r==="contains"){return(w.textContent||w.innerText||"").indexOf(s[3])>=0}else{if(r==="not"){var v=s[3];for(var t=0,e=v.length;t<e;t++){if(v[t]===w){return false}}return true}}}},CHILD:function(e,t){var w=t[1],r=e;switch(w){case"only":case"first":while(r=r.previousSibling){if(r.nodeType===1){return false}}if(w=="first"){return true}r=e;case"last":while(r=r.nextSibling){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],z=t[3];if(s==1&&z==0){return true}var v=t[0],y=e.parentNode;if(y&&(y.sizcache!==v||!e.nodeIndex)){var u=0;for(r=y.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}y.sizcache=v}var x=e.nodeIndex-z;if(s==0){return x==0}else{return(x%s==0&&x/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),w=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?w===r:u==="*="?w.indexOf(r)>=0:u==="~="?(" "+w+" ").indexOf(r)>=0:!r?w&&e!==false:u==="!="?w!=r:u==="^="?w.indexOf(r)===0:u==="$="?w.substr(w.length-r.length)===r:u==="|="?w===r||w.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var j=f.match.POS;for(var l in f.match){f.match[l]=new RegExp(f.match[l].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var a=function(r,e){r=Array.prototype.slice.call(r);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(k){a=function(u,t){var r=t||[];if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var s=0,e=u.length;s<e;s++){r.push(u[s])}}else{for(var s=0;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){n=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){var s=r.sourceIndex-e.sourceIndex;if(s===0){n=true}return s}}else{if(document.createRange){c=function(t,r){var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.setStart(t,0);s.setEnd(t,0);e.setStart(r,0);e.setEnd(r,0);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){n=true}return u}}}}(function(){var r=document.createElement("div"),s="script"+(new Date).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(!!document.getElementById(s)){f.find.ID=function(u,v,w){if(typeof v.getElementById!=="undefined"&&!w){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(w,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!o(v)){try{return a(v.querySelectorAll(w),t)}catch(x){}}return e(w,v,t,u)};for(var r in e){b[r]=e[r]}})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}}})()}function m(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1&&!z){e.sizcache=v;e.sizset=t}if(e.nodeName===w){u=e;break}e=e[r]}A[t]=u}}}function q(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1){if(!z){e.sizcache=v;e.sizset=t}if(typeof w!=="string"){if(e===w){u=true;break}}else{if(b.filter(w,[e]).length>0){u=e;break}}}e=e[r]}A[t]=u}}}var h=document.compareDocumentPosition?function(r,e){return r.compareDocumentPosition(e)&16}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};var o=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,x){var t=[],u="",v,s=x.nodeType?[x]:x;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var w=0,r=s.length;w<r;w++){b(e,s[w],t)}return b.filter(u,t)};window.tinymce.dom.Sizzle=b})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){var b=a.each;a.create("tinymce.dom.Element",{Element:function(g,e){var c=this,f,d;e=e||{};c.id=g;c.dom=f=e.dom||a.DOM;c.settings=e;if(!a.isIE){d=c.dom.get(c.id)}b(["getPos","getRect","getParent","add","setStyle","getStyle","setStyles","setAttrib","setAttribs","getAttrib","addClass","removeClass","hasClass","getOuterHTML","setOuterHTML","remove","show","hide","isHidden","setHTML","get"],function(h){c[h]=function(){var j=[g],k;for(k=0;k<arguments.length;k++){j.push(arguments[k])}j=f[h].apply(f,j);c.update(h);return j}})},on:function(e,d,c){return a.dom.Event.add(this.id,e,d,c)},getXY:function(){return{x:parseInt(this.getStyle("left")),y:parseInt(this.getStyle("top"))}},getSize:function(){var c=this.dom.get(this.id);return{w:parseInt(this.getStyle("width")||c.clientWidth),h:parseInt(this.getStyle("height")||c.clientHeight)}},moveTo:function(c,d){this.setStyles({left:c,top:d})},moveBy:function(c,e){var d=this.getXY();this.moveTo(d.x+c,d.y+e)},resizeTo:function(c,d){this.setStyles({width:c,height:d})},resizeBy:function(c,e){var d=this.getSize();this.resizeTo(d.w+c,d.h+e)},update:function(d){var e=this,c,f=e.dom;if(a.isIE6&&e.settings.blocker){d=d||"";if(d.indexOf("get")===0||d.indexOf("has")===0||d.indexOf("is")===0){return}if(d=="remove"){f.remove(e.blocker);return}if(!e.blocker){e.blocker=f.uniqueId();c=f.add(e.settings.container||f.getRoot(),"iframe",{id:e.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});f.setStyle(c,"opacity",0)}else{c=f.get(e.blocker)}f.setStyle(c,"left",e.getStyle("left",1));f.setStyle(c,"top",e.getStyle("top",1));f.setStyle(c,"width",e.getStyle("width",1));f.setStyle(c,"height",e.getStyle("height",1));f.setStyle(c,"display",e.getStyle("display",1));f.setStyle(c,"zIndex",parseInt(e.getStyle("zIndex",1)||0)-1)}}})})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(i,g){var f=this,j=f.getRng(),l,k=f.win.document;g=g||{format:"html"};g.set=true;i=g.content=f.dom.processHTML(i);f.onBeforeSetContent.dispatch(f,g);i=g.content;if(j.insertNode){i+='<span id="__caret">_</span>';j.deleteContents();j.insertNode(f.getRng().createContextualFragment(i));l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndAfter(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(1);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.firstChild}return h}else{h=g.startContainer;if(h.nodeName=="BODY"){return h.firstChild}return f.dom.getParent(h,"*")}},getEnd:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(0);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.lastChild}return h}else{h=g.endContainer;if(h.nodeName=="BODY"){return h.lastChild}return f.dom.getParent(h,"*")}},getBookmark:function(x){var j=this,m=j.getRng(),f,n,l,u=j.dom.getViewPort(j.win),v,p,z,o,w=-16777215,k,h=j.dom.getRoot(),g=0,i=0,y;n=u.x;l=u.y;if(x){return{rng:m,scrollX:n,scrollY:l}}if(a){if(m.item){v=m.item(0);d(j.dom.select(v.nodeName),function(s,r){if(v==s){p=r;return false}});return{tag:v.nodeName,index:p,scrollX:n,scrollY:l}}f=j.dom.doc.body.createTextRange();f.moveToElementText(h);f.collapse(true);z=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(true);p=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(false);o=Math.abs(f.move("character",w))-p;return{start:p-z,length:o,scrollX:n,scrollY:l}}v=j.getNode();k=j.getSel();if(!k){return null}if(v&&v.nodeName=="IMG"){return{scrollX:n,scrollY:l}}function q(A,D,t){var s=j.dom.doc.createTreeWalker(A,NodeFilter.SHOW_TEXT,null,false),E,B=0,C={};while((E=s.nextNode())!=null){if(E==D){C.start=B}if(E==t){C.end=B;return C}B+=e(E.nodeValue||"").length}return null}if(k.anchorNode==k.focusNode&&k.anchorOffset==k.focusOffset){v=q(h,k.anchorNode,k.focusNode);if(!v){return{scrollX:n,scrollY:l}}e(k.anchorNode.nodeValue||"").replace(/^\s+/,function(r){g=r.length});return{start:Math.max(v.start+k.anchorOffset-g,0),end:Math.max(v.end+k.focusOffset-g,0),scrollX:n,scrollY:l,beg:k.anchorOffset-g==0}}else{v=q(h,m.startContainer,m.endContainer);if(!v){return{scrollX:n,scrollY:l}}return{start:Math.max(v.start+m.startOffset-g,0),end:Math.max(v.end+m.endOffset-i,0),scrollX:n,scrollY:l,beg:m.startOffset-g==0}}},moveToBookmark:function(n){var o=this,g=o.getRng(),p=o.getSel(),j=o.dom.getRoot(),m,h,k;function i(q,t,D){var B=o.dom.doc.createTreeWalker(q,NodeFilter.SHOW_TEXT,null,false),x,s=0,A={},u,C,z,y;while((x=B.nextNode())!=null){z=y=0;k=x.nodeValue||"";h=e(k).length;s+=h;if(s>=t&&!A.startNode){u=t-(s-h);if(n.beg&&u>=h){continue}A.startNode=x;A.startOffset=u+y}if(s>=D){A.endNode=x;A.endOffset=D-(s-h)+y;return A}}return null}if(!n){return false}o.win.scrollTo(n.scrollX,n.scrollY);if(a){o.tridentSel.destroy();if(g=n.rng){try{g.select()}catch(l){}return true}o.win.focus();if(n.tag){g=j.createControlRange();d(o.dom.select(n.tag),function(r,q){if(q==n.index){g.addElement(r)}})}else{try{if(n.start<0){return true}g=p.createRange();g.moveToElementText(j);g.collapse(true);g.moveStart("character",n.start);g.moveEnd("character",n.length)}catch(f){return true}}try{g.select()}catch(l){}return true}if(!p){return false}if(n.rng){p.removeAllRanges();p.addRange(n.rng)}else{if(b(n.start)&&b(n.end)){try{m=i(j,n.start,n.end);if(m){g=o.dom.doc.createRange();g.setStart(m.startNode,m.startOffset);g.setEnd(m.endNode,m.endOffset);p.removeAllRanges();p.addRange(g)}if(!c.isOpera){o.win.focus()}}catch(l){}}}},select:function(g,l){var p=this,f=p.getRng(),q=p.getSel(),o,m,k,j=p.win.document;function h(u,t){var s,r;if(u){s=j.createTreeWalker(u,NodeFilter.SHOW_TEXT,null,false);while(u=s.nextNode()){r=u;if(c.trim(u.nodeValue).length!=0){if(t){return u}else{r=u}}}}return r}if(a){try{o=j.body;if(/^(IMG|TABLE)$/.test(g.nodeName)){f=o.createControlRange();f.addElement(g)}else{f=o.createTextRange();f.moveToElementText(g)}f.select()}catch(i){}}else{if(l){m=h(g,1)||p.dom.select("br:first",g)[0];k=h(g,0)||p.dom.select("br:last",g)[0];if(m&&k){f=j.createRange();if(m.nodeName=="BR"){f.setStartBefore(m)}else{f.setStart(m,0)}if(k.nodeName=="BR"){f.setEndBefore(k)}else{f.setEnd(k,k.nodeValue.length)}}else{f.selectNode(g)}}else{f.selectNode(g)}p.setRng(f)}return g},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}return !g||h.boundingWidth==0||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i){i=a?g.win.document.body.createTextRange():g.win.document.createRange()}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){h.removeAllRanges();h.addRange(i)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var f=this,h=f.getRng(),g=f.getSel(),i;if(!a){if(!h){return f.dom.getRoot()}i=h.commonAncestorContainer;if(!h.collapsed){if(c.isWebKit&&g.anchorNode&&g.anchorNode.nodeType==1){return g.anchorNode.childNodes[g.anchorOffset]}if(h.startContainer==h.endContainer){if(h.startOffset-h.endOffset<2){if(h.startContainer.hasChildNodes()){i=h.startContainer.childNodes[h.startOffset]}}}}return f.dom.getParent(i,"*")}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,">")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+b+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("<![CDATA["+b+"]]>");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("<!-- "+b+"-->");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"<";case">":return">";case"&":return"&";case'"':return"""}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_|sizset|sizcache)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^<br \/>\s*<\//.test(n)){return"</"+o+">"}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,y,w=["ol","ul"],u,t,q,k=/^(OL|UL)$/,z;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p<o.length;p++){if(r.nodeName==o[p]){return r}}}return null}for(y=0;y<w.length;y++){l=i.dom.select(w[y],s.node);for(u=0;u<l.length;u++){t=l[u];q=t.parentNode;if(k.test(q.nodeName)){z=m(t,"LI");if(!z){z=i.dom.create("li");z.innerHTML=" ";z.appendChild(t);q.insertBefore(z,q.firstChild)}else{z.appendChild(t)}}}}})}if(j.fix_table_elements){i.onPreProcess.add(function(k,l){if(!e.isOpera||opera.buildNumber()>=1767){f(i.dom.select("p table",l.node).reverse(),function(p){var o=i.dom.getParent(p.parentNode,"table,p");if(o.nodeName!="TABLE"){try{i.dom.split(o,p)}catch(m){}}})}})}},setEntities:function(p){var n=this,j,m,h={},o="",k;if(n.entityLookup){return}j=p.split(",");for(m=0;m<j.length;m+=2){k=j[m];if(k==34||k==38||k==60||k==62){continue}h[String.fromCharCode(j[m])]=j[m+1];k=parseInt(j[m]).toString(16);o+="\\u"+"0000".substring(k.length)+k}if(!o){n.settings.entity_encoding="raw";return}n.entitiesRE=new RegExp("["+o+"]","g");n.entityLookup=h},setValidChildRules:function(h){this.childRules=null;this.addValidChildRules(h)},addValidChildRules:function(k){var j=this,l,h,i;if(!k){return}l="A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment";h="A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment";i="H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP";f(k.split(","),function(n){var o=n.split(/\[|\]/),m;n="";f(o[1].split("|"),function(p){if(n){n+="|"}switch(p){case"%itrans":p=h;break;case"%itrans_na":p=h.substring(2);break;case"%istrict":p=l;break;case"%istrict_na":p=l.substring(2);break;case"%btrans":p=i;break;case"%bstrict":p=i;break}n+=p});m=new RegExp("^("+n.toLowerCase()+")$","i");f(o[0].split("/"),function(p){j.childRules=j.childRules||{};j.childRules[p]=m})});k="";f(j.childRules,function(n,m){if(k){k+="|"}k+=m});j.parentElementsRE=new RegExp("^("+k.toLowerCase()+")$","i")},setRules:function(i){var h=this;h._setup();h.rules={};h.wildRules=[];h.validElements={};return h.addRules(i)},addRules:function(i){var h=this,j;if(!i){return}h._setup();f(i.split(","),function(m){var q=m.split(/\[|\]/),l=q[0].split("/"),r,k,o,n=[];if(j){k=e.extend([],j.attribs)}if(q.length>1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t<k.length;t++){if(k[t].name==u[2]){k.splice(t,1);return}}}switch(u[3]){case"=":p.defaultVal=u[4]||"";break;case":":p.forcedVal=u[4];break;case"<":p.validVals=u[4].split("?");break}if(/[*.?]/.test(u[2])){o=o||[];p.nameRE=new RegExp("^"+c(u[2])+"$");o.push(p)}else{p.name=u[2];k.push(p)}n.push(u[2])})}f(l,function(v,u){var w=v.charAt(0),t=1,p={};if(j){if(j.noEmpty){p.noEmpty=j.noEmpty}if(j.fullEnd){p.fullEnd=j.fullEnd}if(j.padd){p.padd=j.padd}}switch(w){case"-":p.noEmpty=true;break;case"+":p.fullEnd=true;break;case"#":p.padd=true;break;default:t=0}l[u]=v=v.substring(t);h.validElements[v]=1;if(/[*.?]/.test(l[0])){p.nameRE=new RegExp("^"+c(l[0])+"$");h.wildRules=h.wildRules||{};h.wildRules.push(p)}else{p.name=l[0];if(l[0]=="@"){j=p}h.rules[v]=p}p.attribs=k;if(r){p.requiredAttribs=r}if(o){v="";f(n,function(s){if(v){v+="|"}v+="("+c(s)+")"});p.validAttribsRE=new RegExp("^"+v.toLowerCase()+"$");p.wildAttribs=o}})});i="";f(h.validElements,function(m,l){if(i){i+="|"}if(l!="@"){i+=l}});h.validElementsRE=new RegExp("^("+c(i.toLowerCase())+")$")},findRule:function(m){var j=this,l=j.rules,h,k;j._setup();k=l[m];if(k){return k}l=j.wildRules;for(h=0;h<l.length;h++){if(l[h].nameRE.test(m)){return l[h]}}return null},findAttribRule:function(h,l){var j,k=h.wildAttribs;for(j=0;j<k.length;j++){if(k[j].nameRE.test(l)){return k[j]}}return null},serialize:function(r,q){var m,k=this,p,i,j,l;k._setup();q=q||{};q.format=q.format||"html";k.processObj=q;if(d){l=[];f(r.getElementsByTagName("option"),function(o){var h=k.dom.getAttrib(o,"selected");l.push(h?h:null)})}r=r.cloneNode(true);if(d){f(r.getElementsByTagName("option"),function(o,h){k.dom.setAttrib(o,"selected",l[h])})}j=r.ownerDocument.implementation;if(j.createHTMLDocument&&(e.isOpera&&opera.buildNumber()>=1767)){p=j.createHTMLDocument("");f(r.nodeName=="BODY"?r.childNodes:[r],function(h){p.body.appendChild(p.importNode(h,true))});if(r.nodeName!="BODY"){r=p.body.firstChild}else{r=p.body}i=k.dom.doc;k.dom.doc=p}k.key=""+(parseInt(k.key)+1);if(!q.no_events){q.node=r;k.onPreProcess.dispatch(k,q)}k.writer.reset();k._serializeNode(r,q.getInner);q.content=k.writer.getContent();if(i){k.dom.doc=i}if(!q.no_events){k.onPostProcess.dispatch(k,q)}k._postProcess(q);q.node=null;return e.trim(q.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<noscript[^>]*>)(.*?)(<\/noscript>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?"<p$1> </p>":"<p$1> </p>");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>");if(k.entity_encoding=="raw"){j=j.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g,"<p$1>\u00a0</p>")}j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return"<noscript"+p+">"+i.dom.decode(o.replace(/<!--|-->/g,""))+"</noscript>"})}n.content=j},_serializeNode:function(D,o){var z=this,A=z.settings,x=z.writer,q,j,u,F,E,G,B,h,y,k,r,C,p,m;if(!A.node_filter||A.node_filter(D)){switch(D.nodeType){case 1:if(D.hasAttribute?D.hasAttribute("mce_bogus"):D.getAttribute("mce_bogus")){return}p=false;q=D.hasChildNodes();k=D.getAttribute("mce_name")||D.nodeName.toLowerCase();if(d){if(D.scopeName!=="HTML"&&D.scopeName!=="html"){k=D.scopeName+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!z.validElementsRE||!z.validElementsRE.test(k)||(z.invalidElementsRE&&z.invalidElementsRE.test(k))||o){p=true;break}if(d){if(A.fix_content_duplication){if(D.mce_serialized==z.key){return}D.mce_serialized=z.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(D.nodeName==="BR"&&D.getAttribute("type")=="_moz"){return}}}if(z.childRules){if(z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(k)){p=true;break}}z.elementName=k}r=z.findRule(k);k=r.name||k;m=A.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){G=r.requiredAttribs;for(F=G.length-1;F>=0;F--){if(this.dom.getAttrib(D,G[F])!==""){break}}if(F==-1){p=true;break}}x.writeStartElement(k);if(r.attribs){for(F=0,B=r.attribs,E=B.length;F<E;F++){G=B[F];y=z._getAttrib(D,G);if(y!==null){x.writeAttribute(G.name,y)}}}if(r.validAttribsRE){B=z.dom.getAttribs(D);for(F=B.length-1;F>-1;F--){h=B[F];if(h.specified){G=h.nodeName.toLowerCase();if(A.invalid_attrs.test(G)||!r.validAttribsRE.test(G)){continue}C=z.findAttribRule(r,G);y=z._getAttrib(D,C,G);if(y!==null){x.writeAttribute(G,y)}}}}if(k==="script"&&e.trim(D.innerHTML)){x.writeText("// ");x.writeCDATA(D.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=D.firstChild)&&u.nodeType===1&&D.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("mce_bogus"):u.getAttribute("mce_bogus")){x.writeText("\u00a0")}}else{if(!q){x.writeText("\u00a0")}}}break;case 3:if(z.childRules&&z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(D.nodeName)){return}}return x.writeText(D.nodeValue);case 4:return x.writeCDATA(D.nodeValue);case 8:return x.writeComment(D.nodeValue)}}else{if(D.nodeType==1){q=D.hasChildNodes()}}if(q&&!m){u=D.firstChild;while(u){z._serializeNode(u);z.elementName=k;u=u.nextSibling}}if(!p){if(!m){x.writeFullEndElement()}else{x.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+"<!--mce:"+(j.items.length-1)+"-->"+p}))});return j},_unprotect:function(i,j){i=i.replace(/\<!--mce:([0-9]+)--\>/g,function(k,h){return j.items[parseInt(h)]});j.items=[];return i},_encode:function(m){var j=this,k=j.settings,i;if(k.entity_encoding!=="raw"){if(k.entity_encoding.indexOf("named")!=-1){j.setEntities(k.entities);i=j.entityLookup;m=m.replace(j.entitiesRE,function(h){var l;if(l=i[h]){h="&"+l+";"}return h})}if(k.entity_encoding.indexOf("numeric")!=-1){m=m.replace(/[\u007E-\uFFFF]/g,function(h){return"&#"+h.charCodeAt(0)+";"})}}return m},_setup:function(){var h=this,i=this.settings;if(h.done){return}h.done=1;h.setRules(i.valid_elements);h.addRules(i.extended_valid_elements);h.addValidChildRules(i.valid_child_elements);if(i.invalid_elements){h.invalidElementsRE=new RegExp("^("+c(i.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(i.attrib_value_filter){h.attribValueFilter=i.attribValueFilter}},_getAttrib:function(m,j,h){var l,k;h=h||j.name;if(j.forcedVal&&(k=j.forcedVal)){if(k==="{$uid}"){return this.dom.uniqueId()}return k}k=this.dom.getAttrib(m,h);switch(h){case"rowspan":case"colspan":if(k=="1"){k=""}break}if(this.attribValueFilter){k=this.attribValueFilter(h,k,m)}if(j.validVals){for(l=j.validVals.length-1;l>=0;l--){if(k==j.validVals[l]){break}}if(l==-1){return null}}if(k===""&&typeof(j.defaultVal)!="undefined"){k=j.defaultVal;if(k==="{$uid}"){return this.dom.uniqueId()}return k}else{if(h=="class"&&this.processObj.get){k=k.replace(/\s?mceItem\w+\s?/g,"")}}if(k===""){return null}return k}})})(tinymce);(function(tinymce){var each=tinymce.each,Event=tinymce.dom.Event;tinymce.create("tinymce.dom.ScriptLoader",{ScriptLoader:function(s){this.settings=s||{};this.queue=[];this.lookup={}},isDone:function(u){return this.lookup[u]?this.lookup[u].state==2:0},markDone:function(u){this.lookup[u]={state:2,url:u}},add:function(u,cb,s,pr){var t=this,lo=t.lookup,o;if(o=lo[u]){if(cb&&o.state==2){cb.call(s||this)}return o}o={state:0,url:u,func:cb,scope:s||this};if(pr){t.queue.unshift(o)}else{t.queue.push(o)}lo[u]=o;return o},load:function(u,cb,s){var t=this,o;if(o=t.lookup[u]){if(cb&&o.state==2){cb.call(s||t)}return o}function loadScript(u){if(Event.domLoaded||t.settings.strict_mode){tinymce.util.XHR.send({url:tinymce._addVer(u),error:t.settings.error,async:false,success:function(co){t.eval(co)}})}else{document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"><\/script>')}}if(!tinymce.is(u,"string")){each(u,function(u){loadScript(u)});if(cb){cb.call(s||t)}}else{loadScript(u);if(cb){cb.call(s||t)}}},loadQueue:function(cb,s){var t=this;if(!t.queueLoading){t.queueLoading=1;t.queueCallbacks=[];t.loadScripts(t.queue,function(){t.queueLoading=0;if(cb){cb.call(s||t)}each(t.queueCallbacks,function(o){o.func.call(o.scope)})})}else{if(cb){t.queueCallbacks.push({func:cb,scope:s||t})}}},eval:function(co){var w=window;if(!w.execScript){try{eval.call(w,co)}catch(ex){eval(co,w)}}else{w.execScript(co)}},loadScripts:function(sc,cb,s){var t=this,lo=t.lookup;function done(o){o.state=2;if(o.func){o.func.call(o.scope||t)}}function allDone(){var l;l=sc.length;each(sc,function(o){o=lo[o.url];if(o.state===2){done(o);l--}else{load(o)}});if(l===0&&cb){cb.call(s||t);cb=0}}function load(o){if(o.state>0){return}o.state=1;tinymce.dom.ScriptLoader.loadScript(o.url,function(){done(o);allDone()})}each(sc,function(o){var u=o.url;if(!lo[u]){lo[u]=o;t.queue.push(o)}else{o=lo[u]}if(o.state>0){return}if(!Event.domLoaded&&!t.settings.strict_mode){var ix,ol="";if(cb||o.func){o.state=1;ix=tinymce.dom.ScriptLoader._addOnLoad(function(){done(o);allDone()});if(tinymce.isIE){ol=' onreadystatechange="'}else{ol=' onload="'}ol+="tinymce.dom.ScriptLoader._onLoad(this,'"+u+"',"+ix+');"'}document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"'+ol+"><\/script>");if(!o.func){done(o)}}else{load(o)}});allDone()},"static":{_addOnLoad:function(f){var t=this;t._funcs=t._funcs||[];t._funcs.push(f);return t._funcs.length-1},_onLoad:function(e,u,ix){if(!tinymce.isIE||e.readyState=="complete"){this._funcs[ix].call(this)}},loadScript:function(u,cb){var id=tinymce.DOM.uniqueId(),e;function done(){Event.clear(id);tinymce.DOM.remove(id);if(cb){cb.call(document,u);cb=0}}if(tinymce.isIE){tinymce.util.XHR.send({url:tinymce._addVer(u),async:false,success:function(co){window.execScript(co);done()}})}else{e=tinymce.DOM.create("script",{id:id,type:"text/javascript",src:tinymce._addVer(u)});Event.add(e,"load",done);(document.getElementsByTagName("head")[0]||document.body).appendChild(e)}}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader()})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(w){var h,t,s;w=w.target;if(w&&(w=c.getParent(w,"tr"))){h=z.items[w.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(w&&c.hasClass(w,m+"ItemSub")){t=c.getRect(w);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}z.onShowMenu.dispatch(z);if(A.keyboard_focus){a.add(o,"keydown",z._keyHandler,z);c.select("a","menu_"+z.id)[0].focus();z._focusIdx=0}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000"});k=c.add(g,"div",{id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_keyHandler:function(j){var i=this,h=j.keyCode;function g(m){var k=i._focusIdx+m,l=c.select("a","menu_"+i.id)[k];if(l){i._focusIdx=k;l.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,"td");i=p=c.add(i,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" />'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";i+="</tr></tbody></table>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(h){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(l){var i=-1,j,k=l.keyCode;e(f.items,function(m,n){if(f.selectedValue==m.value){i=n}});if(k==38){j=f.items[i-1]}else{if(k==40){j=f.items[i+1]}else{if(k==13){j=f.selectedValue;f.selectedValue=null;f.settings.onselect(j);return b.cancel(l)}}}if(j){f.hideMenu();f.select(j.value)}})}f._focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return c.get(this.id).options.length-1},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(j){var i=g.items[j.target.selectedIndex-1];if(i&&(i=i.value)){g.onChange.dispatch(g,i);if(g.settings.onselect){g.settings.onselect(i)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(j){var i;b.remove(g.id,"change",h);i=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.remove(g.id,"blur",i)});if(j.keyCode==13||j.keyCode==32){f(j);return b.cancel(j)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}i+="<td>"+b.createHTML("a",{id:f.id+"_action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});i+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},i)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(i){i=i.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+i},mce_color:"#"+i})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(i){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(i)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(i){var m;i=i.target;if(i.nodeName=="A"&&(m=i.getAttribute("mce_color"))){k.setColor(m)}return a.cancel(i)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: relative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new a(this),get:function(d){return this.lookup[d]},requireLangPack:function(f){var d,e=b.EditorManager.settings;if(e&&e.language){d=this.urls[f]+"/langs/"+e.language+".js";if(!b.dom.Event.domLoaded&&!e.strict_mode){b.ScriptLoader.load(d)}else{b.ScriptLoader.add(d)}}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));b.ScriptLoader.add(e,d,g)}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(f){var g=f.each,h=f.extend,e=f.DOM,a=f.dom.Event,c=f.ThemeManager,b=f.PluginManager,d=f.explode;f.create("static tinymce.EditorManager",{editors:{},i18n:{},activeEditor:null,preInit:function(){var i=this,j=window.location;f.documentBaseURL=j.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(f.documentBaseURL)){f.documentBaseURL+="/"}f.baseURL=new f.util.URI(f.documentBaseURL).toAbsolute(f.baseURL);f.EditorManager.baseURI=new f.util.URI(f.baseURL);i.onBeforeUnload=new f.util.Dispatcher(i);a.add(window,"beforeunload",function(k){i.onBeforeUnload.dispatch(i,k)})},init:function(q){var p=this,l,k=f.ScriptLoader,o,n,i=[],m;function j(u,v,r){var t=u[v];if(!t){return}if(f.is(t,"string")){r=t.replace(/\.\w+$/,"");r=r?f.resolve(r):0;t=f.resolve(t)}return t.apply(r||this,Array.prototype.slice.call(arguments,2))}q=h({theme:"simple",language:"en",strict_loading_mode:document.contentType=="application/xhtml+xml"},q);p.settings=q;if(!a.domLoaded&&!q.strict_loading_mode){if(q.language){k.add(f.baseURL+"/langs/"+q.language+".js")}if(q.theme&&q.theme.charAt(0)!="-"&&!c.urls[q.theme]){c.load(q.theme,"themes/"+q.theme+"/editor_template"+f.suffix+".js")}if(q.plugins){l=d(q.plugins);g(l,function(r){if(r&&r.charAt(0)!="-"&&!b.urls[r]){if(!f.isWebKit&&r=="safari"){return}b.load(r,"plugins/"+r+"/editor_plugin"+f.suffix+".js")}})}k.loadQueue()}a.add(document,"init",function(){var r,t;j(q,"onpageload");if(q.browsers){r=false;g(d(q.browsers),function(u){switch(u){case"ie":case"msie":if(f.isIE){r=true}break;case"gecko":if(f.isGecko){r=true}break;case"safari":case"webkit":if(f.isWebKit){r=true}break;case"opera":if(f.isOpera){r=true}break}});if(!r){return}}switch(q.mode){case"exact":r=q.elements||"";if(r.length>0){g(d(r),function(u){if(e.get(u)){m=new f.Editor(u,q);i.push(m);m.render(1)}else{o=0;g(document.forms,function(v){g(v.elements,function(w){if(w.name===u){u="mce_editor_"+o;e.setAttrib(w,"id",u);m=new f.Editor(u,q);i.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function s(v,u){return u.constructor===RegExp?u.test(v.className):e.hasClass(v,u)}g(e.select("textarea"),function(u){if(q.editor_deselector&&s(u,q.editor_deselector)){return}if(!q.editor_selector||s(u,q.editor_selector)){n=e.get(u.name);if(!u.id&&!n){u.id=u.name}if(!u.id||p.get(u.id)){u.id=e.uniqueId()}m=new f.Editor(u.id,q);i.push(m);m.render(1)}});break}if(q.oninit){r=t=0;g(i,function(u){t++;if(!u.initialized){u.onInit.add(function(){r++;if(r==t){j(q,"oninit")}})}else{r++}if(r==t){j(q,"oninit")}})}})},get:function(i){return this.editors[i]},getInstanceById:function(i){return this.get(i)},add:function(i){this.editors[i.id]=i;this._setActive(i);return i},remove:function(j){var i=this;if(!i.editors[j.id]){return null}delete i.editors[j.id];if(i.activeEditor==j){i._setActive(null);g(i.editors,function(k){i._setActive(k);return false})}j.destroy();return j},execCommand:function(o,m,l){var n=this,k=n.get(l),i;switch(o){case"mceFocus":k.focus();return true;case"mceAddEditor":case"mceAddControl":if(!n.get(l)){new f.Editor(l,n.settings).render()}return true;case"mceAddFrameControl":i=l.window;i.tinyMCE=tinyMCE;i.tinymce=f;f.DOM.doc=i.document;f.DOM.win=i;k=new f.Editor(l.element_id,l);k.render();if(f.isIE){function j(){k.destroy();i.detachEvent("onunload",j);i=i.tinyMCE=i.tinymce=null}i.attachEvent("onunload",j)}l.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(k){k.remove()}return true;case"mceToggleEditor":if(!k){n.execCommand("mceAddControl",0,l);return true}if(k.isHidden()){k.show()}else{k.hide()}return true}if(n.activeEditor){return n.activeEditor.execCommand(o,m,l)}return false},execInstanceCommand:function(m,l,k,j){var i=this.get(m);if(i){return i.execCommand(l,k,j)}return false},triggerSave:function(){g(this.editors,function(i){i.save()})},addI18n:function(k,l){var i,j=this.i18n;if(!f.is(k,"string")){g(k,function(n,m){g(n,function(q,p){g(q,function(s,r){if(p==="common"){j[m+"."+r]=s}else{j[m+"."+p+"."+r]=s}})})})}else{g(l,function(n,m){j[k+"."+m]=n})}},_setActive:function(i){this.selectedInstance=this.activeEditor=i}});f.EditorManager.preInit()})(tinymce);var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(n){var o=n.DOM,k=n.dom.Event,f=n.extend,l=n.util.Dispatcher;var j=n.each,a=n.isGecko,b=n.isIE,e=n.isWebKit;var d=n.is,h=n.ThemeManager,c=n.PluginManager,i=n.EditorManager;var p=n.inArray,m=n.grep,g=n.explode;n.create("tinymce.Editor",{Editor:function(u,r){var q=this;q.id=q.editorId=u;q.execCommands={};q.queryStateCommands={};q.queryValueCommands={};q.isNotDirty=false;q.plugins={};j(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){q[s]=new l(q)});q.settings=r=f({id:u,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:n.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',visual_table_class:"mceItemTable",visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,removeformat_selector:"span,b,strong,em,i,font,u,strike"},r);q.documentBaseURI=new n.util.URI(r.document_base_url||n.documentBaseURL,{base_uri:tinyMCE.baseURI});q.baseURI=i.baseURI;q.execCallback("setup",q)},render:function(u){var v=this,w=v.settings,x=v.id,q=n.ScriptLoader;if(!k.domLoaded){k.add(document,"init",function(){v.render()});return}if(!u){w.strict_loading_mode=1;tinyMCE.settings=w}if(!v.getElement()){return}if(w.strict_loading_mode){q.settings.strict_mode=w.strict_loading_mode;n.DOM.settings.strict=1}if(!/TEXTAREA|INPUT/i.test(v.getElement().nodeName)&&w.hidden_input&&o.getParent(x,"form")){o.insertAfter(o.create("input",{type:"hidden",name:x}),x)}if(n.WindowManager){v.windowManager=new n.WindowManager(v)}if(w.encoding=="xml"){v.onGetContent.add(function(s,t){if(t.save){t.content=o.encode(t.content)}})}if(w.add_form_submit_trigger){v.onSubmit.addToTop(function(){if(v.initialized){v.save();v.isNotDirty=1}})}if(w.add_unload_trigger){v._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(v.initialized&&!v.destroyed&&!v.isHidden()){v.save({format:"raw",no_events:true})}})}n.addUnload(v.destroy,v);if(w.submit_patch){v.onBeforeRenderUI.add(function(){var s=v.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){v.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){i.triggerSave();v.isNotDirty=1;return v.formElement._mceOldSubmit(v.formElement)}}s=null})}function r(){if(w.language){q.add(n.baseURL+"/langs/"+w.language+".js")}if(w.theme&&w.theme.charAt(0)!="-"&&!h.urls[w.theme]){h.load(w.theme,"themes/"+w.theme+"/editor_template"+n.suffix+".js")}j(g(w.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(!e&&s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+n.suffix+".js")}});q.loadQueue(function(){if(!v.removed){v.init()}})}r()},init:function(){var v,F=this,G=F.settings,C,z,B=F.getElement(),r,q,D,y,A,E;i.add(F);if(G.theme){G.theme=G.theme.replace(/-/,"");r=h.get(G.theme);F.theme=new r();if(F.theme.init&&G.init_theme){F.theme.init(F,h.urls[G.theme]||n.documentBaseURL.replace(/\/$/,""))}}j(g(G.plugins.replace(/\-/g,"")),function(w){var H=c.get(w),t=c.urls[w]||n.documentBaseURL.replace(/\/$/,""),s;if(H){s=new H(F,t);F.plugins[w]=s;if(s.init){s.init(F,t)}}});if(G.popup_css!==false){if(G.popup_css){G.popup_css=F.documentBaseURI.toAbsolute(G.popup_css)}else{G.popup_css=F.baseURI.toAbsolute("themes/"+G.theme+"/skins/"+G.skin+"/dialog.css")}}if(G.popup_css_add){G.popup_css+=","+F.documentBaseURI.toAbsolute(G.popup_css_add)}F.controlManager=new n.ControlManager(F);F.undoManager=new n.UndoManager(F);F.undoManager.onAdd.add(function(t,s){if(!s.initial){return F.onChange.dispatch(F,s,t)}});F.undoManager.onUndo.add(function(t,s){return F.onUndo.dispatch(F,s,t)});F.undoManager.onRedo.add(function(t,s){return F.onRedo.dispatch(F,s,t)});if(G.custom_undo_redo){F.onExecCommand.add(function(t,w,u,H,s){if(w!="Undo"&&w!="Redo"&&w!="mceRepaint"&&(!s||!s.skip_undo)){F.undoManager.add()}})}F.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){F.nodeChanged()}});if(a){function x(s,t){if(!t||!t.initial){F.execCommand("mceRepaint")}}F.onUndo.add(x);F.onRedo.add(x);F.onSetContent.add(x)}F.onBeforeRenderUI.dispatch(F,F.controlManager);if(G.render_ui){C=G.width||B.style.width||B.offsetWidth;z=G.height||B.style.height||B.offsetHeight;F.orgDisplay=B.style.display;E=/^[0-9\.]+(|px)$/i;if(E.test(""+C)){C=Math.max(parseInt(C)+(r.deltaWidth||0),100)}if(E.test(""+z)){z=Math.max(parseInt(z)+(r.deltaHeight||0),100)}r=F.theme.renderUI({targetNode:B,width:C,height:z,deltaWidth:G.delta_width,deltaHeight:G.delta_height});F.editorContainer=r.editorContainer}if(document.domain&&location.hostname!=document.domain){n.relaxedDomain=document.domain}o.setStyles(r.sizeContainer||r.editorContainer,{width:C,height:z});z=(r.iframeHeight||z)+(typeof(z)=="number"?(r.deltaHeight||0):"");if(z<100){z=100}F.iframeHTML=G.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(G.document_base_url!=n.documentBaseURL){F.iframeHTML+='<base href="'+F.documentBaseURI.getURI()+'" />'}F.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(n.relaxedDomain){F.iframeHTML+='<script type="text/javascript">document.domain = "'+n.relaxedDomain+'";<\/script>'}y=G.body_id||"tinymce";if(y.indexOf("=")!=-1){y=F.getParam("body_id","","hash");y=y[F.id]||y}A=G.body_class||"";if(A.indexOf("=")!=-1){A=F.getParam("body_class","","hash");A=A[F.id]||""}F.iframeHTML+='</head><body id="'+y+'" class="mceContentBody '+A+'"></body></html>';if(n.relaxedDomain){if(b||(n.isOpera&&parseFloat(opera.version())>=9.5)){D='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+F.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(n.isOpera){D='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}v=o.add(r.iframeContainer,"iframe",{id:F.id+"_ifr",src:D||'javascript:""',frameBorder:"0",style:{width:"100%",height:z}});F.contentAreaContainer=r.iframeContainer;o.get(r.editorContainer).style.display=F.orgDisplay;o.get(F.id).style.display="none";if(!b||!n.relaxedDomain){F.setupIframe()}B=v=r=null},setupIframe:function(){var z=this,A=z.settings,u=o.get(z.id),v=z.getDoc(),r,x;if(!b||!n.relaxedDomain){v.open();v.write(z.iframeHTML);v.close()}if(!b){try{if(!A.readonly){v.designMode="On"}}catch(w){}}if(b){x=z.getBody();o.hide(x);if(!A.readonly){x.contentEditable=true}o.show(x)}z.dom=new n.dom.DOMUtils(z.getDoc(),{keep_values:true,url_converter:z.convertURL,url_converter_scope:z,hex_colors:A.force_hex_style_colors,class_filter:A.class_filter,update_styles:1,fix_ie_paragraphs:1});z.serializer=new n.dom.Serializer(f(A,{valid_elements:A.verify_html===false?"*[*]":A.valid_elements,dom:z.dom}));z.selection=new n.dom.Selection(z.dom,z.getWin(),z.serializer);z.forceBlocks=new n.ForceBlocks(z,{forced_root_block:A.forced_root_block});z.editorCommands=new n.EditorCommands(z);z.serializer.onPreProcess.add(function(s,t){return z.onPreProcess.dispatch(z,t,s)});z.serializer.onPostProcess.add(function(s,t){return z.onPostProcess.dispatch(z,t,s)});z.onPreInit.dispatch(z);if(!A.gecko_spellcheck){z.getBody().spellcheck=0}if(!A.readonly){z._addEvents()}z.controlManager.onPostRender.dispatch(z,z.controlManager);z.onPostRender.dispatch(z);if(A.directionality){z.getBody().dir=A.directionality}if(A.nowrap){z.getBody().style.whiteSpace="nowrap"}if(A.custom_elements){function y(s,t){j(g(A.custom_elements),function(B){var C;if(B.indexOf("~")===0){B=B.substring(1);C="span"}else{C="div"}t.content=t.content.replace(new RegExp("<("+B+")([^>]*)>","g"),"<"+C+' mce_name="$1"$2>');t.content=t.content.replace(new RegExp("</("+B+")>","g"),"</"+C+">")})}z.onBeforeSetContent.add(y);z.onPostProcess.add(function(s,t){if(t.set){y(s,t)}})}if(A.handle_node_change_callback){z.onNodeChange.add(function(t,s,B){z.execCallback("handle_node_change_callback",z.id,B,-1,-1,true,z.selection.isCollapsed())})}if(A.save_callback){z.onSaveContent.add(function(s,B){var t=z.execCallback("save_callback",z.id,B.content,z.getBody());if(t){B.content=t}})}if(A.onchange_callback){z.onChange.add(function(t,s){z.execCallback("onchange_callback",z,s)})}if(A.convert_newlines_to_brs){z.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(A.fix_nesting&&b){z.onBeforeSetContent.add(function(s,t){t.content=z._fixNesting(t.content)})}if(A.preformatted){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(A.verify_css_classes){z.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!z.classesRE){t=z.dom.getClasses();if(t.length>0){C="";j(t,function(s){C+=(C?"|":"")+s["class"]});z.classesRE=new RegExp("("+C+")","gi")}}return !z.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||z.classesRE.test(B)?B:""}return B}}if(A.convert_fonts_to_spans){z._convertFonts()}if(A.inline_styles){z._convertInlineElements()}if(A.cleanup_callback){z.onBeforeSetContent.add(function(s,t){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)});z.onPreProcess.add(function(s,t){if(t.set){z.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){z.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});z.onPostProcess.add(function(s,t){if(t.set){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=z.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(A.save_callback){z.onGetContent.add(function(s,t){if(t.save){t.content=z.execCallback("save_callback",z.id,t.content,z.getBody())}})}if(A.handle_event_callback){z.onEvent.add(function(s,t,B){if(z.execCallback("handle_event_callback",t,s,B)===false){k.cancel(t)}})}z.onSetContent.add(function(){z.addVisual(z.getBody())});if(A.padd_empty_editor){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function q(s,t){j(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{mce_bogus:1})}})}z.onExecCommand.add(function(s,t){if(t==="CreateLink"){q(s)}});z.onSetContent.add(z.selection.onSetContent.add(q));if(!A.readonly){try{v.designMode="Off";v.designMode="On"}catch(w){}}}setTimeout(function(){if(z.removed){return}z.load({initial:true,format:(A.cleanup_on_startup?"html":"raw")});z.startContent=z.getContent({format:"raw"});z.undoManager.add({initial:true});z.initialized=true;z.onInit.dispatch(z);z.execCallback("setupcontent_callback",z.id,z.getBody(),z.getDoc());z.execCallback("init_instance_callback",z);z.focus(true);z.nodeChanged({initial:1});if(A.content_css){n.each(g(A.content_css),function(s){z.dom.loadCSS(z.documentBaseURI.toAbsolute(s))})}if(A.auto_focus){setTimeout(function(){var s=i.get(A.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);u=null},focus:function(r){var u,q=this,s=q.settings.content_editable;if(!r){if(!s&&(!b||q.selection.getNode().ownerDocument!=q.getDoc())){q.getWin().focus()}}if(i.activeEditor!=q){if((u=i.activeEditor)!=null){u.onDeactivate.dispatch(u,q)}q.onActivate.dispatch(q,u)}i._setActive(q)},execCallback:function(v){var q=this,u=q.settings[v],r;if(!u){return}if(q.callbackLookup&&(r=q.callbackLookup[v])){u=r.func;r=r.scope}if(d(u,"string")){r=u.replace(/\.\w+$/,"");r=r?n.resolve(r):0;u=n.resolve(u);q.callbackLookup=q.callbackLookup||{};q.callbackLookup[v]={func:u,scope:r}}return u.apply(r||q,Array.prototype.slice.call(arguments,1))},translate:function(q){var t=this.settings.language||"en",r=i.i18n;if(!q){return""}return r[t+"."+q]||q.replace(/{\#([^}]+)\}/g,function(u,s){return r[t+"."+s]||"{#"+s+"}"})},getLang:function(r,q){return i.i18n[(this.settings.language||"en")+"."+r]||(d(q)?q:"{#"+r+"}")},getParam:function(w,s,q){var t=n.trim,r=d(this.settings[w])?this.settings[w]:s,u;if(q==="hash"){u={};if(d(r,"string")){j(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(x){x=x.split("=");if(x.length>1){u[t(x[0])]=t(x[1])}else{u[t(x[0])]=t(x)}})}else{u=r}return u}return r},nodeChanged:function(u){var q=this,r=q.selection,v=r.getNode()||q.getBody();if(q.initialized){q.onNodeChange.dispatch(q,u?u.controlManager||q.controlManager:q.controlManager,b&&v.ownerDocument!=q.getDoc()?q.getBody():v,r.isCollapsed(),u)}},addButton:function(u,r){var q=this;q.buttons=q.buttons||{};q.buttons[u]=r},addCommand:function(t,r,q){this.execCommands[t]={func:r,scope:q||this}},addQueryStateHandler:function(t,r,q){this.queryStateCommands[t]={func:r,scope:q||this}},addQueryValueHandler:function(t,r,q){this.queryValueCommands[t]={func:r,scope:q||this}},addShortcut:function(s,v,q,u){var r=this,w;if(!r.settings.custom_shortcuts){return false}r.shortcuts=r.shortcuts||{};if(d(q,"string")){w=q;q=function(){r.execCommand(w,false,null)}}if(d(q,"object")){w=q;q=function(){r.execCommand(w[0],w[1],w[2])}}j(g(s),function(t){var x={func:q,scope:u||this,desc:v,alt:false,ctrl:false,shift:false};j(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});r.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,w,z,q){var u=this,v=0,y,r;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!q||!q.skip_focus)){u.focus()}y={};u.onBeforeExecCommand.dispatch(u,x,w,z,y);if(y.terminate){return false}if(u.execCallback("execcommand_callback",u.id,u.selection.getNode(),x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(y=u.execCommands[x]){r=y.func.call(y.scope,w,z);if(r!==true){u.onExecCommand.dispatch(u,x,w,z,q);return r}}j(u.plugins,function(s){if(s.execCommand&&s.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);v=1;return false}});if(v){return true}if(u.theme&&u.theme.execCommand&&u.theme.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(n.GlobalCommands.execCommand(u,x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(u.editorCommands.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}u.getDoc().execCommand(x,w,z);u.onExecCommand.dispatch(u,x,w,z,q)},queryCommandState:function(w){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryStateCommands[w]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandState(w);if(v!==-1){return v}try{return this.getDoc().queryCommandState(w)}catch(q){}},queryCommandValue:function(w){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryValueCommands[w]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandValue(w);if(d(v)){return v}try{return this.getDoc().queryCommandValue(w)}catch(q){}},show:function(){var q=this;o.show(q.getContainer());o.hide(q.id);q.load()},hide:function(){var q=this,r=q.getDoc();if(b&&r){r.execCommand("SelectAll")}q.save();o.hide(q.getContainer());o.setStyle(q.id,"display",q.orgDisplay)},isHidden:function(){return !o.isHidden(this.id)},setProgressState:function(q,r,s){this.onSetProgressState.dispatch(this,q,r,s);return q},load:function(u){var q=this,s=q.getElement(),r;if(s){u=u||{};u.load=true;r=q.setContent(d(s.value)?s.value:s.innerHTML,u);u.element=s;if(!u.no_events){q.onLoadContent.dispatch(q,u)}u.element=s=null;return r}},save:function(v){var q=this,u=q.getElement(),r,s;if(!u||!q.initialized){return}v=v||{};v.save=true;if(!v.no_events){q.undoManager.typing=0;q.undoManager.add()}v.element=u;r=v.content=q.getContent(v);if(!v.no_events){q.onSaveContent.dispatch(q,v)}r=v.content;if(!/TEXTAREA|INPUT/i.test(u.nodeName)){u.innerHTML=r;if(s=o.getParent(q.id,"form")){j(s.elements,function(t){if(t.name==q.id){t.value=r;return false}})}}else{u.value=r}v.element=u=null;return r},setContent:function(r,s){var q=this;s=s||{};s.format=s.format||"html";s.set=true;s.content=r;if(!s.no_events){q.onBeforeSetContent.dispatch(q,s)}if(!n.isIE&&(r.length===0||/^\s+$/.test(r))){s.content=q.dom.setHTML(q.getBody(),'<br mce_bogus="1" />');s.format="raw"}s.content=q.dom.setHTML(q.getBody(),n.trim(s.content));if(s.format!="raw"&&q.settings.cleanup){s.getInner=true;s.content=q.dom.setHTML(q.getBody(),q.serializer.serialize(q.getBody(),s))}if(!s.no_events){q.onSetContent.dispatch(q,s)}return s.content},getContent:function(s){var q=this,r;s=s||{};s.format=s.format||"html";s.get=true;if(!s.no_events){q.onBeforeGetContent.dispatch(q,s)}if(s.format!="raw"&&q.settings.cleanup){s.getInner=true;r=q.serializer.serialize(q.getBody(),s)}else{r=q.getBody().innerHTML}r=r.replace(/^\s*|\s*$/g,"");s.content=r;if(!s.no_events){q.onGetContent.dispatch(q,s)}return s.content},isDirty:function(){var q=this;return n.trim(q.startContent)!=n.trim(q.getContent({format:"raw",no_events:1}))&&!q.isNotDirty},getContainer:function(){var q=this;if(!q.container){q.container=o.get(q.editorContainer||q.id+"_parent")}return q.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return o.get(this.settings.content_element||this.id)},getWin:function(){var q=this,r;if(!q.contentWindow){r=o.get(q.id+"_ifr");if(r){q.contentWindow=r.contentWindow}}return q.contentWindow},getDoc:function(){var r=this,q;if(!r.contentDocument){q=r.getWin();if(q){r.contentDocument=q.document}}return r.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(q,x,w){var r=this,v=r.settings;if(v.urlconverter_callback){return r.execCallback("urlconverter_callback",q,w,true,x)}if(!v.convert_urls||(w&&w.nodeName=="LINK")||q.indexOf("file:")===0){return q}if(v.relative_urls){return r.documentBaseURI.toRelative(q)}q=r.documentBaseURI.toAbsolute(q,v.remove_script_host);return q},addVisual:function(u){var q=this,r=q.settings;u=u||q.getBody();if(!d(q.hasVisual)){q.hasVisual=r.visual}j(q.dom.select("table,a",u),function(t){var s;switch(t.nodeName){case"TABLE":s=q.dom.getAttrib(t,"border");if(!s||s=="0"){if(q.hasVisual){q.dom.addClass(t,r.visual_table_class)}else{q.dom.removeClass(t,r.visual_table_class)}}return;case"A":s=q.dom.getAttrib(t,"name");if(s){if(q.hasVisual){q.dom.addClass(t,"mceItemAnchor")}else{q.dom.removeClass(t,"mceItemAnchor")}}return}});q.onVisualAid.dispatch(q,u,q.hasVisual)},remove:function(){var q=this,r=q.getContainer();q.removed=1;q.hide();q.execCallback("remove_instance_callback",q);q.onRemove.dispatch(q);q.onExecCommand.listeners=[];i.remove(q);o.remove(r)},destroy:function(r){var q=this;if(q.destroyed){return}if(!r){n.removeUnload(q.destroy);tinyMCE.onBeforeUnload.remove(q._beforeUnload);if(q.theme&&q.theme.destroy){q.theme.destroy()}q.controlManager.destroy();q.selection.destroy();q.dom.destroy();if(!q.settings.content_editable){k.clear(q.getWin());k.clear(q.getDoc())}k.clear(q.getBody());k.clear(q.formElement)}if(q.formElement){q.formElement.submit=q.formElement._mceOldSubmit;q.formElement._mceOldSubmit=null}q.contentAreaContainer=q.formElement=q.container=q.settings.content_element=q.bodyElement=q.contentDocument=q.contentWindow=null;if(q.selection){q.selection=q.selection.win=q.selection.dom=q.selection.dom.doc=null}q.destroyed=1},_addEvents:function(){var w=this,v,y=w.settings,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function u(t,A){var s=t.type;if(w.removed){return}if(w.onEvent.dispatch(w,t,A)!==false){w[x[t.fakeType||t.type]].dispatch(w,t,A)}}j(x,function(t,s){switch(s){case"contextmenu":if(n.isOpera){w.dom.bind(w.getBody(),"mousedown",function(A){if(A.ctrlKey){A.fakeType="contextmenu";u(A)}})}else{w.dom.bind(w.getBody(),s,u)}break;case"paste":w.dom.bind(w.getBody(),s,function(A){u(A)});break;case"submit":case"reset":w.dom.bind(w.getElement().form||o.getParent(w.id,"form"),s,u);break;default:w.dom.bind(y.content_editable?w.getBody():w.getDoc(),s,u)}});w.dom.bind(y.content_editable?w.getBody():(a?w.getDoc():w.getWin()),"focus",function(s){w.focus(true)});if(n.isGecko){w.dom.bind(w.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("mce_src"))){t.src=w.documentBaseURI.toAbsolute(s)}})}if(a){function q(){var B=this,D=B.getDoc(),C=B.settings;if(a&&!C.readonly){if(B._isHidden()){try{if(!C.content_editable){D.designMode="On"}}catch(A){}}try{D.execCommand("styleWithCSS",0,false)}catch(A){if(!B._isHidden()){try{D.execCommand("useCSS",0,true)}catch(A){}}}if(!C.table_inline_editing){try{D.execCommand("enableInlineTableEditing",false,false)}catch(A){}}if(!C.object_resizing){try{D.execCommand("enableObjectResizing",false,false)}catch(A){}}}}w.onBeforeExecCommand.add(q);w.onMouseDown.add(q)}w.onMouseUp.add(w.nodeChanged);w.onClick.add(w.nodeChanged);w.onKeyUp.add(function(s,t){var A=t.keyCode;if((A>=33&&A<=36)||(A>=37&&A<=40)||A==13||A==45||A==46||A==8||(n.isMac&&(A==91||A==93))||t.ctrlKey){w.nodeChanged()}});w.onReset.add(function(){w.setContent(w.startContent,{format:"raw"})});if(y.custom_shortcuts){if(y.custom_undo_redo_keyboard_shortcuts){w.addShortcut("ctrl+z",w.getLang("undo_desc"),"Undo");w.addShortcut("ctrl+y",w.getLang("redo_desc"),"Redo")}if(a){w.addShortcut("ctrl+b",w.getLang("bold_desc"),"Bold");w.addShortcut("ctrl+i",w.getLang("italic_desc"),"Italic");w.addShortcut("ctrl+u",w.getLang("underline_desc"),"Underline")}for(v=1;v<=6;v++){w.addShortcut("ctrl+"+v,"",["FormatBlock",false,"<h"+v+">"])}w.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);w.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);w.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function z(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}j(w.shortcuts,function(A){if(n.isMac&&A.ctrl!=t.metaKey){return}else{if(!n.isMac&&A.ctrl!=t.ctrlKey){return}}if(A.alt!=t.altKey){return}if(A.shift!=t.shiftKey){return}if(t.keyCode==A.keyCode||(t.charCode&&t.charCode==A.charCode)){s=A;return false}});return s}w.onKeyUp.add(function(s,t){var A=z(t);if(A){return k.cancel(t)}});w.onKeyPress.add(function(s,t){var A=z(t);if(A){return k.cancel(t)}});w.onKeyDown.add(function(s,t){var A=z(t);if(A){A.func.call(A.scope);return k.cancel(t)}})}if(n.isIE){w.dom.bind(w.getDoc(),"controlselect",function(A){var t=w.resizeInfo,s;A=A.target;if(A.nodeName!=="IMG"){return}if(t){w.dom.unbind(t.node,t.ev,t.cb)}if(!w.dom.hasClass(A,"mceItemNoResize")){ev="resizeend";s=w.dom.bind(A,ev,function(C){var B;C=C.target;if(B=w.dom.getStyle(C,"width")){w.dom.setAttrib(C,"width",B.replace(/[^0-9%]+/g,""));w.dom.setStyle(C,"width","")}if(B=w.dom.getStyle(C,"height")){w.dom.setAttrib(C,"height",B.replace(/[^0-9%]+/g,""));w.dom.setStyle(C,"height","")}})}else{ev="resizestart";s=w.dom.bind(A,"resizestart",k.cancel,k)}t=w.resizeInfo={node:A,ev:ev,cb:s}});w.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(w.selection.getRng().item){w.selection.getRng().item(0).removeNode();return k.cancel(t)}}})}if(n.isOpera){w.onClick.add(function(s,t){k.prevent(t)})}if(y.custom_undo_redo){function r(){w.undoManager.typing=0;w.undoManager.add()}if(n.isIE){w.dom.bind(w.getWin(),"blur",function(s){var t;if(w.selection){t=w.selection.getNode();if(!w.removed&&t.ownerDocument&&t.ownerDocument!=w.getDoc()){r()}}})}else{w.dom.bind(w.getDoc(),"blur",function(){if(w.selection&&!w.removed){r()}})}w.onMouseDown.add(r);w.onKeyUp.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){w.undoManager.typing=0;w.undoManager.add()}});w.onKeyDown.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45){if(w.undoManager.typing){w.undoManager.add();w.undoManager.typing=0}return}if(!w.undoManager.typing){w.undoManager.add();w.undoManager.typing=1}})}},_convertInlineElements:function(){var z=this,B=z.settings,r=z.dom,y,w,u,A,q;function x(s,t){if(!B.inline_styles){return}if(t.get){j(z.dom.select("table,u,strike",t.node),function(v){switch(v.nodeName){case"TABLE":if(y=r.getAttrib(v,"height")){r.setStyle(v,"height",y);r.setAttrib(v,"height","")}break;case"U":case"STRIKE":v.style.textDecoration=v.nodeName=="U"?"underline":"line-through";r.setAttrib(v,"mce_style","");r.setAttrib(v,"mce_name","span");break}})}else{if(t.set){j(z.dom.select("table,span",t.node).reverse(),function(v){if(v.nodeName=="TABLE"){if(y=r.getStyle(v,"height")){r.setAttrib(v,"height",y.replace(/[^0-9%]+/g,""))}}else{if(v.style.textDecoration=="underline"){u="u"}else{if(v.style.textDecoration=="line-through"){u="strike"}else{u=""}}if(u){v.style.textDecoration="";r.setAttrib(v,"mce_style","");w=r.create(u,{style:r.getAttrib(v,"style")});r.replace(w,v,1)}}})}}}z.onPreProcess.add(x);if(!B.cleanup_on_startup){z.onSetContent.add(function(s,t){if(t.initial){x(z,{node:z.getBody(),set:1})}})}},_convertFonts:function(){var w=this,x=w.settings,z=w.dom,v,r,q,u;if(!x.inline_styles){return}v=[8,10,12,14,18,24,36];r=["xx-small","x-small","small","medium","large","x-large","xx-large"];if(q=x.font_size_style_values){q=g(q)}if(u=x.font_size_classes){u=g(u)}function y(B){var C,A,t,s;if(!x.inline_styles){return}t=w.dom.select("font",B);for(s=t.length-1;s>=0;s--){C=t[s];A=z.create("span",{style:z.getAttrib(C,"style"),"class":z.getAttrib(C,"class")});z.setStyles(A,{fontFamily:z.getAttrib(C,"face"),color:z.getAttrib(C,"color"),backgroundColor:C.style.backgroundColor});if(C.size){if(q){z.setStyle(A,"fontSize",q[parseInt(C.size)-1])}else{z.setAttrib(A,"class",u[parseInt(C.size)-1])}}z.setAttrib(A,"mce_style","");z.replace(A,C,1)}}w.onPreProcess.add(function(s,t){if(t.get){y(t.node)}});w.onSetContent.add(function(s,t){if(t.initial){y(t.node)}})},_isHidden:function(){var q;if(!a){return 0}q=this.selection.getSel();return(!q||!q.rangeCount||q.rangeCount==0)},_fixNesting:function(r){var t=[],q;r=r.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(u,s,w){var v;if(s==="/"){if(!t.length){return""}if(w!==t[t.length-1].tag){for(q=t.length-1;q>=0;q--){if(t[q].tag===w){t[q].close=1;break}}return""}else{t.pop();if(t.length&&t[t.length-1].close){u=u+"</"+t[t.length-1].tag+">";t.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(w)){return u}if(/\/>$/.test(u)){return u}t.push({tag:w})}return u});for(q=t.length-1;q>=0;q--){r+="</"+t[q].tag+">"}return r}})})(tinymce);(function(d){var f=d.each,c=d.isIE,a=d.isGecko,b=d.isOpera,e=d.isWebKit;d.create("tinymce.EditorCommands",{EditorCommands:function(g){this.editor=g},execCommand:function(k,j,l){var h=this,g=h.editor,i;switch(k){case"mceResetDesignMode":case"mceBeginUndoLevel":return true;case"unlink":h.UnLink();return true;case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":h.mceJustify(k,k.substring(7).toLowerCase());return true;default:i=this[k];if(i){i.call(this,j,l);return true}}return false},Indent:function(){var g=this.editor,l=g.dom,j=g.selection,k,h,i;h=g.settings.indentation;i=/[a-z%]+$/i.exec(h);h=parseInt(h);if(g.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){f(j.getSelectedBlocks(),function(m){l.setStyle(m,"paddingLeft",(parseInt(m.style.paddingLeft||0)+h)+i)});return}g.getDoc().execCommand("Indent",false,null);if(c){l.getParent(j.getNode(),function(m){if(m.nodeName=="BLOCKQUOTE"){m.dir=m.style.cssText=""}})}},Outdent:function(){var h=this.editor,m=h.dom,k=h.selection,l,g,i,j;i=h.settings.indentation;j=/[a-z%]+$/i.exec(i);i=parseInt(i);if(h.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){f(k.getSelectedBlocks(),function(n){g=Math.max(0,parseInt(n.style.paddingLeft||0)-i);m.setStyle(n,"paddingLeft",g?g+j:"")});return}h.getDoc().execCommand("Outdent",false,null)},mceSetContent:function(h,g){this.editor.setContent(g)},mceToggleVisualAid:function(){var g=this.editor;g.hasVisual=!g.hasVisual;g.addVisual()},mceReplaceContent:function(h,g){var i=this.editor.selection;i.setContent(g.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(i,h){var g=this.editor,j=g.selection,k=g.dom.getParent(j.getNode(),"a");if(d.is(h,"string")){h={href:h}}function l(m){f(h,function(o,n){g.dom.setAttrib(m,n,o)})}if(!k){g.execCommand("CreateLink",false,"javascript:mctmp(0);");f(g.dom.select("a[href=javascript:mctmp(0);]"),function(m){l(m)})}else{if(h.href){l(k)}else{g.dom.remove(k,1)}}},UnLink:function(){var g=this.editor,h=g.selection;if(h.isCollapsed()){h.select(h.getNode())}g.getDoc().execCommand("unlink",false,null);h.collapse(0)},FontName:function(i,h){var j=this,g=j.editor,k=g.selection,l;if(!h){if(k.isCollapsed()){k.select(k.getNode())}}else{if(g.settings.convert_fonts_to_spans){j._applyInlineStyle("span",{style:{fontFamily:h}})}else{g.getDoc().execCommand("FontName",false,h)}}},FontSize:function(j,i){var h=this.editor,l=h.settings,k,g;if(l.convert_fonts_to_spans&&i>=1&&i<=7){g=d.explode(l.font_size_style_values);k=d.explode(l.font_size_classes);if(k){i=k[i-1]||i}else{i=g[i-1]||i}}if(i>=1&&i<=7){h.getDoc().execCommand("FontSize",false,i)}else{this._applyInlineStyle("span",{style:{fontSize:i}})}},queryCommandValue:function(h){var g=this["queryValue"+h];if(g){return g.call(this,h)}return false},queryCommandState:function(h){var g;switch(h){case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":return this.queryStateJustify(h,h.substring(7).toLowerCase());default:if(g=this["queryState"+h]){return g.call(this,h)}}return -1},_queryState:function(h){try{return this.editor.getDoc().queryCommandState(h)}catch(g){}},_queryVal:function(h){try{return this.editor.getDoc().queryCommandValue(h)}catch(g){}},queryValueFontSize:function(){var h=this.editor,g=0,i;if(i=h.dom.getParent(h.selection.getNode(),"span")){g=i.style.fontSize}if(!g&&(b||e)){if(i=h.dom.getParent(h.selection.getNode(),"font")){g=i.size}return g}return g||this._queryVal("FontSize")},queryValueFontName:function(){var h=this.editor,g=0,i;if(i=h.dom.getParent(h.selection.getNode(),"font")){g=i.face}if(i=h.dom.getParent(h.selection.getNode(),"span")){g=i.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}if(!g){g=this._queryVal("FontName")}return g},mceJustify:function(o,p){var k=this.editor,m=k.selection,g=m.getNode(),q=g.nodeName,h,j,i=k.dom,l;if(k.settings.inline_styles&&this.queryStateJustify(o,p)){l=1}h=i.getParent(g,k.dom.isBlock);if(q=="IMG"){if(p=="full"){return}if(l){if(p=="center"){i.setStyle(h||g.parentNode,"textAlign","")}i.setStyle(g,"float","");this.mceRepaint();return}if(p=="center"){if(h&&/^(TD|TH)$/.test(h.nodeName)){h=0}if(!h||h.childNodes.length>1){j=i.create("p");j.appendChild(g.cloneNode(false));if(h){i.insertAfter(j,h)}else{i.insertAfter(j,g)}i.remove(g);g=j.firstChild;h=j}i.setStyle(h,"textAlign",p);i.setStyle(g,"float","")}else{i.setStyle(g,"float",p);i.setStyle(h||g.parentNode,"textAlign","")}this.mceRepaint();return}if(k.settings.inline_styles&&k.settings.forced_root_block){if(l){p=""}f(m.getSelectedBlocks(i.getParent(m.getStart(),i.isBlock),i.getParent(m.getEnd(),i.isBlock)),function(n){i.setAttrib(n,"align","");i.setStyle(n,"textAlign",p=="full"?"justify":p)});return}else{if(!l){k.getDoc().execCommand(o,false,null)}}if(k.settings.inline_styles){if(l){i.getParent(k.selection.getNode(),function(r){if(r.style&&r.style.textAlign){i.setStyle(r,"textAlign","")}});return}f(i.select("*"),function(s){var r=s.align;if(r){if(r=="full"){r="justify"}i.setStyle(s,"textAlign",r);i.setAttrib(s,"align","")}})}},mceSetCSSClass:function(h,g){this.mceSetStyleInfo(0,{command:"setattrib",name:"class",value:g})},getSelectedElement:function(){var w=this,o=w.editor,n=o.dom,s=o.selection,h=s.getRng(),l,k,u,p,j,g,q,i,x,v;if(s.isCollapsed()||h.item){return s.getNode()}v=o.settings.merge_styles_invalid_parents;if(d.is(v,"string")){v=new RegExp(v,"i")}if(c){l=h.duplicate();l.collapse(true);u=l.parentElement();k=h.duplicate();k.collapse(false);p=k.parentElement();if(u!=p){l.move("character",1);u=l.parentElement()}if(u==p){l=h.duplicate();l.moveToElementText(u);if(l.compareEndPoints("StartToStart",h)==0&&l.compareEndPoints("EndToEnd",h)==0){return v&&v.test(u.nodeName)?null:u}}}else{function m(r){return n.getParent(r,"*")}u=h.startContainer;p=h.endContainer;j=h.startOffset;g=h.endOffset;if(!h.collapsed){if(u==p){if(j-g<2){if(u.hasChildNodes()){i=u.childNodes[j];return v&&v.test(i.nodeName)?null:i}}}}if(u.nodeType!=3||p.nodeType!=3){return null}if(j==0){i=m(u);if(i&&i.firstChild!=u){i=null}}if(j==u.nodeValue.length){q=u.nextSibling;if(q&&q.nodeType==1){i=u.nextSibling}}if(g==0){q=p.previousSibling;if(q&&q.nodeType==1){x=q}}if(g==p.nodeValue.length){x=m(p);if(x&&x.lastChild!=p){x=null}}if(i==x){return v&&i&&v.test(i.nodeName)?null:i}}return null},mceSetStyleInfo:function(n,m){var q=this,h=q.editor,j=h.getDoc(),g=h.dom,i,k,r=h.selection,p=m.wrapper||"span",k=r.getBookmark(),o;function l(t,s){if(t.nodeType==1){switch(m.command){case"setattrib":return g.setAttrib(t,m.name,m.value);case"setstyle":return g.setStyle(t,m.name,m.value);case"removeformat":return g.setAttrib(t,"class","")}}}o=h.settings.merge_styles_invalid_parents;if(d.is(o,"string")){o=new RegExp(o,"i")}if((i=q.getSelectedElement())&&!h.settings.force_span_wrappers){l(i,1)}else{j.execCommand("FontName",false,"__");f(g.select("span,font"),function(u){var s,t;if(g.getAttrib(u,"face")=="__"||u.style.fontFamily==="__"){s=g.create(p,{mce_new:"1"});l(s);f(u.childNodes,function(v){s.appendChild(v.cloneNode(true))});g.replace(s,u)}})}f(g.select(p).reverse(),function(t){var s=t.parentNode;if(!g.getAttrib(t,"mce_new")){s=g.getParent(t,"*[mce_new]");if(s){g.remove(t,1)}}});f(g.select(p).reverse(),function(t){var s=t.parentNode;if(!s||!g.getAttrib(t,"mce_new")){return}if(h.settings.force_span_wrappers&&s.nodeName!="SPAN"){return}if(s.nodeName==p.toUpperCase()&&s.childNodes.length==1){return g.remove(s,1)}if(t.nodeType==1&&(!o||!o.test(s.nodeName))&&s.childNodes.length==1){l(s);g.setAttrib(t,"class","")}});f(g.select(p).reverse(),function(s){if(g.getAttrib(s,"mce_new")||(g.getAttribs(s).length<=1&&s.className==="")){if(!g.getAttrib(s,"class")&&!g.getAttrib(s,"style")){return g.remove(s,1)}g.setAttrib(s,"mce_new","")}});r.moveToBookmark(k)},queryStateJustify:function(k,h){var g=this.editor,j=g.selection.getNode(),i=g.dom;if(j&&j.nodeName=="IMG"){if(i.getStyle(j,"float")==h){return 1}return j.parentNode.style.textAlign==h}j=i.getParent(g.selection.getStart(),function(l){return l.nodeType==1&&l.style.textAlign});if(h=="full"){h="justify"}if(g.settings.inline_styles){return(j&&j.style.textAlign==h)}return this._queryState(k)},ForeColor:function(i,h){var g=this.editor;if(g.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{color:h}});return}else{g.getDoc().execCommand("ForeColor",false,h)}},HiliteColor:function(i,k){var h=this,g=h.editor,j=g.getDoc();if(g.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{backgroundColor:k}});return}function l(n){if(!a){return}try{j.execCommand("styleWithCSS",0,n)}catch(m){j.execCommand("useCSS",0,!n)}}if(a||b){l(true);j.execCommand("hilitecolor",false,k);l(false)}else{j.execCommand("BackColor",false,k)}},FormatBlock:function(n,h){var o=this,l=o.editor,p=l.selection,j=l.dom,g,k,m;function i(q){return/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(q.nodeName)}g=j.getParent(p.getNode(),function(q){return i(q)});if(g){if((c&&i(g.parentNode))||g.nodeName=="DIV"){k=l.dom.create(h);f(j.getAttribs(g),function(q){j.setAttrib(k,q.nodeName,j.getAttrib(g,q.nodeName))});m=p.getBookmark();j.replace(k,g,1);p.moveToBookmark(m);l.nodeChanged();return}}h=l.settings.forced_root_block?(h||"<p>"):h;if(h.indexOf("<")==-1){h="<"+h+">"}if(d.isGecko){h=h.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,"$1")}l.getDoc().execCommand("FormatBlock",false,h)},mceCleanup:function(){var h=this.editor,i=h.selection,g=i.getBookmark();h.setContent(h.getContent());i.moveToBookmark(g)},mceRemoveNode:function(j,k){var h=this.editor,i=h.selection,g,l=k||i.getNode();if(l==h.getBody()){return}g=i.getBookmark();h.dom.remove(l,1);i.moveToBookmark(g);h.nodeChanged()},mceSelectNodeDepth:function(i,j){var g=this.editor,h=g.selection,k=0;g.dom.getParent(h.getNode(),function(l){if(l.nodeType==1&&k++==j){h.select(l);g.nodeChanged();return false}},g.getBody())},mceSelectNode:function(h,g){this.editor.selection.select(g)},mceInsertContent:function(g,h){this.editor.selection.setContent(h)},mceInsertRawHTML:function(h,i){var g=this.editor;g.selection.setContent("tiny_mce_marker");g.setContent(g.getContent().replace(/tiny_mce_marker/g,i))},mceRepaint:function(){var i,g,j=this.editor;if(d.isGecko){try{i=j.selection;g=i.getBookmark(true);if(i.getSel()){i.getSel().selectAllChildren(j.getBody())}i.collapse(true);i.moveToBookmark(g)}catch(h){}}},queryStateUnderline:function(){var g=this.editor,h=g.selection.getNode();if(h&&h.nodeName=="A"){return false}return this._queryState("Underline")},queryStateOutdent:function(){var g=this.editor,h;if(g.settings.inline_styles){if((h=g.dom.getParent(g.selection.getStart(),g.dom.isBlock))&&parseInt(h.style.paddingLeft)>0){return true}if((h=g.dom.getParent(g.selection.getEnd(),g.dom.isBlock))&&parseInt(h.style.paddingLeft)>0){return true}}return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList()||(!g.settings.inline_styles&&!!g.dom.getParent(g.selection.getNode(),"BLOCKQUOTE"))},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(g){return g.nodeName==="BLOCKQUOTE"})},_applyInlineStyle:function(o,j,m){var q=this,n=q.editor,l=n.dom,i,p={},k,r;o=o.toUpperCase();if(m&&m.check_classes&&j["class"]){m.check_classes.push(j["class"])}function h(){f(l.select(o).reverse(),function(t){var s=0;f(l.getAttribs(t),function(u){if(u.nodeName.substring(0,1)!="_"&&l.getAttrib(t,u.nodeName)!=""){s++}});if(s==0){l.remove(t,1)}})}function g(){var s;f(l.select("span,font"),function(t){if(t.style.fontFamily=="mceinline"||t.face=="mceinline"){if(!s){s=n.selection.getBookmark()}j._mce_new="1";l.replace(l.create(o,j),t,1)}});f(l.select(o+"[_mce_new]"),function(u){function t(v){if(v.nodeType==1){f(j.style,function(x,w){l.setStyle(v,w,"")});if(j["class"]&&v.className&&m){f(m.check_classes,function(w){if(l.hasClass(v,w)){l.removeClass(v,w)}})}}}f(l.select(o,u),t);if(u.parentNode&&u.parentNode.nodeType==1&&u.parentNode.childNodes.length==1){t(u.parentNode)}l.getParent(u.parentNode,function(v){if(v.nodeType==1){if(j.style){f(j.style,function(y,x){var w;if(!p[x]&&(w=l.getStyle(v,x))){if(w===y){l.setStyle(u,x,"")}p[x]=1}})}if(j["class"]&&v.className&&m){f(m.check_classes,function(w){if(l.hasClass(v,w)){l.removeClass(u,w)}})}}return false});u.removeAttribute("_mce_new")});h();n.selection.moveToBookmark(s);return !!s}n.focus();n.getDoc().execCommand("FontName",false,"mceinline");g();if(k=q._applyInlineStyle.keyhandler){n.onKeyUp.remove(k);n.onKeyPress.remove(k);n.onKeyDown.remove(k);n.onSetContent.remove(q._applyInlineStyle.chandler)}if(n.selection.isCollapsed()){if(!c){f(l.getParents(n.selection.getNode(),"span"),function(s){f(j.style,function(u,t){var w;if(w=l.getStyle(s,t)){if(w==u){l.setStyle(s,t,"");r=2;return false}r=1;return false}});if(r){return false}});if(r==2){i=n.selection.getBookmark();h();n.selection.moveToBookmark(i);window.setTimeout(function(){n.nodeChanged()},1);return}}q._pendingStyles=d.extend(q._pendingStyles||{},j.style);q._applyInlineStyle.chandler=n.onSetContent.add(function(){delete q._pendingStyles});q._applyInlineStyle.keyhandler=k=function(s){if(q._pendingStyles){j.style=q._pendingStyles;delete q._pendingStyles}if(g()){n.onKeyDown.remove(q._applyInlineStyle.keyhandler);n.onKeyPress.remove(q._applyInlineStyle.keyhandler)}if(s.type=="keyup"){n.onKeyUp.remove(q._applyInlineStyle.keyhandler)}};n.onKeyDown.add(k);n.onKeyPress.add(k);n.onKeyUp.add(k)}else{q._pendingStyles=0}}})})(tinymce);(function(a){a.create("tinymce.UndoManager",{index:0,data:null,typing:0,UndoManager:function(c){var d=this,b=a.util.Dispatcher;d.editor=c;d.data=[];d.onAdd=new b(this);d.onUndo=new b(this);d.onRedo=new b(this)},add:function(d){var g=this,f,e=g.editor,c,h=e.settings,j;d=d||{};d.content=d.content||e.getContent({format:"raw",no_events:1});d.content=d.content.replace(/^\s*|\s*$/g,"");j=g.data[g.index>0&&(g.index==0||g.index==g.data.length)?g.index-1:g.index];if(!d.initial&&j&&d.content==j.content){return null}if(h.custom_undo_redo_levels){if(g.data.length>h.custom_undo_redo_levels){for(f=0;f<g.data.length-1;f++){g.data[f]=g.data[f+1]}g.data.length--;g.index=g.data.length}}if(h.custom_undo_redo_restore_selection&&!d.initial){d.bookmark=c=d.bookmark||e.selection.getBookmark()}if(g.index<g.data.length){g.index++}if(g.data.length===0&&!d.initial){return null}g.data.length=g.index+1;g.data[g.index++]=d;if(d.initial){g.index=0}if(g.data.length==2&&g.data[0].initial){g.data[0].bookmark=c}g.onAdd.dispatch(g,d);e.isNotDirty=0;return d},undo:function(){var e=this,c=e.editor,b=b,d;if(e.typing){e.add();e.typing=0}if(e.index>0){if(e.index==e.data.length&&e.index>1){d=e.index;e.typing=0;if(!e.add()){e.index=d}--e.index}b=e.data[--e.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);e.onUndo.dispatch(e,b)}return b},redo:function(){var d=this,c=d.editor,b=null;if(d.index<d.data.length-1){b=d.data[++d.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);d.onRedo.dispatch(d,b)}return b},clear:function(){var b=this;b.data=[];b.index=0;b.typing=0;b.add({initial:true})},hasUndo:function(){return this.index!=0||this.typing},hasRedo:function(){return this.index<this.data.length-1}})})(tinymce);(function(i){var h,c,a,b,g,f;h=i.dom.Event;c=i.isIE;a=i.isGecko;b=i.isOpera;g=i.each;f=i.extend;function e(k,l){var j=l.ownerDocument.createRange();j.setStart(k.endContainer,k.endOffset);j.setEndAfter(l);return j.cloneContents().textContent.length==0}function d(j){j=j.innerHTML;j=j.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");j=j.replace(/<[^>]+>/g,"");return j.replace(/[ \t\r\n]+/g,"")==""}i.create("tinymce.ForceBlocks",{ForceBlocks:function(k){var l=this,m=k.settings,n;l.editor=k;l.dom=k.dom;n=(m.forced_root_block||"p").toLowerCase();m.element=n.toUpperCase();k.onPreInit.add(l.setup,l);l.reOpera=new RegExp("(\\u00a0| | )</"+n+">","gi");l.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,n),"gi");l.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,n),"gi");l.reNbsp2BR2=new RegExp("<%p()([^>]+)>( | )<\\/%p>|<%p>( | )<\\/%p>".replace(/%p/g,n),"gi");l.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,n),"gi");function j(p,q){if(b){q.content=q.content.replace(l.reOpera,"</"+n+">")}q.content=q.content.replace(l.rePadd,"<"+n+"$1$2$3$4$5$6>\u00a0</"+n+">");if(!c&&!b&&q.set){q.content=q.content.replace(l.reNbsp2BR1,"<"+n+"$1$2><br /></"+n+">");q.content=q.content.replace(l.reNbsp2BR2,"<"+n+"$1$2><br /></"+n+">")}else{q.content=q.content.replace(l.reBR2Nbsp,"<"+n+"$1$2>\u00a0</"+n+">")}}k.onBeforeSetContent.add(j);k.onPostProcess.add(j);if(m.forced_root_block){k.onInit.add(l.forceRoots,l);k.onSetContent.add(l.forceRoots,l);k.onBeforeGetContent.add(l.forceRoots,l)}},setup:function(){var k=this,j=k.editor,l=j.settings;if(l.forced_root_block){j.onKeyUp.add(k.forceRoots,k);j.onPreProcess.add(k.forceRoots,k)}if(l.force_br_newlines){if(c){j.onKeyPress.add(function(o,q){var r,p=o.selection;if(q.keyCode==13&&p.getNode().nodeName!="LI"){p.setContent('<br id="__" /> ',{format:"raw"});r=o.dom.get("__");r.removeAttribute("id");p.select(r);p.collapse();return h.cancel(q)}})}return}if(!c&&l.force_p_newlines){j.onKeyPress.add(function(n,o){if(o.keyCode==13&&!o.shiftKey){if(!k.insertPara(o)){h.cancel(o)}}});if(a){j.onKeyDown.add(function(n,o){if((o.keyCode==8||o.keyCode==46)&&!o.shiftKey){k.backspaceDelete(o,o.keyCode==8)}})}}function m(o,n){var p=j.dom.create(n);g(o.attributes,function(q){if(q.specified&&q.nodeValue){p.setAttribute(q.nodeName.toLowerCase(),q.nodeValue)}});g(o.childNodes,function(q){p.appendChild(q.cloneNode(true))});o.parentNode.replaceChild(p,o);return p}j.onPreProcess.add(function(n,p){g(n.dom.select("p,h1,h2,h3,h4,h5,h6,div",p.node),function(o){if(d(o)){g(n.dom.select("span,em,strong,b,i",p.node),function(q){if(!q.hasChildNodes()){q.appendChild(n.getDoc().createTextNode("\u00a0"));return false}})}})});if(c){if(l.element!="P"){j.onKeyPress.add(function(n,o){k.lastElm=n.selection.getNode().nodeName});j.onKeyUp.add(function(p,r){var t,q=p.selection,s=q.getNode(),o=p.getBody();if(o.childNodes.length===1&&s.nodeName=="P"){s=m(s,l.element);q.select(s);q.collapse();p.nodeChanged()}else{if(r.keyCode==13&&!r.shiftKey&&k.lastElm!="P"){t=p.dom.getParent(s,"p");if(t){m(t,l.element);p.nodeChanged()}}}})}}},find:function(p,l,m){var k=this.editor,j=k.getDoc().createTreeWalker(p,4,null,false),o=-1;while(p=j.nextNode()){o++;if(l==0&&p==m){return o}if(l==1&&o==m){return p}}return -1},forceRoots:function(p,D){var u=this,p=u.editor,H=p.getBody(),E=p.getDoc(),K=p.selection,v=K.getSel(),w=K.getRng(),I=-2,o,B,j,k,F=-16777215;var G,l,J,A,x,m=H.childNodes,z,y,q;for(z=m.length-1;z>=0;z--){G=m[z];if(G.nodeType===3||(!u.dom.isBlock(G)&&G.nodeType!==8&&!/^(script|mce:script|style|mce:style)$/i.test(G.nodeName))){if(!l){if(G.nodeType!=3||/[^\s]/g.test(G.nodeValue)){if(I==-2&&w){if(!c){if(w.startContainer.nodeType==1&&(y=w.startContainer.childNodes[w.startOffset])&&y.nodeType==1){q=y.getAttribute("id");y.setAttribute("id","__mce")}else{if(p.dom.getParent(w.startContainer,function(n){return n===H})){B=w.startOffset;j=w.endOffset;I=u.find(H,0,w.startContainer);o=u.find(H,0,w.endContainer)}}}else{k=E.body.createTextRange();k.moveToElementText(H);k.collapse(1);J=k.move("character",F)*-1;k=w.duplicate();k.collapse(1);A=k.move("character",F)*-1;k=w.duplicate();k.collapse(0);x=(k.move("character",F)*-1)-A;I=A-J;o=x}}l=p.dom.create(p.settings.forced_root_block);G.parentNode.replaceChild(l,G);l.appendChild(G)}}else{if(l.hasChildNodes()){l.insertBefore(G,l.firstChild)}else{l.appendChild(G)}}}else{l=null}}if(I!=-2){if(!c){l=H.getElementsByTagName(p.settings.element)[0];w=E.createRange();if(I!=-1){w.setStart(u.find(H,1,I),B)}else{w.setStart(l,0)}if(o!=-1){w.setEnd(u.find(H,1,o),j)}else{w.setEnd(l,0)}if(v){v.removeAllRanges();v.addRange(w)}}else{try{w=v.createRange();w.moveToElementText(H);w.collapse(1);w.moveStart("character",I);w.moveEnd("character",o);w.select()}catch(C){}}}else{if(!c&&(y=p.dom.get("__mce"))){if(q){y.setAttribute("id",q)}else{y.removeAttribute("id")}w=E.createRange();w.setStartBefore(y);w.setEndBefore(y);K.setRng(w)}}},getParentBlock:function(k){var j=this.dom;return j.getParent(k,j.isBlock)},insertPara:function(N){var B=this,p=B.editor,J=p.dom,O=p.getDoc(),S=p.settings,C=p.selection.getSel(),D=C.getRangeAt(0),R=O.body;var G,H,E,L,K,m,k,o,u,j,z,Q,l,q,F,I=J.getViewPort(p.getWin()),x,A,w;G=O.createRange();G.setStart(C.anchorNode,C.anchorOffset);G.collapse(true);H=O.createRange();H.setStart(C.focusNode,C.focusOffset);H.collapse(true);E=G.compareBoundaryPoints(G.START_TO_END,H)<0;L=E?C.anchorNode:C.focusNode;K=E?C.anchorOffset:C.focusOffset;m=E?C.focusNode:C.anchorNode;k=E?C.focusOffset:C.anchorOffset;if(L===m&&/^(TD|TH)$/.test(L.nodeName)){if(L.firstChild.nodeName=="BR"){J.remove(L.firstChild)}if(L.childNodes.length==0){p.dom.add(L,S.element,null,"<br />");Q=p.dom.add(L,S.element,null,"<br />")}else{F=L.innerHTML;L.innerHTML="";p.dom.add(L,S.element,null,F);Q=p.dom.add(L,S.element,null,"<br />")}D=O.createRange();D.selectNodeContents(Q);D.collapse(1);p.selection.setRng(D);return false}if(L==R&&m==R&&R.firstChild&&p.dom.isBlock(R.firstChild)){L=m=L.firstChild;K=k=0;G=O.createRange();G.setStart(L,0);H=O.createRange();H.setStart(m,0)}L=L.nodeName=="HTML"?O.body:L;L=L.nodeName=="BODY"?L.firstChild:L;m=m.nodeName=="HTML"?O.body:m;m=m.nodeName=="BODY"?m.firstChild:m;o=B.getParentBlock(L);u=B.getParentBlock(m);j=o?o.nodeName:S.element;if(B.dom.getParent(o,"ol,ul,pre")){return true}if(o&&(o.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(J.getStyle(o,"position",1)))){j=S.element;o=null}if(u&&(u.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(J.getStyle(o,"position",1)))){j=S.element;u=null}if(/(TD|TABLE|TH|CAPTION)/.test(j)||(o&&j=="DIV"&&/left|right/gi.test(J.getStyle(o,"float",1)))){j=S.element;o=u=null}z=(o&&o.nodeName==j)?o.cloneNode(0):p.dom.create(j);Q=(u&&u.nodeName==j)?u.cloneNode(0):p.dom.create(j);Q.removeAttribute("id");if(/^(H[1-6])$/.test(j)&&e(D,o)){Q=p.dom.create(S.element)}F=l=L;do{if(F==R||F.nodeType==9||B.dom.isBlock(F)||/(TD|TABLE|TH|CAPTION)/.test(F.nodeName)){break}l=F}while((F=F.previousSibling?F.previousSibling:F.parentNode));F=q=m;do{if(F==R||F.nodeType==9||B.dom.isBlock(F)||/(TD|TABLE|TH|CAPTION)/.test(F.nodeName)){break}q=F}while((F=F.nextSibling?F.nextSibling:F.parentNode));if(l.nodeName==j){G.setStart(l,0)}else{G.setStartBefore(l)}G.setEnd(L,K);z.appendChild(G.cloneContents()||O.createTextNode(""));try{H.setEndAfter(q)}catch(M){}H.setStart(m,k);Q.appendChild(H.cloneContents()||O.createTextNode(""));D=O.createRange();if(!l.previousSibling&&l.parentNode.nodeName==j){D.setStartBefore(l.parentNode)}else{if(G.startContainer.nodeName==j&&G.startOffset==0){D.setStartBefore(G.startContainer)}else{D.setStart(G.startContainer,G.startOffset)}}if(!q.nextSibling&&q.parentNode.nodeName==j){D.setEndAfter(q.parentNode)}else{D.setEnd(H.endContainer,H.endOffset)}D.deleteContents();if(b){p.getWin().scrollTo(0,I.y)}if(z.firstChild&&z.firstChild.nodeName==j){z.innerHTML=z.firstChild.innerHTML}if(Q.firstChild&&Q.firstChild.nodeName==j){Q.innerHTML=Q.firstChild.innerHTML}if(d(z)){z.innerHTML="<br />"}function P(y,s){var r=[],U,T,t;y.innerHTML="";if(S.keep_styles){T=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(T.nodeName)){U=T.cloneNode(false);J.setAttrib(U,"id","");r.push(U)}}while(T=T.parentNode)}if(r.length>0){for(t=r.length-1,U=y;t>=0;t--){U=U.appendChild(r[t])}r[0].innerHTML=b?" ":"<br />";return r[0]}else{y.innerHTML=b?" ":"<br />"}}if(d(Q)){w=P(Q,m)}if(b&&parseFloat(opera.version())<9.5){D.insertNode(z);D.insertNode(Q)}else{D.insertNode(Q);D.insertNode(z)}Q.normalize();z.normalize();function v(r){return O.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false).nextNode()||r}D=O.createRange();D.selectNodeContents(a?v(w||Q):w||Q);D.collapse(1);C.removeAllRanges();C.addRange(D);x=p.dom.getPos(Q).y;A=Q.clientHeight;if(x<I.y||x+A>I.y+I.h){p.getWin().scrollTo(0,x<I.y?x:x-I.h+25)}return false},backspaceDelete:function(o,x){var z=this,m=z.editor,s=m.getBody(),l=m.dom,k,p=m.selection,j=p.getRng(),q=j.startContainer,k,u,v;if(q&&m.dom.isBlock(q)&&!/^(TD|TH)$/.test(q.nodeName)&&x){if(q.childNodes.length==0||(q.childNodes.length==1&&q.firstChild.nodeName=="BR")){k=q;while((k=k.previousSibling)&&!m.dom.isBlock(k)){}if(k){if(q!=s.firstChild){u=m.dom.doc.createTreeWalker(k,NodeFilter.SHOW_TEXT,null,false);while(v=u.nextNode()){k=v}j=m.getDoc().createRange();j.setStart(k,k.nodeValue?k.nodeValue.length:0);j.setEnd(k,k.nodeValue?k.nodeValue.length:0);p.setRng(j);m.dom.remove(q)}return h.cancel(o)}}}function y(n){var r;n=n.target;if(n&&n.parentNode&&n.nodeName=="BR"&&(k=z.getParentBlock(n))){r=n.previousSibling;h.remove(s,"DOMNodeInserted",y);if(r&&r.nodeType==3&&/\s+$/.test(r.nodeValue)){return}if(n.previousSibling||n.nextSibling){m.dom.remove(n)}}}h._add(s,"DOMNodeInserted",y);window.setTimeout(function(){h._remove(s,"DOMNodeInserted",y)},1)}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){i.execCommand(p.cmd,p.ui||false,p.value)}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark(1)});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.CommandManager=function(){var c={},b={},d={};function e(i,h,g,f){if(typeof(h)=="string"){h=[h]}a.each(h,function(j){i[j.toLowerCase()]={func:g,scope:f}})}a.extend(this,{add:function(h,g,f){e(c,h,g,f)},addQueryStateHandler:function(h,g,f){e(b,h,g,f)},addQueryValueHandler:function(h,g,f){e(d,h,g,f)},execCommand:function(g,j,i,h,f){if(j=c[j.toLowerCase()]){if(j.func.call(g||j.scope,i,h,f)!==false){return true}}},queryCommandValue:function(){if(cmd=d[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}},queryCommandState:function(){if(cmd=b[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}}})};a.GlobalCommands=new a.CommandManager()})(tinymce);(function(b){function a(i,d,h,m){var j,g,e,l,f;function k(p,o){do{if(p.parentNode==o){return p}p=p.parentNode}while(p)}function c(o){m(o);b.walk(o,m,"childNodes")}j=i.findCommonAncestor(d,h);e=k(d,j)||d;l=k(h,j)||h;for(g=d;g&&g!=e;g=g.parentNode){for(f=g.nextSibling;f;f=f.nextSibling){c(f)}}if(e!=l){for(g=e.nextSibling;g&&g!=l;g=g.nextSibling){c(g)}}else{c(e)}for(g=h;g&&g!=l;g=g.parentNode){for(f=g.previousSibling;f;f=f.previousSibling){c(f)}}}b.GlobalCommands.add("RemoveFormat",function(){var m=this,l=m.dom,u=m.selection,d=u.getRng(1),e=[],h,f,j,q,g,o,c,i;function k(s){var r;l.getParent(s,function(v){if(l.is(v,m.getParam("removeformat_selector"))){r=v}return l.isBlock(v)},m.getBody());return r}function p(r){if(l.is(r,m.getParam("removeformat_selector"))){e.push(r)}}function t(r){p(r);b.walk(r,p,"childNodes")}h=u.getBookmark();q=d.startContainer;o=d.endContainer;g=d.startOffset;c=d.endOffset;q=q.nodeType==1?q.childNodes[Math.min(g,q.childNodes.length-1)]:q;o=o.nodeType==1?o.childNodes[Math.min(g==c?c:c-1,o.childNodes.length-1)]:o;if(q==o){f=k(q);if(q.nodeType==3){if(f&&f.nodeType==1){i=q.splitText(g);i.splitText(c-g);l.split(f,i);u.moveToBookmark(h)}return}t(l.split(f,q)||q)}else{f=k(q);j=k(o);if(f){if(q.nodeType==3){if(g==q.nodeValue.length){q.nodeValue+="\uFEFF"}q=q.splitText(g)}}if(j){if(o.nodeType==3){o.splitText(c)}}if(f&&f==j){l.replace(l.create("span",{id:"__end"},o.cloneNode(true)),o)}if(f){f=l.split(f,q)}else{f=q}if(i=l.get("__end")){o=i;j=k(o)}if(j){j=l.split(j,o)}else{j=o}a(l,f,j,p);if(q.nodeValue=="\uFEFF"){q.nodeValue=""}t(o);t(q)}b.each(e,function(r){l.remove(r,1)});l.remove("__end",1);u.moveToBookmark(h)})})(tinymce);(function(a){a.GlobalCommands.add("mceBlockQuote",function(){var j=this,o=j.selection,f=j.dom,l,k,e,d,p,c,m,h,b;function g(i){return f.getParent(i,function(q){return q.nodeName==="BLOCKQUOTE"})}l=f.getParent(o.getStart(),f.isBlock);k=f.getParent(o.getEnd(),f.isBlock);if(p=g(l)){if(l!=k||l.childNodes.length>1||(l.childNodes.length==1&&l.firstChild.nodeName!="BR")){d=o.getBookmark()}if(g(k)){m=p.cloneNode(false);while(e=k.nextSibling){m.appendChild(e.parentNode.removeChild(e))}}if(m){f.insertAfter(m,p)}b=o.getSelectedBlocks(l,k);for(h=b.length-1;h>=0;h--){f.insertAfter(b[h],p)}if(/^\s*$/.test(p.innerHTML)){f.remove(p,1)}if(m&&/^\s*$/.test(m.innerHTML)){f.remove(m,1)}if(!d){if(!a.isIE){c=j.getDoc().createRange();c.setStart(l,0);c.setEnd(l,0);o.setRng(c)}else{o.select(l);o.collapse(0);if(f.getParent(o.getStart(),f.isBlock)!=l){c=o.getRng();c.move("character",-1);c.select()}}}else{j.selection.moveToBookmark(d)}return}if(a.isIE&&!l&&!k){j.getDoc().execCommand("Indent");e=g(o.getNode());e.style.margin=e.dir="";return}if(!l||!k){return}if(l!=k||l.childNodes.length>1||(l.childNodes.length==1&&l.firstChild.nodeName!="BR")){d=o.getBookmark()}a.each(o.getSelectedBlocks(g(o.getStart()),g(o.getEnd())),function(i){if(i.nodeName=="BLOCKQUOTE"&&!p){p=i;return}if(!p){p=f.create("blockquote");i.parentNode.insertBefore(p,i)}if(i.nodeName=="BLOCKQUOTE"&&p){e=i.firstChild;while(e){p.appendChild(e.cloneNode(true));e=e.nextSibling}f.remove(i);return}p.appendChild(f.remove(i))});if(!d){if(!a.isIE){c=j.getDoc().createRange();c.setStart(l,0);c.setEnd(l,0);o.setRng(c)}else{o.select(l);o.collapse(1)}}else{o.moveToBookmark(d)}})})(tinymce);(function(a){a.each(["Cut","Copy","Paste"],function(b){a.GlobalCommands.add(b,function(){var c=this,e=c.getDoc();try{e.execCommand(b,false,null);if(!e.queryCommandEnabled(b)){throw"Error"}}catch(d){if(a.isGecko){c.windowManager.confirm(c.getLang("clipboard_msg"),function(f){if(f){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{c.windowManager.alert(c.getLang("clipboard_no_support"))}}})})})(tinymce);(function(a){a.GlobalCommands.add("InsertHorizontalRule",function(){if(a.isOpera){return this.getDoc().execCommand("InsertHorizontalRule",false,"")}this.selection.setContent("<hr />")})})(tinymce);(function(){var a=tinymce.GlobalCommands;a.add(["mceEndUndoLevel","mceAddUndoLevel"],function(){this.undoManager.add()});a.add("Undo",function(){var b=this;if(b.settings.custom_undo_redo){b.undoManager.undo();b.nodeChanged();return true}return false});a.add("Redo",function(){var b=this;if(b.settings.custom_undo_redo){b.undoManager.redo();b.nodeChanged();return true}return false})})();
// Uncomment and change this document.domain value if you are loading the script cross subdomains
// document.domain = 'moxiecode.com';
-var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return window.dialogArguments||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var e=this,g,a=document.body,c=e.dom.getViewPort(window),d,f;d=e.getWindowArg("mce_width")-c.w;f=e.getWindowArg("mce_height")-c.h;if(e.isWindow){window.resizeBy(d,f)}else{e.editor.windowManager.resizeBy(d,f,e.id)}},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark("simple")},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait();
\ No newline at end of file
+var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var e=this,g,a=document.body,c=e.dom.getViewPort(window),d,f;d=e.getWindowArg("mce_width")-c.w;f=e.getWindowArg("mce_height")-c.h;if(e.isWindow){window.resizeBy(d,f)}else{e.editor.windowManager.resizeBy(d,f,e.id)}},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait();
\ No newline at end of file
/**
- * $Id: form_utils.js 996 2009-02-06 17:32:20Z spocke $
+ * $Id: form_utils.js 1184 2009-08-11 11:47:27Z spocke $
*
* Various form utilitiy functions.
*
function getSelectValue(form_obj, field_name) {
var elm = form_obj.elements[field_name];
- if (elm == null || elm.options == null)
+ if (elm == null || elm.options == null || elm.selectedIndex === -1)
return "";
return elm.options[elm.selectedIndex].value;
//core
-var tinymce={majorVersion:"3",minorVersion:"2.4.1",releaseDate:"2009-05-25",_init:function(){var o=this,k=document,l=window,j=navigator,b=j.userAgent,h,a,g,f,e,m;o.isOpera=l.opera&&opera.buildNumber;o.isWebKit=/WebKit/.test(b);o.isIE=!o.isWebKit&&!o.isOpera&&(/MSIE/gi).test(b)&&(/Explorer/gi).test(j.appName);o.isIE6=o.isIE&&/MSIE [56]/.test(b);o.isGecko=!o.isWebKit&&/Gecko/.test(b);o.isMac=b.indexOf("Mac")!=-1;o.isAir=/adobeair/i.test(b);if(l.tinyMCEPreInit){o.suffix=tinyMCEPreInit.suffix;o.baseURL=tinyMCEPreInit.base;o.query=tinyMCEPreInit.query;return}o.suffix="";a=k.getElementsByTagName("base");for(h=0;h<a.length;h++){if(m=a[h].href){if(/^https?:\/\/[^\/]+$/.test(m)){m+="/"}f=m?m.match(/.*\//)[0]:""}}function c(d){if(d.src&&/tiny_mce(|_dev|_src|_gzip|_jquery|_prototype).js/.test(d.src)){if(/_(src|dev)\.js/g.test(d.src)){o.suffix="_src"}if((e=d.src.indexOf("?"))!=-1){o.query=d.src.substring(e+1)}o.baseURL=d.src.substring(0,d.src.lastIndexOf("/"));if(f&&o.baseURL.indexOf("://")==-1){o.baseURL=f+o.baseURL}return o.baseURL}return null}a=k.getElementsByTagName("script");for(h=0;h<a.length;h++){if(c(a[h])){return}}g=k.getElementsByTagName("head")[0];if(g){a=g.getElementsByTagName("script");for(h=0;h<a.length;h++){if(c(a[h])){return}}}return},is:function(b,a){var c=typeof(b);if(!a){return c!="undefined"}if(a=="array"&&(b.hasOwnProperty&&b instanceof Array)){return true}return c==a},each:function(d,a,c){var e,b;if(!d){return 0}c=c||d;if(typeof(d.length)!="undefined"){for(e=0,b=d.length;e<b;e++){if(a.call(c,d[e],e,d)===false){return 0}}}else{for(e in d){if(d.hasOwnProperty(e)){if(a.call(c,d[e],e,d)===false){return 0}}}}return 1},map:function(b,c){var d=[];tinymce.each(b,function(a){d.push(c(a))});return d},grep:function(b,c){var d=[];tinymce.each(b,function(a){if(!c||c(a)){d.push(a)}});return d},inArray:function(c,d){var e,b;if(c){for(e=0,b=c.length;e<b;e++){if(c[e]===d){return e}}}return -1},extend:function(f,d){var c,b=arguments;for(c=1;c<b.length;c++){d=b[c];tinymce.each(d,function(a,e){if(typeof(a)!=="undefined"){f[e]=a}})}return f},trim:function(a){return(a?""+a:"").replace(/^\s*|\s*$/g,"")},create:function(j,a){var i=this,b,e,f,g,d,h=0;j=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(j);f=j[3].match(/(^|\.)(\w+)$/i)[2];e=i.createNS(j[3].replace(/\.\w+$/,""));if(e[f]){return}if(j[2]=="static"){e[f]=a;if(this.onCreate){this.onCreate(j[2],j[3],e[f])}return}if(!a[f]){a[f]=function(){};h=1}e[f]=a[f];i.extend(e[f].prototype,a);if(j[5]){b=i.resolve(j[5]).prototype;g=j[5].match(/\.(\w+)$/i)[1];d=e[f];if(h){e[f]=function(){return b[g].apply(this,arguments)}}else{e[f]=function(){this.parent=b[g];return d.apply(this,arguments)}}e[f].prototype[f]=e[f];i.each(b,function(c,k){e[f].prototype[k]=b[k]});i.each(a,function(c,k){if(b[k]){e[f].prototype[k]=function(){this.parent=b[k];return c.apply(this,arguments)}}else{if(k!=f){e[f].prototype[k]=c}}})}i.each(a["static"],function(c,k){e[f][k]=c});if(this.onCreate){this.onCreate(j[2],j[3],e[f].prototype)}},walk:function(c,b,d,a){a=a||this;if(c){if(d){c=c[d]}tinymce.each(c,function(f,e){if(b.call(a,f,e,d)===false){return false}tinymce.walk(f,b,d,a)})}},createNS:function(d,c){var b,a;c=c||window;d=d.split(".");for(b=0;b<d.length;b++){a=d[b];if(!c[a]){c[a]={}}c=c[a]}return c},resolve:function(d,c){var b,a;c=c||window;d=d.split(".");for(b=0,a=d.length;b<a;b++){c=c[d[b]];if(!c){break}}return c},addUnload:function(e,d){var c=this,a=window;e={func:e,scope:d||this};if(!c.unloads){function b(){var f=c.unloads,h,i;if(f){for(i in f){h=f[i];if(h&&h.func){h.func.call(h.scope,1)}}if(a.detachEvent){a.detachEvent("onbeforeunload",g);a.detachEvent("onunload",b)}else{if(a.removeEventListener){a.removeEventListener("unload",b,false)}}c.unloads=h=f=a=b=0;if(window.CollectGarbage){window.CollectGarbage()}}}function g(){var h=document;if(h.readyState=="interactive"){function f(){h.detachEvent("onstop",f);if(b){b()}h=0}if(h){h.attachEvent("onstop",f)}window.setTimeout(function(){if(h){h.detachEvent("onstop",f)}},0)}}if(a.attachEvent){a.attachEvent("onunload",b);a.attachEvent("onbeforeunload",g)}else{if(a.addEventListener){a.addEventListener("unload",b,false)}}c.unloads=[e]}else{c.unloads.push(e)}return e},removeUnload:function(c){var a=this.unloads,b=null;tinymce.each(a,function(e,d){if(e&&e.func==c){a.splice(d,1);b=c;return false}});return b},explode:function(a,b){return a?tinymce.map(a.split(b||","),tinymce.trim):a},_addVer:function(b){var a;if(!this.query){return b}a=(b.indexOf("?")==-1?"?":"&")+this.query;if(b.indexOf("#")==-1){return b+a}return b.replace("#",a+"#")}};window.tinymce=tinymce;tinymce._init();tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(e.indexOf(":/")===-1&&e.indexOf("//")!==0){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,g=[],d;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(h){if(h){g.push(h)}});e=g;for(c=f.length-1,g=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}g.push(f[c])}c=e.length-b;if(c<=0){return"/"+g.reverse().join("/")+d}return"/"+e.slice(0,c).join("/")+"/"+g.reverse().join("/")+d},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c<e.length;c++){a+=(c>0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(c){var e=c.each,b=c.is;var d=c.isWebKit,a=c.isIE;c.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(i,g){var f=this;f.doc=i;f.win=window;f.files={};f.cssFlicker=false;f.counter=0;f.boxModel=!c.isIE||i.compatMode=="CSS1Compat";f.stdMode=i.documentMode===8;f.settings=g=c.extend({keep_values:false,hex_colors:1,process_html:1},g);if(c.isIE6){try{i.execCommand("BackgroundImageCache",false,true)}catch(h){f.cssFlicker=true}}c.addUnload(f.destroy,f)},getRoot:function(){var f=this,g=f.settings;return(g&&f.get(g.root_element))||f.doc.body},getViewPort:function(g){var h,f;g=!g?this.win:g;h=g.document;f=this.boxModel?h.documentElement:h.body;return{x:g.pageXOffset||f.scrollLeft,y:g.pageYOffset||f.scrollTop,w:g.innerWidth||f.clientWidth,h:g.innerHeight||f.clientHeight}},getRect:function(i){var h,f=this,g;i=f.get(i);h=f.getPos(i);g=f.getSize(i);return{x:h.x,y:h.y,w:g.w,h:g.h}},getSize:function(j){var g=this,f,i;j=g.get(j);f=g.getStyle(j,"width");i=g.getStyle(j,"height");if(f.indexOf("px")===-1){f=0}if(i.indexOf("px")===-1){i=0}return{w:parseInt(f)||j.offsetWidth||j.clientWidth,h:parseInt(i)||j.offsetHeight||j.clientHeight}},is:function(g,f){return c.dom.Sizzle.matches(f,g.nodeType?[g]:g).length>0},getParent:function(i,h,g){return this.getParents(i,h,g,false)},getParents:function(p,k,i,m){var h=this,g,j=h.settings,l=[];p=h.get(p);m=m===undefined;if(j.strict_root){i=i||h.getRoot()}if(b(k,"string")){g=k;if(k==="*"){k=function(f){return f.nodeType==1}}else{k=function(f){return h.is(f,g)}}}while(p){if(p==i||!p.nodeType||p.nodeType===9){break}if(!k||k(p)){if(m){l.push(p)}else{return p}}p=p.parentNode}return m?l:null},get:function(f){var g;if(f&&this.doc&&typeof(f)=="string"){g=f;f=this.doc.getElementById(f);if(f&&f.id!==g){return this.doc.getElementsByName(g)[1]}}return f},select:function(h,g){var f=this;return c.dom.Sizzle(h,f.get(g)||f.get(f.settings.root_element)||f.doc,[])},add:function(j,l,f,i,k){var g=this;return this.run(j,function(n){var m,h;m=b(l,"string")?g.doc.createElement(l):l;g.setAttribs(m,f);if(i){if(i.nodeType){m.appendChild(i)}else{g.setHTML(m,i)}}return !k?n.appendChild(m):m})},create:function(i,f,g){return this.add(this.doc.createElement(i),i,f,g,1)},createHTML:function(m,f,j){var l="",i=this,g;l+="<"+m;for(g in f){if(f.hasOwnProperty(g)){l+=" "+g+'="'+i.encode(f[g])+'"'}}if(c.is(j)){return l+">"+j+"</"+m+">"}return l+" />"},remove:function(h,f){var g=this;return this.run(h,function(m){var l,k,j;l=m.parentNode;if(!l){return null}if(f){for(j=m.childNodes.length-1;j>=0;j--){g.insertAfter(m.childNodes[j],m)}}if(g.fixPsuedoLeaks){l=m.cloneNode(true);f="IELeakGarbageBin";k=g.get(f)||g.add(g.doc.body,"div",{id:f,style:"display:none"});k.appendChild(m);k.innerHTML="";return l}return l.removeChild(m)})},setStyle:function(i,f,g){var h=this;return h.run(i,function(l){var k,j;k=l.style;f=f.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(h.pixelStyles.test(f)&&(c.is(g,"number")||/^[\-0-9\.]+$/.test(g))){g+="px"}switch(f){case"opacity":if(a){k.filter=g===""?"":"alpha(opacity="+(g*100)+")";if(!i.currentStyle||!i.currentStyle.hasLayout){k.display="inline-block"}}k[f]=k["-moz-opacity"]=k["-khtml-opacity"]=g||"";break;case"float":a?k.styleFloat=g:k.cssFloat=g;break;default:k[f]=g||""}if(h.settings.update_styles){h.setAttrib(l,"mce_style")}})},getStyle:function(i,f,h){i=this.get(i);if(!i){return false}if(this.doc.defaultView&&h){f=f.replace(/[A-Z]/g,function(j){return"-"+j});try{return this.doc.defaultView.getComputedStyle(i,null).getPropertyValue(f)}catch(g){return null}}f=f.replace(/-(\D)/g,function(k,j){return j.toUpperCase()});if(f=="float"){f=a?"styleFloat":"cssFloat"}if(i.currentStyle&&h){return i.currentStyle[f]}return i.style[f]},setStyles:function(i,j){var g=this,h=g.settings,f;f=h.update_styles;h.update_styles=0;e(j,function(k,l){g.setStyle(i,l,k)});h.update_styles=f;if(h.update_styles){g.setAttrib(i,h.cssText)}},setAttrib:function(h,i,f){var g=this;if(!h||!i){return}if(g.settings.strict){i=i.toLowerCase()}return this.run(h,function(k){var j=g.settings;switch(i){case"style":if(!b(f,"string")){e(f,function(l,m){g.setStyle(k,m,l)});return}if(j.keep_values){if(f&&!g._isRes(f)){k.setAttribute("mce_style",f,2)}else{k.removeAttribute("mce_style",2)}}k.style.cssText=f;break;case"class":k.className=f||"";break;case"src":case"href":if(j.keep_values){if(j.url_converter){f=j.url_converter.call(j.url_converter_scope||g,f,i,k)}g.setAttrib(k,"mce_"+i,f,2)}break;case"shape":k.setAttribute("mce_style",f);break}if(b(f)&&f!==null&&f.length!==0){k.setAttribute(i,""+f,2)}else{k.removeAttribute(i,2)}})},setAttribs:function(g,h){var f=this;return this.run(g,function(i){e(h,function(j,k){f.setAttrib(i,k,j)})})},getAttrib:function(i,j,h){var f,g=this;i=g.get(i);if(!i||i.nodeType!==1){return false}if(!b(h)){h=""}if(/^(src|href|style|coords|shape)$/.test(j)){f=i.getAttribute("mce_"+j);if(f){return f}}if(a&&g.props[j]){f=i[g.props[j]];f=f&&f.nodeValue?f.nodeValue:f}if(!f){f=i.getAttribute(j,2)}if(j==="style"){f=f||i.style.cssText;if(f){f=g.serializeStyle(g.parseStyle(f));if(g.settings.keep_values&&!g._isRes(f)){i.setAttribute("mce_style",f)}}}if(d&&j==="class"&&f){f=f.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(a){switch(j){case"rowspan":case"colspan":if(f===1){f=""}break;case"size":if(f==="+0"||f===20||f===0){f=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(f===0){f=""}break;case"hspace":if(f===-1){f=""}break;case"maxlength":case"tabindex":if(f===32768||f===2147483647||f==="32768"){f=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(f===65535){return j}return h;case"shape":f=f.toLowerCase();break;default:if(j.indexOf("on")===0&&f){f=(""+f).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(f!==undefined&&f!==null&&f!=="")?""+f:h},getPos:function(m,i){var g=this,f=0,l=0,j,k=g.doc,h;m=g.get(m);i=i||k.body;if(m){if(a&&!g.stdMode){m=m.getBoundingClientRect();j=g.boxModel?k.documentElement:k.body;f=g.getStyle(g.select("html")[0],"borderWidth");f=(f=="medium"||g.boxModel&&!g.isIE6)&&2||f;m.top+=g.win.self!=g.win.top?2:0;return{x:m.left+j.scrollLeft-f,y:m.top+j.scrollTop-f}}h=m;while(h&&h!=i&&h.nodeType){f+=h.offsetLeft||0;l+=h.offsetTop||0;h=h.offsetParent}h=m.parentNode;while(h&&h!=i&&h.nodeType){f-=h.scrollLeft||0;l-=h.scrollTop||0;h=h.parentNode}}return{x:f,y:l}},parseStyle:function(h){var i=this,j=i.settings,k={};if(!h){return k}function f(w,q,v){var o,u,m,n;o=k[w+"-top"+q];if(!o){return}u=k[w+"-right"+q];if(o!=u){return}m=k[w+"-bottom"+q];if(u!=m){return}n=k[w+"-left"+q];if(m!=n){return}k[v]=n;delete k[w+"-top"+q];delete k[w+"-right"+q];delete k[w+"-bottom"+q];delete k[w+"-left"+q]}function g(n,m,l,p){var o;o=k[m];if(!o){return}o=k[l];if(!o){return}o=k[p];if(!o){return}k[n]=k[m]+" "+k[l]+" "+k[p];delete k[m];delete k[l];delete k[p]}h=h.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");e(h.split(";"),function(m){var l,n=[];if(m){m=m.replace(/_MCE_SEMI_/g,";");m=m.replace(/url\([^\)]+\)/g,function(o){n.push(o);return"url("+n.length+")"});m=m.split(":");l=c.trim(m[1]);l=l.replace(/url\(([^\)]+)\)/g,function(p,o){return n[parseInt(o)-1]});l=l.replace(/rgb\([^\)]+\)/g,function(o){return i.toHex(o)});if(j.url_converter){l=l.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(o,p){return"url("+j.url_converter.call(j.url_converter_scope||i,i.decode(p),"style",null)+")"})}k[c.trim(m[0]).toLowerCase()]=l}});f("border","","border");f("border","-width","border-width");f("border","-color","border-color");f("border","-style","border-style");f("padding","","padding");f("margin","","margin");g("border","border-width","border-style","border-color");if(a){if(k.border=="medium none"){k.border=""}}return k},serializeStyle:function(g){var f="";e(g,function(i,h){if(h&&i){if(c.isGecko&&h.indexOf("-moz-")===0){return}switch(h){case"color":case"background-color":i=i.toLowerCase();break}f+=(f?" ":"")+h+": "+i+";"}});return f},loadCSS:function(f){var h=this,i=h.doc,g;if(!f){f=""}g=h.select("head")[0];e(f.split(","),function(j){var k;if(h.files[j]){return}h.files[j]=true;k=h.create("link",{rel:"stylesheet",href:c._addVer(j)});if(a&&i.documentMode){k.onload=function(){i.recalc();k.onload=null}}g.appendChild(k)})},addClass:function(f,g){return this.run(f,function(h){var i;if(!g){return 0}if(this.hasClass(h,g)){return h.className}i=this.removeClass(h,g);return h.className=(i!=""?(i+" "):"")+g})},removeClass:function(h,i){var f=this,g;return f.run(h,function(k){var j;if(f.hasClass(k,i)){if(!g){g=new RegExp("(^|\\s+)"+i+"(\\s+|$)","g")}j=k.className.replace(g," ");return k.className=c.trim(j!=" "?j:"")}return k.className})},hasClass:function(g,f){g=this.get(g);if(!g||!f){return false}return(" "+g.className+" ").indexOf(" "+f+" ")!==-1},show:function(f){return this.setStyle(f,"display","block")},hide:function(f){return this.setStyle(f,"display","none")},isHidden:function(f){f=this.get(f);return !f||f.style.display=="none"||this.getStyle(f,"display")=="none"},uniqueId:function(f){return(!f?"mce_":f)+(this.counter++)},setHTML:function(i,g){var f=this;return this.run(i,function(m){var h,k,j,q,l,h;g=f.processHTML(g);if(a){function o(){try{m.innerHTML="<br />"+g;m.removeChild(m.firstChild)}catch(n){while(m.firstChild){m.firstChild.removeNode()}h=f.create("div");h.innerHTML="<br />"+g;e(h.childNodes,function(r,p){if(p){m.appendChild(r)}})}}if(f.settings.fix_ie_paragraphs){g=g.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true"> </p>')}o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("p");for(k=j.length-1,h=0;k>=0;k--){q=j[k];if(!q.hasChildNodes()){if(!q.mce_keep){h=1;break}q.removeAttribute("mce_keep")}}}if(h){g=g.replace(/<p ([^>]+)>|<p>/g,'<div $1 mce_tmp="1">');g=g.replace(/<\/p>/g,"</div>");o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("DIV");for(k=j.length-1;k>=0;k--){q=j[k];if(q.mce_tmp){l=f.doc.createElement("p");q.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(p,n){var r;if(n!=="mce_tmp"){r=q.getAttribute(n);if(!r&&n==="class"){r=q.className}l.setAttribute(n,r)}});for(h=0;h<q.childNodes.length;h++){l.appendChild(q.childNodes[h].cloneNode(true))}q.swapNode(l)}}}}}else{m.innerHTML=g}return g})},processHTML:function(j){var g=this,i=g.settings;if(!i.process_html){return j}if(c.isGecko){j=j.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,"<$1b$2>");j=j.replace(/<(\/?)em>|<em( [^>]+)>/gi,"<$1i$2>")}else{if(a){j=j.replace(/'/g,"'");j=j.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}}j=j.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(i.keep_values){if(/<script|style/.test(j)){function f(h){h=h.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n");h=h.replace(/^[\r\n]*|[\r\n]*$/g,"");h=h.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"");h=h.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"");return h}j=j.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/g,function(h,l,k){if(!l){l=' type="text/javascript"'}l=l.replace(/(type|language)=\"?/,"$&mce-");l=l.replace(/src=\"([^\"]+)\"?/,function(m,n){if(i.url_converter){n=g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(n),"src","script"))}return'mce_src="'+n+'"'});if(c.trim(k)){k="<!--\n"+f(k)+"\n// -->"}return"<mce:script"+l+">"+k+"</mce:script>"});j=j.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/g,function(h,l,k){if(k){k="<!--\n"+f(k)+"\n-->"}return"<mce:style"+l+">"+k+"</mce:style><style "+l+' mce_bogus="1">'+k+"</style>"})}j=j.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->");j=j.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi,function(h,l){function k(o,n,q){var p=q;if(h.indexOf("mce_"+n)!=-1){return o}if(n=="style"){if(g._isRes(q)){return o}if(i.hex_colors){p=p.replace(/rgb\([^\)]+\)/g,function(m){return g.toHex(m)})}if(i.url_converter){p=p.replace(/url\([\'\"]?([^\)\'\"]+)\)/g,function(m,r){return"url("+g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(r),n,l))+")"})}}else{if(n!="coords"&&n!="shape"){if(i.url_converter){p=g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(q),n,l))}}}return" "+n+'="'+q+'" mce_'+n+'="'+p+'"'}h=h.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi,k);h=h.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi,k);return h.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi,k)})}return j},getOuterHTML:function(f){var g;f=this.get(f);if(!f){return null}if(f.outerHTML!==undefined){return f.outerHTML}g=(f.ownerDocument||this.doc).createElement("body");g.appendChild(f.cloneNode(true));return g.innerHTML},setOuterHTML:function(i,g,j){var f=this;return this.run(i,function(h){var l,k;h=f.get(h);j=j||h.ownerDocument||f.doc;if(a&&h.nodeType==1){h.outerHTML=g}else{k=j.createElement("body");k.innerHTML=g;l=k.lastChild;while(l){f.insertAfter(l.cloneNode(true),h);l=l.previousSibling}f.remove(h)}})},decode:function(g){var h,i,f;if(/&[^;]+;/.test(g)){h=this.doc.createElement("div");h.innerHTML=g;i=h.firstChild;f="";if(i){do{f+=i.nodeValue}while(i.nextSibling)}return f||g}return g},encode:function(f){return f?(""+f).replace(/[<>&\"]/g,function(h,g){switch(h){case"&":return"&";case'"':return""";case"<":return"<";case">":return">"}return h}):f},insertAfter:function(h,g){var f=this;g=f.get(g);return this.run(h,function(k){var j,i;j=g.parentNode;i=g.nextSibling;if(i){j.insertBefore(k,i)}else{j.appendChild(k)}return k})},isBlock:function(f){if(f.nodeType&&f.nodeType!==1){return false}f=f.nodeName||f;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TR|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(f)},replace:function(i,h,f){var g=this;if(b(h,"array")){i=i.cloneNode(true)}return g.run(h,function(j){if(f){e(j.childNodes,function(k){i.appendChild(k.cloneNode(true))})}if(g.fixPsuedoLeaks&&j.nodeType===1){j.parentNode.insertBefore(i,j);g.remove(j);return i}return j.parentNode.replaceChild(i,j)})},findCommonAncestor:function(h,f){var i=h,g;while(i){g=f;while(g&&i!=g){g=g.parentNode}if(i==g){break}i=i.parentNode}if(!i&&h.ownerDocument){return h.ownerDocument.documentElement}return i},toHex:function(f){var h=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(f);function g(i){i=parseInt(i).toString(16);return i.length>1?i:"0"+i}if(h){f="#"+g(h[1])+g(h[2])+g(h[3]);return f}return f},getClasses:function(){var l=this,g=[],k,m={},n=l.settings.class_filter,j;if(l.classes){return l.classes}function o(f){e(f.imports,function(i){o(i)});e(f.cssRules||f.rules,function(i){switch(i.type||1){case 1:if(i.selectorText){e(i.selectorText.split(","),function(p){p=p.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(p)||!/\.[\w\-]+$/.test(p)){return}j=p;p=p.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(n&&!(p=n(p,j))){return}if(!m[p]){g.push({"class":p});m[p]=1}})}break;case 3:o(i.styleSheet);break}})}try{e(l.doc.styleSheets,o)}catch(h){}if(g.length>0){l.classes=g}return g},run:function(j,i,h){var g=this,k;if(g.doc&&typeof(j)==="string"){j=g.get(j)}if(!j){return false}h=h||this;if(!j.nodeType&&(j.length||j.length===0)){k=[];e(j,function(l,f){if(l){if(typeof(l)=="string"){l=g.doc.getElementById(l)}k.push(i.call(h,l,f))}});return k}return i.call(h,j)},getAttribs:function(g){var f;g=this.get(g);if(!g){return[]}if(a){f=[];if(g.nodeName=="OBJECT"){return g.attributes}g.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(i,h){f.push({specified:1,nodeName:h})});return f}return g.attributes},destroy:function(g){var f=this;if(f.events){f.events.destroy()}f.win=f.doc=f.root=f.events=null;if(!g){c.removeUnload(f.destroy)}},createRng:function(){var f=this.doc;return f.createRange?f.createRange():new c.dom.Range(this)},split:function(l,k,o){var p=this,f=p.createRng(),m,j,n;function g(r,q){r=r[q];if(r&&r[q]&&r[q].nodeType==1&&i(r[q])){p.remove(r[q])}}function i(q){q=p.getOuterHTML(q);q=q.replace(/<(img|hr|table)/gi,"-");q=q.replace(/<[^>]+>/g,"");return q.replace(/[ \t\r\n]+| | /g,"")==""}function h(r){var q=0;while(r.previousSibling){q++;r=r.previousSibling}return q}if(l&&k){f.setStart(l.parentNode,h(l));f.setEnd(k.parentNode,h(k));m=f.extractContents();f=p.createRng();f.setStart(k.parentNode,h(k)+1);f.setEnd(l.parentNode,h(l)+1);j=f.extractContents();n=l.parentNode;g(m,"lastChild");if(!i(m)){n.insertBefore(m,l)}if(o){n.replaceChild(o,k)}else{n.insertBefore(k,l)}g(j,"firstChild");if(!i(j)){n.insertBefore(j,l)}p.remove(l);return o||k}},bind:function(j,f,i,h){var g=this;if(!g.events){g.events=new c.dom.EventUtils()}return g.events.add(j,f,i,h||this)},unbind:function(i,f,h){var g=this;if(!g.events){g.events=new c.dom.EventUtils()}return g.events.remove(i,f,h)},_isRes:function(f){return/^(top|left|bottom|right|width|height)/i.test(f)||/;\s*(top|left|bottom|right|width|height)/i.test(f)}});c.DOM=new c.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(f){var h=0,c=1,e=2,d=tinymce.extend;function g(m,k){var j,l;if(m.parentNode!=k){return -1}for(l=k.firstChild,j=0;l!=m;l=l.nextSibling){j++}return j}function b(k){var j=0;while(k.previousSibling){j++;k=k.previousSibling}return j}function i(j,k){var l;if(j.nodeType==3){return j}if(k<0){return j}l=j.firstChild;while(l!=null&&k>0){--k;l=l.nextSibling}if(l!=null){return l}return j}function a(k){var j=k.doc;d(this,{dom:k,startContainer:j,startOffset:0,endContainer:j,endOffset:0,collapsed:true,commonAncestorContainer:j,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3})}d(a.prototype,{setStart:function(k,j){this._setEndPoint(true,k,j)},setEnd:function(k,j){this._setEndPoint(false,k,j)},setStartBefore:function(j){this.setStart(j.parentNode,b(j))},setStartAfter:function(j){this.setStart(j.parentNode,b(j)+1)},setEndBefore:function(j){this.setEnd(j.parentNode,b(j))},setEndAfter:function(j){this.setEnd(j.parentNode,b(j)+1)},collapse:function(k){var j=this;if(k){j.endContainer=j.startContainer;j.endOffset=j.startOffset}else{j.startContainer=j.endContainer;j.startOffset=j.endOffset}j.collapsed=true},selectNode:function(j){this.setStartBefore(j);this.setEndAfter(j)},selectNodeContents:function(j){this.setStart(j,0);this.setEnd(j,j.nodeType===1?j.childNodes.length:j.nodeValue.length)},compareBoundaryPoints:function(m,n){var l=this,p=l.startContainer,o=l.startOffset,k=l.endContainer,j=l.endOffset;if(m===0){return l._compareBoundaryPoints(p,o,p,o)}if(m===1){return l._compareBoundaryPoints(p,o,k,j)}if(m===2){return l._compareBoundaryPoints(k,j,k,j)}if(m===3){return l._compareBoundaryPoints(k,j,p,o)}},deleteContents:function(){this._traverse(e)},extractContents:function(){return this._traverse(h)},cloneContents:function(){return this._traverse(c)},insertNode:function(m){var j=this,l,k;if(m.nodeType===3||m.nodeType===4){l=j.startContainer.splitText(j.startOffset);j.startContainer.parentNode.insertBefore(m,l)}else{if(j.startContainer.childNodes.length>0){k=j.startContainer.childNodes[j.startOffset]}j.startContainer.insertBefore(m,k)}},surroundContents:function(l){var j=this,k=j.extractContents();j.insertNode(l);l.appendChild(k);j.selectNode(l)},cloneRange:function(){var j=this;return d(new a(j.dom),{startContainer:j.startContainer,startOffset:j.startOffset,endContainer:j.endContainer,endOffset:j.endOffset,collapsed:j.collapsed,commonAncestorContainer:j.commonAncestorContainer})},_isCollapsed:function(){return(this.startContainer==this.endContainer&&this.startOffset==this.endOffset)},_compareBoundaryPoints:function(m,p,k,o){var q,l,j,r,t,s;if(m==k){if(p==o){return 0}else{if(p<o){return -1}else{return 1}}}q=k;while(q&&q.parentNode!=m){q=q.parentNode}if(q){l=0;j=m.firstChild;while(j!=q&&l<p){l++;j=j.nextSibling}if(p<=l){return -1}else{return 1}}q=m;while(q&&q.parentNode!=k){q=q.parentNode}if(q){l=0;j=k.firstChild;while(j!=q&&l<o){l++;j=j.nextSibling}if(l<o){return -1}else{return 1}}r=this.dom.findCommonAncestor(m,k);t=m;while(t&&t.parentNode!=r){t=t.parentNode}if(!t){t=r}s=k;while(s&&s.parentNode!=r){s=s.parentNode}if(!s){s=r}if(t==s){return 0}j=r.firstChild;while(j){if(j==t){return -1}if(j==s){return 1}j=j.nextSibling}},_setEndPoint:function(k,q,p){var l=this,j,m;if(k){l.startContainer=q;l.startOffset=p}else{l.endContainer=q;l.endOffset=p}j=l.endContainer;while(j.parentNode){j=j.parentNode}m=l.startContainer;while(m.parentNode){m=m.parentNode}if(m!=j){l.collapse(k)}else{if(l._compareBoundaryPoints(l.startContainer,l.startOffset,l.endContainer,l.endOffset)>0){l.collapse(k)}}l.collapsed=l._isCollapsed();l.commonAncestorContainer=l.dom.findCommonAncestor(l.startContainer,l.endContainer)},_traverse:function(r){var s=this,q,m=0,v=0,k,o,l,n,j,u;if(s.startContainer==s.endContainer){return s._traverseSameContainer(r)}for(q=s.endContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.startContainer){return s._traverseCommonStartContainer(q,r)}++m}for(q=s.startContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.endContainer){return s._traverseCommonEndContainer(q,r)}++v}o=v-m;l=s.startContainer;while(o>0){l=l.parentNode;o--}n=s.endContainer;while(o<0){n=n.parentNode;o++}for(j=l.parentNode,u=n.parentNode;j!=u;j=j.parentNode,u=u.parentNode){l=j;n=u}return s._traverseCommonAncestors(l,n,r)},_traverseSameContainer:function(o){var r=this,q,u,j,k,l,p,m;if(o!=e){q=r.dom.doc.createDocumentFragment()}if(r.startOffset==r.endOffset){return q}if(r.startContainer.nodeType==3){u=r.startContainer.nodeValue;j=u.substring(r.startOffset,r.endOffset);if(o!=c){r.startContainer.deleteData(r.startOffset,r.endOffset-r.startOffset);r.collapse(true)}if(o==e){return null}q.appendChild(r.dom.doc.createTextNode(j));return q}k=i(r.startContainer,r.startOffset);l=r.endOffset-r.startOffset;while(l>0){p=k.nextSibling;m=r._traverseFullySelected(k,o);if(q){q.appendChild(m)}--l;k=p}if(o!=c){r.collapse(true)}return q},_traverseCommonStartContainer:function(j,p){var s=this,r,k,l,m,q,o;if(p!=e){r=s.dom.doc.createDocumentFragment()}k=s._traverseRightBoundary(j,p);if(r){r.appendChild(k)}l=g(j,s.startContainer);m=l-s.startOffset;if(m<=0){if(p!=c){s.setEndBefore(j);s.collapse(false)}return r}k=j.previousSibling;while(m>0){q=k.previousSibling;o=s._traverseFullySelected(k,p);if(r){r.insertBefore(o,r.firstChild)}--m;k=q}if(p!=c){s.setEndBefore(j);s.collapse(false)}return r},_traverseCommonEndContainer:function(m,p){var s=this,r,o,j,k,q,l;if(p!=e){r=s.dom.doc.createDocumentFragment()}j=s._traverseLeftBoundary(m,p);if(r){r.appendChild(j)}o=g(m,s.endContainer);++o;k=s.endOffset-o;j=m.nextSibling;while(k>0){q=j.nextSibling;l=s._traverseFullySelected(j,p);if(r){r.appendChild(l)}--k;j=q}if(p!=c){s.setStartAfter(m);s.collapse(true)}return r},_traverseCommonAncestors:function(p,j,s){var w=this,l,v,o,q,r,k,u,m;if(s!=e){v=w.dom.doc.createDocumentFragment()}l=w._traverseLeftBoundary(p,s);if(v){v.appendChild(l)}o=p.parentNode;q=g(p,o);r=g(j,o);++q;k=r-q;u=p.nextSibling;while(k>0){m=u.nextSibling;l=w._traverseFullySelected(u,s);if(v){v.appendChild(l)}u=m;--k}l=w._traverseRightBoundary(j,s);if(v){v.appendChild(l)}if(s!=c){w.setStartAfter(p);w.collapse(true)}return v},_traverseRightBoundary:function(p,q){var s=this,l=i(s.endContainer,s.endOffset-1),r,o,n,j,k;var m=l!=s.endContainer;if(l==p){return s._traverseNode(l,m,false,q)}r=l.parentNode;o=s._traverseNode(r,false,false,q);while(r!=null){while(l!=null){n=l.previousSibling;j=s._traverseNode(l,m,false,q);if(q!=e){o.insertBefore(j,o.firstChild)}m=true;l=n}if(r==p){return o}l=r.previousSibling;r=r.parentNode;k=s._traverseNode(r,false,false,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseLeftBoundary:function(p,q){var s=this,m=i(s.startContainer,s.startOffset);var n=m!=s.startContainer,r,o,l,j,k;if(m==p){return s._traverseNode(m,n,true,q)}r=m.parentNode;o=s._traverseNode(r,false,true,q);while(r!=null){while(m!=null){l=m.nextSibling;j=s._traverseNode(m,n,true,q);if(q!=e){o.appendChild(j)}n=true;m=l}if(r==p){return o}m=r.nextSibling;r=r.parentNode;k=s._traverseNode(r,false,true,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseNode:function(j,o,r,s){var u=this,m,l,p,k,q;if(o){return u._traverseFullySelected(j,s)}if(j.nodeType==3){m=j.nodeValue;if(r){k=u.startOffset;l=m.substring(k);p=m.substring(0,k)}else{k=u.endOffset;l=m.substring(0,k);p=m.substring(k)}if(s!=c){j.nodeValue=p}if(s==e){return null}q=j.cloneNode(false);q.nodeValue=l;return q}if(s==e){return null}return j.cloneNode(false)},_traverseFullySelected:function(l,k){var j=this;if(k!=e){return k==c?l.cloneNode(true):l}l.parentNode.removeChild(l);return null}});f.Range=a})(tinymce.dom);(function(){function a(e){var d=this,h="\uFEFF",b,g;function c(j,i){if(j&&i){if(j.item&&i.item&&j.item(0)===i.item(0)){return 1}if(j.isEqual&&i.isEqual&&i.isEqual(j)){return 1}}return 0}function f(){var m=e.dom,j=e.getRng(),s=m.createRng(),p,k,n,q,o,l;function i(v){var t=v.parentNode.childNodes,u;for(u=t.length-1;u>=0;u--){if(t[u]==v){return u}}return -1}function r(v){var t=j.duplicate(),B,y,u,w,x=0,z=0,A,C;t.collapse(v);B=t.parentElement();t.pasteHTML(h);u=B.childNodes;for(y=0;y<u.length;y++){w=u[y];if(y>0&&(w.nodeType!==3||u[y-1].nodeType!==3)){z++}if(w.nodeType===3){A=w.nodeValue.indexOf(h);if(A!==-1){x+=A;break}x+=w.nodeValue.length}else{x=0}}t.moveStart("character",-1);t.text="";return{index:z,offset:x,parent:B}}n=j.item?j.item(0):j.parentElement();if(n.ownerDocument!=m.doc){return s}if(j.item||!n.hasChildNodes()){s.setStart(n.parentNode,i(n));s.setEnd(s.startContainer,s.startOffset+1);return s}l=e.isCollapsed();p=r(true);k=r(false);p.parent.normalize();k.parent.normalize();q=p.parent.childNodes[Math.min(p.index,p.parent.childNodes.length-1)];if(q.nodeType!=3){s.setStart(p.parent,p.index)}else{s.setStart(p.parent.childNodes[p.index],p.offset)}o=k.parent.childNodes[Math.min(k.index,k.parent.childNodes.length-1)];if(o.nodeType!=3){if(!l){k.index++}s.setEnd(k.parent,k.index)}else{s.setEnd(k.parent.childNodes[k.index],k.offset)}if(!l){q=s.startContainer;if(q.nodeType==1){s.setStart(q,Math.min(s.startOffset,q.childNodes.length))}o=s.endContainer;if(o.nodeType==1){s.setEnd(o,Math.min(s.endOffset,o.childNodes.length))}}d.addRange(s);return s}this.addRange=function(j){var o,m=e.dom.doc.body,p,k,q,l,n,i;q=j.startContainer;l=j.startOffset;n=j.endContainer;i=j.endOffset;o=m.createTextRange();q=q.nodeType==1?q.childNodes[Math.min(l,q.childNodes.length-1)]:q;n=n.nodeType==1?n.childNodes[Math.min(l==i?i:i-1,n.childNodes.length-1)]:n;if(q==n&&q.nodeType==1){if(/^(IMG|TABLE)$/.test(q.nodeName)&&l!=i){o=m.createControlRange();o.addElement(q)}else{o=m.createTextRange();if(!q.hasChildNodes()&&q.canHaveHTML){q.innerHTML=h}o.moveToElementText(q);if(q.innerHTML==h){o.collapse(true);q.removeChild(q.firstChild)}}if(l==i){o.collapse(i<=j.endContainer.childNodes.length-1)}o.select();return}function r(t,v){var u,s,w;if(t.nodeType!=3){return -1}u=t.nodeValue;s=m.createTextRange();t.nodeValue=u.substring(0,v)+h+u.substring(v);s.moveToElementText(t.parentNode);s.findText(h);w=Math.abs(s.moveStart("character",-1048575));t.nodeValue=u;return w}if(j.collapsed){pos=r(q,l);o=m.createTextRange();o.move("character",pos);o.select();return}else{if(q==n&&q.nodeType==3){p=r(q,l);o.move("character",p);o.moveEnd("character",i-l);o.select();return}p=r(q,l);k=r(n,i);o=m.createTextRange();if(p==-1){o.moveToElementText(q);p=0}else{o.move("character",p)}tmpRng=m.createTextRange();if(k==-1){tmpRng.moveToElementText(n)}else{tmpRng.move("character",k)}o.setEndPoint("EndToEnd",tmpRng);o.select();return}};this.getRangeAt=function(){if(!b||!c(g,e.getRng())){b=f();g=e.getRng()}return b};this.destroy=function(){g=b=null}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,i=0,d=Object.prototype.toString,n=false;var b=function(D,t,A,v){A=A||[];var e=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!D||typeof D!=="string"){return A}var B=[],C,y,G,F,z,s,r=true,w=o(t);p.lastIndex=0;while((C=p.exec(D))!==null){B.push(C[1]);if(C[2]){s=RegExp.rightContext;break}}if(B.length>1&&j.exec(D)){if(B.length===2&&f.relative[B[0]]){y=g(B[0]+B[1],t)}else{y=f.relative[B[0]]?[t]:b(B.shift(),t);while(B.length){D=B.shift();if(f.relative[D]){D+=B.shift()}y=g(D,y)}}}else{if(!v&&B.length>1&&t.nodeType===9&&!w&&f.match.ID.test(B[0])&&!f.match.ID.test(B[B.length-1])){var H=b.find(B.shift(),t,w);t=H.expr?b.filter(H.expr,H.set)[0]:H.set[0]}if(t){var H=v?{expr:B.pop(),set:a(v)}:b.find(B.pop(),B.length===1&&(B[0]==="~"||B[0]==="+")&&t.parentNode?t.parentNode:t,w);y=H.expr?b.filter(H.expr,H.set):H.set;if(B.length>0){G=a(y)}else{r=false}while(B.length){var u=B.pop(),x=u;if(!f.relative[u]){u=""}else{x=B.pop()}if(x==null){x=t}f.relative[u](G,x,w)}}else{G=B=[]}}if(!G){G=y}if(!G){throw"Syntax error, unrecognized expression: "+(u||D)}if(d.call(G)==="[object Array]"){if(!r){A.push.apply(A,G)}else{if(t&&t.nodeType===1){for(var E=0;G[E]!=null;E++){if(G[E]&&(G[E]===true||G[E].nodeType===1&&h(t,G[E]))){A.push(y[E])}}}else{for(var E=0;G[E]!=null;E++){if(G[E]&&G[E].nodeType===1){A.push(y[E])}}}}}else{a(G,A)}if(s){b(s,e,A,v);b.uniqueSort(A)}return A};b.uniqueSort=function(r){if(c){n=false;r.sort(c);if(n){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(x,e,y){var w,u;if(!x){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.match[v].exec(x))){var r=RegExp.leftContext;if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");w=f.find[v](u,e,y);if(w!=null){x=x.replace(f.match[v],"");break}}}}if(!w){w=e.getElementsByTagName("*")}return{set:w,expr:x}};b.filter=function(A,z,D,t){var s=A,F=[],x=z,v,e,w=z&&z[0]&&o(z[0]);while(A&&z.length){for(var y in f.filter){if((v=f.match[y].exec(A))!=null){var r=f.filter[y],E,C;e=false;if(x==F){F=[]}if(f.preFilter[y]){v=f.preFilter[y](v,x,D,F,t,w);if(!v){e=E=true}else{if(v===true){continue}}}if(v){for(var u=0;(C=x[u])!=null;u++){if(C){E=r(C,v,u,x);var B=t^!!E;if(D&&E!=null){if(B){e=true}else{x[u]=false}}else{if(B){F.push(C);e=true}}}}}if(E!==undefined){if(!D){x=F}A=A.replace(f.match[y],"");if(!e){return[]}break}}}if(A==s){if(e==null){throw"Syntax error, unrecognized expression: "+A}else{break}}s=A}return x};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(x,e,w){var u=typeof e==="string",y=u&&!/\W/.test(e),v=u&&!y;if(y&&!w){e=e.toUpperCase()}for(var t=0,s=x.length,r;t<s;t++){if((r=x[t])){while((r=r.previousSibling)&&r.nodeType!==1){}x[t]=v||r&&r.nodeName===e?r||false:r===e}}if(v){b.filter(e,x,true)}},">":function(w,r,x){var u=typeof r==="string";if(u&&!/\W/.test(r)){r=x?r:r.toUpperCase();for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){var t=v.parentNode;w[s]=t.nodeName===r?t:false}}}else{for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){w[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,w,true)}}},"":function(t,r,v){var s=i++,e=q;if(!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=i++,e=q;if(typeof r==="string"&&!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v,w){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,w,x){t=" "+t[1].replace(/\\/g,"")+" ";if(x){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(w^(v.className&&(" "+v.className+" ").indexOf(t)>=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){for(var s=0;e[s]===false;s++){}return e[s]&&o(e[s])?r[1]:r[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=i++;return e},ATTR:function(u,r,s,e,v,w){var t=u[1].replace(/\\/g,"");if(!w&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if(u[3].match(p).length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return r<e[3]-0},gt:function(s,r,e){return r>e[3]-0},nth:function(s,r,e){return e[3]-0==r},eq:function(s,r,e){return e[3]-0==r}},filter:{PSEUDO:function(w,s,t,x){var r=s[1],u=f.filters[r];if(u){return u(w,t,s,x)}else{if(r==="contains"){return(w.textContent||w.innerText||"").indexOf(s[3])>=0}else{if(r==="not"){var v=s[3];for(var t=0,e=v.length;t<e;t++){if(v[t]===w){return false}}return true}}}},CHILD:function(e,t){var w=t[1],r=e;switch(w){case"only":case"first":while(r=r.previousSibling){if(r.nodeType===1){return false}}if(w=="first"){return true}r=e;case"last":while(r=r.nextSibling){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],z=t[3];if(s==1&&z==0){return true}var v=t[0],y=e.parentNode;if(y&&(y.sizcache!==v||!e.nodeIndex)){var u=0;for(r=y.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}y.sizcache=v}var x=e.nodeIndex-z;if(s==0){return x==0}else{return(x%s==0&&x/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),w=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?w===r:u==="*="?w.indexOf(r)>=0:u==="~="?(" "+w+" ").indexOf(r)>=0:!r?w&&e!==false:u==="!="?w!=r:u==="^="?w.indexOf(r)===0:u==="$="?w.substr(w.length-r.length)===r:u==="|="?w===r||w.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var j=f.match.POS;for(var l in f.match){f.match[l]=new RegExp(f.match[l].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var a=function(r,e){r=Array.prototype.slice.call(r);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(k){a=function(u,t){var r=t||[];if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var s=0,e=u.length;s<e;s++){r.push(u[s])}}else{for(var s=0;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){n=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){var s=r.sourceIndex-e.sourceIndex;if(s===0){n=true}return s}}else{if(document.createRange){c=function(t,r){var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.setStart(t,0);s.setEnd(t,0);e.setStart(r,0);e.setEnd(r,0);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){n=true}return u}}}}(function(){var r=document.createElement("div"),s="script"+(new Date).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(!!document.getElementById(s)){f.find.ID=function(u,v,w){if(typeof v.getElementById!=="undefined"&&!w){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(w,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!o(v)){try{return a(v.querySelectorAll(w),t)}catch(x){}}return e(w,v,t,u)};for(var r in e){b[r]=e[r]}})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}}})()}function m(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1&&!z){e.sizcache=v;e.sizset=t}if(e.nodeName===w){u=e;break}e=e[r]}A[t]=u}}}function q(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1){if(!z){e.sizcache=v;e.sizset=t}if(typeof w!=="string"){if(e===w){u=true;break}}else{if(b.filter(w,[e]).length>0){u=e;break}}}e=e[r]}A[t]=u}}}var h=document.compareDocumentPosition?function(r,e){return r.compareDocumentPosition(e)&16}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};var o=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,x){var t=[],u="",v,s=x.nodeType?[x]:x;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var w=0,r=s.length;w<r;w++){b(e,s[w],t)}return b.filter(u,t)};window.tinymce.dom.Sizzle=b})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}if(!n.preventDefault){n.preventDefault=function(){n.returnValue=false}}if(!n.stopPropagation){n.stopPropagation=function(){n.cancelBubble=true}}}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){var b=a.each;a.create("tinymce.dom.Element",{Element:function(g,e){var c=this,f,d;e=e||{};c.id=g;c.dom=f=e.dom||a.DOM;c.settings=e;if(!a.isIE){d=c.dom.get(c.id)}b(["getPos","getRect","getParent","add","setStyle","getStyle","setStyles","setAttrib","setAttribs","getAttrib","addClass","removeClass","hasClass","getOuterHTML","setOuterHTML","remove","show","hide","isHidden","setHTML","get"],function(h){c[h]=function(){var j=[g],k;for(k=0;k<arguments.length;k++){j.push(arguments[k])}j=f[h].apply(f,j);c.update(h);return j}})},on:function(e,d,c){return a.dom.Event.add(this.id,e,d,c)},getXY:function(){return{x:parseInt(this.getStyle("left")),y:parseInt(this.getStyle("top"))}},getSize:function(){var c=this.dom.get(this.id);return{w:parseInt(this.getStyle("width")||c.clientWidth),h:parseInt(this.getStyle("height")||c.clientHeight)}},moveTo:function(c,d){this.setStyles({left:c,top:d})},moveBy:function(c,e){var d=this.getXY();this.moveTo(d.x+c,d.y+e)},resizeTo:function(c,d){this.setStyles({width:c,height:d})},resizeBy:function(c,e){var d=this.getSize();this.resizeTo(d.w+c,d.h+e)},update:function(d){var e=this,c,f=e.dom;if(a.isIE6&&e.settings.blocker){d=d||"";if(d.indexOf("get")===0||d.indexOf("has")===0||d.indexOf("is")===0){return}if(d=="remove"){f.remove(e.blocker);return}if(!e.blocker){e.blocker=f.uniqueId();c=f.add(e.settings.container||f.getRoot(),"iframe",{id:e.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});f.setStyle(c,"opacity",0)}else{c=f.get(e.blocker)}f.setStyle(c,"left",e.getStyle("left",1));f.setStyle(c,"top",e.getStyle("top",1));f.setStyle(c,"width",e.getStyle("width",1));f.setStyle(c,"height",e.getStyle("height",1));f.setStyle(c,"display",e.getStyle("display",1));f.setStyle(c,"zIndex",parseInt(e.getStyle("zIndex",1)||0)-1)}}})})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(i,g){var f=this,j=f.getRng(),l,k=f.win.document;g=g||{format:"html"};g.set=true;i=g.content=f.dom.processHTML(i);f.onBeforeSetContent.dispatch(f,g);i=g.content;if(j.insertNode){i+='<span id="__caret">_</span>';j.deleteContents();j.insertNode(f.getRng().createContextualFragment(i));l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndAfter(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(1);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.firstChild}return h}else{h=g.startContainer;if(h.nodeName=="BODY"){return h.firstChild}return f.dom.getParent(h,"*")}},getEnd:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(0);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.lastChild}return h}else{h=g.endContainer;if(h.nodeName=="BODY"){return h.lastChild}return f.dom.getParent(h,"*")}},getBookmark:function(x){var j=this,m=j.getRng(),f,n,l,u=j.dom.getViewPort(j.win),v,p,z,o,w=-16777215,k,h=j.dom.getRoot(),g=0,i=0,y;n=u.x;l=u.y;if(x=="simple"){return{rng:m,scrollX:n,scrollY:l}}if(a){if(m.item){v=m.item(0);d(j.dom.select(v.nodeName),function(s,r){if(v==s){p=r;return false}});return{tag:v.nodeName,index:p,scrollX:n,scrollY:l}}f=j.dom.doc.body.createTextRange();f.moveToElementText(h);f.collapse(true);z=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(true);p=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(false);o=Math.abs(f.move("character",w))-p;return{start:p-z,length:o,scrollX:n,scrollY:l}}v=j.getNode();k=j.getSel();if(!k){return null}if(v&&v.nodeName=="IMG"){return{scrollX:n,scrollY:l}}function q(A,D,t){var s=j.dom.doc.createTreeWalker(A,NodeFilter.SHOW_TEXT,null,false),E,B=0,C={};while((E=s.nextNode())!=null){if(E==D){C.start=B}if(E==t){C.end=B;return C}B+=e(E.nodeValue||"").length}return null}if(k.anchorNode==k.focusNode&&k.anchorOffset==k.focusOffset){v=q(h,k.anchorNode,k.focusNode);if(!v){return{scrollX:n,scrollY:l}}e(k.anchorNode.nodeValue||"").replace(/^\s+/,function(r){g=r.length});return{start:Math.max(v.start+k.anchorOffset-g,0),end:Math.max(v.end+k.focusOffset-g,0),scrollX:n,scrollY:l,beg:k.anchorOffset-g==0}}else{v=q(h,m.startContainer,m.endContainer);if(!v){return{scrollX:n,scrollY:l}}return{start:Math.max(v.start+m.startOffset-g,0),end:Math.max(v.end+m.endOffset-i,0),scrollX:n,scrollY:l,beg:m.startOffset-g==0}}},moveToBookmark:function(n){var o=this,g=o.getRng(),p=o.getSel(),j=o.dom.getRoot(),m,h,k;function i(q,t,D){var B=o.dom.doc.createTreeWalker(q,NodeFilter.SHOW_TEXT,null,false),x,s=0,A={},u,C,z,y;while((x=B.nextNode())!=null){z=y=0;k=x.nodeValue||"";h=e(k).length;s+=h;if(s>=t&&!A.startNode){u=t-(s-h);if(n.beg&&u>=h){continue}A.startNode=x;A.startOffset=u+y}if(s>=D){A.endNode=x;A.endOffset=D-(s-h)+y;return A}}return null}if(!n){return false}o.win.scrollTo(n.scrollX,n.scrollY);if(a){if(g=n.rng){try{g.select()}catch(l){}return true}o.win.focus();if(n.tag){g=j.createControlRange();d(o.dom.select(n.tag),function(r,q){if(q==n.index){g.addElement(r)}})}else{try{if(n.start<0){return true}g=p.createRange();g.moveToElementText(j);g.collapse(true);g.moveStart("character",n.start);g.moveEnd("character",n.length)}catch(f){return true}}try{g.select()}catch(l){}return true}if(!p){return false}if(n.rng){p.removeAllRanges();p.addRange(n.rng)}else{if(b(n.start)&&b(n.end)){try{m=i(j,n.start,n.end);if(m){g=o.dom.doc.createRange();g.setStart(m.startNode,m.startOffset);g.setEnd(m.endNode,m.endOffset);p.removeAllRanges();p.addRange(g)}if(!c.isOpera){o.win.focus()}}catch(l){}}}},select:function(g,l){var p=this,f=p.getRng(),q=p.getSel(),o,m,k,j=p.win.document;function h(u,t){var s,r;if(u){s=j.createTreeWalker(u,NodeFilter.SHOW_TEXT,null,false);while(u=s.nextNode()){r=u;if(c.trim(u.nodeValue).length!=0){if(t){return u}else{r=u}}}}return r}if(a){try{o=j.body;if(/^(IMG|TABLE)$/.test(g.nodeName)){f=o.createControlRange();f.addElement(g)}else{f=o.createTextRange();f.moveToElementText(g)}f.select()}catch(i){}}else{if(l){m=h(g,1)||p.dom.select("br:first",g)[0];k=h(g,0)||p.dom.select("br:last",g)[0];if(m&&k){f=j.createRange();if(m.nodeName=="BR"){f.setStartBefore(m)}else{f.setStart(m,0)}if(k.nodeName=="BR"){f.setEndBefore(k)}else{f.setEnd(k,k.nodeValue.length)}}else{f.selectNode(g)}}else{f.selectNode(g)}p.setRng(f)}return g},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}return !g||h.boundingWidth==0||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i){i=a?g.win.document.body.createTextRange():g.win.document.createRange()}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){h.removeAllRanges();h.addRange(i)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var f=this,h=f.getRng(),g=f.getSel(),i;if(!a){if(!h){return f.dom.getRoot()}i=h.commonAncestorContainer;if(!h.collapsed){if(c.isWebKit&&g.anchorNode&&g.anchorNode.nodeType==1){return g.anchorNode.childNodes[g.anchorOffset]}if(h.startContainer==h.endContainer){if(h.startOffset-h.endOffset<2){if(h.startContainer.hasChildNodes()){i=h.startContainer.childNodes[h.startOffset]}}}}return f.dom.getParent(i,"*")}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,">")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+b+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("<![CDATA["+b+"]]>");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("<!-- "+b+"-->");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"<";case">":return">";case"&":return"&";case'"':return"""}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",bool_attrs:/(checked|disabled|readonly|selected|nowrap)/,valid_elements:"*[*]",extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^<br \/>\s*<\//.test(n)){return"</"+o+">"}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,y,w=["ol","ul"],u,t,q,k=/^(OL|UL)$/,z;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p<o.length;p++){if(r.nodeName==o[p]){return r}}}return null}for(y=0;y<w.length;y++){l=i.dom.select(w[y],s.node);for(u=0;u<l.length;u++){t=l[u];q=t.parentNode;if(k.test(q.nodeName)){z=m(t,"LI");if(!z){z=i.dom.create("li");z.innerHTML=" ";z.appendChild(t);q.insertBefore(z,q.firstChild)}else{z.appendChild(t)}}}}})}if(j.fix_table_elements){i.onPreProcess.add(function(k,l){f(i.dom.select("p table",l.node),function(m){i.dom.split(i.dom.getParent(m,"p"),m)})})}},setEntities:function(p){var n=this,j,m,h={},o="",k;if(n.entityLookup){return}j=p.split(",");for(m=0;m<j.length;m+=2){k=j[m];if(k==34||k==38||k==60||k==62){continue}h[String.fromCharCode(j[m])]=j[m+1];k=parseInt(j[m]).toString(16);o+="\\u"+"0000".substring(k.length)+k}if(!o){n.settings.entity_encoding="raw";return}n.entitiesRE=new RegExp("["+o+"]","g");n.entityLookup=h},setValidChildRules:function(h){this.childRules=null;this.addValidChildRules(h)},addValidChildRules:function(k){var j=this,l,h,i;if(!k){return}l="A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment";h="A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment";i="H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP";f(k.split(","),function(n){var o=n.split(/\[|\]/),m;n="";f(o[1].split("|"),function(p){if(n){n+="|"}switch(p){case"%itrans":p=h;break;case"%itrans_na":p=h.substring(2);break;case"%istrict":p=l;break;case"%istrict_na":p=l.substring(2);break;case"%btrans":p=i;break;case"%bstrict":p=i;break}n+=p});m=new RegExp("^("+n.toLowerCase()+")$","i");f(o[0].split("/"),function(p){j.childRules=j.childRules||{};j.childRules[p]=m})});k="";f(j.childRules,function(n,m){if(k){k+="|"}k+=m});j.parentElementsRE=new RegExp("^("+k.toLowerCase()+")$","i")},setRules:function(i){var h=this;h._setup();h.rules={};h.wildRules=[];h.validElements={};return h.addRules(i)},addRules:function(i){var h=this,j;if(!i){return}h._setup();f(i.split(","),function(m){var q=m.split(/\[|\]/),l=q[0].split("/"),r,k,o,n=[];if(j){k=e.extend([],j.attribs)}if(q.length>1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t<k.length;t++){if(k[t].name==u[2]){k.splice(t,1);return}}}switch(u[3]){case"=":p.defaultVal=u[4]||"";break;case":":p.forcedVal=u[4];break;case"<":p.validVals=u[4].split("?");break}if(/[*.?]/.test(u[2])){o=o||[];p.nameRE=new RegExp("^"+c(u[2])+"$");o.push(p)}else{p.name=u[2];k.push(p)}n.push(u[2])})}f(l,function(v,u){var w=v.charAt(0),t=1,p={};if(j){if(j.noEmpty){p.noEmpty=j.noEmpty}if(j.fullEnd){p.fullEnd=j.fullEnd}if(j.padd){p.padd=j.padd}}switch(w){case"-":p.noEmpty=true;break;case"+":p.fullEnd=true;break;case"#":p.padd=true;break;default:t=0}l[u]=v=v.substring(t);h.validElements[v]=1;if(/[*.?]/.test(l[0])){p.nameRE=new RegExp("^"+c(l[0])+"$");h.wildRules=h.wildRules||{};h.wildRules.push(p)}else{p.name=l[0];if(l[0]=="@"){j=p}h.rules[v]=p}p.attribs=k;if(r){p.requiredAttribs=r}if(o){v="";f(n,function(s){if(v){v+="|"}v+="("+c(s)+")"});p.validAttribsRE=new RegExp("^"+v.toLowerCase()+"$");p.wildAttribs=o}})});i="";f(h.validElements,function(m,l){if(i){i+="|"}if(l!="@"){i+=l}});h.validElementsRE=new RegExp("^("+c(i.toLowerCase())+")$")},findRule:function(m){var j=this,l=j.rules,h,k;j._setup();k=l[m];if(k){return k}l=j.wildRules;for(h=0;h<l.length;h++){if(l[h].nameRE.test(m)){return l[h]}}return null},findAttribRule:function(h,l){var j,k=h.wildAttribs;for(j=0;j<k.length;j++){if(k[j].nameRE.test(l)){return k[j]}}return null},serialize:function(l,k){var j,i=this;i._setup();k=k||{};k.format=k.format||"html";i.processObj=k;l=l.cloneNode(true);i.key=""+(parseInt(i.key)+1);if(!k.no_events){k.node=l;i.onPreProcess.dispatch(i,k)}i.writer.reset();i._serializeNode(l,k.getInner);k.content=i.writer.getContent();if(!k.no_events){i.onPostProcess.dispatch(i,k)}i._postProcess(k);k.node=null;return e.trim(k.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?"<p$1> </p>":"<p$1> </p>");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>");j=j.replace(/(type|language)=\"mce-/g,'$1="');if(k.entity_encoding=="raw"){j=j.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g,"<p$1>\u00a0</p>")}}n.content=j},_serializeNode:function(D,o){var z=this,A=z.settings,x=z.writer,q,j,u,F,E,G,B,h,y,k,r,C,p,m;if(!A.node_filter||A.node_filter(D)){switch(D.nodeType){case 1:if(D.hasAttribute?D.hasAttribute("mce_bogus"):D.getAttribute("mce_bogus")){return}p=false;q=D.hasChildNodes();k=D.getAttribute("mce_name")||D.nodeName.toLowerCase();if(d){if(D.scopeName!=="HTML"&&D.scopeName!=="html"){k=D.scopeName+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!z.validElementsRE||!z.validElementsRE.test(k)||(z.invalidElementsRE&&z.invalidElementsRE.test(k))||o){p=true;break}if(d){if(A.fix_content_duplication){if(D.mce_serialized==z.key){return}D.mce_serialized=z.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(D.nodeName==="BR"&&D.getAttribute("type")=="_moz"){return}}}if(z.childRules){if(z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(k)){p=true;break}}z.elementName=k}r=z.findRule(k);k=r.name||k;m=A.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){G=r.requiredAttribs;for(F=G.length-1;F>=0;F--){if(this.dom.getAttrib(D,G[F])!==""){break}}if(F==-1){p=true;break}}x.writeStartElement(k);if(r.attribs){for(F=0,B=r.attribs,E=B.length;F<E;F++){G=B[F];y=z._getAttrib(D,G);if(y!==null){x.writeAttribute(G.name,y)}}}if(r.validAttribsRE){B=z.dom.getAttribs(D);for(F=B.length-1;F>-1;F--){h=B[F];if(h.specified){G=h.nodeName.toLowerCase();if(A.invalid_attrs.test(G)||!r.validAttribsRE.test(G)){continue}C=z.findAttribRule(r,G);y=z._getAttrib(D,C,G);if(y!==null){x.writeAttribute(G,y)}}}}if(k==="script"&&e.trim(D.innerHTML)){x.writeText("// ");x.writeCDATA(D.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=D.firstChild)&&u.nodeType===1&&D.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("mce_bogus"):u.getAttribute("mce_bogus")){x.writeText("\u00a0")}}else{if(!q){x.writeText("\u00a0")}}}break;case 3:if(z.childRules&&z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(D.nodeName)){return}}return x.writeText(D.nodeValue);case 4:return x.writeCDATA(D.nodeValue);case 8:return x.writeComment(D.nodeValue)}}else{if(D.nodeType==1){q=D.hasChildNodes()}}if(q&&!m){u=D.firstChild;while(u){z._serializeNode(u);z.elementName=k;u=u.nextSibling}}if(!p){if(!m){x.writeFullEndElement()}else{x.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+"<!--mce:"+(j.items.length-1)+"-->"+p}))});return j},_unprotect:function(i,j){i=i.replace(/\<!--mce:([0-9]+)--\>/g,function(k,h){return j.items[parseInt(h)]});j.items=[];return i},_encode:function(m){var j=this,k=j.settings,i;if(k.entity_encoding!=="raw"){if(k.entity_encoding.indexOf("named")!=-1){j.setEntities(k.entities);i=j.entityLookup;m=m.replace(j.entitiesRE,function(h){var l;if(l=i[h]){h="&"+l+";"}return h})}if(k.entity_encoding.indexOf("numeric")!=-1){m=m.replace(/[\u007E-\uFFFF]/g,function(h){return"&#"+h.charCodeAt(0)+";"})}}return m},_setup:function(){var h=this,i=this.settings;if(h.done){return}h.done=1;h.setRules(i.valid_elements);h.addRules(i.extended_valid_elements);h.addValidChildRules(i.valid_child_elements);if(i.invalid_elements){h.invalidElementsRE=new RegExp("^("+c(i.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(i.attrib_value_filter){h.attribValueFilter=i.attribValueFilter}},_getAttrib:function(m,j,h){var l,k;h=h||j.name;if(j.forcedVal&&(k=j.forcedVal)){if(k==="{$uid}"){return this.dom.uniqueId()}return k}k=this.dom.getAttrib(m,h);if(this.settings.bool_attrs.test(h)&&k){k=(""+k).toLowerCase();if(k==="false"||k==="0"){return null}k=h}switch(h){case"rowspan":case"colspan":if(k=="1"){k=""}break}if(this.attribValueFilter){k=this.attribValueFilter(h,k,m)}if(j.validVals){for(l=j.validVals.length-1;l>=0;l--){if(k==j.validVals[l]){break}}if(l==-1){return null}}if(k===""&&typeof(j.defaultVal)!="undefined"){k=j.defaultVal;if(k==="{$uid}"){return this.dom.uniqueId()}return k}else{if(h=="class"&&this.processObj.get){k=k.replace(/\s?mceItem\w+\s?/g,"")}}if(k===""){return null}return k}})})(tinymce);(function(tinymce){var each=tinymce.each,Event=tinymce.dom.Event;tinymce.create("tinymce.dom.ScriptLoader",{ScriptLoader:function(s){this.settings=s||{};this.queue=[];this.lookup={}},isDone:function(u){return this.lookup[u]?this.lookup[u].state==2:0},markDone:function(u){this.lookup[u]={state:2,url:u}},add:function(u,cb,s,pr){var t=this,lo=t.lookup,o;if(o=lo[u]){if(cb&&o.state==2){cb.call(s||this)}return o}o={state:0,url:u,func:cb,scope:s||this};if(pr){t.queue.unshift(o)}else{t.queue.push(o)}lo[u]=o;return o},load:function(u,cb,s){var t=this,o;if(o=t.lookup[u]){if(cb&&o.state==2){cb.call(s||t)}return o}function loadScript(u){if(Event.domLoaded||t.settings.strict_mode){tinymce.util.XHR.send({url:tinymce._addVer(u),error:t.settings.error,async:false,success:function(co){t.eval(co)}})}else{document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"><\/script>')}}if(!tinymce.is(u,"string")){each(u,function(u){loadScript(u)});if(cb){cb.call(s||t)}}else{loadScript(u);if(cb){cb.call(s||t)}}},loadQueue:function(cb,s){var t=this;if(!t.queueLoading){t.queueLoading=1;t.queueCallbacks=[];t.loadScripts(t.queue,function(){t.queueLoading=0;if(cb){cb.call(s||t)}each(t.queueCallbacks,function(o){o.func.call(o.scope)})})}else{if(cb){t.queueCallbacks.push({func:cb,scope:s||t})}}},eval:function(co){var w=window;if(!w.execScript){try{eval.call(w,co)}catch(ex){eval(co,w)}}else{w.execScript(co)}},loadScripts:function(sc,cb,s){var t=this,lo=t.lookup;function done(o){o.state=2;if(o.func){o.func.call(o.scope||t)}}function allDone(){var l;l=sc.length;each(sc,function(o){o=lo[o.url];if(o.state===2){done(o);l--}else{load(o)}});if(l===0&&cb){cb.call(s||t);cb=0}}function load(o){if(o.state>0){return}o.state=1;tinymce.dom.ScriptLoader.loadScript(o.url,function(){done(o);allDone()})}each(sc,function(o){var u=o.url;if(!lo[u]){lo[u]=o;t.queue.push(o)}else{o=lo[u]}if(o.state>0){return}if(!Event.domLoaded&&!t.settings.strict_mode){var ix,ol="";if(cb||o.func){o.state=1;ix=tinymce.dom.ScriptLoader._addOnLoad(function(){done(o);allDone()});if(tinymce.isIE){ol=' onreadystatechange="'}else{ol=' onload="'}ol+="tinymce.dom.ScriptLoader._onLoad(this,'"+u+"',"+ix+');"'}document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"'+ol+"><\/script>");if(!o.func){done(o)}}else{load(o)}});allDone()},"static":{_addOnLoad:function(f){var t=this;t._funcs=t._funcs||[];t._funcs.push(f);return t._funcs.length-1},_onLoad:function(e,u,ix){if(!tinymce.isIE||e.readyState=="complete"){this._funcs[ix].call(this)}},loadScript:function(u,cb){var id=tinymce.DOM.uniqueId(),e;function done(){Event.clear(id);tinymce.DOM.remove(id);if(cb){cb.call(document,u);cb=0}}if(tinymce.isIE){tinymce.util.XHR.send({url:tinymce._addVer(u),async:false,success:function(co){window.execScript(co);done()}})}else{e=tinymce.DOM.create("script",{id:id,type:"text/javascript",src:tinymce._addVer(u)});Event.add(e,"load",done);(document.getElementsByTagName("head")[0]||document.body).appendChild(e)}}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader()})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(w){var h,t,s;w=w.target;if(w&&(w=c.getParent(w,"tr"))){h=z.items[w.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(w&&c.hasClass(w,m+"ItemSub")){t=c.getRect(w);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}z.onShowMenu.dispatch(z);if(A.keyboard_focus){a.add(o,"keydown",z._keyHandler,z);c.select("a","menu_"+z.id)[0].focus();z._focusIdx=0}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000"});k=c.add(g,"div",{id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_keyHandler:function(j){var i=this,h=j.keyCode;function g(m){var k=i._focusIdx+m,l=c.select("a","menu_"+i.id)[k];if(l){i._focusIdx=k;l.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,"td");i=p=c.add(i,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" />'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";i+="</tr></tbody></table>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(h){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(l){var i=-1,j,k=l.keyCode;e(f.items,function(m,n){if(f.selectedValue==m.value){i=n}});if(k==38){j=f.items[i-1]}else{if(k==40){j=f.items[i+1]}else{if(k==13){j=f.selectedValue;f.selectedValue=null;f.settings.onselect(j);return b.cancel(l)}}}if(j){f.hideMenu();f.select(j.value)}})}f._focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return c.get(this.id).options.length-1},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(j){var i=g.items[j.target.selectedIndex-1];if(i&&(i=i.value)){g.onChange.dispatch(g,i);if(g.settings.onselect){g.settings.onselect(i)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(j){var i;b.remove(g.id,"change",h);i=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.remove(g.id,"blur",i)});if(j.keyCode==13||j.keyCode==32){f(j);return b.cancel(j)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}i+="<td>"+b.createHTML("a",{id:f.id+"_action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});i+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},i)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(i){i=i.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+i},mce_color:"#"+i})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(i){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(i)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(i){var m;i=i.target;if(i.nodeName=="A"&&(m=i.getAttribute("mce_color"))){k.setColor(m)}return a.cancel(i)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: relative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new a(this),get:function(d){return this.lookup[d]},requireLangPack:function(f){var d,e=b.EditorManager.settings;if(e&&e.language){d=this.urls[f]+"/langs/"+e.language+".js";if(!b.dom.Event.domLoaded&&!e.strict_mode){b.ScriptLoader.load(d)}else{b.ScriptLoader.add(d)}}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));b.ScriptLoader.add(e,d,g)}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(f){var g=f.each,h=f.extend,e=f.DOM,a=f.dom.Event,c=f.ThemeManager,b=f.PluginManager,d=f.explode;f.create("static tinymce.EditorManager",{editors:{},i18n:{},activeEditor:null,preInit:function(){var i=this,j=window.location;f.documentBaseURL=j.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(f.documentBaseURL)){f.documentBaseURL+="/"}f.baseURL=new f.util.URI(f.documentBaseURL).toAbsolute(f.baseURL);f.EditorManager.baseURI=new f.util.URI(f.baseURL);if(document.domain&&j.hostname!=document.domain){f.relaxedDomain=document.domain}i.onBeforeUnload=new f.util.Dispatcher(i);a.add(window,"beforeunload",function(k){i.onBeforeUnload.dispatch(i,k)})},init:function(q){var p=this,l,k=f.ScriptLoader,o,n,i=[],m;function j(u,v,r){var t=u[v];if(!t){return}if(f.is(t,"string")){r=t.replace(/\.\w+$/,"");r=r?f.resolve(r):0;t=f.resolve(t)}return t.apply(r||this,Array.prototype.slice.call(arguments,2))}q=h({theme:"simple",language:"en",strict_loading_mode:document.contentType=="application/xhtml+xml"},q);p.settings=q;if(!a.domLoaded&&!q.strict_loading_mode){if(q.language){k.add(f.baseURL+"/langs/"+q.language+".js")}if(q.theme&&q.theme.charAt(0)!="-"&&!c.urls[q.theme]){c.load(q.theme,"themes/"+q.theme+"/editor_template"+f.suffix+".js")}if(q.plugins){l=d(q.plugins);if(f.inArray(l,"compat2x")!=-1){b.load("compat2x","plugins/compat2x/editor_plugin"+f.suffix+".js")}g(l,function(r){if(r&&r.charAt(0)!="-"&&!b.urls[r]){if(!f.isWebKit&&r=="safari"){return}b.load(r,"plugins/"+r+"/editor_plugin"+f.suffix+".js")}})}k.loadQueue()}a.add(document,"init",function(){var r,t;j(q,"onpageload");if(q.browsers){r=false;g(d(q.browsers),function(u){switch(u){case"ie":case"msie":if(f.isIE){r=true}break;case"gecko":if(f.isGecko){r=true}break;case"safari":case"webkit":if(f.isWebKit){r=true}break;case"opera":if(f.isOpera){r=true}break}});if(!r){return}}switch(q.mode){case"exact":r=q.elements||"";if(r.length>0){g(d(r),function(u){if(e.get(u)){m=new f.Editor(u,q);i.push(m);m.render(1)}else{o=0;g(document.forms,function(v){g(v.elements,function(w){if(w.name===u){u="mce_editor_"+o;e.setAttrib(w,"id",u);m=new f.Editor(u,q);i.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function s(v,u){return u.constructor===RegExp?u.test(v.className):e.hasClass(v,u)}g(e.select("textarea"),function(u){if(q.editor_deselector&&s(u,q.editor_deselector)){return}if(!q.editor_selector||s(u,q.editor_selector)){n=e.get(u.name);if(!u.id&&!n){u.id=u.name}if(!u.id||p.get(u.id)){u.id=e.uniqueId()}m=new f.Editor(u.id,q);i.push(m);m.render(1)}});break}if(q.oninit){r=t=0;g(i,function(u){t++;if(!u.initialized){u.onInit.add(function(){r++;if(r==t){j(q,"oninit")}})}else{r++}if(r==t){j(q,"oninit")}})}})},get:function(i){return this.editors[i]},getInstanceById:function(i){return this.get(i)},add:function(i){this.editors[i.id]=i;this._setActive(i);return i},remove:function(j){var i=this;if(!i.editors[j.id]){return null}delete i.editors[j.id];if(i.activeEditor==j){g(i.editors,function(k){i._setActive(k);return false})}j.destroy();return j},execCommand:function(o,m,l){var n=this,k=n.get(l),i;switch(o){case"mceFocus":k.focus();return true;case"mceAddEditor":case"mceAddControl":if(!n.get(l)){new f.Editor(l,n.settings).render()}return true;case"mceAddFrameControl":i=l.window;i.tinyMCE=tinyMCE;i.tinymce=f;f.DOM.doc=i.document;f.DOM.win=i;k=new f.Editor(l.element_id,l);k.render();if(f.isIE){function j(){k.destroy();i.detachEvent("onunload",j);i=i.tinyMCE=i.tinymce=null}i.attachEvent("onunload",j)}l.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(k){k.remove()}return true;case"mceToggleEditor":if(!k){n.execCommand("mceAddControl",0,l);return true}if(k.isHidden()){k.show()}else{k.hide()}return true}if(n.activeEditor){return n.activeEditor.execCommand(o,m,l)}return false},execInstanceCommand:function(m,l,k,j){var i=this.get(m);if(i){return i.execCommand(l,k,j)}return false},triggerSave:function(){g(this.editors,function(i){i.save()})},addI18n:function(k,l){var i,j=this.i18n;if(!f.is(k,"string")){g(k,function(n,m){g(n,function(q,p){g(q,function(s,r){if(p==="common"){j[m+"."+r]=s}else{j[m+"."+p+"."+r]=s}})})})}else{g(l,function(n,m){j[k+"."+m]=n})}},_setActive:function(i){this.selectedInstance=this.activeEditor=i}});f.EditorManager.preInit()})(tinymce);var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(n){var o=n.DOM,k=n.dom.Event,f=n.extend,l=n.util.Dispatcher;var j=n.each,a=n.isGecko,b=n.isIE,e=n.isWebKit;var d=n.is,h=n.ThemeManager,c=n.PluginManager,i=n.EditorManager;var p=n.inArray,m=n.grep,g=n.explode;n.create("tinymce.Editor",{Editor:function(u,r){var q=this;q.id=q.editorId=u;q.execCommands={};q.queryStateCommands={};q.queryValueCommands={};q.plugins={};j(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){q[s]=new l(q)});q.settings=r=f({id:u,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:n.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',visual_table_class:"mceItemTable",visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,removeformat_selector:"span,b,strong,em,i,font,u,strike"},r);q.documentBaseURI=new n.util.URI(r.document_base_url||n.documentBaseURL,{base_uri:tinyMCE.baseURI});q.baseURI=i.baseURI;q.execCallback("setup",q)},render:function(u){var v=this,w=v.settings,x=v.id,q=n.ScriptLoader;if(!k.domLoaded){k.add(document,"init",function(){v.render()});return}if(!u){w.strict_loading_mode=1;tinyMCE.settings=w}if(!v.getElement()){return}if(w.strict_loading_mode){q.settings.strict_mode=w.strict_loading_mode;n.DOM.settings.strict=1}if(!/TEXTAREA|INPUT/i.test(v.getElement().nodeName)&&w.hidden_input&&o.getParent(x,"form")){o.insertAfter(o.create("input",{type:"hidden",name:x}),x)}if(n.WindowManager){v.windowManager=new n.WindowManager(v)}if(w.encoding=="xml"){v.onGetContent.add(function(s,t){if(t.save){t.content=o.encode(t.content)}})}if(w.add_form_submit_trigger){v.onSubmit.addToTop(function(){if(v.initialized){v.save();v.isNotDirty=1}})}if(w.add_unload_trigger){v._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(v.initialized&&!v.destroyed&&!v.isHidden()){v.save({format:"raw",no_events:true})}})}n.addUnload(v.destroy,v);if(w.submit_patch){v.onBeforeRenderUI.add(function(){var s=v.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){v.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){i.triggerSave();v.isNotDirty=1;return v.formElement._mceOldSubmit(v.formElement)}}s=null})}function r(){if(w.language){q.add(n.baseURL+"/langs/"+w.language+".js")}if(w.theme&&w.theme.charAt(0)!="-"&&!h.urls[w.theme]){h.load(w.theme,"themes/"+w.theme+"/editor_template"+n.suffix+".js")}j(g(w.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(!e&&s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+n.suffix+".js")}});q.loadQueue(function(){if(!v.removed){v.init()}})}if(w.plugins.indexOf("compat2x")!=-1){c.load("compat2x","plugins/compat2x/editor_plugin"+n.suffix+".js");q.loadQueue(r)}else{r()}},init:function(){var v,F=this,G=F.settings,C,z,B=F.getElement(),r,q,D,y,A,E;i.add(F);if(G.theme){G.theme=G.theme.replace(/-/,"");r=h.get(G.theme);F.theme=new r();if(F.theme.init&&G.init_theme){F.theme.init(F,h.urls[G.theme]||n.documentBaseURL.replace(/\/$/,""))}}j(g(G.plugins.replace(/\-/g,"")),function(w){var H=c.get(w),t=c.urls[w]||n.documentBaseURL.replace(/\/$/,""),s;if(H){s=new H(F,t);F.plugins[w]=s;if(s.init){s.init(F,t)}}});if(G.popup_css!==false){if(G.popup_css){G.popup_css=F.documentBaseURI.toAbsolute(G.popup_css)}else{G.popup_css=F.baseURI.toAbsolute("themes/"+G.theme+"/skins/"+G.skin+"/dialog.css")}}if(G.popup_css_add){G.popup_css+=","+F.documentBaseURI.toAbsolute(G.popup_css_add)}F.controlManager=new n.ControlManager(F);F.undoManager=new n.UndoManager(F);F.undoManager.onAdd.add(function(t,s){if(!s.initial){return F.onChange.dispatch(F,s,t)}});F.undoManager.onUndo.add(function(t,s){return F.onUndo.dispatch(F,s,t)});F.undoManager.onRedo.add(function(t,s){return F.onRedo.dispatch(F,s,t)});if(G.custom_undo_redo){F.onExecCommand.add(function(t,w,u,H,s){if(w!="Undo"&&w!="Redo"&&w!="mceRepaint"&&(!s||!s.skip_undo)){F.undoManager.add()}})}F.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){F.nodeChanged()}});if(a){function x(s,t){if(!t||!t.initial){F.execCommand("mceRepaint")}}F.onUndo.add(x);F.onRedo.add(x);F.onSetContent.add(x)}F.onBeforeRenderUI.dispatch(F,F.controlManager);if(G.render_ui){C=G.width||B.style.width||B.offsetWidth;z=G.height||B.style.height||B.offsetHeight;F.orgDisplay=B.style.display;E=/^[0-9\.]+(|px)$/i;if(E.test(""+C)){C=Math.max(parseInt(C)+(r.deltaWidth||0),100)}if(E.test(""+z)){z=Math.max(parseInt(z)+(r.deltaHeight||0),100)}r=F.theme.renderUI({targetNode:B,width:C,height:z,deltaWidth:G.delta_width,deltaHeight:G.delta_height});F.editorContainer=r.editorContainer}o.setStyles(r.sizeContainer||r.editorContainer,{width:C,height:z});z=(r.iframeHeight||z)+(typeof(z)=="number"?(r.deltaHeight||0):"");if(z<100){z=100}F.iframeHTML=G.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+F.documentBaseURI.getURI()+'" />';F.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(n.relaxedDomain){F.iframeHTML+='<script type="text/javascript">document.domain = "'+n.relaxedDomain+'";<\/script>'}y=G.body_id||"tinymce";if(y.indexOf("=")!=-1){y=F.getParam("body_id","","hash");y=y[F.id]||y}A=G.body_class||"";if(A.indexOf("=")!=-1){A=F.getParam("body_class","","hash");A=A[F.id]||""}F.iframeHTML+='</head><body id="'+y+'" class="mceContentBody '+A+'"></body></html>';if(n.relaxedDomain){if(b||(n.isOpera&&parseFloat(opera.version())>=9.5)){D='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+F.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(n.isOpera){D='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}v=o.add(r.iframeContainer,"iframe",{id:F.id+"_ifr",src:D||'javascript:""',frameBorder:"0",style:{width:"100%",height:z}});F.contentAreaContainer=r.iframeContainer;o.get(r.editorContainer).style.display=F.orgDisplay;o.get(F.id).style.display="none";if(!b||!n.relaxedDomain){F.setupIframe()}B=v=r=null},setupIframe:function(){var z=this,A=z.settings,u=o.get(z.id),v=z.getDoc(),r,x;if(!b||!n.relaxedDomain){v.open();v.write(z.iframeHTML);v.close()}if(!b){try{if(!A.readonly){v.designMode="On"}}catch(w){}}if(b){x=z.getBody();o.hide(x);if(!A.readonly){x.contentEditable=true}o.show(x)}z.dom=new n.DOM.DOMUtils(z.getDoc(),{keep_values:true,url_converter:z.convertURL,url_converter_scope:z,hex_colors:A.force_hex_style_colors,class_filter:A.class_filter,update_styles:1,fix_ie_paragraphs:1});z.serializer=new n.dom.Serializer({entity_encoding:A.entity_encoding,entities:A.entities,valid_elements:A.verify_html===false?"*[*]":A.valid_elements,extended_valid_elements:A.extended_valid_elements,valid_child_elements:A.valid_child_elements,invalid_elements:A.invalid_elements,fix_table_elements:A.fix_table_elements,fix_list_elements:A.fix_list_elements,fix_content_duplication:A.fix_content_duplication,convert_fonts_to_spans:A.convert_fonts_to_spans,font_size_classes:A.font_size_classes,font_size_style_values:A.font_size_style_values,apply_source_formatting:A.apply_source_formatting,remove_linebreaks:A.remove_linebreaks,element_format:A.element_format,dom:z.dom});z.selection=new n.dom.Selection(z.dom,z.getWin(),z.serializer);z.forceBlocks=new n.ForceBlocks(z,{forced_root_block:A.forced_root_block});z.editorCommands=new n.EditorCommands(z);z.serializer.onPreProcess.add(function(s,t){return z.onPreProcess.dispatch(z,t,s)});z.serializer.onPostProcess.add(function(s,t){return z.onPostProcess.dispatch(z,t,s)});z.onPreInit.dispatch(z);if(!A.gecko_spellcheck){z.getBody().spellcheck=0}if(!A.readonly){z._addEvents()}z.controlManager.onPostRender.dispatch(z,z.controlManager);z.onPostRender.dispatch(z);if(A.directionality){z.getBody().dir=A.directionality}if(A.nowrap){z.getBody().style.whiteSpace="nowrap"}if(A.auto_resize){z.onNodeChange.add(z.resizeToContent,z)}if(A.custom_elements){function y(s,t){j(g(A.custom_elements),function(B){var C;if(B.indexOf("~")===0){B=B.substring(1);C="span"}else{C="div"}t.content=t.content.replace(new RegExp("<("+B+")([^>]*)>","g"),"<"+C+' mce_name="$1"$2>');t.content=t.content.replace(new RegExp("</("+B+")>","g"),"</"+C+">")})}z.onBeforeSetContent.add(y);z.onPostProcess.add(function(s,t){if(t.set){y(s,t)}})}if(A.handle_node_change_callback){z.onNodeChange.add(function(t,s,B){z.execCallback("handle_node_change_callback",z.id,B,-1,-1,true,z.selection.isCollapsed())})}if(A.save_callback){z.onSaveContent.add(function(s,B){var t=z.execCallback("save_callback",z.id,B.content,z.getBody());if(t){B.content=t}})}if(A.onchange_callback){z.onChange.add(function(t,s){z.execCallback("onchange_callback",z,s)})}if(A.convert_newlines_to_brs){z.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(A.fix_nesting&&b){z.onBeforeSetContent.add(function(s,t){t.content=z._fixNesting(t.content)})}if(A.preformatted){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(A.verify_css_classes){z.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!z.classesRE){t=z.dom.getClasses();if(t.length>0){C="";j(t,function(s){C+=(C?"|":"")+s["class"]});z.classesRE=new RegExp("("+C+")","gi")}}return !z.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||z.classesRE.test(B)?B:""}return B}}if(A.convert_fonts_to_spans){z._convertFonts()}if(A.inline_styles){z._convertInlineElements()}if(A.cleanup_callback){z.onBeforeSetContent.add(function(s,t){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)});z.onPreProcess.add(function(s,t){if(t.set){z.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){z.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});z.onPostProcess.add(function(s,t){if(t.set){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=z.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(A.save_callback){z.onGetContent.add(function(s,t){if(t.save){t.content=z.execCallback("save_callback",z.id,t.content,z.getBody())}})}if(A.handle_event_callback){z.onEvent.add(function(s,t,B){if(z.execCallback("handle_event_callback",t,s,B)===false){k.cancel(t)}})}z.onSetContent.add(function(){z.addVisual(z.getBody())});if(A.padd_empty_editor){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function q(s,t){j(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{mce_bogus:1})}})}z.onExecCommand.add(function(s,t){if(t==="CreateLink"){q(s)}});z.onSetContent.add(z.selection.onSetContent.add(q));if(!A.readonly){try{v.designMode="Off";v.designMode="On"}catch(w){}}}setTimeout(function(){if(z.removed){return}z.load({initial:true,format:(A.cleanup_on_startup?"html":"raw")});z.startContent=z.getContent({format:"raw"});z.undoManager.add({initial:true});z.initialized=true;z.onInit.dispatch(z);z.execCallback("setupcontent_callback",z.id,z.getBody(),z.getDoc());z.execCallback("init_instance_callback",z);z.focus(true);z.nodeChanged({initial:1});if(A.content_css){n.each(g(A.content_css),function(s){z.dom.loadCSS(z.documentBaseURI.toAbsolute(s))})}if(A.auto_focus){setTimeout(function(){var s=i.get(A.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);u=null},focus:function(r){var u,q=this,s=q.settings.content_editable;if(!r){if(!s&&(!b||q.selection.getNode().ownerDocument!=q.getDoc())){q.getWin().focus()}}if(i.activeEditor!=q){if((u=i.activeEditor)!=null){u.onDeactivate.dispatch(u,q)}q.onActivate.dispatch(q,u)}i._setActive(q)},execCallback:function(v){var q=this,u=q.settings[v],r;if(!u){return}if(q.callbackLookup&&(r=q.callbackLookup[v])){u=r.func;r=r.scope}if(d(u,"string")){r=u.replace(/\.\w+$/,"");r=r?n.resolve(r):0;u=n.resolve(u);q.callbackLookup=q.callbackLookup||{};q.callbackLookup[v]={func:u,scope:r}}return u.apply(r||q,Array.prototype.slice.call(arguments,1))},translate:function(q){var t=this.settings.language||"en",r=i.i18n;if(!q){return""}return r[t+"."+q]||q.replace(/{\#([^}]+)\}/g,function(u,s){return r[t+"."+s]||"{#"+s+"}"})},getLang:function(r,q){return i.i18n[(this.settings.language||"en")+"."+r]||(d(q)?q:"{#"+r+"}")},getParam:function(w,s,q){var t=n.trim,r=d(this.settings[w])?this.settings[w]:s,u;if(q==="hash"){u={};if(d(r,"string")){j(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(x){x=x.split("=");if(x.length>1){u[t(x[0])]=t(x[1])}else{u[t(x[0])]=t(x)}})}else{u=r}return u}return r},nodeChanged:function(u){var q=this,r=q.selection,v=r.getNode()||q.getBody();if(q.initialized){q.onNodeChange.dispatch(q,u?u.controlManager||q.controlManager:q.controlManager,b&&v.ownerDocument!=q.getDoc()?q.getBody():v,r.isCollapsed(),u)}},addButton:function(u,r){var q=this;q.buttons=q.buttons||{};q.buttons[u]=r},addCommand:function(t,r,q){this.execCommands[t]={func:r,scope:q||this}},addQueryStateHandler:function(t,r,q){this.queryStateCommands[t]={func:r,scope:q||this}},addQueryValueHandler:function(t,r,q){this.queryValueCommands[t]={func:r,scope:q||this}},addShortcut:function(s,v,q,u){var r=this,w;if(!r.settings.custom_shortcuts){return false}r.shortcuts=r.shortcuts||{};if(d(q,"string")){w=q;q=function(){r.execCommand(w,false,null)}}if(d(q,"object")){w=q;q=function(){r.execCommand(w[0],w[1],w[2])}}j(g(s),function(t){var x={func:q,scope:u||this,desc:v,alt:false,ctrl:false,shift:false};j(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});r.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,w,z,q){var u=this,v=0,y,r;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!q||!q.skip_focus)){u.focus()}y={};u.onBeforeExecCommand.dispatch(u,x,w,z,y);if(y.terminate){return false}if(u.execCallback("execcommand_callback",u.id,u.selection.getNode(),x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(y=u.execCommands[x]){r=y.func.call(y.scope,w,z);if(r!==true){u.onExecCommand.dispatch(u,x,w,z,q);return r}}j(u.plugins,function(s){if(s.execCommand&&s.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);v=1;return false}});if(v){return true}if(u.theme&&u.theme.execCommand&&u.theme.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(n.GlobalCommands.execCommand(u,x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(u.editorCommands.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}u.getDoc().execCommand(x,w,z);u.onExecCommand.dispatch(u,x,w,z,q)},queryCommandState:function(w){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryStateCommands[w]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandState(w);if(v!==-1){return v}try{return this.getDoc().queryCommandState(w)}catch(q){}},queryCommandValue:function(w){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryValueCommands[w]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandValue(w);if(d(v)){return v}try{return this.getDoc().queryCommandValue(w)}catch(q){}},show:function(){var q=this;o.show(q.getContainer());o.hide(q.id);q.load()},hide:function(){var q=this,r=q.getDoc();if(b&&r){r.execCommand("SelectAll")}q.save();o.hide(q.getContainer());o.setStyle(q.id,"display",q.orgDisplay)},isHidden:function(){return !o.isHidden(this.id)},setProgressState:function(q,r,s){this.onSetProgressState.dispatch(this,q,r,s);return q},resizeToContent:function(){var q=this;o.setStyle(q.id+"_ifr","height",q.getBody().scrollHeight)},load:function(u){var q=this,s=q.getElement(),r;if(s){u=u||{};u.load=true;r=q.setContent(d(s.value)?s.value:s.innerHTML,u);u.element=s;if(!u.no_events){q.onLoadContent.dispatch(q,u)}u.element=s=null;return r}},save:function(v){var q=this,u=q.getElement(),r,s;if(!u||!q.initialized){return}v=v||{};v.save=true;if(!v.no_events){q.undoManager.typing=0;q.undoManager.add()}v.element=u;r=v.content=q.getContent(v);if(!v.no_events){q.onSaveContent.dispatch(q,v)}r=v.content;if(!/TEXTAREA|INPUT/i.test(u.nodeName)){u.innerHTML=r;if(s=o.getParent(q.id,"form")){j(s.elements,function(t){if(t.name==q.id){t.value=r;return false}})}}else{u.value=r}v.element=u=null;return r},setContent:function(r,s){var q=this;s=s||{};s.format=s.format||"html";s.set=true;s.content=r;if(!s.no_events){q.onBeforeSetContent.dispatch(q,s)}if(!n.isIE&&(r.length===0||/^\s+$/.test(r))){s.content=q.dom.setHTML(q.getBody(),'<br mce_bogus="1" />');s.format="raw"}s.content=q.dom.setHTML(q.getBody(),n.trim(s.content));if(s.format!="raw"&&q.settings.cleanup){s.getInner=true;s.content=q.dom.setHTML(q.getBody(),q.serializer.serialize(q.getBody(),s))}if(!s.no_events){q.onSetContent.dispatch(q,s)}return s.content},getContent:function(s){var q=this,r;s=s||{};s.format=s.format||"html";s.get=true;if(!s.no_events){q.onBeforeGetContent.dispatch(q,s)}if(s.format!="raw"&&q.settings.cleanup){s.getInner=true;r=q.serializer.serialize(q.getBody(),s)}else{r=q.getBody().innerHTML}r=r.replace(/^\s*|\s*$/g,"");s.content=r;if(!s.no_events){q.onGetContent.dispatch(q,s)}return s.content},isDirty:function(){var q=this;return n.trim(q.startContent)!=n.trim(q.getContent({format:"raw",no_events:1}))&&!q.isNotDirty},getContainer:function(){var q=this;if(!q.container){q.container=o.get(q.editorContainer||q.id+"_parent")}return q.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return o.get(this.settings.content_element||this.id)},getWin:function(){var q=this,r;if(!q.contentWindow){r=o.get(q.id+"_ifr");if(r){q.contentWindow=r.contentWindow}}return q.contentWindow},getDoc:function(){var r=this,q;if(!r.contentDocument){q=r.getWin();if(q){r.contentDocument=q.document}}return r.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(q,x,w){var r=this,v=r.settings;if(v.urlconverter_callback){return r.execCallback("urlconverter_callback",q,w,true,x)}if(!v.convert_urls||(w&&w.nodeName=="LINK")||q.indexOf("file:")===0){return q}if(v.relative_urls){return r.documentBaseURI.toRelative(q)}q=r.documentBaseURI.toAbsolute(q,v.remove_script_host);return q},addVisual:function(u){var q=this,r=q.settings;u=u||q.getBody();if(!d(q.hasVisual)){q.hasVisual=r.visual}j(q.dom.select("table,a",u),function(t){var s;switch(t.nodeName){case"TABLE":s=q.dom.getAttrib(t,"border");if(!s||s=="0"){if(q.hasVisual){q.dom.addClass(t,r.visual_table_class)}else{q.dom.removeClass(t,r.visual_table_class)}}return;case"A":s=q.dom.getAttrib(t,"name");if(s){if(q.hasVisual){q.dom.addClass(t,"mceItemAnchor")}else{q.dom.removeClass(t,"mceItemAnchor")}}return}});q.onVisualAid.dispatch(q,u,q.hasVisual)},remove:function(){var q=this,r=q.getContainer();q.removed=1;q.hide();q.execCallback("remove_instance_callback",q);q.onRemove.dispatch(q);q.onExecCommand.listeners=[];i.remove(q);o.remove(r)},destroy:function(r){var q=this;if(q.destroyed){return}if(!r){n.removeUnload(q.destroy);tinyMCE.onBeforeUnload.remove(q._beforeUnload);if(q.theme&&q.theme.destroy){q.theme.destroy()}q.controlManager.destroy();q.selection.destroy();q.dom.destroy();if(!q.settings.content_editable){k.clear(q.getWin());k.clear(q.getDoc())}k.clear(q.getBody());k.clear(q.formElement)}if(q.formElement){q.formElement.submit=q.formElement._mceOldSubmit;q.formElement._mceOldSubmit=null}q.contentAreaContainer=q.formElement=q.container=q.settings.content_element=q.bodyElement=q.contentDocument=q.contentWindow=null;if(q.selection){q.selection=q.selection.win=q.selection.dom=q.selection.dom.doc=null}q.destroyed=1},_addEvents:function(){var w=this,v,y=w.settings,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function u(t,A){var s=t.type;if(w.removed){return}if(w.onEvent.dispatch(w,t,A)!==false){w[x[t.fakeType||t.type]].dispatch(w,t,A)}}j(x,function(t,s){switch(s){case"contextmenu":if(n.isOpera){w.dom.bind(w.getBody(),"mousedown",function(A){if(A.ctrlKey){A.fakeType="contextmenu";u(A)}})}else{w.dom.bind(w.getBody(),s,u)}break;case"paste":w.dom.bind(w.getBody(),s,function(A){u(A)});break;case"submit":case"reset":w.dom.bind(w.getElement().form||o.getParent(w.id,"form"),s,u);break;default:w.dom.bind(y.content_editable?w.getBody():w.getDoc(),s,u)}});w.dom.bind(y.content_editable?w.getBody():(a?w.getDoc():w.getWin()),"focus",function(s){w.focus(true)});if(n.isGecko){w.dom.bind(w.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("mce_src"))){t.src=w.documentBaseURI.toAbsolute(s)}})}if(a){function q(){var B=this,D=B.getDoc(),C=B.settings;if(a&&!C.readonly){if(B._isHidden()){try{if(!C.content_editable){D.designMode="On"}}catch(A){}}try{D.execCommand("styleWithCSS",0,false)}catch(A){if(!B._isHidden()){try{D.execCommand("useCSS",0,true)}catch(A){}}}if(!C.table_inline_editing){try{D.execCommand("enableInlineTableEditing",false,false)}catch(A){}}if(!C.object_resizing){try{D.execCommand("enableObjectResizing",false,false)}catch(A){}}}}w.onBeforeExecCommand.add(q);w.onMouseDown.add(q)}w.onMouseUp.add(w.nodeChanged);w.onClick.add(w.nodeChanged);w.onKeyUp.add(function(s,t){var A=t.keyCode;if((A>=33&&A<=36)||(A>=37&&A<=40)||A==13||A==45||A==46||A==8||(n.isMac&&(A==91||A==93))||t.ctrlKey){w.nodeChanged()}});w.onReset.add(function(){w.setContent(w.startContent,{format:"raw"})});if(y.custom_shortcuts){if(y.custom_undo_redo_keyboard_shortcuts){w.addShortcut("ctrl+z",w.getLang("undo_desc"),"Undo");w.addShortcut("ctrl+y",w.getLang("redo_desc"),"Redo")}if(a){w.addShortcut("ctrl+b",w.getLang("bold_desc"),"Bold");w.addShortcut("ctrl+i",w.getLang("italic_desc"),"Italic");w.addShortcut("ctrl+u",w.getLang("underline_desc"),"Underline")}for(v=1;v<=6;v++){w.addShortcut("ctrl+"+v,"",["FormatBlock",false,"<h"+v+">"])}w.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);w.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);w.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function z(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}j(w.shortcuts,function(A){if(n.isMac&&A.ctrl!=t.metaKey){return}else{if(!n.isMac&&A.ctrl!=t.ctrlKey){return}}if(A.alt!=t.altKey){return}if(A.shift!=t.shiftKey){return}if(t.keyCode==A.keyCode||(t.charCode&&t.charCode==A.charCode)){s=A;return false}});return s}w.onKeyUp.add(function(s,t){var A=z(t);if(A){return k.cancel(t)}});w.onKeyPress.add(function(s,t){var A=z(t);if(A){return k.cancel(t)}});w.onKeyDown.add(function(s,t){var A=z(t);if(A){A.func.call(A.scope);return k.cancel(t)}})}if(n.isIE){w.dom.bind(w.getDoc(),"controlselect",function(A){var t=w.resizeInfo,s;A=A.target;if(A.nodeName!=="IMG"){return}if(t){w.dom.unbind(t.node,t.ev,t.cb)}if(!w.dom.hasClass(A,"mceItemNoResize")){ev="resizeend";s=w.dom.bind(A,ev,function(C){var B;C=C.target;if(B=w.dom.getStyle(C,"width")){w.dom.setAttrib(C,"width",B.replace(/[^0-9%]+/g,""));w.dom.setStyle(C,"width","")}if(B=w.dom.getStyle(C,"height")){w.dom.setAttrib(C,"height",B.replace(/[^0-9%]+/g,""));w.dom.setStyle(C,"height","")}})}else{ev="resizestart";s=w.dom.bind(A,"resizestart",k.cancel,k)}t=w.resizeInfo={node:A,ev:ev,cb:s}});w.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(w.selection.getRng().item){w.selection.getRng().item(0).removeNode();return k.cancel(t)}}})}if(n.isOpera){w.onClick.add(function(s,t){k.prevent(t)})}if(y.custom_undo_redo){function r(){w.undoManager.typing=0;w.undoManager.add()}if(n.isIE){w.dom.bind(w.getWin(),"blur",function(s){var t;if(w.selection){t=w.selection.getNode();if(!w.removed&&t.ownerDocument&&t.ownerDocument!=w.getDoc()){r()}}})}else{w.dom.bind(w.getDoc(),"blur",function(){if(w.selection&&!w.removed){r()}})}w.onMouseDown.add(r);w.onKeyUp.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){w.undoManager.typing=0;w.undoManager.add()}});w.onKeyDown.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45){if(w.undoManager.typing){w.undoManager.add();w.undoManager.typing=0}return}if(!w.undoManager.typing){w.undoManager.add();w.undoManager.typing=1}})}},_convertInlineElements:function(){var z=this,B=z.settings,r=z.dom,y,w,u,A,q;function x(s,t){if(!B.inline_styles){return}if(t.get){j(z.dom.select("table,u,strike",t.node),function(v){switch(v.nodeName){case"TABLE":if(y=r.getAttrib(v,"height")){r.setStyle(v,"height",y);r.setAttrib(v,"height","")}break;case"U":case"STRIKE":v.style.textDecoration=v.nodeName=="U"?"underline":"line-through";r.setAttrib(v,"mce_style","");r.setAttrib(v,"mce_name","span");break}})}else{if(t.set){j(z.dom.select("table,span",t.node).reverse(),function(v){if(v.nodeName=="TABLE"){if(y=r.getStyle(v,"height")){r.setAttrib(v,"height",y.replace(/[^0-9%]+/g,""))}}else{if(v.style.textDecoration=="underline"){u="u"}else{if(v.style.textDecoration=="line-through"){u="strike"}else{u=""}}if(u){v.style.textDecoration="";r.setAttrib(v,"mce_style","");w=r.create(u,{style:r.getAttrib(v,"style")});r.replace(w,v,1)}}})}}}z.onPreProcess.add(x);if(!B.cleanup_on_startup){z.onSetContent.add(function(s,t){if(t.initial){x(z,{node:z.getBody(),set:1})}})}},_convertFonts:function(){var w=this,x=w.settings,z=w.dom,v,r,q,u;if(!x.inline_styles){return}v=[8,10,12,14,18,24,36];r=["xx-small","x-small","small","medium","large","x-large","xx-large"];if(q=x.font_size_style_values){q=g(q)}if(u=x.font_size_classes){u=g(u)}function y(B){var C,A,t,s;if(!x.inline_styles){return}t=w.dom.select("font",B);for(s=t.length-1;s>=0;s--){C=t[s];A=z.create("span",{style:z.getAttrib(C,"style"),"class":z.getAttrib(C,"class")});z.setStyles(A,{fontFamily:z.getAttrib(C,"face"),color:z.getAttrib(C,"color"),backgroundColor:C.style.backgroundColor});if(C.size){if(q){z.setStyle(A,"fontSize",q[parseInt(C.size)-1])}else{z.setAttrib(A,"class",u[parseInt(C.size)-1])}}z.setAttrib(A,"mce_style","");z.replace(A,C,1)}}w.onPreProcess.add(function(s,t){if(t.get){y(t.node)}});w.onSetContent.add(function(s,t){if(t.initial){y(t.node)}})},_isHidden:function(){var q;if(!a){return 0}q=this.selection.getSel();return(!q||!q.rangeCount||q.rangeCount==0)},_fixNesting:function(r){var t=[],q;r=r.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(u,s,w){var v;if(s==="/"){if(!t.length){return""}if(w!==t[t.length-1].tag){for(q=t.length-1;q>=0;q--){if(t[q].tag===w){t[q].close=1;break}}return""}else{t.pop();if(t.length&&t[t.length-1].close){u=u+"</"+t[t.length-1].tag+">";t.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(w)){return u}if(/\/>$/.test(u)){return u}t.push({tag:w})}return u});for(q=t.length-1;q>=0;q--){r+="</"+t[q].tag+">"}return r}})})(tinymce);(function(d){var f=d.each,c=d.isIE,a=d.isGecko,b=d.isOpera,e=d.isWebKit;d.create("tinymce.EditorCommands",{EditorCommands:function(g){this.editor=g},execCommand:function(k,j,l){var h=this,g=h.editor,i;switch(k){case"mceResetDesignMode":case"mceBeginUndoLevel":return true;case"unlink":h.UnLink();return true;case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":h.mceJustify(k,k.substring(7).toLowerCase());return true;default:i=this[k];if(i){i.call(this,j,l);return true}}return false},Indent:function(){var g=this.editor,l=g.dom,j=g.selection,k,h,i;h=g.settings.indentation;i=/[a-z%]+$/i.exec(h);h=parseInt(h);if(g.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){f(j.getSelectedBlocks(),function(m){l.setStyle(m,"paddingLeft",(parseInt(m.style.paddingLeft||0)+h)+i)});return}g.getDoc().execCommand("Indent",false,null);if(c){l.getParent(j.getNode(),function(m){if(m.nodeName=="BLOCKQUOTE"){m.dir=m.style.cssText=""}})}},Outdent:function(){var h=this.editor,m=h.dom,k=h.selection,l,g,i,j;i=h.settings.indentation;j=/[a-z%]+$/i.exec(i);i=parseInt(i);if(h.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){f(k.getSelectedBlocks(),function(n){g=Math.max(0,parseInt(n.style.paddingLeft||0)-i);m.setStyle(n,"paddingLeft",g?g+j:"")});return}h.getDoc().execCommand("Outdent",false,null)},mceSetContent:function(h,g){this.editor.setContent(g)},mceToggleVisualAid:function(){var g=this.editor;g.hasVisual=!g.hasVisual;g.addVisual()},mceReplaceContent:function(h,g){var i=this.editor.selection;i.setContent(g.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(i,h){var g=this.editor,j=g.selection,k=g.dom.getParent(j.getNode(),"a");if(d.is(h,"string")){h={href:h}}function l(m){f(h,function(o,n){g.dom.setAttrib(m,n,o)})}if(!k){g.execCommand("CreateLink",false,"javascript:mctmp(0);");f(g.dom.select("a[href=javascript:mctmp(0);]"),function(m){l(m)})}else{if(h.href){l(k)}else{g.dom.remove(k,1)}}},UnLink:function(){var g=this.editor,h=g.selection;if(h.isCollapsed()){h.select(h.getNode())}g.getDoc().execCommand("unlink",false,null);h.collapse(0)},FontName:function(i,h){var j=this,g=j.editor,k=g.selection,l;if(!h){if(k.isCollapsed()){k.select(k.getNode())}}else{if(g.settings.convert_fonts_to_spans){j._applyInlineStyle("span",{style:{fontFamily:h}})}else{g.getDoc().execCommand("FontName",false,h)}}},FontSize:function(j,i){var h=this.editor,l=h.settings,k,g;if(l.convert_fonts_to_spans&&i>=1&&i<=7){g=d.explode(l.font_size_style_values);k=d.explode(l.font_size_classes);if(k){i=k[i-1]||i}else{i=g[i-1]||i}}if(i>=1&&i<=7){h.getDoc().execCommand("FontSize",false,i)}else{this._applyInlineStyle("span",{style:{fontSize:i}})}},queryCommandValue:function(h){var g=this["queryValue"+h];if(g){return g.call(this,h)}return false},queryCommandState:function(h){var g;switch(h){case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":return this.queryStateJustify(h,h.substring(7).toLowerCase());default:if(g=this["queryState"+h]){return g.call(this,h)}}return -1},_queryState:function(h){try{return this.editor.getDoc().queryCommandState(h)}catch(g){}},_queryVal:function(h){try{return this.editor.getDoc().queryCommandValue(h)}catch(g){}},queryValueFontSize:function(){var h=this.editor,g=0,i;if(i=h.dom.getParent(h.selection.getNode(),"span")){g=i.style.fontSize}if(!g&&(b||e)){if(i=h.dom.getParent(h.selection.getNode(),"font")){g=i.size}return g}return g||this._queryVal("FontSize")},queryValueFontName:function(){var h=this.editor,g=0,i;if(i=h.dom.getParent(h.selection.getNode(),"font")){g=i.face}if(i=h.dom.getParent(h.selection.getNode(),"span")){g=i.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}if(!g){g=this._queryVal("FontName")}return g},mceJustify:function(o,p){var k=this.editor,m=k.selection,g=m.getNode(),q=g.nodeName,h,j,i=k.dom,l;if(k.settings.inline_styles&&this.queryStateJustify(o,p)){l=1}h=i.getParent(g,k.dom.isBlock);if(q=="IMG"){if(p=="full"){return}if(l){if(p=="center"){i.setStyle(h||g.parentNode,"textAlign","")}i.setStyle(g,"float","");this.mceRepaint();return}if(p=="center"){if(h&&/^(TD|TH)$/.test(h.nodeName)){h=0}if(!h||h.childNodes.length>1){j=i.create("p");j.appendChild(g.cloneNode(false));if(h){i.insertAfter(j,h)}else{i.insertAfter(j,g)}i.remove(g);g=j.firstChild;h=j}i.setStyle(h,"textAlign",p);i.setStyle(g,"float","")}else{i.setStyle(g,"float",p);i.setStyle(h||g.parentNode,"textAlign","")}this.mceRepaint();return}if(k.settings.inline_styles&&k.settings.forced_root_block){if(l){p=""}f(m.getSelectedBlocks(i.getParent(m.getStart(),i.isBlock),i.getParent(m.getEnd(),i.isBlock)),function(n){i.setAttrib(n,"align","");i.setStyle(n,"textAlign",p=="full"?"justify":p)});return}else{if(!l){k.getDoc().execCommand(o,false,null)}}if(k.settings.inline_styles){if(l){i.getParent(k.selection.getNode(),function(r){if(r.style&&r.style.textAlign){i.setStyle(r,"textAlign","")}});return}f(i.select("*"),function(s){var r=s.align;if(r){if(r=="full"){r="justify"}i.setStyle(s,"textAlign",r);i.setAttrib(s,"align","")}})}},mceSetCSSClass:function(h,g){this.mceSetStyleInfo(0,{command:"setattrib",name:"class",value:g})},getSelectedElement:function(){var w=this,o=w.editor,n=o.dom,s=o.selection,h=s.getRng(),l,k,u,p,j,g,q,i,x,v;if(s.isCollapsed()||h.item){return s.getNode()}v=o.settings.merge_styles_invalid_parents;if(d.is(v,"string")){v=new RegExp(v,"i")}if(c){l=h.duplicate();l.collapse(true);u=l.parentElement();k=h.duplicate();k.collapse(false);p=k.parentElement();if(u!=p){l.move("character",1);u=l.parentElement()}if(u==p){l=h.duplicate();l.moveToElementText(u);if(l.compareEndPoints("StartToStart",h)==0&&l.compareEndPoints("EndToEnd",h)==0){return v&&v.test(u.nodeName)?null:u}}}else{function m(r){return n.getParent(r,"*")}u=h.startContainer;p=h.endContainer;j=h.startOffset;g=h.endOffset;if(!h.collapsed){if(u==p){if(j-g<2){if(u.hasChildNodes()){i=u.childNodes[j];return v&&v.test(i.nodeName)?null:i}}}}if(u.nodeType!=3||p.nodeType!=3){return null}if(j==0){i=m(u);if(i&&i.firstChild!=u){i=null}}if(j==u.nodeValue.length){q=u.nextSibling;if(q&&q.nodeType==1){i=u.nextSibling}}if(g==0){q=p.previousSibling;if(q&&q.nodeType==1){x=q}}if(g==p.nodeValue.length){x=m(p);if(x&&x.lastChild!=p){x=null}}if(i==x){return v&&i&&v.test(i.nodeName)?null:i}}return null},mceSetStyleInfo:function(n,m){var q=this,h=q.editor,j=h.getDoc(),g=h.dom,i,k,r=h.selection,p=m.wrapper||"span",k=r.getBookmark(),o;function l(t,s){if(t.nodeType==1){switch(m.command){case"setattrib":return g.setAttrib(t,m.name,m.value);case"setstyle":return g.setStyle(t,m.name,m.value);case"removeformat":return g.setAttrib(t,"class","")}}}o=h.settings.merge_styles_invalid_parents;if(d.is(o,"string")){o=new RegExp(o,"i")}if((i=q.getSelectedElement())&&!h.settings.force_span_wrappers){l(i,1)}else{j.execCommand("FontName",false,"__");f(g.select("span,font"),function(u){var s,t;if(g.getAttrib(u,"face")=="__"||u.style.fontFamily==="__"){s=g.create(p,{mce_new:"1"});l(s);f(u.childNodes,function(v){s.appendChild(v.cloneNode(true))});g.replace(s,u)}})}f(g.select(p).reverse(),function(t){var s=t.parentNode;if(!g.getAttrib(t,"mce_new")){s=g.getParent(t,"*[mce_new]");if(s){g.remove(t,1)}}});f(g.select(p).reverse(),function(t){var s=t.parentNode;if(!s||!g.getAttrib(t,"mce_new")){return}if(h.settings.force_span_wrappers&&s.nodeName!="SPAN"){return}if(s.nodeName==p.toUpperCase()&&s.childNodes.length==1){return g.remove(s,1)}if(t.nodeType==1&&(!o||!o.test(s.nodeName))&&s.childNodes.length==1){l(s);g.setAttrib(t,"class","")}});f(g.select(p).reverse(),function(s){if(g.getAttrib(s,"mce_new")||(g.getAttribs(s).length<=1&&s.className==="")){if(!g.getAttrib(s,"class")&&!g.getAttrib(s,"style")){return g.remove(s,1)}g.setAttrib(s,"mce_new","")}});r.moveToBookmark(k)},queryStateJustify:function(k,h){var g=this.editor,j=g.selection.getNode(),i=g.dom;if(j&&j.nodeName=="IMG"){if(i.getStyle(j,"float")==h){return 1}return j.parentNode.style.textAlign==h}j=i.getParent(g.selection.getStart(),function(l){return l.nodeType==1&&l.style.textAlign});if(h=="full"){h="justify"}if(g.settings.inline_styles){return(j&&j.style.textAlign==h)}return this._queryState(k)},ForeColor:function(i,h){var g=this.editor;if(g.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{color:h}});return}else{g.getDoc().execCommand("ForeColor",false,h)}},HiliteColor:function(i,k){var h=this,g=h.editor,j=g.getDoc();if(g.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{backgroundColor:k}});return}function l(n){if(!a){return}try{j.execCommand("styleWithCSS",0,n)}catch(m){j.execCommand("useCSS",0,!n)}}if(a||b){l(true);j.execCommand("hilitecolor",false,k);l(false)}else{j.execCommand("BackColor",false,k)}},FormatBlock:function(n,h){var o=this,l=o.editor,p=l.selection,j=l.dom,g,k,m;function i(q){return/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(q.nodeName)}g=j.getParent(p.getNode(),function(q){return i(q)});if(g){if((c&&i(g.parentNode))||g.nodeName=="DIV"){k=l.dom.create(h);f(j.getAttribs(g),function(q){j.setAttrib(k,q.nodeName,j.getAttrib(g,q.nodeName))});m=p.getBookmark();j.replace(k,g,1);p.moveToBookmark(m);l.nodeChanged();return}}h=l.settings.forced_root_block?(h||"<p>"):h;if(h.indexOf("<")==-1){h="<"+h+">"}if(d.isGecko){h=h.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,"$1")}l.getDoc().execCommand("FormatBlock",false,h)},mceCleanup:function(){var h=this.editor,i=h.selection,g=i.getBookmark();h.setContent(h.getContent());i.moveToBookmark(g)},mceRemoveNode:function(j,k){var h=this.editor,i=h.selection,g,l=k||i.getNode();if(l==h.getBody()){return}g=i.getBookmark();h.dom.remove(l,1);i.moveToBookmark(g);h.nodeChanged()},mceSelectNodeDepth:function(i,j){var g=this.editor,h=g.selection,k=0;g.dom.getParent(h.getNode(),function(l){if(l.nodeType==1&&k++==j){h.select(l);g.nodeChanged();return false}},g.getBody())},mceSelectNode:function(h,g){this.editor.selection.select(g)},mceInsertContent:function(g,h){this.editor.selection.setContent(h)},mceInsertRawHTML:function(h,i){var g=this.editor;g.selection.setContent("tiny_mce_marker");g.setContent(g.getContent().replace(/tiny_mce_marker/g,i))},mceRepaint:function(){var i,g,j=this.editor;if(d.isGecko){try{i=j.selection;g=i.getBookmark(true);if(i.getSel()){i.getSel().selectAllChildren(j.getBody())}i.collapse(true);i.moveToBookmark(g)}catch(h){}}},queryStateUnderline:function(){var g=this.editor,h=g.selection.getNode();if(h&&h.nodeName=="A"){return false}return this._queryState("Underline")},queryStateOutdent:function(){var g=this.editor,h;if(g.settings.inline_styles){if((h=g.dom.getParent(g.selection.getStart(),g.dom.isBlock))&&parseInt(h.style.paddingLeft)>0){return true}if((h=g.dom.getParent(g.selection.getEnd(),g.dom.isBlock))&&parseInt(h.style.paddingLeft)>0){return true}}return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList()||(!g.settings.inline_styles&&!!g.dom.getParent(g.selection.getNode(),"BLOCKQUOTE"))},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(g){return g.nodeName==="BLOCKQUOTE"})},_applyInlineStyle:function(o,j,m){var q=this,n=q.editor,l=n.dom,i,p={},k,r;o=o.toUpperCase();if(m&&m.check_classes&&j["class"]){m.check_classes.push(j["class"])}function h(){f(l.select(o).reverse(),function(t){var s=0;f(l.getAttribs(t),function(u){if(u.nodeName.substring(0,1)!="_"&&l.getAttrib(t,u.nodeName)!=""){s++}});if(s==0){l.remove(t,1)}})}function g(){var s;f(l.select("span,font"),function(t){if(t.style.fontFamily=="mceinline"||t.face=="mceinline"){if(!s){s=n.selection.getBookmark()}j._mce_new="1";l.replace(l.create(o,j),t,1)}});f(l.select(o+"[_mce_new]"),function(u){function t(v){if(v.nodeType==1){f(j.style,function(x,w){l.setStyle(v,w,"")});if(j["class"]&&v.className&&m){f(m.check_classes,function(w){if(l.hasClass(v,w)){l.removeClass(v,w)}})}}}f(l.select(o,u),t);if(u.parentNode&&u.parentNode.nodeType==1&&u.parentNode.childNodes.length==1){t(u.parentNode)}l.getParent(u.parentNode,function(v){if(v.nodeType==1){if(j.style){f(j.style,function(y,x){var w;if(!p[x]&&(w=l.getStyle(v,x))){if(w===y){l.setStyle(u,x,"")}p[x]=1}})}if(j["class"]&&v.className&&m){f(m.check_classes,function(w){if(l.hasClass(v,w)){l.removeClass(u,w)}})}}return false});u.removeAttribute("_mce_new")});h();n.selection.moveToBookmark(s);return !!s}n.focus();n.getDoc().execCommand("FontName",false,"mceinline");g();if(k=q._applyInlineStyle.keyhandler){n.onKeyUp.remove(k);n.onKeyPress.remove(k);n.onKeyDown.remove(k);n.onSetContent.remove(q._applyInlineStyle.chandler)}if(n.selection.isCollapsed()){if(!c){f(l.getParents(n.selection.getNode(),"span"),function(s){f(j.style,function(u,t){var w;if(w=l.getStyle(s,t)){if(w==u){l.setStyle(s,t,"");r=2;return false}r=1;return false}});if(r){return false}});if(r==2){i=n.selection.getBookmark();h();n.selection.moveToBookmark(i);window.setTimeout(function(){n.nodeChanged()},1);return}}q._pendingStyles=d.extend(q._pendingStyles||{},j.style);q._applyInlineStyle.chandler=n.onSetContent.add(function(){delete q._pendingStyles});q._applyInlineStyle.keyhandler=k=function(s){if(q._pendingStyles){j.style=q._pendingStyles;delete q._pendingStyles}if(g()){n.onKeyDown.remove(q._applyInlineStyle.keyhandler);n.onKeyPress.remove(q._applyInlineStyle.keyhandler)}if(s.type=="keyup"){n.onKeyUp.remove(q._applyInlineStyle.keyhandler)}};n.onKeyDown.add(k);n.onKeyPress.add(k);n.onKeyUp.add(k)}else{q._pendingStyles=0}}})})(tinymce);(function(a){a.create("tinymce.UndoManager",{index:0,data:null,typing:0,UndoManager:function(c){var d=this,b=a.util.Dispatcher;d.editor=c;d.data=[];d.onAdd=new b(this);d.onUndo=new b(this);d.onRedo=new b(this)},add:function(d){var g=this,f,e=g.editor,c,h=e.settings,j;d=d||{};d.content=d.content||e.getContent({format:"raw",no_events:1});d.content=d.content.replace(/^\s*|\s*$/g,"");j=g.data[g.index>0&&(g.index==0||g.index==g.data.length)?g.index-1:g.index];if(!d.initial&&j&&d.content==j.content){return null}if(h.custom_undo_redo_levels){if(g.data.length>h.custom_undo_redo_levels){for(f=0;f<g.data.length-1;f++){g.data[f]=g.data[f+1]}g.data.length--;g.index=g.data.length}}if(h.custom_undo_redo_restore_selection&&!d.initial){d.bookmark=c=d.bookmark||e.selection.getBookmark()}if(g.index<g.data.length){g.index++}if(g.data.length===0&&!d.initial){return null}g.data.length=g.index+1;g.data[g.index++]=d;if(d.initial){g.index=0}if(g.data.length==2&&g.data[0].initial){g.data[0].bookmark=c}g.onAdd.dispatch(g,d);e.isNotDirty=0;return d},undo:function(){var e=this,c=e.editor,b=b,d;if(e.typing){e.add();e.typing=0}if(e.index>0){if(e.index==e.data.length&&e.index>1){d=e.index;e.typing=0;if(!e.add()){e.index=d}--e.index}b=e.data[--e.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);e.onUndo.dispatch(e,b)}return b},redo:function(){var d=this,c=d.editor,b=null;if(d.index<d.data.length-1){b=d.data[++d.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);d.onRedo.dispatch(d,b)}return b},clear:function(){var b=this;b.data=[];b.index=0;b.typing=0;b.add({initial:true})},hasUndo:function(){return this.index!=0||this.typing},hasRedo:function(){return this.index<this.data.length-1}})})(tinymce);(function(e){var b,d,a,c,f,h;b=e.dom.Event;d=e.isIE;a=e.isGecko;c=e.isOpera;f=e.each;h=e.extend;function g(i){i=i.innerHTML;i=i.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");i=i.replace(/<[^>]+>/g,"");return i.replace(/[ \t\r\n]+/g,"")==""}e.create("tinymce.ForceBlocks",{ForceBlocks:function(j){var k=this,l=j.settings,m;k.editor=j;k.dom=j.dom;m=(l.forced_root_block||"p").toLowerCase();l.element=m.toUpperCase();j.onPreInit.add(k.setup,k);k.reOpera=new RegExp("(\\u00a0| | )</"+m+">","gi");k.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,m),"gi");k.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,m),"gi");k.reNbsp2BR2=new RegExp("<%p()([^>]+)>( | )<\\/%p>|<%p>( | )<\\/%p>".replace(/%p/g,m),"gi");k.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,m),"gi");function i(n,p){if(c){p.content=p.content.replace(k.reOpera,"</"+m+">")}p.content=p.content.replace(k.rePadd,"<"+m+"$1$2$3$4$5$6>\u00a0</"+m+">");if(!d&&!c&&p.set){p.content=p.content.replace(k.reNbsp2BR1,"<"+m+"$1$2><br /></"+m+">");p.content=p.content.replace(k.reNbsp2BR2,"<"+m+"$1$2><br /></"+m+">")}else{p.content=p.content.replace(k.reBR2Nbsp,"<"+m+"$1$2>\u00a0</"+m+">")}}j.onBeforeSetContent.add(i);j.onPostProcess.add(i);if(l.forced_root_block){j.onInit.add(k.forceRoots,k);j.onSetContent.add(k.forceRoots,k);j.onBeforeGetContent.add(k.forceRoots,k)}},setup:function(){var j=this,i=j.editor,k=i.settings;if(k.forced_root_block){i.onKeyUp.add(j.forceRoots,j);i.onPreProcess.add(j.forceRoots,j)}if(k.force_br_newlines){if(d){i.onKeyPress.add(function(m,p){var q,o=m.selection;if(p.keyCode==13&&o.getNode().nodeName!="LI"){o.setContent('<br id="__" /> ',{format:"raw"});q=m.dom.get("__");q.removeAttribute("id");o.select(q);o.collapse();return b.cancel(p)}})}return}if(!d&&k.force_p_newlines){i.onKeyPress.add(function(m,n){if(n.keyCode==13&&!n.shiftKey){if(!j.insertPara(n)){b.cancel(n)}}});if(a){i.onKeyDown.add(function(m,n){if((n.keyCode==8||n.keyCode==46)&&!n.shiftKey){j.backspaceDelete(n,n.keyCode==8)}})}}function l(n,m){var o=i.dom.create(m);f(n.attributes,function(p){if(p.specified&&p.nodeValue){o.setAttribute(p.nodeName.toLowerCase(),p.nodeValue)}});f(n.childNodes,function(p){o.appendChild(p.cloneNode(true))});n.parentNode.replaceChild(o,n);return o}i.onPreProcess.add(function(m,n){f(m.dom.select("p,h1,h2,h3,h4,h5,h6,div",n.node),function(o){if(g(o)){f(m.dom.select("span,em,strong,b,i",n.node),function(p){if(!p.hasChildNodes()){p.appendChild(m.getDoc().createTextNode("\u00a0"));return false}})}})});if(d){if(k.element!="P"){i.onKeyPress.add(function(m,n){j.lastElm=m.selection.getNode().nodeName});i.onKeyUp.add(function(o,q){var s,p=o.selection,r=p.getNode(),m=o.getBody();if(m.childNodes.length===1&&r.nodeName=="P"){r=l(r,k.element);p.select(r);p.collapse();o.nodeChanged()}else{if(q.keyCode==13&&!q.shiftKey&&j.lastElm!="P"){s=o.dom.getParent(r,"p");if(s){l(s,k.element);o.nodeChanged()}}}})}}},find:function(o,k,l){var j=this.editor,i=j.getDoc().createTreeWalker(o,4,null,false),m=-1;while(o=i.nextNode()){m++;if(k==0&&o==l){return m}if(k==1&&m==l){return o}}return -1},forceRoots:function(p,D){var u=this,p=u.editor,H=p.getBody(),E=p.getDoc(),K=p.selection,v=K.getSel(),w=K.getRng(),I=-2,o,B,j,k,F=-16777215;var G,l,J,A,x,m=H.childNodes,z,y,q;for(z=m.length-1;z>=0;z--){G=m[z];if(G.nodeType==3||(!u.dom.isBlock(G)&&G.nodeType!=8)){if(!l){if(G.nodeType!=3||/[^\s]/g.test(G.nodeValue)){if(I==-2&&w){if(!d){if(w.startContainer.nodeType==1&&(y=w.startContainer.childNodes[w.startOffset])&&y.nodeType==1){q=y.getAttribute("id");y.setAttribute("id","__mce")}else{if(p.dom.getParent(w.startContainer,function(i){return i===H})){B=w.startOffset;j=w.endOffset;I=u.find(H,0,w.startContainer);o=u.find(H,0,w.endContainer)}}}else{k=E.body.createTextRange();k.moveToElementText(H);k.collapse(1);J=k.move("character",F)*-1;k=w.duplicate();k.collapse(1);A=k.move("character",F)*-1;k=w.duplicate();k.collapse(0);x=(k.move("character",F)*-1)-A;I=A-J;o=x}}l=p.dom.create(p.settings.forced_root_block);l.appendChild(G.cloneNode(1));G.parentNode.replaceChild(l,G)}}else{if(l.hasChildNodes()){l.insertBefore(G,l.firstChild)}else{l.appendChild(G)}}}else{l=null}}if(I!=-2){if(!d){l=H.getElementsByTagName(p.settings.element)[0];w=E.createRange();if(I!=-1){w.setStart(u.find(H,1,I),B)}else{w.setStart(l,0)}if(o!=-1){w.setEnd(u.find(H,1,o),j)}else{w.setEnd(l,0)}if(v){v.removeAllRanges();v.addRange(w)}}else{try{w=v.createRange();w.moveToElementText(H);w.collapse(1);w.moveStart("character",I);w.moveEnd("character",o);w.select()}catch(C){}}}else{if(!d&&(y=p.dom.get("__mce"))){if(q){y.setAttribute("id",q)}else{y.removeAttribute("id")}w=E.createRange();w.setStartBefore(y);w.setEndBefore(y);K.setRng(w)}}},getParentBlock:function(j){var i=this.dom;return i.getParent(j,i.isBlock)},insertPara:function(M){var A=this,o=A.editor,I=o.dom,N=o.getDoc(),R=o.settings,B=o.selection.getSel(),C=B.getRangeAt(0),Q=N.body;var F,G,D,K,J,l,j,m,q,i,x,P,k,p,E,H=I.getViewPort(o.getWin()),w,z,v;F=N.createRange();F.setStart(B.anchorNode,B.anchorOffset);F.collapse(true);G=N.createRange();G.setStart(B.focusNode,B.focusOffset);G.collapse(true);D=F.compareBoundaryPoints(F.START_TO_END,G)<0;K=D?B.anchorNode:B.focusNode;J=D?B.anchorOffset:B.focusOffset;l=D?B.focusNode:B.anchorNode;j=D?B.focusOffset:B.anchorOffset;if(K===l&&/^(TD|TH)$/.test(K.nodeName)){if(K.firstChild.nodeName=="BR"){I.remove(K.firstChild)}if(K.childNodes.length==0){o.dom.add(K,R.element,null,"<br />");P=o.dom.add(K,R.element,null,"<br />")}else{E=K.innerHTML;K.innerHTML="";o.dom.add(K,R.element,null,E);P=o.dom.add(K,R.element,null,"<br />")}C=N.createRange();C.selectNodeContents(P);C.collapse(1);o.selection.setRng(C);return false}if(K==Q&&l==Q&&Q.firstChild&&o.dom.isBlock(Q.firstChild)){K=l=K.firstChild;J=j=0;F=N.createRange();F.setStart(K,0);G=N.createRange();G.setStart(l,0)}K=K.nodeName=="HTML"?N.body:K;K=K.nodeName=="BODY"?K.firstChild:K;l=l.nodeName=="HTML"?N.body:l;l=l.nodeName=="BODY"?l.firstChild:l;m=A.getParentBlock(K);q=A.getParentBlock(l);i=m?m.nodeName:R.element;if(A.dom.getParent(m,"ol,ul,pre")){return true}if(m&&(m.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(I.getStyle(m,"position",1)))){i=R.element;m=null}if(q&&(q.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(I.getStyle(m,"position",1)))){i=R.element;q=null}if(/(TD|TABLE|TH|CAPTION)/.test(i)||(m&&i=="DIV"&&/left|right/gi.test(I.getStyle(m,"float",1)))){i=R.element;m=q=null}x=(m&&m.nodeName==i)?m.cloneNode(0):o.dom.create(i);P=(q&&q.nodeName==i)?q.cloneNode(0):o.dom.create(i);P.removeAttribute("id");if(/^(H[1-6])$/.test(i)&&K.nodeValue&&J==K.nodeValue.length){P=o.dom.create(R.element)}E=k=K;do{if(E==Q||E.nodeType==9||A.dom.isBlock(E)||/(TD|TABLE|TH|CAPTION)/.test(E.nodeName)){break}k=E}while((E=E.previousSibling?E.previousSibling:E.parentNode));E=p=l;do{if(E==Q||E.nodeType==9||A.dom.isBlock(E)||/(TD|TABLE|TH|CAPTION)/.test(E.nodeName)){break}p=E}while((E=E.nextSibling?E.nextSibling:E.parentNode));if(k.nodeName==i){F.setStart(k,0)}else{F.setStartBefore(k)}F.setEnd(K,J);x.appendChild(F.cloneContents()||N.createTextNode(""));try{G.setEndAfter(p)}catch(L){}G.setStart(l,j);P.appendChild(G.cloneContents()||N.createTextNode(""));C=N.createRange();if(!k.previousSibling&&k.parentNode.nodeName==i){C.setStartBefore(k.parentNode)}else{if(F.startContainer.nodeName==i&&F.startOffset==0){C.setStartBefore(F.startContainer)}else{C.setStart(F.startContainer,F.startOffset)}}if(!p.nextSibling&&p.parentNode.nodeName==i){C.setEndAfter(p.parentNode)}else{C.setEnd(G.endContainer,G.endOffset)}C.deleteContents();if(c){o.getWin().scrollTo(0,H.y)}if(x.firstChild&&x.firstChild.nodeName==i){x.innerHTML=x.firstChild.innerHTML}if(P.firstChild&&P.firstChild.nodeName==i){P.innerHTML=P.firstChild.innerHTML}if(g(x)){x.innerHTML="<br />"}function O(y,s){var r=[],T,S,t;y.innerHTML="";if(R.keep_styles){S=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(S.nodeName)){T=S.cloneNode(false);I.setAttrib(T,"id","");r.push(T)}}while(S=S.parentNode)}if(r.length>0){for(t=r.length-1,T=y;t>=0;t--){T=T.appendChild(r[t])}r[0].innerHTML=c?" ":"<br />";return r[0]}else{y.innerHTML=c?" ":"<br />"}}if(g(P)){v=O(P,l)}if(c&&parseFloat(opera.version())<9.5){C.insertNode(x);C.insertNode(P)}else{C.insertNode(P);C.insertNode(x)}P.normalize();x.normalize();function u(r){return N.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false).nextNode()||r}C=N.createRange();C.selectNodeContents(a?u(v||P):v||P);C.collapse(1);B.removeAllRanges();B.addRange(C);w=o.dom.getPos(P).y;z=P.clientHeight;if(w<H.y||w+z>H.y+H.h){o.getWin().scrollTo(0,w<H.y?w:w-H.h+25)}return false},backspaceDelete:function(l,u){var x=this,k=x.editor,p=k.getBody(),j,m=k.selection,i=m.getRng(),o=i.startContainer,j,q,s;if(o&&k.dom.isBlock(o)&&!/^(TD|TH)$/.test(o.nodeName)&&u){if(o.childNodes.length==0||(o.childNodes.length==1&&o.firstChild.nodeName=="BR")){j=o;while((j=j.previousSibling)&&!k.dom.isBlock(j)){}if(j){if(o!=p.firstChild){q=k.dom.doc.createTreeWalker(j,NodeFilter.SHOW_TEXT,null,false);while(s=q.nextNode()){j=s}i=k.getDoc().createRange();i.setStart(j,j.nodeValue?j.nodeValue.length:0);i.setEnd(j,j.nodeValue?j.nodeValue.length:0);m.setRng(i);k.dom.remove(o)}return b.cancel(l)}}}function v(n){var r;n=n.target;if(n&&n.parentNode&&n.nodeName=="BR"&&(j=x.getParentBlock(n))){r=n.previousSibling;b.remove(p,"DOMNodeInserted",v);if(r&&r.nodeType==3&&/\s+$/.test(r.nodeValue)){return}if(n.previousSibling||n.nextSibling){k.dom.remove(n)}}}b._add(p,"DOMNodeInserted",v);window.setTimeout(function(){b._remove(p,"DOMNodeInserted",v)},1)}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){i.execCommand(p.cmd,p.ui||false,p.value)}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark("simple")});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.CommandManager=function(){var c={},b={},d={};function e(i,h,g,f){if(typeof(h)=="string"){h=[h]}a.each(h,function(j){i[j.toLowerCase()]={func:g,scope:f}})}a.extend(this,{add:function(h,g,f){e(c,h,g,f)},addQueryStateHandler:function(h,g,f){e(b,h,g,f)},addQueryValueHandler:function(h,g,f){e(d,h,g,f)},execCommand:function(g,j,i,h,f){if(j=c[j.toLowerCase()]){if(j.func.call(g||j.scope,i,h,f)!==false){return true}}},queryCommandValue:function(){if(cmd=d[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}},queryCommandState:function(){if(cmd=b[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}}})};a.GlobalCommands=new a.CommandManager()})(tinymce);(function(b){function a(i,d,h,m){var j,g,e,l,f;function k(p,o){do{if(p.parentNode==o){return p}p=p.parentNode}while(p)}function c(o){m(o);b.walk(o,m,"childNodes")}j=i.findCommonAncestor(d,h);e=k(d,j)||d;l=k(h,j)||h;for(g=d;g&&g!=e;g=g.parentNode){for(f=g.nextSibling;f;f=f.nextSibling){c(f)}}if(e!=l){for(g=e.nextSibling;g&&g!=l;g=g.nextSibling){c(g)}}else{c(e)}for(g=h;g&&g!=l;g=g.parentNode){for(f=g.previousSibling;f;f=f.previousSibling){c(f)}}}b.GlobalCommands.add("RemoveFormat",function(){var m=this,l=m.dom,u=m.selection,d=u.getRng(1),e=[],h,f,j,q,g,o,c,i;function k(s){var r;l.getParent(s,function(v){if(l.is(v,m.getParam("removeformat_selector"))){r=v}return l.isBlock(v)},m.getBody());return r}function p(r){if(l.is(r,m.getParam("removeformat_selector"))){e.push(r)}}function t(r){p(r);b.walk(r,p,"childNodes")}h=u.getBookmark();q=d.startContainer;o=d.endContainer;g=d.startOffset;c=d.endOffset;q=q.nodeType==1?q.childNodes[Math.min(g,q.childNodes.length-1)]:q;o=o.nodeType==1?o.childNodes[Math.min(g==c?c:c-1,o.childNodes.length-1)]:o;if(q==o){f=k(q);if(q.nodeType==3){if(f&&f.nodeType==1){i=q.splitText(g);i.splitText(c-g);l.split(f,i);u.moveToBookmark(h)}return}t(l.split(f,q)||q)}else{f=k(q);j=k(o);if(f){if(q.nodeType==3){if(g==q.nodeValue.length){q.nodeValue+="\uFEFF"}q=q.splitText(g)}}if(j){if(o.nodeType==3){o.splitText(c)}}if(f&&f==j){l.replace(l.create("span",{id:"__end"},o.cloneNode(true)),o)}if(f){f=l.split(f,q)}else{f=q}if(i=l.get("__end")){o=i;j=k(o)}if(j){j=l.split(j,o)}else{j=o}a(l,f,j,p);if(q.nodeValue=="\uFEFF"){q.nodeValue=""}t(o);t(q)}b.each(e,function(r){l.remove(r,1)});l.remove("__end",1);u.moveToBookmark(h)})})(tinymce);(function(a){a.GlobalCommands.add("mceBlockQuote",function(){var j=this,o=j.selection,f=j.dom,l,k,e,d,p,c,m,h,b;function g(i){return f.getParent(i,function(q){return q.nodeName==="BLOCKQUOTE"})}l=f.getParent(o.getStart(),f.isBlock);k=f.getParent(o.getEnd(),f.isBlock);if(p=g(l)){if(l!=k||l.childNodes.length>1||(l.childNodes.length==1&&l.firstChild.nodeName!="BR")){d=o.getBookmark()}if(g(k)){m=p.cloneNode(false);while(e=k.nextSibling){m.appendChild(e.parentNode.removeChild(e))}}if(m){f.insertAfter(m,p)}b=o.getSelectedBlocks(l,k);for(h=b.length-1;h>=0;h--){f.insertAfter(b[h],p)}if(/^\s*$/.test(p.innerHTML)){f.remove(p,1)}if(m&&/^\s*$/.test(m.innerHTML)){f.remove(m,1)}if(!d){if(!a.isIE){c=j.getDoc().createRange();c.setStart(l,0);c.setEnd(l,0);o.setRng(c)}else{o.select(l);o.collapse(0);if(f.getParent(o.getStart(),f.isBlock)!=l){c=o.getRng();c.move("character",-1);c.select()}}}else{j.selection.moveToBookmark(d)}return}if(a.isIE&&!l&&!k){j.getDoc().execCommand("Indent");e=g(o.getNode());e.style.margin=e.dir="";return}if(!l||!k){return}if(l!=k||l.childNodes.length>1||(l.childNodes.length==1&&l.firstChild.nodeName!="BR")){d=o.getBookmark()}a.each(o.getSelectedBlocks(g(o.getStart()),g(o.getEnd())),function(i){if(i.nodeName=="BLOCKQUOTE"&&!p){p=i;return}if(!p){p=f.create("blockquote");i.parentNode.insertBefore(p,i)}if(i.nodeName=="BLOCKQUOTE"&&p){e=i.firstChild;while(e){p.appendChild(e.cloneNode(true));e=e.nextSibling}f.remove(i);return}p.appendChild(f.remove(i))});if(!d){if(!a.isIE){c=j.getDoc().createRange();c.setStart(l,0);c.setEnd(l,0);o.setRng(c)}else{o.select(l);o.collapse(1)}}else{o.moveToBookmark(d)}})})(tinymce);(function(a){a.each(["Cut","Copy","Paste"],function(b){a.GlobalCommands.add(b,function(){var c=this,e=c.getDoc();try{e.execCommand(b,false,null);if(!e.queryCommandSupported(b)){throw"Error"}}catch(d){c.windowManager.alert(c.getLang("clipboard_no_support"))}})})})(tinymce);(function(a){a.GlobalCommands.add("InsertHorizontalRule",function(){if(a.isOpera){return this.getDoc().execCommand("InsertHorizontalRule",false,"")}this.selection.setContent("<hr />")})})(tinymce);(function(){var a=tinymce.GlobalCommands;a.add(["mceEndUndoLevel","mceAddUndoLevel"],function(){this.undoManager.add()});a.add("Undo",function(){var b=this;if(b.settings.custom_undo_redo){b.undoManager.undo();b.nodeChanged();return true}return false});a.add("Redo",function(){var b=this;if(b.settings.custom_undo_redo){b.undoManager.redo();b.nodeChanged();return true}return false})})();
+var tinymce={majorVersion:"3",minorVersion:"2.7",releaseDate:"2009-09-22",_init:function(){var o=this,k=document,l=window,j=navigator,b=j.userAgent,h,a,g,f,e,m;o.isOpera=l.opera&&opera.buildNumber;o.isWebKit=/WebKit/.test(b);o.isIE=!o.isWebKit&&!o.isOpera&&(/MSIE/gi).test(b)&&(/Explorer/gi).test(j.appName);o.isIE6=o.isIE&&/MSIE [56]/.test(b);o.isGecko=!o.isWebKit&&/Gecko/.test(b);o.isMac=b.indexOf("Mac")!=-1;o.isAir=/adobeair/i.test(b);if(l.tinyMCEPreInit){o.suffix=tinyMCEPreInit.suffix;o.baseURL=tinyMCEPreInit.base;o.query=tinyMCEPreInit.query;return}o.suffix="";a=k.getElementsByTagName("base");for(h=0;h<a.length;h++){if(m=a[h].href){if(/^https?:\/\/[^\/]+$/.test(m)){m+="/"}f=m?m.match(/.*\//)[0]:""}}function c(d){if(d.src&&/tiny_mce(|_gzip|_jquery|_prototype)(_dev|_src)?.js/.test(d.src)){if(/_(src|dev)\.js/g.test(d.src)){o.suffix="_src"}if((e=d.src.indexOf("?"))!=-1){o.query=d.src.substring(e+1)}o.baseURL=d.src.substring(0,d.src.lastIndexOf("/"));if(f&&o.baseURL.indexOf("://")==-1&&o.baseURL.indexOf("/")!==0){o.baseURL=f+o.baseURL}return o.baseURL}return null}a=k.getElementsByTagName("script");for(h=0;h<a.length;h++){if(c(a[h])){return}}g=k.getElementsByTagName("head")[0];if(g){a=g.getElementsByTagName("script");for(h=0;h<a.length;h++){if(c(a[h])){return}}}return},is:function(b,a){var c=typeof(b);if(!a){return c!="undefined"}if(a=="array"&&(b.hasOwnProperty&&b instanceof Array)){return true}return c==a},each:function(d,a,c){var e,b;if(!d){return 0}c=c||d;if(typeof(d.length)!="undefined"){for(e=0,b=d.length;e<b;e++){if(a.call(c,d[e],e,d)===false){return 0}}}else{for(e in d){if(d.hasOwnProperty(e)){if(a.call(c,d[e],e,d)===false){return 0}}}}return 1},map:function(b,c){var d=[];tinymce.each(b,function(a){d.push(c(a))});return d},grep:function(b,c){var d=[];tinymce.each(b,function(a){if(!c||c(a)){d.push(a)}});return d},inArray:function(c,d){var e,b;if(c){for(e=0,b=c.length;e<b;e++){if(c[e]===d){return e}}}return -1},extend:function(f,d){var c,b=arguments;for(c=1;c<b.length;c++){d=b[c];tinymce.each(d,function(a,e){if(typeof(a)!=="undefined"){f[e]=a}})}return f},trim:function(a){return(a?""+a:"").replace(/^\s*|\s*$/g,"")},create:function(j,a){var i=this,b,e,f,g,d,h=0;j=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(j);f=j[3].match(/(^|\.)(\w+)$/i)[2];e=i.createNS(j[3].replace(/\.\w+$/,""));if(e[f]){return}if(j[2]=="static"){e[f]=a;if(this.onCreate){this.onCreate(j[2],j[3],e[f])}return}if(!a[f]){a[f]=function(){};h=1}e[f]=a[f];i.extend(e[f].prototype,a);if(j[5]){b=i.resolve(j[5]).prototype;g=j[5].match(/\.(\w+)$/i)[1];d=e[f];if(h){e[f]=function(){return b[g].apply(this,arguments)}}else{e[f]=function(){this.parent=b[g];return d.apply(this,arguments)}}e[f].prototype[f]=e[f];i.each(b,function(c,k){e[f].prototype[k]=b[k]});i.each(a,function(c,k){if(b[k]){e[f].prototype[k]=function(){this.parent=b[k];return c.apply(this,arguments)}}else{if(k!=f){e[f].prototype[k]=c}}})}i.each(a["static"],function(c,k){e[f][k]=c});if(this.onCreate){this.onCreate(j[2],j[3],e[f].prototype)}},walk:function(c,b,d,a){a=a||this;if(c){if(d){c=c[d]}tinymce.each(c,function(f,e){if(b.call(a,f,e,d)===false){return false}tinymce.walk(f,b,d,a)})}},createNS:function(d,c){var b,a;c=c||window;d=d.split(".");for(b=0;b<d.length;b++){a=d[b];if(!c[a]){c[a]={}}c=c[a]}return c},resolve:function(d,c){var b,a;c=c||window;d=d.split(".");for(b=0,a=d.length;b<a;b++){c=c[d[b]];if(!c){break}}return c},addUnload:function(e,d){var c=this,a=window;e={func:e,scope:d||this};if(!c.unloads){function b(){var f=c.unloads,h,i;if(f){for(i in f){h=f[i];if(h&&h.func){h.func.call(h.scope,1)}}if(a.detachEvent){a.detachEvent("onbeforeunload",g);a.detachEvent("onunload",b)}else{if(a.removeEventListener){a.removeEventListener("unload",b,false)}}c.unloads=h=f=a=b=0;if(window.CollectGarbage){window.CollectGarbage()}}}function g(){var h=document;if(h.readyState=="interactive"){function f(){h.detachEvent("onstop",f);if(b){b()}h=0}if(h){h.attachEvent("onstop",f)}window.setTimeout(function(){if(h){h.detachEvent("onstop",f)}},0)}}if(a.attachEvent){a.attachEvent("onunload",b);a.attachEvent("onbeforeunload",g)}else{if(a.addEventListener){a.addEventListener("unload",b,false)}}c.unloads=[e]}else{c.unloads.push(e)}return e},removeUnload:function(c){var a=this.unloads,b=null;tinymce.each(a,function(e,d){if(e&&e.func==c){a.splice(d,1);b=c;return false}});return b},explode:function(a,b){return a?tinymce.map(a.split(b||","),tinymce.trim):a},_addVer:function(b){var a;if(!this.query){return b}a=(b.indexOf("?")==-1?"?":"&")+this.query;if(b.indexOf("#")==-1){return b+a}return b.replace("#",a+"#")}};window.tinymce=tinymce;tinymce._init();tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;e=tinymce.trim(e);g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about|data):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^\w*:?\/\//.test(e)){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c<e.length;c++){a+=(c>0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(c){var e=c.each,b=c.is;var d=c.isWebKit,a=c.isIE;c.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(i,g){var f=this;f.doc=i;f.win=window;f.files={};f.cssFlicker=false;f.counter=0;f.boxModel=!c.isIE||i.compatMode=="CSS1Compat";f.stdMode=i.documentMode===8;f.settings=g=c.extend({keep_values:false,hex_colors:1,process_html:1},g);if(c.isIE6){try{i.execCommand("BackgroundImageCache",false,true)}catch(h){f.cssFlicker=true}}c.addUnload(f.destroy,f)},getRoot:function(){var f=this,g=f.settings;return(g&&f.get(g.root_element))||f.doc.body},getViewPort:function(g){var h,f;g=!g?this.win:g;h=g.document;f=this.boxModel?h.documentElement:h.body;return{x:g.pageXOffset||f.scrollLeft,y:g.pageYOffset||f.scrollTop,w:g.innerWidth||f.clientWidth,h:g.innerHeight||f.clientHeight}},getRect:function(i){var h,f=this,g;i=f.get(i);h=f.getPos(i);g=f.getSize(i);return{x:h.x,y:h.y,w:g.w,h:g.h}},getSize:function(j){var g=this,f,i;j=g.get(j);f=g.getStyle(j,"width");i=g.getStyle(j,"height");if(f.indexOf("px")===-1){f=0}if(i.indexOf("px")===-1){i=0}return{w:parseInt(f)||j.offsetWidth||j.clientWidth,h:parseInt(i)||j.offsetHeight||j.clientHeight}},getParent:function(i,h,g){return this.getParents(i,h,g,false)},getParents:function(p,k,i,m){var h=this,g,j=h.settings,l=[];p=h.get(p);m=m===undefined;if(j.strict_root){i=i||h.getRoot()}if(b(k,"string")){g=k;if(k==="*"){k=function(f){return f.nodeType==1}}else{k=function(f){return h.is(f,g)}}}while(p){if(p==i||!p.nodeType||p.nodeType===9){break}if(!k||k(p)){if(m){l.push(p)}else{return p}}p=p.parentNode}return m?l:null},get:function(f){var g;if(f&&this.doc&&typeof(f)=="string"){g=f;f=this.doc.getElementById(f);if(f&&f.id!==g){return this.doc.getElementsByName(g)[1]}}return f},getNext:function(g,f){return this._findSib(g,f,"nextSibling")},getPrev:function(g,f){return this._findSib(g,f,"previousSibling")},select:function(h,g){var f=this;return c.dom.Sizzle(h,f.get(g)||f.get(f.settings.root_element)||f.doc,[])},is:function(g,f){return c.dom.Sizzle.matches(f,g.nodeType?[g]:g).length>0},add:function(j,l,f,i,k){var g=this;return this.run(j,function(n){var m,h;m=b(l,"string")?g.doc.createElement(l):l;g.setAttribs(m,f);if(i){if(i.nodeType){m.appendChild(i)}else{g.setHTML(m,i)}}return !k?n.appendChild(m):m})},create:function(i,f,g){return this.add(this.doc.createElement(i),i,f,g,1)},createHTML:function(m,f,j){var l="",i=this,g;l+="<"+m;for(g in f){if(f.hasOwnProperty(g)){l+=" "+g+'="'+i.encode(f[g])+'"'}}if(c.is(j)){return l+">"+j+"</"+m+">"}return l+" />"},remove:function(h,f){var g=this;return this.run(h,function(m){var l,k,j;l=m.parentNode;if(!l){return null}if(f){for(j=m.childNodes.length-1;j>=0;j--){g.insertAfter(m.childNodes[j],m)}}if(g.fixPsuedoLeaks){l=m.cloneNode(true);f="IELeakGarbageBin";k=g.get(f)||g.add(g.doc.body,"div",{id:f,style:"display:none"});k.appendChild(m);k.innerHTML="";return l}return l.removeChild(m)})},setStyle:function(i,f,g){var h=this;return h.run(i,function(l){var k,j;k=l.style;f=f.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(h.pixelStyles.test(f)&&(c.is(g,"number")||/^[\-0-9\.]+$/.test(g))){g+="px"}switch(f){case"opacity":if(a){k.filter=g===""?"":"alpha(opacity="+(g*100)+")";if(!i.currentStyle||!i.currentStyle.hasLayout){k.display="inline-block"}}k[f]=k["-moz-opacity"]=k["-khtml-opacity"]=g||"";break;case"float":a?k.styleFloat=g:k.cssFloat=g;break;default:k[f]=g||""}if(h.settings.update_styles){h.setAttrib(l,"mce_style")}})},getStyle:function(i,f,h){i=this.get(i);if(!i){return false}if(this.doc.defaultView&&h){f=f.replace(/[A-Z]/g,function(j){return"-"+j});try{return this.doc.defaultView.getComputedStyle(i,null).getPropertyValue(f)}catch(g){return null}}f=f.replace(/-(\D)/g,function(k,j){return j.toUpperCase()});if(f=="float"){f=a?"styleFloat":"cssFloat"}if(i.currentStyle&&h){return i.currentStyle[f]}return i.style[f]},setStyles:function(i,j){var g=this,h=g.settings,f;f=h.update_styles;h.update_styles=0;e(j,function(k,l){g.setStyle(i,l,k)});h.update_styles=f;if(h.update_styles){g.setAttrib(i,h.cssText)}},setAttrib:function(h,i,f){var g=this;if(!h||!i){return}if(g.settings.strict){i=i.toLowerCase()}return this.run(h,function(k){var j=g.settings;switch(i){case"style":if(!b(f,"string")){e(f,function(l,m){g.setStyle(k,m,l)});return}if(j.keep_values){if(f&&!g._isRes(f)){k.setAttribute("mce_style",f,2)}else{k.removeAttribute("mce_style",2)}}k.style.cssText=f;break;case"class":k.className=f||"";break;case"src":case"href":if(j.keep_values){if(j.url_converter){f=j.url_converter.call(j.url_converter_scope||g,f,i,k)}g.setAttrib(k,"mce_"+i,f,2)}break;case"shape":k.setAttribute("mce_style",f);break}if(b(f)&&f!==null&&f.length!==0){k.setAttribute(i,""+f,2)}else{k.removeAttribute(i,2)}})},setAttribs:function(g,h){var f=this;return this.run(g,function(i){e(h,function(j,k){f.setAttrib(i,k,j)})})},getAttrib:function(i,j,h){var f,g=this;i=g.get(i);if(!i||i.nodeType!==1){return false}if(!b(h)){h=""}if(/^(src|href|style|coords|shape)$/.test(j)){f=i.getAttribute("mce_"+j);if(f){return f}}if(a&&g.props[j]){f=i[g.props[j]];f=f&&f.nodeValue?f.nodeValue:f}if(!f){f=i.getAttribute(j,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(j)){if(i[g.props[j]]===true&&f===""){return j}return f?j:""}if(i.nodeName==="FORM"&&i.getAttributeNode(j)){return i.getAttributeNode(j).nodeValue}if(j==="style"){f=f||i.style.cssText;if(f){f=g.serializeStyle(g.parseStyle(f));if(g.settings.keep_values&&!g._isRes(f)){i.setAttribute("mce_style",f)}}}if(d&&j==="class"&&f){f=f.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(a){switch(j){case"rowspan":case"colspan":if(f===1){f=""}break;case"size":if(f==="+0"||f===20||f===0){f=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(f===0){f=""}break;case"hspace":if(f===-1){f=""}break;case"maxlength":case"tabindex":if(f===32768||f===2147483647||f==="32768"){f=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(f===65535){return j}return h;case"shape":f=f.toLowerCase();break;default:if(j.indexOf("on")===0&&f){f=(""+f).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(f!==undefined&&f!==null&&f!=="")?""+f:h},getPos:function(m,i){var g=this,f=0,l=0,j,k=g.doc,h;m=g.get(m);i=i||k.body;if(m){if(a&&!g.stdMode){m=m.getBoundingClientRect();j=g.boxModel?k.documentElement:k.body;f=g.getStyle(g.select("html")[0],"borderWidth");f=(f=="medium"||g.boxModel&&!g.isIE6)&&2||f;m.top+=g.win.self!=g.win.top?2:0;return{x:m.left+j.scrollLeft-f,y:m.top+j.scrollTop-f}}h=m;while(h&&h!=i&&h.nodeType){f+=h.offsetLeft||0;l+=h.offsetTop||0;h=h.offsetParent}h=m.parentNode;while(h&&h!=i&&h.nodeType){f-=h.scrollLeft||0;l-=h.scrollTop||0;h=h.parentNode}}return{x:f,y:l}},parseStyle:function(h){var i=this,j=i.settings,k={};if(!h){return k}function f(w,q,v){var o,u,m,n;o=k[w+"-top"+q];if(!o){return}u=k[w+"-right"+q];if(o!=u){return}m=k[w+"-bottom"+q];if(u!=m){return}n=k[w+"-left"+q];if(m!=n){return}k[v]=n;delete k[w+"-top"+q];delete k[w+"-right"+q];delete k[w+"-bottom"+q];delete k[w+"-left"+q]}function g(n,m,l,p){var o;o=k[m];if(!o){return}o=k[l];if(!o){return}o=k[p];if(!o){return}k[n]=k[m]+" "+k[l]+" "+k[p];delete k[m];delete k[l];delete k[p]}h=h.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");e(h.split(";"),function(m){var l,n=[];if(m){m=m.replace(/_MCE_SEMI_/g,";");m=m.replace(/url\([^\)]+\)/g,function(o){n.push(o);return"url("+n.length+")"});m=m.split(":");l=c.trim(m[1]);l=l.replace(/url\(([^\)]+)\)/g,function(p,o){return n[parseInt(o)-1]});l=l.replace(/rgb\([^\)]+\)/g,function(o){return i.toHex(o)});if(j.url_converter){l=l.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(o,p){return"url("+j.url_converter.call(j.url_converter_scope||i,i.decode(p),"style",null)+")"})}k[c.trim(m[0]).toLowerCase()]=l}});f("border","","border");f("border","-width","border-width");f("border","-color","border-color");f("border","-style","border-style");f("padding","","padding");f("margin","","margin");g("border","border-width","border-style","border-color");if(a){if(k.border=="medium none"){k.border=""}}return k},serializeStyle:function(g){var f="";e(g,function(i,h){if(h&&i){if(c.isGecko&&h.indexOf("-moz-")===0){return}switch(h){case"color":case"background-color":i=i.toLowerCase();break}f+=(f?" ":"")+h+": "+i+";"}});return f},loadCSS:function(f){var h=this,i=h.doc,g;if(!f){f=""}g=h.select("head")[0];e(f.split(","),function(j){var k;if(h.files[j]){return}h.files[j]=true;k=h.create("link",{rel:"stylesheet",href:c._addVer(j)});if(a&&i.documentMode){k.onload=function(){i.recalc();k.onload=null}}g.appendChild(k)})},addClass:function(f,g){return this.run(f,function(h){var i;if(!g){return 0}if(this.hasClass(h,g)){return h.className}i=this.removeClass(h,g);return h.className=(i!=""?(i+" "):"")+g})},removeClass:function(h,i){var f=this,g;return f.run(h,function(k){var j;if(f.hasClass(k,i)){if(!g){g=new RegExp("(^|\\s+)"+i+"(\\s+|$)","g")}j=k.className.replace(g," ");return k.className=c.trim(j!=" "?j:"")}return k.className})},hasClass:function(g,f){g=this.get(g);if(!g||!f){return false}return(" "+g.className+" ").indexOf(" "+f+" ")!==-1},show:function(f){return this.setStyle(f,"display","block")},hide:function(f){return this.setStyle(f,"display","none")},isHidden:function(f){f=this.get(f);return !f||f.style.display=="none"||this.getStyle(f,"display")=="none"},uniqueId:function(f){return(!f?"mce_":f)+(this.counter++)},setHTML:function(i,g){var f=this;return this.run(i,function(m){var h,k,j,q,l,h;g=f.processHTML(g);if(a){function o(){try{m.innerHTML="<br />"+g;m.removeChild(m.firstChild)}catch(n){while(m.firstChild){m.firstChild.removeNode()}h=f.create("div");h.innerHTML="<br />"+g;e(h.childNodes,function(r,p){if(p){m.appendChild(r)}})}}if(f.settings.fix_ie_paragraphs){g=g.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true"> </p>')}o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("p");for(k=j.length-1,h=0;k>=0;k--){q=j[k];if(!q.hasChildNodes()){if(!q.mce_keep){h=1;break}q.removeAttribute("mce_keep")}}}if(h){g=g.replace(/<p ([^>]+)>|<p>/ig,'<div $1 mce_tmp="1">');g=g.replace(/<\/p>/g,"</div>");o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("DIV");for(k=j.length-1;k>=0;k--){q=j[k];if(q.mce_tmp){l=f.doc.createElement("p");q.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(p,n){var r;if(n!=="mce_tmp"){r=q.getAttribute(n);if(!r&&n==="class"){r=q.className}l.setAttribute(n,r)}});for(h=0;h<q.childNodes.length;h++){l.appendChild(q.childNodes[h].cloneNode(true))}q.swapNode(l)}}}}}else{m.innerHTML=g}return g})},processHTML:function(j){var g=this,i=g.settings,k=[];if(!i.process_html){return j}if(c.isGecko){j=j.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,"<$1b$2>");j=j.replace(/<(\/?)em>|<em( [^>]+)>/gi,"<$1i$2>")}else{if(a){j=j.replace(/'/g,"'");j=j.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}}j=j.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(i.keep_values){if(/<script|noscript|style/i.test(j)){function f(h){h=h.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n");h=h.replace(/^[\r\n]*|[\r\n]*$/g,"");h=h.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"");h=h.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"");return h}j=j.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi,function(h,m,l){if(!m){m=' type="text/javascript"'}m=m.replace(/src=\"([^\"]+)\"?/i,function(n,o){if(i.url_converter){o=g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(o),"src","script"))}return'mce_src="'+o+'"'});if(c.trim(l)){k.push(f(l));l="<!--\nMCE_SCRIPT:"+(k.length-1)+"\n// -->"}return"<mce:script"+m+">"+l+"</mce:script>"});j=j.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi,function(h,m,l){if(l){k.push(f(l));l="<!--\nMCE_SCRIPT:"+(k.length-1)+"\n-->"}return"<mce:style"+m+">"+l+"</mce:style><style "+m+' mce_bogus="1">'+l+"</style>"});j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,m,l){return"<mce:noscript"+m+"><!--"+g.encode(l).replace(/--/g,"--")+"--></mce:noscript>"})}j=j.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->");j=j.replace(/<([\w:]+) [^>]*(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)[^>]*>/gi,function(l){function h(o,m,n){if(n==="false"||n==="0"){return""}return" "+m+'="'+m+'"'}l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=[\"]([^\"]+)[\"]/gi,h);l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=[\']([^\']+)[\']/gi,h);l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=([^\s\"\'>]+)/gi,h);l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)([\s>])/gi,' $1="$1"$2');return l});j=j.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi,function(h,m){function l(o,n,q){var p=q;if(h.indexOf("mce_"+n)!=-1){return o}if(n=="style"){if(g._isRes(q)){return o}p=g.encode(g.serializeStyle(g.parseStyle(p)))}else{if(n!="coords"&&n!="shape"){if(i.url_converter){p=g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(q),n,m))}}}return" "+n+'="'+q+'" mce_'+n+'="'+p+'"'}h=h.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi,l);h=h.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi,l);return h.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi,l)});j=j.replace(/MCE_SCRIPT:([0-9]+)/g,function(l,h){return k[h]})}return j},getOuterHTML:function(f){var g;f=this.get(f);if(!f){return null}if(f.outerHTML!==undefined){return f.outerHTML}g=(f.ownerDocument||this.doc).createElement("body");g.appendChild(f.cloneNode(true));return g.innerHTML},setOuterHTML:function(j,g,k){var f=this;function i(m,l,p){var q,o;o=p.createElement("body");o.innerHTML=l;q=o.lastChild;while(q){f.insertAfter(q.cloneNode(true),m);q=q.previousSibling}f.remove(m)}return this.run(j,function(l){l=f.get(l);if(l.nodeType==1){k=k||l.ownerDocument||f.doc;if(a){try{if(a&&l.nodeType==1){l.outerHTML=g}else{i(l,g,k)}}catch(h){i(l,g,k)}}else{i(l,g,k)}}})},decode:function(g){var h,i,f;if(/&[^;]+;/.test(g)){h=this.doc.createElement("div");h.innerHTML=g;i=h.firstChild;f="";if(i){do{f+=i.nodeValue}while(i.nextSibling)}return f||g}return g},encode:function(f){return f?(""+f).replace(/[<>&\"]/g,function(h,g){switch(h){case"&":return"&";case'"':return""";case"<":return"<";case">":return">"}return h}):f},insertAfter:function(h,g){var f=this;g=f.get(g);return this.run(h,function(k){var j,i;j=g.parentNode;i=g.nextSibling;if(i){j.insertBefore(k,i)}else{j.appendChild(k)}return k})},isBlock:function(f){if(f.nodeType&&f.nodeType!==1){return false}f=f.nodeName||f;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TH|TBODY|TR|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(f)},replace:function(i,h,f){var g=this;if(b(h,"array")){i=i.cloneNode(true)}return g.run(h,function(j){if(f){e(j.childNodes,function(k){i.appendChild(k.cloneNode(true))})}if(g.fixPsuedoLeaks&&j.nodeType===1){j.parentNode.insertBefore(i,j);g.remove(j);return i}return j.parentNode.replaceChild(i,j)})},findCommonAncestor:function(h,f){var i=h,g;while(i){g=f;while(g&&i!=g){g=g.parentNode}if(i==g){break}i=i.parentNode}if(!i&&h.ownerDocument){return h.ownerDocument.documentElement}return i},toHex:function(f){var h=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(f);function g(i){i=parseInt(i).toString(16);return i.length>1?i:"0"+i}if(h){f="#"+g(h[1])+g(h[2])+g(h[3]);return f}return f},getClasses:function(){var l=this,g=[],k,m={},n=l.settings.class_filter,j;if(l.classes){return l.classes}function o(f){e(f.imports,function(i){o(i)});e(f.cssRules||f.rules,function(i){switch(i.type||1){case 1:if(i.selectorText){e(i.selectorText.split(","),function(p){p=p.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(p)||!/\.[\w\-]+$/.test(p)){return}j=p;p=p.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(n&&!(p=n(p,j))){return}if(!m[p]){g.push({"class":p});m[p]=1}})}break;case 3:o(i.styleSheet);break}})}try{e(l.doc.styleSheets,o)}catch(h){}if(g.length>0){l.classes=g}return g},run:function(j,i,h){var g=this,k;if(g.doc&&typeof(j)==="string"){j=g.get(j)}if(!j){return false}h=h||this;if(!j.nodeType&&(j.length||j.length===0)){k=[];e(j,function(l,f){if(l){if(typeof(l)=="string"){l=g.doc.getElementById(l)}k.push(i.call(h,l,f))}});return k}return i.call(h,j)},getAttribs:function(g){var f;g=this.get(g);if(!g){return[]}if(a){f=[];if(g.nodeName=="OBJECT"){return g.attributes}if(g.nodeName==="OPTION"&&this.getAttrib(g,"selected")){f.push({specified:1,nodeName:"selected"})}g.cloneNode(false).outerHTML.replace(/<\/?[\w:]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=\w+|>/gi,"").replace(/[\w:]+/gi,function(h){f.push({specified:1,nodeName:h})});return f}return g.attributes},destroy:function(g){var f=this;if(f.events){f.events.destroy()}f.win=f.doc=f.root=f.events=null;if(!g){c.removeUnload(f.destroy)}},createRng:function(){var f=this.doc;return f.createRange?f.createRange():new c.dom.Range(this)},split:function(l,k,o){var p=this,f=p.createRng(),m,j,n;function g(r,q){r=r[q];if(r&&r[q]&&r[q].nodeType==1&&i(r[q])){p.remove(r[q])}}function i(q){q=p.getOuterHTML(q);q=q.replace(/<(img|hr|table)/gi,"-");q=q.replace(/<[^>]+>/g,"");return q.replace(/[ \t\r\n]+| | /g,"")==""}function h(r){var q=0;while(r.previousSibling){q++;r=r.previousSibling}return q}if(l&&k){f.setStart(l.parentNode,h(l));f.setEnd(k.parentNode,h(k));m=f.extractContents();f=p.createRng();f.setStart(k.parentNode,h(k)+1);f.setEnd(l.parentNode,h(l)+1);j=f.extractContents();n=l.parentNode;g(m,"lastChild");if(!i(m)){n.insertBefore(m,l)}if(o){n.replaceChild(o,k)}else{n.insertBefore(k,l)}g(j,"firstChild");if(!i(j)){n.insertBefore(j,l)}p.remove(l);return o||k}},bind:function(j,f,i,h){var g=this;if(!g.events){g.events=new c.dom.EventUtils()}return g.events.add(j,f,i,h||this)},unbind:function(i,f,h){var g=this;if(!g.events){g.events=new c.dom.EventUtils()}return g.events.remove(i,f,h)},_findSib:function(j,g,h){var i=this,k=g;if(j){if(b(k,"string")){k=function(f){return i.is(f,g)}}for(j=j[h];j;j=j[h]){if(k(j)){return j}}}return null},_isRes:function(f){return/^(top|left|bottom|right|width|height)/i.test(f)||/;\s*(top|left|bottom|right|width|height)/i.test(f)}});c.DOM=new c.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(f){var h=0,c=1,e=2,d=tinymce.extend;function g(m,k){var j,l;if(m.parentNode!=k){return -1}for(l=k.firstChild,j=0;l!=m;l=l.nextSibling){j++}return j}function b(k){var j=0;while(k.previousSibling){j++;k=k.previousSibling}return j}function i(j,k){var l;if(j.nodeType==3){return j}if(k<0){return j}l=j.firstChild;while(l!=null&&k>0){--k;l=l.nextSibling}if(l!=null){return l}return j}function a(k){var j=k.doc;d(this,{dom:k,startContainer:j,startOffset:0,endContainer:j,endOffset:0,collapsed:true,commonAncestorContainer:j,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3})}d(a.prototype,{setStart:function(k,j){this._setEndPoint(true,k,j)},setEnd:function(k,j){this._setEndPoint(false,k,j)},setStartBefore:function(j){this.setStart(j.parentNode,b(j))},setStartAfter:function(j){this.setStart(j.parentNode,b(j)+1)},setEndBefore:function(j){this.setEnd(j.parentNode,b(j))},setEndAfter:function(j){this.setEnd(j.parentNode,b(j)+1)},collapse:function(k){var j=this;if(k){j.endContainer=j.startContainer;j.endOffset=j.startOffset}else{j.startContainer=j.endContainer;j.startOffset=j.endOffset}j.collapsed=true},selectNode:function(j){this.setStartBefore(j);this.setEndAfter(j)},selectNodeContents:function(j){this.setStart(j,0);this.setEnd(j,j.nodeType===1?j.childNodes.length:j.nodeValue.length)},compareBoundaryPoints:function(m,n){var l=this,p=l.startContainer,o=l.startOffset,k=l.endContainer,j=l.endOffset;if(m===0){return l._compareBoundaryPoints(p,o,p,o)}if(m===1){return l._compareBoundaryPoints(p,o,k,j)}if(m===2){return l._compareBoundaryPoints(k,j,k,j)}if(m===3){return l._compareBoundaryPoints(k,j,p,o)}},deleteContents:function(){this._traverse(e)},extractContents:function(){return this._traverse(h)},cloneContents:function(){return this._traverse(c)},insertNode:function(m){var j=this,l,k;if(m.nodeType===3||m.nodeType===4){l=j.startContainer.splitText(j.startOffset);j.startContainer.parentNode.insertBefore(m,l)}else{if(j.startContainer.childNodes.length>0){k=j.startContainer.childNodes[j.startOffset]}j.startContainer.insertBefore(m,k)}},surroundContents:function(l){var j=this,k=j.extractContents();j.insertNode(l);l.appendChild(k);j.selectNode(l)},cloneRange:function(){var j=this;return d(new a(j.dom),{startContainer:j.startContainer,startOffset:j.startOffset,endContainer:j.endContainer,endOffset:j.endOffset,collapsed:j.collapsed,commonAncestorContainer:j.commonAncestorContainer})},_isCollapsed:function(){return(this.startContainer==this.endContainer&&this.startOffset==this.endOffset)},_compareBoundaryPoints:function(m,p,k,o){var q,l,j,r,t,s;if(m==k){if(p==o){return 0}else{if(p<o){return -1}else{return 1}}}q=k;while(q&&q.parentNode!=m){q=q.parentNode}if(q){l=0;j=m.firstChild;while(j!=q&&l<p){l++;j=j.nextSibling}if(p<=l){return -1}else{return 1}}q=m;while(q&&q.parentNode!=k){q=q.parentNode}if(q){l=0;j=k.firstChild;while(j!=q&&l<o){l++;j=j.nextSibling}if(l<o){return -1}else{return 1}}r=this.dom.findCommonAncestor(m,k);t=m;while(t&&t.parentNode!=r){t=t.parentNode}if(!t){t=r}s=k;while(s&&s.parentNode!=r){s=s.parentNode}if(!s){s=r}if(t==s){return 0}j=r.firstChild;while(j){if(j==t){return -1}if(j==s){return 1}j=j.nextSibling}},_setEndPoint:function(k,q,p){var l=this,j,m;if(k){l.startContainer=q;l.startOffset=p}else{l.endContainer=q;l.endOffset=p}j=l.endContainer;while(j.parentNode){j=j.parentNode}m=l.startContainer;while(m.parentNode){m=m.parentNode}if(m!=j){l.collapse(k)}else{if(l._compareBoundaryPoints(l.startContainer,l.startOffset,l.endContainer,l.endOffset)>0){l.collapse(k)}}l.collapsed=l._isCollapsed();l.commonAncestorContainer=l.dom.findCommonAncestor(l.startContainer,l.endContainer)},_traverse:function(r){var s=this,q,m=0,v=0,k,o,l,n,j,u;if(s.startContainer==s.endContainer){return s._traverseSameContainer(r)}for(q=s.endContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.startContainer){return s._traverseCommonStartContainer(q,r)}++m}for(q=s.startContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.endContainer){return s._traverseCommonEndContainer(q,r)}++v}o=v-m;l=s.startContainer;while(o>0){l=l.parentNode;o--}n=s.endContainer;while(o<0){n=n.parentNode;o++}for(j=l.parentNode,u=n.parentNode;j!=u;j=j.parentNode,u=u.parentNode){l=j;n=u}return s._traverseCommonAncestors(l,n,r)},_traverseSameContainer:function(o){var r=this,q,u,j,k,l,p,m;if(o!=e){q=r.dom.doc.createDocumentFragment()}if(r.startOffset==r.endOffset){return q}if(r.startContainer.nodeType==3){u=r.startContainer.nodeValue;j=u.substring(r.startOffset,r.endOffset);if(o!=c){r.startContainer.deleteData(r.startOffset,r.endOffset-r.startOffset);r.collapse(true)}if(o==e){return null}q.appendChild(r.dom.doc.createTextNode(j));return q}k=i(r.startContainer,r.startOffset);l=r.endOffset-r.startOffset;while(l>0){p=k.nextSibling;m=r._traverseFullySelected(k,o);if(q){q.appendChild(m)}--l;k=p}if(o!=c){r.collapse(true)}return q},_traverseCommonStartContainer:function(j,p){var s=this,r,k,l,m,q,o;if(p!=e){r=s.dom.doc.createDocumentFragment()}k=s._traverseRightBoundary(j,p);if(r){r.appendChild(k)}l=g(j,s.startContainer);m=l-s.startOffset;if(m<=0){if(p!=c){s.setEndBefore(j);s.collapse(false)}return r}k=j.previousSibling;while(m>0){q=k.previousSibling;o=s._traverseFullySelected(k,p);if(r){r.insertBefore(o,r.firstChild)}--m;k=q}if(p!=c){s.setEndBefore(j);s.collapse(false)}return r},_traverseCommonEndContainer:function(m,p){var s=this,r,o,j,k,q,l;if(p!=e){r=s.dom.doc.createDocumentFragment()}j=s._traverseLeftBoundary(m,p);if(r){r.appendChild(j)}o=g(m,s.endContainer);++o;k=s.endOffset-o;j=m.nextSibling;while(k>0){q=j.nextSibling;l=s._traverseFullySelected(j,p);if(r){r.appendChild(l)}--k;j=q}if(p!=c){s.setStartAfter(m);s.collapse(true)}return r},_traverseCommonAncestors:function(p,j,s){var w=this,l,v,o,q,r,k,u,m;if(s!=e){v=w.dom.doc.createDocumentFragment()}l=w._traverseLeftBoundary(p,s);if(v){v.appendChild(l)}o=p.parentNode;q=g(p,o);r=g(j,o);++q;k=r-q;u=p.nextSibling;while(k>0){m=u.nextSibling;l=w._traverseFullySelected(u,s);if(v){v.appendChild(l)}u=m;--k}l=w._traverseRightBoundary(j,s);if(v){v.appendChild(l)}if(s!=c){w.setStartAfter(p);w.collapse(true)}return v},_traverseRightBoundary:function(p,q){var s=this,l=i(s.endContainer,s.endOffset-1),r,o,n,j,k;var m=l!=s.endContainer;if(l==p){return s._traverseNode(l,m,false,q)}r=l.parentNode;o=s._traverseNode(r,false,false,q);while(r!=null){while(l!=null){n=l.previousSibling;j=s._traverseNode(l,m,false,q);if(q!=e){o.insertBefore(j,o.firstChild)}m=true;l=n}if(r==p){return o}l=r.previousSibling;r=r.parentNode;k=s._traverseNode(r,false,false,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseLeftBoundary:function(p,q){var s=this,m=i(s.startContainer,s.startOffset);var n=m!=s.startContainer,r,o,l,j,k;if(m==p){return s._traverseNode(m,n,true,q)}r=m.parentNode;o=s._traverseNode(r,false,true,q);while(r!=null){while(m!=null){l=m.nextSibling;j=s._traverseNode(m,n,true,q);if(q!=e){o.appendChild(j)}n=true;m=l}if(r==p){return o}m=r.nextSibling;r=r.parentNode;k=s._traverseNode(r,false,true,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseNode:function(j,o,r,s){var u=this,m,l,p,k,q;if(o){return u._traverseFullySelected(j,s)}if(j.nodeType==3){m=j.nodeValue;if(r){k=u.startOffset;l=m.substring(k);p=m.substring(0,k)}else{k=u.endOffset;l=m.substring(0,k);p=m.substring(k)}if(s!=c){j.nodeValue=p}if(s==e){return null}q=j.cloneNode(false);q.nodeValue=l;return q}if(s==e){return null}return j.cloneNode(false)},_traverseFullySelected:function(l,k){var j=this;if(k!=e){return k==c?l.cloneNode(true):l}l.parentNode.removeChild(l);return null}});f.Range=a})(tinymce.dom);(function(){function a(e){var d=this,h="\uFEFF",b,g;function c(j,i){if(j&&i){if(j.item&&i.item&&j.item(0)===i.item(0)){return 1}if(j.isEqual&&i.isEqual&&i.isEqual(j)){return 1}}return 0}function f(){var m=e.dom,j=e.getRng(),s=m.createRng(),p,k,n,q,o,l;function i(v){var t=v.parentNode.childNodes,u;for(u=t.length-1;u>=0;u--){if(t[u]==v){return u}}return -1}function r(v){var t=j.duplicate(),B,y,u,w,x=0,z=0,A,C;t.collapse(v);B=t.parentElement();t.pasteHTML(h);u=B.childNodes;for(y=0;y<u.length;y++){w=u[y];if(y>0&&(w.nodeType!==3||u[y-1].nodeType!==3)){z++}if(w.nodeType===3){A=w.nodeValue.indexOf(h);if(A!==-1){x+=A;break}x+=w.nodeValue.length}else{x=0}}t.moveStart("character",-1);t.text="";return{index:z,offset:x,parent:B}}n=j.item?j.item(0):j.parentElement();if(n.ownerDocument!=m.doc){return s}if(j.item||!n.hasChildNodes()){s.setStart(n.parentNode,i(n));s.setEnd(s.startContainer,s.startOffset+1);return s}l=e.isCollapsed();p=r(true);k=r(false);p.parent.normalize();k.parent.normalize();q=p.parent.childNodes[Math.min(p.index,p.parent.childNodes.length-1)];if(q.nodeType!=3){s.setStart(p.parent,p.index)}else{s.setStart(p.parent.childNodes[p.index],p.offset)}o=k.parent.childNodes[Math.min(k.index,k.parent.childNodes.length-1)];if(o.nodeType!=3){if(!l){k.index++}s.setEnd(k.parent,k.index)}else{s.setEnd(k.parent.childNodes[k.index],k.offset)}if(!l){q=s.startContainer;if(q.nodeType==1){s.setStart(q,Math.min(s.startOffset,q.childNodes.length))}o=s.endContainer;if(o.nodeType==1){s.setEnd(o,Math.min(s.endOffset,o.childNodes.length))}}d.addRange(s);return s}this.addRange=function(j){var o,m=e.dom.doc.body,p,k,q,l,n,i;q=j.startContainer;l=j.startOffset;n=j.endContainer;i=j.endOffset;o=m.createTextRange();q=q.nodeType==1?q.childNodes[Math.min(l,q.childNodes.length-1)]:q;n=n.nodeType==1?n.childNodes[Math.min(l==i?i:i-1,n.childNodes.length-1)]:n;if(q==n&&q.nodeType==1){if(/^(IMG|TABLE)$/.test(q.nodeName)&&l!=i){o=m.createControlRange();o.addElement(q)}else{o=m.createTextRange();if(!q.hasChildNodes()&&q.canHaveHTML){q.innerHTML=h}o.moveToElementText(q);if(q.innerHTML==h){o.collapse(true);q.removeChild(q.firstChild)}}if(l==i){o.collapse(i<=j.endContainer.childNodes.length-1)}o.select();return}function r(t,v){var u,s,w;if(t.nodeType!=3){return -1}u=t.nodeValue;s=m.createTextRange();t.nodeValue=u.substring(0,v)+h+u.substring(v);s.moveToElementText(t.parentNode);s.findText(h);w=Math.abs(s.moveStart("character",-1048575));t.nodeValue=u;return w}if(j.collapsed){pos=r(q,l);o=m.createTextRange();o.move("character",pos);o.select();return}else{if(q==n&&q.nodeType==3){p=r(q,l);o=m.createTextRange();o.move("character",p);o.moveEnd("character",i-l);o.select();return}p=r(q,l);k=r(n,i);o=m.createTextRange();if(p==-1){o.moveToElementText(q);p=0}else{o.move("character",p)}tmpRng=m.createTextRange();if(k==-1){tmpRng.moveToElementText(n)}else{tmpRng.move("character",k)}o.setEndPoint("EndToEnd",tmpRng);o.select();return}};this.getRangeAt=function(){if(!b||!c(g,e.getRng())){b=f();g=e.getRng()}return b};this.destroy=function(){g=b=null}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,i=0,d=Object.prototype.toString,n=false;var b=function(D,t,A,v){A=A||[];var e=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!D||typeof D!=="string"){return A}var B=[],C,y,G,F,z,s,r=true,w=o(t);p.lastIndex=0;while((C=p.exec(D))!==null){B.push(C[1]);if(C[2]){s=RegExp.rightContext;break}}if(B.length>1&&j.exec(D)){if(B.length===2&&f.relative[B[0]]){y=g(B[0]+B[1],t)}else{y=f.relative[B[0]]?[t]:b(B.shift(),t);while(B.length){D=B.shift();if(f.relative[D]){D+=B.shift()}y=g(D,y)}}}else{if(!v&&B.length>1&&t.nodeType===9&&!w&&f.match.ID.test(B[0])&&!f.match.ID.test(B[B.length-1])){var H=b.find(B.shift(),t,w);t=H.expr?b.filter(H.expr,H.set)[0]:H.set[0]}if(t){var H=v?{expr:B.pop(),set:a(v)}:b.find(B.pop(),B.length===1&&(B[0]==="~"||B[0]==="+")&&t.parentNode?t.parentNode:t,w);y=H.expr?b.filter(H.expr,H.set):H.set;if(B.length>0){G=a(y)}else{r=false}while(B.length){var u=B.pop(),x=u;if(!f.relative[u]){u=""}else{x=B.pop()}if(x==null){x=t}f.relative[u](G,x,w)}}else{G=B=[]}}if(!G){G=y}if(!G){throw"Syntax error, unrecognized expression: "+(u||D)}if(d.call(G)==="[object Array]"){if(!r){A.push.apply(A,G)}else{if(t&&t.nodeType===1){for(var E=0;G[E]!=null;E++){if(G[E]&&(G[E]===true||G[E].nodeType===1&&h(t,G[E]))){A.push(y[E])}}}else{for(var E=0;G[E]!=null;E++){if(G[E]&&G[E].nodeType===1){A.push(y[E])}}}}}else{a(G,A)}if(s){b(s,e,A,v);b.uniqueSort(A)}return A};b.uniqueSort=function(r){if(c){n=false;r.sort(c);if(n){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(x,e,y){var w,u;if(!x){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.match[v].exec(x))){var r=RegExp.leftContext;if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");w=f.find[v](u,e,y);if(w!=null){x=x.replace(f.match[v],"");break}}}}if(!w){w=e.getElementsByTagName("*")}return{set:w,expr:x}};b.filter=function(A,z,D,t){var s=A,F=[],x=z,v,e,w=z&&z[0]&&o(z[0]);while(A&&z.length){for(var y in f.filter){if((v=f.match[y].exec(A))!=null){var r=f.filter[y],E,C;e=false;if(x==F){F=[]}if(f.preFilter[y]){v=f.preFilter[y](v,x,D,F,t,w);if(!v){e=E=true}else{if(v===true){continue}}}if(v){for(var u=0;(C=x[u])!=null;u++){if(C){E=r(C,v,u,x);var B=t^!!E;if(D&&E!=null){if(B){e=true}else{x[u]=false}}else{if(B){F.push(C);e=true}}}}}if(E!==undefined){if(!D){x=F}A=A.replace(f.match[y],"");if(!e){return[]}break}}}if(A==s){if(e==null){throw"Syntax error, unrecognized expression: "+A}else{break}}s=A}return x};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(x,e,w){var u=typeof e==="string",y=u&&!/\W/.test(e),v=u&&!y;if(y&&!w){e=e.toUpperCase()}for(var t=0,s=x.length,r;t<s;t++){if((r=x[t])){while((r=r.previousSibling)&&r.nodeType!==1){}x[t]=v||r&&r.nodeName===e?r||false:r===e}}if(v){b.filter(e,x,true)}},">":function(w,r,x){var u=typeof r==="string";if(u&&!/\W/.test(r)){r=x?r:r.toUpperCase();for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){var t=v.parentNode;w[s]=t.nodeName===r?t:false}}}else{for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){w[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,w,true)}}},"":function(t,r,v){var s=i++,e=q;if(!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=i++,e=q;if(typeof r==="string"&&!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v,w){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,w,x){t=" "+t[1].replace(/\\/g,"")+" ";if(x){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(w^(v.className&&(" "+v.className+" ").indexOf(t)>=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){for(var s=0;e[s]===false;s++){}return e[s]&&o(e[s])?r[1]:r[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=i++;return e},ATTR:function(u,r,s,e,v,w){var t=u[1].replace(/\\/g,"");if(!w&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if(u[3].match(p).length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return r<e[3]-0},gt:function(s,r,e){return r>e[3]-0},nth:function(s,r,e){return e[3]-0==r},eq:function(s,r,e){return e[3]-0==r}},filter:{PSEUDO:function(w,s,t,x){var r=s[1],u=f.filters[r];if(u){return u(w,t,s,x)}else{if(r==="contains"){return(w.textContent||w.innerText||"").indexOf(s[3])>=0}else{if(r==="not"){var v=s[3];for(var t=0,e=v.length;t<e;t++){if(v[t]===w){return false}}return true}}}},CHILD:function(e,t){var w=t[1],r=e;switch(w){case"only":case"first":while(r=r.previousSibling){if(r.nodeType===1){return false}}if(w=="first"){return true}r=e;case"last":while(r=r.nextSibling){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],z=t[3];if(s==1&&z==0){return true}var v=t[0],y=e.parentNode;if(y&&(y.sizcache!==v||!e.nodeIndex)){var u=0;for(r=y.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}y.sizcache=v}var x=e.nodeIndex-z;if(s==0){return x==0}else{return(x%s==0&&x/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),w=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?w===r:u==="*="?w.indexOf(r)>=0:u==="~="?(" "+w+" ").indexOf(r)>=0:!r?w&&e!==false:u==="!="?w!=r:u==="^="?w.indexOf(r)===0:u==="$="?w.substr(w.length-r.length)===r:u==="|="?w===r||w.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var j=f.match.POS;for(var l in f.match){f.match[l]=new RegExp(f.match[l].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var a=function(r,e){r=Array.prototype.slice.call(r);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(k){a=function(u,t){var r=t||[];if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var s=0,e=u.length;s<e;s++){r.push(u[s])}}else{for(var s=0;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){n=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){var s=r.sourceIndex-e.sourceIndex;if(s===0){n=true}return s}}else{if(document.createRange){c=function(t,r){var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.setStart(t,0);s.setEnd(t,0);e.setStart(r,0);e.setEnd(r,0);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){n=true}return u}}}}(function(){var r=document.createElement("div"),s="script"+(new Date).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(!!document.getElementById(s)){f.find.ID=function(u,v,w){if(typeof v.getElementById!=="undefined"&&!w){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(w,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!o(v)){try{return a(v.querySelectorAll(w),t)}catch(x){}}return e(w,v,t,u)};for(var r in e){b[r]=e[r]}})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}}})()}function m(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1&&!z){e.sizcache=v;e.sizset=t}if(e.nodeName===w){u=e;break}e=e[r]}A[t]=u}}}function q(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1){if(!z){e.sizcache=v;e.sizset=t}if(typeof w!=="string"){if(e===w){u=true;break}}else{if(b.filter(w,[e]).length>0){u=e;break}}}e=e[r]}A[t]=u}}}var h=document.compareDocumentPosition?function(r,e){return r.compareDocumentPosition(e)&16}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};var o=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,x){var t=[],u="",v,s=x.nodeType?[x]:x;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var w=0,r=s.length;w<r;w++){b(e,s[w],t)}return b.filter(u,t)};window.tinymce.dom.Sizzle=b})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){var b=a.each;a.create("tinymce.dom.Element",{Element:function(g,e){var c=this,f,d;e=e||{};c.id=g;c.dom=f=e.dom||a.DOM;c.settings=e;if(!a.isIE){d=c.dom.get(c.id)}b(["getPos","getRect","getParent","add","setStyle","getStyle","setStyles","setAttrib","setAttribs","getAttrib","addClass","removeClass","hasClass","getOuterHTML","setOuterHTML","remove","show","hide","isHidden","setHTML","get"],function(h){c[h]=function(){var j=[g],k;for(k=0;k<arguments.length;k++){j.push(arguments[k])}j=f[h].apply(f,j);c.update(h);return j}})},on:function(e,d,c){return a.dom.Event.add(this.id,e,d,c)},getXY:function(){return{x:parseInt(this.getStyle("left")),y:parseInt(this.getStyle("top"))}},getSize:function(){var c=this.dom.get(this.id);return{w:parseInt(this.getStyle("width")||c.clientWidth),h:parseInt(this.getStyle("height")||c.clientHeight)}},moveTo:function(c,d){this.setStyles({left:c,top:d})},moveBy:function(c,e){var d=this.getXY();this.moveTo(d.x+c,d.y+e)},resizeTo:function(c,d){this.setStyles({width:c,height:d})},resizeBy:function(c,e){var d=this.getSize();this.resizeTo(d.w+c,d.h+e)},update:function(d){var e=this,c,f=e.dom;if(a.isIE6&&e.settings.blocker){d=d||"";if(d.indexOf("get")===0||d.indexOf("has")===0||d.indexOf("is")===0){return}if(d=="remove"){f.remove(e.blocker);return}if(!e.blocker){e.blocker=f.uniqueId();c=f.add(e.settings.container||f.getRoot(),"iframe",{id:e.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});f.setStyle(c,"opacity",0)}else{c=f.get(e.blocker)}f.setStyle(c,"left",e.getStyle("left",1));f.setStyle(c,"top",e.getStyle("top",1));f.setStyle(c,"width",e.getStyle("width",1));f.setStyle(c,"height",e.getStyle("height",1));f.setStyle(c,"display",e.getStyle("display",1));f.setStyle(c,"zIndex",parseInt(e.getStyle("zIndex",1)||0)-1)}}})})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(i,g){var f=this,j=f.getRng(),l,k=f.win.document;g=g||{format:"html"};g.set=true;i=g.content=f.dom.processHTML(i);f.onBeforeSetContent.dispatch(f,g);i=g.content;if(j.insertNode){i+='<span id="__caret">_</span>';j.deleteContents();j.insertNode(f.getRng().createContextualFragment(i));l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndAfter(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(1);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.firstChild}return h}else{h=g.startContainer;if(h.nodeName=="BODY"){return h.firstChild}return f.dom.getParent(h,"*")}},getEnd:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(0);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.lastChild}return h}else{h=g.endContainer;if(h.nodeName=="BODY"){return h.lastChild}return f.dom.getParent(h,"*")}},getBookmark:function(x){var j=this,m=j.getRng(),f,n,l,u=j.dom.getViewPort(j.win),v,p,z,o,w=-16777215,k,h=j.dom.getRoot(),g=0,i=0,y;n=u.x;l=u.y;if(x){return{rng:m,scrollX:n,scrollY:l}}if(a){if(m.item){v=m.item(0);d(j.dom.select(v.nodeName),function(s,r){if(v==s){p=r;return false}});return{tag:v.nodeName,index:p,scrollX:n,scrollY:l}}f=j.dom.doc.body.createTextRange();f.moveToElementText(h);f.collapse(true);z=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(true);p=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(false);o=Math.abs(f.move("character",w))-p;return{start:p-z,length:o,scrollX:n,scrollY:l}}v=j.getNode();k=j.getSel();if(!k){return null}if(v&&v.nodeName=="IMG"){return{scrollX:n,scrollY:l}}function q(A,D,t){var s=j.dom.doc.createTreeWalker(A,NodeFilter.SHOW_TEXT,null,false),E,B=0,C={};while((E=s.nextNode())!=null){if(E==D){C.start=B}if(E==t){C.end=B;return C}B+=e(E.nodeValue||"").length}return null}if(k.anchorNode==k.focusNode&&k.anchorOffset==k.focusOffset){v=q(h,k.anchorNode,k.focusNode);if(!v){return{scrollX:n,scrollY:l}}e(k.anchorNode.nodeValue||"").replace(/^\s+/,function(r){g=r.length});return{start:Math.max(v.start+k.anchorOffset-g,0),end:Math.max(v.end+k.focusOffset-g,0),scrollX:n,scrollY:l,beg:k.anchorOffset-g==0}}else{v=q(h,m.startContainer,m.endContainer);if(!v){return{scrollX:n,scrollY:l}}return{start:Math.max(v.start+m.startOffset-g,0),end:Math.max(v.end+m.endOffset-i,0),scrollX:n,scrollY:l,beg:m.startOffset-g==0}}},moveToBookmark:function(n){var o=this,g=o.getRng(),p=o.getSel(),j=o.dom.getRoot(),m,h,k;function i(q,t,D){var B=o.dom.doc.createTreeWalker(q,NodeFilter.SHOW_TEXT,null,false),x,s=0,A={},u,C,z,y;while((x=B.nextNode())!=null){z=y=0;k=x.nodeValue||"";h=e(k).length;s+=h;if(s>=t&&!A.startNode){u=t-(s-h);if(n.beg&&u>=h){continue}A.startNode=x;A.startOffset=u+y}if(s>=D){A.endNode=x;A.endOffset=D-(s-h)+y;return A}}return null}if(!n){return false}o.win.scrollTo(n.scrollX,n.scrollY);if(a){o.tridentSel.destroy();if(g=n.rng){try{g.select()}catch(l){}return true}o.win.focus();if(n.tag){g=j.createControlRange();d(o.dom.select(n.tag),function(r,q){if(q==n.index){g.addElement(r)}})}else{try{if(n.start<0){return true}g=p.createRange();g.moveToElementText(j);g.collapse(true);g.moveStart("character",n.start);g.moveEnd("character",n.length)}catch(f){return true}}try{g.select()}catch(l){}return true}if(!p){return false}if(n.rng){p.removeAllRanges();p.addRange(n.rng)}else{if(b(n.start)&&b(n.end)){try{m=i(j,n.start,n.end);if(m){g=o.dom.doc.createRange();g.setStart(m.startNode,m.startOffset);g.setEnd(m.endNode,m.endOffset);p.removeAllRanges();p.addRange(g)}if(!c.isOpera){o.win.focus()}}catch(l){}}}},select:function(g,l){var p=this,f=p.getRng(),q=p.getSel(),o,m,k,j=p.win.document;function h(u,t){var s,r;if(u){s=j.createTreeWalker(u,NodeFilter.SHOW_TEXT,null,false);while(u=s.nextNode()){r=u;if(c.trim(u.nodeValue).length!=0){if(t){return u}else{r=u}}}}return r}if(a){try{o=j.body;if(/^(IMG|TABLE)$/.test(g.nodeName)){f=o.createControlRange();f.addElement(g)}else{f=o.createTextRange();f.moveToElementText(g)}f.select()}catch(i){}}else{if(l){m=h(g,1)||p.dom.select("br:first",g)[0];k=h(g,0)||p.dom.select("br:last",g)[0];if(m&&k){f=j.createRange();if(m.nodeName=="BR"){f.setStartBefore(m)}else{f.setStart(m,0)}if(k.nodeName=="BR"){f.setEndBefore(k)}else{f.setEnd(k,k.nodeValue.length)}}else{f.selectNode(g)}}else{f.selectNode(g)}p.setRng(f)}return g},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}return !g||h.boundingWidth==0||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i){i=a?g.win.document.body.createTextRange():g.win.document.createRange()}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){h.removeAllRanges();h.addRange(i)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var f=this,h=f.getRng(),g=f.getSel(),i;if(!a){if(!h){return f.dom.getRoot()}i=h.commonAncestorContainer;if(!h.collapsed){if(c.isWebKit&&g.anchorNode&&g.anchorNode.nodeType==1){return g.anchorNode.childNodes[g.anchorOffset]}if(h.startContainer==h.endContainer){if(h.startOffset-h.endOffset<2){if(h.startContainer.hasChildNodes()){i=h.startContainer.childNodes[h.startOffset]}}}}return f.dom.getParent(i,"*")}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,">")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+b+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("<![CDATA["+b+"]]>");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("<!-- "+b+"-->");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"<";case">":return">";case"&":return"&";case'"':return"""}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_|sizset|sizcache)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^<br \/>\s*<\//.test(n)){return"</"+o+">"}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,y,w=["ol","ul"],u,t,q,k=/^(OL|UL)$/,z;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p<o.length;p++){if(r.nodeName==o[p]){return r}}}return null}for(y=0;y<w.length;y++){l=i.dom.select(w[y],s.node);for(u=0;u<l.length;u++){t=l[u];q=t.parentNode;if(k.test(q.nodeName)){z=m(t,"LI");if(!z){z=i.dom.create("li");z.innerHTML=" ";z.appendChild(t);q.insertBefore(z,q.firstChild)}else{z.appendChild(t)}}}}})}if(j.fix_table_elements){i.onPreProcess.add(function(k,l){if(!e.isOpera||opera.buildNumber()>=1767){f(i.dom.select("p table",l.node).reverse(),function(p){var o=i.dom.getParent(p.parentNode,"table,p");if(o.nodeName!="TABLE"){try{i.dom.split(o,p)}catch(m){}}})}})}},setEntities:function(p){var n=this,j,m,h={},o="",k;if(n.entityLookup){return}j=p.split(",");for(m=0;m<j.length;m+=2){k=j[m];if(k==34||k==38||k==60||k==62){continue}h[String.fromCharCode(j[m])]=j[m+1];k=parseInt(j[m]).toString(16);o+="\\u"+"0000".substring(k.length)+k}if(!o){n.settings.entity_encoding="raw";return}n.entitiesRE=new RegExp("["+o+"]","g");n.entityLookup=h},setValidChildRules:function(h){this.childRules=null;this.addValidChildRules(h)},addValidChildRules:function(k){var j=this,l,h,i;if(!k){return}l="A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment";h="A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment";i="H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP";f(k.split(","),function(n){var o=n.split(/\[|\]/),m;n="";f(o[1].split("|"),function(p){if(n){n+="|"}switch(p){case"%itrans":p=h;break;case"%itrans_na":p=h.substring(2);break;case"%istrict":p=l;break;case"%istrict_na":p=l.substring(2);break;case"%btrans":p=i;break;case"%bstrict":p=i;break}n+=p});m=new RegExp("^("+n.toLowerCase()+")$","i");f(o[0].split("/"),function(p){j.childRules=j.childRules||{};j.childRules[p]=m})});k="";f(j.childRules,function(n,m){if(k){k+="|"}k+=m});j.parentElementsRE=new RegExp("^("+k.toLowerCase()+")$","i")},setRules:function(i){var h=this;h._setup();h.rules={};h.wildRules=[];h.validElements={};return h.addRules(i)},addRules:function(i){var h=this,j;if(!i){return}h._setup();f(i.split(","),function(m){var q=m.split(/\[|\]/),l=q[0].split("/"),r,k,o,n=[];if(j){k=e.extend([],j.attribs)}if(q.length>1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t<k.length;t++){if(k[t].name==u[2]){k.splice(t,1);return}}}switch(u[3]){case"=":p.defaultVal=u[4]||"";break;case":":p.forcedVal=u[4];break;case"<":p.validVals=u[4].split("?");break}if(/[*.?]/.test(u[2])){o=o||[];p.nameRE=new RegExp("^"+c(u[2])+"$");o.push(p)}else{p.name=u[2];k.push(p)}n.push(u[2])})}f(l,function(v,u){var w=v.charAt(0),t=1,p={};if(j){if(j.noEmpty){p.noEmpty=j.noEmpty}if(j.fullEnd){p.fullEnd=j.fullEnd}if(j.padd){p.padd=j.padd}}switch(w){case"-":p.noEmpty=true;break;case"+":p.fullEnd=true;break;case"#":p.padd=true;break;default:t=0}l[u]=v=v.substring(t);h.validElements[v]=1;if(/[*.?]/.test(l[0])){p.nameRE=new RegExp("^"+c(l[0])+"$");h.wildRules=h.wildRules||{};h.wildRules.push(p)}else{p.name=l[0];if(l[0]=="@"){j=p}h.rules[v]=p}p.attribs=k;if(r){p.requiredAttribs=r}if(o){v="";f(n,function(s){if(v){v+="|"}v+="("+c(s)+")"});p.validAttribsRE=new RegExp("^"+v.toLowerCase()+"$");p.wildAttribs=o}})});i="";f(h.validElements,function(m,l){if(i){i+="|"}if(l!="@"){i+=l}});h.validElementsRE=new RegExp("^("+c(i.toLowerCase())+")$")},findRule:function(m){var j=this,l=j.rules,h,k;j._setup();k=l[m];if(k){return k}l=j.wildRules;for(h=0;h<l.length;h++){if(l[h].nameRE.test(m)){return l[h]}}return null},findAttribRule:function(h,l){var j,k=h.wildAttribs;for(j=0;j<k.length;j++){if(k[j].nameRE.test(l)){return k[j]}}return null},serialize:function(r,q){var m,k=this,p,i,j,l;k._setup();q=q||{};q.format=q.format||"html";k.processObj=q;if(d){l=[];f(r.getElementsByTagName("option"),function(o){var h=k.dom.getAttrib(o,"selected");l.push(h?h:null)})}r=r.cloneNode(true);if(d){f(r.getElementsByTagName("option"),function(o,h){k.dom.setAttrib(o,"selected",l[h])})}j=r.ownerDocument.implementation;if(j.createHTMLDocument&&(e.isOpera&&opera.buildNumber()>=1767)){p=j.createHTMLDocument("");f(r.nodeName=="BODY"?r.childNodes:[r],function(h){p.body.appendChild(p.importNode(h,true))});if(r.nodeName!="BODY"){r=p.body.firstChild}else{r=p.body}i=k.dom.doc;k.dom.doc=p}k.key=""+(parseInt(k.key)+1);if(!q.no_events){q.node=r;k.onPreProcess.dispatch(k,q)}k.writer.reset();k._serializeNode(r,q.getInner);q.content=k.writer.getContent();if(i){k.dom.doc=i}if(!q.no_events){k.onPostProcess.dispatch(k,q)}k._postProcess(q);q.node=null;return e.trim(q.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<noscript[^>]*>)(.*?)(<\/noscript>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?"<p$1> </p>":"<p$1> </p>");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>");if(k.entity_encoding=="raw"){j=j.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g,"<p$1>\u00a0</p>")}j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return"<noscript"+p+">"+i.dom.decode(o.replace(/<!--|-->/g,""))+"</noscript>"})}n.content=j},_serializeNode:function(D,o){var z=this,A=z.settings,x=z.writer,q,j,u,F,E,G,B,h,y,k,r,C,p,m;if(!A.node_filter||A.node_filter(D)){switch(D.nodeType){case 1:if(D.hasAttribute?D.hasAttribute("mce_bogus"):D.getAttribute("mce_bogus")){return}p=false;q=D.hasChildNodes();k=D.getAttribute("mce_name")||D.nodeName.toLowerCase();if(d){if(D.scopeName!=="HTML"&&D.scopeName!=="html"){k=D.scopeName+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!z.validElementsRE||!z.validElementsRE.test(k)||(z.invalidElementsRE&&z.invalidElementsRE.test(k))||o){p=true;break}if(d){if(A.fix_content_duplication){if(D.mce_serialized==z.key){return}D.mce_serialized=z.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(D.nodeName==="BR"&&D.getAttribute("type")=="_moz"){return}}}if(z.childRules){if(z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(k)){p=true;break}}z.elementName=k}r=z.findRule(k);k=r.name||k;m=A.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){G=r.requiredAttribs;for(F=G.length-1;F>=0;F--){if(this.dom.getAttrib(D,G[F])!==""){break}}if(F==-1){p=true;break}}x.writeStartElement(k);if(r.attribs){for(F=0,B=r.attribs,E=B.length;F<E;F++){G=B[F];y=z._getAttrib(D,G);if(y!==null){x.writeAttribute(G.name,y)}}}if(r.validAttribsRE){B=z.dom.getAttribs(D);for(F=B.length-1;F>-1;F--){h=B[F];if(h.specified){G=h.nodeName.toLowerCase();if(A.invalid_attrs.test(G)||!r.validAttribsRE.test(G)){continue}C=z.findAttribRule(r,G);y=z._getAttrib(D,C,G);if(y!==null){x.writeAttribute(G,y)}}}}if(k==="script"&&e.trim(D.innerHTML)){x.writeText("// ");x.writeCDATA(D.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=D.firstChild)&&u.nodeType===1&&D.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("mce_bogus"):u.getAttribute("mce_bogus")){x.writeText("\u00a0")}}else{if(!q){x.writeText("\u00a0")}}}break;case 3:if(z.childRules&&z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(D.nodeName)){return}}return x.writeText(D.nodeValue);case 4:return x.writeCDATA(D.nodeValue);case 8:return x.writeComment(D.nodeValue)}}else{if(D.nodeType==1){q=D.hasChildNodes()}}if(q&&!m){u=D.firstChild;while(u){z._serializeNode(u);z.elementName=k;u=u.nextSibling}}if(!p){if(!m){x.writeFullEndElement()}else{x.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+"<!--mce:"+(j.items.length-1)+"-->"+p}))});return j},_unprotect:function(i,j){i=i.replace(/\<!--mce:([0-9]+)--\>/g,function(k,h){return j.items[parseInt(h)]});j.items=[];return i},_encode:function(m){var j=this,k=j.settings,i;if(k.entity_encoding!=="raw"){if(k.entity_encoding.indexOf("named")!=-1){j.setEntities(k.entities);i=j.entityLookup;m=m.replace(j.entitiesRE,function(h){var l;if(l=i[h]){h="&"+l+";"}return h})}if(k.entity_encoding.indexOf("numeric")!=-1){m=m.replace(/[\u007E-\uFFFF]/g,function(h){return"&#"+h.charCodeAt(0)+";"})}}return m},_setup:function(){var h=this,i=this.settings;if(h.done){return}h.done=1;h.setRules(i.valid_elements);h.addRules(i.extended_valid_elements);h.addValidChildRules(i.valid_child_elements);if(i.invalid_elements){h.invalidElementsRE=new RegExp("^("+c(i.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(i.attrib_value_filter){h.attribValueFilter=i.attribValueFilter}},_getAttrib:function(m,j,h){var l,k;h=h||j.name;if(j.forcedVal&&(k=j.forcedVal)){if(k==="{$uid}"){return this.dom.uniqueId()}return k}k=this.dom.getAttrib(m,h);switch(h){case"rowspan":case"colspan":if(k=="1"){k=""}break}if(this.attribValueFilter){k=this.attribValueFilter(h,k,m)}if(j.validVals){for(l=j.validVals.length-1;l>=0;l--){if(k==j.validVals[l]){break}}if(l==-1){return null}}if(k===""&&typeof(j.defaultVal)!="undefined"){k=j.defaultVal;if(k==="{$uid}"){return this.dom.uniqueId()}return k}else{if(h=="class"&&this.processObj.get){k=k.replace(/\s?mceItem\w+\s?/g,"")}}if(k===""){return null}return k}})})(tinymce);(function(tinymce){var each=tinymce.each,Event=tinymce.dom.Event;tinymce.create("tinymce.dom.ScriptLoader",{ScriptLoader:function(s){this.settings=s||{};this.queue=[];this.lookup={}},isDone:function(u){return this.lookup[u]?this.lookup[u].state==2:0},markDone:function(u){this.lookup[u]={state:2,url:u}},add:function(u,cb,s,pr){var t=this,lo=t.lookup,o;if(o=lo[u]){if(cb&&o.state==2){cb.call(s||this)}return o}o={state:0,url:u,func:cb,scope:s||this};if(pr){t.queue.unshift(o)}else{t.queue.push(o)}lo[u]=o;return o},load:function(u,cb,s){var t=this,o;if(o=t.lookup[u]){if(cb&&o.state==2){cb.call(s||t)}return o}function loadScript(u){if(Event.domLoaded||t.settings.strict_mode){tinymce.util.XHR.send({url:tinymce._addVer(u),error:t.settings.error,async:false,success:function(co){t.eval(co)}})}else{document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"><\/script>')}}if(!tinymce.is(u,"string")){each(u,function(u){loadScript(u)});if(cb){cb.call(s||t)}}else{loadScript(u);if(cb){cb.call(s||t)}}},loadQueue:function(cb,s){var t=this;if(!t.queueLoading){t.queueLoading=1;t.queueCallbacks=[];t.loadScripts(t.queue,function(){t.queueLoading=0;if(cb){cb.call(s||t)}each(t.queueCallbacks,function(o){o.func.call(o.scope)})})}else{if(cb){t.queueCallbacks.push({func:cb,scope:s||t})}}},eval:function(co){var w=window;if(!w.execScript){try{eval.call(w,co)}catch(ex){eval(co,w)}}else{w.execScript(co)}},loadScripts:function(sc,cb,s){var t=this,lo=t.lookup;function done(o){o.state=2;if(o.func){o.func.call(o.scope||t)}}function allDone(){var l;l=sc.length;each(sc,function(o){o=lo[o.url];if(o.state===2){done(o);l--}else{load(o)}});if(l===0&&cb){cb.call(s||t);cb=0}}function load(o){if(o.state>0){return}o.state=1;tinymce.dom.ScriptLoader.loadScript(o.url,function(){done(o);allDone()})}each(sc,function(o){var u=o.url;if(!lo[u]){lo[u]=o;t.queue.push(o)}else{o=lo[u]}if(o.state>0){return}if(!Event.domLoaded&&!t.settings.strict_mode){var ix,ol="";if(cb||o.func){o.state=1;ix=tinymce.dom.ScriptLoader._addOnLoad(function(){done(o);allDone()});if(tinymce.isIE){ol=' onreadystatechange="'}else{ol=' onload="'}ol+="tinymce.dom.ScriptLoader._onLoad(this,'"+u+"',"+ix+');"'}document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"'+ol+"><\/script>");if(!o.func){done(o)}}else{load(o)}});allDone()},"static":{_addOnLoad:function(f){var t=this;t._funcs=t._funcs||[];t._funcs.push(f);return t._funcs.length-1},_onLoad:function(e,u,ix){if(!tinymce.isIE||e.readyState=="complete"){this._funcs[ix].call(this)}},loadScript:function(u,cb){var id=tinymce.DOM.uniqueId(),e;function done(){Event.clear(id);tinymce.DOM.remove(id);if(cb){cb.call(document,u);cb=0}}if(tinymce.isIE){tinymce.util.XHR.send({url:tinymce._addVer(u),async:false,success:function(co){window.execScript(co);done()}})}else{e=tinymce.DOM.create("script",{id:id,type:"text/javascript",src:tinymce._addVer(u)});Event.add(e,"load",done);(document.getElementsByTagName("head")[0]||document.body).appendChild(e)}}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader()})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(w){var h,t,s;w=w.target;if(w&&(w=c.getParent(w,"tr"))){h=z.items[w.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(w&&c.hasClass(w,m+"ItemSub")){t=c.getRect(w);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}z.onShowMenu.dispatch(z);if(A.keyboard_focus){a.add(o,"keydown",z._keyHandler,z);c.select("a","menu_"+z.id)[0].focus();z._focusIdx=0}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000"});k=c.add(g,"div",{id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_keyHandler:function(j){var i=this,h=j.keyCode;function g(m){var k=i._focusIdx+m,l=c.select("a","menu_"+i.id)[k];if(l){i._focusIdx=k;l.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,"td");i=p=c.add(i,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" />'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";i+="</tr></tbody></table>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(h){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(l){var i=-1,j,k=l.keyCode;e(f.items,function(m,n){if(f.selectedValue==m.value){i=n}});if(k==38){j=f.items[i-1]}else{if(k==40){j=f.items[i+1]}else{if(k==13){j=f.selectedValue;f.selectedValue=null;f.settings.onselect(j);return b.cancel(l)}}}if(j){f.hideMenu();f.select(j.value)}})}f._focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return c.get(this.id).options.length-1},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(j){var i=g.items[j.target.selectedIndex-1];if(i&&(i=i.value)){g.onChange.dispatch(g,i);if(g.settings.onselect){g.settings.onselect(i)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(j){var i;b.remove(g.id,"change",h);i=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.remove(g.id,"blur",i)});if(j.keyCode==13||j.keyCode==32){f(j);return b.cancel(j)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}i+="<td>"+b.createHTML("a",{id:f.id+"_action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});i+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},i)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(i){i=i.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+i},mce_color:"#"+i})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(i){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(i)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(i){var m;i=i.target;if(i.nodeName=="A"&&(m=i.getAttribute("mce_color"))){k.setColor(m)}return a.cancel(i)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: relative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new a(this),get:function(d){return this.lookup[d]},requireLangPack:function(f){var d,e=b.EditorManager.settings;if(e&&e.language){d=this.urls[f]+"/langs/"+e.language+".js";if(!b.dom.Event.domLoaded&&!e.strict_mode){b.ScriptLoader.load(d)}else{b.ScriptLoader.add(d)}}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));b.ScriptLoader.add(e,d,g)}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(f){var g=f.each,h=f.extend,e=f.DOM,a=f.dom.Event,c=f.ThemeManager,b=f.PluginManager,d=f.explode;f.create("static tinymce.EditorManager",{editors:{},i18n:{},activeEditor:null,preInit:function(){var i=this,j=window.location;f.documentBaseURL=j.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(f.documentBaseURL)){f.documentBaseURL+="/"}f.baseURL=new f.util.URI(f.documentBaseURL).toAbsolute(f.baseURL);f.EditorManager.baseURI=new f.util.URI(f.baseURL);i.onBeforeUnload=new f.util.Dispatcher(i);a.add(window,"beforeunload",function(k){i.onBeforeUnload.dispatch(i,k)})},init:function(q){var p=this,l,k=f.ScriptLoader,o,n,i=[],m;function j(u,v,r){var t=u[v];if(!t){return}if(f.is(t,"string")){r=t.replace(/\.\w+$/,"");r=r?f.resolve(r):0;t=f.resolve(t)}return t.apply(r||this,Array.prototype.slice.call(arguments,2))}q=h({theme:"simple",language:"en",strict_loading_mode:document.contentType=="application/xhtml+xml"},q);p.settings=q;if(!a.domLoaded&&!q.strict_loading_mode){if(q.language){k.add(f.baseURL+"/langs/"+q.language+".js")}if(q.theme&&q.theme.charAt(0)!="-"&&!c.urls[q.theme]){c.load(q.theme,"themes/"+q.theme+"/editor_template"+f.suffix+".js")}if(q.plugins){l=d(q.plugins);g(l,function(r){if(r&&r.charAt(0)!="-"&&!b.urls[r]){if(!f.isWebKit&&r=="safari"){return}b.load(r,"plugins/"+r+"/editor_plugin"+f.suffix+".js")}})}k.loadQueue()}a.add(document,"init",function(){var r,t;j(q,"onpageload");if(q.browsers){r=false;g(d(q.browsers),function(u){switch(u){case"ie":case"msie":if(f.isIE){r=true}break;case"gecko":if(f.isGecko){r=true}break;case"safari":case"webkit":if(f.isWebKit){r=true}break;case"opera":if(f.isOpera){r=true}break}});if(!r){return}}switch(q.mode){case"exact":r=q.elements||"";if(r.length>0){g(d(r),function(u){if(e.get(u)){m=new f.Editor(u,q);i.push(m);m.render(1)}else{o=0;g(document.forms,function(v){g(v.elements,function(w){if(w.name===u){u="mce_editor_"+o;e.setAttrib(w,"id",u);m=new f.Editor(u,q);i.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function s(v,u){return u.constructor===RegExp?u.test(v.className):e.hasClass(v,u)}g(e.select("textarea"),function(u){if(q.editor_deselector&&s(u,q.editor_deselector)){return}if(!q.editor_selector||s(u,q.editor_selector)){n=e.get(u.name);if(!u.id&&!n){u.id=u.name}if(!u.id||p.get(u.id)){u.id=e.uniqueId()}m=new f.Editor(u.id,q);i.push(m);m.render(1)}});break}if(q.oninit){r=t=0;g(i,function(u){t++;if(!u.initialized){u.onInit.add(function(){r++;if(r==t){j(q,"oninit")}})}else{r++}if(r==t){j(q,"oninit")}})}})},get:function(i){return this.editors[i]},getInstanceById:function(i){return this.get(i)},add:function(i){this.editors[i.id]=i;this._setActive(i);return i},remove:function(j){var i=this;if(!i.editors[j.id]){return null}delete i.editors[j.id];if(i.activeEditor==j){i._setActive(null);g(i.editors,function(k){i._setActive(k);return false})}j.destroy();return j},execCommand:function(o,m,l){var n=this,k=n.get(l),i;switch(o){case"mceFocus":k.focus();return true;case"mceAddEditor":case"mceAddControl":if(!n.get(l)){new f.Editor(l,n.settings).render()}return true;case"mceAddFrameControl":i=l.window;i.tinyMCE=tinyMCE;i.tinymce=f;f.DOM.doc=i.document;f.DOM.win=i;k=new f.Editor(l.element_id,l);k.render();if(f.isIE){function j(){k.destroy();i.detachEvent("onunload",j);i=i.tinyMCE=i.tinymce=null}i.attachEvent("onunload",j)}l.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(k){k.remove()}return true;case"mceToggleEditor":if(!k){n.execCommand("mceAddControl",0,l);return true}if(k.isHidden()){k.show()}else{k.hide()}return true}if(n.activeEditor){return n.activeEditor.execCommand(o,m,l)}return false},execInstanceCommand:function(m,l,k,j){var i=this.get(m);if(i){return i.execCommand(l,k,j)}return false},triggerSave:function(){g(this.editors,function(i){i.save()})},addI18n:function(k,l){var i,j=this.i18n;if(!f.is(k,"string")){g(k,function(n,m){g(n,function(q,p){g(q,function(s,r){if(p==="common"){j[m+"."+r]=s}else{j[m+"."+p+"."+r]=s}})})})}else{g(l,function(n,m){j[k+"."+m]=n})}},_setActive:function(i){this.selectedInstance=this.activeEditor=i}});f.EditorManager.preInit()})(tinymce);var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(n){var o=n.DOM,k=n.dom.Event,f=n.extend,l=n.util.Dispatcher;var j=n.each,a=n.isGecko,b=n.isIE,e=n.isWebKit;var d=n.is,h=n.ThemeManager,c=n.PluginManager,i=n.EditorManager;var p=n.inArray,m=n.grep,g=n.explode;n.create("tinymce.Editor",{Editor:function(u,r){var q=this;q.id=q.editorId=u;q.execCommands={};q.queryStateCommands={};q.queryValueCommands={};q.isNotDirty=false;q.plugins={};j(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){q[s]=new l(q)});q.settings=r=f({id:u,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:n.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',visual_table_class:"mceItemTable",visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,removeformat_selector:"span,b,strong,em,i,font,u,strike"},r);q.documentBaseURI=new n.util.URI(r.document_base_url||n.documentBaseURL,{base_uri:tinyMCE.baseURI});q.baseURI=i.baseURI;q.execCallback("setup",q)},render:function(u){var v=this,w=v.settings,x=v.id,q=n.ScriptLoader;if(!k.domLoaded){k.add(document,"init",function(){v.render()});return}if(!u){w.strict_loading_mode=1;tinyMCE.settings=w}if(!v.getElement()){return}if(w.strict_loading_mode){q.settings.strict_mode=w.strict_loading_mode;n.DOM.settings.strict=1}if(!/TEXTAREA|INPUT/i.test(v.getElement().nodeName)&&w.hidden_input&&o.getParent(x,"form")){o.insertAfter(o.create("input",{type:"hidden",name:x}),x)}if(n.WindowManager){v.windowManager=new n.WindowManager(v)}if(w.encoding=="xml"){v.onGetContent.add(function(s,t){if(t.save){t.content=o.encode(t.content)}})}if(w.add_form_submit_trigger){v.onSubmit.addToTop(function(){if(v.initialized){v.save();v.isNotDirty=1}})}if(w.add_unload_trigger){v._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(v.initialized&&!v.destroyed&&!v.isHidden()){v.save({format:"raw",no_events:true})}})}n.addUnload(v.destroy,v);if(w.submit_patch){v.onBeforeRenderUI.add(function(){var s=v.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){v.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){i.triggerSave();v.isNotDirty=1;return v.formElement._mceOldSubmit(v.formElement)}}s=null})}function r(){if(w.language){q.add(n.baseURL+"/langs/"+w.language+".js")}if(w.theme&&w.theme.charAt(0)!="-"&&!h.urls[w.theme]){h.load(w.theme,"themes/"+w.theme+"/editor_template"+n.suffix+".js")}j(g(w.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(!e&&s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+n.suffix+".js")}});q.loadQueue(function(){if(!v.removed){v.init()}})}r()},init:function(){var v,F=this,G=F.settings,C,z,B=F.getElement(),r,q,D,y,A,E;i.add(F);if(G.theme){G.theme=G.theme.replace(/-/,"");r=h.get(G.theme);F.theme=new r();if(F.theme.init&&G.init_theme){F.theme.init(F,h.urls[G.theme]||n.documentBaseURL.replace(/\/$/,""))}}j(g(G.plugins.replace(/\-/g,"")),function(w){var H=c.get(w),t=c.urls[w]||n.documentBaseURL.replace(/\/$/,""),s;if(H){s=new H(F,t);F.plugins[w]=s;if(s.init){s.init(F,t)}}});if(G.popup_css!==false){if(G.popup_css){G.popup_css=F.documentBaseURI.toAbsolute(G.popup_css)}else{G.popup_css=F.baseURI.toAbsolute("themes/"+G.theme+"/skins/"+G.skin+"/dialog.css")}}if(G.popup_css_add){G.popup_css+=","+F.documentBaseURI.toAbsolute(G.popup_css_add)}F.controlManager=new n.ControlManager(F);F.undoManager=new n.UndoManager(F);F.undoManager.onAdd.add(function(t,s){if(!s.initial){return F.onChange.dispatch(F,s,t)}});F.undoManager.onUndo.add(function(t,s){return F.onUndo.dispatch(F,s,t)});F.undoManager.onRedo.add(function(t,s){return F.onRedo.dispatch(F,s,t)});if(G.custom_undo_redo){F.onExecCommand.add(function(t,w,u,H,s){if(w!="Undo"&&w!="Redo"&&w!="mceRepaint"&&(!s||!s.skip_undo)){F.undoManager.add()}})}F.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){F.nodeChanged()}});if(a){function x(s,t){if(!t||!t.initial){F.execCommand("mceRepaint")}}F.onUndo.add(x);F.onRedo.add(x);F.onSetContent.add(x)}F.onBeforeRenderUI.dispatch(F,F.controlManager);if(G.render_ui){C=G.width||B.style.width||B.offsetWidth;z=G.height||B.style.height||B.offsetHeight;F.orgDisplay=B.style.display;E=/^[0-9\.]+(|px)$/i;if(E.test(""+C)){C=Math.max(parseInt(C)+(r.deltaWidth||0),100)}if(E.test(""+z)){z=Math.max(parseInt(z)+(r.deltaHeight||0),100)}r=F.theme.renderUI({targetNode:B,width:C,height:z,deltaWidth:G.delta_width,deltaHeight:G.delta_height});F.editorContainer=r.editorContainer}if(document.domain&&location.hostname!=document.domain){n.relaxedDomain=document.domain}o.setStyles(r.sizeContainer||r.editorContainer,{width:C,height:z});z=(r.iframeHeight||z)+(typeof(z)=="number"?(r.deltaHeight||0):"");if(z<100){z=100}F.iframeHTML=G.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(G.document_base_url!=n.documentBaseURL){F.iframeHTML+='<base href="'+F.documentBaseURI.getURI()+'" />'}F.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(n.relaxedDomain){F.iframeHTML+='<script type="text/javascript">document.domain = "'+n.relaxedDomain+'";<\/script>'}y=G.body_id||"tinymce";if(y.indexOf("=")!=-1){y=F.getParam("body_id","","hash");y=y[F.id]||y}A=G.body_class||"";if(A.indexOf("=")!=-1){A=F.getParam("body_class","","hash");A=A[F.id]||""}F.iframeHTML+='</head><body id="'+y+'" class="mceContentBody '+A+'"></body></html>';if(n.relaxedDomain){if(b||(n.isOpera&&parseFloat(opera.version())>=9.5)){D='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+F.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(n.isOpera){D='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}v=o.add(r.iframeContainer,"iframe",{id:F.id+"_ifr",src:D||'javascript:""',frameBorder:"0",style:{width:"100%",height:z}});F.contentAreaContainer=r.iframeContainer;o.get(r.editorContainer).style.display=F.orgDisplay;o.get(F.id).style.display="none";if(!b||!n.relaxedDomain){F.setupIframe()}B=v=r=null},setupIframe:function(){var z=this,A=z.settings,u=o.get(z.id),v=z.getDoc(),r,x;if(!b||!n.relaxedDomain){v.open();v.write(z.iframeHTML);v.close()}if(!b){try{if(!A.readonly){v.designMode="On"}}catch(w){}}if(b){x=z.getBody();o.hide(x);if(!A.readonly){x.contentEditable=true}o.show(x)}z.dom=new n.dom.DOMUtils(z.getDoc(),{keep_values:true,url_converter:z.convertURL,url_converter_scope:z,hex_colors:A.force_hex_style_colors,class_filter:A.class_filter,update_styles:1,fix_ie_paragraphs:1});z.serializer=new n.dom.Serializer(f(A,{valid_elements:A.verify_html===false?"*[*]":A.valid_elements,dom:z.dom}));z.selection=new n.dom.Selection(z.dom,z.getWin(),z.serializer);z.forceBlocks=new n.ForceBlocks(z,{forced_root_block:A.forced_root_block});z.editorCommands=new n.EditorCommands(z);z.serializer.onPreProcess.add(function(s,t){return z.onPreProcess.dispatch(z,t,s)});z.serializer.onPostProcess.add(function(s,t){return z.onPostProcess.dispatch(z,t,s)});z.onPreInit.dispatch(z);if(!A.gecko_spellcheck){z.getBody().spellcheck=0}if(!A.readonly){z._addEvents()}z.controlManager.onPostRender.dispatch(z,z.controlManager);z.onPostRender.dispatch(z);if(A.directionality){z.getBody().dir=A.directionality}if(A.nowrap){z.getBody().style.whiteSpace="nowrap"}if(A.custom_elements){function y(s,t){j(g(A.custom_elements),function(B){var C;if(B.indexOf("~")===0){B=B.substring(1);C="span"}else{C="div"}t.content=t.content.replace(new RegExp("<("+B+")([^>]*)>","g"),"<"+C+' mce_name="$1"$2>');t.content=t.content.replace(new RegExp("</("+B+")>","g"),"</"+C+">")})}z.onBeforeSetContent.add(y);z.onPostProcess.add(function(s,t){if(t.set){y(s,t)}})}if(A.handle_node_change_callback){z.onNodeChange.add(function(t,s,B){z.execCallback("handle_node_change_callback",z.id,B,-1,-1,true,z.selection.isCollapsed())})}if(A.save_callback){z.onSaveContent.add(function(s,B){var t=z.execCallback("save_callback",z.id,B.content,z.getBody());if(t){B.content=t}})}if(A.onchange_callback){z.onChange.add(function(t,s){z.execCallback("onchange_callback",z,s)})}if(A.convert_newlines_to_brs){z.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(A.fix_nesting&&b){z.onBeforeSetContent.add(function(s,t){t.content=z._fixNesting(t.content)})}if(A.preformatted){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(A.verify_css_classes){z.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!z.classesRE){t=z.dom.getClasses();if(t.length>0){C="";j(t,function(s){C+=(C?"|":"")+s["class"]});z.classesRE=new RegExp("("+C+")","gi")}}return !z.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||z.classesRE.test(B)?B:""}return B}}if(A.convert_fonts_to_spans){z._convertFonts()}if(A.inline_styles){z._convertInlineElements()}if(A.cleanup_callback){z.onBeforeSetContent.add(function(s,t){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)});z.onPreProcess.add(function(s,t){if(t.set){z.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){z.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});z.onPostProcess.add(function(s,t){if(t.set){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=z.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(A.save_callback){z.onGetContent.add(function(s,t){if(t.save){t.content=z.execCallback("save_callback",z.id,t.content,z.getBody())}})}if(A.handle_event_callback){z.onEvent.add(function(s,t,B){if(z.execCallback("handle_event_callback",t,s,B)===false){k.cancel(t)}})}z.onSetContent.add(function(){z.addVisual(z.getBody())});if(A.padd_empty_editor){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function q(s,t){j(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{mce_bogus:1})}})}z.onExecCommand.add(function(s,t){if(t==="CreateLink"){q(s)}});z.onSetContent.add(z.selection.onSetContent.add(q));if(!A.readonly){try{v.designMode="Off";v.designMode="On"}catch(w){}}}setTimeout(function(){if(z.removed){return}z.load({initial:true,format:(A.cleanup_on_startup?"html":"raw")});z.startContent=z.getContent({format:"raw"});z.undoManager.add({initial:true});z.initialized=true;z.onInit.dispatch(z);z.execCallback("setupcontent_callback",z.id,z.getBody(),z.getDoc());z.execCallback("init_instance_callback",z);z.focus(true);z.nodeChanged({initial:1});if(A.content_css){n.each(g(A.content_css),function(s){z.dom.loadCSS(z.documentBaseURI.toAbsolute(s))})}if(A.auto_focus){setTimeout(function(){var s=i.get(A.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);u=null},focus:function(r){var u,q=this,s=q.settings.content_editable;if(!r){if(!s&&(!b||q.selection.getNode().ownerDocument!=q.getDoc())){q.getWin().focus()}}if(i.activeEditor!=q){if((u=i.activeEditor)!=null){u.onDeactivate.dispatch(u,q)}q.onActivate.dispatch(q,u)}i._setActive(q)},execCallback:function(v){var q=this,u=q.settings[v],r;if(!u){return}if(q.callbackLookup&&(r=q.callbackLookup[v])){u=r.func;r=r.scope}if(d(u,"string")){r=u.replace(/\.\w+$/,"");r=r?n.resolve(r):0;u=n.resolve(u);q.callbackLookup=q.callbackLookup||{};q.callbackLookup[v]={func:u,scope:r}}return u.apply(r||q,Array.prototype.slice.call(arguments,1))},translate:function(q){var t=this.settings.language||"en",r=i.i18n;if(!q){return""}return r[t+"."+q]||q.replace(/{\#([^}]+)\}/g,function(u,s){return r[t+"."+s]||"{#"+s+"}"})},getLang:function(r,q){return i.i18n[(this.settings.language||"en")+"."+r]||(d(q)?q:"{#"+r+"}")},getParam:function(w,s,q){var t=n.trim,r=d(this.settings[w])?this.settings[w]:s,u;if(q==="hash"){u={};if(d(r,"string")){j(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(x){x=x.split("=");if(x.length>1){u[t(x[0])]=t(x[1])}else{u[t(x[0])]=t(x)}})}else{u=r}return u}return r},nodeChanged:function(u){var q=this,r=q.selection,v=r.getNode()||q.getBody();if(q.initialized){q.onNodeChange.dispatch(q,u?u.controlManager||q.controlManager:q.controlManager,b&&v.ownerDocument!=q.getDoc()?q.getBody():v,r.isCollapsed(),u)}},addButton:function(u,r){var q=this;q.buttons=q.buttons||{};q.buttons[u]=r},addCommand:function(t,r,q){this.execCommands[t]={func:r,scope:q||this}},addQueryStateHandler:function(t,r,q){this.queryStateCommands[t]={func:r,scope:q||this}},addQueryValueHandler:function(t,r,q){this.queryValueCommands[t]={func:r,scope:q||this}},addShortcut:function(s,v,q,u){var r=this,w;if(!r.settings.custom_shortcuts){return false}r.shortcuts=r.shortcuts||{};if(d(q,"string")){w=q;q=function(){r.execCommand(w,false,null)}}if(d(q,"object")){w=q;q=function(){r.execCommand(w[0],w[1],w[2])}}j(g(s),function(t){var x={func:q,scope:u||this,desc:v,alt:false,ctrl:false,shift:false};j(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});r.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,w,z,q){var u=this,v=0,y,r;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!q||!q.skip_focus)){u.focus()}y={};u.onBeforeExecCommand.dispatch(u,x,w,z,y);if(y.terminate){return false}if(u.execCallback("execcommand_callback",u.id,u.selection.getNode(),x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(y=u.execCommands[x]){r=y.func.call(y.scope,w,z);if(r!==true){u.onExecCommand.dispatch(u,x,w,z,q);return r}}j(u.plugins,function(s){if(s.execCommand&&s.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);v=1;return false}});if(v){return true}if(u.theme&&u.theme.execCommand&&u.theme.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(n.GlobalCommands.execCommand(u,x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(u.editorCommands.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}u.getDoc().execCommand(x,w,z);u.onExecCommand.dispatch(u,x,w,z,q)},queryCommandState:function(w){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryStateCommands[w]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandState(w);if(v!==-1){return v}try{return this.getDoc().queryCommandState(w)}catch(q){}},queryCommandValue:function(w){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryValueCommands[w]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandValue(w);if(d(v)){return v}try{return this.getDoc().queryCommandValue(w)}catch(q){}},show:function(){var q=this;o.show(q.getContainer());o.hide(q.id);q.load()},hide:function(){var q=this,r=q.getDoc();if(b&&r){r.execCommand("SelectAll")}q.save();o.hide(q.getContainer());o.setStyle(q.id,"display",q.orgDisplay)},isHidden:function(){return !o.isHidden(this.id)},setProgressState:function(q,r,s){this.onSetProgressState.dispatch(this,q,r,s);return q},load:function(u){var q=this,s=q.getElement(),r;if(s){u=u||{};u.load=true;r=q.setContent(d(s.value)?s.value:s.innerHTML,u);u.element=s;if(!u.no_events){q.onLoadContent.dispatch(q,u)}u.element=s=null;return r}},save:function(v){var q=this,u=q.getElement(),r,s;if(!u||!q.initialized){return}v=v||{};v.save=true;if(!v.no_events){q.undoManager.typing=0;q.undoManager.add()}v.element=u;r=v.content=q.getContent(v);if(!v.no_events){q.onSaveContent.dispatch(q,v)}r=v.content;if(!/TEXTAREA|INPUT/i.test(u.nodeName)){u.innerHTML=r;if(s=o.getParent(q.id,"form")){j(s.elements,function(t){if(t.name==q.id){t.value=r;return false}})}}else{u.value=r}v.element=u=null;return r},setContent:function(r,s){var q=this;s=s||{};s.format=s.format||"html";s.set=true;s.content=r;if(!s.no_events){q.onBeforeSetContent.dispatch(q,s)}if(!n.isIE&&(r.length===0||/^\s+$/.test(r))){s.content=q.dom.setHTML(q.getBody(),'<br mce_bogus="1" />');s.format="raw"}s.content=q.dom.setHTML(q.getBody(),n.trim(s.content));if(s.format!="raw"&&q.settings.cleanup){s.getInner=true;s.content=q.dom.setHTML(q.getBody(),q.serializer.serialize(q.getBody(),s))}if(!s.no_events){q.onSetContent.dispatch(q,s)}return s.content},getContent:function(s){var q=this,r;s=s||{};s.format=s.format||"html";s.get=true;if(!s.no_events){q.onBeforeGetContent.dispatch(q,s)}if(s.format!="raw"&&q.settings.cleanup){s.getInner=true;r=q.serializer.serialize(q.getBody(),s)}else{r=q.getBody().innerHTML}r=r.replace(/^\s*|\s*$/g,"");s.content=r;if(!s.no_events){q.onGetContent.dispatch(q,s)}return s.content},isDirty:function(){var q=this;return n.trim(q.startContent)!=n.trim(q.getContent({format:"raw",no_events:1}))&&!q.isNotDirty},getContainer:function(){var q=this;if(!q.container){q.container=o.get(q.editorContainer||q.id+"_parent")}return q.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return o.get(this.settings.content_element||this.id)},getWin:function(){var q=this,r;if(!q.contentWindow){r=o.get(q.id+"_ifr");if(r){q.contentWindow=r.contentWindow}}return q.contentWindow},getDoc:function(){var r=this,q;if(!r.contentDocument){q=r.getWin();if(q){r.contentDocument=q.document}}return r.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(q,x,w){var r=this,v=r.settings;if(v.urlconverter_callback){return r.execCallback("urlconverter_callback",q,w,true,x)}if(!v.convert_urls||(w&&w.nodeName=="LINK")||q.indexOf("file:")===0){return q}if(v.relative_urls){return r.documentBaseURI.toRelative(q)}q=r.documentBaseURI.toAbsolute(q,v.remove_script_host);return q},addVisual:function(u){var q=this,r=q.settings;u=u||q.getBody();if(!d(q.hasVisual)){q.hasVisual=r.visual}j(q.dom.select("table,a",u),function(t){var s;switch(t.nodeName){case"TABLE":s=q.dom.getAttrib(t,"border");if(!s||s=="0"){if(q.hasVisual){q.dom.addClass(t,r.visual_table_class)}else{q.dom.removeClass(t,r.visual_table_class)}}return;case"A":s=q.dom.getAttrib(t,"name");if(s){if(q.hasVisual){q.dom.addClass(t,"mceItemAnchor")}else{q.dom.removeClass(t,"mceItemAnchor")}}return}});q.onVisualAid.dispatch(q,u,q.hasVisual)},remove:function(){var q=this,r=q.getContainer();q.removed=1;q.hide();q.execCallback("remove_instance_callback",q);q.onRemove.dispatch(q);q.onExecCommand.listeners=[];i.remove(q);o.remove(r)},destroy:function(r){var q=this;if(q.destroyed){return}if(!r){n.removeUnload(q.destroy);tinyMCE.onBeforeUnload.remove(q._beforeUnload);if(q.theme&&q.theme.destroy){q.theme.destroy()}q.controlManager.destroy();q.selection.destroy();q.dom.destroy();if(!q.settings.content_editable){k.clear(q.getWin());k.clear(q.getDoc())}k.clear(q.getBody());k.clear(q.formElement)}if(q.formElement){q.formElement.submit=q.formElement._mceOldSubmit;q.formElement._mceOldSubmit=null}q.contentAreaContainer=q.formElement=q.container=q.settings.content_element=q.bodyElement=q.contentDocument=q.contentWindow=null;if(q.selection){q.selection=q.selection.win=q.selection.dom=q.selection.dom.doc=null}q.destroyed=1},_addEvents:function(){var w=this,v,y=w.settings,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function u(t,A){var s=t.type;if(w.removed){return}if(w.onEvent.dispatch(w,t,A)!==false){w[x[t.fakeType||t.type]].dispatch(w,t,A)}}j(x,function(t,s){switch(s){case"contextmenu":if(n.isOpera){w.dom.bind(w.getBody(),"mousedown",function(A){if(A.ctrlKey){A.fakeType="contextmenu";u(A)}})}else{w.dom.bind(w.getBody(),s,u)}break;case"paste":w.dom.bind(w.getBody(),s,function(A){u(A)});break;case"submit":case"reset":w.dom.bind(w.getElement().form||o.getParent(w.id,"form"),s,u);break;default:w.dom.bind(y.content_editable?w.getBody():w.getDoc(),s,u)}});w.dom.bind(y.content_editable?w.getBody():(a?w.getDoc():w.getWin()),"focus",function(s){w.focus(true)});if(n.isGecko){w.dom.bind(w.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("mce_src"))){t.src=w.documentBaseURI.toAbsolute(s)}})}if(a){function q(){var B=this,D=B.getDoc(),C=B.settings;if(a&&!C.readonly){if(B._isHidden()){try{if(!C.content_editable){D.designMode="On"}}catch(A){}}try{D.execCommand("styleWithCSS",0,false)}catch(A){if(!B._isHidden()){try{D.execCommand("useCSS",0,true)}catch(A){}}}if(!C.table_inline_editing){try{D.execCommand("enableInlineTableEditing",false,false)}catch(A){}}if(!C.object_resizing){try{D.execCommand("enableObjectResizing",false,false)}catch(A){}}}}w.onBeforeExecCommand.add(q);w.onMouseDown.add(q)}w.onMouseUp.add(w.nodeChanged);w.onClick.add(w.nodeChanged);w.onKeyUp.add(function(s,t){var A=t.keyCode;if((A>=33&&A<=36)||(A>=37&&A<=40)||A==13||A==45||A==46||A==8||(n.isMac&&(A==91||A==93))||t.ctrlKey){w.nodeChanged()}});w.onReset.add(function(){w.setContent(w.startContent,{format:"raw"})});if(y.custom_shortcuts){if(y.custom_undo_redo_keyboard_shortcuts){w.addShortcut("ctrl+z",w.getLang("undo_desc"),"Undo");w.addShortcut("ctrl+y",w.getLang("redo_desc"),"Redo")}if(a){w.addShortcut("ctrl+b",w.getLang("bold_desc"),"Bold");w.addShortcut("ctrl+i",w.getLang("italic_desc"),"Italic");w.addShortcut("ctrl+u",w.getLang("underline_desc"),"Underline")}for(v=1;v<=6;v++){w.addShortcut("ctrl+"+v,"",["FormatBlock",false,"<h"+v+">"])}w.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);w.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);w.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function z(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}j(w.shortcuts,function(A){if(n.isMac&&A.ctrl!=t.metaKey){return}else{if(!n.isMac&&A.ctrl!=t.ctrlKey){return}}if(A.alt!=t.altKey){return}if(A.shift!=t.shiftKey){return}if(t.keyCode==A.keyCode||(t.charCode&&t.charCode==A.charCode)){s=A;return false}});return s}w.onKeyUp.add(function(s,t){var A=z(t);if(A){return k.cancel(t)}});w.onKeyPress.add(function(s,t){var A=z(t);if(A){return k.cancel(t)}});w.onKeyDown.add(function(s,t){var A=z(t);if(A){A.func.call(A.scope);return k.cancel(t)}})}if(n.isIE){w.dom.bind(w.getDoc(),"controlselect",function(A){var t=w.resizeInfo,s;A=A.target;if(A.nodeName!=="IMG"){return}if(t){w.dom.unbind(t.node,t.ev,t.cb)}if(!w.dom.hasClass(A,"mceItemNoResize")){ev="resizeend";s=w.dom.bind(A,ev,function(C){var B;C=C.target;if(B=w.dom.getStyle(C,"width")){w.dom.setAttrib(C,"width",B.replace(/[^0-9%]+/g,""));w.dom.setStyle(C,"width","")}if(B=w.dom.getStyle(C,"height")){w.dom.setAttrib(C,"height",B.replace(/[^0-9%]+/g,""));w.dom.setStyle(C,"height","")}})}else{ev="resizestart";s=w.dom.bind(A,"resizestart",k.cancel,k)}t=w.resizeInfo={node:A,ev:ev,cb:s}});w.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(w.selection.getRng().item){w.selection.getRng().item(0).removeNode();return k.cancel(t)}}})}if(n.isOpera){w.onClick.add(function(s,t){k.prevent(t)})}if(y.custom_undo_redo){function r(){w.undoManager.typing=0;w.undoManager.add()}if(n.isIE){w.dom.bind(w.getWin(),"blur",function(s){var t;if(w.selection){t=w.selection.getNode();if(!w.removed&&t.ownerDocument&&t.ownerDocument!=w.getDoc()){r()}}})}else{w.dom.bind(w.getDoc(),"blur",function(){if(w.selection&&!w.removed){r()}})}w.onMouseDown.add(r);w.onKeyUp.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){w.undoManager.typing=0;w.undoManager.add()}});w.onKeyDown.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45){if(w.undoManager.typing){w.undoManager.add();w.undoManager.typing=0}return}if(!w.undoManager.typing){w.undoManager.add();w.undoManager.typing=1}})}},_convertInlineElements:function(){var z=this,B=z.settings,r=z.dom,y,w,u,A,q;function x(s,t){if(!B.inline_styles){return}if(t.get){j(z.dom.select("table,u,strike",t.node),function(v){switch(v.nodeName){case"TABLE":if(y=r.getAttrib(v,"height")){r.setStyle(v,"height",y);r.setAttrib(v,"height","")}break;case"U":case"STRIKE":v.style.textDecoration=v.nodeName=="U"?"underline":"line-through";r.setAttrib(v,"mce_style","");r.setAttrib(v,"mce_name","span");break}})}else{if(t.set){j(z.dom.select("table,span",t.node).reverse(),function(v){if(v.nodeName=="TABLE"){if(y=r.getStyle(v,"height")){r.setAttrib(v,"height",y.replace(/[^0-9%]+/g,""))}}else{if(v.style.textDecoration=="underline"){u="u"}else{if(v.style.textDecoration=="line-through"){u="strike"}else{u=""}}if(u){v.style.textDecoration="";r.setAttrib(v,"mce_style","");w=r.create(u,{style:r.getAttrib(v,"style")});r.replace(w,v,1)}}})}}}z.onPreProcess.add(x);if(!B.cleanup_on_startup){z.onSetContent.add(function(s,t){if(t.initial){x(z,{node:z.getBody(),set:1})}})}},_convertFonts:function(){var w=this,x=w.settings,z=w.dom,v,r,q,u;if(!x.inline_styles){return}v=[8,10,12,14,18,24,36];r=["xx-small","x-small","small","medium","large","x-large","xx-large"];if(q=x.font_size_style_values){q=g(q)}if(u=x.font_size_classes){u=g(u)}function y(B){var C,A,t,s;if(!x.inline_styles){return}t=w.dom.select("font",B);for(s=t.length-1;s>=0;s--){C=t[s];A=z.create("span",{style:z.getAttrib(C,"style"),"class":z.getAttrib(C,"class")});z.setStyles(A,{fontFamily:z.getAttrib(C,"face"),color:z.getAttrib(C,"color"),backgroundColor:C.style.backgroundColor});if(C.size){if(q){z.setStyle(A,"fontSize",q[parseInt(C.size)-1])}else{z.setAttrib(A,"class",u[parseInt(C.size)-1])}}z.setAttrib(A,"mce_style","");z.replace(A,C,1)}}w.onPreProcess.add(function(s,t){if(t.get){y(t.node)}});w.onSetContent.add(function(s,t){if(t.initial){y(t.node)}})},_isHidden:function(){var q;if(!a){return 0}q=this.selection.getSel();return(!q||!q.rangeCount||q.rangeCount==0)},_fixNesting:function(r){var t=[],q;r=r.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(u,s,w){var v;if(s==="/"){if(!t.length){return""}if(w!==t[t.length-1].tag){for(q=t.length-1;q>=0;q--){if(t[q].tag===w){t[q].close=1;break}}return""}else{t.pop();if(t.length&&t[t.length-1].close){u=u+"</"+t[t.length-1].tag+">";t.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(w)){return u}if(/\/>$/.test(u)){return u}t.push({tag:w})}return u});for(q=t.length-1;q>=0;q--){r+="</"+t[q].tag+">"}return r}})})(tinymce);(function(d){var f=d.each,c=d.isIE,a=d.isGecko,b=d.isOpera,e=d.isWebKit;d.create("tinymce.EditorCommands",{EditorCommands:function(g){this.editor=g},execCommand:function(k,j,l){var h=this,g=h.editor,i;switch(k){case"mceResetDesignMode":case"mceBeginUndoLevel":return true;case"unlink":h.UnLink();return true;case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":h.mceJustify(k,k.substring(7).toLowerCase());return true;default:i=this[k];if(i){i.call(this,j,l);return true}}return false},Indent:function(){var g=this.editor,l=g.dom,j=g.selection,k,h,i;h=g.settings.indentation;i=/[a-z%]+$/i.exec(h);h=parseInt(h);if(g.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){f(j.getSelectedBlocks(),function(m){l.setStyle(m,"paddingLeft",(parseInt(m.style.paddingLeft||0)+h)+i)});return}g.getDoc().execCommand("Indent",false,null);if(c){l.getParent(j.getNode(),function(m){if(m.nodeName=="BLOCKQUOTE"){m.dir=m.style.cssText=""}})}},Outdent:function(){var h=this.editor,m=h.dom,k=h.selection,l,g,i,j;i=h.settings.indentation;j=/[a-z%]+$/i.exec(i);i=parseInt(i);if(h.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){f(k.getSelectedBlocks(),function(n){g=Math.max(0,parseInt(n.style.paddingLeft||0)-i);m.setStyle(n,"paddingLeft",g?g+j:"")});return}h.getDoc().execCommand("Outdent",false,null)},mceSetContent:function(h,g){this.editor.setContent(g)},mceToggleVisualAid:function(){var g=this.editor;g.hasVisual=!g.hasVisual;g.addVisual()},mceReplaceContent:function(h,g){var i=this.editor.selection;i.setContent(g.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(i,h){var g=this.editor,j=g.selection,k=g.dom.getParent(j.getNode(),"a");if(d.is(h,"string")){h={href:h}}function l(m){f(h,function(o,n){g.dom.setAttrib(m,n,o)})}if(!k){g.execCommand("CreateLink",false,"javascript:mctmp(0);");f(g.dom.select("a[href=javascript:mctmp(0);]"),function(m){l(m)})}else{if(h.href){l(k)}else{g.dom.remove(k,1)}}},UnLink:function(){var g=this.editor,h=g.selection;if(h.isCollapsed()){h.select(h.getNode())}g.getDoc().execCommand("unlink",false,null);h.collapse(0)},FontName:function(i,h){var j=this,g=j.editor,k=g.selection,l;if(!h){if(k.isCollapsed()){k.select(k.getNode())}}else{if(g.settings.convert_fonts_to_spans){j._applyInlineStyle("span",{style:{fontFamily:h}})}else{g.getDoc().execCommand("FontName",false,h)}}},FontSize:function(j,i){var h=this.editor,l=h.settings,k,g;if(l.convert_fonts_to_spans&&i>=1&&i<=7){g=d.explode(l.font_size_style_values);k=d.explode(l.font_size_classes);if(k){i=k[i-1]||i}else{i=g[i-1]||i}}if(i>=1&&i<=7){h.getDoc().execCommand("FontSize",false,i)}else{this._applyInlineStyle("span",{style:{fontSize:i}})}},queryCommandValue:function(h){var g=this["queryValue"+h];if(g){return g.call(this,h)}return false},queryCommandState:function(h){var g;switch(h){case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":return this.queryStateJustify(h,h.substring(7).toLowerCase());default:if(g=this["queryState"+h]){return g.call(this,h)}}return -1},_queryState:function(h){try{return this.editor.getDoc().queryCommandState(h)}catch(g){}},_queryVal:function(h){try{return this.editor.getDoc().queryCommandValue(h)}catch(g){}},queryValueFontSize:function(){var h=this.editor,g=0,i;if(i=h.dom.getParent(h.selection.getNode(),"span")){g=i.style.fontSize}if(!g&&(b||e)){if(i=h.dom.getParent(h.selection.getNode(),"font")){g=i.size}return g}return g||this._queryVal("FontSize")},queryValueFontName:function(){var h=this.editor,g=0,i;if(i=h.dom.getParent(h.selection.getNode(),"font")){g=i.face}if(i=h.dom.getParent(h.selection.getNode(),"span")){g=i.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}if(!g){g=this._queryVal("FontName")}return g},mceJustify:function(o,p){var k=this.editor,m=k.selection,g=m.getNode(),q=g.nodeName,h,j,i=k.dom,l;if(k.settings.inline_styles&&this.queryStateJustify(o,p)){l=1}h=i.getParent(g,k.dom.isBlock);if(q=="IMG"){if(p=="full"){return}if(l){if(p=="center"){i.setStyle(h||g.parentNode,"textAlign","")}i.setStyle(g,"float","");this.mceRepaint();return}if(p=="center"){if(h&&/^(TD|TH)$/.test(h.nodeName)){h=0}if(!h||h.childNodes.length>1){j=i.create("p");j.appendChild(g.cloneNode(false));if(h){i.insertAfter(j,h)}else{i.insertAfter(j,g)}i.remove(g);g=j.firstChild;h=j}i.setStyle(h,"textAlign",p);i.setStyle(g,"float","")}else{i.setStyle(g,"float",p);i.setStyle(h||g.parentNode,"textAlign","")}this.mceRepaint();return}if(k.settings.inline_styles&&k.settings.forced_root_block){if(l){p=""}f(m.getSelectedBlocks(i.getParent(m.getStart(),i.isBlock),i.getParent(m.getEnd(),i.isBlock)),function(n){i.setAttrib(n,"align","");i.setStyle(n,"textAlign",p=="full"?"justify":p)});return}else{if(!l){k.getDoc().execCommand(o,false,null)}}if(k.settings.inline_styles){if(l){i.getParent(k.selection.getNode(),function(r){if(r.style&&r.style.textAlign){i.setStyle(r,"textAlign","")}});return}f(i.select("*"),function(s){var r=s.align;if(r){if(r=="full"){r="justify"}i.setStyle(s,"textAlign",r);i.setAttrib(s,"align","")}})}},mceSetCSSClass:function(h,g){this.mceSetStyleInfo(0,{command:"setattrib",name:"class",value:g})},getSelectedElement:function(){var w=this,o=w.editor,n=o.dom,s=o.selection,h=s.getRng(),l,k,u,p,j,g,q,i,x,v;if(s.isCollapsed()||h.item){return s.getNode()}v=o.settings.merge_styles_invalid_parents;if(d.is(v,"string")){v=new RegExp(v,"i")}if(c){l=h.duplicate();l.collapse(true);u=l.parentElement();k=h.duplicate();k.collapse(false);p=k.parentElement();if(u!=p){l.move("character",1);u=l.parentElement()}if(u==p){l=h.duplicate();l.moveToElementText(u);if(l.compareEndPoints("StartToStart",h)==0&&l.compareEndPoints("EndToEnd",h)==0){return v&&v.test(u.nodeName)?null:u}}}else{function m(r){return n.getParent(r,"*")}u=h.startContainer;p=h.endContainer;j=h.startOffset;g=h.endOffset;if(!h.collapsed){if(u==p){if(j-g<2){if(u.hasChildNodes()){i=u.childNodes[j];return v&&v.test(i.nodeName)?null:i}}}}if(u.nodeType!=3||p.nodeType!=3){return null}if(j==0){i=m(u);if(i&&i.firstChild!=u){i=null}}if(j==u.nodeValue.length){q=u.nextSibling;if(q&&q.nodeType==1){i=u.nextSibling}}if(g==0){q=p.previousSibling;if(q&&q.nodeType==1){x=q}}if(g==p.nodeValue.length){x=m(p);if(x&&x.lastChild!=p){x=null}}if(i==x){return v&&i&&v.test(i.nodeName)?null:i}}return null},mceSetStyleInfo:function(n,m){var q=this,h=q.editor,j=h.getDoc(),g=h.dom,i,k,r=h.selection,p=m.wrapper||"span",k=r.getBookmark(),o;function l(t,s){if(t.nodeType==1){switch(m.command){case"setattrib":return g.setAttrib(t,m.name,m.value);case"setstyle":return g.setStyle(t,m.name,m.value);case"removeformat":return g.setAttrib(t,"class","")}}}o=h.settings.merge_styles_invalid_parents;if(d.is(o,"string")){o=new RegExp(o,"i")}if((i=q.getSelectedElement())&&!h.settings.force_span_wrappers){l(i,1)}else{j.execCommand("FontName",false,"__");f(g.select("span,font"),function(u){var s,t;if(g.getAttrib(u,"face")=="__"||u.style.fontFamily==="__"){s=g.create(p,{mce_new:"1"});l(s);f(u.childNodes,function(v){s.appendChild(v.cloneNode(true))});g.replace(s,u)}})}f(g.select(p).reverse(),function(t){var s=t.parentNode;if(!g.getAttrib(t,"mce_new")){s=g.getParent(t,"*[mce_new]");if(s){g.remove(t,1)}}});f(g.select(p).reverse(),function(t){var s=t.parentNode;if(!s||!g.getAttrib(t,"mce_new")){return}if(h.settings.force_span_wrappers&&s.nodeName!="SPAN"){return}if(s.nodeName==p.toUpperCase()&&s.childNodes.length==1){return g.remove(s,1)}if(t.nodeType==1&&(!o||!o.test(s.nodeName))&&s.childNodes.length==1){l(s);g.setAttrib(t,"class","")}});f(g.select(p).reverse(),function(s){if(g.getAttrib(s,"mce_new")||(g.getAttribs(s).length<=1&&s.className==="")){if(!g.getAttrib(s,"class")&&!g.getAttrib(s,"style")){return g.remove(s,1)}g.setAttrib(s,"mce_new","")}});r.moveToBookmark(k)},queryStateJustify:function(k,h){var g=this.editor,j=g.selection.getNode(),i=g.dom;if(j&&j.nodeName=="IMG"){if(i.getStyle(j,"float")==h){return 1}return j.parentNode.style.textAlign==h}j=i.getParent(g.selection.getStart(),function(l){return l.nodeType==1&&l.style.textAlign});if(h=="full"){h="justify"}if(g.settings.inline_styles){return(j&&j.style.textAlign==h)}return this._queryState(k)},ForeColor:function(i,h){var g=this.editor;if(g.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{color:h}});return}else{g.getDoc().execCommand("ForeColor",false,h)}},HiliteColor:function(i,k){var h=this,g=h.editor,j=g.getDoc();if(g.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{backgroundColor:k}});return}function l(n){if(!a){return}try{j.execCommand("styleWithCSS",0,n)}catch(m){j.execCommand("useCSS",0,!n)}}if(a||b){l(true);j.execCommand("hilitecolor",false,k);l(false)}else{j.execCommand("BackColor",false,k)}},FormatBlock:function(n,h){var o=this,l=o.editor,p=l.selection,j=l.dom,g,k,m;function i(q){return/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(q.nodeName)}g=j.getParent(p.getNode(),function(q){return i(q)});if(g){if((c&&i(g.parentNode))||g.nodeName=="DIV"){k=l.dom.create(h);f(j.getAttribs(g),function(q){j.setAttrib(k,q.nodeName,j.getAttrib(g,q.nodeName))});m=p.getBookmark();j.replace(k,g,1);p.moveToBookmark(m);l.nodeChanged();return}}h=l.settings.forced_root_block?(h||"<p>"):h;if(h.indexOf("<")==-1){h="<"+h+">"}if(d.isGecko){h=h.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,"$1")}l.getDoc().execCommand("FormatBlock",false,h)},mceCleanup:function(){var h=this.editor,i=h.selection,g=i.getBookmark();h.setContent(h.getContent());i.moveToBookmark(g)},mceRemoveNode:function(j,k){var h=this.editor,i=h.selection,g,l=k||i.getNode();if(l==h.getBody()){return}g=i.getBookmark();h.dom.remove(l,1);i.moveToBookmark(g);h.nodeChanged()},mceSelectNodeDepth:function(i,j){var g=this.editor,h=g.selection,k=0;g.dom.getParent(h.getNode(),function(l){if(l.nodeType==1&&k++==j){h.select(l);g.nodeChanged();return false}},g.getBody())},mceSelectNode:function(h,g){this.editor.selection.select(g)},mceInsertContent:function(g,h){this.editor.selection.setContent(h)},mceInsertRawHTML:function(h,i){var g=this.editor;g.selection.setContent("tiny_mce_marker");g.setContent(g.getContent().replace(/tiny_mce_marker/g,i))},mceRepaint:function(){var i,g,j=this.editor;if(d.isGecko){try{i=j.selection;g=i.getBookmark(true);if(i.getSel()){i.getSel().selectAllChildren(j.getBody())}i.collapse(true);i.moveToBookmark(g)}catch(h){}}},queryStateUnderline:function(){var g=this.editor,h=g.selection.getNode();if(h&&h.nodeName=="A"){return false}return this._queryState("Underline")},queryStateOutdent:function(){var g=this.editor,h;if(g.settings.inline_styles){if((h=g.dom.getParent(g.selection.getStart(),g.dom.isBlock))&&parseInt(h.style.paddingLeft)>0){return true}if((h=g.dom.getParent(g.selection.getEnd(),g.dom.isBlock))&&parseInt(h.style.paddingLeft)>0){return true}}return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList()||(!g.settings.inline_styles&&!!g.dom.getParent(g.selection.getNode(),"BLOCKQUOTE"))},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(g){return g.nodeName==="BLOCKQUOTE"})},_applyInlineStyle:function(o,j,m){var q=this,n=q.editor,l=n.dom,i,p={},k,r;o=o.toUpperCase();if(m&&m.check_classes&&j["class"]){m.check_classes.push(j["class"])}function h(){f(l.select(o).reverse(),function(t){var s=0;f(l.getAttribs(t),function(u){if(u.nodeName.substring(0,1)!="_"&&l.getAttrib(t,u.nodeName)!=""){s++}});if(s==0){l.remove(t,1)}})}function g(){var s;f(l.select("span,font"),function(t){if(t.style.fontFamily=="mceinline"||t.face=="mceinline"){if(!s){s=n.selection.getBookmark()}j._mce_new="1";l.replace(l.create(o,j),t,1)}});f(l.select(o+"[_mce_new]"),function(u){function t(v){if(v.nodeType==1){f(j.style,function(x,w){l.setStyle(v,w,"")});if(j["class"]&&v.className&&m){f(m.check_classes,function(w){if(l.hasClass(v,w)){l.removeClass(v,w)}})}}}f(l.select(o,u),t);if(u.parentNode&&u.parentNode.nodeType==1&&u.parentNode.childNodes.length==1){t(u.parentNode)}l.getParent(u.parentNode,function(v){if(v.nodeType==1){if(j.style){f(j.style,function(y,x){var w;if(!p[x]&&(w=l.getStyle(v,x))){if(w===y){l.setStyle(u,x,"")}p[x]=1}})}if(j["class"]&&v.className&&m){f(m.check_classes,function(w){if(l.hasClass(v,w)){l.removeClass(u,w)}})}}return false});u.removeAttribute("_mce_new")});h();n.selection.moveToBookmark(s);return !!s}n.focus();n.getDoc().execCommand("FontName",false,"mceinline");g();if(k=q._applyInlineStyle.keyhandler){n.onKeyUp.remove(k);n.onKeyPress.remove(k);n.onKeyDown.remove(k);n.onSetContent.remove(q._applyInlineStyle.chandler)}if(n.selection.isCollapsed()){if(!c){f(l.getParents(n.selection.getNode(),"span"),function(s){f(j.style,function(u,t){var w;if(w=l.getStyle(s,t)){if(w==u){l.setStyle(s,t,"");r=2;return false}r=1;return false}});if(r){return false}});if(r==2){i=n.selection.getBookmark();h();n.selection.moveToBookmark(i);window.setTimeout(function(){n.nodeChanged()},1);return}}q._pendingStyles=d.extend(q._pendingStyles||{},j.style);q._applyInlineStyle.chandler=n.onSetContent.add(function(){delete q._pendingStyles});q._applyInlineStyle.keyhandler=k=function(s){if(q._pendingStyles){j.style=q._pendingStyles;delete q._pendingStyles}if(g()){n.onKeyDown.remove(q._applyInlineStyle.keyhandler);n.onKeyPress.remove(q._applyInlineStyle.keyhandler)}if(s.type=="keyup"){n.onKeyUp.remove(q._applyInlineStyle.keyhandler)}};n.onKeyDown.add(k);n.onKeyPress.add(k);n.onKeyUp.add(k)}else{q._pendingStyles=0}}})})(tinymce);(function(a){a.create("tinymce.UndoManager",{index:0,data:null,typing:0,UndoManager:function(c){var d=this,b=a.util.Dispatcher;d.editor=c;d.data=[];d.onAdd=new b(this);d.onUndo=new b(this);d.onRedo=new b(this)},add:function(d){var g=this,f,e=g.editor,c,h=e.settings,j;d=d||{};d.content=d.content||e.getContent({format:"raw",no_events:1});d.content=d.content.replace(/^\s*|\s*$/g,"");j=g.data[g.index>0&&(g.index==0||g.index==g.data.length)?g.index-1:g.index];if(!d.initial&&j&&d.content==j.content){return null}if(h.custom_undo_redo_levels){if(g.data.length>h.custom_undo_redo_levels){for(f=0;f<g.data.length-1;f++){g.data[f]=g.data[f+1]}g.data.length--;g.index=g.data.length}}if(h.custom_undo_redo_restore_selection&&!d.initial){d.bookmark=c=d.bookmark||e.selection.getBookmark()}if(g.index<g.data.length){g.index++}if(g.data.length===0&&!d.initial){return null}g.data.length=g.index+1;g.data[g.index++]=d;if(d.initial){g.index=0}if(g.data.length==2&&g.data[0].initial){g.data[0].bookmark=c}g.onAdd.dispatch(g,d);e.isNotDirty=0;return d},undo:function(){var e=this,c=e.editor,b=b,d;if(e.typing){e.add();e.typing=0}if(e.index>0){if(e.index==e.data.length&&e.index>1){d=e.index;e.typing=0;if(!e.add()){e.index=d}--e.index}b=e.data[--e.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);e.onUndo.dispatch(e,b)}return b},redo:function(){var d=this,c=d.editor,b=null;if(d.index<d.data.length-1){b=d.data[++d.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);d.onRedo.dispatch(d,b)}return b},clear:function(){var b=this;b.data=[];b.index=0;b.typing=0;b.add({initial:true})},hasUndo:function(){return this.index!=0||this.typing},hasRedo:function(){return this.index<this.data.length-1}})})(tinymce);(function(i){var h,c,a,b,g,f;h=i.dom.Event;c=i.isIE;a=i.isGecko;b=i.isOpera;g=i.each;f=i.extend;function e(k,l){var j=l.ownerDocument.createRange();j.setStart(k.endContainer,k.endOffset);j.setEndAfter(l);return j.cloneContents().textContent.length==0}function d(j){j=j.innerHTML;j=j.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");j=j.replace(/<[^>]+>/g,"");return j.replace(/[ \t\r\n]+/g,"")==""}i.create("tinymce.ForceBlocks",{ForceBlocks:function(k){var l=this,m=k.settings,n;l.editor=k;l.dom=k.dom;n=(m.forced_root_block||"p").toLowerCase();m.element=n.toUpperCase();k.onPreInit.add(l.setup,l);l.reOpera=new RegExp("(\\u00a0| | )</"+n+">","gi");l.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,n),"gi");l.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,n),"gi");l.reNbsp2BR2=new RegExp("<%p()([^>]+)>( | )<\\/%p>|<%p>( | )<\\/%p>".replace(/%p/g,n),"gi");l.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,n),"gi");function j(p,q){if(b){q.content=q.content.replace(l.reOpera,"</"+n+">")}q.content=q.content.replace(l.rePadd,"<"+n+"$1$2$3$4$5$6>\u00a0</"+n+">");if(!c&&!b&&q.set){q.content=q.content.replace(l.reNbsp2BR1,"<"+n+"$1$2><br /></"+n+">");q.content=q.content.replace(l.reNbsp2BR2,"<"+n+"$1$2><br /></"+n+">")}else{q.content=q.content.replace(l.reBR2Nbsp,"<"+n+"$1$2>\u00a0</"+n+">")}}k.onBeforeSetContent.add(j);k.onPostProcess.add(j);if(m.forced_root_block){k.onInit.add(l.forceRoots,l);k.onSetContent.add(l.forceRoots,l);k.onBeforeGetContent.add(l.forceRoots,l)}},setup:function(){var k=this,j=k.editor,l=j.settings;if(l.forced_root_block){j.onKeyUp.add(k.forceRoots,k);j.onPreProcess.add(k.forceRoots,k)}if(l.force_br_newlines){if(c){j.onKeyPress.add(function(o,q){var r,p=o.selection;if(q.keyCode==13&&p.getNode().nodeName!="LI"){p.setContent('<br id="__" /> ',{format:"raw"});r=o.dom.get("__");r.removeAttribute("id");p.select(r);p.collapse();return h.cancel(q)}})}return}if(!c&&l.force_p_newlines){j.onKeyPress.add(function(n,o){if(o.keyCode==13&&!o.shiftKey){if(!k.insertPara(o)){h.cancel(o)}}});if(a){j.onKeyDown.add(function(n,o){if((o.keyCode==8||o.keyCode==46)&&!o.shiftKey){k.backspaceDelete(o,o.keyCode==8)}})}}function m(o,n){var p=j.dom.create(n);g(o.attributes,function(q){if(q.specified&&q.nodeValue){p.setAttribute(q.nodeName.toLowerCase(),q.nodeValue)}});g(o.childNodes,function(q){p.appendChild(q.cloneNode(true))});o.parentNode.replaceChild(p,o);return p}j.onPreProcess.add(function(n,p){g(n.dom.select("p,h1,h2,h3,h4,h5,h6,div",p.node),function(o){if(d(o)){g(n.dom.select("span,em,strong,b,i",p.node),function(q){if(!q.hasChildNodes()){q.appendChild(n.getDoc().createTextNode("\u00a0"));return false}})}})});if(c){if(l.element!="P"){j.onKeyPress.add(function(n,o){k.lastElm=n.selection.getNode().nodeName});j.onKeyUp.add(function(p,r){var t,q=p.selection,s=q.getNode(),o=p.getBody();if(o.childNodes.length===1&&s.nodeName=="P"){s=m(s,l.element);q.select(s);q.collapse();p.nodeChanged()}else{if(r.keyCode==13&&!r.shiftKey&&k.lastElm!="P"){t=p.dom.getParent(s,"p");if(t){m(t,l.element);p.nodeChanged()}}}})}}},find:function(p,l,m){var k=this.editor,j=k.getDoc().createTreeWalker(p,4,null,false),o=-1;while(p=j.nextNode()){o++;if(l==0&&p==m){return o}if(l==1&&o==m){return p}}return -1},forceRoots:function(p,D){var u=this,p=u.editor,H=p.getBody(),E=p.getDoc(),K=p.selection,v=K.getSel(),w=K.getRng(),I=-2,o,B,j,k,F=-16777215;var G,l,J,A,x,m=H.childNodes,z,y,q;for(z=m.length-1;z>=0;z--){G=m[z];if(G.nodeType===3||(!u.dom.isBlock(G)&&G.nodeType!==8&&!/^(script|mce:script|style|mce:style)$/i.test(G.nodeName))){if(!l){if(G.nodeType!=3||/[^\s]/g.test(G.nodeValue)){if(I==-2&&w){if(!c){if(w.startContainer.nodeType==1&&(y=w.startContainer.childNodes[w.startOffset])&&y.nodeType==1){q=y.getAttribute("id");y.setAttribute("id","__mce")}else{if(p.dom.getParent(w.startContainer,function(n){return n===H})){B=w.startOffset;j=w.endOffset;I=u.find(H,0,w.startContainer);o=u.find(H,0,w.endContainer)}}}else{k=E.body.createTextRange();k.moveToElementText(H);k.collapse(1);J=k.move("character",F)*-1;k=w.duplicate();k.collapse(1);A=k.move("character",F)*-1;k=w.duplicate();k.collapse(0);x=(k.move("character",F)*-1)-A;I=A-J;o=x}}l=p.dom.create(p.settings.forced_root_block);G.parentNode.replaceChild(l,G);l.appendChild(G)}}else{if(l.hasChildNodes()){l.insertBefore(G,l.firstChild)}else{l.appendChild(G)}}}else{l=null}}if(I!=-2){if(!c){l=H.getElementsByTagName(p.settings.element)[0];w=E.createRange();if(I!=-1){w.setStart(u.find(H,1,I),B)}else{w.setStart(l,0)}if(o!=-1){w.setEnd(u.find(H,1,o),j)}else{w.setEnd(l,0)}if(v){v.removeAllRanges();v.addRange(w)}}else{try{w=v.createRange();w.moveToElementText(H);w.collapse(1);w.moveStart("character",I);w.moveEnd("character",o);w.select()}catch(C){}}}else{if(!c&&(y=p.dom.get("__mce"))){if(q){y.setAttribute("id",q)}else{y.removeAttribute("id")}w=E.createRange();w.setStartBefore(y);w.setEndBefore(y);K.setRng(w)}}},getParentBlock:function(k){var j=this.dom;return j.getParent(k,j.isBlock)},insertPara:function(N){var B=this,p=B.editor,J=p.dom,O=p.getDoc(),S=p.settings,C=p.selection.getSel(),D=C.getRangeAt(0),R=O.body;var G,H,E,L,K,m,k,o,u,j,z,Q,l,q,F,I=J.getViewPort(p.getWin()),x,A,w;G=O.createRange();G.setStart(C.anchorNode,C.anchorOffset);G.collapse(true);H=O.createRange();H.setStart(C.focusNode,C.focusOffset);H.collapse(true);E=G.compareBoundaryPoints(G.START_TO_END,H)<0;L=E?C.anchorNode:C.focusNode;K=E?C.anchorOffset:C.focusOffset;m=E?C.focusNode:C.anchorNode;k=E?C.focusOffset:C.anchorOffset;if(L===m&&/^(TD|TH)$/.test(L.nodeName)){if(L.firstChild.nodeName=="BR"){J.remove(L.firstChild)}if(L.childNodes.length==0){p.dom.add(L,S.element,null,"<br />");Q=p.dom.add(L,S.element,null,"<br />")}else{F=L.innerHTML;L.innerHTML="";p.dom.add(L,S.element,null,F);Q=p.dom.add(L,S.element,null,"<br />")}D=O.createRange();D.selectNodeContents(Q);D.collapse(1);p.selection.setRng(D);return false}if(L==R&&m==R&&R.firstChild&&p.dom.isBlock(R.firstChild)){L=m=L.firstChild;K=k=0;G=O.createRange();G.setStart(L,0);H=O.createRange();H.setStart(m,0)}L=L.nodeName=="HTML"?O.body:L;L=L.nodeName=="BODY"?L.firstChild:L;m=m.nodeName=="HTML"?O.body:m;m=m.nodeName=="BODY"?m.firstChild:m;o=B.getParentBlock(L);u=B.getParentBlock(m);j=o?o.nodeName:S.element;if(B.dom.getParent(o,"ol,ul,pre")){return true}if(o&&(o.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(J.getStyle(o,"position",1)))){j=S.element;o=null}if(u&&(u.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(J.getStyle(o,"position",1)))){j=S.element;u=null}if(/(TD|TABLE|TH|CAPTION)/.test(j)||(o&&j=="DIV"&&/left|right/gi.test(J.getStyle(o,"float",1)))){j=S.element;o=u=null}z=(o&&o.nodeName==j)?o.cloneNode(0):p.dom.create(j);Q=(u&&u.nodeName==j)?u.cloneNode(0):p.dom.create(j);Q.removeAttribute("id");if(/^(H[1-6])$/.test(j)&&e(D,o)){Q=p.dom.create(S.element)}F=l=L;do{if(F==R||F.nodeType==9||B.dom.isBlock(F)||/(TD|TABLE|TH|CAPTION)/.test(F.nodeName)){break}l=F}while((F=F.previousSibling?F.previousSibling:F.parentNode));F=q=m;do{if(F==R||F.nodeType==9||B.dom.isBlock(F)||/(TD|TABLE|TH|CAPTION)/.test(F.nodeName)){break}q=F}while((F=F.nextSibling?F.nextSibling:F.parentNode));if(l.nodeName==j){G.setStart(l,0)}else{G.setStartBefore(l)}G.setEnd(L,K);z.appendChild(G.cloneContents()||O.createTextNode(""));try{H.setEndAfter(q)}catch(M){}H.setStart(m,k);Q.appendChild(H.cloneContents()||O.createTextNode(""));D=O.createRange();if(!l.previousSibling&&l.parentNode.nodeName==j){D.setStartBefore(l.parentNode)}else{if(G.startContainer.nodeName==j&&G.startOffset==0){D.setStartBefore(G.startContainer)}else{D.setStart(G.startContainer,G.startOffset)}}if(!q.nextSibling&&q.parentNode.nodeName==j){D.setEndAfter(q.parentNode)}else{D.setEnd(H.endContainer,H.endOffset)}D.deleteContents();if(b){p.getWin().scrollTo(0,I.y)}if(z.firstChild&&z.firstChild.nodeName==j){z.innerHTML=z.firstChild.innerHTML}if(Q.firstChild&&Q.firstChild.nodeName==j){Q.innerHTML=Q.firstChild.innerHTML}if(d(z)){z.innerHTML="<br />"}function P(y,s){var r=[],U,T,t;y.innerHTML="";if(S.keep_styles){T=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(T.nodeName)){U=T.cloneNode(false);J.setAttrib(U,"id","");r.push(U)}}while(T=T.parentNode)}if(r.length>0){for(t=r.length-1,U=y;t>=0;t--){U=U.appendChild(r[t])}r[0].innerHTML=b?" ":"<br />";return r[0]}else{y.innerHTML=b?" ":"<br />"}}if(d(Q)){w=P(Q,m)}if(b&&parseFloat(opera.version())<9.5){D.insertNode(z);D.insertNode(Q)}else{D.insertNode(Q);D.insertNode(z)}Q.normalize();z.normalize();function v(r){return O.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false).nextNode()||r}D=O.createRange();D.selectNodeContents(a?v(w||Q):w||Q);D.collapse(1);C.removeAllRanges();C.addRange(D);x=p.dom.getPos(Q).y;A=Q.clientHeight;if(x<I.y||x+A>I.y+I.h){p.getWin().scrollTo(0,x<I.y?x:x-I.h+25)}return false},backspaceDelete:function(o,x){var z=this,m=z.editor,s=m.getBody(),l=m.dom,k,p=m.selection,j=p.getRng(),q=j.startContainer,k,u,v;if(q&&m.dom.isBlock(q)&&!/^(TD|TH)$/.test(q.nodeName)&&x){if(q.childNodes.length==0||(q.childNodes.length==1&&q.firstChild.nodeName=="BR")){k=q;while((k=k.previousSibling)&&!m.dom.isBlock(k)){}if(k){if(q!=s.firstChild){u=m.dom.doc.createTreeWalker(k,NodeFilter.SHOW_TEXT,null,false);while(v=u.nextNode()){k=v}j=m.getDoc().createRange();j.setStart(k,k.nodeValue?k.nodeValue.length:0);j.setEnd(k,k.nodeValue?k.nodeValue.length:0);p.setRng(j);m.dom.remove(q)}return h.cancel(o)}}}function y(n){var r;n=n.target;if(n&&n.parentNode&&n.nodeName=="BR"&&(k=z.getParentBlock(n))){r=n.previousSibling;h.remove(s,"DOMNodeInserted",y);if(r&&r.nodeType==3&&/\s+$/.test(r.nodeValue)){return}if(n.previousSibling||n.nextSibling){m.dom.remove(n)}}}h._add(s,"DOMNodeInserted",y);window.setTimeout(function(){h._remove(s,"DOMNodeInserted",y)},1)}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){i.execCommand(p.cmd,p.ui||false,p.value)}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark(1)});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.CommandManager=function(){var c={},b={},d={};function e(i,h,g,f){if(typeof(h)=="string"){h=[h]}a.each(h,function(j){i[j.toLowerCase()]={func:g,scope:f}})}a.extend(this,{add:function(h,g,f){e(c,h,g,f)},addQueryStateHandler:function(h,g,f){e(b,h,g,f)},addQueryValueHandler:function(h,g,f){e(d,h,g,f)},execCommand:function(g,j,i,h,f){if(j=c[j.toLowerCase()]){if(j.func.call(g||j.scope,i,h,f)!==false){return true}}},queryCommandValue:function(){if(cmd=d[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}},queryCommandState:function(){if(cmd=b[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}}})};a.GlobalCommands=new a.CommandManager()})(tinymce);(function(b){function a(i,d,h,m){var j,g,e,l,f;function k(p,o){do{if(p.parentNode==o){return p}p=p.parentNode}while(p)}function c(o){m(o);b.walk(o,m,"childNodes")}j=i.findCommonAncestor(d,h);e=k(d,j)||d;l=k(h,j)||h;for(g=d;g&&g!=e;g=g.parentNode){for(f=g.nextSibling;f;f=f.nextSibling){c(f)}}if(e!=l){for(g=e.nextSibling;g&&g!=l;g=g.nextSibling){c(g)}}else{c(e)}for(g=h;g&&g!=l;g=g.parentNode){for(f=g.previousSibling;f;f=f.previousSibling){c(f)}}}b.GlobalCommands.add("RemoveFormat",function(){var m=this,l=m.dom,u=m.selection,d=u.getRng(1),e=[],h,f,j,q,g,o,c,i;function k(s){var r;l.getParent(s,function(v){if(l.is(v,m.getParam("removeformat_selector"))){r=v}return l.isBlock(v)},m.getBody());return r}function p(r){if(l.is(r,m.getParam("removeformat_selector"))){e.push(r)}}function t(r){p(r);b.walk(r,p,"childNodes")}h=u.getBookmark();q=d.startContainer;o=d.endContainer;g=d.startOffset;c=d.endOffset;q=q.nodeType==1?q.childNodes[Math.min(g,q.childNodes.length-1)]:q;o=o.nodeType==1?o.childNodes[Math.min(g==c?c:c-1,o.childNodes.length-1)]:o;if(q==o){f=k(q);if(q.nodeType==3){if(f&&f.nodeType==1){i=q.splitText(g);i.splitText(c-g);l.split(f,i);u.moveToBookmark(h)}return}t(l.split(f,q)||q)}else{f=k(q);j=k(o);if(f){if(q.nodeType==3){if(g==q.nodeValue.length){q.nodeValue+="\uFEFF"}q=q.splitText(g)}}if(j){if(o.nodeType==3){o.splitText(c)}}if(f&&f==j){l.replace(l.create("span",{id:"__end"},o.cloneNode(true)),o)}if(f){f=l.split(f,q)}else{f=q}if(i=l.get("__end")){o=i;j=k(o)}if(j){j=l.split(j,o)}else{j=o}a(l,f,j,p);if(q.nodeValue=="\uFEFF"){q.nodeValue=""}t(o);t(q)}b.each(e,function(r){l.remove(r,1)});l.remove("__end",1);u.moveToBookmark(h)})})(tinymce);(function(a){a.GlobalCommands.add("mceBlockQuote",function(){var j=this,o=j.selection,f=j.dom,l,k,e,d,p,c,m,h,b;function g(i){return f.getParent(i,function(q){return q.nodeName==="BLOCKQUOTE"})}l=f.getParent(o.getStart(),f.isBlock);k=f.getParent(o.getEnd(),f.isBlock);if(p=g(l)){if(l!=k||l.childNodes.length>1||(l.childNodes.length==1&&l.firstChild.nodeName!="BR")){d=o.getBookmark()}if(g(k)){m=p.cloneNode(false);while(e=k.nextSibling){m.appendChild(e.parentNode.removeChild(e))}}if(m){f.insertAfter(m,p)}b=o.getSelectedBlocks(l,k);for(h=b.length-1;h>=0;h--){f.insertAfter(b[h],p)}if(/^\s*$/.test(p.innerHTML)){f.remove(p,1)}if(m&&/^\s*$/.test(m.innerHTML)){f.remove(m,1)}if(!d){if(!a.isIE){c=j.getDoc().createRange();c.setStart(l,0);c.setEnd(l,0);o.setRng(c)}else{o.select(l);o.collapse(0);if(f.getParent(o.getStart(),f.isBlock)!=l){c=o.getRng();c.move("character",-1);c.select()}}}else{j.selection.moveToBookmark(d)}return}if(a.isIE&&!l&&!k){j.getDoc().execCommand("Indent");e=g(o.getNode());e.style.margin=e.dir="";return}if(!l||!k){return}if(l!=k||l.childNodes.length>1||(l.childNodes.length==1&&l.firstChild.nodeName!="BR")){d=o.getBookmark()}a.each(o.getSelectedBlocks(g(o.getStart()),g(o.getEnd())),function(i){if(i.nodeName=="BLOCKQUOTE"&&!p){p=i;return}if(!p){p=f.create("blockquote");i.parentNode.insertBefore(p,i)}if(i.nodeName=="BLOCKQUOTE"&&p){e=i.firstChild;while(e){p.appendChild(e.cloneNode(true));e=e.nextSibling}f.remove(i);return}p.appendChild(f.remove(i))});if(!d){if(!a.isIE){c=j.getDoc().createRange();c.setStart(l,0);c.setEnd(l,0);o.setRng(c)}else{o.select(l);o.collapse(1)}}else{o.moveToBookmark(d)}})})(tinymce);(function(a){a.each(["Cut","Copy","Paste"],function(b){a.GlobalCommands.add(b,function(){var c=this,e=c.getDoc();try{e.execCommand(b,false,null);if(!e.queryCommandEnabled(b)){throw"Error"}}catch(d){if(a.isGecko){c.windowManager.confirm(c.getLang("clipboard_msg"),function(f){if(f){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{c.windowManager.alert(c.getLang("clipboard_no_support"))}}})})})(tinymce);(function(a){a.GlobalCommands.add("InsertHorizontalRule",function(){if(a.isOpera){return this.getDoc().execCommand("InsertHorizontalRule",false,"")}this.selection.setContent("<hr />")})})(tinymce);(function(){var a=tinymce.GlobalCommands;a.add(["mceEndUndoLevel","mceAddUndoLevel"],function(){this.undoManager.add()});a.add("Undo",function(){var b=this;if(b.settings.custom_undo_redo){b.undoManager.undo();b.nodeChanged();return true}return false});a.add("Redo",function(){var b=this;if(b.settings.custom_undo_redo){b.undoManager.redo();b.nodeChanged();return true}return false})})();
// advanced/editor_template.js
(function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],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(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);l.settings=m=h({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_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";if(j.settings.convert_fonts_to_spans){o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}j.onInit.add(function(){j.onNodeChange.add(l._nodeChanged,l);if(j.settings.content_css!==false){j.dom.loadCSS(j.baseURI.toAbsolute("themes/advanced/skins/"+j.settings.skin+"/content.css"))}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){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((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(j){var i=this.editor,k=i.controlManager.get("styleselect");if(k.getLength()==0){f(i.dom.getClasses(),function(l){k.add(l["class"],l["class"])})}},_createStyleSelect:function(m){var j=this,i=j.editor,k=i.controlManager,l=k.createListBox("styleselect",{title:"advanced.style_select",onselect:function(n){if(l.selectedValue===n){i.execCommand("mceSetStyleInfo",0,{command:"removeformat"});l.select();return false}else{i.execCommand("mceSetCSSClass",0,n)}}});if(l){f(i.getParam("theme_advanced_styles","","hash"),function(o,n){if(o){l.add(j.editor.translate(n),o)}});l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",j._importClasses,j);b.add(p.id+"_text","mousedown",j._importClasses,j);b.add(p.id+"_open","focus",j._importClasses,j);b.add(p.id+"_open","mousedown",j._importClasses,j)}else{b.add(p.id,"focus",j._importClasses,j)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",cmd:"FontName"});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){if(i.fontSize){k.execCommand("FontSize",false,i.fontSize)}else{f(m.settings.theme_advanced_font_sizes,function(p,o){if(p["class"]){j.push(p["class"])}});k.editorCommands._applyInlineStyle("span",{"class":i["class"]},{check_classes:j})}}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={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"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",cmd:"FormatBlock"});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;m=j=d.create("span",{id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=d.stdMode?u.getElementsByTagName("tr"):u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_tbl");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,l){var j=this.editor,k=j.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr"),m;i=Math.max(k.theme_advanced_resizing_min_width||100,i);l=Math.max(k.theme_advanced_resizing_min_height||100,l);i=Math.min(k.theme_advanced_resizing_max_width||65535,i);l=Math.min(k.theme_advanced_resizing_max_height||65535,l);m=n.clientHeight-o.clientHeight;d.setStyle(o,"height",l-m);d.setStyles(n,{width:i,height:l})},destroy:function(){var i=this.editor.id;b.clear(i+"_resize");b.clear(i+"_path_row");b.clear(i+"_external_close")},_simpleLayout:function(y,r,k,i){var x=this,u=x.editor,v=y.theme_advanced_toolbar_location,m=y.theme_advanced_statusbar_location,l,j,q,w;if(y.readonly){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});return j}if(v=="top"){x._addToolbars(r,k)}if(v=="external"){l=w=d.create("div",{style:"position:relative"});l=d.add(l,"div",{id:u.id+"_external","class":"mceExternalToolbar"});d.add(l,"a",{id:u.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});l=d.add(l,"table",{id:u.id+"_tblext",cellSpacing:0,cellPadding:0});q=d.add(l,"tbody");if(i.firstChild.className=="mceOldBoxModel"){i.firstChild.appendChild(w)}else{i.insertBefore(w,i.firstChild)}x._addToolbars(q,k);u.onMouseUp.add(function(){var o=d.get(u.id+"_external");d.show(o);d.hide(g);var n=b.add(u.id+"_external_close","click",function(){d.hide(u.id+"_external");b.remove(u.id+"_external_close","click",n)});d.show(o);d.setStyle(o,"top",0-d.getRect(u.id+"_tblext").h-1);d.hide(o);d.show(o);o.style.filter="";g=u.id+"_external";o=null})}if(m=="top"){x._addStatusBar(r,k)}if(!y.theme_advanced_toolbar_container){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"})}if(v=="bottom"){x._addToolbars(r,k)}if(m=="bottom"){x._addStatusBar(r,k)}return j},_rowLayout:function(w,m,k){var v=this,p=v.editor,u,x,i=p.controlManager,l,j,r,q;u=w.theme_advanced_containers_default_class||"";x=w.theme_advanced_containers_default_align||"center";f(c(w.theme_advanced_containers||""),function(s,o){var n=w["theme_advanced_container_"+s]||"";switch(n.toLowerCase()){case"mceeditor":l=d.add(m,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":v._addStatusBar(m,k);break;default:q=(w["theme_advanced_container_"+s+"_align"]||x).toLowerCase();q="mce"+v._ufirst(q);l=d.add(d.add(m,"tr"),"td",{"class":"mceToolbar "+(w["theme_advanced_container_"+s+"_class"]||u)+" "+q||x});r=i.createToolbar("toolbar"+o);v._addControls(n,r);d.setHTML(l,r.renderHTML());k.deltaHeight-=w.theme_advanced_row_height}});return j},_addControls:function(j,i){var k=this,l=k.settings,m,n=k.editor.controlManager;if(l.theme_advanced_disable&&!k._disabled){m={};f(c(l.theme_advanced_disable),function(o){m[o]=1});k._disabled=m}else{m=k._disabled}f(c(j),function(p){var o;if(m&&m[p]){return}if(p=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(q){q=k.createControl(q,n);if(q){i.add(q)}});return}o=k.createControl(p,n);if(o){i.add(o)}})},_addToolbars:function(w,k){var z=this,p,m,r=z.editor,A=z.settings,y,j=r.controlManager,u,l,q=[],x;x=A.theme_advanced_toolbar_align.toLowerCase();x="mce"+z._ufirst(x);l=d.add(d.add(w,"tr"),"td",{"class":"mceToolbar "+x});if(!r.getParam("accessibility_focus")){q.push(d.createHTML("a",{href:"#",onfocus:"tinyMCE.get('"+r.id+"').focus();"},"<!-- IE -->"))}q.push(d.createHTML("a",{href:"#",accesskey:"q",title:r.getLang("advanced.toolbar_focus")},"<!-- IE -->"));for(p=1;(y=A["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(A["theme_advanced_buttons"+p+"_add"]){y+=","+A["theme_advanced_buttons"+p+"_add"]}if(A["theme_advanced_buttons"+p+"_add_before"]){y=A["theme_advanced_buttons"+p+"_add_before"]+","+y}z._addControls(y,m);q.push(m.renderHTML());k.deltaHeight-=A.theme_advanced_row_height}q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},"<!-- IE -->"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row"},w.theme_advanced_path?p.translate("advanced.path")+": ":" ");d.add(k,"a",{href:"#",accesskey:"x"});if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}if(w.theme_advanced_resize_horizontal){r.style.width=Math.max(10,n.cw)+"px"}r.style.height=Math.max(10,n.ch)+"px";d.get(p.id+"_ifr").style.height=Math.max(10,parseInt(n.ch)+v.deltaHeight)+"px"})}p.onPostRender.add(function(){b.add(p.id+"_resize","mousedown",function(x){var z,t,o,s,y,r;z=d.get(p.id+"_tbl");o=z.clientWidth;s=z.clientHeight;miw=w.theme_advanced_resizing_min_width||100;mih=w.theme_advanced_resizing_min_height||100;maw=w.theme_advanced_resizing_max_width||65535;mah=w.theme_advanced_resizing_max_height||65535;t=d.add(d.get(p.id+"_parent"),"div",{"class":"mcePlaceHolder"});d.setStyles(t,{width:o,height:s});d.hide(z);d.show(t);i={x:x.screenX,y:x.screenY,w:o,h:s,dx:null,dy:null};q=b.add(d.doc,"mousemove",function(B){var n,A;i.dx=B.screenX-i.x;i.dy=B.screenY-i.y;n=Math.max(miw,i.w+i.dx);A=Math.max(mih,i.h+i.dy);n=Math.min(maw,n);A=Math.min(mah,A);if(w.theme_advanced_resize_horizontal){t.style.width=n+"px"}t.style.height=A+"px";return b.cancel(B)});u=b.add(d.doc,"mouseup",function(n){var A;b.remove(d.doc,"mousemove",q);b.remove(d.doc,"mouseup",u);z.style.display="";d.remove(t);if(i.dx===null){return}A=d.get(p.id+"_ifr");if(w.theme_advanced_resize_horizontal){z.style.width=Math.max(10,i.w+i.dx)+"px"}z.style.height=Math.max(10,i.h+i.dy)+"px";A.style.height=Math.max(10,A.clientHeight+i.dy)+"px";if(w.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+p.id+"_size",{cw:i.w+i.dx,ch:i.h+i.dy})}});return b.cancel(x)})})}j.deltaHeight-=21;k=m=null},_nodeChanged:function(l,u,k,q){var y=this,i,r=0,x,m,z=y.settings,w,j,o;if(z.readonly){return}e.each(y.stateControls,function(n){u.setActive(n,l.queryCommandState(y.controls[n][1]))});u.setActive("visualaid",l.hasVisual);u.setDisabled("undo",!l.undoManager.hasUndo()&&!l.typing);u.setDisabled("redo",!l.undoManager.hasRedo());u.setDisabled("outdent",!l.queryCommandState("Outdent"));i=d.getParent(k,"A");if(m=u.get("link")){if(!i||!i.name){m.setDisabled(!i&&q);m.setActive(!!i)}}if(m=u.get("unlink")){m.setDisabled(!i&&q);m.setActive(!!i&&!i.name)}if(m=u.get("anchor")){m.setActive(!!i&&i.name);if(e.isWebKit){i=d.getParent(k,"IMG");m.setActive(!!i&&d.getAttrib(i,"mce_name")=="a")}}i=d.getParent(k,"IMG");if(m=u.get("image")){m.setActive(!!i&&k.className.indexOf("mceItem")==-1)}if(m=u.get("styleselect")){if(k.className){y._importClasses();m.select(k.className)}else{m.select()}}if(m=u.get("formatselect")){i=d.getParent(k,d.isBlock);if(i){m.select(i.nodeName.toLowerCase())}}if(l.settings.convert_fonts_to_spans){l.dom.getParent(k,function(p){if(p.nodeName==="SPAN"){if(!w&&p.className){w=p.className}if(!j&&p.style.fontSize){j=p.style.fontSize}if(!o&&p.style.fontFamily){o=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}}return false});if(m=u.get("fontselect")){m.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==o})}if(m=u.get("fontsizeselect")){m.select(function(n){if(n.fontSize&&n.fontSize===j){return true}if(n["class"]&&n["class"]===w){return true}})}}else{if(m=u.get("fontselect")){m.select(l.queryCommandValue("FontName"))}if(m=u.get("fontsizeselect")){x=l.queryCommandValue("FontSize");m.select(function(n){return n.fontSize==x})}}if(z.theme_advanced_path&&z.theme_advanced_statusbar_location){i=d.get(l.id+"_path")||d.add(l.id+"_path_row","span",{id:l.id+"_path"});d.setHTML(i,"");l.dom.getParent(k,function(A){var p=A.nodeName.toLowerCase(),s,v,t="";if(A.nodeType!=1||A.nodeName==="BR"||(d.hasClass(A,"mceItemHidden")||d.hasClass(A,"mceItemRemoved"))){return}if(x=d.getAttrib(A,"mce_name")){p=x}if(e.isIE&&A.scopeName!=="HTML"){p=A.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(x=d.getAttrib(A,"src")){t+="src: "+x+" "}break;case"a":if(x=d.getAttrib(A,"name")){t+="name: "+x+" ";p+="#"+x}if(x=d.getAttrib(A,"href")){t+="href: "+x+" "}break;case"font":if(z.convert_fonts_to_spans){p="span"}if(x=d.getAttrib(A,"face")){t+="font: "+x+" "}if(x=d.getAttrib(A,"size")){t+="size: "+x+" "}if(x=d.getAttrib(A,"color")){t+="color: "+x+" "}break;case"span":if(x=d.getAttrib(A,"style")){t+="style: "+x+" "}break}if(x=d.getAttrib(A,"id")){t+="id: "+x+" "}if(x=A.className){x=x.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,"");if(x&&x.indexOf("mceItem")==-1){t+="class: "+x+" ";if(d.isBlock(A)||p=="img"||p=="span"){p+="."+x}}}p=p.replace(/(html:)/g,"");p={name:p,node:A,title:t};y.onResolveName.dispatch(y,p);t=p.title;p=p.name;v=d.create("a",{href:"javascript:;",onmousedown:"return false;",title:t,"class":"mcePath_"+(r++)},p);if(i.hasChildNodes()){i.insertBefore(d.doc.createTextNode(" \u00bb "),i.firstChild);i.insertBefore(v,i.firstChild)}else{i.appendChild(v)}},l.getBody())}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:e.baseURL+"/themes/advanced/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:e.baseURL+"/themes/advanced/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce));
// plugins/directionality
// plugins/fullscreen
(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(c,d){var e=this,f={},b;e.editor=c;c.addCommand("mceFullScreen",function(){var h,i=a.doc.documentElement;if(c.getParam("fullscreen_is_enabled")){if(c.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",e.resizeFunc);tinyMCE.get(c.getParam("fullscreen_editor_id")).setContent(c.getContent({format:"raw"}),{format:"raw"});tinyMCE.remove(c);a.remove("mce_fullscreen_container");i.style.overflow=c.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",c.getParam("fullscreen_overflow"));a.win.scrollTo(c.getParam("fullscreen_scrollx"),c.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(c.getParam("fullscreen_new_window")){h=a.win.open(d+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{h.resizeTo(screen.availWidth,screen.availHeight)}catch(g){}}else{tinyMCE.oldSettings=tinyMCE.settings;f.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";f.fullscreen_html_overflow=a.getStyle(i,"overflow",1);b=a.getViewPort();f.fullscreen_scrollx=b.x;f.fullscreen_scrolly=b.y;if(tinymce.isOpera&&f.fullscreen_overflow=="visible"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&f.fullscreen_overflow=="scroll"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&(f.fullscreen_html_overflow=="visible"||f.fullscreen_html_overflow=="scroll")){f.fullscreen_html_overflow="auto"}if(f.fullscreen_overflow=="0px"){f.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");i.style.overflow="hidden";b=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){b.h-=1}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+(tinymce.isIE6||(tinymce.isIE&&!a.boxModel)?"absolute":"fixed")+";top:0;left:0;width:"+b.w+"px;height:"+b.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(c.settings,function(j,k){f[k]=j});f.id="mce_fullscreen";f.width=n.clientWidth;f.height=n.clientHeight-15;f.fullscreen_is_enabled=true;f.fullscreen_editor_id=c.id;f.theme_advanced_resizing=false;f.save_onsavecallback=function(){c.setContent(tinyMCE.get(f.id).getContent({format:"raw"}),{format:"raw"});c.execCommand("mceSave")};tinymce.each(c.getParam("fullscreen_settings"),function(l,j){f[j]=l});if(f.theme_advanced_toolbar_location==="external"){f.theme_advanced_toolbar_location="top"}e.fullscreenEditor=new tinymce.Editor("mce_fullscreen",f);e.fullscreenEditor.onInit.add(function(){e.fullscreenEditor.setContent(c.getContent());e.fullscreenEditor.focus()});e.fullscreenEditor.render();tinyMCE.add(e.fullscreenEditor);e.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");e.fullscreenElement.update();e.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var j=tinymce.DOM.getViewPort();e.fullscreenEditor.theme.resizeTo(j.w,j.h)})}});c.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});c.onNodeChange.add(function(h,g){g.setActive("fullscreen",h.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)})();
// plugins/inlinepopups
-(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(r,j){var y=this,i,k="",q=y.editor,g=0,s=0,h,m,n,o,l,v,x;r=r||{};j=j||{};if(!r.inline){return y.parent(r,j)}if(!r.type){y.bookmark=q.selection.getBookmark("simple")}i=d.uniqueId();h=d.getViewPort();r.width=parseInt(r.width||320);r.height=parseInt(r.height||240)+(tinymce.isIE?8:0);r.min_width=parseInt(r.min_width||150);r.min_height=parseInt(r.min_height||100);r.max_width=parseInt(r.max_width||2000);r.max_height=parseInt(r.max_height||2000);r.left=r.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(r.width/2)));r.top=r.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(r.height/2)));r.movable=r.resizable=true;j.mce_width=r.width;j.mce_height=r.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=r.auto_focus;y.features=r;y.params=j;y.onOpen.dispatch(y,r,j);if(r.type){k+=" mceModal";if(r.type){k+=" mce"+r.type.substring(0,1).toUpperCase()+r.type.substring(1)}r.resizable=false}if(r.statusbar){k+=" mceStatusbar"}if(r.resizable){k+=" mceResizable"}if(r.minimizable){k+=" mceMinimizable"}if(r.maximizable){k+=" mceMaximizable"}if(r.movable){k+=" mceMovable"}y._addAll(d.doc.body,["div",{id:i,"class":q.settings.inlinepopups_skin||"clearlooks2",style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},r.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!r.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;s+=d.get(i+"_top").clientHeight;s+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:r.top,left:r.left,width:r.width+g,height:r.height+s});x=r.url||r.file;if(x){if(tinymce.relaxedDomain){x+=(x.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}x=tinymce._addVer(x)}if(!r.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:r.width,height:r.height});d.setAttrib(i+"_ifr","src",x)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(r.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",r.content.replace("\n","<br />"))}n=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=y.windows[i];y.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return y._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return y._startDrag(i,t,u.className.substring(13))}}}}}});o=a.add(i,"click",function(f){var p=f.target;y.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":y.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":r.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});v=y.windows[i]={id:i,mousedown_func:n,click_func:o,element:new b(i,{blocker:1,container:q.getContainer()}),iframeElement:new b(i+"_ifr"),features:r,deltaWidth:g,deltaHeight:s};v.iframeElement.on("focus",function(){y.focus(i)});if(y.count==0&&y.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(y.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:y.zIndex-1}});d.show("mceModalBlocker")}else{d.setStyle("mceModalBlocker","z-index",y.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}y.focus(i);y._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}y.count++;return v},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;g<h.length;g++){f._addAll(k,h[g])}}}},_startDrag:function(v,G,E){var o=this,u,z,C=d.doc,f,l=o.windows[v],h=l.element,y=h.getXY(),x,q,F,g,A,s,r,j,i,m,k,n,B;g={x:0,y:0};A=d.getViewPort();A.w-=2;A.h-=2;j=G.screenX;i=G.screenY;m=k=n=B=0;u=a.add(C,"mouseup",function(p){a.remove(C,"mouseup",u);a.remove(C,"mousemove",z);if(f){f.remove()}h.moveBy(m,k);h.resizeBy(n,B);q=h.getSize();d.setStyles(v+"_ifr",{width:q.w-l.deltaWidth,height:q.h-l.deltaHeight});o._fixIELayout(v,1);return a.cancel(p)});if(E!="Move"){D()}function D(){if(f){return}o._fixIELayout(v,0);d.add(C.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(o.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:o.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceEventBlocker",{position:"absolute",left:A.x,top:A.y,width:A.w-2,height:A.h-2})}f=new b("mceEventBlocker");f.update();x=h.getXY();q=h.getSize();s=g.x+x.x-A.x;r=g.y+x.y-A.y;d.add(f.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:s,top:r,width:q.w,height:q.h}});F=new b("mcePlaceHolder")}z=a.add(C,"mousemove",function(w){var p,H,t;D();p=w.screenX-j;H=w.screenY-i;switch(E){case"ResizeW":m=p;n=0-p;break;case"ResizeE":n=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(E=="ResizeNW"){m=p;n=0-p}else{if(E=="ResizeNE"){n=p}}k=H;B=0-H;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(E=="ResizeSW"){m=p;n=0-p}else{if(E=="ResizeSE"){n=p}}B=H;break;case"mceMove":m=p;k=H;break}if(n<(t=l.features.min_width-q.w)){if(m!==0){m+=n-t}n=t}if(B<(t=l.features.min_height-q.h)){if(k!==0){k+=B-t}B=t}n=Math.min(n,l.features.max_width-q.w);B=Math.min(B,l.features.max_height-q.h);m=Math.max(m,A.x-(s+A.x));k=Math.max(k,A.y-(r+A.y));m=Math.min(m,(A.w+A.x)-(s+q.w+A.x));k=Math.min(k,(A.h+A.y)-(r+q.h+A.y));if(m+k!==0){if(s+m<0){m=0}if(r+k<0){k=0}F.moveTo(s+m,r+k)}if(n+B!==0){F.resizeTo(q.w+n,q.h+B)}return a.cancel(w)});return a.cancel(G)},resizeBy:function(g,h,i){var f=this.windows[i];if(f){f.element.resizeBy(g,h);f.iframeElement.resizeBy(g,h)}},close:function(j,l){var h=this,g,k=d.doc,f=0,i,l;l=h._findId(l||j);if(!h.windows[l]){h.parent(j);return}h.count--;if(h.count==0){d.remove("mceModalBlocker")}if(g=h.windows[l]){h.onClose.dispatch(h);a.remove(k,"mousedown",g.mousedownFunc);a.remove(k,"click",g.clickFunc);a.clear(l);a.clear(l+"_ifr");d.setAttrib(l+"_ifr","src",'javascript:""');g.element.remove();delete h.windows[l];e(h.windows,function(m){if(m.zIndex>f){i=m;f=m.zIndex}});if(i){h.focus(i.id)}}},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();
+(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(r,j){var y=this,i,k="",q=y.editor,g=0,s=0,h,m,n,o,l,v,x;r=r||{};j=j||{};if(!r.inline){return y.parent(r,j)}if(!r.type){y.bookmark=q.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();r.width=parseInt(r.width||320);r.height=parseInt(r.height||240)+(tinymce.isIE?8:0);r.min_width=parseInt(r.min_width||150);r.min_height=parseInt(r.min_height||100);r.max_width=parseInt(r.max_width||2000);r.max_height=parseInt(r.max_height||2000);r.left=r.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(r.width/2)));r.top=r.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(r.height/2)));r.movable=r.resizable=true;j.mce_width=r.width;j.mce_height=r.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=r.auto_focus;y.features=r;y.params=j;y.onOpen.dispatch(y,r,j);if(r.type){k+=" mceModal";if(r.type){k+=" mce"+r.type.substring(0,1).toUpperCase()+r.type.substring(1)}r.resizable=false}if(r.statusbar){k+=" mceStatusbar"}if(r.resizable){k+=" mceResizable"}if(r.minimizable){k+=" mceMinimizable"}if(r.maximizable){k+=" mceMaximizable"}if(r.movable){k+=" mceMovable"}y._addAll(d.doc.body,["div",{id:i,"class":q.settings.inlinepopups_skin||"clearlooks2",style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},r.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!r.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;s+=d.get(i+"_top").clientHeight;s+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:r.top,left:r.left,width:r.width+g,height:r.height+s});x=r.url||r.file;if(x){if(tinymce.relaxedDomain){x+=(x.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}x=tinymce._addVer(x)}if(!r.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:r.width,height:r.height});d.setAttrib(i+"_ifr","src",x)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(r.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",r.content.replace("\n","<br />"))}n=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=y.windows[i];y.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return y._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return y._startDrag(i,t,u.className.substring(13))}}}}}});o=a.add(i,"click",function(f){var p=f.target;y.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":y.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":r.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});v=y.windows[i]={id:i,mousedown_func:n,click_func:o,element:new b(i,{blocker:1,container:q.getContainer()}),iframeElement:new b(i+"_ifr"),features:r,deltaWidth:g,deltaHeight:s};v.iframeElement.on("focus",function(){y.focus(i)});if(y.count==0&&y.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(y.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:y.zIndex-1}});d.show("mceModalBlocker")}else{d.setStyle("mceModalBlocker","z-index",y.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}y.focus(i);y._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}y.count++;return v},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;g<h.length;g++){f._addAll(k,h[g])}}}},_startDrag:function(v,G,E){var o=this,u,z,C=d.doc,f,l=o.windows[v],h=l.element,y=h.getXY(),x,q,F,g,A,s,r,j,i,m,k,n,B;g={x:0,y:0};A=d.getViewPort();A.w-=2;A.h-=2;j=G.screenX;i=G.screenY;m=k=n=B=0;u=a.add(C,"mouseup",function(p){a.remove(C,"mouseup",u);a.remove(C,"mousemove",z);if(f){f.remove()}h.moveBy(m,k);h.resizeBy(n,B);q=h.getSize();d.setStyles(v+"_ifr",{width:q.w-l.deltaWidth,height:q.h-l.deltaHeight});o._fixIELayout(v,1);return a.cancel(p)});if(E!="Move"){D()}function D(){if(f){return}o._fixIELayout(v,0);d.add(C.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(o.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:o.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceEventBlocker",{position:"absolute",left:A.x,top:A.y,width:A.w-2,height:A.h-2})}f=new b("mceEventBlocker");f.update();x=h.getXY();q=h.getSize();s=g.x+x.x-A.x;r=g.y+x.y-A.y;d.add(f.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:s,top:r,width:q.w,height:q.h}});F=new b("mcePlaceHolder")}z=a.add(C,"mousemove",function(w){var p,H,t;D();p=w.screenX-j;H=w.screenY-i;switch(E){case"ResizeW":m=p;n=0-p;break;case"ResizeE":n=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(E=="ResizeNW"){m=p;n=0-p}else{if(E=="ResizeNE"){n=p}}k=H;B=0-H;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(E=="ResizeSW"){m=p;n=0-p}else{if(E=="ResizeSE"){n=p}}B=H;break;case"mceMove":m=p;k=H;break}if(n<(t=l.features.min_width-q.w)){if(m!==0){m+=n-t}n=t}if(B<(t=l.features.min_height-q.h)){if(k!==0){k+=B-t}B=t}n=Math.min(n,l.features.max_width-q.w);B=Math.min(B,l.features.max_height-q.h);m=Math.max(m,A.x-(s+A.x));k=Math.max(k,A.y-(r+A.y));m=Math.min(m,(A.w+A.x)-(s+q.w+A.x));k=Math.min(k,(A.h+A.y)-(r+q.h+A.y));if(m+k!==0){if(s+m<0){m=0}if(r+k<0){k=0}F.moveTo(s+m,r+k)}if(n+B!==0){F.resizeTo(q.w+n,q.h+B)}return a.cancel(w)});return a.cancel(G)},resizeBy:function(g,h,i){var f=this.windows[i];if(f){f.element.resizeBy(g,h);f.iframeElement.resizeBy(g,h)}},close:function(j,l){var h=this,g,k=d.doc,f=0,i,l;l=h._findId(l||j);if(!h.windows[l]){h.parent(j);return}h.count--;if(h.count==0){d.remove("mceModalBlocker")}if(g=h.windows[l]){h.onClose.dispatch(h);a.remove(k,"mousedown",g.mousedownFunc);a.remove(k,"click",g.clickFunc);a.clear(l);a.clear(l+"_ifr");d.setAttrib(l+"_ifr","src",'javascript:""');g.element.remove();delete h.windows[l];e(h.windows,function(m){if(m.zIndex>f){i=m;f=m.zIndex}});if(i){h.focus(i.id)}}},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();
// plugins/media
-(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.MediaPlugin",{init:function(b,c){var e=this;e.editor=b;e.url=c;function f(g){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(g.className)}b.onPreInit.add(function(){b.serializer.addRules("param[name|value|_mce_value]")});b.addCommand("mceMedia",function(){b.windowManager.open({file:c+"/media.htm",width:430+parseInt(b.getLang("media.delta_width",0)),height:470+parseInt(b.getLang("media.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("media",{title:"media.desc",cmd:"mceMedia"});b.onNodeChange.add(function(h,g,i){g.setActive("media",i.nodeName=="IMG"&&f(i))});b.onInit.add(function(){var g={mceItemFlash:"flash",mceItemShockWave:"shockwave",mceItemWindowsMedia:"windowsmedia",mceItemQuickTime:"quicktime",mceItemRealMedia:"realmedia"};b.selection.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.selection.onBeforeSetContent.add(e._objectsToSpans,e);if(b.settings.content_css!==false){b.dom.loadCSS(c+"/css/content.css")}if(b.theme.onResolveName){b.theme.onResolveName.add(function(h,i){if(i.name=="img"){a(g,function(l,j){if(b.dom.hasClass(i.node,j)){i.name=l;i.title=b.dom.getAttrib(i.node,"title");return false}})}})}if(b&&b.plugins.contextmenu){b.plugins.contextmenu.onContextMenu.add(function(i,h,j){if(j.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(j.className)){h.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});b.onBeforeSetContent.add(e._objectsToSpans,e);b.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.onPreProcess.add(function(g,i){var h=g.dom;if(i.set){e._spansToImgs(i.node);a(h.select("IMG",i.node),function(k){var j;if(f(k)){j=e._parse(k.title);h.setAttrib(k,"width",h.getAttrib(k,"width",j.width||100));h.setAttrib(k,"height",h.getAttrib(k,"height",j.height||100))}})}if(i.get){a(h.select("IMG",i.node),function(m){var l,j,k;if(g.getParam("media_use_script")){if(f(m)){m.className=m.className.replace(/mceItem/g,"mceTemp")}return}switch(m.className){case"mceItemFlash":l="d27cdb6e-ae6d-11cf-96b8-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="application/x-shockwave-flash";break;case"mceItemShockWave":l="166b1bca-3f9c-11cf-8075-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0";k="application/x-director";break;case"mceItemWindowsMedia":l=g.getParam("media_wmp6_compatible")?"05589fa1-c356-11ce-bf01-00aa0055595a":"6bf52a52-394a-11d3-b153-00c04f79faa6";j="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";k="application/x-mplayer2";break;case"mceItemQuickTime":l="02bf25d5-8c17-4b23-bc80-d3488abddc6b";j="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0";k="video/quicktime";break;case"mceItemRealMedia":l="cfcdaa03-8be4-11cf-b84b-0020afbbccfa";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="audio/x-pn-realaudio-plugin";break}if(l){h.replace(e._buildObj({classid:l,codebase:j,type:k},m),m)}})}});b.onPostProcess.add(function(g,h){h.content=h.content.replace(/_mce_value=/g,"value=")});function d(g,h){h=new RegExp(h+'="([^"]+)"',"g").exec(g);return h?b.dom.decode(h[1]):""}b.onPostProcess.add(function(g,h){if(g.getParam("media_use_script")){h.content=h.content.replace(/<img[^>]+>/g,function(j){var i=d(j,"class");if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(i)){at=e._parse(d(j,"title"));at.width=d(j,"width");at.height=d(j,"height");j='<script type="text/javascript">write'+i.substring(7)+"({"+e._serialize(at)+"});<\/script>"}return j})}})},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}},_objectsToSpans:function(b,e){var c=this,d=e.content;d=d.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(g,f,i){var h=c._parse(i);return'<img class="mceItem'+f+'" title="'+b.dom.encode(i)+'" src="'+c.url+'/img/trans.gif" width="'+h.width+'" height="'+h.height+'" />'});d=d.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');d=d.replace(/<embed([^>]*)\/?>/gi,'<span class="mceItemEmbed" $1></span>');d=d.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');d=d.replace(/<\/(object)([^>]*)>/gi,"</span>");d=d.replace(/<\/embed>/gi,"");d=d.replace(/<param([^>]*)>/gi,function(g,f){return"<span "+f.replace(/value=/gi,"_mce_value=")+' class="mceItemParam"></span>'});d=d.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');e.content=d},_buildObj:function(g,h){var d,c=this.editor,f=c.dom,e=this._parse(h.title),b;b=c.getParam("media_strict",true)&&g.type=="application/x-shockwave-flash";e.width=g.width=f.getAttrib(h,"width")||100;e.height=g.height=f.getAttrib(h,"height")||100;if(e.src){e.src=c.convertURL(e.src,"src",h)}if(b){d=f.create("span",{id:e.id,mce_name:"object",type:"application/x-shockwave-flash",data:e.src,style:f.getAttrib(h,"style"),width:g.width,height:g.height})}else{d=f.create("span",{id:e.id,mce_name:"object",classid:"clsid:"+g.classid,style:f.getAttrib(h,"style"),codebase:g.codebase,width:g.width,height:g.height})}a(e,function(j,i){if(!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(i)){if(g.type=="application/x-mplayer2"&&i=="src"&&!e.url){i="url"}if(j){f.add(d,"span",{mce_name:"param",name:i,_mce_value:j})}}});if(!b){f.add(d,"span",tinymce.extend({mce_name:"embed",type:g.type,style:f.getAttrib(h,"style")},e))}return d},_spansToImgs:function(e){var d=this,f=d.editor.dom,b,c;a(f.select("span",e),function(g){if(f.getAttrib(g,"class")=="mceItemObject"){c=f.getAttrib(g,"classid").toLowerCase().replace(/\s+/g,"");switch(c){case"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000":f.replace(d._createImg("mceItemFlash",g),g);break;case"clsid:166b1bca-3f9c-11cf-8075-444553540000":f.replace(d._createImg("mceItemShockWave",g),g);break;case"clsid:6bf52a52-394a-11d3-b153-00c04f79faa6":case"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95":case"clsid:05589fa1-c356-11ce-bf01-00aa0055595a":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}return}if(f.getAttrib(g,"class")=="mceItemEmbed"){switch(f.getAttrib(g,"type")){case"application/x-shockwave-flash":f.replace(d._createImg("mceItemFlash",g),g);break;case"application/x-director":f.replace(d._createImg("mceItemShockWave",g),g);break;case"application/x-mplayer2":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"video/quicktime":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"audio/x-pn-realaudio-plugin":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}}})},_createImg:function(c,h){var b,g=this.editor.dom,f={},e="",d;d=["id","name","width","height","bgcolor","align","flashvars","src","wmode","allowfullscreen","quality"];b=g.create("img",{src:this.url+"/img/trans.gif",width:g.getAttrib(h,"width")||100,height:g.getAttrib(h,"height")||100,style:g.getAttrib(h,"style"),"class":c});a(d,function(i){var j=g.getAttrib(h,i);if(j){f[i]=j}});a(g.select("span",h),function(i){if(g.hasClass(i,"mceItemParam")){f[g.getAttrib(i,"name")]=g.getAttrib(i,"_mce_value")}});if(f.movie){f.src=f.movie;delete f.movie}h=g.select(".mceItemEmbed",h)[0];if(h){a(d,function(i){var j=g.getAttrib(h,i);if(j&&!f[i]){f[i]=j}})}delete f.width;delete f.height;b.title=this._serialize(f);return b},_parse:function(b){return tinymce.util.JSON.parse("{"+b+"}")},_serialize:function(b){return tinymce.util.JSON.serialize(b).replace(/[{}]/g,"")}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();
+(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.MediaPlugin",{init:function(b,c){var e=this;e.editor=b;e.url=c;function f(g){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(g.className)}b.onPreInit.add(function(){b.serializer.addRules("param[name|value|_mce_value]")});b.addCommand("mceMedia",function(){b.windowManager.open({file:c+"/media.htm",width:430+parseInt(b.getLang("media.delta_width",0)),height:470+parseInt(b.getLang("media.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("media",{title:"media.desc",cmd:"mceMedia"});b.onNodeChange.add(function(h,g,i){g.setActive("media",i.nodeName=="IMG"&&f(i))});b.onInit.add(function(){var g={mceItemFlash:"flash",mceItemShockWave:"shockwave",mceItemWindowsMedia:"windowsmedia",mceItemQuickTime:"quicktime",mceItemRealMedia:"realmedia"};b.selection.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.selection.onBeforeSetContent.add(e._objectsToSpans,e);if(b.settings.content_css!==false){b.dom.loadCSS(c+"/css/content.css")}if(b.theme&&b.theme.onResolveName){b.theme.onResolveName.add(function(h,i){if(i.name=="img"){a(g,function(l,j){if(b.dom.hasClass(i.node,j)){i.name=l;i.title=b.dom.getAttrib(i.node,"title");return false}})}})}if(b&&b.plugins.contextmenu){b.plugins.contextmenu.onContextMenu.add(function(i,h,j){if(j.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(j.className)){h.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});b.onBeforeSetContent.add(e._objectsToSpans,e);b.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.onPreProcess.add(function(g,i){var h=g.dom;if(i.set){e._spansToImgs(i.node);a(h.select("IMG",i.node),function(k){var j;if(f(k)){j=e._parse(k.title);h.setAttrib(k,"width",h.getAttrib(k,"width",j.width||100));h.setAttrib(k,"height",h.getAttrib(k,"height",j.height||100))}})}if(i.get){a(h.select("IMG",i.node),function(m){var l,j,k;if(g.getParam("media_use_script")){if(f(m)){m.className=m.className.replace(/mceItem/g,"mceTemp")}return}switch(m.className){case"mceItemFlash":l="d27cdb6e-ae6d-11cf-96b8-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="application/x-shockwave-flash";break;case"mceItemShockWave":l="166b1bca-3f9c-11cf-8075-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0";k="application/x-director";break;case"mceItemWindowsMedia":l=g.getParam("media_wmp6_compatible")?"05589fa1-c356-11ce-bf01-00aa0055595a":"6bf52a52-394a-11d3-b153-00c04f79faa6";j="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";k="application/x-mplayer2";break;case"mceItemQuickTime":l="02bf25d5-8c17-4b23-bc80-d3488abddc6b";j="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0";k="video/quicktime";break;case"mceItemRealMedia":l="cfcdaa03-8be4-11cf-b84b-0020afbbccfa";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="audio/x-pn-realaudio-plugin";break}if(l){h.replace(e._buildObj({classid:l,codebase:j,type:k},m),m)}})}});b.onPostProcess.add(function(g,h){h.content=h.content.replace(/_mce_value=/g,"value=")});function d(g,h){h=new RegExp(h+'="([^"]+)"',"g").exec(g);return h?b.dom.decode(h[1]):""}b.onPostProcess.add(function(g,h){if(g.getParam("media_use_script")){h.content=h.content.replace(/<img[^>]+>/g,function(j){var i=d(j,"class");if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(i)){at=e._parse(d(j,"title"));at.width=d(j,"width");at.height=d(j,"height");j='<script type="text/javascript">write'+i.substring(7)+"({"+e._serialize(at)+"});<\/script>"}return j})}})},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}},_objectsToSpans:function(b,e){var c=this,d=e.content;d=d.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(g,f,i){var h=c._parse(i);return'<img class="mceItem'+f+'" title="'+b.dom.encode(i)+'" src="'+c.url+'/img/trans.gif" width="'+h.width+'" height="'+h.height+'" />'});d=d.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');d=d.replace(/<embed([^>]*)\/?>/gi,'<span class="mceItemEmbed" $1></span>');d=d.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');d=d.replace(/<\/(object)([^>]*)>/gi,"</span>");d=d.replace(/<\/embed>/gi,"");d=d.replace(/<param([^>]*)>/gi,function(g,f){return"<span "+f.replace(/value=/gi,"_mce_value=")+' class="mceItemParam"></span>'});d=d.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');e.content=d},_buildObj:function(g,h){var d,c=this.editor,f=c.dom,e=this._parse(h.title),b;b=c.getParam("media_strict",true)&&g.type=="application/x-shockwave-flash";e.width=g.width=f.getAttrib(h,"width")||100;e.height=g.height=f.getAttrib(h,"height")||100;if(e.src){e.src=c.convertURL(e.src,"src",h)}if(b){d=f.create("span",{id:e.id,mce_name:"object",type:"application/x-shockwave-flash",data:e.src,style:f.getAttrib(h,"style"),width:g.width,height:g.height})}else{d=f.create("span",{id:e.id,mce_name:"object",classid:"clsid:"+g.classid,style:f.getAttrib(h,"style"),codebase:g.codebase,width:g.width,height:g.height})}a(e,function(j,i){if(!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(i)){if(g.type=="application/x-mplayer2"&&i=="src"&&!e.url){i="url"}if(j){f.add(d,"span",{mce_name:"param",name:i,_mce_value:j})}}});if(!b){f.add(d,"span",tinymce.extend({mce_name:"embed",type:g.type,style:f.getAttrib(h,"style")},e))}return d},_spansToImgs:function(e){var d=this,f=d.editor.dom,b,c;a(f.select("span",e),function(g){if(f.getAttrib(g,"class")=="mceItemObject"){c=f.getAttrib(g,"classid").toLowerCase().replace(/\s+/g,"");switch(c){case"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000":f.replace(d._createImg("mceItemFlash",g),g);break;case"clsid:166b1bca-3f9c-11cf-8075-444553540000":f.replace(d._createImg("mceItemShockWave",g),g);break;case"clsid:6bf52a52-394a-11d3-b153-00c04f79faa6":case"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95":case"clsid:05589fa1-c356-11ce-bf01-00aa0055595a":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}return}if(f.getAttrib(g,"class")=="mceItemEmbed"){switch(f.getAttrib(g,"type")){case"application/x-shockwave-flash":f.replace(d._createImg("mceItemFlash",g),g);break;case"application/x-director":f.replace(d._createImg("mceItemShockWave",g),g);break;case"application/x-mplayer2":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"video/quicktime":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"audio/x-pn-realaudio-plugin":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}}})},_createImg:function(c,h){var b,g=this.editor.dom,f={},e="",d;d=["id","name","width","height","bgcolor","align","flashvars","src","wmode","allowfullscreen","quality","data"];b=g.create("img",{src:this.url+"/img/trans.gif",width:g.getAttrib(h,"width")||100,height:g.getAttrib(h,"height")||100,style:g.getAttrib(h,"style"),"class":c});a(d,function(i){var j=g.getAttrib(h,i);if(j){f[i]=j}});a(g.select("span",h),function(i){if(g.hasClass(i,"mceItemParam")){f[g.getAttrib(i,"name")]=g.getAttrib(i,"_mce_value")}});if(f.movie){f.src=f.movie;delete f.movie}if(!f.src){f.src=f.data;delete f.data}h=g.select(".mceItemEmbed",h)[0];if(h){a(d,function(i){var j=g.getAttrib(h,i);if(j&&!f[i]){f[i]=j}})}delete f.width;delete f.height;b.title=this._serialize(f);return b},_parse:function(b){return tinymce.util.JSON.parse("{"+b+"}")},_serialize:function(b){return tinymce.util.JSON.serialize(b).replace(/[{}]/g,"")}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();
// plugins/paste
-(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.PastePlugin",{init:function(c,d){var e=this,b;e.editor=c;e.url=d;e.onPreProcess=new tinymce.util.Dispatcher(e);e.onPostProcess=new tinymce.util.Dispatcher(e);e.onPreProcess.add(e._preProcess);e.onPostProcess.add(e._postProcess);e.onPreProcess.add(function(h,i){c.execCallback("paste_preprocess",h,i)});e.onPostProcess.add(function(h,i){c.execCallback("paste_postprocess",h,i)});function g(i){var k=c.dom,j={content:i};e.onPreProcess.dispatch(e,j);j.node=k.create("div",0,j.content);e.onPostProcess.dispatch(e,j);j.content=c.serializer.serialize(j.node,{getInner:1});if(/<(p|h[1-6]|ul|ol)/.test(j.content)){e._insertBlockContent(c,k,j.content)}else{e._insert(j.content)}}c.addCommand("mceInsertClipboardContent",function(i,h){g(h)});function f(l){var p,k,i,j=c.selection,o=c.dom,h=c.getBody(),m;if(o.get("_mcePaste")){return}p=o.add(h,"div",{id:"_mcePaste"}," ");if(h!=c.getDoc().body){m=o.getPos(c.selection.getStart(),h).y}else{m=h.scrollTop}o.setStyles(p,{position:"absolute",left:-10000,top:m,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){i=o.doc.body.createTextRange();i.moveToElementText(p);i.execCommand("Paste");o.remove(p);g(p.innerHTML);return tinymce.dom.Event.cancel(l)}else{k=c.selection.getRng();p=p.firstChild;i=c.getDoc().createRange();i.setStart(p,0);i.setEnd(p,1);j.setRng(i);window.setTimeout(function(){var r=o.get("_mcePaste"),q;r.id="_mceRemoved";o.remove(r);r=o.get("_mcePaste")||r;q=(o.select("> span.Apple-style-span div",r)[0]||o.select("> span.Apple-style-span",r)[0]||r).innerHTML;o.remove(r);if(k){j.setRng(k)}g(q)},0)}}if(c.getParam("paste_auto_cleanup_on_paste",true)){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){c.onKeyDown.add(function(h,i){if(((tinymce.isMac?i.metaKey:i.ctrlKey)&&i.keyCode==86)||(i.shiftKey&&i.keyCode==45)){f(i)}})}else{c.onPaste.addToTop(function(h,i){return f(i)})}}if(c.getParam("paste_block_drop")){c.onInit.add(function(){c.dom.bind(c.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(h){h.preventDefault();h.stopPropagation();return false})})}e._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(d,g){var b=this.editor,c=g.content,f,e;function f(h){a(h,function(i){if(i.constructor==RegExp){c=c.replace(i,"")}else{c=c.replace(i[0],i[1])}})}f([/^\s*( )+/g,/( |<br[^>]*>)+\s*$/g]);if(/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(c)){g.wordContent=true;if(b.getParam("paste_convert_middot_lists",true)){f([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+:\s*symbol[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<span[^>]+mso-list:[^>]+>)/gi,"$1__MCE_ITEM__"]])}f([/<!--[\s\S]+?-->/gi,/<\/?(img|font|meta|link|style|div|v:\w+)[^>]*>/gi,/<\\?\?xml[^>]*>/gi,/<\/?o:[^>]*>/gi,/ (id|name|language|type|on\w+|v:\w+)=\"([^\"]*)\"/gi,/ (id|name|language|type|on\w+|v:\w+)=(\w+)/gi,[/<(\/?)s>/gi,"<$1strike>"],/<script[^>]+>[\s\S]*?<\/script>/gi,[/ /g,"\u00a0"]]);if(!b.getParam("paste_retain_style_properties")){f([/<\/?(span)[^>]*>/gi])}}e=b.getParam("paste_strip_class_attributes","all");if(e!="none"){if(e=="all"){f([/ class=\"([^\"]*)\"/gi,/ class=(\w+)/gi])}else{f([/ class=\"(mso[^\"]*)\"/gi,/ class=(mso\w+)/gi])}}if(b.getParam("paste_remove_spans")){f([/<\/?(span)[^>]*>/gi])}g.content=c},_postProcess:function(e,g){var d=this,c=d.editor,f=c.dom,b;if(g.wordContent){a(f.select("a",g.node),function(h){if(!h.href||h.href.indexOf("#_Toc")!=-1){f.remove(h,1)}});if(d.editor.getParam("paste_convert_middot_lists",true)){d._convertLists(e,g)}b=c.getParam("paste_retain_style_properties");if(tinymce.is(b,"string")){b=tinymce.explode(b)}a(f.select("*",g.node),function(l){var m={},j=0,k,n,h;if(b){for(k=0;k<b.length;k++){n=b[k];h=f.getStyle(l,n);if(h){m[n]=h;j++}}}f.setAttrib(l,"style","");if(b&&j>0){f.setStyles(l,m)}else{if(l.nodeName=="SPAN"&&!l.className){f.remove(l,true)}}})}if(c.getParam("paste_remove_styles")||(c.getParam("paste_remove_styles_if_webkit")&&tinymce.isWebKit)){a(f.select("*[style]",g.node),function(h){h.removeAttribute("style");h.removeAttribute("mce_style")})}else{if(tinymce.isWebKit){a(f.select("*",g.node),function(h){h.removeAttribute("mce_style")})}}},_convertLists:function(e,c){var g=e.editor.dom,f,j,b=-1,d,k=[],i,h;a(g.select("p",c.node),function(r){var n,s="",q,o,l,m;for(n=r.firstChild;n&&n.nodeType==3;n=n.nextSibling){s+=n.nodeValue}s=r.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(s)){q="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(s)){q="ol"}if(q){d=parseFloat(r.style.marginLeft||0);if(d>b){k.push(d)}if(!f||q!=i){f=g.create(q);g.insertAfter(f,r)}else{if(d>b){f=j.appendChild(g.create(q))}else{if(d<b){l=tinymce.inArray(k,d);m=g.getParents(f.parentNode,q);f=m[m.length-1-l]||f}}}a(g.select("span",r),function(t){var p=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(q=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){g.remove(t)}else{if(/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){g.remove(t)}}});o=r.innerHTML;if(q=="ul"){o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/,"")}else{o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}j=f.appendChild(g.create("li",0,o));g.remove(r);b=d;i=q}else{f=b=0}});h=c.node.innerHTML;if(h.indexOf("__MCE_ITEM__")!=-1){c.node.innerHTML=h.replace(/__MCE_ITEM__/g,"")}},_insertBlockContent:function(h,e,i){var c,g,d=h.selection,m,j,b,k,f;function l(p){var o;if(tinymce.isIE){o=h.getDoc().body.createTextRange();o.moveToElementText(p);o.collapse(false);o.select()}else{d.select(p,1);d.collapse(false)}}this._insert('<span id="_marker"> </span>',1);g=e.get("_marker");c=e.getParent(g,"p,h1,h2,h3,h4,h5,h6,ul,ol");if(c){g=e.split(c,g);a(e.create("div",0,i).childNodes,function(o){m=g.parentNode.insertBefore(o.cloneNode(true),g)});l(m)}else{e.setOuterHTML(g,i);d.select(h.getBody(),1);d.collapse(0)}e.remove("_marker");j=d.getStart();b=e.getViewPort(h.getWin());k=h.dom.getPos(j).y;f=j.clientHeight;if(k<b.y||k+f>b.y+b.h){h.getDoc().body.scrollTop=k<b.y?k:k-b.h+25}},_insert:function(d,b){var c=this.editor;if(!c.selection.isCollapsed()){c.getDoc().execCommand("Delete",false,null)}c.execCommand(tinymce.isGecko?"insertHTML":"mceInsertContent",false,d,{skip_undo:b})},_legacySupport:function(){var c=this,b=c.editor;a(["mcePasteText","mcePasteWord"],function(d){b.addCommand(d,function(){b.windowManager.open({file:c.url+(d=="mcePasteText"?"/pastetext.htm":"/pasteword.htm"),width:parseInt(b.getParam("paste_dialog_width","450")),height:parseInt(b.getParam("paste_dialog_height","400")),inline:1})})});b.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});b.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"});b.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
+(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.PastePlugin",{init:function(c,d){var e=this,b;e.editor=c;e.url=d;e.onPreProcess=new tinymce.util.Dispatcher(e);e.onPostProcess=new tinymce.util.Dispatcher(e);e.onPreProcess.add(e._preProcess);e.onPostProcess.add(e._postProcess);e.onPreProcess.add(function(h,i){c.execCallback("paste_preprocess",h,i)});e.onPostProcess.add(function(h,i){c.execCallback("paste_postprocess",h,i)});function g(i){var h=c.dom;e.onPreProcess.dispatch(e,i);i.node=h.create("div",0,i.content);e.onPostProcess.dispatch(e,i);i.content=c.serializer.serialize(i.node,{getInner:1});if(/<(p|h[1-6]|ul|ol)/.test(i.content)){e._insertBlockContent(c,h,i.content)}else{e._insert(i.content)}}c.addCommand("mceInsertClipboardContent",function(h,i){g(i)});function f(l){var p,k,i,j=c.selection,o=c.dom,h=c.getBody(),m;if(o.get("_mcePaste")){return}p=o.add(h,"div",{id:"_mcePaste"},"\uFEFF");if(h!=c.getDoc().body){m=o.getPos(c.selection.getStart(),h).y}else{m=h.scrollTop}o.setStyles(p,{position:"absolute",left:-10000,top:m,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){i=o.doc.body.createTextRange();i.moveToElementText(p);i.execCommand("Paste");o.remove(p);if(p.innerHTML==="\uFEFF"){c.execCommand("mcePasteWord");l.preventDefault();return}g({content:p.innerHTML});return tinymce.dom.Event.cancel(l)}else{k=c.selection.getRng();p=p.firstChild;i=c.getDoc().createRange();i.setStart(p,0);i.setEnd(p,1);j.setRng(i);window.setTimeout(function(){var q="",n=o.select("div[id=_mcePaste]");a(n,function(r){q+=(o.select("> span.Apple-style-span div",r)[0]||o.select("> span.Apple-style-span",r)[0]||r).innerHTML});a(n,function(r){o.remove(r)});if(k){j.setRng(k)}g({content:q})},0)}}if(c.getParam("paste_auto_cleanup_on_paste",true)){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){c.onKeyDown.add(function(h,i){if(((tinymce.isMac?i.metaKey:i.ctrlKey)&&i.keyCode==86)||(i.shiftKey&&i.keyCode==45)){f(i)}})}else{c.onPaste.addToTop(function(h,i){return f(i)})}}if(c.getParam("paste_block_drop")){c.onInit.add(function(){c.dom.bind(c.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(h){h.preventDefault();h.stopPropagation();return false})})}e._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(d,i){var b=this.editor,c=i.content,g,f;function g(h){a(h,function(j){if(j.constructor==RegExp){c=c.replace(j,"")}else{c=c.replace(j[0],j[1])}})}if(/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(c)||i.wordContent){i.wordContent=true;g([/^\s*( )+/g,/( |<br[^>]*>)+\s*$/g]);if(b.getParam("paste_convert_middot_lists",true)){g([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+:\s*symbol[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<span[^>]+mso-list:[^>]+>)/gi,"$1__MCE_ITEM__"]])}g([/<!--[\s\S]+?-->/gi,/<\/?(img|font|meta|link|style|div|v:\w+)[^>]*>/gi,/<\\?\?xml[^>]*>/gi,/<\/?o:[^>]*>/gi,/ (id|name|language|type|on\w+|v:\w+)=\"([^\"]*)\"/gi,/ (id|name|language|type|on\w+|v:\w+)=(\w+)/gi,[/<(\/?)s>/gi,"<$1strike>"],/<script[^>]+>[\s\S]*?<\/script>/gi,[/ /g,"\u00a0"]]);if(!b.getParam("paste_retain_style_properties")){g([/<\/?(span)[^>]*>/gi])}}f=b.getParam("paste_strip_class_attributes");if(f!="none"){function e(l,h){var k,j="";if(f=="all"){return""}h=tinymce.explode(h," ");for(k=h.length-1;k>=0;k--){if(!/^(Mso)/i.test(h[k])){j+=(!j?"":" ")+h[k]}}return' class="'+j+'"'}g([[/ class=\"([^\"]*)\"/gi,e],[/ class=(\w+)/gi,e]])}if(b.getParam("paste_remove_spans")){g([/<\/?(span)[^>]*>/gi])}i.content=c},_postProcess:function(e,g){var d=this,c=d.editor,f=c.dom,b;if(g.wordContent){a(f.select("a",g.node),function(h){if(!h.href||h.href.indexOf("#_Toc")!=-1){f.remove(h,1)}});if(d.editor.getParam("paste_convert_middot_lists",true)){d._convertLists(e,g)}b=c.getParam("paste_retain_style_properties");if(tinymce.is(b,"string")){b=tinymce.explode(b)}a(f.select("*",g.node),function(l){var m={},j=0,k,n,h;if(b){for(k=0;k<b.length;k++){n=b[k];h=f.getStyle(l,n);if(h){m[n]=h;j++}}}f.setAttrib(l,"style","");if(b&&j>0){f.setStyles(l,m)}else{if(l.nodeName=="SPAN"&&!l.className){f.remove(l,true)}}})}if(c.getParam("paste_remove_styles")||(c.getParam("paste_remove_styles_if_webkit")&&tinymce.isWebKit)){a(f.select("*[style]",g.node),function(h){h.removeAttribute("style");h.removeAttribute("mce_style")})}else{if(tinymce.isWebKit){a(f.select("*",g.node),function(h){h.removeAttribute("mce_style")})}}},_convertLists:function(e,c){var g=e.editor.dom,f,j,b=-1,d,k=[],i,h;a(g.select("p",c.node),function(r){var n,s="",q,o,l,m;for(n=r.firstChild;n&&n.nodeType==3;n=n.nextSibling){s+=n.nodeValue}s=r.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(s)){q="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(s)){q="ol"}if(q){d=parseFloat(r.style.marginLeft||0);if(d>b){k.push(d)}if(!f||q!=i){f=g.create(q);g.insertAfter(f,r)}else{if(d>b){f=j.appendChild(g.create(q))}else{if(d<b){l=tinymce.inArray(k,d);m=g.getParents(f.parentNode,q);f=m[m.length-1-l]||f}}}a(g.select("span",r),function(t){var p=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(q=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){g.remove(t)}else{if(/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){g.remove(t)}}});o=r.innerHTML;if(q=="ul"){o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/,"")}else{o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}j=f.appendChild(g.create("li",0,o));g.remove(r);b=d;i=q}else{f=b=0}});h=c.node.innerHTML;if(h.indexOf("__MCE_ITEM__")!=-1){c.node.innerHTML=h.replace(/__MCE_ITEM__/g,"")}},_insertBlockContent:function(h,e,i){var c,g,d=h.selection,m,j,b,k,f;function l(p){var o;if(tinymce.isIE){o=h.getDoc().body.createTextRange();o.moveToElementText(p);o.collapse(false);o.select()}else{d.select(p,1);d.collapse(false)}}this._insert('<span id="_marker"> </span>',1);g=e.get("_marker");c=e.getParent(g,"p,h1,h2,h3,h4,h5,h6,ul,ol,th,td");if(c&&!/TD|TH/.test(c.nodeName)){g=e.split(c,g);a(e.create("div",0,i).childNodes,function(o){m=g.parentNode.insertBefore(o.cloneNode(true),g)});l(m)}else{e.setOuterHTML(g,i);d.select(h.getBody(),1);d.collapse(0)}e.remove("_marker");j=d.getStart();b=e.getViewPort(h.getWin());k=h.dom.getPos(j).y;f=j.clientHeight;if(k<b.y||k+f>b.y+b.h){h.getDoc().body.scrollTop=k<b.y?k:k-b.h+25}},_insert:function(d,b){var c=this.editor;if(!c.selection.isCollapsed()){c.getDoc().execCommand("Delete",false,null)}c.execCommand(tinymce.isGecko?"insertHTML":"mceInsertContent",false,d,{skip_undo:b})},_legacySupport:function(){var c=this,b=c.editor;a(["mcePasteText","mcePasteWord"],function(d){b.addCommand(d,function(){b.windowManager.open({file:c.url+(d=="mcePasteText"?"/pastetext.htm":"/pasteword.htm"),width:parseInt(b.getParam("paste_dialog_width","450")),height:parseInt(b.getParam("paste_dialog_height","400")),inline:1})})});b.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});b.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"});b.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
// plugins/safari
(function(){var a=tinymce.dom.Event,c=tinymce.grep,d=tinymce.each,b=tinymce.inArray;function e(j,i,h){var g,k;g=j.createTreeWalker(i,NodeFilter.SHOW_ALL,null,false);while(k=g.nextNode()){if(h){if(!h(k)){return false}}if(k.nodeType==3&&k.nodeValue&&/[^\s\u00a0]+/.test(k.nodeValue)){return false}if(k.nodeType==1&&/^(HR|IMG|TABLE)$/.test(k.nodeName)){return false}}return true}tinymce.create("tinymce.plugins.Safari",{init:function(f){var g=this,h;if(!tinymce.isWebKit){return}g.editor=f;g.webKitFontSizes=["x-small","small","medium","large","x-large","xx-large","-webkit-xxx-large"];g.namedFontSizes=["xx-small","x-small","small","medium","large","x-large","xx-large"];f.addCommand("CreateLink",function(k,j){var m=f.selection.getNode(),l=f.dom,i;if(m&&(/^(left|right)$/i.test(l.getStyle(m,"float",1))||/^(left|right)$/i.test(l.getAttrib(m,"align")))){i=l.create("a",{href:j},m.cloneNode());m.parentNode.replaceChild(i,m);f.selection.select(i)}else{f.getDoc().execCommand("CreateLink",false,j)}});f.onKeyUp.add(function(j,o){var l,i,m,p,k;if(o.keyCode==46||o.keyCode==8){i=j.getBody();l=i.innerHTML;k=j.selection;if(i.childNodes.length==1&&!/<(img|hr)/.test(l)&&tinymce.trim(l.replace(/<[^>]+>/g,"")).length==0){j.setContent('<p><br mce_bogus="1" /></p>',{format:"raw"});p=i.firstChild;m=k.getRng();m.setStart(p,0);m.setEnd(p,0);k.setRng(m)}}});f.addCommand("FormatBlock",function(j,i){var l=f.dom,k=l.getParent(f.selection.getNode(),l.isBlock);if(k){l.replace(l.create(i),k,1)}else{f.getDoc().execCommand("FormatBlock",false,i)}});f.addCommand("mceInsertContent",function(j,i){f.getDoc().execCommand("InsertText",false,"mce_marker");f.getBody().innerHTML=f.getBody().innerHTML.replace(/mce_marker/g,f.dom.processHTML(i)+'<span id="_mce_tmp">XX</span>');f.selection.select(f.dom.get("_mce_tmp"));f.getDoc().execCommand("Delete",false," ")});f.onKeyPress.add(function(o,p){var q,v,r,l,j,k,i,u,m,t,s;if(p.keyCode==13){i=o.selection;q=i.getNode();if(p.shiftKey||o.settings.force_br_newlines&&q.nodeName!="LI"){g._insertBR(o);a.cancel(p)}if(v=h.getParent(q,"LI")){r=h.getParent(v,"OL,UL");u=o.getDoc();s=h.create("p");h.add(s,"br",{mce_bogus:"1"});if(e(u,v)){if(k=h.getParent(r.parentNode,"LI,OL,UL")){return}k=h.getParent(r,"p,h1,h2,h3,h4,h5,h6,div")||r;l=u.createRange();l.setStartBefore(k);l.setEndBefore(v);j=u.createRange();j.setStartAfter(v);j.setEndAfter(k);m=l.cloneContents();t=j.cloneContents();if(!e(u,t)){h.insertAfter(t,k)}h.insertAfter(s,k);if(!e(u,m)){h.insertAfter(m,k)}h.remove(k);k=s.firstChild;l=u.createRange();l.setStartBefore(k);l.setEndBefore(k);i.setRng(l);return a.cancel(p)}}}});f.onExecCommand.add(function(i,k){var j,m,n,l;if(k=="InsertUnorderedList"||k=="InsertOrderedList"){j=i.selection;m=i.dom;if(n=m.getParent(j.getNode(),function(o){return/^(H[1-6]|P|ADDRESS|PRE)$/.test(o.nodeName)})){l=j.getBookmark();m.remove(n,1);j.moveToBookmark(l)}}});f.onClick.add(function(i,j){j=j.target;if(j.nodeName=="IMG"){g.selElm=j;i.selection.select(j)}else{g.selElm=null}});f.onInit.add(function(){g._fixWebKitSpans()});f.onSetContent.add(function(){h=f.dom;d(["strong","b","em","u","strike","sub","sup","a"],function(i){d(c(h.select(i)).reverse(),function(l){var k=l.nodeName.toLowerCase(),j;if(k=="a"){if(l.name){h.replace(h.create("img",{mce_name:"a",name:l.name,"class":"mceItemAnchor"}),l)}return}switch(k){case"b":case"strong":if(k=="b"){k="strong"}j="font-weight: bold;";break;case"em":j="font-style: italic;";break;case"u":j="text-decoration: underline;";break;case"sub":j="vertical-align: sub;";break;case"sup":j="vertical-align: super;";break;case"strike":j="text-decoration: line-through;";break}h.replace(h.create("span",{mce_name:k,style:j,"class":"Apple-style-span"}),l,1)})})});f.onPreProcess.add(function(i,j){h=i.dom;d(c(j.node.getElementsByTagName("span")).reverse(),function(m){var k,l;if(j.get){if(h.hasClass(m,"Apple-style-span")){l=m.style.backgroundColor;switch(h.getAttrib(m,"mce_name")){case"font":if(!i.settings.convert_fonts_to_spans){h.setAttrib(m,"style","")}break;case"strong":case"em":case"sub":case"sup":h.setAttrib(m,"style","");break;case"strike":case"u":if(!i.settings.inline_styles){h.setAttrib(m,"style","")}else{h.setAttrib(m,"mce_name","")}break;default:if(!i.settings.inline_styles){h.setAttrib(m,"style","")}}if(l){m.style.backgroundColor=l}}}if(h.hasClass(m,"mceItemRemoved")){h.remove(m,1)}})});f.onPostProcess.add(function(i,j){j.content=j.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g,"</$1>");j.content=j.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 g=this,f=g.editor;a.add(f.getDoc(),"DOMNodeInserted",function(h){h=h.target;if(h&&h.nodeType==1){g._fixAppleSpan(h)}})},_fixAppleSpan:function(l){var g=this.editor,m=g.dom,i=this.webKitFontSizes,f=this.namedFontSizes,j=g.settings,h,k;if(m.getAttrib(l,"mce_fixed")){return}if(l.nodeName=="SPAN"&&l.className=="Apple-style-span"){h=l.style;if(!j.convert_fonts_to_spans){if(h.fontSize){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"size",b(i,h.fontSize)+1)}if(h.fontFamily){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"face",h.fontFamily)}if(h.color){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"color",m.toHex(h.color))}if(h.backgroundColor){m.setAttrib(l,"mce_name","font");m.setStyle(l,"background-color",h.backgroundColor)}}else{if(h.fontSize){m.setStyle(l,"fontSize",f[b(i,h.fontSize)])}}if(h.fontWeight=="bold"){m.setAttrib(l,"mce_name","strong")}if(h.fontStyle=="italic"){m.setAttrib(l,"mce_name","em")}if(h.textDecoration=="underline"){m.setAttrib(l,"mce_name","u")}if(h.textDecoration=="line-through"){m.setAttrib(l,"mce_name","strike")}if(h.verticalAlign=="super"){m.setAttrib(l,"mce_name","sup")}if(h.verticalAlign=="sub"){m.setAttrib(l,"mce_name","sub")}m.setAttrib(l,"mce_fixed","1")}},_insertBR:function(f){var j=f.dom,h=f.selection,i=h.getRng(),g;i.insertNode(g=j.create("br"));i.setStartAfter(g);i.setEndAfter(g);h.setRng(i);if(h.getSel().focusNode==g.previousSibling){h.select(j.insertAfter(j.doc.createTextNode("\u00a0"),g));h.collapse(1)}f.getWin().scrollTo(0,j.getPos(h.getRng().startContainer).y)}});tinymce.PluginManager.add("safari",tinymce.plugins.Safari)})();
// plugins/spellchecker
// plugins/tabfocus
(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(i){o=c.getParent(l.id,"form");n=o.elements;if(o){d(n,function(s,r){if(s.id==l.id){j=r;return false}});if(i>0){for(m=j+1;m<n.length;m++){if(n[m].type!="hidden"){return n[m]}}}else{for(m=j-1;m>=0;m--){if(n[m].type!="hidden"){return n[m]}}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(l=tinymce.EditorManager.get(n.id||n.name)){l.focus()}else{window.setTimeout(function(){window.focus();n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}f.onInit.add(function(){d(c.select("a:first,a:last",f.getContainer()),function(i){a.add(i,"focus",function(){f.focus()})})})},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})();
// plugins/wordpress
-(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.WordPress",{init:function(c,d){var e=this,h=c.getParam("wordpress_adv_toolbar","toolbar2"),g=0,f,b;f='<img src="'+d+'/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+c.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+c.getLang("wordpress.wp_page_alt")+'" />';if(getUserSetting("hidetb","0")=="1"){c.settings.wordpress_adv_hidden=0}c.onPostRender.add(function(){if(c.getParam("wordpress_adv_hidden",1)){a.hide(c.controlManager.get(h).id);e._resizeIframe(c,h,28)}});c.addCommand("WP_More",function(){c.execCommand("mceInsertContent",0,f)});c.addCommand("WP_Page",function(){c.execCommand("mceInsertContent",0,b)});c.addCommand("WP_Help",function(){c.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",width:450,height:420,inline:1})});c.addCommand("WP_Adv",function(){var j=c.controlManager.get(h).id,i=c.controlManager;if(a.isHidden(j)){i.setActive("wp_adv",1);a.show(j);e._resizeIframe(c,h,-28);c.settings.wordpress_adv_hidden=0;setUserSetting("hidetb","1")}else{i.setActive("wp_adv",0);a.hide(j);e._resizeIframe(c,h,28);c.settings.wordpress_adv_hidden=1;setUserSetting("hidetb","0")}});c.addButton("wp_more",{title:"wordpress.wp_more_desc",image:d+"/img/more.gif",cmd:"WP_More"});c.addButton("wp_page",{title:"wordpress.wp_page_desc",image:d+"/img/page.gif",cmd:"WP_Page"});c.addButton("wp_help",{title:"wordpress.wp_help_desc",image:d+"/img/help.gif",cmd:"WP_Help"});c.addButton("wp_adv",{title:"wordpress.wp_adv_desc",image:d+"/img/toolbars.gif",cmd:"WP_Adv"});c.addButton("add_media",{title:"wordpress.add_media",image:d+"/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")}});c.addButton("add_image",{title:"wordpress.add_image",image:d+"/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")}});c.addButton("add_video",{title:"wordpress.add_video",image:d+"/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")}});c.addButton("add_audio",{title:"wordpress.add_audio",image:d+"/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")}});c.onBeforeExecCommand.add(function(i,k,j,l){if("mceFullScreen"!=k){return}if("mce_fullscreen"!=i.id){i.settings.theme_advanced_buttons1+=",|,add_image,add_video,add_audio,add_media"}});c.addCommand("JustifyLeft",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyLeft","left")}else{c.plugins.wordpress.do_align(i,"alignleft")}});c.addCommand("JustifyRight",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyRight","right")}else{c.plugins.wordpress.do_align(i,"alignright")}});c.addCommand("JustifyCenter",function(){var k=c.selection.getNode(),j=c.dom.getParent(k,"p"),i=c.dom.getParent(k,"dl");if(k.nodeName=="IMG"&&(j||i)){c.plugins.wordpress.do_align(k,"aligncenter")}else{c.editorCommands.mceJustify("JustifyCenter","center")}});if("undefined"!=typeof wpWordCount){c.onKeyUp.add(function(i,j){if(j.keyCode==g){return}if(13==j.keyCode||8==g||46==g){wpWordCount.wc(i.getContent({format:"raw"}))}g=j.keyCode})}e._handleMoreBreak(c,d);c.addShortcut("alt+shift+c",c.getLang("justifycenter_desc"),"JustifyCenter");c.addShortcut("alt+shift+r",c.getLang("justifyright_desc"),"JustifyRight");c.addShortcut("alt+shift+l",c.getLang("justifyleft_desc"),"JustifyLeft");c.addShortcut("alt+shift+j",c.getLang("justifyfull_desc"),"JustifyFull");c.addShortcut("alt+shift+q",c.getLang("blockquote_desc"),"mceBlockQuote");c.addShortcut("alt+shift+u",c.getLang("bullist_desc"),"InsertUnorderedList");c.addShortcut("alt+shift+o",c.getLang("numlist_desc"),"InsertOrderedList");c.addShortcut("alt+shift+d",c.getLang("striketrough_desc"),"Strikethrough");c.addShortcut("alt+shift+n",c.getLang("spellchecker.desc"),"mceSpellCheck");c.addShortcut("alt+shift+a",c.getLang("link_desc"),"mceLink");c.addShortcut("alt+shift+s",c.getLang("unlink_desc"),"unlink");c.addShortcut("alt+shift+m",c.getLang("image_desc"),"mceImage");c.addShortcut("alt+shift+g",c.getLang("fullscreen.desc"),"mceFullScreen");c.addShortcut("alt+shift+z",c.getLang("wp_adv_desc"),"WP_Adv");c.addShortcut("alt+shift+h",c.getLang("help_desc"),"WP_Help");c.addShortcut("alt+shift+t",c.getLang("wp_more_desc"),"WP_More");c.addShortcut("alt+shift+p",c.getLang("wp_page_desc"),"WP_Page");c.addShortcut("ctrl+s",c.getLang("save_desc"),function(){if("function"==typeof autosave){autosave()}});if(tinymce.isWebKit){c.addShortcut("alt+shift+b",c.getLang("bold_desc"),"Bold");c.addShortcut("alt+shift+i",c.getLang("italic_desc"),"Italic")}},getInfo:function(){return{longname:"WordPress Plugin",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"3.0"}},do_align:function(j,d){var h,f,g,b,i,e=tinyMCE.activeEditor;if(/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(j.className)){return}h=e.dom.getParent(j,"p");f=e.dom.getParent(j,"dl");g=e.dom.getParent(j,"div");if(f&&g){b=e.dom.hasClass(f,d)?"alignnone":d;f.className=f.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(f,b);i=(b=="aligncenter")?e.dom.addClass(g,"mceIEcenter"):e.dom.removeClass(g,"mceIEcenter")}else{if(h){b=e.dom.hasClass(j,d)?"alignnone":d;j.className=j.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(j,b);if(b=="aligncenter"){e.dom.setStyle(h,"textAlign","center")}else{if(h.style&&h.style.textAlign=="center"){e.dom.setStyle(h,"textAlign","")}}}}e.execCommand("mceRepaint")},_resizeIframe:function(c,e,b){var d=c.getContentAreaContainer().firstChild;a.setStyle(d,"height",d.clientHeight+b);c.theme.deltaHeight+=b},_handleMoreBreak:function(c,d){var e,b;e='<img src="'+d+'/img/trans.gif" alt="$1" class="mceWPmore mceItemNoResize" title="'+c.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+c.getLang("wordpress.wp_page_alt")+'" />';c.onInit.add(function(){c.dom.loadCSS(d+"/css/content.css")});c.onPostRender.add(function(){if(c.theme.onResolveName){c.theme.onResolveName.add(function(f,g){if(g.node.nodeName=="IMG"){if(c.dom.hasClass(g.node,"mceWPmore")){g.name="wpmore"}if(c.dom.hasClass(g.node,"mceWPnextpage")){g.name="wppage"}}})}});c.onBeforeSetContent.add(function(f,g){g.content=g.content.replace(/<!--more(.*?)-->/g,e);g.content=g.content.replace(/<!--nextpage-->/g,b)});c.onPostProcess.add(function(f,g){if(g.get){g.content=g.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mceWPmore')!==-1){var h,j=(h=i.match(/alt="(.*?)"/))?h[1]:"";i="<!--more"+j+"-->"}if(i.indexOf('class="mceWPnextpage')!==-1){i="<!--nextpage-->"}return i})}});c.onNodeChange.add(function(g,f,h){f.setActive("wp_page",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPnextpage"));f.setActive("wp_more",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPmore"))})}});tinymce.PluginManager.add("wordpress",tinymce.plugins.WordPress)})();
+(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.WordPress",{mceTout:0,init:function(c,d){var e=this,h=c.getParam("wordpress_adv_toolbar","toolbar2"),g=0,f,b;f='<img src="'+d+'/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+c.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+c.getLang("wordpress.wp_page_alt")+'" />';if(getUserSetting("hidetb","0")=="1"){c.settings.wordpress_adv_hidden=0}c.onPostRender.add(function(){var i=c.controlManager.get(h);if(c.getParam("wordpress_adv_hidden",1)&&i){a.hide(i.id);e._resizeIframe(c,h,28)}});c.addCommand("WP_More",function(){c.execCommand("mceInsertContent",0,f)});c.addCommand("WP_Page",function(){c.execCommand("mceInsertContent",0,b)});c.addCommand("WP_Help",function(){c.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",width:450,height:420,inline:1})});c.addCommand("WP_Adv",function(){var i=c.controlManager,j=i.get(h).id;if("undefined"==j){return}if(a.isHidden(j)){i.setActive("wp_adv",1);a.show(j);e._resizeIframe(c,h,-28);c.settings.wordpress_adv_hidden=0;setUserSetting("hidetb","1")}else{i.setActive("wp_adv",0);a.hide(j);e._resizeIframe(c,h,28);c.settings.wordpress_adv_hidden=1;setUserSetting("hidetb","0")}});c.addButton("wp_more",{title:"wordpress.wp_more_desc",image:d+"/img/more.gif",cmd:"WP_More"});c.addButton("wp_page",{title:"wordpress.wp_page_desc",image:d+"/img/page.gif",cmd:"WP_Page"});c.addButton("wp_help",{title:"wordpress.wp_help_desc",image:d+"/img/help.gif",cmd:"WP_Help"});c.addButton("wp_adv",{title:"wordpress.wp_adv_desc",image:d+"/img/toolbars.gif",cmd:"WP_Adv"});c.addButton("add_media",{title:"wordpress.add_media",image:d+"/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")}});c.addButton("add_image",{title:"wordpress.add_image",image:d+"/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")}});c.addButton("add_video",{title:"wordpress.add_video",image:d+"/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")}});c.addButton("add_audio",{title:"wordpress.add_audio",image:d+"/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")}});c.onBeforeExecCommand.add(function(i,l,k,m){var j=tinymce.DOM;if("mceFullScreen"!=l){return}if("mce_fullscreen"!=i.id&&j.get("add_audio")&&j.get("add_video")&&j.get("add_image")&&j.get("add_media")){i.settings.theme_advanced_buttons1+=",|,add_image,add_video,add_audio,add_media"}});c.addCommand("JustifyLeft",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyLeft","left")}else{c.plugins.wordpress.do_align(i,"alignleft")}});c.addCommand("JustifyRight",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyRight","right")}else{c.plugins.wordpress.do_align(i,"alignright")}});c.addCommand("JustifyCenter",function(){var k=c.selection.getNode(),j=c.dom.getParent(k,"p"),i=c.dom.getParent(k,"dl");if(k.nodeName=="IMG"&&(j||i)){c.plugins.wordpress.do_align(k,"aligncenter")}else{c.editorCommands.mceJustify("JustifyCenter","center")}});if("undefined"!=typeof wpWordCount){c.onKeyUp.add(function(i,j){if(j.keyCode==g){return}if(13==j.keyCode||8==g||46==g){wpWordCount.wc(i.getContent({format:"raw"}))}g=j.keyCode})}c.onSaveContent.add(function(i,j){if(typeof(switchEditors)=="object"){if(i.isHidden()){j.content=j.element.value}else{j.content=switchEditors.pre_wpautop(j.content)}}});e._handleMoreBreak(c,d);c.addShortcut("alt+shift+c",c.getLang("justifycenter_desc"),"JustifyCenter");c.addShortcut("alt+shift+r",c.getLang("justifyright_desc"),"JustifyRight");c.addShortcut("alt+shift+l",c.getLang("justifyleft_desc"),"JustifyLeft");c.addShortcut("alt+shift+j",c.getLang("justifyfull_desc"),"JustifyFull");c.addShortcut("alt+shift+q",c.getLang("blockquote_desc"),"mceBlockQuote");c.addShortcut("alt+shift+u",c.getLang("bullist_desc"),"InsertUnorderedList");c.addShortcut("alt+shift+o",c.getLang("numlist_desc"),"InsertOrderedList");c.addShortcut("alt+shift+d",c.getLang("striketrough_desc"),"Strikethrough");c.addShortcut("alt+shift+n",c.getLang("spellchecker.desc"),"mceSpellCheck");c.addShortcut("alt+shift+a",c.getLang("link_desc"),"mceLink");c.addShortcut("alt+shift+s",c.getLang("unlink_desc"),"unlink");c.addShortcut("alt+shift+m",c.getLang("image_desc"),"mceImage");c.addShortcut("alt+shift+g",c.getLang("fullscreen.desc"),"mceFullScreen");c.addShortcut("alt+shift+z",c.getLang("wp_adv_desc"),"WP_Adv");c.addShortcut("alt+shift+h",c.getLang("help_desc"),"WP_Help");c.addShortcut("alt+shift+t",c.getLang("wp_more_desc"),"WP_More");c.addShortcut("alt+shift+p",c.getLang("wp_page_desc"),"WP_Page");c.addShortcut("ctrl+s",c.getLang("save_desc"),function(){if("function"==typeof autosave){autosave()}});if(tinymce.isWebKit){c.addShortcut("alt+shift+b",c.getLang("bold_desc"),"Bold");c.addShortcut("alt+shift+i",c.getLang("italic_desc"),"Italic")}c.onInit.add(function(i){tinymce.dom.Event.add(i.getWin(),"scroll",function(j){i.plugins.wordpress._hideButtons()});tinymce.dom.Event.add(i.getBody(),"dragstart",function(j){i.plugins.wordpress._hideButtons()})});c.onBeforeExecCommand.add(function(i,k,j,l){i.plugins.wordpress._hideButtons()});c.onSaveContent.add(function(i,j){i.plugins.wordpress._hideButtons()});c.onMouseDown.add(function(i,j){if(j.target.nodeName!="IMG"){i.plugins.wordpress._hideButtons()}})},getInfo:function(){return{longname:"WordPress Plugin",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"3.0"}},_setEmbed:function(b){return b.replace(/\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g,function(d,c){return'<img width="300" height="200" src="'+tinymce.baseURL+'/plugins/wordpress/img/trans.gif" class="wp-oembed mceItemNoResize" alt="'+c+'" title="'+c+'" />'})},_getEmbed:function(b){return b.replace(/<img[^>]+>/g,function(c){if(c.indexOf('class="wp-oembed')!=-1){var d=c.match(/alt="([^\"]+)"/);if(d[1]){c="[embed]"+d[1]+"[/embed]"}}return c})},_showButtons:function(f,d){var g=tinyMCE.activeEditor,i,h,b,j=tinymce.DOM,e,c;b=g.dom.getViewPort(g.getWin());i=j.getPos(g.getContentAreaContainer());h=g.dom.getPos(f);e=Math.max(h.x-b.x,0)+i.x;c=Math.max(h.y-b.y,0)+i.y;j.setStyles(d,{top:c+5+"px",left:e+5+"px",display:"block"});if(this.mceTout){clearTimeout(this.mceTout)}this.mceTout=setTimeout(function(){g.plugins.wordpress._hideButtons()},5000)},_hideButtons:function(){if(!this.mceTout){return}if(document.getElementById("wp_editbtns")){tinymce.DOM.hide("wp_editbtns")}if(document.getElementById("wp_gallerybtns")){tinymce.DOM.hide("wp_gallerybtns")}clearTimeout(this.mceTout);this.mceTout=0},do_align:function(j,d){var h,f,g,b,i,e=tinyMCE.activeEditor;if(/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(j.className)){return}h=e.dom.getParent(j,"p");f=e.dom.getParent(j,"dl");g=e.dom.getParent(j,"div");if(f&&g){b=e.dom.hasClass(f,d)?"alignnone":d;f.className=f.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(f,b);i=(b=="aligncenter")?e.dom.addClass(g,"mceIEcenter"):e.dom.removeClass(g,"mceIEcenter")}else{if(h){b=e.dom.hasClass(j,d)?"alignnone":d;j.className=j.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(j,b);if(b=="aligncenter"){e.dom.setStyle(h,"textAlign","center")}else{if(h.style&&h.style.textAlign=="center"){e.dom.setStyle(h,"textAlign","")}}}}e.execCommand("mceRepaint")},_resizeIframe:function(c,e,b){var d=c.getContentAreaContainer().firstChild;a.setStyle(d,"height",d.clientHeight+b);c.theme.deltaHeight+=b},_handleMoreBreak:function(c,d){var e,b;e='<img src="'+d+'/img/trans.gif" alt="$1" class="mceWPmore mceItemNoResize" title="'+c.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+c.getLang("wordpress.wp_page_alt")+'" />';c.onInit.add(function(){c.dom.loadCSS(d+"/css/content.css")});c.onPostRender.add(function(){if(c.theme.onResolveName){c.theme.onResolveName.add(function(f,g){if(g.node.nodeName=="IMG"){if(c.dom.hasClass(g.node,"mceWPmore")){g.name="wpmore"}if(c.dom.hasClass(g.node,"mceWPnextpage")){g.name="wppage"}}})}});c.onBeforeSetContent.add(function(f,g){g.content=g.content.replace(/<!--more(.*?)-->/g,e);g.content=g.content.replace(/<!--nextpage-->/g,b)});c.onPostProcess.add(function(f,g){if(g.get){g.content=g.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mceWPmore')!==-1){var h,j=(h=i.match(/alt="(.*?)"/))?h[1]:"";i="<!--more"+j+"-->"}if(i.indexOf('class="mceWPnextpage')!==-1){i="<!--nextpage-->"}return i})}});c.onNodeChange.add(function(g,f,h){f.setActive("wp_page",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPnextpage"));f.setActive("wp_more",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPmore"))})}});tinymce.PluginManager.add("wordpress",tinymce.plugins.WordPress)})();
// plugins/wpeditimage
-(function(){tinymce.create("tinymce.plugins.wpEditImage",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_EditImage",function(){var h=a.selection.getNode(),f=tinymce.DOM.getViewPort(),g=f.h,d=(720<f.w)?720:f.w,e=a.dom.getAttrib(h,"class");if(e.indexOf("mceItem")!=-1||e.indexOf("wpGallery")!=-1||h.nodeName!="IMG"){return}tb_show("",b+"/editimage.html?ver=321&TB_iframe=true");tinymce.DOM.setStyles("TB_window",{width:(d-50)+"px",height:(g-45)+"px","margin-left":"-"+parseInt(((d-50)/2),10)+"px"});if(!tinymce.isIE6){tinymce.DOM.setStyles("TB_window",{top:"20px",marginTop:"0"})}tinymce.DOM.setStyles("TB_iframeContent",{width:(d-50)+"px",height:(g-75)+"px"});tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")});a.onInit.add(function(d){tinymce.dom.Event.add(d.getWin(),"scroll",function(f){d.plugins.wpeditimage.hideButtons()})});a.onBeforeExecCommand.add(function(d,f,e,g){d.plugins.wpeditimage.hideButtons()});a.onSaveContent.add(function(d,e){d.plugins.wpeditimage.hideButtons()});a.onMouseUp.add(function(d,g){var h,f;if(tinymce.isOpera){if(g.target.nodeName=="IMG"){d.plugins.wpeditimage.showButtons(g.target)}}else{if(!tinymce.isWebKit){h=d.selection.getNode();if(h.nodeName=="IMG"&&(f=d.dom.getParent(h,"DL"))){window.setTimeout(function(){var e=tinyMCE.activeEditor,j=e.selection.getNode(),i=e.dom.getParent(j,"DL");if(j.width!=(parseInt(e.dom.getStyle(i,"width"))-10)){e.dom.setStyle(i,"width",parseInt(j.width)+10);e.execCommand("mceRepaint")}},100)}}}});a.onMouseDown.add(function(d,f){if(tinymce.isOpera||f.target.nodeName!="IMG"){c.hideButtons();return}d.plugins.wpeditimage.showButtons(f.target)});a.onKeyPress.add(function(d,i){var f,h,g;if(i.keyCode==13&&(f=d.dom.getParent(d.selection.getNode(),"DL"))){g=d.dom.create("p",{}," ");if((h=f.parentNode)&&h.nodeName=="DIV"){d.dom.insertAfter(g,h)}else{d.dom.insertAfter(g,f)}tinymce.dom.Event.cancel(i);d.selection.select(g);return false}});a.onBeforeSetContent.add(function(d,e){e.content=c._do_shcode(e.content)});a.onPostProcess.add(function(d,e){if(e.get){e.content=c._get_shcode(e.content)}})},_do_shcode:function(a){return a.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g,function(g,d,k){var j,f,e,h,i;d=d.replace(/\\'|\\'|\\'/g,"'").replace(/\\"|\\"/g,""");k=k.replace(/\\'|\\'/g,"'").replace(/\\"/g,""");j=d.match(/id=['"]([^'"]+)/i);f=d.match(/align=['"]([^'"]+)/i);e=d.match(/width=['"]([0-9]+)/);h=d.match(/caption=['"]([^'"]+)/i);j=(j&&j[1])?j[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";h=(h&&h[1])?h[1]:"";if(!e||!h){return k}i=(f=="aligncenter")?"mceTemp mceIEcenter":"mceTemp";return'<div class="'+i+'"><dl id="'+j+'" class="wp-caption '+f+'" style="width: '+(10+parseInt(e))+'px"><dt class="wp-caption-dt">'+k+'</dt><dd class="wp-caption-dd">'+h+"</dd></dl></div>"})},_get_shcode:function(a){return a.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi,function(g,d,j,h){var i,f,e;i=d.match(/id=['"]([^'"]+)/i);f=d.match(/class=['"]([^'"]+)/i);e=j.match(/width=['"]([0-9]+)/);i=(i&&i[1])?i[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";if(!e||!h){return j}f=f.match(/align[^ '"]+/)||"alignnone";h=h.replace(/<\S[^<>]*>/gi,"").replace(/'/g,"'").replace(/"/g,""");return'[caption id="'+i+'" align="'+f+'" width="'+e+'" caption="'+h+'"]'+j+"[/caption]"})},showButtons:function(d){var j=this,e=tinyMCE.activeEditor,g,f,a,i=tinymce.DOM,c,b,h=e.dom.getAttrib(d,"class");if(h.indexOf("mceItem")!=-1||h.indexOf("wpGallery")!=-1){return}a=e.dom.getViewPort(e.getWin());g=i.getPos(e.getContentAreaContainer());f=e.dom.getPos(d);c=Math.max(f.x-a.x,0)+g.x;b=Math.max(f.y-a.y,0)+g.y;i.setStyles("wp_editbtns",{top:b+5+"px",left:c+5+"px",display:"block"});j.btnsTout=window.setTimeout(function(){e.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 d=this,b=tinyMCE.activeEditor,e=tinymce.DOM,a,c,f;e.remove("wp_editbtns");a=e.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"});c=e.add("wp_editbtns","img",{src:d.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:b.getLang("wpeditimage.edit_img")});c.onmousedown=function(h){var g=tinyMCE.activeEditor;g.windowManager.bookmark=g.selection.getBookmark("simple");g.execCommand("WP_EditImage");this.parentNode.style.display="none"};f=e.add("wp_editbtns","img",{src:d.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:b.getLang("wpeditimage.del_img")});f.onmousedown=function(j){var g=tinyMCE.activeEditor,h=g.selection.getNode(),i;if(h.nodeName=="IMG"&&g.dom.getAttrib(h,"class").indexOf("mceItem")==-1){if((i=g.dom.getParent(h,"div"))&&g.dom.hasClass(i,"mceTemp")){g.dom.remove(i)}else{if((i=g.dom.getParent(h,"A"))&&i.childNodes.length==1){g.dom.remove(i)}else{g.dom.remove(h)}}this.parentNode.style.display="none";g.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)})();
+(function(){tinymce.create("tinymce.plugins.wpEditImage",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_EditImage",function(){var h=a.selection.getNode(),f=tinymce.DOM.getViewPort(),g=f.h,d=(720<f.w)?720:f.w,e=a.dom.getAttrib(h,"class");if(e.indexOf("mceItem")!=-1||e.indexOf("wpGallery")!=-1||h.nodeName!="IMG"){return}tb_show("",b+"/editimage.html?ver=321&TB_iframe=true");tinymce.DOM.setStyles("TB_window",{width:(d-50)+"px",height:(g-45)+"px","margin-left":"-"+parseInt(((d-50)/2),10)+"px"});if(!tinymce.isIE6){tinymce.DOM.setStyles("TB_window",{top:"20px",marginTop:"0"})}tinymce.DOM.setStyles("TB_iframeContent",{width:(d-50)+"px",height:(g-75)+"px"});tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")});a.onInit.add(function(d){tinymce.dom.Event.add(d.getBody(),"dragstart",function(f){if(!tinymce.isGecko&&f.target.nodeName=="IMG"&&d.dom.getParent(f.target,"dl.wp-caption")){return tinymce.dom.Event.cancel(f)}})});a.onMouseUp.add(function(d,f){if(tinymce.isWebKit||tinymce.isOpera){return}if(d.dom.getParent(f.target,"div.mceTemp")||d.dom.is(f.target,"div.mceTemp")){window.setTimeout(function(){var e=tinyMCE.activeEditor,h=e.selection.getNode(),g=e.dom.getParent(h,"dl.wp-caption");if(g&&h.width!=(parseInt(e.dom.getStyle(g,"width"),10)-10)){e.dom.setStyle(g,"width",parseInt(h.width,10)+10);e.execCommand("mceRepaint")}},100)}});a.onMouseDown.add(function(d,g){var f;if(g.target.nodeName=="IMG"&&d.dom.getAttrib(g.target,"class").indexOf("mceItem")==-1){d.plugins.wordpress._showButtons(g.target,"wp_editbtns");if(tinymce.isGecko&&(f=d.dom.getParent(g.target,"dl.wp-caption"))&&d.dom.hasClass(f.parentNode,"mceTemp")){d.selection.select(f.parentNode)}}});a.onKeyPress.add(function(d,i){var f,h,g;if(i.keyCode==13&&(f=d.dom.getParent(d.selection.getNode(),"DL"))&&d.dom.hasClass(f,"wp-caption")){g=d.dom.create("p",{}," ");if((h=f.parentNode)&&h.nodeName=="DIV"){d.dom.insertAfter(g,h)}else{d.dom.insertAfter(g,f)}if(g.firstChild){d.selection.select(g.firstChild)}else{d.selection.select(g)}tinymce.dom.Event.cancel(i);return false}});a.onBeforeSetContent.add(function(d,e){e.content=c._do_shcode(e.content)});a.onPostProcess.add(function(d,e){if(e.get){e.content=c._get_shcode(e.content)}})},_do_shcode:function(a){return a.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g,function(g,d,k){var j,f,e,h,i;d=d.replace(/\\'|\\'|\\'/g,"'").replace(/\\"|\\"/g,""");k=k.replace(/\\'|\\'/g,"'").replace(/\\"/g,""");j=d.match(/id=['"]([^'"]+)/i);f=d.match(/align=['"]([^'"]+)/i);e=d.match(/width=['"]([0-9]+)/);h=d.match(/caption=['"]([^'"]+)/i);j=(j&&j[1])?j[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";h=(h&&h[1])?h[1]:"";if(!e||!h){return k}i=(f=="aligncenter")?"mceTemp mceIEcenter":"mceTemp";return'<div class="'+i+'" draggable><dl id="'+j+'" class="wp-caption '+f+'" style="width: '+(10+parseInt(e))+'px"><dt class="wp-caption-dt">'+k+'</dt><dd class="wp-caption-dd">'+h+"</dd></dl></div>"})},_get_shcode:function(a){return a.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi,function(g,d,j,h){var i,f,e;i=d.match(/id=['"]([^'"]+)/i);f=d.match(/class=['"]([^'"]+)/i);e=j.match(/width=['"]([0-9]+)/);i=(i&&i[1])?i[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";if(!e||!h){return j}f=f.match(/align[^ '"]+/)||"alignnone";h=h.replace(/<\S[^<>]*>/gi,"").replace(/'/g,"'").replace(/"/g,""");return'[caption id="'+i+'" align="'+f+'" width="'+e+'" caption="'+h+'"]'+j+"[/caption]"})},_createButtons:function(){var b=this,a=tinyMCE.activeEditor,d=tinymce.DOM,e,c;d.remove("wp_editbtns");d.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"});e=d.add("wp_editbtns","img",{src:b.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.edit_img")});tinymce.dom.Event.add(e,"mousedown",function(g){var f=tinyMCE.activeEditor;f.windowManager.bookmark=f.selection.getBookmark("simple");f.execCommand("WP_EditImage")});c=d.add("wp_editbtns","img",{src:b.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.del_img")});tinymce.dom.Event.add(c,"mousedown",function(i){var f=tinyMCE.activeEditor,g=f.selection.getNode(),h;if(g.nodeName=="IMG"&&f.dom.getAttrib(g,"class").indexOf("mceItem")==-1){if((h=f.dom.getParent(g,"div"))&&f.dom.hasClass(h,"mceTemp")){f.dom.remove(h)}else{if((h=f.dom.getParent(g,"A"))&&h.childNodes.length==1){f.dom.remove(h)}else{f.dom.remove(g)}}f.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)})();
// plugins/wpgallery
-(function(){tinymce.create("tinymce.plugins.wpGallery",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_Gallery",function(){var e=a.selection.getNode(),d;if(e.nodeName!="IMG"){return}if(a.dom.getAttrib(e,"class").indexOf("wpGallery")==-1){return}d=tinymce.DOM.get("post_ID").value;tb_show("",tinymce.documentBaseURL+"/media-upload.php?post_id="+d+"&tab=gallery&TB_iframe=true");tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")});a.onInit.add(function(d){tinymce.dom.Event.add(d.getWin(),"scroll",function(f){d.plugins.wpgallery.hideButtons()})});a.onBeforeExecCommand.add(function(d,f,e,g){d.plugins.wpgallery.hideButtons()});a.onSaveContent.add(function(d,e){d.plugins.wpgallery.hideButtons()});a.onMouseUp.add(function(d,f){if(tinymce.isOpera){if(f.target.nodeName=="IMG"){d.plugins.wpgallery.showButtons(f.target)}}});a.onMouseDown.add(function(d,f){if(tinymce.isOpera||f.target.nodeName!="IMG"){c.hideButtons();return}d.plugins.wpgallery.showButtons(f.target)});a.onBeforeSetContent.add(function(d,e){e.content=c._do_gallery(e.content)});a.onPostProcess.add(function(d,e){if(e.get){e.content=c._get_gallery(e.content)}})},_do_gallery:function(a){return a.replace(/\[gallery([^\]]*)\]/g,function(d,c){return'<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="wpGallery mceItem" title="gallery'+tinymce.DOM.encode(c)+'" />'})},_get_gallery:function(b){function a(c,d){d=new RegExp(d+'="([^"]+)"',"g").exec(c);return d?tinymce.DOM.decode(d[1]):""}return b.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g,function(e,d){var c=a(d,"class");if(c.indexOf("wpGallery")!=-1){return"<p>["+tinymce.trim(a(d,"title"))+"]</p>"}return e})},showButtons:function(d){var i=this,e=tinyMCE.activeEditor,g,f,a,h=tinymce.DOM,c,b;if(e.dom.getAttrib(d,"class").indexOf("wpGallery")==-1){return}a=e.dom.getViewPort(e.getWin());g=h.getPos(e.getContentAreaContainer());f=e.dom.getPos(d);c=Math.max(f.x-a.x,0)+g.x;b=Math.max(f.y-a.y,0)+g.y;h.setStyles("wp_gallerybtns",{top:b+5+"px",left:c+5+"px",display:"block"});i.btnsTout=window.setTimeout(function(){e.plugins.wpgallery.hideButtons()},5000)},hideButtons:function(){if(tinymce.DOM.isHidden("wp_gallerybtns")){return}tinymce.DOM.hide("wp_gallerybtns");window.clearTimeout(this.btnsTout)},_createButtons:function(){var d=this,b=tinyMCE.activeEditor,e=tinymce.DOM,c,f,a;e.remove("wp_gallerybtns");c=e.add(document.body,"div",{id:"wp_gallerybtns",style:"display:none;"});f=e.add("wp_gallerybtns","img",{src:d.url+"/img/edit.png",id:"wp_editgallery",width:"24",height:"24",title:b.getLang("wordpress.editgallery")});f.onmousedown=function(h){var g=tinyMCE.activeEditor;g.windowManager.bookmark=g.selection.getBookmark("simple");g.execCommand("WP_Gallery");this.parentNode.style.display="none"};a=e.add("wp_gallerybtns","img",{src:d.url+"/img/delete.png",id:"wp_delgallery",width:"24",height:"24",title:b.getLang("wordpress.delgallery")});a.onmousedown=function(i){var g=tinyMCE.activeEditor,h=g.selection.getNode();if(h.nodeName=="IMG"&&g.dom.getAttrib(h,"class").indexOf("wpGallery")!=-1){g.dom.remove(h);this.parentNode.style.display="none";g.execCommand("mceRepaint");return false}}},getInfo:function(){return{longname:"Gallery Settings",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpgallery",tinymce.plugins.wpGallery)})();
+(function(){tinymce.create("tinymce.plugins.wpGallery",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_Gallery",function(){var h=a.selection.getNode(),f,e=tinymce.DOM.getViewPort(),g=e.h-80,d=(640<e.w)?640:e.w;if(h.nodeName!="IMG"){return}if(a.dom.getAttrib(h,"class").indexOf("wpGallery")==-1){return}f=tinymce.DOM.get("post_ID").value;tb_show("",tinymce.documentBaseURL+"/media-upload.php?post_id="+f+"&tab=gallery&TB_iframe=true&width="+d+"&height="+g);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")});a.onMouseDown.add(function(d,f){if(f.target.nodeName=="IMG"&&d.dom.hasClass(f.target,"wpGallery")){d.plugins.wordpress._showButtons(f.target,"wp_gallerybtns")}});a.onBeforeSetContent.add(function(d,e){e.content=c._do_gallery(e.content)});a.onPostProcess.add(function(d,e){if(e.get){e.content=c._get_gallery(e.content)}})},_do_gallery:function(a){return a.replace(/\[gallery([^\]]*)\]/g,function(d,c){return'<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="wpGallery mceItem" title="gallery'+tinymce.DOM.encode(c)+'" />'})},_get_gallery:function(b){function a(c,d){d=new RegExp(d+'="([^"]+)"',"g").exec(c);return d?tinymce.DOM.decode(d[1]):""}return b.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g,function(e,d){var c=a(d,"class");if(c.indexOf("wpGallery")!=-1){return"<p>["+tinymce.trim(a(d,"title"))+"]</p>"}return e})},_createButtons:function(){var b=this,a=tinyMCE.activeEditor,d=tinymce.DOM,e,c;d.remove("wp_gallerybtns");d.add(document.body,"div",{id:"wp_gallerybtns",style:"display:none;"});e=d.add("wp_gallerybtns","img",{src:b.url+"/img/edit.png",id:"wp_editgallery",width:"24",height:"24",title:a.getLang("wordpress.editgallery")});tinymce.dom.Event.add(e,"mousedown",function(g){var f=tinyMCE.activeEditor;f.windowManager.bookmark=f.selection.getBookmark("simple");f.execCommand("WP_Gallery")});c=d.add("wp_gallerybtns","img",{src:b.url+"/img/delete.png",id:"wp_delgallery",width:"24",height:"24",title:a.getLang("wordpress.delgallery")});tinymce.dom.Event.add(c,"mousedown",function(h){var f=tinyMCE.activeEditor,g=f.selection.getNode();if(g.nodeName=="IMG"&&f.dom.hasClass(g,"wpGallery")){f.dom.remove(g);f.execCommand("mceRepaint");return false}})},getInfo:function(){return{longname:"Gallery Settings",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpgallery",tinymce.plugins.wpGallery)})();
// mark as loaded
tinyMCEPreInit.go=function(){var b=this,a=tinymce.ScriptLoader,f=b.mceInit.language,e=b.mceInit.theme,c=b.mceInit.plugins,d=b.suffix;a.markDone(b.base+"/langs/"+f+".js");a.markDone(b.base+"/themes/"+e+"/editor_template"+d+".js");a.markDone(b.base+"/themes/"+e+"/langs/"+f+".js");a.markDone(b.base+"/themes/"+e+"/langs/"+f+"_dlg.js");tinymce.each(c.split(","),function(g){if(g&&g.charAt(0)!="-"){a.markDone(b.base+"/plugins/"+g+"/editor_plugin"+d+".js");a.markDone(b.base+"/plugins/"+g+"/langs/"+f+".js");a.markDone(b.base+"/plugins/"+g+"/langs/"+f+"_dlg.js")}})};
<?php
+/**
+ * Disable error reporting
+ *
+ * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging
+ */
+error_reporting(0);
$basepath = dirname(__FILE__);
header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
header("Cache-Control: public, max-age=$expires_offset");
-if ( isset($_GET['c']) && 1 == $_GET['c'] && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) {
+if ( isset($_GET['c']) && 1 == $_GET['c'] && isset($_SERVER['HTTP_ACCEPT_ENCODING'])
+ && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) {
+
header('Content-Encoding: gzip');
echo $file;
} else {
return true;
},
invalidateForm: function ( selector ) {
- return jQuery( selector ).addClass( 'form-invalid' ).change( function() { jQuery(this).removeClass( 'form-invalid' ); } );
+ return jQuery( selector ).addClass( 'form-invalid' ).find('input:visible').change( function() { jQuery(this).closest('.form-invalid').removeClass( 'form-invalid' ); } );
},
validateForm: function( selector ) {
selector = jQuery( selector );
-var wpAjax=jQuery.extend({unserialize:function(c){var d={},e,a,b,f;if(!c){return d}e=c.split("?");if(e[1]){c=e[1]}a=c.split("&");for(b in a){if(jQuery.isFunction(a.hasOwnProperty)&&!a.hasOwnProperty(b)){continue}f=a[b].split("=");d[f[0]]=f[1]}return d},parseAjaxResponse:function(a,f,g){var b={},c=jQuery("#"+f).html(""),d="";if(a&&typeof a=="object"&&a.getElementsByTagName("wp_ajax")){b.responses=[];b.errors=false;jQuery("response",a).each(function(){var h=jQuery(this),i=jQuery(this.firstChild),e;e={action:h.attr("action"),what:i.get(0).nodeName,id:i.attr("id"),oldId:i.attr("old_id"),position:i.attr("position")};e.data=jQuery("response_data",i).text();e.supplemental={};if(!jQuery("supplemental",i).children().each(function(){e.supplemental[this.nodeName]=jQuery(this).text()}).size()){e.supplemental=false}e.errors=[];if(!jQuery("wp_error",i).each(function(){var j=jQuery(this).attr("code"),m,l,k;m={code:j,message:this.firstChild.nodeValue,data:false};l=jQuery('wp_error_data[code="'+j+'"]',a);if(l){m.data=l.get()}k=jQuery("form-field",l).text();if(k){j=k}if(g){wpAjax.invalidateForm(jQuery("#"+g+' :input[name="'+j+'"]').parents(".form-field:first"))}d+="<p>"+m.message+"</p>";e.errors.push(m);b.errors=true}).size()){e.errors=false}b.responses.push(e)});if(d.length){c.html('<div class="error">'+d+"</div>")}return b}if(isNaN(a)){return !c.html('<div class="error"><p>'+a+"</p></div>")}a=parseInt(a,10);if(-1==a){return !c.html('<div class="error"><p>'+wpAjax.noPerm+"</p></div>")}else{if(0===a){return !c.html('<div class="error"><p>'+wpAjax.broken+"</p></div>")}}return true},invalidateForm:function(a){return jQuery(a).addClass("form-invalid").change(function(){jQuery(this).removeClass("form-invalid")})},validateForm:function(a){a=jQuery(a);return !wpAjax.invalidateForm(a.find(".form-required").filter(function(){return jQuery("input:visible",this).val()==""})).size()}},wpAjax||{noPerm:"You do not have permission to do that.",broken:"An unidentified error has occurred."});jQuery(document).ready(function(a){a("form.validate").submit(function(){return wpAjax.validateForm(a(this))})});
\ No newline at end of file
+var wpAjax=jQuery.extend({unserialize:function(c){var d={},e,a,b,f;if(!c){return d}e=c.split("?");if(e[1]){c=e[1]}a=c.split("&");for(b in a){if(jQuery.isFunction(a.hasOwnProperty)&&!a.hasOwnProperty(b)){continue}f=a[b].split("=");d[f[0]]=f[1]}return d},parseAjaxResponse:function(a,f,g){var b={},c=jQuery("#"+f).html(""),d="";if(a&&typeof a=="object"&&a.getElementsByTagName("wp_ajax")){b.responses=[];b.errors=false;jQuery("response",a).each(function(){var h=jQuery(this),i=jQuery(this.firstChild),e;e={action:h.attr("action"),what:i.get(0).nodeName,id:i.attr("id"),oldId:i.attr("old_id"),position:i.attr("position")};e.data=jQuery("response_data",i).text();e.supplemental={};if(!jQuery("supplemental",i).children().each(function(){e.supplemental[this.nodeName]=jQuery(this).text()}).size()){e.supplemental=false}e.errors=[];if(!jQuery("wp_error",i).each(function(){var j=jQuery(this).attr("code"),m,l,k;m={code:j,message:this.firstChild.nodeValue,data:false};l=jQuery('wp_error_data[code="'+j+'"]',a);if(l){m.data=l.get()}k=jQuery("form-field",l).text();if(k){j=k}if(g){wpAjax.invalidateForm(jQuery("#"+g+' :input[name="'+j+'"]').parents(".form-field:first"))}d+="<p>"+m.message+"</p>";e.errors.push(m);b.errors=true}).size()){e.errors=false}b.responses.push(e)});if(d.length){c.html('<div class="error">'+d+"</div>")}return b}if(isNaN(a)){return !c.html('<div class="error"><p>'+a+"</p></div>")}a=parseInt(a,10);if(-1==a){return !c.html('<div class="error"><p>'+wpAjax.noPerm+"</p></div>")}else{if(0===a){return !c.html('<div class="error"><p>'+wpAjax.broken+"</p></div>")}}return true},invalidateForm:function(a){return jQuery(a).addClass("form-invalid").find("input:visible").change(function(){jQuery(this).closest(".form-invalid").removeClass("form-invalid")})},validateForm:function(a){a=jQuery(a);return !wpAjax.invalidateForm(a.find(".form-required").filter(function(){return jQuery("input:visible",this).val()==""})).size()}},wpAjax||{noPerm:"You do not have permission to do that.",broken:"An unidentified error has occurred."});jQuery(document).ready(function(a){a("form.validate").submit(function(){return wpAjax.validateForm(a(this))})});
\ No newline at end of file
wpList = {
settings: {
- url: wpListL10n.url, type: 'POST',
+ url: ajaxurl, type: 'POST',
response: 'ajax-response',
what: '',
};
}
list.wpList.recolor();
+ $(list).trigger( 'wpListAddEnd', [ s, list.wpList ] );
wpList.clear.call(list,'#' + s.element);
};
ajaxDel: function( e, s ) {
e = $(e); s = s || {};
- var list = this, cls = wpList.parseClass(e,'delete'), element, anim;
+ var list = this, cls = wpList.parseClass(e,'delete'), element;
s = wpList.pre.call( list, e, s, 'delete' );
s.element = cls[2] || s.element || null;
if ( cls[3] ) { s.delColor = '#' + cls[3]; }
- else { s.delColor = s.delColor || '#FF3333'; }
+ else { s.delColor = s.delColor || '#faa'; }
if ( !s || !s.element ) { return false; }
);
if ( $.isFunction(s.delBefore) ) {
- s = s.delBefore( s );
+ s = s.delBefore( s, list );
if ( !s ) { return true; }
}
if ( !s.data._ajax_nonce ) { return true; }
element = $('#' + s.element);
if ( 'none' != s.delColor ) {
- anim = 'slideUp';
- if ( element.css( 'display' ).match(/table/) )
- anim = 'fadeOut'; // Can't slideup table rows and other table elements. Known jQuery bug
- element
- .animate( { backgroundColor: s.delColor }, 'fast' )[anim]( 'fast' )
- .queue( function() { list.wpList.recolor(); $(this).dequeue(); } );
+ element.css( 'backgroundColor', s.delColor ).fadeOut( 350, function(){
+ list.wpList.recolor();
+ $(list).trigger( 'wpListDelEnd', [ s, list.wpList ] );
+ });
} else {
list.wpList.recolor();
+ $(list).trigger( 'wpListDelEnd', [ s, list.wpList ] );
}
s.success = function(r) {
var res = wpAjax.parseAjaxResponse(r, s.response, s.element), o;
if ( !res || res.errors ) {
- element.stop().stop().css( 'backgroundColor', '#FF3333' ).show().queue( function() { list.wpList.recolor(); $(this).dequeue(); } );
+ element.stop().stop().css( 'backgroundColor', '#faa' ).show().queue( function() { list.wpList.recolor(); $(this).dequeue(); } );
return false;
}
if ( $.isFunction(s.delAfter) ) {
element
.animate( { backgroundColor: dimColor }, 'fast' )
.queue( function() { element.toggleClass(s.dimClass); $(this).dequeue(); } )
- .animate( { backgroundColor: color }, { complete: function() { $(this).css( 'backgroundColor', '' ); } } );
+ .animate( { backgroundColor: color }, { complete: function() { $(this).css( 'backgroundColor', '' ); $(list).trigger( 'wpListDimEnd', [ s, list.wpList ] ); } } );
+ } else {
+ $(list).trigger( 'wpListDimEnd', [ s, list.wpList ] );
}
if ( !s.data._ajax_nonce ) { return true; }
-(function(b){var a={add:"ajaxAdd",del:"ajaxDel",dim:"ajaxDim",process:"process",recolor:"recolor"},c;c={settings:{url:wpListL10n.url,type:"POST",response:"ajax-response",what:"",alt:"alternate",altOffset:0,addColor:null,delColor:null,dimAddColor:null,dimDelColor:null,confirm:null,addBefore:null,addAfter:null,delBefore:null,delAfter:null,dimBefore:null,dimAfter:null},nonce:function(g,f){var d=wpAjax.unserialize(g.attr("href"));return f.nonce||d._ajax_nonce||b("#"+f.element+" input[name=_ajax_nonce]").val()||d._wpnonce||b("#"+f.element+" input[name=_wpnonce]").val()||0},parseClass:function(h,f){var i=[],d;try{d=b(h).attr("class")||"";d=d.match(new RegExp(f+":[\\S]+"));if(d){i=d[0].split(":")}}catch(g){}return i},pre:function(i,g,d){var f,h;g=b.extend({},this.wpList.settings,{element:null,nonce:0,target:i.get(0)},g||{});if(b.isFunction(g.confirm)){if("add"!=d){f=b("#"+g.element).css("backgroundColor");b("#"+g.element).css("backgroundColor","#FF9966")}h=g.confirm.call(this,i,g,d,f);if("add"!=d){b("#"+g.element).css("backgroundColor",f)}if(!h){return false}}return g},ajaxAdd:function(j,f){j=b(j);f=f||{};var h=this,d=c.parseClass(j,"add"),k,g,i;f=c.pre.call(h,j,f,"add");f.element=d[2]||j.attr("id")||f.element||null;if(d[3]){f.addColor="#"+d[3]}else{f.addColor=f.addColor||"#FFFF33"}if(!f){return false}if(!j.is("[class^=add:"+h.id+":]")){return !c.add.call(h,j,f)}if(!f.element){return true}f.action="add-"+f.what;f.nonce=c.nonce(j,f);k=b("#"+f.element+" :input").not("[name=_ajax_nonce], [name=_wpnonce], [name=action]");g=wpAjax.validateForm("#"+f.element);if(!g){return false}f.data=b.param(b.extend({_ajax_nonce:f.nonce,action:f.action},wpAjax.unserialize(d[4]||"")));i=b.isFunction(k.fieldSerialize)?k.fieldSerialize():k.serialize();if(i){f.data+="&"+i}if(b.isFunction(f.addBefore)){f=f.addBefore(f);if(!f){return true}}if(!f.data.match(/_ajax_nonce=[a-f0-9]+/)){return true}f.success=function(l){var e=wpAjax.parseAjaxResponse(l,f.response,f.element),m;if(!e||e.errors){return false}if(true===e){return true}jQuery.each(e.responses,function(){c.add.call(h,this.data,b.extend({},f,{pos:this.position||0,id:this.id||0,oldId:this.oldId||null}))});if(b.isFunction(f.addAfter)){m=this.complete;this.complete=function(n,o){var p=b.extend({xml:n,status:o,parsed:e},f);f.addAfter(l,p);if(b.isFunction(m)){m(n,o)}}}h.wpList.recolor();c.clear.call(h,"#"+f.element)};b.ajax(f);return false},ajaxDel:function(j,g){j=b(j);g=g||{};var i=this,d=c.parseClass(j,"delete"),f,h;g=c.pre.call(i,j,g,"delete");g.element=d[2]||g.element||null;if(d[3]){g.delColor="#"+d[3]}else{g.delColor=g.delColor||"#FF3333"}if(!g||!g.element){return false}g.action="delete-"+g.what;g.nonce=c.nonce(j,g);g.data=b.extend({action:g.action,id:g.element.split("-").pop(),_ajax_nonce:g.nonce},wpAjax.unserialize(d[4]||""));if(b.isFunction(g.delBefore)){g=g.delBefore(g);if(!g){return true}}if(!g.data._ajax_nonce){return true}f=b("#"+g.element);if("none"!=g.delColor){h="slideUp";if(f.css("display").match(/table/)){h="fadeOut"}f.animate({backgroundColor:g.delColor},"fast")[h]("fast").queue(function(){i.wpList.recolor();b(this).dequeue()})}else{i.wpList.recolor()}g.success=function(k){var e=wpAjax.parseAjaxResponse(k,g.response,g.element),l;if(!e||e.errors){f.stop().stop().css("backgroundColor","#FF3333").show().queue(function(){i.wpList.recolor();b(this).dequeue()});return false}if(b.isFunction(g.delAfter)){l=this.complete;this.complete=function(m,n){f.queue(function(){var o=b.extend({xml:m,status:n,parsed:e},g);g.delAfter(k,o);if(b.isFunction(l)){l(m,n)}}).dequeue()}}};b.ajax(g);return false},ajaxDim:function(k,h){if(b(k).parent().css("display")=="none"){return false}k=b(k);h=h||{};var j=this,d=c.parseClass(k,"dim"),g,l,f,i;h=c.pre.call(j,k,h,"dim");h.element=d[2]||h.element||null;h.dimClass=d[3]||h.dimClass||null;if(d[4]){h.dimAddColor="#"+d[4]}else{h.dimAddColor=h.dimAddColor||"#FFFF33"}if(d[5]){h.dimDelColor="#"+d[5]}else{h.dimDelColor=h.dimDelColor||"#FF3333"}if(!h||!h.element||!h.dimClass){return true}h.action="dim-"+h.what;h.nonce=c.nonce(k,h);h.data=b.extend({action:h.action,id:h.element.split("-").pop(),dimClass:h.dimClass,_ajax_nonce:h.nonce},wpAjax.unserialize(d[6]||""));if(b.isFunction(h.dimBefore)){h=h.dimBefore(h);if(!h){return true}}g=b("#"+h.element);l=g.toggleClass(h.dimClass).is("."+h.dimClass);f=c.getColor(g);g.toggleClass(h.dimClass);i=l?h.dimAddColor:h.dimDelColor;if("none"!=i){g.animate({backgroundColor:i},"fast").queue(function(){g.toggleClass(h.dimClass);b(this).dequeue()}).animate({backgroundColor:f},{complete:function(){b(this).css("backgroundColor","")}})}if(!h.data._ajax_nonce){return true}h.success=function(m){var e=wpAjax.parseAjaxResponse(m,h.response,h.element),n;if(!e||e.errors){g.stop().stop().css("backgroundColor","#FF3333")[l?"removeClass":"addClass"](h.dimClass).show().queue(function(){j.wpList.recolor();b(this).dequeue()});return false}if(b.isFunction(h.dimAfter)){n=this.complete;this.complete=function(o,p){g.queue(function(){var q=b.extend({xml:o,status:p,parsed:e},h);h.dimAfter(m,q);if(b.isFunction(n)){n(o,p)}}).dequeue()}}};b.ajax(h);return false},getColor:function(e){if(e.constructor==Object){e=e.get(0)}var f=e,d,g=new RegExp("rgba\\(\\s*0,\\s*0,\\s*0,\\s*0\\s*\\)","i");do{d=jQuery.curCSS(f,"backgroundColor");if(d!=""&&d!="transparent"&&!d.match(g)||jQuery.nodeName(f,"body")){break}}while(f=f.parentNode);return d||"#ffffff"},add:function(k,g){k=b(k);var i=b(this),d=false,j={pos:0,id:0,oldId:null},l,h,f;if("string"==typeof g){g={what:g}}g=b.extend(j,this.wpList.settings,g);if(!k.size()||!g.what){return false}if(g.oldId){d=b("#"+g.what+"-"+g.oldId)}if(g.id&&(g.id!=g.oldId||!d||!d.size())){b("#"+g.what+"-"+g.id).remove()}if(d&&d.size()){d.before(k);d.remove()}else{if(isNaN(g.pos)){l="after";if("-"==g.pos.substr(0,1)){g.pos=g.pos.substr(1);l="before"}h=i.find("#"+g.pos);if(1===h.size()){h[l](k)}else{i.append(k)}}else{if(g.pos<0){i.prepend(k)}else{i.append(k)}}}if(g.alt){if((i.children(":visible").index(k[0])+g.altOffset)%2){k.removeClass(g.alt)}else{k.addClass(g.alt)}}if("none"!=g.addColor){f=c.getColor(k);k.css("backgroundColor",g.addColor).animate({backgroundColor:f},{complete:function(){b(this).css("backgroundColor","")}})}i.each(function(){this.wpList.process(k)});return k},clear:function(h){var g=this,f,d;h=b(h);if(g.wpList&&h.parents("#"+g.id).size()){return}h.find(":input").each(function(){if(b(this).parents(".form-no-clear").size()){return}f=this.type.toLowerCase();d=this.tagName.toLowerCase();if("text"==f||"password"==f||"textarea"==d){this.value=""}else{if("checkbox"==f||"radio"==f){this.checked=false}else{if("select"==d){this.selectedIndex=null}}}})},process:function(d){var e=this;b("[class^=add:"+e.id+":]",d||null).filter("form").submit(function(){return e.wpList.add(this)}).end().not("form").click(function(){return e.wpList.add(this)});b("[class^=delete:"+e.id+":]",d||null).click(function(){return e.wpList.del(this)});b("[class^=dim:"+e.id+":]",d||null).click(function(){return e.wpList.dim(this)})},recolor:function(){var f=this,e,d;if(!f.wpList.settings.alt){return}e=b(".list-item:visible",f);if(!e.size()){e=b(f).children(":visible")}d=[":even",":odd"];if(f.wpList.settings.altOffset%2){d.reverse()}e.filter(d[0]).addClass(f.wpList.settings.alt).end().filter(d[1]).removeClass(f.wpList.settings.alt)},init:function(){var d=this;d.wpList.process=function(e){d.each(function(){this.wpList.process(e)})};d.wpList.recolor=function(){d.each(function(){this.wpList.recolor()})}}};b.fn.wpList=function(d){this.each(function(){var e=this;this.wpList={settings:b.extend({},c.settings,{what:c.parseClass(this,"list")[1]||""},d)};b.each(a,function(g,h){e.wpList[g]=function(i,f){return c[h].call(e,i,f)}})});c.init.call(this);this.wpList.process();return this}})(jQuery);
\ No newline at end of file
+(function(b){var a={add:"ajaxAdd",del:"ajaxDel",dim:"ajaxDim",process:"process",recolor:"recolor"},c;c={settings:{url:ajaxurl,type:"POST",response:"ajax-response",what:"",alt:"alternate",altOffset:0,addColor:null,delColor:null,dimAddColor:null,dimDelColor:null,confirm:null,addBefore:null,addAfter:null,delBefore:null,delAfter:null,dimBefore:null,dimAfter:null},nonce:function(g,f){var d=wpAjax.unserialize(g.attr("href"));return f.nonce||d._ajax_nonce||b("#"+f.element+" input[name=_ajax_nonce]").val()||d._wpnonce||b("#"+f.element+" input[name=_wpnonce]").val()||0},parseClass:function(h,f){var i=[],d;try{d=b(h).attr("class")||"";d=d.match(new RegExp(f+":[\\S]+"));if(d){i=d[0].split(":")}}catch(g){}return i},pre:function(i,g,d){var f,h;g=b.extend({},this.wpList.settings,{element:null,nonce:0,target:i.get(0)},g||{});if(b.isFunction(g.confirm)){if("add"!=d){f=b("#"+g.element).css("backgroundColor");b("#"+g.element).css("backgroundColor","#FF9966")}h=g.confirm.call(this,i,g,d,f);if("add"!=d){b("#"+g.element).css("backgroundColor",f)}if(!h){return false}}return g},ajaxAdd:function(j,f){j=b(j);f=f||{};var h=this,d=c.parseClass(j,"add"),k,g,i;f=c.pre.call(h,j,f,"add");f.element=d[2]||j.attr("id")||f.element||null;if(d[3]){f.addColor="#"+d[3]}else{f.addColor=f.addColor||"#FFFF33"}if(!f){return false}if(!j.is("[class^=add:"+h.id+":]")){return !c.add.call(h,j,f)}if(!f.element){return true}f.action="add-"+f.what;f.nonce=c.nonce(j,f);k=b("#"+f.element+" :input").not("[name=_ajax_nonce], [name=_wpnonce], [name=action]");g=wpAjax.validateForm("#"+f.element);if(!g){return false}f.data=b.param(b.extend({_ajax_nonce:f.nonce,action:f.action},wpAjax.unserialize(d[4]||"")));i=b.isFunction(k.fieldSerialize)?k.fieldSerialize():k.serialize();if(i){f.data+="&"+i}if(b.isFunction(f.addBefore)){f=f.addBefore(f);if(!f){return true}}if(!f.data.match(/_ajax_nonce=[a-f0-9]+/)){return true}f.success=function(l){var e=wpAjax.parseAjaxResponse(l,f.response,f.element),m;if(!e||e.errors){return false}if(true===e){return true}jQuery.each(e.responses,function(){c.add.call(h,this.data,b.extend({},f,{pos:this.position||0,id:this.id||0,oldId:this.oldId||null}))});if(b.isFunction(f.addAfter)){m=this.complete;this.complete=function(n,o){var p=b.extend({xml:n,status:o,parsed:e},f);f.addAfter(l,p);if(b.isFunction(m)){m(n,o)}}}h.wpList.recolor();b(h).trigger("wpListAddEnd",[f,h.wpList]);c.clear.call(h,"#"+f.element)};b.ajax(f);return false},ajaxDel:function(i,g){i=b(i);g=g||{};var h=this,d=c.parseClass(i,"delete"),f;g=c.pre.call(h,i,g,"delete");g.element=d[2]||g.element||null;if(d[3]){g.delColor="#"+d[3]}else{g.delColor=g.delColor||"#faa"}if(!g||!g.element){return false}g.action="delete-"+g.what;g.nonce=c.nonce(i,g);g.data=b.extend({action:g.action,id:g.element.split("-").pop(),_ajax_nonce:g.nonce},wpAjax.unserialize(d[4]||""));if(b.isFunction(g.delBefore)){g=g.delBefore(g,h);if(!g){return true}}if(!g.data._ajax_nonce){return true}f=b("#"+g.element);if("none"!=g.delColor){f.css("backgroundColor",g.delColor).fadeOut(350,function(){h.wpList.recolor();b(h).trigger("wpListDelEnd",[g,h.wpList])})}else{h.wpList.recolor();b(h).trigger("wpListDelEnd",[g,h.wpList])}g.success=function(j){var e=wpAjax.parseAjaxResponse(j,g.response,g.element),k;if(!e||e.errors){f.stop().stop().css("backgroundColor","#faa").show().queue(function(){h.wpList.recolor();b(this).dequeue()});return false}if(b.isFunction(g.delAfter)){k=this.complete;this.complete=function(l,m){f.queue(function(){var n=b.extend({xml:l,status:m,parsed:e},g);g.delAfter(j,n);if(b.isFunction(k)){k(l,m)}}).dequeue()}}};b.ajax(g);return false},ajaxDim:function(k,h){if(b(k).parent().css("display")=="none"){return false}k=b(k);h=h||{};var j=this,d=c.parseClass(k,"dim"),g,l,f,i;h=c.pre.call(j,k,h,"dim");h.element=d[2]||h.element||null;h.dimClass=d[3]||h.dimClass||null;if(d[4]){h.dimAddColor="#"+d[4]}else{h.dimAddColor=h.dimAddColor||"#FFFF33"}if(d[5]){h.dimDelColor="#"+d[5]}else{h.dimDelColor=h.dimDelColor||"#FF3333"}if(!h||!h.element||!h.dimClass){return true}h.action="dim-"+h.what;h.nonce=c.nonce(k,h);h.data=b.extend({action:h.action,id:h.element.split("-").pop(),dimClass:h.dimClass,_ajax_nonce:h.nonce},wpAjax.unserialize(d[6]||""));if(b.isFunction(h.dimBefore)){h=h.dimBefore(h);if(!h){return true}}g=b("#"+h.element);l=g.toggleClass(h.dimClass).is("."+h.dimClass);f=c.getColor(g);g.toggleClass(h.dimClass);i=l?h.dimAddColor:h.dimDelColor;if("none"!=i){g.animate({backgroundColor:i},"fast").queue(function(){g.toggleClass(h.dimClass);b(this).dequeue()}).animate({backgroundColor:f},{complete:function(){b(this).css("backgroundColor","");b(j).trigger("wpListDimEnd",[h,j.wpList])}})}else{b(j).trigger("wpListDimEnd",[h,j.wpList])}if(!h.data._ajax_nonce){return true}h.success=function(m){var e=wpAjax.parseAjaxResponse(m,h.response,h.element),n;if(!e||e.errors){g.stop().stop().css("backgroundColor","#FF3333")[l?"removeClass":"addClass"](h.dimClass).show().queue(function(){j.wpList.recolor();b(this).dequeue()});return false}if(b.isFunction(h.dimAfter)){n=this.complete;this.complete=function(o,p){g.queue(function(){var q=b.extend({xml:o,status:p,parsed:e},h);h.dimAfter(m,q);if(b.isFunction(n)){n(o,p)}}).dequeue()}}};b.ajax(h);return false},getColor:function(e){if(e.constructor==Object){e=e.get(0)}var f=e,d,g=new RegExp("rgba\\(\\s*0,\\s*0,\\s*0,\\s*0\\s*\\)","i");do{d=jQuery.curCSS(f,"backgroundColor");if(d!=""&&d!="transparent"&&!d.match(g)||jQuery.nodeName(f,"body")){break}}while(f=f.parentNode);return d||"#ffffff"},add:function(k,g){k=b(k);var i=b(this),d=false,j={pos:0,id:0,oldId:null},l,h,f;if("string"==typeof g){g={what:g}}g=b.extend(j,this.wpList.settings,g);if(!k.size()||!g.what){return false}if(g.oldId){d=b("#"+g.what+"-"+g.oldId)}if(g.id&&(g.id!=g.oldId||!d||!d.size())){b("#"+g.what+"-"+g.id).remove()}if(d&&d.size()){d.before(k);d.remove()}else{if(isNaN(g.pos)){l="after";if("-"==g.pos.substr(0,1)){g.pos=g.pos.substr(1);l="before"}h=i.find("#"+g.pos);if(1===h.size()){h[l](k)}else{i.append(k)}}else{if(g.pos<0){i.prepend(k)}else{i.append(k)}}}if(g.alt){if((i.children(":visible").index(k[0])+g.altOffset)%2){k.removeClass(g.alt)}else{k.addClass(g.alt)}}if("none"!=g.addColor){f=c.getColor(k);k.css("backgroundColor",g.addColor).animate({backgroundColor:f},{complete:function(){b(this).css("backgroundColor","")}})}i.each(function(){this.wpList.process(k)});return k},clear:function(h){var g=this,f,d;h=b(h);if(g.wpList&&h.parents("#"+g.id).size()){return}h.find(":input").each(function(){if(b(this).parents(".form-no-clear").size()){return}f=this.type.toLowerCase();d=this.tagName.toLowerCase();if("text"==f||"password"==f||"textarea"==d){this.value=""}else{if("checkbox"==f||"radio"==f){this.checked=false}else{if("select"==d){this.selectedIndex=null}}}})},process:function(d){var e=this;b("[class^=add:"+e.id+":]",d||null).filter("form").submit(function(){return e.wpList.add(this)}).end().not("form").click(function(){return e.wpList.add(this)});b("[class^=delete:"+e.id+":]",d||null).click(function(){return e.wpList.del(this)});b("[class^=dim:"+e.id+":]",d||null).click(function(){return e.wpList.dim(this)})},recolor:function(){var f=this,e,d;if(!f.wpList.settings.alt){return}e=b(".list-item:visible",f);if(!e.size()){e=b(f).children(":visible")}d=[":even",":odd"];if(f.wpList.settings.altOffset%2){d.reverse()}e.filter(d[0]).addClass(f.wpList.settings.alt).end().filter(d[1]).removeClass(f.wpList.settings.alt)},init:function(){var d=this;d.wpList.process=function(e){d.each(function(){this.wpList.process(e)})};d.wpList.recolor=function(){d.each(function(){this.wpList.recolor()})}}};b.fn.wpList=function(d){this.each(function(){var e=this;this.wpList={settings:b.extend({},c.settings,{what:c.parseClass(this,"list")[1]||""},d)};b.each(a,function(g,h){e.wpList[g]=function(i,f){return c[h].call(e,i,f)}})});c.init.call(this);this.wpList.process();return this}})(jQuery);
\ No newline at end of file
*/
function wp_kses_bad_protocol($string, $allowed_protocols) {
$string = wp_kses_no_null($string);
- $string = preg_replace('/\xad+/', '', $string); # deals with Opera "feature"
$string2 = $string.'a';
while ($string != $string2) {
$string2 = wp_kses_decode_entities($string);
$string2 = preg_replace('/\s/', '', $string2);
$string2 = wp_kses_no_null($string2);
- $string2 = preg_replace('/\xad+/', '', $string2);
- # deals with Opera "feature"
$string2 = strtolower($string2);
$allowed = false;
* @return string Content after decoded entities
*/
function wp_kses_decode_entities($string) {
- $string = preg_replace_callback('/&#([0-9]+);/', create_function('$match', 'return chr($match[1]);'), $string);
- $string = preg_replace_callback('/&#[Xx]([0-9A-Fa-f]+);/', create_function('$match', 'return chr(hexdec($match[1]));'), $string);
+ $string = preg_replace_callback('/&#([0-9]+);/', '_wp_kses_decode_entities_chr', $string);
+ $string = preg_replace_callback('/&#[Xx]([0-9A-Fa-f]+);/', '_wp_kses_decode_entities_chr_hexdec', $string);
return $string;
}
+/**
+ * Regex callback for wp_kses_decode_entities()
+ *
+ * @param array $match preg match
+ * @return string
+ */
+function _wp_kses_decode_entities_chr( $match ) {
+ return chr( $match[1] );
+}
+
+/**
+ * Regex callback for wp_kses_decode_entities()
+ *
+ * @param array $match preg match
+ * @return string
+ */
+function _wp_kses_decode_entities_chr_hexdec( $match ) {
+ return chr( hexdec( $match[1] ) );
+}
+
/**
* Sanitize content with allowed HTML Kses rules.
*
* @since 1.0.0
* @uses $allowedtags
*
- * @param string $data Content to filter
+ * @param string $data Content to filter, expected to be escaped with slashes
* @return string Filtered content
*/
function wp_filter_kses($data) {
return addslashes( wp_kses(stripslashes( $data ), $allowedtags) );
}
+/**
+ * Sanitize content with allowed HTML Kses rules.
+ *
+ * @since 2.9.0
+ * @uses $allowedtags
+ *
+ * @param string $data Content to filter, expected to not be escaped
+ * @return string Filtered content
+ */
+function wp_kses_data($data) {
+ global $allowedtags;
+ return wp_kses( $data , $allowedtags );
+}
+
/**
* Sanitize content for allowed HTML tags for post content.
*
* @since 2.0.0
* @uses $allowedposttags
*
- * @param string $data Post content to filter
+ * @param string $data Post content to filter, expected to be escaped with slashes
* @return string Filtered post content with allowed HTML tags and attributes intact.
*/
function wp_filter_post_kses($data) {
return addslashes ( wp_kses(stripslashes( $data ), $allowedposttags) );
}
+/**
+ * Sanitize content for allowed HTML tags for post content.
+ *
+ * Post content refers to the page contents of the 'post' type and not $_POST
+ * data from forms.
+ *
+ * @since 2.9.0
+ * @uses $allowedposttags
+ *
+ * @param string $data Post content to filter
+ * @return string Filtered post content with allowed HTML tags and attributes intact.
+ */
+function wp_kses_post($data) {
+ global $allowedposttags;
+ return wp_kses( $data , $allowedposttags );
+}
+
/**
* Strips all of the HTML in the content.
*
return '';
$css_array = split( ';', trim( $css ) );
- $allowed_attr = apply_filters( 'safe_style_css', array( 'text-align', 'margin', 'color', 'float',
- 'border', 'background', 'background-color', 'border-bottom', 'border-bottom-color',
+ $allowed_attr = apply_filters( 'safe_style_css', array( 'text-align', 'margin', 'color', 'float',
+ 'border', 'background', 'background-color', 'border-bottom', 'border-bottom-color',
'border-bottom-style', 'border-bottom-width', 'border-collapse', 'border-color', 'border-left',
- 'border-left-color', 'border-left-style', 'border-left-width', 'border-right', 'border-right-color',
- 'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top',
- 'border-top-color', 'border-top-style', 'border-top-width', 'border-width', 'caption-side',
- 'clear', 'cursor', 'direction', 'font', 'font-family', 'font-size', 'font-style',
- 'font-variant', 'font-weight', 'height', 'letter-spacing', 'line-height', 'margin-bottom',
- 'margin-left', 'margin-right', 'margin-top', 'overflow', 'padding', 'padding-bottom',
- 'padding-left', 'padding-right', 'padding-top', 'text-decoration', 'text-indent', 'vertical-align',
+ 'border-left-color', 'border-left-style', 'border-left-width', 'border-right', 'border-right-color',
+ 'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top',
+ 'border-top-color', 'border-top-style', 'border-top-width', 'border-width', 'caption-side',
+ 'clear', 'cursor', 'direction', 'font', 'font-family', 'font-size', 'font-style',
+ 'font-variant', 'font-weight', 'height', 'letter-spacing', 'line-height', 'margin-bottom',
+ 'margin-left', 'margin-right', 'margin-top', 'overflow', 'padding', 'padding-bottom',
+ 'padding-left', 'padding-right', 'padding-top', 'text-decoration', 'text-indent', 'vertical-align',
'width' ) );
if ( empty($allowed_attr) )
function get_locale() {
global $locale;
- if (isset($locale))
+ if ( isset( $locale ) )
return apply_filters( 'locale', $locale );
// WPLANG is defined in wp-config.
- if (defined('WPLANG'))
+ if ( defined( 'WPLANG' ) )
$locale = WPLANG;
- if (empty($locale))
+ if ( empty( $locale ) )
$locale = 'en_US';
- return apply_filters('locale', $locale);
+ return apply_filters( 'locale', $locale );
}
/**
*/
function translate( $text, $domain = 'default' ) {
$translations = &get_translations_for_domain( $domain );
- return apply_filters('gettext', $translations->translate($text), $text, $domain);
+ return apply_filters( 'gettext', $translations->translate( $text ), $text, $domain );
}
function before_last_bar( $string ) {
*/
function translate_with_context( $text, $domain = 'default' ) {
return before_last_bar( translate( $text, $domain ) );
-
}
function translate_with_gettext_context( $text, $context, $domain = 'default' ) {
$translations = &get_translations_for_domain( $domain );
- return apply_filters( 'gettext_with_context', $translations->translate( $text, $context ), $text, $context, $domain);
+ return apply_filters( 'gettext_with_context', $translations->translate( $text, $context ), $text, $context, $domain );
}
/**
}
/**
- * Retrieve translated string with vertical bar context
+ * Retrieve translated string with gettext context
*
* Quite a few times, there will be collisions with similar translatable text
* found in more than two places but with different translated context.
*
- * In order to use the separate contexts, the _c() function is used and the
- * translatable string uses a pipe ('|') which has the context the string is in.
- *
- * When the translated string is returned, it is everything before the pipe, not
- * including the pipe character. If there is no pipe in the translated text then
- * everything is returned.
+ * By including the context in the pot file translators can translate the two
+ * string differently
*
- * @since 2.2.0
+ * @since 2.8
*
* @param string $text Text to translate
+ * @param string $context Context information for the translators
* @param string $domain Optional. Domain to retrieve the translated text
* @return string Translated context string without pipe
*/
-function _c($text, $domain = 'default') {
- return translate_with_context($text, $domain);
-}
function _x( $single, $context, $domain = 'default' ) {
return translate_with_gettext_context( $single, $context, $domain );
return esc_attr( translate_with_gettext_context( $single, $context, $domain ) );
}
+function esc_html_x( $single, $context, $domain = 'default' ) {
+ return esc_html( translate_with_gettext_context( $single, $context, $domain ) );
+}
+
function __ngettext() {
_deprecated_function( __FUNCTION__, '2.8', '_n()' );
$args = func_get_args();
* @param string $domain Optional. The domain identifier the text should be retrieved in
* @return string Either $single or $plural translated text
*/
-function _n($single, $plural, $number, $domain = 'default') {
+function _n( $single, $plural, $number, $domain = 'default' ) {
$translations = &get_translations_for_domain( $domain );
$translation = $translations->translate_plural( $single, $plural, $number );
return apply_filters( 'ngettext', $translation, $single, $plural, $number, $domain );
function _nx($single, $plural, $number, $context, $domain = 'default') {
$translations = &get_translations_for_domain( $domain );
$translation = $translations->translate_plural( $single, $plural, $number, $context );
- return apply_filters( 'ngettext_with_context ', $translation, $single, $plural, $number, $context, $domain );
+ return apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain );
}
/**
* @param string $mofile Path to the .mo file
* @return bool true on success, false on failure
*/
-function load_textdomain($domain, $mofile) {
+function load_textdomain( $domain, $mofile ) {
global $l10n;
+
+ $plugin_override = apply_filters( 'override_load_textdomain', false, $domain, $mofile );
+
+ if ( true == $plugin_override ) {
+ return true;
+ }
+
+ do_action( 'load_textdomain', $domain, $mofile );
+
+ $mofile = apply_filters( 'load_textdomain_mofile', $mofile, $domain );
if ( !is_readable( $mofile ) ) return false;
$mo->merge_with( $l10n[$domain] );
$l10n[$domain] = &$mo;
+
return true;
}
$mofile = WP_LANG_DIR . "/$locale.mo";
- return load_textdomain('default', $mofile);
+ return load_textdomain( 'default', $mofile );
}
/**
* where the .mo file resides. Deprecated, but still functional until 2.7
* @param string $plugin_rel_path Optional. Relative path to WP_PLUGIN_DIR. This is the preferred argument to use. It takes precendence over $abs_rel_path
*/
-function load_plugin_textdomain($domain, $abs_rel_path = false, $plugin_rel_path = false) {
+function load_plugin_textdomain( $domain, $abs_rel_path = false, $plugin_rel_path = false ) {
$locale = get_locale();
if ( false !== $plugin_rel_path )
- $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/');
- else if ( false !== $abs_rel_path)
- $path = ABSPATH . trim( $abs_rel_path, '/');
+ $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' );
+ else if ( false !== $abs_rel_path )
+ $path = ABSPATH . trim( $abs_rel_path, '/' );
else
$path = WP_PLUGIN_DIR;
$mofile = $path . '/'. $domain . '-' . $locale . '.mo';
- return load_textdomain($domain, $mofile);
+ return load_textdomain( $domain, $mofile );
}
/**
return load_textdomain($domain, $mofile);
}
+/**
+ * Loads the child themes translated strings.
+ *
+ * If the current locale exists as a .mo file in the child themes root directory, it
+ * will be included in the translated strings by the $domain.
+ *
+ * The .mo files must be named based on the locale exactly.
+ *
+ * @since 2.9.0
+ *
+ * @param string $domain Unique identifier for retrieving translated strings
+ */
+function load_child_theme_textdomain($domain, $path = false) {
+ $locale = get_locale();
+
+ $path = ( empty( $path ) ) ? get_stylesheet_directory() : $path;
+
+ $mofile = "$path/$locale.mo";
+ return load_textdomain($domain, $mofile);
+}
+
/**
* Returns the Translations instance for a domain. If there isn't one,
* returns empty Translations instance.
*/
function &get_translations_for_domain( $domain ) {
global $l10n;
- $empty = &new Translations;
- if ( isset($l10n[$domain]) )
- return $l10n[$domain];
- else
- return $empty;
+ if ( !isset( $l10n[$domain] ) ) {
+ $l10n[$domain] = &new NOOP_Translations;
+ }
+ return $l10n[$domain];
}
/**
$pagestruct = $wp_rewrite->get_page_permastruct();
- if ( '' != $pagestruct && ( ( isset($post->post_status) && 'draft' != $post->post_status ) || $sample ) ) {
+ if ( '' != $pagestruct && ( ( isset($post->post_status) && 'draft' != $post->post_status && 'pending' != $post->post_status ) || $sample ) ) {
$link = get_page_uri($id);
$link = ( $leavename ) ? $pagestruct : str_replace('%pagename%', $link, $pagestruct);
$link = trailingslashit(get_option('home')) . "$link";
*/
function get_search_feed_link($search_query = '', $feed = '') {
if ( empty($search_query) )
- $search = esc_attr(get_search_query());
+ $search = esc_attr( urlencode(get_search_query()) );
else
- $search = esc_attr(stripslashes($search_query));
+ $search = esc_attr( urlencode(stripslashes($search_query)) );
if ( empty($feed) )
$feed = get_default_feed();
*/
function get_search_comments_feed_link($search_query = '', $feed = '') {
if ( empty($search_query) )
- $search = esc_attr(get_search_query());
+ $search = esc_attr( urlencode(get_search_query()) );
else
- $search = esc_attr(stripslashes($search_query));
+ $search = esc_attr( urlencode(stripslashes($search_query)) );
if ( empty($feed) )
$feed = get_default_feed();
break;
default :
if ( !current_user_can( 'edit_post', $post->ID ) )
- return;
+ return apply_filters( 'get_edit_post_link', '', $post->ID, $context );;
$file = 'post';
$var = 'post';
break;
* @param string $after Optional. Display after edit link.
* @param int $id Optional. Post ID.
*/
-function edit_post_link( $link = 'Edit This', $before = '', $after = '', $id = 0 ) {
+function edit_post_link( $link = null, $before = '', $after = '', $id = 0 ) {
if ( !$post = &get_post( $id ) )
return;
if ( !$url = get_edit_post_link( $post->ID ) )
return;
+ if ( null === $link )
+ $link = __('Edit This');
+
$link = '<a class="post-edit-link" href="' . $url . '" title="' . esc_attr( __( 'Edit post' ) ) . '">' . $link . '</a>';
echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after;
}
+/**
+ * Retrieve delete posts link for post.
+ *
+ * Can be used within the WordPress loop or outside of it. Can be used with
+ * pages, posts, attachments, and revisions.
+ *
+ * @since 2.9.0
+ *
+ * @param int $id Optional. Post ID.
+ * @param string $context Optional, default to display. How to write the '&', defaults to '&'.
+ * @return string
+ */
+function get_delete_post_link($id = 0, $context = 'display') {
+ if ( !$post = &get_post( $id ) )
+ return;
+
+ if ( 'display' == $context )
+ $action = 'action=trash&';
+ else
+ $action = 'action=trash&';
+
+ switch ( $post->post_type ) :
+ case 'page' :
+ if ( !current_user_can( 'delete_page', $post->ID ) )
+ return;
+ $file = 'page';
+ $var = 'post';
+ break;
+ case 'attachment' :
+ if ( !current_user_can( 'delete_post', $post->ID ) )
+ return;
+ $file = 'media';
+ $var = 'attachment_id';
+ break;
+ case 'revision' :
+ if ( !current_user_can( 'delete_post', $post->ID ) )
+ return;
+ $file = 'revision';
+ $var = 'revision';
+ $action = '';
+ break;
+ default :
+ if ( !current_user_can( 'edit_post', $post->ID ) )
+ return apply_filters( 'get_delete_post_link', '', $post->ID, $context );;
+ $file = 'post';
+ $var = 'post';
+ break;
+ endswitch;
+
+ return apply_filters( 'get_delete_post_link', wp_nonce_url( admin_url("$file.php?{$action}$var=$post->ID"), "trash-{$file}_" . $post->ID ), $context );
+}
+
/**
* Retrieve edit comment link.
*
* @param string $after Optional. Display after edit link.
* @return string|null HTML content, if $echo is set to false.
*/
-function edit_comment_link( $link = 'Edit This', $before = '', $after = '' ) {
+function edit_comment_link( $link = null, $before = '', $after = '' ) {
global $comment, $post;
if ( $post->post_type == 'page' ) {
return;
}
+ if ( null === $link )
+ $link = __('Edit This');
+
$link = '<a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>';
echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after;
}
$order = $previous ? 'DESC' : 'ASC';
$join = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_cat, $excluded_categories );
- $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare("WHERE p.post_date $op %s AND p.post_type = 'post' AND p.post_status = 'publish' $posts_in_ex_cats_sql", $current_post_date), $in_same_cat, $excluded_categories );
+ $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare("WHERE p.post_date $op %s AND p.post_type = %s AND p.post_status = 'publish' $posts_in_ex_cats_sql", $current_post_date, $post->post_type), $in_same_cat, $excluded_categories );
$sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1" );
$query = "SELECT p.* FROM $wpdb->posts AS p $join $where $sort";
$title = apply_filters('the_title', $title, $post);
$date = mysql2date(get_option('date_format'), $post->post_date);
+ $rel = $previous ? 'prev' : 'next';
- $string = '<a href="'.get_permalink($post).'">';
+ $string = '<a href="'.get_permalink($post).'" rel="'.$rel.'">';
$link = str_replace('%title', $title, $link);
$link = str_replace('%date', $date, $link);
$link = $string . $link . '</a>';
f='" . admin_url('press-this.php') . "',
l=d.location,
e=encodeURIComponent,
- g=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(s)+'&v=2';
- function a(){
- if(!w.open(g,'t','toolbar=0,resizable=0,scrollbars=1,status=1,width=720,height=570')){
- l.href=g;
- }
- }";
- if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false)
- $link .= 'setTimeout(a,0);';
- else
- $link .= 'a();';
-
- $link .= "void(0);";
+ u=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(s)+'&v=4';
+ a=function(){if(!w.open(u,'t','toolbar=0,resizable=1,scrollbars=1,status=1,width=720,height=570'))l.href=u;};
+ if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a();
+ void(0)";
$link = str_replace(array("\r", "\n", "\t"), '', $link);
return apply_filters('plugins_url', $url, $path, $plugin);
}
+/**
+ * Output rel=canonical for singular queries
+ *
+ * @package WordPress
+ * @since 2.9.0
+*/
+function rel_canonical() {
+ if ( !is_singular() )
+ return;
+
+ global $wp_the_query;
+ if ( !$id = $wp_the_query->get_queried_object_id() )
+ return;
+
+ $link = get_permalink( $id );
+ echo "<link rel='canonical' href='$link' />\n";
+}
+
?>
* @return array Width and height of what the result image should resize to.
*/
function image_constrain_size_for_editor($width, $height, $size = 'medium') {
- global $content_width;
+ global $content_width, $_wp_additional_image_sizes;
if ( is_array($size) ) {
$max_width = $size[0];
$max_height = intval(get_option('large_size_h'));
if ( intval($content_width) > 0 )
$max_width = min( intval($content_width), $max_width );
+ } elseif ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) && in_array( $size, array_keys( $_wp_additional_image_sizes ) ) ) {
+ $max_width = intval( $_wp_additional_image_sizes[$size]['width'] );
+ $max_height = intval( $_wp_additional_image_sizes[$size]['height'] );
+ if ( intval($content_width) > 0 )
+ $max_width = min( intval($content_width), $max_width );
}
// $size == 'full' has no constraint
else {
}
+/**
+ * Registers a new image size
+ */
+function add_image_size( $name, $width = 0, $height = 0, $crop = FALSE ) {
+ global $_wp_additional_image_sizes;
+ $_wp_additional_image_sizes[$name] = array( 'width' => absint( $width ), 'height' => absint( $height ), 'crop' => !!$crop );
+}
+
+/**
+ * Registers an image size for the post thumbnail
+ */
+function set_post_thumbnail_size( $width = 0, $height = 0, $crop = FALSE ) {
+ add_image_size( 'post-thumbnail', $width, $height, $crop );
+}
+
/**
* An <img src /> tag for an image attachment, scaling it down if requested.
*
* @param bool $crop Optional, default is false. Whether to crop image or resize.
* @return bool|array False, on failure. Returned array matches parameters for imagecopyresampled() PHP function.
*/
-function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop=false) {
+function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop = false) {
if ($orig_w <= 0 || $orig_h <= 0)
return false;
$aspect_ratio = $orig_w / $orig_h;
$new_w = min($dest_w, $orig_w);
$new_h = min($dest_h, $orig_h);
- if (!$new_w) {
+
+ if ( !$new_w ) {
$new_w = intval($new_h * $aspect_ratio);
}
- if (!$new_h) {
+
+ if ( !$new_h ) {
$new_h = intval($new_w / $aspect_ratio);
}
$size_ratio = max($new_w / $orig_w, $new_h / $orig_h);
- $crop_w = ceil($new_w / $size_ratio);
- $crop_h = ceil($new_h / $size_ratio);
+ $crop_w = round($new_w / $size_ratio);
+ $crop_h = round($new_h / $size_ratio);
- $s_x = floor(($orig_w - $crop_w)/2);
- $s_y = floor(($orig_h - $crop_h)/2);
- }
- else {
+ $s_x = floor( ($orig_w - $crop_w) / 2 );
+ $s_y = floor( ($orig_h - $crop_h) / 2 );
+ } else {
// don't crop, just resize using $dest_w x $dest_h as a maximum bounding box
$crop_w = $orig_w;
$crop_h = $orig_h;
}
// if the resulting image would be the same size or larger we don't want to resize it
- if ($new_w >= $orig_w && $new_h >= $orig_h)
+ if ( $new_w >= $orig_w && $new_h >= $orig_h )
return false;
// the return array matches the parameters to imagecopyresampled()
// int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h
- return array(0, 0, $s_x, $s_y, $new_w, $new_h, $crop_w, $crop_h);
+ return array( 0, 0, (int) $s_x, (int) $s_y, (int) $new_w, (int) $new_h, (int) $crop_w, (int) $crop_h );
}
* @param int $jpeg_quality Optional, default is 90. Image quality percentage.
* @return mixed WP_Error on failure. String with new destination path. Array of dimensions from {@link image_resize_dimensions()}
*/
-function image_resize( $file, $max_w, $max_h, $crop=false, $suffix=null, $dest_path=null, $jpeg_quality=90) {
+function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 90 ) {
$image = wp_load_image( $file );
if ( !is_resource( $image ) )
return new WP_Error('error_loading_image', $image);
- list($orig_w, $orig_h, $orig_type) = getimagesize( $file );
+ $size = @getimagesize( $file );
+ if ( !$size )
+ return new WP_Error('invalid_image', __('Could not read image size'), $file);
+ list($orig_w, $orig_h, $orig_type) = $size;
+
$dims = image_resize_dimensions($orig_w, $orig_h, $max_w, $max_h, $crop);
- if (!$dims)
+ if ( !$dims )
return $dims;
list($dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) = $dims;
- $newimage = imagecreatetruecolor( $dst_w, $dst_h);
-
- // preserve PNG transparency
- if ( IMAGETYPE_PNG == $orig_type && function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' ) ) {
- imagealphablending( $newimage, false);
- imagesavealpha( $newimage, true);
- }
+ $newimage = wp_imagecreatetruecolor( $dst_w, $dst_h );
imagecopyresampled( $newimage, $image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
+ // convert from full colors to index colors, like original PNG.
+ if ( IMAGETYPE_PNG == $orig_type && !imageistruecolor( $image ) )
+ imagetruecolortopalette( $newimage, false, imagecolorstotal( $image ) );
+
// we don't need the original in memory anymore
imagedestroy( $image );
$dir = $_dest_path;
$destfilename = "{$dir}/{$name}-{$suffix}.{$ext}";
- if ( $orig_type == IMAGETYPE_GIF ) {
- if (!imagegif( $newimage, $destfilename ) )
+ if ( IMAGETYPE_GIF == $orig_type ) {
+ if ( !imagegif( $newimage, $destfilename ) )
return new WP_Error('resize_path_invalid', __( 'Resize path invalid' ));
- }
- elseif ( $orig_type == IMAGETYPE_PNG ) {
- if (!imagepng( $newimage, $destfilename ) )
+ } elseif ( IMAGETYPE_PNG == $orig_type ) {
+ if ( !imagepng( $newimage, $destfilename ) )
return new WP_Error('resize_path_invalid', __( 'Resize path invalid' ));
- }
- else {
+ } else {
// all other formats are converted to jpg
$destfilename = "{$dir}/{$name}-{$suffix}.jpg";
- if (!imagejpeg( $newimage, $destfilename, apply_filters( 'jpeg_quality', $jpeg_quality, 'image_resize' ) ) )
+ if ( !imagejpeg( $newimage, $destfilename, apply_filters( 'jpeg_quality', $jpeg_quality, 'image_resize' ) ) )
return new WP_Error('resize_path_invalid', __( 'Resize path invalid' ));
}
* @param bool $icon Optional, default is false. Whether it is an icon.
* @return string HTML img element or empty string on failure.
*/
-function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false) {
+function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false, $attr = '') {
$html = '';
$image = wp_get_attachment_image_src($attachment_id, $size, $icon);
if ( is_array($size) )
$size = join('x', $size);
$attachment =& get_post($attachment_id);
- $attr = array(
+ $default_attr = array(
'src' => $src,
'class' => "attachment-$size",
'alt' => trim(strip_tags( $attachment->post_excerpt )),
'title' => trim(strip_tags( $attachment->post_title )),
- );
+ );
+ $attr = wp_parse_args($attr, $default_attr);
$attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment );
$attr = array_map( 'esc_attr', $attr );
$html = rtrim("<img $hwstring");
return $html;
}
+/**
+ * Adds a 'wp-post-image' class to post thumbnail thumbnails
+ * Uses the begin_fetch_post_thumbnail_html and end_fetch_post_thumbnail_html action hooks to
+ * dynamically add/remove itself so as to only filter post thumbnail thumbnails
+ *
+ * @author Mark Jaquith
+ * @since 2.9.0
+ * @param array $attr Attributes including src, class, alt, title
+ * @return array
+ */
+function _wp_post_thumbnail_class_filter( $attr ) {
+ $attr['class'] .= ' wp-post-image';
+ return $attr;
+}
+
+/**
+ * Adds _wp_post_thumbnail_class_filter to the wp_get_attachment_image_attributes filter
+ *
+ * @author Mark Jaquith
+ * @since 2.9.0
+ */
+function _wp_post_thumbnail_class_filter_add( $attr ) {
+ add_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' );
+}
+
+/**
+ * Removes _wp_post_thumbnail_class_filter from the wp_get_attachment_image_attributes filter
+ *
+ * @author Mark Jaquith
+ * @since 2.9.0
+ */
+function _wp_post_thumbnail_class_filter_remove( $attr ) {
+ remove_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' );
+}
+
add_shortcode('wp_caption', 'img_caption_shortcode');
add_shortcode('caption', 'img_caption_shortcode');
* @return string HTML content to display gallery.
*/
function gallery_shortcode($attr) {
- global $post;
+ global $post, $wp_locale;
static $instance = 0;
$instance++;
'icontag' => 'dt',
'captiontag' => 'dd',
'columns' => 3,
- 'size' => 'thumbnail'
+ 'size' => 'thumbnail',
+ 'include' => '',
+ 'exclude' => ''
), $attr));
$id = intval($id);
- $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
+ if ( 'RAND' == $order )
+ $orderby = 'none';
+
+ if ( !empty($include) ) {
+ $include = preg_replace( '/[^0-9,]+/', '', $include );
+ $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
+
+ $attachments = array();
+ foreach ( $_attachments as $key => $val ) {
+ $attachments[$val->ID] = $_attachments[$key];
+ }
+ } elseif ( !empty($exclude) ) {
+ $exclude = preg_replace( '/[^0-9,]+/', '', $exclude );
+ $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
+ } else {
+ $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
+ }
if ( empty($attachments) )
return '';
$captiontag = tag_escape($captiontag);
$columns = intval($columns);
$itemwidth = $columns > 0 ? floor(100/$columns) : 100;
-
+ $float = $wp_locale->text_direction == 'rtl' ? 'right' : 'left';
+
$selector = "gallery-{$instance}";
$output = apply_filters('gallery_style', "
margin: auto;
}
#{$selector} .gallery-item {
- float: left;
+ float: {$float};
margin-top: 10px;
text-align: center;
width: {$itemwidth}%; }
return array_unique($taxonomies);
}
+/**
+ * Check if the installed version of GD supports particular image type
+ *
+ * @since 2.9.0
+ *
+ * @param $mime_type string
+ * @return bool
+ */
+function gd_edit_image_support($mime_type) {
+ if ( function_exists('imagetypes') ) {
+ switch( $mime_type ) {
+ case 'image/jpeg':
+ return (imagetypes() & IMG_JPG) != 0;
+ case 'image/png':
+ return (imagetypes() & IMG_PNG) != 0;
+ case 'image/gif':
+ return (imagetypes() & IMG_GIF) != 0;
+ }
+ } else {
+ switch( $mime_type ) {
+ case 'image/jpeg':
+ return function_exists('imagecreatefromjpeg');
+ case 'image/png':
+ return function_exists('imagecreatefrompng');
+ case 'image/gif':
+ return function_exists('imagecreatefromgif');
+ }
+ }
+ return false;
+}
+
+/**
+ * Create new GD image resource with transparency support
+ *
+ * @since 2.9.0
+ *
+ * @param $width
+ * @param $height
+ * @return image resource
+ */
+function wp_imagecreatetruecolor($width, $height) {
+ $img = imagecreatetruecolor($width, $height);
+ if ( is_resource($img) && function_exists('imagealphablending') && function_exists('imagesavealpha') ) {
+ imagealphablending($img, false);
+ imagesavealpha($img, true);
+ }
+ return $img;
+}
+
+/**
+ * API for easily embedding rich media such as videos and images into content.
+ *
+ * @package WordPress
+ * @subpackage Embed
+ * @since 2.9.0
+ */
+class WP_Embed {
+ var $handlers = array();
+ var $post_ID;
+ var $usecache = true;
+ var $linkifunknown = true;
+
+ /**
+ * PHP4 constructor
+ */
+ function WP_Embed() {
+ return $this->__construct();
+ }
+
+ /**
+ * PHP5 constructor
+ */
+ function __construct() {
+ // Hack to get the [embed] shortcode to run before wpautop()
+ add_filter( 'the_content', array(&$this, 'run_shortcode'), 8 );
+
+ // Attempts to embed all URLs in a post
+ if ( get_option('embed_autourls') )
+ add_filter( 'the_content', array(&$this, 'autoembed'), 8 );
+
+ // After a post is saved, invalidate the oEmbed cache
+ add_action( 'save_post', array(&$this, 'delete_oembed_caches') );
+
+ // After a post is saved, cache oEmbed items via AJAX
+ add_action( 'edit_form_advanced', array(&$this, 'maybe_run_ajax_cache') );
+ }
+
+ /**
+ * Process the [embed] shortcode.
+ *
+ * Since the [embed] shortcode needs to be run earlier than other shortcodes,
+ * this function removes all existing shortcodes, registers the [embed] shortcode,
+ * calls {@link do_shortcode()}, and then re-registers the old shortcodes.
+ *
+ * @uses $shortcode_tags
+ * @uses remove_all_shortcodes()
+ * @uses add_shortcode()
+ * @uses do_shortcode()
+ *
+ * @param string $content Content to parse
+ * @return string Content with shortcode parsed
+ */
+ function run_shortcode( $content ) {
+ global $shortcode_tags;
+
+ // Backup current registered shortcodes and clear them all out
+ $orig_shortcode_tags = $shortcode_tags;
+ remove_all_shortcodes();
+
+ add_shortcode( 'embed', array(&$this, 'shortcode') );
+
+ // Do the shortcode (only the [embed] one is registered)
+ $content = do_shortcode( $content );
+
+ // Put the original shortcodes back
+ $shortcode_tags = $orig_shortcode_tags;
+
+ return $content;
+ }
+
+ /**
+ * If a post/page was saved, then output Javascript to make
+ * an AJAX request that will call WP_Embed::cache_oembed().
+ */
+ function maybe_run_ajax_cache() {
+ global $post_ID;
+
+ if ( empty($post_ID) || empty($_GET['message']) || 1 != $_GET['message'] )
+ return;
+
?>
+<script type="text/javascript">
+/* <![CDATA[ */
+ jQuery(document).ready(function($){
+ $.get("<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post_ID ); ?>");
+ });
+/* ]]> */
+</script>
+<?php
+ }
+
+ /**
+ * Register an embed handler. Do not use this function directly, use {@link wp_embed_register_handler()} instead.
+ * This function should probably also only be used for sites that do not support oEmbed.
+ *
+ * @param string $id An internal ID/name for the handler. Needs to be unique.
+ * @param string $regex The regex that will be used to see if this handler should be used for a URL.
+ * @param callback $callback The callback function that will be called if the regex is matched.
+ * @param int $priority Optional. Used to specify the order in which the registered handlers will be tested (default: 10). Lower numbers correspond with earlier testing, and handlers with the same priority are tested in the order in which they were added to the action.
+ */
+ function register_handler( $id, $regex, $callback, $priority = 10 ) {
+ $this->handlers[$priority][$id] = array(
+ 'regex' => $regex,
+ 'callback' => $callback,
+ );
+ }
+
+ /**
+ * Unregister a previously registered embed handler. Do not use this function directly, use {@link wp_embed_unregister_handler()} instead.
+ *
+ * @param string $id The handler ID that should be removed.
+ * @param int $priority Optional. The priority of the handler to be removed (default: 10).
+ */
+ function unregister_handler( $id, $priority = 10 ) {
+ if ( isset($this->handlers[$priority][$id]) )
+ unset($this->handlers[$priority][$id]);
+ }
+
+ /**
+ * The {@link do_shortcode()} callback function.
+ *
+ * Attempts to convert a URL into embed HTML. Starts by checking the URL against the regex of the registered embed handlers.
+ * If none of the regex matches and it's enabled, then the URL will be given to the {@link WP_oEmbed} class.
+ *
+ * @uses wp_oembed_get()
+ * @uses wp_parse_args()
+ * @uses wp_embed_defaults()
+ * @uses WP_Embed::maybe_make_link()
+ * @uses get_option()
+ * @uses current_user_can()
+ * @uses wp_cache_get()
+ * @uses wp_cache_set()
+ * @uses get_post_meta()
+ * @uses update_post_meta()
+ *
+ * @param array $attr Shortcode attributes.
+ * @param string $url The URL attempting to be embeded.
+ * @return string The embed HTML on success, otherwise the original URL.
+ */
+ function shortcode( $attr, $url = '' ) {
+ global $post;
+
+ if ( empty($url) )
+ return '';
+
+ $rawattr = $attr;
+ $attr = wp_parse_args( $attr, wp_embed_defaults() );
+
+ // Look for known internal handlers
+ ksort( $this->handlers );
+ foreach ( $this->handlers as $priority => $handlers ) {
+ foreach ( $handlers as $id => $handler ) {
+ if ( preg_match( $handler['regex'], $url, $matches ) && is_callable( $handler['callback'] ) ) {
+ if ( false !== $return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr ) )
+ return apply_filters( 'embed_handler_html', $return, $url, $attr );
+ }
+ }
+ }
+
+ $post_ID = ( !empty($post->ID) ) ? $post->ID : null;
+ if ( !empty($this->post_ID) ) // Potentially set by WP_Embed::cache_oembed()
+ $post_ID = $this->post_ID;
+
+ // Unknown URL format. Let oEmbed have a go.
+ if ( $post_ID ) {
+
+ // Check for a cached result (stored in the post meta)
+ $cachekey = '_oembed_' . md5( $url . serialize( $attr ) );
+ if ( $this->usecache ) {
+ $cache = get_post_meta( $post_ID, $cachekey, true );
+
+ // Failures are cached
+ if ( '{{unknown}}' === $cache )
+ return $this->maybe_make_link( $url );
+
+ if ( !empty($cache) )
+ return apply_filters( 'embed_oembed_html', $cache, $url, $attr );
+ }
+
+ // Use oEmbed to get the HTML
+ $attr['discover'] = ( apply_filters('embed_oembed_discover', false) && author_can( $post_ID, 'unfiltered_html' ) ) ? true : false;
+ $html = wp_oembed_get( $url, $attr );
+
+ // Cache the result
+ $cache = ( $html ) ? $html : '{{unknown}}';
+ update_post_meta( $post_ID, $cachekey, $cache );
+
+ // If there was a result, return it
+ if ( $html )
+ return apply_filters( 'embed_oembed_html', $html, $url, $attr );
+ }
+
+ // Still unknown
+ return $this->maybe_make_link( $url );
+ }
+
+ /**
+ * Delete all oEmbed caches.
+ *
+ * @param int $post_ID Post ID to delete the caches for.
+ */
+ function delete_oembed_caches( $post_ID ) {
+ $post_metas = get_post_custom_keys( $post_ID );
+ if ( empty($post_metas) )
+ return;
+
+ foreach( $post_metas as $post_meta_key ) {
+ if ( '_oembed_' == substr( $post_meta_key, 0, 8 ) )
+ delete_post_meta( $post_ID, $post_meta_key );
+ }
+ }
+
+ /**
+ * Triggers a caching of all oEmbed results.
+ *
+ * @param int $post_ID Post ID to do the caching for.
+ */
+ function cache_oembed( $post_ID ) {
+ $post = get_post( $post_ID );
+
+ if ( empty($post->ID) || !in_array( $post->post_type, apply_filters( 'embed_cache_oembed_types', array( 'post', 'page' ) ) ) )
+ return;
+
+ // Trigger a caching
+ if ( !empty($post->post_content) ) {
+ $this->post_ID = $post->ID;
+ $this->usecache = false;
+
+ $content = $this->run_shortcode( $post->post_content );
+ if ( get_option('embed_autourls') )
+ $this->autoembed( $content );
+
+ $this->usecache = true;
+ }
+ }
+
+ /**
+ * Passes any unlinked URLs that are on their own line to {@link WP_Embed::shortcode()} for potential embedding.
+ *
+ * @uses WP_Embed::autoembed_callback()
+ *
+ * @param string $content The content to be searched.
+ * @return string Potentially modified $content.
+ */
+ function autoembed( $content ) {
+ return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array(&$this, 'autoembed_callback'), $content );
+ }
+
+ /**
+ * Callback function for {@link WP_Embed::autoembed()}.
+ *
+ * @uses WP_Embed::shortcode()
+ *
+ * @param array $match A regex match array.
+ * @return string The embed HTML on success, otherwise the original URL.
+ */
+ function autoembed_callback( $match ) {
+ $oldval = $this->linkifunknown;
+ $this->linkifunknown = false;
+ $return = $this->shortcode( array(), $match[1] );
+ $this->linkifunknown = $oldval;
+
+ return "\n$return\n";
+ }
+
+ /**
+ * Conditionally makes a hyperlink based on an internal class variable.
+ *
+ * @param string $url URL to potentially be linked.
+ * @return string Linked URL or the original URL.
+ */
+ function maybe_make_link( $url ) {
+ $output = ( $this->linkifunknown ) ? '<a href="' . esc_attr($url) . '">' . esc_html($url) . '</a>' : $url;
+ return apply_filters( 'embed_maybe_make_link', $output, $url );
+ }
+}
+$wp_embed = new WP_Embed();
+
+/**
+ * Register an embed handler. This function should probably only be used for sites that do not support oEmbed.
+ *
+ * @since 2.9.0
+ * @see WP_Embed::register_handler()
+ */
+function wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) {
+ global $wp_embed;
+ $wp_embed->register_handler( $id, $regex, $callback, $priority );
+}
+
+/**
+ * Unregister a previously registered embed handler.
+ *
+ * @since 2.9.0
+ * @see WP_Embed::unregister_handler()
+ */
+function wp_embed_unregister_handler( $id, $priority = 10 ) {
+ global $wp_embed;
+ $wp_embed->unregister_handler( $id, $priority );
+}
+
+/**
+ * Create default array of embed parameters.
+ *
+ * @since 2.9.0
+ *
+ * @return array Default embed parameters.
+ */
+function wp_embed_defaults() {
+ if ( !empty($GLOBALS['content_width']) )
+ $theme_width = (int) $GLOBALS['content_width'];
+
+ $width = get_option('embed_size_w');
+
+ if ( !$width && !empty($theme_width) )
+ $width = $theme_width;
+
+ if ( !$width )
+ $width = 500;
+
+ return apply_filters( 'embed_defaults', array(
+ 'width' => $width,
+ 'height' => 700,
+ ) );
+}
+
+/**
+ * Based on a supplied width/height example, return the biggest possible dimensions based on the max width/height.
+ *
+ * @since 2.9.0
+ * @uses wp_constrain_dimensions() This function passes the widths and the heights.
+ *
+ * @param int $example_width The width of an example embed.
+ * @param int $example_height The height of an example embed.
+ * @param int $max_width The maximum allowed width.
+ * @param int $max_height The maximum allowed height.
+ * @return array The maximum possible width and height based on the example ratio.
+ */
+function wp_expand_dimensions( $example_width, $example_height, $max_width, $max_height ) {
+ $example_width = (int) $example_width;
+ $example_height = (int) $example_height;
+ $max_width = (int) $max_width;
+ $max_height = (int) $max_height;
+
+ return wp_constrain_dimensions( $example_width * 1000000, $example_height * 1000000, $max_width, $max_height );
+}
+
+/**
+ * Attempts to fetch the embed HTML for a provided URL using oEmbed.
+ *
+ * @since 2.9.0
+ * @see WP_oEmbed
+ *
+ * @uses _wp_oembed_get_object()
+ * @uses WP_oEmbed::get_html()
+ *
+ * @param string $url The URL that should be embeded.
+ * @param array $args Addtional arguments and parameters.
+ * @return string The original URL on failure or the embed HTML on success.
+ */
+function wp_oembed_get( $url, $args = '' ) {
+ require_once( 'class-oembed.php' );
+ $oembed = _wp_oembed_get_object();
+ return $oembed->get_html( $url, $args );
+}
+
+/**
+ * Adds a URL format and oEmbed provider URL pair.
+ *
+ * @since 2.9.0
+ * @see WP_oEmbed
+ *
+ * @uses _wp_oembed_get_object()
+ *
+ * @param string $format The format of URL that this provider can handle. You can use asterisks as wildcards.
+ * @param string $provider The URL to the oEmbed provider.
+ * @param boolean $regex Whether the $format parameter is in a regex format or not.
+ */
+function wp_oembed_add_provider( $format, $provider, $regex = false ) {
+ require_once( 'class-oembed.php' );
+ $oembed = _wp_oembed_get_object();
+ $oembed->providers[$format] = array( $provider, $regex );
+}
--- /dev/null
+<?php
+/**
+ * Meta API
+ *
+ * Functions for retrieving and manipulating metadata
+ *
+ * @package WordPress
+ * @subpackage Meta
+ * @since 2.9.0
+ */
+
+function add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique = false) {
+ if ( !$meta_type || !$meta_key )
+ return false;
+
+ if ( ! $table = _get_meta_table($meta_type) )
+ return false;
+
+ global $wpdb;
+
+ $column = esc_sql($meta_type . '_id');
+
+ // expected_slashed ($meta_key)
+ $meta_key = stripslashes($meta_key);
+
+ if ( $unique && $wpdb->get_var( $wpdb->prepare(
+ "SELECT COUNT(*) FROM $table WHERE meta_key = %s AND $column = %d",
+ $meta_key, $object_id ) ) )
+ return false;
+
+ $meta_value = maybe_serialize( stripslashes_deep($meta_value) );
+
+ $wpdb->insert( $table, array(
+ $column => $object_id,
+ 'meta_key' => $meta_key,
+ 'meta_value' => $meta_value
+ ) );
+
+ wp_cache_delete($object_id, $meta_type . '_meta');
+
+ do_action( "added_{$meta_type}_meta", $wpdb->insert_id, $object_id, $meta_key, $meta_value );
+
+ return true;
+}
+
+function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_value = '') {
+ if ( !$meta_type || !$meta_key )
+ return false;
+
+ if ( ! $table = _get_meta_table($meta_type) )
+ return false;
+
+ global $wpdb;
+
+ $column = esc_sql($meta_type . '_id');
+
+ // expected_slashed ($meta_key)
+ $meta_key = stripslashes($meta_key);
+
+ if ( ! $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $table WHERE meta_key = %s AND $column = %d", $meta_key, $object_id ) ) )
+ return add_metadata($meta_type, $object_id, $meta_key, $meta_value);
+
+ $meta_value = maybe_serialize( stripslashes_deep($meta_value) );
+
+ $data = compact( 'meta_value' );
+ $where = array( $column => $object_id, 'meta_key' => $meta_key );
+
+ if ( !empty( $prev_value ) ) {
+ $prev_value = maybe_serialize($prev_value);
+ $where['meta_value'] = $prev_value;
+ }
+
+ do_action( "update_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $meta_value );
+
+ $wpdb->update( $table, $data, $where );
+ wp_cache_delete($object_id, $meta_type . '_meta');
+
+ do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $meta_value );
+
+ return true;
+}
+
+function delete_metadata($meta_type, $object_id, $meta_key, $meta_value = '', $delete_all = false) {
+ if ( !$meta_type || !$meta_key || (!$delete_all && ! (int)$object_id) )
+ return false;
+
+ if ( ! $table = _get_meta_table($meta_type) )
+ return false;
+
+ global $wpdb;
+
+ $type_column = esc_sql($meta_type . '_id');
+ // expected_slashed ($meta_key)
+ $meta_key = stripslashes($meta_key);
+ $meta_value = maybe_serialize( stripslashes_deep($meta_value) );
+
+ $query = $wpdb->prepare( "SELECT meta_id FROM $table WHERE meta_key = %s", $meta_key );
+
+ if ( !$delete_all )
+ $query .= $wpdb->prepare(" AND $type_column = %d", $object_id );
+
+ if ( $meta_value )
+ $query .= $wpdb->prepare(" AND meta_value = %s", $meta_value );
+
+ $meta_ids = $wpdb->get_col( $query );
+ if ( !count( $meta_ids ) )
+ return false;
+
+ $query = "DELETE FROM $table WHERE meta_id IN( " . implode( ',', $meta_ids ) . " )";
+
+ $count = $wpdb->query($query);
+
+ if ( !$count )
+ return false;
+
+ wp_cache_delete($object_id, $meta_type . '_meta');
+
+ do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $meta_value );
+
+ return true;
+}
+
+function get_metadata($meta_type, $object_id, $meta_key = '', $single = false) {
+ if ( !$meta_type )
+ return false;
+
+ $meta_cache = wp_cache_get($object_id, $meta_type . '_meta');
+
+ if ( !$meta_cache ) {
+ update_meta_cache($meta_type, $object_id);
+ $meta_cache = wp_cache_get($object_id, $meta_type . '_meta');
+ }
+
+ if ( ! $meta_key )
+ return $meta_cache;
+
+ if ( isset($meta_cache[$meta_key]) ) {
+ if ( $single ) {
+ return maybe_unserialize( $meta_cache[$meta_key][0] );
+ } else {
+ return array_map('maybe_unserialize', $meta_cache[$meta_key]);
+ }
+ }
+
+ if ($single)
+ return '';
+ else
+ return array();
+}
+
+function update_meta_cache($meta_type, $object_ids) {
+ if ( empty( $meta_type ) || empty( $object_ids ) )
+ return false;
+
+ if ( ! $table = _get_meta_table($meta_type) )
+ return false;
+
+ $column = esc_sql($meta_type . '_id');
+
+ global $wpdb;
+
+ if ( !is_array($object_ids) ) {
+ $object_ids = preg_replace('|[^0-9,]|', '', $object_ids);
+ $object_ids = explode(',', $object_ids);
+ }
+
+ $object_ids = array_map('intval', $object_ids);
+
+ $cache_key = $meta_type . '_meta';
+ $ids = array();
+ foreach ( $object_ids as $id ) {
+ if ( false === wp_cache_get($id, $cache_key) )
+ $ids[] = $id;
+ }
+
+ if ( empty( $ids ) )
+ return false;
+
+ // Get meta info
+ $id_list = join(',', $ids);
+ $cache = array();
+ $meta_list = $wpdb->get_results( $wpdb->prepare("SELECT $column, meta_key, meta_value FROM $table WHERE $column IN ($id_list)",
+ $meta_type), ARRAY_A );
+
+ if ( !empty($meta_list) ) {
+ foreach ( $meta_list as $metarow) {
+ $mpid = intval($metarow[$column]);
+ $mkey = $metarow['meta_key'];
+ $mval = $metarow['meta_value'];
+
+ // Force subkeys to be array type:
+ if ( !isset($cache[$mpid]) || !is_array($cache[$mpid]) )
+ $cache[$mpid] = array();
+ if ( !isset($cache[$mpid][$mkey]) || !is_array($cache[$mpid][$mkey]) )
+ $cache[$mpid][$mkey] = array();
+
+ // Add a value to the current pid/key:
+ $cache[$mpid][$mkey][] = $mval;
+ }
+ }
+
+ foreach ( $ids as $id ) {
+ if ( ! isset($cache[$id]) )
+ $cache[$id] = array();
+ }
+
+ foreach ( array_keys($cache) as $object)
+ wp_cache_set($object, $cache[$object], $cache_key);
+
+ return $cache;
+}
+
+function _get_meta_table($type) {
+ global $wpdb;
+
+ $table_name = $type . 'meta';
+
+ if ( empty($wpdb->$table_name) )
+ return false;
+
+ return $wpdb->$table_name;
+}
+?>
return;
if ( ! $user = wp_validate_auth_cookie() ) {
- if ( empty($_COOKIE[LOGGED_IN_COOKIE]) || !$user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in') ) {
+ if ( is_admin() || empty($_COOKIE[LOGGED_IN_COOKIE]) || !$user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in') ) {
wp_set_current_user(0);
return false;
}
return false;
}
+ if ( $expiration < time() ) // AJAX/POST grace period set above
+ $GLOBALS['login_grace_period'] = 1;
+
do_action('auth_cookie_valid', $cookie_elements, $user);
return $user->ID;
}
}
- if ( $user_id = wp_validate_auth_cookie() ) {
+ if ( $user_id = wp_validate_auth_cookie( '', apply_filters( 'auth_redirect_scheme', '' ) ) ) {
do_action('auth_redirect', $user_id);
// If the user wants ssl but the session is not ssl, redirect.
if ( $query_arg )
$nonce = $_REQUEST[$query_arg];
else
- $nonce = $_REQUEST['_ajax_nonce'] ? $_REQUEST['_ajax_nonce'] : $_REQUEST['_wpnonce'];
+ $nonce = isset($_REQUEST['_ajax_nonce']) ? $_REQUEST['_ajax_nonce'] : $_REQUEST['_wpnonce'];
$result = wp_verify_nonce( $nonce, $action );
} else {
if ( php_sapi_name() != 'cgi-fcgi' )
status_header($status); // This causes problems on IIS and some FastCGI setups
- header("Location: $location");
+ header("Location: $location", true, $status);
}
}
endif;
if ('' == $user->user_email) return false; // If there's no email to send the comment to
$comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
-
- $blogname = get_option('blogname');
+
+ // The blogname option is escaped with esc_html on the way into the database in sanitize_option
+ // we want to reverse this for the plain text arena of emails.
+ $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
if ( empty( $comment_type ) ) $comment_type = 'comment';
$notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n";
$notify_message .= __('Excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
$notify_message .= __('You can see all trackbacks on this post here: ') . "\r\n";
- /* translators: 1: blog name, 2: post title */
+ /* translators: 1: blog name, 2: post title */
$subject = sprintf( __('[%1$s] Trackback: "%2$s"'), $blogname, $post->post_title );
} elseif ('pingback' == $comment_type) {
/* translators: 1: post id, 2: post title */
$subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title );
}
$notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
- $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=cdc&c=$comment_id") ) . "\r\n";
- $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=cdc&dt=spam&c=$comment_id") ) . "\r\n";
+ if ( EMPTY_TRASH_DAYS )
+ $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=trash&c=$comment_id") ) . "\r\n";
+ else
+ $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=delete&c=$comment_id") ) . "\r\n";
+ $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c=$comment_id") ) . "\r\n";
$wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));
$comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
$comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");
-
+
+ // The blogname option is escaped with esc_html on the way into the database in sanitize_option
+ // we want to reverse this for the plain text arena of emails.
+ $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
+
switch ($comment->comment_type)
{
case 'trackback':
break;
}
- $notify_message .= sprintf( __('Approve it: %s'), admin_url("comment.php?action=mac&c=$comment_id") ) . "\r\n";
- $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=cdc&c=$comment_id") ) . "\r\n";
- $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=cdc&dt=spam&c=$comment_id") ) . "\r\n";
+ $notify_message .= sprintf( __('Approve it: %s'), admin_url("comment.php?action=approve&c=$comment_id") ) . "\r\n";
+ if ( EMPTY_TRASH_DAYS )
+ $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=trash&c=$comment_id") ) . "\r\n";
+ else
+ $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=delete&c=$comment_id") ) . "\r\n";
+ $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c=$comment_id") ) . "\r\n";
$notify_message .= sprintf( _n('Currently %s comment is waiting for approval. Please visit the moderation panel:',
'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting), number_format_i18n($comments_waiting) ) . "\r\n";
$notify_message .= admin_url("edit-comments.php?comment_status=moderated") . "\r\n";
- $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_option('blogname'), $post->post_title );
+ $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), $blogname, $post->post_title );
$admin_email = get_option('admin_email');
$message_headers = '';
// but check to see if it's the admin whose password we're changing, and skip this
if ( $user->user_email != get_option('admin_email') ) {
$message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n";
- wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), get_option('blogname')), $message);
+ // The blogname option is escaped with esc_html on the way into the database in sanitize_option
+ // we want to reverse this for the plain text arena of emails.
+ $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
+ wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), $blogname), $message);
}
}
endif;
$user_login = stripslashes($user->user_login);
$user_email = stripslashes($user->user_email);
+
+ // The blogname option is escaped with esc_html on the way into the database in sanitize_option
+ // we want to reverse this for the plain text arena of emails.
+ $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
- $message = sprintf(__('New user registration on your blog %s:'), get_option('blogname')) . "\r\n\r\n";
+ $message = sprintf(__('New user registration on your blog %s:'), $blogname) . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
$message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
- @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $message);
+ @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
if ( empty($plaintext_pass) )
return;
$message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
$message .= wp_login_url() . "\r\n";
- wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $message);
+ wp_mail($user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);
}
endif;
}
endif;
-?>
global $wp_filter;
static $filter_id_count = 0;
- // If function then just skip all of the tests and not overwrite the following.
- if ( is_string($function) )
+ if ( is_string($function) ) {
return $function;
- // Object Class Calling
- else if (is_object($function[0]) ) {
- $obj_idx = get_class($function[0]).$function[1];
- if ( !isset($function[0]->wp_filter_id) ) {
- if ( false === $priority )
- return false;
- $obj_idx .= isset($wp_filter[$tag][$priority]) ? count((array)$wp_filter[$tag][$priority]) : 0;
- $function[0]->wp_filter_id = $filter_id_count++;
- } else
- $obj_idx .= $function[0]->wp_filter_id;
- return $obj_idx;
- }
- // Static Calling
- else if ( is_string($function[0]) )
+ } else if (is_object($function[0]) ) {
+ // Object Class Calling
+ if ( function_exists('spl_object_hash') ) {
+ return spl_object_hash($function[0]) . $function[1];
+ } else {
+ $obj_idx = get_class($function[0]).$function[1];
+ if ( !isset($function[0]->wp_filter_id) ) {
+ if ( false === $priority )
+ return false;
+ $obj_idx .= isset($wp_filter[$tag][$priority]) ? count((array)$wp_filter[$tag][$priority]) : $filter_id_count;
+ $function[0]->wp_filter_id = $filter_id_count;
+ ++$filter_id_count;
+ } else {
+ $obj_idx .= $function[0]->wp_filter_id;
+ }
+
+ return $obj_idx;
+ }
+ } else if ( is_string($function[0]) ) {
+ // Static Calling
return $function[0].$function[1];
+ }
}
?>
/**
* Contains Translation_Entry class
*
- * @version $Id: entry.php 115 2009-05-11 18:56:15Z nbachiyski $
+ * @version $Id: entry.php 222 2009-09-07 21:14:23Z nbachiyski $
* @package pomo
* @subpackage entry
*/
-
+if ( !class_exists( 'Translation_Entry' ) ):
/**
* Translation_Entry class encapsulates a translatable string
*/
return is_null($this->context)? $this->singular : $this->context.chr(4).$this->singular;
}
}
-?>
+endif;
\ No newline at end of file
/**
* Class for working with MO files
*
- * @version $Id: mo.php 106 2009-04-23 19:48:22Z nbachiyski $
+ * @version $Id: mo.php 293 2009-11-12 15:43:50Z nbachiyski $
* @package pomo
* @subpackage mo
*/
require_once dirname(__FILE__) . '/translations.php';
require_once dirname(__FILE__) . '/streams.php';
+if ( !class_exists( 'MO' ) ):
class MO extends Gettext_Translations {
var $_nplurals = 2;
* @param string $filename MO file to load
*/
function import_from_file($filename) {
- $reader = new POMO_CachedIntFileReader($filename);
- if (isset($reader->error)) {
+ $reader = new POMO_FileReader($filename);
+ if (!$reader->is_resource())
return false;
- }
return $this->import_from_reader($reader);
}
}
function get_byteorder($magic) {
-
// The magic is 0x950412de
// bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565
$magic_little = (int) - 1794895138;
$magic_little_64 = (int) 2500072158;
// 0xde120495
- $magic_big = ((int) - 569244523) && 0xFFFFFFFF;
-
+ $magic_big = ((int) - 569244523) & 0xFFFFFFFF;
if ($magic_little == $magic || $magic_little_64 == $magic) {
return 'little';
} else if ($magic_big == $magic) {
}
function import_from_reader($reader) {
- $reader->setEndian('little');
- $endian = MO::get_byteorder($reader->readint32());
- if (false === $endian) {
+ $endian_string = MO::get_byteorder($reader->readint32());
+ if (false === $endian_string) {
return false;
}
- $reader->setEndian($endian);
+ $reader->setEndian($endian_string);
+
+ $endian = ('big' == $endian_string)? 'N' : 'V';
+
+ $header = $reader->read(24);
+ if ($reader->strlen($header) != 24)
+ return false;
+
+ // parse header
+ $header = unpack("{$endian}revision/{$endian}total/{$endian}originals_lenghts_addr/{$endian}translations_lenghts_addr/{$endian}hash_length/{$endian}hash_addr", $header);
+ if (!is_array($header))
+ return false;
+
+ extract( $header );
- $revision = $reader->readint32();
- $total = $reader->readint32();
- // get addresses of array of lenghts and offsets for original string and translations
- $originals_lenghts_addr = $reader->readint32();
- $translations_lenghts_addr = $reader->readint32();
+ // support revision 0 of MO format specs, only
+ if ($revision != 0)
+ return false;
+ // seek to data blocks
$reader->seekto($originals_lenghts_addr);
- $originals_lenghts = $reader->readint32array($total * 2); // each of
- $reader->seekto($translations_lenghts_addr);
- $translations_lenghts = $reader->readint32array($total * 2);
-
- $length = create_function('$i', 'return $i * 2 + 1;');
- $offset = create_function('$i', 'return $i * 2 + 2;');
-
- for ($i = 0; $i < $total; ++$i) {
- $reader->seekto($originals_lenghts[$offset($i)]);
- $original = $reader->read($originals_lenghts[$length($i)]);
- $reader->seekto($translations_lenghts[$offset($i)]);
- $translation = $reader->read($translations_lenghts[$length($i)]);
- if ('' == $original) {
+
+ // read originals' indices
+ $originals_lengths_length = $translations_lenghts_addr - $originals_lenghts_addr;
+ if ( $originals_lengths_length != $total * 8 )
+ return false;
+
+ $originals = $reader->read($originals_lengths_length);
+ if ( $reader->strlen( $originals ) != $originals_lengths_length )
+ return false;
+
+ // read translations' indices
+ $translations_lenghts_length = $hash_addr - $translations_lenghts_addr;
+ if ( $translations_lenghts_length != $total * 8 )
+ return false;
+
+ $translations = $reader->read($translations_lenghts_length);
+ if ( $reader->strlen( $translations ) != $translations_lenghts_length )
+ return false;
+
+ // transform raw data into set of indices
+ $originals = $reader->str_split( $originals, 8 );
+ $translations = $reader->str_split( $translations, 8 );
+
+ // skip hash table
+ $strings_addr = $hash_addr + $hash_length * 4;
+
+ $reader->seekto($strings_addr);
+
+ $strings = $reader->read_all();
+ $reader->close();
+
+ for ( $i = 0; $i < $total; $i++ ) {
+ $o = unpack( "{$endian}length/{$endian}pos", $originals[$i] );
+ $t = unpack( "{$endian}length/{$endian}pos", $translations[$i] );
+ if ( !$o || !$t ) return false;
+
+ // adjust offset due to reading strings to separate space before
+ $o['pos'] -= $strings_addr;
+ $t['pos'] -= $strings_addr;
+
+ $original = $reader->substr( $strings, $o['pos'], $o['length'] );
+ $translation = $reader->substr( $strings, $t['pos'], $t['length'] );
+
+ if ('' === $original) {
$this->set_headers($this->make_headers($translation));
} else {
- $this->add_entry($this->make_entry($original, $translation));
+ $entry = &$this->make_entry($original, $translation);
+ $this->entries[$entry->key()] = &$entry;
}
}
return true;
}
/**
+ * Build a Translation_Entry from original string and translation strings,
+ * found in a MO file
+ *
* @static
+ * @param string $original original string to translate from MO file. Might contain
+ * 0x04 as context separator or 0x00 as singular/plural separator
+ * @param string $translation translation string from MO file. Might contain
+ * 0x00 as a plural translations separator
*/
function &make_entry($original, $translation) {
- $args = array();
+ $entry = & new Translation_Entry();
// look for context
$parts = explode(chr(4), $original);
if (isset($parts[1])) {
$original = $parts[1];
- $args['context'] = $parts[0];
+ $entry->context = $parts[0];
}
// look for plural original
$parts = explode(chr(0), $original);
- $args['singular'] = $parts[0];
+ $entry->singular = $parts[0];
if (isset($parts[1])) {
- $args['plural'] = $parts[1];
+ $entry->is_plural = true;
+ $entry->plural = $parts[1];
}
// plural translations are also separated by \0
- $args['translations'] = explode(chr(0), $translation);
- $entry = & new Translation_Entry($args);
+ $entry->translations = explode(chr(0), $translation);
return $entry;
}
function get_plural_forms_count() {
return $this->_nplurals;
}
-
-
}
-?>
+endif;
\ No newline at end of file
/**
* Class for working with PO files
*
- * @version $Id: po.php 123 2009-05-13 19:35:43Z nbachiyski $
+ * @version $Id: po.php 283 2009-09-23 16:21:51Z nbachiyski $
* @package pomo
* @subpackage po
*/
/**
* Routines for working with PO files
*/
+if ( !class_exists( 'PO' ) ):
class PO extends Gettext_Translations {
return false;
}
}
- if (array() == array_filter($entry->translations)) $entry->translations = array();
+ if (array() == array_filter($entry->translations, create_function('$t', 'return $t || "0" === $t;'))) {
+ $entry->translations = array();
+ }
return array('entry' => $entry, 'lineno' => $lineno);
}
return $s;
}
}
-?>
+endif;
\ No newline at end of file
* Classes, which help reading streams of data from files.
* Based on the classes from Danilo Segan <danilo@kvota.net>
*
- * @version $Id: streams.php 138 2009-06-23 13:22:09Z nbachiyski $
+ * @version $Id: streams.php 293 2009-11-12 15:43:50Z nbachiyski $
* @package pomo
* @subpackage streams
*/
-
-/**
- * Provides file-like methods for manipulating a string instead
- * of a physical file.
- */
-class POMO_StringReader {
- var $_pos;
- var $_str;
-
- function POMO_StringReader($str = '') {
- $this->_str = $str;
- $this->_pos = 0;
+if ( !class_exists( 'POMO_Reader' ) ):
+class POMO_Reader {
+
+ var $endian = 'little';
+ var $_post = '';
+
+ function POMO_Reader() {
$this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr');
+ $this->_pos = 0;
+ }
+
+ /**
+ * Sets the endianness of the file.
+ *
+ * @param $endian string 'big' or 'little'
+ */
+ function setEndian($endian) {
+ $this->endian = $endian;
+ }
+
+ /**
+ * Reads a 32bit Integer from the Stream
+ *
+ * @return mixed The integer, corresponding to the next 32 bits from
+ * the stream of false if there are not enough bytes or on error
+ */
+ function readint32() {
+ $bytes = $this->read(4);
+ if (4 != $this->strlen($bytes))
+ return false;
+ $endian_letter = ('big' == $this->endian)? 'N' : 'V';
+ $int = unpack($endian_letter, $bytes);
+ return array_shift($int);
}
- function _substr($string, $start, $length) {
+ /**
+ * Reads an array of 32-bit Integers from the Stream
+ *
+ * @param integer count How many elements should be read
+ * @return mixed Array of integers or false if there isn't
+ * enough data or on error
+ */
+ function readint32array($count) {
+ $bytes = $this->read(4 * $count);
+ if (4*$count != $this->strlen($bytes))
+ return false;
+ $endian_letter = ('big' == $this->endian)? 'N' : 'V';
+ return unpack($endian_letter.$count, $bytes);
+ }
+
+
+ function substr($string, $start, $length) {
if ($this->is_overloaded) {
- return mb_substr($string,$start,$length,'ascii');
+ return mb_substr($string, $start, $length, 'ascii');
} else {
- return substr($string,$start,$length);
+ return substr($string, $start, $length);
}
}
- function _strlen($string) {
+ function strlen($string) {
if ($this->is_overloaded) {
- return mb_strlen($string,'ascii');
+ return mb_strlen($string, 'ascii');
} else {
return strlen($string);
}
}
+
+ function str_split($string, $chunk_size) {
+ if (!function_exists('str_split')) {
+ $length = $this->strlen($string);
+ $out = array();
+ for ($i = 0; $i < $length; $i += $chunk_size)
+ $out[] = $this->substr($string, $i, $chunk_size);
+ return $out;
+ } else {
+ return str_split( $string, $chunk_size );
+ }
+ }
+
+
+ function pos() {
+ return $this->_pos;
+ }
+
+ function is_resource() {
+ return true;
+ }
+
+ function close() {
+ return true;
+ }
+}
+endif;
+
+if ( !class_exists( 'POMO_FileReader' ) ):
+class POMO_FileReader extends POMO_Reader {
+ function POMO_FileReader($filename) {
+ parent::POMO_Reader();
+ $this->_f = fopen($filename, 'r');
+ }
+
+ function read($bytes) {
+ return fread($this->_f, $bytes);
+ }
+
+ function seekto($pos) {
+ if ( -1 == fseek($this->_f, $pos, SEEK_SET)) {
+ return false;
+ }
+ $this->_pos = $pos;
+ return true;
+ }
+
+ function is_resource() {
+ return is_resource($this->_f);
+ }
+
+ function feof() {
+ return feof($this->_f);
+ }
+
+ function close() {
+ return fclose($this->_f);
+ }
+
+ function read_all() {
+ $all = '';
+ while ( !$this->feof() )
+ $all .= $this->read(4096);
+ return $all;
+ }
+}
+endif;
+
+if ( !class_exists( 'POMO_StringReader' ) ):
+/**
+ * Provides file-like methods for manipulating a string instead
+ * of a physical file.
+ */
+class POMO_StringReader extends POMO_Reader {
+
+ var $_str = '';
+
+ function POMO_StringReader($str = '') {
+ parent::POMO_Reader();
+ $this->_str = $str;
+ $this->_pos = 0;
+ }
+
function read($bytes) {
- $data = $this->_substr($this->_str, $this->_pos, $bytes);
+ $data = $this->substr($this->_str, $this->_pos, $bytes);
$this->_pos += $bytes;
- if ($this->_strlen($this->_str) < $this->_pos) $this->_pos = $this->_strlen($this->_str);
+ if ($this->strlen($this->_str) < $this->_pos) $this->_pos = $this->strlen($this->_str);
return $data;
}
function seekto($pos) {
$this->_pos = $pos;
- if ($this->_strlen($this->_str) < $this->_pos) $this->_pos = $this->_strlen($this->_str);
- return $this->_pos;
- }
-
- function pos() {
+ if ($this->strlen($this->_str) < $this->_pos) $this->_pos = $this->strlen($this->_str);
return $this->_pos;
}
function length() {
- return $this->_strlen($this->_str);
+ return $this->strlen($this->_str);
}
+ function read_all() {
+ return $this->substr($this->_str, $this->_pos, $this->strlen($this->_str));
+ }
+
}
+endif;
+if ( !class_exists( 'POMO_CachedFileReader' ) ):
/**
* Reads the contents of the file in the beginning.
*/
$this->_pos = 0;
}
}
+endif;
+if ( !class_exists( 'POMO_CachedIntFileReader' ) ):
/**
- * Allows reading integers from a file.
+ * Reads the contents of the file in the beginning.
*/
class POMO_CachedIntFileReader extends POMO_CachedFileReader {
-
- var $endian = 'little';
-
- /**
- * Opens a file and caches it.
- *
- * @param $filename string name of the file to be opened
- * @param $endian string endianness of the words in the file, allowed
- * values are 'little' or 'big'. Default value is 'little'
- */
- function POMO_CachedIntFileReader($filename, $endian = 'little') {
- $this->endian = $endian;
+ function POMO_CachedIntFileReader($filename) {
parent::POMO_CachedFileReader($filename);
}
-
- /**
- * Sets the endianness of the file.
- *
- * @param $endian string 'big' or 'little'
- */
- function setEndian($endian) {
- $this->endian = $endian;
- }
-
- /**
- * Reads a 32bit Integer from the Stream
- *
- * @return mixed The integer, corresponding to the next 32 bits from
- * the stream of false if there are not enough bytes or on error
- */
- function readint32() {
- $bytes = $this->read(4);
- if (4 != $this->_strlen($bytes))
- return false;
- $endian_letter = ('big' == $this->endian)? 'N' : 'V';
- $int = unpack($endian_letter, $bytes);
- return array_shift($int);
- }
-
- /**
- * Reads an array of 32-bit Integers from the Stream
- *
- * @param integer count How many elements should be read
- * @return mixed Array of integers or false if there isn't
- * enough data or on error
- */
- function readint32array($count) {
- $bytes = $this->read(4 * $count);
- if (4*$count != $this->_strlen($bytes))
- return false;
- $endian_letter = ('big' == $this->endian)? 'N' : 'V';
- return unpack($endian_letter.$count, $bytes);
- }
}
-
-?>
+endif;
\ No newline at end of file
/**
* Class for a set of entries for translation and their associated headers
*
- * @version $Id: translations.php 114 2009-05-11 17:30:38Z nbachiyski $
+ * @version $Id: translations.php 291 2009-10-21 05:46:08Z nbachiyski $
* @package pomo
* @subpackage translations
*/
require_once dirname(__FILE__) . '/entry.php';
+if ( !class_exists( 'Translations' ) ):
class Translations {
var $entries = array();
var $headers = array();
}
$key = $entry->key();
if (false === $key) return false;
- $this->entries[$key] = $entry;
+ $this->entries[$key] = &$entry;
return true;
}
*/
function gettext_select_plural_form($count) {
if (!isset($this->_gettext_select_plural_form) || is_null($this->_gettext_select_plural_form)) {
- $plural_header = $this->get_header('Plural-Forms');
- $this->_gettext_select_plural_form = $this->_make_gettext_select_plural_form($plural_header);
+ list( $nplurals, $expression ) = $this->nplurals_and_expression_from_header($this->get_header('Plural-Forms'));
+ $this->_nplurals = $nplurals;
+ $this->_gettext_select_plural_form = $this->make_plural_form_function($nplurals, $expression);
}
return call_user_func($this->_gettext_select_plural_form, $count);
}
+
+ function nplurals_and_expression_from_header($header) {
+ if (preg_match('/^\s*nplurals\s*=\s*(\d+)\s*;\s+plural\s*=\s*(.+)$/', $header, $matches)) {
+ $nplurals = (int)$matches[1];
+ $expression = trim($this->parenthesize_plural_exression($matches[2]));
+ return array($nplurals, $expression);
+ } else {
+ return array(2, 'n != 1');
+ }
+ }
/**
* Makes a function, which will return the right translation index, according to the
* plural forms header
*/
- function _make_gettext_select_plural_form($plural_header) {
- $res = create_function('$count', 'return 1 == $count? 0 : 1;');
- if ($plural_header && (preg_match('/^\s*nplurals\s*=\s*(\d+)\s*;\s+plural\s*=\s*(.+)$/', $plural_header, $matches))) {
- $nplurals = (int)$matches[1];
- $this->_nplurals = $nplurals;
- $plural_expr = trim($this->_parenthesize_plural_exression($matches[2]));
- $plural_expr = str_replace('n', '$n', $plural_expr);
- $func_body = "
- \$index = (int)($plural_expr);
- return (\$index < $nplurals)? \$index : $nplurals - 1;";
- $res = create_function('$n', $func_body);
- }
- return $res;
+ function make_plural_form_function($nplurals, $expression) {
+ $expression = str_replace('n', '$n', $expression);
+ $func_body = "
+ \$index = (int)($expression);
+ return (\$index < $nplurals)? \$index : $nplurals - 1;";
+ return create_function('$n', $func_body);
}
/**
* @param string $expression the expression without parentheses
* @return string the expression with parentheses added
*/
- function _parenthesize_plural_exression($expression) {
+ function parenthesize_plural_exression($expression) {
$expression .= ';';
$res = '';
$depth = 0;
}
return $headers;
}
-
+
function set_header($header, $value) {
parent::set_header($header, $value);
- if ('Plural-Forms' == $header)
- $this->_gettext_select_plural_form = $this->_make_gettext_select_plural_form($value);
+ if ('Plural-Forms' == $header) {
+ list( $nplurals, $expression ) = $this->nplurals_and_expression_from_header($this->get_header('Plural-Forms'));
+ $this->_nplurals = $nplurals;
+ $this->_gettext_select_plural_form = $this->make_plural_form_function($nplurals, $expression);
+ }
}
+}
+endif;
+if ( !class_exists( 'NOOP_Translations' ) ):
+/**
+ * Provides the same interface as Translations, but doesn't do anything
+ */
+class NOOP_Translations {
+ var $entries = array();
+ var $headers = array();
-}
+ function add_entry($entry) {
+ return true;
+ }
+
+ function set_header($header, $value) {
+ }
-?>
+ function set_headers(&$headers) {
+ }
+
+ function get_header($header) {
+ return false;
+ }
+
+ function translate_entry(&$entry) {
+ return false;
+ }
+
+ function translate($singular, $context=null) {
+ return $singular;
+ }
+
+ function select_plural_form($count) {
+ return 1 == $count? 0 : 1;
+ }
+
+ function get_plural_forms_count() {
+ return 2;
+ }
+
+ function translate_plural($singular, $plural, $count, $context = null) {
+ return 1 == $count? $singular : $plural;
+ }
+
+ function merge_with(&$other) {
+ }
+}
+endif;
*
* @param string $more_link_text Optional. Content for when there is more text.
* @param string $stripteaser Optional. Teaser content before the more text.
- * @param string $more_file Optional. Not used.
*/
-function the_content($more_link_text = null, $stripteaser = 0, $more_file = '') {
- $content = get_the_content($more_link_text, $stripteaser, $more_file);
+function the_content($more_link_text = null, $stripteaser = 0) {
+ $content = get_the_content($more_link_text, $stripteaser);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo $content;
*
* @param string $more_link_text Optional. Content for when there is more text.
* @param string $stripteaser Optional. Teaser content before the more text.
- * @param string $more_file Optional. Not used.
* @return string
*/
-function get_the_content($more_link_text = null, $stripteaser = 0, $more_file = '') {
+function get_the_content($more_link_text = null, $stripteaser = 0) {
global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow;
if ( null === $more_link_text )
return $output;
}
- if ( $more_file != '' )
- $file = $more_file;
- else
- $file = $pagenow; //$_SERVER['PHP_SELF'];
-
if ( $page > count($pages) ) // if the requested page doesn't exist
$page = count($pages); // give them the highest numbered page that DOES exist
*/
function get_the_excerpt($deprecated = '') {
global $post;
- $output = '';
$output = $post->post_excerpt;
if ( post_password_required($post) ) {
$output = __('There is no excerpt because this is a protected post.');
$classes = array();
+ if ( empty($post) )
+ return $classes;
+
$classes[] = 'post-' . $post->ID;
$classes[] = $post->post_type;
if ( is_author() ) {
$author = $wp_query->get_queried_object();
$classes[] = 'author';
- $classes[] = 'author-' . sanitize_html_class($author->user_nicename , $author->user_id);
+ $classes[] = 'author-' . sanitize_html_class($author->user_nicename , $author->ID);
} elseif ( is_category() ) {
$cat = $wp_query->get_queried_object();
$classes[] = 'category';
* each bookmarks.
* 'after' - Default is '</p>' (string). The html or text to append to each
* bookmarks.
- * 'more_file' - Default is '' (string) Page the links should point to. Defaults
- * to the current page.
* 'link_before' - Default is '' (string). The html or text to prepend to each
* Pages link inside the <a> tag.
* 'link_after' - Default is '' (string). The html or text to append to each
'link_before' => '', 'link_after' => '',
'next_or_number' => 'number', 'nextpagelink' => __('Next page'),
'previouspagelink' => __('Previous page'), 'pagelink' => '%',
- 'more_file' => '', 'echo' => 1
+ 'echo' => 1
);
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
global $post, $page, $numpages, $multipage, $more, $pagenow;
- if ( $more_file != '' )
- $file = $more_file;
- else
- $file = $pagenow;
$output = '';
if ( $multipage ) {
'child_of' => 0, 'exclude' => '',
'title_li' => __('Pages'), 'echo' => 1,
'authors' => '', 'sort_column' => 'menu_order, post_title',
- 'link_before' => '', 'link_after' => ''
+ 'link_before' => '', 'link_after' => '', 'walker' => '',
);
$r = wp_parse_args( $args, $defaults );
// sanitize, mostly to keep spaces out
$r['exclude'] = preg_replace('/[^0-9,]/', '', $r['exclude']);
- // Allow plugins to filter an array of excluded pages
- $r['exclude'] = implode(',', apply_filters('wp_list_pages_excludes', explode(',', $r['exclude'])));
+ // Allow plugins to filter an array of excluded pages (but don't put a nullstring into the array)
+ $exclude_array = ( $r['exclude'] ) ? explode(',', $r['exclude']) : array();
+ $r['exclude'] = implode( ',', apply_filters('wp_list_pages_excludes', $exclude_array) );
// Query pages.
$r['hierarchical'] = 0;
$output .= '</ul></li>';
}
- $output = apply_filters('wp_list_pages', $output);
+ $output = apply_filters('wp_list_pages', $output, $r);
if ( $r['echo'] )
echo $output;
$class = '';
if ( is_front_page() && !is_paged() )
$class = 'class="current_page_item"';
- $menu .= '<li ' . $class . '><a href="' . get_option('home') . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
+ $menu .= '<li ' . $class . '><a href="' . get_option('home') . '" title="' . esc_attr($text) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
// If the front page is a page, add it to the exclude list
if (get_option('show_on_front') == 'page') {
if ( !empty( $list_args['exclude'] ) ) {
--- /dev/null
+<?php
+/**
+ * WordPress Post Thumbnail Template Functions.
+ *
+ * Support for post thumbnails
+ * Themes function.php must call add_theme_support( 'post-thumbnails' ) to use these.
+ *
+ * @package WordPress
+ * @subpackage Template
+ */
+
+/**
+ * Check if post has an image attached.
+ *
+ * @since 2.9.0
+ *
+ * @param int $post_id Optional. Post ID.
+ * @return bool Whether post has an image attached (true) or not (false).
+ */
+function has_post_thumbnail( $post_id = NULL ) {
+ global $id;
+ $post_id = ( NULL === $post_id ) ? $id : $post_id;
+ return !! get_post_thumbnail_id( $post_id );
+}
+
+/**
+ * Retrieve Post Thumbnail ID.
+ *
+ * @since 2.9.0
+ *
+ * @param int $post_id Optional. Post ID.
+ * @return int
+ */
+function get_post_thumbnail_id( $post_id = NULL ) {
+ global $id;
+ $post_id = ( NULL === $post_id ) ? $id : $post_id;
+ return get_post_meta( $post_id, '_thumbnail_id', true );
+}
+
+/**
+ * Display Post Thumbnail.
+ *
+ * @since 2.9.0
+ *
+ * @param int $size Optional. Image size. Defaults to 'post-thumbnail', which theme sets using set_post_thumbnail_size( $width, $height, $crop_flag );.
+ * @param string|array $attr Optional. Query string or array of attributes.
+ */
+function the_post_thumbnail( $size = 'post-thumbnail', $attr = '' ) {
+ echo get_the_post_thumbnail( NULL, $size, $attr );
+}
+
+/**
+ * Retrieve Post Thumbnail.
+ *
+ * @since 2.9.0
+ *
+ * @param int $post_id Optional. Post ID.
+ * @param string $size Optional. Image size. Defaults to 'thumbnail'.
+ * @param string|array $attr Optional. Query string or array of attributes.
+ */
+function get_the_post_thumbnail( $post_id = NULL, $size = 'post-thumbnail', $attr = '' ) {
+ global $id;
+ $post_id = ( NULL === $post_id ) ? $id : $post_id;
+ $post_thumbnail_id = get_post_thumbnail_id( $post_id );
+ $size = apply_filters( 'post_thumbnail_size', $size );
+ if ( $post_thumbnail_id ) {
+ do_action( 'begin_fetch_post_thumbnail_html', $post_id, $post_thumbnail_id, $size ); // for "Just In Time" filtering of all of wp_get_attachment_image()'s filters
+ $html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr );
+ do_action( 'end_fetch_post_thumbnail_html', $post_id, $post_thumbnail_id, $size );
+ } else {
+ $html = '';
+ }
+ return apply_filters( 'post_thumbnail_html', $html, $post_id, $post_thumbnail_id, $size, $attr );
+}
+
+?>
\ No newline at end of file
* @since 1.5.0
*/
+//
+// Post Type Registration
+//
+
+/**
+ * Creates the initial post types when 'init' action is fired.
+ */
+function create_initial_post_types() {
+ register_post_type( 'post', array('exclude_from_search' => false) );
+ register_post_type( 'page', array('exclude_from_search' => false) );
+ register_post_type( 'attachment', array('exclude_from_search' => false) );
+ register_post_type( 'revision', array('exclude_from_search' => true) );
+}
+add_action( 'init', 'create_initial_post_types', 0 ); // highest priority
+
/**
* Retrieve attached file path based on attachment ID.
*
return false;
$file = apply_filters( 'update_attached_file', $file, $attachment_id );
+ $file = _wp_relative_upload_path($file);
+
+ return update_post_meta( $attachment_id, '_wp_attached_file', $file );
+}
+
+/**
+ * Return relative path to an uploaded file.
+ *
+ * The path is relative to the current upload dir.
+ *
+ * @since 2.9
+ * @uses apply_filters() Calls '_wp_relative_upload_path' on file path.
+ *
+ * @param string $path Full path to the file
+ * @return string relative path on success, unchanged path on failure.
+ */
+function _wp_relative_upload_path( $path ) {
+ $new_path = $path;
- // Make the file path relative to the upload dir
- if ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) { // Get upload directory
- if ( 0 === strpos($file, $uploads['basedir']) ) {// Check that the upload base exists in the file path
- $file = str_replace($uploads['basedir'], '', $file); // Remove upload dir from the file path
- $file = ltrim($file, '/');
+ if ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) {
+ if ( 0 === strpos($new_path, $uploads['basedir']) ) {
+ $new_path = str_replace($uploads['basedir'], '', $new_path);
+ $new_path = ltrim($new_path, '/');
}
}
- return update_post_meta( $attachment_id, '_wp_attached_file', $file );
+ return apply_filters( '_wp_relative_upload_path', $new_path, $path );
}
/**
* @return array|bool False on failure and the type will be determined by $output parameter.
*/
function &get_children($args = '', $output = OBJECT) {
+ $kids = array();
if ( empty( $args ) ) {
if ( isset( $GLOBALS['post'] ) ) {
$args = array('post_parent' => (int) $GLOBALS['post']->post_parent );
} else {
- return false;
+ return $kids;
}
} elseif ( is_object( $args ) ) {
$args = array('post_parent' => (int) $args->post_parent );
$r = wp_parse_args( $args, $defaults );
$children = get_posts( $r );
- if ( !$children ) {
- $kids = false;
+
+ if ( !$children )
return $kids;
- }
update_post_cache($children);
return $null;
} elseif ( is_object($post) && empty($post->filter) ) {
_get_post_ancestors($post);
- wp_cache_add($post->ID, $post, 'posts');
- $_post = &$post;
+ $_post = sanitize_post($post, 'raw');
+ wp_cache_add($post->ID, $_post, 'posts');
} else {
if ( is_object($post) )
$post = $post->ID;
if ( ! $_post )
return $null;
_get_post_ancestors($_post);
+ $_post = sanitize_post($_post, 'raw');
wp_cache_add($_post->ID, $_post, 'posts');
}
}
- $_post = sanitize_post($_post, $filter);
+ if ($filter != 'raw')
+ $_post = sanitize_post($_post, $filter);
if ( $output == OBJECT ) {
return $_post;
return false;
}
+/**
+ * Get a list of all registered post type objects.
+ *
+ * @package WordPress
+ * @subpackage Post
+ * @since 2.9.0
+ * @uses $wp_post_types
+ * @see register_post_type
+ * @see get_post_types
+ *
+ * @param array|string $args An array of key => value arguments to match against the post types.
+ * Only post types having attributes that match all arguments are returned.
+ * @param string $output The type of output to return, either post type 'names' or 'objects'. 'names' is the default.
+ * @return array A list of post type names or objects
+ */
+function get_post_types( $args = array(), $output = 'names' ) {
+ global $wp_post_types;
+
+ $do_names = false;
+ if ( 'names' == $output )
+ $do_names = true;
+
+ $post_types = array();
+ foreach ( (array) $wp_post_types as $post_type ) {
+ if ( empty($args) ) {
+ if ( $do_names )
+ $post_types[] = $post_type->name;
+ else
+ $post_types[] = $post_type;
+ } elseif ( array_intersect_assoc((array) $post_type, $args) ) {
+ if ( $do_names )
+ $post_types[] = $post_type->name;
+ else
+ $post_types[] = $post_type;
+ }
+ }
+
+ return $post_types;
+}
+
+/**
+ * Register a post type. Do not use before init.
+ *
+ * A simple function for creating or modifying a post type based on the
+ * parameters given. The function will accept an array (second optional
+ * parameter), along with a string for the post type name.
+ *
+ *
+ * Optional $args contents:
+ *
+ * exclude_from_search - Whether to exclude posts with this post type from search results. Defaults to true.
+ *
+ * @package WordPress
+ * @subpackage Post
+ * @since 2.9.0
+ * @uses $wp_post_types Inserts new post type object into the list
+ *
+ * @param string $post_type Name of the post type.
+ * @param array|string $args See above description.
+ */
+function register_post_type($post_type, $args = array()) {
+ global $wp_post_types;
+
+ if (!is_array($wp_post_types))
+ $wp_post_types = array();
+
+ $defaults = array('exclude_from_search' => true);
+ $args = wp_parse_args($args, $defaults);
+
+ $post_type = sanitize_user($post_type, true);
+ $args['name'] = $post_type;
+ $wp_post_types[$post_type] = (object) $args;
+}
+
/**
* Updates the post type for the post ID.
*
* @return bool False for failure. True for success.
*/
function add_post_meta($post_id, $meta_key, $meta_value, $unique = false) {
- if ( !$meta_key )
- return false;
-
- global $wpdb;
-
// make sure meta is added to the post, not a revision
if ( $the_post = wp_is_post_revision($post_id) )
$post_id = $the_post;
- // expected_slashed ($meta_key)
- $meta_key = stripslashes($meta_key);
-
- if ( $unique && $wpdb->get_var( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d", $meta_key, $post_id ) ) )
- return false;
-
- $meta_value = maybe_serialize( stripslashes_deep($meta_value) );
-
- $wpdb->insert( $wpdb->postmeta, compact( 'post_id', 'meta_key', 'meta_value' ) );
-
- wp_cache_delete($post_id, 'post_meta');
-
- return true;
+ return add_metadata('post', $post_id, $meta_key, $meta_value, $unique);
}
/**
* @return bool False for failure. True for success.
*/
function delete_post_meta($post_id, $meta_key, $meta_value = '') {
- global $wpdb;
-
// make sure meta is added to the post, not a revision
if ( $the_post = wp_is_post_revision($post_id) )
$post_id = $the_post;
- // expected_slashed ($meta_key, $meta_value)
- $meta_key = stripslashes( $meta_key );
- $meta_value = maybe_serialize( stripslashes_deep($meta_value) );
-
- if ( !$meta_key )
- return false;
-
- if ( empty( $meta_value ) )
- $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta_key ) );
- else
- $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s AND meta_value = %s", $post_id, $meta_key, $meta_value ) );
-
- if ( !$meta_id )
- return false;
-
- if ( empty( $meta_value ) )
- $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post_id, $meta_key ) );
- else
- $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s AND meta_value = %s", $post_id, $meta_key, $meta_value ) );
-
- wp_cache_delete($post_id, 'post_meta');
-
- return true;
+ return delete_metadata('post', $post_id, $meta_key, $meta_value);
}
/**
* is true.
*/
function get_post_meta($post_id, $key, $single = false) {
- if ( !$key )
- return '';
-
- $post_id = (int) $post_id;
-
- $meta_cache = wp_cache_get($post_id, 'post_meta');
-
- if ( !$meta_cache ) {
- update_postmeta_cache($post_id);
- $meta_cache = wp_cache_get($post_id, 'post_meta');
- }
-
- if ( isset($meta_cache[$key]) ) {
- if ( $single ) {
- return maybe_unserialize( $meta_cache[$key][0] );
- } else {
- return array_map('maybe_unserialize', $meta_cache[$key]);
- }
- }
-
- return '';
+ return get_metadata('post', $post_id, $key, $single);
}
/**
* @return bool False on failure, true if success.
*/
function update_post_meta($post_id, $meta_key, $meta_value, $prev_value = '') {
- global $wpdb;
-
// make sure meta is added to the post, not a revision
if ( $the_post = wp_is_post_revision($post_id) )
$post_id = $the_post;
- // expected_slashed ($meta_key)
- $meta_key = stripslashes($meta_key);
-
- if ( !$meta_key )
- return false;
-
- if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key = %s AND post_id = %d", $meta_key, $post_id ) ) ) {
- return add_post_meta($post_id, $meta_key, $meta_value);
- }
-
- $meta_value = maybe_serialize( stripslashes_deep($meta_value) );
-
- $data = compact( 'meta_value' );
- $where = compact( 'meta_key', 'post_id' );
-
- if ( !empty( $prev_value ) ) {
- $prev_value = maybe_serialize($prev_value);
- $where['meta_value'] = $prev_value;
- }
-
- $wpdb->update( $wpdb->postmeta, $data, $where );
- wp_cache_delete($post_id, 'post_meta');
- return true;
+ return update_metadata('post', $post_id, $meta_key, $meta_value, $prev_value);
}
/**
global $wpdb;
$post_ids = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT post_id FROM $wpdb->postmeta WHERE meta_key = %s", $post_meta_key));
if ( $post_ids ) {
- $wpdb->query($wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_key = %s", $post_meta_key));
+ $postmetaids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = %s", $post_meta_key ) );
+ $in = implode( ',', array_fill(1, count($postmetaids), '%d'));
+ do_action( 'delete_postmeta', $postmetaids );
+ $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id IN($in)", $postmetaids ));
+ do_action( 'deleted_postmeta', $postmetaids );
foreach ( $post_ids as $post_id )
wp_cache_delete($post_id, 'post_meta');
return true;
*/
function sanitize_post($post, $context = 'display') {
if ( is_object($post) ) {
+ // Check if post already filtered for this context
+ if ( isset($post->filter) && $context == $post->filter )
+ return $post;
if ( !isset($post->ID) )
$post->ID = 0;
foreach ( array_keys(get_object_vars($post)) as $field )
$post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context);
$post->filter = $context;
} else {
+ // Check if post already filtered for this context
+ if ( isset($post['filter']) && $context == $post['filter'] )
+ return $post;
if ( !isset($post['ID']) )
$post['ID'] = 0;
foreach ( array_keys($post) as $field )
$count = $wpdb->get_results( $wpdb->prepare( $query, $type ), ARRAY_A );
- $stats = array( 'publish' => 0, 'private' => 0, 'draft' => 0, 'pending' => 0, 'future' => 0 );
+ $stats = array( 'publish' => 0, 'private' => 0, 'draft' => 0, 'pending' => 0, 'future' => 0, 'trash' => 0 );
foreach( (array) $count as $row_num => $row ) {
$stats[$row['post_status']] = $row['num_posts'];
}
global $wpdb;
$and = wp_post_mime_type_where( $mime_type );
- $count = $wpdb->get_results( "SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb->posts WHERE post_type = 'attachment' $and GROUP BY post_mime_type", ARRAY_A );
+ $count = $wpdb->get_results( "SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' $and GROUP BY post_mime_type", ARRAY_A );
$stats = array( );
foreach( (array) $count as $row ) {
$stats[$row['post_mime_type']] = $row['num_posts'];
}
+ $stats['trash'] = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status = 'trash' $and");
return (object) $stats;
}
* @uses wp_delete_attachment() if post type is 'attachment'.
*
* @param int $postid Post ID.
+ * @param bool $force_delete Whether to bypass trash and force deletion
* @return mixed False on failure
*/
-function wp_delete_post($postid = 0) {
+function wp_delete_post( $postid = 0, $force_delete = false ) {
global $wpdb, $wp_rewrite;
if ( !$post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d", $postid)) )
return $post;
- if ( 'attachment' == $post->post_type )
- return wp_delete_attachment($postid);
+ if ( !$force_delete && ( $post->post_type == 'post' || $post->post_type == 'page') && get_post_status( $postid ) != 'trash' && EMPTY_TRASH_DAYS > 0 )
+ return wp_trash_post($postid);
+
+ if ( $post->post_type == 'attachment' )
+ return wp_delete_attachment( $postid, $force_delete );
do_action('delete_post', $postid);
- /** @todo delete for pluggable post taxonomies too */
- wp_delete_object_term_relationships($postid, array('category', 'post_tag'));
+ delete_post_meta($postid,'_wp_trash_meta_status');
+ delete_post_meta($postid,'_wp_trash_meta_time');
+
+ wp_delete_object_term_relationships($postid, get_object_taxonomies($post->post_type));
$parent_data = array( 'post_parent' => $post->post_parent );
$parent_where = array( 'post_parent' => $postid );
// Point all attachments to this post up one level
$wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'attachment' ) );
- $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->comments WHERE comment_post_ID = %d", $postid ));
+ $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $postid ));
+ if ( ! empty($comment_ids) ) {
+ do_action( 'delete_comment', $comment_ids );
+ $in_comment_ids = "'" . implode("', '", $comment_ids) . "'";
+ $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_ID IN($in_comment_ids)" );
+ do_action( 'deleted_comment', $comment_ids );
+ }
- $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d", $postid ));
+ $post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d ", $postid ));
+ if ( !empty($post_meta_ids) ) {
+ do_action( 'delete_postmeta', $post_meta_ids );
+ $in_post_meta_ids = "'" . implode("', '", $post_meta_ids) . "'";
+ $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_id IN($in_post_meta_ids)" );
+ do_action( 'deleted_postmeta', $post_meta_ids );
+ }
+ do_action( 'delete_post', $postid );
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->posts WHERE ID = %d", $postid ));
+ do_action( 'deleted_post', $postid );
if ( 'page' == $post->post_type ) {
clean_page_cache($postid);
return $post;
}
+/**
+ * Moves a post or page to the Trash
+ *
+ * @since 2.9.0
+ * @uses do_action() on 'trash_post' before trashing
+ * @uses do_action() on 'trashed_post' after trashing
+ *
+ * @param int $postid Post ID.
+ * @return mixed False on failure
+ */
+function wp_trash_post($post_id = 0) {
+ if ( EMPTY_TRASH_DAYS == 0 )
+ return wp_delete_post($post_id);
+
+ if ( !$post = wp_get_single_post($post_id, ARRAY_A) )
+ return $post;
+
+ if ( $post['post_status'] == 'trash' )
+ return false;
+
+ do_action('trash_post', $post_id);
+
+ add_post_meta($post_id,'_wp_trash_meta_status', $post['post_status']);
+ add_post_meta($post_id,'_wp_trash_meta_time', time());
+
+ $post['post_status'] = 'trash';
+ wp_insert_post($post);
+
+ wp_trash_post_comments($post_id);
+
+ do_action('trashed_post', $post_id);
+
+ return $post;
+}
+
+/**
+ * Restores a post or page from the Trash
+ *
+ * @since 2.9.0
+ * @uses do_action() on 'untrash_post' before undeletion
+ * @uses do_action() on 'untrashed_post' after undeletion
+ *
+ * @param int $postid Post ID.
+ * @return mixed False on failure
+ */
+function wp_untrash_post($post_id = 0) {
+ if ( !$post = wp_get_single_post($post_id, ARRAY_A) )
+ return $post;
+
+ if ( $post['post_status'] != 'trash' )
+ return false;
+
+ do_action('untrash_post', $post_id);
+
+ $post_status = get_post_meta($post_id, '_wp_trash_meta_status', true);
+
+ $post['post_status'] = $post_status;
+
+ delete_post_meta($post_id, '_wp_trash_meta_status');
+ delete_post_meta($post_id, '_wp_trash_meta_time');
+
+ wp_insert_post($post);
+
+ wp_untrash_post_comments($post_id);
+
+ do_action('untrashed_post', $post_id);
+
+ return $post;
+}
+
+/**
+ * Moves comments for a post to the trash
+ *
+ * @since 2.9.0
+ * @uses do_action() on 'trash_post_comments' before trashing
+ * @uses do_action() on 'trashed_post_comments' after trashing
+ *
+ * @param int $post Post ID or object.
+ * @return mixed False on failure
+ */
+function wp_trash_post_comments($post = null) {
+ global $wpdb;
+
+ $post = get_post($post);
+ if ( empty($post) )
+ return;
+
+ $post_id = $post->ID;
+
+ do_action('trash_post_comments', $post_id);
+
+ $comments = $wpdb->get_results( $wpdb->prepare("SELECT comment_ID, comment_approved FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id) );
+ if ( empty($comments) )
+ return;
+
+ // Cache current status for each comment
+ $statuses = array();
+ foreach ( $comments as $comment )
+ $statuses[$comment->comment_ID] = $comment->comment_approved;
+ add_post_meta($post_id, '_wp_trash_meta_comments_status', $statuses);
+
+ // Set status for all comments to post-trashed
+ $result = $wpdb->update($wpdb->comments, array('comment_approved' => 'post-trashed'), array('comment_post_ID' => $post_id));
+
+ clean_comment_cache( array_keys($statuses) );
+
+ do_action('trashed_post_comments', $post_id, $statuses);
+
+ return $result;
+}
+
+/**
+ * Restore comments for a post from the trash
+ *
+ * @since 2.9.0
+ * @uses do_action() on 'untrash_post_comments' before trashing
+ * @uses do_action() on 'untrashed_post_comments' after trashing
+ *
+ * @param int $post Post ID or object.
+ * @return mixed False on failure
+ */
+function wp_untrash_post_comments($post = null) {
+ global $wpdb;
+
+ $post = get_post($post);
+ if ( empty($post) )
+ return;
+
+ $post_id = $post->ID;
+
+ $statuses = get_post_meta($post_id, '_wp_trash_meta_comments_status', true);
+
+ if ( empty($statuses) )
+ return true;
+
+ do_action('untrash_post_comments', $post_id);
+
+ // Restore each comment to its original status
+ $group_by_status = array();
+ foreach ( $statuses as $comment_id => $comment_status )
+ $group_by_status[$comment_status][] = $comment_id;
+
+ foreach ( $group_by_status as $status => $comments ) {
+ // Sanity check. This shouldn't happen.
+ if ( 'post-trashed' == $status )
+ $status = '0';
+ $comments_in = implode( "', '", $comments );
+ $wpdb->query( "UPDATE $wpdb->comments SET comment_approved = '$status' WHERE comment_ID IN ('" . $comments_in . "')" );
+ }
+
+ clean_comment_cache( array_keys($statuses) );
+
+ delete_post_meta($post_id, '_wp_trash_meta_comments_status');
+
+ do_action('untrashed_post_comments', $post_id);
+}
+
/**
* Retrieve the list of categories for a post.
*
// Set the limit clause, if we got a limit
$num = (int) $num;
- if ($num) {
+ if ( $num ) {
$limit = "LIMIT $num";
}
- $sql = "SELECT * FROM $wpdb->posts WHERE post_type = 'post' ORDER BY post_date DESC $limit";
- $result = $wpdb->get_results($sql,ARRAY_A);
+ $sql = "SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND post_status IN ( 'draft', 'publish', 'future', 'pending', 'private' ) ORDER BY post_date DESC $limit";
+ $result = $wpdb->get_results($sql, ARRAY_A);
return $result ? $result : array();
}
$previous_status = 'new';
}
- if ( ('' == $post_content) && ('' == $post_title) && ('' == $post_excerpt) ) {
+ if ( ('' == $post_content) && ('' == $post_title) && ('' == $post_excerpt) && ('attachment' != $post_type) ) {
if ( $wp_error )
return new WP_Error('empty_content', __('Content, title, and excerpt are empty.'));
else
/**
* Given the desired slug and some post details computes a unique slug for the post.
*
+ * @global wpdb $wpdb
+ * @global WP_Rewrite $wp_rewrite
* @param string $slug the desired slug (post_name)
* @param integer $post_ID
* @param string $post_status no uniqueness checks are made if the post is still draft or pending
function wp_unique_post_slug($slug, $post_ID, $post_status, $post_type, $post_parent) {
if ( in_array( $post_status, array( 'draft', 'pending' ) ) )
return $slug;
-
+
global $wpdb, $wp_rewrite;
+
+ $feeds = $wp_rewrite->feeds;
+ if ( !is_array($feeds) )
+ $feeds = array();
+
$hierarchical_post_types = apply_filters('hierarchical_post_types', array('page'));
if ( 'attachment' == $post_type ) {
// Attachment slugs must be unique across all types.
$check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND ID != %d LIMIT 1";
$post_name_check = $wpdb->get_var($wpdb->prepare($check_sql, $slug, $post_ID));
-
- if ( $post_name_check || in_array($slug, $wp_rewrite->feeds) ) {
+
+ if ( $post_name_check || in_array($slug, $feeds) ) {
$suffix = 2;
do {
$alt_post_name = substr($slug, 0, 200-(strlen($suffix)+1)). "-$suffix";
} elseif ( in_array($post_type, $hierarchical_post_types) ) {
// Page slugs must be unique within their own trees. Pages are in a
// separate namespace than posts so page slugs are allowed to overlap post slugs.
- $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . implode("', '", $wpdb->escape($hierarchical_post_types)) . "' ) AND ID != %d AND post_parent = %d LIMIT 1";
+ $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . implode("', '", esc_sql($hierarchical_post_types)) . "' ) AND ID != %d AND post_parent = %d LIMIT 1";
$post_name_check = $wpdb->get_var($wpdb->prepare($check_sql, $slug, $post_ID, $post_parent));
-
- if ( $post_name_check || in_array($slug, $wp_rewrite->feeds) ) {
+
+ if ( $post_name_check || in_array($slug, $feeds) ) {
$suffix = 2;
do {
$alt_post_name = substr($slug, 0, 200-(strlen($suffix)+1)). "-$suffix";
// Post slugs must be unique across all posts.
$check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1";
$post_name_check = $wpdb->get_var($wpdb->prepare($check_sql, $slug, $post_type, $post_ID));
-
+
if ( $post_name_check || in_array($slug, $wp_rewrite->feeds) ) {
$suffix = 2;
do {
*/
function &get_page(&$page, $output = OBJECT, $filter = 'raw') {
if ( empty($page) ) {
- if ( isset( $GLOBALS['page'] ) && isset( $GLOBALS['page']->ID ) ) {
- return get_post($GLOBALS['page'], $output, $filter);
+ if ( isset( $GLOBALS['post'] ) && isset( $GLOBALS['post']->ID ) ) {
+ return get_post($GLOBALS['post'], $output, $filter);
} else {
$page = null;
return $page;
/**
* Order the pages with children under parents in a flat list.
*
+ * It uses auxiliary structure to hold parent-children relationships and
+ * runs in O(N) complexity
+ *
* @since 2.0.0
*
* @param array $posts Posts array.
* @param int $parent Parent page ID.
* @return array A list arranged by hierarchy. Children immediately follow their parents.
*/
-function get_page_hierarchy($posts, $parent = 0) {
- $result = array ( );
- if ($posts) { foreach ( (array) $posts as $post) {
- if ($post->post_parent == $parent) {
- $result[$post->ID] = $post->post_name;
- $children = get_page_hierarchy($posts, $post->ID);
- $result += $children; //append $children to $result
- }
- } }
+function &get_page_hierarchy( &$pages, $page_id = 0 ) {
+
+ if ( empty( $pages ) )
+ return null;
+
+ $children = array();
+ foreach ( (array) $pages as $p ) {
+
+ $parent_id = intval( $p->post_parent );
+ $children[ $parent_id ][] = $p;
+ }
+
+ $result = array();
+ _page_traverse_name( $page_id, $children, $result );
+
return $result;
}
+/**
+ * function to traverse and return all the nested children post names of a root page.
+ * $children contains parent-chilren relations
+ *
+ */
+function _page_traverse_name( $page_id, &$children, &$result ){
+
+ if ( isset( $children[ $page_id ] ) ){
+
+ foreach( (array)$children[ $page_id ] as $child ) {
+
+ $result[ $child->ID ] = $child->post_name;
+ _page_traverse_name( $child->ID, $children, $result );
+ }
+ }
+}
+
/**
* Builds URI for a page.
*
return $pages;
}
+ // Sanitize before caching so it'll only get done once
+ $num_pages = count($pages);
+ for ($i = 0; $i < $num_pages; $i++) {
+ $pages[$i] = sanitize_post($pages[$i], 'raw');
+ }
+
// Update cache.
update_page_cache($pages);
$pages = & get_page_children($child_of, $pages);
if ( !empty($exclude_tree) ) {
- $exclude = array();
-
$exclude = (int) $exclude_tree;
$children = get_page_children($exclude, $pages);
$excludes = array();
foreach ( $children as $child )
$excludes[] = $child->ID;
$excludes[] = $exclude;
- $total = count($pages);
- for ( $i = 0; $i < $total; $i++ ) {
+ $num_pages = count($pages);
+ for ( $i = 0; $i < $num_pages; $i++ ) {
if ( in_array($pages[$i]->ID, $excludes) )
unset($pages[$i]);
}
clean_post_cache($post_ID);
+ if ( isset($post_parent) && $post_parent < 0 )
+ add_post_meta($post_ID, '_wp_attachment_temp_parent', $post_parent, true);
+
if ( $update) {
do_action('edit_attachment', $post_ID);
} else {
* @uses do_action() Calls 'delete_attachment' hook on Attachment ID.
*
* @param int $postid Attachment ID.
+ * @param bool $force_delete Whether to bypass trash and force deletion
* @return mixed False on failure. Post data on success.
*/
-function wp_delete_attachment($postid) {
+function wp_delete_attachment( $post_id, $force_delete = false ) {
global $wpdb;
- if ( !$post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d", $postid)) )
+ if ( !$post = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d", $post_id) ) )
return $post;
if ( 'attachment' != $post->post_type )
return false;
- $meta = wp_get_attachment_metadata( $postid );
- $file = get_attached_file( $postid );
+ if ( !$force_delete && EMPTY_TRASH_DAYS && MEDIA_TRASH && 'trash' != $post->post_status )
+ return wp_trash_post( $post_id );
- do_action('delete_attachment', $postid);
+ delete_post_meta($post_id, '_wp_trash_meta_status');
+ delete_post_meta($post_id, '_wp_trash_meta_time');
- /** @todo Delete for pluggable post taxonomies too */
- wp_delete_object_term_relationships($postid, array('category', 'post_tag'));
+ $meta = wp_get_attachment_metadata( $post_id );
+ $backup_sizes = get_post_meta( $post->ID, '_wp_attachment_backup_sizes', true );
+ $file = get_attached_file( $post_id );
- $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->comments WHERE comment_post_ID = %d", $postid ));
+ do_action('delete_attachment', $post_id);
- $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d ", $postid ));
+ wp_delete_object_term_relationships($post_id, array('category', 'post_tag'));
+ wp_delete_object_term_relationships($post_id, get_object_taxonomies($post->post_type));
- $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->posts WHERE ID = %d", $postid ));
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_thumbnail_id' AND meta_value = %d", $post_id ));
- $uploadPath = wp_upload_dir();
+ $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ));
+ if ( ! empty($comment_ids) ) {
+ do_action( 'delete_comment', $comment_ids );
+ $in_comment_ids = "'" . implode("', '", $comment_ids) . "'";
+ $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_ID IN($in_comment_ids)" );
+ do_action( 'deleted_comment', $comment_ids );
+ }
+
+ $post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d ", $post_id ));
+ if ( !empty($post_meta_ids) ) {
+ do_action( 'delete_postmeta', $post_meta_ids );
+ $in_post_meta_ids = "'" . implode("', '", $post_meta_ids) . "'";
+ $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_id IN($in_post_meta_ids)" );
+ do_action( 'deleted_postmeta', $post_meta_ids );
+ }
+
+ do_action( 'delete_post', $post_id );
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->posts WHERE ID = %d", $post_id ));
+ do_action( 'deleted_post', $post_id );
+
+ $uploadpath = wp_upload_dir();
if ( ! empty($meta['thumb']) ) {
// Don't delete the thumb if another attachment uses it
- if (! $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE %s AND post_id <> %d", '%'.$meta['thumb'].'%', $postid)) ) {
+ if (! $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE %s AND post_id <> %d", '%' . $meta['thumb'] . '%', $post_id)) ) {
$thumbfile = str_replace(basename($file), $meta['thumb'], $file);
$thumbfile = apply_filters('wp_delete_file', $thumbfile);
- @ unlink( path_join($uploadPath['basedir'], $thumbfile) );
+ @ unlink( path_join($uploadpath['basedir'], $thumbfile) );
}
}
- // remove intermediate images if there are any
+ // remove intermediate and backup images if there are any
$sizes = apply_filters('intermediate_image_sizes', array('thumbnail', 'medium', 'large'));
foreach ( $sizes as $size ) {
- if ( $intermediate = image_get_intermediate_size($postid, $size) ) {
+ if ( $intermediate = image_get_intermediate_size($post_id, $size) ) {
$intermediate_file = apply_filters('wp_delete_file', $intermediate['path']);
- @ unlink( path_join($uploadPath['basedir'], $intermediate_file) );
+ @ unlink( path_join($uploadpath['basedir'], $intermediate_file) );
+ }
+ }
+
+ if ( is_array($backup_sizes) ) {
+ foreach ( $backup_sizes as $size ) {
+ $del_file = path_join( dirname($meta['file']), $size['file'] );
+ $del_file = apply_filters('wp_delete_file', $del_file);
+ @ unlink( path_join($uploadpath['basedir'], $del_file) );
}
}
if ( ! empty($file) )
@ unlink($file);
- clean_post_cache($postid);
+ clean_post_cache($post_id);
return $post;
}
return false;
$data = get_post_meta( $post->ID, '_wp_attachment_metadata', true );
+
if ( $unfiltered )
return $data;
+
return apply_filters( 'wp_get_attachment_metadata', $data, $post->ID );
}
* @return bool|array Returns false if there is nothing to update or an array of metadata.
*/
function update_postmeta_cache($post_ids) {
- global $wpdb;
-
- if ( empty( $post_ids ) )
- return false;
-
- if ( !is_array($post_ids) ) {
- $post_ids = preg_replace('|[^0-9,]|', '', $post_ids);
- $post_ids = explode(',', $post_ids);
- }
-
- $post_ids = array_map('intval', $post_ids);
-
- $ids = array();
- foreach ( (array) $post_ids as $id ) {
- if ( false === wp_cache_get($id, 'post_meta') )
- $ids[] = $id;
- }
-
- if ( empty( $ids ) )
- return false;
-
- // Get post-meta info
- $id_list = join(',', $ids);
- $cache = array();
- if ( $meta_list = $wpdb->get_results("SELECT post_id, meta_key, meta_value FROM $wpdb->postmeta WHERE post_id IN ($id_list)", ARRAY_A) ) {
- foreach ( (array) $meta_list as $metarow) {
- $mpid = (int) $metarow['post_id'];
- $mkey = $metarow['meta_key'];
- $mval = $metarow['meta_value'];
-
- // Force subkeys to be array type:
- if ( !isset($cache[$mpid]) || !is_array($cache[$mpid]) )
- $cache[$mpid] = array();
- if ( !isset($cache[$mpid][$mkey]) || !is_array($cache[$mpid][$mkey]) )
- $cache[$mpid][$mkey] = array();
-
- // Add a value to the current pid/key:
- $cache[$mpid][$mkey][] = $mval;
- }
- }
-
- foreach ( (array) $ids as $id ) {
- if ( ! isset($cache[$id]) )
- $cache[$id] = array();
- }
-
- foreach ( (array) array_keys($cache) as $post)
- wp_cache_set($post, $cache[$post], 'post_meta');
-
- return $cache;
+ return update_meta_cache('post', $post_ids);
}
//
return;
$data = array( 'post_id' => $post_id, 'meta_value' => '1' );
- if ( get_option('default_pingback_flag') )
+ if ( get_option('default_pingback_flag') ) {
$wpdb->insert( $wpdb->postmeta, $data + array( 'meta_key' => '_pingme' ) );
+ do_action( 'added_postmeta', $wpdb->insert_id, $post_id, '_pingme', 1 );
+ }
$wpdb->insert( $wpdb->postmeta, $data + array( 'meta_key' => '_encloseme' ) );
+ do_action( 'added_postmeta', $wpdb->insert_id, $post_id, '_encloseme', 1 );
+
wp_schedule_single_event(time(), 'do_pings');
}
*/
function wp_save_post_revision( $post_id ) {
// We do autosaves manually with wp_create_post_autosave()
- if ( @constant( 'DOING_AUTOSAVE' ) )
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
return;
// WP_POST_REVISIONS = 0, false
* Query type checks.
*/
-/**
- * Whether the current request is in WordPress admin Panel
- *
- * Does not inform on whether the user is an admin! Use capability checks to
- * tell if the user should be accessing a section or not.
- *
- * @since 1.5.1
- *
- * @return bool True if inside WordPress administration pages.
- */
-function is_admin () {
- if ( defined('WP_ADMIN') )
- return WP_ADMIN;
- return false;
-}
-
/**
* Is query requesting an archive page.
*
if ( empty($slug) )
return true;
- $term = $wp_query->get_queried_object();
-
- $slug = (array) $slug;
-
- if ( in_array( $term->slug, $slug ) )
- return true;
-
- return false;
+ return in_array( get_query_var('taxonomy'), (array) $slug );
}
/**
if ( '' != $qv['tb'] )
$this->is_trackback = true;
- if ( '' != $qv['paged'] )
+ if ( '' != $qv['paged'] && ( intval($qv['paged']) > 1 ) )
$this->is_paged = true;
if ( '' != $qv['comments_popup'] )
}
}
- if ( !empty($qv['post_type']) )
- $qv['post_type'] = sanitize_user($qv['post_type'], true);
+ if ( !empty($qv['post_type']) ) {
+ if(is_array($qv['post_type']))
+ $qv['post_type'] = array_map('sanitize_user', $qv['post_type'], array(true));
+ else
+ $qv['post_type'] = sanitize_user($qv['post_type'], true);
+ }
if ( !empty($qv['post_status']) )
$qv['post_status'] = preg_replace('|[^a-z0-9_,-]|', '', $qv['post_status']);
if ( $this->is_search )
$q['post_type'] = 'any';
else
- $q['post_type'] = 'post';
+ $q['post_type'] = '';
}
$post_type = $q['post_type'];
if ( !isset($q['posts_per_page']) || $q['posts_per_page'] == 0 )
$q['search_terms'] = array($q['s']);
} else {
preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $q['s'], $matches);
- $q['search_terms'] = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
+ $q['search_terms'] = array_map('_search_terms_tidy', $matches[0]);
}
$n = !empty($q['exact']) ? '' : '%';
$searchand = '';
$search .= "{$searchand}(($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}'))";
$searchand = ' AND ';
}
- $term = $wpdb->escape($q['s']);
+ $term = esc_sql($q['s']);
if (empty($q['sentence']) && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] )
$search .= " OR ($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')";
}
if ( !empty($q['category__not_in']) ) {
- if ( $wpdb->has_cap( 'subqueries' ) ) {
- $cat_string = "'" . implode("', '", $q['category__not_in']) . "'";
- $whichcat .= " AND $wpdb->posts.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'category' AND tt.term_id IN ($cat_string) )";
- } else {
- $ids = get_objects_in_term($q['category__not_in'], 'category');
- if ( !is_wp_error($ids) && is_array($ids) && count($ids) > 0 )
- $whichcat .= " AND $wpdb->posts.ID NOT IN ('" . implode("', '", $ids) . "')";
- }
+ $cat_string = "'" . implode("', '", $q['category__not_in']) . "'";
+ $whichcat .= " AND $wpdb->posts.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'category' AND tt.term_id IN ($cat_string) )";
}
// Category stuff for nice URLs
}
if ( !empty($q['tag__not_in']) ) {
- if ( $wpdb->has_cap( 'subqueries' ) ) {
- $tag_string = "'" . implode("', '", $q['tag__not_in']) . "'";
- $whichcat .= " AND $wpdb->posts.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'post_tag' AND tt.term_id IN ($tag_string) )";
- } else {
- $ids = get_objects_in_term($q['tag__not_in'], 'post_tag');
- if ( !is_wp_error($ids) && is_array($ids) && count($ids) > 0 )
- $whichcat .= " AND $wpdb->posts.ID NOT IN ('" . implode("', '", $ids) . "')";
- }
+ $tag_string = "'" . implode("', '", $q['tag__not_in']) . "'";
+ $whichcat .= " AND $wpdb->posts.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'post_tag' AND tt.term_id IN ($tag_string) )";
}
// Tag and slug intersections.
$q['orderby'] = '';
} else {
// Used to filter values
- $allowed_keys = array('author', 'date', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand');
+ $allowed_keys = array('author', 'date', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand', 'comment_count');
if ( !empty($q['meta_key']) ) {
$allowed_keys[] = $q['meta_key'];
$allowed_keys[] = 'meta_value';
case 'meta_value':
$orderby = "$wpdb->postmeta.meta_value";
break;
+ case 'comment_count':
+ $orderby = "$wpdb->posts.comment_count";
+ break;
default:
$orderby = "$wpdb->posts.post_" . $orderby;
}
$q['orderby'] = "$wpdb->posts.post_date ".$q['order'];
}
+ if ( is_array($post_type) )
+ $post_type_cap = 'multiple_post_type';
+ else
+ $post_type_cap = $post_type;
+
+ $exclude_post_types = '';
+ foreach ( get_post_types( array('exclude_from_search' => true) ) as $_wp_post_type )
+ $exclude_post_types .= $wpdb->prepare(" AND $wpdb->posts.post_type != %s", $_wp_post_type);
+
if ( 'any' == $post_type ) {
- $where .= " AND $wpdb->posts.post_type != 'revision'";
+ $where .= $exclude_post_types;
+ } elseif ( !empty( $post_type ) && is_array( $post_type ) ) {
+ $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $post_type) . "')";
+ } elseif ( ! empty( $post_type ) ) {
+ $where .= " AND $wpdb->posts.post_type = '$post_type'";
} elseif ( $this->is_attachment ) {
$where .= " AND $wpdb->posts.post_type = 'attachment'";
+ $post_type_cap = 'post';
} elseif ($this->is_page) {
$where .= " AND $wpdb->posts.post_type = 'page'";
- } elseif ($this->is_single) {
- $where .= " AND $wpdb->posts.post_type = 'post'";
+ $post_type_cap = 'page';
} else {
- $where .= " AND $wpdb->posts.post_type = '$post_type'";
+ $where .= " AND $wpdb->posts.post_type = 'post'";
+ $post_type_cap = 'post';
}
if ( isset($q['post_status']) && '' != $q['post_status'] ) {
$q_status = explode(',', $q['post_status']);
$r_status = array();
$p_status = array();
- if ( in_array( 'draft' , $q_status ) )
- $r_status[] = "$wpdb->posts.post_status = 'draft'";
- if ( in_array( 'pending', $q_status ) )
- $r_status[] = "$wpdb->posts.post_status = 'pending'";
- if ( in_array( 'future' , $q_status ) )
- $r_status[] = "$wpdb->posts.post_status = 'future'";
- if ( in_array( 'inherit' , $q_status ) )
- $r_status[] = "$wpdb->posts.post_status = 'inherit'";
- if ( in_array( 'private', $q_status ) )
- $p_status[] = "$wpdb->posts.post_status = 'private'";
- if ( in_array( 'publish', $q_status ) )
- $r_status[] = "$wpdb->posts.post_status = 'publish'";
+ if ( $q['post_status'] == 'any' ) {
+ // @todo Use register_post_status() data to determine which states should be excluded.
+ $r_status[] = "$wpdb->posts.post_status <> 'trash'";
+ } else {
+ if ( in_array( 'draft' , $q_status ) )
+ $r_status[] = "$wpdb->posts.post_status = 'draft'";
+ if ( in_array( 'pending', $q_status ) )
+ $r_status[] = "$wpdb->posts.post_status = 'pending'";
+ if ( in_array( 'future' , $q_status ) )
+ $r_status[] = "$wpdb->posts.post_status = 'future'";
+ if ( in_array( 'inherit' , $q_status ) )
+ $r_status[] = "$wpdb->posts.post_status = 'inherit'";
+ if ( in_array( 'private', $q_status ) )
+ $p_status[] = "$wpdb->posts.post_status = 'private'";
+ if ( in_array( 'publish', $q_status ) )
+ $r_status[] = "$wpdb->posts.post_status = 'publish'";
+ if ( in_array( 'trash', $q_status ) )
+ $r_status[] = "$wpdb->posts.post_status = 'trash'";
+ }
if ( empty($q['perm'] ) || 'readable' != $q['perm'] ) {
$r_status = array_merge($r_status, $p_status);
}
if ( !empty($r_status) ) {
- if ( !empty($q['perm'] ) && 'editable' == $q['perm'] && !current_user_can("edit_others_{$post_type}s") )
+ if ( !empty($q['perm'] ) && 'editable' == $q['perm'] && !current_user_can("edit_others_{$post_type_cap}s") )
$statuswheres[] = "($wpdb->posts.post_author = $user_ID " . "AND (" . join( ' OR ', $r_status ) . "))";
else
$statuswheres[] = "(" . join( ' OR ', $r_status ) . ")";
}
if ( !empty($p_status) ) {
- if ( !empty($q['perm'] ) && 'readable' == $q['perm'] && !current_user_can("read_private_{$post_type}s") )
+ if ( !empty($q['perm'] ) && 'readable' == $q['perm'] && !current_user_can("read_private_{$post_type_cap}s") )
$statuswheres[] = "($wpdb->posts.post_author = $user_ID " . "AND (" . join( ' OR ', $p_status ) . "))";
else
$statuswheres[] = "(" . join( ' OR ', $p_status ) . ")";
$where .= " OR $wpdb->posts.post_status = 'future' OR $wpdb->posts.post_status = 'draft' OR $wpdb->posts.post_status = 'pending'";
if ( is_user_logged_in() ) {
- $where .= current_user_can( "read_private_{$post_type}s" ) ? " OR $wpdb->posts.post_status = 'private'" : " OR $wpdb->posts.post_author = $user_ID AND $wpdb->posts.post_status = 'private'";
+ $where .= current_user_can( "read_private_{$post_type_cap}s" ) ? " OR $wpdb->posts.post_status = 'private'" : " OR $wpdb->posts.post_author = $user_ID AND $wpdb->posts.post_status = 'private'";
}
$where .= ')';
} else {
if (in_array($status, array('draft', 'pending')) ) {
// User must have edit permissions on the draft to preview.
- if (! current_user_can('edit_post', $this->posts[0]->ID)) {
+ if (! current_user_can("edit_$post_type_cap", $this->posts[0]->ID)) {
$this->posts = array();
} else {
$this->is_preview = true;
}
} else if ('future' == $status) {
$this->is_preview = true;
- if (!current_user_can('edit_post', $this->posts[0]->ID)) {
+ if (!current_user_can("edit_$post_type_cap", $this->posts[0]->ID)) {
$this->posts = array ( );
}
} else {
- if (! current_user_can('read_post', $this->posts[0]->ID))
+ if (! current_user_can("read_$post_type_cap", $this->posts[0]->ID))
$this->posts = array();
}
}
}
- if ( $this->is_preview && current_user_can( "edit_{$post_type}", $this->posts[0]->ID ) )
+ if ( $this->is_preview && current_user_can( "edit_{$post_type_cap}", $this->posts[0]->ID ) )
$this->posts[0] = apply_filters('the_preview', $this->posts[0]);
}
// Fetch sticky posts that weren't in the query results
if ( !empty($sticky_posts) ) {
$stickies__in = implode(',', array_map( 'absint', $sticky_posts ));
- $stickies = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.ID IN ($stickies__in)" );
+ // honor post type(s) if not set to any
+ $stickies_where = '';
+ if ( 'any' != $post_type && '' != $post_type ) {
+ if ( is_array( $post_type ) ) {
+ $post_types = join( "', '", $post_type );
+ } else {
+ $post_types = $post_type;
+ }
+ $stickies_where = "AND $wpdb->posts.post_type IN ('" . $post_types . "')";
+ }
+ $stickies = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.ID IN ($stickies__in) $stickies_where" );
/** @todo Make sure post is published or viewable by the current user */
foreach ( $stickies as $sticky_post ) {
if ( 'publish' != $sticky_post->post_status )
if ( !$q['suppress_filters'] )
$this->posts = apply_filters('the_posts', $this->posts);
+ $this->post_count = count($this->posts);
+
+ // Sanitize before caching so it'll only get done once
+ for ($i = 0; $i < $this->post_count; $i++) {
+ $this->posts[$i] = sanitize_post($this->posts[$i], 'raw');
+ }
+
update_post_caches($this->posts);
- $this->post_count = count($this->posts);
if ($this->post_count > 0) {
$this->post = $this->posts[0];
}
}
do_action_ref_array('the_post', array(&$post));
-
+
return true;
}
if ( empty($use_ssl) )
$use_ssl = 0;
- if ( empty($jabber) )
- $jabber = '';
-
- if ( empty($aim) )
- $aim = '';
-
- if ( empty($yim) )
- $yim = '';
-
if ( empty($user_registered) )
$user_registered = gmdate('Y-m-d H:i:s');
$user_nicename_check = $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1" , $user_nicename, $user_login));
- if ($user_nicename_check) {
+ if ( $user_nicename_check ) {
$suffix = 2;
while ($user_nicename_check) {
$alt_user_nicename = $user_nicename . "-$suffix";
update_usermeta( $user_id, 'last_name', $last_name);
update_usermeta( $user_id, 'nickname', $nickname );
update_usermeta( $user_id, 'description', $description );
- update_usermeta( $user_id, 'jabber', $jabber );
- update_usermeta( $user_id, 'aim', $aim );
- update_usermeta( $user_id, 'yim', $yim );
update_usermeta( $user_id, 'rich_editing', $rich_editing);
update_usermeta( $user_id, 'comment_shortcuts', $comment_shortcuts);
update_usermeta( $user_id, 'admin_color', $admin_color);
update_usermeta( $user_id, 'use_ssl', $use_ssl);
+ foreach ( _wp_get_user_contactmethods() as $method => $name ) {
+ if ( empty($$method) )
+ $$method = '';
+
+ update_usermeta( $user_id, $method, $$method );
+ }
+
if ( isset($role) ) {
$user = new WP_User($user_id);
$user->set_role($role);
*
* @since 2.0.0
* @see wp_insert_user() More complete way to create a new user
- * @uses $wpdb Escapes $username and $email parameters
*
* @param string $username The user's username.
* @param string $password The user's password.
* @return int The new user's ID.
*/
function wp_create_user($username, $password, $email = '') {
- global $wpdb;
-
- $user_login = $wpdb->escape($username);
- $user_email = $wpdb->escape($email);
+ $user_login = esc_sql( $username );
+ $user_email = esc_sql( $email );
$user_pass = $password;
$userdata = compact('user_login', 'user_email', 'user_pass');
return wp_insert_user($userdata);
}
+
+/**
+ * Setup the default contact methods
+ *
+ * @access private
+ * @since
+ *
+ * @return array $user_contactmethods Array of contact methods and their labels.
+ */
+function _wp_get_user_contactmethods() {
+ $user_contactmethods = array(
+ 'aim' => __('AIM'),
+ 'yim' => __('Yahoo IM'),
+ 'jabber' => __('Jabber / Google Talk')
+ );
+ return apply_filters('user_contactmethods',$user_contactmethods);
+}
+
?>
* @return string|bool False if not found. Permalink structure string.
*/
function get_extra_permastruct($name) {
+ if ( empty($this->permalink_structure) )
+ return false;
if ( isset($this->extra_permastructs[$name]) )
return $this->extra_permastructs[$name];
return false;
$subcommentquery = $subquery . '&cpage=' . $this->preg_index(2);
//do endpoints for attachments
- if ( !empty($endpoint) ) { foreach ( (array) $ep_query_append as $regex => $ep ) {
+ if ( !empty($endpoints) ) { foreach ( (array) $ep_query_append as $regex => $ep ) {
if ($ep[0] & EP_ATTACHMENT) {
- $rewrite[$sub1 . $regex] = $subquery . '?' . $ep[1] . $this->preg_index(2);
- $rewrite[$sub2 . $regex] = $subquery . '?' . $ep[1] . $this->preg_index(2);
+ $rewrite[$sub1 . $regex] = $subquery . $ep[1] . $this->preg_index(2);
+ $rewrite[$sub2 . $regex] = $subquery . $ep[1] . $this->preg_index(2);
}
} }
* @return array Rewrite rules.
*/
function wp_rewrite_rules() {
- $this->rules = get_transient('rewrite_rules');
+ $this->rules = get_option('rewrite_rules');
if ( empty($this->rules) ) {
$this->matches = 'matches';
$this->rewrite_rules();
- set_transient('rewrite_rules', $this->rules);
+ update_option('rewrite_rules', $this->rules);
}
return $this->rules;
*
* @return string
*/
- function iis7_url_rewrite_rules(){
+ function iis7_url_rewrite_rules($add_parent_tags = false, $indent = " ", $end_of_line = "\n") {
if ( ! $this->using_permalinks()) {
return '';
}
- $rules = "<rule name=\"wordpress\" patternSyntax=\"Wildcard\">\n";
- $rules .= " <match url=\"*\" />\n";
- $rules .= " <conditions>\n";
- $rules .= " <add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" negate=\"true\" />\n";
- $rules .= " <add input=\"{REQUEST_FILENAME}\" matchType=\"IsDirectory\" negate=\"true\" />\n";
- $rules .= " </conditions>\n";
- $rules .= " <action type=\"Rewrite\" url=\"index.php\" />\n";
- $rules .= "</rule>";
+
+ $rules = '';
+ $extra_indent = '';
+ if ( $add_parent_tags ) {
+ $rules .= "<configuration>".$end_of_line;
+ $rules .= $indent."<system.webServer>".$end_of_line;
+ $rules .= $indent.$indent."<rewrite>".$end_of_line;
+ $rules .= $indent.$indent.$indent."<rules>".$end_of_line;
+ $extra_indent = $indent.$indent.$indent.$indent;
+ }
+
+ $rules .= $extra_indent."<rule name=\"wordpress\" patternSyntax=\"Wildcard\">".$end_of_line;
+ $rules .= $extra_indent.$indent."<match url=\"*\" />".$end_of_line;
+ $rules .= $extra_indent.$indent.$indent."<conditions>".$end_of_line;
+ $rules .= $extra_indent.$indent.$indent.$indent."<add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" negate=\"true\" />".$end_of_line;
+ $rules .= $extra_indent.$indent.$indent.$indent."<add input=\"{REQUEST_FILENAME}\" matchType=\"IsDirectory\" negate=\"true\" />".$end_of_line;
+ $rules .= $extra_indent.$indent.$indent."</conditions>".$end_of_line;
+ $rules .= $extra_indent.$indent."<action type=\"Rewrite\" url=\"index.php\" />".$end_of_line;
+ $rules .= $extra_indent."</rule>";
+
+ if ( $add_parent_tags ) {
+ $rules .= $end_of_line.$indent.$indent.$indent."</rules>".$end_of_line;
+ $rules .= $indent.$indent."</rewrite>".$end_of_line;
+ $rules .= $indent."</system.webServer>".$end_of_line;
+ $rules .= "</configuration>";
+ }
$rules = apply_filters('iis7_url_rewrite_rules', $rules);
*
* @since 2.0.1
* @access public
- * @param $hard bool Whether to update .htaccess (hard flush) or just update rewrite_rules transient (soft flush). Default is true (hard).
+ * @param $hard bool Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard).
*/
function flush_rules($hard = true) {
- delete_transient('rewrite_rules');
+ delete_option('rewrite_rules');
$this->wp_rewrite_rules();
if ( $hard && function_exists('save_mod_rewrite_rules') )
save_mod_rewrite_rules();
* file.
*
* Several constants are used to manage the loading, concatenating and compression of scripts and CSS:
- * define('SCRIPT_DEBUG', true); loads the development (non-minified) versions of all scripts and disables compression and concatenation
- * define('CONCATENATE_SCRIPTS', false); disables compression and concatenation,
+ * define('SCRIPT_DEBUG', true); loads the development (non-minified) versions of all scripts and disables compression and concatenation,
+ * define('STYLE_DEBUG', true); loads the development (non-minified) versions of all CSS and disables compression and concatenation,
+ * define('CONCATENATE_SCRIPTS', false); disables compression and concatenation of scripts and CSS,
* define('COMPRESS_SCRIPTS', false); disables compression of scripts,
* define('COMPRESS_CSS', false); disables compression of CSS,
* define('ENFORCE_GZIP', true); forces gzip for compression (default is deflate).
$scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20090102' );
- $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20090609' );
+ $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20091212' );
$scripts->add_data( 'common', 'group', 1 );
$scripts->localize( 'common', 'commonL10n', array(
- 'warnDelete' => __("You are about to delete the selected items.\n 'Cancel' to stop, 'OK' to delete."),
+ 'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete."),
'l10n_print_after' => 'try{convertEntities(commonL10n);}catch(e){};'
) );
$scripts->add( 'colorpicker', "/wp-includes/js/colorpicker$suffix.js", array('prototype'), '3517m' );
- $scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", false, '20090503' );
+ $scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", false, '20091124' );
$scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');
- $scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array('jquery'), '20090128' );
+ $scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array('jquery'), '20091119' );
$scripts->add_data( 'wp-ajax-response', 'group', 1 );
$scripts->localize( 'wp-ajax-response', 'wpAjax', array(
'noPerm' => __('You do not have permission to do that.'),
'l10n_print_after' => 'try{convertEntities(wpAjax);}catch(e){};'
) );
- $scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20090526' );
+ $scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20091012' );
$scripts->add_data( 'autosave', 'group', 1 );
- $scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response'), '20090504' );
+ $scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response'), '20091128' );
$scripts->add_data( 'wp-lists', 'group', 1 );
- $scripts->localize( 'wp-lists', 'wpListL10n', array(
- 'url' => admin_url('admin-ajax.php')
- ) );
$scripts->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/wp-scriptaculous.js', array('prototype'), '1.8.0');
$scripts->add( 'scriptaculous-builder', '/wp-includes/js/scriptaculous/builder.js', array('scriptaculous-root'), '1.8.0');
$scripts->add( 'scriptaculous-controls', '/wp-includes/js/scriptaculous/controls.js', array('scriptaculous-root'), '1.8.0');
$scripts->add( 'scriptaculous', '', array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls'), '1.8.0');
+ // not used in core, replaced by Jcrop.js
$scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118');
$scripts->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.3.2');
$scripts->add( 'jquery-ui-dialog', '/wp-includes/js/jquery/ui.dialog.js', array('jquery-ui-resizable', 'jquery-ui-draggable'), '1.7.1' );
$scripts->add_data( 'jquery-ui-dialog', 'group', 1 );
+ // deprecated, not used in core, most functionality is included in jQuery 1.3
$scripts->add( 'jquery-form', "/wp-includes/js/jquery/jquery.form$suffix.js", array('jquery'), '2.02m');
$scripts->add_data( 'jquery-form', 'group', 1 );
$scripts->add( 'jquery-color', "/wp-includes/js/jquery/jquery.color$suffix.js", array('jquery'), '2.0-4561m');
$scripts->add_data( 'jquery-color', 'group', 1 );
+ // deprecated, not used in core
$scripts->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.2' );
$scripts->add( 'suggest', "/wp-includes/js/jquery/suggest$suffix.js", array('jquery'), '1.1-20090125');
$scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array('jquery', 'jquery-hotkeys'), '20090102' );
$scripts->add_data( 'jquery-table-hotkeys', 'group', 1 );
- $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20090123');
+ $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20091124');
$scripts->add_data( 'thickbox', 'group', 1 );
+ $scripts->localize( 'thickbox', 'thickboxL10n', array(
+ 'next' => __('Next >'),
+ 'prev' => __('< Prev'),
+ 'image' => __('Image'),
+ 'of' => __('of'),
+ 'close' => __('Close'),
+ 'l10n_print_after' => 'try{convertEntities(thickboxL10n);}catch(e){};'
+ ) );
+
$scripts->add( 'jcrop', "/wp-includes/js/jcrop/jquery.Jcrop$suffix.js", array('jquery'), '0.9.8');
$scripts->add( 'swfupload-all', '/wp-includes/js/swfupload/swfupload-all.js', array(), '2201');
}
- $scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array('swfupload-all', 'jquery'), '2201-20090515');
+ $scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array('swfupload-all', 'jquery'), '2201-20091208');
+ $max_upload_size = ( (int) ( $max_up = @ini_get('upload_max_filesize') ) < (int) ( $max_post = @ini_get('post_max_size') ) ) ? $max_up : $max_post;
+ if ( empty($max_upload_size) )
+ $max_upload_size = __('not configured');
// these error messages came from the sample swfupload js, they might need changing.
$scripts->localize( 'swfupload-handlers', 'swfuploadL10n', array(
'queue_limit_exceeded' => __('You have attempted to queue too many files.'),
- 'file_exceeds_size_limit' => sprintf(__('This file is too big. Your php.ini upload_max_filesize is %s.'), @ini_get('upload_max_filesize')),
+ 'file_exceeds_size_limit' => sprintf( __('This file is too big. The maximum upload size for your server is %s.'), $max_upload_size ),
'zero_byte_file' => __('This file is empty. Please try another.'),
'invalid_filetype' => __('This file type is not allowed. Please try another.'),
'default_error' => __('An error occurred in the upload. Please try again later.'),
'upload_stopped' => __('Upload stopped.'),
'dismiss' => __('Dismiss'),
'crunching' => __('Crunching…'),
- 'deleted' => __('Deleted'),
+ 'deleted' => __('moved to the trash.'),
'l10n_print_after' => 'try{convertEntities(swfuploadL10n);}catch(e){};'
) );
$scripts->add( 'comment-reply', "/wp-includes/js/comment-reply$suffix.js", false, '20090102');
+ $scripts->add( 'json2', "/wp-includes/js/json2$suffix.js", false, '20090817');
+
+ $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.1' );
+ $scripts->add_data( 'imgareaselect', 'group', 1 );
+
if ( is_admin() ) {
$scripts->add( 'ajaxcat', "/wp-admin/js/cat$suffix.js", array( 'wp-lists' ), '20090102' );
$scripts->add_data( 'ajaxcat', 'group', 1 );
'l10n_print_after' => 'try{convertEntities(catL10n);}catch(e){};'
) );
- $scripts->add( 'admin-categories', "/wp-admin/js/categories$suffix.js", array('wp-lists'), '20090207' );
+ $scripts->add( 'admin-categories', "/wp-admin/js/categories$suffix.js", array('wp-lists'), '20091201' );
$scripts->add_data( 'admin-categories', 'group', 1 );
- $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array('wp-lists'), '20090211' );
+ $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array('jquery'), '20090623' );
$scripts->add_data( 'admin-tags', 'group', 1 );
+ $scripts->localize( 'admin-tags', 'tagsl10n', array(
+ 'noPerm' => __('You do not have permission to do that.'),
+ 'broken' => __('An unidentified error has occurred.'),
+ 'l10n_print_after' => 'try{convertEntities(tagsl10n);}catch(e){};'
+ ));
$scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), '20090106' );
$scripts->add_data( 'admin-custom-fields', 'group', 1 );
$scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array('jquery'), '20090514' );
$scripts->add_data( 'user-profile', 'group', 1 );
- $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20090627' );
+ $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20091129' );
$scripts->add_data( 'admin-comments', 'group', 1 );
$scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
$scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", false, '3517m' );
- $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20090618' );
+ $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20091012' );
$scripts->add_data( 'postbox', 'group', 1 );
- $scripts->localize( 'postbox', 'postboxL10n', array(
- 'requestFile' => admin_url('admin-ajax.php')
- ) );
- $scripts->add( 'slug', "/wp-admin/js/slug$suffix.js", array('jquery'), '20090207' );
- $scripts->add_data( 'slug', 'group', 1 );
- $scripts->localize( 'slug', 'slugL10n', array(
- 'requestFile' => admin_url('admin-ajax.php'),
- 'save' => __('Save'),
- 'cancel' => __('Cancel'),
- 'l10n_print_after' => 'try{convertEntities(slugL10n);}catch(e){};'
- ) );
-
- $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox', 'slug'), '20090624' );
+ $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), '20091208' );
$scripts->add_data( 'post', 'group', 1 );
$scripts->localize( 'post', 'postL10n', array(
'tagsUsed' => __('Tags used on this post:'),
'add' => esc_attr(__('Add')),
'addTag' => esc_attr(__('Add new tag')),
'separate' => __('Separate tags with commas'),
+ 'ok' => __('OK'),
'cancel' => __('Cancel'),
'edit' => __('Edit'),
'publishOn' => __('Publish on:'),
'endcomm' => __('No more comments found.'),
'publish' => __('Publish'),
'schedule' => __('Schedule'),
- 'update' => __('Update Post'),
+ 'updatePost' => __('Update Post'),
+ 'updatePage' => __('Update Page'),
'savePending' => __('Save as Pending'),
'saveDraft' => __('Save Draft'),
'private' => __('Private'),
'l10n_print_after' => 'try{convertEntities(postL10n);}catch(e){};'
) );
- $scripts->add( 'page', "/wp-admin/js/page$suffix.js", array('jquery', 'slug', 'wp-lists', 'postbox'), '20090526' );
- $scripts->add_data( 'page', 'group', 1 );
- $scripts->localize( 'page', 'postL10n', array(
- 'cancel' => __('Cancel'),
- 'edit' => __('Edit'),
- 'publishOn' => __('Publish on:'),
- 'publishOnFuture' => __('Schedule for:'),
- 'publishOnPast' => __('Published on:'),
- 'showcomm' => __('Show more comments'),
- 'endcomm' => __('No more comments found.'),
- 'publish' => __('Publish'),
- 'schedule' => __('Schedule'),
- 'update' => __('Update Page'),
- 'savePending' => __('Save as Pending'),
- 'saveDraft' => __('Save Draft'),
- 'private' => __('Private'),
- 'public' => __('Public'),
- 'password' => __('Password Protected'),
- 'privatelyPublished' => __('Privately Published'),
- 'published' => __('Published'),
- 'l10n_print_after' => 'try{convertEntities(postL10n);}catch(e){};'
- ) );
-
$scripts->add( 'link', "/wp-admin/js/link$suffix.js", array('wp-lists', 'postbox'), '20090506' );
$scripts->add_data( 'link', 'group', 1 );
- $scripts->add( 'comment', "/wp-admin/js/comment$suffix.js", array('jquery'), '20090102' );
+ $scripts->add( 'comment', "/wp-admin/js/comment$suffix.js", array('jquery'), '20091202' );
$scripts->add_data( 'comment', 'group', 1 );
$scripts->localize( 'comment', 'commentL10n', array(
'cancel' => __('Cancel'),
$scripts->add( 'admin-gallery', "/wp-admin/js/gallery$suffix.js", array( 'jquery-ui-sortable' ), '20090516' );
- $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox' ), '20090114' );
+ $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox' ), '20091023' );
$scripts->add_data( 'media-upload', 'group', 1 );
- $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), '20090601' );
+ $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), '20090824' );
$scripts->add_data( 'admin-widgets', 'group', 1 );
$scripts->add( 'word-count', "/wp-admin/js/word-count$suffix.js", array( 'jquery' ), '20090422' );
'l10n_print_after' => 'try{convertEntities(wordCountL10n);}catch(e){};'
));
- $scripts->add( 'wp-gears', "/wp-admin/js/wp-gears$suffix.js", false, '20090102' );
+ $scripts->add( 'wp-gears', "/wp-admin/js/wp-gears$suffix.js", false, '20090717' );
$scripts->localize( 'wp-gears', 'wpGearsL10n', array(
'updateCompleted' => __('Update completed.'),
'error' => __('Error:'),
$scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), '20090319' );
$scripts->add_data( 'theme-preview', 'group', 1 );
- $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery-form', 'suggest' ), '20090125' );
+ $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest' ), '20091202' );
$scripts->add_data( 'inline-edit-post', 'group', 1 );
$scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
'error' => __('Error while saving the changes.'),
'l10n_print_after' => 'try{convertEntities(inlineEditL10n);}catch(e){};'
) );
- $scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery-form' ), '20090211' );
+ $scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery' ), '20090623' );
$scripts->add_data( 'inline-edit-tax', 'group', 1 );
$scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array(
'error' => __('Error while saving the changes.'),
$scripts->add( 'codepress', '/wp-includes/js/codepress/codepress.js', false, '0.9.6' );
$scripts->add_data( 'codepress', 'group', 1 );
+
+ $scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), '20091111' );
+ $scripts->add_data( 'image-edit', 'group', 1 );
+
+ $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), '20091210b' );
+ $scripts->add_data( 'set-post-thumbnail', 'group', 1 );
+ $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array(
+ 'setThumbnail' => __( 'Use as thumbnail' ),
+ 'saving' => __( 'Saving...' ),
+ 'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ),
+ 'done' => __( 'Done' )
+ ) );
+
}
}
$styles->text_direction = 'rtl' == get_bloginfo( 'text_direction' ) ? 'rtl' : 'ltr';
$styles->default_dirs = array('/wp-admin/');
+ $suffix = defined('STYLE_DEBUG') && STYLE_DEBUG ? '.dev' : '';
+
$rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'plugin-install', 'farbtastic' );
// all colors stylesheets need to have the same query strings (cache manifest compat)
- $colors_version = '20090625';
+ $colors_version = '20091217';
- $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20090625' );
- $styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' );
+ $styles->add( 'wp-admin', "/wp-admin/wp-admin$suffix.css", array(), '20091217' );
+ $styles->add_data( 'wp-admin', 'rtl', "/wp-admin/rtl$suffix.css" );
- $styles->add( 'ie', '/wp-admin/css/ie.css', array(), '20090630' );
+ $styles->add( 'ie', '/wp-admin/css/ie.css', array(), '20091217' );
$styles->add_data( 'ie', 'conditional', 'lte IE 7' );
// Register "meta" stylesheet for admin colors. All colors-* style sheets should have the same version string.
$styles->add( 'colors', true, array(), $colors_version );
-
+
// do not refer to these directly, the right one is queued by the above "meta" colors handle
- $styles->add( 'colors-fresh', '/wp-admin/css/colors-fresh.css', array(), $colors_version);
+ $styles->add( 'colors-fresh', "/wp-admin/css/colors-fresh$suffix.css", array(), $colors_version);
$styles->add_data( 'colors-fresh', 'rtl', true );
- $styles->add( 'colors-classic', '/wp-admin/css/colors-classic.css', array(), $colors_version);
+ $styles->add( 'colors-classic', "/wp-admin/css/colors-classic$suffix.css", array(), $colors_version);
$styles->add_data( 'colors-classic', 'rtl', true );
- $styles->add( 'global', '/wp-admin/css/global.css', array(), '20090630' );
- $styles->add( 'media', '/wp-admin/css/media.css', array(), '20090516' );
- $styles->add( 'widgets', '/wp-admin/css/widgets.css', array(), '20090603' );
- $styles->add( 'dashboard', '/wp-admin/css/dashboard.css', array(), '20090514' );
- $styles->add( 'install', '/wp-admin/css/install.css', array(), '20090514' );
- $styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css', array(), '20090625' );
- $styles->add( 'press-this', '/wp-admin/css/press-this.css', array(), '20090514' );
+ $styles->add( 'global', "/wp-admin/css/global$suffix.css", array(), '20091217' );
+ $styles->add( 'media', "/wp-admin/css/media$suffix.css", array(), '20091029' );
+ $styles->add( 'widgets', "/wp-admin/css/widgets$suffix.css", array(), '20091118' );
+ $styles->add( 'dashboard', "/wp-admin/css/dashboard$suffix.css", array(), '20091211' );
+ $styles->add( 'install', "/wp-admin/css/install$suffix.css", array(), '20090514' );
+ $styles->add( 'theme-editor', "/wp-admin/css/theme-editor$suffix.css", array(), '20090625' );
+ $styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array(), '20091022' );
$styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20090514' );
- $styles->add( 'login', '/wp-admin/css/login.css', array(), '20090514' );
- $styles->add( 'plugin-install', '/wp-admin/css/plugin-install.css', array(), '20090514' );
- $styles->add( 'theme-install', '/wp-admin/css/theme-install.css', array(), '20090610' );
+ $styles->add( 'login', "/wp-admin/css/login$suffix.css", array(), '20091010' );
+ $styles->add( 'plugin-install', "/wp-admin/css/plugin-install$suffix.css", array(), '20090514' );
+ $styles->add( 'theme-install', "/wp-admin/css/theme-install$suffix.css", array(), '20090610' );
$styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.2' );
$styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' );
+ $styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
foreach ( $rtl_styles as $rtl_style )
$styles->add_data( $rtl_style, 'rtl', true );
if ( 'colors' == $handle || 'colors-rtl' == $handle ) {
global $_wp_admin_css_colors;
$color = get_user_option('admin_color');
+
if ( empty($color) || !isset($_wp_admin_css_colors[$color]) )
$color = 'fresh';
+
$color = $_wp_admin_css_colors[$color];
$parsed = parse_url( $src );
$url = $color->url;
+
+ if ( defined('STYLE_DEBUG') && STYLE_DEBUG )
+ $url = preg_replace('/.css$|.css(?=\?)/', '.dev.css', $url);
+
if ( isset($parsed['query']) && $parsed['query'] ) {
wp_parse_str( $parsed['query'], $qv );
$url = add_query_arg( $qv, $url );
}
+
return $url;
}
$tagnames = array_keys($shortcode_tags);
$tagregexp = join( '|', array_map('preg_quote', $tagnames) );
+ // WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcodes()
return '(.?)\[('.$tagregexp.')\b(.*?)(?:(\/))?\](?:(.+?)\[\/\2\])?(.?)';
}
$pattern = get_shortcode_regex();
- return preg_replace('/'.$pattern.'/s', '', $content);
+ return preg_replace('/'.$pattern.'/s', '$1$6', $content);
}
add_filter('the_content', 'do_shortcode', 11); // AFTER wpautop()
+++ /dev/null
-<?php
-/**
- * PHP-Gettext External Library: StreamReader classes
- *
- * @package External
- * @subpackage PHP-gettext
- *
- * @internal
- Copyright (c) 2003, 2005 Danilo Segan <danilo@kvota.net>.
-
- This file is part of PHP-gettext.
-
- PHP-gettext is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PHP-gettext is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PHP-gettext; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- */
-
-
-// Simple class to wrap file streams, string streams, etc.
-// seek is essential, and it should be byte stream
-class StreamReader {
- // should return a string [FIXME: perhaps return array of bytes?]
- function read($bytes) {
- return false;
- }
-
- // should return new position
- function seekto($position) {
- return false;
- }
-
- // returns current position
- function currentpos() {
- return false;
- }
-
- // returns length of entire stream (limit for seekto()s)
- function length() {
- return false;
- }
-}
-
-class StringReader {
- var $_pos;
- var $_str;
-
- function StringReader($str='') {
- $this->_str = $str;
- $this->_pos = 0;
- // If string functions are overloaded, we need to use the mb versions
- $this->is_overloaded = ((ini_get("mbstring.func_overload") & 2) != 0) && function_exists('mb_substr');
- }
-
- function _substr($string, $start, $length) {
- if ($this->is_overloaded) {
- return mb_substr($string,$start,$length,'ascii');
- } else {
- return substr($string,$start,$length);
- }
- }
-
- function _strlen($string) {
- if ($this->is_overloaded) {
- return mb_strlen($string,'ascii');
- } else {
- return strlen($string);
- }
- }
-
- function read($bytes) {
- $data = $this->_substr($this->_str, $this->_pos, $bytes);
- $this->_pos += $bytes;
- if ($this->_strlen($this->_str)<$this->_pos)
- $this->_pos = $this->_strlen($this->_str);
-
- return $data;
- }
-
- function seekto($pos) {
- $this->_pos = $pos;
- if ($this->_strlen($this->_str)<$this->_pos)
- $this->_pos = $this->_strlen($this->_str);
- return $this->_pos;
- }
-
- function currentpos() {
- return $this->_pos;
- }
-
- function length() {
- return $this->_strlen($this->_str);
- }
-}
-
-
-class FileReader {
- var $_pos;
- var $_fd;
- var $_length;
-
- function FileReader($filename) {
- if (file_exists($filename)) {
-
- $this->_length=filesize($filename);
- $this->_pos = 0;
- $this->_fd = fopen($filename,'rb');
- if (!$this->_fd) {
- $this->error = 3; // Cannot read file, probably permissions
- return false;
- }
- } else {
- $this->error = 2; // File doesn't exist
- return false;
- }
- }
-
- function read($bytes) {
- if ($bytes) {
- fseek($this->_fd, $this->_pos);
-
- // PHP 5.1.1 does not read more than 8192 bytes in one fread()
- // the discussions at PHP Bugs suggest it's the intended behaviour
- while ($bytes > 0) {
- $chunk = fread($this->_fd, $bytes);
- $data .= $chunk;
- $bytes -= strlen($chunk);
- }
- $this->_pos = ftell($this->_fd);
-
- return $data;
- } else return '';
- }
-
- function seekto($pos) {
- fseek($this->_fd, $pos);
- $this->_pos = ftell($this->_fd);
- return $this->_pos;
- }
-
- function currentpos() {
- return $this->_pos;
- }
-
- function length() {
- return $this->_length;
- }
-
- function close() {
- fclose($this->_fd);
- }
-
-}
-
-// Preloads entire file in memory first, then creates a StringReader
-// over it (it assumes knowledge of StringReader internals)
-class CachedFileReader extends StringReader {
- function CachedFileReader($filename) {
- parent::StringReader();
-
- if (file_exists($filename)) {
-
- $length=filesize($filename);
- $fd = fopen($filename,'rb');
-
- if (!$fd) {
- $this->error = 3; // Cannot read file, probably permissions
- return false;
- }
- $this->_str = fread($fd, $length);
- fclose($fd);
-
- } else {
- $this->error = 2; // File doesn't exist
- return false;
- }
- }
-}
-
-
-?>
*/
function &get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') {
global $wpdb;
+ $null = null;
if ( empty($term) ) {
$error = new WP_Error('invalid_term', __('Empty Term'));
$term = (int) $term;
if ( ! $_term = wp_cache_get($term, $taxonomy) ) {
$_term = $wpdb->get_row( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = %s AND t.term_id = %s LIMIT 1", $taxonomy, $term) );
+ if ( ! $_term )
+ return $null;
wp_cache_add($term, $_term, $taxonomy);
}
}
foreach ( (array) $taxonomies as $taxonomy ) {
$tt_ids = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids');
$in_tt_ids = "'" . implode("', '", $tt_ids) . "'";
+ do_action( 'delete_term_relationships', $object_id, $tt_ids );
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)", $object_id) );
+ do_action( 'deleted_term_relationships', $object_id, $tt_ids );
wp_update_term_count($tt_ids, $taxonomy);
}
}
return $term_obj;
$parent = $term_obj->parent;
+ $edit_tt_ids = $wpdb->get_col( "SELECT `term_taxonomy_id` FROM $wpdb->term_taxonomy WHERE `parent` = " . (int)$term_obj->term_id );
+ do_action( 'edit_term_taxonomies', $edit_tt_ids );
$wpdb->update( $wpdb->term_taxonomy, compact( 'parent' ), array( 'parent' => $term_obj->term_id) + compact( 'taxonomy' ) );
+ do_action( 'edited_term_taxonomies', $edit_tt_ids );
}
$objects = $wpdb->get_col( $wpdb->prepare( "SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $tt_id ) );
wp_set_object_terms($object, $terms, $taxonomy);
}
+ do_action( 'delete_term_taxonomy', $tt_id );
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", $tt_id ) );
+ do_action( 'deleted_term_taxonomy', $tt_id );
// Delete the term if no taxonomies use it.
if ( !$wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_taxonomy WHERE term_id = %d", $term) ) )
} else {
// The alias isn't in a group, so let's create a new one and firstly add the alias term to it.
$term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms") + 1;
+ do_action( 'edit_terms', $alias->term_id );
$wpdb->update($wpdb->terms, compact('term_group'), array('term_id' => $alias->term_id) );
+ do_action( 'edited_terms', $alias->term_id );
}
}
if ( empty($slug) ) {
$slug = sanitize_title($slug, $term_id);
+ do_action( 'edit_terms', $term_id );
$wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) );
+ do_action( 'edited_terms', $term_id );
}
$tt_id = $wpdb->get_var( $wpdb->prepare( "SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id ) );
$wpdb->insert( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent') + array( 'count' => 0 ) );
$tt_id = (int) $wpdb->insert_id;
- do_action("create_term", $term_id, $tt_id);
+ do_action("create_term", $term_id, $tt_id, $taxonomy);
do_action("create_$taxonomy", $term_id, $tt_id);
$term_id = apply_filters('term_id_filter', $term_id, $tt_id);
clean_term_cache($term_id, $taxonomy);
- do_action("created_term", $term_id, $tt_id);
+ do_action("created_term", $term_id, $tt_id, $taxonomy);
do_action("created_$taxonomy", $term_id, $tt_id);
return array('term_id' => $term_id, 'term_taxonomy_id' => $tt_id);
if ( $wpdb->get_var( $wpdb->prepare( "SELECT term_taxonomy_id FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id = %d", $object_id, $tt_id ) ) )
continue;
+ do_action( 'add_term_relationship', $object_id, $tt_id );
$wpdb->insert( $wpdb->term_relationships, array( 'object_id' => $object_id, 'term_taxonomy_id' => $tt_id ) );
+ do_action( 'added_term_relationship', $object_id, $tt_id );
}
wp_update_term_count($tt_ids, $taxonomy);
$delete_terms = array_diff($old_tt_ids, $tt_ids);
if ( $delete_terms ) {
$in_delete_terms = "'" . implode("', '", $delete_terms) . "'";
+ do_action( 'delete_term_relationships', $object_id, $delete_terms );
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_delete_terms)", $object_id) );
+ do_action( 'deleted_term_relationships', $object_id, $delete_terms );
wp_update_term_count($delete_terms, $taxonomy);
}
}
$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)");
}
- do_action('set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append);
+ do_action('set_object_terms', $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids);
return $tt_ids;
}
} else {
// The alias isn't in a group, so let's create a new one and firstly add the alias term to it.
$term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms") + 1;
+ do_action( 'edit_terms', $alias->term_id );
$wpdb->update( $wpdb->terms, compact('term_group'), array( 'term_id' => $alias->term_id ) );
+ do_action( 'edited_terms', $alias->term_id );
}
}
else
return new WP_Error('duplicate_term_slug', sprintf(__('The slug “%s” is already in use by another term'), $slug));
}
-
+ do_action( 'edit_terms', $term_id );
$wpdb->update($wpdb->terms, compact( 'name', 'slug', 'term_group' ), compact( 'term_id' ) );
-
if ( empty($slug) ) {
$slug = sanitize_title($name, $term_id);
$wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) );
}
+ do_action( 'edited_terms', $term_id );
$tt_id = $wpdb->get_var( $wpdb->prepare( "SELECT tt.term_taxonomy_id FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.term_id = %d", $taxonomy, $term_id) );
-
+ do_action( 'edit_term_taxonomy', $tt_id );
$wpdb->update( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent' ), array( 'term_taxonomy_id' => $tt_id ) );
+ do_action( 'edited_term_taxonomy', $tt_id );
- do_action("edit_term", $term_id, $tt_id);
+ do_action("edit_term", $term_id, $tt_id, $taxonomy);
do_action("edit_$taxonomy", $term_id, $tt_id);
$term_id = apply_filters('term_id_filter', $term_id, $tt_id);
clean_term_cache($term_id, $taxonomy);
- do_action("edited_term", $term_id, $tt_id);
+ do_action("edited_term", $term_id, $tt_id, $taxonomy);
do_action("edited_$taxonomy", $term_id, $tt_id);
return array('term_id' => $term_id, 'term_taxonomy_id' => $tt_id);
// Default count updater
foreach ( (array) $terms as $term) {
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $term) );
+ do_action( 'edit_term_taxonomy', $term );
$wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) );
+ do_action( 'edited_term_taxonomy', $term );
}
}
foreach ( (array) $terms as $term ) {
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type = 'post' AND term_taxonomy_id = %d", $term ) );
+ do_action( 'edit_term_taxonomy', $term );
$wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) );
+ do_action( 'edited_term_taxonomy', $term );
}
}
$slug = $term->slug;
if ( empty($termlink) ) {
- $file = get_option('home') . '/';
+ $file = trailingslashit( get_option('home') );
$t = get_taxonomy($taxonomy);
if ( $t->query_var )
$termlink = "$file?$t->query_var=$slug";
*/
function get_stylesheet_directory() {
$stylesheet = get_stylesheet();
- $stylesheet_dir = get_theme_root() . "/$stylesheet";
- return apply_filters('stylesheet_directory', $stylesheet_dir, $stylesheet);
+ $theme_root = get_theme_root( $stylesheet );
+ $stylesheet_dir = "$theme_root/$stylesheet";
+
+ return apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );
}
/**
*/
function get_stylesheet_directory_uri() {
$stylesheet = get_stylesheet();
- $stylesheet_dir_uri = get_theme_root_uri() . "/$stylesheet";
- return apply_filters('stylesheet_directory_uri', $stylesheet_dir_uri, $stylesheet);
+ $theme_root_uri = get_theme_root_uri( $stylesheet );
+ $stylesheet_dir_uri = "$theme_root_uri/$stylesheet";
+
+ return apply_filters( 'stylesheet_directory_uri', $stylesheet_dir_uri, $stylesheet, $theme_root_uri );
}
/**
*/
function get_template_directory() {
$template = get_template();
- $template_dir = get_theme_root() . "/$template";
- return apply_filters('template_directory', $template_dir, $template);
+ $theme_root = get_theme_root( $template );
+ $template_dir = "$theme_root/$template";
+
+ return apply_filters( 'template_directory', $template_dir, $template, $theme_root );
}
/**
*/
function get_template_directory_uri() {
$template = get_template();
- $template_dir_uri = get_theme_root_uri() . "/$template";
- return apply_filters('template_directory_uri', $template_dir_uri, $template);
+ $theme_root_uri = get_theme_root_uri( $template );
+ $template_dir_uri = "$theme_root_uri/$template";
+
+ return apply_filters( 'template_directory_uri', $template_dir_uri, $template, $theme_root_uri );
}
/**
* @return array Theme data.
*/
function get_theme_data( $theme_file ) {
+ $default_headers = array(
+ 'Name' => 'Theme Name',
+ 'URI' => 'Theme URI',
+ 'Description' => 'Description',
+ 'Author' => 'Author',
+ 'AuthorURI' => 'Author URI',
+ 'Version' => 'Version',
+ 'Template' => 'Template',
+ 'Status' => 'Status',
+ 'Tags' => 'Tags'
+ );
+
$themes_allowed_tags = array(
'a' => array(
'href' => array(),'title' => array()
'strong' => array()
);
- $theme_data = implode( '', file( $theme_file ) );
- $theme_data = str_replace ( '\r', '\n', $theme_data );
- if ( preg_match( '|Theme Name:(.*)$|mi', $theme_data, $theme_name ) )
- $name = $theme = wp_kses( _cleanup_header_comment($theme_name[1]), $themes_allowed_tags );
- else
- $name = $theme = '';
+ $theme_data = get_file_data( $theme_file, $default_headers, 'theme' );
- if ( preg_match( '|Theme URI:(.*)$|mi', $theme_data, $theme_uri ) )
- $theme_uri = esc_url( _cleanup_header_comment($theme_uri[1]) );
- else
- $theme_uri = '';
+ $theme_data['Name'] = $theme_data['Title'] = wp_kses( $theme_data['Name'], $themes_allowed_tags );
- if ( preg_match( '|Description:(.*)$|mi', $theme_data, $description ) )
- $description = wptexturize( wp_kses( _cleanup_header_comment($description[1]), $themes_allowed_tags ) );
- else
- $description = '';
+ $theme_data['URI'] = esc_url( $theme_data['URI'] );
- if ( preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri ) )
- $author_uri = esc_url( _cleanup_header_comment($author_uri[1]) );
- else
- $author_uri = '';
+ $theme_data['Description'] = wptexturize( wp_kses( $theme_data['Description'], $themes_allowed_tags ) );
- if ( preg_match( '|Template:(.*)$|mi', $theme_data, $template ) )
- $template = wp_kses( _cleanup_header_comment($template[1]), $themes_allowed_tags );
- else
- $template = '';
+ $theme_data['AuthorURI'] = esc_url( $theme_data['AuthorURI'] );
- if ( preg_match( '|Version:(.*)|i', $theme_data, $version ) )
- $version = wp_kses( _cleanup_header_comment($version[1]), $themes_allowed_tags );
- else
- $version = '';
+ $theme_data['Template'] = wp_kses( $theme_data['Template'], $themes_allowed_tags );
- if ( preg_match('|Status:(.*)|i', $theme_data, $status) )
- $status = wp_kses( _cleanup_header_comment($status[1]), $themes_allowed_tags );
+ $theme_data['Version'] = wp_kses( $theme_data['Version'], $themes_allowed_tags );
+
+ if ( $theme_data['Status'] == '' )
+ $theme_data['Status'] = 'publish';
else
- $status = 'publish';
+ $theme_data['Status'] = wp_kses( $theme_data['Status'], $themes_allowed_tags );
- if ( preg_match('|Tags:(.*)|i', $theme_data, $tags) )
- $tags = array_map( 'trim', explode( ',', wp_kses( _cleanup_header_comment($tags[1]), array() ) ) );
+ if ( $theme_data['Tags'] == '' )
+ $theme_data['Tags'] = array();
else
- $tags = array();
+ $theme_data['Tags'] = array_map( 'trim', explode( ',', wp_kses( $theme_data['Tags'], array() ) ) );
- if ( preg_match( '|Author:(.*)$|mi', $theme_data, $author_name ) ) {
- if ( empty( $author_uri ) ) {
- $author = wp_kses( _cleanup_header_comment($author_name[1]), $themes_allowed_tags );
+ if ( $theme_data['Author'] == '' ) {
+ $theme_data['Author'] = __('Anonymous');
+ } else {
+ if ( empty( $theme_data['AuthorURI'] ) ) {
+ $theme_data['Author'] = wp_kses( $theme_data['Author'], $themes_allowed_tags );
} else {
- $author = sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', $author_uri, __( 'Visit author homepage' ), wp_kses( _cleanup_header_comment($author_name[1]), $themes_allowed_tags ) );
+ $theme_data['Author'] = sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', $theme_data['AuthorURI'], __( 'Visit author homepage' ), wp_kses( $theme_data['Author'], $themes_allowed_tags ) );
}
- } else {
- $author = __('Anonymous');
}
- return array( 'Name' => $name, 'Title' => $theme, 'URI' => $theme_uri, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Status' => $status, 'Tags' => $tags );
+ return $theme_data;
}
/**
if ( isset($wp_themes) )
return $wp_themes;
- $themes = array();
- $wp_broken_themes = array();
- $theme_loc = $theme_root = get_theme_root();
- if ( '/' != WP_CONTENT_DIR ) // don't want to replace all forward slashes, see Trac #4541
- $theme_loc = str_replace(WP_CONTENT_DIR, '', $theme_root);
+ /* Register the default root as a theme directory */
+ register_theme_directory( get_theme_root() );
- // Files in wp-content/themes directory and one subdir down
- $themes_dir = @ opendir($theme_root);
- if ( !$themes_dir )
+ if ( !$theme_files = search_theme_directories() )
return false;
- while ( ($theme_dir = readdir($themes_dir)) !== false ) {
- if ( is_dir($theme_root . '/' . $theme_dir) && is_readable($theme_root . '/' . $theme_dir) ) {
- if ( $theme_dir{0} == '.' || $theme_dir == '..' || $theme_dir == 'CVS' )
- continue;
- $stylish_dir = @ opendir($theme_root . '/' . $theme_dir);
- $found_stylesheet = false;
- while ( ($theme_file = readdir($stylish_dir)) !== false ) {
- if ( $theme_file == 'style.css' ) {
- $theme_files[] = $theme_dir . '/' . $theme_file;
- $found_stylesheet = true;
- break;
- }
- }
- @closedir($stylish_dir);
- if ( !$found_stylesheet ) { // look for themes in that dir
- $subdir = "$theme_root/$theme_dir";
- $subdir_name = $theme_dir;
- $theme_subdir = @ opendir( $subdir );
- while ( ($theme_dir = readdir($theme_subdir)) !== false ) {
- if ( is_dir( $subdir . '/' . $theme_dir) && is_readable($subdir . '/' . $theme_dir) ) {
- if ( $theme_dir{0} == '.' || $theme_dir == '..' || $theme_dir == 'CVS' )
- continue;
- $stylish_dir = @ opendir($subdir . '/' . $theme_dir);
- $found_stylesheet = false;
- while ( ($theme_file = readdir($stylish_dir)) !== false ) {
- if ( $theme_file == 'style.css' ) {
- $theme_files[] = $subdir_name . '/' . $theme_dir . '/' . $theme_file;
- $found_stylesheet = true;
- break;
- }
- }
- @closedir($stylish_dir);
- }
- }
- @closedir($theme_subdir);
- $wp_broken_themes[$theme_dir] = array('Name' => $theme_dir, 'Title' => $theme_dir, 'Description' => __('Stylesheet is missing.'));
- }
- }
- }
- if ( is_dir( $theme_dir ) )
- @closedir( $theme_dir );
-
- if ( !$themes_dir || !$theme_files )
- return $themes;
+ asort( $theme_files );
- sort($theme_files);
+ $wp_themes = array();
foreach ( (array) $theme_files as $theme_file ) {
+ $theme_root = $theme_file['theme_root'];
+ $theme_file = $theme_file['theme_file'];
+
if ( !is_readable("$theme_root/$theme_file") ) {
$wp_broken_themes[$theme_file] = array('Name' => $theme_file, 'Title' => $theme_file, 'Description' => __('File not readable.'));
continue;
}
if ( empty($template) ) {
- if ( file_exists(dirname("$theme_root/$theme_file/index.php")) )
- $template = dirname($theme_file);
+ if ( file_exists("$theme_root/$stylesheet/index.php") )
+ $template = $stylesheet;
else
continue;
}
- $template = trim($template);
+ $template = trim( $template );
if ( !file_exists("$theme_root/$template/index.php") ) {
$parent_dir = dirname(dirname($theme_file));
if ( file_exists("$theme_root/$parent_dir/$template/index.php") ) {
$template = "$parent_dir/$template";
+ $template_directory = "$theme_root/$template";
} else {
- $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.'));
- continue;
+ /**
+ * The parent theme doesn't exist in the current theme's folder or sub folder
+ * so lets use the theme root for the parent template.
+ */
+ if ( isset($theme_files[$template]) && file_exists( $theme_files[$template]['theme_root'] . "/$template/index.php" ) ) {
+ $template_directory = $theme_files[$template]['theme_root'] . "/$template";
+ } else {
+ $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.'));
+ continue;
+ }
+
}
+ } else {
+ $template_directory = trim( $theme_root . '/' . $template );
}
$stylesheet_files = array();
while ( ($file = $stylesheet_dir->read()) !== false ) {
if ( !preg_match('|^\.+$|', $file) ) {
if ( preg_match('|\.css$|', $file) )
- $stylesheet_files[] = "$theme_loc/$stylesheet/$file";
+ $stylesheet_files[] = "$theme_root/$stylesheet/$file";
elseif ( preg_match('|\.php$|', $file) )
- $template_files[] = "$theme_loc/$stylesheet/$file";
+ $template_files[] = "$theme_root/$stylesheet/$file";
}
}
@ $stylesheet_dir->close();
}
- $template_dir = @ dir("$theme_root/$template");
+ $template_dir = @ dir("$template_directory");
if ( $template_dir ) {
while ( ($file = $template_dir->read()) !== false ) {
if ( preg_match('|^\.+$|', $file) )
continue;
if ( preg_match('|\.php$|', $file) ) {
- $template_files[] = "$theme_loc/$template/$file";
- } elseif ( is_dir("$theme_root/$template/$file") ) {
- $template_subdir = @ dir("$theme_root/$template/$file");
+ $template_files[] = "$template_directory/$file";
+ } elseif ( is_dir("$template_directory/$file") ) {
+ $template_subdir = @ dir("$template_directory/$file");
+ if ( !$template_subdir )
+ continue;
while ( ($subfile = $template_subdir->read()) !== false ) {
if ( preg_match('|^\.+$|', $subfile) )
continue;
if ( preg_match('|\.php$|', $subfile) )
- $template_files[] = "$theme_loc/$template/$file/$subfile";
+ $template_files[] = "$template_directory/$file/$subfile";
}
@ $template_subdir->close();
}
@ $template_dir->close();
}
+ //Make unique and remove duplicates when stylesheet and template are the same i.e. most themes
+ $template_files = array_unique($template_files);
+ $stylesheet_files = array_unique($stylesheet_files);
+
$template_dir = dirname($template_files[0]);
$stylesheet_dir = dirname($stylesheet_files[0]);
// a new theme directory and the theme header is not updated. Whichever
// theme is first keeps the name. Subsequent themes get a suffix applied.
// The Default and Classic themes always trump their pretenders.
- if ( isset($themes[$name]) ) {
+ if ( isset($wp_themes[$name]) ) {
if ( ('WordPress Default' == $name || 'WordPress Classic' == $name) &&
('default' == $stylesheet || 'classic' == $stylesheet) ) {
// If another theme has claimed to be one of our default themes, move
// them aside.
- $suffix = $themes[$name]['Stylesheet'];
+ $suffix = $wp_themes[$name]['Stylesheet'];
$new_name = "$name/$suffix";
- $themes[$new_name] = $themes[$name];
- $themes[$new_name]['Name'] = $new_name;
+ $wp_themes[$new_name] = $wp_themes[$name];
+ $wp_themes[$new_name]['Name'] = $new_name;
} else {
$name = "$name/$stylesheet";
}
}
- $themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Stylesheet' => $stylesheet, 'Template Files' => $template_files, 'Stylesheet Files' => $stylesheet_files, 'Template Dir' => $template_dir, 'Stylesheet Dir' => $stylesheet_dir, 'Status' => $theme_data['Status'], 'Screenshot' => $screenshot, 'Tags' => $theme_data['Tags']);
+ $theme_roots[$stylesheet] = str_replace( WP_CONTENT_DIR, '', $theme_root );
+ $wp_themes[$name] = array( 'Name' => $name, 'Title' => $title, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template, 'Stylesheet' => $stylesheet, 'Template Files' => $template_files, 'Stylesheet Files' => $stylesheet_files, 'Template Dir' => $template_dir, 'Stylesheet Dir' => $stylesheet_dir, 'Status' => $theme_data['Status'], 'Screenshot' => $screenshot, 'Tags' => $theme_data['Tags'], 'Theme Root' => $theme_root, 'Theme Root URI' => str_replace( WP_CONTENT_DIR, content_url(), $theme_root ) );
}
- // Resolve theme dependencies.
- $theme_names = array_keys($themes);
+ unset($theme_files);
+
+ /* Store theme roots in the DB */
+ if ( get_site_transient( 'theme_roots' ) != $theme_roots )
+ set_site_transient( 'theme_roots', $theme_roots, 7200 ); // cache for two hours
+ unset($theme_roots);
+ /* Resolve theme dependencies. */
+ $theme_names = array_keys( $wp_themes );
foreach ( (array) $theme_names as $theme_name ) {
- $themes[$theme_name]['Parent Theme'] = '';
- if ( $themes[$theme_name]['Stylesheet'] != $themes[$theme_name]['Template'] ) {
+ $wp_themes[$theme_name]['Parent Theme'] = '';
+ if ( $wp_themes[$theme_name]['Stylesheet'] != $wp_themes[$theme_name]['Template'] ) {
foreach ( (array) $theme_names as $parent_theme_name ) {
- if ( ($themes[$parent_theme_name]['Stylesheet'] == $themes[$parent_theme_name]['Template']) && ($themes[$parent_theme_name]['Template'] == $themes[$theme_name]['Template']) ) {
- $themes[$theme_name]['Parent Theme'] = $themes[$parent_theme_name]['Name'];
+ if ( ($wp_themes[$parent_theme_name]['Stylesheet'] == $wp_themes[$parent_theme_name]['Template']) && ($wp_themes[$parent_theme_name]['Template'] == $wp_themes[$theme_name]['Template']) ) {
+ $wp_themes[$theme_name]['Parent Theme'] = $wp_themes[$parent_theme_name]['Name'];
break;
}
}
}
}
- $wp_themes = $themes;
+ return $wp_themes;
+}
- return $themes;
+/**
+ * Retrieve theme roots.
+ *
+ * @since 2.9.0
+ *
+ * @return array Theme roots
+ */
+function get_theme_roots() {
+ $theme_roots = get_site_transient( 'theme_roots' );
+ if ( false === $theme_roots ) {
+ get_themes();
+ $theme_roots = get_site_transient( 'theme_roots' ); // this is set in get_theme()
+ }
+ return $theme_roots;
}
/**
return $current_theme;
}
+/**
+ * Register a directory that contains themes.
+ *
+ * @since 2.9.0
+ *
+ * @param string $directory Either the full filesystem path to a theme folder or a folder within WP_CONTENT_DIR
+ * @return bool
+ */
+function register_theme_directory( $directory) {
+ global $wp_theme_directories;
+
+ /* If this folder does not exist, return and do not register */
+ if ( !file_exists( $directory ) )
+ /* Try prepending as the theme directory could be relative to the content directory */
+ $registered_directory = WP_CONTENT_DIR . '/' . $directory;
+ else
+ $registered_directory = $directory;
+
+ /* If this folder does not exist, return and do not register */
+ if ( !file_exists( $registered_directory ) )
+ return false;
+
+ $wp_theme_directories[] = $registered_directory;
+
+ return true;
+}
+
+/**
+ * Search all registered theme directories for complete and valid themes.
+ *
+ * @since 2.9.0
+ *
+ * @return array Valid themes found
+ */
+function search_theme_directories() {
+ global $wp_theme_directories, $wp_broken_themes;
+ if ( empty( $wp_theme_directories ) )
+ return false;
+
+ $theme_files = array();
+ $wp_broken_themes = array();
+
+ /* Loop the registered theme directories and extract all themes */
+ foreach ( (array) $wp_theme_directories as $theme_root ) {
+ $theme_loc = $theme_root;
+
+ /* We don't want to replace all forward slashes, see Trac #4541 */
+ if ( '/' != WP_CONTENT_DIR )
+ $theme_loc = str_replace(WP_CONTENT_DIR, '', $theme_root);
+
+ /* Files in the root of the current theme directory and one subdir down */
+ $themes_dir = @ opendir($theme_root);
+
+ if ( !$themes_dir )
+ return false;
+
+ while ( ($theme_dir = readdir($themes_dir)) !== false ) {
+ if ( is_dir($theme_root . '/' . $theme_dir) && is_readable($theme_root . '/' . $theme_dir) ) {
+ if ( $theme_dir{0} == '.' || $theme_dir == 'CVS' )
+ continue;
+
+ $stylish_dir = @opendir($theme_root . '/' . $theme_dir);
+ $found_stylesheet = false;
+
+ while ( ($theme_file = readdir($stylish_dir)) !== false ) {
+ if ( $theme_file == 'style.css' ) {
+ $theme_files[$theme_dir] = array( 'theme_file' => $theme_dir . '/' . $theme_file, 'theme_root' => $theme_root );
+ $found_stylesheet = true;
+ break;
+ }
+ }
+ @closedir($stylish_dir);
+
+ if ( !$found_stylesheet ) { // look for themes in that dir
+ $subdir = "$theme_root/$theme_dir";
+ $subdir_name = $theme_dir;
+ $theme_subdirs = @opendir( $subdir );
+
+ $found_subdir_themes = false;
+ while ( ($theme_subdir = readdir($theme_subdirs)) !== false ) {
+ if ( is_dir( $subdir . '/' . $theme_subdir) && is_readable($subdir . '/' . $theme_subdir) ) {
+ if ( $theme_subdir{0} == '.' || $theme_subdir == 'CVS' )
+ continue;
+
+ $stylish_dir = @opendir($subdir . '/' . $theme_subdir);
+ $found_stylesheet = false;
+
+ while ( ($theme_file = readdir($stylish_dir)) !== false ) {
+ if ( $theme_file == 'style.css' ) {
+ $theme_files["$theme_dir/$theme_subdir"] = array( 'theme_file' => $subdir_name . '/' . $theme_subdir . '/' . $theme_file, 'theme_root' => $theme_root );
+ $found_stylesheet = true;
+ $found_subdir_themes = true;
+ break;
+ }
+ }
+ @closedir($stylish_dir);
+ }
+ }
+ @closedir($theme_subdir);
+ if ( !$found_subdir_themes )
+ $wp_broken_themes[$theme_dir] = array('Name' => $theme_dir, 'Title' => $theme_dir, 'Description' => __('Stylesheet is missing.'));
+ }
+ }
+ }
+ if ( is_dir( $theme_dir ) )
+ @closedir( $theme_dir );
+ }
+ return $theme_files;
+}
+
/**
* Retrieve path to themes directory.
*
* Does not have trailing slash.
*
* @since 1.5.0
+ * @param $stylesheet_or_template The stylesheet or template name of the theme
* @uses apply_filters() Calls 'theme_root' filter on path.
*
* @return string Theme path.
*/
-function get_theme_root() {
- return apply_filters('theme_root', WP_CONTENT_DIR . "/themes");
+function get_theme_root( $stylesheet_or_template = false ) {
+ if ($stylesheet_or_template) {
+ $theme_roots = get_theme_roots();
+
+ if ( $theme_roots[$stylesheet_or_template] )
+ $theme_root = WP_CONTENT_DIR . $theme_roots[$stylesheet_or_template];
+ else
+ $theme_root = WP_CONTENT_DIR . '/themes';
+ } else {
+ $theme_root = WP_CONTENT_DIR . '/themes';
+ }
+
+ return apply_filters( 'theme_root', $theme_root );
}
/**
* Does not have trailing slash.
*
* @since 1.5.0
+ * @param $stylesheet_or_template The stylesheet or template name of the theme
*
* @return string Themes URI.
*/
-function get_theme_root_uri() {
- return apply_filters('theme_root_uri', content_url('themes'), get_option('siteurl'));
+function get_theme_root_uri( $stylesheet_or_template = false ) {
+ $theme_roots = get_theme_roots();
+
+ if ( $theme_roots[$stylesheet_or_template] )
+ $theme_root_uri = content_url( $theme_roots[$stylesheet_or_template] );
+ else
+ $theme_root_uri = content_url( 'themes' );
+
+ return apply_filters( 'theme_root_uri', $theme_root_uri, get_option('siteurl'), $stylesheet_or_template );
}
/**
/**
* Retrieve path of category template in current or parent template.
*
- * Works by retrieving the current category ID, for example 'category-1.php' and
- * will fallback to category.php template, if the ID category file doesn't
- * exist.
+ * Works by first retrieving the current slug for example 'category-default.php' and then
+ * trying category ID, for example 'category-1.php' and will finally fallback to category.php
+ * template, if those files don't exist.
*
* @since 1.5.0
* @uses apply_filters() Calls 'category_template' on file path of category template.
* @return string
*/
function get_category_template() {
- $template = locate_template(array("category-" . absint( get_query_var('cat') ) . '.php', 'category.php'));
+ $cat_ID = absint( get_query_var('cat') );
+ $category = get_category( $cat_ID );
+
+ $templates = array();
+
+ if ( !is_wp_error($category) )
+ $templates[] = "category-{$category->slug}.php";
+
+ $templates[] = "category-$cat_ID.php";
+ $templates[] = "category.php";
+
+ $template = locate_template($templates);
return apply_filters('category_template', $template);
}
/**
* Retrieve path of tag template in current or parent template.
*
- * Works by retrieving the current tag name, for example 'tag-wordpress.php' and will
- * fallback to tag.php template, if the name tag file doesn't exist.
+ * Works by first retrieving the current tag name, for example 'tag-wordpress.php' and then
+ * trying tag ID, for example 'tag-1.php' and will finally fallback to tag.php
+ * template, if those files don't exist.
*
* @since 2.3.0
* @uses apply_filters() Calls 'tag_template' on file path of tag template.
* @return string
*/
function get_tag_template() {
- $template = locate_template(array("tag-" . get_query_var('tag') . '.php', 'tag.php'));
+ $tag_id = absint( get_query_var('tag_id') );
+ $tag_name = get_query_var('tag');
+
+ $templates = array();
+
+ if ( $tag_name )
+ $templates[] = "tag-$tag_name.php";
+ if ( $tag_id )
+ $templates[] = "tag-$tag_id.php";
+ $templates[] = "tag.php";
+
+ $template = locate_template($templates);
return apply_filters('tag_template', $template);
}
/**
* Retrieve path of page template in current or parent template.
*
- * First attempt is to look for the file in the '_wp_page_template' page meta
- * data. The second attempt, if the first has a file and is not empty, is to
- * look for 'page.php'.
+ * Will first look for the specifically assigned page template
+ * The will search for 'page-{slug}.php' followed by 'page-id.php'
+ * and finally 'page.php'
*
* @since 1.5.0
*
$id = (int) $wp_query->post->ID;
$template = get_post_meta($id, '_wp_page_template', true);
+ $pagename = get_query_var('pagename');
if ( 'default' == $template )
$template = '';
$templates = array();
if ( !empty($template) && !validate_file($template) )
$templates[] = $template;
-
+ if ( $pagename )
+ $templates[] = "page-$pagename.php";
+ if ( $id )
+ $templates[] = "page-$id.php";
$templates[] = "page.php";
return apply_filters('page_template', locate_template($templates));
* Will only preform task if the user has permissions and template and preview
* query variables exist.
*
- * @since 2.5.0
+ * @since 2.6.0
*/
function preview_theme() {
if ( ! (isset($_GET['template']) && isset($_GET['preview'])) )
/**
* Private function to modify the current template when previewing a theme
- *
+ *
+ * @since 2.9.0
+ * @access private
+ *
* @return string
*/
function _preview_theme_template_filter() {
/**
* Private function to modify the current stylesheet when previewing a theme
- *
+ *
+ * @since 2.9.0
+ * @access private
+ *
* @return string
*/
function _preview_theme_stylesheet_filter() {
/**
* Callback function for ob_start() to capture all links in the theme.
*
- * @since unknown
+ * @since 2.6.0
* @access private
*
* @param string $content
*
* Callback function for preg_replace_callback() to accept and filter matches.
*
- * @since unknown
+ * @since 2.6.0
* @access private
*
* @param array $matches
add_action('admin_menu', array(&$GLOBALS['custom_image_header'], 'init'));
}
+/**
+ * Allows a theme to register its support of a certain feature
+ *
+ * Must be called in the themes functions.php file to work.
+ *
+ * @author Mark Jaquith
+ * @since 2.9
+ * @param string $feature the feature being added
+ */
+function add_theme_support( $feature ) {
+ global $_wp_theme_features;
+
+ if ( func_num_args() == 1 )
+ $_wp_theme_features[$feature] = true;
+ else
+ $_wp_theme_features[$feature] = array_slice( func_get_args(), 1 );
+}
+
+/**
+ * Checks a theme's support for a given feature
+ *
+ * @author Mark Jaquith
+ * @since 2.9
+ * @param string $feature the feature being checked
+ * @return boolean
+ */
+
+function current_theme_supports( $feature ) {
+ global $_wp_theme_features;
+
+ if ( !isset( $_wp_theme_features[$feature] ) )
+ return false;
+
+ // If no args passed then no extra checks need be performed
+ if ( func_num_args() <= 1 )
+ return true;
+
+ $args = array_slice( func_get_args(), 1 );
+
+ // @todo Allow pluggable arg checking
+ switch ( $feature ) {
+ case 'post-thumbnails':
+ // post-thumbnails can be registered for only certain content/post types by passing
+ // an array of types to add_theme_support(). If no array was passed, then
+ // any type is accepted
+ if ( true === $_wp_theme_features[$feature] ) // Registered for all types
+ return true;
+ $content_type = $args[0];
+ if ( in_array($content_type, $_wp_theme_features[$feature][0]) )
+ return true;
+ else
+ return false;
+ break;
+ }
+
+ return true;
+}
+
+/**
+ * Checks a theme's support for a given feature before loading the functions which implement it.
+ *
+ * @author Peter Westwood
+ * @since 2.9
+ * @param string $feature the feature being checked
+ * @param string $include the file containing the functions that implement the feature
+ */
+function require_if_theme_supports( $feature, $include) {
+ if ( current_theme_supports( $feature ) )
+ require ( $include );
+}
+
?>
set_transient( 'update_core', $current );
if ( method_exists( $wpdb, 'db_version' ) )
- $mysql_version = preg_replace('/[^0-9.].*/', '', $wpdb->db_version($wpdb->users));
+ $mysql_version = preg_replace('/[^0-9.].*/', '', $wpdb->db_version());
else
$mysql_version = 'N/A';
$local_package = isset( $wp_local_package )? $wp_local_package : '';
$url = "http://api.wordpress.org/core/version-check/1.3/?version=$wp_version&php=$php_version&locale=$locale&mysql=$mysql_version&local_package=$local_package";
$options = array(
- 'timeout' => 3,
+ 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3),
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
);
$to_send = (object)compact('plugins', 'active');
$options = array(
- 'timeout' => 3,
+ 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3),
'body' => array( 'plugins' => serialize( $to_send ) ),
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
);
$timeout = 'load-themes.php' == current_filter() ? 3600 : 43200; //Check for updated every 60 minutes if hitting the themes page, Else, check every 12 hours
$time_not_changed = isset( $current_theme->last_checked ) && $timeout > ( time( ) - $current_theme->last_checked );
- if( $time_not_changed )
- return false;
-
- // Update last_checked for current to prevent multiple blocking requests if request hangs
- $current_theme->last_checked = time();
- set_transient( 'update_themes', $current_theme );
-
- $current_theme->template = get_option( 'template' );
-
- $themes = array( );
+ $themes = array();
+ $checked = array();
$themes['current_theme'] = (array) $current_theme;
foreach( (array) $installed_themes as $theme_title => $theme ) {
- $themes[$theme['Stylesheet']] = array( );
+ $themes[$theme['Stylesheet']] = array();
+ $checked[$theme['Stylesheet']] = $theme['Version'];
foreach( (array) $theme as $key => $value ) {
$themes[$theme['Stylesheet']][$key] = $value;
}
}
+ $theme_changed = false;
+ foreach ( $checked as $slug => $v ) {
+ $new_option->checked[ $slug ] = $v;
+
+ if ( !isset( $current_theme->checked[ $slug ] ) || strval($current_theme->checked[ $slug ]) !== strval($v) )
+ $theme_changed = true;
+ }
+
+ if ( isset ( $current_theme->response ) && is_array( $current_theme->response ) ) {
+ foreach ( $current_theme->response as $slug => $update_details ) {
+ if ( ! isset($checked[ $slug ]) ) {
+ $theme_changed = true;
+ break;
+ }
+ }
+ }
+
+ if( $time_not_changed && !$theme_changed )
+ return false;
+
+ // Update last_checked for current to prevent multiple blocking requests if request hangs
+ $current_theme->last_checked = time();
+ set_transient( 'update_themes', $current_theme );
+
+ $current_theme->template = get_option( 'template' );
+
$options = array(
- 'timeout' => 3,
+ 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3),
'body' => array( 'themes' => serialize( $themes ) ),
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
);
return false;
$response = unserialize( $raw_response['body'] );
- if( $response )
+ if( $response ) {
+ $new_option->checked = $checked;
$new_option->response = $response;
+ }
set_transient( 'update_themes', $new_option );
}
if( isset( $current->last_checked ) && 43200 > ( time( ) - $current->last_checked ) )
return;
- wp_update_themes( );
+ wp_update_themes();
}
add_action( 'admin_init', '_maybe_update_core' );
add_action( 'load-plugins.php', 'wp_update_plugins' );
add_action( 'load-update.php', 'wp_update_plugins' );
+add_action( 'load-update-core.php', 'wp_update_plugins' );
add_action( 'admin_init', '_maybe_update_plugins' );
add_action( 'wp_update_plugins', 'wp_update_plugins' );
function get_profile($field, $user = false) {
global $wpdb;
if ( !$user )
- $user = $wpdb->escape($_COOKIE[USER_COOKIE]);
+ $user = esc_sql( $_COOKIE[USER_COOKIE] );
return $wpdb->get_var( $wpdb->prepare("SELECT $field FROM $wpdb->users WHERE user_login = %s", $user) );
}
$meta_value = serialize($meta_value);
$meta_value = trim( $meta_value );
+ $cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
+
+ if ( $cur && $cur->umeta_id )
+ do_action( 'delete_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
+
if ( ! empty($meta_value) )
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $user_id, $meta_key, $meta_value) );
else
wp_cache_delete($user_id, 'users');
+ if ( $cur && $cur->umeta_id )
+ do_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
+
return true;
}
}
$cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) );
+
+ if ( $cur )
+ do_action( 'update_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
+
if ( !$cur )
$wpdb->insert($wpdb->usermeta, compact('user_id', 'meta_key', 'meta_value') );
else if ( $cur->meta_value != $meta_value )
wp_cache_delete($user_id, 'users');
+ if ( !$cur )
+ do_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value );
+ else
+ do_action( 'updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
+
return true;
}
* @global string $user_pass_md5 MD5 of the user's password
* @global string $user_identity The display name of the user
*
- * @param int $user_id Optional. User ID to setup global data.
+ * @param int $for_user_id Optional. User ID to setup global data.
*/
-function setup_userdata($user_id = '') {
+function setup_userdata($for_user_id = '') {
global $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_pass_md5, $user_identity;
- if ( '' == $user_id )
+ if ( '' == $for_user_id )
$user = wp_get_current_user();
else
- $user = new WP_User($user_id);
+ $user = new WP_User($for_user_id);
if ( 0 == $user->ID )
return;
$userdata = $user->data;
$user_login = $user->user_login;
$user_level = (int) isset($user->user_level) ? $user->user_level : 0;
- $user_ID = (int) $user->ID;
+ $user_ID = (int) $user->ID;
$user_email = $user->user_email;
$user_url = $user->user_url;
$user_pass_md5 = md5($user->user_pass);
wp_cache_add($user->user_nicename, $user->ID, 'userslugs');
}
+/**
+ * Sanitize every user field.
+ *
+ * If the context is 'raw', then the user object or array will get minimal santization of the int fields.
+ *
+ * @since 2.3.0
+ * @uses sanitize_user_field() Used to sanitize the fields.
+ *
+ * @param object|array $user The User Object or Array
+ * @param string $context Optional, default is 'display'. How to sanitize user fields.
+ * @return object|array The now sanitized User Object or Array (will be the same type as $user)
+ */
+function sanitize_user_object($user, $context = 'display') {
+ if ( is_object($user) ) {
+ if ( !isset($user->ID) )
+ $user->ID = 0;
+ if ( isset($user->data) )
+ $vars = get_object_vars( $user->data );
+ else
+ $vars = get_object_vars($user);
+ foreach ( array_keys($vars) as $field ) {
+ if ( is_array($user->$field) )
+ continue;
+ $user->$field = sanitize_user_field($field, $user->$field, $user->ID, $context);
+ }
+ $user->filter = $context;
+ } else {
+ if ( !isset($user['ID']) )
+ $user['ID'] = 0;
+ foreach ( array_keys($user) as $field )
+ $user[$field] = sanitize_user_field($field, $user[$field], $user['ID'], $context);
+ $user['filter'] = $context;
+ }
+
+ return $user;
+}
+
+/**
+ * Sanitize user field based on context.
+ *
+ * Possible context values are: 'raw', 'edit', 'db', 'display', 'attribute' and 'js'. The
+ * 'display' context is used by default. 'attribute' and 'js' contexts are treated like 'display'
+ * when calling filters.
+ *
+ * @since 2.3.0
+ * @uses apply_filters() Calls 'edit_$field' and '${field_no_prefix}_edit_pre' passing $value and
+ * $user_id if $context == 'edit' and field name prefix == 'user_'.
+ *
+ * @uses apply_filters() Calls 'edit_user_$field' passing $value and $user_id if $context == 'db'.
+ * @uses apply_filters() Calls 'pre_$field' passing $value if $context == 'db' and field name prefix == 'user_'.
+ * @uses apply_filters() Calls '${field}_pre' passing $value if $context == 'db' and field name prefix != 'user_'.
+ *
+ * @uses apply_filters() Calls '$field' passing $value, $user_id and $context if $context == anything
+ * other than 'raw', 'edit' and 'db' and field name prefix == 'user_'.
+ * @uses apply_filters() Calls 'user_$field' passing $value if $context == anything other than 'raw',
+ * 'edit' and 'db' and field name prefix != 'user_'.
+ *
+ * @param string $field The user Object field name.
+ * @param mixed $value The user Object value.
+ * @param int $user_id user ID.
+ * @param string $context How to sanitize user fields. Looks for 'raw', 'edit', 'db', 'display',
+ * 'attribute' and 'js'.
+ * @return mixed Sanitized value.
+ */
+function sanitize_user_field($field, $value, $user_id, $context) {
+ $int_fields = array('ID');
+ if ( in_array($field, $int_fields) )
+ $value = (int) $value;
+
+ if ( 'raw' == $context )
+ return $value;
+
+ if ( is_array($value) )
+ return $value;
+
+ $prefixed = false;
+ if ( false !== strpos($field, 'user_') ) {
+ $prefixed = true;
+ $field_no_prefix = str_replace('user_', '', $field);
+ }
+
+ if ( 'edit' == $context ) {
+ if ( $prefixed ) {
+ $value = apply_filters("edit_$field", $value, $user_id);
+ } else {
+ $value = apply_filters("edit_user_$field", $value, $user_id);
+ }
+
+ if ( 'description' == $field )
+ $value = esc_html($value);
+ else
+ $value = esc_attr($value);
+ } else if ( 'db' == $context ) {
+ if ( $prefixed ) {
+ $value = apply_filters("pre_$field", $value);
+ } else {
+ $value = apply_filters("pre_user_$field", $value);
+ }
+ } else {
+ // Use display filters by default.
+ if ( $prefixed )
+ $value = apply_filters($field, $value, $user_id, $context);
+ else
+ $value = apply_filters("user_$field", $value, $user_id, $context);
+ }
+
+ if ( 'user_url' == $field )
+ $value = esc_url($value);
+
+ if ( 'attribute' == $context )
+ $value = esc_attr($value);
+ else if ( 'js' == $context )
+ $value = esc_js($value);
+
+ return $value;
+}
+
?>
// Simple browser detection
$is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = $is_safari = $is_chrome = $is_iphone = false;
-if (strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false) {
- $is_lynx = true;
-} elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'chrome') !== false ) {
- $is_chrome = true;
-} elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false ) {
- $is_safari = true;
-} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false) {
- $is_gecko = true;
-} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Win') !== false) {
- $is_winIE = true;
-} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
- $is_macIE = true;
-} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false) {
- $is_opera = true;
-} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Nav') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.') !== false) {
- $is_NS4 = true;
+if ( isset($_SERVER['HTTP_USER_AGENT']) ) {
+ if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false ) {
+ $is_lynx = true;
+ } elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'chrome') !== false ) {
+ $is_chrome = true;
+ } elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false ) {
+ $is_safari = true;
+ } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false ) {
+ $is_gecko = true;
+ } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Win') !== false ) {
+ $is_winIE = true;
+ } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false ) {
+ $is_macIE = true;
+ } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false ) {
+ $is_opera = true;
+ } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Nav') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.') !== false ) {
+ $is_NS4 = true;
+ }
}
if ( $is_safari && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'mobile') !== false )
*
* @global string $wp_version
*/
-$wp_version = '2.8.5';
+$wp_version = '2.9';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
*
* @global int $wp_db_version
*/
-$wp_db_version = 11548;
+$wp_db_version = 12329;
/**
* Holds the TinyMCE version
*
* @global string $tinymce_version
*/
-$tinymce_version = '3241-1141';
+$tinymce_version = '327-1235';
/**
* Holds the cache manifest version
* @global string $manifest_version
*/
$manifest_version = '20090616';
+
+/**
+ * Holds the required PHP version
+ *
+ * @global string $required_php_version
+ */
+$required_php_version = '4.3';
+
+/**
+ * Holds the required MySQL version
+ *
+ * @global string $required_mysql_version
+ */
+$required_mysql_version = '4.1.2';
function _register() {
$settings = $this->get_settings();
+ $empty = true;
- if ( empty($settings) ) {
- // If there are none, we register the widget's existance with a
- // generic template
- $this->_set(1);
- $this->_register_one();
- } elseif ( is_array($settings) ) {
+ if ( is_array($settings) ) {
foreach ( array_keys($settings) as $number ) {
if ( is_numeric($number) ) {
$this->_set($number);
$this->_register_one($number);
+ $empty = false;
}
}
}
+
+ if ( $empty ) {
+ // If there are none, we register the widget's existance with a
+ // generic template
+ $this->_set(1);
+ $this->_register_one();
+ }
}
function _set($number) {
$defaults = array(
'name' => sprintf(__('Sidebar %d'), $i ),
'id' => "sidebar-$i",
+ 'description' => '',
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => "</li>\n",
'before_title' => '<h2 class="widgettitle">',
return esc_html( $wp_registered_widgets[$id]['description'] );
}
+/**
+ * Retrieve description for a sidebar.
+ *
+ * When registering sidebars a 'description' parameter can be included that
+ * describes the sidebar for display on the widget administration panel.
+ *
+ * @since 2.9.0
+ *
+ * @param int|string $id sidebar ID.
+ * @return string Sidebar description, if available. Null on failure to retrieve description.
+ */
+function wp_sidebar_description( $id ) {
+ if ( !is_scalar($id) )
+ return;
+
+ global $wp_registered_sidebars;
+
+ if ( isset($wp_registered_sidebars[$id]['description']) )
+ return esc_html( $wp_registered_sidebars[$id]['description'] );
+}
+
+
/**
* Remove widget from sidebar.
*
$sidebars_widgets = get_option('sidebars_widgets', array());
$_sidebars_widgets = array();
- if ( isset($sidebars_widgets['wp_inactive_widgets']) )
+ if ( isset($sidebars_widgets['wp_inactive_widgets']) || empty($sidebars_widgets) )
$sidebars_widgets['array_version'] = 3;
elseif ( !isset($sidebars_widgets['array_version']) )
$sidebars_widgets['array_version'] = 1;
*/
var $postmeta;
+ /**
+ * WordPress Comment Metadata table
+ *
+ * @since 2.9
+ * @access public
+ * @var string
+ */
+ var $commentmeta;
+
/**
* WordPress User Metadata table
*
* @var array
*/
var $tables = array('users', 'usermeta', 'posts', 'categories', 'post2cat', 'comments', 'links', 'link2cat', 'options',
- 'postmeta', 'terms', 'term_taxonomy', 'term_relationships');
+ 'postmeta', 'terms', 'term_taxonomy', 'term_relationships', 'commentmeta');
+
+ /**
+ * List of deprecated WordPress tables
+ *
+ * @since 2.9.0
+ * @access private
+ * @var array
+ */
+ var $old_tables = array('categories', 'post2cat', 'link2cat');
+
/**
* Format specifiers for DB columns. Columns not listed here default to %s. Initialized in wp-settings.php.
*/
var $real_escape = false;
+ /**
+ * Database Username
+ *
+ * @since 2.9.0
+ * @access private
+ * @var string
+ */
+ var $dbuser;
+
/**
* Connects to the database server and selects a database
*
function __construct($dbuser, $dbpassword, $dbname, $dbhost) {
register_shutdown_function(array(&$this, "__destruct"));
- if ( defined('WP_DEBUG') and WP_DEBUG == true )
+ if ( WP_DEBUG )
$this->show_errors();
if ( defined('DB_CHARSET') )
if ( defined('DB_COLLATE') )
$this->collate = DB_COLLATE;
+ $this->dbuser = $dbuser;
+
$this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword, true);
if (!$this->dbh) {
$this->bail(sprintf(/*WP_I18N_DB_CONN_ERROR*/"
<li>Are you sure that the database server is running?</li>
</ul>
<p>If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p>
-"/*/WP_I18N_DB_CONN_ERROR*/, $dbhost));
+"/*/WP_I18N_DB_CONN_ERROR*/, $dbhost), 'db_connect_fail');
return;
}
$this->ready = true;
- if ( $this->has_cap( 'collation' ) ) {
- if ( !empty($this->charset) ) {
- if ( function_exists('mysql_set_charset') ) {
- mysql_set_charset($this->charset, $this->dbh);
- $this->real_escape = true;
- } else {
- $collation_query = "SET NAMES '{$this->charset}'";
- if ( !empty($this->collate) )
- $collation_query .= " COLLATE '{$this->collate}'";
- $this->query($collation_query);
- }
+ if ( !empty($this->charset) ) {
+ if ( function_exists('mysql_set_charset') ) {
+ mysql_set_charset($this->charset, $this->dbh);
+ $this->real_escape = true;
+ } else {
+ $collation_query = "SET NAMES '{$this->charset}'";
+ if ( !empty($this->collate) )
+ $collation_query .= " COLLATE '{$this->collate}'";
+ $this->query($collation_query);
}
}
<li>Does the user <code>%2$s</code> have permission to use the <code>%1$s</code> database?</li>
<li>On some systems the name of your database is prefixed with your username, so it would be like <code>username_%1$s</code>. Could that be the problem?</li>
</ul>
-<p>If you don\'t know how to setup a database you should <strong>contact your host</strong>. If all else fails you may find help at the <a href="http://wordpress.org/support/">WordPress Support Forums</a>.</p>'/*/WP_I18N_DB_SELECT_DB*/, $db, DB_USER));
+<p>If you don\'t know how to setup a database you should <strong>contact your host</strong>. If all else fails you may find help at the <a href="http://wordpress.org/support/">WordPress Support Forums</a>.</p>'/*/WP_I18N_DB_SELECT_DB*/, $db, $this->dbuser), 'db_select_fail');
return;
}
}
*
* @since 1.5.0
*
- * @param string $message
+ * @param string $message The Error message
+ * @param string $error_code (optional) A Computer readable string to identify the error.
* @return false|void
*/
- function bail($message) {
+ function bail($message, $error_code = '500') {
if ( !$this->show_errors ) {
if ( class_exists('WP_Error') )
- $this->error = new WP_Error('500', $message);
+ $this->error = new WP_Error($error_code, $message);
else
$this->error = $message;
return false;
function check_database_version()
{
global $wp_version;
- // Make sure the server has MySQL 4.0
- if ( version_compare($this->db_version(), '4.0.0', '<') )
- return new WP_Error('database_version',sprintf(__('<strong>ERROR</strong>: WordPress %s requires MySQL 4.0.0 or higher'), $wp_version));
+ // Make sure the server has MySQL 4.1.2
+ if ( version_compare($this->db_version(), '4.1.2', '<') )
+ return new WP_Error('database_version',sprintf(__('<strong>ERROR</strong>: WordPress %s requires MySQL 4.1.2 or higher'), $wp_version));
}
/**
*
* @return bool True if collation is supported, false if version does not
*/
- function supports_collation()
- {
+ function supports_collation() {
return $this->has_cap( 'collation' );
}
* @param WP_Error $wp_error Optional. WordPress Error Object
*/
function login_header($title = 'Log In', $message = '', $wp_error = '') {
- global $error, $is_iphone;
+ global $error, $is_iphone, $interim_login;
// Don't index any of these forms
add_filter( 'pre_option_blog_public', create_function( '$a', 'return 0;' ) );
<head>
<title><?php bloginfo('name'); ?> › <?php echo $title; ?></title>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
- <?php
+<?php
wp_admin_css( 'login', true );
wp_admin_css( 'colors-fresh', true );
- if ( $is_iphone ) {
- ?>
- <meta name="viewport" content="width=320; initial-scale=0.9; maximum-scale=1.0; user-scalable=0;" />
- <style type="text/css" media="screen">
+ if ( $is_iphone ) { ?>
+ <meta name="viewport" content="width=320; initial-scale=0.9; maximum-scale=1.0; user-scalable=0;" />
+ <style type="text/css" media="screen">
form { margin-left: 0px; }
#login { margin-top: 20px; }
</style>
- <?php
+<?php
+ } elseif ( isset($interim_login) && $interim_login ) { ?>
+ <style type="text/css" media="all">
+ .login #login { margin: 20px auto; }
+ </style>
+<?php
}
do_action('login_head'); ?>
$message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n";
$message .= site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . "\r\n";
- $title = sprintf(__('[%s] Password Reset'), get_option('blogname'));
+ // The blogname option is escaped with esc_html on the way into the database in sanitize_option
+ // we want to reverse this for the plain text arena of emails.
+ $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
+
+ $title = sprintf(__('[%s] Password Reset'), $blogname);
$title = apply_filters('retrieve_password_title', $title);
$message = apply_filters('retrieve_password_message', $message, $key);
$message .= sprintf(__('Password: %s'), $new_pass) . "\r\n";
$message .= site_url('wp-login.php', 'login') . "\r\n";
- $title = sprintf(__('[%s] Your new password'), get_option('blogname'));
+ // The blogname option is escaped with esc_html on the way into the database in sanitize_option
+ // we want to reverse this for the plain text arena of emails.
+ $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
+
+ $title = sprintf(__('[%s] Your new password'), $blogname);
$title = apply_filters('password_reset_title', $title);
$message = apply_filters('password_reset_message', $message, $new_pass);
do_action('register_post', $user_login, $user_email, $errors);
- $errors = apply_filters( 'registration_errors', $errors );
+ $errors = apply_filters( 'registration_errors', $errors, $user_login, $user_email );
if ( $errors->get_error_code() )
return $errors;
$action = 'resetpass';
// validate action so as to default to the login screen
-if ( !in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login')) && false === has_filter('login_form_' . $action) )
+if ( !in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login'), true) && false === has_filter('login_form_' . $action) )
$action = 'login';
nocache_headers();
<input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr($user_login); ?>" size="20" tabindex="10" /></label>
</p>
<?php do_action('lostpassword_form'); ?>
- <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" value="<?php esc_attr_e('Get New Password'); ?>" tabindex="100" /></p>
+ <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Get New Password'); ?>" tabindex="100" /></p>
</form>
<p id="nav">
<?php do_action('register_form'); ?>
<p id="reg_passmail"><?php _e('A password will be e-mailed to you.') ?></p>
<br class="clear" />
- <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" value="<?php esc_attr_e('Register'); ?>" tabindex="100" /></p>
+ <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Register'); ?>" tabindex="100" /></p>
</form>
<p id="nav">
case 'login' :
default:
$secure_cookie = '';
+ $interim_login = isset($_REQUEST['interim-login']);
// If the user wants ssl but the session is not ssl, force a secure cookie.
if ( !empty($_POST['log']) && !force_ssl_admin() ) {
$redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);
if ( !is_wp_error($user) ) {
+ if ( $interim_login ) {
+ $message = '<p class="message">' . __('You have logged in successfully.') . '</p>';
+ login_header( '', $message ); ?>
+ <script type="text/javascript">setTimeout( function(){window.close()}, 8000);</script>
+ <p class="alignright">
+ <input type="button" class="button-primary" value="<?php esc_attr_e('Close'); ?>" onclick="window.close()" /></p>
+ </div></body></html>
+<?php exit;
+ }
// If the user can't edit posts, send them to their profile.
if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) )
$redirect_to = admin_url('profile.php');
$errors->add('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress."));
// Some parts of this script use the main login form to display a message
- if ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] ) $errors->add('loggedout', __('You are now logged out.'), 'message');
- elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) $errors->add('registerdisabled', __('User registration is currently not allowed.'));
- elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message');
- elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] ) $errors->add('newpass', __('Check your e-mail for your new password.'), 'message');
- elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');
+ if ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] )
+ $errors->add('loggedout', __('You are now logged out.'), 'message');
+ elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] )
+ $errors->add('registerdisabled', __('User registration is currently not allowed.'));
+ elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] )
+ $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message');
+ elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] )
+ $errors->add('newpass', __('Check your e-mail for your new password.'), 'message');
+ elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] )
+ $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');
+ elseif ( $interim_login )
+ $errors->add('expired', __('Your session has expired. Please log-in again.'), 'message');
login_header(__('Log In'), '', $errors);
<?php do_action('login_form'); ?>
<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> <?php esc_attr_e('Remember Me'); ?></label></p>
<p class="submit">
- <input type="submit" name="wp-submit" id="wp-submit" value="<?php esc_attr_e('Log In'); ?>" tabindex="100" />
+ <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Log In'); ?>" tabindex="100" />
+<?php if ( $interim_login ) { ?>
+ <input type="hidden" name="interim-login" value="1" />
+<?php } else { ?>
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" />
+<?php } ?>
<input type="hidden" name="testcookie" value="1" />
</p>
</form>
<?php endif; ?>
+<?php if ( !$interim_login ) { ?>
<p id="nav">
<?php if ( isset($_GET['checkemail']) && in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) : ?>
<?php elseif (get_option('users_can_register')) : ?>
<?php endif; ?>
</p>
-</div>
-
<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('← Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
+<?php } ?>
+</div>
<script type="text/javascript">
-<?php if ( $user_login ) { ?>
+<?php if ( $user_login || $interim_login ) { ?>
setTimeout( function(){ try{
d = document.getElementById('user_pass');
d.value = '';
/** Make sure that the WordPress bootstrap has run before continuing. */
require(dirname(__FILE__) . '/wp-load.php');
+/** Allow a plugin to do a complete takeover of Post by Email **/
+do_action('wp-mail.php');
+
/** Get the POP3 class with which to access the mailbox. */
require_once( ABSPATH . WPINC . '/class-pop3.php' );
+/** Only check at this interval for new messages. */
+if ( !defined('WP_MAIL_INTERVAL') )
+ define('WP_MAIL_INTERVAL', 300); // 5 minutes
+
+$last_checked = get_transient('mailserver_last_checked');
+
+if ( $last_checked )
+ wp_die(__('Slow down cowboy, no need to check for new mails so often!'));
+
+set_transient('mailserver_last_checked', true, WP_MAIL_INTERVAL);
+
$time_difference = get_option('gmt_offset') * 3600;
$phone_delim = '::';
$pop3 = new POP3();
+$count = 0;
if ( ! $pop3->connect(get_option('mailserver_url'), get_option('mailserver_port') ) ||
! $pop3->user(get_option('mailserver_login')) ||
set_magic_quotes_runtime(0);
@ini_set('magic_quotes_sybase', 0);
+if ( function_exists('date_default_timezone_set') )
+ date_default_timezone_set('UTC');
+
/**
* Turn register globals off.
*
unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate );
-// Force REQUEST to be GET + POST. If SERVER, COOKIE, or ENV are needed, use those superglobals directly.
-$_REQUEST = array_merge($_GET, $_POST);
-
/**
* The $blog_id global, which you can change in the config allows you to create a simple
* multiple blog installation using just one WordPress and changing $blog_id around.
$protocol = 'HTTP/1.0';
header( "$protocol 503 Service Unavailable", true, 503 );
header( 'Content-Type: text/html; charset=utf-8' );
+ header( 'Retry-After: 600' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
}
timer_start();
-// Add define('WP_DEBUG',true); to wp-config.php to enable display of notices during development.
-if (defined('WP_DEBUG') and WP_DEBUG == true) {
- error_reporting(E_ALL);
+// Add define('WP_DEBUG', true); to wp-config.php to enable display of notices during development.
+if ( defined('WP_DEBUG') && WP_DEBUG ) {
+ if ( defined('E_DEPRECATED') )
+ error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
+ else
+ error_reporting(E_ALL);
+ // Add define('WP_DEBUG_DISPLAY', false); to wp-config.php to use the globally configured setting for display_errors and not force it to On
+ if ( ! defined('WP_DEBUG_DISPLAY') || WP_DEBUG_DISPLAY )
+ ini_set('display_errors', 1);
+ // Add define('WP_DEBUG_LOG', true); to enable php debug logging to WP_CONTENT_DIR/debug.log
+ if ( defined('WP_DEBUG_LOG') && WP_DEBUG_LOG ) {
+ ini_set('log_errors', 1);
+ ini_set('error_log', WP_CONTENT_DIR . '/debug.log');
+ }
} else {
+ define('WP_DEBUG', false);
if ( defined('E_RECOVERABLE_ERROR') )
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR);
else
}
// For an advanced caching plugin to use, static because you would only want one
-if ( defined('WP_CACHE') )
+if ( defined('WP_CACHE') && WP_CACHE )
@include WP_CONTENT_DIR . '/advanced-cache.php';
+/**
+ * Private
+ */
+if ( !defined('MEDIA_TRASH') )
+ define('MEDIA_TRASH', false);
+
/**
* Stores the location of the WordPress directory of functions, classes, and core content.
*
return $can_clone ? clone( $object ) : $object;
}
+/**
+ * Whether the current request is in WordPress admin Panel
+ *
+ * Does not inform on whether the user is an admin! Use capability checks to
+ * tell if the user should be accessing a section or not.
+ *
+ * @since 1.5.1
+ *
+ * @return bool True if inside WordPress administration pages.
+ */
+function is_admin() {
+ if ( defined('WP_ADMIN') )
+ return WP_ADMIN;
+ return false;
+}
+
if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) {
require_once (WP_CONTENT_DIR . '/object-cache.php');
$_wp_using_ext_object_cache = true;
wp_cache_init();
if ( function_exists('wp_cache_add_global_groups') ) {
- wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta'));
+ wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta', 'site-transient'));
wp_cache_add_non_persistent_groups(array( 'comment', 'counts', 'plugins' ));
}
require (ABSPATH . WPINC . '/query.php');
require (ABSPATH . WPINC . '/theme.php');
require (ABSPATH . WPINC . '/user.php');
+require (ABSPATH . WPINC . '/meta.php');
require (ABSPATH . WPINC . '/general-template.php');
require (ABSPATH . WPINC . '/link-template.php');
require (ABSPATH . WPINC . '/author-template.php');
if ( !defined( 'AUTOSAVE_INTERVAL' ) )
define( 'AUTOSAVE_INTERVAL', 60 );
+/**
+ * It is possible to define this in wp-config.php
+ * @since 2.9.0
+ */
+if ( !defined( 'EMPTY_TRASH_DAYS' ) )
+ define( 'EMPTY_TRASH_DAYS', 30 );
require (ABSPATH . WPINC . '/vars.php');
require(ABSPATH . 'my-hacks.php');
}
-$current_plugins = get_option('active_plugins');
+$current_plugins = apply_filters( 'active_plugins', get_option( 'active_plugins' ) );
if ( is_array($current_plugins) && !defined('WP_INSTALLING') ) {
foreach ( $current_plugins as $plugin ) {
// check the $plugin filename
$_COOKIE = add_magic_quotes($_COOKIE);
$_SERVER = add_magic_quotes($_SERVER);
+// Force REQUEST to be GET + POST. If SERVER, COOKIE, or ENV are needed, use those superglobals directly.
+$_REQUEST = array_merge($_GET, $_POST);
+
do_action('sanitize_comment_cookies');
/**
if ( file_exists(TEMPLATEPATH . '/functions.php') )
include(TEMPLATEPATH . '/functions.php');
+// Load in support for template functions which the theme supports
+require_if_theme_supports( 'post-thumbnails', ABSPATH . WPINC . '/post-thumbnail-template.php' );
+
/**
* Runs just before PHP shuts down execution.
*
// trackback is done by a POST
$request_array = 'HTTP_POST_VARS';
-if ( !$_GET['tb_id'] ) {
+if ( !isset($_GET['tb_id']) || !$_GET['tb_id'] ) {
$tb_id = explode('/', $_SERVER['REQUEST_URI']);
$tb_id = intval( $tb_id[ count($tb_id) - 1 ] );
}
-$tb_url = $_POST['url'];
-$charset = $_POST['charset'];
+$tb_url = isset($_POST['url']) ? $_POST['url'] : '';
+$charset = isset($_POST['charset']) ? $_POST['charset'] : '';
// These three are stripslashed here so that they can be properly escaped after mb_convert_encoding()
-$title = stripslashes($_POST['title']);
-$excerpt = stripslashes($_POST['excerpt']);
-$blog_name = stripslashes($_POST['blog_name']);
+$title = isset($_POST['title']) ? stripslashes($_POST['title']) : '';
+$excerpt = isset($_POST['excerpt']) ? stripslashes($_POST['excerpt']) : '';
+$blog_name = isset($_POST['blog_name']) ? stripslashes($_POST['blog_name']) : '';
if ($charset)
$charset = str_replace( array(',', ' '), '', strtoupper( trim($charset) ) );
if ( is_single() || is_page() )
$tb_id = $posts[0]->ID;
-if ( !intval( $tb_id ) )
+if ( !isset($tb_id) || !intval( $tb_id ) )
trackback_response(1, 'I really need an ID for this to work.');
if (empty($title) && empty($tb_url) && empty($blog_name)) {
$this->initialise_blog_option_info( );
$this->methods = apply_filters('xmlrpc_methods', $this->methods);
+ }
+
+ function serve_request() {
$this->IXR_Server($this->methods);
}
'desc' => __( 'Time Format' ),
'readonly' => false,
'option' => 'time_format'
+ ),
+ 'users_can_register' => array(
+ 'desc' => __( 'Allow new users to sign up' ),
+ 'readonly' => false,
+ 'option' => 'users_can_register'
)
);
$blog_id = (int) $args[0];
$username = $args[1];
$password = $args[2];
- $num_pages = (int) $args[3];
+ $num_pages = isset($args[3]) ? (int) $args[3] : 10;
if ( !$user = $this->login($username, $password) ) {
return $this->error;
do_action('xmlrpc_call', 'wp.getPages');
- $page_limit = 10;
- if( isset( $num_pages ) ) {
- $page_limit = $num_pages;
- }
-
- $pages = get_posts( array('post_type' => 'page', 'post_status' => 'all', 'numberposts' => $page_limit) );
+ $pages = get_posts( array('post_type' => 'page', 'post_status' => 'any', 'numberposts' => $num_pages) );
$num_pages = count($pages);
// If we have pages, put together their info.
$comment_date = mysql2date("Ymd\TH:i:s", $comment->comment_date, false);
$comment_date_gmt = mysql2date("Ymd\TH:i:s", $comment->comment_date_gmt, false);
- if ( 0 == $comment->comment_approved )
+ if ( '0' == $comment->comment_approved )
$comment_status = 'hold';
else if ( 'spam' == $comment->comment_approved )
$comment_status = 'spam';
- else if ( 1 == $comment->comment_approved )
+ else if ( '1' == $comment->comment_approved )
$comment_status = 'approve';
else
$comment_status = $comment->comment_approved;
foreach( $options as $o_name => $o_value ) {
$option_names[] = $o_name;
- if( empty( $o_value ) )
- continue;
-
if( !array_key_exists( $o_name, $this->blog_options ) )
continue;
}
$post_title = $content_struct['title'];
- $post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
+ $post_content = $content_struct['description'];
$post_status = $publish ? 'publish' : 'draft';
global $wpdb;
// find any unattached files
- $attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '-1' AND post_type = 'attachment'" );
+ $attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '0' AND post_type = 'attachment'" );
if( is_array( $attachments ) ) {
foreach( $attachments as $file ) {
if( strpos( $post_content, $file->guid ) !== false ) {
}
$post_title = $content_struct['title'];
- $post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
+ $post_content = $content_struct['description'];
$catnames = $content_struct['categories'];
$post_category = array();
return new IXR_Error(500, $errorString);
}
// Construct the attachment array
- // attach to post_id -1
- $post_id = -1;
+ // attach to post_id 0
+ $post_id = 0;
$attachment = array(
'post_title' => $name,
'post_content' => '',
}
$wp_xmlrpc_server = new wp_xmlrpc_server();
-
+$wp_xmlrpc_server->serve_request();
?>