Plugin Directory

Changeset 3451009


Ignore:
Timestamp:
01/31/2026 01:55:28 PM (2 months ago)
Author:
pokhar
Message:

Release Version 1.4.8

Location:
whistleblowing-system/trunk
Files:
2 added
3 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • whistleblowing-system/trunk/admin/assets/css/admin.css

    r3434724 r3451009  
    160160    height: 100%;
    161161    position: fixed;
    162     background: rgba(0, 0, 0, 0.5);
    163     top: 0;
     162    background: rgba(0,0,0, 0.5);
     163    top:0;
    164164    left: 0;
    165165    z-index: 99999999;
  • whistleblowing-system/trunk/admin/assets/css/edit.css

    r3419598 r3451009  
    637637.wbls-field-option-row label {
    638638    margin-bottom: 3px;
     639    font-weight: 600;
    639640}
    640641
     
    12511252}
    12521253
     1254.wbls-field-item[data-type="rating"] {
     1255    background-image: url(../images/fields_icons/rate.svg);
     1256    background-size: 16px;
     1257    background-repeat: no-repeat;
     1258    background-position: left 10px center;
     1259    background-color: #0d9ad6;
     1260}
     1261
     1262.wbls-field-item[data-type="rating"].wbls-pro-tooltip {
     1263    background-image: url(../images/fields_icons/rate.svg), url(../images/pro-icon.svg);
     1264    background-size: 16px, 30px;
     1265    background-repeat: no-repeat;
     1266    background-position: left 10px center, right 10px center;
     1267    background-color: #0d9ad6;
     1268}
     1269
    12531270.wbls-field-item[data-type="page_break"] {
    12541271    background-image: url(../images/fields_icons/page-break.svg);
     
    22782295    width: calc(33% - 5px);
    22792296}
     2297
     2298/* Rating default styles */
     2299.wbls-rating {
     2300    display: inline-flex;
     2301    gap: 6px;
     2302    flex-direction: row-reverse;
     2303}
     2304
     2305.wbls-rating input { display: none; }
     2306
     2307/* Numbers */
     2308.wbls-rating--numbers label {
     2309    display: flex;
     2310    align-items: center;
     2311    justify-content: center;
     2312    line-height: 1;
     2313}
     2314
     2315.wbls-rating--numbers label::before {
     2316    content: attr(data-label);
     2317    width: 34px;
     2318    height: 34px;
     2319    background: #bfc1c5;
     2320    border-radius: 6px;
     2321    display: flex;
     2322    align-items: center;
     2323    justify-content: center;
     2324    cursor: pointer;
     2325}
     2326
     2327.wbls-rating--numbers label:hover::before {
     2328    background: #000000;
     2329    color: #fff;
     2330}
     2331
     2332/* Stars */
     2333.wbls-rating--stars label {
     2334    line-height: 1;
     2335}
     2336
     2337.wbls-rating--stars label::before {
     2338    content: "★";
     2339    font-size: 28px;
     2340    color: #d1d5db;
     2341    cursor: pointer;
     2342}
     2343
     2344.wbls-form-container .wbls-form .wbls-rating--stars label:hover::before,
     2345.wbls-form-container .wbls-form .wbls-rating--stars label:hover ~ label::before,
     2346.wbls-form-container .wbls-form .wbls-rating--stars input:checked ~ label::before,
     2347.wbls-form-container .wbls-form .wbls-rating--stars label:hover,
     2348.wbls-form-container .wbls-form .wbls-rating--stars label:hover ~ label,
     2349.wbls-form-container .wbls-form .wbls-rating--stars input:checked ~ label {
     2350    color: #fbbf24;
     2351}
     2352
  • whistleblowing-system/trunk/admin/assets/css/themes.css

    r3419598 r3451009  
    105105    color: #0d9ad6;
    106106    background-color: #ffffff;
     107    text-decoration: none;
     108}
     109
     110.wbls-tabs-row > a.wbls-tab-item:focus {
     111    color: #ffffff;
     112    box-shadow: none;
     113    outline: none;
    107114}
    108115
  • whistleblowing-system/trunk/admin/assets/js/edit.js

    r3410172 r3451009  
    4545    registerEvents() {
    4646        let self = this;
    47         jQuery(document).off( "click", "#wbls-sidebar-fields-tab")
     47        jQuery(document).off("click", "#wbls-sidebar-fields-tab")
    4848            .on("click", "#wbls-sidebar-fields-tab", function () {
    49             jQuery(".wbls-sidebar-tab").removeClass("wbls-sidebar-tab-active");
    50             jQuery(this).addClass("wbls-sidebar-tab-active");
    51             jQuery(".wbls-sidebar-field-options-content").hide();
    52             jQuery(".wbls-sidebar-fields-content").show();
    53         })
    54 
    55         jQuery(document).off( "click", "#wbls-sidebar-field-options-tab")
     49                jQuery(".wbls-sidebar-tab").removeClass("wbls-sidebar-tab-active");
     50                jQuery(this).addClass("wbls-sidebar-tab-active");
     51                jQuery(".wbls-sidebar-field-options-content").hide();
     52                jQuery(".wbls-sidebar-fields-content").show();
     53            })
     54
     55        jQuery(document).off("click", "#wbls-sidebar-field-options-tab")
    5656            .on("click", "#wbls-sidebar-field-options-tab", function () {
    57                 if( !jQuery(document).find(".wblsform-row-edit-active").length ) {
     57                if (!jQuery(document).find(".wblsform-row-edit-active").length) {
    5858                    return;
    5959                }
     
    6262                jQuery(".wbls-sidebar-field-options-content").show();
    6363                jQuery(".wbls-sidebar-fields-content").hide();
    64         })
    65 
    66         jQuery(document).off( "click", ".wbls-field-item")
     64            })
     65
     66        jQuery(document).off("click", ".wbls-field-item")
    6767            .on("click", ".wbls-field-item", function () {
    68             if( jQuery(this).attr("data-type") !== "page_break" ) {
    69                 self.add_field(this);
    70             } else {
    71                 self.wblsAddNewPage( jQuery(document).find(".wbls-add-new-page") );
    72             }
    73         })
    74 
    75         jQuery(document).off( "click", ".wbls-add-form").on("click", ".wbls-add-form", function () {
     68                if (jQuery(this).attr("data-type") !== "page_break") {
     69                    self.add_field(this);
     70                } else {
     71                    self.wblsAddNewPage(jQuery(document).find(".wbls-add-new-page"));
     72                }
     73            })
     74
     75        jQuery(document).off("click", ".wbls-add-form").on("click", ".wbls-add-form", function () {
    7676            self.save_form();
    7777        })
    7878
    79         jQuery(document).off( "click", ".wblsform-row:not(.dashicons-trash), .wblsform-row-page:not(.dashicons-trash)")
     79        jQuery(document).off("click", ".wblsform-row:not(.dashicons-trash), .wblsform-row-page:not(.dashicons-trash)")
    8080            .on("click", ".wblsform-row:not(.dashicons-trash), .wblsform-row-page:not(.dashicons-trash)", function () {
    8181                jQuery(document).find(".wblsform-row-edit-active").removeClass("wblsform-row-edit-active")
    8282                jQuery(this).addClass("wblsform-row-edit-active");
    83             self.edit_field(jQuery(this));
    84         })
    85 
    86         jQuery(document).off( "click", ".wblsform-actions .dashicons-trash")
     83                self.edit_field(jQuery(this));
     84            })
     85
     86        jQuery(document).off("click", ".wblsform-actions .dashicons-trash")
    8787            .on("click", ".wblsform-actions .dashicons-trash", function () {
    8888
    8989                let template = jQuery(document).find("#wbls-template-alert").html();
    9090                jQuery('body').append(template);
    91                 if( jQuery(this).parents(".wblsform-row-pageTitle").length ) {
     91                if (jQuery(this).parents(".wblsform-row-pageTitle").length) {
    9292                    jQuery(document).find(".wbls-alert-container .wbls-alert-title").text("Are you sure you want to delete this page and all associated fields?");
    9393                } else {
     
    9696                jQuery(this).addClass("wbls-active-delete");
    9797
    98         });
    99 
    100         jQuery(document).off( "click", ".wbls-alert-buttons-delete")
     98            });
     99
     100        jQuery(document).off("click", ".wbls-alert-buttons-delete")
    101101            .on("click", ".wbls-alert-buttons-delete", function () {
    102102                let el = jQuery(document).find(".wbls-active-delete");
    103                 if( el.parents(".wblsform-row-pageTitle").length ) {
     103                if (el.parents(".wblsform-row-pageTitle").length) {
    104104                    self.delete_page(el);
    105105                } else {
    106106                    self.delete_field(el);
    107107                }
    108         });
    109 
    110         jQuery(document).off( "click", ".wbls-alert-buttons-cancel, .wbls-alert-layer")
     108            });
     109
     110        jQuery(document).off("click", ".wbls-alert-buttons-cancel, .wbls-alert-layer")
    111111            .on("click", ".wbls-alert-buttons-cancel, .wbls-alert-layer", function () {
    112112                jQuery(document).find(".wbls-active-delete").removeClass("wbls-active-delete");
    113113                jQuery(document).find(".wbls-alert-layer, .wbls-alert-container").remove();
    114         });
     114            });
    115115
    116116        jQuery(document).on("input", ".wbls-sidebar-field-options-content .wbls-field-option", function () {
     
    119119            self.fields_options[self.edit_field_id][current_option] = val;
    120120
    121             switch(current_option) {
     121            switch (current_option) {
    122122                case 'label':
    123                     if( self.fields_options[self.edit_field_id]['type'] == 'submit' ) {
    124                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-submit-form").text(val);
     123                    if (self.fields_options[self.edit_field_id]['type'] == 'submit') {
     124                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-submit-form").text(val);
    125125                    } else {
    126                         if(self.fields_options[self.edit_field_id]['required'] === "1") {
    127                             jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-label").text(val+"*");
     126                        if (self.fields_options[self.edit_field_id]['required'] === "1") {
     127                            jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-label").text(val + "*");
    128128                        } else {
    129129                            jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-label").text(val);
     
    132132                    break;
    133133                case 'required':
    134                     let labelVal = jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-label").text();
    135                     if(  jQuery(this).is(':checked') ) {
     134                    let labelVal = jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-label").text();
     135                    if (jQuery(this).is(':checked')) {
    136136                        self.fields_options[self.edit_field_id][current_option] = 1;
    137137
    138138                        /* Disable single required if required all active */
    139139                        self.fields_options[self.edit_field_id]['required_single'] = 0;
    140                         if( labelVal.slice(-1) == "*" ) {
     140                        if (labelVal.slice(-1) == "*") {
    141141                            labelVal = labelVal.slice(0, -1);
    142142                        }
    143                         jQuery(".wbls-sidebar-field-options-content").find(".wbls-field-option-required_single").prop( "checked", false );
    144                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"']").removeAttr('data-required');
    145                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"']").removeAttr('data-required-group-ids');
     143                        jQuery(".wbls-sidebar-field-options-content").find(".wbls-field-option-required_single").prop("checked", false);
     144                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "']").removeAttr('data-required');
     145                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "']").removeAttr('data-required-group-ids');
    146146
    147147                        labelVal += "*";
    148                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-label").text(labelVal);
    149                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field").prop('required',true);
     148                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-label").text(labelVal);
     149                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field").prop('required', true);
    150150                    } else {
    151151                        self.fields_options[self.edit_field_id][current_option] = 0;
    152                         if( labelVal.slice(-1) == "*" ) {
     152                        if (labelVal.slice(-1) == "*") {
    153153                            labelVal = labelVal.slice(0, -1);
    154154                        }
    155                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-label").text(labelVal);
    156                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field").prop('required',false);
     155                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-label").text(labelVal);
     156                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field").prop('required', false);
    157157                    }
    158158                    break;
    159159                case 'required_single': /* Checkbox field only*/
    160                     let labelValSingle = jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-label").text();
    161                     if(  jQuery(this).is(':checked') ) {
     160                    let labelValSingle = jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-label").text();
     161                    if (jQuery(this).is(':checked')) {
    162162                        self.fields_options[self.edit_field_id][current_option] = 1;
    163163                        self.fields_options[self.edit_field_id]['required'] = 0;
    164                         if( labelValSingle.slice(-1) == "*" ) {
     164                        if (labelValSingle.slice(-1) == "*") {
    165165                            labelValSingle = labelValSingle.slice(0, -1);
    166166                        }
    167                         jQuery(".wbls-sidebar-field-options-content").find(".wbls-field-option-required").prop( "checked", false );
     167                        jQuery(".wbls-sidebar-field-options-content").find(".wbls-field-option-required").prop("checked", false);
    168168
    169169                        labelValSingle += "*";
    170                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-label").text(labelValSingle);
    171                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field").prop('required',true);
    172                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"']").attr('data-required','single');
     170                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-label").text(labelValSingle);
     171                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field").prop('required', true);
     172                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "']").attr('data-required', 'single');
    173173
    174174                        let group_ids = [];
    175                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-row-checkbox").each(function(index, element) {
     175                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-row-checkbox").each(function (index, element) {
    176176                            let $field = jQuery(element).find(".wbls-field").attr('name');
    177177                            let $field_id = $field.replace("wbls_field_", "");
     
    179179                        });
    180180                        group_ids = group_ids.join(",");
    181                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"']").attr('data-required-group-ids',group_ids);
     181                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "']").attr('data-required-group-ids', group_ids);
    182182                    } else {
    183183                        self.fields_options[self.edit_field_id][current_option] = 0;
    184                         if( labelValSingle.slice(-1) == "*" ) {
     184                        if (labelValSingle.slice(-1) == "*") {
    185185                            labelValSingle = labelValSingle.slice(0, -1);
    186186                        }
    187                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-label").text(labelValSingle);
    188                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field").prop('required',false);
    189                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"']").removeAttr('data-required');
    190                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"']").removeAttr('data-required-group-ids');
     187                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-label").text(labelValSingle);
     188                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field").prop('required', false);
     189                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "']").removeAttr('data-required');
     190                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "']").removeAttr('data-required-group-ids');
    191191                    }
    192192                    break;
    193193                case 'limit_days_active':
    194                     if(  jQuery(this).is(':checked') ) {
     194                    if (jQuery(this).is(':checked')) {
    195195                        self.fields_options[self.edit_field_id]['date_options'][current_option] = '1';
    196196                        jQuery(document).find(".wbls-limit_days").closest(".wbls-field-option-row").show();
     
    198198                        let limit_days_ob = self.fields_options[self.edit_field_id]['date_options']['limit_days'];
    199199                        Object.keys(limit_days_ob).forEach((key) => {
    200                             if( limit_days_ob[key] === '1' ) {
    201                                 attr += key+',';
     200                            if (limit_days_ob[key] === '1') {
     201                                attr += key + ',';
    202202                            }
    203203                        });
    204204                        attr = attr.slice(0, -1);
    205                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-datepicker").attr('data-limit_days', attr);
     205                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-datepicker").attr('data-limit_days', attr);
    206206                    } else {
    207207                        self.fields_options[self.edit_field_id]['date_options'][current_option] = '0';
    208208                        jQuery(document).find(".wbls-limit_days").closest(".wbls-field-option-row").hide();
    209                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-datepicker").attr('data-limit_days', '');
     209                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-datepicker").attr('data-limit_days', '');
    210210                    }
    211211                    break;
    212212                case 'disable_past_days':
    213                     if(  jQuery(this).is(':checked') ) {
     213                    if (jQuery(this).is(':checked')) {
    214214                        self.fields_options[self.edit_field_id]['date_options'][current_option] = '1';
    215                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-datepicker").attr('data-past_days', 1);
     215                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-datepicker").attr('data-past_days', 1);
    216216                    } else {
    217217                        self.fields_options[self.edit_field_id]['date_options'][current_option] = '0';
    218                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-datepicker").attr('data-past_days', 0);
     218                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-datepicker").attr('data-past_days', 0);
    219219                    }
    220220                    break;
    221221                case 'limit_hours':
    222                     if(  jQuery(this).is(':checked') ) {
     222                    if (jQuery(this).is(':checked')) {
    223223                        self.fields_options[self.edit_field_id]['time_options'][current_option] = '1';
    224224                        jQuery(document).find(".wbls-time-limit-row").closest(".wbls-field-option-row").show();
    225                         self.generateTimeOptions(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-time select", {
     225                        self.generateTimeOptions(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-time select", {
    226226                            limitHours: true,
    227227                            timeInterval: jQuery(document).find(".wbls-time-row select[name='time_interval']").val(),
     
    238238                        self.fields_options[self.edit_field_id]['time_options'][current_option] = '0';
    239239                        jQuery(document).find(".wbls-time-limit-row").closest(".wbls-field-option-row").hide();
    240                         self.generateTimeOptions(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-time select", {
     240                        self.generateTimeOptions(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-time select", {
    241241                            limitHours: false,
    242242                            timeInterval: jQuery(document).find(".wbls-time-row select[name='time_interval']").val(),
     
    247247                    break;
    248248                case 'placeholder':
    249                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] input, .wblsform-row[data-field-id='"+self.edit_field_id+"'] textarea").attr('placeholder', val);
     249                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] input, .wblsform-row[data-field-id='" + self.edit_field_id + "'] textarea").attr('placeholder', val);
    250250                    break;
    251251                case 'date-placeholder':
    252                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-date input").attr('placeholder', val);
     252                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-date input").attr('placeholder', val);
    253253                    self.fields_options[self.edit_field_id]['date_options']['placeholder'] = val;
    254254                    break;
    255255                case 'date-mini_label':
    256                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-date .wbls-field-miniLabel").text(val);
     256                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-date .wbls-field-miniLabel").text(val);
    257257                    self.fields_options[self.edit_field_id]['date_options']['mini_label'] = val;
    258258                    break;
    259259                case 'time-mini_label':
    260                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-time .wbls-field-miniLabel").text(val);
     260                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-time .wbls-field-miniLabel").text(val);
    261261                    self.fields_options[self.edit_field_id]['date_options']['mini_label'] = val;
    262262                    break;
    263263                case 'description':
    264                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-description").text(val);
     264                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-description").text(val);
    265265                    break;
    266266                case 'firstNamePlaceholder':
    267                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-firstName input").attr('placeholder', val);
     267                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-firstName input").attr('placeholder', val);
    268268                    break;
    269269                case 'lastNamePlaceholder':
    270                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-lastName input").attr('placeholder', val);
     270                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-lastName input").attr('placeholder', val);
    271271                    break;
    272272                case 'middleNamePlaceholder':
    273                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-middleName input").attr('placeholder', val);
     273                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-middleName input").attr('placeholder', val);
    274274                    break;
    275275                case 'firstNameMiniLabel':
    276                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-firstName .wbls-field-miniLabel").text(val);
     276                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-firstName .wbls-field-miniLabel").text(val);
    277277                    break;
    278278                case 'lastNameMiniLabel':
    279                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-lastName .wbls-field-miniLabel").text(val);
     279                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-lastName .wbls-field-miniLabel").text(val);
    280280                    break;
    281281                case 'middleNameMiniLabel':
    282                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-middleName .wbls-field-miniLabel").text(val);
     282                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-middleName .wbls-field-miniLabel").text(val);
    283283                    break;
    284284                case 'hideMiddleName':
    285                     if( jQuery(this).is(':checked') ) {
     285                    if (jQuery(this).is(':checked')) {
    286286                        self.fields_options[self.edit_field_id][current_option] = 0;
    287                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-middleName").remove();
     287                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-middleName").remove();
    288288                    } else {
    289289                        let templ = jQuery(document).find("#wbls-template-middleName").html();
    290                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-firstName").after(templ);
     290                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-firstName").after(templ);
    291291                        let miniLabel = self.fields_options[self.edit_field_id]['middleNameMiniLabel'];
    292292                        let placeholder = self.fields_options[self.edit_field_id]['middleNamePlaceholder'];
    293                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-middleName input").attr('name', self.fields_options[self.edit_field_id]['mname']);
    294                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-middleName input").attr('placeholder', placeholder);
    295                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-middleName .wbls-field-miniLabel").text(miniLabel);
     293                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-middleName input").attr('name', self.fields_options[self.edit_field_id]['mname']);
     294                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-middleName input").attr('placeholder', placeholder);
     295                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-middleName .wbls-field-miniLabel").text(miniLabel);
    296296                    }
    297297                    break;
    298298                case 'streetPlaceholder':
    299                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-street input").attr('placeholder', val);
     299                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-street input").attr('placeholder', val);
    300300                    break;
    301301                case 'street1Placeholder':
    302                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-street1 input").attr('placeholder', val);
     302                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-street1 input").attr('placeholder', val);
    303303                    break;
    304304                case 'cityPlaceholder':
    305                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-city input").attr('placeholder', val);
     305                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-city input").attr('placeholder', val);
    306306                    break;
    307307                case 'statePlaceholder':
    308                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-state input").attr('placeholder', val);
     308                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-state input").attr('placeholder', val);
    309309                    break;
    310310                case 'postalPlaceholder':
    311                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-postal input").attr('placeholder', val);
     311                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-postal input").attr('placeholder', val);
    312312                    break;
    313313                case 'countryPlaceholder':
    314                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-country input").attr('placeholder', val);
     314                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-country input").attr('placeholder', val);
    315315                    break;
    316316                case 'streetMiniLabel':
    317                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"']  .wbls-field-street .wbls-field-miniLabel").text(val);
     317                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "']  .wbls-field-street .wbls-field-miniLabel").text(val);
    318318                    break;
    319319                case 'street1MiniLabel':
    320                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"']  .wbls-field-street1 .wbls-field-miniLabel").text(val);
     320                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "']  .wbls-field-street1 .wbls-field-miniLabel").text(val);
    321321                    break;
    322322                case 'cityMiniLabel':
    323                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"']  .wbls-field-city .wbls-field-miniLabel").text(val);
     323                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "']  .wbls-field-city .wbls-field-miniLabel").text(val);
    324324                    break;
    325325                case 'stateMiniLabel':
    326                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"']  .wbls-field-state .wbls-field-miniLabel").text(val);
     326                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "']  .wbls-field-state .wbls-field-miniLabel").text(val);
    327327                    break;
    328328                case 'postalMiniLabel':
    329                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"']  .wbls-field-postal .wbls-field-miniLabel").text(val);
     329                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "']  .wbls-field-postal .wbls-field-miniLabel").text(val);
    330330                    break;
    331331                case 'countryMiniLabel':
    332                     jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"']  .wbls-field-country .wbls-field-miniLabel").text(val);
     332                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "']  .wbls-field-country .wbls-field-miniLabel").text(val);
    333333                    break;
    334334                case 'hideStreet':
    335                     if( jQuery(this).is(':checked') ) {
     335                    if (jQuery(this).is(':checked')) {
    336336                        self.fields_options[self.edit_field_id][current_option] = 1;
    337                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-street").remove();
     337                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-street").remove();
    338338                    } else {
    339339                        let templ = jQuery(document).find("#wbls-template-street").html();
    340                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-address-container").prepend(templ);
     340                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-address-container").prepend(templ);
    341341                        let miniLabel = self.fields_options[self.edit_field_id]['streetMiniLabel'];
    342342                        let placeholder = self.fields_options[self.edit_field_id]['streetPlaceholder'];
    343                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-street input").attr('name', self.fields_options[self.edit_field_id]['streetName']);
    344                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-street input").attr('placeholder', placeholder);
    345                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-street .wbls-field-miniLabel").text(miniLabel);
     343                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-street input").attr('name', self.fields_options[self.edit_field_id]['streetName']);
     344                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-street input").attr('placeholder', placeholder);
     345                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-street .wbls-field-miniLabel").text(miniLabel);
    346346                    }
    347347                    break;
    348348                case 'hideStreet1':
    349                     if( jQuery(this).is(':checked') ) {
     349                    if (jQuery(this).is(':checked')) {
    350350                        self.fields_options[self.edit_field_id][current_option] = 1;
    351                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-street1").remove();
     351                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-street1").remove();
    352352                    } else {
    353353                        let templ = jQuery(document).find("#wbls-template-street1").html();
    354                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-address-container > div:nth-child(1)").after(templ);
     354                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-address-container > div:nth-child(1)").after(templ);
    355355                        let miniLabel = self.fields_options[self.edit_field_id]['street1MiniLabel'];
    356356                        let placeholder = self.fields_options[self.edit_field_id]['street1Placeholder'];
    357                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-street1 input").attr('name', self.fields_options[self.edit_field_id]['street1Name']);
    358                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-street1 input").attr('placeholder', placeholder);
    359                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-street1 .wbls-field-miniLabel").text(miniLabel);
     357                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-street1 input").attr('name', self.fields_options[self.edit_field_id]['street1Name']);
     358                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-street1 input").attr('placeholder', placeholder);
     359                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-street1 .wbls-field-miniLabel").text(miniLabel);
    360360                    }
    361361                    break;
    362362                case 'hideCity':
    363                     if( jQuery(this).is(':checked') ) {
     363                    if (jQuery(this).is(':checked')) {
    364364                        self.fields_options[self.edit_field_id][current_option] = 1;
    365                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-city").remove();
     365                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-city").remove();
    366366                    } else {
    367367                        let templ = jQuery(document).find("#wbls-template-city").html();
    368                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-address-container .wbls-address-row").eq(0).prepend(templ);
     368                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-address-container .wbls-address-row").eq(0).prepend(templ);
    369369                        let miniLabel = self.fields_options[self.edit_field_id]['cityMiniLabel'];
    370370                        let placeholder = self.fields_options[self.edit_field_id]['cityPlaceholder'];
    371                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-city input").attr('name', self.fields_options[self.edit_field_id]['cityName']);
    372                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-city input").attr('placeholder', placeholder);
    373                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-city .wbls-field-miniLabel").text(miniLabel);
     371                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-city input").attr('name', self.fields_options[self.edit_field_id]['cityName']);
     372                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-city input").attr('placeholder', placeholder);
     373                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-city .wbls-field-miniLabel").text(miniLabel);
    374374                    }
    375375                    break;
    376376                case 'hideState':
    377                     if( jQuery(this).is(':checked') ) {
     377                    if (jQuery(this).is(':checked')) {
    378378                        self.fields_options[self.edit_field_id][current_option] = 1;
    379                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-state").remove();
     379                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-state").remove();
    380380                    } else {
    381381                        let templ = jQuery(document).find("#wbls-template-state").html();
    382                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-address-container .wbls-address-row").eq(0).append(templ);
     382                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-address-container .wbls-address-row").eq(0).append(templ);
    383383                        let miniLabel = self.fields_options[self.edit_field_id]['stateMiniLabel'];
    384384                        let placeholder = self.fields_options[self.edit_field_id]['statePlaceholder'];
    385                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-state input").attr('name', self.fields_options[self.edit_field_id]['stateName']);
    386                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-state input").attr('placeholder', placeholder);
    387                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-state .wbls-field-miniLabel").text(miniLabel);
     385                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-state input").attr('name', self.fields_options[self.edit_field_id]['stateName']);
     386                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-state input").attr('placeholder', placeholder);
     387                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-state .wbls-field-miniLabel").text(miniLabel);
    388388                    }
    389389                    break;
    390390                case 'hidePostal':
    391                     if( jQuery(this).is(':checked') ) {
     391                    if (jQuery(this).is(':checked')) {
    392392                        self.fields_options[self.edit_field_id][current_option] = 1;
    393                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-postal").remove();
     393                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-postal").remove();
    394394                    } else {
    395395                        let templ = jQuery(document).find("#wbls-template-postal").html();
    396                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-address-container .wbls-address-row").eq(1).prepend(templ);
     396                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-address-container .wbls-address-row").eq(1).prepend(templ);
    397397                        let miniLabel = self.fields_options[self.edit_field_id]['postalMiniLabel'];
    398398                        let placeholder = self.fields_options[self.edit_field_id]['postalPlaceholder'];
    399                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-postal input").attr('name', self.fields_options[self.edit_field_id]['postalName']);
    400                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-postal input").attr('placeholder', placeholder);
    401                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-postal .wbls-field-miniLabel").text(miniLabel);
     399                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-postal input").attr('name', self.fields_options[self.edit_field_id]['postalName']);
     400                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-postal input").attr('placeholder', placeholder);
     401                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-postal .wbls-field-miniLabel").text(miniLabel);
    402402                    }
    403403                    break;
    404404                case 'hideCountry':
    405                     if( jQuery(this).is(':checked') ) {
     405                    if (jQuery(this).is(':checked')) {
    406406                        self.fields_options[self.edit_field_id][current_option] = 1;
    407                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-country").remove();
     407                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-country").remove();
    408408                    } else {
    409409                        let templ = jQuery(document).find("#wbls-template-country").html();
    410                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-address-container .wbls-address-row").eq(1).append(templ);
     410                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-address-container .wbls-address-row").eq(1).append(templ);
    411411                        let miniLabel = self.fields_options[self.edit_field_id]['countryMiniLabel'];
    412412                        let placeholder = self.fields_options[self.edit_field_id]['countryPlaceholder'];
    413                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-country input").attr('name', self.fields_options[self.edit_field_id]['countryName']);
    414                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-country input").attr('placeholder', placeholder);
    415                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-country .wbls-field-miniLabel").text(miniLabel);
     413                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-country input").attr('name', self.fields_options[self.edit_field_id]['countryName']);
     414                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-country input").attr('placeholder', placeholder);
     415                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-country .wbls-field-miniLabel").text(miniLabel);
    416416                    }
    417417                    break;
    418418                case 'multiple':
    419                     let input = jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] input");
     419                    let input = jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] input");
    420420                    let currentName = input.attr('name');  // Get the current name attribute
    421                     if( jQuery(this).is(':checked') ) {
     421                    if (jQuery(this).is(':checked')) {
    422422                        self.fields_options[self.edit_field_id][current_option] = 1;
    423                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field").prop('multiple',true);
     423                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field").prop('multiple', true);
    424424                        let newName = currentName + '[]';
    425425                        input.attr('name', newName);
    426426                    } else {
    427                         jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field").prop('multiple',false);
     427                        jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field").prop('multiple', false);
    428428                        let newName = currentName.replace("[]", "");
    429429                        input.attr('name', newName);
     
    440440
    441441                case 'show_previous':
    442                     if( jQuery(this).val() === "1" ) {
     442                    if (jQuery(this).val() === "1") {
    443443                        let prevButtonTemplate = jQuery(document).find("#wbls-template-page-previous-button").html();
    444444
    445                         jQuery(document).find(".wblsform-page-and-images").each( function(index) {
    446                             if ( 0 !== index ) {
    447                                 if( jQuery(this).find(".wblsform-row-pageButtonNextPrev-container").length ) {
     445                        jQuery(document).find(".wblsform-page-and-images").each(function (index) {
     446                            if (0 !== index) {
     447                                if (jQuery(this).find(".wblsform-row-pageButtonNextPrev-container").length) {
    448448                                    jQuery(this).find(".wblsform-row-pageButtonNextPrev-container").prepend(prevButtonTemplate);
    449449                                } else {
     
    465465
    466466        /* Set new default Selected option */
    467         jQuery(document).off( "click", ".wbls-sidebar-field-options-content .wbls-select-item-default")
     467        jQuery(document).off("click", ".wbls-sidebar-field-options-content .wbls-select-item-default")
    468468            .on("click", ".wbls-sidebar-field-options-content .wbls-select-item-default", function () {
    469             let index = jQuery(this).closest(".wbls-select-item").index();
    470             self.fields_options[self.edit_field_id]['default_option'] = parseInt(index)-1;
    471 
    472         });
     469                let index = jQuery(this).closest(".wbls-select-item").index();
     470                self.fields_options[self.edit_field_id]['default_option'] = parseInt(index) - 1;
     471
     472            });
    473473
    474474        /* Set new value to option */
     
    479479            self.fields_options[self.edit_field_id]['options'][key]['val'] = val;
    480480
    481             jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] select option")
     481            jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] select option")
    482482                .eq(key).text(val).val(val);
    483483        });
     
    494494
    495495        /* Set new default Selected option */
    496         jQuery(document).off( "click", ".wbls-sidebar-field-options-content .wbls-add-select-item")
     496        jQuery(document).off("click", ".wbls-sidebar-field-options-content .wbls-add-select-item")
    497497            .on("click", ".wbls-sidebar-field-options-content .wbls-add-select-item", function () {
    498             let index = jQuery(this).closest(".wbls-select-item").index();
    499             self.fields_options[self.edit_field_id]['options'].splice(index, 0, {'key':'', 'val' : '', 'order' : index});
    500             let option_template = jQuery("#wbls-template-field-select").html();
    501             jQuery(document).find(".wbls-select-item").eq((index-1)).after(option_template);
    502             jQuery(document).find(".wbls-select-item").eq((index)).find(".wbls-select-item-value").attr("data-key", index);
    503 
    504             jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] select option")
    505                 .eq((index-1)).after('<option value=""></option>');
    506         });
     498                let index = jQuery(this).closest(".wbls-select-item").index();
     499                self.fields_options[self.edit_field_id]['options'].splice(index, 0, {
     500                    'key': '',
     501                    'val': '',
     502                    'order': index
     503                });
     504                let option_template = jQuery("#wbls-template-field-select").html();
     505                jQuery(document).find(".wbls-select-item").eq((index - 1)).after(option_template);
     506                jQuery(document).find(".wbls-select-item").eq((index)).find(".wbls-select-item-value").attr("data-key", index);
     507
     508                jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] select option")
     509                    .eq((index - 1)).after('<option value=""></option>');
     510            });
    507511
    508512        /* Set new default Selected option */
    509         jQuery(document).off( "click", ".wbls-sidebar-field-options-content .wbls-remove-select-item")
     513        jQuery(document).off("click", ".wbls-sidebar-field-options-content .wbls-remove-select-item")
    510514            .on("click", ".wbls-sidebar-field-options-content .wbls-remove-select-item", function () {
    511             let index = jQuery(this).closest(".wbls-select-item").index();
    512             self.fields_options[self.edit_field_id]['options'].splice((index-1), 1);
    513             jQuery(document).find(".wbls-select-item").eq((index-1)).remove();
    514             jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] select option")
    515                 .eq((index-1)).remove();
    516         });
     515                let index = jQuery(this).closest(".wbls-select-item").index();
     516                self.fields_options[self.edit_field_id]['options'].splice((index - 1), 1);
     517                jQuery(document).find(".wbls-select-item").eq((index - 1)).remove();
     518                jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] select option")
     519                    .eq((index - 1)).remove();
     520            });
    517521
    518522        /* Radio field events */
    519523
    520524        /* Set new default Radio option */
    521         jQuery(document).off( "click", ".wbls-sidebar-field-options-content .wbls-radio-item-default")
     525        jQuery(document).off("click", ".wbls-sidebar-field-options-content .wbls-radio-item-default")
    522526            .on("click", ".wbls-sidebar-field-options-content .wbls-radio-item-default", function () {
    523             let index = jQuery(this).closest(".wbls-radio-item").index();
    524             let el = jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] input").eq((index-1));
    525             jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] input").removeAttr("checked");
    526             if( self.fields_options[self.edit_field_id]['default_option'] === (parseInt(index)-1) ) {
    527                 self.fields_options[self.edit_field_id]['default_option'] = '';
    528                 jQuery(this).prop("checked", false);
    529                 el.prop("checked", false);
    530                 el.removeAttr("checked");
    531             } else {
    532                 self.fields_options[self.edit_field_id]['default_option'] = parseInt(index) - 1;
    533                 el.prop("checked", true);
    534                 el.attr("checked", "checked");
    535             }
    536         });
    537 
    538         /* Set new value to option */
    539         jQuery(document).on("input", ".wbls-sidebar-field-options-content .wbls-radio-item-value", function () {
    540             let key = jQuery(this).attr("data-key");
    541             let val = jQuery(this).val();
    542             self.fields_options[self.edit_field_id]['options'][key]['key'] = val;
    543             self.fields_options[self.edit_field_id]['options'][key]['val'] = val;
    544 
    545             let inputVal = val.replace(/(<([^>]+)>)/gi, "");
    546             jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-row-radio")
    547                 .eq(key).find("input").val(inputVal);
    548             jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-row-radio")
    549                 .eq(key).find("label").html(val);
    550         });
    551 
    552         jQuery(document).on("change", ".wbls-sidebar-field-options-content .wbls-radio-item-value", function () {
    553             let key = jQuery(this).attr("data-key");
    554             let val = jQuery(this).val();
    555         });
    556 
    557         /* Set new default Selected option */
    558         jQuery(document).off( "click", ".wbls-sidebar-field-options-content .wbls-add-radio-item")
    559             .on("click", ".wbls-sidebar-field-options-content .wbls-add-radio-item", function () {
    560             let index = jQuery(this).closest(".wbls-radio-item").index();
    561             self.fields_options[self.edit_field_id]['options'].splice(index, 0, {'key':'', 'val' : '', 'order' : index});
    562             let name = self.fields_options[self.edit_field_id]['name'];
    563             let option_template = jQuery("#wbls-template-field-radio").html();
    564             jQuery(document).find(".wbls-radio-item").eq((index-1)).after(option_template);
    565             let ind = 0;
    566             jQuery(document).find(".wbls-radio-item").each(function () {
    567                 jQuery(this).find(".wbls-radio-item-value").attr("data-key", ind);
    568                 ind++;
    569             });
    570             let radio_single_template = jQuery("#wbls-template-radio-single").html();
    571             jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-row-radio")
    572                 .eq((index-1)).after(radio_single_template);
    573             jQuery(document).find(".wbls-field-row-radio-new .wbls-field").attr("name", name).removeClass("wbls-field-row-radio-new");
    574         });
    575 
    576 
    577         /* Set new default Selected option */
    578         jQuery(document).off( "click", ".wbls-sidebar-field-options-content .wbls-remove-radio-item")
    579             .on("click", ".wbls-sidebar-field-options-content .wbls-remove-radio-item", function () {
    580             let index = jQuery(this).closest(".wbls-radio-item").index();
    581             self.fields_options[self.edit_field_id]['options'].splice((index-1), 1);
    582             jQuery(document).find(".wbls-radio-item").eq((index-1)).remove();
    583             jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-row-radio")
    584                 .eq((index-1)).remove();
    585         });
    586         /* End radio */
    587 
    588         /* anonymous field events */
    589         /* Set new default Radio option */
    590         jQuery(document).off( "click", ".wbls-sidebar-field-options-content .wbls-anonymous-item-default")
    591             .on("click", ".wbls-sidebar-field-options-content .wbls-anonymous-item-default", function () {
    592527                let index = jQuery(this).closest(".wbls-radio-item").index();
    593                 let el = jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] input").eq((index-1));
    594                 jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] input").removeAttr("checked");
    595                 if( self.fields_options[self.edit_field_id]['default_option'] === (parseInt(index)-1) ) {
     528                let el = jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] input").eq((index - 1));
     529                jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] input").removeAttr("checked");
     530                if (self.fields_options[self.edit_field_id]['default_option'] === (parseInt(index) - 1)) {
    596531                    self.fields_options[self.edit_field_id]['default_option'] = '';
    597532                    jQuery(this).prop("checked", false);
     
    606541
    607542        /* Set new value to option */
     543        jQuery(document).on("input", ".wbls-sidebar-field-options-content .wbls-radio-item-value", function () {
     544            let key = jQuery(this).attr("data-key");
     545            let val = jQuery(this).val();
     546            self.fields_options[self.edit_field_id]['options'][key]['key'] = val;
     547            self.fields_options[self.edit_field_id]['options'][key]['val'] = val;
     548
     549            let inputVal = val.replace(/(<([^>]+)>)/gi, "");
     550            jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-row-radio")
     551                .eq(key).find("input").val(inputVal);
     552            jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-row-radio")
     553                .eq(key).find("label").html(val);
     554        });
     555
     556        jQuery(document).on("change", ".wbls-sidebar-field-options-content .wbls-radio-item-value", function () {
     557            let key = jQuery(this).attr("data-key");
     558            let val = jQuery(this).val();
     559        });
     560
     561        /* Set new default Selected option */
     562        jQuery(document).off("click", ".wbls-sidebar-field-options-content .wbls-add-radio-item")
     563            .on("click", ".wbls-sidebar-field-options-content .wbls-add-radio-item", function () {
     564                let index = jQuery(this).closest(".wbls-radio-item").index();
     565                self.fields_options[self.edit_field_id]['options'].splice(index, 0, {
     566                    'key': '',
     567                    'val': '',
     568                    'order': index
     569                });
     570                let name = self.fields_options[self.edit_field_id]['name'];
     571                let option_template = jQuery("#wbls-template-field-radio").html();
     572                jQuery(document).find(".wbls-radio-item").eq((index - 1)).after(option_template);
     573                let ind = 0;
     574                jQuery(document).find(".wbls-radio-item").each(function () {
     575                    jQuery(this).find(".wbls-radio-item-value").attr("data-key", ind);
     576                    ind++;
     577                });
     578                let radio_single_template = jQuery("#wbls-template-radio-single").html();
     579                jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-row-radio")
     580                    .eq((index - 1)).after(radio_single_template);
     581                jQuery(document).find(".wbls-field-row-radio-new .wbls-field").attr("name", name).removeClass("wbls-field-row-radio-new");
     582            });
     583
     584
     585        /* Set new default Selected option */
     586        jQuery(document).off("click", ".wbls-sidebar-field-options-content .wbls-remove-radio-item")
     587            .on("click", ".wbls-sidebar-field-options-content .wbls-remove-radio-item", function () {
     588                let index = jQuery(this).closest(".wbls-radio-item").index();
     589                self.fields_options[self.edit_field_id]['options'].splice((index - 1), 1);
     590                jQuery(document).find(".wbls-radio-item").eq((index - 1)).remove();
     591                jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-row-radio")
     592                    .eq((index - 1)).remove();
     593            });
     594        /* End radio */
     595
     596        /* anonymous field events */
     597        /* Set new default Radio option */
     598        jQuery(document).off("click", ".wbls-sidebar-field-options-content .wbls-anonymous-item-default")
     599            .on("click", ".wbls-sidebar-field-options-content .wbls-anonymous-item-default", function () {
     600                let index = jQuery(this).closest(".wbls-radio-item").index();
     601                let el = jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] input").eq((index - 1));
     602                jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] input").removeAttr("checked");
     603                if (self.fields_options[self.edit_field_id]['default_option'] === (parseInt(index) - 1)) {
     604                    self.fields_options[self.edit_field_id]['default_option'] = '';
     605                    jQuery(this).prop("checked", false);
     606                    el.prop("checked", false);
     607                    el.removeAttr("checked");
     608                } else {
     609                    self.fields_options[self.edit_field_id]['default_option'] = parseInt(index) - 1;
     610                    el.prop("checked", true);
     611                    el.attr("checked", "checked");
     612                }
     613            });
     614
     615        /* Set new value to option */
    608616        jQuery(document).on("input", ".wbls-sidebar-field-options-content .wbls-anonymous-item-value", function () {
    609617            let key = jQuery(this).attr("data-key");
     
    612620
    613621            let inputVal = val.replace(/(<([^>]+)>)/gi, "");
    614             jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-row-radio")
     622            jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-row-radio")
    615623                .eq(key).find("label").html(val);
    616624        });
     
    625633        /* Start checkbox */
    626634        /* Set new default Checkbox option */
    627         jQuery(document).off( "click", ".wbls-sidebar-field-options-content .wbls-add-checkbox-item")
     635        jQuery(document).off("click", ".wbls-sidebar-field-options-content .wbls-add-checkbox-item")
    628636            .on("click", ".wbls-sidebar-field-options-content .wbls-add-checkbox-item", function () {
    629             let index = jQuery(this).closest(".wbls-checkbox-item").index();
    630 
    631             let new_name = 'wbls_field_' + self.fieldNameLastId;
    632             self.fields_options[self.edit_field_id]['options'].splice(index, 0, {'miniLabel':'New choice', 'name' : new_name, 'checked' : 0, 'order' : index});
    633             let option_template = jQuery("#wbls-template-field-checkbox").html();
    634             jQuery(document).find(".wbls-checkbox-item").eq((index-1)).after(option_template);
    635             let ind = 0;
    636             jQuery(document).find(".wbls-checkbox-item").each(function () {
    637                 jQuery(this).find(".wbls-checkbox-item-value").attr("data-key", ind);
    638                 ind++;
    639             });
    640 
    641             let checkbox_single_template = jQuery("#wbls-template-checkbox-single").html();
    642             jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-row-checkbox")
    643                 .eq((index-1)).after(checkbox_single_template);
    644 
    645             jQuery(document).find(".wblsform-row .wbls-field-row-checkbox-new input").attr("name", new_name);
    646             jQuery(document).find(".wblsform-row .wbls-field-row-checkbox-new").removeClass("wbls-field-row-checkbox-new");
    647             self.fieldNameLastId = parseInt(self.fieldNameLastId) + 1;
    648 
    649             let $el = jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"']");
    650             if( $el.attr("data-required") === "single" ) {
    651                 let group_ids = [];
    652                 jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-row-checkbox").each(function(index, element) {
    653                     let $field = jQuery(element).find(".wbls-field").attr('name');
    654                     let $field_id = $field.replace("wbls_field_", "");
    655                     group_ids.push($field_id);
     637                let index = jQuery(this).closest(".wbls-checkbox-item").index();
     638
     639                let new_name = 'wbls_field_' + self.fieldNameLastId;
     640                self.fields_options[self.edit_field_id]['options'].splice(index, 0, {
     641                    'miniLabel': 'New choice',
     642                    'name': new_name,
     643                    'checked': 0,
     644                    'order': index
    656645                });
    657                 group_ids = group_ids.join(",");
    658                 jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"']").attr('data-required-group-ids',group_ids);
    659             }
    660         });
     646                let option_template = jQuery("#wbls-template-field-checkbox").html();
     647                jQuery(document).find(".wbls-checkbox-item").eq((index - 1)).after(option_template);
     648                let ind = 0;
     649                jQuery(document).find(".wbls-checkbox-item").each(function () {
     650                    jQuery(this).find(".wbls-checkbox-item-value").attr("data-key", ind);
     651                    ind++;
     652                });
     653
     654                let checkbox_single_template = jQuery("#wbls-template-checkbox-single").html();
     655                jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-row-checkbox")
     656                    .eq((index - 1)).after(checkbox_single_template);
     657
     658                jQuery(document).find(".wblsform-row .wbls-field-row-checkbox-new input").attr("name", new_name);
     659                jQuery(document).find(".wblsform-row .wbls-field-row-checkbox-new").removeClass("wbls-field-row-checkbox-new");
     660                self.fieldNameLastId = parseInt(self.fieldNameLastId) + 1;
     661
     662                let $el = jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "']");
     663                if ($el.attr("data-required") === "single") {
     664                    let group_ids = [];
     665                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-row-checkbox").each(function (index, element) {
     666                        let $field = jQuery(element).find(".wbls-field").attr('name');
     667                        let $field_id = $field.replace("wbls_field_", "");
     668                        group_ids.push($field_id);
     669                    });
     670                    group_ids = group_ids.join(",");
     671                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "']").attr('data-required-group-ids', group_ids);
     672                }
     673            });
    661674
    662675        /* Remove checkbox item */
    663         jQuery(document).off( "click", ".wbls-sidebar-field-options-content .wbls-remove-checkbox-item")
     676        jQuery(document).off("click", ".wbls-sidebar-field-options-content .wbls-remove-checkbox-item")
    664677            .on("click", ".wbls-sidebar-field-options-content .wbls-remove-checkbox-item", function () {
    665             let index = jQuery(this).closest(".wbls-checkbox-item").index();
    666             self.fields_options[self.edit_field_id]['options'].splice((index-1), 1);
    667             jQuery(document).find(".wbls-checkbox-item").eq((index-1)).remove();
    668             jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-row-checkbox")
    669                 .eq((index-1)).remove();
    670 
    671             let $el = jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"']");
    672             if( $el.attr("data-required") === "single" ) {
    673                 let group_ids = [];
    674                 jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-row-checkbox").each(function(index, element) {
    675                     let $field = jQuery(element).find(".wbls-field").attr('name');
    676                     let $field_id = $field.replace("wbls_field_", "");
    677                     group_ids.push($field_id);
    678                 });
    679                 group_ids = group_ids.join(",");
    680                 jQuery(".wblsform-row[data-field-id='"+self.edit_field_id+"']").attr('data-required-group-ids',group_ids);
    681             }
    682         });
     678                let index = jQuery(this).closest(".wbls-checkbox-item").index();
     679                self.fields_options[self.edit_field_id]['options'].splice((index - 1), 1);
     680                jQuery(document).find(".wbls-checkbox-item").eq((index - 1)).remove();
     681                jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-row-checkbox")
     682                    .eq((index - 1)).remove();
     683
     684                let $el = jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "']");
     685                if ($el.attr("data-required") === "single") {
     686                    let group_ids = [];
     687                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-row-checkbox").each(function (index, element) {
     688                        let $field = jQuery(element).find(".wbls-field").attr('name');
     689                        let $field_id = $field.replace("wbls_field_", "");
     690                        group_ids.push($field_id);
     691                    });
     692                    group_ids = group_ids.join(",");
     693                    jQuery(".wblsform-row[data-field-id='" + self.edit_field_id + "']").attr('data-required-group-ids', group_ids);
     694                }
     695            });
    683696
    684697        /* Set new value to option */
     
    690703
    691704            let inputVal = val.replace(/(<([^>]+)>)/gi, "");
    692             jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-row-checkbox")
     705            jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-row-checkbox")
    693706                .eq(key).find("input").val(inputVal);
    694             jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] .wbls-field-row-checkbox")
     707            jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] .wbls-field-row-checkbox")
    695708                .eq(key).find("label").html(val);
    696709        });
    697710
    698711        /* Set default Checked option */
    699         jQuery(document).off( "click", ".wbls-sidebar-field-options-content .wbls-checkbox-item-default")
     712        jQuery(document).off("click", ".wbls-sidebar-field-options-content .wbls-checkbox-item-default")
    700713            .on("click", ".wbls-sidebar-field-options-content .wbls-checkbox-item-default", function () {
    701             let index = jQuery(this).closest(".wbls-checkbox-item").index();
    702             let el = jQuery(document).find(".wblsform-row[data-field-id='"+self.edit_field_id+"'] input").eq((index-1));
    703             if( self.fields_options[self.edit_field_id]['options'][(parseInt(index) - 1)]['checked'] == 1 ) {
    704                 self.fields_options[self.edit_field_id]['options'][(parseInt(index) - 1)]['checked'] = 0;
    705                 jQuery(this).prop("checked", false);
    706                 el.prop("checked", false);
    707                 el.val(0);
    708                 el.removeAttr("checked");
    709             } else {
    710                 self.fields_options[self.edit_field_id]['options'][(parseInt(index) - 1)]['checked'] = 1;
    711                 el.prop("checked", true);
    712                 el.val(1);
    713                 el.attr("checked", "checked");
    714             }
    715         });
     714                let index = jQuery(this).closest(".wbls-checkbox-item").index();
     715                let el = jQuery(document).find(".wblsform-row[data-field-id='" + self.edit_field_id + "'] input").eq((index - 1));
     716                if (self.fields_options[self.edit_field_id]['options'][(parseInt(index) - 1)]['checked'] == 1) {
     717                    self.fields_options[self.edit_field_id]['options'][(parseInt(index) - 1)]['checked'] = 0;
     718                    jQuery(this).prop("checked", false);
     719                    el.prop("checked", false);
     720                    el.val(0);
     721                    el.removeAttr("checked");
     722                } else {
     723                    self.fields_options[self.edit_field_id]['options'][(parseInt(index) - 1)]['checked'] = 1;
     724                    el.prop("checked", true);
     725                    el.val(1);
     726                    el.attr("checked", "checked");
     727                }
     728            });
    716729        /* End Checkbox field events */
    717730
    718731        /* Recaptcha version change */
    719         jQuery(document).off( "click", ".wbls-recaptcha-version").on("click", ".wbls-recaptcha-version", function () {
     732        jQuery(document).off("click", ".wbls-recaptcha-version").on("click", ".wbls-recaptcha-version", function () {
    720733            let val = jQuery(this).val();
    721734            self.fields_options[self.edit_field_id]['version'] = val;
     
    724737
    725738        /* Form edit page menu item click */
    726         jQuery(document).off( "click", ".wbls-form-menu-item")
     739        jQuery(document).off("click", ".wbls-form-menu-item")
    727740            .on("click", ".wbls-form-menu-item", function () {
    728             let content = jQuery(this).attr("data-content");
    729             jQuery(".wbls-form-menu-item").removeClass("wbls-form-menu-item-active");
    730             jQuery(this).addClass("wbls-form-menu-item-active");
    731             jQuery(".wbls-form-menu-item-content").hide();
    732             jQuery(".wbls-sidebar-menu").hide();
    733             jQuery("#"+content).show();
    734             jQuery("#"+content+"-sidebar").show();
    735             jQuery("#"+content+"-sidebar").find(".wbls-sidebar-menu-item-active").trigger("click");
    736         });
     741                let content = jQuery(this).attr("data-content");
     742                jQuery(".wbls-form-menu-item").removeClass("wbls-form-menu-item-active");
     743                jQuery(this).addClass("wbls-form-menu-item-active");
     744                jQuery(".wbls-form-menu-item-content").hide();
     745                jQuery(".wbls-sidebar-menu").hide();
     746                jQuery("#" + content).show();
     747                jQuery("#" + content + "-sidebar").show();
     748                jQuery("#" + content + "-sidebar").find(".wbls-sidebar-menu-item-active").trigger("click");
     749            });
    737750
    738751        /* Form edit page sidebar menu item click */
    739         jQuery(document).off( "click", ".wbls-sidebar-menu-item")
     752        jQuery(document).off("click", ".wbls-sidebar-menu-item")
    740753            .on("click", ".wbls-sidebar-menu-item", function () {
    741             let content = jQuery(this).attr("id");
    742             jQuery(this).closest(".wbls-sidebar-menu").find(".wbls-sidebar-menu-item").removeClass("wbls-sidebar-menu-item-active");
    743             jQuery(this).addClass("wbls-sidebar-menu-item-active");
    744             jQuery(".wbls-sidebar-menu-item-content").hide();
    745             jQuery("."+content).show();
    746         })
    747 
    748         jQuery(document).off( "click", ".wbls-field-placeholder").on("click", ".wbls-field-placeholder", function() {
     754                let content = jQuery(this).attr("id");
     755                jQuery(this).closest(".wbls-sidebar-menu").find(".wbls-sidebar-menu-item").removeClass("wbls-sidebar-menu-item-active");
     756                jQuery(this).addClass("wbls-sidebar-menu-item-active");
     757                jQuery(".wbls-sidebar-menu-item-content").hide();
     758                jQuery("." + content).show();
     759            })
     760
     761        jQuery(document).off("click", ".wbls-field-placeholder").on("click", ".wbls-field-placeholder", function () {
    749762            self.wbls_set_email_placeholder(this);
    750763        });
    751764
    752         jQuery(document).off( "click", ".wbls-embed-form").on("click", ".wbls-embed-form", function () {
     765        jQuery(document).off("click", ".wbls-embed-form").on("click", ".wbls-embed-form", function () {
    753766            jQuery(document).find(".wbls-shortcode-layer, .wbls-shortcode-popup").show()
    754767        })
    755768
    756         jQuery(document).off( "click", ".wbls-shortcode-layer").on("click", ".wbls-shortcode-layer", function () {
     769        jQuery(document).off("click", ".wbls-shortcode-layer").on("click", ".wbls-shortcode-layer", function () {
    757770            jQuery(document).find(".wbls-shortcode-layer, .wbls-shortcode-popup").hide()
    758771        })
    759772
    760         jQuery(document).off( "click", "#wbls-shortcode-copy, #wbls-form-shortcode-copy, #wbls-reply-shortcode-copy")
     773        jQuery(document).off("click", "#wbls-shortcode-copy, #wbls-form-shortcode-copy, #wbls-reply-shortcode-copy")
    761774            .on("click", "#wbls-shortcode-copy, #wbls-form-shortcode-copy, #wbls-reply-shortcode-copy", function () {
    762             let text = jQuery(this).closest(".wbls-shortcode-popup-row").find(".wbls-form-shortcode").val();
    763             navigator.clipboard.writeText(text);
    764             jQuery(this).find(".wbls-form-shortcode-copy-tooltip").show();
    765             setTimeout(() => {
    766                 jQuery(this).find(".wbls-form-shortcode-copy-tooltip").hide();
    767             }, 500);
    768         })
     775                let text = jQuery(this).closest(".wbls-shortcode-popup-row").find(".wbls-form-shortcode").val();
     776                navigator.clipboard.writeText(text);
     777                jQuery(this).find(".wbls-form-shortcode-copy-tooltip").show();
     778                setTimeout(() => {
     779                    jQuery(this).find(".wbls-form-shortcode-copy-tooltip").hide();
     780                }, 500);
     781            })
    769782
    770783        jQuery('.wbls-file-types').select2({
     
    773786        });
    774787
    775         jQuery(document).off( "click", ".wbls-tabs-menu-item").on("click", ".wbls-tabs-menu-item", function () {
     788        jQuery(document).off("click", ".wbls-tabs-menu-item").on("click", ".wbls-tabs-menu-item", function () {
    776789            let id = jQuery(this).attr("id");
    777790            jQuery(document).find(".wbls-tabs-menu-item").removeClass("wbls-tabs-menu-item-active");
     
    782795
    783796        /* Incoming webhook events */
    784         jQuery(document).off( "click", ".wbls-copy-webhook-incoming-url")
     797        jQuery(document).off("click", ".wbls-copy-webhook-incoming-url")
    785798            .on("click", ".wbls-copy-webhook-incoming-url", function () {
    786799                let text = jQuery(this).closest(".wbls-option-row").find(".wbls-webhook-incoming-url").val();
     
    790803                    jQuery(this).find(".wbls-copy-webhook-tooltip").hide();
    791804                }, 500);
    792         })
    793 
    794         jQuery(document).off( "click", ".wbls-webhook-generate-token")
     805            })
     806
     807        jQuery(document).off("click", ".wbls-webhook-generate-token")
    795808            .on("click", ".wbls-webhook-generate-token", function () {
    796809                let text = self.generateSecret(64);
    797810                jQuery(this).closest(".wbls-option-row").find(".wbls-webhook-secret-token").val(text);
    798         })
     811            })
    799812
    800813        jQuery(document).off("click", ".wbls-mapping-add")
     
    810823                // Re-index after adding
    811824                self.reindexMapping($repeater);
    812         });
     825            });
    813826
    814827        jQuery(document).off("click", ".wbls-mapping-remove")
     
    822835
    823836
    824 
    825837        /* Outgoing webhook events */
    826         jQuery(document).on('change', 'input[name="wbls_webhook[outgoing][auth_type]"]', function() {
     838        jQuery(document).on('change', 'input[name="wbls_webhook[outgoing][auth_type]"]', function () {
    827839            const authType = jQuery('input[name="wbls_webhook[outgoing][auth_type]"]:checked').val();
    828840            if (authType === 'header') {
     
    846858
    847859                // Re-index after adding
    848                 self.reindexMapping( jQuery(this).closest(".wbls-mapping-repeater") );
     860                self.reindexMapping(jQuery(this).closest(".wbls-mapping-repeater"));
    849861            });
    850862
     
    861873            `);
    862874
    863             self.reindexMapping( jQuery(this).closest(".wbls-option-section-group").find(".wbls-mapping-repeater") );
     875            self.reindexMapping(jQuery(this).closest(".wbls-option-section-group").find(".wbls-mapping-repeater"));
    864876        });
    865877
     
    912924        });
    913925
     926        /* Rating field rate scale change event */
     927        jQuery(document).off('change', ".wbls-field-option-rateType")
     928            .on('change', ".wbls-field-option-rateType", function() {
     929
     930                const fieldId = self.edit_field_id;
     931                self.fields_options[fieldId]['rateType'] = jQuery(this).val();
     932                const $ratingContainer = jQuery(`.wblsform-row[data-field-id="${fieldId}"] .wbls-rating`);
     933                if( $ratingContainer.hasClass("wbls-rating--numbers") ) {
     934                    jQuery(`.wblsform-row[data-field-id="${fieldId}"] .wbls-rating`).removeClass("wbls-rating--numbers")
     935                        .addClass("wbls-rating--stars");
     936                } else {
     937                    jQuery(`.wblsform-row[data-field-id="${fieldId}"] .wbls-rating`).removeClass("wbls-rating--stars")
     938                        .addClass("wbls-rating--numbers");
     939                }
     940        });
     941
     942        jQuery(document).off('change', ".wbls-field-option-rateScale")
     943            .on('change', ".wbls-field-option-rateScale", function() {
     944
     945            let newScale = parseInt(jQuery(this).val());
     946            if( newScale > 20 ) {
     947                newScale = 20;
     948                jQuery(this).val(newScale);
     949            }
     950            const fieldId = self.edit_field_id;
     951
     952            self.fields_options[fieldId]['rateScale'] = newScale;
     953
     954            const $ratingContainer = jQuery(`.wblsform-row[data-field-id="${fieldId}"] .wbls-rating`);
     955            const template = `
     956                <input type="radio" class="wbls-field" id="{{ID}}" name="{{NAME}}" value="{{VALUE}}" />
     957                <label for="{{FOR}}" data-label="{{LABEL}}"></label>
     958            `;
     959
     960            $ratingContainer.empty();
     961
     962            // String concatenation is faster than multiple DOM manipulations
     963            let htmlContent = '';
     964            const nameAttr = `wbls_field_${fieldId}`;
     965
     966            for(let num = newScale; num >= 1; num--) {
     967                let itemHtml = template
     968                    .replace(/{{ID}}/g, `rating_${num}`)
     969                    .replace(/{{FOR}}/g, `rating_${num}`)
     970                    .replace(/{{VALUE}}/g, num)
     971                    .replace(/{{NAME}}/g, nameAttr)
     972                    .replace(/{{LABEL}}/g, num);
     973
     974
     975                htmlContent += itemHtml;
     976            }
     977
     978            $ratingContainer.html(htmlContent);
     979        });
    914980    }
    915981
     
    11121178        field_options_content.empty().append(default_template);
    11131179
    1114         let tabs = ['general', 'options', 'conditions'];
     1180        let tabs = ['general', 'options', 'styles', 'conditions'];
    11151181        tabs.forEach(function (val) {
    11161182            if( !field['tabs'].includes(val) ) {
     
    11751241                this.edit_Html_field(values);
    11761242                break;
     1243            case 'rating':
     1244                this.remove_field_option_html(".wbls-field-option-placeholder");
     1245                this.edit_rating_field(values);
     1246                break;
    11771247        }
    11781248
    11791249        Object.keys(values).forEach(function (key){
    11801250            if( key == 'required' ) {
    1181                 if ( values[key] == "1" ){
     1251                if ( values[key] === "1" ){
    11821252                    field_options_content.find(".wbls-field-option-"+key ).prop( "checked", true );
    11831253                }
    11841254            }
    1185             else if( key == 'required_single' ) {
    1186                 if ( values[key] == "1" ){
     1255            else if( key === 'required_single' ) {
     1256                if ( values[key] === "1" ){
    11871257                    field_options_content.find(".wbls-field-option-"+key ).prop( "checked", true );
    11881258                }
    11891259            }
    1190             else if( key == 'hideMiddleName' ) {
    1191                 if ( values[key] == "0" ){
     1260            else if( key === 'hideMiddleName' ) {
     1261                if ( values[key] === "0" ){
    11921262                    field_options_content.find(".wbls-field-option-"+key ).prop( "checked", true );
    11931263                }
    11941264            }
    1195             else if( key == 'hideStreet' ) {
    1196                 if ( values[key] == "1" ){
     1265            else if( key === 'hideStreet' ) {
     1266                if ( values[key] === "1" ){
    11971267                    field_options_content.find(".wbls-field-option-"+key ).prop( "checked", true );
    11981268                }
    11991269            }
    1200             else if( key == 'hideStreet1' ) {
    1201                 if ( values[key] == "1" ){
     1270            else if( key === 'hideStreet1' ) {
     1271                if ( values[key] === "1" ){
    12021272                    field_options_content.find(".wbls-field-option-"+key ).prop( "checked", true );
    12031273                }
    12041274            }
    1205             else if( key == 'hideCity' ) {
    1206                 if ( values[key] == "1" ){
     1275            else if( key === 'hideCity' ) {
     1276                if ( values[key] === "1" ){
    12071277                    field_options_content.find(".wbls-field-option-"+key ).prop( "checked", true );
    12081278                }
    12091279            }
    1210             else if( key == 'hideState' ) {
    1211                 if ( values[key] == "1" ){
     1280            else if( key === 'hideState' ) {
     1281                if ( values[key] === "1" ){
    12121282                    field_options_content.find(".wbls-field-option-"+key ).prop( "checked", true );
    12131283                }
    12141284            }
    1215             else if( key == 'hidePostal' ) {
    1216                 if ( values[key] == "1" ){
     1285            else if( key === 'hidePostal' ) {
     1286                if ( values[key] === "1" ){
    12171287                    field_options_content.find(".wbls-field-option-"+key ).prop( "checked", true );
    12181288                }
    12191289            }
    1220             else if( key == 'hideCountry' ) {
    1221                 if ( values[key] == "1" ){
     1290            else if( key === 'hideCountry' ) {
     1291                if ( values[key] === "1" ){
    12221292                    field_options_content.find(".wbls-field-option-"+key ).prop( "checked", true );
    12231293                }
    12241294            }
    1225             else if( key == 'multiple' ) {
    1226                 if ( values[key] == "1" ){
     1295            else if( key === 'multiple' ) {
     1296                if ( values[key] === "1" ){
    12271297                    field_options_content.find(".wbls-field-option-"+key ).prop( "checked", true );
    12281298                }
    12291299            }
    1230             else if( key == 'show_previous' ) {
     1300            else if( key === 'show_previous' ) {
     1301                field_options_content.find(".wbls-field-option-"+key+"[value='"+values[key]+"']").prop( "checked", true );
     1302            }
     1303            else if( key === 'rateType' ) {
    12311304                field_options_content.find(".wbls-field-option-"+key+"[value='"+values[key]+"']").prop( "checked", true );
    12321305            }
     
    12871360
    12881361        /* Foreach on all fields in the page */
    1289         page.find(".wblsform-row").each(function() {
     1362        page.find(".wblsform_column").each(function() {
    12901363            /* If page has submit button, submit button move to last page */
    1291             if( jQuery(this).hasClass("wblsform-row-submit") ) {
     1364            if( jQuery(this).find(".wblsform-row").hasClass("wblsform-row-submit") ) {
    12921365                if( lastPage.find(".wblsform-row-pageButtonNextPrev-container").length ) {
    12931366                    lastPage.find(".wblsform-row-pageButtonNextPrev-container").before(jQuery(this));
     
    12971370                    lastPage.find(".wblsform-row-pageButtonPrev").before(jQuery(this));
    12981371                } else {
    1299                     lastPage.append(jQuery(this));
     1372                    lastPage.find(".wblsform_section").append(jQuery(this));
    13001373                }
    13011374            } else {
     
    14041477        let recaptcha_visible = field_options['visible'];
    14051478        jQuery("#wbls-editor-conditions").hide();
     1479        this.remove_field_option_html(".wbls-field-option-required");
    14061480        this.remove_field_option_html(".wbls-field-option-placeholder");
    14071481        this.remove_field_option_html(".wbls-field-option-description");
     
    15501624
    15511625    add_field(that) {
    1552         let field_type = jQuery(that).attr("data-type");
    1553         if( field_type === 'submit' &&
    1554             ( ( Array.isArray(this.fields_options) && this.fields_options.some(item => item.type === 'submit') ) ||
    1555             ( typeof this.fields_options === "object" && Object.values(this.fields_options).some(item => item.type === "submit") ))) {
    1556             jQuery(document).find(".wblsform-row.wblsform-row-submit").trigger("click");
     1626        const $ = jQuery;
     1627        const field_type = $(that).attr("data-type");
     1628
     1629        // Early returns for special cases
     1630        if (this.shouldPreventSubmitFieldAddition(field_type)) {
     1631            $(".wblsform-row.wblsform-row-submit").trigger("click");
    15571632            return false;
    15581633        }
    1559         let field_args = JSON.parse(JSON.stringify(wbls_edit.form_fields[field_type]));
    1560         if( field_args['pro'] && !wbls_edit.pro ) {
     1634
     1635        if (field_type === 'recaptcha' && this.shouldPreventRecaptchaAddition()) {
     1636            return;
     1637        }
     1638
     1639        // Validate pro field
     1640        const field_args = this.getFieldArgs(field_type);
     1641        if (!field_args || (field_args.pro && !wbls_edit.pro)) {
    15611642            return false;
    15621643        }
    1563         let fieldTemplate = jQuery("#wbls-template-"+field_type).html();
    1564         let actionsTemplate = jQuery("#wbls-template-actions").html();
    1565 
    1566         let field_id = this.fieldNameLastId;
    1567         this.fields_options[field_id] = field_args;
    1568 
    1569         if( field_type == "fullName" ) {
    1570             this.fields_options[field_id]['name'] = 'wbls_field_' + this.fieldNameLastId;
    1571             this.fields_options[field_id]['fname'] = 'wbls_field_' + this.fieldNameLastId + '_f';
    1572             this.fields_options[field_id]['mname'] = 'wbls_field_' + this.fieldNameLastId + '_m';
    1573             this.fields_options[field_id]['lname'] = 'wbls_field_' + this.fieldNameLastId + '_l';
    1574         }
    1575         else if( field_type == "address" ) {
    1576             this.fields_options[field_id]['name'] = 'wbls_field_' + this.fieldNameLastId;
    1577             this.fields_options[field_id]['streetName'] = 'wbls_field_' + this.fieldNameLastId + '_street';
    1578             this.fields_options[field_id]['street1Name'] = 'wbls_field_' + this.fieldNameLastId + '_street1';
    1579             this.fields_options[field_id]['cityName'] = 'wbls_field_' + this.fieldNameLastId + '_city';
    1580             this.fields_options[field_id]['stateName'] = 'wbls_field_' + this.fieldNameLastId + '_state';
    1581             this.fields_options[field_id]['postalName'] = 'wbls_field_' + this.fieldNameLastId + '_postal';
    1582             this.fields_options[field_id]['countryName'] = 'wbls_field_' + this.fieldNameLastId + '_country';
    1583         }
    1584         else if( field_type == "DateTime" ) {
    1585             this.fields_options[field_id]['name'] = 'wbls_field_' + this.fieldNameLastId;
    1586             this.fields_options[field_id]['dateName'] = 'wbls_field_' + this.fieldNameLastId + '_date';
    1587             this.fields_options[field_id]['dayName'] = 'wbls_field_' + this.fieldNameLastId + '_day';
    1588             this.fields_options[field_id]['monthName'] = 'wbls_field_' + this.fieldNameLastId + '_month';
    1589             this.fields_options[field_id]['yearName'] = 'wbls_field_' + this.fieldNameLastId + '_year';
    1590             this.fields_options[field_id]['timeName'] = 'wbls_field_' + this.fieldNameLastId + '_time';
    1591         }
    1592         else if( field_type == "checkbox" ) {
    1593             this.fields_options[field_id]['options'][0]['name'] = 'wbls_field_' + this.fieldNameLastId;
    1594         }
    1595         else if( field_type == "recaptcha" ) {
    1596             if( jQuery(document).find("#wbls-grecaptcha").length ) {
    1597                 alert("You already have reCAPTCHA field in the form.");
    1598                 return;
    1599             } else if( wbls_edit.recaptcha_active == '0' ) {
    1600                 alert("Please set the reCAPTCHA keys from the plugin's 'Settings' menu.");
    1601                 return;
    1602             }
    1603         }
    1604         else if( field_type != "submit" ) {
    1605             this.fields_options[field_id]['name'] = 'wbls_field_' + this.fieldNameLastId;
    1606         }
    1607 
    1608         //const el = jQuery(".wblsform-page-and-images:last .wblsform_column:last:not(.wbls-col-hidden)");
    1609         const elSubmitButton = jQuery(".wblsform-page-and-images:last .wblsform-row.wblsform-row-submit");
    1610 
    1611         fieldTemplate = '<div class="wblsform_column ui-sortable">' +
    1612             fieldTemplate.replace('data-field-id=""', 'data-field-id="' + field_id + '"') + '</div>' +
    1613             '<div class="wblsform_column wbls-col-hidden ui-sortable"></div>';
    1614 
    1615         if( elSubmitButton.length ) {
    1616             elSubmitButton.closest(".wblsform_column").before(fieldTemplate);
     1644
     1645        // Create field
     1646        const field_id = this.fieldNameLastId.toString();
     1647        this.fields_options[field_id] = { ...field_args };
     1648
     1649        this.setFieldNames(field_type, field_id);
     1650        this.insertFieldTemplate(field_type, field_id);
     1651        this.updateFieldAttributes(field_type, field_id);
     1652        this.finalizeFieldAddition(field_id);
     1653
     1654        this.fieldNameLastId++;
     1655        this.columns_refresh();
     1656    }
     1657
     1658    // Helper methods
     1659    shouldPreventSubmitFieldAddition(field_type) {
     1660        if (field_type !== 'submit') return false;
     1661
     1662        const fields = this.fields_options;
     1663        const hasSubmitField = Array.isArray(fields)
     1664            ? fields.some(item => item.type === 'submit')
     1665            : Object.values(fields).some(item => item.type === 'submit');
     1666
     1667        return hasSubmitField;
     1668    }
     1669
     1670    shouldPreventRecaptchaAddition() {
     1671        const $ = jQuery;
     1672        if ($("#wbls-grecaptcha").length) {
     1673            alert("You already have reCAPTCHA field in the form.");
     1674            return true;
     1675        }
     1676        if (wbls_edit.recaptcha_active === '0') {
     1677            alert("Please set the reCAPTCHA keys from the plugin's 'Settings' menu.");
     1678            return true;
     1679        }
     1680        return false;
     1681    }
     1682
     1683    getFieldArgs(field_type) {
     1684        return wbls_edit.form_fields[field_type]
     1685            ? JSON.parse(JSON.stringify(wbls_edit.form_fields[field_type]))
     1686            : null;
     1687    }
     1688
     1689    setFieldNames(field_type, field_id) {
     1690        const field = this.fields_options[field_id];
     1691        const baseName = `wbls_field_${field_id}`;
     1692
     1693        const nameMappings = {
     1694            fullName: () => {
     1695                field.name = baseName;
     1696                field.fname = `${baseName}_f`;
     1697                field.mname = `${baseName}_m`;
     1698                field.lname = `${baseName}_l`;
     1699            },
     1700            address: () => {
     1701                field.name = baseName;
     1702                field.streetName = `${baseName}_street`;
     1703                field.street1Name = `${baseName}_street1`;
     1704                field.cityName = `${baseName}_city`;
     1705                field.stateName = `${baseName}_state`;
     1706                field.postalName = `${baseName}_postal`;
     1707                field.countryName = `${baseName}_country`;
     1708            },
     1709            DateTime: () => {
     1710                field.name = baseName;
     1711                field.dateName = `${baseName}_date`;
     1712                field.dayName = `${baseName}_day`;
     1713                field.monthName = `${baseName}_month`;
     1714                field.yearName = `${baseName}_year`;
     1715                field.timeName = `${baseName}_time`;
     1716            },
     1717            checkbox: () => {
     1718                if (field.options && field.options[0]) {
     1719                    field.options[0].name = baseName;
     1720                }
     1721            }
     1722        };
     1723
     1724        if (nameMappings[field_type]) {
     1725            nameMappings[field_type]();
     1726        } else if (field_type !== 'submit' && field_type !== 'recaptcha') {
     1727            field.name = baseName;
     1728        }
     1729    }
     1730
     1731    insertFieldTemplate(field_type, field_id) {
     1732        const $ = jQuery;
     1733        const fieldTemplate = $(`#wbls-template-${field_type}`).html();
     1734        const actionsTemplate = $("#wbls-template-actions").html();
     1735
     1736        if (!fieldTemplate) return;
     1737
     1738        const template = `<div class="wblsform_column ui-sortable">${fieldTemplate.replace('data-field-id=""', `data-field-id="${field_id}"`)}</div><div class="wblsform_column wbls-col-hidden ui-sortable"></div>`;
     1739        const $submitButton = $(".wblsform-page-and-images:last .wblsform-row.wblsform-row-submit");
     1740
     1741        if ($submitButton.length) {
     1742            $submitButton.closest(".wblsform_column").before(template);
    16171743        } else {
    1618             jQuery(".wblsform-page-and-images:last .wblsform_section").append(fieldTemplate);
    1619         }
    1620 
    1621         jQuery(document).find(".wblsform-row-new[data-field-id="+field_id+"]").append(actionsTemplate);
    1622         if( field_type == 'fullName' ) {
    1623             jQuery(document).find(".wblsform-row-new .wbls-field-firstName .wbls-field").attr("name", this.fields_options[field_id]['fname']);
    1624             jQuery(document).find(".wblsform-row-new .wbls-field-middleName .wbls-field").attr("name", this.fields_options[field_id]['mname']);
    1625             jQuery(document).find(".wblsform-row-new .wbls-field-lastName .wbls-field").attr("name", this.fields_options[field_id]['lname']);
    1626         } else if( field_type == 'address' ) {
    1627             jQuery(document).find(".wblsform-row-new .wbls-field-street .wbls-field").attr("name", this.fields_options[field_id]['streetName']);
    1628             jQuery(document).find(".wblsform-row-new .wbls-field-street1 .wbls-field").attr("name", this.fields_options[field_id]['street1Name']);
    1629             jQuery(document).find(".wblsform-row-new .wbls-field-city .wbls-field").attr("name", this.fields_options[field_id]['cityName']);
    1630             jQuery(document).find(".wblsform-row-new .wbls-field-state .wbls-field").attr("name", this.fields_options[field_id]['stateName']);
    1631             jQuery(document).find(".wblsform-row-new .wbls-field-postal .wbls-field").attr("name", this.fields_options[field_id]['postalName']);
    1632             jQuery(document).find(".wblsform-row-new .wbls-field-country .wbls-field").attr("name", this.fields_options[field_id]['countryName']);
    1633         } else if( field_type == "checkbox" ) {
    1634             jQuery(document).find(".wblsform-row-new .wbls-field").attr("name", this.fields_options[field_id]['options'][0]['name']);
    1635         } else if( field_type == "file" ) {
    1636             jQuery(document).find(".wblsform-row-new .wbls-field").attr("name", this.fields_options[field_id]['name']);
    1637         } else if( field_type == "DateTime" ) {
    1638             jQuery(document).find(".wblsform-row-new .wbls-field-date .wbls-field").attr("name", this.fields_options[field_id]['dateName']);
    1639             jQuery(document).find(".wblsform-row-new .wbls-field-time .wbls-field").attr("name", this.fields_options[field_id]['timeName']);
    1640         } else {
    1641             jQuery(document).find(".wblsform-row-new .wbls-field").attr("name", this.fields_options[field_id]['name']);
    1642         }
    1643         jQuery(document).find(".wblsform-row-new label.wbls-field-label").text(field_args['label']);
    1644      
    1645         jQuery('.wbls-content').animate({
    1646             scrollTop: jQuery('.wbls-content')[0].scrollHeight - 100
    1647         }, 1000); // Scroll over 1 second
    1648         jQuery(document).find(".wblsform-row-new").trigger("click");
    1649         jQuery(document).find(".wblsform-row-new").removeClass("wblsform-row-new");
    1650         this.fieldNameLastId = parseInt(this.fieldNameLastId) + 1;
    1651 
    1652         this.columns_refresh();
     1744            $(".wblsform-page-and-images:last .wblsform_section").append(template);
     1745        }
     1746
     1747        $(`.wblsform-row-new[data-field-id="${field_id}"]`).append(actionsTemplate);
     1748    }
     1749
     1750    updateFieldAttributes(field_type, field_id) {
     1751        const $ = jQuery;
     1752        const field = this.fields_options[field_id];
     1753        const $newField = $(`.wblsform-row-new[data-field-id="${field_id}"]`);
     1754
     1755        if (!$newField.length) return;
     1756
     1757        const attributeMappings = {
     1758            fullName: () => {
     1759                $newField.find(".wbls-field-firstName .wbls-field").attr("name", field.fname);
     1760                $newField.find(".wbls-field-middleName .wbls-field").attr("name", field.mname);
     1761                $newField.find(".wbls-field-lastName .wbls-field").attr("name", field.lname);
     1762            },
     1763            address: () => {
     1764                $newField.find(".wbls-field-street .wbls-field").attr("name", field.streetName);
     1765                $newField.find(".wbls-field-street1 .wbls-field").attr("name", field.street1Name);
     1766                $newField.find(".wbls-field-city .wbls-field").attr("name", field.cityName);
     1767                $newField.find(".wbls-field-state .wbls-field").attr("name", field.stateName);
     1768                $newField.find(".wbls-field-postal .wbls-field").attr("name", field.postalName);
     1769                $newField.find(".wbls-field-country .wbls-field").attr("name", field.countryName);
     1770            },
     1771            checkbox: () => {
     1772                $newField.find(".wbls-field").attr("name", field.options?.[0]?.name || '');
     1773            },
     1774            file: () => {
     1775                $newField.find(".wbls-field").attr("name", field.name);
     1776            },
     1777            DateTime: () => {
     1778                $newField.find(".wbls-field-date .wbls-field").attr("name", field.dateName);
     1779                $newField.find(".wbls-field-time .wbls-field").attr("name", field.timeName);
     1780            },
     1781            rating: () => {
     1782                $newField.find(".wbls-rating input").attr("name", field.name);
     1783            }
     1784        };
     1785
     1786        if (attributeMappings[field_type]) {
     1787            attributeMappings[field_type]();
     1788        } else if (field_type !== 'submit' && field_type !== 'recaptcha') {
     1789            $newField.find(".wbls-field").attr("name", field.name);
     1790        }
     1791
     1792        // Update label
     1793        $newField.find("label.wbls-field-label").text(field.label || '');
     1794    }
     1795
     1796    finalizeFieldAddition(field_id) {
     1797        const $ = jQuery;
     1798        const $newField = $(`.wblsform-row-new[data-field-id="${field_id}"]`);
     1799
     1800        $('.wbls-content').animate({
     1801            scrollTop: $('.wbls-content')[0].scrollHeight - 100
     1802        }, 1000);
     1803
     1804        $newField.trigger("click");
     1805        $newField.removeClass("wblsform-row-new");
    16531806    }
    16541807}
  • whistleblowing-system/trunk/admin/assets/js/themes.js

    r3191680 r3451009  
    44        jQuery(this).addClass("wbls-tab-active");
    55        let content_class = jQuery(this).data("content");
     6        jQuery("#wbls-active-tab-anchor").val(content_class);
    67        content_class = ".wbls-tabs-content-" + content_class;
    7         jQuery(".wbls-tabs-content-item").hide();
    8         jQuery(content_class).show();
     8        jQuery(".wbls-tabs-content-item").addClass("wbls-hidden");
     9        jQuery(content_class).removeClass("wbls-hidden");
    910    });
    1011
  • whistleblowing-system/trunk/admin/controllers/Controller.php

    r3434724 r3451009  
    106106            $form_conditions = $this->wbls_clear_conditions_array( $form_conditions, $field_options );
    107107        }
    108 
    109         require_once WBLS_DIR . "/admin/includes/conditions.php";
    110108
    111109        if ( $form_id ) {
     
    125123                $this->save_income_webhook( $form_id );
    126124                $this->save_outgoing_webhook( $form_id );
    127                 $args = [
    128                     'form_id' => $form_id,
    129                     'field_options' => $field_options,
    130                     'form_conditions' => $form_conditions
    131                 ];
    132                 if( ! empty($form_conditions) || ! empty($db_last_conditions) ) {
    133                     new \WBLS_WhistleBlower\Free\WBLS_Conditions($args);
    134                 }
    135125
    136126                $reload_url = '';
  • whistleblowing-system/trunk/admin/controllers/ControllerThemes.php

    r3434724 r3451009  
    117117                                            'hover_bg_color' => '#000000',
    118118                                            'hover_color' => '#ffffff',
     119                                        ),
     120                        'rating_fields' =>
     121                                        array (
     122                                            'gap' => '6',
     123                                            'width' => '34',
     124                                            'height' => '34',
     125                                            'font_size' => '16',
     126                                            'bg_color' => '#bfc1c5',
     127                                            'color' => '#000000',
     128                                            'font_weight' => 'normal',
     129                                            'border_width' => '0',
     130                                            'border_style' => 'solid',
     131                                            'border_color' => '#bfc1c5',
     132                                            'border_radius' => '6',
     133                                            'hover_font_weight' => 'normal',
     134                                            'hover_bg_color' => '#000000',
     135                                            'hover_color' => '#ffffff',
     136                                            'border_border_color' => '#bfc1c5',
    119137                                        ),
    120138                        'new_case_button_fields' =>
     
    580598        }\n";
    581599
     600        /* Rating field styles */
     601        $wbls_theme .= ".wbls-form-container .wbls-form .wbls-rating {
     602            gap: ".$data['rating_fields']['gap']."px;
     603        }\n";
     604        $wbls_theme .= ".wbls-form-container .wbls-form .wbls-rating--numbers label::before {
     605            width: ".$data['rating_fields']['width']."px;
     606            height: ".$data['rating_fields']['height']."px;
     607            background-color: ".$data['rating_fields']['bg_color'].";
     608            border-width: ".$data['rating_fields']['border_width']."px;
     609            border-style: ".$data['rating_fields']['border_style'].";
     610            border-color: ".$data['rating_fields']['border_color'].";
     611            border-radius: ".$data['rating_fields']['border_radius']."px;
     612            font-size: ".$data['rating_fields']['font_size']."px;
     613            font-weight: ".$data['rating_fields']['font_weight'].";
     614            color: ".$data['rating_fields']['color'].";
     615        }\n";
     616        $wbls_theme .= ".wbls-form-container .wbls-form .wbls-rating--stars label::before {         
     617            font-size: ".$data['rating_fields']['width']."px;
     618            font-weight: ".$data['rating_fields']['font_weight'].";
     619            color: ".$data['rating_fields']['bg_color'].";
     620        }\n";
     621        $wbls_theme .= ".wbls-form-container .wbls-form .wbls-rating--numbers label:hover::before,
     622            .wbls-form-container .wbls-form .wbls-rating--numbers label:hover,
     623            .wbls-form-container .wbls-form .wbls-rating--numbers input:checked + label,
     624            .wbls-form-container .wbls-form .wbls-rating--numbers input:checked + label::before {
     625                font-weight: ".$data['rating_fields']['hover_font_weight'].";
     626                color: ".$data['rating_fields']['hover_color'].";
     627                background-color: ".$data['rating_fields']['hover_bg_color'].";
     628                border-radius: ".$data['rating_fields']['border_radius']."px;
     629        }\n";
     630        $wbls_theme .= ".wbls-form-container .wbls-form .wbls-rating--stars label:hover::before,
     631            .wbls-form-container .wbls-form .wbls-rating--stars label:hover ~ label::before,
     632            .wbls-form-container .wbls-form .wbls-rating--stars input:checked ~ label::before,
     633            .wbls-form-container .wbls-form .wbls-rating--stars label:hover,
     634            .wbls-form-container .wbls-form .wbls-rating--stars label:hover ~ label,
     635            .wbls-form-container .wbls-form .wbls-rating--stars input:checked ~ label {
     636                color: ".$data['rating_fields']['hover_bg_color'].";
     637        }\n";
     638        /* End rating styles */
     639
    582640        $wbls_theme .= ".wbls-front-buttons-container .wbls-new-case-button {
    583641            width: ".$data['new_case_button_fields']['width'].";
  • whistleblowing-system/trunk/admin/includes/fields_templates.php

    r3396376 r3451009  
    455455        <div id="wbls-editor-general" class="wbls-tabs-menu-item wbls-tabs-menu-item-active"><?php esc_html_e('General', 'whistleblowing-system'); ?></div>
    456456        <div id="wbls-editor-options" class="wbls-tabs-menu-item"><?php esc_html_e('Options', 'whistleblowing-system'); ?></div>
     457        <div id="wbls-editor-styles" class="wbls-tabs-menu-item"><?php esc_html_e('Styles', 'whistleblowing-system'); ?></div>
    457458        <div id="wbls-editor-conditions" class="wbls-tabs-menu-item"><?php esc_html_e('Conditional fields', 'whistleblowing-system'); ?></div>
    458459    </div>
     
    484485    </div>
    485486
    486     <div class="wbls-editor-options wbls-editor-menu-content" style="display:none">
    487 
    488     </div>
    489 
     487    <div class="wbls-editor-options wbls-editor-menu-content" style="display:none"></div>
     488    <div class="wbls-editor-styles wbls-editor-menu-content" style="display:none">
     489    </div>
    490490    <div class="wbls-editor-conditions wbls-editor-menu-content" style="display:none">
    491491        <div class="wbls-field-option-row wbls-condition-item-row wbls-condition-header-row">
  • whistleblowing-system/trunk/admin/whistleblower_form_edit_page.php

    r3434724 r3451009  
    231231                'name' => '',
    232232                'icon' => '',
    233                 'order' => '14',
     233                'order' => '15',
    234234                'public' => true,
    235235                'class' => '',
     
    270270                'default_option' => 0,
    271271                'icon' => '',
    272                 'order' => '13',
     272                'order' => '14',
    273273                'public' => true,
    274274                'class' => '',
     
    378378                'tabs' => array('general', 'conditions'),
    379379            ),
     380            'rating' => array(
     381                    'type' => 'rating',
     382                    'title' => 'Rating',
     383                    'description' => '',
     384                    'value' => '',
     385                    'name' => '',
     386                    'rateScale' => 5,
     387                    'rateType' => 'numbers',
     388                    'default_option' => 0,
     389                    'icon' => '',
     390                    'order' => '12',
     391                    'public' => true,
     392                    'class' => '',
     393                    'id' => '',
     394                    'label' => 'Rating',
     395                    'pro' => 1,
     396                    'required' => 0,
     397                    'tabs' => array('general', 'conditions'),
     398            ),
     399
    380400    );
    381401
     
    690710                                <div class="wbls-switch-button-cover">
    691711                                    <div class="button b2 wbls-switch-button" id="wbls-req-switch-button">
    692                                         <input type="checkbox" class="checkbox wbls-field-option wbls-show-token-header" id="wbls-required-checkbox" name="show_form_header"  value="1" <?php echo $show_form_header ? 'checked' : ''; ?>/>
     712                                        <input type="checkbox" class="checkbox wbls-field-option wbls-show-token-header" id="wbls-required-checkbox" name="show_token_header"  value="1" <?php echo $show_token_header ? 'checked' : ''; ?>/>
    693713                                        <div class="wbls-req-knobs wbls-knobs">
    694714                                        <span></span>
  • whistleblowing-system/trunk/admin/whistleblower_theme_edit_page.php

    r3434724 r3451009  
    3434        $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
    3535        $theme_title = esc_html__('Untitled Form', 'whistleblowing-system');
     36        $wbls_active_tab_anchor = isset($_POST['wbls_active_tab_anchor']) ? sanitize_text_field($_POST['wbls_active_tab_anchor']) : 'general';
    3637        if( $id ) {
    3738            $theme_title = get_the_title($id);
     
    4849        <form method="post">
    4950            <input type="hidden" name="task" value="save_theme">
     51            <input type="hidden" name="wbls_active_tab_anchor" id="wbls-active-tab-anchor" value="<?php echo esc_attr($wbls_active_tab_anchor); ?>">
     52
    5053            <?php wp_nonce_field( 'wbls_theme', 'wbls_theme_nonce' );
    5154            WBLSLibrary::wbls_render_topbar_row(); ?>
     
    7376            <div class="wbls-theme">
    7477                <div class="wbls-tabs-row">
    75                     <span class="wbls-tab-item wbls-tab-active" data-content="general"><?php esc_html_e('General', 'whistleblowing-system') ?></span>
    76                     <span class="wbls-tab-item" data-content="form_fields"><?php esc_html_e('Form fields', 'whistleblowing-system') ?></span>
    77                     <span class="wbls-tab-item" data-content="start_buttons"><?php esc_html_e('Start Buttons', 'whistleblowing-system') ?></span>
    78                     <span class="wbls-tab-item" data-content="chat_styles"><?php esc_html_e('Chat styles', 'whistleblowing-system') ?></span>
    79                     <span class="wbls-tab-item" data-content="login_styles"><?php esc_html_e('Login styles', 'whistleblowing-system') ?></span>
    80                     <span class="wbls-tab-item" data-content="pagination_styles"><?php esc_html_e('Pagination styles', 'whistleblowing-system') ?></span>
     78                    <a href="#general" class="wbls-tab-item<?php echo $wbls_active_tab_anchor === 'general' ? ' wbls-tab-active' : '' ?>" data-content="general"><?php esc_html_e('General', 'whistleblowing-system') ?></a>
     79                    <a href="#form_fields" class="wbls-tab-item<?php echo $wbls_active_tab_anchor === 'form_fields' ? ' wbls-tab-active' : '' ?>" data-content="form_fields"><?php esc_html_e('Form fields', 'whistleblowing-system') ?></a>
     80                    <a href="#start_buttons" class="wbls-tab-item<?php echo $wbls_active_tab_anchor === 'start_buttons' ? ' wbls-tab-active' : '' ?>" data-content="start_buttons"><?php esc_html_e('Start Buttons', 'whistleblowing-system') ?></a>
     81                    <a href="#chat_styles" class="wbls-tab-item<?php echo $wbls_active_tab_anchor === 'chat_styles' ? ' wbls-tab-active' : '' ?>" data-content="chat_styles"><?php esc_html_e('Chat styles', 'whistleblowing-system') ?></a>
     82                    <a href="#login_styles" class="wbls-tab-item<?php echo $wbls_active_tab_anchor === 'login_styles' ? ' wbls-tab-active' : '' ?>" data-content="login_styles"><?php esc_html_e('Login styles', 'whistleblowing-system') ?></a>
     83                    <a href="#pagination_styles" class="wbls-tab-item<?php echo $wbls_active_tab_anchor === 'pagination_styles' ? ' wbls-tab-active' : '' ?>" data-content="pagination_styles"><?php esc_html_e('Pagination styles', 'whistleblowing-system') ?></a>
    8184                </div>
    8285                <div class="wbls-tabs-content">
    83                     <div class="wbls-tabs-content-general wbls-tabs-content-item">
     86                    <div class="wbls-tabs-content-general wbls-tabs-content-item<?php echo $wbls_active_tab_anchor === 'general' ? '' : ' wbls-hidden' ?>">
    8487                        <?php $this->general_content(); ?>
    8588                    </div>
    86                     <div class="wbls-tabs-content-form_fields wbls-tabs-content-item" style="display:none">
     89                    <div class="wbls-tabs-content-form_fields wbls-tabs-content-item<?php echo $wbls_active_tab_anchor === 'form_fields' ? '' : ' wbls-hidden'; ?>">
    8790                        <?php $this->form_fields_content(); ?>
    8891                    </div>
    89                     <div class="wbls-tabs-content-start_buttons wbls-tabs-content-item" style="display:none">
     92                    <div class="wbls-tabs-content-start_buttons wbls-tabs-content-item<?php echo $wbls_active_tab_anchor === 'start_buttons' ? '' : ' wbls-hidden'; ?>">
    9093                        <?php $this->start_buttons_content(); ?>
    9194                    </div>
    92                     <div class="wbls-tabs-content-chat_styles wbls-tabs-content-item" style="display:none">
     95                    <div class="wbls-tabs-content-chat_styles wbls-tabs-content-item<?php echo $wbls_active_tab_anchor === 'chat_styles' ? '' : ' wbls-hidden'; ?>">
    9396                        <?php $this->chat_content(); ?>
    9497                    </div>
    95                     <div class="wbls-tabs-content-login_styles wbls-tabs-content-item" style="display:none">
     98                    <div class="wbls-tabs-content-login_styles wbls-tabs-content-item<?php echo $wbls_active_tab_anchor === 'login_styles' ? '' : ' wbls-hidden'; ?>">
    9699                        <?php $this->login_content(); ?>
    97100                    </div>
    98                     <div class="wbls-tabs-content-pagination_styles wbls-tabs-content-item" style="display:none">
     101                    <div class="wbls-tabs-content-pagination_styles wbls-tabs-content-item<?php echo $wbls_active_tab_anchor === 'pagination_styles' ? '' : ' wbls-hidden'; ?>">
    99102                        <?php $this->pagination_content(); ?>
    100103                    </div>
     
    110113            <div class="wbls-style-item-title">
    111114                <?php esc_html_e('Popup Container Styles', 'whistleblowing-system') ?>
    112                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    113             </div>
    114             <div class="wbls-style-item-content">
     115                <span class="dashicons dashicons-arrow-down-alt2"></span>
     116            </div>
     117            <div class="wbls-style-item-content" style="display: none;">
    115118                <?php $this->general_styles($this->default['general']); ?>
    116119            </div>
     
    119122            <div class="wbls-style-item-title">
    120123                <?php esc_html_e('Form Container Styles', 'whistleblowing-system') ?>
    121                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    122             </div>
    123             <div class="wbls-style-item-content">
     124                <span class="dashicons dashicons-arrow-down-alt2"></span>
     125            </div>
     126            <div class="wbls-style-item-content" style="display: none;">
    124127                <?php $this->form_general_styles($this->default['general_form']); ?>
    125128            </div>
     
    128131            <div class="wbls-style-item-title">
    129132                <?php esc_html_e('Custom CSS', 'whistleblowing-system') ?>
    130                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    131             </div>
    132             <div class="wbls-style-item-content">
     133                <span class="dashicons dashicons-arrow-down-alt2"></span>
     134            </div>
     135            <div class="wbls-style-item-content" style="display: none;">
    133136                <textarea name="custom_css_custom_css" class="wbls_theme_custom_css"><?php echo esc_html($this->default['custom_css']['custom_css']); ?></textarea>
    134137            </div>
     
    222225            <div class="wbls-style-item-title">
    223226                <?php esc_html_e('Login Input Field  Styles', 'whistleblowing-system') ?>
    224                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    225             </div>
    226             <div class="wbls-style-item-content">
     227                <span class="dashicons dashicons-arrow-down-alt2"></span>
     228            </div>
     229            <div class="wbls-style-item-content" style="display: none;">
    227230                <?php $this->input_fields_styles($this->default['login_input_styles'], 'login_input_styles_'); ?>
    228231            </div>
     
    231234            <div class="wbls-style-item-title">
    232235                <?php esc_html_e('Login Button Styles', 'whistleblowing-system') ?>
    233                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    234             </div>
    235             <div class="wbls-style-item-content">
     236                <span class="dashicons dashicons-arrow-down-alt2"></span>
     237            </div>
     238            <div class="wbls-style-item-content" style="display: none;">
    236239                <?php $this->buttons_styles($this->default['login_button_styles'], 'login_button_styles_'); ?>
    237240            </div>
     
    246249            <div class="wbls-style-item-title">
    247250                <?php esc_html_e('Pagination Title Styles', 'whistleblowing-system') ?>
    248                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    249             </div>
    250             <div class="wbls-style-item-content">
     251                <span class="dashicons dashicons-arrow-down-alt2"></span>
     252            </div>
     253            <div class="wbls-style-item-content" style="display: none;">
    251254                <?php $this->labels_styles($this->default['page_title_style'], 'page_title_style_'); ?>
    252255            </div>
     
    255258            <div class="wbls-style-item-title">
    256259                <?php esc_html_e('Next/Previous Buttons Styles', 'whistleblowing-system') ?>
    257                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    258             </div>
    259             <div class="wbls-style-item-content">
     260                <span class="dashicons dashicons-arrow-down-alt2"></span>
     261            </div>
     262            <div class="wbls-style-item-content" style="display: none;">
    260263                <?php $this->buttons_styles($this->default['next_prev_button_styles'], 'next_prev_button_styles_'); ?>
    261264            </div>
     
    270273            <div class="wbls-style-item-title">
    271274                <?php esc_html_e('Client Message Styles', 'whistleblowing-system') ?>
    272                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    273             </div>
    274             <div class="wbls-style-item-content">
     275                <span class="dashicons dashicons-arrow-down-alt2"></span>
     276            </div>
     277            <div class="wbls-style-item-content" style="display: none;">
    275278                <?php $this->message_styles($this->default['client_message_styles'], 'client_message_styles_'); ?>
    276279            </div>
     
    279282            <div class="wbls-style-item-title">
    280283                <?php esc_html_e('Admin Message Styles', 'whistleblowing-system') ?>
    281                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    282             </div>
    283             <div class="wbls-style-item-content">
     284                <span class="dashicons dashicons-arrow-down-alt2"></span>
     285            </div>
     286            <div class="wbls-style-item-content" style="display: none;">
    284287                <?php $this->message_styles($this->default['admin_message_styles'], 'admin_message_styles_'); ?>
    285288            </div>
     
    288291            <div class="wbls-style-item-title">
    289292                <?php esc_html_e('Message Textarea Styles', 'whistleblowing-system') ?>
    290                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    291             </div>
    292             <div class="wbls-style-item-content">
     293                <span class="dashicons dashicons-arrow-down-alt2"></span>
     294            </div>
     295            <div class="wbls-style-item-content" style="display: none;">
    293296                <?php $this->textarea_styles($this->default['message_textarea'], 'message_textarea_'); ?>
    294297
     
    298301            <div class="wbls-style-item-title">
    299302                <?php esc_html_e('Send Button Styles', 'whistleblowing-system') ?>
    300                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    301             </div>
    302             <div class="wbls-style-item-content">
     303                <span class="dashicons dashicons-arrow-down-alt2"></span>
     304            </div>
     305            <div class="wbls-style-item-content" style="display: none;">
    303306                <?php $this->buttons_styles($this->default['message_send_button'], 'message_send_button_'); ?>
    304307            </div>
     
    312315            <div class="wbls-style-item-title">
    313316                <?php esc_html_e('New Case Button Styles', 'whistleblowing-system') ?>
    314                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    315             </div>
    316             <div class="wbls-style-item-content">
     317                <span class="dashicons dashicons-arrow-down-alt2"></span>
     318            </div>
     319            <div class="wbls-style-item-content" style="display: none;">
    317320                <?php $this->buttons_styles($this->default['new_case_button_fields'], 'new_case_button_fields_'); ?>
    318321            </div>
     
    321324            <div class="wbls-style-item-title">
    322325                <?php esc_html_e('Follow Case Button Styles', 'whistleblowing-system') ?>
    323                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    324             </div>
    325             <div class="wbls-style-item-content">
     326                <span class="dashicons dashicons-arrow-down-alt2"></span>
     327            </div>
     328            <div class="wbls-style-item-content" style="display: none;">
    326329                <?php $this->buttons_styles($this->default['follow_case_button_fields'], 'follow_case_button_fields_'); ?>
    327330            </div>
     
    330333            <div class="wbls-style-item-title">
    331334                <?php esc_html_e('Default Tab Styles', 'whistleblowing-system') ?>
    332                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    333             </div>
    334             <div class="wbls-style-item-content">
     335                <span class="dashicons dashicons-arrow-down-alt2"></span>
     336            </div>
     337            <div class="wbls-style-item-content" style="display: none;">
    335338                <?php $this->tabs_styles($this->default['default_tab_fields'], 'default_tab_fields_'); ?>
    336339            </div>
     
    339342            <div class="wbls-style-item-title">
    340343                <?php esc_html_e('Active Tab Styles', 'whistleblowing-system') ?>
    341                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    342             </div>
    343             <div class="wbls-style-item-content">
     344                <span class="dashicons dashicons-arrow-down-alt2"></span>
     345            </div>
     346            <div class="wbls-style-item-content" style="display: none;">
    344347                <?php $this->tabs_styles($this->default['active_tab_fields'], 'active_tab_fields_'); ?>
    345348            </div>
     
    353356            <div class="wbls-style-item-title">
    354357                <?php esc_html_e('Labels', 'whistleblowing-system') ?>
    355                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    356             </div>
    357             <div class="wbls-style-item-content">
     358                <span class="dashicons dashicons-arrow-down-alt2"></span>
     359            </div>
     360            <div class="wbls-style-item-content" style="display: none;">
    358361            <?php $this->labels_styles($this->default['labels'], 'labels_'); ?>
    359362            </div>
     
    362365            <div class="wbls-style-item-title">
    363366                <?php esc_html_e('Input Field', 'whistleblowing-system') ?>
    364                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    365             </div>
    366             <div class="wbls-style-item-content">
     367                <span class="dashicons dashicons-arrow-down-alt2"></span>
     368            </div>
     369            <div class="wbls-style-item-content" style="display: none;">
    367370            <?php $this->input_fields_styles($this->default['input_fields'], 'input_fields_'); ?>
    368371            </div>
     
    371374            <div class="wbls-style-item-title">
    372375                <?php esc_html_e('Textarea', 'whistleblowing-system') ?>
    373                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    374             </div>
    375             <div class="wbls-style-item-content">
     376                <span class="dashicons dashicons-arrow-down-alt2"></span>
     377            </div>
     378            <div class="wbls-style-item-content" style="display: none;">
    376379                <?php $this->textarea_styles($this->default['textarea'], 'textarea_'); ?>
    377380            </div>
     
    380383            <div class="wbls-style-item-title">
    381384                <?php esc_html_e('Dropdown', 'whistleblowing-system') ?>
    382                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    383             </div>
    384             <div class="wbls-style-item-content">
     385                <span class="dashicons dashicons-arrow-down-alt2"></span>
     386            </div>
     387            <div class="wbls-style-item-content" style="display: none;">
    385388                <?php $this->dropdown_field_styles(); ?>
    386389            </div>
     
    389392            <div class="wbls-style-item-title">
    390393                <?php esc_html_e('Checkbox/Radio Field', 'whistleblowing-system') ?>
    391                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    392             </div>
    393             <div class="wbls-style-item-content">
     394                <span class="dashicons dashicons-arrow-down-alt2"></span>
     395            </div>
     396            <div class="wbls-style-item-content" style="display: none;">
    394397                <?php $this->checkbox_field_styles(); ?>
    395398            </div>
     
    399402            <div class="wbls-style-item-title">
    400403                <?php esc_html_e('Buttons', 'whistleblowing-system') ?>
    401                 <span class="dashicons dashicons-arrow-up-alt2"></span>
    402             </div>
    403             <div class="wbls-style-item-content">
     404                <span class="dashicons dashicons-arrow-down-alt2"></span>
     405            </div>
     406            <div class="wbls-style-item-content" style="display: none;">
    404407                <?php $this->buttons_styles($this->default['button_fields'], 'button_fields_'); ?>
     408            </div>
     409
     410        </div>
     411
     412        <div class="wbls-style-item wbls-cols-50">
     413            <div class="wbls-style-item-title">
     414                <?php esc_html_e('Ratings', 'whistleblowing-system') ?>
     415                <span class="dashicons dashicons-arrow-down-alt2"></span>
     416            </div>
     417            <div class="wbls-style-item-content" style="display: none;">
     418                <?php $this->rating_styles($this->default['rating_fields'], 'rating_fields_'); ?>
    405419            </div>
    406420
     
    905919    }
    906920
    907     public function tabs_styles($params, $name_prefix) {
    908         ?>
    909         <div class="wbls-style-row">
    910             <label>Tab width</label>
     921    public function rating_styles($params, $name_prefix) {
     922        ?>
     923        <div class="wbls-style-row">
     924            <label>Gap</label>
     925            <input type="text" name="<?php echo esc_attr($name_prefix); ?>gap" value="<?php echo esc_attr($params['gap']); ?>">
     926            <p class="cf7b-description">Distance between rate items</p>
     927        </div>
     928        <div class="wbls-style-row">
     929            <label>Width</label>
    911930            <input type="text" name="<?php echo esc_attr($name_prefix); ?>width" value="<?php echo esc_attr($params['width']); ?>">
    912             <p class="cf7b-description">Use CSS type values. Ex 200px or auto</p>
    913         </div>
    914         <div class="wbls-style-row">
    915             <label>Tab height</label>
     931            <p class="cf7b-description">Use CSS type values. Ex 34 or auto</p>
     932        </div>
     933        <div class="wbls-style-row">
     934            <label>Height</label>
    916935            <input type="text" name="<?php echo esc_attr($name_prefix); ?>height" value="<?php echo esc_attr($params['height']); ?>">
    917             <p class="cf7b-description">Use CSS type values. Ex 40px or auto</p>
     936            <p class="cf7b-description">Use CSS type values. Ex 34 or auto</p>
    918937        </div>
    919938        <div class="wbls-style-row">
     
    942961        </div>
    943962        <div class="wbls-style-row">
    944             <label>Margin</label>
    945             <input type="text" name="<?php echo esc_attr($name_prefix); ?>margin" value="<?php echo esc_attr($params['margin']); ?>">
    946             <p class="cf7b-description">Use CSS type values. Ex 5px 3px</p>
    947         </div>
    948         <div class="wbls-style-row">
    949             <label>Padding</label>
    950             <input type="text" name="<?php echo esc_attr($name_prefix); ?>padding" value="<?php echo esc_attr($params['padding']); ?>">
    951             <p class="cf7b-description">Use CSS type values. Ex 5px 3px</p>
    952         </div>
    953         <div class="wbls-style-row">
    954             <label>Border (Top, Right, Bottom, Left)</label>
    955             <div class="wbls-style-four-vals">
    956                 <input type="number" name="<?php echo esc_attr($name_prefix); ?>border_width_top" min="0" value="<?php echo esc_attr($params['border_width_top']); ?>">
    957                 <input type="number" name="<?php echo esc_attr($name_prefix); ?>border_width_right" min="0" value="<?php echo esc_attr($params['border_width_right']); ?>">
    958                 <input type="number" name="<?php echo esc_attr($name_prefix); ?>border_width_bottom" min="0" value="<?php echo esc_attr($params['border_width_bottom']); ?>">
    959                 <input type="number" name="<?php echo esc_attr($name_prefix); ?>border_width_left" min="0" value="<?php echo esc_attr($params['border_width_left']); ?>">
    960             </div>
     963            <label>Border Width</label>
     964            <input type="number" name="<?php echo esc_attr($name_prefix); ?>border_width" min="0" value="<?php echo esc_attr($params['border_width']); ?>">
    961965            <span class="cf7b-um">px</span>
    962966        </div>
     
    985989            <span class="cf7b-um">px</span>
    986990        </div>
    987         <div class="wbls-style-row">
    988             <label>Box Shadow</label>
    989             <input type="text" name="<?php echo esc_attr($name_prefix); ?>box_shadow" value="<?php echo esc_attr($params['box_shadow']); ?>" placeholder="e.g. 5px 5px 2px #888888">
    990         </div>
    991         <div class="wbls-style-row">
    992             <label>Text align</label>
    993             <select name="<?php echo esc_attr($name_prefix); ?>text_align">
    994                 <option value="left" <?php echo ($params['text_align'] == 'left') ? 'selected' : '' ?>>Left</option>
    995                 <option value="center" <?php echo ($params['text_align'] == 'center') ? 'selected' : '' ?>>Center</option>
    996                 <option value="right" <?php echo ($params['text_align'] == 'right') ? 'selected' : '' ?>>Right</option>
    997             </select>
    998         </div>
     991
    999992        <!-- Hover -->
    1000993        <div class="wbls-style-row">
    1001             <label>Hover Font Weight</label>
     994            <label>Hover/Active Font Weight</label>
    1002995            <select name="<?php echo esc_attr($name_prefix); ?>hover_font_weight">
    1003996                <option value=""></option>
     
    10101003        </div>
    10111004        <div class="wbls-style-row">
    1012             <label>Hover Background Color</label>
     1005            <label>Hover/Active Background Color</label>
    10131006            <input type="text" name="<?php echo esc_attr($name_prefix); ?>hover_bg_color" value="<?php echo esc_attr($params['hover_bg_color']); ?>" class="button_hover_bg_color" />
    10141007        </div>
    10151008        <div class="wbls-style-row">
    1016             <label>Hover Font Color</label>
     1009            <label>Hover/Active Font Color</label>
    10171010            <input type="text" name="<?php echo esc_attr($name_prefix); ?>hover_color" value="<?php echo esc_attr($params['hover_color']); ?>" class="button_hover_color" />
    10181011        </div>
     
    10201013    }
    10211014
    1022     public function message_styles($params, $name_prefix) {
    1023         ?>
    1024         <div class="wbls-style-row">
    1025             <label>Text Font Size</label>
     1015    public function tabs_styles($params, $name_prefix) {
     1016        ?>
     1017        <div class="wbls-style-row">
     1018            <label>Tab width</label>
     1019            <input type="text" name="<?php echo esc_attr($name_prefix); ?>width" value="<?php echo esc_attr($params['width']); ?>">
     1020            <p class="cf7b-description">Use CSS type values. Ex 200px or auto</p>
     1021        </div>
     1022        <div class="wbls-style-row">
     1023            <label>Tab height</label>
     1024            <input type="text" name="<?php echo esc_attr($name_prefix); ?>height" value="<?php echo esc_attr($params['height']); ?>">
     1025            <p class="cf7b-description">Use CSS type values. Ex 40px or auto</p>
     1026        </div>
     1027        <div class="wbls-style-row">
     1028            <label>Font Size</label>
    10261029            <input type="text" name="<?php echo esc_attr($name_prefix); ?>font_size" value="<?php echo esc_attr($params['font_size']); ?>">
    10271030            <span class="cf7b-um">px</span>
    10281031        </div>
    10291032        <div class="wbls-style-row">
    1030             <label>Text Font Weight</label>
     1033            <label>Font Color</label>
     1034            <input type="text" name="<?php echo esc_attr($name_prefix); ?>color" value="<?php echo esc_attr($params['color']); ?>" class="button_color" />
     1035        </div>
     1036        <div class="wbls-style-row">
     1037            <label>Font Weight</label>
    10311038            <select name="<?php echo esc_attr($name_prefix); ?>font_weight">
    10321039                <option value=""></option>
     
    10391046        </div>
    10401047        <div class="wbls-style-row">
    1041             <label>Message Background Color</label>
    1042             <input type="text" name="<?php echo esc_attr($name_prefix); ?>bg_color" value="<?php echo esc_attr($params['bg_color']); ?>" class="input_bg_color" />
    1043         </div>
    1044         <div class="wbls-style-row">
    1045             <label>Text Color</label>
    1046             <input type="text" name="<?php echo esc_attr($name_prefix); ?>color" value="<?php echo esc_attr($params['color']); ?>" class="input_color" />
     1048            <label>Background Color</label>
     1049            <input type="text" name="<?php echo esc_attr($name_prefix); ?>bg_color" value="<?php echo esc_attr($params['bg_color']); ?>" class="button_bg_color" />
    10471050        </div>
    10481051        <div class="wbls-style-row">
     
    10571060        </div>
    10581061        <div class="wbls-style-row">
    1059             <label>Border Width</label>
    1060             <input type="number" name="<?php echo esc_attr($name_prefix); ?>border_width" min="0" value="<?php echo esc_attr($params['border_width']); ?>">
     1062            <label>Border (Top, Right, Bottom, Left)</label>
     1063            <div class="wbls-style-four-vals">
     1064                <input type="number" name="<?php echo esc_attr($name_prefix); ?>border_width_top" min="0" value="<?php echo esc_attr($params['border_width_top']); ?>">
     1065                <input type="number" name="<?php echo esc_attr($name_prefix); ?>border_width_right" min="0" value="<?php echo esc_attr($params['border_width_right']); ?>">
     1066                <input type="number" name="<?php echo esc_attr($name_prefix); ?>border_width_bottom" min="0" value="<?php echo esc_attr($params['border_width_bottom']); ?>">
     1067                <input type="number" name="<?php echo esc_attr($name_prefix); ?>border_width_left" min="0" value="<?php echo esc_attr($params['border_width_left']); ?>">
     1068            </div>
    10611069            <span class="cf7b-um">px</span>
    10621070        </div>
     
    10781086        <div class="wbls-style-row">
    10791087            <label>Border Color</label>
    1080             <input type="text" name="<?php echo esc_attr($name_prefix); ?>border_color" value="<?php echo esc_attr($params['border_color']); ?>" class="input_border_color" />
     1088            <input type="text" name="<?php echo esc_attr($name_prefix); ?>border_color" value="<?php echo esc_attr($params['border_color']); ?>" class="button_border_color" />
    10811089        </div>
    10821090        <div class="wbls-style-row">
     
    10891097            <input type="text" name="<?php echo esc_attr($name_prefix); ?>box_shadow" value="<?php echo esc_attr($params['box_shadow']); ?>" placeholder="e.g. 5px 5px 2px #888888">
    10901098        </div>
     1099        <div class="wbls-style-row">
     1100            <label>Text align</label>
     1101            <select name="<?php echo esc_attr($name_prefix); ?>text_align">
     1102                <option value="left" <?php echo ($params['text_align'] == 'left') ? 'selected' : '' ?>>Left</option>
     1103                <option value="center" <?php echo ($params['text_align'] == 'center') ? 'selected' : '' ?>>Center</option>
     1104                <option value="right" <?php echo ($params['text_align'] == 'right') ? 'selected' : '' ?>>Right</option>
     1105            </select>
     1106        </div>
     1107        <!-- Hover -->
     1108        <div class="wbls-style-row">
     1109            <label>Hover Font Weight</label>
     1110            <select name="<?php echo esc_attr($name_prefix); ?>hover_font_weight">
     1111                <option value=""></option>
     1112                <option value="normal" <?php echo ($params['hover_font_weight'] == 'normal') ? 'selected' : '' ?>>Normal</option>
     1113                <option value="bold" <?php echo ($params['hover_font_weight'] == 'bold') ? 'selected' : '' ?>>Bold</option>
     1114                <option value="bolder" <?php echo ($params['hover_font_weight'] == 'bolder') ? 'selected' : '' ?>>Bolder</option>
     1115                <option value="lighter" <?php echo ($params['hover_font_weight'] == 'lighter') ? 'selected' : '' ?>>Lighter</option>
     1116                <option value="initial" <?php echo ($params['hover_font_weight'] == 'initial') ? 'selected' : '' ?>>Initial</option>
     1117            </select>
     1118        </div>
     1119        <div class="wbls-style-row">
     1120            <label>Hover Background Color</label>
     1121            <input type="text" name="<?php echo esc_attr($name_prefix); ?>hover_bg_color" value="<?php echo esc_attr($params['hover_bg_color']); ?>" class="button_hover_bg_color" />
     1122        </div>
     1123        <div class="wbls-style-row">
     1124            <label>Hover Font Color</label>
     1125            <input type="text" name="<?php echo esc_attr($name_prefix); ?>hover_color" value="<?php echo esc_attr($params['hover_color']); ?>" class="button_hover_color" />
     1126        </div>
     1127        <?php
     1128    }
     1129
     1130    public function message_styles($params, $name_prefix) {
     1131        ?>
     1132        <div class="wbls-style-row">
     1133            <label>Text Font Size</label>
     1134            <input type="text" name="<?php echo esc_attr($name_prefix); ?>font_size" value="<?php echo esc_attr($params['font_size']); ?>">
     1135            <span class="cf7b-um">px</span>
     1136        </div>
     1137        <div class="wbls-style-row">
     1138            <label>Text Font Weight</label>
     1139            <select name="<?php echo esc_attr($name_prefix); ?>font_weight">
     1140                <option value=""></option>
     1141                <option value="normal" <?php echo ($params['font_weight'] == 'normal') ? 'selected' : '' ?>>Normal</option>
     1142                <option value="bold" <?php echo ($params['font_weight'] == 'bold') ? 'selected' : '' ?>>Bold</option>
     1143                <option value="bolder" <?php echo ($params['font_weight'] == 'bolder') ? 'selected' : '' ?>>Bolder</option>
     1144                <option value="lighter" <?php echo ($params['font_weight'] == 'lighter') ? 'selected' : '' ?>>Lighter</option>
     1145                <option value="initial" <?php echo ($params['font_weight'] == 'initial') ? 'selected' : '' ?>>Initial</option>
     1146            </select>
     1147        </div>
     1148        <div class="wbls-style-row">
     1149            <label>Message Background Color</label>
     1150            <input type="text" name="<?php echo esc_attr($name_prefix); ?>bg_color" value="<?php echo esc_attr($params['bg_color']); ?>" class="input_bg_color" />
     1151        </div>
     1152        <div class="wbls-style-row">
     1153            <label>Text Color</label>
     1154            <input type="text" name="<?php echo esc_attr($name_prefix); ?>color" value="<?php echo esc_attr($params['color']); ?>" class="input_color" />
     1155        </div>
     1156        <div class="wbls-style-row">
     1157            <label>Margin</label>
     1158            <input type="text" name="<?php echo esc_attr($name_prefix); ?>margin" value="<?php echo esc_attr($params['margin']); ?>">
     1159            <p class="cf7b-description">Use CSS type values. Ex 5px 3px</p>
     1160        </div>
     1161        <div class="wbls-style-row">
     1162            <label>Padding</label>
     1163            <input type="text" name="<?php echo esc_attr($name_prefix); ?>padding" value="<?php echo esc_attr($params['padding']); ?>">
     1164            <p class="cf7b-description">Use CSS type values. Ex 5px 3px</p>
     1165        </div>
     1166        <div class="wbls-style-row">
     1167            <label>Border Width</label>
     1168            <input type="number" name="<?php echo esc_attr($name_prefix); ?>border_width" min="0" value="<?php echo esc_attr($params['border_width']); ?>">
     1169            <span class="cf7b-um">px</span>
     1170        </div>
     1171        <div class="wbls-style-row">
     1172            <label>Border Type</label>
     1173            <select name="<?php echo esc_attr($name_prefix); ?>border_style">
     1174                <option value="solid" <?php echo ($params['border_style'] == 'solid') ? 'selected' : '' ?>>Solid</option>
     1175                <option value="dotted" <?php echo ($params['border_style'] == 'dotted') ? 'selected' : '' ?>>Dotted</option>
     1176                <option value="dashed" <?php echo ($params['border_style'] == 'dashed') ? 'selected' : '' ?>>Dashed</option>
     1177                <option value="double" <?php echo ($params['border_style'] == 'double') ? 'selected' : '' ?>>Double</option>
     1178                <option value="groove" <?php echo ($params['border_style'] == 'groove') ? 'selected' : '' ?>>Groove</option>
     1179                <option value="ridge" <?php echo ($params['border_style'] == 'ridge') ? 'selected' : '' ?>>Ridge</option>
     1180                <option value="inset" <?php echo ($params['border_style'] == 'inset') ? 'selected' : '' ?>>Inset</option>
     1181                <option value="outset" <?php echo ($params['border_style'] == 'outset') ? 'selected' : '' ?>>Outset</option>
     1182                <option value="initial" <?php echo ($params['border_style'] == 'initial') ? 'selected' : '' ?>>Initial</option>
     1183                <option value="inherit" <?php echo ($params['border_style'] == 'inherit') ? 'selected' : '' ?>>Inherit</option>
     1184            </select>
     1185        </div>
     1186        <div class="wbls-style-row">
     1187            <label>Border Color</label>
     1188            <input type="text" name="<?php echo esc_attr($name_prefix); ?>border_color" value="<?php echo esc_attr($params['border_color']); ?>" class="input_border_color" />
     1189        </div>
     1190        <div class="wbls-style-row">
     1191            <label>Border Radius</label>
     1192            <input type="number" name="<?php echo esc_attr($name_prefix); ?>border_radius" value="<?php echo esc_attr($params['border_radius']); ?>">
     1193            <span class="cf7b-um">px</span>
     1194        </div>
     1195        <div class="wbls-style-row">
     1196            <label>Box Shadow</label>
     1197            <input type="text" name="<?php echo esc_attr($name_prefix); ?>box_shadow" value="<?php echo esc_attr($params['box_shadow']); ?>" placeholder="e.g. 5px 5px 2px #888888">
     1198        </div>
    10911199        <?php
    10921200    }
  • whistleblowing-system/trunk/config.php

    r3434724 r3451009  
    55
    66if (!defined('WBLS_VERSION')) {
    7     define('WBLS_VERSION', '1.4.7');
     7    define('WBLS_VERSION', '1.4.8');
    88}
    99if (!defined('WBLS_PREFIX')) {
  • whistleblowing-system/trunk/frontend/assets/css/default.css

    r3419598 r3451009  
    295295
    296296/* Tab view styles */
    297 
    298297.wbls-form-tab-container .wbls-form-tab {
    299298    width: 50%;
  • whistleblowing-system/trunk/frontend/assets/css/style.css

    r3434724 r3451009  
    923923.wblsform-row-pageButtonNextPrev-container {
    924924    display: flex;
     925    padding: 0 10px;
     926    box-sizing: border-box;
    925927}
    926928
     
    943945.wbls-form-container .wbls-form .wblsform-row-pageButtonNext.wblsform-row-page {
    944946    justify-content: flex-end;
     947}
     948
     949.wbls-form-container .wbls-form button.wbls-next-button,
     950.wbls-form-container .wbls-form button.wbls-previous-button {
     951    cursor: pointer;
    945952}
    946953
     
    13161323    display: flex;
    13171324    justify-content: center;
    1318     align-items: center;
     1325    align-items: stretch; /* Key change */
    13191326}
    13201327
    13211328.wbls-form-tab-container .wbls-form-tab {
     1329    flex: 1;
     1330    display: flex;
     1331    align-items: center;
     1332    justify-content: center;
     1333    text-align: center;
     1334    box-sizing: border-box;
     1335    min-height: 100%;
     1336    white-space: normal; /* Allows text wrapping */
     1337    word-wrap: break-word;
    13221338    width: 50%;
    13231339    height: auto;
     
    16711687}
    16721688
     1689/* Rating default styles */
     1690.wbls-rating {
     1691    display: inline-flex;
     1692    gap: 6px;
     1693    flex-direction: row-reverse;
     1694}
     1695
     1696.wbls-rating input { display: none; }
     1697
     1698/* Numbers */
     1699.wbls-rating--numbers label {
     1700    display: flex;
     1701    align-items: center;
     1702    justify-content: center;
     1703    line-height: 1;
     1704}
     1705
     1706.wbls-rating--numbers label::before {
     1707    content: attr(data-label);
     1708    width: 34px;
     1709    height: 34px;
     1710    background: #bfc1c5;
     1711    border-radius: 6px;
     1712    display: flex;
     1713    align-items: center;
     1714    justify-content: center;
     1715    cursor: pointer;
     1716}
     1717
     1718.wbls-form-container .wbls-form .wbls-rating--numbers label:hover::before,
     1719.wbls-form-container .wbls-form .wbls-rating--numbers label:hover,
     1720.wbls-form-container .wbls-form .wbls-rating--numbers input:checked + label,
     1721.wbls-form-container .wbls-form .wbls-rating--numbers input:checked + label::before {
     1722    background: #000000;
     1723    color: #fff;
     1724}
     1725
     1726/* Stars */
     1727.wbls-rating--stars label::before {
     1728    content: "★";
     1729    font-size: 34px;
     1730    color: #d1d5db;
     1731    cursor: pointer;
     1732}
     1733
     1734.wbls-form-container .wbls-form .wbls-rating--stars label:hover::before,
     1735.wbls-form-container .wbls-form .wbls-rating--stars label:hover ~ label::before,
     1736.wbls-form-container .wbls-form .wbls-rating--stars input:checked ~ label::before,
     1737.wbls-form-container .wbls-form .wbls-rating--stars label:hover,
     1738.wbls-form-container .wbls-form .wbls-rating--stars label:hover ~ label,
     1739.wbls-form-container .wbls-form .wbls-rating--stars input:checked ~ label {
     1740    color: #fbbf24;
     1741}
    16731742
    16741743/* Media */
  • whistleblowing-system/trunk/frontend/frontend.php

    r3434724 r3451009  
    1717    private static $queued_footer_forms = [];
    1818    private static $footer_hook_added = false;
     19
     20    private static $conditions_data = [];
     21    private static $conditions_script_enqueued = false;
    1922
    2023    public function __construct( $attr )
     
    4952
    5053        $file_max_size = isset($this->settings['file_max_size']) ? floatval($this->settings['file_max_size']) : 10;
     54
    5155        $form_conditions = get_post_meta($this->form_id, 'wbls_form_conditions', true);
    52         if ( empty($form_conditions) ) {
    53             $form_conditions = [];
     56        $field_options   = get_post_meta($this->form_id, 'wbls_field_options', true);
     57
     58        if ( ! empty($form_conditions) ) {
     59
     60            // Collect per-form data
     61            self::$conditions_data[ $this->form_id ] = [
     62                    'conditions' => $form_conditions,
     63                    'fields'     => $field_options,
     64            ];
     65
     66            // Enqueue JS ONCE
     67            if ( ! self::$conditions_script_enqueued ) {
     68                wp_enqueue_script(
     69                        'wbls-conditions',
     70                        WBLS_URL . '/frontend/assets/js/conditions.js',
     71                        ['jquery'],
     72                        WBLS_VERSION,
     73                        true
     74                );
     75
     76                self::$conditions_script_enqueued = true;
     77            }
     78
     79            // Localize ONCE in footer
     80            add_action('wp_footer', function () {
     81                if ( ! empty(self::$conditions_data) ) {
     82                    wp_localize_script(
     83                            'wbls-conditions',
     84                            'WBLS_CONDITIONS',
     85                            self::$conditions_data
     86                    );
     87                }
     88            }, 5);
    5489        }
    5590
     
    95130        } else {
    96131            wp_enqueue_style(WBLS_PREFIX . '-theme-style', WBLS_URL . '/frontend/assets/css/default.css', array(), WBLS_VERSION);
    97         }
    98 
    99         $wbls_js_dir = $wp_upload_dir[ 'basedir' ] . '/wbls-system/wbls-codition_' . $this->form_id . '.js';
    100         $wbls_js_url = $wp_upload_dir[ 'baseurl' ] . '/wbls-system/wbls-codition_' . $this->form_id . '.js';
    101         if( file_exists($wbls_js_dir) ) {
    102             wp_enqueue_script( 'wbls-condition_' . $this->form_id, $wbls_js_url, array('jquery'), WBLS_VERSION, true);
    103 
    104132        }
    105133
  • whistleblowing-system/trunk/library.php

    r3434724 r3451009  
    158158                    'style' => array(),
    159159                    'for' => array(),
     160                    'data-label' => array(),
    160161            ),
    161162            'input' => array(
  • whistleblowing-system/trunk/readme.txt

    r3434724 r3451009  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 1.4.7
     7Stable tag: 1.4.8
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    143143
    144144== Changelog ==
     145= 1.4.8 =
     146Added: Rating field (Pro)
     147Changed: Conditional fields logic
     148Changed: Themes page (Pro)
     149
    145150= 1.4.7 =
    146151Added: Full Data encryption
  • whistleblowing-system/trunk/whistleblowing.php

    r3434724 r3451009  
    44 * Plugin URI:  https://whistleblowing-form.de
    55 * Description: Whistleblowing system form is the ultimate solution for effortlessly creating and managing contact and whistleblowing forms.
    6  * Version:     1.4.7
     6 * Version:     1.4.8
    77 * Author:      Whistleblowing System Team
    88 * Author URI:  https://whistleblowing-form.de
Note: See TracChangeset for help on using the changeset viewer.