publish_my_data 0.0.32 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. data/app/assets/images/publish_my_data/small-spinner.gif +0 -0
  2. data/app/assets/images/publish_my_data/sort-asc.gif +0 -0
  3. data/app/assets/images/publish_my_data/sort-desc.gif +0 -0
  4. data/app/assets/javascripts/bootstrap/affix.js +126 -0
  5. data/app/assets/javascripts/bootstrap/alert.js +98 -0
  6. data/app/assets/javascripts/bootstrap/button.js +109 -0
  7. data/app/assets/javascripts/bootstrap/carousel.js +217 -0
  8. data/app/assets/javascripts/bootstrap/collapse.js +179 -0
  9. data/app/assets/javascripts/bootstrap/dropdown.js +154 -0
  10. data/app/assets/javascripts/bootstrap/modal.js +246 -0
  11. data/app/assets/javascripts/bootstrap/popover.js +117 -0
  12. data/app/assets/javascripts/bootstrap/scrollspy.js +158 -0
  13. data/app/assets/javascripts/bootstrap/tab.js +135 -0
  14. data/app/assets/javascripts/bootstrap/tooltip.js +386 -0
  15. data/app/assets/javascripts/bootstrap/transition.js +56 -0
  16. data/app/assets/javascripts/publish_my_data/grid/10_data-loader.js +142 -0
  17. data/app/assets/javascripts/publish_my_data/grid/20_cube-grid.js +512 -0
  18. data/app/assets/javascripts/publish_my_data/grid/30_cube-dimension.js +77 -0
  19. data/app/assets/javascripts/publish_my_data/grid/40_cube-dimension-dropdown.js +87 -0
  20. data/app/assets/javascripts/publish_my_data/grid/45_cube-dimension-label.js +58 -0
  21. data/app/assets/javascripts/publish_my_data/grid/50_cube-dimensions-controls.js +336 -0
  22. data/app/assets/javascripts/publish_my_data/grid/60_dataset_cube_grid.js +187 -0
  23. data/app/assets/javascripts/publish_my_data/grid/70_sparql_results_grid.js +135 -0
  24. data/app/assets/javascripts/publish_my_data/select_text.js +27 -0
  25. data/app/assets/javascripts/publish_my_data.js +3 -0
  26. data/app/assets/javascripts/slick_grid/10_event-drag.js +402 -0
  27. data/app/assets/javascripts/slick_grid/20_slick-core.js +458 -0
  28. data/app/assets/javascripts/slick_grid/30_slick-grid.js +3295 -0
  29. data/app/assets/stylesheets/bootstrap/_alerts.scss +67 -0
  30. data/app/assets/stylesheets/bootstrap/_badges.scss +51 -0
  31. data/app/assets/stylesheets/bootstrap/_breadcrumbs.scss +23 -0
  32. data/app/assets/stylesheets/bootstrap/_button-groups.scss +248 -0
  33. data/app/assets/stylesheets/bootstrap/_buttons.scss +160 -0
  34. data/app/assets/stylesheets/bootstrap/_carousel.scss +209 -0
  35. data/app/assets/stylesheets/bootstrap/_close.scss +33 -0
  36. data/app/assets/stylesheets/bootstrap/_code.scss +56 -0
  37. data/app/assets/stylesheets/bootstrap/_component-animations.scss +29 -0
  38. data/app/assets/stylesheets/bootstrap/_dropdowns.scss +194 -0
  39. data/app/assets/stylesheets/bootstrap/_forms.scss +350 -0
  40. data/app/assets/stylesheets/bootstrap/_glyphicons.scss +232 -0
  41. data/app/assets/stylesheets/bootstrap/_grid.scss +346 -0
  42. data/app/assets/stylesheets/bootstrap/_input-groups.scss +127 -0
  43. data/app/assets/stylesheets/bootstrap/_jumbotron.scss +40 -0
  44. data/app/assets/stylesheets/bootstrap/_labels.scss +58 -0
  45. data/app/assets/stylesheets/bootstrap/_list-group.scss +88 -0
  46. data/app/assets/stylesheets/bootstrap/_media.scss +56 -0
  47. data/app/assets/stylesheets/bootstrap/_mixins.scss +728 -0
  48. data/app/assets/stylesheets/bootstrap/_modals.scss +145 -0
  49. data/app/assets/stylesheets/bootstrap/_navbar.scss +625 -0
  50. data/app/assets/stylesheets/bootstrap/_navs.scss +229 -0
  51. data/app/assets/stylesheets/bootstrap/_normalize.scss +396 -0
  52. data/app/assets/stylesheets/bootstrap/_pager.scss +55 -0
  53. data/app/assets/stylesheets/bootstrap/_pagination.scss +83 -0
  54. data/app/assets/stylesheets/bootstrap/_panels.scss +148 -0
  55. data/app/assets/stylesheets/bootstrap/_popovers.scss +133 -0
  56. data/app/assets/stylesheets/bootstrap/_print.scss +100 -0
  57. data/app/assets/stylesheets/bootstrap/_progress-bars.scss +95 -0
  58. data/app/assets/stylesheets/bootstrap/_responsive-utilities.scss +209 -0
  59. data/app/assets/stylesheets/bootstrap/_scaffolding.scss +130 -0
  60. data/app/assets/stylesheets/bootstrap/_tables.scss +236 -0
  61. data/app/assets/stylesheets/bootstrap/_theme.scss +232 -0
  62. data/app/assets/stylesheets/bootstrap/_thumbnails.scss +31 -0
  63. data/app/assets/stylesheets/bootstrap/_tooltip.scss +95 -0
  64. data/app/assets/stylesheets/bootstrap/_type.scss +238 -0
  65. data/app/assets/stylesheets/bootstrap/_utilities.scss +42 -0
  66. data/app/assets/stylesheets/bootstrap/_variables.scss +620 -0
  67. data/app/assets/stylesheets/bootstrap/_wells.scss +29 -0
  68. data/app/assets/stylesheets/bootstrap/bootstrap.scss +59 -0
  69. data/app/assets/stylesheets/publish_my_data/core.scss +244 -0
  70. data/app/assets/stylesheets/publish_my_data/data_grid.scss +103 -0
  71. data/app/assets/stylesheets/publish_my_data/variables.scss +1 -0
  72. data/app/assets/stylesheets/{publish_my_data.css → publish_my_data.scss} +13 -2
  73. data/app/assets/stylesheets/slick_grid/slick_grid.scss +155 -0
  74. data/app/assets/stylesheets/slick_grid/slick_grid_default_theme.scss +97 -0
  75. data/app/controllers/concerns/publish_my_data/data_cube.rb +42 -0
  76. data/app/controllers/publish_my_data/data_cube/dimensions_controller.rb +58 -0
  77. data/app/controllers/publish_my_data/data_cube/observations_controller.rb +54 -0
  78. data/app/controllers/publish_my_data/datasets_controller.rb +0 -11
  79. data/app/controllers/publish_my_data/example_resources_controller.rb +11 -0
  80. data/app/controllers/publish_my_data/home_controller.rb +4 -0
  81. data/app/controllers/publish_my_data/information_resources_controller.rb +0 -13
  82. data/app/helpers/publish_my_data/application_helper.rb +66 -0
  83. data/app/helpers/publish_my_data/crumb_helper.rb +61 -0
  84. data/app/helpers/publish_my_data/datasets_helper.rb +31 -0
  85. data/app/helpers/publish_my_data/resources_helper.rb +24 -0
  86. data/app/models/concerns/publish_my_data/cube_results.rb +51 -0
  87. data/app/models/concerns/publish_my_data/dataset_powers.rb +13 -0
  88. data/app/models/publish_my_data/data_cube/cube.rb +358 -0
  89. data/app/models/publish_my_data/data_cube/dimension.rb +58 -0
  90. data/app/models/publish_my_data/vocabulary.rb +0 -4
  91. data/app/views/layouts/publish_my_data/application.html.haml +18 -0
  92. data/app/views/layouts/publish_my_data/error.html.haml +21 -0
  93. data/app/views/publish_my_data/classes/show.html.haml +28 -0
  94. data/app/views/publish_my_data/concept_schemes/show.html.haml +79 -0
  95. data/app/views/publish_my_data/concepts/show.html.haml +28 -0
  96. data/app/views/publish_my_data/data_cube/_controls.html.haml +19 -0
  97. data/app/views/publish_my_data/data_cube/_grid.html.haml +37 -0
  98. data/app/views/publish_my_data/datasets/_example_resources.html.haml +47 -0
  99. data/app/views/publish_my_data/datasets/_types_table.html.erb +33 -0
  100. data/app/views/publish_my_data/datasets/index.html.haml +32 -0
  101. data/app/views/publish_my_data/datasets/show.html.haml +186 -0
  102. data/app/views/publish_my_data/errors/not_found.html.haml +18 -0
  103. data/app/views/publish_my_data/errors/response_too_large.html.haml +16 -0
  104. data/app/views/publish_my_data/errors/timeout.html.haml +16 -0
  105. data/app/views/publish_my_data/errors/uncaught.html.haml +16 -0
  106. data/app/views/publish_my_data/example_resources/index.js.erb +1 -0
  107. data/app/views/publish_my_data/home/accessibility.html.haml +1 -0
  108. data/app/views/publish_my_data/home/docs.html.haml +1 -0
  109. data/app/views/publish_my_data/home/home.html.haml +5 -0
  110. data/app/views/publish_my_data/home/privacy.html.haml +1 -0
  111. data/app/views/publish_my_data/ontologies/show.html.haml +100 -0
  112. data/app/views/publish_my_data/properties/show.html.haml +28 -0
  113. data/app/views/publish_my_data/resources/_resource_data.html.haml +16 -0
  114. data/app/views/publish_my_data/resources/_sparql_section.html.haml +22 -0
  115. data/app/views/publish_my_data/resources/index.html.haml +37 -0
  116. data/app/views/publish_my_data/resources/show.html.haml +36 -0
  117. data/app/views/publish_my_data/shared/_browser_warning.html.haml +4 -0
  118. data/app/views/publish_my_data/shared/_deprecation_notice.html.haml +8 -0
  119. data/app/views/publish_my_data/shared/_footer.html.haml +11 -0
  120. data/app/views/publish_my_data/shared/_google_analytics.html.haml +11 -0
  121. data/app/views/publish_my_data/shared/_logo.html.haml +1 -0
  122. data/app/views/publish_my_data/shared/_meta_title.html.haml +2 -0
  123. data/app/views/publish_my_data/sparql/_form.html.haml +28 -0
  124. data/app/views/publish_my_data/sparql/_formats_dropdown.html.haml +11 -0
  125. data/app/views/publish_my_data/sparql/endpoint.html.haml +125 -0
  126. data/app/views/publish_my_data/sparql/formats_dropdowns/_ask.html.haml +7 -0
  127. data/app/views/publish_my_data/sparql/formats_dropdowns/_construct.html.haml +7 -0
  128. data/app/views/publish_my_data/sparql/formats_dropdowns/_describe.html.haml +1 -0
  129. data/app/views/publish_my_data/sparql/formats_dropdowns/_select.html.haml +9 -0
  130. data/app/views/publish_my_data/themes/index.html.haml +30 -0
  131. data/app/views/publish_my_data/themes/show.html.haml +43 -0
  132. data/config/routes.rb +20 -5
  133. data/lib/publish_my_data/version.rb +1 -1
  134. data/lib/publish_my_data.rb +7 -12
  135. data/spec/controllers/publish_my_data/datasets_controller_spec.rb +0 -75
  136. data/spec/controllers/publish_my_data/information_resources_controller_spec.rb +2 -11
  137. data/spec/dummy/config/environments/development.rb +0 -4
  138. data/spec/dummy/config/environments/test.rb +0 -4
  139. data/spec/dummy/log/test.log +62962 -0
  140. data/spec/dummy/tmp/cache/sass/e509ccd4d793d2c162d70125e9f3656b6c28f357/(__TEMPLATE__)c +0 -0
  141. data/spec/features/running_a_sparql_query_spec.rb +1 -1
  142. data/spec/features/uri_dereferencing_spec.rb +1 -1
  143. metadata +200 -58
  144. data/app/controllers/concerns/publish_my_data/data_download.rb +0 -22
  145. data/app/controllers/publish_my_data/vocabularies_controller.rb +0 -18
  146. data/app/views/layouts/publish_my_data/application.html.erb +0 -13
  147. data/app/views/layouts/publish_my_data/error.html.erb +0 -13
  148. data/app/views/publish_my_data/classes/show.html.erb +0 -3
  149. data/app/views/publish_my_data/concept_schemes/_concepts.html.erb +0 -18
  150. data/app/views/publish_my_data/concept_schemes/show.html.erb +0 -11
  151. data/app/views/publish_my_data/concepts/show.html.erb +0 -3
  152. data/app/views/publish_my_data/datasets/index.html.erb +0 -20
  153. data/app/views/publish_my_data/datasets/show.html.erb +0 -18
  154. data/app/views/publish_my_data/errors/not_found.html.erb +0 -1
  155. data/app/views/publish_my_data/errors/response_too_large.html.erb +0 -1
  156. data/app/views/publish_my_data/errors/timeout.html.erb +0 -1
  157. data/app/views/publish_my_data/errors/uncaught.html.erb +0 -6
  158. data/app/views/publish_my_data/ontologies/show.html.erb +0 -17
  159. data/app/views/publish_my_data/properties/show.html.erb +0 -3
  160. data/app/views/publish_my_data/resources/_predicates_table.html.erb +0 -30
  161. data/app/views/publish_my_data/resources/_predicates_table_head.html.erb +0 -6
  162. data/app/views/publish_my_data/resources/_resource_formats.html.erb +0 -4
  163. data/app/views/publish_my_data/resources/_summaries.html.erb +0 -18
  164. data/app/views/publish_my_data/resources/_uri_and_label.html.erb +0 -3
  165. data/app/views/publish_my_data/resources/index.html.erb +0 -40
  166. data/app/views/publish_my_data/resources/show.html.erb +0 -3
  167. data/app/views/publish_my_data/sparql/_ask_formats.html.erb +0 -3
  168. data/app/views/publish_my_data/sparql/_construct_formats.html.erb +0 -3
  169. data/app/views/publish_my_data/sparql/_describe_formats.html.erb +0 -1
  170. data/app/views/publish_my_data/sparql/_error_message.html.erb +0 -3
  171. data/app/views/publish_my_data/sparql/_form.html.erb +0 -4
  172. data/app/views/publish_my_data/sparql/_formats.html.erb +0 -6
  173. data/app/views/publish_my_data/sparql/_pagination.html.erb +0 -6
  174. data/app/views/publish_my_data/sparql/_results.html.erb +0 -5
  175. data/app/views/publish_my_data/sparql/_results_data.html.erb +0 -4
  176. data/app/views/publish_my_data/sparql/_select_formats.html.erb +0 -3
  177. data/app/views/publish_my_data/sparql/endpoint.html.erb +0 -10
  178. data/app/views/publish_my_data/themes/index.html.erb +0 -13
  179. data/app/views/publish_my_data/themes/show.html.erb +0 -15
  180. data/config/initializers/20_s3_setup.rb +0 -4
  181. data/spec/controllers/publish_my_data/vocabularies_controller_spec.rb +0 -14
  182. data/spec/support/data_download.rb +0 -60
