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:
parent
09f42ecdc0
commit
f577a436c0
@ -74,10 +74,7 @@ unset($hook_suffixes, $hook_suffix);
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$gears_compat = false;
|
if ( ! $is_opera ) {
|
||||||
|
|
||||||
if ( ($is_gecko || $is_winIE) && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'webkit') === false ) {
|
|
||||||
$gears_compat = true;
|
|
||||||
?>
|
?>
|
||||||
<div id="gears-info-box" class="info-box" style="display:none;">
|
<div id="gears-info-box" class="info-box" style="display:none;">
|
||||||
<img src="images/gear.png" title="Gear" alt="" class="gears-img" />
|
<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 } ?>
|
<?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
|
<?php
|
||||||
require(ABSPATH . 'wp-admin/menu-header.php');
|
require(ABSPATH . 'wp-admin/menu-header.php');
|
||||||
|
@ -61,23 +61,32 @@ wpGears = {
|
|||||||
I : function(id) {
|
I : function(id) {
|
||||||
return document.getElementById(id);
|
return document.getElementById(id);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
function gearsInit() {
|
(function() {
|
||||||
if ( 'undefined' != typeof google && google.gears ) return;
|
if ( 'undefined' != typeof google && google.gears ) return;
|
||||||
|
|
||||||
var gf = false;
|
var gf = false;
|
||||||
if ( 'undefined' != typeof GearsFactory ) { // Firefox
|
if ( 'undefined' != typeof GearsFactory ) {
|
||||||
gf = new GearsFactory();
|
gf = new GearsFactory();
|
||||||
} else { // IE
|
} else {
|
||||||
try {
|
try {
|
||||||
gf = new ActiveXObject('Gears.Factory');
|
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 ( ! gf ) return;
|
||||||
if ( 'undefined' == typeof google ) google = {};
|
if ( 'undefined' == typeof google ) google = {};
|
||||||
if ( ! google.gears ) google.gears = { factory : gf };
|
if ( ! google.gears ) google.gears = { factory : gf };
|
||||||
}
|
})();
|
||||||
|
|
||||||
gearsInit();
|
|
||||||
|
@ -194,7 +194,7 @@ function wp_default_scripts( &$scripts ) {
|
|||||||
'count' => __('Word count: %d')
|
'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(
|
$scripts->localize( 'wp-gears', 'wpGearsL10n', array(
|
||||||
'updateCompleted' => __('Update completed.'),
|
'updateCompleted' => __('Update completed.'),
|
||||||
'error' => __('Error:')
|
'error' => __('Error:')
|
||||||
|
Loading…
Reference in New Issue
Block a user