diff --git a/assets/css/um-styles.css b/assets/css/um-styles.css index bc6302a8..6cbcc5bf 100644 --- a/assets/css/um-styles.css +++ b/assets/css/um-styles.css @@ -750,4 +750,9 @@ small.um-max-filesize { } small.um-max-filesize span{ font-size: 12px; -} \ No newline at end of file +} + +.um-form .um-field .um-field-area input.um-form-field.um-validate-not-matched, +.um-form .um-field .um-field-area input.um-form-field.um-validate-not-matched:focus { + border-color: #DB2929 !important; +} diff --git a/assets/js/um-functions.js b/assets/js/um-functions.js index f834753c..e202ea69 100644 --- a/assets/js/um-functions.js +++ b/assets/js/um-functions.js @@ -8,15 +8,15 @@ function um_conditional(){ var found = 0; var um_field_key = jQuery(this).data('key'); for (var i = 0; i < 5; i++) { - + var action0 = jQuery(this).data('cond-'+i+'-action'); var field0 = jQuery(this).data('cond-'+i+'-field'); var operator0 = jQuery(this).data('cond-'+i+'-operator'); var value0 = jQuery(this).data('cond-'+i+'-value'); - - + + if ( action0 == 'show' && field0 == live_field && typeof value0 !== 'undefined' ) { - + if ( operator0 == 'empty' ) { if ( !live_value || live_value == '' || found > 0 ) { jQuery(this).fadeIn(); @@ -25,10 +25,10 @@ function um_conditional(){ jQuery(this).hide(); jQuery('div.um-field[data-cond-'+i+'-field='+um_field_key+']').hide(); um_reset_field('div.um-field[data-cond-'+i+'-field='+um_field_key+']'); - + } } - + if ( operator0 == 'not empty' ) { if ( live_value && live_value != '' || found > 0 ) { jQuery(this).fadeIn(); @@ -37,10 +37,10 @@ function um_conditional(){ jQuery(this).hide(); jQuery('div.um-field[data-cond-'+i+'-field='+um_field_key+']').hide(); um_reset_field('div.um-field[data-cond-'+i+'-field='+um_field_key+']'); - + } } - + if ( operator0 == 'equals to' ) { if ( value0 == live_value || found > 0 ) { jQuery(this).fadeIn(); @@ -49,10 +49,10 @@ function um_conditional(){ jQuery(this).hide(); jQuery('div.um-field[data-cond-'+i+'-field='+um_field_key+']').hide(); um_reset_field('div.um-field[data-cond-'+i+'-field='+um_field_key+']'); - + } } - + if ( operator0 == 'not equals' ) { if ( jQuery.isNumeric( value0 ) && parseInt( live_value ) != parseInt( value0 ) && live_value || found > 0 ) { jQuery(this).fadeIn(); @@ -64,10 +64,10 @@ function um_conditional(){ jQuery(this).hide(); jQuery('div.um-field[data-cond-'+i+'-field='+um_field_key+']').hide(); um_reset_field('div.um-field[data-cond-'+i+'-field='+um_field_key+']'); - + } } - + if ( operator0 == 'greater than' ) { if ( jQuery.isNumeric( value0 ) && parseInt( live_value ) > parseInt( value0 ) || found > 0) { jQuery(this).fadeIn(); @@ -76,10 +76,10 @@ function um_conditional(){ jQuery(this).hide(); jQuery('div.um-field[data-cond-'+i+'-field='+um_field_key+']').hide(); um_reset_field('div.um-field[data-cond-'+i+'-field='+um_field_key+']'); - + } } - + if ( operator0 == 'less than' ) { if ( jQuery.isNumeric( value0 ) && parseInt( live_value ) < parseInt( value0 ) && live_value || found > 0) { jQuery(this).fadeIn(); @@ -88,10 +88,10 @@ function um_conditional(){ jQuery(this).hide(); jQuery('div.um-field[data-cond-'+i+'-field='+um_field_key+']').hide(); um_reset_field('div.um-field[data-cond-'+i+'-field='+um_field_key+']'); - + } } - + if ( operator0 == 'contains' ) { if ( live_value && live_value.indexOf( value0 ) >= 0 || found > 0 ) { jQuery(this).fadeIn(); @@ -100,14 +100,14 @@ function um_conditional(){ jQuery(this).hide(); jQuery('div.um-field[data-cond-'+i+'-field='+um_field_key+']').hide(); um_reset_field('div.um-field[data-cond-'+i+'-field='+um_field_key+']'); - + } } - + } - + if ( action0 == 'hide' && field0 == live_field && typeof value0 !== 'undefined' ) { - + if ( operator0 == 'empty' ) { if ( !live_value || live_value == '' ) { jQuery(this).hide(); @@ -117,7 +117,7 @@ function um_conditional(){ } } - + if ( operator0 == 'not empty' ) { if ( live_value && live_value != '' ) { jQuery(this).hide(); @@ -125,10 +125,10 @@ function um_conditional(){ } else { jQuery(this).fadeIn(); jQuery('div.um-field[data-cond-'+i+'-field='+um_field_key+']').show(); - + } } - + if ( operator0 == 'equals to' ) { if ( value0 == live_value ) { jQuery(this).hide(); @@ -136,10 +136,10 @@ function um_conditional(){ } else { jQuery(this).fadeIn(); jQuery('div.um-field[data-cond-'+i+'-field='+um_field_key+']').show(); - + } } - + if ( operator0 == 'not equals' ) { if ( jQuery.isNumeric( value0 ) && parseInt( live_value ) != parseInt( value0 ) && live_value ) { jQuery(this).hide(); @@ -150,10 +150,10 @@ function um_conditional(){ } else { jQuery(this).fadeIn(); jQuery('div.um-field[data-cond-'+i+'-field='+um_field_key+']').show(); - + } } - + if ( operator0 == 'greater than' ) { if ( jQuery.isNumeric( value0 ) && parseInt( live_value ) > parseInt( value0 ) ) { jQuery(this).hide(); @@ -161,10 +161,10 @@ function um_conditional(){ } else { jQuery(this).fadeIn(); jQuery('div.um-field[data-cond-'+i+'-field='+um_field_key+']').show(); - + } } - + if ( operator0 == 'less than' ) { if ( jQuery.isNumeric( value0 ) && parseInt( live_value ) < parseInt( value0 ) && live_value ) { jQuery(this).hide(); @@ -172,10 +172,10 @@ function um_conditional(){ } else { jQuery(this).fadeIn(); jQuery('div.um-field[data-cond-'+i+'-field='+um_field_key+']').show(); - + } } - + if ( operator0 == 'contains' ) { if ( live_value && live_value.indexOf( value0 ) >= 0 ) { jQuery(this).hide(); @@ -183,41 +183,62 @@ function um_conditional(){ } else { jQuery(this).fadeIn(); jQuery('div.um-field[data-cond-'+i+'-field='+um_field_key+']').show(); - + } } //console.log( 'hide',i,value0, live_value ); } - + } }); } +function UM_check_password_matched() { + jQuery(document).on('input[data-key=user_password],input[data-key=confirm_user_password]').on('keyup', function(e) { + var value = jQuery('input[data-key=user_password]').val(); + var match = jQuery('input[data-key=confirm_user_password]').val(); + var field = jQuery('input[data-key=user_password],input[data-key=confirm_user_password]'); + + if(!value && !match) { + field.removeClass('um-validate-matched').removeClass('um-validate-not-matched'); + } else if(value !== match) { + field.removeClass('um-validate-matched').addClass('um-validate-not-matched'); + } else { + field.removeClass('um-validate-not-matched').addClass('um-validate-matched'); + } + }); +} +jQuery(document).ready(function(){ + if(jQuery('input[data-key=user_password],input[data-key=confirm_user_password]').length == 2) { + UM_check_password_matched(); + } +}) + function UM_hide_menus() { menu = jQuery('.um-dropdown'); menu.parents('div').find('a').removeClass('active'); menu.hide(); - + } function UM_domenus(){ jQuery('.um-dropdown').each(function(){ - + var menu = jQuery(this); var element = jQuery(this).attr('data-element'); var position = jQuery(this).attr('data-position'); - + jQuery(element).addClass('um-trigger-menu-on-'+menu.attr('data-trigger')); if ( jQuery(window).width() <= 1200 && element == 'div.um-profile-edit' ) { position = 'lc'; } - + if ( position == 'lc' ){ if ( 200 > jQuery(element).find('img').width() ) { @@ -225,9 +246,9 @@ function UM_domenus(){ } else { left_p = ( ( jQuery(element).width() - jQuery(element).find('img').width() ) / 2 ); } - + top_ = parseInt( jQuery(element).find('a').css('top') ); - + if ( top_ ) { top_p = jQuery(element).find('img').height() + 4 + top_; left_gap = 4; @@ -235,13 +256,13 @@ function UM_domenus(){ top_p = jQuery(element).find('img').height() + 4; left_gap = 0; } - + if ( top_p == 4 && element == 'div.um-cover' ) { top_p = jQuery(element).height() / 2 + ( menu.height() / 2 ); } else if ( top_p == 4 ) { top_p = jQuery(element).height() + 20; } - + gap_right = jQuery(element).width() + 17; menu.css({ 'top' : 0, @@ -250,17 +271,17 @@ function UM_domenus(){ 'right' : gap_right + 'px', 'text-align' : 'center' }); - + menu.find('.um-dropdown-arr').find('i').removeClass().addClass('um-icon-arrow-right-b'); - + menu.find('.um-dropdown-arr').css({ 'top' : '4px', 'left' : 'auto', 'right' : '-17px' }); - + } - + if ( position == 'bc' ){ if ( 200 > jQuery(element).find('img').width() ) { @@ -268,9 +289,9 @@ function UM_domenus(){ } else { left_p = ( ( jQuery(element).width() - jQuery(element).find('img').width() ) / 2 ); } - + top_ = parseInt( jQuery(element).find('a').css('top') ); - + if ( top_ ) { top_p = jQuery(element).find('img').height() + 4 + top_; left_gap = 4; @@ -278,7 +299,7 @@ function UM_domenus(){ top_p = jQuery(element).find('img').height() + 4; left_gap = 0; } - + if ( top_p == 4 && element == 'div.um-cover' ) { top_p = jQuery(element).height() / 2 + ( menu.height() / 2 ); } else if ( top_p == 4 ) { @@ -292,64 +313,64 @@ function UM_domenus(){ 'right' : 'auto', 'text-align' : 'center' }); - + menu.find('.um-dropdown-arr').find('i').removeClass().addClass('um-icon-arrow-up-b'); - + menu.find('.um-dropdown-arr').css({ 'top' : '-17px', 'left' : ( menu.width() / 2 ) - 12, 'right' : 'auto' }); - + } }); - + } function um_responsive(){ jQuery('.um').each(function(){ - + element_width = jQuery(this).width(); if ( element_width <= 340 ) { - + jQuery(this).removeClass('uimob340'); jQuery(this).removeClass('uimob500'); jQuery(this).removeClass('uimob800'); jQuery(this).removeClass('uimob960'); - + jQuery(this).addClass('uimob340'); } else if ( element_width <= 500 ) { - + jQuery(this).removeClass('uimob340'); jQuery(this).removeClass('uimob500'); jQuery(this).removeClass('uimob800'); jQuery(this).removeClass('uimob960'); - + jQuery(this).addClass('uimob500'); } else if ( element_width <= 800 ) { - + jQuery(this).removeClass('uimob340'); jQuery(this).removeClass('uimob500'); jQuery(this).removeClass('uimob800'); jQuery(this).removeClass('uimob960'); - + jQuery(this).addClass('uimob800'); } else if ( element_width <= 960 ) { - + jQuery(this).removeClass('uimob340'); jQuery(this).removeClass('uimob500'); jQuery(this).removeClass('uimob800'); jQuery(this).removeClass('uimob960'); - + jQuery(this).addClass('uimob960'); } else if ( element_width > 960 ) { - + jQuery(this).removeClass('uimob340'); jQuery(this).removeClass('uimob500'); jQuery(this).removeClass('uimob800'); @@ -360,13 +381,13 @@ function um_responsive(){ if ( jQuery('.um-account-nav').length > 0 && jQuery('.um-account-side').is(':visible') && jQuery('.um-account-tab:visible').length == 0 ) { jQuery('.um-account-side li a.current').trigger('click'); } - + jQuery(this).css('opacity',1); }); jQuery('.um-cover, .um-member-cover').each(function(){ - + var elem = jQuery(this); var ratio = elem.data('ratio'); var width = elem.width(); @@ -375,7 +396,7 @@ function um_responsive(){ calcHeight = Math.round( width / ratios[0] ) + 'px'; elem.height( calcHeight ); elem.find('.um-cover-add').height( calcHeight ); - + }); jQuery('.um-members').each(function(){ @@ -383,7 +404,7 @@ function um_responsive(){ }); UM_domenus(); - + } function UM_Member_Grid( container ) { @@ -402,7 +423,7 @@ function initImageUpload_UM( trigger ) { } else { upload_help_text = ''; } - + if ( trigger.data('icon') ) { icon = ''; } else { @@ -434,42 +455,42 @@ function initImageUpload_UM( trigger ) { showFileCounter: false, showStatusAfterSuccess: true, onSubmit:function(files){ - + trigger.parents('.um-modal-body').find('.um-error-block').remove(); - + }, onSuccess:function(files,data,xhr){ - + trigger.selectedFiles = 0; - + data = jQuery.parseJSON(data); if (data.error && data.error != '') { trigger.parents('.um-modal-body').append('