integral 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (761) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +105 -0
  4. data/Rakefile +22 -0
  5. data/app/assets/images/integral/backend/data-unavailable.png +0 -0
  6. data/app/assets/images/integral/backend/logo.png +0 -0
  7. data/app/assets/images/integral/defaults/no_image_available.jpg +0 -0
  8. data/app/assets/images/integral/defaults/user_avatar.jpg +0 -0
  9. data/app/assets/images/integral/image-not-set.png +0 -0
  10. data/app/assets/images/integral/posts-hero-banner.jpg +0 -0
  11. data/app/assets/javascripts/ckeditor/loader.js.erb +6 -0
  12. data/app/assets/javascripts/ckeditor/my_config.js.erb +154 -0
  13. data/app/assets/javascripts/ckeditor/my_contents.sass +22 -0
  14. data/app/assets/javascripts/ckeditor/my_javascript.js +12 -0
  15. data/app/assets/javascripts/ckeditor/my_styles.js +5 -0
  16. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/az.js +8 -0
  17. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/bg.js +8 -0
  18. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ca.js +8 -0
  19. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/cs.js +8 -0
  20. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/da.js +8 -0
  21. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/de-ch.js +8 -0
  22. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/de.js +8 -0
  23. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/el.js +8 -0
  24. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/en-au.js +8 -0
  25. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/en.js +8 -0
  26. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/eo.js +8 -0
  27. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/es-mx.js +8 -0
  28. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/es.js +8 -0
  29. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/eu.js +8 -0
  30. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/fr.js +8 -0
  31. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/gl.js +8 -0
  32. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/hr.js +8 -0
  33. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/hu.js +8 -0
  34. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/it.js +8 -0
  35. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ja.js +8 -0
  36. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/km.js +8 -0
  37. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ko.js +8 -0
  38. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ku.js +8 -0
  39. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/mk.js +8 -0
  40. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/nb.js +8 -0
  41. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/nl.js +8 -0
  42. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/oc.js +8 -0
  43. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/pl.js +8 -0
  44. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/pt-br.js +8 -0
  45. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/pt.js +8 -0
  46. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ro.js +8 -0
  47. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ru.js +8 -0
  48. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/sk.js +8 -0
  49. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/sq.js +8 -0
  50. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/sv.js +8 -0
  51. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/tr.js +8 -0
  52. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ug.js +8 -0
  53. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/uk.js +8 -0
  54. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/vi.js +8 -0
  55. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/zh-cn.js +8 -0
  56. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/zh.js +8 -0
  57. data/app/assets/javascripts/ckeditor/plugins/autoembed/plugin.js +218 -0
  58. data/app/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +232 -0
  59. data/app/assets/javascripts/ckeditor/plugins/autogrow/samples/autogrow.html +102 -0
  60. data/app/assets/javascripts/ckeditor/plugins/autolink/plugin.js +69 -0
  61. data/app/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -0
  62. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/autocomplete.png +0 -0
  63. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/autoformat.png +0 -0
  64. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/commentselectedrange.png +0 -0
  65. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/searchcode.png +0 -0
  66. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/uncommentselectedrange.png +0 -0
  67. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +2 -0
  68. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +2 -0
  69. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -0
  70. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +6 -0
  71. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcode.min.js +1 -0
  72. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +1 -0
  73. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +2 -0
  74. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -0
  75. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +3 -0
  76. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.twig.min.js +1 -0
  77. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/af.js +12 -0
  78. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ar.js +12 -0
  79. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/bg.js +12 -0
  80. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/bn.js +12 -0
  81. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/bs.js +12 -0
  82. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ca.js +12 -0
  83. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/cs.js +12 -0
  84. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/cy.js +12 -0
  85. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/da.js +12 -0
  86. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/de.js +12 -0
  87. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/el.js +12 -0
  88. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/en-au.js +12 -0
  89. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/en-ca.js +12 -0
  90. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/en-gb.js +12 -0
  91. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/en.js +12 -0
  92. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/eo.js +12 -0
  93. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/es.js +12 -0
  94. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/et.js +12 -0
  95. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/eu.js +12 -0
  96. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/fa.js +12 -0
  97. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/fi.js +12 -0
  98. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/fo.js +12 -0
  99. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/fr-ca.js +12 -0
  100. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/fr.js +12 -0
  101. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/gl.js +12 -0
  102. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/gu.js +12 -0
  103. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/he.js +12 -0
  104. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/hi.js +12 -0
  105. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/hr.js +12 -0
  106. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/hu.js +12 -0
  107. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/is.js +12 -0
  108. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/it.js +12 -0
  109. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ja.js +12 -0
  110. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ka.js +12 -0
  111. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/km.js +12 -0
  112. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ko.js +12 -0
  113. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ku.js +12 -0
  114. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/lt.js +12 -0
  115. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/lv.js +12 -0
  116. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/mk.js +12 -0
  117. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/mn.js +12 -0
  118. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ms.js +12 -0
  119. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/nb.js +12 -0
  120. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/nl.js +12 -0
  121. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/no.js +12 -0
  122. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/pl.js +12 -0
  123. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/pt-br.js +12 -0
  124. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/pt.js +12 -0
  125. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ro.js +12 -0
  126. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ru.js +12 -0
  127. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/sk.js +12 -0
  128. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/sl.js +12 -0
  129. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/sr-latn.js +12 -0
  130. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/sr.js +12 -0
  131. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/sv.js +12 -0
  132. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/th.js +12 -0
  133. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/tr.js +12 -0
  134. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ug.js +12 -0
  135. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/uk.js +12 -0
  136. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/vi.js +12 -0
  137. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/zh-cn.js +12 -0
  138. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/zh.js +12 -0
  139. data/app/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +1311 -0
  140. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-day.css +41 -0
  141. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-night.css +39 -0
  142. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/abcdef.css +32 -0
  143. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance-mobile.css +5 -0
  144. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +74 -0
  145. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-dark.css +38 -0
  146. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-light.css +38 -0
  147. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/bespin.css +34 -0
  148. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/blackboard.css +32 -0
  149. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +25 -0
  150. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/colorforth.css +33 -0
  151. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/dracula.css +40 -0
  152. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-dark.css +35 -0
  153. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-light.css +36 -0
  154. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +23 -0
  155. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/elegant.css +13 -0
  156. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +34 -0
  157. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/hopscotch.css +34 -0
  158. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/icecoder.css +43 -0
  159. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/isotope.css +34 -0
  160. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +47 -0
  161. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/liquibyte.css +95 -0
  162. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/material.css +53 -0
  163. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/mbo.css +37 -0
  164. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/mdn-like.css +46 -0
  165. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/midnight.css +43 -0
  166. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +36 -0
  167. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/neat.css +12 -0
  168. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/neo.css +43 -0
  169. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +27 -0
  170. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/panda-syntax.css +85 -0
  171. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-dark.css +38 -0
  172. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-light.css +38 -0
  173. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/pastel-on-dark.css +52 -0
  174. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/railscasts.css +34 -0
  175. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +25 -0
  176. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/seti.css +44 -0
  177. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +168 -0
  178. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/the-matrix.css +30 -0
  179. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/tomorrow-night-bright.css +35 -0
  180. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/tomorrow-night-eighties.css +38 -0
  181. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/ttcn.css +64 -0
  182. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +32 -0
  183. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +34 -0
  184. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +53 -0
  185. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-light.css +43 -0
  186. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/yeti.css +44 -0
  187. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/zenburn.css +37 -0
  188. data/app/assets/javascripts/ckeditor/plugins/embed/icons/embed.png +0 -0
  189. data/app/assets/javascripts/ckeditor/plugins/embed/icons/hidpi/embed.png +0 -0
  190. data/app/assets/javascripts/ckeditor/plugins/embed/plugin.js +105 -0
  191. data/app/assets/javascripts/ckeditor/plugins/embedbase/dialogs/embedbase.js +99 -0
  192. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/az.js +15 -0
  193. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/bg.js +15 -0
  194. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ca.js +15 -0
  195. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/cs.js +15 -0
  196. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/da.js +15 -0
  197. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/de-ch.js +15 -0
  198. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/de.js +15 -0
  199. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/en-au.js +15 -0
  200. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/en.js +15 -0
  201. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/eo.js +15 -0
  202. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/es-mx.js +15 -0
  203. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/es.js +15 -0
  204. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/eu.js +15 -0
  205. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/fr.js +15 -0
  206. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/gl.js +15 -0
  207. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/hr.js +15 -0
  208. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/hu.js +15 -0
  209. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/id.js +15 -0
  210. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/it.js +15 -0
  211. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ja.js +15 -0
  212. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ko.js +15 -0
  213. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ku.js +15 -0
  214. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/nb.js +15 -0
  215. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/nl.js +15 -0
  216. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/oc.js +15 -0
  217. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/pl.js +15 -0
  218. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/pt-br.js +15 -0
  219. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/pt.js +15 -0
  220. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ro.js +15 -0
  221. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ru.js +15 -0
  222. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/sk.js +15 -0
  223. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/sq.js +15 -0
  224. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/sv.js +15 -0
  225. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/tr.js +15 -0
  226. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ug.js +15 -0
  227. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/uk.js +15 -0
  228. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/zh-cn.js +15 -0
  229. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/zh.js +15 -0
  230. data/app/assets/javascripts/ckeditor/plugins/embedbase/plugin.js +652 -0
  231. data/app/assets/javascripts/ckeditor/plugins/embedjs/plugin.js +110 -0
  232. data/app/assets/javascripts/ckeditor/plugins/lineutils/dev/dnd.html +172 -0
  233. data/app/assets/javascripts/ckeditor/plugins/lineutils/dev/magicfinger.html +285 -0
  234. data/app/assets/javascripts/ckeditor/plugins/lineutils/plugin.js +1018 -0
  235. data/app/assets/javascripts/ckeditor/plugins/notification/lang/cs.js +7 -0
  236. data/app/assets/javascripts/ckeditor/plugins/notification/lang/da.js +7 -0
  237. data/app/assets/javascripts/ckeditor/plugins/notification/lang/de-ch.js +7 -0
  238. data/app/assets/javascripts/ckeditor/plugins/notification/lang/de.js +7 -0
  239. data/app/assets/javascripts/ckeditor/plugins/notification/lang/en.js +7 -0
  240. data/app/assets/javascripts/ckeditor/plugins/notification/lang/eo.js +7 -0
  241. data/app/assets/javascripts/ckeditor/plugins/notification/lang/eu.js +7 -0
  242. data/app/assets/javascripts/ckeditor/plugins/notification/lang/fr.js +7 -0
  243. data/app/assets/javascripts/ckeditor/plugins/notification/lang/gl.js +7 -0
  244. data/app/assets/javascripts/ckeditor/plugins/notification/lang/id.js +7 -0
  245. data/app/assets/javascripts/ckeditor/plugins/notification/lang/it.js +7 -0
  246. data/app/assets/javascripts/ckeditor/plugins/notification/lang/km.js +7 -0
  247. data/app/assets/javascripts/ckeditor/plugins/notification/lang/ko.js +7 -0
  248. data/app/assets/javascripts/ckeditor/plugins/notification/lang/ku.js +7 -0
  249. data/app/assets/javascripts/ckeditor/plugins/notification/lang/nb.js +7 -0
  250. data/app/assets/javascripts/ckeditor/plugins/notification/lang/nl.js +7 -0
  251. data/app/assets/javascripts/ckeditor/plugins/notification/lang/pl.js +7 -0
  252. data/app/assets/javascripts/ckeditor/plugins/notification/lang/pt-br.js +7 -0
  253. data/app/assets/javascripts/ckeditor/plugins/notification/lang/pt.js +7 -0
  254. data/app/assets/javascripts/ckeditor/plugins/notification/lang/ru.js +7 -0
  255. data/app/assets/javascripts/ckeditor/plugins/notification/lang/sv.js +7 -0
  256. data/app/assets/javascripts/ckeditor/plugins/notification/lang/tr.js +7 -0
  257. data/app/assets/javascripts/ckeditor/plugins/notification/lang/ug.js +7 -0
  258. data/app/assets/javascripts/ckeditor/plugins/notification/lang/uk.js +7 -0
  259. data/app/assets/javascripts/ckeditor/plugins/notification/lang/zh-cn.js +7 -0
  260. data/app/assets/javascripts/ckeditor/plugins/notification/lang/zh.js +7 -0
  261. data/app/assets/javascripts/ckeditor/plugins/notification/plugin.js +923 -0
  262. data/app/assets/javascripts/ckeditor/plugins/notificationaggregator/plugin.js +548 -0
  263. data/app/assets/javascripts/ckeditor/plugins/placeholder/dev/placeholder.html +60 -0
  264. data/app/assets/javascripts/ckeditor/plugins/placeholder/dialogs/placeholder.js +49 -0
  265. data/app/assets/javascripts/ckeditor/plugins/placeholder/icons/hidpi/placeholder.png +0 -0
  266. data/app/assets/javascripts/ckeditor/plugins/placeholder/icons/placeholder.png +0 -0
  267. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/af.js +12 -0
  268. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ar.js +12 -0
  269. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/az.js +12 -0
  270. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/bg.js +12 -0
  271. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ca.js +12 -0
  272. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/cs.js +12 -0
  273. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/cy.js +12 -0
  274. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/da.js +12 -0
  275. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/de-ch.js +12 -0
  276. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/de.js +12 -0
  277. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/el.js +12 -0
  278. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/en-gb.js +12 -0
  279. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/en.js +12 -0
  280. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/eo.js +12 -0
  281. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/es-mx.js +12 -0
  282. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/es.js +12 -0
  283. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/et.js +12 -0
  284. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/eu.js +12 -0
  285. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fa.js +12 -0
  286. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fi.js +12 -0
  287. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fr-ca.js +12 -0
  288. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fr.js +12 -0
  289. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/gl.js +12 -0
  290. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/he.js +12 -0
  291. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/hr.js +12 -0
  292. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/hu.js +12 -0
  293. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/id.js +12 -0
  294. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/it.js +12 -0
  295. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ja.js +12 -0
  296. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/km.js +12 -0
  297. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ko.js +12 -0
  298. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ku.js +12 -0
  299. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/lv.js +12 -0
  300. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/nb.js +12 -0
  301. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/nl.js +12 -0
  302. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/no.js +12 -0
  303. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/oc.js +12 -0
  304. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/pl.js +12 -0
  305. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/pt-br.js +12 -0
  306. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/pt.js +12 -0
  307. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ru.js +12 -0
  308. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/si.js +12 -0
  309. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sk.js +12 -0
  310. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sl.js +12 -0
  311. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sq.js +12 -0
  312. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sv.js +12 -0
  313. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/th.js +12 -0
  314. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/tr.js +12 -0
  315. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/tt.js +12 -0
  316. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ug.js +12 -0
  317. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/uk.js +12 -0
  318. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/vi.js +12 -0
  319. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/zh-cn.js +12 -0
  320. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/zh.js +12 -0
  321. data/app/assets/javascripts/ckeditor/plugins/placeholder/plugin.js +99 -0
  322. data/app/assets/javascripts/ckeditor/plugins/placeholder/samples/placeholder.html +75 -0
  323. data/app/assets/javascripts/ckeditor/plugins/strinsert/README.md +76 -0
  324. data/app/assets/javascripts/ckeditor/plugins/strinsert/bower.json +16 -0
  325. data/app/assets/javascripts/ckeditor/plugins/strinsert/plugin.js +107 -0
  326. data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/contents.css +23 -0
  327. data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/sample.jpg +0 -0
  328. data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/contents.css +36 -0
  329. data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/dialogs/simplebox.js +51 -0
  330. data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/icons/simplebox.png +0 -0
  331. data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/plugin.js +114 -0
  332. data/app/assets/javascripts/ckeditor/plugins/widget/dev/console.js +131 -0
  333. data/app/assets/javascripts/ckeditor/plugins/widget/dev/nestedwidgets.html +134 -0
  334. data/app/assets/javascripts/ckeditor/plugins/widget/dev/widgetstyles.html +144 -0
  335. data/app/assets/javascripts/ckeditor/plugins/widget/images/handle.png +0 -0
  336. data/app/assets/javascripts/ckeditor/plugins/widget/lang/af.js +8 -0
  337. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ar.js +8 -0
  338. data/app/assets/javascripts/ckeditor/plugins/widget/lang/az.js +8 -0
  339. data/app/assets/javascripts/ckeditor/plugins/widget/lang/bg.js +8 -0
  340. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ca.js +8 -0
  341. data/app/assets/javascripts/ckeditor/plugins/widget/lang/cs.js +8 -0
  342. data/app/assets/javascripts/ckeditor/plugins/widget/lang/cy.js +8 -0
  343. data/app/assets/javascripts/ckeditor/plugins/widget/lang/da.js +8 -0
  344. data/app/assets/javascripts/ckeditor/plugins/widget/lang/de-ch.js +8 -0
  345. data/app/assets/javascripts/ckeditor/plugins/widget/lang/de.js +8 -0
  346. data/app/assets/javascripts/ckeditor/plugins/widget/lang/el.js +8 -0
  347. data/app/assets/javascripts/ckeditor/plugins/widget/lang/en-gb.js +8 -0
  348. data/app/assets/javascripts/ckeditor/plugins/widget/lang/en.js +8 -0
  349. data/app/assets/javascripts/ckeditor/plugins/widget/lang/eo.js +8 -0
  350. data/app/assets/javascripts/ckeditor/plugins/widget/lang/es-mx.js +8 -0
  351. data/app/assets/javascripts/ckeditor/plugins/widget/lang/es.js +8 -0
  352. data/app/assets/javascripts/ckeditor/plugins/widget/lang/eu.js +8 -0
  353. data/app/assets/javascripts/ckeditor/plugins/widget/lang/fa.js +8 -0
  354. data/app/assets/javascripts/ckeditor/plugins/widget/lang/fi.js +8 -0
  355. data/app/assets/javascripts/ckeditor/plugins/widget/lang/fr.js +8 -0
  356. data/app/assets/javascripts/ckeditor/plugins/widget/lang/gl.js +8 -0
  357. data/app/assets/javascripts/ckeditor/plugins/widget/lang/he.js +8 -0
  358. data/app/assets/javascripts/ckeditor/plugins/widget/lang/hr.js +8 -0
  359. data/app/assets/javascripts/ckeditor/plugins/widget/lang/hu.js +8 -0
  360. data/app/assets/javascripts/ckeditor/plugins/widget/lang/id.js +8 -0
  361. data/app/assets/javascripts/ckeditor/plugins/widget/lang/it.js +8 -0
  362. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ja.js +8 -0
  363. data/app/assets/javascripts/ckeditor/plugins/widget/lang/km.js +8 -0
  364. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ko.js +8 -0
  365. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ku.js +8 -0
  366. data/app/assets/javascripts/ckeditor/plugins/widget/lang/lv.js +8 -0
  367. data/app/assets/javascripts/ckeditor/plugins/widget/lang/nb.js +8 -0
  368. data/app/assets/javascripts/ckeditor/plugins/widget/lang/nl.js +8 -0
  369. data/app/assets/javascripts/ckeditor/plugins/widget/lang/no.js +8 -0
  370. data/app/assets/javascripts/ckeditor/plugins/widget/lang/oc.js +8 -0
  371. data/app/assets/javascripts/ckeditor/plugins/widget/lang/pl.js +8 -0
  372. data/app/assets/javascripts/ckeditor/plugins/widget/lang/pt-br.js +8 -0
  373. data/app/assets/javascripts/ckeditor/plugins/widget/lang/pt.js +8 -0
  374. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ru.js +8 -0
  375. data/app/assets/javascripts/ckeditor/plugins/widget/lang/sk.js +8 -0
  376. data/app/assets/javascripts/ckeditor/plugins/widget/lang/sl.js +8 -0
  377. data/app/assets/javascripts/ckeditor/plugins/widget/lang/sq.js +8 -0
  378. data/app/assets/javascripts/ckeditor/plugins/widget/lang/sv.js +8 -0
  379. data/app/assets/javascripts/ckeditor/plugins/widget/lang/tr.js +8 -0
  380. data/app/assets/javascripts/ckeditor/plugins/widget/lang/tt.js +8 -0
  381. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ug.js +8 -0
  382. data/app/assets/javascripts/ckeditor/plugins/widget/lang/uk.js +8 -0
  383. data/app/assets/javascripts/ckeditor/plugins/widget/lang/vi.js +8 -0
  384. data/app/assets/javascripts/ckeditor/plugins/widget/lang/zh-cn.js +8 -0
  385. data/app/assets/javascripts/ckeditor/plugins/widget/lang/zh.js +8 -0
  386. data/app/assets/javascripts/ckeditor/plugins/widget/plugin.js +4147 -0
  387. data/app/assets/javascripts/ckeditor/plugins/widgetselection/plugin.js +366 -0
  388. data/app/assets/javascripts/ckeditor/plugins/wordcount/css/wordcount.css +3 -0
  389. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ar.js +11 -0
  390. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ca.js +13 -0
  391. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/da.js +13 -0
  392. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/de.js +13 -0
  393. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/el.js +13 -0
  394. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +13 -0
  395. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/es.js +13 -0
  396. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/fi.js +14 -0
  397. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/fr.js +11 -0
  398. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/he.js +13 -0
  399. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/hr.js +13 -0
  400. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/it.js +14 -0
  401. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ja.js +14 -0
  402. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/jp.js +13 -0
  403. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/nl.js +13 -0
  404. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/no.js +10 -0
  405. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/pl.js +13 -0
  406. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/pt-br.js +13 -0
  407. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/pt.js +9 -0
  408. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +13 -0
  409. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/sv.js +13 -0
  410. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/tr.js +13 -0
  411. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/zh-cn.js +13 -0
  412. data/app/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +407 -0
  413. data/app/assets/javascripts/ckeditor/plugins/wordcount/samples/wordcount.html +61 -0
  414. data/app/assets/javascripts/ckeditor/plugins/wordcount/samples/wordcountWithMaxCount.html +110 -0
  415. data/app/assets/javascripts/integral/backend.js +268 -0
  416. data/app/assets/javascripts/integral/backend/extensions.js +1 -0
  417. data/app/assets/javascripts/integral/backend/support/Chart.bundle.min.js +10 -0
  418. data/app/assets/javascripts/integral/frontend.js +60 -0
  419. data/app/assets/javascripts/integral/support/character_counter.js +67 -0
  420. data/app/assets/javascripts/integral/support/chart_manager.coffee +145 -0
  421. data/app/assets/javascripts/integral/support/click_to_copy.coffee +28 -0
  422. data/app/assets/javascripts/integral/support/confirm_modal.coffee +58 -0
  423. data/app/assets/javascripts/integral/support/date_picker.coffee +83 -0
  424. data/app/assets/javascripts/integral/support/date_picker/picker.date.js +1435 -0
  425. data/app/assets/javascripts/integral/support/date_picker/picker.js +1132 -0
  426. data/app/assets/javascripts/integral/support/gallery.coffee +82 -0
  427. data/app/assets/javascripts/integral/support/google_analytics.coffee +23 -0
  428. data/app/assets/javascripts/integral/support/grid.coffee +92 -0
  429. data/app/assets/javascripts/integral/support/header_anchors.coffee +22 -0
  430. data/app/assets/javascripts/integral/support/image-preview.coffee +14 -0
  431. data/app/assets/javascripts/integral/support/image_selector.coffee +43 -0
  432. data/app/assets/javascripts/integral/support/image_uploader.coffee +59 -0
  433. data/app/assets/javascripts/integral/support/lib/html.sortable.js +691 -0
  434. data/app/assets/javascripts/integral/support/lib/jquery.are-you-sure.js +231 -0
  435. data/app/assets/javascripts/integral/support/lib/jquery_form.js +11 -0
  436. data/app/assets/javascripts/integral/support/lib/js.cookie.js +165 -0
  437. data/app/assets/javascripts/integral/support/lib/materialize-tags.js +758 -0
  438. data/app/assets/javascripts/integral/support/lib/materialize.clockpicker.js +699 -0
  439. data/app/assets/javascripts/integral/support/lib/swiper.js +7719 -0
  440. data/app/assets/javascripts/integral/support/lib/typeahead.js +2451 -0
  441. data/app/assets/javascripts/integral/support/lib/underscore.js +6 -0
  442. data/app/assets/javascripts/integral/support/list.coffee +71 -0
  443. data/app/assets/javascripts/integral/support/list_item.coffee +249 -0
  444. data/app/assets/javascripts/integral/support/notification_manager.coffee +17 -0
  445. data/app/assets/javascripts/integral/support/record_selector.coffee +161 -0
  446. data/app/assets/javascripts/integral/support/remote_form.coffee +87 -0
  447. data/app/assets/javascripts/integral/support/responsive_swiper.coffee +26 -0
  448. data/app/assets/javascripts/integral/support/scroll_to_top.coffee +17 -0
  449. data/app/assets/javascripts/integral/support/slug_generator.coffee +49 -0
  450. data/app/assets/stylesheets/errors.css +1834 -0
  451. data/app/assets/stylesheets/integral/backend.sass +66 -0
  452. data/app/assets/stylesheets/integral/backend/_foundation_settings.scss +867 -0
  453. data/app/assets/stylesheets/integral/backend/dashboard-layout.scss +491 -0
  454. data/app/assets/stylesheets/integral/backend/devise.sass +40 -0
  455. data/app/assets/stylesheets/integral/backend/foundation_and_overrides.scss +56 -0
  456. data/app/assets/stylesheets/integral/backend/materialize-tags.sass +70 -0
  457. data/app/assets/stylesheets/integral/backend/notifications.sass +43 -0
  458. data/app/assets/stylesheets/integral/backend/overrides.sass +1 -0
  459. data/app/assets/stylesheets/integral/backend/shared.sass +770 -0
  460. data/app/assets/stylesheets/integral/emails.scss +19 -0
  461. data/app/assets/stylesheets/integral/emails/colors.sass +3 -0
  462. data/app/assets/stylesheets/integral/frontend.sass +26 -0
  463. data/app/assets/stylesheets/integral/frontend/_foundation_settings.scss +863 -0
  464. data/app/assets/stylesheets/integral/frontend/blog.sass +263 -0
  465. data/app/assets/stylesheets/integral/frontend/demo.sass +158 -0
  466. data/app/assets/stylesheets/integral/frontend/foundation_and_overrides.scss +56 -0
  467. data/app/assets/stylesheets/integral/frontend/layout.sass +66 -0
  468. data/app/assets/stylesheets/integral/frontend/overrides.sass +1 -0
  469. data/app/assets/stylesheets/integral/frontend/share_modal.sass +25 -0
  470. data/app/assets/stylesheets/integral/frontend/shared.sass +73 -0
  471. data/app/assets/stylesheets/integral/support/date-picker.scss +16 -0
  472. data/app/assets/stylesheets/integral/support/date_picker/_default.date.scss +452 -0
  473. data/app/assets/stylesheets/integral/support/date_picker/_default.scss +201 -0
  474. data/app/assets/stylesheets/integral/support/date_picker/_default.time.scss +125 -0
  475. data/app/assets/stylesheets/integral/support/date_picker/materialize_clockpicker.sass +220 -0
  476. data/app/assets/stylesheets/integral/support/gallery.sass +54 -0
  477. data/app/assets/stylesheets/integral/support/media-query-indicator.sass +25 -0
  478. data/app/assets/stylesheets/integral/support/mixins.sass +29 -0
  479. data/app/assets/stylesheets/integral/support/scroll-to-top.sass +19 -0
  480. data/app/assets/stylesheets/integral/support/swiper.css +618 -0
  481. data/app/assets/stylesheets/integral/wysiwyg.sass +13 -0
  482. data/app/controllers/integral/application_controller.rb +130 -0
  483. data/app/controllers/integral/backend/activities_controller.rb +55 -0
  484. data/app/controllers/integral/backend/base_controller.rb +123 -0
  485. data/app/controllers/integral/backend/images_controller.rb +120 -0
  486. data/app/controllers/integral/backend/lists_controller.rb +138 -0
  487. data/app/controllers/integral/backend/pages_controller.rb +142 -0
  488. data/app/controllers/integral/backend/posts_controller.rb +132 -0
  489. data/app/controllers/integral/backend/settings_controller.rb +53 -0
  490. data/app/controllers/integral/backend/static_pages_controller.rb +10 -0
  491. data/app/controllers/integral/backend/users_controller.rb +130 -0
  492. data/app/controllers/integral/blog_controller.rb +19 -0
  493. data/app/controllers/integral/contact_controller.rb +36 -0
  494. data/app/controllers/integral/pages_controller.rb +45 -0
  495. data/app/controllers/integral/posts_controller.rb +71 -0
  496. data/app/controllers/integral/tags_controller.rb +38 -0
  497. data/app/decorators/integral/image_decorator.rb +16 -0
  498. data/app/decorators/integral/list_decorator.rb +21 -0
  499. data/app/decorators/integral/page_decorator.rb +26 -0
  500. data/app/decorators/integral/post_decorator.rb +63 -0
  501. data/app/decorators/integral/user_decorator.rb +21 -0
  502. data/app/decorators/integral/version_decorator.rb +57 -0
  503. data/app/helpers/integral/application_helper.rb +52 -0
  504. data/app/helpers/integral/backend/base_helper.rb +72 -0
  505. data/app/helpers/integral/blog_helper.rb +26 -0
  506. data/app/helpers/integral/gallery_helper.rb +36 -0
  507. data/app/helpers/integral/mail_helper.rb +16 -0
  508. data/app/helpers/integral/social_helper.rb +123 -0
  509. data/app/helpers/integral/support_helper.rb +60 -0
  510. data/app/jobs/integral/application_job.rb +10 -0
  511. data/app/jobs/integral/newsletter_signup_job.rb +28 -0
  512. data/app/mailers/integral/contact_mailer.rb +56 -0
  513. data/app/models/ckeditor/asset.rb +8 -0
  514. data/app/models/ckeditor/attachment_file.rb +9 -0
  515. data/app/models/ckeditor/picture.rb +21 -0
  516. data/app/models/integral/application_record.rb +6 -0
  517. data/app/models/integral/basic.rb +11 -0
  518. data/app/models/integral/enquiry.rb +46 -0
  519. data/app/models/integral/image.rb +67 -0
  520. data/app/models/integral/image_version.rb +8 -0
  521. data/app/models/integral/link.rb +11 -0
  522. data/app/models/integral/list.rb +69 -0
  523. data/app/models/integral/list_item.rb +89 -0
  524. data/app/models/integral/list_version.rb +8 -0
  525. data/app/models/integral/newsletter_signup.rb +22 -0
  526. data/app/models/integral/object.rb +30 -0
  527. data/app/models/integral/page.rb +153 -0
  528. data/app/models/integral/page_version.rb +8 -0
  529. data/app/models/integral/post.rb +149 -0
  530. data/app/models/integral/post_version.rb +8 -0
  531. data/app/models/integral/post_viewing.rb +19 -0
  532. data/app/models/integral/role.rb +14 -0
  533. data/app/models/integral/role_assignment.rb +7 -0
  534. data/app/models/integral/settings.rb +5 -0
  535. data/app/models/integral/user.rb +59 -0
  536. data/app/models/integral/user_version.rb +8 -0
  537. data/app/models/integral/version.rb +31 -0
  538. data/app/models/paper_trail/version.rb +9 -0
  539. data/app/policies/integral/base_policy.rb +50 -0
  540. data/app/policies/integral/image_policy.rb +14 -0
  541. data/app/policies/integral/list_policy.rb +9 -0
  542. data/app/policies/integral/page_policy.rb +45 -0
  543. data/app/policies/integral/post_policy.rb +9 -0
  544. data/app/policies/integral/settings_policy.rb +17 -0
  545. data/app/policies/integral/user_policy.rb +17 -0
  546. data/app/policies/integral/version_policy.rb +19 -0
  547. data/app/uploaders/ckeditor_attachment_file_uploader.rb +34 -0
  548. data/app/uploaders/ckeditor_picture_uploader.rb +55 -0
  549. data/app/uploaders/integral/avatar_uploader.rb +9 -0
  550. data/app/uploaders/integral/image_uploader.rb +114 -0
  551. data/app/views/devise/invitations/edit.haml +17 -0
  552. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  553. data/app/views/devise/mailer/invitation_instructions.html.erb +13 -0
  554. data/app/views/devise/mailer/invitation_instructions.text.erb +12 -0
  555. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  556. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  557. data/app/views/devise/passwords/edit.haml +17 -0
  558. data/app/views/devise/passwords/new.haml +12 -0
  559. data/app/views/devise/sessions/new.haml +18 -0
  560. data/app/views/devise/shared/_links.html.erb +25 -0
  561. data/app/views/integral/backend/activities/_grid.haml +23 -0
  562. data/app/views/integral/backend/activities/index.haml +15 -0
  563. data/app/views/integral/backend/activities/shared/_grid.haml +20 -0
  564. data/app/views/integral/backend/activities/shared/_listing.haml +14 -0
  565. data/app/views/integral/backend/activities/shared/_log.haml +56 -0
  566. data/app/views/integral/backend/activities/show.haml +18 -0
  567. data/app/views/integral/backend/images/_create_modal.haml +17 -0
  568. data/app/views/integral/backend/images/_form.haml +41 -0
  569. data/app/views/integral/backend/images/_grid.haml +16 -0
  570. data/app/views/integral/backend/images/edit.haml +3 -0
  571. data/app/views/integral/backend/images/index.haml +18 -0
  572. data/app/views/integral/backend/images/new.haml +1 -0
  573. data/app/views/integral/backend/lists/_child_fields.haml +26 -0
  574. data/app/views/integral/backend/lists/_form.haml +25 -0
  575. data/app/views/integral/backend/lists/_grid.haml +16 -0
  576. data/app/views/integral/backend/lists/_item_container.haml +26 -0
  577. data/app/views/integral/backend/lists/_item_modal.haml +46 -0
  578. data/app/views/integral/backend/lists/_list_item_fields.haml +26 -0
  579. data/app/views/integral/backend/lists/_manager.haml +14 -0
  580. data/app/views/integral/backend/lists/edit.haml +2 -0
  581. data/app/views/integral/backend/lists/index.haml +18 -0
  582. data/app/views/integral/backend/lists/new.haml +1 -0
  583. data/app/views/integral/backend/lists/show.haml +26 -0
  584. data/app/views/integral/backend/pages/_form.haml +52 -0
  585. data/app/views/integral/backend/pages/_grid.haml +21 -0
  586. data/app/views/integral/backend/pages/activities.haml +2 -0
  587. data/app/views/integral/backend/pages/activity.haml +1 -0
  588. data/app/views/integral/backend/pages/edit.html.haml +15 -0
  589. data/app/views/integral/backend/pages/index.haml +22 -0
  590. data/app/views/integral/backend/pages/new.haml +2 -0
  591. data/app/views/integral/backend/posts/_form.haml +57 -0
  592. data/app/views/integral/backend/posts/_grid.haml +25 -0
  593. data/app/views/integral/backend/posts/activities.haml +3 -0
  594. data/app/views/integral/backend/posts/activity.haml +1 -0
  595. data/app/views/integral/backend/posts/edit.haml +16 -0
  596. data/app/views/integral/backend/posts/index.haml +20 -0
  597. data/app/views/integral/backend/posts/new.haml +2 -0
  598. data/app/views/integral/backend/settings/_input.haml +4 -0
  599. data/app/views/integral/backend/settings/_section.haml +11 -0
  600. data/app/views/integral/backend/settings/index.haml +10 -0
  601. data/app/views/integral/backend/settings/sections/_general.haml +12 -0
  602. data/app/views/integral/backend/settings/sections/_lists.haml +4 -0
  603. data/app/views/integral/backend/settings/sections/_seo.haml +8 -0
  604. data/app/views/integral/backend/settings/sections/_social.haml +16 -0
  605. data/app/views/integral/backend/shared/_breadcrumbs.haml +9 -0
  606. data/app/views/integral/backend/shared/_empty_grid.haml +7 -0
  607. data/app/views/integral/backend/shared/_grid.haml +18 -0
  608. data/app/views/integral/backend/shared/_image_preview.haml +23 -0
  609. data/app/views/integral/backend/shared/_image_selector.haml +4 -0
  610. data/app/views/integral/backend/shared/_pagination.haml +1 -0
  611. data/app/views/integral/backend/shared/cards/_at_a_glance.haml +5 -0
  612. data/app/views/integral/backend/shared/cards/_welcome.haml +29 -0
  613. data/app/views/integral/backend/shared/graphs/_donut.haml +5 -0
  614. data/app/views/integral/backend/shared/graphs/_line.haml +5 -0
  615. data/app/views/integral/backend/shared/graphs/_no_data_available.haml +2 -0
  616. data/app/views/integral/backend/shared/record_selector/_collection.haml +13 -0
  617. data/app/views/integral/backend/shared/record_selector/_modal.haml +42 -0
  618. data/app/views/integral/backend/shared/record_selector/_record.haml +6 -0
  619. data/app/views/integral/backend/static_pages/_card.haml +24 -0
  620. data/app/views/integral/backend/static_pages/dashboard.haml +20 -0
  621. data/app/views/integral/backend/users/_form.haml +58 -0
  622. data/app/views/integral/backend/users/_grid.haml +19 -0
  623. data/app/views/integral/backend/users/edit.haml +3 -0
  624. data/app/views/integral/backend/users/index.haml +18 -0
  625. data/app/views/integral/backend/users/new.haml +2 -0
  626. data/app/views/integral/backend/users/show.haml +36 -0
  627. data/app/views/integral/contact_mailer/auto_reply.html.haml +16 -0
  628. data/app/views/integral/contact_mailer/auto_reply.text.erb +15 -0
  629. data/app/views/integral/contact_mailer/forward_enquiry.haml +12 -0
  630. data/app/views/integral/contact_mailer/forward_enquiry.text.erb +9 -0
  631. data/app/views/integral/pages/_demo.haml +188 -0
  632. data/app/views/integral/pages/templates/default.haml +6 -0
  633. data/app/views/integral/posts/_item.haml +16 -0
  634. data/app/views/integral/posts/index.haml +6 -0
  635. data/app/views/integral/posts/templates/default.haml +38 -0
  636. data/app/views/integral/shared/_blog_layout.haml +15 -0
  637. data/app/views/integral/shared/_blog_sidebar.haml +49 -0
  638. data/app/views/integral/shared/_breadcrumbs.haml +5 -0
  639. data/app/views/integral/shared/_media_query_indicator.haml +2 -0
  640. data/app/views/integral/shared/_scroll_to_top.haml +3 -0
  641. data/app/views/integral/shared/_share_modal.haml +20 -0
  642. data/app/views/integral/shared/_social_list_items.haml +41 -0
  643. data/app/views/integral/shared/_swiper_layout.haml +20 -0
  644. data/app/views/integral/shared/gallery/_placeholder.haml +7 -0
  645. data/app/views/integral/shared/gallery/_slide.haml +5 -0
  646. data/app/views/integral/shared/gallery/_thumb_slide.haml +2 -0
  647. data/app/views/integral/shared/gallery/gallery.haml +7 -0
  648. data/app/views/integral/tags/index.haml +6 -0
  649. data/app/views/integral/tags/show.haml +6 -0
  650. data/app/views/layouts/error.haml +12 -0
  651. data/app/views/layouts/integral/backend.html.haml +93 -0
  652. data/app/views/layouts/integral/backend/_create_dropdown.haml +30 -0
  653. data/app/views/layouts/integral/backend/_head.html.haml +17 -0
  654. data/app/views/layouts/integral/backend/_main_menu_items.haml +91 -0
  655. data/app/views/layouts/integral/frontend.html.haml +36 -0
  656. data/app/views/layouts/integral/frontend/_admin_bar.haml +25 -0
  657. data/app/views/layouts/integral/frontend/_footer.haml +23 -0
  658. data/app/views/layouts/integral/frontend/_header.haml +12 -0
  659. data/app/views/layouts/integral/login.haml +8 -0
  660. data/app/views/layouts/integral/mailer.html.inky-haml +17 -0
  661. data/app/views/layouts/integral/mailer/_footer.html.inky-haml +11 -0
  662. data/app/views/layouts/integral/mailer/_header.html.inky-haml +7 -0
  663. data/config/initializers/acts_as_taggable_on.rb +6 -0
  664. data/config/initializers/ckeditor.rb +51 -0
  665. data/config/initializers/client_side_validations.rb +20 -0
  666. data/config/initializers/compression.rb +46 -0
  667. data/config/initializers/devise.rb +308 -0
  668. data/config/initializers/extensions/ckeditor.rb +31 -0
  669. data/config/initializers/friendly_id.rb +88 -0
  670. data/config/initializers/gaffe.rb +3 -0
  671. data/config/initializers/simple_form.rb +169 -0
  672. data/config/initializers/simple_form/length_component.rb +36 -0
  673. data/config/locales/devise.en.yml +60 -0
  674. data/config/locales/devise_invitable.en.yml +31 -0
  675. data/config/locales/en.yml +477 -0
  676. data/config/locales/simple_form.en.yml +31 -0
  677. data/config/routes.rb +3 -0
  678. data/db/migrate/20160129021044_devise_create_integral_users.rb +42 -0
  679. data/db/migrate/20160130051535_add_name_and_avatar_to_users.rb +6 -0
  680. data/db/migrate/20160201003936_add_roles.rb +13 -0
  681. data/db/migrate/20160302071241_create_integral_images.rb +13 -0
  682. data/db/migrate/20160311092506_create_ckeditor_assets.rb +26 -0
  683. data/db/migrate/20160318004136_create_integral_pages.rb +12 -0
  684. data/db/migrate/20160513033619_create_integral_posts.rb +12 -0
  685. data/db/migrate/20160514063048_add_slug_column_to_post.rb +6 -0
  686. data/db/migrate/20160516084702_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +31 -0
  687. data/db/migrate/20160516084703_add_missing_unique_indices.acts_as_taggable_on_engine.rb +20 -0
  688. data/db/migrate/20160516084704_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +15 -0
  689. data/db/migrate/20160516084705_add_missing_taggable_index.acts_as_taggable_on_engine.rb +10 -0
  690. data/db/migrate/20160516084706_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +10 -0
  691. data/db/migrate/20160519005736_add_image_to_posts.rb +5 -0
  692. data/db/migrate/20160519053329_create_friendly_id_slugs.rb +15 -0
  693. data/db/migrate/20160610021858_add_view_count_to_posts.rb +5 -0
  694. data/db/migrate/20160613035508_add_drafting_to_posts.rb +6 -0
  695. data/db/migrate/20160628050006_create_integral_post_viewings.rb +10 -0
  696. data/db/migrate/20160718011218_add_locale_to_integral_users.rb +5 -0
  697. data/db/migrate/20160722100113_devise_invitable_add_to_integral_users.rb +23 -0
  698. data/db/migrate/20160809115906_add_drafting_to_pages.rb +5 -0
  699. data/db/migrate/20160909124940_add_deleted_at_to_objects.rb +15 -0
  700. data/db/migrate/20161014175823_create_lists.rb +31 -0
  701. data/db/migrate/20161102094859_create_settings.rb +18 -0
  702. data/db/migrate/20170215012231_add_templates_to_pages.rb +5 -0
  703. data/db/migrate/20170425091312_add_image_processing_fields.rb +7 -0
  704. data/db/migrate/20170516033523_add_timestamps_to_lists.rb +6 -0
  705. data/db/migrate/20170608131624_add_file_size_to_images.rb +5 -0
  706. data/db/migrate/20170801182434_add_parent_to_pages.rb +5 -0
  707. data/db/migrate/20170922201940_add_image_id_to_posts.rb +9 -0
  708. data/db/migrate/20171008193414_create_post_versions.rb +21 -0
  709. data/db/migrate/20171030215146_create_page_versions.rb +20 -0
  710. data/db/migrate/20171030215154_create_user_versions.rb +20 -0
  711. data/db/migrate/20171030215202_create_list_versions.rb +20 -0
  712. data/db/migrate/20171123155010_create_integral_enquiries.rb +13 -0
  713. data/db/migrate/20171127141132_add_deleted_at_to_lists.rb +6 -0
  714. data/db/migrate/20171230213848_add_image_to_pages.rb +6 -0
  715. data/db/migrate/20180202010010_add_lock_version_to_integral_objects.rb +9 -0
  716. data/db/migrate/20180202010020_create_image_versions.rb +20 -0
  717. data/db/migrate/20180207174914_add_fields_to_lists.rb +7 -0
  718. data/db/migrate/20180223232512_create_integral_newsletter_signups.rb +11 -0
  719. data/db/migrate/20180306204912_add_admin_to_integral_users.rb +5 -0
  720. data/db/migrate/20180326224500_add_processed_to_enquiries_and_newsletters.rb +6 -0
  721. data/db/migrate/20180509101917_add_context_to_enquiries.rb +6 -0
  722. data/db/migrate/20180920030236_update_posts_and_pages_null.rb +6 -0
  723. data/db/migrate/20181011234446_add_preview_image_to_posts.rb +6 -0
  724. data/db/seeds.rb +53 -0
  725. data/lib/generators/integral/install_generator.rb +19 -0
  726. data/lib/generators/templates/app.yml +24 -0
  727. data/lib/generators/templates/carrierwave.rb +35 -0
  728. data/lib/generators/templates/carrierwave_backgrounder.rb +11 -0
  729. data/lib/generators/templates/integral.rb +129 -0
  730. data/lib/generators/templates/sitemap.rb +41 -0
  731. data/lib/integral.rb +155 -0
  732. data/lib/integral/acts_as_listable.rb +45 -0
  733. data/lib/integral/button_link_renderer.rb +54 -0
  734. data/lib/integral/chart_renderer/base.rb +80 -0
  735. data/lib/integral/chart_renderer/donut.rb +21 -0
  736. data/lib/integral/chart_renderer/line.rb +24 -0
  737. data/lib/integral/content_renderer.rb +78 -0
  738. data/lib/integral/engine.rb +124 -0
  739. data/lib/integral/foundation_builder.rb +33 -0
  740. data/lib/integral/google_tag_manager.rb +33 -0
  741. data/lib/integral/grids/activities_grid.rb +37 -0
  742. data/lib/integral/grids/images_grid.rb +21 -0
  743. data/lib/integral/grids/lists_grid.rb +21 -0
  744. data/lib/integral/grids/pages_grid.rb +27 -0
  745. data/lib/integral/grids/posts_grid.rb +32 -0
  746. data/lib/integral/grids/users_grid.rb +22 -0
  747. data/lib/integral/list_item_renderer.rb +204 -0
  748. data/lib/integral/list_renderer.rb +91 -0
  749. data/lib/integral/middleware/page_router.rb +84 -0
  750. data/lib/integral/partial_list_item_renderer.rb +40 -0
  751. data/lib/integral/router.rb +106 -0
  752. data/lib/integral/slack_bot.rb +45 -0
  753. data/lib/integral/swiper_list_renderer.rb +30 -0
  754. data/lib/integral/version.rb +5 -0
  755. data/lib/integral/widgets/recent_posts.rb +41 -0
  756. data/lib/integral/widgets/swiper_list.rb +40 -0
  757. data/lib/tasks/integral_tasks.rake +57 -0
  758. data/lib/templates/erb/scaffold/_form.html.erb +13 -0
  759. data/spec/factories.rb +114 -0
  760. data/spec/support/image.jpg +0 -0
  761. metadata +1734 -0
