Plugin Directory

Changeset 2179244


Ignore:
Timestamp:
10/24/2019 11:31:03 AM (5 years ago)
Author:
lucastidio
Message:

Simplify login flow for users with only one project; Set widget as installed immediately after user connected project

Location:
tidio-live-chat/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • tidio-live-chat/trunk/media/css/options.css

    r2178184 r2179244  
    5757}
    5858
    59 .tidio-box-advert {
     59.tidio-box-george {
    6060    text-align: center;
    6161    position: relative;
     
    7575}
    7676
    77 .tidio-box-advert h2, .tidio-box-actions h1 {
     77.tidio-box-george h2, .tidio-box-actions h1 {
    7878    font-size: 24px;
    7979    line-height: 34px;
     
    9797}
    9898
    99 .tidio-box-advert-image {
     99.tidio-box-george-image {
    100100    position: absolute;
    101101    left: 0;
     
    210210    }
    211211
    212     .tidio-box-advert h2 {
     212    .tidio-box-george h2 {
    213213        margin-top: 24px;
    214214    }
     
    229229    }
    230230
    231     .tidio-box-advert h2 {
     231    .tidio-box-george h2 {
    232232        margin-top: 32px;
    233233    }
     
    237237    }
    238238
    239     .tidio-box-advert {
     239    .tidio-box-george {
    240240        flex-basis: 680px;
    241241    }
  • tidio-live-chat/trunk/media/js/options.js

    r2178254 r2179244  
    7575                return false;
    7676            }
    77             if (passwordField.is(':invalid')) {
    78                 this.showError('Password must be at least 6 characters long!');
     77            if (passwordField.val() === '') {
     78                this.showError('Password can’t be empty!');
    7979                return false;
    8080            }
     
    131131            select_project.children().remove();
    132132            select_project.append(defaultOption);
     133            var selected = false;
     134            if (data.value.length === 1) {
     135                selected = true;
     136            }
    133137            for (var i in data.value) {
    134138                var project = data.value[i];
     
    140144
    141145                var option = $(
    142                     '<option value="' + project.id + '">' + project.name +
     146                    '<option value="' + project.id + '" ' + (selected ? 'selected="selected"' : '') + '>' + project.name +
    143147                    '</option>');
    144148                option.data('value', value);
     
    152156                api_token: token,
    153157            }, (function (response) {
    154                 this.form.hide();
    155                 this.form = $('#tidio-project');
    156                 this.form.show();
    157                 this.renderProjects(response);
    158                 this.form.off().submit(this.onProjectSubmit.bind(this));
    159                 var startOver = $('#start-over');
    160                 startOver.click(this.startOver.bind(this));
     158                if (response.value.length === 1) {
     159                    this.renderProjects(response);
     160                    this.onProjectSubmit();
     161                } else {
     162                    this.form.hide();
     163                    this.form = $('#tidio-project');
     164                    this.form.show();
     165                    this.renderProjects(response);
     166                    this.form.off().submit(this.onProjectSubmit.bind(this));
     167                    var startOver = $('#start-over');
     168                    startOver.click(this.startOver.bind(this));
     169                }
    161170            }).bind(this), 'json');
    162171        },
     
    164173            var details = $('#select-tidio-project option:selected').
    165174                data('value');
    166             $.extend(details, { 'action': 'get_project_keys' });
     175            $.extend(details, { 'action': 'set_project_keys', 'api_token': TidioChatWP.token });
    167176            $.post(ajaxurl, details, (function (response) {
    168177                window.open(response, '_blank');
  • tidio-live-chat/trunk/options.php

    r2178184 r2179244  
    2525                <label>
    2626                    Password
    27                     <input type="password" id="password" minlength="6" required placeholder="Type your password&hellip;"/>
     27                    <input type="password" id="password" placeholder="Type your password&hellip;" required/>
    2828                </label>
    2929
     
    5353            </form>
    5454        </div>
    55         <div class="tidio-box tidio-box-advert">
     55        <div class="tidio-box tidio-box-george">
    5656            <h2>Join 300 000+ websites using Tidio - Live Chat boosted with Bots</h2>
    5757            <p>Increase sales by skyrocketing communication with customers.</p>
    58             <div class="tidio-box-advert-image"></div>
     58            <div class="tidio-box-george-image"></div>
    5959        </div>
    6060    </div>
  • tidio-live-chat/trunk/readme.txt

    r2178254 r2179244  
    44Requires at least: 3.0
    55Tested up to: 5.2
    6 Stable tag: trunk
     6Stable tag: 4.1.0
    77License: GPLv2
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    122122== Changelog ==
    123123
     124= 4.1.0 =
     125* Simplify login flow for users with only one project
     126* Set widget as installed immediately after user connected project
     127
    124128= 4.0.1 =
    125129* Fix saving project data after creating new project
  • tidio-live-chat/trunk/tidio-elements.php

    r2178254 r2179244  
    55 * Plugin URI: http://www.tidiochat.com
    66 * Description: Tidio Live Chat - Live chat for your website. No logging in, no signing up - integrates with your website in less than 20 seconds.
    7  * Version: 4.0.1
     7 * Version: 4.1.0
    88 * Author: Tidio Ltd.
    99 * Author URI: http://www.tidiochat.com
    1010 * License: GPL2
    1111 */
    12 define('TIDIOCHAT_VERSION', '4.0.1');
     12define('TIDIOCHAT_VERSION', '4.1.0');
    1313define('AFFILIATE_CONFIG_FILE_PATH', get_template_directory().'/tidio_affiliate_ref_id.txt');
    1414
     
    5353
    5454            add_action('wp_ajax_tidio_chat_save_keys', array($this, 'ajaxTidioChatSaveKeys'));
    55             add_action('wp_ajax_get_project_keys', array($this, 'ajaxGetProjectKeys'));
     55            add_action('wp_ajax_set_project_keys', array($this, 'ajaxSetProjectKeys'));
    5656            add_action('wp_ajax_get_private_key', array($this, 'ajaxGetPrivateKey'));
    5757
     
    217217    }
    218218
    219     public function ajaxGetProjectKeys()
     219    public function ajaxSetProjectKeys()
    220220    {
    221221        update_option(TidioLiveChat::PUBLIC_KEY_OPTION, $_POST['public_key']);
    222222        update_option(TidioLiveChat::PRIVATE_KEY_OPTION, $_POST['private_key']);
     223
     224        $query = http_build_query(array(
     225            'api_token' => $_POST['api_token'],
     226            'project_public_key' => $_POST['public_key']
     227        ));
     228
     229        $options = array('http' => array('method' => 'POST'));
     230
     231        $context = stream_context_create($options);
     232        @file_get_contents(TidioLiveChat::API_URL . '/access/connectWordpress?' . $query, false, $context);
     233
    223234        echo TidioLiveChat::getRedirectUrl($_POST['private_key']);
    224235        exit();
Note: See TracChangeset for help on using the changeset viewer.