Do not show the Turbo link in the header if Gears is already being used, props markjaquith, fixes #8276

git-svn-id: http://svn.automattic.com/wordpress/trunk@10031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2008-12-04 06:35:21 +00:00
parent 27e98ed75a
commit a6a324ac11
3 changed files with 31 additions and 2 deletions

View File

@ -99,7 +99,7 @@ if ( function_exists('mb_strlen') ) {
<div id="wphead-info">
<div id="user_info">
<p><?php printf(__('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity) ?>
<?php if ( ! $is_opera ) { ?> | <span id="gears-menu"><a href="tools.php"><?php _e('Turbo') ?></a></span><?php } ?> |
<?php if ( ! $is_opera ) { ?><span class="turbo-nag hidden"> | <a href="tools.php"><?php _e('Turbo') ?></a></span><?php } ?> |
<a href="<?php echo wp_logout_url() ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a></p>
</div>

View File

@ -349,3 +349,32 @@ columns = {
}
})(jQuery);
jQuery(document).ready(function($){
if ( 'undefined' != typeof google && google.gears ) return;
var gf = false;
if ( 'undefined' != typeof GearsFactory ) {
gf = new GearsFactory();
} else {
try {
gf = new ActiveXObject('Gears.Factory');
if ( factory.getBuildInfo().indexOf('ie_mobile') != -1 )
gf.privateSetGlobalObject(this);
} catch (e) {
if ( ( 'undefined' != typeof navigator.mimeTypes ) && navigator.mimeTypes['application/x-googlegears'] ) {
gf = document.createElement("object");
gf.style.display = "none";
gf.width = 0;
gf.height = 0;
gf.type = "application/x-googlegears";
document.documentElement.appendChild(gf);
}
}
}
if ( gf && gf.hasPermission )
return;
$('.turbo-nag').show();
});

View File

@ -41,7 +41,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->base_url = $guessurl;
$scripts->default_version = get_bloginfo( 'version' );
$scripts->add( 'common', '/wp-admin/js/common.js', array('jquery', 'hoverIntent'), '20081126' );
$scripts->add( 'common', '/wp-admin/js/common.js', array('jquery', 'hoverIntent'), '20081203' );
$scripts->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' );
$scripts->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '20081103' );