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

git-svn-id: https://develop.svn.wordpress.org/trunk@8395 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2008-07-22 04:03:36 +00:00
parent 09f42ecdc0
commit f577a436c0
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

@ -25,15 +25,15 @@ wpGears = {
},
storeName : function() {
var name = window.location.protocol + window.location.host;
var name = window.location.protocol + window.location.host;
name = name.replace(/[\/\\:*"?<>|;,]+/g, '_'); // gears beta doesn't allow certain chars in the store name
name = 'wp_' + name.substring(0, 60); // max length of name is 64 chars
name = name.replace(/[\/\\:*"?<>|;,]+/g, '_'); // gears beta doesn't allow certain chars in the store name
name = 'wp_' + name.substring(0, 60); // max length of name is 64 chars
return name;
},
return name;
},
message : function(show) {
message : function(show) {
var t = this, msg1 = t.I('gears-msg1'), msg2 = t.I('gears-msg2'), msg3 = t.I('gears-msg3'), num = t.I('gears-upd-number'), wait = t.I('gears-wait');
if ( ! msg1 ) return;
@ -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:')