s2Member v110815
Source Code: s2member\includes\s2member-min.js
Docs updated: August 15, 2011, 4:16 pm
Open for public discussion.
(!-- s-words :: --)Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code jQuery(window).load(function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli'+location.hash).addClass('hilite'); }); jQuery(window).bind('hashchange', function(){ if(typeof location.hash === 'string' && location.hash.match(/^#/)) jQuery('olli').removeClass('hilite'); jQuery('olli'+location.hash).addClass('hilite'); }); [ full view ]s2member\includes\s2member-min.js jQuery(document).ready(function(b){ws_plugin__s2member_uniqueFilesDownloaded=[];var a='?php echo c_ws_plugin__s2member_utils_strings:: esc_sq ( preg_quote ( (c_ws_plugin__s2member_utils_conds:: bp_is_installed ( ) ) ? "/" . ltrim (BP_REGISTER_SLUG, "/" ) : "" ) , "/" ) ; ?';var c='?php echo c_ws_plugin__s2member_utils_strings:: esc_sq ( preg_quote ( (c_ws_plugin__s2member_utils_conds:: bp_is_installed ( ) ) ? "/" . ltrim (BP_XPROFILE_SLUG, "/" ) : "" ) , "/" ) ; ?';if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN&&S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLYS2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED){b('a[href*="s2member_file_download"]').click(function(){if(!this.href.match(/s2member_file_download_key\=(.+)/i)){var d="** Please Confirm This File Download **\n\n";d+="You've downloaded "+S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY+" protected file"+((S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY!==1)?"s":"")+" in the last "+S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS+" days.\n\n";d+="You're entitled to "+((S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED)?"UNLIMITED downloads though ( so, no worries ).":S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED+" unique downloads every "+S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS+" day period.");if(this.href.match(/s2member_skip_confirmation/i)||confirm(d)){if(b.inArray(this.href,ws_plugin__s2member_uniqueFilesDownloaded)===-1){ws_plugin__s2member_uniqueFilesDownloaded.push(this.href),S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY++}return true}else{return false}}else{return true}})}if(!location.href.match(/\/wp-admin\//)){b("input#ws-plugin--s2member-profile-password1, input#ws-plugin--s2member-profile-password2").keyup(function(){ws_plugin__s2member_passwordStrength(b("input#ws-plugin--s2member-profile-login"),b("input#ws-plugin--s2member-profile-password1"),b("input#ws-plugin--s2member-profile-password2"),b("div#ws-plugin--s2member-profile-password-strength"))});b("form#ws-plugin--s2member-profile").submit(function(){var f=this,e="",d="",j="";var h=b("input#ws-plugin--s2member-profile-password1",f);var g=b("input#ws-plugin--s2member-profile-password2",f);var i=b("input#ws-plugin--s2member-profile-submit",f);b(":input",f).each(function(){var k=b.trim(b(this).attr("id")).replace(/-[0-9]+$/g,"");if(k&&(e=b.trim(b('label[for="'+k+'"]',f).first().children("strong").first().text().replace(/[\r\n\t]+/g," ")))){if(d=ws_plugin__s2member_validationErrors(e,this,f)){j+=d+"\n\n"}}});if(j=b.trim(j)){alert("— Oops, you missed something: —\n\n"+j);return false}else{if(b.trim(h.val())&&b.trim(h.val())!==b.trim(g.val())){alert("— Oops, you missed something: —\n\nPasswords do not match up. Please try again.");return false}}ws_plugin__s2member_animateProcessing(i);return true})}if(location.href.match(/\/wp-signup\.php/)){b("div#content div.mu_register form#setupform").submit(function(){var f=this,e="",d="",h="";b("input#user_email",f).attr("data-expected","email");var g=b('p.submit input[type="submit"]',f);b("input#user_name, input#user_email, input#blogname, input#blog_title, input#captcha_code",f).attr({"aria-required":"true"});b(":input",f).each(function(){var i=b.trim(b(this).attr("id")).replace(/-[0-9]+$/g,"");if(i&&(e=b.trim(b('label[for="'+i+'"]',f).first().text().replace(/[\r\n\t]+/g," ")))){if(d=ws_plugin__s2member_validationErrors(e,this,f)){h+=d+"\n\n"}}});if(h=b.trim(h)){alert("— Oops, you missed something: —\n\n"+h);return false}ws_plugin__s2member_animateProcessing(g);return true})}else{if(location.href.match(/\/wp-login\.php/)){b("input#ws-plugin--s2member-custom-reg-field-user-pass1, input#ws-plugin--s2member-custom-reg-field-user-pass2").keyup(function(){ws_plugin__s2member_passwordStrength(b("input#user_login"),b("input#ws-plugin--s2member-custom-reg-field-user-pass1"),b("input#ws-plugin--s2member-custom-reg-field-user-pass2"),b("div#ws-plugin--s2member-custom-reg-field-user-pass-strength"))});b("div#login form#registerform input#wp-submit").attr("tabindex","1000");b("div#login form#registerform").submit(function(){var f=this,e="",d="",j="";b("input#user_email",f).attr("data-expected","email");var i=b('input#ws-plugin--s2member-custom-reg-field-user-pass1[aria-required="true"]',f);var g=b("input#ws-plugin--s2member-custom-reg-field-user-pass2",f);var h=b("input#wp-submit",f);b("input#user_login, input#user_email, input#captcha_code",f).attr({"aria-required":"true"});b(":input",f).each(function(){var k=b.trim(b(this).attr("id")).replace(/-[0-9]+$/g,"");if(b.inArray(k,["user_login","user_email","captcha_code"])!==-1){if((e=b.trim(b(this).parent("label").text().replace(/[\r\n\t]+/g," ")))){if(d=ws_plugin__s2member_validationErrors(e,this,f)){j+=d+"\n\n"}}}else{if(k&&(e=b.trim(b('label[for="'+k+'"]',f).first().children("span").first().text().replace(/[\r\n\t]+/g," ")))){if(d=ws_plugin__s2member_validationErrors(e,this,f)){j+=d+"\n\n"}}}});if(j=b.trim(j)){alert("— Oops, you missed something: —\n\n"+j);return false}else{if(i.length&&b.trim(i.val())!==b.trim(g.val())){alert("— Oops, you missed something: —\n\nPasswords do not match up. Please try again.");return false}}ws_plugin__s2member_animateProcessing(h);return true})}else{if(location.href.match(/\/wp-admin\/(user\/)?profile\.php/)){b("form#your-profile").submit(function(){var f=this,e="",d="",g="";b("input#email",f).attr("data-expected","email");b(':input[id^="ws-plugin--s2member-profile-"]',f).each(function(){var h=b.trim(b(this).attr("id")).replace(/-[0-9]+$/g,"");if(h&&(e=b.trim(b('label[for="'+h+'"]',f).first().text().replace(/[\r\n\t]+/g," ")))){if(d=ws_plugin__s2member_validationErrors(e,this,f)){g+=d+"\n\n"}}});if(g=b.trim(g)){alert("— Oops, you missed something: —\n\n"+g);return false}return true})}else{if(a&&location.href.match(a)){b("body.registration form div#ws-plugin--s2member-custom-reg-fields-4bp-section").closest("form").submit(function(){var f=this,e="",d="",g="";b("input#signup_email",f).attr("data-expected","email");b("input#signup_username, input#signup_email, input#signup_password, input#field_1",f).attr({"aria-required":"true"});b(":input",f).each(function(){var h=b.trim(b(this).attr("id")).replace(/-[0-9]+$/g,"");if(h&&(e=b.trim(b('label[for="'+h+'"]',f).first().text().replace(/[\r\n\t]+/g," ")))){if(d=ws_plugin__s2member_validationErrors(e,this,f)){g+=d+"\n\n"}}});if(g=b.trim(g)){alert("— Oops, you missed something: —\n\n"+g);return false}return true})}else{if(c&&location.href.match(c)&&location.href.match(/\/edit\//)){b('body.logged-in.profile.profile-edit input.ws-plugin--s2member-profile-field-4bp[type = "text"]').closest("form").submit(function(){var f=this,e="",d="",g="";b("input#field_1",f).attr({"aria-required":"true"});b(":input",f).each(function(){var h=b.trim(b(this).attr("id")).replace(/-[0-9]+$/g,"");if(h&&(e=b.trim(b('label[for="'+h+'"]',f).first().text().replace(/[\r\n\t]+/g," ")))){if(d=ws_plugin__s2member_validationErrors(e,this,f)){g+=d+"\n\n"}}});if(g=b.trim(g)){alert("— Oops, you missed something: —\n\n"+g);return false}return true})}}}}}ws_plugin__s2member_passwordStrength=function(e,g,f,d){if(e instanceof jQuery&&g instanceof jQuery&&f instanceof jQuery&&d instanceof jQuery&&typeof passwordStrength==="function"&&typeof pwsL10n==="object"){d.removeClass("ws-plugin--s2member-password-strength-short ws-plugin--s2member-password-strength-bad ws-plugin--s2member-password-strength-good ws-plugin--s2member-password-strength-strong ws-plugin--s2member-password-strength-mismatch");switch(passwordStrength(g.val(),e.val(),f.val())){case 1:d.addClass("ws-plugin--s2member-password-strength-short").html(pwsL10n["short"]);break;case 2:d.addClass("ws-plugin--s2member-password-strength-bad").html(pwsL10n.bad);break;case 3:d.addClass("ws-plugin--s2member-password-strength-good").html(pwsL10n.good);break;case 4:d.addClass("ws-plugin--s2member-password-strength-strong").html(pwsL10n.strong);break;case 5:d.addClass("ws-plugin--s2member-password-strength-mismatch").html(pwsL10n.mismatch);break;default:d.addClass("ws-plugin--s2member-password-strength-short").html(pwsL10n["short"])}}return};ws_plugin__s2member_validationErrors=function(p,o,e,k,j){if(typeof p==="string"&&p&&typeof o==="object"&&typeof e==="object"){if(typeof o.tagName==="string"&&o.tagName.match(/^(input|textarea|select)$/i)&&!o.disabled){var r=o.tagName.toLowerCase(),n=b(o),m=b.trim(n.attr("type")).toLowerCase(),d=b.trim(n.attr("name")),q=n.val();var k=(typeof k==="boolean")?k:(n.attr("aria-required")==="true"),j=(typeof j==="string")?j:b.trim(n.attr("data-expected"));var i=('?php echo strlen ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "custom_reg_force_personal_emails" ] ) ; ?'0)?true:false;var g=new RegExp('^(?php echo c_ws_plugin__s2member_utils_strings:: esc_sq ( implode ( "|" , preg_split ( "/[\r \n \t ;,]+/" , preg_quote ( $GLOBALS [ "WS_PLUGIN__" ] [ "s2member" ] [ "o" ] [ "custom_reg_force_personal_emails" ] , "/" ) ) ) ) ; ?)@',"i");if(r==="input"&&m==="checkbox"&&d.match(/\[\]$/)){if(typeof o.id==="string"&&o.id.match(/-0$/)){if(k&&!b('input[name="'+d.replace(/([\[\]])/g,"$1")+'"]:checked',e).length){return p+"\nPlease check at least one of the boxes."}}}else{if(r==="input"&&m==="checkbox"){if(k&&!o.checked){return p+"\nRequired. This box must be checked."}}else{if(r==="input"&&m==="radio"){if(typeof o.id==="string"&&o.id.match(/-0$/)){if(k&&!b('input[name="'+d.replace(/([\[\]])/g,"$1")+'"]:checked',e).length){return p+"\nPlease select one of the options."}}}else{if(r==="select"&&n.attr("multiple")){if(k&&(!(q instanceof Array)||!q.length)){return p+"\nPlease select at least one of the options."}}else{if(typeof q!=="string"||(k&&!(q=b.trim(q)).length)){return p+"\nThis is a required field, please try again."}else{if((q=b.trim(q)).length&&((r==="input"&&m.match(/^(text|password)$/i))||r==="textarea")&&typeof j==="string"&&j.length){if(j==="numeric-wp-commas"&&(!q.match(/^[0-9\.,]+$/)||isNaN(q.replace(/,/g,"")))){return p+"\nMust be numeric ( with or without decimals, commas allowed )."}else{if(j==="numeric"&&(!q.match(/^[0-9\.]+$/)||isNaN(q))){return p+"\nMust be numeric ( with or without decimals, no commas )."}else{if(j==="integer"&&(!q.match(/^[0-9]+$/)||isNaN(q))){return p+"\nMust be an integer ( a whole number, without any decimals )."}else{if(j==="integer-gt-0"&&(!q.match(/^[0-9]+$/)||isNaN(q)||q=0)){return p+"\nMust be an integer 0 ( whole number, no decimals, greater than 0 )."}else{if(j==="float"&&(!q.match(/^[0-9\.]+$/)||!q.match(/[0-9]/)||!q.match(/\./)||isNaN(q))){return p+"\nMust be a float ( floating point number, decimals required )."}else{if(j==="float-gt-0"&&(!q.match(/^[0-9\.]+$/)||!q.match(/[0-9]/)||!q.match(/\./)||isNaN(q)||q=0)){return p+"\nMust be a float 0 ( floating point number, decimals required, greater than 0 )."}else{if(j==="date"&&!q.match(/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}$/)){return p+"\nMust be a date ( required date format: dd/mm/yyyy )."}else{if(j==="email"&&!q.match(/^([a-z_~0-9\+\-]+)(((\.?)([a-z_~0-9\+\-]+))*)(@)([a-z0-9]+)(((-*)([a-z0-9]+))*)(((\.)([a-z0-9]+)(((-*)([a-z0-9]+))*))*)(\.)([a-z]{2,6})$/i)){return p+"\nMust be a valid email address."}else{if(j==="email"&&i&&q.match(g)){return p+"\nPlease use a personal email address.\nAddresses like "+q.split("@")[0]+"@ are problematic."}else{if(j==="url"&&!q.match(/^http(s?)\:\/\/(.{5,})$/i)){return p+"\nMust be a full URL ( starting with http or https )."}else{if(j==="domain"&&!q.match(/^([a-z0-9]+)(((-*)([a-z0-9]+))*)(((\.)([a-z0-9]+)(((-*)([a-z0-9]+))*))*)(\.)([a-z]{2,6})$/i)){return p+"\nMust be a domain name ( domain name only, without http )."}else{if(j==="phone"&&(!q.match(/^[0-9 \(\)\-]+$/)||q.replace(/[^0-9]/g,"").length!==10)){return p+"\nMust be a phone # ( 10 digits w/possible hyphens,spaces,brackets )."}else{if(j==="uszip"&&!q.match(/^[0-9]{5}(-[0-9]{4})?$/)){return p+"\nMust be a US zipcode ( 5-9 digits w/possible hyphen )."}else{if(j==="cazip"&&!q.match(/^[0-9A-Z]{3}( ?)[0-9A-Z]{3}$/i)){return p+"\nMust be a Canadian zipcode ( 6 alpha-numerics w/possible space )."}else{if(j==="uczip"&&!q.match(/^[0-9]{5}(-[0-9]{4})?$/)&&!q.match(/^[0-9A-Z]{3}( ?)[0-9A-Z]{3}$/i)){return p+"\nMust be a zipcode ( either a US or Canadian zipcode )."}else{if(j.match(/^alphanumerics-spaces-punctuation-([0-9]+)(-e)?$/)&&!q.match(/^[a-z 0-9,\.\/\?\:;"'\{\}\[\]\|\\\+\=_\-\(\)\*&\^%\$#@\!`~]+$/i)){return p+"\nPlease use alphanumerics, spaces & punctuation only."}else{if(j.match(/^alphanumerics-spaces-([0-9]+)(-e)?$/)&&!q.match(/^[a-z 0-9]+$/i)){return p+"\nPlease use alphanumerics & spaces only."}else{if(j.match(/^alphanumerics-punctuation-([0-9]+)(-e)?$/)&&!q.match(/^[a-z0-9,\.\/\?\:;"'\{\}\[\]\|\\\+\=_\-\(\)\*&\^%\$#@\!`~]+$/i)){return p+"\nPlease use alphanumerics & punctuation only ( no spaces )."}else{if(j.match(/^alphanumerics-([0-9]+)(-e)?$/)&&!q.match(/^[a-z0-9]+$/i)){return p+"\nPlease use alphanumerics only ( no spaces/punctuation )."}else{if(j.match(/^alphabetics-([0-9]+)(-e)?$/)&&!q.match(/^[a-z]+$/i)){return p+"\nPlease use alphabetics only ( no digits/spaces/punctuation )."}else{if(j.match(/^numerics-([0-9]+)(-e)?$/)&&!q.match(/^[0-9]+$/i)){return p+"\nPlease use numeric digits only."}else{if(j.match(/^(any|alphanumerics-spaces-punctuation|alphanumerics-spaces|alphanumerics-punctuation|alphanumerics|alphabetics|numerics)-([0-9]+)(-e)?$/)){var l=j.split("-"),f=Number(l[1]),h=(l.length2)?Number(l[2]):"";if(h&&q.length!==f){return p+"\nMust be exactly "+f+" "+((l[0]==="numerics")?"digit":"character")+((f1)?"s":"")+"."}else{if(q.lengthf){return p+"\nMust be at least "+f+" "+((l[0]==="numerics")?"digit":"character")+((f1)?"s":"")+"."}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}return""};ws_plugin__s2member_animateProcessingConfig={originalText:"",interval:null,speed:100},ws_plugin__s2member_animateProcessing=function(e,d){if(e instanceof jQuery){if(d){clearInterval(ws_plugin__s2member_animateProcessingConfig.interval);if(ws_plugin__s2member_animateProcessingConfig.originalText){e.val(ws_plugin__s2member_animateProcessingConfig.originalText)}return}e.first().each(function(){var h=b(this),g=0,f="r",j=[".","..","..."];ws_plugin__s2member_animateProcessingConfig.originalText=h.val();clearInterval(ws_plugin__s2member_animateProcessingConfig.interval);ws_plugin__s2member_animateProcessingConfig.interval=setInterval(function(){if(f==="r"){if(g+1=j.length-1){g=g+1,f="r"}else{g=g-1,f="l"}}else{if(f==="l"){if(g-1=0){g=g-1,f="l"}else{g=g+1,f="r"}}}for(var k=j[g],i=j[g].length;ij.length;i++){k+=" "}h.val("Processing"+k)},ws_plugin__s2member_animateProcessingConfig.speed)})}}}); [ full view ]s2member\includes\s2member-min.js Source Code Documentation Packages ( Overview ) Classes Deprecated Todo Index Source Code(!-- :: s-words --)Statistics: Posted by System Robot — August 15th, 2011, 3:15 pm
]]>