Gears integration update in anticipation of Safari support. Fixes #7371 for 2.6.1

git-svn-id: http://svn.automattic.com/wordpress/trunk@8395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2008-07-22 04:03:36 +00:00
parent 364d78f689
commit 2a4ed4c5a8
3 changed files with 26 additions and 20 deletions

View File

@ -74,10 +74,7 @@ unset($hook_suffixes, $hook_suffix);
</div>
<?php
$gears_compat = false;
if ( ($is_gecko || $is_winIE) && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'webkit') === false ) {
$gears_compat = true;
if ( ! $is_opera ) {
?>
<div id="gears-info-box" class="info-box" style="display:none;">
<img src="images/gear.png" title="Gear" alt="" class="gears-img" />
@ -110,7 +107,7 @@ if ( ($is_gecko || $is_winIE) && strpos(strtolower($_SERVER['HTTP_USER_AGENT']),
<?php } ?>
<div id="user_info"><p><?php printf(__('Howdy, <a href="%1$s">%2$s</a>!'), 'profile.php', $user_identity) ?> | <a href="<?php echo site_url('wp-login.php?action=logout', 'login') ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a> | <?php _e('<a href="http://codex.wordpress.org/">Help</a>') ?> | <?php _e('<a href="http://wordpress.org/support/">Forums</a>'); if ( $gears_compat ) { ?> | <span id="gears-menu"><a href="#" onclick="wpGears.message(1);return false;"><?php _e('Turbo') ?></a></span><?php } ?></p></div>
<div id="user_info"><p><?php printf(__('Howdy, <a href="%1$s">%2$s</a>!'), 'profile.php', $user_identity) ?> | <a href="<?php echo site_url('wp-login.php?action=logout', 'login') ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a> | <?php _e('<a href="http://codex.wordpress.org/">Help</a>') ?> | <?php _e('<a href="http://wordpress.org/support/">Forums</a>'); if ( ! $is_opera ) { ?> | <span id="gears-menu"><a href="#" onclick="wpGears.message(1);return false;"><?php _e('Turbo') ?></a></span><?php } ?></p></div>
<?php
require(ABSPATH . 'wp-admin/menu-header.php');

View File

@ -61,23 +61,32 @@ wpGears = {
I : function(id) {
return document.getElementById(id);
}
}
};
function gearsInit() {
(function() {
if ( 'undefined' != typeof google && google.gears ) return;
var gf = false;
if ( 'undefined' != typeof GearsFactory ) { // Firefox
if ( 'undefined' != typeof GearsFactory ) {
gf = new GearsFactory();
} else { // IE
} else {
try {
gf = new ActiveXObject('Gears.Factory');
} catch (e) {}
if ( factory.getBuildInfo().indexOf('ie_mobile') != -1 )
gf.privateSetGlobalObject(this);
} catch (e) {
if ( ( 'undefined' != typeof navigator.mimeTypes ) && navigator.mimeTypes['application/x-googlegears'] ) {
gf = document.createElement("object");
gf.style.display = "none";
gf.width = 0;
gf.height = 0;
gf.type = "application/x-googlegears";
document.documentElement.appendChild(gf);
}
}
}
if ( ! gf ) return;
if ( 'undefined' == typeof google ) google = {};
if ( ! google.gears ) google.gears = { factory : gf };
}
gearsInit();
})();

View File

@ -194,7 +194,7 @@ function wp_default_scripts( &$scripts ) {
'count' => __('Word count: %d')
));
$scripts->add( 'wp-gears', '/wp-admin/js/wp-gears.js', false, '20080511' );
$scripts->add( 'wp-gears', '/wp-admin/js/wp-gears.js', false, '20080721' );
$scripts->localize( 'wp-gears', 'wpGearsL10n', array(
'updateCompleted' => __('Update completed.'),
'error' => __('Error:')