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:
parent
797b1c59ae
commit
333924fbec
|
@ -241,32 +241,27 @@ jQuery(document).ready( function($) {
|
|||
$('div.default-password-nag').hide();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
(function(){
|
||||
if ( 'undefined' != typeof google && google.gears ) return;
|
||||
jQuery(document).ready( function($){
|
||||
var turboNag = $('.turbo-nag');
|
||||
|
||||
if ( !turboNag.length || ('undefined' != typeof(google) && google.gears) )
|
||||
return;
|
||||
|
||||
var gf = false;
|
||||
if ( 'undefined' != typeof GearsFactory ) {
|
||||
gf = new GearsFactory();
|
||||
return;
|
||||
} else {
|
||||
try {
|
||||
if ( window.ActiveXObject ) {
|
||||
gf = new ActiveXObject('Gears.Factory');
|
||||
if ( gf && gf.getBuildInfo().indexOf('ie_mobile') != -1 )
|
||||
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);
|
||||
if ( ( 'undefined' != typeof window.ActiveXObject && ActiveXObject('Gears.Factory') ) ||
|
||||
( 'undefined' != typeof navigator.mimeTypes && navigator.mimeTypes['application/x-googlegears'] ) ) {
|
||||
return;
|
||||
}
|
||||
} catch(e){}
|
||||
}
|
||||
if ( gf && gf.hasPermission )
|
||||
return;
|
||||
|
||||
jQuery('.turbo-nag').show();
|
||||
})();
|
||||
turboNag.show();
|
||||
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -60,7 +60,7 @@ function wp_default_scripts( &$scripts ) {
|
|||
|
||||
$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->localize( 'common', 'commonL10n', array(
|
||||
'warnDelete' => __("You are about to delete the selected items.\n 'Cancel' to stop, 'OK' to delete."),
|
||||
|
|
Loading…
Reference in New Issue