Plugin Directory

Changeset 3310668


Ignore:
Timestamp:
06/12/2025 05:58:28 PM (10 months ago)
Author:
jrmoser
Message:

version 2.1.8

Location:
box-tracker
Files:
8 edited
8 copied

Legend:

Unmodified
Added
Removed
  • box-tracker/tags/2.1.8/box-tracker-online.php

    r3292698 r3310668  
    88Plugin URI: https://www.dumpster.software/api/word-press-plugin.html
    99Description: The Box Tracker plugin facilitates online ordering for waste haulers.  Depending on configuration, orders will result either in service requests on the customer screen or fully booked work orders on dispatch.  Using the Web API tab on Box Tracker's Preferences app, you can prevent over booking, control which days of the week online orders will be accepted, and prevent same day ordering.  For more information about Box Tracker or this plugin please contact support at 603 546 6751 option 2 or support@cairnapps.com
    10 Version: 2.1.7
     10Version: 2.1.8
    1111Author: Cairn Applications Inc
    1212Author URI: https://www.cloud-computing.rocks/
  • box-tracker/tags/2.1.8/includes/base/enqueue.php

    r2772148 r3310668  
    3737            wp_enqueue_script('b0xT-dialog-box-script',         $this->b0xT_plugin_url.'javascript/dialog-box-script.js', '', '', 'all');
    3838     
    39             wp_enqueue_script('b0xT-google-maps', "https://maps.googleapis.com/maps/api/js?key=$b0xT_google_api_key&libraries=places", '', '', 'all');
     39            wp_enqueue_script('b0xT-google-maps', "https://maps.googleapis.com/maps/api/js?key=$b0xT_google_api_key&loading=async&libraries=places", '', '', 'all');
    4040            wp_enqueue_script('jquery-ui-datepicker');
    4141
  • box-tracker/tags/2.1.8/javascript/address-validation-script.js

    r3029650 r3310668  
    22     var b0xT_address_data = this;
    33     b0xT_address_data.config = b0xT_arg_config;
    4      var b0xT_place_auto_complete;
    5 
    6      this._b0xT_init = function() {
    7           //setup google places address autocomplete
    8           var b0xT_search = b0xT_address_data.config.searchCtrl;
    9           b0xT_place_auto_complete = new google.maps.places.Autocomplete(
     4
     5     this._b0xT_init = async function() {
     6          let b0xT_waitForGoogle = async function() {
     7               return new Promise(function(b0xT_resolve) {
     8                    async function b0xT_isItReady() {
     9                         if(typeof(google.maps.places) !== "undefined") {
     10                              try { //make a call to make sure the api is included in the key.
     11                                    //this call is not included in billing because the get details never
     12                                    //never gets called.
     13                                   const b0xT_token = new google.maps.places.AutocompleteSessionToken();
     14                                   const b0xT_suggestions = await google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions({
     15                                        sessionToken: b0xT_token,
     16                                        input: "588",
     17                                        language: "en-US",
     18                                        includedRegionCodes: ["us", "ca"]   
     19                                   });
     20                              } catch(e) {
     21                                    b0xT_resolve(1);
     22                              }
     23                              b0xT_resolve(0);
     24                         } else {
     25                              setTimeout(b0xT_isItReady, 50);
     26                         }
     27                    }
     28                    b0xT_isItReady();
     29               });
     30          };
     31
     32          let b0xT_legacy_check = await b0xT_waitForGoogle();
     33
     34          if(b0xT_legacy_check) {
     35               b0xT_address_data._b0xT_init_legacy();
     36               return;
     37          }
     38
     39          let b0xT_address_suggestion_wrap                = document.createElement("div");
     40          b0xT_address_suggestion_wrap.style.maxHeight    = "300px";
     41          b0xT_address_suggestion_wrap.style.overflowY    = "auto";
     42          b0xT_address_suggestion_wrap.style.position     = "absolute";
     43          b0xT_address_suggestion_wrap.style.marginTop    = "1px";
     44          b0xT_address_suggestion_wrap.style.marginLeft   = "1px";
     45          b0xT_address_suggestion_wrap.style.borderRadius = "1px";
     46          b0xT_address_suggestion_wrap.style.width        = b0xT_address_data.config.searchCtrl.clientWidth+"px";
     47          b0xT_address_data.address_suggestion_wrap       = b0xT_address_suggestion_wrap;
     48          b0xT_address_data.config.searchCtrl.after(b0xT_address_suggestion_wrap);
     49     
     50          //setup event listensers on fields
     51          b0xT_address_data.config.searchCtrl.addEventListener("keyup", function(b0xT_e) {       
     52               clearTimeout(b0xT_address_data.searchTimeOut); 
     53               b0xT_address_data.searchTimeOut = setTimeout(function() {
     54                    if(!String(b0xT_address_data.config.searchCtrl.value).trim()) { return; }
     55
     56                    //if we are using the search bar to act as the address bar aswell. then trigger the address changed
     57                    if(b0xT_address_data.config.addressCtrl && (b0xT_address_data.config.addressCtrl == b0xT_address_data.config.searchCtrl)) {
     58                         b0xT_address_data._b0xT_address_changed();
     59                    }
     60 
     61                    b0xT_address_data._b0xT_get_suggestions(b0xT_address_data.config.searchCtrl.value);
     62               }, 500);
     63          });
     64
     65          b0xT_address_data.config.searchCtrl.addEventListener("focus", function(b0xT_e) {     
     66               clearTimeout(b0xT_address_data.searchTimeOut); 
     67               b0xT_address_data.searchTimeOut = setTimeout(function() {
     68                    if(!String(b0xT_address_data.config.searchCtrl.value).trim()) { return; }
     69                    b0xT_address_data._b0xT_get_suggestions(b0xT_address_data.config.searchCtrl.value);
     70               }, 500);
     71          });
     72
     73          b0xT_address_data.config.searchCtrl.addEventListener("blur", function(b0xT_e) {
     74               clearTimeout(b0xT_address_data.blurTimeOut); 
     75               b0xT_address_data.blurTimeOut = setTimeout(function() {
     76                    b0xT_address_data.address_suggestion_wrap.innerHTML = "";
     77               }, 500);
     78          });
     79
     80          //if we are not using the search bar to act as the address bar, then set an onchange handler. Otherwise skip it
     81          if(b0xT_address_data.config.addressCtrl && (b0xT_address_data.config.addressCtrl != b0xT_address_data.config.searchCtrl)) {
     82               b0xT_address_data.config.addressCtrl = b0xT_address_data._b0xT_address_changed;
     83          }
     84
     85          b0xT_address_data.config.cityCtrl.onchange   = b0xT_address_data._b0xT_address_changed;
     86          b0xT_address_data.config.stateCtrl.onchange  = b0xT_address_data._b0xT_address_changed;
     87          b0xT_address_data.config.postalCtrl.onchange = b0xT_address_data._b0xT_address_changed;
     88     };
     89
     90     this._b0xT_init_legacy = function() {
     91          let b0xT_search = b0xT_address_data.config.searchCtrl;
     92          let b0xT_place_auto_complete = new google.maps.places.Autocomplete(
    1093               b0xT_search, {
    1194                    fields: ['geometry', 'address_component', 'type']
     
    1396          );
    1497
    15           var b0xT_call_back = function () {
    16                b0xT_address_data._b0xT_fill_in_address();
    17           }
    18 
    19           b0xT_place_auto_complete.addListener( 'place_changed',  b0xT_call_back);
    20           b0xT_address_data.placeautocomplete = b0xT_place_auto_complete;
     98          let b0xT_call_back = function () {
     99               b0xT_address_data._b0xT_fill_in_address_legacy();
     100          }
     101
     102          b0xT_place_auto_complete.addListener('place_changed',  b0xT_call_back);
     103          b0xT_address_data.placeautocomplete_legacy = b0xT_place_auto_complete;
    21104
    22105          //limit the counties to usa and canada
     
    26109
    27110          //setup event listensers on fields
    28           b0xT_address_data.config.addressCtrl.onchange = b0xT_address_data._b0xT_address_changed;
    29           b0xT_address_data.config.cityCtrl.onchange = b0xT_address_data._b0xT_address_changed;
    30           b0xT_address_data.config.stateCtrl.onchange = b0xT_address_data._b0xT_address_changed;
    31           b0xT_address_data.config.postalCtrl.onchange = b0xT_address_data._b0xT_address_changed;
    32      };
    33 
    34      this._b0xT_fill_in_address = function () {
    35           var b0xT_place = b0xT_address_data.placeautocomplete.getPlace();
     111          b0xT_address_data.config.addressCtrl.onchange = function() { b0xT_address_data._b0xT_address_changed(1); }
     112          b0xT_address_data.config.cityCtrl.onchange    = function() { b0xT_address_data._b0xT_address_changed(1); }
     113          b0xT_address_data.config.stateCtrl.onchange   = function() { b0xT_address_data._b0xT_address_changed(1); }
     114          b0xT_address_data.config.postalCtrl.onchange  = function() { b0xT_address_data._b0xT_address_changed(1); }
     115     }
     116
     117     this._b0xT_get_suggestions = async function(b0xT_v) {
     118          //creating a new session if it does not exist.
     119          const b0xT_token = b0xT_address_data.token_session ? b0xT_address_data.token_session : new google.maps.places.AutocompleteSessionToken();
     120          b0xT_address_data.token_session = b0xT_token;
     121
     122          let b0xT_options = {
     123               sessionToken: b0xT_token,
     124               input: b0xT_v,
     125               language: "en-US",
     126               includedRegionCodes: ["us", "ca"]
     127          };
     128
     129          const b0xT_suggestions = await google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions(b0xT_options);
     130          const b0xT_suggestions_array = b0xT_suggestions.suggestions;
     131
     132          b0xT_address_data.address_suggestion_wrap.innerHTML = "";
     133          let b0xT_address_suggestion_wrap = document.createElement("div");
     134          b0xT_address_suggestion_wrap.style.border = "1px solid #d1cfcf";
     135
     136          b0xT_suggestions_array.forEach(function(b0xT_suggestion, b0xT_index) {
     137               const b0xT_place_prediction = b0xT_suggestion.placePrediction;
     138               let b0xT_input_wrap = document.createElement("div");
     139               let b0xT_input      = document.createElement("input");
     140               b0xT_input.setAttribute("type", "text");
     141               b0xT_input.style.width   = "100%";
     142               b0xT_input.style.border  = "0px";
     143               b0xT_input.style.padding = "10px";
     144               b0xT_input.style.cursor  = "pointer";
     145               b0xT_input.style.color   = "#000000";
     146
     147               if(b0xT_index < b0xT_suggestions_array.length) {
     148                    b0xT_input.style.borderBottom = "1px solid #d1cfcf";
     149               }
     150
     151               b0xT_input.readOnly = true;
     152               b0xT_input.value    = b0xT_place_prediction.text.toString();
     153
     154               b0xT_input.onmouseover = function() {
     155                    this.style.color = "#0174ab";
     156                    this.style.backgroundColor = "#dddddd";
     157               };
     158               b0xT_input.onmouseout = function() {
     159                    this.style.removeProperty("color");
     160                    this.style.removeProperty("background-color");
     161               }
     162               b0xT_input.onclick = function() {
     163                    clearTimeout(b0xT_address_data.blurTimeOut);
     164                    clearTimeout(b0xT_address_data.searchTimeOut);
     165                    b0xT_address_data._b0xT_fill_in_address(b0xT_place_prediction);
     166                    b0xT_address_data.address_suggestion_wrap.innerHTML = "";
     167               }
     168
     169               b0xT_input_wrap.appendChild(b0xT_input);
     170               b0xT_address_suggestion_wrap.appendChild(b0xT_input_wrap);
     171          });
     172
     173          let b0xT_powered_by_wrap = document.createElement("div");
     174          let b0xT_powered_by      = document.createElement("input");
     175          b0xT_powered_by.setAttribute("type", "text");
     176          b0xT_powered_by.style.border        = "0px";
     177          b0xT_powered_by.style.padding       = "5px";
     178          b0xT_powered_by.style.width         = "100%";
     179          b0xT_powered_by.style.textAlign     = "right";
     180          b0xT_powered_by.style.fontWeight    = "bold";
     181          b0xT_powered_by.style.color         = "#000000";
     182          b0xT_powered_by.style.pointerEvents = "none";
     183          b0xT_powered_by.value               = "powered by Google";
     184
     185          b0xT_powered_by_wrap.appendChild(b0xT_powered_by);
     186          b0xT_address_suggestion_wrap.appendChild(b0xT_powered_by_wrap);
     187          b0xT_address_data.address_suggestion_wrap.appendChild(b0xT_address_suggestion_wrap);
     188     };
     189
     190     this._b0xT_fill_in_address = async function (b0xT_place_prediction) {
     191          var b0xT_place = b0xT_place_prediction.toPlace();
     192
     193          await b0xT_place.fetchFields({fields: ['location', 'addressComponents', 'types', 'displayName']});
     194
     195          //clear session token, this way we create a
     196          //new one when the suggestion triggers again
     197          b0xT_address_data.token_session = undefined;
     198
     199          if (!b0xT_place.location) {
     200               b0xT_address_data.b0xT_refresh_google_verification();
     201
     202               if(b0xT_address_data.dBox) {
     203                    b0xT_address_data.dBox.b0xT_open_dialog("WARNING!!", 'No details available for input: '+b0xT_place.displayName);
     204               }
     205               return;
     206          }
     207       
     208          //get autocompleted address
     209          let b0xT_street_number = b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'street_number' );
     210          b0xT_street_number.shortText = b0xT_street_number.shortText ? b0xT_street_number.shortText : b0xT_address_data.config.searchCtrl.value.split(' ')[0].replaceAll(/\D/g, '');
     211 
     212          let b0xT_street_name = b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'street_address' );
     213          b0xT_street_name = b0xT_street_name.longText ? b0xT_street_name : b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'route' );
     214          b0xT_street_name = b0xT_street_name.longText ? b0xT_street_name : b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'intersection' );
     215 
     216          let b0xT_city = b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'locality' );
     217          b0xT_city = b0xT_city.longText ? b0xT_city : b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'administrative_area_level_3' );
     218          b0xT_city = b0xT_city.longText ? b0xT_city : b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'sublocality_level_1' );
     219 
     220          let b0xT_state = b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'administrative_area_level_1' );
     221          let b0xT_postal = b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'postal_code' );         
     222          let b0xT_postal_suffix = b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'postal_code_suffix' );
     223
     224          //we are done, clear address field
     225          b0xT_address_data.config.addressCtrl.value = "";
     226
     227          //however, is state part of the selected country ?
     228          //if not we dont want to go any further than this
     229          var found_state = 0;
     230          for(var option of b0xT_address_data.config.stateCtrl.options) {
     231               if(option.value == b0xT_state.shortText) {
     232                    found_state++;
     233               }
     234          }
     235
     236          if(!found_state) {
     237               b0xT_address_data.b0xT_refresh_google_verification();
     238
     239               if(b0xT_address_data.dBox) {
     240                    b0xT_address_data.dBox.b0xT_open_dialog("WARNING!!", "This address appears to reside in a country that is not accepted by this company");
     241               }
     242               return;
     243          }
     244
     245          b0xT_address_data.config.addressCtrl.value = `${b0xT_street_number.shortText} ${b0xT_street_name.shortText}`;
     246          b0xT_address_data.config.cityCtrl.value = b0xT_city.longText;
     247          b0xT_address_data.config.stateCtrl.value = b0xT_state.shortText;
     248          b0xT_address_data.config.postalCtrl.value = b0xT_postal.shortText;
     249
     250          //check if the address is rooftop
     251          let b0xT_verified = 0;
     252          if(b0xT_place.types.includes('premise') || b0xT_place.location.location_type == 'ROOFTOP' || b0xT_postal_suffix.shortText.length) {
     253               //TODO::
     254               b0xT_verified = 1;
     255          } else if(document.getElementById("b0xT_google_status_bypass").value == "On") {
     256               //we are going to check for valid cordinates
     257               let b0xT_coordinate_validate = function() {
     258                    let b0xT_pattern = new RegExp("^-?[1-9]\\d{1,2}($|\.\\d+$)");
     259
     260                    if(!b0xT_place.location) { return 0; }
     261                    if(!b0xT_place.location.location) { return 0; }
     262
     263                    let b0xT_lat = b0xT_place.location.location.lat() * 1;
     264                    let b0xT_lng = b0xT_place.location.location.lng() * 1;
     265
     266                    if(!b0xT_pattern.exec(b0xT_lat)) { return 0; }
     267                    if(!b0xT_pattern.exec(b0xT_lng)) { return 0; }
     268
     269                    if(!(b0xT_lat <= 90 && b0xT_lat >= -90)) { return 0; }
     270                    if(!(b0xT_lng <= 180 && b0xT_lng >= -180)) { return 0; }
     271                    return 2;
     272               }
     273
     274               b0xT_verified = b0xT_coordinate_validate();
     275          }
     276
     277          b0xT_address_data.b0xT_refresh_google_verification(b0xT_verified);
     278     };
     279
     280     this._b0xT_fill_in_address_legacy = function() {
     281          var b0xT_place = b0xT_address_data.placeautocomplete_legacy.getPlace();
    36282
    37283          if (!b0xT_place.geometry) {
    38 
    39284               b0xT_address_data.b0xT_refresh_google_verification();
    40285
     
    46291       
    47292          //get autocompleted address
    48           let b0xT_street_number = b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'street_number' );
     293          let b0xT_street_number = b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'street_number', 1);
    49294          b0xT_street_number.short_name = b0xT_street_number.short_name ? b0xT_street_number.short_name : b0xT_address_data.config.searchCtrl.value.split(' ')[0].replaceAll(/\D/g, '');
    50295 
    51           let b0xT_street_name = b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'street_address' );
    52           b0xT_street_name = b0xT_street_name.long_name ? b0xT_street_name : b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'route' );
    53           b0xT_street_name = b0xT_street_name.long_name ? b0xT_street_name : b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'intersection' );
    54  
    55           let b0xT_city = b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'locality' );
    56           b0xT_city = b0xT_city.long_name ? b0xT_city : b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'administrative_area_level_3' );
    57           b0xT_city = b0xT_city.long_name ? b0xT_city : b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'sublocality_level_1' );
    58  
    59           let b0xT_state = b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'administrative_area_level_1' );
    60           let b0xT_postal = b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'postal_code' );         
    61           let b0xT_postal_suffix = b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'postal_code_suffix' );
     296          let b0xT_street_name = b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'street_address' );
     297          b0xT_street_name = b0xT_street_name.long_name ? b0xT_street_name : b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'route', 1);
     298          b0xT_street_name = b0xT_street_name.long_name ? b0xT_street_name : b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'intersection', 1);
     299 
     300          let b0xT_city = b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'locality', 1);
     301          b0xT_city = b0xT_city.long_name ? b0xT_city : b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'administrative_area_level_3', 1);
     302          b0xT_city = b0xT_city.long_name ? b0xT_city : b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'sublocality_level_1', 1);
     303 
     304          let b0xT_state = b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'administrative_area_level_1', 1);
     305          let b0xT_postal = b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'postal_code', 1);         
     306          let b0xT_postal_suffix = b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'postal_code_suffix', 1);
    62307
    63308          //we are done, clear address field
     
    74319
    75320          if(!found_state) {
    76 
    77321               b0xT_address_data.b0xT_refresh_google_verification();
    78 
    79322               if(b0xT_address_data.dBox) {
    80323                    b0xT_address_data.dBox.b0xT_open_dialog("WARNING!!", "This address appears to reside in a country that is not accepted by this company");
     
    84327
    85328          b0xT_address_data.config.addressCtrl.value = `${b0xT_street_number.short_name} ${b0xT_street_name.short_name}`;
    86           b0xT_address_data.config.cityCtrl.value = b0xT_city.long_name;
    87           b0xT_address_data.config.stateCtrl.value = b0xT_state.short_name;
    88           b0xT_address_data.config.postalCtrl.value = b0xT_postal.short_name;
     329          b0xT_address_data.config.cityCtrl.value    = b0xT_city.long_name;
     330          b0xT_address_data.config.stateCtrl.value   = b0xT_state.short_name;
     331          b0xT_address_data.config.postalCtrl.value  = b0xT_postal.short_name;
    89332
    90333          //check if the address is rooftop
     
    116359
    117360          b0xT_address_data.b0xT_refresh_google_verification(b0xT_verified);
    118      };
    119 
    120      this._b0xT_find_address_component = function( b0xT_address_array, b0xT_search ) {
     361     }
     362
     363     this._b0xT_find_address_component = function(b0xT_address_array, b0xT_search, b0xT_arg_legacy) {
    121364          for( let i = 0; i < b0xT_address_array.length; i++ ) {
    122365               if ( b0xT_address_array[i].types[0] == b0xT_search ) {
     
    124367               }
    125368          }
    126           return { long_name: '', short_name: '', types: [ b0xT_search ] };
     369          if(b0xT_arg_legacy) {
     370               return { long_name: '', short_name: '', types: [ b0xT_search ] };
     371          }
     372          return { longText: '', shortText: '', types: [ b0xT_search ] };
    127373     };
    128374
     
    144390     };
    145391
    146      this._b0xT_address_changed = function() {
    147           if(b0xT_address_data.config.validateCtrl.className != 'b0xT_verify_error') {
    148                b0xT_address_data.b0xT_refresh_google_verification();
    149           }
    150 
    151           //reset error div if its present
    152           if(document.getElementsByClassName("b0xT-error-msg") && document.getElementsByClassName("b0xT-error-msg")[0]) {
    153                document.getElementsByClassName("b0xT-error-msg")[0].remove();
    154           }
     392     this._b0xT_address_changed = function(b0xT_arg_legacy) {
     393          let b0xT_the_work = function() {
     394               if(b0xT_address_data.config.validateCtrl.className != 'b0xT_verify_error') {
     395                    b0xT_address_data.b0xT_refresh_google_verification();
     396               }
     397               //reset error div if its present
     398               if(document.getElementsByClassName("b0xT-error-msg") && document.getElementsByClassName("b0xT-error-msg")[0]) {
     399                    document.getElementsByClassName("b0xT-error-msg")[0].remove();
     400               }
     401          };
     402
     403          if(b0xT_arg_legacy) {
     404               b0xT_the_work();
     405               return;
     406          }
     407
     408          clearTimeout(b0xT_address_data.changeTimeout);
     409          b0xT_address_data.changeTimeout = setTimeout(function() {
     410               b0xT_the_work(); 
     411          }, 500);
    155412     };
    156413
  • box-tracker/tags/2.1.8/readme.txt

    r3292698 r3310668  
    44Requires PHP: 5.6.4
    55Tested up to: 6.8
    6 Stable tag: 2.1.7
     6Stable tag: 2.1.8
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • box-tracker/tags/2.1.8/templates/front-house-step-one-template.php

    r2793642 r3310668  
    1414                <div class="b0xT_field-row">
    1515                    <label>Job Address:<span style="color: red">*</span></label>
    16                     <input type="text" id="b0xT_job_address" class="b0xT_form-input " name="b0xT_job_address" value=""/>
     16                    <div>
     17                        <input type="text" id="b0xT_job_address" class="b0xT_form-input " name="b0xT_job_address" value="" placeholder="Search Address" />
     18                    </div>
    1719                    <div style="padding-top: 5px; font-size: 90%;">
    1820                        <strong>
  • box-tracker/trunk/box-tracker-online.php

    r3292698 r3310668  
    88Plugin URI: https://www.dumpster.software/api/word-press-plugin.html
    99Description: The Box Tracker plugin facilitates online ordering for waste haulers.  Depending on configuration, orders will result either in service requests on the customer screen or fully booked work orders on dispatch.  Using the Web API tab on Box Tracker's Preferences app, you can prevent over booking, control which days of the week online orders will be accepted, and prevent same day ordering.  For more information about Box Tracker or this plugin please contact support at 603 546 6751 option 2 or support@cairnapps.com
    10 Version: 2.1.7
     10Version: 2.1.8
    1111Author: Cairn Applications Inc
    1212Author URI: https://www.cloud-computing.rocks/
  • box-tracker/trunk/includes/base/enqueue.php

    r2772148 r3310668  
    3737            wp_enqueue_script('b0xT-dialog-box-script',         $this->b0xT_plugin_url.'javascript/dialog-box-script.js', '', '', 'all');
    3838     
    39             wp_enqueue_script('b0xT-google-maps', "https://maps.googleapis.com/maps/api/js?key=$b0xT_google_api_key&libraries=places", '', '', 'all');
     39            wp_enqueue_script('b0xT-google-maps', "https://maps.googleapis.com/maps/api/js?key=$b0xT_google_api_key&loading=async&libraries=places", '', '', 'all');
    4040            wp_enqueue_script('jquery-ui-datepicker');
    4141
  • box-tracker/trunk/javascript/address-validation-script.js

    r3029650 r3310668  
    22     var b0xT_address_data = this;
    33     b0xT_address_data.config = b0xT_arg_config;
    4      var b0xT_place_auto_complete;
    5 
    6      this._b0xT_init = function() {
    7           //setup google places address autocomplete
    8           var b0xT_search = b0xT_address_data.config.searchCtrl;
    9           b0xT_place_auto_complete = new google.maps.places.Autocomplete(
     4
     5     this._b0xT_init = async function() {
     6          let b0xT_waitForGoogle = async function() {
     7               return new Promise(function(b0xT_resolve) {
     8                    async function b0xT_isItReady() {
     9                         if(typeof(google.maps.places) !== "undefined") {
     10                              try { //make a call to make sure the api is included in the key.
     11                                    //this call is not included in billing because the get details never
     12                                    //never gets called.
     13                                   const b0xT_token = new google.maps.places.AutocompleteSessionToken();
     14                                   const b0xT_suggestions = await google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions({
     15                                        sessionToken: b0xT_token,
     16                                        input: "588",
     17                                        language: "en-US",
     18                                        includedRegionCodes: ["us", "ca"]   
     19                                   });
     20                              } catch(e) {
     21                                    b0xT_resolve(1);
     22                              }
     23                              b0xT_resolve(0);
     24                         } else {
     25                              setTimeout(b0xT_isItReady, 50);
     26                         }
     27                    }
     28                    b0xT_isItReady();
     29               });
     30          };
     31
     32          let b0xT_legacy_check = await b0xT_waitForGoogle();
     33
     34          if(b0xT_legacy_check) {
     35               b0xT_address_data._b0xT_init_legacy();
     36               return;
     37          }
     38
     39          let b0xT_address_suggestion_wrap                = document.createElement("div");
     40          b0xT_address_suggestion_wrap.style.maxHeight    = "300px";
     41          b0xT_address_suggestion_wrap.style.overflowY    = "auto";
     42          b0xT_address_suggestion_wrap.style.position     = "absolute";
     43          b0xT_address_suggestion_wrap.style.marginTop    = "1px";
     44          b0xT_address_suggestion_wrap.style.marginLeft   = "1px";
     45          b0xT_address_suggestion_wrap.style.borderRadius = "1px";
     46          b0xT_address_suggestion_wrap.style.width        = b0xT_address_data.config.searchCtrl.clientWidth+"px";
     47          b0xT_address_data.address_suggestion_wrap       = b0xT_address_suggestion_wrap;
     48          b0xT_address_data.config.searchCtrl.after(b0xT_address_suggestion_wrap);
     49     
     50          //setup event listensers on fields
     51          b0xT_address_data.config.searchCtrl.addEventListener("keyup", function(b0xT_e) {       
     52               clearTimeout(b0xT_address_data.searchTimeOut); 
     53               b0xT_address_data.searchTimeOut = setTimeout(function() {
     54                    if(!String(b0xT_address_data.config.searchCtrl.value).trim()) { return; }
     55
     56                    //if we are using the search bar to act as the address bar aswell. then trigger the address changed
     57                    if(b0xT_address_data.config.addressCtrl && (b0xT_address_data.config.addressCtrl == b0xT_address_data.config.searchCtrl)) {
     58                         b0xT_address_data._b0xT_address_changed();
     59                    }
     60 
     61                    b0xT_address_data._b0xT_get_suggestions(b0xT_address_data.config.searchCtrl.value);
     62               }, 500);
     63          });
     64
     65          b0xT_address_data.config.searchCtrl.addEventListener("focus", function(b0xT_e) {     
     66               clearTimeout(b0xT_address_data.searchTimeOut); 
     67               b0xT_address_data.searchTimeOut = setTimeout(function() {
     68                    if(!String(b0xT_address_data.config.searchCtrl.value).trim()) { return; }
     69                    b0xT_address_data._b0xT_get_suggestions(b0xT_address_data.config.searchCtrl.value);
     70               }, 500);
     71          });
     72
     73          b0xT_address_data.config.searchCtrl.addEventListener("blur", function(b0xT_e) {
     74               clearTimeout(b0xT_address_data.blurTimeOut); 
     75               b0xT_address_data.blurTimeOut = setTimeout(function() {
     76                    b0xT_address_data.address_suggestion_wrap.innerHTML = "";
     77               }, 500);
     78          });
     79
     80          //if we are not using the search bar to act as the address bar, then set an onchange handler. Otherwise skip it
     81          if(b0xT_address_data.config.addressCtrl && (b0xT_address_data.config.addressCtrl != b0xT_address_data.config.searchCtrl)) {
     82               b0xT_address_data.config.addressCtrl = b0xT_address_data._b0xT_address_changed;
     83          }
     84
     85          b0xT_address_data.config.cityCtrl.onchange   = b0xT_address_data._b0xT_address_changed;
     86          b0xT_address_data.config.stateCtrl.onchange  = b0xT_address_data._b0xT_address_changed;
     87          b0xT_address_data.config.postalCtrl.onchange = b0xT_address_data._b0xT_address_changed;
     88     };
     89
     90     this._b0xT_init_legacy = function() {
     91          let b0xT_search = b0xT_address_data.config.searchCtrl;
     92          let b0xT_place_auto_complete = new google.maps.places.Autocomplete(
    1093               b0xT_search, {
    1194                    fields: ['geometry', 'address_component', 'type']
     
    1396          );
    1497
    15           var b0xT_call_back = function () {
    16                b0xT_address_data._b0xT_fill_in_address();
    17           }
    18 
    19           b0xT_place_auto_complete.addListener( 'place_changed',  b0xT_call_back);
    20           b0xT_address_data.placeautocomplete = b0xT_place_auto_complete;
     98          let b0xT_call_back = function () {
     99               b0xT_address_data._b0xT_fill_in_address_legacy();
     100          }
     101
     102          b0xT_place_auto_complete.addListener('place_changed',  b0xT_call_back);
     103          b0xT_address_data.placeautocomplete_legacy = b0xT_place_auto_complete;
    21104
    22105          //limit the counties to usa and canada
     
    26109
    27110          //setup event listensers on fields
    28           b0xT_address_data.config.addressCtrl.onchange = b0xT_address_data._b0xT_address_changed;
    29           b0xT_address_data.config.cityCtrl.onchange = b0xT_address_data._b0xT_address_changed;
    30           b0xT_address_data.config.stateCtrl.onchange = b0xT_address_data._b0xT_address_changed;
    31           b0xT_address_data.config.postalCtrl.onchange = b0xT_address_data._b0xT_address_changed;
    32      };
    33 
    34      this._b0xT_fill_in_address = function () {
    35           var b0xT_place = b0xT_address_data.placeautocomplete.getPlace();
     111          b0xT_address_data.config.addressCtrl.onchange = function() { b0xT_address_data._b0xT_address_changed(1); }
     112          b0xT_address_data.config.cityCtrl.onchange    = function() { b0xT_address_data._b0xT_address_changed(1); }
     113          b0xT_address_data.config.stateCtrl.onchange   = function() { b0xT_address_data._b0xT_address_changed(1); }
     114          b0xT_address_data.config.postalCtrl.onchange  = function() { b0xT_address_data._b0xT_address_changed(1); }
     115     }
     116
     117     this._b0xT_get_suggestions = async function(b0xT_v) {
     118          //creating a new session if it does not exist.
     119          const b0xT_token = b0xT_address_data.token_session ? b0xT_address_data.token_session : new google.maps.places.AutocompleteSessionToken();
     120          b0xT_address_data.token_session = b0xT_token;
     121
     122          let b0xT_options = {
     123               sessionToken: b0xT_token,
     124               input: b0xT_v,
     125               language: "en-US",
     126               includedRegionCodes: ["us", "ca"]
     127          };
     128
     129          const b0xT_suggestions = await google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions(b0xT_options);
     130          const b0xT_suggestions_array = b0xT_suggestions.suggestions;
     131
     132          b0xT_address_data.address_suggestion_wrap.innerHTML = "";
     133          let b0xT_address_suggestion_wrap = document.createElement("div");
     134          b0xT_address_suggestion_wrap.style.border = "1px solid #d1cfcf";
     135
     136          b0xT_suggestions_array.forEach(function(b0xT_suggestion, b0xT_index) {
     137               const b0xT_place_prediction = b0xT_suggestion.placePrediction;
     138               let b0xT_input_wrap = document.createElement("div");
     139               let b0xT_input      = document.createElement("input");
     140               b0xT_input.setAttribute("type", "text");
     141               b0xT_input.style.width   = "100%";
     142               b0xT_input.style.border  = "0px";
     143               b0xT_input.style.padding = "10px";
     144               b0xT_input.style.cursor  = "pointer";
     145               b0xT_input.style.color   = "#000000";
     146
     147               if(b0xT_index < b0xT_suggestions_array.length) {
     148                    b0xT_input.style.borderBottom = "1px solid #d1cfcf";
     149               }
     150
     151               b0xT_input.readOnly = true;
     152               b0xT_input.value    = b0xT_place_prediction.text.toString();
     153
     154               b0xT_input.onmouseover = function() {
     155                    this.style.color = "#0174ab";
     156                    this.style.backgroundColor = "#dddddd";
     157               };
     158               b0xT_input.onmouseout = function() {
     159                    this.style.removeProperty("color");
     160                    this.style.removeProperty("background-color");
     161               }
     162               b0xT_input.onclick = function() {
     163                    clearTimeout(b0xT_address_data.blurTimeOut);
     164                    clearTimeout(b0xT_address_data.searchTimeOut);
     165                    b0xT_address_data._b0xT_fill_in_address(b0xT_place_prediction);
     166                    b0xT_address_data.address_suggestion_wrap.innerHTML = "";
     167               }
     168
     169               b0xT_input_wrap.appendChild(b0xT_input);
     170               b0xT_address_suggestion_wrap.appendChild(b0xT_input_wrap);
     171          });
     172
     173          let b0xT_powered_by_wrap = document.createElement("div");
     174          let b0xT_powered_by      = document.createElement("input");
     175          b0xT_powered_by.setAttribute("type", "text");
     176          b0xT_powered_by.style.border        = "0px";
     177          b0xT_powered_by.style.padding       = "5px";
     178          b0xT_powered_by.style.width         = "100%";
     179          b0xT_powered_by.style.textAlign     = "right";
     180          b0xT_powered_by.style.fontWeight    = "bold";
     181          b0xT_powered_by.style.color         = "#000000";
     182          b0xT_powered_by.style.pointerEvents = "none";
     183          b0xT_powered_by.value               = "powered by Google";
     184
     185          b0xT_powered_by_wrap.appendChild(b0xT_powered_by);
     186          b0xT_address_suggestion_wrap.appendChild(b0xT_powered_by_wrap);
     187          b0xT_address_data.address_suggestion_wrap.appendChild(b0xT_address_suggestion_wrap);
     188     };
     189
     190     this._b0xT_fill_in_address = async function (b0xT_place_prediction) {
     191          var b0xT_place = b0xT_place_prediction.toPlace();
     192
     193          await b0xT_place.fetchFields({fields: ['location', 'addressComponents', 'types', 'displayName']});
     194
     195          //clear session token, this way we create a
     196          //new one when the suggestion triggers again
     197          b0xT_address_data.token_session = undefined;
     198
     199          if (!b0xT_place.location) {
     200               b0xT_address_data.b0xT_refresh_google_verification();
     201
     202               if(b0xT_address_data.dBox) {
     203                    b0xT_address_data.dBox.b0xT_open_dialog("WARNING!!", 'No details available for input: '+b0xT_place.displayName);
     204               }
     205               return;
     206          }
     207       
     208          //get autocompleted address
     209          let b0xT_street_number = b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'street_number' );
     210          b0xT_street_number.shortText = b0xT_street_number.shortText ? b0xT_street_number.shortText : b0xT_address_data.config.searchCtrl.value.split(' ')[0].replaceAll(/\D/g, '');
     211 
     212          let b0xT_street_name = b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'street_address' );
     213          b0xT_street_name = b0xT_street_name.longText ? b0xT_street_name : b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'route' );
     214          b0xT_street_name = b0xT_street_name.longText ? b0xT_street_name : b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'intersection' );
     215 
     216          let b0xT_city = b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'locality' );
     217          b0xT_city = b0xT_city.longText ? b0xT_city : b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'administrative_area_level_3' );
     218          b0xT_city = b0xT_city.longText ? b0xT_city : b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'sublocality_level_1' );
     219 
     220          let b0xT_state = b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'administrative_area_level_1' );
     221          let b0xT_postal = b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'postal_code' );         
     222          let b0xT_postal_suffix = b0xT_address_data._b0xT_find_address_component( b0xT_place.addressComponents, 'postal_code_suffix' );
     223
     224          //we are done, clear address field
     225          b0xT_address_data.config.addressCtrl.value = "";
     226
     227          //however, is state part of the selected country ?
     228          //if not we dont want to go any further than this
     229          var found_state = 0;
     230          for(var option of b0xT_address_data.config.stateCtrl.options) {
     231               if(option.value == b0xT_state.shortText) {
     232                    found_state++;
     233               }
     234          }
     235
     236          if(!found_state) {
     237               b0xT_address_data.b0xT_refresh_google_verification();
     238
     239               if(b0xT_address_data.dBox) {
     240                    b0xT_address_data.dBox.b0xT_open_dialog("WARNING!!", "This address appears to reside in a country that is not accepted by this company");
     241               }
     242               return;
     243          }
     244
     245          b0xT_address_data.config.addressCtrl.value = `${b0xT_street_number.shortText} ${b0xT_street_name.shortText}`;
     246          b0xT_address_data.config.cityCtrl.value = b0xT_city.longText;
     247          b0xT_address_data.config.stateCtrl.value = b0xT_state.shortText;
     248          b0xT_address_data.config.postalCtrl.value = b0xT_postal.shortText;
     249
     250          //check if the address is rooftop
     251          let b0xT_verified = 0;
     252          if(b0xT_place.types.includes('premise') || b0xT_place.location.location_type == 'ROOFTOP' || b0xT_postal_suffix.shortText.length) {
     253               //TODO::
     254               b0xT_verified = 1;
     255          } else if(document.getElementById("b0xT_google_status_bypass").value == "On") {
     256               //we are going to check for valid cordinates
     257               let b0xT_coordinate_validate = function() {
     258                    let b0xT_pattern = new RegExp("^-?[1-9]\\d{1,2}($|\.\\d+$)");
     259
     260                    if(!b0xT_place.location) { return 0; }
     261                    if(!b0xT_place.location.location) { return 0; }
     262
     263                    let b0xT_lat = b0xT_place.location.location.lat() * 1;
     264                    let b0xT_lng = b0xT_place.location.location.lng() * 1;
     265
     266                    if(!b0xT_pattern.exec(b0xT_lat)) { return 0; }
     267                    if(!b0xT_pattern.exec(b0xT_lng)) { return 0; }
     268
     269                    if(!(b0xT_lat <= 90 && b0xT_lat >= -90)) { return 0; }
     270                    if(!(b0xT_lng <= 180 && b0xT_lng >= -180)) { return 0; }
     271                    return 2;
     272               }
     273
     274               b0xT_verified = b0xT_coordinate_validate();
     275          }
     276
     277          b0xT_address_data.b0xT_refresh_google_verification(b0xT_verified);
     278     };
     279
     280     this._b0xT_fill_in_address_legacy = function() {
     281          var b0xT_place = b0xT_address_data.placeautocomplete_legacy.getPlace();
    36282
    37283          if (!b0xT_place.geometry) {
    38 
    39284               b0xT_address_data.b0xT_refresh_google_verification();
    40285
     
    46291       
    47292          //get autocompleted address
    48           let b0xT_street_number = b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'street_number' );
     293          let b0xT_street_number = b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'street_number', 1);
    49294          b0xT_street_number.short_name = b0xT_street_number.short_name ? b0xT_street_number.short_name : b0xT_address_data.config.searchCtrl.value.split(' ')[0].replaceAll(/\D/g, '');
    50295 
    51           let b0xT_street_name = b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'street_address' );
    52           b0xT_street_name = b0xT_street_name.long_name ? b0xT_street_name : b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'route' );
    53           b0xT_street_name = b0xT_street_name.long_name ? b0xT_street_name : b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'intersection' );
    54  
    55           let b0xT_city = b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'locality' );
    56           b0xT_city = b0xT_city.long_name ? b0xT_city : b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'administrative_area_level_3' );
    57           b0xT_city = b0xT_city.long_name ? b0xT_city : b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'sublocality_level_1' );
    58  
    59           let b0xT_state = b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'administrative_area_level_1' );
    60           let b0xT_postal = b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'postal_code' );         
    61           let b0xT_postal_suffix = b0xT_address_data._b0xT_find_address_component( b0xT_place.address_components, 'postal_code_suffix' );
     296          let b0xT_street_name = b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'street_address' );
     297          b0xT_street_name = b0xT_street_name.long_name ? b0xT_street_name : b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'route', 1);
     298          b0xT_street_name = b0xT_street_name.long_name ? b0xT_street_name : b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'intersection', 1);
     299 
     300          let b0xT_city = b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'locality', 1);
     301          b0xT_city = b0xT_city.long_name ? b0xT_city : b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'administrative_area_level_3', 1);
     302          b0xT_city = b0xT_city.long_name ? b0xT_city : b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'sublocality_level_1', 1);
     303 
     304          let b0xT_state = b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'administrative_area_level_1', 1);
     305          let b0xT_postal = b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'postal_code', 1);         
     306          let b0xT_postal_suffix = b0xT_address_data._b0xT_find_address_component(b0xT_place.address_components, 'postal_code_suffix', 1);
    62307
    63308          //we are done, clear address field
     
    74319
    75320          if(!found_state) {
    76 
    77321               b0xT_address_data.b0xT_refresh_google_verification();
    78 
    79322               if(b0xT_address_data.dBox) {
    80323                    b0xT_address_data.dBox.b0xT_open_dialog("WARNING!!", "This address appears to reside in a country that is not accepted by this company");
     
    84327
    85328          b0xT_address_data.config.addressCtrl.value = `${b0xT_street_number.short_name} ${b0xT_street_name.short_name}`;
    86           b0xT_address_data.config.cityCtrl.value = b0xT_city.long_name;
    87           b0xT_address_data.config.stateCtrl.value = b0xT_state.short_name;
    88           b0xT_address_data.config.postalCtrl.value = b0xT_postal.short_name;
     329          b0xT_address_data.config.cityCtrl.value    = b0xT_city.long_name;
     330          b0xT_address_data.config.stateCtrl.value   = b0xT_state.short_name;
     331          b0xT_address_data.config.postalCtrl.value  = b0xT_postal.short_name;
    89332
    90333          //check if the address is rooftop
     
    116359
    117360          b0xT_address_data.b0xT_refresh_google_verification(b0xT_verified);
    118      };
    119 
    120      this._b0xT_find_address_component = function( b0xT_address_array, b0xT_search ) {
     361     }
     362
     363     this._b0xT_find_address_component = function(b0xT_address_array, b0xT_search, b0xT_arg_legacy) {
    121364          for( let i = 0; i < b0xT_address_array.length; i++ ) {
    122365               if ( b0xT_address_array[i].types[0] == b0xT_search ) {
     
    124367               }
    125368          }
    126           return { long_name: '', short_name: '', types: [ b0xT_search ] };
     369          if(b0xT_arg_legacy) {
     370               return { long_name: '', short_name: '', types: [ b0xT_search ] };
     371          }
     372          return { longText: '', shortText: '', types: [ b0xT_search ] };
    127373     };
    128374
     
    144390     };
    145391
    146      this._b0xT_address_changed = function() {
    147           if(b0xT_address_data.config.validateCtrl.className != 'b0xT_verify_error') {
    148                b0xT_address_data.b0xT_refresh_google_verification();
    149           }
    150 
    151           //reset error div if its present
    152           if(document.getElementsByClassName("b0xT-error-msg") && document.getElementsByClassName("b0xT-error-msg")[0]) {
    153                document.getElementsByClassName("b0xT-error-msg")[0].remove();
    154           }
     392     this._b0xT_address_changed = function(b0xT_arg_legacy) {
     393          let b0xT_the_work = function() {
     394               if(b0xT_address_data.config.validateCtrl.className != 'b0xT_verify_error') {
     395                    b0xT_address_data.b0xT_refresh_google_verification();
     396               }
     397               //reset error div if its present
     398               if(document.getElementsByClassName("b0xT-error-msg") && document.getElementsByClassName("b0xT-error-msg")[0]) {
     399                    document.getElementsByClassName("b0xT-error-msg")[0].remove();
     400               }
     401          };
     402
     403          if(b0xT_arg_legacy) {
     404               b0xT_the_work();
     405               return;
     406          }
     407
     408          clearTimeout(b0xT_address_data.changeTimeout);
     409          b0xT_address_data.changeTimeout = setTimeout(function() {
     410               b0xT_the_work(); 
     411          }, 500);
    155412     };
    156413
  • box-tracker/trunk/readme.txt

    r3292698 r3310668  
    44Requires PHP: 5.6.4
    55Tested up to: 6.8
    6 Stable tag: 2.1.7
     6Stable tag: 2.1.8
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • box-tracker/trunk/templates/front-house-step-one-template.php

    r2793642 r3310668  
    1414                <div class="b0xT_field-row">
    1515                    <label>Job Address:<span style="color: red">*</span></label>
    16                     <input type="text" id="b0xT_job_address" class="b0xT_form-input " name="b0xT_job_address" value=""/>
     16                    <div>
     17                        <input type="text" id="b0xT_job_address" class="b0xT_form-input " name="b0xT_job_address" value="" placeholder="Search Address" />
     18                    </div>
    1719                    <div style="padding-top: 5px; font-size: 90%;">
    1820                        <strong>
Note: See TracChangeset for help on using the changeset viewer.