pageflow-progress-navigation-bar 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.scss-lint.yml +147 -0
  3. data/CHANGELOG.md +29 -0
  4. data/Gemfile +0 -6
  5. data/README.md +2 -2
  6. data/app/assets/javascript/pageflow/progress_navigation_bar.js +7 -1
  7. data/app/assets/javascript/pageflow/progress_navigation_bar/widget.js +97 -43
  8. data/app/assets/stylesheets/pageflow/{progress_navigation_bar.css.scss → progress_navigation_bar.scss} +33 -195
  9. data/app/assets/stylesheets/pageflow/progress_navigation_bar/animations2.scss +82 -0
  10. data/app/assets/stylesheets/pageflow/progress_navigation_bar/cross_dependant_styles.scss +37 -0
  11. data/app/assets/stylesheets/pageflow/progress_navigation_bar/horizontal.scss +234 -0
  12. data/app/assets/stylesheets/pageflow/progress_navigation_bar/mixins.scss +54 -0
  13. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default.scss +273 -0
  14. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/buttons.scss +22 -0
  15. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/credits.scss +9 -0
  16. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/icons/icon_font.scss +206 -0
  17. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/icons/sprite.scss +152 -0
  18. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/menu_boxes.scss +42 -0
  19. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/share_box.scss +9 -0
  20. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/typography.scss +90 -0
  21. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default/widget_margin.scss +23 -0
  22. data/app/assets/stylesheets/pageflow/progress_navigation_bar/vertical.scss +97 -0
  23. data/app/views/pageflow/progress_navigation_bar/_widget.html.erb +7 -3
  24. data/app/views/pageflow/progress_navigation_bar/widget/_bar_top.html.erb +6 -22
  25. data/app/views/pageflow/progress_navigation_bar/widget/_overview_button.html.erb +8 -0
  26. data/app/views/pageflow/progress_navigation_bar/widget/_page.html.erb +1 -2
  27. data/config/locales/de.yml +4 -1
  28. data/config/locales/en.yml +4 -1
  29. data/lib/pageflow-progress-navigation-bar.rb +9 -1
  30. data/lib/pageflow/progress_navigation_bar/horizontal_widget_type.rb +17 -0
  31. data/lib/pageflow/progress_navigation_bar/version.rb +1 -1
  32. data/lib/pageflow/progress_navigation_bar/vertical_widget_type.rb +17 -0
  33. data/lib/pageflow/progress_navigation_bar/widget_type.rb +5 -4
  34. data/pageflow-progress-navigation-bar.gemspec +2 -2
  35. metadata +26 -10
  36. data/app/assets/stylesheets/pageflow/cross_dependant_styles.css.scss +0 -35
  37. data/app/assets/stylesheets/pageflow/progress_navigation_bar/themes/default.css.scss +0 -345
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80610bc20007bcc35f9ed886be7094fa633481f2
4
- data.tar.gz: 3a0cd81da1e019605426480fccea45a2382594a9
3
+ metadata.gz: 2bf226056a886479d66b2b40cc869dda62f79f40
4
+ data.tar.gz: a09b16ff39b92b94e5ef5d474ed342376bb99426
5
5
  SHA512:
