diff options
author | Theo Chatzimichos <tampakrap@gentoo.org> | 2012-08-04 22:18:54 +0200 |
---|---|---|
committer | Theo Chatzimichos <tampakrap@gentoo.org> | 2012-08-04 22:18:54 +0200 |
commit | f31a3a10b15cfcc8a452c2dbd23ed2fbd293425d (patch) | |
tree | d176aff387ae54b663def996e61da8ff13547ec2 /plugins/jetpack/jetpack.php | |
parent | Revert the blogroll icon change, mine is better :) (diff) | |
download | blogs-gentoo-f31a3a10b15cfcc8a452c2dbd23ed2fbd293425d.tar.gz blogs-gentoo-f31a3a10b15cfcc8a452c2dbd23ed2fbd293425d.tar.bz2 blogs-gentoo-f31a3a10b15cfcc8a452c2dbd23ed2fbd293425d.zip |
- My kde-breathe fork theme changed name to kde-graffiti, update it to 1.2
- Update jetpack
Diffstat (limited to 'plugins/jetpack/jetpack.php')
-rw-r--r-- | plugins/jetpack/jetpack.php | 63 |
1 files changed, 48 insertions, 15 deletions
diff --git a/plugins/jetpack/jetpack.php b/plugins/jetpack/jetpack.php index cdc362d5..68d7aaed 100644 --- a/plugins/jetpack/jetpack.php +++ b/plugins/jetpack/jetpack.php @@ -5,7 +5,7 @@ * Plugin URI: http://wordpress.org/extend/plugins/jetpack/ * Description: Bring the power of the WordPress.com cloud to your self-hosted WordPress. Jetpack enables you to connect your blog to a WordPress.com account to use the powerful features normally only available to WordPress.com users. * Author: Automattic - * Version: 1.5 + * Version: 1.6.1 * Author URI: http://jetpack.me * License: GPL2+ * Text Domain: jetpack @@ -17,7 +17,7 @@ define( 'JETPACK__API_VERSION', 1 ); define( 'JETPACK__MINIMUM_WP_VERSION', '3.2' ); defined( 'JETPACK_CLIENT__AUTH_LOCATION' ) or define( 'JETPACK_CLIENT__AUTH_LOCATION', 'header' ); defined( 'JETPACK_CLIENT__HTTPS' ) or define( 'JETPACK_CLIENT__HTTPS', 'AUTO' ); -define( 'JETPACK__VERSION', '1.5' ); +define( 'JETPACK__VERSION', '1.6.1' ); define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); /* Options: @@ -142,8 +142,10 @@ class Jetpack { $this->sync = new Jetpack_Sync; if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST && isset( $_GET['for'] ) && 'jetpack' == $_GET['for'] ) { + @ini_set( 'display_errors', false ); // Display errors can cause the XML to be not well formed. + require_once dirname( __FILE__ ) . '/class.jetpack-xmlrpc-server.php'; - $this->xmlrpc_server = new Jetpack_XMLRPC_Server( $GLOBALS['wp_xmlrpc_server'] ); + $this->xmlrpc_server = new Jetpack_XMLRPC_Server(); // Don't let anyone authenticate remove_all_filters( 'authenticate' ); @@ -174,6 +176,18 @@ class Jetpack { add_action( 'wp_ajax_jetpack-check-news-subscription', array( $this, 'check_news_subscription' ) ); add_action( 'wp_ajax_jetpack-subscribe-to-news', array( $this, 'subscribe_to_news' ) ); + + add_action( 'wp_enqueue_scripts', array( $this, 'devicepx' ) ); + add_action( 'customize_controls_enqueue_scripts', array( $this, 'devicepx' ) ); + add_action( 'admin_enqueue_scripts', array( $this, 'devicepx' ) ); + } + + /** + * Device Pixels support + * This improves the resolution of gravatars and wordpress.com uploads on hi-res and zoomed browsers. + */ + function devicepx() { + wp_enqueue_script( 'devicepx', ( is_ssl() ? 'https' : 'http' ) . '://s0.wp.com/wp-content/js/devicepx-jetpack.js', array(), gmdate('oW'), true ); } /** @@ -632,6 +646,7 @@ class Jetpack { // Add special cases here for modules to avoid auto-activation switch ( $module ) { case 'comments' : + case 'carousel' : continue; default : $return[] = $module; @@ -1075,6 +1090,16 @@ p { if ( $is_active ) { // Artificially throw errors in certain whitelisted cases during plugin activation add_action( 'activate_plugin', array( $this, 'throw_error_on_activate_plugin' ) ); + + // Add retina images hotfix to admin + global $wp_db_version; + if ( $wp_db_version > 19470 ) { + // WP 3.4.x + // TODO will need to add && $wp_db_version < xxxxx when 3.5 comes out. + add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_retina_scripts' ) ); + // /wp-admin/customize.php omits the action above. + add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_retina_scripts' ) ); + } } } @@ -1156,7 +1181,7 @@ p { $title = __( 'Jetpack', 'jetpack' ); } - $hook = add_menu_page( 'Jetpack', $title, 'manage_options', 'jetpack', array( $this, 'admin_page' ), '' ); + $hook = add_menu_page( 'Jetpack', $title, 'manage_options', 'jetpack', array( $this, 'admin_page' ), 'div' ); add_action( "load-$hook", array( $this, 'admin_page_load' ) ); @@ -1239,9 +1264,21 @@ p { function admin_menu_css() { ?> <style type="text/css" id="jetpack-menu-css"> - #toplevel_page_jetpack .wp-menu-image img { visibility: hidden; } - #toplevel_page_jetpack .wp-menu-image { background: url( <?php echo plugins_url( basename( dirname( __FILE__ ) ) . '/_inc/images/jp-icon.png' ) ?> ) 0 90% no-repeat; } - #toplevel_page_jetpack.current .wp-menu-image, #toplevel_page_jetpack.wp-has-current-submenu .wp-menu-image, #toplevel_page_jetpack:hover .wp-menu-image { background-position: top left; } + #toplevel_page_jetpack .wp-menu-image { + background: url( <?php echo plugins_url( basename( dirname( __FILE__ ) ) . '/_inc/images/menuicon-sprite.png' ) ?> ) 0 90% no-repeat; + } + /* Retina Jetpack Menu Icon */ + @media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) { + #toplevel_page_jetpack .wp-menu-image { + background: url( <?php echo plugins_url( basename( dirname( __FILE__ ) ) . '/_inc/images/menuicon-sprite-2x.png' ) ?> ) 0 90% no-repeat; + background-size:30px 64px; + } + } + #toplevel_page_jetpack.current .wp-menu-image, + #toplevel_page_jetpack.wp-has-current-submenu .wp-menu-image, + #toplevel_page_jetpack:hover .wp-menu-image { + background-position: top left; + } </style><?php } @@ -1270,7 +1307,7 @@ p { function admin_styles() { global $wp_styles; - wp_enqueue_style( 'jetpack', plugins_url( basename( dirname( __FILE__ ) ) . '/_inc/jetpack.css' ), false, JETPACK__VERSION . '-20111115' ); + wp_enqueue_style( 'jetpack', plugins_url( basename( dirname( __FILE__ ) ) . '/_inc/jetpack.css' ), false, JETPACK__VERSION . '-20120701' ); $wp_styles->add_data( 'jetpack', 'rtl', true ); } @@ -1283,6 +1320,9 @@ p { add_action( 'admin_footer', array( $this, 'do_stats' ) ); } + function enqueue_retina_scripts() { + wp_enqueue_style( 'jetpack-retina', plugins_url( basename( dirname( __FILE__ ) ) . '/_inc/jetpack-retina.css' ), false, JETPACK__VERSION . '-20120730' ); + } function plugin_action_links( $actions ) { return array_merge( @@ -2063,12 +2103,6 @@ p { "jetpack_activate-$module" ); } - $file = Jetpack::get_module_path( $module ); - $png = str_replace( '.php', '.png', $file ); - if ( is_readable( dirname( __FILE__ ) . '/_inc/images/icons/' . basename( $png ) ) ) - $module_img = plugins_url( basename( dirname( __FILE__ ) ) . '/_inc/images/icons/' . basename( $png ) ); - else - $module_img = plugins_url( basename( dirname( __FILE__ ) ) . '/_inc/images/module-blank.png' ); if ( $counter % 4 == 0 ) { $classes = $css . ' jetpack-newline'; @@ -2100,7 +2134,6 @@ p { <h3><?php echo $module_data['name']; ?></h3> <div class="jetpack-module-description"> <div class="module-image"> - <img src="<?php echo esc_url( $module_img ); ?>" align="right" width="71" height="45" /> <p><span class="module-image-badge"><?php echo $badge_text; ?></span><span class="module-image-free" style="display: none"><?php echo $free_text; ?></span></p> </div> |