Check if turbo-nag exists and don't initialize Gears on every page load to check if it's enabled only check if it's installed to prevent crash in Firefox 3.0.10. Fixes #10083

git-svn-id: http://svn.automattic.com/wordpress/trunk@11538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-06-10 02:52:16 +00:00
parent 797b1c59ae
commit 333924fbec
3 changed files with 16 additions and 21 deletions

View File

@ -241,32 +241,27 @@ jQuery(document).ready( function($) {
$('div.default-password-nag').hide(); $('div.default-password-nag').hide();
return false; return false;
}); });
}); });
(function(){ jQuery(document).ready( function($){
if ( 'undefined' != typeof google && google.gears ) return; var turboNag = $('.turbo-nag');
if ( !turboNag.length || ('undefined' != typeof(google) && google.gears) )
return;
var gf = false;
if ( 'undefined' != typeof GearsFactory ) { if ( 'undefined' != typeof GearsFactory ) {
gf = new GearsFactory(); return;
} else { } else {
try { try {
if ( window.ActiveXObject ) { if ( ( 'undefined' != typeof window.ActiveXObject && ActiveXObject('Gears.Factory') ) ||
gf = new ActiveXObject('Gears.Factory'); ( 'undefined' != typeof navigator.mimeTypes && navigator.mimeTypes['application/x-googlegears'] ) ) {
if ( gf && gf.getBuildInfo().indexOf('ie_mobile') != -1 ) return;
gf.privateSetGlobalObject(this);
} else 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);
} }
} catch(e){} } catch(e){}
} }
if ( gf && gf.hasPermission )
return;
jQuery('.turbo-nag').show(); turboNag.show();
})();
});

File diff suppressed because one or more lines are too long

View File

@ -60,7 +60,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20090102' ); $scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20090102' );
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20090528' ); $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20090609' );
$scripts->add_data( 'common', 'group', 1 ); $scripts->add_data( 'common', 'group', 1 );
$scripts->localize( 'common', 'commonL10n', array( $scripts->localize( 'common', 'commonL10n', array(
'warnDelete' => __("You are about to delete the selected items.\n 'Cancel' to stop, 'OK' to delete."), 'warnDelete' => __("You are about to delete the selected items.\n 'Cancel' to stop, 'OK' to delete."),