PageSourceSearch

https://www.chestnet.org/Scripts/ecommerce/app/views.js

js chestnet.org collected 2026-09-24 08:36:22 UTC 4,818 bytes, 131 lines download raw bytes

1var ECOMM = ECOMM || {};
2
3ECOMM.events = ECOMM.events || _.extend({}, Backbone.Events);
4
5$(function () {
6
7    ECOMM.BasicExampleModel = Backbone.Model.extend({
8        urlRoot: "/Services/AMS/MembershipService.asmx/HelloWorld",
9
10        parse: function (data) {
11
12            var myObject = JSON.parse(data.d);
13            return myObject;
14
15
16        }
17
18    });
19
20    ECOMM.UserPreferencesView = Backbone.View.extend({
21        
22        initialize: function () {
23            //Set the event preferences hidden field which will be processed at login by the code behind
24            //$("#userEventPrefs").val(localStorage.getItem('eventPreferences'));
25            //$("#userMembershipPrefs").val(localStorage.getItem('membershipPreferences'));
26        }
27    });
28
29    ECOMM.LoginUserModel = Backbone.Model.extend({
30        urlRoot: "/Services/AMS/MembershipService.asmx/LoginUser",
31        parse: function (data) {
32
33            var myObject = JSON.parse(data.d);
34
35            if (myObject.success) {
36                $(location).attr('href', "/");
37            }
38
39        }
40    });
41
42    ECOMM.LoginView = Backbone.View.extend({
43        events: {
44            "click button.login__login-btn": "onClick"
45        },
46        onClick: function (event) {
47            var login = new ECOMM.LoginUserModel();
48            var email = $("#login__email-address").val();
49            var password = $("#login__password").val();
50
51            login.fetch({ data: JSON.stringify({ email: email, password: password }), type: 'POST', dataType: 'json', contentType: "application/json; charset=utf-8" });
52
53            return false;
54        }
55    });
56
57        ECOMM.DonationRegisterView = Backbone.View.extend({
58            initialize: function () {
59                this.manualSelectedNetworkCheckBox = "";
60            //There is a bug in .NET wehn using radio buttons in a repeater.
61            //The names get mangled so they do not end up in the same group,
62            //this fixes that issue.
63            $(".survey__designation input[type=radio]").each(function () {
64                var radioButton = $(this);
65                radioButton.attr("name", "donationOption");
66            });
67            
68            $(".survey__inHonor input[type=radio]").each(function () {
69                var radioButton = $(this);
70                radioButton.attr("name", "inHonor");
71            });
72
73
74            this.SetSelectedDonationOption();
75
76        },
77        events: {
78            "change input[name=donationOption]:checked": "SetSelectedDonationOption",
79            "change input[name=inHonor]:checked": "SetSelectedInHonorOptionAndToggleFormVisibility",
80            "click input[name=chkdonateAnonymously]": "DisableDonationTextbox",
81            "click input[name=chkParitipateInNetworks]": "SetManualSelectionVariable",
82            "blur input#txtNetWorksAffiliations":"VerifyAndUpdateNetworksCheckBox"
83        },
84        SetSelectedInHonorOptionAndToggleFormVisibility: function (event) {
85            var checkedValue = $('input[name=inHonor]:checked').val();
86
87            $("#selectedInHonorOption").val(checkedValue);
88            
89            if (checkedValue != "") {
90                $(".survey__in-honor").show();
91            } else {
92                $(".survey__in-honor").hide();
93            }
94        },
95        SetSelectedDonationOption: function () {
96            var checkedValue = $('input[name=donationOption]:checked').val();
97
98            $("#selectedDonationOption").val(checkedValue);
99        },
100        DisableDonationTextbox: function (event) {
101
102            var atLeastOneIsChecked = $('input[name="chkdonateAnonymously"]:checked').length > 0;
103
104            if (atLeastOneIsChecked) {
105                $("#txtRecognitionName").val('');
106                $("#txtRecognitionName").attr("disabled", "disabled");
107            } else{
108                $("#txtRecognitionName").removeAttr("disabled");
109            }
110        },
111        SetManualSelectionVariable: function () {
112            this.SetManualSelectionVariable = $('input[name="chkParitipateInNetworks"]').is(":checked");
113        },
114        VerifyAndUpdateNetworksCheckBox: function(event) {
115
116            var netWorksListed = $("#txtNetWorksAffiliations").val().length > 0;
117
118            var atLeastOneIsChecked = $('input[name="chkParitipateInNetworks"]:checked').length > 0;
119
120            if (netWorksListed && atLeastOneIsChecked) return;
121
122            if (netWorksListed) {
123                $('input[name="chkParitipateInNetworks"]').attr("checked", true);
124            } else if (!this.SetManualSelectionVariable) {
125                $('input[name="chkParitipateInNetworks"]').removeAttr("checked");
126            }
127        }
128        });
129    
130        
131});

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.