caboose-cms 0.9.30 → 0.9.31
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edd4495325ae1e2e44f453bbd23603ab339b7345
|
4
|
+
data.tar.gz: 3a36acac988b41eb9aaabf5121f46c69c27f0284
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f5b923f8d7b8b1bf9b938ee8425f6ef37e4f171383ffe4c5b32e5410b7a380b8ac640bdaa001718c893d016bab7dc77162da151643f979fbd94cb8ffb8498bc
|
7
|
+
data.tar.gz: aec65c0bbb515e9a0894122b75fdd1d3894f591ff36b8349aa249b1bcce992869f91f46152013794eb3d97227b40785bed61c4aa7d83994c92b307c48508d9c2
|
@@ -86,11 +86,11 @@ ShippingAddressController.prototype = {
|
|
86
86
|
{ name: 'first_name' , wrapper_class: 'first_name' , nice_name: 'First Name' , type: 'text' , value: sa.first_name , width: '50%' , fixed_placeholder: false , before_update: function() { this.value_old = this.value_clean; }, after_update: function() { that.cc.invoice.shipping_address.first_name = this.value; that.cc.print_ready_message(); }},
|
87
87
|
{ name: 'last_name' , wrapper_class: 'last_name' , nice_name: 'Last Name' , type: 'text' , value: sa.last_name , width: '50%' , fixed_placeholder: false , before_update: function() { this.value_old = this.value_clean; }, after_update: function() { that.cc.invoice.shipping_address.last_name = this.value; that.cc.print_ready_message(); }},
|
88
88
|
{ name: 'company' , wrapper_class: 'company' , nice_name: 'Company' , type: 'text' , value: sa.company , width: '100%' , fixed_placeholder: false , before_update: function() { this.value_old = this.value_clean; }, after_update: function() { that.cc.invoice.shipping_address.company = this.value; that.cc.print_ready_message(); }},
|
89
|
-
{ name: 'address1' , wrapper_class: 'address1' , nice_name: 'Address 1' , type: 'text' , value: sa.address1 , width: '100%' , fixed_placeholder: false , before_update: function() { this.value_old = this.value_clean; }, after_update: function() { that.cc.invoice.shipping_address.address1 = this.value; if (this.value != this.value_old) that.cc.refresh_cart(function() { that.cc.print_ready_message(); }); }},
|
90
|
-
{ name: 'address2' , wrapper_class: 'address2' , nice_name: 'Address 2' , type: 'text' , value: sa.address2 , width: '100%' , fixed_placeholder: false , before_update: function() { this.value_old = this.value_clean; }, after_update: function() { that.cc.invoice.shipping_address.address2 = this.value; if (this.value != this.value_old) that.cc.refresh_cart(function() { that.cc.print_ready_message(); }); }},
|
91
|
-
{ name: 'city' , wrapper_class: 'city' , nice_name: 'City' , type: 'text' , value: sa.city , width: '25%' , fixed_placeholder: false , before_update: function() { this.value_old = this.value_clean; }, after_update: function() { that.cc.invoice.shipping_address.city = this.value; if (this.value != this.value_old) that.cc.refresh_cart(function() { that.cc.print_ready_message(); }); }},
|
92
|
-
{ name: 'zip' , wrapper_class: 'zip' , nice_name: 'Zip' , type: 'text' , value: sa.zip , width: '25%' , fixed_placeholder: false , before_update: function() { this.value_old = this.value_clean; }, after_update: function() { that.cc.invoice.shipping_address.zip = this.value; if (this.value != this.value_old) that.cc.refresh_cart(function() { that.cc.print_ready_message(); }); }},
|
93
|
-
{ name: 'state' , wrapper_class: 'state' , nice_name: 'State' , type: 'select' , value: sa.state , width: '25%' , fixed_placeholder: false , before_update: function() { this.value_old = this.value_clean; }, after_update: function() { that.cc.invoice.shipping_address.state = this.value; if (this.value != this.value_old) that.cc.refresh_cart(function() { that.cc.print_ready_message(); }); }, options_url: '/checkout/state-options', show_empty_option: true, empty_text: '-- State --' }
|
89
|
+
{ name: 'address1' , wrapper_class: 'address1' , nice_name: 'Address 1' , type: 'text' , value: sa.address1 , width: '100%' , fixed_placeholder: false , before_update: function() { this.value_old = this.value_clean; }, after_update: function() { that.cc.invoice.shipping_address.address1 = this.value; if (this.value != this.value_old) { that.cc.refresh_cart(function() { that.cc.print_ready_message(); }); } else { that.cc.print_ready_message(); } }},
|
90
|
+
{ name: 'address2' , wrapper_class: 'address2' , nice_name: 'Address 2' , type: 'text' , value: sa.address2 , width: '100%' , fixed_placeholder: false , before_update: function() { this.value_old = this.value_clean; }, after_update: function() { that.cc.invoice.shipping_address.address2 = this.value; if (this.value != this.value_old) { that.cc.refresh_cart(function() { that.cc.print_ready_message(); }); } else { that.cc.print_ready_message(); } }},
|
91
|
+
{ name: 'city' , wrapper_class: 'city' , nice_name: 'City' , type: 'text' , value: sa.city , width: '25%' , fixed_placeholder: false , before_update: function() { this.value_old = this.value_clean; }, after_update: function() { that.cc.invoice.shipping_address.city = this.value; if (this.value != this.value_old) { that.cc.refresh_cart(function() { that.cc.print_ready_message(); }); } else { that.cc.print_ready_message(); } }},
|
92
|
+
{ name: 'zip' , wrapper_class: 'zip' , nice_name: 'Zip' , type: 'text' , value: sa.zip , width: '25%' , fixed_placeholder: false , before_update: function() { this.value_old = this.value_clean; }, after_update: function() { that.cc.invoice.shipping_address.zip = this.value; if (this.value != this.value_old) { that.cc.refresh_cart(function() { that.cc.print_ready_message(); }); } else { that.cc.print_ready_message(); } }},
|
93
|
+
{ name: 'state' , wrapper_class: 'state' , nice_name: 'State' , type: 'select' , value: sa.state , width: '25%' , fixed_placeholder: false , before_update: function() { this.value_old = this.value_clean; }, after_update: function() { that.cc.invoice.shipping_address.state = this.value; if (this.value != this.value_old) { that.cc.refresh_cart(function() { that.cc.print_ready_message(); }); } else { that.cc.print_ready_message(); } }, options_url: '/checkout/state-options', show_empty_option: true, empty_text: '-- State --' }
|
94
94
|
]
|
95
95
|
});
|
96
96
|
},
|
@@ -12,54 +12,42 @@ BoundText = BoundControl.extend({
|
|
12
12
|
init: function(params) {
|
13
13
|
var that = this;
|
14
14
|
for (var thing in params)
|
15
|
-
|
15
|
+
that[thing] = params[thing];
|
16
16
|
|
17
|
-
|
18
|
-
var wrapper = $('<div/>').attr('id',
|
19
|
-
if (
|
20
|
-
wrapper.addClass(
|
21
|
-
$('#'+
|
22
|
-
$('#'+
|
23
|
-
$('#'+
|
24
|
-
.attr('id',
|
17
|
+
that.el = that.el ? that.el : that.model.name.toLowerCase() + '_' + that.model.id + '_' + that.attribute.name;
|
18
|
+
var wrapper = $('<div/>').attr('id', that.el + '_container').addClass('mb_container').css('position', 'relative');
|
19
|
+
if (that.attribute.wrapper_class)
|
20
|
+
wrapper.addClass(that.attribute.wrapper_class);
|
21
|
+
$('#'+that.el).wrap(wrapper);
|
22
|
+
$('#'+that.el+'_container').empty();
|
23
|
+
$('#'+that.el+'_container').append($('<input/>')
|
24
|
+
.attr('id', that.el)
|
25
25
|
.attr('type', 'text')
|
26
|
-
.attr('placeholder',
|
27
|
-
.css('text-align',
|
28
|
-
.val(
|
26
|
+
.attr('placeholder', that.attribute.fixed_placeholder ? 'empty' : that.attribute.nice_name)
|
27
|
+
.css('text-align', that.attribute.align)
|
28
|
+
.val(that.attribute.value)
|
29
29
|
);
|
30
30
|
|
31
|
-
if (
|
31
|
+
if (that.attribute.fixed_placeholder)
|
32
32
|
{
|
33
|
-
$('#'+
|
34
|
-
$('#'+
|
33
|
+
$('#'+that.el+'_container').append($('<div/>').attr('id', that.el + '_placeholder').addClass('mb_placeholder').append($('<span/>').html(that.attribute.nice_name + ': ')));
|
34
|
+
$('#'+that.el).css('background', 'transparent');
|
35
35
|
}
|
36
|
-
if (
|
37
|
-
if (
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
// }, 200);
|
44
|
-
}
|
45
|
-
|
46
|
-
var this2 = this;
|
47
|
-
$('#'+this.el).on('keyup', function(e) {
|
48
|
-
if (e.keyCode == 27) this2.cancel(); // Escape
|
49
|
-
if (e.keyCode == 13) this2.save(); // Enter
|
36
|
+
if (that.attribute.width) $('#'+that.el).css('width', that.attribute.width);
|
37
|
+
if (that.attribute.fixed_placeholder && that.attribute.align != 'right')
|
38
|
+
that.set_placeholder_padding();
|
39
|
+
|
40
|
+
$('#'+that.el).on('keyup', function(e) {
|
41
|
+
if (e.keyCode == 27) that.cancel(); // Escape
|
42
|
+
if (e.keyCode == 13) that.save(); // Enter
|
50
43
|
|
51
|
-
if ($('#'+
|
52
|
-
$('#'+
|
44
|
+
if ($('#'+that.el).val() != that.attribute.value_clean)
|
45
|
+
$('#'+that.el).addClass('mb_dirty');
|
53
46
|
else
|
54
|
-
$('#'+
|
47
|
+
$('#'+that.el).removeClass('mb_dirty');
|
55
48
|
});
|
56
|
-
$('#'+
|
57
|
-
|
58
|
-
{
|
59
|
-
this2.save_attempts++;
|
60
|
-
this2.save();
|
61
|
-
}
|
62
|
-
});
|
49
|
+
$('#'+that.el).on('blur', function() { that.save(); });
|
50
|
+
$('#'+that.el).on('change', function() { that.save(); });
|
63
51
|
},
|
64
52
|
|
65
53
|
set_placeholder_padding: function() {
|
@@ -71,29 +59,36 @@ BoundText = BoundControl.extend({
|
|
71
59
|
setTimeout(function() { that.set_placeholder_padding(); }, 200);
|
72
60
|
},
|
73
61
|
|
74
|
-
save: function()
|
75
|
-
|
76
|
-
|
62
|
+
save: function()
|
63
|
+
{
|
64
|
+
var that = this;
|
65
|
+
if (that.save_attempts > 0)
|
77
66
|
return;
|
78
67
|
|
79
|
-
|
80
|
-
|
68
|
+
that.save_attempts++;
|
69
|
+
that.attribute.value = $('#'+that.el).val();
|
70
|
+
if (that.attribute.value == that.attribute.value_clean)
|
71
|
+
{
|
72
|
+
that.save_attempts = 0;
|
73
|
+
return;
|
74
|
+
}
|
81
75
|
|
82
|
-
|
83
|
-
|
76
|
+
that.show_loader();
|
77
|
+
that.binder.save(that.attribute, function(resp) {
|
78
|
+
that.save_attempts = 0;
|
84
79
|
if (resp.error)
|
85
80
|
{
|
86
|
-
|
87
|
-
|
81
|
+
that.hide_loader();
|
82
|
+
that.error(resp.error);
|
88
83
|
}
|
89
84
|
else
|
90
85
|
{
|
91
|
-
|
92
|
-
$('#'+
|
93
|
-
$('#'+
|
86
|
+
that.show_check(500);
|
87
|
+
$('#'+that.el).val(that.attribute.value);
|
88
|
+
$('#'+that.el).removeClass('mb_dirty');
|
94
89
|
|
95
|
-
if (
|
96
|
-
|
90
|
+
if (that.binder.success)
|
91
|
+
that.binder.success(that);
|
97
92
|
}
|
98
93
|
});
|
99
94
|
},
|
data/lib/caboose/version.rb
CHANGED