nail_polish 0.1.1 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +2 -4
  3. data/app/assets/images/nail_polish/elements/link_action.png +0 -0
  4. data/app/assets/images/nail_polish/elements/white_down_arrow.png +0 -0
  5. data/app/assets/javascripts/nail_polish.js +6 -1
  6. data/app/assets/javascripts/nail_polish/app.js +32 -18
  7. data/app/assets/javascripts/nail_polish/events.js +2 -0
  8. data/app/assets/javascripts/nail_polish/model.js +49 -0
  9. data/app/assets/javascripts/nail_polish/models/dropdown.js +9 -0
  10. data/app/assets/javascripts/nail_polish/models/menu.js +1 -0
  11. data/app/assets/javascripts/nail_polish/nail_polish.js +2 -0
  12. data/app/assets/javascripts/nail_polish/presenter.js +34 -7
  13. data/app/assets/javascripts/nail_polish/presenter_with_errors.js +61 -0
  14. data/app/assets/javascripts/nail_polish/presenters/dropdown.js +7 -12
  15. data/app/assets/javascripts/nail_polish/presenters/menu.js +7 -0
  16. data/app/assets/javascripts/nail_polish/router.js +23 -13
  17. data/app/assets/javascripts/nail_polish/templates/dropdown.mustache +14 -0
  18. data/app/assets/javascripts/nail_polish/templates/menu.mustache +22 -0
  19. data/app/assets/javascripts/nail_polish/templates/modal.mustache +5 -0
  20. data/app/assets/javascripts/nail_polish/utils/subview_manager.js +28 -0
  21. data/app/assets/javascripts/nail_polish/validator.js +147 -0
  22. data/app/assets/javascripts/nail_polish/view.js +17 -8
  23. data/app/assets/javascripts/nail_polish/views/form.js +44 -0
  24. data/app/assets/javascripts/nail_polish/widget/dropdown.js +37 -9
  25. data/app/assets/javascripts/nail_polish/widget/flash.js +8 -8
  26. data/app/assets/javascripts/nail_polish/widget/menu.js +61 -0
  27. data/app/assets/javascripts/nail_polish/widget/modal.js +35 -5
  28. data/app/assets/javascripts/nail_polish_widgets.js +1 -0
  29. data/app/assets/stylesheets/nail_polish/base.scss +1 -1
  30. data/app/assets/stylesheets/nail_polish/base/buttons.scss +5 -0
  31. data/app/assets/stylesheets/nail_polish/base/form_elements.scss +15 -1
  32. data/app/assets/stylesheets/nail_polish/base/grid.scss +8 -6
  33. data/app/assets/stylesheets/nail_polish/base/layout.scss +3 -2
  34. data/app/assets/stylesheets/nail_polish/base/oo_styles.scss +37 -2
  35. data/app/assets/stylesheets/nail_polish/base/reset.scss +5 -0
  36. data/app/assets/stylesheets/nail_polish/base/typography_and_tags.scss +4 -0
  37. data/app/assets/stylesheets/nail_polish/desktop.scss +1 -1
  38. data/app/assets/stylesheets/nail_polish/desktop/grid.scss +6 -1
  39. data/app/assets/stylesheets/nail_polish/desktop/widgets/menu.scss +61 -0
  40. data/app/assets/stylesheets/nail_polish/tablet.scss +0 -1
  41. data/app/assets/stylesheets/nail_polish/tablet/grid.scss +3 -0
  42. data/lib/nail_polish/version.rb +1 -1
  43. metadata +43 -14
