ack_rocket_cms 0.7.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.rspec +1 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +19 -0
  7. data/Gemfile +5 -0
  8. data/Gemfile.lock +244 -0
  9. data/LICENSE.txt +22 -0
  10. data/README.md +74 -0
  11. data/Rakefile +1 -0
  12. data/app/assets/javascripts/head.load.js +707 -0
  13. data/app/assets/javascripts/jquery.placeholder.js +157 -0
  14. data/app/assets/javascripts/rocket_cms.js.coffee +10 -0
  15. data/app/assets/javascripts/rocket_cms/flash.js.coffee +3 -0
  16. data/app/assets/javascripts/rocket_cms/map.js.coffee +22 -0
  17. data/app/assets/stylesheets/rocket_cms.css.sass +6 -0
  18. data/app/assets/stylesheets/rocket_cms/flash.css.sass +66 -0
  19. data/app/assets/stylesheets/rocket_cms/normalize.css.scss +406 -0
  20. data/app/controllers/concerns/no_cache.rb +12 -0
  21. data/app/controllers/concerns/rs_errors.rb +63 -0
  22. data/app/controllers/concerns/rs_menu.rb +45 -0
  23. data/app/controllers/concerns/rs_pages.rb +41 -0
  24. data/app/controllers/contacts_controller.rb +3 -0
  25. data/app/controllers/home_controller.rb +5 -0
  26. data/app/controllers/news_controller.rb +3 -0
  27. data/app/controllers/pages_controller.rb +4 -0
  28. data/app/controllers/search_controller.rb +4 -0
  29. data/app/mailers/contact_mailer.rb +15 -0
  30. data/app/models/concerns/boolean_field.rb +17 -0
  31. data/app/models/concerns/enableable.rb +8 -0
  32. data/app/models/concerns/geocodeable.rb +4 -0
  33. data/app/models/concerns/mappable.rb +95 -0
  34. data/app/models/concerns/seoable.rb +42 -0
  35. data/app/models/concerns/sitemap_data.rb +20 -0
  36. data/app/models/concerns/sort_field.rb +17 -0
  37. data/app/models/concerns/sortable.rb +8 -0
  38. data/app/models/contact_message.rb +11 -0
  39. data/app/models/menu.rb +11 -0
  40. data/app/models/news.rb +10 -0
  41. data/app/models/page.rb +11 -0
  42. data/app/views/blocks/_footer.html.haml +1 -0
  43. data/app/views/contact_mailer/new_message_email.html.haml +16 -0
  44. data/app/views/contacts/index.html.haml +10 -0
  45. data/app/views/contacts/new.html.haml +10 -0
  46. data/app/views/contacts/sent.html.haml +4 -0
  47. data/app/views/errors/_base.html.haml +3 -0
  48. data/app/views/errors/error_403.html.haml +1 -0
  49. data/app/views/errors/error_404.html.haml +1 -0
  50. data/app/views/errors/error_500.html.haml +1 -0
  51. data/app/views/home/index.html.haml +1 -0
  52. data/app/views/layouts/application.html.haml +23 -0
  53. data/app/views/layouts/application.html.slim +24 -0
  54. data/app/views/news/index.html.haml +9 -0
  55. data/app/views/news/show.html.haml +8 -0
  56. data/app/views/pages/show.html.haml +1 -0
  57. data/app/views/rails_admin/main/_check_boxes.html.haml +27 -0
  58. data/app/views/rails_admin/main/_enum_check_boxes.html.haml +5 -0
  59. data/app/views/rails_admin/main/_enum_radio_buttons.html.haml +5 -0
  60. data/app/views/rails_admin/main/_form_raw.html.haml +1 -0
  61. data/app/views/search/index.html.haml +19 -0
  62. data/app/views/shared/_admin_link.html.haml +3 -0
  63. data/app/views/shared/_messages.html.haml +7 -0
  64. data/app/views/shared/_meta.html.haml +6 -0
  65. data/app/views/shared/_obj.html.haml +20 -0
  66. data/app/views/shared/_og.html.haml +4 -0
  67. data/config/locales/en.rocket_admin.yml +6 -0
  68. data/config/locales/en.rs.yml +20 -0
  69. data/config/locales/ru.cancan.yml +4 -0
  70. data/config/locales/ru.devise.yml +65 -0
  71. data/config/locales/ru.kaminari.yml +17 -0
  72. data/config/locales/ru.models.yml +92 -0
  73. data/config/locales/ru.mongoid.yml +450 -0
  74. data/config/locales/ru.rails_admin.yml +148 -0
  75. data/config/locales/ru.rocket_admin.yml +6 -0
  76. data/config/locales/ru.rs.yml +20 -0
  77. data/config/locales/ru.simple_captcha.yml +3 -0
  78. data/config/locales/ru.simple_form.yml +9 -0
  79. data/lib/filename_to_slug.rb +34 -0
  80. data/lib/generators/rocket_cms/ability_generator.rb +15 -0
  81. data/lib/generators/rocket_cms/admin_generator.rb +21 -0
  82. data/lib/generators/rocket_cms/capify_generator.rb +40 -0
  83. data/lib/generators/rocket_cms/layout_generator.rb +15 -0
  84. data/lib/generators/rocket_cms/migration_generator.rb +19 -0
  85. data/lib/generators/rocket_cms/templates/Capfile +17 -0
  86. data/lib/generators/rocket_cms/templates/ability.erb +28 -0
  87. data/lib/generators/rocket_cms/templates/admin.erb +81 -0
  88. data/lib/generators/rocket_cms/templates/deploy.erb +47 -0
  89. data/lib/generators/rocket_cms/templates/dl.erb +30 -0
  90. data/lib/generators/rocket_cms/templates/migration_contact_messages.rb +15 -0
  91. data/lib/generators/rocket_cms/templates/migration_news.rb +21 -0
  92. data/lib/generators/rocket_cms/templates/migration_pages.rb +36 -0
  93. data/lib/generators/rocket_cms/templates/production.erb +8 -0
  94. data/lib/generators/rocket_cms/templates/unicorn.erb +66 -0
  95. data/lib/generators/rocket_cms/utils.rb +22 -0
  96. data/lib/manual_slug.rb +11 -0
  97. data/lib/manual_slug/active_record.rb +32 -0
  98. data/lib/manual_slug/mongoid.rb +36 -0
  99. data/lib/rails_admin/custom_show_in_app.rb +39 -0
  100. data/lib/rocket_cms.rb +88 -0
  101. data/lib/rocket_cms/admin.rb +152 -0
  102. data/lib/rocket_cms/configuration.rb +67 -0
  103. data/lib/rocket_cms/controller.rb +24 -0
  104. data/lib/rocket_cms/controllers/contacts.rb +70 -0
  105. data/lib/rocket_cms/controllers/news.rb +31 -0
  106. data/lib/rocket_cms/controllers/pages.rb +19 -0
  107. data/lib/rocket_cms/controllers/search.rb +45 -0
  108. data/lib/rocket_cms/elastic_search.rb +31 -0
  109. data/lib/rocket_cms/engine.rb +39 -0
  110. data/lib/rocket_cms/migration.rb +31 -0
  111. data/lib/rocket_cms/model.rb +25 -0
  112. data/lib/rocket_cms/models/active_record/contact_message.rb +14 -0
  113. data/lib/rocket_cms/models/active_record/menu.rb +14 -0
  114. data/lib/rocket_cms/models/active_record/news.rb +23 -0
  115. data/lib/rocket_cms/models/active_record/page.rb +17 -0
  116. data/lib/rocket_cms/models/contact_message.rb +27 -0
  117. data/lib/rocket_cms/models/menu.rb +29 -0
  118. data/lib/rocket_cms/models/mongoid/contact_message.rb +20 -0
  119. data/lib/rocket_cms/models/mongoid/menu.rb +12 -0
  120. data/lib/rocket_cms/models/mongoid/news.rb +27 -0
  121. data/lib/rocket_cms/models/mongoid/page.rb +26 -0
  122. data/lib/rocket_cms/models/news.rb +50 -0
  123. data/lib/rocket_cms/models/page.rb +76 -0
  124. data/lib/rocket_cms/patch.rb +58 -0
  125. data/lib/rocket_cms/rails_admin_menu.rb +145 -0
  126. data/lib/rocket_cms/simple_form_patch.rb +12 -0
  127. data/lib/rocket_cms/tasks.rb +13 -0
  128. data/lib/rocket_cms/version.rb +3 -0
  129. data/release.sh +13 -0
  130. data/rocket_cms.gemspec +54 -0
  131. data/template.rb +557 -0
  132. metadata +533 -0
