You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
4.2 KiB

[MIG] web_widget_slick: Migrate to v10 * Add local slick files to use instead of CDN * Override CSS to display widget correctly * Adjust arrow button size/placement * Bump version * Rename __openerp__.py -> __manifest__.py * Rename widget_slick.js -> web_widget_slick.js * Update copyright, license (AGPL -> LGPL) * Update readme * Correct eslint errors * Change module name in various places for consistency * Improve styling of widget arrows, dots * Change css -> less * Remove unneeded slick files * Copyright 2017 -> 2016-2017 * Add OCA to authors * Use OCA icon * Fix readme * Clean up assets * Fix file permissions * Update readme with reference to example module * Fix formatting error, incorrect link * Add javascript tests * Add note to readme about functional testing with example module * Fix/cleanup javascript * Fix destroy_content() method * Move slide navigation out of slide addition loop * Remove unused variables * Remove unneeded DOM append * Reorganize files/directories * Adjust template tags (templates -> template) * Add slick-field class to field template instead of using jQuery * Misc cleanup * Adjust breakpoint settings to show fewer images by default * Enable adaptiveHeight by default * Add .img and .img-responsive classes to images * Fix dragging issues by preventing default mousedown and touchstart event behavior * Set swipeToSlide default to true * Change how slick slides are populated to allow grid mode * Fix issue causing carousel images to display improperly in some situations * Add better functional testing instructions to readme * Add roadmap to readme * Make minor styling changes * Fix issue with template loading w/ PhantomJS * Clean up template, use css class provided by widget * Remove unneeded dependency from tests * Break up render_value method * Break up destroy_content method * Add unslicking to destroy_content, add test * Clean up qweb template formatting * Fix indentation * Change widget name * Add Slick copyright information * Add padding left/right, move arrows in to avoid clipping when widget not in a sheet tag * Apply dot and arrow styles only when needed * Add _resizeCarousel() and related methods to ensure accurate carousel sizing in various views * Resize carousel on core.bus resize * Account for differences in group layouts and labels, sheet/no-sheet layouts * Adjust, clean up less * Clean up js
7 years ago
  1. /* Copyright 2013-2016 Ken Wheeler
  2. * Version 1.7.1
  3. * License MIT (https://opensource.org/licenses/MIT) */
  4. @charset "UTF-8";
  5. // Default Variables
  6. @slick-font-path: "./fonts/";
  7. @slick-font-family: "slick";
  8. @slick-loader-path: "./";
  9. @slick-arrow-color: white;
  10. @slick-dot-color: black;
  11. @slick-dot-color-active: @slick-dot-color;
  12. @slick-prev-character: "←";
  13. @slick-next-character: "→";
  14. @slick-dot-character: "•";
  15. @slick-dot-size: 6px;
  16. @slick-opacity-default: 0.75;
  17. @slick-opacity-on-hover: 1;
  18. @slick-opacity-not-active: 0.25;
  19. /* Slider */
  20. .slick-loading .slick-list{
  21. background: #fff url('@{slick-loader-path}ajax-loader.gif') center center no-repeat;
  22. }
  23. /* Arrows */
  24. .slick-prev,
  25. .slick-next {
  26. position: absolute;
  27. display: block;
  28. height: 20px;
  29. width: 20px;
  30. line-height: 0px;
  31. font-size: 0px;
  32. cursor: pointer;
  33. background: transparent;
  34. color: transparent;
  35. top: 50%;
  36. -webkit-transform: translate(0, -50%);
  37. -ms-transform: translate(0, -50%);
  38. transform: translate(0, -50%);
  39. padding: 0;
  40. border: none;
  41. outline: none;
  42. &:hover, &:focus {
  43. outline: none;
  44. background: transparent;
  45. color: transparent;
  46. &:before {
  47. opacity: @slick-opacity-on-hover;
  48. }
  49. }
  50. &.slick-disabled:before {
  51. opacity: @slick-opacity-not-active;
  52. }
  53. }
  54. .slick-prev:before, .slick-next:before {
  55. font-family: @slick-font-family;
  56. font-size: 20px;
  57. line-height: 1;
  58. color: @slick-arrow-color;
  59. opacity: @slick-opacity-default;
  60. -webkit-font-smoothing: antialiased;
  61. -moz-osx-font-smoothing: grayscale;
  62. & when ( @slick-font-family = 'slick' ) {
  63. /* Icons */
  64. @font-face {
  65. font-family: 'slick';
  66. font-weight: normal;
  67. font-style: normal;
  68. src: url('@{slick-font-path}slick.eot');
  69. src: url('@{slick-font-path}slick.eot?#iefix') format('embedded-opentype'), url('@{slick-font-path}slick.woff') format('woff'), url('@{slick-font-path}slick.ttf') format('truetype'), url('@{slick-font-path}slick.svg#slick') format('svg');
  70. }
  71. }
  72. }
  73. .slick-prev {
  74. left: -25px;
  75. [dir="rtl"] & {
  76. left: auto;
  77. right: -25px;
  78. }
  79. &:before {
  80. content: @slick-prev-character;
  81. [dir="rtl"] & {
  82. content: @slick-next-character;
  83. }
  84. }
  85. }
  86. .slick-next {
  87. right: -25px;
  88. [dir="rtl"] & {
  89. left: -25px;
  90. right: auto;
  91. }
  92. &:before {
  93. content: @slick-next-character;
  94. [dir="rtl"] & {
  95. content: @slick-prev-character;
  96. }
  97. }
  98. }
  99. /* Dots */
  100. .slick-dotted .slick-slider {
  101. margin-bottom: 30px;
  102. }
  103. .slick-dots {
  104. position: absolute;
  105. bottom: -25px;
  106. list-style: none;
  107. display: block;
  108. text-align: center;
  109. padding: 0;
  110. margin: 0;
  111. width: 100%;
  112. li {
  113. position: relative;
  114. display: inline-block;
  115. height: 20px;
  116. width: 20px;
  117. margin: 0 5px;
  118. padding: 0;
  119. cursor: pointer;
  120. button {
  121. border: 0;
  122. background: transparent;
  123. display: block;
  124. height: 20px;
  125. width: 20px;
  126. outline: none;
  127. line-height: 0px;
  128. font-size: 0px;
  129. color: transparent;
  130. padding: 5px;
  131. cursor: pointer;
  132. &:hover, &:focus {
  133. outline: none;
  134. &:before {
  135. opacity: @slick-opacity-on-hover;
  136. }
  137. }
  138. &:before {
  139. position: absolute;
  140. top: 0;
  141. left: 0;
  142. content: @slick-dot-character;
  143. width: 20px;
  144. height: 20px;
  145. font-family: @slick-font-family;
  146. font-size: @slick-dot-size;
  147. line-height: 20px;
  148. text-align: center;
  149. color: @slick-dot-color;
  150. opacity: @slick-opacity-not-active;
  151. -webkit-font-smoothing: antialiased;
  152. -moz-osx-font-smoothing: grayscale;
  153. }
  154. }
  155. &.slick-active button:before {
  156. color: @slick-dot-color-active;
  157. opacity: @slick-opacity-default;
  158. }
  159. }
  160. }