caboose-cms 0.7.85 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/caboose/{admin_edit_order.js → admin_edit_invoice.js} +332 -189
- data/app/assets/javascripts/caboose/cart.js +15 -15
- data/app/assets/javascripts/caboose/cart_old.js +2 -2
- data/app/assets/javascripts/caboose/checkout/authnet_payment_method_controller.js +120 -0
- data/app/assets/javascripts/caboose/checkout/billing_address_controller.js +85 -0
- data/app/assets/javascripts/caboose/checkout/cart_controller.js +257 -0
- data/app/assets/javascripts/caboose/checkout/checkout_controller.js +258 -0
- data/app/assets/javascripts/caboose/checkout/gift_cards_controller.js +57 -0
- data/app/assets/javascripts/caboose/checkout/shipping_address_controller.js +86 -0
- data/app/assets/javascripts/caboose/checkout/shipping_method_controller.js +121 -0
- data/app/assets/javascripts/caboose/checkout/stripe_payment_method_controller.js +155 -0
- data/app/assets/javascripts/caboose/checkout_login_register.js +2 -2
- data/app/assets/javascripts/caboose/checkout_module.js +8 -8
- data/app/assets/javascripts/caboose/checkout_old.js +151 -0
- data/app/assets/javascripts/caboose/{checkout_payment.js → checkout_payment_authnet.js} +1 -1
- data/app/assets/javascripts/caboose/checkout_payment_stripe.js +212 -0
- data/app/assets/javascripts/caboose/checkout_shipping.js +1 -1
- data/app/assets/javascripts/caboose/jquery.payment.js +1 -0
- data/app/assets/javascripts/caboose/model/attribute.js +3 -2
- data/app/assets/javascripts/caboose/model/bound_control.js +56 -14
- data/app/assets/javascripts/caboose/model/bound_select.js +9 -11
- data/app/assets/javascripts/caboose/model/bound_select_simple.js +215 -0
- data/app/assets/javascripts/caboose/model/bound_text.js +7 -8
- data/app/assets/javascripts/caboose/{my_account_edit_order.js → my_account_edit_invoice.js} +55 -55
- data/app/assets/javascripts/caboose/united_states.js +65 -0
- data/app/assets/stylesheets/caboose/{my_account_edit_order.css.scss → my_account_edit_invoice.css.scss} +1 -1
- data/app/assets/templates/caboose/cart/line_items.jst.ejs +3 -3
- data/app/assets/templates/caboose/checkout/line_items.jst.ejs +7 -7
- data/app/controllers/caboose/ab_options_controller.rb +4 -4
- data/app/controllers/caboose/ab_variants_controller.rb +5 -5
- data/app/controllers/caboose/admin_controller.rb +0 -6
- data/app/controllers/caboose/application_controller.rb +16 -15
- data/app/controllers/caboose/billing_addresses_controller.rb +22 -22
- data/app/controllers/caboose/block_type_sources_controller.rb +8 -8
- data/app/controllers/caboose/block_types_controller.rb +2 -42
- data/app/controllers/caboose/blocks_controller.rb +26 -26
- data/app/controllers/caboose/calendars_controller.rb +5 -5
- data/app/controllers/caboose/cart_controller.rb +55 -36
- data/app/controllers/caboose/categories_controller.rb +78 -76
- data/app/controllers/caboose/checkout_controller.rb +313 -340
- data/app/controllers/caboose/checkout_controller_bak.rb +620 -0
- data/app/controllers/caboose/domains_controller.rb +5 -5
- data/app/controllers/caboose/event_groups_controller.rb +26 -4
- data/app/controllers/caboose/events_controller.rb +7 -6
- data/app/controllers/caboose/fonts_controller.rb +2 -2
- data/app/controllers/caboose/gift_cards_controller.rb +113 -139
- data/app/controllers/caboose/google_spreadsheets_controller.rb +1 -1
- data/app/controllers/caboose/{order_packages_controller.rb → invoice_packages_controller.rb} +49 -49
- data/app/controllers/caboose/{order_reports_controller.rb → invoice_reports_controller.rb} +11 -13
- data/app/controllers/caboose/invoice_transactions_controller.rb +35 -0
- data/app/controllers/caboose/invoices_controller.rb +328 -0
- data/app/controllers/caboose/line_items_controller.rb +35 -34
- data/app/controllers/caboose/login_controller.rb +7 -7
- data/app/controllers/caboose/login_logs_controller.rb +4 -4
- data/app/controllers/caboose/logout_controller.rb +3 -1
- data/app/controllers/caboose/media_categories_controller.rb +9 -9
- data/app/controllers/caboose/media_controller.rb +21 -46
- data/app/controllers/caboose/modal_controller.rb +4 -3
- data/app/controllers/caboose/modification_values_controller.rb +6 -6
- data/app/controllers/caboose/modifications_controller.rb +7 -6
- data/app/controllers/caboose/my_account_controller.rb +2 -2
- data/app/controllers/caboose/my_account_invoices_controller.rb +166 -0
- data/app/controllers/caboose/my_account_line_items_controller.rb +15 -13
- data/app/controllers/caboose/page_custom_fields_controller.rb +9 -8
- data/app/controllers/caboose/page_permissions_controller.rb +3 -3
- data/app/controllers/caboose/pages_controller.rb +132 -135
- data/app/controllers/caboose/permissions_controller.rb +8 -7
- data/app/controllers/caboose/post_categories_controller.rb +22 -7
- data/app/controllers/caboose/post_custom_fields_controller.rb +9 -8
- data/app/controllers/caboose/posts_controller.rb +35 -43
- data/app/controllers/caboose/product_images_controller.rb +5 -5
- data/app/controllers/caboose/products_controller.rb +53 -47
- data/app/controllers/caboose/redirects_controller.rb +7 -7
- data/app/controllers/caboose/register_controller.rb +2 -2
- data/app/controllers/caboose/retargeting_controller.rb +2 -61
- data/app/controllers/caboose/reviews_controller.rb +1 -0
- data/app/controllers/caboose/roles_controller.rb +10 -9
- data/app/controllers/caboose/settings_controller.rb +9 -7
- data/app/controllers/caboose/shipping_addresses_controller.rb +18 -18
- data/app/controllers/caboose/shipping_packages_controller.rb +24 -21
- data/app/controllers/caboose/sites_controller.rb +35 -25
- data/app/controllers/caboose/smtp_controller.rb +3 -3
- data/app/controllers/caboose/sns_controller.rb +6 -6
- data/app/controllers/caboose/social_controller.rb +5 -6
- data/app/controllers/caboose/stackable_groups_controller.rb +10 -8
- data/app/controllers/caboose/station_controller.rb +3 -3
- data/app/controllers/caboose/store_controller.rb +93 -87
- data/app/controllers/caboose/subscriptions_controller.rb +153 -0
- data/app/controllers/caboose/users_controller.rb +25 -22
- data/app/controllers/caboose/variants_controller.rb +72 -93
- data/app/controllers/caboose/vendors_controller.rb +35 -32
- data/app/mailers/caboose/{orders_mailer.rb → invoices_mailer.rb} +21 -21
- data/app/mailers/caboose/login_mailer.rb +3 -3
- data/app/models/caboose/authnet.rb +295 -195
- data/app/models/caboose/comment_routes.rb +68 -41
- data/app/models/caboose/core_plugin.rb +1 -1
- data/app/models/caboose/discount.rb +14 -3
- data/app/models/caboose/domain_constraint.rb +11 -3
- data/app/models/caboose/gift_card.rb +8 -8
- data/app/models/caboose/invoice.rb +706 -0
- data/app/models/caboose/invoice_discount.rb +10 -0
- data/app/models/caboose/invoice_package.rb +76 -0
- data/app/models/caboose/{order_package_calculator.rb → invoice_package_calculator.rb} +20 -20
- data/app/models/caboose/{order_pdf.rb → invoice_pdf.rb} +30 -30
- data/app/models/caboose/{order_reporter.rb → invoice_reporter.rb} +5 -5
- data/app/models/caboose/invoice_transaction.rb +169 -0
- data/app/models/caboose/line_item.rb +11 -8
- data/app/models/caboose/payment_processors/authorizenet.rb +15 -15
- data/app/models/caboose/payment_processors/base.rb +3 -3
- data/app/models/caboose/{pending_orders_pdf.rb → pending_invoices_pdf.rb} +31 -31
- data/app/models/caboose/product.rb +2 -4
- data/app/models/caboose/schema.rb +159 -111
- data/app/models/caboose/shipping_calculator.rb +41 -139
- data/app/models/caboose/smtp_config.rb +2 -1
- data/app/models/caboose/store_config.rb +7 -7
- data/app/models/caboose/subscription.rb +32 -0
- data/app/models/caboose/tax_calculator.rb +36 -36
- data/app/models/caboose/user.rb +6 -0
- data/app/models/caboose/user_subscription.rb +142 -0
- data/app/models/caboose/wish_list.rb +14 -0
- data/app/models/caboose/wish_list_line_item.rb +13 -0
- data/app/views/caboose/blocks/_products.html.erb +10 -13
- data/app/views/caboose/checkout/_address_form.html.erb +14 -14
- data/app/views/caboose/checkout/_billing_form.html.erb +3 -3
- data/app/views/caboose/checkout/_cart.html.erb +7 -7
- data/app/views/caboose/checkout/_cart_old.html.erb +9 -9
- data/app/views/caboose/checkout/_confirm.html.erb +9 -9
- data/app/views/caboose/checkout/_order_discount.html.erb +3 -3
- data/app/views/caboose/checkout/_shipping_address.html.erb +1 -1
- data/app/views/caboose/checkout/_shipping_method.html.erb +1 -1
- data/app/views/caboose/checkout/addresses.html.erb +10 -10
- data/app/views/caboose/checkout/authnet.html.erb +34 -0
- data/app/views/caboose/checkout/authnet_response_handler.html.erb +3 -0
- data/app/views/caboose/checkout/checkout.html.erb +100 -0
- data/app/views/caboose/checkout/confirm_without_payment.html.erb +6 -6
- data/app/views/caboose/checkout/discount.html.erb +1 -1
- data/app/views/caboose/checkout/index.html.erb +4 -4
- data/app/views/caboose/checkout/payment_authnet.html.erb +140 -0
- data/app/views/caboose/checkout/payment_stripe.html.erb +95 -0
- data/app/views/caboose/checkout/shipping.html.erb +4 -4
- data/app/views/caboose/checkout/thanks.html.erb +3 -3
- data/app/views/caboose/gift_cards/admin_edit.html.erb +19 -19
- data/app/views/caboose/gift_cards/admin_index.html.erb +9 -9
- data/app/views/caboose/{orders → invoices}/_admin_footer.html.erb +0 -0
- data/app/views/caboose/{orders → invoices}/_admin_header.html.erb +0 -0
- data/app/views/caboose/{orders/_quickbooks_order.html.erb → invoices/_quickbooks_invoice.html.erb} +0 -0
- data/app/views/caboose/{orders → invoices}/admin_city_report.html.erb +1 -1
- data/app/views/caboose/invoices/admin_delete_form.html.erb +18 -0
- data/app/views/caboose/{orders → invoices}/admin_edit.html.erb +14 -14
- data/app/views/caboose/{orders → invoices}/admin_index.html.erb +24 -24
- data/app/views/caboose/{orders → invoices}/admin_invalid_order.html.erb +2 -2
- data/app/views/caboose/{orders → invoices}/admin_new.html.erb +7 -7
- data/app/views/caboose/{orders → invoices}/admin_print.html.erb +15 -15
- data/app/views/caboose/{orders → invoices}/admin_summary_report.html.erb +4 -4
- data/app/views/caboose/{orders_mailer/customer_new_order.html.erb → invoices_mailer/customer_new_invoice.html.erb} +21 -21
- data/app/views/caboose/invoices_mailer/customer_payment_authorization.html.erb +5 -0
- data/app/views/caboose/{orders_mailer → invoices_mailer}/customer_status_updated.html.erb +22 -22
- data/app/views/caboose/{orders_mailer/fulfillment_new_order.html.erb → invoices_mailer/fulfillment_new_invoice.html.erb} +23 -23
- data/app/views/caboose/{orders_mailer/shipping_order_ready.html.erb → invoices_mailer/shipping_invoice_ready.html.erb} +0 -0
- data/app/views/caboose/{orders_mailer → invoices_mailer}/test_email.html.erb +0 -0
- data/app/views/caboose/line_items/admin_new.html.erb +1 -1
- data/app/views/caboose/login_mailer/forgot_password_email.html.erb +2 -3
- data/app/views/caboose/my_account/index.html.erb +1 -1
- data/app/views/caboose/{my_account_orders → my_account_invoices}/authnet_relay.html.erb +0 -0
- data/app/views/caboose/{my_account_orders → my_account_invoices}/authnet_response.html.erb +0 -0
- data/app/views/caboose/{my_account_orders → my_account_invoices}/edit.html.erb +9 -9
- data/app/views/caboose/my_account_invoices/index.html.erb +36 -0
- data/app/views/caboose/{my_account_orders → my_account_invoices}/payment_form.html.erb +10 -10
- data/app/views/caboose/post_categories/admin_index.html.erb +1 -1
- data/app/views/caboose/sites/admin_edit.html.erb +1 -1
- data/app/views/caboose/store/admin_edit_general.html.erb +5 -3
- data/app/views/caboose/store/admin_edit_packages.html.erb +6 -6
- data/app/views/caboose/store/admin_edit_shipping.html.erb +3 -3
- data/app/views/caboose/store/admin_edit_tax.html.erb +1 -1
- data/app/views/caboose/subscriptions/admin_edit.html.erb +82 -0
- data/app/views/caboose/subscriptions/admin_index.html.erb +45 -0
- data/config/routes.rb +1 -759
- data/config/routes_old.rb +759 -0
- data/lib/caboose/version.rb +1 -1
- data/lib/tasks/caboose.rake +41 -15
- metadata +101 -61
- data/app/controllers/caboose/my_account_orders_controller.rb +0 -165
- data/app/controllers/caboose/orders_controller.rb +0 -310
- data/app/models/caboose/order.rb +0 -479
- data/app/models/caboose/order_discount.rb +0 -10
- data/app/models/caboose/order_package.rb +0 -133
- data/app/models/caboose/order_transaction.rb +0 -41
- data/app/models/caboose/payment_processors/payscape.rb +0 -94
- data/app/views/caboose/checkout/payment.html.erb +0 -146
- data/app/views/caboose/my_account_orders/index.html.erb +0 -36
- data/app/views/caboose/orders/admin_delete_form.html.erb +0 -21
- data/app/views/caboose/orders_mailer/customer_payment_authorization.html.erb +0 -5
@@ -3,7 +3,7 @@ Cart = function(params) { this.init(params); };
|
|
3
3
|
|
4
4
|
Cart.prototype = {
|
5
5
|
|
6
|
-
|
6
|
+
invoice: false,
|
7
7
|
allow_edit_line_items: true,
|
8
8
|
allow_edit_gift_cards: true,
|
9
9
|
show_total: true,
|
@@ -27,7 +27,7 @@ Cart.prototype = {
|
|
27
27
|
$.ajax({
|
28
28
|
url: '/cart/items',
|
29
29
|
success: function(resp) {
|
30
|
-
that.
|
30
|
+
that.invoice = resp;
|
31
31
|
$('#message').empty();
|
32
32
|
that.print();
|
33
33
|
}
|
@@ -37,7 +37,7 @@ Cart.prototype = {
|
|
37
37
|
print: function()
|
38
38
|
{
|
39
39
|
var that = this;
|
40
|
-
if (!this.
|
40
|
+
if (!this.invoice || !this.invoice.line_items || this.invoice.line_items.length == 0)
|
41
41
|
{
|
42
42
|
$('#cart').html("<p class='note'>You don't have any items in your shopping cart. <a href='/products'>Continue shopping.</a></p>");
|
43
43
|
return;
|
@@ -51,7 +51,7 @@ Cart.prototype = {
|
|
51
51
|
.append($('<th/>').html('Subtotal'))
|
52
52
|
);
|
53
53
|
|
54
|
-
$.each(this.
|
54
|
+
$.each(this.invoice.line_items, function(i, li) {
|
55
55
|
var v = li.variant;
|
56
56
|
var p = v.product;
|
57
57
|
var img = v.product_images && v.product_images.length > 0 ? v.product_images[0] : (p.product_images && p.product_images.length > 0 ? p.product_images[0] : false);
|
@@ -114,33 +114,33 @@ Cart.prototype = {
|
|
114
114
|
});
|
115
115
|
tbody.append($('<tr/>')
|
116
116
|
.append($('<td/>').css('text-align', 'right').attr('colspan', 4).html('Subtotal'))
|
117
|
-
.append($('<td/>').css('text-align', 'right').html('$' + parseFloat(that.
|
117
|
+
.append($('<td/>').css('text-align', 'right').html('$' + parseFloat(that.invoice.subtotal).toFixed(2)))
|
118
118
|
);
|
119
119
|
if (that.show_tax)
|
120
120
|
{
|
121
121
|
tbody.append($('<tr/>')
|
122
122
|
.append($('<td/>').css('text-align', 'right').attr('colspan', 4).html('Tax'))
|
123
|
-
.append($('<td/>').css('text-align', 'right').html('$' + parseFloat(that.
|
123
|
+
.append($('<td/>').css('text-align', 'right').html('$' + parseFloat(that.invoice.tax).toFixed(2)))
|
124
124
|
);
|
125
125
|
}
|
126
126
|
if (that.show_shipping)
|
127
127
|
{
|
128
|
-
var x = parseFloat(that.
|
128
|
+
var x = parseFloat(that.invoice.shipping) + parseFloat(that.invoice.handling);
|
129
129
|
tbody.append($('<tr/>')
|
130
130
|
.append($('<td/>').css('text-align', 'right').attr('colspan', 4).html('Shipping & Handling'))
|
131
131
|
.append($('<td/>').css('text-align', 'right').html('$' + x.toFixed(2)))
|
132
132
|
);
|
133
133
|
}
|
134
|
-
if (that.show_gift_wrap && that.
|
134
|
+
if (that.show_gift_wrap && that.invoice.gift_wrap > 0)
|
135
135
|
{
|
136
136
|
tbody.append($('<tr/>')
|
137
137
|
.append($('<td/>').css('text-align', 'right').attr('colspan', 4).html('Gift Wrapping'))
|
138
|
-
.append($('<td/>').css('text-align', 'right').html('$' + parseFloat(that.
|
138
|
+
.append($('<td/>').css('text-align', 'right').html('$' + parseFloat(that.invoice.gift_wrap).toFixed(2)))
|
139
139
|
);
|
140
140
|
}
|
141
|
-
if (that.show_discounts && that.
|
141
|
+
if (that.show_discounts && that.invoice.discounts.length > 0)
|
142
142
|
{
|
143
|
-
$.each(that.
|
143
|
+
$.each(that.invoice.discounts, function(i, d) {
|
144
144
|
|
145
145
|
var gctd = $('<td/>').css('text-align', 'right').attr('colspan', 4);
|
146
146
|
if (that.allow_edit_gift_cards)
|
@@ -152,11 +152,11 @@ Cart.prototype = {
|
|
152
152
|
.append($('<td/>').css('text-align', 'right').html('-$' + parseFloat(d.amount).toFixed(2)))
|
153
153
|
);
|
154
154
|
});
|
155
|
-
if (that.
|
155
|
+
if (that.invoice.custom_discount && that.invoice.custom_discount > 0)
|
156
156
|
{
|
157
157
|
tbody.append($('<tr/>')
|
158
158
|
.append($('<td/>').css('text-align', 'right').attr('colspan', 4).html('Discount'))
|
159
|
-
.append($('<td/>').css('text-align', 'right').html('$' + parseFloat(that.
|
159
|
+
.append($('<td/>').css('text-align', 'right').html('$' + parseFloat(that.invoice.custom_discount).toFixed(2)))
|
160
160
|
);
|
161
161
|
}
|
162
162
|
}
|
@@ -164,7 +164,7 @@ Cart.prototype = {
|
|
164
164
|
{
|
165
165
|
tbody.append($('<tr/>')
|
166
166
|
.append($('<td/>').css('text-align', 'right').attr('colspan', 4).html('Total'))
|
167
|
-
.append($('<td/>').css('text-align', 'right').html('$' + parseFloat(that.
|
167
|
+
.append($('<td/>').css('text-align', 'right').html('$' + parseFloat(that.invoice.total).toFixed(2)))
|
168
168
|
);
|
169
169
|
}
|
170
170
|
$('#cart').empty().append($('<table/>').append(tbody));
|
@@ -172,7 +172,7 @@ Cart.prototype = {
|
|
172
172
|
// Make anything editable that needs to be
|
173
173
|
if (that.allow_edit_line_items)
|
174
174
|
{
|
175
|
-
$.each(this.
|
175
|
+
$.each(this.invoice.line_items, function(i, li) {
|
176
176
|
var p = li.variant.product;
|
177
177
|
var attribs = [];
|
178
178
|
attribs.push({ name: 'quantity', nice_name: 'Qty', type: 'text', value: li.quantity, width: 50, fixed_placeholder: false, after_update: function() { that.refresh(); } });
|
@@ -41,7 +41,7 @@ Caboose.Store.Modules.Cart = (function() {
|
|
41
41
|
|
42
42
|
self.render = function() {
|
43
43
|
$.get('/cart/items', function(response) {
|
44
|
-
self.$cart.empty().html(self.templates.line_items({
|
44
|
+
self.$cart.empty().html(self.templates.line_items({ invoice: response.invoice }));
|
45
45
|
self.$cart.removeClass('loading');
|
46
46
|
});
|
47
47
|
};
|
@@ -143,7 +143,7 @@ Caboose.Store.Modules.Cart = (function() {
|
|
143
143
|
success: function(response) {
|
144
144
|
if (response.success) {
|
145
145
|
$line_item.find('.price').empty().text('$' + response.line_item.price);
|
146
|
-
if (self.$cart.find('.subtotal').length) self.$cart.find('.subtotal').empty().text('$' + response.
|
146
|
+
if (self.$cart.find('.subtotal').length) self.$cart.find('.subtotal').empty().text('$' + response.invoice_subtotal);
|
147
147
|
} else {
|
148
148
|
alert(response.errors[0]);
|
149
149
|
}
|
@@ -0,0 +1,120 @@
|
|
1
|
+
|
2
|
+
var AuthnetPaymentMethodController = function(params) { this.init(params); };
|
3
|
+
|
4
|
+
AuthnetPaymentMethodController.prototype = {
|
5
|
+
|
6
|
+
container: 'payment_method_container',
|
7
|
+
customer_profile_id: false,
|
8
|
+
payment_profile_id: false,
|
9
|
+
card_brand: false,
|
10
|
+
card_last4: false,
|
11
|
+
card_name: false,
|
12
|
+
card_zip: false,
|
13
|
+
|
14
|
+
init: function(params)
|
15
|
+
{
|
16
|
+
var that = this;
|
17
|
+
for (var i in params)
|
18
|
+
that[i] = params[i];
|
19
|
+
},
|
20
|
+
|
21
|
+
refresh: function(after)
|
22
|
+
{
|
23
|
+
var that = this;
|
24
|
+
$.ajax({
|
25
|
+
url: '/checkout/authnet/json',
|
26
|
+
type: 'get',
|
27
|
+
success: function(resp) {
|
28
|
+
that.stripe_key = resp.stripe_key;
|
29
|
+
that.customer_id = resp.customer_id;
|
30
|
+
that.card_brand = resp.card_brand;
|
31
|
+
that.card_last4 = resp.card_last4;
|
32
|
+
that.cc.print_ready_message();
|
33
|
+
if (after) after();
|
34
|
+
}
|
35
|
+
});
|
36
|
+
},
|
37
|
+
|
38
|
+
print: function()
|
39
|
+
{
|
40
|
+
var that = this;
|
41
|
+
//if (!that.stripe_key)
|
42
|
+
//{
|
43
|
+
// that.refresh(function() { that.print(); });
|
44
|
+
// return;
|
45
|
+
//}
|
46
|
+
var msg = that.card_brand && that.card_last4 ? that.card_brand + ' ending in ' + that.card_last4 : 'You have no card on file.';
|
47
|
+
var div = $('<div/>')
|
48
|
+
.append($('<h3/>').html('Payment Method'))
|
49
|
+
.append($('<p/>')
|
50
|
+
.append(msg).append(' ')
|
51
|
+
.append($('<a/>').attr('href', '#').html('Edit').click(function(e) {
|
52
|
+
e.preventDefault();
|
53
|
+
that.edit();
|
54
|
+
})
|
55
|
+
));
|
56
|
+
$('#'+that.container).empty().append(div);
|
57
|
+
},
|
58
|
+
|
59
|
+
edit: function()
|
60
|
+
{
|
61
|
+
caboose_modal_url('/checkout/authnet');
|
62
|
+
},
|
63
|
+
|
64
|
+
update: function()
|
65
|
+
{
|
66
|
+
var that = this;
|
67
|
+
var info = {
|
68
|
+
number: $('#card_number').val(),
|
69
|
+
exp: $('#card_exp').val(),
|
70
|
+
cvc: $('#card_cvc').val(),
|
71
|
+
name: $('card_name').val(),
|
72
|
+
address_zip: $('card_zip').val()
|
73
|
+
};
|
74
|
+
var exp = info.exp.split('/');
|
75
|
+
var m = exp.length > 0 ? exp[0] : '';
|
76
|
+
var y = exp.length > 1 ? exp[1] : '';
|
77
|
+
var error = false;
|
78
|
+
if (!$.payment.validateCardNumber(info.number)) error = "Invalid card number.";
|
79
|
+
if (!$.payment.validateCardExpiry(m, y)) error = "Invalid expiration date.";
|
80
|
+
if (!$.payment.validateCardCVC(info.cvc)) error = "Invalid CVC.";
|
81
|
+
if (error) { $('#payment_message').html("<p class='note error'>" + error + "</p>"); return; }
|
82
|
+
|
83
|
+
$('#save_payment_btn').attr('disabled', 'true').val('Saving card...');
|
84
|
+
Stripe.setPublishableKey(that.stripe_key);
|
85
|
+
Stripe.card.createToken(info, function(status, resp) {
|
86
|
+
if (resp.error)
|
87
|
+
{
|
88
|
+
$('#save_payment_btn').attr('disabled', 'false').val('Save Payment Method');
|
89
|
+
$('#payment_message').html("<p class='note error'>" + resp.error.message + "</p>");
|
90
|
+
}
|
91
|
+
else
|
92
|
+
{
|
93
|
+
that.card_brand = resp.card.brand;
|
94
|
+
that.card_last4 = resp.card.last4;
|
95
|
+
$.ajax({
|
96
|
+
url: '/checkout/stripe-details',
|
97
|
+
type: 'put',
|
98
|
+
data: { token: resp.id, card: resp.card },
|
99
|
+
success: function(resp2) {
|
100
|
+
if (resp2.success)
|
101
|
+
{
|
102
|
+
that.customer_id = resp.customer_id;
|
103
|
+
that.print();
|
104
|
+
}
|
105
|
+
if (resp2.error) $('#payment_message').html("<p class='note error'>" + resp2.error + "</p>");
|
106
|
+
}
|
107
|
+
});
|
108
|
+
}
|
109
|
+
});
|
110
|
+
},
|
111
|
+
|
112
|
+
ready: function()
|
113
|
+
{
|
114
|
+
var that = this;
|
115
|
+
if (!that.customer_id ) return false;
|
116
|
+
if (!that.card_brand ) return false;
|
117
|
+
if (!that.card_last4 ) return false;
|
118
|
+
return true;
|
119
|
+
}
|
120
|
+
};
|
@@ -0,0 +1,85 @@
|
|
1
|
+
|
2
|
+
var BillingAddressController = function(params) { this.init(params); };
|
3
|
+
|
4
|
+
BillingAddressController.prototype = {
|
5
|
+
|
6
|
+
cc: false,
|
7
|
+
model_binder: false,
|
8
|
+
|
9
|
+
init: function(params)
|
10
|
+
{
|
11
|
+
var that = this;
|
12
|
+
for (var i in params)
|
13
|
+
that[i] = params[i];
|
14
|
+
},
|
15
|
+
|
16
|
+
print: function()
|
17
|
+
{
|
18
|
+
var that = this;
|
19
|
+
var ba = that.cc.invoice.billing_address;
|
20
|
+
|
21
|
+
var div = $('<div/>').append($('<h3/>').html('Billing Address'));
|
22
|
+
|
23
|
+
if (that.cc.is_empty_address(ba))
|
24
|
+
div.append($('<p/>').append('[Empty]'));
|
25
|
+
else
|
26
|
+
{
|
27
|
+
var name = ba.first_name + ' ' + ba.last_name;
|
28
|
+
if (name.length == 0) name = '[Empty name]';
|
29
|
+
var address = ba.address1.length > 0 ? ba.address1 : '[Empty address]'
|
30
|
+
var city_state_zip = (ba.city.length > 0 ? ba.city : '[Empty city]') + ', ' + (ba.state.length > 0 ? ba.state : '[Empty state]') + ' ' + (ba.zip.length > 0 ? ba.zip : '[Empty zip]')
|
31
|
+
|
32
|
+
div.append($('<span/>').addClass('name' ).html(name )).append($('<br/>'));
|
33
|
+
if (ba.company.length > 0) div.append($('<span/>').addClass('company' ).html(ba.company )).append($('<br/>'));
|
34
|
+
div.append($('<span/>').addClass('address1' ).html(address )).append($('<br/>'));
|
35
|
+
if (ba.address2.length > 0) div.append($('<span/>').addClass('address2' ).html(ba.address2 )).append($('<br/>'));
|
36
|
+
div.append($('<span/>').addClass('city_state_zip' ).html(city_state_zip )).append($('<br/>'));
|
37
|
+
}
|
38
|
+
|
39
|
+
div.append($('<p/>').append($('<a/>').attr('href', '#').html('Edit').click(function(e) { e.preventDefault(); that.edit(); })));
|
40
|
+
$('#billing_address_container').empty().append(div);
|
41
|
+
},
|
42
|
+
|
43
|
+
edit: function()
|
44
|
+
{
|
45
|
+
var that = this;
|
46
|
+
var ba = that.cc.invoice.billing_address;
|
47
|
+
if (!ba.id) ba.id = 1;
|
48
|
+
|
49
|
+
var div = $('<div/>')
|
50
|
+
.append($('<h3/>').html('Billing Address'))
|
51
|
+
.append($('<div/>').attr('id', 'billingaddress_' + ba.id + '_first_name' ))
|
52
|
+
.append($('<div/>').attr('id', 'billingaddress_' + ba.id + '_last_name' ))
|
53
|
+
.append($('<div/>').attr('id', 'billingaddress_' + ba.id + '_company' ))
|
54
|
+
.append($('<div/>').attr('id', 'billingaddress_' + ba.id + '_address1' ))
|
55
|
+
.append($('<div/>').attr('id', 'billingaddress_' + ba.id + '_address2' ))
|
56
|
+
.append($('<div/>').attr('id', 'billingaddress_' + ba.id + '_city' ))
|
57
|
+
.append($('<div/>').attr('id', 'billingaddress_' + ba.id + '_state' ))
|
58
|
+
.append($('<div/>').attr('id', 'billingaddress_' + ba.id + '_zip' ));
|
59
|
+
$('#billing_address_container').empty().append(div);
|
60
|
+
|
61
|
+
that.model_binder = new ModelBinder({
|
62
|
+
name: 'BillingAddress',
|
63
|
+
id: ba.id,
|
64
|
+
update_url: '/checkout/billing-address',
|
65
|
+
authenticity_token: that.cc.authenticity_token,
|
66
|
+
attributes: [
|
67
|
+
{ name: 'first_name' , wrapper_class: 'first_name' , nice_name: 'First Name' , type: 'text' , value: ba.first_name , width: '50%' , fixed_placeholder: false },
|
68
|
+
{ name: 'last_name' , wrapper_class: 'last_name' , nice_name: 'Last Name' , type: 'text' , value: ba.last_name , width: '50%' , fixed_placeholder: false },
|
69
|
+
{ name: 'company' , wrapper_class: 'company' , nice_name: 'Company' , type: 'text' , value: ba.company , width: '100%' , fixed_placeholder: false },
|
70
|
+
{ name: 'address1' , wrapper_class: 'address1' , nice_name: 'Address 1' , type: 'text' , value: ba.address1 , width: '100%' , fixed_placeholder: false },
|
71
|
+
{ name: 'address2' , wrapper_class: 'address2' , nice_name: 'Address 2' , type: 'text' , value: ba.address2 , width: '100%' , fixed_placeholder: false },
|
72
|
+
{ name: 'city' , wrapper_class: 'city' , nice_name: 'City' , type: 'text' , value: ba.city , width: '25%' , fixed_placeholder: false },
|
73
|
+
{ name: 'zip' , wrapper_class: 'zip' , nice_name: 'Zip' , type: 'text' , value: ba.zip , width: '25%' , fixed_placeholder: false },
|
74
|
+
{ name: 'state' , wrapper_class: 'state' , nice_name: 'State' , type: 'select' , value: ba.state , width: '25%' , fixed_placeholder: false , options_url: '/checkout/state-options' }
|
75
|
+
]
|
76
|
+
});
|
77
|
+
},
|
78
|
+
|
79
|
+
ready: function()
|
80
|
+
{
|
81
|
+
var that = this;
|
82
|
+
if (that.cc.is_empty_address(that.cc.invoice.billing_address)) return false;
|
83
|
+
return true;
|
84
|
+
}
|
85
|
+
};
|
@@ -0,0 +1,257 @@
|
|
1
|
+
|
2
|
+
var CartController = function(params) { this.init(params); };
|
3
|
+
|
4
|
+
CartController.prototype = {
|
5
|
+
|
6
|
+
cc: false, // CheckoutController
|
7
|
+
|
8
|
+
init: function(params)
|
9
|
+
{
|
10
|
+
var that = this;
|
11
|
+
for (var i in params)
|
12
|
+
that[i] = params[i];
|
13
|
+
},
|
14
|
+
|
15
|
+
update_totals: function()
|
16
|
+
{
|
17
|
+
var that = this;
|
18
|
+
var x = parseFloat(that.cc.invoice.shipping) + parseFloat(that.cc.invoice.handling);
|
19
|
+
|
20
|
+
$('#totals_subtotal').html('$' + parseFloat(that.cc.invoice.subtotal).toFixed(2));
|
21
|
+
$('#totals_tax').html('$' + parseFloat(that.cc.invoice.tax).toFixed(2));
|
22
|
+
$('#totals_shipping').html('$' + x.toFixed(2));
|
23
|
+
$('#totals_gift_wrap').html('$' + parseFloat(that.cc.invoice.gift_wrap).toFixed(2));
|
24
|
+
$('#totals_custom_discount').html('$' + parseFloat(that.cc.invoice.custom_discount).toFixed(2));
|
25
|
+
$('#totals_total').html('$' + parseFloat(that.cc.invoice.total).toFixed(2));
|
26
|
+
|
27
|
+
$.each(that.cc.invoice.discounts, function(i, d) {
|
28
|
+
$('#totals_discount_' + i).html('-$' + parseFloat(d.amount).toFixed(2));
|
29
|
+
});
|
30
|
+
},
|
31
|
+
|
32
|
+
print: function(confirm)
|
33
|
+
{
|
34
|
+
var that = this;
|
35
|
+
if (!that.cc.invoice || !that.cc.invoice.line_items || that.cc.invoice.line_items.length == 0)
|
36
|
+
{
|
37
|
+
$('#cart').html("<p class='note'>You don't have any items in your shopping cart. <a href='/products'>Continue shopping.</a></p>");
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
|
41
|
+
var tbody = $('<tbody/>');
|
42
|
+
$.each(that.cc.invoice.invoice_packages, function(j, op) {
|
43
|
+
that.cart_line_items(tbody, op, j, confirm);
|
44
|
+
});
|
45
|
+
that.cart_line_items(tbody, false);
|
46
|
+
that.cart_totals(tbody, confirm);
|
47
|
+
$('#cart').empty().append($('<table/>').append(tbody));
|
48
|
+
|
49
|
+
// Make anything editable that needs to be
|
50
|
+
if (!confirm)
|
51
|
+
{
|
52
|
+
$.each(that.cc.invoice.line_items, function(i, li) {
|
53
|
+
var p = li.variant.product;
|
54
|
+
var attribs = [];
|
55
|
+
attribs.push({ name: 'quantity', nice_name: 'Qty', type: 'text', value: li.quantity, width: 50, fixed_placeholder: false, after_update: function() { that.cc.refresh_cart(); }});
|
56
|
+
if (that.cc.show_gift_options)
|
57
|
+
{
|
58
|
+
attribs.push({ name: 'is_gift' , nice_name: 'This item is a gift' , type: 'checkbox' , value: li.is_gift , width: 40 , fixed_placeholder: false, after_update: function() { that.toggle_gift_options(this.li_id); }, li_id: li.id });
|
59
|
+
attribs.push({ name: 'hide_prices' , nice_name: 'Hide prices' , type: 'checkbox' , value: li.hide_prices , width: 40 , fixed_placeholder: false, after_update: function() { } });
|
60
|
+
if (p.allow_gift_wrap == true)
|
61
|
+
attribs.push({ name: 'gift_wrap' , nice_name: 'Gift wrap' , type: 'checkbox' , value: li.gift_wrap , width: 40 , fixed_placeholder: false, after_update: function() { that.cc.refresh_cart(); } });
|
62
|
+
attribs.push({ name: 'gift_message' , nice_name: 'Gift message' , type: 'textarea' , value: li.gift_message , width: 400 , height: 75 , fixed_placeholder: false, after_update: function() { } });
|
63
|
+
}
|
64
|
+
m = new ModelBinder({
|
65
|
+
name: 'LineItem',
|
66
|
+
id: li.id,
|
67
|
+
update_url: '/cart/' + li.id,
|
68
|
+
authenticity_token: that.cc.authenticity_token,
|
69
|
+
attributes: attribs
|
70
|
+
});
|
71
|
+
});
|
72
|
+
}
|
73
|
+
|
74
|
+
$.each(that.cc.invoice.invoice_packages, function(i, op) {
|
75
|
+
if (confirm)
|
76
|
+
op.shipping_method_controller.print();
|
77
|
+
else
|
78
|
+
op.shipping_method_controller.edit();
|
79
|
+
});
|
80
|
+
},
|
81
|
+
|
82
|
+
cart_line_items: function(tbody, op, j, confirm)
|
83
|
+
{
|
84
|
+
var that = this;
|
85
|
+
|
86
|
+
line_items = [];
|
87
|
+
$.each(that.cc.invoice.line_items, function(i, li) {
|
88
|
+
if ((op && li.invoice_package_id == op.id) || (!op && !li.invoice_package_id))
|
89
|
+
line_items[line_items.length] = li;
|
90
|
+
});
|
91
|
+
|
92
|
+
if (line_items.length > 0)
|
93
|
+
{
|
94
|
+
tbody
|
95
|
+
.append($('<tr/>').addClass('invoice_package_header')
|
96
|
+
.append($('<td/>')
|
97
|
+
.attr('colspan', '4')
|
98
|
+
.append('<h3>Package ' + (j+1) + '</h3>')
|
99
|
+
.append($('<div/>').attr('id', 'invoice_package_' + op.id + '_shipping_method'))
|
100
|
+
)
|
101
|
+
)
|
102
|
+
.append($('<tr/>')
|
103
|
+
.append($('<th/>').html('Item'))
|
104
|
+
.append($('<th/>').html('Price'))
|
105
|
+
.append($('<th/>').html('Quantity'))
|
106
|
+
.append($('<th/>').html('Subtotal'))
|
107
|
+
);
|
108
|
+
}
|
109
|
+
|
110
|
+
$.each(line_items, function(i, li) {
|
111
|
+
var v = li.variant;
|
112
|
+
var p = v.product;
|
113
|
+
var img = v.product_images && v.product_images.length > 0 ? v.product_images[0] : (p.product_images && p.product_images.length > 0 ? p.product_images[0] : false);
|
114
|
+
img = img ? $('<img/>').attr('src', img.urls.tiny) : ' ';
|
115
|
+
var item = $('<td/>').attr('valign', 'top')
|
116
|
+
.append(img)
|
117
|
+
.append('<br/>' + p.title + '<br/>' + v.title);
|
118
|
+
|
119
|
+
if (that.cc.show_gift_options)
|
120
|
+
{
|
121
|
+
if (!confirm)
|
122
|
+
{
|
123
|
+
var gift_options_tbody = $('<tbody/>');
|
124
|
+
if (li.variant.product.allow_gift_wrap == true)
|
125
|
+
gift_options_tbody.append($('<tr/>').append($('<td/>').addClass('checkbox').append($('<div/>').attr('id', 'lineitem_' + li.id + '_gift_wrap' ))).append($('<td/>').append("Gift wrap ($" + parseFloat(li.variant.product.gift_wrap_price).toFixed(2) + ')')));
|
126
|
+
gift_options_tbody.append($('<tr/>').append($('<td/>').addClass('checkbox').append($('<div/>').attr('id', 'lineitem_' + li.id + '_hide_prices'))).append($('<td/>').append("Hide prices in receipt")));
|
127
|
+
gift_options_tbody.append($('<tr/>').append($('<td/>').attr('colspan', '2').append('Gift message<br/>').append($('<div/>').attr('id', 'lineitem_' + li.id + '_gift_message'))));
|
128
|
+
|
129
|
+
item.append($('<div/>').addClass('gift_options_checkbox')
|
130
|
+
.append($('<table/>').append($('<tbody/>').append($('<tr/>').append($('<td/>').addClass('checkbox').append($('<div/>').attr('id', 'lineitem_' + li.id + '_is_gift' ))).append($('<td/>').append("This item is a gift"))))))
|
131
|
+
.append($('<div/>').attr('id', 'gift_options_' + li.id).addClass('gift_options').css('display', li.is_gift ? 'block' : 'none').append($('<table/>').append(gift_options_tbody)));
|
132
|
+
}
|
133
|
+
else
|
134
|
+
{
|
135
|
+
if (li.is_gift)
|
136
|
+
{
|
137
|
+
item.append($('<ul/>').addClass('gift_options')
|
138
|
+
.append($('<li/>').html("This item is a gift."))
|
139
|
+
.append($('<li/>').html("Gift wrap? " + (li.gift_wrap ? 'Yes' : 'No')))
|
140
|
+
.append($('<li/>').html("Hide prices? " + (li.hide_prices ? 'Yes' : 'No')))
|
141
|
+
.append($('<li/>').html("Gift message: " + (li.gift_message.length > 0 ? li.gift_message : '[Empty]')))
|
142
|
+
);
|
143
|
+
}
|
144
|
+
else
|
145
|
+
item.append($('<p/>').append("This item is not a gift."));
|
146
|
+
}
|
147
|
+
}
|
148
|
+
|
149
|
+
var qty = $('<td/>').css('text-align', 'right');
|
150
|
+
if (!confirm) qty.append($('<div/>').attr('id', 'lineitem_' + li.id + '_quantity'));
|
151
|
+
else qty.append(li.quantity);
|
152
|
+
if (!confirm) qty.append($('<div/>').append($('<a/>').attr('href','#').html('Remove').click(function(e) { e.preventDefault(); that.remove_item(li.id); })));
|
153
|
+
|
154
|
+
var tr = $('<tr/>').data('id', li.id);
|
155
|
+
//if (i == 0)
|
156
|
+
// tr.append($('<td/>').attr('valign', 'top').attr('rowspan', line_items.length).attr('id', 'invoice_package_' + op.id + '_shipping_method'));
|
157
|
+
|
158
|
+
tr.append(item)
|
159
|
+
.append($('<td/>').css('text-align', 'right').html('$' + parseFloat(li.unit_price).toFixed(2)))
|
160
|
+
.append(qty)
|
161
|
+
.append($('<td/>').css('text-align', 'right').html('$' + (li.unit_price * li.quantity).toFixed(2)));
|
162
|
+
tbody.append(tr);
|
163
|
+
});
|
164
|
+
},
|
165
|
+
|
166
|
+
cart_totals: function(tbody, confirm)
|
167
|
+
{
|
168
|
+
var that = this;
|
169
|
+
|
170
|
+
tbody.append($('<tr/>')
|
171
|
+
.append($('<th/>').addClass('invoice_totals_header').attr('colspan', '4').html('<h3>Invoice Totals</h3>')));
|
172
|
+
tbody.append($('<tr/>')
|
173
|
+
.append($('<td/>').css('text-align', 'right').attr('colspan', 3).html('Subtotal'))
|
174
|
+
.append($('<td/>').css('text-align', 'right').attr('id', 'totals_subtotal').html('$' + parseFloat(that.cc.invoice.subtotal).toFixed(2)))
|
175
|
+
);
|
176
|
+
if (that.cc.show_tax)
|
177
|
+
{
|
178
|
+
tbody.append($('<tr/>')
|
179
|
+
.append($('<td/>').css('text-align', 'right').attr('colspan', 3).html('Tax'))
|
180
|
+
.append($('<td/>').css('text-align', 'right').attr('id', 'totals_tax').html('$' + parseFloat(that.cc.invoice.tax).toFixed(2)))
|
181
|
+
);
|
182
|
+
}
|
183
|
+
if (that.cc.show_shipping)
|
184
|
+
{
|
185
|
+
var x = parseFloat(that.cc.invoice.shipping) + parseFloat(that.cc.invoice.handling);
|
186
|
+
tbody.append($('<tr/>')
|
187
|
+
.append($('<td/>').css('text-align', 'right').attr('colspan', 3).html('Shipping & Handling'))
|
188
|
+
.append($('<td/>').css('text-align', 'right').attr('id', 'totals_shipping').html('$' + x.toFixed(2)))
|
189
|
+
);
|
190
|
+
}
|
191
|
+
if (that.cc.show_gift_wrap && that.cc.invoice.gift_wrap > 0)
|
192
|
+
{
|
193
|
+
tbody.append($('<tr/>')
|
194
|
+
.append($('<td/>').css('text-align', 'right').attr('colspan', 3).html('Gift Wrapping'))
|
195
|
+
.append($('<td/>').css('text-align', 'right').attr('id', 'totals_gift_wrap').html('$' + parseFloat(that.cc.invoice.gift_wrap).toFixed(2)))
|
196
|
+
);
|
197
|
+
}
|
198
|
+
if (that.cc.show_discounts && that.cc.invoice.discounts.length > 0)
|
199
|
+
{
|
200
|
+
$.each(that.cc.invoice.discounts, function(i, d) {
|
201
|
+
|
202
|
+
var gctd = $('<td/>').css('text-align', 'right').attr('colspan', 3);
|
203
|
+
if (!confirm)
|
204
|
+
gctd.append($('<a/>').data('discount_id', d.id).attr('href', '#').html('(remove)').click(function(e) { e.preventDefault(); that.remove_discount($(this).data('discount_id')); })).append(' ');
|
205
|
+
gctd.append('Gift Card (' + d.gift_card.code + ')');
|
206
|
+
|
207
|
+
tbody.append($('<tr/>')
|
208
|
+
.append(gctd)
|
209
|
+
.append($('<td/>').css('text-align', 'right').attr('id', 'totals_discount_' + i).html('-$' + parseFloat(d.amount).toFixed(2)))
|
210
|
+
);
|
211
|
+
});
|
212
|
+
if (that.cc.invoice.custom_discount && that.cc.invoice.custom_discount > 0)
|
213
|
+
{
|
214
|
+
tbody.append($('<tr/>')
|
215
|
+
.append($('<td/>').css('text-align', 'right').attr('colspan', 3).html('Discount'))
|
216
|
+
.append($('<td/>').css('text-align', 'right').attr('id', 'totals_custom_discount').html('$' + parseFloat(that.cc.invoice.custom_discount).toFixed(2)))
|
217
|
+
);
|
218
|
+
}
|
219
|
+
}
|
220
|
+
if (that.cc.show_total)
|
221
|
+
{
|
222
|
+
tbody.append($('<tr/>')
|
223
|
+
.append($('<td/>').css('text-align', 'right').attr('colspan', 3).html('Total'))
|
224
|
+
.append($('<td/>').css('text-align', 'right').attr('id', 'totals_total').html('$' + parseFloat(that.cc.invoice.total).toFixed(2)))
|
225
|
+
);
|
226
|
+
}
|
227
|
+
},
|
228
|
+
|
229
|
+
toggle_gift_options: function(li_id)
|
230
|
+
{
|
231
|
+
var el = $('#gift_options_' + li_id);
|
232
|
+
if (el.is(':visible'))
|
233
|
+
el.slideUp();
|
234
|
+
else
|
235
|
+
el.slideDown();
|
236
|
+
},
|
237
|
+
|
238
|
+
remove_item: function(li_id)
|
239
|
+
{
|
240
|
+
var that = this;
|
241
|
+
$.ajax({
|
242
|
+
url: '/cart/' + li_id,
|
243
|
+
type: 'delete',
|
244
|
+
success: function(resp) { that.cc.refresh_and_print(); }
|
245
|
+
});
|
246
|
+
},
|
247
|
+
|
248
|
+
remove_discount: function(discount_id)
|
249
|
+
{
|
250
|
+
var that = this;
|
251
|
+
$.ajax({
|
252
|
+
url: '/cart/discounts/' + discount_id,
|
253
|
+
type: 'delete',
|
254
|
+
success: function(resp) { that.cc.refresh_and_print(); }
|
255
|
+
});
|
256
|
+
}
|
257
|
+
};
|