X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/76aea3697c6043c1613370f172395b4f65ee71f0..refs/tags/wordpress-2.7.1:/wp-admin/js/wp-gears.js diff --git a/wp-admin/js/wp-gears.js b/wp-admin/js/wp-gears.js index 20c8aa23..0509373e 100644 --- a/wp-admin/js/wp-gears.js +++ b/wp-admin/js/wp-gears.js @@ -4,23 +4,26 @@ wpGears = { createStore : function() { if ( 'undefined' == typeof google || ! google.gears ) return; - if ( 'undefined' == typeof localServer ) + if ( 'undefined' == typeof localServer ) localServer = google.gears.factory.create("beta.localserver"); store = localServer.createManagedStore(this.storeName()); store.manifestUrl = "gears-manifest.php"; store.checkForUpdate(); - this.message(); + this.message(3); }, getPermission : function() { + var perm = true; + if ( 'undefined' != typeof google && google.gears ) { if ( ! google.gears.factory.hasPermission ) - google.gears.factory.getPermission( 'WordPress', 'images/logo.gif' ); + perm = google.gears.factory.getPermission( 'WordPress', 'images/logo.gif' ); - try { - this.createStore(); - } catch(e) {} // silence if canceled + if ( perm ) + try { this.createStore(); } catch(e) { this.message(); } // silence if canceled + else + this.message(4); } }, @@ -34,13 +37,16 @@ wpGears = { }, 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'); + var t = this, msg1 = t.I('gears-msg1'), msg2 = t.I('gears-msg2'), msg3 = t.I('gears-msg3'), msg4 = t.I('gears-msg4'), num = t.I('gears-upd-number'), wait = t.I('gears-wait'); if ( ! msg1 ) return; if ( 'undefined' != typeof google && google.gears ) { - if ( google.gears.factory.hasPermission ) { - msg1.style.display = msg2.style.display = 'none'; + if ( show && show == 4 ) { + msg1.style.display = msg2.style.display = msg3.style.display = 'none'; + msg4.style.display = 'block'; + } else if ( google.gears.factory.hasPermission ) { + msg1.style.display = msg2.style.display = msg4.style.display = 'none'; msg3.style.display = 'block'; if ( 'undefined' == typeof store ) @@ -50,12 +56,10 @@ wpGears = { store.onerror = function(){wait.innerHTML = (' ' + wpGearsL10n.error + ' ' + store.lastErrorMessage);}; store.onprogress = function(e){if(num) num.innerHTML = (' ' + e.filesComplete + ' / ' + e.filesTotal);}; } else { - msg1.style.display = msg3.style.display = 'none'; + msg1.style.display = msg3.style.display = msg4.style.display = 'none'; msg2.style.display = 'block'; } } - - if ( show ) t.I('gears-info-box').style.display = 'block'; }, I : function(id) {