@@ -1,18 +1,27 @@
1
1
  NailPolish.Widget.Modal = NailPolish.View.extend({
2
+ parent: 'body',
2
3
  parentSelector: '#overlay-container',
3
4
  attachmentMethod: 'html',
4
5
 
5
6
  events: function () {
6
7
  _.extend(this.addListeners, {
7
- 'click .close-modal': 'close'
8
+ 'click .close-modal': 'close',
9
+ 'click .cancel-link a': 'close',
10
+ 'click #overlay': 'verifyTargetAndClose'
8
11
  });
9
12
 
10
13
  return NailPolish.View.prototype.events.apply(this);
11
14
  },
12
15
 
16
+ verifyTargetAndClose: function (e) {
17
+ if($(e.target).is('#overlay')) {
18
+ this.close();
19
+ }
20
+ },
21
+
13
22
  renderTemplate: function () {
14
23
  // switch declared template into a partial for consistent usage
15
- var template = HoganTemplates['modal'];
24
+ var template = HoganTemplates['nail_polish/templates/modal'];
16
25
  var partials = _.extend(this.partials(), {
17
26
  modal_content: HoganTemplates[this.templateName]
18
27
  });
@@ -22,7 +31,9 @@ NailPolish.Widget.Modal = NailPolish.View.extend({
22
31
 
23
32
  render: function() {
24
33
  NailPolish.View.prototype.render.apply(this);
34
+ this.freezeBody();
25
35
  this.addListenerForClose();
36
+ this.setPosition();
26
37
  },
27
38
 
28
39
  addListenerForClose: function() {
@@ -30,11 +41,30 @@ NailPolish.Widget.Modal = NailPolish.View.extend({
30
41
  },
31
42
 
32
43
  close: function (e) {
44
+ if(e){
45
+ e.preventDefault(); // This is necessary to prevent clicking on elements behind the modal
46
+ }
33
47
  NailPolish.Events.unsubscribe('page:new', this.close, this);
48
+ $('body').removeClass('no-scroll');
34
49
  this.remove();
35
- this.onClose()
50
+ this.onClose();
36
51
  },
37
52
 
38
- onClose: function() {} // to be implemented by subclasses
39
- });
53
+ onClose: function() {}, // to be implemented by subclasses
54
+
55
+ windowHeight: function () {
56
+ return $(window).height();
57
+ },
40
58
 
59
+ setPosition: function () {
60
+ var $modal = this.$('.modal');
61
+
62
+ if ($modal.height()+100 < this.windowHeight() ){
63
+ $modal.css('top', '100px');
64
+ }
65
+ },
66
+
67
+ freezeBody: function() {
68
+ $('body').addClass('no-scroll');
69
+ }
70
+ });
@@ -1,3 +1,4 @@
1
1
  //= require nail_polish/widget/flash
2
2
  //= require nail_polish/widget/modal
3
3
  //= require nail_polish/widget/dropdown
4
+ //= require nail_polish/widget/menu
@@ -1,7 +1,7 @@
1
1
  @import 'compass/css3';
2
2
  @import "compass/css3/hyphenation";
3
-
4
3
  @import "base/reset";
4
+
5
5
  @import "base/variables";
6
6
  @import 'base/colors';
7
7
  @import 'base/mixins';
@@ -77,4 +77,9 @@ div.button {
77
77
  &.small {
78
78
  @include small-text;
79
79
  }
80
+
81
+ &.thin {
82
+ @include small-text;
83
+ padding: $spacing*0.6 $spacing*2.2;
84
+ }
80
85
  }
@@ -84,7 +84,21 @@ textarea {
84
84
  }
85
85
 
86
86
  form {
87
- &.error {
87
+ .error-message {
88
+ display: none;
89
+ }
90
+
91
+ .error {
92
+ .error-message {
93
+ display: block;
94
+ padding: 0;
95
+ padding-top: 3px;
96
+ }
97
+
98
+ .file-input {
99
+ border: 1px solid $error-color;
100
+ }
101
+
88
102
  input[type=text],
89
103
  input[type=password],
90
104
  input[type=email],
@@ -5,7 +5,7 @@
5
5
  }
6
6
  .unit{float:left;}
7
7
  .unit-right{float:right;}
8
- .size1of1{width:100%;float:none;}
8
+ .size1of1{width:100%;}
9
9
  .size1of2{width:50%;}
10
10
  .size1of3{width:33.33333%;}
11
11
  .size2of3{width:66.66666%;}
@@ -18,29 +18,31 @@
18
18
  .size1of6{width:16.66666%;}
19
19
  .size4of6{width:66.66666%;}
20
20
  .size5of6{width:83.33333%;}
21
+ .size1of8{width: 12.5%;}
21
22
  .size1of10{width:10%;}
22
23
  .size3of10{width:30%;}
23
24
  .size7of10{width:70%;}
24
25
  .size9of10{width: 90%}
25
26
  .size1of20{width:5%;}
26
27
 
28
+
27
29
  .last-unit{float:none;width:auto;_position:relative;_left:-3px;_margin-right:-3px;}
28
30
 
29
31
  .inner {
30
32
  padding: $spacing;
31
33
  @include line;
32
-
33
- &.half {
34
- padding: $spacing * 0.5;
35
- }
36
34
  }
37
35
 
38
36
  .spacer {
39
37
  width: $spacing;
40
38
  height: $spacing;
39
+
40
+ &.half {
41
+ width: $spacing / 2;
42
+ height: $spacing / 2;
43
+ }
41
44
  }
42
45
 
43
46
  .s-hidden {
44
47
  display: none;
45
48
  }
46
-
@@ -3,7 +3,8 @@ body {
3
3
  }
4
4
 
5
5
  #overlay {
6
- position: absolute;
6
+ position: fixed;
7
+ overflow-y: scroll;
7
8
  top: 0;
8
9
  bottom: 0;
9
10
  left: 0;
@@ -20,4 +21,4 @@ body {
20
21
  @include box-shadow(0px 0px 5px rgba(0,0,0,0.25));
21
22
  width: 100%;
22
23
  }
23
- }
24
+ }
@@ -6,10 +6,24 @@
6
6
  overflow: visible;
7
7
  }
8
8
 
9
+ .hidden-overflow {
10
+ overflow: hidden;
11
+ }
12
+
13
+ .no-scroll {
14
+ overflow: hidden;
15
+ }
16
+
9
17
  .rounded {
10
18
  @include rounded;
11
19
  }
12
20
 
21
+ .round {
22
+ height: $spacing * 3.2;
23
+ width: $spacing * 3.2;
24
+ border-radius: 50%;
25
+ }
26
+
13
27
  .bordered {
14
28
  @include bordered;
15
29
  }
@@ -46,7 +60,7 @@
46
60
  font-weight: bold;
47
61
  }
48
62
 
49
- .light-text{
63
+ .light-text {
50
64
  color: $neutral-base-color;
51
65
  }
52
66
 
@@ -55,6 +69,11 @@
55
69
  @include text-shadow(1px 1px 0px $body-color);
56
70
  }
57
71
 
72
+ .light-headline-shadowless {
73
+ color: $light-color;
74
+ @include text-shadow(none);
75
+ }
76
+
58
77
  /* this is for page-width sections of the page */
59
78
  .page-inner {
60
79
  @include line;
@@ -90,6 +109,10 @@
90
109
  background-color: $accent-button-base-color;
91
110
  }
92
111
 
112
+ .light-background {
113
+ background-color: $neutral-superlight-color;
114
+ }
115
+
93
116
  /* These three styles aren't very descriptive should have text appended */
94
117
  .small {
95
118
  @include small-text;
@@ -117,4 +140,16 @@
117
140
 
118
141
  .italic {
119
142
  font-style: italic;
120
- }
143
+ }
144
+
145
+ .absolute {
146
+ position: absolute;
147
+ }
148
+
149
+ .relative {
150
+ position: relative;
151
+ }
152
+
153
+ .pointer-cursor {
154
+ cursor: pointer;
155
+ }
@@ -47,6 +47,11 @@ input, textarea, button {
47
47
  background-color: transparent;
48
48
  -webkit-appearance: none;
49
49
  }
50
+
51
+ input[type="radio"] {
52
+ -webkit-appearance: radio;
53
+ }
54
+
50
55
  img {
51
56
  display: block;
52
57
  }
@@ -10,6 +10,10 @@ body {
10
10
  h1, h2, h3, h4, h5, h6, p {
11
11
  font-weight: normal;
12
12
  padding-bottom: $em*0.5;
13
+
14
+ .no-padding {
15
+ padding: 0px;
16
+ }
13
17
  }
14
18
 
15
19
  h1, h2, h3 {
@@ -1,6 +1,5 @@
1
1
  @import 'compass/css3';
2
2
 
3
- @import "base/reset";
4
3
  @import "base/variables";
5
4
  @import 'base/colors';
6
5
  @import 'base/mixins';
@@ -10,3 +9,4 @@
10
9
  @import 'desktop/layout';
11
10
  @import 'desktop/oo_styles';
12
11
  @import 'desktop/widgets/modal';
12
+ @import 'desktop/widgets/menu';
@@ -3,6 +3,7 @@
3
3
 
4
4
  .l-unit{float:left;}
5
5
  .l-unit-right{float:right;}
6
+ .l-1of1{width:100%;}
6
7
  .l-1of2{width:50%;}
7
8
  .l-1of3{width:33.33333%;}
8
9
  .l-2of3{width:66.66666%;}
@@ -26,4 +27,8 @@
26
27
 
27
28
  .l-hidden {
28
29
  display: none;
29
- }
30
+ }
31
+
32
+ .hidden {
33
+ display: none;
34
+ }
@@ -0,0 +1,61 @@
1
+ .menu-container {
2
+ .menu-item-wrapper {
3
+ position: relative;
4
+ z-index: 100;
5
+
6
+ h3 {
7
+ padding-bottom: 0;
8
+ text-shadow: none;
9
+ }
10
+ }
11
+
12
+ .menu-items {
13
+ @include border-radius;
14
+ background-color: $light-color;
15
+ border: 1px solid $neutral-light-color;
16
+ position: absolute;
17
+ top: 56px;
18
+ width: 213px;
19
+ }
20
+
21
+ .menu-item {
22
+ border-bottom: 1px solid $neutral-light-color;
23
+
24
+ &:hover {
25
+ background-color: $neutral-superlight-color;
26
+ }
27
+
28
+ a {
29
+ color: $body-color;
30
+ text-decoration: none;
31
+ }
32
+
33
+ .icon {
34
+ padding-left: 2.5*$spacing;
35
+ background-position: 0 50%;
36
+ }
37
+
38
+ .link-action {
39
+ background-image: image-url('nail_polish/elements/link_action.png');
40
+ background-repeat: no-repeat;
41
+ }
42
+ }
43
+
44
+ .white-down-arrow {
45
+ padding-right: 2*$spacing;
46
+ background-image: image-url('nail_polish/elements/white_down_arrow.png');
47
+ background-repeat: no-repeat;
48
+ background-position: center right;
49
+ }
50
+
51
+ .menu-caret {
52
+ height: 16px;
53
+ width: 100%;
54
+ background-image: image-url('nail_polish/elements/menu_caret.png');
55
+ background-repeat: no-repeat;
56
+ position: absolute;
57
+ background-position: top right;
58
+ top: -15px;
59
+ right: 17px;
60
+ }
61
+ }
@@ -1,6 +1,5 @@
1
1
  @import 'compass/css3';
2
2
 
3
- @import "base/reset";
4
3
  @import "base/variables";
5
4
  @import 'base/colors';
6
5
  @import 'base/mixins';
@@ -5,6 +5,9 @@
5
5
  @include line;
6
6
  }
7
7
 
8
+ .m-unit{float:left;}
9
+ .m-unit-right{float:right;}
10
+ .m-1of1{width:100%;}
8
11
  .m-1of2{width:50%;}
9
12
  .m-1of3{width:33.33333%;}
10
13
  .m-2of3{width:66.66666%;}
@@ -1,3 +1,3 @@
1
1
  module NailPolish
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nail_polish
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kane Baccigalupi
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-01-16 00:00:00.000000000 Z
13
+ date: 2014-07-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -82,6 +82,20 @@ dependencies:
82
82
  - - '>='
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
+ - !ruby/object:Gem::Dependency
86
+ name: rspec-instafail
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ type: :development
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
85
99
  - !ruby/object:Gem::Dependency
86
100
  name: cucumber-rails
87
101
  requirement: !ruby/object:Gem::Requirement
@@ -145,35 +159,52 @@ executables: []
145
159
  extensions: []
146
160
  extra_rdoc_files: []
147
161
  files:
162
+ - MIT-LICENSE
163
+ - README.rdoc
164
+ - Rakefile
148
165
  - app/assets/images/nail_polish/backgrounds/black-0_5.png
149
166
  - app/assets/images/nail_polish/backgrounds/blue-0_5.png
150
167
  - app/assets/images/nail_polish/backgrounds/dark_bg.png
151
168
  - app/assets/images/nail_polish/backgrounds/light_bg.png
152
169
  - app/assets/images/nail_polish/backgrounds/medium_bg.png
153
170
  - app/assets/images/nail_polish/elements/close_icon.png
171
+ - app/assets/images/nail_polish/elements/link_action.png
154
172
  - app/assets/images/nail_polish/elements/menu_caret.png
155
173
  - app/assets/images/nail_polish/elements/no_image.png
156
174
  - app/assets/images/nail_polish/elements/white_close_icon.png
175
+ - app/assets/images/nail_polish/elements/white_down_arrow.png
176
+ - app/assets/javascripts/nail_polish.js
157
177
  - app/assets/javascripts/nail_polish/app.js
178
+ - app/assets/javascripts/nail_polish/events.js
158
179
  - app/assets/javascripts/nail_polish/events/flasher.js
159
180
  - app/assets/javascripts/nail_polish/events/redirector.js
160
- - app/assets/javascripts/nail_polish/events.js
181
+ - app/assets/javascripts/nail_polish/model.js
182
+ - app/assets/javascripts/nail_polish/models/dropdown.js
183
+ - app/assets/javascripts/nail_polish/models/menu.js
161
184
  - app/assets/javascripts/nail_polish/nail_polish.js
162
185
  - app/assets/javascripts/nail_polish/overrides/auth_token_adder.js
163
186
  - app/assets/javascripts/nail_polish/overrides/for_backbone.js
164
187
  - app/assets/javascripts/nail_polish/overrides/function_bind.js
165
188
  - app/assets/javascripts/nail_polish/overrides/global_publisher_adder.js
166
189
  - app/assets/javascripts/nail_polish/presenter.js
190
+ - app/assets/javascripts/nail_polish/presenter_with_errors.js
167
191
  - app/assets/javascripts/nail_polish/presenters/collection.js
168
192
  - app/assets/javascripts/nail_polish/presenters/dropdown.js
193
+ - app/assets/javascripts/nail_polish/presenters/menu.js
169
194
  - app/assets/javascripts/nail_polish/router.js
195
+ - app/assets/javascripts/nail_polish/templates/dropdown.mustache
196
+ - app/assets/javascripts/nail_polish/templates/menu.mustache
197
+ - app/assets/javascripts/nail_polish/templates/modal.mustache
198
+ - app/assets/javascripts/nail_polish/utils/subview_manager.js
170
199
  - app/assets/javascripts/nail_polish/utils/text.js
171
- - app/assets/javascripts/nail_polish/view/parent_finder.js
200
+ - app/assets/javascripts/nail_polish/validator.js
172
201
  - app/assets/javascripts/nail_polish/view.js
202
+ - app/assets/javascripts/nail_polish/view/parent_finder.js
203
+ - app/assets/javascripts/nail_polish/views/form.js
173
204
  - app/assets/javascripts/nail_polish/widget/dropdown.js
174
205
  - app/assets/javascripts/nail_polish/widget/flash.js
206
+ - app/assets/javascripts/nail_polish/widget/menu.js
175
207
  - app/assets/javascripts/nail_polish/widget/modal.js
176
- - app/assets/javascripts/nail_polish.js
177
208
  - app/assets/javascripts/nail_polish_legacy_base.js
178
209
  - app/assets/javascripts/nail_polish_modern_base.js
179
210
  - app/assets/javascripts/nail_polish_widgets.js
@@ -183,6 +214,7 @@ files:
183
214
  - app/assets/javascripts/vendor/underscore.js
184
215
  - app/assets/javascripts/vendor/zepto.cookie.js
185
216
  - app/assets/javascripts/vendor/zepto.js
217
+ - app/assets/stylesheets/nail_polish/base.scss
186
218
  - app/assets/stylesheets/nail_polish/base/buttons.scss
187
219
  - app/assets/stylesheets/nail_polish/base/colors.scss
188
220
  - app/assets/stylesheets/nail_polish/base/form_elements.scss
@@ -195,27 +227,24 @@ files:
195
227
  - app/assets/stylesheets/nail_polish/base/variables.scss
196
228
  - app/assets/stylesheets/nail_polish/base/widgets/drop_down_menu.scss
197
229
  - app/assets/stylesheets/nail_polish/base/widgets/panels.scss
198
- - app/assets/stylesheets/nail_polish/base.scss
230
+ - app/assets/stylesheets/nail_polish/desktop.scss
199
231
  - app/assets/stylesheets/nail_polish/desktop/grid.scss
200
232
  - app/assets/stylesheets/nail_polish/desktop/layout.scss
201
233
  - app/assets/stylesheets/nail_polish/desktop/oo_styles.scss
234
+ - app/assets/stylesheets/nail_polish/desktop/widgets/menu.scss
202
235
  - app/assets/stylesheets/nail_polish/desktop/widgets/modal.scss
203
- - app/assets/stylesheets/nail_polish/desktop.scss
236
+ - app/assets/stylesheets/nail_polish/tablet.scss
204
237
  - app/assets/stylesheets/nail_polish/tablet/grid.scss
205
238
  - app/assets/stylesheets/nail_polish/tablet/oo_styles.scss
206
- - app/assets/stylesheets/nail_polish/tablet.scss
239
+ - app/assets/stylesheets/nail_polish/tablet_and_desktop.scss
207
240
  - app/assets/stylesheets/nail_polish/tablet_and_desktop/typography_and_tags.scss
208
241
  - app/assets/stylesheets/nail_polish/tablet_and_desktop/variables.scss
209
- - app/assets/stylesheets/nail_polish/tablet_and_desktop.scss
210
242
  - config/initializers/nail_polish.rb
211
243
  - config/routes.rb
244
+ - lib/nail_polish.rb
212
245
  - lib/nail_polish/engine.rb
213
246
  - lib/nail_polish/version.rb
214
- - lib/nail_polish.rb
215
247
  - lib/tasks/nail_polish_tasks.rake
216
- - MIT-LICENSE
217
- - Rakefile
218
- - README.rdoc
219
248
  homepage: http://github.com/socialchorus/nail_polish
220
249
  licenses: []
221
250
  metadata: {}
@@ -235,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
264
  version: '0'
236
265
  requirements: []
237
266
  rubyforge_project:
238
- rubygems_version: 2.0.3
267
+ rubygems_version: 2.2.2
239
268
  signing_key:
240
269
  specification_version: 4
241
270
  summary: NailPolish is a Backbone/OOCSS engine for your Rails 4 app