mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Remove Gears from UI. see #11301
git-svn-id: http://svn.automattic.com/wordpress/trunk@13981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
329cc77afd
commit
2501fac129
@ -1,100 +0,0 @@
|
||||
|
||||
var wpGears = {
|
||||
|
||||
createStore : function() {
|
||||
if ( 'undefined' == typeof google || ! google.gears ) return;
|
||||
|
||||
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(3);
|
||||
},
|
||||
|
||||
getPermission : function() {
|
||||
var perm = true;
|
||||
|
||||
if ( 'undefined' != typeof google && google.gears ) {
|
||||
if ( ! google.gears.factory.hasPermission )
|
||||
perm = google.gears.factory.getPermission( 'WordPress', 'images/logo.gif' );
|
||||
|
||||
if ( perm )
|
||||
try { this.createStore(); } catch(e) { this.message(); } // silence if canceled
|
||||
else
|
||||
this.message(4);
|
||||
}
|
||||
},
|
||||
|
||||
storeName : function() {
|
||||
var name, host = window.location.host;
|
||||
|
||||
if ( host.match(/[^a-z0-9._-]/i) )
|
||||
host = encodeURIComponent(host);
|
||||
|
||||
name = window.location.protocol + host;
|
||||
name = name.replace(/[^a-z0-9._-]+/gi, '_');
|
||||
name = 'wp_' + name.substring(0, 60); // max length of name is 64 chars
|
||||
|
||||
return name;
|
||||
},
|
||||
|
||||
message : function(show) {
|
||||
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 ( 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 )
|
||||
t.createStore();
|
||||
|
||||
store.oncomplete = function(){wait.innerHTML = (' ' + wpGearsL10n.updateCompleted);};
|
||||
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 = msg4.style.display = 'none';
|
||||
msg2.style.display = 'block';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
I : function(id) {
|
||||
return document.getElementById(id);
|
||||
}
|
||||
};
|
||||
|
||||
(function() {
|
||||
if ( 'undefined' != typeof google && google.gears ) return;
|
||||
|
||||
var gf = false;
|
||||
if ( 'undefined' != typeof GearsFactory ) {
|
||||
gf = new GearsFactory();
|
||||
} else {
|
||||
try {
|
||||
gf = new ActiveXObject('Gears.Factory');
|
||||
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 };
|
||||
})();
|
@ -1 +0,0 @@
|
||||
var wpGears={createStore:function(){if("undefined"==typeof google||!google.gears){return}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(3)},getPermission:function(){var a=true;if("undefined"!=typeof google&&google.gears){if(!google.gears.factory.hasPermission){a=google.gears.factory.getPermission("WordPress","images/logo.gif")}if(a){try{this.createStore()}catch(b){this.message()}}else{this.message(4)}}},storeName:function(){var a,b=window.location.host;if(b.match(/[^a-z0-9._-]/i)){b=encodeURIComponent(b)}a=window.location.protocol+b;a=a.replace(/[^a-z0-9._-]+/gi,"_");a="wp_"+a.substring(0,60);return a},message:function(a){var d=this,g=d.I("gears-msg1"),f=d.I("gears-msg2"),e=d.I("gears-msg3"),c=d.I("gears-msg4"),b=d.I("gears-upd-number"),h=d.I("gears-wait");if(!g){return}if("undefined"!=typeof google&&google.gears){if(a&&a==4){g.style.display=f.style.display=e.style.display="none";c.style.display="block"}else{if(google.gears.factory.hasPermission){g.style.display=f.style.display=c.style.display="none";e.style.display="block";if("undefined"==typeof store){d.createStore()}store.oncomplete=function(){h.innerHTML=(" "+wpGearsL10n.updateCompleted)};store.onerror=function(){h.innerHTML=(" "+wpGearsL10n.error+" "+store.lastErrorMessage)};store.onprogress=function(i){if(b){b.innerHTML=(" "+i.filesComplete+" / "+i.filesTotal)}}}else{g.style.display=e.style.display=c.style.display="none";f.style.display="block"}}}},I:function(a){return document.getElementById(a)}};(function(){if("undefined"!=typeof google&&google.gears){return}var a=false;if("undefined"!=typeof GearsFactory){a=new GearsFactory()}else{try{a=new ActiveXObject("Gears.Factory");if(factory.getBuildInfo().indexOf("ie_mobile")!=-1){a.privateSetGlobalObject(this)}}catch(b){if(("undefined"!=typeof navigator.mimeTypes)&&navigator.mimeTypes["application/x-googlegears"]){a=document.createElement("object");a.style.display="none";a.width=0;a.height=0;a.type="application/x-googlegears";document.documentElement.appendChild(a)}}}if(!a){return}if("undefined"==typeof google){google={}}if(!google.gears){google.gears={factory:a}}})();
|
@ -10,7 +10,6 @@
|
||||
require_once('admin.php');
|
||||
|
||||
$title = __('Tools');
|
||||
wp_enqueue_script( 'wp-gears' );
|
||||
|
||||
require_once('admin-header.php');
|
||||
|
||||
@ -19,62 +18,6 @@ require_once('admin-header.php');
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?></h2>
|
||||
|
||||
<?php
|
||||
if ( ! $is_opera ) {
|
||||
?>
|
||||
<div class="tool-box">
|
||||
<div id="gears-msg1">
|
||||
<h3 class="title"><?php _e('Turbo:'); ?> <?php _e('Speed up WordPress'); ?></h3>
|
||||
<p><?php _e('WordPress has support for Gears, which adds new features to your web browser.'); ?><br />
|
||||
<a href="http://gears.google.com/" target="_blank" style="font-weight:normal;"><?php _e('More information...'); ?></a></p>
|
||||
<p><?php _e('After you install and enable Gears, most of WordPress’ images, scripts, and CSS files will be stored locally on your computer. This speeds up page load time.'); ?></p>
|
||||
<p><strong><?php _e('Don’t install on a public or shared computer.'); ?></strong></p>
|
||||
<div class="buttons"><button onclick="window.location = 'http://gears.google.com/?action=install&return=<?php echo urlencode( admin_url() ); ?>';" class="button"><?php _e('Install Now'); ?></button></div>
|
||||
</div>
|
||||
|
||||
<div id="gears-msg2" style="display:none;">
|
||||
<h3 class="title"><?php _e('Turbo:'); ?> <?php _e('Gears Status'); ?></h3>
|
||||
<p><?php _e('Gears is installed on this computer, but is not enabled for use with WordPress.'); ?></p>
|
||||
<p><?php _e('To enable it click the button below.'); ?></p>
|
||||
<p><strong><?php _e('Note: Do not enable Gears if this is a public or shared computer!'); ?></strong></p>
|
||||
<div class="buttons"><button class="button" onclick="wpGears.getPermission();"><?php _e('Enable Gears'); ?></button></div>
|
||||
</div>
|
||||
|
||||
<div id="gears-msg3" style="display:none;">
|
||||
<h3 class="title"><?php _e('Turbo:'); ?> <?php _e('Gears Status'); ?></h3>
|
||||
<p><?php
|
||||
|
||||
if ( $is_chrome )
|
||||
_e('Gears is installed and enabled on this computer. You can disable it from the Under the Hood tab in Chrome’s Options menu.');
|
||||
elseif ( $is_safari )
|
||||
_e('Gears is installed and enabled on this computer. You can disable it from the Safari menu.');
|
||||
else
|
||||
_e('Gears is installed and enabled on this computer. You can disable it from your browser’s Tools menu.');
|
||||
|
||||
?></p>
|
||||
<p><?php _e('If there are any errors try disabling Gears, reloading the page, and re-enabling Gears.'); ?></p>
|
||||
<p><?php _e('Local storage status:'); ?> <span id="gears-wait"><span style="color:#f00;"><?php _e('Updating files:'); ?></span> <span id="gears-upd-number"></span></span></p>
|
||||
</div>
|
||||
|
||||
<div id="gears-msg4" style="display:none;">
|
||||
<h3 class="title"><?php _e('Turbo:'); ?> <?php _e('Gears Status'); ?></h3>
|
||||
<p><?php _e('Your browser’s settings do not permit this website to use Google Gears.'); ?></p>
|
||||
<p><?php
|
||||
|
||||
if ( $is_chrome )
|
||||
_e('To allow it, change the Gears settings in your browser’s Options, Under the Hood menu and reload this page.');
|
||||
elseif ( $is_safari )
|
||||
_e('To allow it, change the Gears settings in the Safari menu and reload this page.');
|
||||
else
|
||||
_e('To allow it, change the Gears settings in your browser’s Tools menu and reload this page.');
|
||||
|
||||
?></p>
|
||||
<p><strong><?php _e('Note: Do not enable Gears if this is a public or shared computer!'); ?></strong></p>
|
||||
</div>
|
||||
<script type="text/javascript">wpGears.message();</script>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( current_user_can('edit_posts') ) : ?>
|
||||
<div class="tool-box">
|
||||
<h3 class="title"><?php _e('Press This') ?></h3>
|
||||
|
@ -336,13 +336,6 @@ function wp_default_scripts( &$scripts ) {
|
||||
'l10n_print_after' => 'try{convertEntities(wordCountL10n);}catch(e){};'
|
||||
));
|
||||
|
||||
$scripts->add( 'wp-gears', "/wp-admin/js/wp-gears$suffix.js", false, '20090717' );
|
||||
$scripts->localize( 'wp-gears', 'wpGearsL10n', array(
|
||||
'updateCompleted' => __('Update completed.'),
|
||||
'error' => __('Error:'),
|
||||
'l10n_print_after' => 'try{convertEntities(wpGearsL10n);}catch(e){};'
|
||||
));
|
||||
|
||||
$scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), '20090319' );
|
||||
$scripts->add_data( 'theme-preview', 'group', 1 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user