PageSourceSearch

https://member.marathontrainingacademy.com/wp-content/plugins/memb…/js/common/mm-social_login.js?ver=3.0.34

js marathontrainingacademy.com collected 2026-10-02 03:56:13 UTC 3,807 bytes, 90 lines download raw bytes

1/*!
2 * 
3 * MemberMouse(TM) (http://www.membermouse.com)
4 * (c) MemberMouse, LLC. All rights reserved.
5 */
6var MM_SocialLoginJS = Class.extend({
7
8
9    _constructParams: function (cmd, provider, membershipLevel, redirectUrl, email) {
10        var params = { "cmd": cmd, "provider": provider };
11        if (membershipLevel != undefined) {
12            params['membershipLevel'] = membershipLevel;
13        }
14
15        if (redirectUrl != undefined) {
16            params['redirectUrl'] = redirectUrl;
17        }
18
19        if (email != undefined) {
20            params['email'] = email;
21        }
22        return params;
23    },
24
25    socialLoginLogin: function (provider, membershipLevel, redirectUrl) {
26        var params = this._constructParams("login", provider, membershipLevel, redirectUrl);
27        //this.nonAjaxPost(socialLoginVars.endpointUrl, params);
28        this.redirectAuth(socialLoginVars.endpointUrl, params);
29    },
30
31
32    socialLoginSignup: function (provider, membershipLevel, redirectUrl) {
33        var params = this._constructParams("signup", provider, membershipLevel, redirectUrl);
34        //this.nonAjaxPost(socialLoginVars.endpointUrl, params);
35        this.redirectAuth(socialLoginVars.endpointUrl, params);
36    },
37
38    socialLoginSignupPromptForEmail: function (provider, membershipLevel, redirectUrl) {
39        let enterEmailText = wp.i18n.__("Please enter your email address:", "membermouse");
40        jQuery("#socialLoginSignupModal").remove();
41        jQuery('<div id="socialLoginSignupModal" style="display:none; cursor: default; padding:10px; line-height:30px;">' +
42            '<form>' + enterEmailText + ' <br/><input type="text" name="email" style="width:300px;"><br/>' +
43            '<input type="button" id="socialLoginSignupModalOk" value="Continue" ' +
44            'onClick="javascript:sociallogin_js.socialLoginSignupWithEmail(\'' + provider + '\',\'' + membershipLevel + '\',\'' + redirectUrl + '\');">' +
45            '<input type="button" id="socialLoginSignupModalCancel" value="Cancel" onClick="javascript:jQuery.unblockUI();">' +
46            '</form></div>').appendTo(jQuery(document.body));
47        jQuery.blockUI({ message: jQuery('#socialLoginSignupModal') });
48        jQuery(".blockMsg").addClass(MemberMouseGlobal.checkoutProcessingMessageCSS);
49    },
50
51    socialLoginSignupWithEmail: function (provider, membershipLevel, redirectUrl) {
52        var email = jQuery("#socialLoginSignupModal input[name='email']").val(); //TODO: get email from form; validate
53        var params = this._constructParams("signup", provider, membershipLevel, redirectUrl, email);
54        //this.nonAjaxPost(socialLoginVars.endpointUrl, params);
55        this.redirectAuth(socialLoginVars.endpointUrl, params);
56    },
57
58
59    redirectAuth: function (destinationUrl, params) {
60        var first = true;
61        var urlComponent = "";
62        var finalUrl = "";
63
64        for (var param in params) {
65            if (!first) {
66                urlComponent += "&";
67            }
68            else {
69                first = false;
70            }
71            urlComponent += (param + "=" + encodeURIComponent(params[param]));
72        }
73        finalUrl = destinationUrl + ((destinationUrl.indexOf('?') === -1) ? "?" : "&") + urlComponent;
74        location.href = finalUrl;
75    },
76
77
78    nonAjaxPost: function (destinationUrl, params) {
79        var form = jQuery('<form action="' + destinationUrl + '" method="POST"/>');
80        if ((params != undefined) && (typeof params === 'object') && (params != null)) {
81            for (var paramName in params) {
82                form.append(jQuery('<input type="hidden" name="' + paramName + '" value="' + params[paramName] + '">'));
83            }
84        }
85        form.appendTo(jQuery(document.body)).submit();
86    }
87
88});
89
90var sociallogin_js = new MM_SocialLoginJS();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.