@@ -0,0 +1,1132 @@
1
+ /*!
2
+ * pickadate.js v3.5.0, 2014/04/13
3
+ * By Amsul, http://amsul.ca
4
+ * Hosted on http://amsul.github.io/pickadate.js
5
+ * Licensed under MIT
6
+ */
7
+
8
+ (function ( factory ) {
9
+
10
+ // AMD.
11
+ if ( typeof define == 'function' && define.amd )
12
+ define( 'picker', ['jquery'], factory )
13
+
14
+ // Node.js/browserify.
15
+ else if ( typeof exports == 'object' )
16
+ module.exports = factory( require('jquery') )
17
+
18
+ // Browser globals.
19
+ else this.Picker = factory( jQuery )
20
+
21
+ }(function( $ ) {
22
+
23
+ var $window = $( window )
24
+ var $document = $( document )
25
+ var $html = $( document.documentElement )
26
+
27
+
28
+ /**
29
+ * The picker constructor that creates a blank picker.
30
+ */
31
+ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
32
+
33
+ // If there’s no element, return the picker constructor.
34
+ if ( !ELEMENT ) return PickerConstructor
35
+
36
+
37
+ var
38
+ IS_DEFAULT_THEME = false,
39
+
40
+
41
+ // The state of the picker.
42
+ STATE = {
43
+ id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )
44
+ },
45
+
46
+
47
+ // Merge the defaults and options passed.
48
+ SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},
49
+
50
+
51
+ // Merge the default classes with the settings classes.
52
+ CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),
53
+
54
+
55
+ // The element node wrapper into a jQuery object.
56
+ $ELEMENT = $( ELEMENT ),
57
+
58
+
59
+ // Pseudo picker constructor.
60
+ PickerInstance = function() {
61
+ return this.start()
62
+ },
63
+
64
+
65
+ // The picker prototype.
66
+ P = PickerInstance.prototype = {
67
+
68
+ constructor: PickerInstance,
69
+
70
+ $node: $ELEMENT,
71
+
72
+
73
+ /**
74
+ * Initialize everything
75
+ */
76
+ start: function() {
77
+
78
+ // If it’s already started, do nothing.
79
+ if ( STATE && STATE.start ) return P
80
+
81
+
82
+ // Update the picker states.
83
+ STATE.methods = {}
84
+ STATE.start = true
85
+ STATE.open = false
86
+ STATE.type = ELEMENT.type
87
+
88
+
89
+ // Confirm focus state, convert into text input to remove UA stylings,
90
+ // and set as readonly to prevent keyboard popup.
91
+ ELEMENT.autofocus = ELEMENT == getActiveElement()
92
+ ELEMENT.readOnly = !SETTINGS.editable
93
+ ELEMENT.id = ELEMENT.id || STATE.id
94
+ if ( ELEMENT.type != 'text' ) {
95
+ ELEMENT.type = 'text'
96
+ }
97
+
98
+
99
+ // Create a new picker component with the settings.
100
+ P.component = new COMPONENT(P, SETTINGS)
101
+
102
+
103
+ // Create the picker root with a holder and then prepare it.
104
+ P.$root = $( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id="' + ELEMENT.id + '_root" tabindex="0"') )
105
+ prepareElementRoot()
106
+
107
+
108
+ // If there’s a format for the hidden input element, create the element.
109
+ if ( SETTINGS.formatSubmit ) {
110
+ prepareElementHidden()
111
+ }
112
+
113
+
114
+ // Prepare the input element.
115
+ prepareElement()
116
+
117
+
118
+ // Insert the root as specified in the settings.
119
+ if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )
120
+ else $ELEMENT.after( P.$root )
121
+
122
+
123
+ // Bind the default component and settings events.
124
+ P.on({
125
+ start: P.component.onStart,
126
+ render: P.component.onRender,
127
+ stop: P.component.onStop,
128
+ open: P.component.onOpen,
129
+ close: P.component.onClose,
130
+ set: P.component.onSet
131
+ }).on({
132
+ start: SETTINGS.onStart,
133
+ render: SETTINGS.onRender,
134
+ stop: SETTINGS.onStop,
135
+ open: SETTINGS.onOpen,
136
+ close: SETTINGS.onClose,
137
+ set: SETTINGS.onSet
138
+ })
139
+
140
+
141
+ // Once we’re all set, check the theme in use.
142
+ IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] )
143
+
144
+
145
+ // If the element has autofocus, open the picker.
146
+ if ( ELEMENT.autofocus ) {
147
+ P.open()
148
+ }
149
+
150
+
151
+ // Trigger queued the “start” and “render” events.
152
+ return P.trigger( 'start' ).trigger( 'render' )
153
+ }, //start
154
+
155
+
156
+ /**
157
+ * Render a new picker
158
+ */
159
+ render: function( entireComponent ) {
160
+
161
+ // Insert a new component holder in the root or box.
162
+ if ( entireComponent ) P.$root.html( createWrappedComponent() )
163
+ else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )
164
+
165
+ // Trigger the queued “render” events.
166
+ return P.trigger( 'render' )
167
+ }, //render
168
+
169
+
170
+ /**
171
+ * Destroy everything
172
+ */
173
+ stop: function() {
174
+
175
+ // If it’s already stopped, do nothing.
176
+ if ( !STATE.start ) return P
177
+
178
+ // Then close the picker.
179
+ P.close()
180
+
181
+ // Remove the hidden field.
182
+ if ( P._hidden ) {
183
+ P._hidden.parentNode.removeChild( P._hidden )
184
+ }
185
+
186
+ // Remove the root.
187
+ P.$root.remove()
188
+
189
+ // Remove the input class, remove the stored data, and unbind
190
+ // the events (after a tick for IE - see `P.close`).
191
+ $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )
192
+ setTimeout( function() {
193
+ $ELEMENT.off( '.' + STATE.id )
194
+ }, 0)
195
+
196
+ // Restore the element state
197
+ ELEMENT.type = STATE.type
198
+ ELEMENT.readOnly = false
199
+
200
+ // Trigger the queued “stop” events.
201
+ P.trigger( 'stop' )
202
+
203
+ // Reset the picker states.
204
+ STATE.methods = {}
205
+ STATE.start = false
206
+
207
+ return P
208
+ }, //stop
209
+
210
+
211
+ /**
212
+ * Open up the picker
213
+ */
214
+ open: function( dontGiveFocus ) {
215
+
216
+ // If it’s already open, do nothing.
217
+ if ( STATE.open ) return P
218
+
219
+ // Add the “active” class.
220
+ $ELEMENT.addClass( CLASSES.active )
221
+ aria( ELEMENT, 'expanded', true )
222
+
223
+ // * A Firefox bug, when `html` has `overflow:hidden`, results in
224
+ // killing transitions :(. So add the “opened” state on the next tick.
225
+ // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289
226
+ setTimeout( function() {
227
+
228
+ // Add the “opened” class to the picker root.
229
+ P.$root.addClass( CLASSES.opened )
230
+ aria( P.$root[0], 'hidden', false )
231
+
232
+ }, 0 )
233
+
234
+ // If we have to give focus, bind the element and doc events.
235
+ if ( dontGiveFocus !== false ) {
236
+
237
+ // Set it as open.
238
+ STATE.open = true
239
+
240
+ // Prevent the page from scrolling.
241
+ if ( IS_DEFAULT_THEME ) {
242
+ $html.
243
+ css( 'overflow', 'hidden' ).
244
+ css( 'padding-right', '+=' + getScrollbarWidth() )
245
+ }
246
+
247
+ // Pass focus to the root element’s jQuery object.
248
+ // * Workaround for iOS8 to bring the picker’s root into view.
249
+ P.$root.eq(0).focus()
250
+
251
+ // Bind the document events.
252
+ $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {
253
+
254
+ var target = event.target
255
+
256
+ // If the target of the event is not the element, close the picker picker.
257
+ // * Don’t worry about clicks or focusins on the root because those don’t bubble up.
258
+ // Also, for Firefox, a click on an `option` element bubbles up directly
259
+ // to the doc. So make sure the target wasn't the doc.
260
+ // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,
261
+ // which causes the picker to unexpectedly close when right-clicking it. So make
262
+ // sure the event wasn’t a right-click.
263
+ if ( target != ELEMENT && target != document && event.which != 3 ) {
264
+
265
+ // If the target was the holder that covers the screen,
266
+ // keep the element focused to maintain tabindex.
267
+ P.close( target === P.$root.children()[0] )
268
+ }
269
+
270
+ }).on( 'keydown.' + STATE.id, function( event ) {
271
+
272
+ var
273
+ // Get the keycode.
274
+ keycode = event.keyCode,
275
+
276
+ // Translate that to a selection change.
277
+ keycodeToMove = P.component.key[ keycode ],
278
+
279
+ // Grab the target.
280
+ target = event.target
281
+
282
+
283
+ // On escape, close the picker and give focus.
284
+ if ( keycode == 27 ) {
285
+ P.close( true )
286
+ }
287
+
288
+
289
+ // Check if there is a key movement or “enter” keypress on the element.
290
+ else if ( target == P.$root[0] && ( keycodeToMove || keycode == 13 ) ) {
291
+
292
+ // Prevent the default action to stop page movement.
293
+ event.preventDefault()
294
+
295
+ // Trigger the key movement action.
296
+ if ( keycodeToMove ) {
297
+ PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )
298
+ }
299
+
300
+ // On “enter”, if the highlighted item isn’t disabled, set the value and close.
301
+ else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {
302
+ P.set( 'select', P.component.item.highlight )
303
+ if ( SETTINGS.closeOnSelect ) {
304
+ P.close( true )
305
+ }
306
+ }
307
+ }
308
+
309
+
310
+ // If the target is within the root and “enter” is pressed,
311
+ // prevent the default action and trigger a click on the target instead.
312
+ else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {
313
+ event.preventDefault()
314
+ target.click()
315
+ }
316
+ })
317
+ }
318
+
319
+ // Trigger the queued “open” events.
320
+ return P.trigger( 'open' )
321
+ }, //open
322
+
323
+
324
+ /**
325
+ * Close the picker
326
+ */
327
+ close: function( giveFocus ) {
328
+
329
+ // If we need to give focus, do it before changing states.
330
+ if ( giveFocus ) {
331
+ // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|
332
+ // The focus is triggered *after* the close has completed - causing it
333
+ // to open again. So unbind and rebind the event at the next tick.
334
+ P.$root.off( 'focus.toOpen' ).eq(0).focus()
335
+ setTimeout( function() {
336
+ P.$root.on( 'focus.toOpen', handleFocusToOpenEvent )
337
+ }, 0 )
338
+ }
339
+
340
+ // Remove the “active” class.
341
+ $ELEMENT.removeClass( CLASSES.active )
342
+ aria( ELEMENT, 'expanded', false )
343
+
344
+ // * A Firefox bug, when `html` has `overflow:hidden`, results in
345
+ // killing transitions :(. So remove the “opened” state on the next tick.
346
+ // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289
347
+ setTimeout( function() {
348
+
349
+ // Remove the “opened” and “focused” class from the picker root.
350
+ P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )
351
+ aria( P.$root[0], 'hidden', true )
352
+
353
+ }, 0 )
354
+
355
+ // If it’s already closed, do nothing more.
356
+ if ( !STATE.open ) return P
357
+
358
+ // Set it as closed.
359
+ STATE.open = false
360
+
361
+ // Allow the page to scroll.
362
+ if ( IS_DEFAULT_THEME ) {
363
+ $html.
364
+ css( 'overflow', '' ).
365
+ css( 'padding-right', '-=' + getScrollbarWidth() )
366
+ }
367
+
368
+ // Unbind the document events.
369
+ $document.off( '.' + STATE.id )
370
+
371
+ // Trigger the queued “close” events.
372
+ return P.trigger( 'close' )
373
+ }, //close
374
+
375
+
376
+ /**
377
+ * Clear the values
378
+ */
379
+ clear: function( options ) {
380
+ return P.set( 'clear', null, options )
381
+ }, //clear
382
+
383
+
384
+ /**
385
+ * Set something
386
+ */
387
+ set: function( thing, value, options ) {
388
+
389
+ var thingItem, thingValue,
390
+ thingIsObject = $.isPlainObject( thing ),
391
+ thingObject = thingIsObject ? thing : {}
392
+
393
+ // Make sure we have usable options.
394
+ options = thingIsObject && $.isPlainObject( value ) ? value : options || {}
395
+
396
+ if ( thing ) {
397
+
398
+ // If the thing isn’t an object, make it one.
399
+ if ( !thingIsObject ) {
400
+ thingObject[ thing ] = value
401
+ }
402
+
403
+ // Go through the things of items to set.
404
+ for ( thingItem in thingObject ) {
405
+
406
+ // Grab the value of the thing.
407
+ thingValue = thingObject[ thingItem ]
408
+
409
+ // First, if the item exists and there’s a value, set it.
410
+ if ( thingItem in P.component.item ) {
411
+ if ( thingValue === undefined ) thingValue = null
412
+ P.component.set( thingItem, thingValue, options )
413
+ }
414
+
415
+ // Then, check to update the element value and broadcast a change.
416
+ if ( thingItem == 'select' || thingItem == 'clear' ) {
417
+ $ELEMENT.
418
+ val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).
419
+ trigger( 'change' )
420
+ }
421
+ }
422
+
423
+ // Render a new picker.
424
+ P.render()
425
+ }
426
+
427
+ // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.
428
+ return options.muted ? P : P.trigger( 'set', thingObject )
429
+ }, //set
430
+
431
+
432
+ /**
433
+ * Get something
434
+ */
435
+ get: function( thing, format ) {
436
+
437
+ // Make sure there’s something to get.
438
+ thing = thing || 'value'
439
+
440
+ // If a picker state exists, return that.
441
+ if ( STATE[ thing ] != null ) {
442
+ return STATE[ thing ]
443
+ }
444
+
445
+ // Return the submission value, if that.
446
+ if ( thing == 'valueSubmit' ) {
447
+ if ( P._hidden ) {
448
+ return P._hidden.value
449
+ }
450
+ thing = 'value'
451
+ }
452
+
453
+ // Return the value, if that.
454
+ if ( thing == 'value' ) {
455
+ return ELEMENT.value
456
+ }
457
+
458
+ // Check if a component item exists, return that.
459
+ if ( thing in P.component.item ) {
460
+ if ( typeof format == 'string' ) {
461
+ var thingValue = P.component.get( thing )
462
+ return thingValue ?
463
+ PickerConstructor._.trigger(
464
+ P.component.formats.toString,
465
+ P.component,
466
+ [ format, thingValue ]
467
+ ) : ''
468
+ }
469
+ return P.component.get( thing )
470
+ }
471
+ }, //get
472
+
473
+
474
+
475
+ /**
476
+ * Bind events on the things.
477
+ */
478
+ on: function( thing, method, internal ) {
479
+
480
+ var thingName, thingMethod,
481
+ thingIsObject = $.isPlainObject( thing ),
482
+ thingObject = thingIsObject ? thing : {}
483
+
484
+ if ( thing ) {
485
+
486
+ // If the thing isn’t an object, make it one.
487
+ if ( !thingIsObject ) {
488
+ thingObject[ thing ] = method
489
+ }
490
+
491
+ // Go through the things to bind to.
492
+ for ( thingName in thingObject ) {
493
+
494
+ // Grab the method of the thing.
495
+ thingMethod = thingObject[ thingName ]
496
+
497
+ // If it was an internal binding, prefix it.
498
+ if ( internal ) {
499
+ thingName = '_' + thingName
500
+ }
501
+
502
+ // Make sure the thing methods collection exists.
503
+ STATE.methods[ thingName ] = STATE.methods[ thingName ] || []
504
+
505
+ // Add the method to the relative method collection.
506
+ STATE.methods[ thingName ].push( thingMethod )
507
+ }
508
+ }
509
+
510
+ return P
511
+ }, //on
512
+
513
+
514
+
515
+ /**
516
+ * Unbind events on the things.
517
+ */
518
+ off: function() {
519
+ var i, thingName,
520
+ names = arguments;
521
+ for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {
522
+ thingName = names[i]
523
+ if ( thingName in STATE.methods ) {
524
+ delete STATE.methods[thingName]
525
+ }
526
+ }
527
+ return P
528
+ },
529
+
530
+
531
+ /**
532
+ * Fire off method events.
533
+ */
534
+ trigger: function( name, data ) {
535
+ var _trigger = function( name ) {
536
+ var methodList = STATE.methods[ name ]
537
+ if ( methodList ) {
538
+ methodList.map( function( method ) {
539
+ PickerConstructor._.trigger( method, P, [ data ] )
540
+ })
541
+ }
542
+ }
543
+ _trigger( '_' + name )
544
+ _trigger( name )
545
+ return P
546
+ } //trigger
547
+ } //PickerInstance.prototype
548
+
549
+
550
+ /**
551
+ * Wrap the picker holder components together.
552
+ */
553
+ function createWrappedComponent() {
554
+
555
+ // Create a picker wrapper holder
556
+ return PickerConstructor._.node( 'div',
557
+
558
+ // Create a picker wrapper node
559
+ PickerConstructor._.node( 'div',
560
+
561
+ // Create a picker frame
562
+ PickerConstructor._.node( 'div',
563
+
564
+ // Create a picker box node
565
+ PickerConstructor._.node( 'div',
566
+
567
+ // Create the components nodes.
568
+ P.component.nodes( STATE.open ),
569
+
570
+ // The picker box class
571
+ CLASSES.box
572
+ ),
573
+
574
+ // Picker wrap class
575
+ CLASSES.wrap
576
+ ),
577
+
578
+ // Picker frame class
579
+ CLASSES.frame
580
+ ),
581
+
582
+ // Picker holder class
583
+ CLASSES.holder
584
+ ) //endreturn
585
+ } //createWrappedComponent
586
+
587
+
588
+
589
+ /**
590
+ * Prepare the input element with all bindings.
591
+ */
592
+ function prepareElement() {
593
+
594
+ $ELEMENT.
595
+
596
+ // Store the picker data by component name.
597
+ data(NAME, P).
598
+
599
+ // Add the “input” class name.
600
+ addClass(CLASSES.input).
601
+
602
+ // Remove the tabindex.
603
+ attr('tabindex', -1).
604
+
605
+ // If there’s a `data-value`, update the value of the element.
606
+ val( $ELEMENT.data('value') ?
607
+ P.get('select', SETTINGS.format) :
608
+ ELEMENT.value
609
+ )
610
+
611
+
612
+ // Only bind keydown events if the element isn’t editable.
613
+ if ( !SETTINGS.editable ) {
614
+
615
+ $ELEMENT.
616
+
617
+ // On focus/click, focus onto the root to open it up.
618
+ on( 'focus.' + STATE.id + ' click.' + STATE.id, function( event ) {
619
+ event.preventDefault()
620
+ P.$root.eq(0).focus()
621
+ }).
622
+
623
+ // Handle keyboard event based on the picker being opened or not.
624
+ on( 'keydown.' + STATE.id, handleKeydownEvent )
625
+ }
626
+
627
+
628
+ // Update the aria attributes.
629
+ aria(ELEMENT, {
630
+ haspopup: true,
631
+ expanded: false,
632
+ readonly: false,
633
+ owns: ELEMENT.id + '_root'
634
+ })
635
+ }
636
+
637
+
638
+ /**
639
+ * Prepare the root picker element with all bindings.
640
+ */
641
+ function prepareElementRoot() {
642
+
643
+ P.$root.
644
+
645
+ on({
646
+
647
+ // For iOS8.
648
+ keydown: handleKeydownEvent,
649
+
650
+ // When something within the root is focused, stop from bubbling
651
+ // to the doc and remove the “focused” state from the root.
652
+ focusin: function( event ) {
653
+ P.$root.removeClass( CLASSES.focused )
654
+ event.stopPropagation()
655
+ },
656
+
657
+ // When something within the root holder is clicked, stop it
658
+ // from bubbling to the doc.
659
+ 'mousedown click': function( event ) {
660
+
661
+ var target = event.target
662
+
663
+ // Make sure the target isn’t the root holder so it can bubble up.
664
+ if ( target != P.$root.children()[ 0 ] ) {
665
+
666
+ event.stopPropagation()
667
+
668
+ // * For mousedown events, cancel the default action in order to
669
+ // prevent cases where focus is shifted onto external elements
670
+ // when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).
671
+ // Also, for Firefox, don’t prevent action on the `option` element.
672
+ if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {
673
+
674
+ event.preventDefault()
675
+
676
+ // Re-focus onto the root so that users can click away
677
+ // from elements focused within the picker.
678
+ P.$root.eq(0).focus()
679
+ }
680
+ }
681
+ }
682
+ }).
683
+
684
+ // Add/remove the “target” class on focus and blur.
685
+ on({
686
+ focus: function() {
687
+ $ELEMENT.addClass( CLASSES.target )
688
+ },
689
+ blur: function() {
690
+ $ELEMENT.removeClass( CLASSES.target )
691
+ }
692
+ }).
693
+
694
+ // Open the picker and adjust the root “focused” state
695
+ on( 'focus.toOpen', handleFocusToOpenEvent ).
696
+
697
+ // If there’s a click on an actionable element, carry out the actions.
698
+ on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {
699
+
700
+ var $target = $( this ),
701
+ targetData = $target.data(),
702
+ targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),
703
+
704
+ // * For IE, non-focusable elements can be active elements as well
705
+ // (http://stackoverflow.com/a/2684561).
706
+ activeElement = getActiveElement()
707
+ activeElement = activeElement && ( activeElement.type || activeElement.href )
708
+
709
+ // If it’s disabled or nothing inside is actively focused, re-focus the element.
710
+ if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {
711
+ P.$root.eq(0).focus()
712
+ }
713
+
714
+ // If something is superficially changed, update the `highlight` based on the `nav`.
715
+ if ( !targetDisabled && targetData.nav ) {
716
+ P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )
717
+ }
718
+
719
+ // If something is picked, set `select` then close with focus.
720
+ else if ( !targetDisabled && 'pick' in targetData ) {
721
+ P.set( 'select', targetData.pick )
722
+ if ( SETTINGS.closeOnSelect ) {
723
+ P.close( true )
724
+ }
725
+ }
726
+
727
+ // If a “clear” button is pressed, empty the values and close with focus.
728
+ else if ( targetData.clear ) {
729
+ P.clear()
730
+ if ( SETTINGS.closeOnClear ) {
731
+ P.close( true )
732
+ }
733
+ }
734
+
735
+ else if ( targetData.close ) {
736
+ P.close( true )
737
+ }
738
+
739
+ }) //P.$root
740
+
741
+ aria( P.$root[0], 'hidden', true )
742
+ }
743
+
744
+
745
+ /**
746
+ * Prepare the hidden input element along with all bindings.
747
+ */
748
+ function prepareElementHidden() {
749
+
750
+ var name
751
+
752
+ if ( SETTINGS.hiddenName === true ) {
753
+ name = ELEMENT.name
754
+ ELEMENT.name = ''
755
+ }
756
+ else {
757
+ name = [
758
+ typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',
759
+ typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'
760
+ ]
761
+ name = name[0] + ELEMENT.name + name[1]
762
+ }
763
+
764
+ P._hidden = $(
765
+ '<input ' +
766
+ 'type=hidden ' +
767
+
768
+ // Create the name using the original input’s with a prefix and suffix.
769
+ 'name="' + name + '"' +
770
+
771
+ // If the element has a value, set the hidden value as well.
772
+ (
773
+ $ELEMENT.data('value') || ELEMENT.value ?
774
+ ' value="' + P.get('select', SETTINGS.formatSubmit) + '"' :
775
+ ''
776
+ ) +
777
+ '>'
778
+ )[0]
779
+
780
+ $ELEMENT.
781
+
782
+ // If the value changes, update the hidden input with the correct format.
783
+ on('change.' + STATE.id, function() {
784
+ P._hidden.value = ELEMENT.value ?
785
+ P.get('select', SETTINGS.formatSubmit) :
786
+ ''
787
+ })
788
+
789
+
790
+ // Insert the hidden input as specified in the settings.
791
+ if ( SETTINGS.container ) $( SETTINGS.container ).append( P._hidden )
792
+ else $ELEMENT.after( P._hidden )
793
+ }
794
+
795
+
796
+ // For iOS8.
797
+ function handleKeydownEvent( event ) {
798
+
799
+ var keycode = event.keyCode,
800
+
801
+ // Check if one of the delete keys was pressed.
802
+ isKeycodeDelete = /^(8|46)$/.test(keycode)
803
+
804
+ // For some reason IE clears the input value on “escape”.
805
+ if ( keycode == 27 ) {
806
+ P.close()
807
+ return false
808
+ }
809
+
810
+ // Check if `space` or `delete` was pressed or the picker is closed with a key movement.
811
+ if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {
812
+
813
+ // Prevent it from moving the page and bubbling to doc.
814
+ event.preventDefault()
815
+ event.stopPropagation()
816
+
817
+ // If `delete` was pressed, clear the values and close the picker.
818
+ // Otherwise open the picker.
819
+ if ( isKeycodeDelete ) { P.clear().close() }
820
+ else { P.open() }
821
+ }
822
+ }
823
+
824
+
825
+ // Separated for IE
826
+ function handleFocusToOpenEvent( event ) {
827
+
828
+ // Stop the event from propagating to the doc.
829
+ event.stopPropagation()
830
+
831
+ // If it’s a focus event, add the “focused” class to the root.
832
+ if ( event.type == 'focus' ) {
833
+ P.$root.addClass( CLASSES.focused )
834
+ }
835
+
836
+ // And then finally open the picker.
837
+ P.open()
838
+ }
839
+
840
+
841
+ // Return a new picker instance.
842
+ return new PickerInstance()
843
+ } //PickerConstructor
844
+
845
+
846
+
847
+ /**
848
+ * The default classes and prefix to use for the HTML classes.
849
+ */
850
+ PickerConstructor.klasses = function( prefix ) {
851
+ prefix = prefix || 'picker'
852
+ return {
853
+
854
+ picker: prefix,
855
+ opened: prefix + '--opened',
856
+ focused: prefix + '--focused',
857
+
858
+ input: prefix + '__input',
859
+ active: prefix + '__input--active',
860
+ target: prefix + '__input--target',
861
+
862
+ holder: prefix + '__holder',
863
+
864
+ frame: prefix + '__frame',
865
+ wrap: prefix + '__wrap',
866
+
867
+ box: prefix + '__box'
868
+ }
869
+ } //PickerConstructor.klasses
870
+
871
+
872
+
873
+ /**
874
+ * Check if the default theme is being used.
875
+ */
876
+ function isUsingDefaultTheme( element ) {
877
+
878
+ var theme,
879
+ prop = 'position'
880
+
881
+ // For IE.
882
+ if ( element.currentStyle ) {
883
+ theme = element.currentStyle[prop]
884
+ }
885
+
886
+ // For normal browsers.
887
+ else if ( window.getComputedStyle ) {
888
+ theme = getComputedStyle( element )[prop]
889
+ }
890
+
891
+ return theme == 'fixed'
892
+ }
893
+
894
+
895
+
896
+ /**
897
+ * Get the width of the browser’s scrollbar.
898
+ * Taken from: https://github.com/VodkaBears/Remodal/blob/master/src/jquery.remodal.js
899
+ */
900
+ function getScrollbarWidth() {
901
+
902
+ if ( $html.height() <= $window.height() ) {
903
+ return 0
904
+ }
905
+
906
+ var $outer = $( '<div style="visibility:hidden;width:100px" />' ).
907
+ appendTo( 'body' )
908
+
909
+ // Get the width without scrollbars.
910
+ var widthWithoutScroll = $outer[0].offsetWidth
911
+
912
+ // Force adding scrollbars.
913
+ $outer.css( 'overflow', 'scroll' )
914
+
915
+ // Add the inner div.
916
+ var $inner = $( '<div style="width:100%" />' ).appendTo( $outer )
917
+
918
+ // Get the width with scrollbars.
919
+ var widthWithScroll = $inner[0].offsetWidth
920
+
921
+ // Remove the divs.
922
+ $outer.remove()
923
+
924
+ // Return the difference between the widths.
925
+ return widthWithoutScroll - widthWithScroll
926
+ }
927
+
928
+
929
+
930
+ /**
931
+ * PickerConstructor helper methods.
932
+ */
933
+ PickerConstructor._ = {
934
+
935
+ /**
936
+ * Create a group of nodes. Expects:
937
+ * `
938
+ {
939
+ min: {Integer},
940
+ max: {Integer},
941
+ i: {Integer},
942
+ node: {String},
943
+ item: {Function}
944
+ }
945
+ * `
946
+ */
947
+ group: function( groupObject ) {
948
+
949
+ var
950
+ // Scope for the looped object
951
+ loopObjectScope,
952
+
953
+ // Create the nodes list
954
+ nodesList = '',
955
+
956
+ // The counter starts from the `min`
957
+ counter = PickerConstructor._.trigger( groupObject.min, groupObject )
958
+
959
+
960
+ // Loop from the `min` to `max`, incrementing by `i`
961
+ for ( ; counter <= PickerConstructor._.trigger( groupObject.max, groupObject, [ counter ] ); counter += groupObject.i ) {
962
+
963
+ // Trigger the `item` function within scope of the object
964
+ loopObjectScope = PickerConstructor._.trigger( groupObject.item, groupObject, [ counter ] )
965
+
966
+ // Splice the subgroup and create nodes out of the sub nodes
967
+ nodesList += PickerConstructor._.node(
968
+ groupObject.node,
969
+ loopObjectScope[ 0 ], // the node
970
+ loopObjectScope[ 1 ], // the classes
971
+ loopObjectScope[ 2 ] // the attributes
972
+ )
973
+ }
974
+
975
+ // Return the list of nodes
976
+ return nodesList
977
+ }, //group
978
+
979
+
980
+ /**
981
+ * Create a dom node string
982
+ */
983
+ node: function( wrapper, item, klass, attribute ) {
984
+
985
+ // If the item is false-y, just return an empty string
986
+ if ( !item ) return ''
987
+
988
+ // If the item is an array, do a join
989
+ item = $.isArray( item ) ? item.join( '' ) : item
990
+
991
+ // Check for the class
992
+ klass = klass ? ' class="' + klass + '"' : ''
993
+
994
+ // Check for any attributes
995
+ attribute = attribute ? ' ' + attribute : ''
996
+
997
+ // Return the wrapped item
998
+ return '<' + wrapper + klass + attribute + '>' + item + '</' + wrapper + '>'
999
+ }, //node
1000
+
1001
+
1002
+ /**
1003
+ * Lead numbers below 10 with a zero.
1004
+ */
1005
+ lead: function( number ) {
1006
+ return ( number < 10 ? '0': '' ) + number
1007
+ },
1008
+
1009
+
1010
+ /**
1011
+ * Trigger a function otherwise return the value.
1012
+ */
1013
+ trigger: function( callback, scope, args ) {
1014
+ return typeof callback == 'function' ? callback.apply( scope, args || [] ) : callback
1015
+ },
1016
+
1017
+
1018
+ /**
1019
+ * If the second character is a digit, length is 2 otherwise 1.
1020
+ */
1021
+ digits: function( string ) {
1022
+ return ( /\d/ ).test( string[ 1 ] ) ? 2 : 1
1023
+ },
1024
+
1025
+
1026
+ /**
1027
+ * Tell if something is a date object.
1028
+ */
1029
+ isDate: function( value ) {
1030
+ return {}.toString.call( value ).indexOf( 'Date' ) > -1 && this.isInteger( value.getDate() )
1031
+ },
1032
+
1033
+
1034
+ /**
1035
+ * Tell if something is an integer.
1036
+ */
1037
+ isInteger: function( value ) {
1038
+ return {}.toString.call( value ).indexOf( 'Number' ) > -1 && value % 1 === 0
1039
+ },
1040
+
1041
+
1042
+ /**
1043
+ * Create ARIA attribute strings.
1044
+ */
1045
+ ariaAttr: ariaAttr
1046
+ } //PickerConstructor._
1047
+
1048
+
1049
+
1050
+ /**
1051
+ * Extend the picker with a component and defaults.
1052
+ */
1053
+ PickerConstructor.extend = function( name, Component ) {
1054
+
1055
+ // Extend jQuery.
1056
+ $.fn[ name ] = function( options, action ) {
1057
+
1058
+ // Grab the component data.
1059
+ var componentData = this.data( name )
1060
+
1061
+ // If the picker is requested, return the data object.
1062
+ if ( options == 'picker' ) {
1063
+ return componentData
1064
+ }
1065
+
1066
+ // If the component data exists and `options` is a string, carry out the action.
1067
+ if ( componentData && typeof options == 'string' ) {
1068
+ return PickerConstructor._.trigger( componentData[ options ], componentData, [ action ] )
1069
+ }
1070
+
1071
+ // Otherwise go through each matched element and if the component
1072
+ // doesn’t exist, create a new picker using `this` element
1073
+ // and merging the defaults and options with a deep copy.
1074
+ return this.each( function() {
1075
+ var $this = $( this )
1076
+ if ( !$this.data( name ) ) {
1077
+ new PickerConstructor( this, name, Component, options )
1078
+ }
1079
+ })
1080
+ }
1081
+
1082
+ // Set the defaults.
1083
+ $.fn[ name ].defaults = Component.defaults
1084
+ } //PickerConstructor.extend
1085
+
1086
+
1087
+
1088
+ function aria(element, attribute, value) {
1089
+ if ( $.isPlainObject(attribute) ) {
1090
+ for ( var key in attribute ) {
1091
+ ariaSet(element, key, attribute[key])
1092
+ }
1093
+ }
1094
+ else {
1095
+ ariaSet(element, attribute, value)
1096
+ }
1097
+ }
1098
+ function ariaSet(element, attribute, value) {
1099
+ element.setAttribute(
1100
+ (attribute == 'role' ? '' : 'aria-') + attribute,
1101
+ value
1102
+ )
1103
+ }
1104
+ function ariaAttr(attribute, data) {
1105
+ if ( !$.isPlainObject(attribute) ) {
1106
+ attribute = { attribute: data }
1107
+ }
1108
+ data = ''
1109
+ for ( var key in attribute ) {
1110
+ var attr = (key == 'role' ? '' : 'aria-') + key,
1111
+ attrVal = attribute[key]
1112
+ data += attrVal == null ? '' : attr + '="' + attribute[key] + '"'
1113
+ }
1114
+ return data
1115
+ }
1116
+
1117
+ // IE8 bug throws an error for activeElements within iframes.
1118
+ function getActiveElement() {
1119
+ try {
1120
+ return document.activeElement
1121
+ } catch ( err ) { }
1122
+ }
1123
+
1124
+
1125
+
1126
+ // Expose the picker constructor.
1127
+ return PickerConstructor
1128
+
1129
+
1130
+ }));
1131
+
1132
+