WordPress.org

Make WordPress Core

Changeset 8815


Ignore:
Timestamp:
09/05/2008 04:29:03 PM (10 years ago)
Author:
azaozz
Message:

Add simple Chrome detection and updates for Gears dialog, fixes #7684

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r8785 r8815  
    101101    <h3 class="info-box-title"><?php _e('Gears Status'); ?></h3>
    102102    <p><?php _e('Gears is installed on this computer, but is not enabled for use with WordPress.'); ?></p>
    103     <p><?php
    104 
    105     if ( $is_safari )
    106         _e('To enable it, ensure this web site is not on the denied list in Gears Settings under the Safari menu, then click the button below.');
    107     else
    108         _e('To enable it, ensure this web site is not on the denied list in Gears Settings under your browser&#8217;s Tools menu, then click the button below.');
    109 
    110     ?></p>
     103    <p><?php _e('To enable it click the button below.'); ?></p>
    111104    <p><strong><?php _e('However, Gears should not be enabled if this is a public or shared computer.'); ?></strong></p>
    112105    <div class="submit"><button class="button" onclick="wpGears.getPermission();"><?php _e('Enable Gears'); ?></button>
     
    118111    <p><?php
    119112
    120     if ( $is_safari )
     113    if ( $is_chrome )
     114        _e('Gears is installed and enabled on this computer. You can disable it from your browser&#8217;s Options, Under the Hood menu.');
     115    elseif ( $is_safari )
    121116        _e('Gears is installed and enabled on this computer. You can disable it from the Safari menu.');
    122117    else
     
    125120    ?></p>
    126121    <p><?php _e('If there are any errors try disabling Gears, reloading the page, and re-enabling Gears.'); ?></p>
    127     <p><?php _e('Local storage status:'); ?> <span id="gears-wait"><span style="color:#f00;"><?php _e('Please wait! Updating files:'); ?></span> <span id="gears-upd-number"></span></span></p>
     122    <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>
    128123    <div class="submit"><button class="button" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Close'); ?></button></div>
    129124    </div>
     125
     126    <div id="gears-msg4" style="display:none;">
     127    <h3 class="info-box-title"><?php _e('Gears Status'); ?></h3>
     128    <p><?php _e('This web site is denied to use Gears.'); ?></p>
     129    <p><?php
     130
     131    if ( $is_chrome )
     132        _e('To allow it, change the Gears settings from your browser&#8217;s Options, Under the Hood menu and reload this page.');
     133    elseif ( $is_safari )
     134        _e('To allow it, change the Gears settings from the Safari menu and reload this page.');
     135    else
     136        _e('To allow it, change the Gears settings from your browser&#8217;s Tools menu and reload this page.');
     137
     138    ?></p>
     139    <p><strong><?php _e('However, Gears should not be enabled if this is a public or shared computer.'); ?></strong></p>
     140    <div class="submit"><button class="button" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Cancel'); ?></button></div>
     141    </div>
     142   
    130143    </div>
    131144<?php } ?>
  • trunk/wp-admin/gears-manifest.php

    r8720 r8815  
    209209{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311b" },
    210210{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311f" },
    211 { "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311b" },
    212211
    213212{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=311b" },
     
    277276{ "url" : "../wp-includes/images/rss.png" },
    278277{ "url" : "../wp-includes/js/thickbox/loadingAnimation.gif" },
    279 { "url" : "../wp-includes/js/thickbox/tb-close.png" },
    280 { "url" : "../wp-includes/js/swfupload/swfupload_f9.swf" }
     278{ "url" : "../wp-includes/js/thickbox/tb-close.png" }
    281279]}
  • trunk/wp-admin/js/wp-gears.js

    r8600 r8815  
    1111        store.manifestUrl = "gears-manifest.php";
    1212        store.checkForUpdate();
    13         this.message();
     13        this.message(3);
    1414    },
    1515
    1616    getPermission : function() {
     17        var perm = true;
     18       
    1719        if ( 'undefined' != typeof google && google.gears ) {
    1820            if ( ! google.gears.factory.hasPermission )
    19                 google.gears.factory.getPermission( 'WordPress', 'images/logo.gif' );
     21                perm = google.gears.factory.getPermission( 'WordPress', 'images/logo.gif' );
    2022
    21             try {
    22                 this.createStore();
    23             } catch(e) {} // silence if canceled
     23            if ( perm )
     24                try { this.createStore(); } catch(e) { this.message(); } // silence if canceled
     25            else
     26                this.message(4);
    2427        }
    2528    },
     
    3538
    3639    message : function(show) {
    37         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');
     40        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');
    3841
    3942        if ( ! msg1 ) return;
    4043
    4144        if ( 'undefined' != typeof google && google.gears ) {
    42             if ( google.gears.factory.hasPermission ) {
    43                 msg1.style.display = msg2.style.display = 'none';
     45            if ( show && show == 4 ) {
     46                msg1.style.display = msg2.style.display = msg3.style.display = 'none';
     47                msg4.style.display = 'block';
     48            } else if ( google.gears.factory.hasPermission ) {
     49                msg1.style.display = msg2.style.display = msg4.style.display = 'none';
    4450                msg3.style.display = 'block';
    4551
     
    5157                store.onprogress = function(e){if(num) num.innerHTML = (' ' + e.filesComplete + ' / ' + e.filesTotal);};
    5258            } else {
    53                 msg1.style.display = msg3.style.display = 'none';
     59                msg1.style.display = msg3.style.display = msg4.style.display = 'none';
    5460                msg2.style.display = 'block';
    5561            }
     
    5763
    5864        if ( show ) t.I('gears-info-box').style.display = 'block';
     65        else t.I('gears-info-box').style.display = 'none';
    5966    },
    6067
  • trunk/wp-includes/script-loader.php

    r8789 r8815  
    235235        ));
    236236
    237         $scripts->add( 'wp-gears', '/wp-admin/js/wp-gears.js', false, '20080721' );
     237        $scripts->add( 'wp-gears', '/wp-admin/js/wp-gears.js', false, '20080905' );
    238238        $scripts->localize( 'wp-gears', 'wpGearsL10n', array(
    239239            'updateCompleted' => __('Update completed.'),
  • trunk/wp-includes/vars.php

    r8406 r8815  
    3939if (strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false) {
    4040    $is_lynx = true;
     41} elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'chrome') !== false ) {
     42    $is_chrome = true;
    4143} elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'webkit') !== false ) {
    4244    $is_safari = true;
Note: See TracChangeset for help on using the changeset viewer.