Plugin Directory

Changeset 2536298


Ignore:
Timestamp:
05/24/2021 07:34:51 AM (5 years ago)
Author:
redboxsa
Message:

Update verson 1.8

Location:
redbox-pickup
Files:
4 edited
6 copied

Legend:

Unmodified
Added
Removed
  • redbox-pickup/tags/1.8/front/front.php

    r2515504 r2536298  
    9999                    'headers' => array(
    100100                        'Authorization' => 'Bearer ' . $this->redboxKey
    101                     )
     101                    ),
     102                    'timeout' => 10
    102103                );
    103104                $response = wp_remote_get($urlQuery, $options);
  • redbox-pickup/tags/1.8/js/front.js

    r2517378 r2536298  
    157157            let LAT = 24.7135517
    158158            let LNG = 46.6752957
    159             callAjaxGetListPoint(LAT, LNG)
     159            if (REDBOX_LIST_POINT.length) {
     160                activeInputConfirm()
     161                drawMapInThis(REDBOX_LIST_POINT, LAT, LNG)
     162                jQuery('.redbox-waiting-response').remove()
     163            } else {
     164                callAjaxGetListPoint(LAT, LNG)
     165            }
    160166            jQuery('#close-wrap-choose-point').off()
    161167            jQuery('#close-wrap-choose-point').click(function(){
     
    321327    function reRenderMapWithPoint(lat, lng) {
    322328        var htmlWaiting = '<div class="redbox-waiting-response"><i class="fa fa-spinner fa-spin"></i></div>'
    323         jQuery('.redbox-pickup').prepend(htmlWaiting)
    324         jQuery.ajax({
    325             url: ajax_url,
    326             type:'GET',
    327             data:`action=getlispoint&lat=${lat}&lng=${lng}&distance=100000000`,
    328             success : function(response) {
    329                 let data = JSON.parse(response)
    330                 if (data.success) {
    331                     var bounds = new google.maps.LatLngBounds();
    332                     bounds.extend(new google.maps.LatLng(lat, lng));
    333                     bounds.extend(new google.maps.LatLng(data.points[0].location.lat, data.points[0].location.lng));
    334                     REDBOX_MAP.fitBounds(bounds);
    335                     jQuery( "#wrap-area-choose-point" ).animate({
    336                         bottom: -400
    337                     }, 500);
    338                 } else {
    339                     alert(data.msg)
    340                 }
    341                 jQuery('.redbox-waiting-response').remove()
    342             },
    343             error: function(e) {
    344                 alert('Error occured');
    345                 jQuery('.redbox-waiting-response').remove()
    346             }
    347         });
     329        var bounds = new google.maps.LatLngBounds();
     330        bounds.extend(new google.maps.LatLng(lat, lng));
     331        bounds.extend(new google.maps.LatLng(REDBOX_LIST_POINT[0].location.lat, REDBOX_LIST_POINT[0].location.lng));
     332        REDBOX_MAP.fitBounds(bounds);
     333        jQuery( "#wrap-area-choose-point" ).animate({
     334            bottom: -400
     335        }, 500);
    348336    }
    349337    function setFindAreaMap(map) {
     
    381369        });
    382370    }
     371
     372    function loadListPoint() {
     373        if (!REDBOX_LIST_POINT.length) {
     374            let LAT = 24.7135517
     375            let LNG = 46.6752957
     376            jQuery.ajax({
     377                url: ajax_url,
     378                type:'GET',
     379                data:`action=getlispoint&lat=${LAT}&lng=${LNG}&distance=100000000`,
     380                success : function(response) {
     381                    let data = JSON.parse(response)
     382                    if (data.success) {
     383                        REDBOX_LIST_POINT = data.points
     384                    } else {
     385                        alert(data.msg)
     386                    }
     387                },
     388                error: function(e) {
     389                    alert('Error occured');
     390                }
     391            });
     392        }
     393    }
     394
    383395    jQuery('#area-point-selected .bt-change-point').click(function(){
    384396        openModalRedbox()
     
    400412                REDBOX_METHOD_SELECTED = false
    401413                jQuery("#area-point-selected").hide()
     414                loadListPoint()
    402415            }
    403416        }
  • redbox-pickup/tags/1.8/readme.txt

    r2517378 r2536298  
    55Requires at least: 3.3
    66Tested up to: 5.5.1
    7 Stable tag: 1.7
     7Stable tag: 1.8
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4141= 1.5 =
    4242Edit marker icon. Now there are 3 types of Redbox point: Locker, Counter and Locker and Counter.
     43= 1.8 =
     44Make page load list point after load checkout page.
    4345
    4446
     
    5254= 1.5 =
    5355Edit marker icon
     56= 1.8 =
     57Enhance performance load point
    5458
    5559
  • redbox-pickup/tags/1.8/redbox.php

    r2517378 r2536298  
    44        * Description: This plugin allows customers pickup package at RedBox Locker.
    55        * Plugin URI: https://woocommerce.com/
    6         * Version: 1.7
     6        * Version: 1.8
    77        * Author: RedBox
    88        * Author URI: https://redboxsa.com
     
    120120                wp_enqueue_style( 'redbox_font_roboto', 'https://fonts.googleapis.com/css?family=Roboto' );
    121121                wp_enqueue_style( 'redbox_font_cario', 'https://fonts.googleapis.com/css?family=Cairo' );
    122                 wp_enqueue_script( 'redbox_front_js', REDBOX_PLUGIN_DIR . '/js/front.js', false, '1.0.9' );
     122                wp_enqueue_script( 'redbox_front_js', REDBOX_PLUGIN_DIR . '/js/front.js', false, '1.0.10' );
    123123                wp_enqueue_script( 'redbox_front_js_map', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBY1xlGe6jLbugOJegCsUGnzlufYWa5CRw&amp;sensor=false&amp;libraries=places' );
    124124                wp_enqueue_script( 'redbox_front_js_map_clustor', 'https://unpkg.com/@google/markerclustererplus@4.0.1/dist/markerclustererplus.min.js' );
  • redbox-pickup/trunk/front/front.php

    r2515504 r2536298  
    9999                    'headers' => array(
    100100                        'Authorization' => 'Bearer ' . $this->redboxKey
    101                     )
     101                    ),
     102                    'timeout' => 10
    102103                );
    103104                $response = wp_remote_get($urlQuery, $options);
  • redbox-pickup/trunk/js/front.js

    r2517378 r2536298  
    157157            let LAT = 24.7135517
    158158            let LNG = 46.6752957
    159             callAjaxGetListPoint(LAT, LNG)
     159            if (REDBOX_LIST_POINT.length) {
     160                activeInputConfirm()
     161                drawMapInThis(REDBOX_LIST_POINT, LAT, LNG)
     162                jQuery('.redbox-waiting-response').remove()
     163            } else {
     164                callAjaxGetListPoint(LAT, LNG)
     165            }
    160166            jQuery('#close-wrap-choose-point').off()
    161167            jQuery('#close-wrap-choose-point').click(function(){
     
    321327    function reRenderMapWithPoint(lat, lng) {
    322328        var htmlWaiting = '<div class="redbox-waiting-response"><i class="fa fa-spinner fa-spin"></i></div>'
    323         jQuery('.redbox-pickup').prepend(htmlWaiting)
    324         jQuery.ajax({
    325             url: ajax_url,
    326             type:'GET',
    327             data:`action=getlispoint&lat=${lat}&lng=${lng}&distance=100000000`,
    328             success : function(response) {
    329                 let data = JSON.parse(response)
    330                 if (data.success) {
    331                     var bounds = new google.maps.LatLngBounds();
    332                     bounds.extend(new google.maps.LatLng(lat, lng));
    333                     bounds.extend(new google.maps.LatLng(data.points[0].location.lat, data.points[0].location.lng));
    334                     REDBOX_MAP.fitBounds(bounds);
    335                     jQuery( "#wrap-area-choose-point" ).animate({
    336                         bottom: -400
    337                     }, 500);
    338                 } else {
    339                     alert(data.msg)
    340                 }
    341                 jQuery('.redbox-waiting-response').remove()
    342             },
    343             error: function(e) {
    344                 alert('Error occured');
    345                 jQuery('.redbox-waiting-response').remove()
    346             }
    347         });
     329        var bounds = new google.maps.LatLngBounds();
     330        bounds.extend(new google.maps.LatLng(lat, lng));
     331        bounds.extend(new google.maps.LatLng(REDBOX_LIST_POINT[0].location.lat, REDBOX_LIST_POINT[0].location.lng));
     332        REDBOX_MAP.fitBounds(bounds);
     333        jQuery( "#wrap-area-choose-point" ).animate({
     334            bottom: -400
     335        }, 500);
    348336    }
    349337    function setFindAreaMap(map) {
     
    381369        });
    382370    }
     371
     372    function loadListPoint() {
     373        if (!REDBOX_LIST_POINT.length) {
     374            let LAT = 24.7135517
     375            let LNG = 46.6752957
     376            jQuery.ajax({
     377                url: ajax_url,
     378                type:'GET',
     379                data:`action=getlispoint&lat=${LAT}&lng=${LNG}&distance=100000000`,
     380                success : function(response) {
     381                    let data = JSON.parse(response)
     382                    if (data.success) {
     383                        REDBOX_LIST_POINT = data.points
     384                    } else {
     385                        alert(data.msg)
     386                    }
     387                },
     388                error: function(e) {
     389                    alert('Error occured');
     390                }
     391            });
     392        }
     393    }
     394
    383395    jQuery('#area-point-selected .bt-change-point').click(function(){
    384396        openModalRedbox()
     
    400412                REDBOX_METHOD_SELECTED = false
    401413                jQuery("#area-point-selected").hide()
     414                loadListPoint()
    402415            }
    403416        }
  • redbox-pickup/trunk/readme.txt

    r2517378 r2536298  
    55Requires at least: 3.3
    66Tested up to: 5.5.1
    7 Stable tag: 1.7
     7Stable tag: 1.8
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4141= 1.5 =
    4242Edit marker icon. Now there are 3 types of Redbox point: Locker, Counter and Locker and Counter.
     43= 1.8 =
     44Make page load list point after load checkout page.
    4345
    4446
     
    5254= 1.5 =
    5355Edit marker icon
     56= 1.8 =
     57Enhance performance load point
    5458
    5559
  • redbox-pickup/trunk/redbox.php

    r2517378 r2536298  
    44        * Description: This plugin allows customers pickup package at RedBox Locker.
    55        * Plugin URI: https://woocommerce.com/
    6         * Version: 1.7
     6        * Version: 1.8
    77        * Author: RedBox
    88        * Author URI: https://redboxsa.com
     
    120120                wp_enqueue_style( 'redbox_font_roboto', 'https://fonts.googleapis.com/css?family=Roboto' );
    121121                wp_enqueue_style( 'redbox_font_cario', 'https://fonts.googleapis.com/css?family=Cairo' );
    122                 wp_enqueue_script( 'redbox_front_js', REDBOX_PLUGIN_DIR . '/js/front.js', false, '1.0.9' );
     122                wp_enqueue_script( 'redbox_front_js', REDBOX_PLUGIN_DIR . '/js/front.js', false, '1.0.10' );
    123123                wp_enqueue_script( 'redbox_front_js_map', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBY1xlGe6jLbugOJegCsUGnzlufYWa5CRw&amp;sensor=false&amp;libraries=places' );
    124124                wp_enqueue_script( 'redbox_front_js_map_clustor', 'https://unpkg.com/@google/markerclustererplus@4.0.1/dist/markerclustererplus.min.js' );
Note: See TracChangeset for help on using the changeset viewer.