diff --git a/assets/js/countrySelect.js b/assets/js/countrySelect.js index 7ca92d68..b1228fea 100755 --- a/assets/js/countrySelect.js +++ b/assets/js/countrySelect.js @@ -13,26 +13,26 @@ })(function($, window, document, undefined) { "use strict"; var pluginName = "countrySelect", id = 1, // give each instance its own ID for namespaced event handling - defaults = { - // Default country - defaultCountry: "", - // Position the selected flag inside or outside of the input - defaultStyling: "inside", - // Display only these countries - onlyCountries: [], - // The countries at the top of the list. Defaults to United States and United Kingdom - preferredCountries: [ "us", "gb" ] - }, keys = { - UP: 38, - DOWN: 40, - ENTER: 13, - ESC: 27, - PLUS: 43, - A: 65, - Z: 90 - }, windowLoaded = false; + defaults = { + // Default country + defaultCountry: "", + // Position the selected flag inside or outside of the input + defaultStyling: "inside", + // Display only these countries + onlyCountries: [], + // The countries at the top of the list. Defaults to United States and United Kingdom + preferredCountries: [ "us", "gb" ] + }, keys = { + UP: 38, + DOWN: 40, + ENTER: 13, + ESC: 27, + PLUS: 43, + A: 65, + Z: 90 + }, windowLoaded = false; // keep track of if the window.load event has fired as impossible to check after the fact - $(window).load(function() { + $(window).on('load', function() { windowLoaded = true; }); function Plugin(element, options) { @@ -249,7 +249,7 @@ // decide where to position dropdown (depends on position within viewport, and scroll) _setDropdownPosition: function() { var inputTop = this.countryInput.offset().top, windowTop = $(window).scrollTop(), - dropdownFitsBelow = inputTop + this.countryInput.outerHeight() + this.dropdownHeight < windowTop + $(window).height(), dropdownFitsAbove = inputTop - this.dropdownHeight > windowTop; + dropdownFitsBelow = inputTop + this.countryInput.outerHeight() + this.dropdownHeight < windowTop + $(window).height(), dropdownFitsAbove = inputTop - this.dropdownHeight > windowTop; // dropdownHeight - 1 for border var cssTop = !dropdownFitsBelow && dropdownFitsAbove ? "-" + (this.dropdownHeight - 1) + "px" : ""; this.countryList.css("top", cssTop); @@ -517,8 +517,8 @@ } }; /******************** - * STATIC METHODS - ********************/ + * STATIC METHODS + ********************/ // get the country data object $.fn[pluginName].getCountryData = function() { return allCountries; diff --git a/assets/js/countrySelect.min.js b/assets/js/countrySelect.min.js index 53d0f624..5d0aaa56 100644 --- a/assets/js/countrySelect.min.js +++ b/assets/js/countrySelect.min.js @@ -1 +1 @@ -(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],function($){factory($,window,document)})}else{factory(jQuery,window,document)}})(function($,window,document,undefined){"use strict";var pluginName="countrySelect",id=1,defaults={defaultCountry:"",defaultStyling:"inside",onlyCountries:[],preferredCountries:["us","gb"]},keys={UP:38,DOWN:40,ENTER:13,ESC:27,PLUS:43,A:65,Z:90},windowLoaded=false;$(window).load(function(){windowLoaded=true});function Plugin(element,options){this.element=element;this.options=$.extend({},defaults,options);this._defaults=defaults;this.ns="."+pluginName+id++;this._name=pluginName;this.init()}Plugin.prototype={init:function(){this._processCountryData();this._generateMarkup();this._setInitialState();this._initListeners()},_processCountryData:function(){this._setInstanceCountryData();this._setPreferredCountries()},_setInstanceCountryData:function(){var that=this;if(this.options.onlyCountries.length){var newCountries=[];$.each(this.options.onlyCountries,function(i,countryCode){var countryData=that._getCountryData(countryCode,true);if(countryData){newCountries.push(countryData)}});this.countries=newCountries}else{this.countries=allCountries}},_setPreferredCountries:function(){var that=this;this.preferredCountries=[];$.each(this.options.preferredCountries,function(i,countryCode){var countryData=that._getCountryData(countryCode,false);if(countryData){that.preferredCountries.push(countryData)}})},_generateMarkup:function(){this.countryInput=$(this.element);var mainClass="country-select";if(this.options.defaultStyling){mainClass+=" "+this.options.defaultStyling}this.countryInput.wrap($("
",{"class":mainClass}));var flagsContainer=$("
",{"class":"flag-dropdown"}).insertAfter(this.countryInput);var selectedFlag=$("
",{"class":"selected-flag"}).appendTo(flagsContainer);this.selectedFlagInner=$("
",{"class":"flag"}).appendTo(selectedFlag);$("
",{"class":"arrow"}).appendTo(this.selectedFlagInner);this.countryList=$("
    ",{"class":"country-list v-hide"}).appendTo(flagsContainer);if(this.preferredCountries.length){this._appendListItems(this.preferredCountries,"preferred");$("
  • ",{"class":"divider"}).appendTo(this.countryList)}this._appendListItems(this.countries,"");this.countryCodeInput=$("#"+this.countryInput.attr("id")+"_code");if(!this.countryCodeInput){this.countryCodeInput=$('');this.countryCodeInput.insertAfter(this.countryInput)}this.dropdownHeight=this.countryList.outerHeight();this.countryList.removeClass("v-hide").addClass("hide");this.countryListItems=this.countryList.children(".country")},_appendListItems:function(countries,className){var tmp="";$.each(countries,function(i,c){tmp+='
  • ';tmp+='
    ';tmp+=''+c.name+"";tmp+="
  • "});this.countryList.append(tmp)},_setInitialState:function(){var flagIsSet=false;if(this.countryInput.val()){flagIsSet=this._updateFlagFromInputVal()}var selectedCode=this.countryCodeInput.val();if(selectedCode){this.selectCountry(selectedCode)}if(!flagIsSet){var defaultCountry;if(this.options.defaultCountry){defaultCountry=this._getCountryData(this.options.defaultCountry,false);if(!defaultCountry){defaultCountry=this.preferredCountries.length?this.preferredCountries[0]:this.countries[0]}}else{defaultCountry=this.preferredCountries.length?this.preferredCountries[0]:this.countries[0]}this.selectCountry(defaultCountry.iso2)}},_initListeners:function(){var that=this;this.countryInput.on("keyup"+this.ns,function(){that._updateFlagFromInputVal()});var selectedFlag=this.selectedFlagInner.parent();selectedFlag.on("click"+this.ns,function(e){if(that.countryList.hasClass("hide")&&!that.countryInput.prop("disabled")){that._showDropdown()}});this.countryInput.on("blur"+this.ns,function(){if(that.countryInput.val()!=that.getSelectedCountryData().name){that.setCountry(that.countryInput.val())}that.countryInput.val(that.getSelectedCountryData().name)})},_focus:function(){this.countryInput.focus();var input=this.countryInput[0];if(input.setSelectionRange){var len=this.countryInput.val().length;input.setSelectionRange(len,len)}},_showDropdown:function(){this._setDropdownPosition();var activeListItem=this.countryList.children(".active");this._highlightListItem(activeListItem);this.countryList.removeClass("hide");this._scrollTo(activeListItem);this._bindDropdownListeners();this.selectedFlagInner.children(".arrow").addClass("up")},_setDropdownPosition:function(){var inputTop=this.countryInput.offset().top,windowTop=$(window).scrollTop(),dropdownFitsBelow=inputTop+this.countryInput.outerHeight()+this.dropdownHeightwindowTop;var cssTop=!dropdownFitsBelow&&dropdownFitsAbove?"-"+(this.dropdownHeight-1)+"px":"";this.countryList.css("top",cssTop)},_bindDropdownListeners:function(){var that=this;this.countryList.on("mouseover"+this.ns,".country",function(e){that._highlightListItem($(this))});this.countryList.on("click"+this.ns,".country",function(e){that._selectListItem($(this))});var isOpening=true;$("html").on("click"+this.ns,function(e){if(!isOpening){that._closeDropdown()}isOpening=false});$(document).on("keydown"+this.ns,function(e){e.preventDefault();if(e.which==keys.UP||e.which==keys.DOWN){that._handleUpDownKey(e.which)}else if(e.which==keys.ENTER){that._handleEnterKey()}else if(e.which==keys.ESC){that._closeDropdown()}else if(e.which>=keys.A&&e.which<=keys.Z){that._handleLetterKey(e.which)}})},_handleUpDownKey:function(key){var current=this.countryList.children(".highlight").first();var next=key==keys.UP?current.prev():current.next();if(next.length){if(next.hasClass("divider")){next=key==keys.UP?next.prev():next.next()}this._highlightListItem(next);this._scrollTo(next)}},_handleEnterKey:function(){var currentCountry=this.countryList.children(".highlight").first();if(currentCountry.length){this._selectListItem(currentCountry)}},_handleLetterKey:function(key){var letter=String.fromCharCode(key);var countries=this.countryListItems.filter(function(){return $(this).text().charAt(0)==letter&&!$(this).hasClass("preferred")});if(countries.length){var highlightedCountry=countries.filter(".highlight").first(),listItem;if(highlightedCountry&&highlightedCountry.next()&&highlightedCountry.next().text().charAt(0)==letter){listItem=highlightedCountry.next()}else{listItem=countries.first()}this._highlightListItem(listItem);this._scrollTo(listItem)}},_updateFlagFromInputVal:function(){var that=this;var value=this.countryInput.val().replace(/(?=[() ])/g,"\\");if(value){var countryCodes=[];var matcher=new RegExp("^"+value,"i");for(var i=0;icontainerBottom){var heightDifference=containerHeight-elementHeight;container.scrollTop(newScrollTop-heightDifference)}},_updateName:function(countryCode){this.countryCodeInput.val(countryCode).trigger("change");this.countryInput.val(this._getCountryData(countryCode).name)},getSelectedCountryData:function(){var countryCode=this.selectedFlagInner.attr("class").split(" ")[1];return this._getCountryData(countryCode)},selectCountry:function(countryCode){countryCode=countryCode.toLowerCase();if(!this.selectedFlagInner.hasClass(countryCode)){this._selectFlag(countryCode);this._updateName(countryCode)}},setCountry:function(country){this.countryInput.val(country);this._updateFlagFromInputVal()},destroy:function(){this.countryInput.off(this.ns);this.selectedFlagInner.parent().off(this.ns);var container=this.countryInput.parent();container.before(this.countryInput).remove()}};$.fn[pluginName]=function(options){var args=arguments;if(options===undefined||typeof options==="object"){return this.each(function(){if(!$.data(this,"plugin_"+pluginName)){$.data(this,"plugin_"+pluginName,new Plugin(this,options))}})}else if(typeof options==="string"&&options[0]!=="_"&&options!=="init"){var returns;this.each(function(){var instance=$.data(this,"plugin_"+pluginName);if(instance instanceof Plugin&&typeof instance[options]==="function"){returns=instance[options].apply(instance,Array.prototype.slice.call(args,1))}if(options==="destroy"){$.data(this,"plugin_"+pluginName,null)}});return returns!==undefined?returns:this}};$.fn[pluginName].getCountryData=function(){return allCountries};$.fn[pluginName].setCountryData=function(obj){allCountries=obj};var ii=0;var cc=[];var allCountries=$.each(uwp_country_data,function(i,c){cc[ii]={name:c,iso2:i};ii++});allCountries=cc}); \ No newline at end of file +!function(t){"function"==typeof define&&define.amd?define(["jquery"],function(n){t(n,window,document)}):t(jQuery,window,document)}(function(t,n,e,i){"use strict";function s(n,e){this.element=n,this.options=t.extend({},h,e),this._defaults=h,this.ns="."+r+o++,this._name=r,this.init()}var r="countrySelect",o=1,h={defaultCountry:"",defaultStyling:"inside",onlyCountries:[],preferredCountries:["us","gb"]},a={UP:38,DOWN:40,ENTER:13,ESC:27,PLUS:43,A:65,Z:90},u=!1;t(n).on("load",function(){u=!0}),s.prototype={init:function(){this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners()},_processCountryData:function(){this._setInstanceCountryData(),this._setPreferredCountries()},_setInstanceCountryData:function(){var n=this;if(this.options.onlyCountries.length){var e=[];t.each(this.options.onlyCountries,function(t,i){var s=n._getCountryData(i,!0);s&&e.push(s)}),this.countries=e}else this.countries=d},_setPreferredCountries:function(){var n=this;this.preferredCountries=[],t.each(this.options.preferredCountries,function(t,e){var i=n._getCountryData(e,!1);i&&n.preferredCountries.push(i)})},_generateMarkup:function(){this.countryInput=t(this.element);var n="country-select";this.options.defaultStyling&&(n+=" "+this.options.defaultStyling),this.countryInput.wrap(t("
    ",{class:n}));var e=t("
    ",{class:"flag-dropdown"}).insertAfter(this.countryInput),i=t("
    ",{class:"selected-flag"}).appendTo(e);this.selectedFlagInner=t("
    ",{class:"flag"}).appendTo(i),t("
    ",{class:"arrow"}).appendTo(this.selectedFlagInner),this.countryList=t("
      ",{class:"country-list v-hide"}).appendTo(e),this.preferredCountries.length&&(this._appendListItems(this.preferredCountries,"preferred"),t("
    • ",{class:"divider"}).appendTo(this.countryList)),this._appendListItems(this.countries,""),this.countryCodeInput=t("#"+this.countryInput.attr("id")+"_code"),this.countryCodeInput||(this.countryCodeInput=t(''),this.countryCodeInput.insertAfter(this.countryInput)),this.dropdownHeight=this.countryList.outerHeight(),this.countryList.removeClass("v-hide").addClass("hide"),this.countryListItems=this.countryList.children(".country")},_appendListItems:function(n,e){var i="";t.each(n,function(t,n){i+='
    • ',i+='
      ',i+=''+n.name+"",i+="
    • "}),this.countryList.append(i)},_setInitialState:function(){var t=!1;this.countryInput.val()&&(t=this._updateFlagFromInputVal());var n=this.countryCodeInput.val();if(n&&this.selectCountry(n),!t){var e;this.options.defaultCountry?(e=this._getCountryData(this.options.defaultCountry,!1))||(e=this.preferredCountries.length?this.preferredCountries[0]:this.countries[0]):e=this.preferredCountries.length?this.preferredCountries[0]:this.countries[0],this.selectCountry(e.iso2)}},_initListeners:function(){var t=this;this.countryInput.on("keyup"+this.ns,function(){t._updateFlagFromInputVal()});this.selectedFlagInner.parent().on("click"+this.ns,function(n){t.countryList.hasClass("hide")&&!t.countryInput.prop("disabled")&&t._showDropdown()}),this.countryInput.on("blur"+this.ns,function(){t.countryInput.val()!=t.getSelectedCountryData().name&&t.setCountry(t.countryInput.val()),t.countryInput.val(t.getSelectedCountryData().name)})},_focus:function(){this.countryInput.focus();var t=this.countryInput[0];if(t.setSelectionRange){var n=this.countryInput.val().length;t.setSelectionRange(n,n)}},_showDropdown:function(){this._setDropdownPosition();var t=this.countryList.children(".active");this._highlightListItem(t),this.countryList.removeClass("hide"),this._scrollTo(t),this._bindDropdownListeners(),this.selectedFlagInner.children(".arrow").addClass("up")},_setDropdownPosition:function(){var e=this.countryInput.offset().top,i=t(n).scrollTop(),s=e+this.countryInput.outerHeight()+this.dropdownHeighti,o=!s&&r?"-"+(this.dropdownHeight-1)+"px":"";this.countryList.css("top",o)},_bindDropdownListeners:function(){var n=this;this.countryList.on("mouseover"+this.ns,".country",function(e){n._highlightListItem(t(this))}),this.countryList.on("click"+this.ns,".country",function(e){n._selectListItem(t(this))});var i=!0;t("html").on("click"+this.ns,function(t){i||n._closeDropdown(),i=!1}),t(e).on("keydown"+this.ns,function(t){t.preventDefault(),t.which==a.UP||t.which==a.DOWN?n._handleUpDownKey(t.which):t.which==a.ENTER?n._handleEnterKey():t.which==a.ESC?n._closeDropdown():t.which>=a.A&&t.which<=a.Z&&n._handleLetterKey(t.which)})},_handleUpDownKey:function(t){var n=this.countryList.children(".highlight").first(),e=t==a.UP?n.prev():n.next();e.length&&(e.hasClass("divider")&&(e=t==a.UP?e.prev():e.next()),this._highlightListItem(e),this._scrollTo(e))},_handleEnterKey:function(){var t=this.countryList.children(".highlight").first();t.length&&this._selectListItem(t)},_handleLetterKey:function(n){var e=String.fromCharCode(n),i=this.countryListItems.filter(function(){return t(this).text().charAt(0)==e&&!t(this).hasClass("preferred")});if(i.length){var s,r=i.filter(".highlight").first();s=r&&r.next()&&r.next().text().charAt(0)==e?r.next():i.first(),this._highlightListItem(s),this._scrollTo(s)}},_updateFlagFromInputVal:function(){var n=this,e=this.countryInput.val().replace(/(?=[() ])/g,"\\");if(e){for(var i=[],s=new RegExp("^"+e,"i"),r=0;rs){var u=e-r;n.scrollTop(a-u)}}},_updateName:function(t){this.countryCodeInput.val(t).trigger("change"),this.countryInput.val(this._getCountryData(t).name)},getSelectedCountryData:function(){var t=this.selectedFlagInner.attr("class").split(" ")[1];return this._getCountryData(t)},selectCountry:function(t){t=t.toLowerCase(),this.selectedFlagInner.hasClass(t)||(this._selectFlag(t),this._updateName(t))},setCountry:function(t){this.countryInput.val(t),this._updateFlagFromInputVal()},destroy:function(){this.countryInput.off(this.ns),this.selectedFlagInner.parent().off(this.ns);this.countryInput.parent().before(this.countryInput).remove()}},t.fn[r]=function(n){var e=arguments;if(n===i||"object"==typeof n)return this.each(function(){t.data(this,"plugin_"+r)||t.data(this,"plugin_"+r,new s(this,n))});if("string"==typeof n&&"_"!==n[0]&&"init"!==n){var o;return this.each(function(){var i=t.data(this,"plugin_"+r);i instanceof s&&"function"==typeof i[n]&&(o=i[n].apply(i,Array.prototype.slice.call(e,1))),"destroy"===n&&t.data(this,"plugin_"+r,null)}),o!==i?o:this}},t.fn[r].getCountryData=function(){return d},t.fn[r].setCountryData=function(t){d=t};var c=0,l=[],d=t.each(uwp_country_data,function(t,n){l[c]={name:n,iso2:t},c++});d=l}); \ No newline at end of file diff --git a/assets/js/users-wp.js b/assets/js/users-wp.js index cf4e1dc9..f2b07f91 100644 --- a/assets/js/users-wp.js +++ b/assets/js/users-wp.js @@ -1,5 +1,4 @@ jQuery(window).on('load',function () { - // Enable auth modals uwp_init_auth_modal();uwp_switch_reg_form_init(); }); @@ -28,7 +27,7 @@ jQuery(window).on('load',function () { }); - $(".uwp_more_link").click(function(){ + $(".uwp_more_link").on('click', function(){ if($(this).hasClass("uwp_less")) { $(this).removeClass("uwp_less"); $(this).html(moretext); @@ -255,8 +254,8 @@ function uwp_init_auth_modal(){ // open login form if(uwp_localize_data.login_modal) { - jQuery('.users-wp-login-nav a, .uwp-login-link').unbind('click'); - jQuery(".users-wp-login-nav a, .uwp-login-link").click(function (e) { + jQuery('.users-wp-login-nav a, .uwp-login-link').off('click'); + jQuery(".users-wp-login-nav a, .uwp-login-link").on('click', function (e) { uwp_cancelBubble(e); uwp_modal_login_form(); return false; @@ -265,8 +264,8 @@ function uwp_init_auth_modal(){ // open the register form if(uwp_localize_data.register_modal) { - jQuery('.users-wp-register-nav a, .uwp-register-link').unbind('click'); - jQuery(".users-wp-register-nav a, .uwp-register-link").click(function (e) { + jQuery('.users-wp-register-nav a, .uwp-register-link').off('click'); + jQuery(".users-wp-register-nav a, .uwp-register-link").on('click', function (e) { uwp_cancelBubble(e); uwp_modal_register_form(); return false; @@ -275,8 +274,8 @@ function uwp_init_auth_modal(){ // open the forgot password form if(uwp_localize_data.forgot_modal) { - jQuery('.users-wp-forgot-nav a, .uwp-forgot-password-link').unbind('click'); - jQuery(".users-wp-forgot-nav a, .uwp-forgot-password-link").click(function (e) { + jQuery('.users-wp-forgot-nav a, .uwp-forgot-password-link').off('click'); + jQuery(".users-wp-forgot-nav a, .uwp-forgot-password-link").on('click', function (e) { uwp_cancelBubble(e); uwp_modal_forgot_password_form(); return false; @@ -538,7 +537,7 @@ function uwp_switch_reg_form_init() { var form_id = self.attr('data-form_id'); var form = self.parents('form'); jQuery('#uwp-form-select a').removeClass('active'); - + var data = { 'action': 'uwp_ajax_register_form', // deliberately no nonce for caching reasons 'form_id': form_id, @@ -566,12 +565,12 @@ function uwp_switch_reg_form_init() { var $returnedForm = jQuery(data.data).find('form'); var $formSelector = form.find('#uwp-form-select'); - + form.html($returnedForm.html()); if (!$returnedForm.find('#uwp-form-select').length && !$returnedForm.find('#uwp-form-select-ajax').length && $formSelector) { form.prepend($formSelector); - } + } form.find('#uwp-form-select-ajax').attr('id', 'uwp-form-select'); } diff --git a/assets/js/users-wp.min.js b/assets/js/users-wp.min.js index c34526f5..ee6db18a 100644 --- a/assets/js/users-wp.min.js +++ b/assets/js/users-wp.min.js @@ -1 +1 @@ -jQuery(window).on("load",function(){uwp_init_auth_modal();uwp_switch_reg_form_init()});(function($,window,undefined){$(document).ready(function(){var showChar=uwp_localize_data.uwp_more_char_limit;var ellipsestext=uwp_localize_data.uwp_more_ellipses_text;var moretext=uwp_localize_data.uwp_more_text;var lesstext=uwp_localize_data.uwp_less_text;$(".uwp_more").each(function(){var content=$.trim($(this).text());var length=$(this).data("maxchar");if(length>0){showChar=length}if(content.length>showChar){var c=content.substr(0,showChar);var h=content.substr(showChar,content.length-showChar);var html=uwp_nl2br(c)+''+ellipsestext+' '+uwp_nl2br(h)+'  '+moretext+"";$(this).html(html)}});$(".uwp_more_link").click(function(){if($(this).hasClass("uwp_less")){$(this).removeClass("uwp_less");$(this).html(moretext)}else{$(this).addClass("uwp_less");$(this).html(lesstext)}$(this).parent().prev().toggle();$(this).prev().toggle();return false});if(typeof Storage!=="undefined"){var $storage_key="uwp_list_view";var $list=jQuery(".uwp-users-loop > .row");if(!$list.length){$list=jQuery(".uwp-profile-cpt-loop > .row");$storage_key="uwp_cpt_list_view"}var $noStore=false;var uwp_list_view=localStorage.getItem($storage_key);setTimeout(function(){if(!uwp_list_view){$noStore=true;if($list.hasClass("row-cols-md-0")){uwp_list_view=0}else if($list.hasClass("row-cols-md-1")){uwp_list_view=1}else if($list.hasClass("row-cols-md-2")){uwp_list_view=2}else if($list.hasClass("row-cols-md-3")){uwp_list_view=3}else if($list.hasClass("row-cols-md-4")){uwp_list_view=4}else if($list.hasClass("row-cols-md-5")){uwp_list_view=5}else{uwp_list_view=3}}uwp_list_view_select(uwp_list_view,$noStore)},10)}})})(jQuery,window);(function($,window,undefined){var uwp_popup_type;$(document).ready(function(){$(".uwp-profile-modal-form-trigger").on("click",function(event){event.preventDefault();uwp_popup_type=$(this).data("type");var data={action:"uwp_ajax_image_crop_popup_form",type:uwp_popup_type};var container=jQuery("#uwp-popup-modal-wrap");container.show();jQuery.post(uwp_localize_data.ajaxurl,data,function(response){$(document.body).append("
      ");container.replaceWith(response)})})});$(document).ready(function(){$(".uwp_upload_file_remove").on("click",function(event){event.preventDefault();var htmlvar=$(this).data("htmlvar");var uid=$(this).data("uid");var data={action:"uwp_upload_file_remove",htmlvar:htmlvar,uid:uid,security:uwp_localize_data.basicNonce};jQuery.ajax({url:uwp_localize_data.ajaxurl,type:"POST",data:data,dataType:"json"}).done(function(res,textStatus,jqXHR){if(typeof res=="object"&&res.success){$("#"+htmlvar+"_row").find(".uwp_file_preview_wrap").remove();$("#"+htmlvar).closest("td").find(".uwp_file_preview_wrap").remove();if($("input[name="+htmlvar+"]").data("is-required")){$("input[name="+htmlvar+"]").prop("required",true)}}})})})})(jQuery,window);(function($,window,undefined){$(document).ready(function(){$("#uwp_layout").on("change",function(){var layout=$(this).val();var container=$("#uwp_user_items_layout");container.removeClass();if(layout=="list"){container.addClass("uwp-users-list-wrap uwp_listview")}else if(layout=="2col"){container.addClass("uwp-users-list-wrap uwp_gridview uwp_gridview_2col")}else if(layout=="3col"){container.addClass("uwp-users-list-wrap uwp_gridview uwp_gridview_3col")}else if(layout=="4col"){container.addClass("uwp-users-list-wrap uwp_gridview uwp_gridview_4col")}else if(layout=="5col"){container.addClass("uwp-users-list-wrap uwp_gridview uwp_gridview_5col")}else{container.addClass("uwp-users-list-wrap uwp_listview")}});jQuery(document).ready(function($){$("#uwp_login_modal form.uwp-login-form").on("submit",function(e){e.preventDefault();uwp_ajax_login(this)})});function uwp_ajax_login($this){$("#uwp_login_modal .uwp-login-ajax-notice").remove();var data=jQuery($this).serialize()+"&action=uwp_ajax_login";jQuery.post(uwp_localize_data.ajaxurl,data,function(response){response=jQuery.parseJSON(response);if(response.error){$("#uwp_login_modal form.uwp-login-form").before(response.message)}else{$("#uwp_login_modal form.uwp-login-form").before(response.message);setTimeout(function(){location.reload()},1200)}})}})})(jQuery,window);function uwp_nl2br(str,is_xhtml){var breakTag=is_xhtml||typeof is_xhtml==="undefined"?"
      ":"
      ";return(str+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+breakTag+"$2")}function uwp_list_view_select($val,$noStore){var $storage_key="uwp_list_view";var $list=jQuery(".uwp-users-loop > .row");if(!$list.length){$list=jQuery(".uwp-profile-cpt-loop > .row");$storage_key="uwp_cpt_list_view"}var $listSelect=jQuery(".uwp-list-view-select");if($val==0){$list.removeClass("row-cols-sm-2 row-cols-md-2 row-cols-md-3 row-cols-md-4 row-cols-md-5").addClass("row-cols-md-0");$listSelect.find("button").removeClass("active");$listSelect.find("button.uwp-list-view-select-list").addClass("active")}else{$listSelect.find("button").removeClass("active");$listSelect.find("button.uwp-list-view-select-grid").addClass("active");$listSelect.find('button[data-gridview="'+$val+'"]').addClass("active");$list.removeClass("row-cols-md-0 row-cols-md-2 row-cols-md-3 row-cols-md-4 row-cols-md-5").addClass("row-cols-sm-2 row-cols-md-"+$val)}if(!$noStore){localStorage.setItem($storage_key,$val)}}function uwp_profile_image_change(type){jQuery(".uwp-profile-image-change-modal").remove();var $modal='';jQuery("body").append($modal);if(window.bootstrap&&window.bootstrap.Modal){var authModal=new window.bootstrap.Modal(document.querySelector(".uwp-profile-image-change-modal"));authModal.show()}else{jQuery(".uwp-profile-image-change-modal").modal({backdrop:"static"})}var data={action:"uwp_ajax_image_crop_popup_form",type:type,style:"bootstrap"};jQuery.post(uwp_localize_data.ajaxurl,data,function(response){jQuery(".uwp-profile-image-change-modal .modal-content").html(response)})}function uwp_init_auth_modal(){if(uwp_localize_data.login_modal){jQuery(".users-wp-login-nav a, .uwp-login-link").unbind("click");jQuery(".users-wp-login-nav a, .uwp-login-link").click(function(e){uwp_cancelBubble(e);uwp_modal_login_form();return false})}if(uwp_localize_data.register_modal){jQuery(".users-wp-register-nav a, .uwp-register-link").unbind("click");jQuery(".users-wp-register-nav a, .uwp-register-link").click(function(e){uwp_cancelBubble(e);uwp_modal_register_form();return false})}if(uwp_localize_data.forgot_modal){jQuery(".users-wp-forgot-nav a, .uwp-forgot-password-link").unbind("click");jQuery(".users-wp-forgot-nav a, .uwp-forgot-password-link").click(function(e){uwp_cancelBubble(e);uwp_modal_forgot_password_form();return false})}}function uwp_modal_loading(inputs){$input_single=' ';$inputs=inputs?$input_single.repeat(inputs):$input_single;var $modal_content=''+'";var $modal='";if(!jQuery(".uwp-auth-modal").length){jQuery("body").append($modal)}else{jQuery(".uwp-auth-modal .modal-content").html($modal_content)}jQuery(".modal-backdrop").remove();if(window.bootstrap&&window.bootstrap.Modal){var authModal=new window.bootstrap.Modal(document.querySelector(".uwp-auth-modal"));authModal.show()}else{jQuery(".uwp-auth-modal").modal()}}function uwp_modal_login_form(){var data={action:"uwp_ajax_login_form"};jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:data,beforeSend:function(){uwp_modal_loading(4)},success:function(data){if(data.success){jQuery(".uwp-auth-modal .modal-content").html(data.data);setTimeout(function(){jQuery(".uwp-auth-modal .modal-content input:visible:enabled:first").focus().unbind("focus")},300);jQuery(".uwp-auth-modal .modal-content form.uwp-login-form").on("submit",function(e){e.preventDefault(e);uwp_modal_login_form_process()})}uwp_init_auth_modal()}})}function uwp_maybe_check_recaptcha($form){if(typeof uwp_recaptcha_loops==="undefined"||!uwp_recaptcha_loops){uwp_recaptcha_loops=1}if(jQuery(".uwp-auth-modal .modal-content .g-recaptcha-response").length&&jQuery(".uwp-auth-modal .modal-content .g-recaptcha-response").val()==""){setTimeout(function(){jQuery('.uwp-auth-modal .modal-content button[type="submit"] i.fa-spin,.uwp-auth-modal .modal-content button[type="submit"] svg.fa-spin').remove();if(uwp_recaptcha_loops>=6){jQuery(".uwp-auth-modal .modal-content .uwp_login_submit").prop("disabled",false);jQuery(".uwp-auth-modal .modal-content .uwp_register_submit").prop("disabled",false);jQuery(".uwp-auth-modal .modal-content .uwp_forgot_submit").prop("disabled",false);jQuery(".uwp-auth-modal .modal-content .uwp-captcha-render").addClass("alert alert-danger");if(jQuery(".uwp-auth-modal .modal-content .modal-error").html()==""){jQuery(".uwp-auth-modal .modal-content .modal-error").html("
      "+uwp_localize_data.error_retry+"
      ")}return false}if($form=="login"){uwp_modal_login_form_process()}else if($form=="register"){uwp_modal_register_form_process()}else if($form=="forgot"){uwp_modal_forgot_password_form_process()}},500);uwp_recaptcha_loops++;return false}uwp_recaptcha_loops=0;return true}function uwp_maybe_reset_recaptcha(){if(jQuery(".uwp-auth-modal .modal-content .g-recaptcha-response").length){var id=jQuery(".uwp-auth-modal .modal-content .g-recaptcha-response").attr("id");uwp_reset_captcha(id)}document.dispatchEvent(new Event("ayecode_reset_captcha"))}function uwp_modal_login_form_process(){var data=jQuery(".modal-content form.uwp-login-form").serialize()+"&action=uwp_ajax_login";$button_text=jQuery(".uwp-auth-modal .modal-content .uwp_login_submit").html();jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:data,beforeSend:function(){jQuery(".uwp-auth-modal .modal-content .uwp_login_submit").html(' '+$button_text).prop("disabled",true);jQuery(".uwp-auth-modal .modal-content .modal-error").html("");return uwp_maybe_check_recaptcha("login")},success:function(data){if(data.success==true){jQuery(".uwp-auth-modal .modal-content .uwp_login_submit").html($button_text).prop("disabled",true);jQuery(".uwp-auth-modal .modal-content .modal-error").html(data.data.message);if(data.data.is_2fa){jQuery(".modal-content form.uwp-login-form").replaceWith(data.data.html);jQuery(".uwp-auth-modal .modal-content form.validate_2fa_form").on("submit",function(e){e.preventDefault(e);uwp_modal_login_form_2fa_process("form.validate_2fa_form","")});jQuery(".uwp-auth-modal .modal-content form.validate_2fa_backup_codes_form").on("submit",function(e){e.preventDefault(e);uwp_modal_login_form_2fa_process("form.validate_2fa_backup_codes_form","")});jQuery(".uwp-auth-modal .modal-content .uwp-2fa-email-resend").on("click",function(e){e.preventDefault(e);uwp_modal_login_form_2fa_process("form.validate_2fa_form","&wp-2fa-email-code-resend=1")})}else{if(data.data.redirect){setTimeout(function(){location.href=data.data.redirect},1e3)}else{setTimeout(function(){location.reload()},1e3)}}}else if(data.success===false){jQuery(".uwp-auth-modal .modal-content .modal-error").html(data.data.message);jQuery(".uwp-auth-modal .modal-content .uwp_login_submit").html($button_text).prop("disabled",false);uwp_maybe_reset_recaptcha()}uwp_init_auth_modal()}})}function uwp_modal_login_form_2fa_process(type,fields){var data=jQuery(".modal-content "+type).serialize()+"&action=uwp_ajax_login_process_2fa"+fields;$button=jQuery(".uwp-auth-modal .modal-content "+type).find(".uwp-2fa-submit");$button_text=$button.html();jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:data,beforeSend:function(){$button.html(' '+$button_text).prop("disabled",true);jQuery(".uwp-auth-modal .modal-content .modal-error").html("")},success:function(data){if(data.success==true){$button.html($button_text).prop("disabled",true);jQuery(".uwp-auth-modal .modal-content .modal-error").html(data.data.message);if(data.data.redirect){setTimeout(function(){location.href=data.data.redirect},1e3)}else{setTimeout(function(){location.reload()},1e3)}}else if(data.success===false){jQuery(".uwp-auth-modal .modal-content .modal-error").html(data.data.message);$button.html($button_text).prop("disabled",false)}uwp_init_auth_modal()}})}function uwp_modal_register_form(form_id){var data={action:"uwp_ajax_register_form",form_id:form_id};jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:data,beforeSend:function(){uwp_modal_loading(6)},success:function(data){if(data.success){jQuery(".uwp-auth-modal .modal-content").html(data.data);setTimeout(function(){jQuery(".uwp-auth-modal .modal-content input:visible:enabled:first").focus().unbind("focus")},300);jQuery(".uwp-auth-modal .modal-content form.uwp-registration-form").submit(function(e){e.preventDefault(e);uwp_modal_register_form_process()})}uwp_init_auth_modal();aui_init_select2();uwp_switch_reg_form_init();aui_init()}})}function uwp_switch_reg_form_init(){jQuery("#uwp-form-select-ajax a").on("click",function(e){e.preventDefault(e);var form_id=jQuery(this).attr("data-form_id");uwp_modal_register_form(form_id)});jQuery("#uwp-form-select a").on("click",function(e){e.preventDefault(e);var self=jQuery(this);var form_id=self.attr("data-form_id");var form=self.parents("form");jQuery("#uwp-form-select a").removeClass("active");var data={action:"uwp_ajax_register_form",form_id:form_id};jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:data,beforeSend:function(){self.addClass("active");var $inputDivs=form.find("input, select, textarea");var $placeholder='
       
      ';$inputDivs.each(function(){jQuery(this).replaceWith($placeholder)});form.children().not(".badge, #uwp-form-select").remove()},success:function(data){if(data.success){var $returnedForm=jQuery(data.data).find("form");var $formSelector=form.find("#uwp-form-select");form.html($returnedForm.html());if(!$returnedForm.find("#uwp-form-select").length&&!$returnedForm.find("#uwp-form-select-ajax").length&&$formSelector){form.prepend($formSelector)}form.find("#uwp-form-select-ajax").attr("id","uwp-form-select")}uwp_init_auth_modal();aui_init_select2();uwp_switch_reg_form_init()}})})}function uwp_modal_register_form_process(){var data=jQuery(".modal-content form.uwp-registration-form").serialize()+"&action=uwp_ajax_register";$button=jQuery(".uwp-auth-modal .modal-content .uwp_register_submit");$button_text=$button.html();jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:data,beforeSend:function(){$button.html(' '+$button_text).prop("disabled",true);jQuery(".uwp-auth-modal .modal-content .modal-error").html("");return uwp_maybe_check_recaptcha("register")},success:function(data){if(data.success){$button.html($button_text).prop("disabled",true);if(data.data.message){jQuery(".uwp-auth-modal .modal-content .modal-error").html(data.data.message);jQuery(".modal-content form.uwp-registration-form").trigger("reset");setTimeout(function(){if(data.data.redirect){window.location=data.data.redirect}else{location.reload()}},1e3)}else{jQuery(".uwp-auth-modal .modal-content .modal-error").html(data.data.message)}}else if(data.success===false){jQuery(".uwp-auth-modal .modal-content .modal-error").html(data.data.message);$button.html($button_text).prop("disabled",false);uwp_maybe_reset_recaptcha()}uwp_init_auth_modal();aui_init_select2();uwp_switch_reg_form_init()}})}function uwp_modal_forgot_password_form(){var data={action:"uwp_ajax_forgot_password_form"};jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:data,beforeSend:function(){uwp_modal_loading(2)},success:function(data){if(data.success){jQuery(".uwp-auth-modal .modal-content").html(data.data);setTimeout(function(){jQuery(".uwp-auth-modal .modal-content input:visible:enabled:first").focus().unbind("focus")},300);jQuery(".uwp-auth-modal .modal-content form.uwp-forgot-form").on("submit",function(e){e.preventDefault(e);uwp_modal_forgot_password_form_process()})}uwp_init_auth_modal()}})}function uwp_modal_forgot_password_form_process(){var data=jQuery(".modal-content form.uwp-forgot-form").serialize()+"&action=uwp_ajax_forgot_password";$button=jQuery(".uwp-auth-modal .modal-content .uwp_forgot_submit");$button_text=$button.html();jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:data,beforeSend:function(){$button.html(' '+$button_text).prop("disabled",true);jQuery(".uwp-auth-modal .modal-content .modal-error").html("");return uwp_maybe_check_recaptcha("forgot")},success:function(data){if(data.success){$button.html($button_text).prop("disabled",true);jQuery(".uwp-auth-modal .modal-content .modal-error").html(data.data)}else if(data.success===false){jQuery(".uwp-auth-modal .modal-content .modal-error").html(data.data);$button.html($button_text).prop("disabled",false);uwp_maybe_reset_recaptcha()}uwp_init_auth_modal()}})}function uwp_checkPasswordStrength($pass1,$pass2,$strengthResult,$submitButton,blacklistArray){var pass1=$pass1.val();var pass2=$pass2.val();if(!jQuery("#uwp-password-strength").length&&pass1){if($pass2.length){$container=$pass2.closest(".uwp-password-wrap")}else{$container=$pass1.closest(".uwp-password-wrap")}$container.append('
      ');$strengthResult=jQuery("#uwp-password-strength")}else if(!pass1&&!pass2){$strengthResult.parent().remove()}if(parseInt(uwp_localize_data.uwp_pass_strength)>0){$submitButton.attr("disabled","disabled")}$strengthResult.removeClass("short bad good strong bg-warning bg-success bg-danger");blacklistArray=blacklistArray.concat(wp.passwordStrength.userInputDisallowedList());var strength=wp.passwordStrength.meter(pass1,blacklistArray,pass2);switch(strength){case-1:$strengthResult.addClass("short bg-danger").html(pwsL10n.unknown);break;case 2:$strengthResult.addClass("bad bg-warning").html(pwsL10n.bad).width("50%");break;case 3:$strengthResult.addClass("good bg-success").html(pwsL10n.good).width("75%");break;case 4:$strengthResult.addClass("strong bg-success").html(pwsL10n.strong).width("100%");break;case 5:$strengthResult.addClass("short bg-danger").html(pwsL10n.mismatch).width("25%");break;default:$strengthResult.addClass("short bg-danger").html(pwsL10n.short).width("25%")}if(parseInt(uwp_localize_data.uwp_pass_strength)>0){if($pass2.length){$container=$pass2.closest(".uwp-password-wrap")}else{$container=$pass1.closest(".uwp-password-wrap")}$container.find("small").remove();if(4==parseInt(uwp_localize_data.uwp_pass_strength)&&strength===4){$submitButton.removeAttr("disabled")}else if(3==parseInt(uwp_localize_data.uwp_pass_strength)&&(strength===3||strength===4)){$submitButton.removeAttr("disabled")}else{$container.append(""+uwp_localize_data.uwp_strong_pass_msg+"")}}return strength}function uwp_cancelBubble(e){var evt=e?e:window.event;if(evt.stopPropagation)evt.stopPropagation();if(evt.cancelBubble!=null)evt.cancelBubble=true}function uwp_gd_delete_post($post_id){var message=geodir_params.my_place_listing_del;if(confirm(message)){jQuery.ajax({url:uwp_localize_data.ajaxurl,type:"POST",dataType:"json",data:{action:"geodir_user_delete_post",security:geodir_params.basic_nonce,post_id:$post_id},timeout:2e4,success:function(data){if(data.success){var $modal_content='
      '+data.data.message+"
      "}else{var $modal_content='
      '+data.data.message+"
      "}var $modal='";if(!jQuery(".uwp-gd-modal").length){jQuery("body").append($modal)}else{jQuery(".uwp-gd-modal .modal-content").html($modal_content)}if(window.bootstrap&&window.bootstrap.Modal){var authModal=new window.bootstrap.Modal(document.querySelector(".uwp-gd-modal"));authModal.show()}else{jQuery(".uwp-gd-modal").modal()}if(data.success){setTimeout(function(){location.reload()},3e3)}}});return true}else{return false}} \ No newline at end of file +function uwp_nl2br(a,e){return(a+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+(e||void 0===e?"
      ":"
      ")+"$2")}function uwp_list_view_select(a,e){var t="uwp_list_view",o=jQuery(".uwp-users-loop > .row");o.length||(o=jQuery(".uwp-profile-cpt-loop > .row"),t="uwp_cpt_list_view");var r=jQuery(".uwp-list-view-select");0==a?(o.removeClass("row-cols-sm-2 row-cols-md-2 row-cols-md-3 row-cols-md-4 row-cols-md-5").addClass("row-cols-md-0"),r.find("button").removeClass("active"),r.find("button.uwp-list-view-select-list").addClass("active")):(r.find("button").removeClass("active"),r.find("button.uwp-list-view-select-grid").addClass("active"),r.find('button[data-gridview="'+a+'"]').addClass("active"),o.removeClass("row-cols-md-0 row-cols-md-2 row-cols-md-3 row-cols-md-4 row-cols-md-5").addClass("row-cols-sm-2 row-cols-md-"+a)),e||localStorage.setItem(t,a)}function uwp_profile_image_change(a){jQuery(".uwp-profile-image-change-modal").remove();if(jQuery("body").append(''),window.bootstrap&&window.bootstrap.Modal){new window.bootstrap.Modal(document.querySelector(".uwp-profile-image-change-modal")).show()}else jQuery(".uwp-profile-image-change-modal").modal({backdrop:"static"});var e={action:"uwp_ajax_image_crop_popup_form",type:a,style:"bootstrap"};jQuery.post(uwp_localize_data.ajaxurl,e,function(a){jQuery(".uwp-profile-image-change-modal .modal-content").html(a)})}function uwp_init_auth_modal(){uwp_localize_data.login_modal&&(jQuery(".users-wp-login-nav a, .uwp-login-link").off("click"),jQuery(".users-wp-login-nav a, .uwp-login-link").on("click",function(a){return uwp_cancelBubble(a),uwp_modal_login_form(),!1})),uwp_localize_data.register_modal&&(jQuery(".users-wp-register-nav a, .uwp-register-link").off("click"),jQuery(".users-wp-register-nav a, .uwp-register-link").on("click",function(a){return uwp_cancelBubble(a),uwp_modal_register_form(),!1})),uwp_localize_data.forgot_modal&&(jQuery(".users-wp-forgot-nav a, .uwp-forgot-password-link").off("click"),jQuery(".users-wp-forgot-nav a, .uwp-forgot-password-link").on("click",function(a){return uwp_cancelBubble(a),uwp_modal_forgot_password_form(),!1}))}function uwp_modal_loading(a){$input_single=' ',$inputs=a?$input_single.repeat(a):$input_single;var e='",t='";if(jQuery(".uwp-auth-modal").length?jQuery(".uwp-auth-modal .modal-content").html(e):jQuery("body").append(t),jQuery(".modal-backdrop").remove(),window.bootstrap&&window.bootstrap.Modal){new window.bootstrap.Modal(document.querySelector(".uwp-auth-modal")).show()}else jQuery(".uwp-auth-modal").modal()}function uwp_modal_login_form(){jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:{action:"uwp_ajax_login_form"},beforeSend:function(){uwp_modal_loading(4)},success:function(a){a.success&&(jQuery(".uwp-auth-modal .modal-content").html(a.data),setTimeout(function(){jQuery(".uwp-auth-modal .modal-content input:visible:enabled:first").focus().unbind("focus")},300),jQuery(".uwp-auth-modal .modal-content form.uwp-login-form").on("submit",function(a){a.preventDefault(a),uwp_modal_login_form_process()})),uwp_init_auth_modal()}})}function uwp_maybe_check_recaptcha(a){return"undefined"!=typeof uwp_recaptcha_loops&&uwp_recaptcha_loops||(uwp_recaptcha_loops=1),jQuery(".uwp-auth-modal .modal-content .g-recaptcha-response").length&&""==jQuery(".uwp-auth-modal .modal-content .g-recaptcha-response").val()?(setTimeout(function(){if(jQuery('.uwp-auth-modal .modal-content button[type="submit"] i.fa-spin,.uwp-auth-modal .modal-content button[type="submit"] svg.fa-spin').remove(),uwp_recaptcha_loops>=6)return jQuery(".uwp-auth-modal .modal-content .uwp_login_submit").prop("disabled",!1),jQuery(".uwp-auth-modal .modal-content .uwp_register_submit").prop("disabled",!1),jQuery(".uwp-auth-modal .modal-content .uwp_forgot_submit").prop("disabled",!1),jQuery(".uwp-auth-modal .modal-content .uwp-captcha-render").addClass("alert alert-danger"),""==jQuery(".uwp-auth-modal .modal-content .modal-error").html()&&jQuery(".uwp-auth-modal .modal-content .modal-error").html("
      "+uwp_localize_data.error_retry+"
      "),!1;"login"==a?uwp_modal_login_form_process():"register"==a?uwp_modal_register_form_process():"forgot"==a&&uwp_modal_forgot_password_form_process()},500),uwp_recaptcha_loops++,!1):(uwp_recaptcha_loops=0,!0)}function uwp_maybe_reset_recaptcha(){if(jQuery(".uwp-auth-modal .modal-content .g-recaptcha-response").length){var a=jQuery(".uwp-auth-modal .modal-content .g-recaptcha-response").attr("id");uwp_reset_captcha(a)}document.dispatchEvent(new Event("ayecode_reset_captcha"))}function uwp_modal_login_form_process(){var a=jQuery(".modal-content form.uwp-login-form").serialize()+"&action=uwp_ajax_login";$button_text=jQuery(".uwp-auth-modal .modal-content .uwp_login_submit").html(),jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:a,beforeSend:function(){return jQuery(".uwp-auth-modal .modal-content .uwp_login_submit").html(' '+$button_text).prop("disabled",!0),jQuery(".uwp-auth-modal .modal-content .modal-error").html(""),uwp_maybe_check_recaptcha("login")},success:function(a){1==a.success?(jQuery(".uwp-auth-modal .modal-content .uwp_login_submit").html($button_text).prop("disabled",!0),jQuery(".uwp-auth-modal .modal-content .modal-error").html(a.data.message),a.data.is_2fa?(jQuery(".modal-content form.uwp-login-form").replaceWith(a.data.html),jQuery(".uwp-auth-modal .modal-content form.validate_2fa_form").on("submit",function(a){a.preventDefault(a),uwp_modal_login_form_2fa_process("form.validate_2fa_form","")}),jQuery(".uwp-auth-modal .modal-content form.validate_2fa_backup_codes_form").on("submit",function(a){a.preventDefault(a),uwp_modal_login_form_2fa_process("form.validate_2fa_backup_codes_form","")}),jQuery(".uwp-auth-modal .modal-content .uwp-2fa-email-resend").on("click",function(a){a.preventDefault(a),uwp_modal_login_form_2fa_process("form.validate_2fa_form","&wp-2fa-email-code-resend=1")})):a.data.redirect?setTimeout(function(){location.href=a.data.redirect},1e3):setTimeout(function(){location.reload()},1e3)):!1===a.success&&(jQuery(".uwp-auth-modal .modal-content .modal-error").html(a.data.message),jQuery(".uwp-auth-modal .modal-content .uwp_login_submit").html($button_text).prop("disabled",!1),uwp_maybe_reset_recaptcha()),uwp_init_auth_modal()}})}function uwp_modal_login_form_2fa_process(a,e){var t=jQuery(".modal-content "+a).serialize()+"&action=uwp_ajax_login_process_2fa"+e;$button=jQuery(".uwp-auth-modal .modal-content "+a).find(".uwp-2fa-submit"),$button_text=$button.html(),jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:t,beforeSend:function(){$button.html(' '+$button_text).prop("disabled",!0),jQuery(".uwp-auth-modal .modal-content .modal-error").html("")},success:function(a){1==a.success?($button.html($button_text).prop("disabled",!0),jQuery(".uwp-auth-modal .modal-content .modal-error").html(a.data.message),a.data.redirect?setTimeout(function(){location.href=a.data.redirect},1e3):setTimeout(function(){location.reload()},1e3)):!1===a.success&&(jQuery(".uwp-auth-modal .modal-content .modal-error").html(a.data.message),$button.html($button_text).prop("disabled",!1)),uwp_init_auth_modal()}})}function uwp_modal_register_form(a){var e={action:"uwp_ajax_register_form",form_id:a};jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:e,beforeSend:function(){uwp_modal_loading(6)},success:function(a){a.success&&(jQuery(".uwp-auth-modal .modal-content").html(a.data),setTimeout(function(){jQuery(".uwp-auth-modal .modal-content input:visible:enabled:first").focus().unbind("focus")},300),jQuery(".uwp-auth-modal .modal-content form.uwp-registration-form").submit(function(a){a.preventDefault(a),uwp_modal_register_form_process()})),uwp_init_auth_modal(),aui_init_select2(),uwp_switch_reg_form_init(),aui_init()}})}function uwp_switch_reg_form_init(){jQuery("#uwp-form-select-ajax a").on("click",function(a){a.preventDefault(a);uwp_modal_register_form(jQuery(this).attr("data-form_id"))}),jQuery("#uwp-form-select a").on("click",function(a){a.preventDefault(a);var e=jQuery(this),t=e.attr("data-form_id"),o=e.parents("form");jQuery("#uwp-form-select a").removeClass("active");var r={action:"uwp_ajax_register_form",form_id:t};jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:r,beforeSend:function(){e.addClass("active");o.find("input, select, textarea").each(function(){jQuery(this).replaceWith('
       
      ')}),o.children().not(".badge, #uwp-form-select").remove()},success:function(a){if(a.success){var e=jQuery(a.data).find("form"),t=o.find("#uwp-form-select");o.html(e.html()),e.find("#uwp-form-select").length||e.find("#uwp-form-select-ajax").length||!t||o.prepend(t),o.find("#uwp-form-select-ajax").attr("id","uwp-form-select")}uwp_init_auth_modal(),aui_init_select2(),uwp_switch_reg_form_init()}})})}function uwp_modal_register_form_process(){var a=jQuery(".modal-content form.uwp-registration-form").serialize()+"&action=uwp_ajax_register";$button=jQuery(".uwp-auth-modal .modal-content .uwp_register_submit"),$button_text=$button.html(),jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:a,beforeSend:function(){return $button.html(' '+$button_text).prop("disabled",!0),jQuery(".uwp-auth-modal .modal-content .modal-error").html(""),uwp_maybe_check_recaptcha("register")},success:function(a){a.success?($button.html($button_text).prop("disabled",!0),a.data.message?(jQuery(".uwp-auth-modal .modal-content .modal-error").html(a.data.message),jQuery(".modal-content form.uwp-registration-form").trigger("reset"),setTimeout(function(){a.data.redirect?window.location=a.data.redirect:location.reload()},1e3)):jQuery(".uwp-auth-modal .modal-content .modal-error").html(a.data.message)):!1===a.success&&(jQuery(".uwp-auth-modal .modal-content .modal-error").html(a.data.message),$button.html($button_text).prop("disabled",!1),uwp_maybe_reset_recaptcha()),uwp_init_auth_modal(),aui_init_select2(),uwp_switch_reg_form_init()}})}function uwp_modal_forgot_password_form(){jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:{action:"uwp_ajax_forgot_password_form"},beforeSend:function(){uwp_modal_loading(2)},success:function(a){a.success&&(jQuery(".uwp-auth-modal .modal-content").html(a.data),setTimeout(function(){jQuery(".uwp-auth-modal .modal-content input:visible:enabled:first").focus().unbind("focus")},300),jQuery(".uwp-auth-modal .modal-content form.uwp-forgot-form").on("submit",function(a){a.preventDefault(a),uwp_modal_forgot_password_form_process()})),uwp_init_auth_modal()}})}function uwp_modal_forgot_password_form_process(){var a=jQuery(".modal-content form.uwp-forgot-form").serialize()+"&action=uwp_ajax_forgot_password";$button=jQuery(".uwp-auth-modal .modal-content .uwp_forgot_submit"),$button_text=$button.html(),jQuery.ajax({type:"POST",url:uwp_localize_data.ajaxurl,data:a,beforeSend:function(){return $button.html(' '+$button_text).prop("disabled",!0),jQuery(".uwp-auth-modal .modal-content .modal-error").html(""),uwp_maybe_check_recaptcha("forgot")},success:function(a){a.success?($button.html($button_text).prop("disabled",!0),jQuery(".uwp-auth-modal .modal-content .modal-error").html(a.data)):!1===a.success&&(jQuery(".uwp-auth-modal .modal-content .modal-error").html(a.data),$button.html($button_text).prop("disabled",!1),uwp_maybe_reset_recaptcha()),uwp_init_auth_modal()}})}function uwp_checkPasswordStrength(a,e,t,o,r){var l=a.val(),u=e.val();!jQuery("#uwp-password-strength").length&&l?(e.length?$container=e.closest(".uwp-password-wrap"):$container=a.closest(".uwp-password-wrap"),$container.append('
      '),t=jQuery("#uwp-password-strength")):l||u||t.parent().remove(),parseInt(uwp_localize_data.uwp_pass_strength)>0&&o.attr("disabled","disabled"),t.removeClass("short bad good strong bg-warning bg-success bg-danger"),r=r.concat(wp.passwordStrength.userInputDisallowedList());var s=wp.passwordStrength.meter(l,r,u);switch(s){case-1:t.addClass("short bg-danger").html(pwsL10n.unknown);break;case 2:t.addClass("bad bg-warning").html(pwsL10n.bad).width("50%");break;case 3:t.addClass("good bg-success").html(pwsL10n.good).width("75%");break;case 4:t.addClass("strong bg-success").html(pwsL10n.strong).width("100%");break;case 5:t.addClass("short bg-danger").html(pwsL10n.mismatch).width("25%");break;default:t.addClass("short bg-danger").html(pwsL10n.short).width("25%")}return parseInt(uwp_localize_data.uwp_pass_strength)>0&&(e.length?$container=e.closest(".uwp-password-wrap"):$container=a.closest(".uwp-password-wrap"),$container.find("small").remove(),4==parseInt(uwp_localize_data.uwp_pass_strength)&&4===s?o.removeAttr("disabled"):3!=parseInt(uwp_localize_data.uwp_pass_strength)||3!==s&&4!==s?$container.append(""+uwp_localize_data.uwp_strong_pass_msg+""):o.removeAttr("disabled")),s}function uwp_cancelBubble(a){var e=a||window.event;e.stopPropagation&&e.stopPropagation(),null!=e.cancelBubble&&(e.cancelBubble=!0)}function uwp_gd_delete_post(a){var e=geodir_params.my_place_listing_del;return!!confirm(e)&&(jQuery.ajax({url:uwp_localize_data.ajaxurl,type:"POST",dataType:"json",data:{action:"geodir_user_delete_post",security:geodir_params.basic_nonce,post_id:a},timeout:2e4,success:function(a){if(a.success)e='
      '+a.data.message+"
      ";else var e='
      '+a.data.message+"
      ";var t='";if(jQuery(".uwp-gd-modal").length?jQuery(".uwp-gd-modal .modal-content").html(e):jQuery("body").append(t),window.bootstrap&&window.bootstrap.Modal){new window.bootstrap.Modal(document.querySelector(".uwp-gd-modal")).show()}else jQuery(".uwp-gd-modal").modal();a.success&&setTimeout(function(){location.reload()},3e3)}}),!0)}jQuery(window).on("load",function(){uwp_init_auth_modal(),uwp_switch_reg_form_init()}),function(a,e,t){a(document).ready(function(){var e=uwp_localize_data.uwp_more_char_limit,t=uwp_localize_data.uwp_more_ellipses_text,o=uwp_localize_data.uwp_more_text,r=uwp_localize_data.uwp_less_text;if(a(".uwp_more").each(function(){var r=a.trim(a(this).text()),l=a(this).data("maxchar");if(l>0&&(e=l),r.length>e){var u=r.substr(0,e),s=r.substr(e,r.length-e),n=uwp_nl2br(u)+''+t+' '+uwp_nl2br(s)+'  '+o+"";a(this).html(n)}}),a(".uwp_more_link").on("click",function(){return a(this).hasClass("uwp_less")?(a(this).removeClass("uwp_less"),a(this).html(o)):(a(this).addClass("uwp_less"),a(this).html(r)),a(this).parent().prev().toggle(),a(this).prev().toggle(),!1}),"undefined"!=typeof Storage){var l="uwp_list_view",u=jQuery(".uwp-users-loop > .row");u.length||(u=jQuery(".uwp-profile-cpt-loop > .row"),l="uwp_cpt_list_view");var s=!1,n=localStorage.getItem(l);setTimeout(function(){n||(s=!0,n=u.hasClass("row-cols-md-0")?0:u.hasClass("row-cols-md-1")?1:u.hasClass("row-cols-md-2")?2:u.hasClass("row-cols-md-3")?3:u.hasClass("row-cols-md-4")?4:u.hasClass("row-cols-md-5")?5:3),uwp_list_view_select(n,s)},10)}})}(jQuery,window),function(a,e,t){var o;a(document).ready(function(){a(".uwp-profile-modal-form-trigger").on("click",function(e){e.preventDefault();var t={action:"uwp_ajax_image_crop_popup_form",type:o=a(this).data("type")},r=jQuery("#uwp-popup-modal-wrap");r.show(),jQuery.post(uwp_localize_data.ajaxurl,t,function(e){a(document.body).append("
      "),r.replaceWith(e)})})}),a(document).ready(function(){a(".uwp_upload_file_remove").on("click",function(e){e.preventDefault();var t=a(this).data("htmlvar"),o=a(this).data("uid"),r={action:"uwp_upload_file_remove",htmlvar:t,uid:o,security:uwp_localize_data.basicNonce};jQuery.ajax({url:uwp_localize_data.ajaxurl,type:"POST",data:r,dataType:"json"}).done(function(e,o,r){"object"==typeof e&&e.success&&(a("#"+t+"_row").find(".uwp_file_preview_wrap").remove(),a("#"+t).closest("td").find(".uwp_file_preview_wrap").remove(),a("input[name="+t+"]").data("is-required")&&a("input[name="+t+"]").prop("required",!0))})})})}(jQuery,window),function(a,e,t){a(document).ready(function(){function e(e){a("#uwp_login_modal .uwp-login-ajax-notice").remove();var t=jQuery(e).serialize()+"&action=uwp_ajax_login";jQuery.post(uwp_localize_data.ajaxurl,t,function(e){(e=jQuery.parseJSON(e)).error?a("#uwp_login_modal form.uwp-login-form").before(e.message):(a("#uwp_login_modal form.uwp-login-form").before(e.message),setTimeout(function(){location.reload()},1200))})}a("#uwp_layout").on("change",function(){var e=a(this).val(),t=a("#uwp_user_items_layout");t.removeClass(),"list"==e?t.addClass("uwp-users-list-wrap uwp_listview"):"2col"==e?t.addClass("uwp-users-list-wrap uwp_gridview uwp_gridview_2col"):"3col"==e?t.addClass("uwp-users-list-wrap uwp_gridview uwp_gridview_3col"):"4col"==e?t.addClass("uwp-users-list-wrap uwp_gridview uwp_gridview_4col"):"5col"==e?t.addClass("uwp-users-list-wrap uwp_gridview uwp_gridview_5col"):t.addClass("uwp-users-list-wrap uwp_listview")}),jQuery(document).ready(function(a){a("#uwp_login_modal form.uwp-login-form").on("submit",function(a){a.preventDefault(),e(this)})})})}(jQuery,window); \ No newline at end of file diff --git a/readme.txt b/readme.txt index c180592f..3a39f08b 100644 --- a/readme.txt +++ b/readme.txt @@ -148,6 +148,7 @@ Yes, you can customize it with Elementor, but also with Gutenberg, Divi, Beaver = 1.2.4 - TBD = * Fixed alignment issue with the profile header username - FIXED +* Showing warnings for deprecated jQuery functions - FIXED = 1.2.33 - 2025-04-17 = * WordPress v6.8 compatibility check - CHANGED