para 0.11.4 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (228) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/para/admin/main.scss +31 -0
  3. data/app/assets/stylesheets/para/admin/src/_affix.scss +7 -0
  4. data/app/assets/stylesheets/para/admin/src/_alert.scss +35 -0
  5. data/app/assets/stylesheets/para/admin/src/_base.scss +63 -0
  6. data/app/assets/stylesheets/para/admin/src/_bootstrap-variables.scss +766 -379
  7. data/app/assets/stylesheets/para/admin/src/_breadcrumb.scss +37 -0
  8. data/app/assets/stylesheets/para/admin/src/_buttons.scss +128 -0
  9. data/app/assets/stylesheets/para/admin/src/_checkable.scss +106 -0
  10. data/app/assets/stylesheets/para/admin/src/_common.scss +250 -0
  11. data/app/assets/stylesheets/para/admin/src/_dropdown.scss +52 -0
  12. data/app/assets/stylesheets/para/admin/src/_form.scss +359 -0
  13. data/app/assets/stylesheets/para/admin/src/_list.scss +96 -0
  14. data/app/assets/stylesheets/para/admin/src/_mixins.scss +109 -0
  15. data/app/assets/stylesheets/para/admin/src/_multi-select.scss +110 -0
  16. data/app/assets/stylesheets/para/admin/src/_navigation.scss +210 -0
  17. data/app/assets/stylesheets/para/admin/src/_navtabs.scss +68 -0
  18. data/app/assets/stylesheets/para/admin/src/_nested-many.scss +87 -0
  19. data/app/assets/stylesheets/para/admin/src/_nested_one.scss +26 -0
  20. data/app/assets/stylesheets/para/admin/src/_orderable.scss +48 -0
  21. data/app/assets/stylesheets/para/admin/src/_page-loading.scss +40 -0
  22. data/app/assets/stylesheets/para/admin/src/_pagination.scss +39 -0
  23. data/app/assets/stylesheets/para/admin/src/_panel.scss +61 -0
  24. data/app/assets/stylesheets/para/admin/src/_responsive.scss +133 -0
  25. data/app/assets/stylesheets/para/admin/src/_sorting.scss +43 -0
  26. data/app/assets/stylesheets/para/admin/src/_statcard.scss +46 -0
  27. data/app/assets/stylesheets/para/admin/src/_table.scss +36 -0
  28. data/app/assets/stylesheets/para/admin/src/_tree.scss +60 -0
  29. data/app/assets/stylesheets/para/admin/src/{_variables.sass → _variables.scss} +7 -7
  30. data/app/assets/stylesheets/para/admin/src/{_well.sass → _well.scss} +5 -4
  31. data/app/assets/stylesheets/para/admin.scss +15 -0
  32. data/app/assets/stylesheets/para/index.scss +1 -0
  33. data/app/assets/stylesheets/para/lib/datetimepicker.scss +15 -0
  34. data/app/assets/stylesheets/para/lib/fuelux.scss +46 -0
  35. data/app/assets/stylesheets/para/lib/jasny-bootstrap.scss +100 -0
  36. data/app/assets/stylesheets/para/lib/selectize.scss +129 -0
  37. data/app/assets/stylesheets/para/lib/slider.scss +14 -0
  38. data/app/controllers/para/admin/crud_resources_controller.rb +16 -9
  39. data/app/controllers/para/admin/imports_controller.rb +9 -9
  40. data/app/controllers/para/admin/jobs_controller.rb +7 -1
  41. data/app/controllers/para/admin/resources_controller.rb +17 -18
  42. data/app/controllers/para/admin/settings_component_controller.rb +2 -2
  43. data/app/helpers/para/admin/base_helper.rb +36 -25
  44. data/app/helpers/para/admin/page_helper.rb +8 -9
  45. data/app/helpers/para/flash_helper.rb +7 -28
  46. data/app/helpers/para/model_helper.rb +5 -8
  47. data/app/helpers/para/tree_helper.rb +4 -4
  48. data/app/javascripts/para/admin/async-progress.js +58 -0
  49. data/app/javascripts/para/admin/filters-form.js +12 -0
  50. data/app/javascripts/para/admin/job-tracker.js +33 -0
  51. data/app/javascripts/para/admin/table.js +58 -0
  52. data/app/javascripts/para/admin/tabs.js +110 -0
  53. data/app/javascripts/para/admin/theme_actions.js +39 -0
  54. data/app/javascripts/para/admin/tree.js +124 -0
  55. data/app/javascripts/para/application.js +2 -0
  56. data/app/javascripts/para/controllers/application.js +17 -0
  57. data/app/javascripts/para/controllers/index.js +10 -0
  58. data/app/javascripts/para/controllers/para_admin_flash_message_controller.js +48 -0
  59. data/app/javascripts/para/controllers/para_admin_modal_controller.js +43 -0
  60. data/app/javascripts/para/controllers/selectize_field_controller.js +142 -0
  61. data/app/javascripts/para/index.js +31 -0
  62. data/app/javascripts/para/inputs/material-input.js +7 -0
  63. data/app/javascripts/para/inputs/multi-select-input.js +343 -0
  64. data/app/javascripts/para/inputs/nested_many.js +151 -0
  65. data/app/javascripts/para/lib/fetch.js +41 -0
  66. data/app/javascripts/para/lib/page-loading.js +42 -0
  67. data/app/javascripts/para/simple_form_extension/colorpicker.js +30 -0
  68. data/app/javascripts/para/simple_form_extension/datetimepicker.js +115 -0
  69. data/app/javascripts/para/simple_form_extension/fileinput.js +57 -0
  70. data/app/javascripts/para/simple_form_extension/index.js +12 -0
  71. data/app/javascripts/para/simple_form_extension/selectize.js +160 -0
  72. data/app/javascripts/para/simple_form_extension/simple_form_extension_initialization.js +62 -0
  73. data/app/javascripts/para/simple_form_extension/slider.js +43 -0
  74. data/app/javascripts/para/simple_form_extension/spinbox.js +35 -0
  75. data/app/javascripts/para/vendor/bootstrap-colorpicker.js +1025 -0
  76. data/app/javascripts/para/vendor/bootstrap-slider.js +1610 -0
  77. data/app/javascripts/para/vendor/cocoon.js +150 -0
  78. data/app/javascripts/para/vendor/jquery.datetimepicker.js +2156 -0
  79. data/app/javascripts/para/vendor/jquery.js +3 -0
  80. data/app/javascripts/para/vendor/spinbox.js +438 -0
  81. data/app/javascripts/para/vendor/vertebra.js +224 -0
  82. data/app/views/admin/para/exporter/bases/_completed.html.haml +1 -1
  83. data/app/views/layouts/para/admin.html.haml +4 -2
  84. data/app/views/para/admin/imports/new.html.haml +12 -11
  85. data/app/views/para/admin/jobs/_completed.html.haml +1 -1
  86. data/app/views/para/admin/jobs/_failed.html.haml +1 -1
  87. data/app/views/para/admin/jobs/_job.html.haml +11 -0
  88. data/app/views/para/admin/jobs/show.html.haml +1 -10
  89. data/app/views/para/admin/resources/_add_button.html.haml +1 -1
  90. data/app/views/para/admin/resources/_exports_menu.html.haml +2 -2
  91. data/app/views/para/admin/resources/_filters.html.haml +1 -1
  92. data/app/views/para/admin/resources/_imports_menu.html.haml +2 -2
  93. data/app/views/para/admin/resources/_list.html.haml +27 -26
  94. data/app/views/para/admin/resources/_navigation.html.haml +10 -11
  95. data/app/views/para/admin/resources/_subclassable_add_button.html.haml +1 -1
  96. data/app/views/para/admin/shared/_flash.html.haml +18 -0
  97. data/app/views/para/admin/shared/_header.html.haml +1 -1
  98. data/app/views/para/form/_tabs.html.haml +1 -1
  99. data/app/views/para/inputs/_nested_many.html.haml +3 -3
  100. data/app/views/para/inputs/nested_many/_add.html.haml +1 -1
  101. data/app/views/para/inputs/nested_many/_add_with_subclasses.html.haml +2 -2
  102. data/app/views/para/inputs/nested_many/_container.html.haml +1 -1
  103. data/config/locales/fr.yml +1 -0
  104. data/lib/generators/para/install/install_generator.rb +10 -14
  105. data/lib/para/attribute_field/base.rb +3 -0
  106. data/lib/para/attribute_field/wysiwyg_editor.rb +15 -0
  107. data/lib/para/attribute_field.rb +1 -1
  108. data/lib/para/components_configuration.rb +1 -1
  109. data/lib/para/engine.rb +20 -22
  110. data/lib/para/ext/turbo_stream.rb +13 -0
  111. data/lib/para/ext.rb +1 -1
  112. data/lib/para/form_builder/containers.rb +33 -22
  113. data/lib/para/form_builder/nested_form.rb +6 -5
  114. data/lib/para/inputs/nested_many_input.rb +5 -0
  115. data/lib/para/markup/modal.rb +30 -15
  116. data/lib/para/markup/resources_buttons.rb +15 -11
  117. data/lib/para/model_field_parsers/wysiwyg_editor.rb +19 -0
  118. data/lib/para/model_field_parsers.rb +1 -1
  119. data/lib/para/version.rb +1 -1
  120. data/lib/para.rb +2 -8
  121. data/lib/simple_form_extension/components/icons.rb +13 -0
  122. data/lib/simple_form_extension/components/popovers.rb +46 -0
  123. data/lib/simple_form_extension/components.rb +8 -0
  124. data/lib/simple_form_extension/ext/form_builder.rb +20 -0
  125. data/lib/simple_form_extension/file_concern.rb +74 -0
  126. data/lib/simple_form_extension/inputs/boolean_input.rb +16 -0
  127. data/lib/simple_form_extension/inputs/collection_check_boxes_input.rb +15 -0
  128. data/lib/simple_form_extension/inputs/collection_radio_buttons_input.rb +15 -0
  129. data/lib/simple_form_extension/inputs/color_input.rb +37 -0
  130. data/lib/simple_form_extension/inputs/date_time_input.rb +48 -0
  131. data/lib/simple_form_extension/inputs/file_input.rb +41 -0
  132. data/lib/simple_form_extension/inputs/image_input.rb +110 -0
  133. data/lib/simple_form_extension/inputs/numeric_input.rb +27 -0
  134. data/lib/simple_form_extension/inputs/selectize_input.rb +210 -0
  135. data/lib/simple_form_extension/inputs/slider_input.rb +30 -0
  136. data/lib/simple_form_extension/inputs.rb +16 -0
  137. data/lib/simple_form_extension/railtie.rb +21 -0
  138. data/lib/simple_form_extension/resource_name_helper.rb +9 -0
  139. data/lib/simple_form_extension/translations.rb +7 -0
  140. data/lib/simple_form_extension/version.rb +3 -0
  141. data/lib/simple_form_extension.rb +30 -0
  142. data/vendor/assets/images/simple_form_extension/bootstrap-colorpicker/alpha-horizontal.png +0 -0
  143. data/vendor/assets/images/simple_form_extension/bootstrap-colorpicker/alpha.png +0 -0
  144. data/vendor/assets/images/simple_form_extension/bootstrap-colorpicker/hue-horizontal.png +0 -0
  145. data/vendor/assets/images/simple_form_extension/bootstrap-colorpicker/hue.png +0 -0
  146. data/vendor/assets/images/simple_form_extension/bootstrap-colorpicker/saturation.png +0 -0
  147. data/vendor/assets/stylesheets/bootstrap-colorpicker.scss +227 -0
  148. data/vendor/assets/stylesheets/bootstrap-slider.scss +246 -0
  149. data/vendor/assets/stylesheets/bootstrap.scss +6032 -0
  150. data/vendor/assets/stylesheets/jquery.datetimepicker.scss +568 -0
  151. metadata +120 -188
  152. data/app/assets/javascripts/admin/app.coffee +0 -1
  153. data/app/assets/javascripts/para/admin/async-progress.coffee +0 -29
  154. data/app/assets/javascripts/para/admin/filters-form.coffee +0 -11
  155. data/app/assets/javascripts/para/admin/job-tracker.coffee +0 -39
  156. data/app/assets/javascripts/para/admin/table.coffee +0 -44
  157. data/app/assets/javascripts/para/admin/tabs.coffee +0 -63
  158. data/app/assets/javascripts/para/admin/theme_actions.coffee +0 -25
  159. data/app/assets/javascripts/para/admin/tree.coffee +0 -105
  160. data/app/assets/javascripts/para/admin.coffee +0 -22
  161. data/app/assets/javascripts/para/application.js +0 -13
  162. data/app/assets/javascripts/para/inputs/material-input.coffee +0 -4
  163. data/app/assets/javascripts/para/inputs/multi-select-input.coffee +0 -174
  164. data/app/assets/javascripts/para/inputs/nested_many.coffee +0 -108
  165. data/app/assets/javascripts/para/lib/ajax.coffee +0 -11
  166. data/app/assets/javascripts/para/lib/remote-file-forms.coffee +0 -59
  167. data/app/assets/javascripts/para/lib/turbolinks-forms.coffee +0 -23
  168. data/app/assets/javascripts/para/lib/turbolinks-loading.coffee +0 -25
  169. data/app/assets/javascripts/para/lib/turbolinks-reloader.coffee +0 -19
  170. data/app/assets/stylesheets/para/admin/main.sass +0 -33
  171. data/app/assets/stylesheets/para/admin/src/_affix.sass +0 -4
  172. data/app/assets/stylesheets/para/admin/src/_alert.sass +0 -17
  173. data/app/assets/stylesheets/para/admin/src/_base.sass +0 -54
  174. data/app/assets/stylesheets/para/admin/src/_breadcrumb.sass +0 -32
  175. data/app/assets/stylesheets/para/admin/src/_buttons.sass +0 -107
  176. data/app/assets/stylesheets/para/admin/src/_checkable.sass +0 -94
  177. data/app/assets/stylesheets/para/admin/src/_common.sass +0 -202
  178. data/app/assets/stylesheets/para/admin/src/_dropdown.sass +0 -40
  179. data/app/assets/stylesheets/para/admin/src/_form.sass +0 -299
  180. data/app/assets/stylesheets/para/admin/src/_list.sass +0 -89
  181. data/app/assets/stylesheets/para/admin/src/_mixins.sass +0 -113
  182. data/app/assets/stylesheets/para/admin/src/_multi-select.sass +0 -91
  183. data/app/assets/stylesheets/para/admin/src/_navigation.sass +0 -171
  184. data/app/assets/stylesheets/para/admin/src/_navtabs.sass +0 -58
  185. data/app/assets/stylesheets/para/admin/src/_nested-many.sass +0 -75
  186. data/app/assets/stylesheets/para/admin/src/_nested_one.sass +0 -22
  187. data/app/assets/stylesheets/para/admin/src/_orderable.sass +0 -44
  188. data/app/assets/stylesheets/para/admin/src/_page-loading.sass +0 -39
  189. data/app/assets/stylesheets/para/admin/src/_pagination.sass +0 -34
  190. data/app/assets/stylesheets/para/admin/src/_panel.sass +0 -55
  191. data/app/assets/stylesheets/para/admin/src/_responsive.sass +0 -117
  192. data/app/assets/stylesheets/para/admin/src/_sorting.sass +0 -36
  193. data/app/assets/stylesheets/para/admin/src/_statcard.sass +0 -41
  194. data/app/assets/stylesheets/para/admin/src/_table.sass +0 -33
  195. data/app/assets/stylesheets/para/admin/src/_tree.sass +0 -52
  196. data/app/assets/stylesheets/para/admin.sass +0 -12
  197. data/app/assets/stylesheets/para/lib/compass/_support.scss +0 -447
  198. data/app/assets/stylesheets/para/lib/compass/css3/_box-shadow.scss +0 -88
  199. data/app/assets/stylesheets/para/lib/compass/css3/_images.scss +0 -152
  200. data/app/assets/stylesheets/para/lib/compass/css3/_inline-block.scss +0 -31
  201. data/app/assets/stylesheets/para/lib/compass/css3/_text-shadow.scss +0 -82
  202. data/app/assets/stylesheets/para/lib/compass/css3/_transform.scss +0 -590
  203. data/app/assets/stylesheets/para/lib/compass/css3/_transition.scss +0 -190
  204. data/app/assets/stylesheets/para/lib/compass/css3/_user-interface.scss +0 -71
  205. data/app/assets/stylesheets/para/lib/compass/utilities/general/_hacks.scss +0 -65
  206. data/app/assets/stylesheets/para/lib/datetimepicker.sass +0 -15
  207. data/app/assets/stylesheets/para/lib/fuelux.sass +0 -40
  208. data/app/assets/stylesheets/para/lib/jasny-bootstrap.sass +0 -97
  209. data/app/assets/stylesheets/para/lib/redactor.sass +0 -86
  210. data/app/assets/stylesheets/para/lib/selectize.sass +0 -111
  211. data/app/assets/stylesheets/para/lib/slider.sass +0 -12
  212. data/app/assets/stylesheets/para/plugins-includes.sass.erb +0 -1
  213. data/lib/para/attribute_field/redactor.rb +0 -22
  214. data/lib/para/ext/request_iframe_xhr.rb +0 -17
  215. data/lib/para/iframe_transport/middleware.rb +0 -58
  216. data/lib/para/iframe_transport.rb +0 -7
  217. data/lib/para/model_field_parsers/redactor.rb +0 -19
  218. data/vendor/assets/javascripts/jquery.iframe-transport.js +0 -260
  219. data/vendor/assets/javascripts/jquery.remote-modal-form.coffee +0 -145
  220. /data/app/assets/stylesheets/admin/{app.sass → app.scss} +0 -0
  221. /data/app/{assets/javascripts → javascripts}/para/plugins-includes.js.erb +0 -0
  222. /data/{vendor/assets/javascripts → app/javascripts/para/vendor}/Sortable.js +0 -0
  223. /data/{vendor/assets/javascripts → app/javascripts/para/vendor}/jasny-bootstrap.js +0 -0
  224. /data/{vendor/assets/javascripts → app/javascripts/para/vendor}/jquery.scrollto.js +0 -0
  225. /data/{vendor/assets/javascripts → app/javascripts/para/vendor}/jquery.sortable.js +0 -0
  226. /data/vendor/assets/stylesheets/{animate.css → animate.scss} +0 -0
  227. /data/vendor/assets/stylesheets/{hint.css → hint.scss} +0 -0
  228. /data/vendor/assets/stylesheets/{jasny-bootstrap.css → jasny-bootstrap.scss} +0 -0
@@ -1,33 +0,0 @@
1
- //
2
- // Table
3
- // --------------------------------------------------
4
-
5
- // Main style
6
- //
7
- //##
8
-
9
- .table
10
- margin-bottom: 0
11
-
12
- .table > thead > tr > th
13
- font-weight: 300
14
-
15
- .table > tbody > tr > td
16
- vertical-align: middle
17
- .label
18
- display: inline-block
19
- margin-bottom: 4px
20
-
21
- .table > thead > tr > th
22
- border-bottom: 1px solid #A6AFBB
23
-
24
- //** Actions with 3 btn at least
25
- .table-row-actions
26
- min-width: 180px
27
- text-align: right
28
- .btn
29
- margin: 0 3px
30
-
31
- //** img dont destroy the table and don't create horizontal scroll
32
- .table > tbody > tr > td > img.max-width
33
- max-width: 250px
@@ -1,52 +0,0 @@
1
- //
2
- // Tree
3
- // --------------------------------------------------
4
-
5
- //== Main style
6
- //
7
- //##
8
-
9
- .root-tree
10
- padding-left: 0
11
- .tree
12
- padding-left: 40px
13
-
14
- .sortable-dragging
15
- .placeholder,
16
- .btn-group
17
- display: none
18
-
19
- .sortable-placeholder
20
- height: 30px
21
- margin: 10px 0px 20px 0
22
-
23
- .node
24
- border-left: 4px solid $gray-light
25
- padding-bottom: 5px
26
- margin-top: 15px
27
- .node-row
28
- +default-transition
29
- border-bottom: 1px dashed $gray-light
30
- padding: 5px
31
- &:first-child
32
- border-top: 1px dashed $gray-light
33
- &:hover
34
- background-color: $gray-lighter
35
- .btn
36
- margin: 0 3px
37
-
38
- .handle
39
- font-size: 14px
40
- margin: 4px 14px 0 5px
41
-
42
- .node-name
43
- margin-top: 4px
44
- display: inline-block
45
-
46
- .placeholder
47
- border: dashed 1px $gray
48
- height: 30px
49
- margin-top: 5px
50
-
51
- .tree
52
- list-style: none
@@ -1,12 +0,0 @@
1
- //= require_self
2
- //= require animate
3
- //= require hint
4
- //= require font-awesome
5
- //= require jasny-bootstrap
6
- //= require simple_form_extension
7
- //= require selectize
8
- //= require selectize.bootstrap3
9
- //= require_tree ./lib
10
- //= require ./admin/main
11
- //= require ./plugins-includes
12
- //= require admin/app
@@ -1,447 +0,0 @@
1
- // Map of compass extensions that are loaded. The value will either be
2
- // the version of the extension or `true` if the version is unknown.
3
- // $compass-extensions: compass-extensions() !default;
4
-
5
- // The list of browsers you want to support.
6
- // Defaults to all.
7
- $supported-browsers: browsers() !default;
8
-
9
- // The browser usage threshold for features that gracefully degrade
10
- // Defaults to 1 user in 1,000.
11
- $graceful-usage-threshold: 0.1 !default;
12
-
13
- // The browser usage threshold for features that cannot degrade gracefully
14
- // Defaults to 1 user in 10,000.
15
- $critical-usage-threshold: 0.01 !default;
16
-
17
- // Set this to true to generate comments that will explain why a prefix was included or omitted.
18
- $debug-browser-support: false !default;
19
-
20
- // Minimum browser versions that must be supported.
21
- // The keys of this map are any valid browser according to `browsers()`.
22
- // The values of this map are the min version that is valid for that browser
23
- // according to `browser-versions($browser)`
24
- $browser-minimum-versions: (
25
- 'chrome': null,
26
- 'firefox': null,
27
- 'ie': null,
28
- 'safari': null,
29
- 'opera': null
30
- ) !default;
31
-
32
-
33
- // @private
34
- $default-capability-options: (
35
- full-support: true,
36
- partial-support: true
37
- );
38
-
39
- // When a prefix in in context, but there is no current prefix
40
- // That context is recorded here so other prefixes can be avoided.
41
- $prefix-context: null;
42
-
43
- // When a prefix is in a selector or directive scope, this is set to the
44
- // current prefix value. When `null`, either there is no prefix in scope
45
- // or the official prefix is being rendered. The `$prefix-context`
46
- // variable can be used to make that distinction.
47
- $current-prefix: null;
48
-
49
- // When in a context that only exists in a particular version
50
- // this variable is set to those versions.
51
- $current-browser-versions: ();
52
-
53
- // The legacy support CSS 2.1 Selectors.
54
- // Defaults to the $critical-usage-threshold.
55
- $css-sel2-support-threshold: $critical-usage-threshold !default;
56
-
57
- // Check if the browser is in scope given the browser support and current prefix minimums.
58
- @function browser-out-of-scope($browser, $version: null) {
59
- @if not index($supported-browsers, $browser) {
60
- @if $debug-browser-support {
61
- @return "#{$browser} is not listed as a supported browser."
62
- } @else {
63
- @return true;
64
- }
65
- } @else if not ($current-prefix == null or $current-prefix == browser-prefix($browser)) {
66
- @if $debug-browser-support {
67
- @return "#{$browser} #{$version} is incompatible with #{$current-prefix}."
68
- } @else {
69
- @return true;
70
- }
71
- }
72
- $current-range: map-get($current-browser-versions, $browser);
73
- $current-min: if($current-range, nth($current-range, 1), null);
74
- $current-max: if($current-range, nth($current-range, 2), null);
75
- @if not ($version and $current-max) {
76
- // We don't have any versions to compare
77
- @return false;
78
- } @else {
79
- // If the version is less than the current min, it is not supported
80
- $too-old: compare-browser-versions($browser, $version, $current-min) < 0;
81
- $too-new: compare-browser-versions($browser, $version, $current-max) > 0;
82
- @if $too-old or $too-new {
83
- @if $debug-browser-support {
84
- @return "The current scope only works with #{display-browser-range($browser, $current-min, $current-max)}.";
85
- } @else {
86
- @return true;
87
- }
88
- } @else {
89
- @return false;
90
- }
91
- }
92
- }
93
-
94
- // Check whether the browser is supported according to the supported browsers,
95
- // declared minimum support and usage thresholds.
96
- @function support-legacy-browser($browser, $min-version, $max-version: null, $threshold: $critical-usage-threshold) {
97
- @if not index($supported-browsers, $browser) {
98
- @return false;
99
- }
100
- // Check agaist usage stats and declared minimums
101
- $min-required-version: map-get($browser-minimum-versions, $browser);
102
- $usage: if($max-version,
103
- omitted-usage($browser, $min-version, $max-version),
104
- omitted-usage($browser, $min-version));
105
- @return $usage > $threshold or
106
- ($min-required-version and
107
- compare-browser-versions($browser, $max-version or $min-version, $min-required-version) >= 0);
108
- }
109
-
110
- // Include content for a legacy browser
111
- // Version can be a single version string or a list of versions ordered from oldest to newest.
112
- @mixin for-legacy-browser($browser, $min-version, $max-version: $min-version,
113
- $threshold: $critical-usage-threshold,
114
- $ranges: ($browser: $min-version $max-version)) {
115
- @if not browser-out-of-scope($browser, $max-version) and
116
- support-legacy-browser($browser, $min-version, $max-version, $threshold)
117
- {
118
- @if $debug-browser-support {
119
- /* Content for #{display-browser-range($browser, $min-version, $max-version)}.
120
- Min version: #{map-get($browser-minimum-versions, $browser) or unspecified}.
121
- User threshold to keep: #{$threshold}%. If #{display-browser-range($browser, $min-version, $max-version)} are omitted: #{omitted-usage($browser, $min-version, $max-version)}%. */
122
- }
123
- @include with-browser-ranges(intersect-browser-ranges($current-browser-versions, $ranges)) {
124
- @content;
125
- }
126
- } @else if $debug-browser-support and browser-out-of-scope($browser, $max-version) {
127
- /* Content for #{display-browser-range($browser, $min-version, $max-version)} omitted.
128
- Not allowed in the current scope: #{browser-out-of-scope($browser, $max-version)} */
129
- } @else if $debug-browser-support and not
130
- support-legacy-browser($browser, $min-version, $max-version, $threshold) {
131
- @if omitted-usage($browser, $min-version, $max-version) > $threshold {
132
- /* Content for #{display-browser-range($browser, $min-version, $max-version)} omitted.
133
- User threshold to keep: #{$threshold}%. If #{display-browser-range($browser, $min-version, $max-version)} and below are omitted: #{omitted-usage($browser, $min-version, $max-version)}%. */
134
- } @else {
135
- /* Content for #{display-browser-range($browser, $min-version, $max-version)} omitted.
136
- Minimum support is #{map-get($browser-minimum-versions, $browser)}. */
137
- }
138
- }
139
- }
140
-
141
- @function display-browser-range($browser, $min-version, $max-version: $min-version) {
142
- @return "#{unquote($browser)} #{unquote($min-version)}#{if($max-version != $min-version, unquote(' -') unquote($max-version), null)}";
143
- }
144
-
145
-
146
- // Renders the content once if any of the legacy browsers are supported.
147
- // $browsers is a map of browser name to version ranges
148
- @mixin for-legacy-browsers($browsers, $threshold: $critical-usage-threshold) {
149
- $rendered: false;
150
- @each $browser, $range in $browsers {
151
- @if not $rendered {
152
- @include for-legacy-browser($browser, $range..., $threshold: $threshold, $ranges: $browsers) {
153
- $rendered: true;
154
- @content;
155
- }
156
- }
157
- }
158
- }
159
-
160
- // If there's a prefix context in scope, this will only output the content if the prefix matches.
161
- // Otherwise, sets the current prefix scope and outputs the content.
162
- @mixin with-prefix($prefix) {
163
- @if $current-prefix or $prefix-context {
164
- @if $current-prefix == $prefix or $prefix-context == $prefix {
165
- @if $debug-browser-support {
166
- @if $prefix {
167
- /* content for #{$prefix} because #{$current-prefix or $prefix-context} is already in scope. */
168
- } @else {
169
- /* unprefixed content. #{$current-prefix or $prefix-context} is already in scope. */
170
- }
171
- }
172
- $old-prefix-context: $prefix-context;
173
- $old-prefix: $current-prefix;
174
- $prefix-context: $prefix-context or $current-prefix !global;
175
- $current-prefix: $prefix !global;
176
- @content;
177
- $prefix-context: $old-prefix-context !global;
178
- $current-prefix: $old-prefix !global;
179
- } @else if $prefix == null {
180
- $old-prefix-context: $prefix-context;
181
- $prefix-context: $prefix-context or $current-prefix !global;
182
- $current-prefix: null !global;
183
- @if $debug-browser-support {
184
- /* Content for official syntax. Prefix context is still #{$prefix-context}. */
185
- }
186
- @content;
187
- $current-prefix: $prefix-context !global;
188
- $prefix-context: $old-prefix-context !global;
189
- } @else if $debug-browser-support {
190
- /* Omitting content for #{$prefix} because #{$current-prefix} is already in scope. */
191
- }
192
- } @else {
193
- @if $debug-browser-support and $prefix {
194
- /* Creating new #{$prefix} context. */
195
- }
196
- $prefix-context: $prefix !global;
197
- $current-prefix: $prefix !global;
198
- @content;
199
- $current-prefix: null !global;
200
- $prefix-context: null !global;
201
- }
202
- }
203
-
204
- @function prefixes-for-capability($capability, $threshold, $capability-options: $default-capability-options) {
205
- $result: ();
206
- @each $prefix in browser-prefixes($supported-browsers) {
207
- $result: map-merge($result,
208
- ($prefix: use-prefix($prefix, $capability, $threshold, $capability-options)));
209
- }
210
- @return $result;
211
- }
212
-
213
- // Yields to the mixin content once for each prefix required.
214
- // The current prefix is set to the $current-prefix global for use by the included content.
215
- // Also yields to the content once with $current-prefix set to null for the official version
216
- // as long as there's not already a prefix in scope.
217
- @mixin with-each-prefix($capability, $threshold, $capability-options: $default-capability-options) {
218
- @each $prefix, $should-use-prefix in prefixes-for-capability($capability, $threshold, $capability-options) {
219
- @if $should-use-prefix {
220
- @if $debug-browser-support and type-of($should-use-prefix) == list {
221
- /* Capability #{$capability} is prefixed with #{$prefix} because #{$should-use-prefix} is required. */
222
- } @else if $debug-browser-support and type-of($should-use-prefix) == number {
223
- /* Capability #{$capability} is prefixed with #{$prefix} because #{$should-use-prefix}% of users need it which is more than the threshold of #{$threshold}%. */
224
- }
225
- @include with-prefix($prefix) {
226
- @include with-browser-ranges($capability) {
227
- @content;
228
- }
229
- }
230
- } @else if $debug-browser-support {
231
- /* Capability #{$capability} is not prefixed with #{$prefix} because #{prefix-usage($prefix, $capability, $capability-options)}% of users are affected which is less than the threshold of #{$threshold}. */
232
- }
233
- }
234
- @include with-prefix(null) {
235
- @include with-browser-ranges($capability) {
236
- @content;
237
- }
238
- }
239
- }
240
-
241
- // Returns true if at least one browser-version pair in $subset-ranges
242
- // is a higher (or same) version than the browser-version pairs in
243
- // $ranges.
244
- @function has-browser-subset($ranges, $subset-ranges) {
245
- $found-mismatch: false;
246
- @each $browser, $subset-range in $subset-ranges {
247
- $range: map-get($ranges, $browser);
248
- @if $range {
249
- $min-1: nth($subset-range, 1);
250
- $max-1: nth($subset-range, 2);
251
- $min-2: nth($range, 1);
252
- $max-2: nth($range, 2);
253
- @if (compare-browser-versions($browser, $min-2, $min-1) <= 0 and
254
- compare-browser-versions($browser, $min-1, $max-2) <= 0) or
255
- (compare-browser-versions($browser, $min-2, $max-1) <= 0 and
256
- compare-browser-versions($browser, $max-1, $max-2) <= 0) or
257
- (compare-browser-versions($browser, $min-1, $min-2) <= 0 and
258
- compare-browser-versions($browser, $max-1, $max-2) >= 0) or
259
- (compare-browser-versions($browser, $min-1, $min-2) >= 0 and
260
- compare-browser-versions($browser, $max-1, $max-2) <= 0) {
261
- @return true;
262
- } @else {
263
- $found-mismatch: true
264
- }
265
- }
266
- }
267
- @return not $found-mismatch;
268
- }
269
-
270
- // When the same browser is in both maps, then the minimum will be set
271
- // to the maximum of the two minimum versions, and the maximum will be
272
- // set to the minmum of the two maximum versions.
273
- @function intersect-browser-ranges($ranges, $new-ranges) {
274
- @each $browser, $new-range in $new-ranges {
275
- $old-range: map-get($ranges, $browser);
276
- @if $old-range {
277
- $old-min: nth($old-range, 1);
278
- $old-max: if(length($old-range) == 1, $old-min, nth($old-range, 2));
279
- $new-min: nth($new-range, 1);
280
- $new-max: if(length($new-range) == 1, $new-min, nth($new-range, 2));
281
- $maximin: if(compare-browser-versions($browser, $old-min, $new-min) > 0,
282
- $old-min, $new-min);
283
- $minimax: if(compare-browser-versions($browser, $old-max, $new-max) < 0,
284
- $old-max, $new-max);
285
- $ranges: map-merge($ranges, ($browser: $maximin $minimax));
286
- } @else {
287
- $ranges: map-merge($ranges, ($browser: $new-range));
288
- }
289
- }
290
- @return $ranges;
291
- }
292
-
293
- // If passed a map, that will be the new browser ranges.
294
- // Otherwise a range map will be created based on the given capability and prefix
295
- // using the `browser-ranges($capability, $prefix)` function.
296
- //
297
- // If there are current ranges in scope and the new ranges have some overlap
298
- // with the current,
299
- //
300
- // If there is no overlap, then the content will not be rendered.
301
- @mixin with-browser-ranges($capability, $prefix: $current-prefix) {
302
- $new-ranges: null;
303
- @if type-of($capability) == map {
304
- $new-ranges: $capability;
305
- } @else {
306
- $new-ranges: browser-ranges($capability, $prefix);
307
- }
308
-
309
- @if has-browser-subset($current-browser-versions, $new-ranges) {
310
- $old-ranges: $current-browser-versions;
311
- $current-browser-versions: intersect-browser-ranges($old-ranges, $new-ranges) !global;
312
- @content;
313
- $current-browser-versions: $old-ranges !global;
314
- } @else if $debug-browser-support {
315
- /* Excluding content because #{inspect($new-ranges)} is not included within
316
- #{inspect($current-browser-versions)} */
317
- }
318
- }
319
-
320
- // Returns true if the prefixed usage stats for the capability exceed the threshold
321
- // or if the minimum version for a supported browser would require a prefix for the capability.
322
- @function use-prefix($prefix, $capability, $threshold, $capability-options: $default-capability-options) {
323
- $usage: prefix-usage($prefix, $capability, $capability-options);
324
- @if $usage > $threshold {
325
- @return $usage;
326
- } @else {
327
- @each $browser in browsers($prefix) {
328
- @if index($supported-browsers, $browser) {
329
- $min-version: map-get($browser-minimum-versions, $browser);
330
- @if $min-version {
331
- $actual-prefix: browser-requires-prefix($browser, $min-version, $capability, $capability-options);
332
- @if $actual-prefix and $prefix == $actual-prefix {
333
- @return $browser $min-version;
334
- }
335
- }
336
- }
337
- }
338
- }
339
- @return false;
340
- }
341
-
342
- @function prefix-identifier($ident, $prefix: $current-prefix) {
343
- @return unquote("#{$prefix}#{if($prefix, '-', null)}#{$ident}");
344
- }
345
-
346
- // Output a property and value using the current prefix.
347
- // It will be unprefixed if $current-prefix is null.
348
- @mixin prefix-prop($property, $value, $prefix: $current-prefix) {
349
- #{prefix-identifier($property, $prefix)}: $value;
350
- }
351
-
352
- // Emit a set of properties with the prefix governed by the capability and usage threshold given.
353
- //
354
- // Example:
355
- //
356
- // @include prefixed-properties(css-animation, $animation-support-threshold,
357
- // (animation-name: foo, animation-duration: 2s)
358
- // );
359
- @mixin prefixed-properties($capability, $threshold, $properties, $capability-options: $default-capability-options) {
360
- @include with-each-prefix($capability, $threshold, $capability-options) {
361
- @each $prop, $value in $properties {
362
- @include prefix-prop($prop, $value);
363
- }
364
- }
365
- }
366
-
367
-
368
- // @private
369
- @function warn-about-old-variables() {
370
- $old-variables-in-use: ();
371
- @each $old-variable-name in
372
- (legacy-support-for-ie, legacy-support-for-ie6, legacy-support-for-ie7,
373
- legacy-support-for-ie8, legacy-support-for-mozilla, legacy-support-for-webkit,
374
- experimental-support-for-mozilla, experimental-support-for-webkit,
375
- experimental-support-for-opera, experimental-support-for-microsoft,
376
- experimental-support-for-khtml, experimental-support-for-svg)
377
- {
378
- @if global-variable-exists($old-variable-name) {
379
- $old-variables-in-use: append($old-variables-in-use,
380
- unquote("$#{$old-variable-name}"), comma);
381
- }
382
- }
383
- @if length($old-variables-in-use) > 0 {
384
- @warn "Compass has changed how browser support is configured. " +
385
- "The following configuration variables " +
386
- "are no longer supported: #{$old-variables-in-use}." +
387
- "Details: http://compass-style.org/help/documentation/tuning-vendor-prefixes/"
388
- }
389
- @return $old-variables-in-use;
390
- }
391
-
392
- // @private
393
- @function warn-about-pie-removal() {
394
- @if global-variable-exists(experimental-support-for-pie) {
395
- @warn "Compass no longer supports css3pie.";
396
- }
397
- @return true;
398
- }
399
-
400
- // Enable browser support debugging within the content block.
401
- // Or you can enable it for the whole stylesheet by setting `$debug-browser-support` to true.
402
- @mixin with-browser-support-debugging {
403
- $current-status: $debug-browser-support;
404
- $debug-browser-support: true !global;
405
- @content;
406
- $debug-browser-support: $current-status !global;
407
- }
408
-
409
- // Set a default value if the given arglist is empty
410
- @function set-arglist-default($arglist, $default) {
411
- $default-index: index($arglist, default);
412
- @if $default-index {
413
- $arglist: set-nth($arglist, $default-index, $default)
414
- }
415
- @return if(length($arglist) > 0, $arglist, $default);
416
- }
417
-
418
-
419
- // @private
420
- $old-variable-warnings-issued: warn-about-old-variables() !default;
421
-
422
- // @private
423
- $pie-removal-warning-issued: warn-about-pie-removal() !default;
424
-
425
- // @private
426
- @function warn-about-useless-prefix-arguments($moz: null, $webkit: null, $o: null, $khtml: null, $official: null) {
427
- @if $moz != null or $webkit != null or $o != null or $khtml != null or $official != null {
428
- @warn "Browser prefix arguments to this mixin are no longer used and " +
429
- "will be removed in the next release.";
430
- }
431
- @return true;
432
- }
433
-
434
- // coerce a list to be comma delimited or make a new, empty comma delimited list.
435
- @function comma-list($list: ()) {
436
- @return join((), $list, comma);
437
- }
438
-
439
- // @private Returns the legacy value for a given box-model
440
- // - Used by background-clip and -origin.
441
- @function legacy-box($box) {
442
- $box: unquote($box);
443
- @if $box == padding-box { $box: padding; }
444
- @if $box == border-box { $box: border; }
445
- @if $box == content-box { $box: content; }
446
- @return $box;
447
- }
@@ -1,88 +0,0 @@
1
- // Box Shadow
2
-
3
- @import "para/lib/compass/support";
4
-
5
- // The prefixed support threshold for box-shadow.
6
- // Defaults to the $graceful-usage-threshold.
7
- $box-shadow-support-threshold: $graceful-usage-threshold !default;
8
-
9
-
10
- // The default color for box shadows
11
- $default-box-shadow-color: #333333 !default;
12
-
13
- // The default horizontal offset. Positive is to the right.
14
- $default-box-shadow-h-offset: 0px !default;
15
-
16
- // The default vertical offset. Positive is down.
17
- $default-box-shadow-v-offset: 0px !default;
18
-
19
- // The default blur length.
20
- $default-box-shadow-blur: 5px !default;
21
-
22
- // The default spread length.
23
- $default-box-shadow-spread: null !default;
24
-
25
- // The default shadow inset: inset or null (for standard shadow).
26
- $default-box-shadow-inset: null !default;
27
-
28
- @function default-box-shadow() {
29
- @return compact(if($default-box-shadow-inset, inset, null)
30
- $default-box-shadow-h-offset
31
- $default-box-shadow-v-offset
32
- $default-box-shadow-blur
33
- $default-box-shadow-spread
34
- $default-box-shadow-color);
35
- }
36
-
37
- // Provides cross-browser for Webkit, Gecko, and CSS3 box shadows
38
- // when one or more box shadows are needed.
39
- // Each shadow argument should adhere to the standard css3 syntax
40
- // for the box-shadow property.
41
- @mixin box-shadow($shadow...) {
42
- $shadow: set-arglist-default($shadow, default-box-shadow());
43
- @include prefixed-properties(css-boxshadow, $box-shadow-support-threshold, (box-shadow: $shadow));
44
- }
45
-
46
- // Provides a single cross-browser CSS box shadow for Webkit, Gecko, and CSS3.
47
- // Includes default arguments for color, horizontal offset, vertical offset, blur length, spread length, and inset.
48
- @mixin single-box-shadow(
49
- $hoff : null,
50
- $voff : null,
51
- $blur : null,
52
- $spread : null,
53
- $color : null,
54
- $inset : $default-box-shadow-inset
55
- ) {
56
- // Handle legacy argument order
57
- @if not ($hoff == none or $hoff == null) and type-of($hoff) != number {
58
- @warn "The $color argument for single-box-shadow is now the 5th argument instead of the 1st.";
59
- $tmp-color: $color;
60
- $color: $hoff;
61
- $hoff: $voff;
62
- $voff: $blur;
63
- $blur: $spread;
64
- $spread: $tmp-color
65
- }
66
-
67
- // Need to set these defaults here instead of the arglist to support the above backwards compat handling
68
- @if $hoff == null { $hoff: $default-box-shadow-h-offset; }
69
- @if $voff == null { $hoff: $default-box-shadow-v-offset; }
70
- @if $blur == null { $blur: $default-box-shadow-blur; }
71
- @if $spread == null { $spread: $default-box-shadow-spread; }
72
- @if $color == null { $color: $default-box-shadow-color; }
73
-
74
- @if not ($inset == true or $inset == false or $inset == null or $inset == inset) {
75
- @warn "$inset expected to be true or the inset keyword. Got #{$inset} instead. Using: inset";
76
- }
77
-
78
- @if $hoff == none {
79
- @include box-shadow(none);
80
- } @else {
81
- $full : $hoff $voff;
82
- @if $blur { $full: $full $blur; }
83
- @if $spread { $full: $full $spread; }
84
- @if $color { $full: $full $color; }
85
- @if $inset { $full: inset $full; }
86
- @include box-shadow($full);
87
- }
88
- }