6
- metadata.gz: e057b25d3762ceebf476cad147158041f3829efdb88d9d1394310e82ac1ace5f3200dd3466871414fe47c1b3f6825a1f6b916ca6a53d34ba199304cb53f38209
7
- data.tar.gz: 7866f04a7dfa3539302c205d0efe895f57de9e6eb0adb173a7cb6fb77f5ce2f3dc8b02190fca3f9341436470c056ff66a9daa7fb9f86b7e3188ff191c639f05f
6
+ metadata.gz: 2fc124cf313ddee6fa30a9aa1ac089f93de165b12caffd854f6a171d4865a7032a745e357a8259b5413115a90068c5116d8846a3d22e20f4bf01021af117334a
7
+ data.tar.gz: 914a9310f21d21faecefc4df2589cd8e8f8a8aba09287f282b7b6ae72fbceafa86f69806d3d18a058cac96b06bfc57aa9fae03b63e8f4be4704fa4a22864d7b5
@@ -0,0 +1,147 @@
1
+ scss_files: "**/*.scss"
2
+ linters:
3
+ BangFormat:
4
+ enabled: true
5
+ space_before_bang: true
6
+ space_after_bang: false
7
+ BorderZero:
8
+ enabled: false
9
+ convention: zero
10
+ ColorKeyword:
11
+ enabled: true
12
+ severity: warning
13
+ ColorVariable:
14
+ enabled: true
15
+ Comment:
16
+ enabled: true
17
+ DebugStatement:
18
+ enabled: true
19
+ DeclarationOrder:
20
+ enabled: false
21
+ DuplicateProperty:
22
+ enabled: true
23
+ ElsePlacement:
24
+ enabled: true
25
+ style: same_line
26
+ EmptyLineBetweenBlocks:
27
+ enabled: true
28
+ ignore_single_line_blocks: true
29
+ EmptyRule:
30
+ enabled: true
31
+ FinalNewline:
32
+ enabled: true
33
+ present: true
34
+ HexLength:
35
+ enabled: false
36
+ style: short
37
+ HexNotation:
38
+ enabled: true
39
+ style: lowercase
40
+ HexValidation:
41
+ enabled: true
42
+ IdSelector:
43
+ enabled: true
44
+ ImportantRule:
45
+ enabled: true
46
+ ImportPath:
47
+ enabled: true
48
+ leading_underscore: false
49
+ filename_extension: false
50
+ Indentation:
51
+ enabled: true
52
+ allow_non_nested_indentation: false
53
+ character: space
54
+ width: 2
55
+ LeadingZero:
56
+ enabled: true
57
+ style: include_zero
58
+ MergeableSelector:
59
+ enabled: true
60
+ force_nesting: true
61
+ NameFormat:
62
+ enabled: true
63
+ allow_leading_underscore: true
64
+ convention: hyphenated_lowercase
65
+ placeholder_convention: "^[-a-z_]+$"
66
+ mixin_convention: "^[-a-z_]+$"
67
+ NestingDepth:
68
+ enabled: true
69
+ max_depth: 4
70
+ severity: warning
71
+ PlaceholderInExtend:
72
+ enabled: false
73
+ PropertyCount:
74
+ enabled: true
75
+ include_nested: false
76
+ max_properties: 10
77
+ PropertySortOrder:
78
+ enabled: false
79
+ ignore_unspecified: false
80
+ severity: warning
81
+ separate_groups: false
82
+ PropertySpelling:
83
+ enabled: true
84
+ extra_properties: []
85
+ QualifyingElement:
86
+ enabled: false
87
+ allow_element_with_attribute: false
88
+ allow_element_with_class: false
89
+ allow_element_with_id: false
90
+ severity: warning
91
+ SelectorDepth:
92
+ enabled: true
93
+ max_depth: 3
94
+ severity: warning
95
+ SelectorFormat:
96
+ enabled: true
97
+ convention: "^[-a-z0-9_]+$"
98
+ Shorthand:
99
+ enabled: false
100
+ severity: warning
101
+ SingleLinePerProperty:
102
+ enabled: true
103
+ allow_single_line_rule_sets: true
104
+ SingleLinePerSelector:
105
+ enabled: true
106
+ SpaceAfterComma:
107
+ enabled: true
108
+ SpaceAfterPropertyColon:
109
+ enabled: true
110
+ style: one_space
111
+ SpaceAfterPropertyName:
112
+ enabled: true
113
+ SpaceBeforeBrace:
114
+ enabled: true
115
+ style: space
116
+ allow_single_line_padding: false
117
+ SpaceBetweenParens:
118
+ enabled: true
119
+ spaces: 0
120
+ StringQuotes:
121
+ enabled: true
122
+ style: double_quotes
123
+ TrailingSemicolon:
124
+ enabled: true
125
+ TrailingZero:
126
+ enabled: false
127
+ UnnecessaryMantissa:
128
+ enabled: true
129
+ UnnecessaryParentReference:
130
+ enabled: true
131
+ UrlFormat:
132
+ enabled: true
133
+ UrlQuotes:
134
+ enabled: true
135
+ VariableForProperty:
136
+ enabled: false
137
+ properties: []
138
+ VendorPrefixes:
139
+ enabled: true
140
+ identifier_list: bourbon
141
+ include: []
142
+ exclude: []
143
+ ZeroUnit:
144
+ enabled: true
145
+ severity: warning
146
+ Compass::PropertyWithMixin:
147
+ enabled: false
@@ -1,5 +1,34 @@
1
1
  # CHANGELOG
2
2
 