@@ -0,0 +1,728 @@
1
+ //
2
+ // Mixins
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Utilities
7
+ // -------------------------
8
+
9
+ // Clearfix
10
+ // Source: http://nicolasgallagher.com/micro-clearfix-hack/
11
+ //
12
+ // For modern browsers
13
+ // 1. The space content is one way to avoid an Opera bug when the
14
+ // contenteditable attribute is included anywhere else in the document.
15
+ // Otherwise it causes space to appear at the top and bottom of elements
16
+ // that are clearfixed.
17
+ // 2. The use of `table` rather than `block` is only necessary if using
18
+ // `:before` to contain the top-margins of child elements.
19
+ @mixin clearfix() {
20
+ &:before,
21
+ &:after {
22
+ content: " "; /* 1 */
23
+ display: table; /* 2 */
24
+ }
25
+ &:after {
26
+ clear: both;
27
+ }
28
+ }
29
+
30
+ // Webkit-style focus
31
+ @mixin tab-focus() {
32
+ // Default
33
+ outline: thin dotted #333;
34
+ // Webkit
35
+ outline: 5px auto -webkit-focus-ring-color;
36
+ outline-offset: -2px;
37
+ }
38
+
39
+ // Center-align a block level element
40
+ @mixin center-block() {
41
+ display: block;
42
+ margin-left: auto;
43
+ margin-right: auto;
44
+ }
45
+
46
+ // Sizing shortcuts
47
+ @mixin size($width, $height) {
48
+ width: $width;
49
+ height: $height;
50
+ }
51
+ @mixin square($size) {
52
+ @include size($size, $size);
53
+ }
54
+
55
+ // Placeholder text
56
+ @mixin placeholder($color: $input-color-placeholder) {
57
+ &:-moz-placeholder { color: $color; } // Firefox 4-18
58
+ &::-moz-placeholder { color: $color; } // Firefox 19+
59
+ &:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
60
+ &::-webkit-input-placeholder { color: $color; } // Safari and Chrome
61
+ }
62
+
63
+ // Text overflow
64
+ // Requires inline-block or block for proper styling
65
+ @mixin text-overflow() {
66
+ overflow: hidden;
67
+ text-overflow: ellipsis;
68
+ white-space: nowrap;
69
+ }
70
+
71
+ // CSS image replacement
72
+ // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
73
+ @mixin hide-text() {
74
+ font: 0/0 a;
75
+ color: transparent;
76
+ text-shadow: none;
77
+ background-color: transparent;
78
+ border: 0;
79
+ }
80
+
81
+
82
+
83
+ // CSS3 PROPERTIES
84
+ // --------------------------------------------------
85
+
86
+ // Single side border-radius
87
+ @mixin border-top-radius($radius) {
88
+ border-top-right-radius: $radius;
89
+ border-top-left-radius: $radius;
90
+ }
91
+ @mixin border-right-radius($radius) {
92
+ border-bottom-right-radius: $radius;
93
+ border-top-right-radius: $radius;
94
+ }
95
+ @mixin border-bottom-radius($radius) {
96
+ border-bottom-right-radius: $radius;
97
+ border-bottom-left-radius: $radius;
98
+ }
99
+ @mixin border-left-radius($radius) {
100
+ border-bottom-left-radius: $radius;
101
+ border-top-left-radius: $radius;
102
+ }
103
+
104
+ // Drop shadows
105
+ @mixin box-shadow($shadow...) {
106
+ -webkit-box-shadow: $shadow; // iOS <4.3 & Android <4.1
107
+ box-shadow: $shadow;
108
+ }
109
+
110
+ // Transitions
111
+ @mixin transition($transition...) {
112
+ -webkit-transition: $transition;
113
+ transition: $transition;
114
+ }
115
+ @mixin transition-delay($transition-delay) {
116
+ -webkit-transition-delay: $transition-delay;
117
+ transition-delay: $transition-delay;
118
+ }
119
+ @mixin transition-duration($transition-duration) {
120
+ -webkit-transition-duration: $transition-duration;
121
+ transition-duration: $transition-duration;
122
+ }
123
+ @mixin transition-transform($transition...) {
124
+ -webkit-transition: -webkit-transform $transition;
125
+ -moz-transition: -moz-transform $transition;
126
+ -o-transition: -o-transform $transition;
127
+ transition: transform $transition;
128
+ }
129
+
130
+ // Transformations
131
+ @mixin rotate($degrees) {
132
+ -webkit-transform: rotate($degrees);
133
+ -ms-transform: rotate($degrees); // IE9+
134
+ transform: rotate($degrees);
135
+ }
136
+ @mixin scale($ratio) {
137
+ -webkit-transform: scale($ratio);
138
+ -ms-transform: scale($ratio); // IE9+
139
+ transform: scale($ratio);
140
+ }
141
+ @mixin translate($x, $y) {
142
+ -webkit-transform: translate($x, $y);
143
+ -ms-transform: translate($x, $y); // IE9+
144
+ transform: translate($x, $y);
145
+ }
146
+ @mixin skew($x, $y) {
147
+ -webkit-transform: skew($x, $y);
148
+ -ms-transform: skewX($x) skewY($y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
149
+ transform: skew($x, $y);
150
+ }
151
+ @mixin translate3d($x, $y, $z) {
152
+ -webkit-transform: translate3d($x, $y, $z);
153
+ transform: translate3d($x, $y, $z);
154
+ }
155
+
156
+ // Backface visibility
157
+ // Prevent browsers from flickering when using CSS 3D transforms.
158
+ // Default value is `visible`, but can be changed to `hidden`
159
+ // See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
160
+ @mixin backface-visibility($visibility){
161
+ -webkit-backface-visibility: $visibility;
162
+ -moz-backface-visibility: $visibility;
163
+ backface-visibility: $visibility;
164
+ }
165
+
166
+ // Box sizing
167
+ @mixin box-sizing($boxmodel) {
168
+ -webkit-box-sizing: $boxmodel;
169
+ -moz-box-sizing: $boxmodel;
170
+ box-sizing: $boxmodel;
171
+ }
172
+
173
+ // User select
174
+ // For selecting text on the page
175
+ @mixin user-select($select) {
176
+ -webkit-user-select: $select;
177
+ -moz-user-select: $select;
178
+ -ms-user-select: $select; // IE10+
179
+ -o-user-select: $select;
180
+ user-select: $select;
181
+ }
182
+
183
+ // Resize anything
184
+ @mixin resizable($direction) {
185
+ resize: $direction; // Options: horizontal, vertical, both
186
+ overflow: auto; // Safari fix
187
+ }
188
+
189
+ // CSS3 Content Columns
190
+ @mixin content-columns($column-count, $column-gap: $grid-gutter-width) {
191
+ -webkit-column-count: $column-count;
192
+ -moz-column-count: $column-count;
193
+ column-count: $column-count;
194
+ -webkit-column-gap: $column-gap;
195
+ -moz-column-gap: $column-gap;
196
+ column-gap: $column-gap;
197
+ }
198
+
199
+ // Optional hyphenation
200
+ @mixin hyphens($mode: auto) {
201
+ word-wrap: break-word;
202
+ -webkit-hyphens: $mode;
203
+ -moz-hyphens: $mode;
204
+ -ms-hyphens: $mode; // IE10+
205
+ -o-hyphens: $mode;
206
+ hyphens: $mode;
207
+ }
208
+
209
+ // Opacity
210
+ @mixin opacity($opacity) {
211
+ opacity: $opacity;
212
+ // IE8 filter
213
+ $opacity-ie: ($opacity * 100);
214
+ filter: alpha(opacity=$opacity-ie);
215
+ }
216
+
217
+
218
+
219
+ // GRADIENTS
220
+ // --------------------------------------------------
221
+
222
+
223
+
224
+ // Horizontal gradient, from left to right
225
+ //
226
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
227
+ // Color stops are not available in IE9 and below.
228
+ @mixin gradient-horizontal($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
229
+ background-image: -webkit-gradient(linear, $start-percent top, $end-percent top, from($start-color), to($end-color)); // Safari 4+, Chrome 2+
230
+ background-image: -webkit-linear-gradient(left, color-stop($start-color $start-percent), color-stop($end-color $end-percent)); // Safari 5.1+, Chrome 10+
231
+ background-image: -moz-linear-gradient(left, $start-color $start-percent, $end-color $end-percent); // FF 3.6+
232
+ background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent); // Standard, IE10
233
+ background-repeat: repeat-x;
234
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down
235
+ }
236
+
237
+ // Vertical gradient, from top to bottom
238
+ //
239
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
240
+ // Color stops are not available in IE9 and below.
241
+ @mixin gradient-vertical($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
242
+ background-image: -webkit-gradient(linear, left $start-percent, left $end-percent, from($start-color), to($end-color)); // Safari 4+, Chrome 2+
243
+ background-image: -webkit-linear-gradient(top, $start-color, $start-percent, $end-color, $end-percent); // Safari 5.1+, Chrome 10+
244
+ background-image: -moz-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // FF 3.6+
245
+ background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent); // Standard, IE10
246
+ background-repeat: repeat-x;
247
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down
248
+ }
249
+
250
+ @mixin gradient-directional($start-color: #555, $end-color: #333, $deg: 45deg) {
251
+ background-repeat: repeat-x;
252
+ background-image: -webkit-linear-gradient($deg, $start-color, $end-color); // Safari 5.1+, Chrome 10+
253
+ background-image: -moz-linear-gradient($deg, $start-color, $end-color); // FF 3.6+
254
+ background-image: linear-gradient($deg, $start-color, $end-color); // Standard, IE10
255
+ }
256
+ @mixin gradient-horizontal-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
257
+ background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from($start-color), color-stop($color-stop, $mid-color), to($end-color));
258
+ background-image: -webkit-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color);
259
+ background-image: -moz-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color);
260
+ background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color);
261
+ background-repeat: no-repeat;
262
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down, gets no color-stop at all for proper fallback
263
+ }
264
+ @mixin gradient-vertical-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
265
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from($start-color), color-stop($color-stop, $mid-color), to($end-color));
266
+ background-image: -webkit-linear-gradient($start-color, $mid-color $color-stop, $end-color);
267
+ background-image: -moz-linear-gradient(top, $start-color, $mid-color $color-stop, $end-color);
268
+ background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color);
269
+ background-repeat: no-repeat;
270
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback
271
+ }
272
+ @mixin gradient-radial($inner-color: #555, $outer-color: #333) {
273
+ background-image: -webkit-gradient(radial, center center, 0, center center, 460, from($inner-color), to($outer-color));
274
+ background-image: -webkit-radial-gradient(circle, $inner-color, $outer-color);
275
+ background-image: -moz-radial-gradient(circle, $inner-color, $outer-color);
276
+ background-image: radial-gradient(circle, $inner-color, $outer-color);
277
+ background-repeat: no-repeat;
278
+ }
279
+ @mixin gradient-striped($color: #555, $angle: 45deg) {
280
+ background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent));
281
+ background-image: -webkit-linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
282
+ background-image: -moz-linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
283
+ background-image: linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
284
+ }
285
+
286
+ // Reset filters for IE
287
+ //
288
+ // When you need to remove a gradient background, do not forget to use this to reset
289
+ // the IE filter for IE9 and below.
290
+ @mixin reset-filter() {
291
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
292
+ }
293
+
294
+
295
+
296
+ // Retina images
297
+ //
298
+ // Short retina mixin for setting background-image and -size
299
+
300
+ @mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {
301
+ background-image: url("#{$file-1x}");
302
+
303
+ @media
304
+ only screen and (-webkit-min-device-pixel-ratio: 2),
305
+ only screen and ( min--moz-device-pixel-ratio: 2),
306
+ only screen and ( -o-min-device-pixel-ratio: 2/1),
307
+ only screen and ( min-device-pixel-ratio: 2),
308
+ only screen and ( min-resolution: 192dpi),
309
+ only screen and ( min-resolution: 2dppx) {
310
+ background-image: url("#{$file-2x}");
311
+ background-size: $width-1x $height-1x;
312
+ }
313
+ }
314
+
315
+
316
+ // Responsive image
317
+ //
318
+ // Keep images from scaling beyond the width of their parents.
319
+
320
+ @mixin img-responsive($display: block) {
321
+ display: $display;
322
+ max-width: 100%; // Part 1: Set a maximum relative to the parent
323
+ height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
324
+ }
325
+
326
+
327
+ // COMPONENT MIXINS
328
+ // --------------------------------------------------
329
+
330
+ // Horizontal dividers
331
+ // -------------------------
332
+ // Dividers (basically an hr) within dropdowns and nav lists
333
+ @mixin nav-divider($color: #e5e5e5) {
334
+ height: 1px;
335
+ margin: (($line-height-computed / 2) - 1) 0;
336
+ overflow: hidden;
337
+ background-color: $color;
338
+ }
339
+
340
+ // Panels
341
+ // -------------------------
342
+ @mixin panel-variant($border, $heading-text-color, $heading-bg-color, $heading-border) {
343
+ border-color: $border;
344
+ & > .panel-heading {
345
+ color: $heading-text-color;
346
+ background-color: $heading-bg-color;
347
+ border-color: $heading-border;
348
+ + .panel-collapse .panel-body {
349
+ border-top-color: $border;
350
+ }
351
+ }
352
+ & > .panel-footer {
353
+ + .panel-collapse .panel-body {
354
+ border-bottom-color: $border;
355
+ }
356
+ }
357
+ }
358
+
359
+ // Alerts
360
+ // -------------------------
361
+ @mixin alert-variant($background, $border, $text-color) {
362
+ background-color: $background;
363
+ border-color: $border;
364
+ color: $text-color;
365
+ hr {
366
+ border-top-color: darken($border, 5%);
367
+ }
368
+ .alert-link {
369
+ color: darken($text-color, 10%);
370
+ }
371
+ }
372
+
373
+ // Tables
374
+ // -------------------------
375
+ @mixin table-row-variant($state, $background, $border) {
376
+ // Exact selectors below required to override `.table-striped` and prevent
377
+ // inheritance to nested tables.
378
+ .table > thead > tr,
379
+ .table > tbody > tr,
380
+ .table > tfoot > tr {
381
+ > td.#{$state},
382
+ > th.#{$state},
383
+ &.#{$state} > td,
384
+ &.#{$state} > th {
385
+ background-color: $background;
386
+ border-color: $border;
387
+ }
388
+ }
389
+
390
+ // Hover states for `.table-hover`
391
+ // Note: this is not available for cells or rows within `thead` or `tfoot`.
392
+ .table-hover > tbody > tr {
393
+ > td.#{$state}:hover,
394
+ > th.#{$state}:hover,
395
+ &.#{$state}:hover > td {
396
+ background-color: darken($background, 5%);
397
+ border-color: darken($border, 5%);
398
+ }
399
+ }
400
+ }
401
+
402
+ // Button variants
403
+ // -------------------------
404
+ // Easily pump out default styles, as well as :hover, :focus, :active,
405
+ // and disabled options for all buttons
406
+ @mixin button-variant($color, $background, $border) {
407
+ color: $color;
408
+ background-color: $background;
409
+ border-color: $border;
410
+
411
+ &:hover,
412
+ &:focus,
413
+ &:active,
414
+ &.active {
415
+ color: $color;
416
+ background-color: darken($background, 8%);
417
+ border-color: darken($border, 12%);
418
+ }
419
+ .open & { &.dropdown-toggle {
420
+ color: $color;
421
+ background-color: darken($background, 8%);
422
+ border-color: darken($border, 12%);
423
+ } }
424
+ &:active,
425
+ &.active {
426
+ background-image: none;
427
+ }
428
+ .open & { &.dropdown-toggle {
429
+ background-image: none;
430
+ } }
431
+ &.disabled,
432
+ &[disabled],
433
+ fieldset[disabled] & {
434
+ &,
435
+ &:hover,
436
+ &:focus,
437
+ &:active,
438
+ &.active {
439
+ background-color: $background;
440
+ border-color: $border
441
+ }
442
+ }
443
+ }
444
+
445
+ // Button sizes
446
+ // -------------------------
447
+ @mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
448
+ padding: $padding-vertical $padding-horizontal;
449
+ font-size: $font-size;
450
+ line-height: $line-height;
451
+ border-radius: $border-radius;
452
+ }
453
+
454
+ // Pagination
455
+ // -------------------------
456
+ @mixin pagination-size($padding-vertical, $padding-horizontal, $font-size, $border-radius) {
457
+ > li {
458
+ > a,
459
+ > span {
460
+ padding: $padding-vertical $padding-horizontal;
461
+ font-size: $font-size;
462
+ }
463
+ &:first-child {
464
+ > a,
465
+ > span {
466
+ @include border-left-radius($border-radius);
467
+ }
468
+ }
469
+ &:last-child {
470
+ > a,
471
+ > span {
472
+ @include border-right-radius($border-radius);
473
+ }
474
+ }
475
+ }
476
+ }
477
+
478
+ // Labels
479
+ // -------------------------
480
+ @mixin label-variant($color) {
481
+ background-color: $color;
482
+ &[href] {
483
+ &:hover,
484
+ &:focus {
485
+ background-color: darken($color, 10%);
486
+ }
487
+ }
488
+ }
489
+
490
+ // Navbar vertical align
491
+ // -------------------------
492
+ // Vertically center elements in the navbar.
493
+ // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
494
+ @mixin navbar-vertical-align($element-height) {
495
+ margin-top: (($navbar-height - $element-height) / 2);
496
+ margin-bottom: (($navbar-height - $element-height) / 2);
497
+ }
498
+
499
+ // Progress bars
500
+ // -------------------------
501
+ @mixin progress-bar-variant($color) {
502
+ background-color: $color;
503
+ .progress-striped & {
504
+ @include gradient-striped($color);
505
+ }
506
+ }
507
+
508
+ // Responsive utilities
509
+ // -------------------------
510
+ // More easily include all the states for responsive-utilities.less.
511
+ // $parent hack because sass doesn't support tr& (without space)
512
+ @mixin responsive-visibility($parent) {
513
+ #{$parent} { display: block !important; }
514
+ tr#{$parent} { display: table-row !important; }
515
+ th#{$parent},
516
+ td#{$parent} { display: table-cell !important; }
517
+ }
518
+
519
+ @mixin responsive-invisibility($parent) {
520
+ #{$parent} { display: none !important; }
521
+ tr#{$parent} { display: none !important; }
522
+ th#{$parent},
523
+ td#{$parent} { display: none !important; }
524
+ }
525
+
526
+ // Grid System
527
+ // -----------
528
+
529
+ // Centered container element
530
+ @mixin container-fixed() {
531
+ margin-right: auto;
532
+ margin-left: auto;
533
+ padding-left: ($grid-gutter-width / 2);
534
+ padding-right: ($grid-gutter-width / 2);
535
+ @include clearfix();
536
+ }
537
+
538
+ // Creates a wrapper for a series of columns
539
+ @mixin make-row($gutter: $grid-gutter-width) {
540
+ margin-left: ($gutter / -2);
541
+ margin-right: ($gutter / -2);
542
+ @include clearfix();
543
+ }
544
+
545
+ // Generate the extra small columns
546
+ @mixin make-xs-column($columns, $gutter: $grid-gutter-width) {
547
+ position: relative;
548
+ float: left;
549
+ width: percentage(($columns / $grid-columns));
550
+ // Prevent columns from collapsing when empty
551
+ min-height: 1px;
552
+ // Inner gutter via padding
553
+ padding-left: ($gutter / 2);
554
+ padding-right: ($gutter / 2);
555
+ }
556
+
557
+ // Generate the small columns
558
+ @mixin make-sm-column($columns, $gutter: $grid-gutter-width) {
559
+ position: relative;
560
+ // Prevent columns from collapsing when empty
561
+ min-height: 1px;
562
+ // Inner gutter via padding
563
+ padding-left: ($gutter / 2);
564
+ padding-right: ($gutter / 2);
565
+
566
+ // Calculate width based on number of columns available
567
+ @media (min-width: $screen-sm) {
568
+ float: left;
569
+ width: percentage(($columns / $grid-columns));
570
+ }
571
+ }
572
+
573
+ // Generate the small column offsets
574
+ @mixin make-sm-column-offset($columns) {
575
+ @media (min-width: $screen-sm) {
576
+ margin-left: percentage(($columns / $grid-columns));
577
+ }
578
+ }
579
+ @mixin make-sm-column-push($columns) {
580
+ @media (min-width: $screen-sm) {
581
+ left: percentage(($columns / $grid-columns));
582
+ }
583
+ }
584
+ @mixin make-sm-column-pull($columns) {
585
+ @media (min-width: $screen-sm) {
586
+ right: percentage(($columns / $grid-columns));
587
+ }
588
+ }
589
+
590
+ // Generate the medium columns
591
+ @mixin make-md-column($columns, $gutter: $grid-gutter-width) {
592
+ position: relative;
593
+ // Prevent columns from collapsing when empty
594
+ min-height: 1px;
595
+ // Inner gutter via padding
596
+ padding-left: ($gutter / 2);
597
+ padding-right: ($gutter / 2);
598
+
599
+ // Calculate width based on number of columns available
600
+ @media (min-width: $screen-md) {
601
+ float: left;
602
+ width: percentage(($columns / $grid-columns));
603
+ }
604
+ }
605
+
606
+ // Generate the large column offsets
607
+ @mixin make-md-column-offset($columns) {
608
+ @media (min-width: $screen-md) {
609
+ margin-left: percentage(($columns / $grid-columns));
610
+ }
611
+ }
612
+ @mixin make-md-column-push($columns) {
613
+ @media (min-width: $screen-md) {
614
+ left: percentage(($columns / $grid-columns));
615
+ }
616
+ }
617
+ @mixin make-md-column-pull($columns) {
618
+ @media (min-width: $screen-md) {
619
+ right: percentage(($columns / $grid-columns));
620
+ }
621
+ }
622
+
623
+ // Generate the large columns
624
+ @mixin make-lg-column($columns, $gutter: $grid-gutter-width) {
625
+ position: relative;
626
+ // Prevent columns from collapsing when empty
627
+ min-height: 1px;
628
+ // Inner gutter via padding
629
+ padding-left: ($gutter / 2);
630
+ padding-right: ($gutter / 2);
631
+
632
+ // Calculate width based on number of columns available
633
+ @media (min-width: $screen-lg) {
634
+ float: left;
635
+ width: percentage(($columns / $grid-columns));
636
+ }
637
+ }
638
+
639
+ // Generate the large column offsets
640
+ @mixin make-lg-column-offset($columns) {
641
+ @media (min-width: $screen-lg) {
642
+ margin-left: percentage(($columns / $grid-columns));
643
+ }
644
+ }
645
+ @mixin make-lg-column-push($columns) {
646
+ @media (min-width: $screen-lg) {
647
+ left: percentage(($columns / $grid-columns));
648
+ }
649
+ }
650
+ @mixin make-lg-column-pull($columns) {
651
+ @media (min-width: $screen-lg) {
652
+ right: percentage(($columns / $grid-columns));
653
+ }
654
+ }
655
+
656
+
657
+ // Form validation states
658
+ //
659
+ // Used in forms.less to generate the form validation CSS for warnings, errors,
660
+ // and successes.
661
+
662
+ @mixin form-control-validation($text-color: #555, $border-color: #ccc, $background-color: #f5f5f5) {
663
+ // Color the label and help text
664
+ .help-block,
665
+ .control-label {
666
+ color: $text-color;
667
+ }
668
+ // Set the border and box shadow on specific inputs to match
669
+ .form-control {
670
+ border-color: $border-color;
671
+ @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
672
+ &:focus {
673
+ border-color: darken($border-color, 10%);
674
+ $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($border-color, 20%);
675
+ @include box-shadow($shadow);
676
+ }
677
+ }
678
+ // Set validation states also for addons
679
+ .input-group-addon {
680
+ color: $text-color;
681
+ border-color: $border-color;
682
+ background-color: $background-color;
683
+ }
684
+ }
685
+
686
+ // Form control focus state
687
+ //
688
+ // Generate a customized focus state and for any input with the specified color,
689
+ // which defaults to the `$input-focus-border` variable.
690
+ //
691
+ // We highly encourage you to not customize the default value, but instead use
692
+ // this to tweak colors on an as-needed basis. This aesthetic change is based on
693
+ // WebKit's default styles, but applicable to a wider range of browsers. Its
694
+ // usability and accessibility should be taken into account with any change.
695
+ //
696
+ // Example usage: change the default blue border and shadow to white for better
697
+ // contrast against a dark gray background.
698
+
699
+ @mixin form-control-focus($color: $input-border-focus) {
700
+ $color-rgba: rgba(red($color), green($color), blue($color), .6);
701
+ &:focus {
702
+ border-color: $color;
703
+ outline: 0;
704
+ @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px $color-rgba);
705
+ }
706
+ }
707
+
708
+ // Form control sizing
709
+ //
710
+ // Relative text size, padding, and border-radii changes for form controls. For
711
+ // horizontal sizing, wrap controls in the predefined grid classes. `<select>`
712
+ // element gets special love because it's special, and that's a fact!
713
+
714
+ @mixin input-size($parent, $input-height, $padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
715
+ #{$parent} { height: $input-height;
716
+ padding: $padding-vertical $padding-horizontal;
717
+ font-size: $font-size;
718
+ line-height: $line-height;
719
+ border-radius: $border-radius; }
720
+ select#{$parent} {
721
+ height: $input-height;
722
+ line-height: $input-height;
723
+ }
724
+
725
+ textarea#{$parent} {
726
+ height: auto;
727
+ }
728
+ }