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: eb82d8896301aa81a5dd5c31515e674a8d94ca3e
4
- data.tar.gz: a99eeebf6c56d93dc437fd3ec6126e57f8ea360d
3
+ metadata.gz: edd4495325ae1e2e44f453bbd23603ab339b7345
4
+ data.tar.gz: 3a36acac988b41eb9aaabf5121f46c69c27f0284
5
5
  SHA512:
6
- metadata.gz: 91bfbab79102337d1f8faa9e7ddd389d27a88a4e0e0286c41a196976d8deea9bcb42d29c335a1c6897839cecc367c873de0d6de8a90264c5b7275f7614e63ac9
7
- data.tar.gz: 409be109f1ab404760d03222a93b180e97c099d878604cd508d310e9419b1428eb04d90aa2317e2d9f89656d628882f78fffb96fb778c6306ca4bf28c1269a1e
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
- this[thing] = params[thing];
15
+ that[thing] = params[thing];
16
16
 
17
- this.el = this.el ? this.el : this.model.name.toLowerCase() + '_' + this.model.id + '_' + this.attribute.name;
18
- var wrapper = $('<div/>').attr('id', this.el + '_container').addClass('mb_container').css('position', 'relative');
19
- if (this.attribute.wrapper_class)
20
- wrapper.addClass(this.attribute.wrapper_class);
21
- $('#'+this.el).wrap(wrapper);
22
- $('#'+this.el+'_container').empty();
23
- $('#'+this.el+'_container').append($('<input/>')
24
- .attr('id', this.el)
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', this.attribute.fixed_placeholder ? 'empty' : this.attribute.nice_name)
27
- .css('text-align', this.attribute.align)
28
- .val(this.attribute.value)
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 (this.attribute.fixed_placeholder)
31
+ if (that.attribute.fixed_placeholder)
32
32
  {
33
- $('#'+this.el+'_container').append($('<div/>').attr('id', this.el + '_placeholder').addClass('mb_placeholder').append($('<span/>').html(this.attribute.nice_name + ': ')));
34
- $('#'+this.el).css('background', 'transparent');
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 (this.attribute.width) $('#'+this.el).css('width' , this.attribute.width);
37
- if (this.attribute.fixed_placeholder && this.attribute.align != 'right')
38
- {
39
- that.set_placeholder_padding();
40
- //setTimeout(function() {
41
- // var w = $('#'+that.el+'_placeholder').outerWidth();
42
- // $('#'+that.el).attr('placeholder', 'empty').css('padding-left', '+=' + w);//.css('width', '-=' + w);
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 ($('#'+this2.el).val() != this2.attribute.value_clean)
52
- $('#'+this2.el).addClass('mb_dirty');
44
+ if ($('#'+that.el).val() != that.attribute.value_clean)
45
+ $('#'+that.el).addClass('mb_dirty');
53
46
  else
54
- $('#'+this2.el).removeClass('mb_dirty');
47
+ $('#'+that.el).removeClass('mb_dirty');
55
48
  });
56
- $('#'+this.el).on('blur', function() {
57
- if (this2.save_attempts < 1)
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
- this.attribute.value = $('#'+this.el).val();
76
- if (this.attribute.value == this.attribute.value_clean)
62
+ save: function()
63
+ {
64
+ var that = this;
65
+ if (that.save_attempts > 0)
77
66
  return;
78
67
 
79
- this.show_loader();
80
- var this2 = this;
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
- this.binder.save(this.attribute, function(resp) {
83
- this2.save_attempts = 0;
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
- this2.hide_loader();
87
- this2.error(resp.error);
81
+ that.hide_loader();
82
+ that.error(resp.error);
88
83
  }
89
84
  else
90
85
  {
91
- this2.show_check(500);
92
- $('#'+this2.el).val(this2.attribute.value);
93
- $('#'+this2.el).removeClass('mb_dirty');
86
+ that.show_check(500);
87
+ $('#'+that.el).val(that.attribute.value);
88
+ $('#'+that.el).removeClass('mb_dirty');
94
89
 
95
- if (this2.binder.success)
96
- this2.binder.success(this2);
90
+ if (that.binder.success)
91
+ that.binder.success(that);
97
92
  }
98
93
  });
99
94
  },
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.9.30'
2
+ VERSION = '0.9.31'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.30
4
+ version: 0.9.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry