"}),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='
";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='