3
+ ### Version 0.5.0
4
+
5
+ 2016-09-09
6
+
7
+ [Compare changes](https://github.com/codevise/pageflow-progress-navigation-bar/compare/v0.4.0...v0.5.0)
8
+
9
+ - Add configurable pictogram visibility
10
+ ([#20](https://github.com/codevise/pageflow-progress-navigation-bar/pull/20))
11
+ - Fix volume up/down icons
12
+ ([#19](https://github.com/codevise/pageflow-progress-navigation-bar/pull/19))
13
+ - Also apply transparent bg color for horizontal bar
14
+ ([#18](https://github.com/codevise/pageflow-progress-navigation-bar/pull/18))
15
+ - Prevent hover effect for deactivated top button
16
+ ([#17](https://github.com/codevise/pageflow-progress-navigation-bar/pull/17))
17
+ - Make link and menu box colors configurable
18
+ ([#16](https://github.com/codevise/pageflow-progress-navigation-bar/pull/16))
19
+ - Horizontal navigation bar
20
+ ([#15](https://github.com/codevise/pageflow-progress-navigation-bar/pull/15))
21
+ - Use share links partials from pageflow gem
22
+ ([#14](https://github.com/codevise/pageflow-progress-navigation-bar/pull/14))
23
+ - Add theme options to control display of hide text button
24
+ ([#24](https://github.com/codevise/pageflow-progress-navigation-bar/pull/24))
25
+ - Make typography configurable in theme
26
+ ([#23](https://github.com/codevise/pageflow-progress-navigation-bar/pull/23))
27
+ - Rename .css.scss files to only .scss
28
+ ([#22](https://github.com/codevise/pageflow-progress-navigation-bar/pull/22))
29
+ - Fix icon font volume icons
30
+ ([#21](https://github.com/codevise/pageflow-progress-navigation-bar/pull/21))
31
+
3
32
  ### Version 0.4.0
4
33
 
5
34
  2016-06-09
data/Gemfile CHANGED
@@ -2,9 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in chart.gemspec
4
4
  gemspec
5
-
6
- # Rails 4 compat
7
- gem 'activeadmin', git: 'https://github.com/codevise/active_admin.git', branch: 'rails4'
8
- gem 'ransack'
9
- gem 'inherited_resources', '1.4.1'
10
- gem 'formtastic', '2.3.0.rc2'
data/README.md CHANGED
@@ -21,11 +21,11 @@ Include javascripts and stylesheets:
21
21
  # app/assets/javascripts/pageflow/application.js
22
22
  //= require pageflow/progress_navigation_bar
23
23
 
24
- # app/assets/stylesheets/pageflow/application.css.scss
24
+ # app/assets/stylesheets/pageflow/application.scss
25
25
  @import "pageflow/progress_navigation_bar";
26
26
 
27
27
  # Adding basic style to your theme
28
- # app/assets/stylesheets/pageflow/themes/default.css.scss
28
+ # app/assets/stylesheets/pageflow/themes/default.scss
29
29
  @import "pageflow/progress_navigation_bar/themes/default";
30
30
 
31
31
  Execute `bundle install` Restart the application server.
@@ -5,4 +5,10 @@ pageflow.widgetTypes.register('progress_navigation_bar', {
5
5
  enhance: function(element) {
6
6
  element.progressNavigationBar();
7
7
  }
8
- });
8
+ });
9
+
10
+ pageflow.widgetTypes.register('progress_navigation_bar_horizontal', {
11
+ enhance: function(element) {
12
+ element.progressNavigationBar();
13
+ }
14
+ });
@@ -2,6 +2,48 @@
2
2
 
3
3
  (function($) {
4
4
  $.widget('pageflow.progressNavigationBar', {
5
+
6
+ _toggleNavigationBar: function() {
7
+ if (this.element.hasClass('horizontal')) {
8
+ var button = $('.header_button .button');
9
+ if (button.hasClass('close')) {
10
+ $('.scroller').show();
11
+ } else {
12
+ $('.scroller').hide();
13
+ }
14
+ button.toggleClass('close');
15
+ }
16
+ },
17
+
18
+ _resizeDots: function() {
19
+ var dots = $('.navigation_dots a', this.element),
20
+ pageDotsMaxSize = 20,
21
+ pageDotsMinSize = 1;
22
+
23
+ if (this.element.hasClass('horizontal')) {
24
+ var maxBarWidth = $('.navigation_dots').width();
25
+ var wantedWidth = Math.floor(maxBarWidth / dots.filter(':not(.filtered)').length);
26
+ var appliedWidth = (wantedWidth > pageDotsMaxSize) ? pageDotsMaxSize :
27
+ (wantedWidth < pageDotsMinSize) ? pageDotsMinSize : wantedWidth - 1;
28
+
29
+ $('.navigation_dots > li').css('width', appliedWidth + 'px').css('height', '');
30
+ }
31
+ else {
32
+ var maxBarHeight = $('#outer_wrapper').height() ? $('#outer_wrapper').height() : $('main').height(),
33
+ wantedHeight = maxBarHeight / dots.filter(':not(.filtered)').length,
34
+ appliedHeight = pageDotsMinSize;
35
+
36
+ if (wantedHeight <= pageDotsMaxSize && wantedHeight > pageDotsMinSize) {
37
+ appliedHeight = wantedHeight;
38
+ }
39
+ else if (wantedHeight > pageDotsMinSize) {
40
+ appliedHeight = pageDotsMaxSize;
41
+ }
42
+
43
+ $('.navigation_dots > li').css('height', Math.floor(appliedHeight) + 'px').css('width', '');
44
+ }
45
+ },
46
+
5
47
  _create: function() {
6
48
  var overlays = this.element.find('.navigation_site_detail'),
7
49
  that = this,
@@ -9,10 +51,13 @@
9
51
 
10
52
  this.element.addClass('js').append(overlays);
11
53
 
54
+ this.element.toggleClass('horizontal', this.element.data('widget') === 'progress_navigation_bar_horizontal');
55
+ this.element.toggleClass('vertical', this.element.data('widget') !== 'progress_navigation_bar_horizontal');
56
+
12
57
  $('a.navigation_top', this.element).topButton();
13
58
 
14
59
  $('.navigation_bar_bottom', this.element)
15
- .append($('.navigation_bar_top > li', this.element).slice(hasHomeButton ? 4 : 3));
60
+ .append($('.navigation_bar_top > li', this.element).slice(hasHomeButton ? 4 : 3));
16
61
 
17
62
  pageflow.slides.on('slideshowchangepage', function() {
18
63
  that.element.addClass('show_on_mobile');
@@ -21,8 +66,12 @@
21
66
  }, 1000);
22
67
  });
23
68
 
24
- that.element.on('mouseenter', function() { that.element.addClass('hover'); });
25
- that.element.on('mouseleave', function() { that.element.removeClass('hover'); });
69
+ that.element.on('mouseenter', function() {
70
+ that.element.addClass('hover');
71
+ });
72
+ that.element.on('mouseleave', function() {
73
+ that.element.removeClass('hover');
74
+ });
26
75
 
27
76
  /* keyboard / skiplinks */
28
77
 
@@ -36,23 +85,23 @@
36
85
 
37
86
  /* Volume */
38
87
  that.element.find('.navigation_volume_box').volumeSlider({
39
- orientation: 'v'
88
+ orientation: that.element.hasClass('horizontal') ? 'h' : 'v'
40
89
  });
41
90
  that.element.find('.navigation_mute').muteButton();
42
91
 
43
92
  /* hide buttons on mobile devices */
44
93
  if (pageflow.features.has('mobile platform')) {
45
94
  that.element.find('.navigation_butten_area').hide();
46
-
47
95
  }
48
96
 
49
97
  /* header button */
50
98
  $('.navigation_main', this.element).click(function() {
51
99
  $(this)
52
- .toggleClass('active')
53
- .updateTitle();
100
+ .toggleClass('active')
101
+ .updateTitle();
54
102
  $('.header').toggleClass('active');
55
103
  that.element.toggleClass('header_active');
104
+ that._toggleNavigationBar();
56
105
  });
57
106
 
58
107
  /* open header through skiplinks */
@@ -60,18 +109,22 @@
60
109
  $('.navigation_main', that.element).addClass('active');
61
110
  $('.header').addClass('active');
62
111
  $(this.getAttribute('href')).select();
112
+ that._toggleNavigationBar();
63
113
  });
64
114
 
65
115
  /* share-button */
66
116
  $('.navigation_menu .navigation_menu_box a', this.element).focus(function() {
67
- $(this).parent().parent().addClass('focused');
117
+ $(this).parents('.navigation_menu').addClass('focused');
68
118
  }).blur(function() {
69
- $(this).parent().parent().removeClass('focused');
119
+ $(this).parents('.navigation_menu').removeClass('focused');
120
+ });
121
+ $('.navigation_menu_box', this.element).on('mouseleave', function() {
122
+ $(this).parents('.navigation_menu').removeClass('focused');
70
123
  });
71
124
 
72
125
  var shareBox = $('.navigation_share_box', this.element),
73
126
  links = $('> a', shareBox);
74
- shareBox.shareMenu({
127
+ shareBox.shareMenu({
75
128
  subMenu: $('.sub_share', shareBox),
76
129
  links: links,
77
130
  insertAfter: links.last(),
@@ -80,7 +133,7 @@
80
133
 
81
134
  /* pages */
82
135
  var pageLinks = $('.navigation_dots a', that.element),
83
- target;
136
+ target;
84
137
 
85
138
  function registerHandler() {
86
139
  target = $(this);
@@ -107,8 +160,25 @@
107
160
  pageLinks.each(function(index) {
108
161
  var handlerIn = function() {
109
162
  if (!('ontouchstart' in document.documentElement)) {
110
- var calculatedOffset = $(this).offset().top + $(overlays[index]).outerHeight() > $('.progress_navigation_bar').height() ? $('.progress_navigation_bar').height() - $(overlays[index]).outerHeight() : $(this).offset().top;
111
- $(overlays[index]).css("top", calculatedOffset).addClass('visible').removeClass('hidden');
163
+ if (that.element.hasClass('horizontal')) {
164
+ var offset = 204;
165
+ var left = $(this).offset().left;
166
+ var right = left + offset;
167
+ var width = $('.progress_navigation_bar').width();
168
+ var calculatedOffsetLeft = left;
169
+ if (right > width) {
170
+ calculatedOffsetLeft = width - offset;
171
+ }
172
+
173
+ $(overlays[index]).css('left', calculatedOffsetLeft).css('top', '').addClass('visible').removeClass('hidden');
174
+ }
175
+ else {
176
+ var calculatedOffsetTop = $(this).offset().top + $(overlays[index]).outerHeight()
177
+ > $('.progress_navigation_bar').height() ? $('.progress_navigation_bar').height()
178
+ - $(overlays[index]).outerHeight() : $(this).offset().top;
179
+
180
+ $(overlays[index]).css('top', calculatedOffsetTop).css('left', '').addClass('visible').removeClass('hidden');
181
+ }
112
182
  }
113
183
  };
114
184
 
@@ -120,41 +190,24 @@
120
190
  });
121
191
  });
122
192
 
123
- var resizeDots = function() {
124
- var pageDotsMaxHeight = 20,
125
- pageDotsMinHeight = 1,
126
- maxBarHeight = $('#outer_wrapper').height() ? $('#outer_wrapper').height() : $('main').height(),
127
- wantedHeight = maxBarHeight / pageLinks.filter(':not(.filtered)').length,
128
- appliedHeight = pageDotsMinHeight;
193
+ this._resizeDots();
129
194
 
130
- if (wantedHeight <= pageDotsMaxHeight && wantedHeight > pageDotsMinHeight) {
131
- appliedHeight = wantedHeight;
132
- }
133
- else if(wantedHeight > pageDotsMinHeight) {
134
- appliedHeight = pageDotsMaxHeight;
135
- }
136
-
137
- $('.navigation_dots > li').css('height', Math.floor(appliedHeight) + 'px');
138
- };
139
-
140
- resizeDots();
141
-
142
- $(window).on('resize', function () {
143
- $(overlays).css("top","0");
144
- resizeDots();
195
+ $(window).on('resize', function() {
196
+ $(overlays).css("top", "0");
197
+ that._resizeDots();
145
198
  });
146
199
 
147
- $('.scroller', this.element).each(function () {
200
+ $('.scroller', this.element).each(function() {
148
201
  var scrollerOptions = {
149
202
  mouseWheel: true,
150
- bounce : false,
151
- probeType : 2
203
+ bounce: false,
204
+ probeType: 2
152
205
  };
153
206
 
154
207
  /*
155
- This is just a quick fix to detect IE10. We should
156
- refactor this condition if we decide to use Modernizr
157
- or another more global detection.
208
+ This is just a quick fix to detect IE10. We should
209
+ refactor this condition if we decide to use Modernizr
210
+ or another more global detection.
158
211
  */
159
212
  if (window.navigator.msPointerEnabled) {
160
213
  scrollerOptions.preventDefault = false;
@@ -166,7 +219,7 @@
166
219
  scroller: scroller,
167
220
  scrollToActive: true,
168
221
  animationDuration: 400,
169
- onFilterChange: resizeDots
222
+ onFilterChange: that._resizeDots()
170
223
  });
171
224
 
172
225
  });
@@ -187,8 +240,8 @@
187
240
  var fs = $('.navigation_fullscreen', this.element),
188
241
  fullscreenCallback = function(isFullScreen) {
189
242
  fs
190
- .toggleClass('active', !!isFullScreen)
191
- .updateTitle();
243
+ .toggleClass('active', !!isFullScreen)
244
+ .updateTitle();
192
245
  };
193
246
 
194
247
  fs.click(function() {
@@ -220,6 +273,7 @@
220
273
  $('body').off('touchstart', close);
221
274
  }
222
275
  }
276
+
223
277
  $('body').on('touchstart', close);
224
278
  }
225
279
  });