@@ -0,0 +1,157 @@
1
+ /*! http://mths.be/placeholder v2.0.7 by @mathias */
2
+ ;(function(window, document, $) {
3
+
4
+ var isInputSupported = 'placeholder' in document.createElement('input'),
5
+ isTextareaSupported = 'placeholder' in document.createElement('textarea'),
6
+ prototype = $.fn,
7
+ valHooks = $.valHooks,
8
+ hooks,
9
+ placeholder;
10
+
11
+ if (isInputSupported && isTextareaSupported) {
12
+
13
+ placeholder = prototype.placeholder = function() {
14
+ return this;
15
+ };
16
+
17
+ placeholder.input = placeholder.textarea = true;
18
+
19
+ } else {
20
+
21
+ placeholder = prototype.placeholder = function() {
22
+ var $this = this;
23
+ $this
24
+ .filter((isInputSupported ? 'textarea' : ':input') + '[placeholder]')
25
+ .not('.placeholder')
26
+ .bind({
27
+ 'focus.placeholder': clearPlaceholder,
28
+ 'blur.placeholder': setPlaceholder
29
+ })
30
+ .data('placeholder-enabled', true)
31
+ .trigger('blur.placeholder');
32
+ return $this;
33
+ };
34
+
35
+ placeholder.input = isInputSupported;
36
+ placeholder.textarea = isTextareaSupported;
37
+
38
+ hooks = {
39
+ 'get': function(element) {
40
+ var $element = $(element);
41
+ return $element.data('placeholder-enabled') && $element.hasClass('placeholder') ? '' : element.value;
42
+ },
43
+ 'set': function(element, value) {
44
+ var $element = $(element);
45
+ if (!$element.data('placeholder-enabled')) {
46
+ return element.value = value;
47
+ }
48
+ if (value == '') {
49
+ element.value = value;
50
+ // Issue #56: Setting the placeholder causes problems if the element continues to have focus.
51
+ if (element != document.activeElement) {
52
+ // We can't use `triggerHandler` here because of dummy text/password inputs :(
53
+ setPlaceholder.call(element);
54
+ }
55
+ } else if ($element.hasClass('placeholder')) {
56
+ clearPlaceholder.call(element, true, value) || (element.value = value);
57
+ } else {
58
+ element.value = value;
59
+ }
60
+ // `set` can not return `undefined`; see http://jsapi.info/jquery/1.7.1/val#L2363
61
+ return $element;
62
+ }
63
+ };
64
+
65
+ isInputSupported || (valHooks.input = hooks);
66
+ isTextareaSupported || (valHooks.textarea = hooks);
67
+
68
+ $(function() {
69
+ // Look for forms
70
+ $(document).delegate('form', 'submit.placeholder', function() {
71
+ // Clear the placeholder values so they don't get submitted
72
+ var $inputs = $('.placeholder', this).each(clearPlaceholder);
73
+ setTimeout(function() {
74
+ $inputs.each(setPlaceholder);
75
+ }, 10);
76
+ });
77
+ });
78
+
79
+ // Clear placeholder values upon page reload
80
+ $(window).bind('beforeunload.placeholder', function() {
81
+ $('.placeholder').each(function() {
82
+ this.value = '';
83
+ });
84
+ });
85
+
86
+ }
87
+
88
+ function args(elem) {
89
+ // Return an object of element attributes
90
+ var newAttrs = {},
91
+ rinlinejQuery = /^jQuery\d+$/;
92
+ $.each(elem.attributes, function(i, attr) {
93
+ if (attr.specified && !rinlinejQuery.test(attr.name)) {
94
+ newAttrs[attr.name] = attr.value;
95
+ }
96
+ });
97
+ return newAttrs;
98
+ }
99
+
100
+ function clearPlaceholder(event, value) {
101
+ var input = this,
102
+ $input = $(input);
103
+ if (input.value == $input.attr('placeholder') && $input.hasClass('placeholder')) {
104
+ if ($input.data('placeholder-password')) {
105
+ $input = $input.hide().next().show().attr('id', $input.removeAttr('id').data('placeholder-id'));
106
+ // If `clearPlaceholder` was called from `$.valHooks.input.set`
107
+ if (event === true) {
108
+ return $input[0].value = value;
109
+ }
110
+ $input.focus();
111
+ } else {
112
+ input.value = '';
113
+ $input.removeClass('placeholder');
114
+ input == document.activeElement && input.select();
115
+ }
116
+ }
117
+ }
118
+
119
+ function setPlaceholder() {
120
+ var $replacement,
121
+ input = this,
122
+ $input = $(input),
123
+ $origInput = $input,
124
+ id = this.id;
125
+ if (input.value == '') {
126
+ if (input.type == 'password') {
127
+ if (!$input.data('placeholder-textinput')) {
128
+ try {
129
+ $replacement = $input.clone().attr({ 'type': 'text' });
130
+ } catch(e) {
131
+ $replacement = $('<input>').attr($.extend(args(this), { 'type': 'text' }));
132
+ }
133
+ $replacement
134
+ .removeAttr('name')
135
+ .data({
136
+ 'placeholder-password': true,
137
+ 'placeholder-id': id
138
+ })
139
+ .bind('focus.placeholder', clearPlaceholder);
140
+ $input
141
+ .data({
142
+ 'placeholder-textinput': $replacement,
143
+ 'placeholder-id': id
144
+ })
145
+ .before($replacement);
146
+ }
147
+ $input = $input.removeAttr('id').hide().prev().attr('id', id).show();
148
+ // Note: `$input[0] != input` now!
149
+ }
150
+ $input.addClass('placeholder');
151
+ $input[0].value = $input.attr('placeholder');
152
+ } else {
153
+ $input.removeClass('placeholder');
154
+ }
155
+ }
156
+
157
+ }(this, document, jQuery));
@@ -0,0 +1,10 @@
1
+ #= require jquery
2
+ #= require jquery_ujs
3
+ #= require turbolinks
4
+ #= require head.load.js
5
+ #= require rocket_cms/map
6
+ #= require rocket_cms/flash
7
+ #= require jquery.placeholder.js
8
+
9
+ $(document).on 'page:change', ->
10
+ $('input, textarea').placeholder()
@@ -0,0 +1,3 @@
1
+ $(document).on('click.close_flash', 'a.close_flash', ->
2
+ $(this).parents('.message').fadeOut()
3
+ )
@@ -0,0 +1,22 @@
1
+ window.ya_init = ->
2
+ $('.ymap').not('.done').addClass('done').each ->
3
+ $m = $(this)
4
+ coord = [$m.data('lat'), $m.data('lon')]
5
+ map = new ymaps.Map($m[0],
6
+ center: coord
7
+ zoom: 14,
8
+ behaviors: ['default'] #, 'scrollZoom']
9
+ )
10
+ map.controls.add('zoomControl', { left: 5, top: 5 })
11
+ obj = new ymaps.Placemark(coord,
12
+ hintContent: $m.data('hint')
13
+ balloonContent: $m.data('hint') + ' ' + $m.data('addr')
14
+ )
15
+ map.geoObjects.add obj
16
+
17
+ $(document).on 'page:change', ->
18
+ return if $('.ymap').not('.done').length == 0
19
+ if window.ymaps
20
+ ya_init()
21
+ else
22
+ head.load "//api-maps.yandex.ru/2.0/?load=package.full&lang=ru-RU&onload=ya_init"
@@ -0,0 +1,6 @@
1
+ @import rocket_cms/*
2
+
3
+ html
4
+ -moz-font-smoothing: antialiased
5
+ -webkit-font-smoothing: antialiased
6
+
@@ -0,0 +1,66 @@
1
+
2
+
3
+ .flash
4
+ margin: 0 auto
5
+ padding: 10px 0
6
+ width: 530px
7
+
8
+ .message
9
+ border-radius: 3px
10
+ behavior: url('/PIE.htc')
11
+ text-align: center
12
+ margin: 0 auto 15px
13
+ color: white
14
+ font-family: Tahoma
15
+ font-size: 17px
16
+ position: relative
17
+ a.close_flash
18
+ cursor: pointer
19
+ position: absolute
20
+ top: 1px
21
+ right: 2px
22
+ font-weight: bold
23
+ text-shadow: none
24
+ text-decoration: none
25
+ font-family: Arial
26
+ &:hover
27
+ opacity: 0.8
28
+
29
+ p
30
+ margin: 5px 10px 7px
31
+ color: white
32
+ font-size: 17px
33
+ line-height: 1.2
34
+
35
+ .success
36
+ border: 1px solid #009357
37
+ background: #02bb6f
38
+ +background(linear-gradient(top, #02bb6f, #019f4b))
39
+ text-shadow: 0px 1px #006d1c
40
+ a.close_flash
41
+ color: #004b2c
42
+
43
+ .notice
44
+ border: 1px solid #69b3d1
45
+ background: #79cdee
46
+ +background(linear-gradient(top, #79cdee, #56b6e5))
47
+ text-shadow: 0px 1px #248cd1
48
+ a.close_flash
49
+ color: #2f5f72
50
+
51
+ .warning
52
+ border: 1px solid #ce8f4b
53
+ background: #fbae5c
54
+ +background(linear-gradient(top, #fbae5c, #f9903b))
55
+ text-shadow: 0px 1px #f57024
56
+ a.close_flash
57
+ color: #865623
58
+
59
+ .error, .alert
60
+ border: 1px solid #ce4549
61
+ background: #f0565b
62
+ +background(linear-gradient(top, #f0565b, #e83639))
63
+ text-shadow: 0px 1px #d71012
64
+ a.close_flash
65
+ color: #782124
66
+
@@ -0,0 +1,406 @@
1
+ /*! normalize.css v2.1.3 | MIT License | git.io/normalize */
2
+
3
+ /* ==========================================================================
4
+ HTML5 display definitions
5
+ ========================================================================== */
6
+
7
+ /**
8
+ * Correct `block` display not defined in IE 8/9.
9
+ */
10
+
11
+ article,
12
+ aside,
13
+ details,
14
+ figcaption,
15
+ figure,
16
+ footer,
17
+ header,
18
+ hgroup,
19
+ main,
20
+ nav,
21
+ section,
22
+ summary {
23
+ display: block;
24
+ }
25
+
26
+ /**
27
+ * Correct `inline-block` display not defined in IE 8/9.
28
+ */
29
+
30
+ audio,
31
+ canvas,
32
+ video {
33
+ display: inline-block;
34
+ }
35
+
36
+ /**
37
+ * Prevent modern browsers from displaying `audio` without controls.
38
+ * Remove excess height in iOS 5 devices.
39
+ */
40
+
41
+ audio:not([controls]) {
42
+ display: none;
43
+ height: 0;
44
+ }
45
+
46
+ /**
47
+ * Address `[hidden]` styling not present in IE 8/9.
48
+ * Hide the `template` element in IE, Safari, and Firefox < 22.
49
+ */
50
+
51
+ [hidden],
52
+ template {
53
+ display: none;
54
+ }
55
+
56
+ /* ==========================================================================
57
+ Base
58
+ ========================================================================== */
59
+
60
+ /**
61
+ * 1. Set default font family to sans-serif.
62
+ * 2. Prevent iOS text size adjust after orientation change, without disabling
63
+ * user zoom.
64
+ */
65
+
66
+ html {
67
+ font-family: sans-serif; /* 1 */
68
+ -ms-text-size-adjust: 100%; /* 2 */
69
+ -webkit-text-size-adjust: 100%; /* 2 */
70
+ }
71
+
72
+ /**
73
+ * Remove default margin.
74
+ */
75
+
76
+ body {
77
+ margin: 0;
78
+ }
79
+
80
+ /* ==========================================================================
81
+ Links
82
+ ========================================================================== */
83
+
84
+ /**
85
+ * Remove the gray background color from active links in IE 10.
86
+ */
87
+
88
+ a {
89
+ background: transparent;
90
+ }
91
+
92
+ /**
93
+ * Address `outline` inconsistency between Chrome and other browsers.
94
+ */
95
+
96
+ a:focus {
97
+ outline: thin dotted;
98
+ }
99
+
100
+ /**
101
+ * Improve readability when focused and also mouse hovered in all browsers.
102
+ */
103
+
104
+ a:active,
105
+ a:hover {
106
+ outline: 0;
107
+ }
108
+
109
+ /* ==========================================================================
110
+ Typography
111
+ ========================================================================== */
112
+
113
+ /**
114
+ * Address variable `h1` font-size and margin within `section` and `article`
115
+ * contexts in Firefox 4+, Safari 5, and Chrome.
116
+ */
117
+
118
+ h1 {
119
+ font-size: 2em;
120
+ margin: 0.67em 0;
121
+ }
122
+
123
+ /**
124
+ * Address styling not present in IE 8/9, Safari 5, and Chrome.
125
+ */
126
+
127
+ abbr[title] {
128
+ border-bottom: 1px dotted;
129
+ }
130
+
131
+ /**
132
+ * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
133
+ */
134
+
135
+ b,
136
+ strong {
137
+ font-weight: bold;
138
+ }
139
+
140
+ /**
141
+ * Address styling not present in Safari 5 and Chrome.
142
+ */
143
+
144
+ dfn {
145
+ font-style: italic;
146
+ }
147
+
148
+ /**
149
+ * Address differences between Firefox and other browsers.
150
+ */
151
+
152
+ hr {
153
+ -moz-box-sizing: content-box;
154
+ box-sizing: content-box;
155
+ height: 0;
156
+ }
157
+
158
+ /**
159
+ * Address styling not present in IE 8/9.
160
+ */
161
+
162
+ mark {
163
+ background: #ff0;
164
+ color: #000;
165
+ }
166
+
167
+ /**
168
+ * Correct font family set oddly in Safari 5 and Chrome.
169
+ */
170
+
171
+ code,
172
+ kbd,
173
+ pre,
174
+ samp {
175
+ font-family: monospace, serif;
176
+ font-size: 1em;
177
+ }
178
+
179
+ /**
180
+ * Improve readability of pre-formatted text in all browsers.
181
+ */
182
+
183
+ pre {
184
+ white-space: pre-wrap;
185
+ }
186
+
187
+ /**
188
+ * Set consistent quote types.
189
+ */
190
+
191
+ q {
192
+ quotes: "\201C" "\201D" "\2018" "\2019";
193
+ }
194
+
195
+ /**
196
+ * Address inconsistent and variable font size in all browsers.
197
+ */
198
+
199
+ small {
200
+ font-size: 80%;
201
+ }
202
+
203
+ /**
204
+ * Prevent `sub` and `sup` affecting `line-height` in all browsers.
205
+ */
206
+
207
+ sub,
208
+ sup {
209
+ font-size: 75%;
210
+ line-height: 0;
211
+ position: relative;
212
+ vertical-align: baseline;
213
+ }
214
+
215
+ sup {
216
+ top: -0.5em;
217
+ }
218
+
219
+ sub {
220
+ bottom: -0.25em;
221
+ }
222
+
223
+ /* ==========================================================================
224
+ Embedded content
225
+ ========================================================================== */
226
+
227
+ /**
228
+ * Remove border when inside `a` element in IE 8/9.
229
+ */
230
+
231
+ img {
232
+ border: 0;
233
+ }
234
+
235
+ /**
236
+ * Correct overflow displayed oddly in IE 9.
237
+ */
238
+
239
+ svg:not(:root) {
240
+ overflow: hidden;
241
+ }
242
+
243
+ /* ==========================================================================
244
+ Figures
245
+ ========================================================================== */
246
+
247
+ /**
248
+ * Address margin not present in IE 8/9 and Safari 5.
249
+ */
250
+
251
+ figure {
252
+ margin: 0;
253
+ }
254
+
255
+ /* ==========================================================================
256
+ Forms
257
+ ========================================================================== */
258
+
259
+ /**
260
+ * Define consistent border, margin, and padding.
261
+ */
262
+
263
+ fieldset {
264
+ border: 1px solid #c0c0c0;
265
+ margin: 0 2px;
266
+ padding: 0.35em 0.625em 0.75em;
267
+ }
268
+
269
+ /**
270
+ * 1. Correct `color` not being inherited in IE 8/9.
271
+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.
272
+ */
273
+
274
+ legend {
275
+ border: 0; /* 1 */
276
+ padding: 0; /* 2 */
277
+ }
278
+
279
+ /**
280
+ * 1. Correct font family not being inherited in all browsers.
281
+ * 2. Correct font size not being inherited in all browsers.
282
+ * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
283
+ */
284
+
285
+ button,
286
+ input,
287
+ select,
288
+ textarea {
289
+ font-family: inherit; /* 1 */
290
+ font-size: 100%; /* 2 */
291
+ margin: 0; /* 3 */
292
+ }
293
+
294
+ /**
295
+ * Address Firefox 4+ setting `line-height` on `input` using `!important` in
296
+ * the UA stylesheet.
297
+ */
298
+
299
+ button,
300
+ input {
301
+ line-height: normal;
302
+ }
303
+
304
+ /**
305
+ * Address inconsistent `text-transform` inheritance for `button` and `select`.
306
+ * All other form control elements do not inherit `text-transform` values.
307
+ * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
308
+ * Correct `select` style inheritance in Firefox 4+ and Opera.
309
+ */
310
+
311
+ button,
312
+ select {
313
+ text-transform: none;
314
+ }
315
+
316
+ /**
317
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
318
+ * and `video` controls.
319
+ * 2. Correct inability to style clickable `input` types in iOS.
320
+ * 3. Improve usability and consistency of cursor style between image-type
321
+ * `input` and others.
322
+ */
323
+
324
+ button,
325
+ html input[type="button"], /* 1 */
326
+ input[type="reset"],
327
+ input[type="submit"] {
328
+ -webkit-appearance: button; /* 2 */
329
+ cursor: pointer; /* 3 */
330
+ }
331
+
332
+ /**
333
+ * Re-set default cursor for disabled elements.
334
+ */
335
+
336
+ button[disabled],
337
+ html input[disabled] {
338
+ cursor: default;
339
+ }
340
+
341
+ /**
342
+ * 1. Address box sizing set to `content-box` in IE 8/9/10.
343
+ * 2. Remove excess padding in IE 8/9/10.
344
+ */
345
+
346
+ input[type="checkbox"],
347
+ input[type="radio"] {
348
+ box-sizing: border-box; /* 1 */
349
+ padding: 0; /* 2 */
350
+ }
351
+
352
+ /**
353
+ * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
354
+ * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
355
+ * (include `-moz` to future-proof).
356
+ */
357
+
358
+ input[type="search"] {
359
+ -webkit-appearance: textfield; /* 1 */
360
+ -moz-box-sizing: content-box;
361
+ -webkit-box-sizing: content-box; /* 2 */
362
+ box-sizing: content-box;
363
+ }
364
+
365
+ /**
366
+ * Remove inner padding and search cancel button in Safari 5 and Chrome
367
+ * on OS X.
368
+ */
369
+
370
+ input[type="search"]::-webkit-search-cancel-button,
371
+ input[type="search"]::-webkit-search-decoration {
372
+ -webkit-appearance: none;
373
+ }
374
+
375
+ /**
376
+ * Remove inner padding and border in Firefox 4+.
377
+ */
378
+
379
+ button::-moz-focus-inner,
380
+ input::-moz-focus-inner {
381
+ border: 0;
382
+ padding: 0;
383
+ }
384
+
385
+ /**
386
+ * 1. Remove default vertical scrollbar in IE 8/9.
387
+ * 2. Improve readability and alignment in all browsers.
388
+ */
389
+
390
+ textarea {
391
+ overflow: auto; /* 1 */
392
+ vertical-align: top; /* 2 */
393
+ }
394
+
395
+ /* ==========================================================================
396
+ Tables
397
+ ========================================================================== */
398
+
399
+ /**
400
+ * Remove most spacing between table cells.
401
+ */
402
+
403
+ table {
404
+ border-collapse: collapse;
405
+ border-spacing: 0;
406
+ }