nail_polish 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/nail_polish.js +1 -0
- data/app/assets/javascripts/nail_polish/app.js +17 -10
- data/app/assets/javascripts/nail_polish/model.js +6 -1
- data/app/assets/javascripts/nail_polish/overrides/function_bind.js +3 -5
- data/app/assets/javascripts/nail_polish/utils/local_date_converter.js +27 -0
- data/app/assets/javascripts/nail_polish/view.js +71 -3
- data/app/assets/javascripts/nail_polish/widget/modal.js +9 -5
- data/app/assets/javascripts/nail_polish_legacy_base.js +1 -1
- data/app/assets/javascripts/nail_polish_modern_base.js +2 -2
- data/app/assets/javascripts/vendor/jquery-1.12.0.js +11027 -0
- data/app/assets/javascripts/vendor/jquery-html5-placeholder-shim.js +104 -0
- data/app/assets/stylesheets/nail_polish/base/form_elements.scss +1 -4
- data/app/assets/stylesheets/nail_polish/base/widgets/modal.scss +3 -1
- data/app/assets/stylesheets/nail_polish/desktop/grid.scss +8 -16
- data/app/assets/stylesheets/nail_polish/tablet/widgets/modal.scss +3 -0
- data/lib/nail_polish/version.rb +1 -1
- metadata +29 -109
@@ -0,0 +1,104 @@
|
|
1
|
+
(function($) {
|
2
|
+
// @todo Document this.
|
3
|
+
$.extend($,{ placeholder: {
|
4
|
+
browser_supported: function() {
|
5
|
+
return this._supported !== undefined ?
|
6
|
+
this._supported :
|
7
|
+
( this._supported = !!('placeholder' in $('<input type="text">')[0]) );
|
8
|
+
},
|
9
|
+
shim: function(opts) {
|
10
|
+
var config = {
|
11
|
+
color: '#888',
|
12
|
+
cls: 'placeholder',
|
13
|
+
selector: 'input[placeholder], textarea[placeholder]'
|
14
|
+
};
|
15
|
+
$.extend(config,opts);
|
16
|
+
return !this.browser_supported() && $(config.selector)._placeholder_shim(config);
|
17
|
+
}
|
18
|
+
}});
|
19
|
+
|
20
|
+
$.extend($.fn,{
|
21
|
+
_placeholder_shim: function(config) {
|
22
|
+
function calcPositionCss(target)
|
23
|
+
{
|
24
|
+
var op = $(target).offsetParent().offset();
|
25
|
+
var ot = $(target).offset();
|
26
|
+
|
27
|
+
return {
|
28
|
+
top: ot.top - op.top,
|
29
|
+
left: ot.left - op.left,
|
30
|
+
width: $(target).width()
|
31
|
+
};
|
32
|
+
}
|
33
|
+
function adjustToResizing(label) {
|
34
|
+
var $target = label.data('target');
|
35
|
+
if(typeof $target !== "undefined") {
|
36
|
+
label.css(calcPositionCss($target));
|
37
|
+
$(window).one("resize", function () { adjustToResizing(label); });
|
38
|
+
}
|
39
|
+
}
|
40
|
+
return this.each(function() {
|
41
|
+
var $this = $(this);
|
42
|
+
|
43
|
+
if( $this.is(':visible') ) {
|
44
|
+
|
45
|
+
if( $this.data('placeholder') ) {
|
46
|
+
var $ol = $this.data('placeholder');
|
47
|
+
$ol.css(calcPositionCss($this));
|
48
|
+
return true;
|
49
|
+
}
|
50
|
+
|
51
|
+
var possible_line_height = {};
|
52
|
+
if( !$this.is('textarea') && $this.css('height') != 'auto') {
|
53
|
+
possible_line_height = { lineHeight: $this.css('height'), whiteSpace: 'nowrap' };
|
54
|
+
}
|
55
|
+
|
56
|
+
var isBorderBox = ($this.css('box-sizing') === 'border-box');
|
57
|
+
var isTextarea = $this.is('textarea');
|
58
|
+
|
59
|
+
var ol = $('<label />')
|
60
|
+
.text($this.attr('placeholder'))
|
61
|
+
.addClass(config.cls)
|
62
|
+
.css($.extend({
|
63
|
+
position:'absolute',
|
64
|
+
display: 'inline',
|
65
|
+
'float':'none',
|
66
|
+
overflow:'hidden',
|
67
|
+
textAlign: 'left',
|
68
|
+
color: config.color,
|
69
|
+
cursor: 'text',
|
70
|
+
paddingTop: !isTextarea && isBorderBox ? '0' : $this.css('padding-top'),
|
71
|
+
paddingRight: $this.css('padding-right'),
|
72
|
+
paddingBottom: !isTextarea && isBorderBox ? '0' : $this.css('padding-bottom'),
|
73
|
+
paddingLeft: $this.css('padding-left'),
|
74
|
+
fontSize: $this.css('font-size'),
|
75
|
+
fontFamily: $this.css('font-family'),
|
76
|
+
fontStyle: $this.css('font-style'),
|
77
|
+
fontWeight: $this.css('font-weight'),
|
78
|
+
textTransform: $this.css('text-transform'),
|
79
|
+
backgroundColor: 'transparent',
|
80
|
+
zIndex: 99
|
81
|
+
}, possible_line_height))
|
82
|
+
.css(calcPositionCss(this))
|
83
|
+
.attr('for', this.id)
|
84
|
+
.data('target',$this)
|
85
|
+
.click(function(){
|
86
|
+
if (!$(this).data('target').is(':disabled')) {
|
87
|
+
$(this).data('target').focus();
|
88
|
+
}
|
89
|
+
})
|
90
|
+
.insertBefore(this);
|
91
|
+
$this
|
92
|
+
.data('placeholder',ol)
|
93
|
+
.keydown(function(){
|
94
|
+
ol.hide();
|
95
|
+
})
|
96
|
+
.blur(function() {
|
97
|
+
ol[$this.val().length ? 'hide' : 'show']();
|
98
|
+
}).triggerHandler('blur');
|
99
|
+
$(window).one("resize", function () { adjustToResizing(ol); });
|
100
|
+
}
|
101
|
+
});
|
102
|
+
}
|
103
|
+
});
|
104
|
+
})($);
|
@@ -30,7 +30,7 @@ textarea {
|
|
30
30
|
}
|
31
31
|
|
32
32
|
/* A fake input will look like an input, but not be usable.
|
33
|
-
This will be used for */
|
33
|
+
This will be used for */
|
34
34
|
.fake-input {
|
35
35
|
background-color: $light-color;
|
36
36
|
font-size: $em;
|
@@ -71,9 +71,6 @@ input[type=checkbox] {
|
|
71
71
|
}
|
72
72
|
|
73
73
|
textarea {
|
74
|
-
width: 100%;
|
75
|
-
font-size: $em * 0.8;
|
76
|
-
background-color: #f1f1f1;
|
77
74
|
min-height: 100px;
|
78
75
|
}
|
79
76
|
|
@@ -3,22 +3,14 @@
|
|
3
3
|
|
4
4
|
.l-unit{float:left;}
|
5
5
|
.l-unit-right{float:right;}
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
.l
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
.l-3of5{width:60%;}
|
15
|
-
.l-4of5{width:80%;}
|
16
|
-
.l-1of6{width:16.66666%;}
|
17
|
-
.l-4of6{width:66.66666%;}
|
18
|
-
.l-5of6{width:83.33333%;}
|
19
|
-
.l-1of10{width:10%;}
|
20
|
-
.l-3of10{width:30%;}
|
21
|
-
.l-9of10{width: 90%}
|
6
|
+
|
7
|
+
@for $denominator from 1 through 10 {
|
8
|
+
@for $numerator from 1 through $denominator {
|
9
|
+
.l-#{$numerator}of#{$denominator} {
|
10
|
+
width: percentage($numerator / $denominator);
|
11
|
+
}
|
12
|
+
}
|
13
|
+
}
|
22
14
|
|
23
15
|
.m-hidden,
|
24
16
|
.s-hidden {
|
data/lib/nail_polish/version.rb
CHANGED
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.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kane Baccigalupi
|
@@ -10,146 +10,62 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2016-06-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- - ~>
|
19
|
+
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 4.
|
21
|
+
version: 4.2.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- - ~>
|
26
|
+
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 4.
|
28
|
+
version: 4.2.4
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: mustache
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - ">="
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '0'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: hogan_assets
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: compass-rails
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '0'
|
64
64
|
type: :runtime
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- -
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
version: '0'
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: rspec-rails
|
73
|
-
requirement: !ruby/object:Gem::Requirement
|
74
|
-
requirements:
|
75
|
-
- - '>='
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '0'
|
78
|
-
type: :development
|
79
|
-
prerelease: false
|
80
|
-
version_requirements: !ruby/object:Gem::Requirement
|
81
|
-
requirements:
|
82
|
-
- - '>='
|
83
|
-
- !ruby/object:Gem::Version
|
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'
|
99
|
-
- !ruby/object:Gem::Dependency
|
100
|
-
name: cucumber-rails
|
101
|
-
requirement: !ruby/object:Gem::Requirement
|
102
|
-
requirements:
|
103
|
-
- - '>='
|
104
|
-
- !ruby/object:Gem::Version
|
105
|
-
version: '0'
|
106
|
-
type: :development
|
107
|
-
prerelease: false
|
108
|
-
version_requirements: !ruby/object:Gem::Requirement
|
109
|
-
requirements:
|
110
|
-
- - '>='
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
version: '0'
|
113
|
-
- !ruby/object:Gem::Dependency
|
114
|
-
name: selenium-webdriver
|
115
|
-
requirement: !ruby/object:Gem::Requirement
|
116
|
-
requirements:
|
117
|
-
- - ~>
|
118
|
-
- !ruby/object:Gem::Version
|
119
|
-
version: '2.35'
|
120
|
-
type: :development
|
121
|
-
prerelease: false
|
122
|
-
version_requirements: !ruby/object:Gem::Requirement
|
123
|
-
requirements:
|
124
|
-
- - ~>
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
version: '2.35'
|
127
|
-
- !ruby/object:Gem::Dependency
|
128
|
-
name: database_cleaner
|
129
|
-
requirement: !ruby/object:Gem::Requirement
|
130
|
-
requirements:
|
131
|
-
- - '>='
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
version: '0'
|
134
|
-
type: :development
|
135
|
-
prerelease: false
|
136
|
-
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
requirements:
|
138
|
-
- - '>='
|
139
|
-
- !ruby/object:Gem::Version
|
140
|
-
version: '0'
|
141
|
-
- !ruby/object:Gem::Dependency
|
142
|
-
name: zip
|
143
|
-
requirement: !ruby/object:Gem::Requirement
|
144
|
-
requirements:
|
145
|
-
- - '>='
|
146
|
-
- !ruby/object:Gem::Version
|
147
|
-
version: '0'
|
148
|
-
type: :development
|
149
|
-
prerelease: false
|
150
|
-
version_requirements: !ruby/object:Gem::Requirement
|
151
|
-
requirements:
|
152
|
-
- - '>='
|
68
|
+
- - ">="
|
153
69
|
- !ruby/object:Gem::Version
|
154
70
|
version: '0'
|
155
71
|
description: NailPolish is a Backbone/OOCSS engine for your Rails 4 app
|
@@ -159,6 +75,8 @@ executables: []
|
|
159
75
|
extensions: []
|
160
76
|
extra_rdoc_files: []
|
161
77
|
files:
|
78
|
+
- MIT-LICENSE
|
79
|
+
- Rakefile
|
162
80
|
- app/assets/images/nail_polish/backgrounds/black-0_5.png
|
163
81
|
- app/assets/images/nail_polish/backgrounds/blue-0_5.png
|
164
82
|
- app/assets/images/nail_polish/backgrounds/dark_bg.png
|
@@ -170,10 +88,11 @@ files:
|
|
170
88
|
- app/assets/images/nail_polish/elements/no_image.png
|
171
89
|
- app/assets/images/nail_polish/elements/white_close_icon.png
|
172
90
|
- app/assets/images/nail_polish/elements/white_down_arrow.png
|
91
|
+
- app/assets/javascripts/nail_polish.js
|
173
92
|
- app/assets/javascripts/nail_polish/app.js
|
93
|
+
- app/assets/javascripts/nail_polish/events.js
|
174
94
|
- app/assets/javascripts/nail_polish/events/flasher.js
|
175
95
|
- app/assets/javascripts/nail_polish/events/redirector.js
|
176
|
-
- app/assets/javascripts/nail_polish/events.js
|
177
96
|
- app/assets/javascripts/nail_polish/model.js
|
178
97
|
- app/assets/javascripts/nail_polish/models/dropdown.js
|
179
98
|
- app/assets/javascripts/nail_polish/models/menu.js
|
@@ -192,27 +111,30 @@ files:
|
|
192
111
|
- app/assets/javascripts/nail_polish/templates/menu.mustache
|
193
112
|
- app/assets/javascripts/nail_polish/templates/modal.mustache
|
194
113
|
- app/assets/javascripts/nail_polish/templates/stackable_modal.mustache
|
114
|
+
- app/assets/javascripts/nail_polish/utils/local_date_converter.js
|
195
115
|
- app/assets/javascripts/nail_polish/utils/subview_manager.js
|
196
116
|
- app/assets/javascripts/nail_polish/utils/text.js
|
197
117
|
- app/assets/javascripts/nail_polish/validator.js
|
198
|
-
- app/assets/javascripts/nail_polish/view/parent_finder.js
|
199
118
|
- app/assets/javascripts/nail_polish/view.js
|
119
|
+
- app/assets/javascripts/nail_polish/view/parent_finder.js
|
200
120
|
- app/assets/javascripts/nail_polish/views/form.js
|
201
121
|
- app/assets/javascripts/nail_polish/widget/dropdown.js
|
202
122
|
- app/assets/javascripts/nail_polish/widget/flash.js
|
203
123
|
- app/assets/javascripts/nail_polish/widget/menu.js
|
204
124
|
- app/assets/javascripts/nail_polish/widget/modal.js
|
205
125
|
- app/assets/javascripts/nail_polish/widget/stackable_modal.js
|
206
|
-
- app/assets/javascripts/nail_polish.js
|
207
126
|
- app/assets/javascripts/nail_polish_legacy_base.js
|
208
127
|
- app/assets/javascripts/nail_polish_modern_base.js
|
209
128
|
- app/assets/javascripts/nail_polish_widgets.js
|
210
129
|
- app/assets/javascripts/vendor/backbone.js
|
130
|
+
- app/assets/javascripts/vendor/jquery-1.12.0.js
|
211
131
|
- app/assets/javascripts/vendor/jquery-1.8.3.js
|
132
|
+
- app/assets/javascripts/vendor/jquery-html5-placeholder-shim.js
|
212
133
|
- app/assets/javascripts/vendor/jquery.cookie.js
|
213
134
|
- app/assets/javascripts/vendor/underscore.js
|
214
135
|
- app/assets/javascripts/vendor/zepto.cookie.js
|
215
136
|
- app/assets/javascripts/vendor/zepto.js
|
137
|
+
- app/assets/stylesheets/nail_polish/base.scss
|
216
138
|
- app/assets/stylesheets/nail_polish/base/buttons.scss
|
217
139
|
- app/assets/stylesheets/nail_polish/base/colors.scss
|
218
140
|
- app/assets/stylesheets/nail_polish/base/form_elements.scss
|
@@ -226,27 +148,25 @@ files:
|
|
226
148
|
- app/assets/stylesheets/nail_polish/base/widgets/drop_down_menu.scss
|
227
149
|
- app/assets/stylesheets/nail_polish/base/widgets/modal.scss
|
228
150
|
- app/assets/stylesheets/nail_polish/base/widgets/panels.scss
|
229
|
-
- app/assets/stylesheets/nail_polish/
|
151
|
+
- app/assets/stylesheets/nail_polish/desktop.scss
|
230
152
|
- app/assets/stylesheets/nail_polish/desktop/grid.scss
|
231
153
|
- app/assets/stylesheets/nail_polish/desktop/layout.scss
|
232
154
|
- app/assets/stylesheets/nail_polish/desktop/oo_styles.scss
|
233
155
|
- app/assets/stylesheets/nail_polish/desktop/widgets/menu.scss
|
234
156
|
- app/assets/stylesheets/nail_polish/desktop/widgets/modal.scss
|
235
|
-
- app/assets/stylesheets/nail_polish/
|
157
|
+
- app/assets/stylesheets/nail_polish/tablet.scss
|
236
158
|
- app/assets/stylesheets/nail_polish/tablet/grid.scss
|
237
159
|
- app/assets/stylesheets/nail_polish/tablet/oo_styles.scss
|
238
|
-
- app/assets/stylesheets/nail_polish/tablet.scss
|
160
|
+
- app/assets/stylesheets/nail_polish/tablet/widgets/modal.scss
|
161
|
+
- app/assets/stylesheets/nail_polish/tablet_and_desktop.scss
|
239
162
|
- app/assets/stylesheets/nail_polish/tablet_and_desktop/typography_and_tags.scss
|
240
163
|
- app/assets/stylesheets/nail_polish/tablet_and_desktop/variables.scss
|
241
|
-
- app/assets/stylesheets/nail_polish/tablet_and_desktop.scss
|
242
164
|
- config/initializers/nail_polish.rb
|
243
165
|
- config/routes.rb
|
166
|
+
- lib/nail_polish.rb
|
244
167
|
- lib/nail_polish/engine.rb
|
245
168
|
- lib/nail_polish/version.rb
|
246
|
-
- lib/nail_polish.rb
|
247
169
|
- lib/tasks/nail_polish_tasks.rake
|
248
|
-
- MIT-LICENSE
|
249
|
-
- Rakefile
|
250
170
|
homepage: http://github.com/socialchorus/nail_polish
|
251
171
|
licenses: []
|
252
172
|
metadata: {}
|
@@ -256,17 +176,17 @@ require_paths:
|
|
256
176
|
- lib
|
257
177
|
required_ruby_version: !ruby/object:Gem::Requirement
|
258
178
|
requirements:
|
259
|
-
- -
|
179
|
+
- - ">="
|
260
180
|
- !ruby/object:Gem::Version
|
261
181
|
version: '0'
|
262
182
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
263
183
|
requirements:
|
264
|
-
- -
|
184
|
+
- - ">="
|
265
185
|
- !ruby/object:Gem::Version
|
266
186
|
version: '0'
|
267
187
|
requirements: []
|
268
188
|
rubyforge_project:
|
269
|
-
rubygems_version: 2.
|
189
|
+
rubygems_version: 2.4.3
|
270
190
|
signing_key:
|
271
191
|
specification_version: 4
|
272
192
|
summary: NailPolish is a Backbone/OOCSS engine for your Rails 4 app
|