Commit 80137c29 by Clinton Blackburn

Cleaned up JS code

ECOM-7141
parent f29768f3
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-31 18:11+0000\n" "POT-Creation-Date: 2017-02-13 10:45-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -50,11 +50,11 @@ msgstr "" ...@@ -50,11 +50,11 @@ msgstr ""
msgid "Must occur after start date" msgid "Must occur after start date"
msgstr "" msgstr ""
#: ecommerce/static/js/models/coupon_model.js:142 #: ecommerce/static/js/models/coupon_model.js:145
msgid "Max uses for multi-use coupons must be higher than 2." msgid "Max uses for multi-use coupons must be higher than 2."
msgstr "" msgstr ""
#: ecommerce/static/js/models/coupon_model.js:170 #: ecommerce/static/js/models/coupon_model.js:173
msgid "Must occur before end date" msgid "Must occur before end date"
msgstr "" msgstr ""
...@@ -154,10 +154,46 @@ msgstr "" ...@@ -154,10 +154,46 @@ msgstr ""
msgid "All credit seats must designate a number of credit hours." msgid "All credit seats must designate a number of credit hours."
msgstr "" msgstr ""
#: ecommerce/static/js/pages/basket_page.js:48 #: ecommerce/static/js/pages/basket_page.js:27
msgid "Problem occurred during checkout. Please contact support" msgid "Problem occurred during checkout. Please contact support"
msgstr "" msgstr ""
#: ecommerce/static/js/pages/basket_page.js:93
msgid "This field is required"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:120
msgid "Invalid card number"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:122
msgid "Unsupported card type"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:124
msgid "Invalid security number"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:129
msgid "Invalid month"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:131
msgid "Invalid year"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:133
msgid "Card expired"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:298
msgid "<Choose state/province>"
msgstr ""
#: ecommerce/static/js/pages/basket_page.js:299
msgid "State/Province (required)"
msgstr ""
#: ecommerce/static/js/pages/coupon_create_page.js:12 #: ecommerce/static/js/pages/coupon_create_page.js:12
msgid "Create New Coupon" msgid "Create New Coupon"
msgstr "" msgstr ""
......
...@@ -7,14 +7,14 @@ msgid "" ...@@ -7,14 +7,14 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-31 18:11+0000\n" "POT-Creation-Date: 2017-02-13 10:45-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Language: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: ecommerce/static/js/models/coupon_model.js #: ecommerce/static/js/models/coupon_model.js
...@@ -179,6 +179,42 @@ msgstr "" ...@@ -179,6 +179,42 @@ msgstr ""
"Prößlém öççürréd dürïng çhéçköüt. Pléäsé çöntäçt süppört Ⱡ'σяєм ιρѕυм ∂σłσя " "Prößlém öççürréd dürïng çhéçköüt. Pléäsé çöntäçt süppört Ⱡ'σяєм ιρѕυм ∂σłσя "
"ѕιт αмєт, ¢σηѕє¢тєтυя α#" "ѕιт αмєт, ¢σηѕє¢тєтυя α#"
#: ecommerce/static/js/pages/basket_page.js
msgid "This field is required"
msgstr "Thïs fïéld ïs réqüïréd Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢#"
#: ecommerce/static/js/pages/basket_page.js
msgid "Invalid card number"
msgstr "Ìnvälïd çärd nümßér Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт,#"
#: ecommerce/static/js/pages/basket_page.js
msgid "Unsupported card type"
msgstr "Ûnsüppörtéd çärd týpé Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, #"
#: ecommerce/static/js/pages/basket_page.js
msgid "Invalid security number"
msgstr "Ìnvälïd séçürïtý nümßér Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σ#"
#: ecommerce/static/js/pages/basket_page.js
msgid "Invalid month"
msgstr "Ìnvälïd mönth Ⱡ'σяєм ιρѕυм ∂σłσя ѕι#"
#: ecommerce/static/js/pages/basket_page.js
msgid "Invalid year"
msgstr "Ìnvälïd ýéär Ⱡ'σяєм ιρѕυм ∂σłσя ѕ#"
#: ecommerce/static/js/pages/basket_page.js
msgid "Card expired"
msgstr "Çärd éxpïréd Ⱡ'σяєм ιρѕυм ∂σłσя ѕ#"
#: ecommerce/static/js/pages/basket_page.js
msgid "<Choose state/province>"
msgstr "<Choose state/province> Ⱡ'σяєм#"
#: ecommerce/static/js/pages/basket_page.js
msgid "State/Province (required)"
msgstr "Stäté/Prövïnçé (réqüïréd) Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕ#"
#: ecommerce/static/js/pages/coupon_create_page.js #: ecommerce/static/js/pages/coupon_create_page.js
msgid "Create New Coupon" msgid "Create New Coupon"
msgstr "Çréäté Néw Çöüpön Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмє#" msgstr "Çréäté Néw Çöüpön Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмє#"
......
...@@ -5,32 +5,32 @@ ...@@ -5,32 +5,32 @@
define([ define([
'jquery' 'jquery'
], ],
function ($ function ($) {
) {
'use strict'; 'use strict';
var onReady = function() { function trackPurchase(order_id, total_amount, currency) {
window.analytics.track('Completed Purchase', {
orderId: order_id,
total: total_amount,
currency: currency
});
}
function onReady() {
var el = $('#receipt-container'), var el = $('#receipt-container'),
order_id = el.data('order-id'), order_id = el.data('order-id'),
fire_tracking_events = el.data('fire-tracking-events'), fire_tracking_events = el.data('fire-tracking-events'),
total_amount = el.data('total-amount'), total_amount = el.data('total-amount'),
currency = el.data('currency'); currency = el.data('currency');
if(order_id && fire_tracking_events){ if (order_id && fire_tracking_events) {
trackPurchase(order_id, total_amount, currency); trackPurchase(order_id, total_amount, currency);
} }
}, }
trackPurchase = function(order_id, total_amount, currency) {
window.analytics.track('Completed Purchase', {
orderId: order_id,
total: total_amount,
currency: currency
});
};
$(document).ready(onReady); $(document).ready(onReady);
return { return {
onReady: onReady, onReady: onReady
}; };
} }
); );
...@@ -452,15 +452,6 @@ define([ ...@@ -452,15 +452,6 @@ define([
}); });
}); });
describe('appendToForm', function () {
it('should append input data to form', function () {
_.each(data.payment_form_data, function(value, key) {
BasketPage.appendToForm(value, key, form);
});
expect(form.children().length).toEqual(3);
});
});
describe('onFail', function () { describe('onFail', function () {
it('should report error to message div element', function () { it('should report error to message div element', function () {
$('<div id="messages"></div>').appendTo('body'); $('<div id="messages"></div>').appendTo('body');
......
define([ define([
'jquery',
'pages/receipt_page', 'pages/receipt_page',
'utils/analytics_utils' 'utils/analytics_utils'
], ],
function (ReceiptPage, function ($,
AnalyticsUtils ReceiptPage,
) { AnalyticsUtils) {
'use strict'; 'use strict';
describe('Receipt Page', function () { describe('Receipt Page', function () {
......
...@@ -36,7 +36,7 @@ define([ ...@@ -36,7 +36,7 @@ define([
course_start_date: '2013-02-05T05:00:00Z', course_start_date: '2013-02-05T05:00:00Z',
id: 'course-v1:edX+DemoX+Demo_Course', id: 'course-v1:edX+DemoX+Demo_Course',
voucher_end_date: '2016-07-29T00:00:00Z', voucher_end_date: '2016-07-29T00:00:00Z',
contains_verified: true, contains_verified: true
}), }),
course2 = new OfferModel({ course2 = new OfferModel({
benefit: { benefit: {
...@@ -58,7 +58,7 @@ define([ ...@@ -58,7 +58,7 @@ define([
course_start_date: '2013-02-05T05:00:00Z', course_start_date: '2013-02-05T05:00:00Z',
id: 'course-v1:edX+DemoX+Demo_Courseewewe', id: 'course-v1:edX+DemoX+Demo_Courseewewe',
voucher_end_date: '2016-07-29T00:00:00Z', voucher_end_date: '2016-07-29T00:00:00Z',
contains_verified: true, contains_verified: true
}); });
beforeEach(function() { beforeEach(function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment