Ensure window.isExternal is loaded Don't set a default for terms of service For paid courses, add the course to the cart and redirect to the shopping cart view. Don't send form method and url as form data. Stub window.analytics in the access view test.
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
var edx = edx || {};
|
|
|
|
(function($, Backbone) {
|
|
'use strict';
|
|
|
|
edx.student = edx.student || {};
|
|
edx.student.account = edx.student.account || {};
|
|
|
|
edx.student.account.PasswordResetModel = Backbone.Model.extend({
|
|
|
|
defaults: {
|
|
email: ''
|
|
},
|
|
|
|
ajaxType: '',
|
|
|
|
urlRoot: '',
|
|
|
|
initialize: function( attributes, options ) {
|
|
this.ajaxType = options.method;
|
|
this.urlRoot = options.url;
|
|
},
|
|
|
|
sync: function(method, model) {
|
|
var headers = {
|
|
'X-CSRFToken': $.cookie('csrftoken')
|
|
};
|
|
|
|
// Only expects an email address.
|
|
$.ajax({
|
|
url: model.urlRoot,
|
|
type: model.ajaxType,
|
|
data: model.attributes,
|
|
headers: headers,
|
|
success: function() {
|
|
model.trigger('sync');
|
|
},
|
|
error: function( error ) {
|
|
model.trigger('error', error);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
})(jQuery, Backbone);
|