Plugin Directory

Changeset 2093546


Ignore:
Timestamp:
05/23/2019 07:31:16 AM (7 years ago)
Author:
jobprogress
Message:
  1. Enable Canadian Zip Code
  2. Captcha Changed due to security reason
Location:
contractor-contact-form-website-to-workflow-tool
Files:
52 added
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • contractor-contact-form-website-to-workflow-tool/trunk/class.jobprogress.php

    r2078295 r2093546  
    1818     */
    1919    private function init_hooks() {
     20        add_action('admin_enqueue_scripts', array($this, 'admin_script'));
    2021        add_action('wp_footer', array($this, 'scripts'));
    2122        add_action('admin_menu',array($this, 'jp_admin_page') );
    22         add_action('admin_enqueue_scripts', array($this, 'admin_script'));
    2323    }
    2424
  • contractor-contact-form-website-to-workflow-tool/trunk/css/custom.css

    r2078296 r2093546  
    394394    bottom: -25px;
    395395}
     396.captcha-wrap {
     397    text-align: center !important;
     398}
     399#jp_captcha {
     400    position: relative;
     401    padding: 10px !important;
     402    display: inline-block;
     403}
     404.captcha-invalid {
     405    display: block !important;
     406}
     407.refresh-captcha {
     408    position: absolute;
     409    cursor: pointer;
     410    right: 15px;
     411    bottom: 45px;
     412}
     413.refresh-captcha img {
     414    width: 15px;
     415}
  • contractor-contact-form-website-to-workflow-tool/trunk/customer-form-page.php

    r2078295 r2093546  
    166166                <label class="absolute-label">Zip <!-- <span class="required-sign">*</span> --></label>
    167167                <div>
    168                     <input type="text" class="number form-control" placeholder="Zip" name="address[zip]" maxLength="5" />
     168                    <input type="text" class="form-control" placeholder="Zip" name="address[zip]" maxLength="10" />
    169169                    <?php echo $this->get_error_wrapper('zip'); ?>
    170170                </div>
     
    234234                    <label class="absolute-label">zip</label>
    235235                    <div>
    236                         <input type="text" class="form-control" placeholder="zip code" name="billing[zip]" maxLength="5" />
     236                        <input type="text" class="form-control" placeholder="zip code" name="billing[zip]" maxLength="10" />
    237237                    </div>
    238238                </div>
     
    306306   
    307307    <div style="position: relative;">
    308         <div class="form-group form-group-input">
     308        <div class="captcha-wrap form-group form-group-input">
    309309            <label class="absolute-label">Enter Captcha<span class="required-sign">*</span></label>
    310             <div id="captchaimage">
    311                 <a href="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>" id="refreshimg" title="Click to refresh image"><img src="<?php echo plugin_dir_url( __FILE__ ); ?>captcha_image/image.php?<?php echo time(); ?>" width="132" height="46"></a>
    312             </div>
    313             <input type="text" class="form-control captcha-input" maxlength="6" name="captcha" id="captcha" placeholder="Enter Captcha" required>
    314         </div>
     310            <div id="jp_captcha"></div>
     311            <input type="text" class="form-control captcha-input" placeholder="Enter Captcha" name="cpatchaTextBox" id="cpatchaTextBox"/>
     312            <span class="refresh-captcha" title="Refresh captcha">
     313                <img src="<?php echo plugin_dir_url( __FILE__ ); ?>img/sync-alt.svg">
     314            </span>
     315        </div>
     316        <label class="error captcha-invalid"></label>
    315317    </div>
    316318
  • contractor-contact-form-website-to-workflow-tool/trunk/jobprogress.php

    r2078295 r2093546  
    44Description: This useful plugin is a website to workflow tool that allows contractors to drive leads directly from their own website form inquiries directly into their JobProgress workcenters.  JobProgress is  a Cloud based Business Management Platform for Home Improvement Contractors. With this useful plugin, you can drive customers directly from your website into your JobProgress workflow stages and begin to populate both customer and job related leads and prospects for immediate and mistake free follow-up.  This is an automated Customer Relationship Management tool which will save you time and minimize mistakes. For more information about JobProgress, please visit our website.
    55Plugin URI: http://example.com
    6 Version: 3.0.2
     6Version: 3.0.3
    77Author: JobProgress
    88Author URI: http://www.jobprogress.com/
  • contractor-contact-form-website-to-workflow-tool/trunk/js/custom.js

    r2078295 r2093546  
    1414    }
    1515   
    16     $("body").on("click", "#refreshimg", function(){
    17         $("#captchaimage").load(plugin_dir_url+"image_req.php", { 'jp_plugin_dir_url':plugin_dir_url });
    18         return false;
    19     });
    20    
     16    jQuery.validator.addMethod("alphanumeric", function(value, element) {
     17        return this.optional(element) || /^[a-z0-9\\-]+$/i.test(value);
     18    }, "Only letters and numbers are allowed");
     19
    2120    // validate signup form on keyup and submit
    2221    $("#jobprogrssCustomerSignupForm").validate({
     
    3938                    }
    4039            },
    41             // 'email':{
    42             //  email: true
    43             // },
    44             'captcha': {
    45                 required: true,
    46                 remote:  plugin_dir_url+"process.php"
    47             },
    48             // 'address[country_id]':  {
    49             //  required: true
    50             // }
     40            'address[zip]': {
     41                alphanumeric: true
     42            },
     43            'billing[zip]': {
     44                alphanumeric: true
     45            },
     46            'cpatchaTextBox': {
     47                required: true
     48            }
    5149        },
    5250        messages: {
    5351            first_name: "Please enter the first name.",
    5452            last_name: "Please enter the last name.",
    55             captcha: "Correct captcha is required. Click the captcha to generate a new one"
     53            cpatchaTextBox: "Correct captcha is required. Click the refresh icon to generate a new one"
    5654        },
    5755        errorPlacement: function(error, element) {
     
    5957        },
    6058        onkeyup: false
     59    });
     60
     61    $('#jobprogrssCustomerSignupForm').on('submit', function() {
     62        // check validation
     63        if ($("#cpatchaTextBox").val() != code) {
     64            $('#cpatchaTextBox-error').css('display', 'none');
     65            $('.captcha-invalid').text("Correct captcha is required. Click the refresh icon to generate a new one");
     66            return false;
     67        }
    6168    });
    6269
     
    217224        }).on('change', function (e) {
    218225            var input = $(this).parent().find('.extension-field');
    219 //          if (e.currentTarget.value == "cell") {
    220 //              input.val(null);
    221 //              input.attr('disabled', true);
    222 //          } else {
    223 //              input.attr('disabled', false);
    224 //          }
    225226        });
    226227
     
    240241        }
    241242    });
     243
     244    /* captcha create code */
     245    var code;
     246    function createCaptcha() {
     247        //clear the contents of captcha div first
     248        document.getElementById('jp_captcha').innerHTML = "";
     249        var charsArray =
     250        "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@!#$%^&*";
     251        var lengthOtp = 6;
     252        var captcha = [];
     253        for (var i = 0; i < lengthOtp; i++) {
     254            //below code will not allow Repetition of Characters
     255            var index = Math.floor(Math.random() * charsArray.length + 1); //get the next character from the array
     256            if (captcha.indexOf(charsArray[index]) == -1)
     257                captcha.push(charsArray[index]);
     258            else i--;
     259        }
     260        var canv = document.createElement("canvas");
     261        canv.id = "jp_captcha_img";
     262        canv.width = 100;
     263        canv.height = 50;
     264        var ctx = canv.getContext("2d");
     265        ctx.font = "25px Georgia";
     266        ctx.strokeText(captcha.join(""), 0, 30);
     267        //storing captcha so that can validate you can save it somewhere else according to your specific requirements
     268        code = captcha.join("");
     269        document.getElementById("jp_captcha").appendChild(canv); // adds the canvas to the body element
     270    }
     271    createCaptcha();
     272
     273    $('.refresh-captcha').click(function() {
     274        createCaptcha();
     275    })
    242276});
  • contractor-contact-form-website-to-workflow-tool/trunk/readme.txt

    r2078295 r2093546  
    2020
    2121== Changelog ==
     22= 3.0.3 =
     231. Enable Canadaian Zip Code
     242. Captcha Changed due to security reason
     25
    2226= 3.0.2 =
    23271. UI/UX Improvements
Note: See TracChangeset for help on using the changeset viewer.