c80_yax 0.1.0.16 → 0.1.0.17

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: ff7af30b89808c3567f9d20865720520850b376f
4
- data.tar.gz: 4cd0728270edb831f2e443b14a1d5089ac574af5
3
+ metadata.gz: b27cb43794e072755dc0e6619628eaebca9dfab5
4
+ data.tar.gz: cb43a6459897d944f7f20132e48811dfd1ce52b6
5
5
  SHA512:
6
- metadata.gz: 8d928f4bd23c9fb7b93a94e6955df20573d46d4397f1187424dce84ef58d431f57d47ef832d08bcc177f47008d57618639831ef1e9ddaf931ee5321202d82451
7
- data.tar.gz: cf4d847d51e6face4c3c839d704a5731019699e81c2bc0bca6631bb6763d480e711188c6d415ae926f25ecb60cdc10e293b1238357a62a03ab5ce0c9ecc9beb8
6
+ metadata.gz: 7189f75edc61815e45465a882c22bd557592225b03b8cccb8e207afeb4386d33e4b5b3db0bd965cb19ec079ec3e10eda0246fec4c8bcf979389add3f1c410425
7
+ data.tar.gz: b9ccc3788c03bb70478fadc1c3c965537b50d4456488ccc18bdec517b71b5d73cf1c817a79bd2eceb21b24f5651aa1d74712a36e8b200b91bdbe838e30a4aed5
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ var _activate_color_selectors = function() {
4
+ $('.item_color_selector').each(function() {
5
+ new ItemColorSelector(this);
6
+ });
7
+ };
8
+
9
+ $(document).ready(function() {
10
+ // alert(ItemColorSelector);
11
+ _activate_color_selectors();
12
+ });
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ var ItemColorSelector = function(wrapper) {
4
+
5
+ var _$wrapper;
6
+ var _$lic;
7
+ var _sel_color;
8
+
9
+ var _set_sel_color = function(new_color) {
10
+ _sel_color = new_color;
11
+ };
12
+
13
+ var _onClickColorBox = function(e) {
14
+ e.preventDefault();
15
+ var $t = $(e.target);
16
+ var t_color = $t.data('color');
17
+ _set_sel_color(t_color);
18
+ _$lic.removeClass('active');
19
+ $t.addClass('active');
20
+ };
21
+
22
+ var _fInitRadioBehaviour = function() {
23
+ _$lic.each(function() {
24
+ $(this).on('click', _onClickColorBox);
25
+ });
26
+ };
27
+
28
+ var _fInit = function(wrapper) {
29
+
30
+ _$wrapper = $(wrapper);
31
+ _$lic = _$wrapper.find('li.c');
32
+
33
+ _fInitRadioBehaviour();
34
+
35
+ };
36
+
37
+ _fInit(wrapper);
38
+
39
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ var _activate_q_picker = function() {
4
+ $('.quantity_picker').each(function() {
5
+ new ItemQuantityPicker(this);
6
+ });
7
+ };
8
+
9
+ $(document).ready(function() {
10
+ // alert(ItemQuantityPicker);
11
+ _activate_q_picker();
12
+ });
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ var ItemQuantityPicker = function (wrapper){
4
+
5
+ var _$wrapper;
6
+ var _$less, _$great, _$input;
7
+ var _cur_val;
8
+
9
+ var _set_cur_val = function (new_val){
10
+ _cur_val = (new_val === 0) ? 1:new_val;
11
+ };
12
+
13
+ var _get_cur_val = function() {
14
+ return _cur_val;
15
+ };
16
+
17
+ var _onClickLess = function(e) {
18
+ console.log('<_onClickLess>');
19
+ _set_cur_val(_cur_val - 1);
20
+ _afterClick();
21
+ e.preventDefault();
22
+ };
23
+
24
+ var _onClickGreat = function(e) {
25
+ console.log('<_onClickGreat>');
26
+ _set_cur_val(Number(_cur_val) + 1);
27
+ _afterClick();
28
+ e.preventDefault();
29
+ };
30
+
31
+ var _afterClick = function() {
32
+ _$input.val(_cur_val);
33
+ };
34
+
35
+ var _onChangeInput = function(e) {
36
+ console.log('<_onChangeInput>');
37
+ };
38
+
39
+ var _fInitBehaviour = function (){
40
+ _$less.on('click', _onClickLess);
41
+ _$great.on('click', _onClickGreat);
42
+ _$input.on('change', _onChangeInput);
43
+ };
44
+
45
+ var _fInit = function (wrapper){
46
+
47
+ _$wrapper = $(wrapper);
48
+ _$less = _$wrapper.find('a.l');
49
+ _$great = _$wrapper.find('a.g');
50
+ _$input = _$wrapper.find('input');
51
+ _cur_val = _$input.val();
52
+
53
+ _fInitBehaviour();
54
+
55
+ };
56
+
57
+ _fInit(wrapper);
58
+
59
+ return {
60
+ get_cur_val: _get_cur_val
61
+ }
62
+
63
+ };
@@ -0,0 +1,32 @@
1
+ ul.item_color_selector {
2
+ @include clearfix;
3
+ margin: 0;
4
+ padding: 0;
5
+ list-style: none;
6
+
7
+ > li {
8
+ float: left;
9
+ margin-right: 5px;
10
+ display: block;
11
+
12
+ &.caption {
13
+ margin-right: 14px;
14
+ }
15
+
16
+ &.c {
17
+ border: 1px solid #B2B2B2;
18
+ width: 25px;
19
+ height: 25px;
20
+ cursor: pointer;
21
+
22
+ &.active {
23
+ border: 2px solid #fc0000;
24
+ }
25
+
26
+ &:hover {
27
+ border: 2px solid #000000;
28
+ }
29
+ }
30
+
31
+ }
32
+ }
@@ -0,0 +1,29 @@
1
+ div.quantity_picker {
2
+
3
+ > .caption {
4
+ padding: 4px 0 0 0 !important;
5
+ }
6
+
7
+ > a {
8
+ @include color_button(#FFFFFF, $red);
9
+ }
10
+
11
+ > input {
12
+ @extend %HelveticaNeueCyrBold;
13
+ width: 50px;
14
+ text-align: center;
15
+ }
16
+
17
+ > * {
18
+ display: inline-block;
19
+ float: left;
20
+
21
+ padding: 2px 11px !important;
22
+ font-size: 17px !important;
23
+ height: 29px !important;
24
+ line-height: 24px !important;
25
+ margin-right: 7px !important;
26
+
27
+ }
28
+
29
+ }
@@ -0,0 +1,19 @@
1
+ module C80Yax
2
+ module Items
3
+ module Shared
4
+ module ColorSelectorHelper
5
+
6
+ def render_color_selector(item)
7
+ colors = item.colors
8
+ unless colors.size.zero?
9
+ render :partial => 'c80_yax/items/color_selector',
10
+ :locals => {
11
+ colors: colors
12
+ }
13
+ end
14
+ end
15
+
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,16 @@
1
+ module C80Yax
2
+ module Items
3
+ module Shared
4
+ module QuantityPickerHelper
5
+
6
+ def render_quantity_picker
7
+ render :partial => 'c80_yax/items/quantity_picker',
8
+ :locals => {
9
+
10
+ }
11
+ end
12
+
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,9 @@
1
+ <ul class="item_color_selector">
2
+ <li class="caption">Цвет: </li>
3
+ <% colors.each do |color| %>
4
+ <% style = "style='background-color: #{color.value}'".html_safe %>
5
+ <% data = "data-color='#{color.value}'".html_safe %>
6
+ <% klass = "class='c c_#{color.id}'".html_safe %>
7
+ <li <%=style%> <%=klass%> <%=data%></li>
8
+ <% end %>
9
+ </ul>
@@ -0,0 +1,6 @@
1
+ <div class="quantity_picker">
2
+ <span class="caption">Количество: </span>
3
+ <%= link_to '-', '#', class: 'l' %>
4
+ <input name="val" id="val" value="1">
5
+ <%= link_to '+', '#', class: 'g' %>
6
+ </div>
@@ -1,3 +1,3 @@
1
1
  module C80Yax
2
- VERSION = '0.1.0.16'
2
+ VERSION = '0.1.0.17'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: c80_yax
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.16
4
+ version: 0.1.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - C80609A
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-19 00:00:00.000000000 Z
11
+ date: 2017-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -138,6 +138,10 @@ files:
138
138
  - app/assets/javascripts/c80_yax.js.coffee
139
139
  - app/assets/javascripts/c80_yax/backend/items.js
140
140
  - app/assets/javascripts/c80_yax/backend/strsubcats.js
141
+ - app/assets/javascripts/c80_yax/frontend/item_color_selector/app.js
142
+ - app/assets/javascripts/c80_yax/frontend/item_color_selector/item_color_selector.js
143
+ - app/assets/javascripts/c80_yax/frontend/item_quantity_picker/app.js
144
+ - app/assets/javascripts/c80_yax/frontend/item_quantity_picker/item_quantity_picker.js
141
145
  - app/assets/javascripts/c80_yax/frontend/more_items_list/app.js
142
146
  - app/assets/javascripts/c80_yax/frontend/more_items_list/more_items_list.js
143
147
  - app/assets/javascripts/c80_yax/lib_backend/collapsable-groups.js
@@ -156,7 +160,9 @@ files:
156
160
  - app/assets/stylesheets/c80_yax/backend/jquery-my-dialog.scss
157
161
  - app/assets/stylesheets/c80_yax/elems/add_to_bucket.scss
158
162
  - app/assets/stylesheets/c80_yax/elems/cats_iconed_list.scss
163
+ - app/assets/stylesheets/c80_yax/elems/item_color_selector.scss
159
164
  - app/assets/stylesheets/c80_yax/elems/item_images_no_main.scss
165
+ - app/assets/stylesheets/c80_yax/elems/item_quantity_picker.scss
160
166
  - app/assets/stylesheets/c80_yax/elems/more_items_list.scss
161
167
  - app/assets/stylesheets/c80_yax/elems/more_items_list_loading.scss
162
168
  - app/assets/stylesheets/c80_yax/elems/ul_item_index.scss
@@ -176,7 +182,9 @@ files:
176
182
  - app/helpers/c80_yax/items/render_show_item_helper.rb
177
183
  - app/helpers/c80_yax/items/shared/asterix_helper.rb
178
184
  - app/helpers/c80_yax/items/shared/buy_options_helper.rb
185
+ - app/helpers/c80_yax/items/shared/color_selector_helper.rb
179
186
  - app/helpers/c80_yax/items/shared/item_view_helper.rb
187
+ - app/helpers/c80_yax/items/shared/quantity_picker_helper.rb
180
188
  - app/helpers/c80_yax/prop_name_helper.rb
181
189
  - app/helpers/c80_yax/strsubcats/props_helper.rb
182
190
  - app/helpers/c80_yax/uom_helper.rb
@@ -208,7 +216,9 @@ files:
208
216
  - app/views/c80_yax/ajax/fetch_items.js.erb
209
217
  - app/views/c80_yax/cats/_cats_iconed_list.html.erb
210
218
  - app/views/c80_yax/items/_buy_options.html.erb
219
+ - app/views/c80_yax/items/_color_selector.html.erb
211
220
  - app/views/c80_yax/items/_index.html.erb
221
+ - app/views/c80_yax/items/_quantity_picker.html.erb
212
222
  - bin/console
213
223
  - bin/setup
214
224
  - c80_yax.gemspec