customValidate-min.js
19.3 KB
function sfsi_plus_validationStep2(){SFSI("input").removeClass("inputError");if(sfsi_validator(SFSI('input[name="sfsi_plus_rss_display"]'),"checked")){if(!sfsi_validator(SFSI('input[name="sfsi_plus_rss_url"]'),"url")){sfsiplus_showErrorSuc("error","Error : Invalid Rss url ",2);SFSI('input[name="sfsi_plus_rss_url"]').addClass("inputError");return false}}if(sfsi_validator(SFSI('input[name="sfsi_plus_facebookPage_option"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_facebookPage_option"]'),"checked")){if(!sfsi_validator(SFSI('input[name="sfsi_plus_facebookPage_url"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Invalid Facebook page url ",2);SFSI('input[name="sfsi_plus_facebookPage_url"]').addClass("inputError");return false}}if(sfsi_validator(SFSI('input[name="sfsi_plus_twitter_followme"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_twitter_followme"]'),"checked")){if(!sfsi_validator(SFSI('input[name="sfsi_plus_twitter_followUserName"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Invalid Twitter UserName ",2);SFSI('input[name="sfsi_plus_twitter_followUserName"]').addClass("inputError");return false}}if(sfsi_validator(SFSI('input[name="sfsi_plus_twitter_aboutPage"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_twitter_aboutPage"]'),"checked")){if(!sfsi_validator(SFSI("#sfsi_plus_twitter_aboutPageText"),"blank")){sfsiplus_showErrorSuc("error","Error : Tweet about my page is blank ",2);SFSI("#sfsi_plus_twitter_aboutPageText").addClass("inputError");return false}}if(sfsi_validator(SFSI('input[name="sfsi_plus_twitter_page"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_twitter_page"]'),"checked")){if(!sfsi_validator(SFSI('input[name="sfsi_plus_twitter_pageURL"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Invalid twitter page Url ",2);SFSI('input[name="sfsi_plus_twitter_pageURL"]').addClass("inputError");return false}}if(sfsi_validator(SFSI('input[name="sfsi_plus_google_page"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_google_page"]'),"checked")){if(!sfsi_validator(SFSI('input[name="sfsi_plus_google_pageURL"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Invalid Google+ page Url ",2);SFSI('input[name="sfsi_plus_google_pageURL"]').addClass("inputError");return false}}if(sfsi_validator(SFSI('input[name="sfsi_plus_youtube_page"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_youtube_page"]'),"checked")){if(!sfsi_validator(SFSI('input[name="sfsi_plus_youtube_pageUrl"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Invalid youtube Url ",2);SFSI('input[name="sfsi_plus_youtube_pageUrl"]').addClass("inputError");return false}}if(sfsi_validator(SFSI('input[name="sfsi_plus_youtube_page"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_youtube_follow"]'),"checked")){if(jQuery("input[name='sfsi_plus_youtubeusernameorid']:checked").val()=="name"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_ytube_user"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Invalid youtube user ",2);SFSI('input[name="sfsi_plus_ytube_user"]').addClass("inputError");return false}}else{if(!sfsi_validator(SFSI('input[name="sfsi_plus_ytube_chnlid"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Invalid youtube channel id",2);SFSI('input[name="sfsi_plus_ytube_chnlid"]').addClass("inputError");return false}}}if(sfsi_validator(SFSI('input[name="sfsi_plus_pinterest_page"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_pinterest_page"]'),"checked")){if(!sfsi_validator(SFSI('input[name="sfsi_plus_pinterest_pageUrl"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Invalid pinterest page url ",2);SFSI('input[name="sfsi_plus_pinterest_pageUrl"]').addClass("inputError");return false}}if(sfsi_validator(SFSI('input[name="sfsi_plus_instagram_display"]'),"checked")){if(!sfsi_validator(SFSI('input[name="sfsi_plus_instagram_pageUrl"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Invalid Instagram url ",2);SFSI('input[name="sfsi_plus_instagram_pageUrl"]').addClass("inputError");return false}}if(sfsi_validator(SFSI('input[name="sfsi_plus_linkedin_page"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_linkedin_page"]'),"checked")){if(!sfsi_validator(SFSI('input[name="sfsi_plus_linkedin_pageURL"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Invalid LinkedIn page url ",2);SFSI('input[name="sfsi_plus_linkedin_pageURL"]').addClass("inputError");return false}}if(sfsi_validator(SFSI('input[name="sfsi_plus_linkedin_recommendBusines"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_linkedin_recommendBusines"]'),"checked")){if(!sfsi_validator(SFSI('input[name="sfsi_plus_linkedin_recommendProductId"]'),"blank")||!sfsi_validator(SFSI('input[name="sfsi_plus_linkedin_recommendCompany"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter Product Id and Company for LinkedIn Recommendation ",2);SFSI('input[name="sfsi_plus_linkedin_recommendProductId"]').addClass("inputError");SFSI('input[name="sfsi_plus_linkedin_recommendCompany"]').addClass("inputError");return false}}var e=0;SFSI("input[name='sfsi_plus_CustomIcon_links[]']").each(function(){if(!sfsi_validator(SFSI(this),"blank")||!sfsi_validator(SFSI(SFSI(this)),"url")){sfsiplus_showErrorSuc("error","Error : Please Enter a valid Custom link ",2);SFSI(this).addClass("inputError");e=1}});if(!e)return true;else return false}function sfsi_plus_validationStep3(){SFSI("input").removeClass("inputError");if(sfsi_validator(SFSI('input[name="sfsi_plus_shuffle_icons"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_shuffle_icons"]'),"checked")){if((!sfsi_validator(SFSI('input[name="sfsi_plus_shuffle_Firstload"]'),"activte")||!sfsi_validator(SFSI('input[name="sfsi_plus_shuffle_Firstload"]'),"checked"))&&(!sfsi_validator(SFSI('input[name="sfsi_plus_shuffle_interval"]'),"activte")||!sfsi_validator(SFSI('input[name="sfsi_plus_shuffle_interval"]'),"checked"))){sfsiplus_showErrorSuc("error","Error : Please Chose a Shuffle option ",3);SFSI('input[name="sfsi_plus_shuffle_Firstload"]').addClass("inputError");SFSI('input[name="sfsi_plus_shuffle_interval"]').addClass("inputError");return false}}if(!sfsi_validator(SFSI('input[name="sfsi_plus_shuffle_icons"]'),"checked")&&(sfsi_validator(SFSI('input[name="sfsi_plus_shuffle_Firstload"]'),"checked")||sfsi_validator(SFSI('input[name="sfsi_plus_shuffle_interval"]'),"checked"))){sfsiplus_showErrorSuc("error",'Error : Please check "Shuffle them automatically" option also ',3);SFSI('input[name="sfsi_plus_shuffle_Firstload"]').addClass("inputError");SFSI('input[name="sfsi_plus_shuffle_interval"]').addClass("inputError");return false}if(sfsi_validator(SFSI('input[name="sfsi_plus_shuffle_interval"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_shuffle_interval"]'),"checked")){if(!sfsi_validator(SFSI('input[name="sfsi_plus_shuffle_intervalTime"]'),"blank")||!sfsi_validator(SFSI('input[name="sfsi_plus_shuffle_intervalTime"]'),"int")){sfsiplus_showErrorSuc("error","Error : Invalid shuffle time interval",3);SFSI('input[name="sfsi_plus_shuffle_intervalTime"]').addClass("inputError");return false}}return true}function sfsi_plus_validationStep4(){if(sfsi_validator(SFSI('input[name="sfsi_plus_email_countsDisplay"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_email_countsDisplay"]'),"checked")){if(SFSI('input[name="sfsi_plus_email_countsFrom"]:checked').val()=="manual"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_email_manualCounts"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter manual counts for Email icon ",4);SFSI('input[name="sfsi_plus_email_manualCounts"]').addClass("inputError");return false}}}if(sfsi_validator(SFSI('input[name="sfsi_plus_rss_countsDisplay"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_rss_countsDisplay"]'),"checked")){if(!sfsi_validator(SFSI('input[name="sfsi_plus_rss_manualCounts"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter manual counts for Rss icon ",4);SFSI('input[name="sfsi_plus_rss_countsDisplay"]').addClass("inputError");return false}}if(sfsi_validator(SFSI('input[name="sfsi_plus_facebook_countsDisplay"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_facebook_countsDisplay"]'),"checked")){if(SFSI('input[name="sfsi_plus_facebook_countsFrom"]:checked').val()=="manual"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_facebook_manualCounts"]'),"blank")&&!sfsi_validator(SFSI('input[name="sfsi_plus_facebook_manualCounts"]'),"url")){sfsiplus_showErrorSuc("error","Error : Please Enter a valid facebook manual counts ",4);SFSI('input[name="sfsi_plus_facebook_manualCounts"]').addClass("inputError");return false}}}if(sfsi_validator(SFSI('input[name="sfsi_plus_google_countsDisplay"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_google_countsDisplay"]'),"checked")){if(SFSI('input[name="sfsi_plus_google_countsFrom"]:checked').val()=="follower"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_google_api_key"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter a valid google api key",4);SFSI('input[name="sfsi_plus_google_api_key"]').addClass("inputError");return false}}if(SFSI('input[name="sfsi_plus_google_countsFrom"]:checked').val()=="manual"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_google_manualCounts"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter google+ manual counts ",4);SFSI('input[name="sfsi_plus_google_manualCounts"]').addClass("inputError");return false}}}if(sfsi_validator(SFSI('input[name="sfsi_plus_twitter_countsDisplay"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_twitter_countsDisplay"]'),"checked")){if(SFSI('input[name="sfsi_plus_twitter_countsFrom"]:checked').val()=="source"){if(!sfsi_validator(SFSI('input[name="sfsiplus_tw_consumer_key"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter a valid consumer key",4);SFSI('input[name="sfsiplus_tw_consumer_key"]').addClass("inputError");return false}if(!sfsi_validator(SFSI('input[name="sfsiplus_tw_consumer_secret"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter a valid consume secret ",4);SFSI('input[name="sfsiplus_tw_consumer_secret"]').addClass("inputError");return false}if(!sfsi_validator(SFSI('input[name="sfsiplus_tw_oauth_access_token"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter a valid oauth access token",4);SFSI('input[name="sfsiplus_tw_oauth_access_token"]').addClass("inputError");return false}if(!sfsi_validator(SFSI('input[name="sfsiplus_tw_oauth_access_token_secret"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter a oAuth access token secret",4);SFSI('input[name="sfsiplus_tw_oauth_access_token_secret"]').addClass("inputError");return false}}if(SFSI('input[name="sfsi_plus_linkedIn_countsFrom"]:checked').val()=="manual"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_twitter_manualCounts"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter Twitter manual counts ",4);SFSI('input[name="sfsi_plus_twitter_manualCounts"]').addClass("inputError");return false}}}if(sfsi_validator(SFSI('input[name="sfsi_plus_linkedIn_countsDisplay"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_linkedIn_countsDisplay"]'),"checked")){if(SFSI('input[name="sfsi_plus_linkedIn_countsFrom"]:checked').val()=="follower"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_ln_company"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter a valid company name",4);SFSI('input[name="sfsi_plus_ln_company"]').addClass("inputError");return false}if(!sfsi_validator(SFSI('input[name="sfsi_plus_ln_api_key"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter a valid API key ",4);SFSI('input[name="sfsi_plus_ln_api_key"]').addClass("inputError");return false}if(!sfsi_validator(SFSI('input[name="sfsi_plus_ln_secret_key"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter a valid secret ",4);SFSI('input[name="sfsi_plus_ln_secret_key"]').addClass("inputError");return false}if(!sfsi_validator(SFSI('input[name="sfsi_plus_ln_oAuth_user_token"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter a oAuth Access Token",4);SFSI('input[name="sfsi_plus_ln_oAuth_user_token"]').addClass("inputError");return false}}if(SFSI('input[name="sfsi_plus_linkedIn_countsFrom"]:checked').val()=="manual"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_linkedIn_manualCounts"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter LinkedIn manual counts ",4);SFSI('input[name="sfsi_plus_linkedIn_manualCounts"]').addClass("inputError");return false}}}if(sfsi_validator(SFSI('input[name="sfsi_plus_youtube_countsDisplay"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_youtube_countsDisplay"]'),"checked")){if(SFSI('input[name="sfsi_plus_youtube_countsFrom"]:checked').val()=="subscriber"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_youtube_user"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter a youtube user name",4);SFSI('input[name="sfsi_plus_youtube_user"]').addClass("inputError");return false}}if(SFSI('input[name="sfsi_plus_youtube_countsFrom"]:checked').val()=="manual"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_youtube_manualCounts"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter youtube manual counts ",4);SFSI('input[name="sfsi_plus_youtube_manualCounts"]').addClass("inputError");return false}}}if(sfsi_validator(SFSI('input[name="sfsi_plus_pinterest_countsDisplay"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_pinterest_countsDisplay"]'),"checked")){if(SFSI('input[name="sfsi_plus_pinterest_countsFrom"]:checked').val()=="manual"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_pinterest_manualCounts"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter Pinterest manual counts ",4);SFSI('input[name="sfsi_plus_pinterest_manualCounts"]').addClass("inputError");return false}}}if(sfsi_validator(SFSI('input[name="sfsi_plus_instagram_countsDisplay"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_instagram_countsDisplay"]'),"checked")){if(SFSI('input[name="sfsi_plus_instagram_countsFrom"]:checked').val()=="manual"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_instagram_manualCounts"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter Instagram manual counts ",4);SFSI('input[name="sfsi_plus_instagram_manualCounts"]').addClass("inputError");return false}}if(SFSI('input[name="sfsi_plus_instagram_countsFrom"]:checked').val()=="followers"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_instagram_User"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter a instagram user name",4);SFSI('input[name="sfsi_plus_instagram_User"]').addClass("inputError");return false}}}if(sfsi_validator(SFSI('input[name="sfsi_plus_shares_countsDisplay"]'),"activte")&&sfsi_validator(SFSI('input[name="sfsi_plus_shares_countsDisplay"]'),"checked")){if(SFSI('input[name="sfsi_plus_shares_countsFrom"]:checked').val()=="manual"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_shares_manualCounts"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter Share icon manual counts ",4);SFSI('input[name="sfsi_plus_shares_manualCounts"]').addClass("inputError");return false}}}return true}function sfsi_plus_validationStep5(){if(!sfsi_validator(SFSI('input[name="sfsi_plus_icons_size"]'),"int")){sfsiplus_showErrorSuc("error","Error : Please enter a numeric value only ",5);SFSI('input[name="sfsi_plus_icons_size"]').addClass("inputError");return false}if(parseInt(SFSI('input[name="sfsi_plus_icons_size"]').val())>100){sfsiplus_showErrorSuc("error","Error : Icons Size allow 100px maximum ",5);SFSI('input[name="sfsi_plus_icons_size"]').addClass("inputError");return false}if(parseInt(SFSI('input[name="sfsi_plus_icons_size"]').val())<=0){sfsiplus_showErrorSuc("error","Error : Icons Size should be more than 0 ",5);SFSI('input[name="sfsi_plus_icons_size"]').addClass("inputError");return false}if(!sfsi_validator(SFSI('input[name="sfsi_plus_icons_spacing"]'),"int")){sfsiplus_showErrorSuc("error","Error : Please enter a numeric value only ",5);SFSI('input[name="sfsi_plus_icons_spacing"]').addClass("inputError");return false}if(parseInt(SFSI('input[name="sfsi_plus_icons_spacing"]').val())<0){sfsiplus_showErrorSuc("error","Error : Icons Spacing should be 0 or more",5);SFSI('input[name="sfsi_plus_icons_spacing"]').addClass("inputError");return false}if(!sfsi_validator(SFSI('input[name="sfsi_plus_icons_perRow"]'),"int")){sfsiplus_showErrorSuc("error","Error : Please enter a numeric value only ",5);SFSI('input[name="sfsi_plus_icons_perRow"]').addClass("inputError");return false}if(parseInt(SFSI('input[name="sfsi_plus_icons_perRow"]').val())<=0){sfsiplus_showErrorSuc("error","Error : Icons Per row should be more than 0",5);SFSI('input[name="sfsi_plus_icons_perRow"]').addClass("inputError");return false}if(SFSI('input[name="sfsi_plus_icons_float"]:checked').val()=="yes"&&SFSI('input[name="sfsi_plus_icons_stick"]:checked').val()=="yes"){sfsiplus_showErrorSuc("error","Error : Only one allow from Sticking & floating ",5);SFSI('input[name="sfsi_plus_icons_float"][value="no"]').prop("checked",true);return false}return true}function sfsi_plus_validationStep7(){if(!sfsi_validator(SFSI('input[name="sfsi_plus_popup_border_thickness"]'),"int")){sfsiplus_showErrorSuc("error","Error : Please enter a numeric value only ",7);SFSI('input[name="sfsi_plus_popup_border_thickness"]').addClass("inputError");return false}if(!sfsi_validator(SFSI('input[name="sfsi_plus_popup_fontSize"]'),"int")){sfsiplus_showErrorSuc("error","Error : Please enter a numeric value only ",7);SFSI('input[name="sfsi_plus_popup_fontSize"]').addClass("inputError");return false}if(SFSI('input[name="sfsi_plus_Shown_pop"]:checked').val()=="once"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_Shown_popupOnceTime"]'),"blank")&&!sfsi_validator(SFSI('input[name="sfsi_plus_Shown_popupOnceTime"]'),"url")){sfsiplus_showErrorSuc("error","Error : Please Enter a valid pop up shown time ",7);SFSI('input[name="sfsi_plus_Shown_popupOnceTime"]').addClass("inputError");return false}}if(SFSI('input[name="sfsi_plus_Show_popupOn"]:checked').val()=="selectedpage"){if(!sfsi_validator(SFSI('input[name="sfsi_plus_Show_popupOn"]'),"blank")){sfsiplus_showErrorSuc("error","Error : Please Enter page ids with comma ",7);SFSI('input[name="sfsi_plus_Show_popupOn"]').addClass("inputError");return false}}if(!sfsi_validator(SFSI('input[name="sfsi_plus_icons_spacing"]'),"int")){sfsiplus_showErrorSuc("error","Error : Please enter a numeric value only ",7);SFSI('input[name="sfsi_plus_icons_spacing"]').addClass("inputError");return false}if(!sfsi_validator(SFSI('input[name="sfsi_plus_icons_perRow"]'),"int")){sfsiplus_showErrorSuc("error","Error : Please enter a numeric value only ",7);SFSI('input[name="sfsi_plus_icons_perRow"]').addClass("inputError");return false}return true}function sfsi_validator(e,t){var n=new RegExp("^(http|https|ftp)://([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]).(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0).(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0).(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|([a-zA-Z0-9-]+.)*[a-zA-Z0-9-]+.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$");switch(t){case"blank":if(!e.val().trim())return false;else return true;break;case"url":if(!n.test(e.val().trim()))return false;else return true;break;case"checked":if(!e.attr("checked")===true)return false;else return true;break;case"activte":if(!e.attr("disabled"))return true;else return false;break;case"int":if(!isNaN(e.val()))return true;else return false;break}}