integral 1.1.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (633) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +6 -33
  3. data/Rakefile +1 -1
  4. data/app/assets/images/integral/defaults/no_image_available.jpg +0 -0
  5. data/app/assets/images/logo.png +0 -0
  6. data/app/assets/javascripts/ckeditor/my_config.js.erb +26 -18
  7. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/lv.js +8 -0
  8. data/app/assets/javascripts/ckeditor/plugins/autoembed/plugin.js +1 -1
  9. data/app/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +14 -14
  10. data/app/assets/javascripts/ckeditor/plugins/autogrow/samples/autogrow.html +8 -8
  11. data/app/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
  12. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/autoformat.png +0 -0
  13. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/searchcode.png +0 -0
  14. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/uncommentselectedrange.png +0 -0
  15. data/app/assets/javascripts/ckeditor/plugins/codemirror/images/autocomplete.png +0 -0
  16. data/app/assets/javascripts/ckeditor/plugins/codemirror/images/autoformat.png +0 -0
  17. data/app/assets/javascripts/ckeditor/plugins/codemirror/images/commentselectedrange.png +0 -0
  18. data/app/assets/javascripts/ckeditor/plugins/codemirror/images/searchcode.png +0 -0
  19. data/app/assets/javascripts/ckeditor/plugins/codemirror/images/uncommentselectedrange.png +0 -0
  20. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +2 -2
  21. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +2 -2
  22. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
  23. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -6
  24. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +1 -1
  25. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.handlebars.min.js +1 -0
  26. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +2 -2
  27. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
  28. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +3 -3
  29. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.twig.min.js +1 -1
  30. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/bg.js +7 -7
  31. data/app/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +231 -217
  32. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/darcula.css +46 -0
  33. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/gruvbox-dark.css +34 -0
  34. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/idea.css +42 -0
  35. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +1 -1
  36. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/lucario.css +37 -0
  37. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +5 -0
  38. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/oceanic-next.css +44 -0
  39. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/shadowfox.css +52 -0
  40. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/ssms.css +16 -0
  41. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ar.js +15 -0
  42. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/lv.js +15 -0
  43. data/app/assets/javascripts/ckeditor/plugins/embedbase/plugin.js +1 -1
  44. data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/copywidget.png +0 -0
  45. data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/editwidget.png +0 -0
  46. data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/hidpi/copywidget.png +0 -0
  47. data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/hidpi/editwidget.png +0 -0
  48. data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/hidpi/removewidget.png +0 -0
  49. data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/hidpi/widget.png +0 -0
  50. data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/removewidget.png +0 -0
  51. data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/widget.png +0 -0
  52. data/app/assets/javascripts/ckeditor/plugins/foundation-callout/plugin.js +86 -0
  53. data/app/assets/javascripts/ckeditor/plugins/image2/dev/assets/image1.jpg +0 -0
  54. data/app/assets/javascripts/ckeditor/plugins/image2/dev/assets/image2.jpg +0 -0
  55. data/app/assets/javascripts/ckeditor/plugins/image2/dev/contents.css +35 -0
  56. data/app/assets/javascripts/ckeditor/plugins/image2/dev/image2.html +339 -0
  57. data/app/assets/javascripts/ckeditor/plugins/image2/dialogs/image2.js +553 -0
  58. data/app/assets/javascripts/ckeditor/plugins/image2/icons/hidpi/image.png +0 -0
  59. data/app/assets/javascripts/ckeditor/plugins/image2/icons/image.png +0 -0
  60. data/app/assets/javascripts/ckeditor/plugins/image2/lang/af.js +21 -0
  61. data/app/assets/javascripts/ckeditor/plugins/image2/lang/ar.js +21 -0
  62. data/app/assets/javascripts/ckeditor/plugins/image2/lang/az.js +21 -0
  63. data/app/assets/javascripts/ckeditor/plugins/image2/lang/bg.js +21 -0
  64. data/app/assets/javascripts/ckeditor/plugins/image2/lang/bn.js +21 -0
  65. data/app/assets/javascripts/ckeditor/plugins/image2/lang/bs.js +21 -0
  66. data/app/assets/javascripts/ckeditor/plugins/image2/lang/ca.js +21 -0
  67. data/app/assets/javascripts/ckeditor/plugins/image2/lang/cs.js +21 -0
  68. data/app/assets/javascripts/ckeditor/plugins/image2/lang/cy.js +21 -0
  69. data/app/assets/javascripts/ckeditor/plugins/image2/lang/da.js +21 -0
  70. data/app/assets/javascripts/ckeditor/plugins/image2/lang/de-ch.js +21 -0
  71. data/app/assets/javascripts/ckeditor/plugins/image2/lang/de.js +21 -0
  72. data/app/assets/javascripts/ckeditor/plugins/image2/lang/el.js +21 -0
  73. data/app/assets/javascripts/ckeditor/plugins/image2/lang/en-au.js +21 -0
  74. data/app/assets/javascripts/ckeditor/plugins/image2/lang/en-ca.js +21 -0
  75. data/app/assets/javascripts/ckeditor/plugins/image2/lang/en-gb.js +21 -0
  76. data/app/assets/javascripts/ckeditor/plugins/image2/lang/en.js +21 -0
  77. data/app/assets/javascripts/ckeditor/plugins/image2/lang/eo.js +21 -0
  78. data/app/assets/javascripts/ckeditor/plugins/image2/lang/es-mx.js +21 -0
  79. data/app/assets/javascripts/ckeditor/plugins/image2/lang/es.js +21 -0
  80. data/app/assets/javascripts/ckeditor/plugins/image2/lang/et.js +21 -0
  81. data/app/assets/javascripts/ckeditor/plugins/image2/lang/eu.js +21 -0
  82. data/app/assets/javascripts/ckeditor/plugins/image2/lang/fa.js +21 -0
  83. data/app/assets/javascripts/ckeditor/plugins/image2/lang/fi.js +21 -0
  84. data/app/assets/javascripts/ckeditor/plugins/image2/lang/fo.js +21 -0
  85. data/app/assets/javascripts/ckeditor/plugins/image2/lang/fr-ca.js +21 -0
  86. data/app/assets/javascripts/ckeditor/plugins/image2/lang/fr.js +21 -0
  87. data/app/assets/javascripts/ckeditor/plugins/image2/lang/gl.js +21 -0
  88. data/app/assets/javascripts/ckeditor/plugins/image2/lang/gu.js +21 -0
  89. data/app/assets/javascripts/ckeditor/plugins/image2/lang/he.js +21 -0
  90. data/app/assets/javascripts/ckeditor/plugins/image2/lang/hi.js +21 -0
  91. data/app/assets/javascripts/ckeditor/plugins/image2/lang/hr.js +21 -0
  92. data/app/assets/javascripts/ckeditor/plugins/image2/lang/hu.js +21 -0
  93. data/app/assets/javascripts/ckeditor/plugins/image2/lang/id.js +21 -0
  94. data/app/assets/javascripts/ckeditor/plugins/image2/lang/is.js +21 -0
  95. data/app/assets/javascripts/ckeditor/plugins/image2/lang/it.js +21 -0
  96. data/app/assets/javascripts/ckeditor/plugins/image2/lang/ja.js +21 -0
  97. data/app/assets/javascripts/ckeditor/plugins/image2/lang/ka.js +21 -0
  98. data/app/assets/javascripts/ckeditor/plugins/image2/lang/km.js +21 -0
  99. data/app/assets/javascripts/ckeditor/plugins/image2/lang/ko.js +21 -0
  100. data/app/assets/javascripts/ckeditor/plugins/image2/lang/ku.js +21 -0
  101. data/app/assets/javascripts/ckeditor/plugins/image2/lang/lt.js +21 -0
  102. data/app/assets/javascripts/ckeditor/plugins/image2/lang/lv.js +21 -0
  103. data/app/assets/javascripts/ckeditor/plugins/image2/lang/mk.js +21 -0
  104. data/app/assets/javascripts/ckeditor/plugins/image2/lang/mn.js +21 -0
  105. data/app/assets/javascripts/ckeditor/plugins/image2/lang/ms.js +21 -0
  106. data/app/assets/javascripts/ckeditor/plugins/image2/lang/nb.js +21 -0
  107. data/app/assets/javascripts/ckeditor/plugins/image2/lang/nl.js +21 -0
  108. data/app/assets/javascripts/ckeditor/plugins/image2/lang/no.js +21 -0
  109. data/app/assets/javascripts/ckeditor/plugins/image2/lang/oc.js +21 -0
  110. data/app/assets/javascripts/ckeditor/plugins/image2/lang/pl.js +21 -0
  111. data/app/assets/javascripts/ckeditor/plugins/image2/lang/pt-br.js +21 -0
  112. data/app/assets/javascripts/ckeditor/plugins/image2/lang/pt.js +21 -0
  113. data/app/assets/javascripts/ckeditor/plugins/image2/lang/ro.js +21 -0
  114. data/app/assets/javascripts/ckeditor/plugins/image2/lang/ru.js +21 -0
  115. data/app/assets/javascripts/ckeditor/plugins/image2/lang/si.js +21 -0
  116. data/app/assets/javascripts/ckeditor/plugins/image2/lang/sk.js +21 -0
  117. data/app/assets/javascripts/ckeditor/plugins/image2/lang/sl.js +21 -0
  118. data/app/assets/javascripts/ckeditor/plugins/image2/lang/sq.js +21 -0
  119. data/app/assets/javascripts/ckeditor/plugins/image2/lang/sr-latn.js +21 -0
  120. data/app/assets/javascripts/ckeditor/plugins/image2/lang/sr.js +21 -0
  121. data/app/assets/javascripts/ckeditor/plugins/image2/lang/sv.js +21 -0
  122. data/app/assets/javascripts/ckeditor/plugins/image2/lang/th.js +21 -0
  123. data/app/assets/javascripts/ckeditor/plugins/image2/lang/tr.js +21 -0
  124. data/app/assets/javascripts/ckeditor/plugins/image2/lang/tt.js +21 -0
  125. data/app/assets/javascripts/ckeditor/plugins/image2/lang/ug.js +21 -0
  126. data/app/assets/javascripts/ckeditor/plugins/image2/lang/uk.js +21 -0
  127. data/app/assets/javascripts/ckeditor/plugins/image2/lang/vi.js +21 -0
  128. data/app/assets/javascripts/ckeditor/plugins/image2/lang/zh-cn.js +21 -0
  129. data/app/assets/javascripts/ckeditor/plugins/image2/lang/zh.js +21 -0
  130. data/app/assets/javascripts/ckeditor/plugins/image2/plugin.js +1720 -0
  131. data/app/assets/javascripts/ckeditor/plugins/image2/samples/assets/image1.jpg +0 -0
  132. data/app/assets/javascripts/ckeditor/plugins/image2/samples/assets/image2.jpg +0 -0
  133. data/app/assets/javascripts/ckeditor/plugins/image2/samples/image2.html +68 -0
  134. data/app/assets/javascripts/ckeditor/plugins/lineutils/dev/dnd.html +4 -4
  135. data/app/assets/javascripts/ckeditor/plugins/lineutils/dev/magicfinger.html +4 -4
  136. data/app/assets/javascripts/ckeditor/plugins/lineutils/plugin.js +7 -7
  137. data/app/assets/javascripts/ckeditor/plugins/linkballoon/README.md +5 -0
  138. data/app/assets/javascripts/ckeditor/plugins/linkballoon/assets/demo.png +0 -0
  139. data/app/assets/javascripts/ckeditor/plugins/linkballoon/plugin.js +25 -0
  140. data/app/assets/javascripts/ckeditor/plugins/notification/lang/az.js +7 -0
  141. data/app/assets/javascripts/ckeditor/plugins/notification/lang/bg.js +7 -0
  142. data/app/assets/javascripts/ckeditor/plugins/notification/lang/ca.js +7 -0
  143. data/app/assets/javascripts/ckeditor/plugins/notification/lang/cs.js +2 -2
  144. data/app/assets/javascripts/ckeditor/plugins/notification/lang/da.js +2 -2
  145. data/app/assets/javascripts/ckeditor/plugins/notification/lang/de-ch.js +2 -2
  146. data/app/assets/javascripts/ckeditor/plugins/notification/lang/de.js +2 -2
  147. data/app/assets/javascripts/ckeditor/plugins/notification/lang/en-au.js +7 -0
  148. data/app/assets/javascripts/ckeditor/plugins/notification/lang/en.js +2 -2
  149. data/app/assets/javascripts/ckeditor/plugins/notification/lang/eo.js +2 -2
  150. data/app/assets/javascripts/ckeditor/plugins/notification/lang/es-mx.js +7 -0
  151. data/app/assets/javascripts/ckeditor/plugins/notification/lang/es.js +7 -0
  152. data/app/assets/javascripts/ckeditor/plugins/notification/lang/et.js +7 -0
  153. data/app/assets/javascripts/ckeditor/plugins/notification/lang/eu.js +2 -2
  154. data/app/assets/javascripts/ckeditor/plugins/notification/lang/fa.js +7 -0
  155. data/app/assets/javascripts/ckeditor/plugins/notification/lang/fr.js +3 -3
  156. data/app/assets/javascripts/ckeditor/plugins/notification/lang/gl.js +2 -2
  157. data/app/assets/javascripts/ckeditor/plugins/notification/lang/hr.js +7 -0
  158. data/app/assets/javascripts/ckeditor/plugins/notification/lang/hu.js +7 -0
  159. data/app/assets/javascripts/ckeditor/plugins/notification/lang/id.js +2 -2
  160. data/app/assets/javascripts/ckeditor/plugins/notification/lang/it.js +2 -2
  161. data/app/assets/javascripts/ckeditor/plugins/notification/lang/ja.js +7 -0
  162. data/app/assets/javascripts/ckeditor/plugins/notification/lang/km.js +2 -2
  163. data/app/assets/javascripts/ckeditor/plugins/notification/lang/ko.js +2 -2
  164. data/app/assets/javascripts/ckeditor/plugins/notification/lang/ku.js +2 -2
  165. data/app/assets/javascripts/ckeditor/plugins/notification/lang/lv.js +7 -0
  166. data/app/assets/javascripts/ckeditor/plugins/notification/lang/nb.js +2 -2
  167. data/app/assets/javascripts/ckeditor/plugins/notification/lang/nl.js +2 -2
  168. data/app/assets/javascripts/ckeditor/plugins/notification/lang/oc.js +7 -0
  169. data/app/assets/javascripts/ckeditor/plugins/notification/lang/pl.js +2 -2
  170. data/app/assets/javascripts/ckeditor/plugins/notification/lang/pt-br.js +2 -2
  171. data/app/assets/javascripts/ckeditor/plugins/notification/lang/pt.js +2 -2
  172. data/app/assets/javascripts/ckeditor/plugins/notification/lang/ro.js +7 -0
  173. data/app/assets/javascripts/ckeditor/plugins/notification/lang/ru.js +2 -2
  174. data/app/assets/javascripts/ckeditor/plugins/notification/lang/sk.js +7 -0
  175. data/app/assets/javascripts/ckeditor/plugins/notification/lang/sq.js +7 -0
  176. data/app/assets/javascripts/ckeditor/plugins/notification/lang/sv.js +2 -2
  177. data/app/assets/javascripts/ckeditor/plugins/notification/lang/tr.js +2 -2
  178. data/app/assets/javascripts/ckeditor/plugins/notification/lang/ug.js +2 -2
  179. data/app/assets/javascripts/ckeditor/plugins/notification/lang/uk.js +2 -2
  180. data/app/assets/javascripts/ckeditor/plugins/notification/lang/zh-cn.js +3 -3
  181. data/app/assets/javascripts/ckeditor/plugins/notification/lang/zh.js +2 -2
  182. data/app/assets/javascripts/ckeditor/plugins/notification/plugin.js +794 -784
  183. data/app/assets/javascripts/ckeditor/plugins/openlink/README.md +50 -0
  184. data/app/assets/javascripts/ckeditor/plugins/openlink/icons/hidpi/openLink.png +0 -0
  185. data/app/assets/javascripts/ckeditor/plugins/openlink/icons/openLink.png +0 -0
  186. data/app/assets/javascripts/ckeditor/plugins/openlink/lang/bg.js +7 -0
  187. data/app/assets/javascripts/ckeditor/plugins/openlink/lang/de.js +7 -0
  188. data/app/assets/javascripts/ckeditor/plugins/openlink/lang/en.js +7 -0
  189. data/app/assets/javascripts/ckeditor/plugins/openlink/lang/pl.js +7 -0
  190. data/app/assets/javascripts/ckeditor/plugins/openlink/lang/ru.js +7 -0
  191. data/app/assets/javascripts/ckeditor/plugins/openlink/lang/uk.js +7 -0
  192. data/app/assets/javascripts/ckeditor/plugins/openlink/plugin.js +178 -0
  193. data/app/assets/javascripts/ckeditor/plugins/placeholder/dev/placeholder.html +5 -5
  194. data/app/assets/javascripts/ckeditor/plugins/placeholder/dialogs/placeholder.js +2 -2
  195. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/af.js +2 -2
  196. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ar.js +2 -2
  197. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/az.js +2 -2
  198. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/bg.js +5 -5
  199. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ca.js +2 -2
  200. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/cs.js +2 -2
  201. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/cy.js +2 -2
  202. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/da.js +2 -2
  203. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/de-ch.js +2 -2
  204. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/de.js +2 -2
  205. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/el.js +2 -2
  206. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/en-au.js +12 -0
  207. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/en-gb.js +2 -2
  208. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/en.js +2 -2
  209. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/eo.js +2 -2
  210. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/es-mx.js +2 -2
  211. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/es.js +2 -2
  212. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/et.js +2 -2
  213. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/eu.js +2 -2
  214. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fa.js +2 -2
  215. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fi.js +2 -2
  216. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fr-ca.js +2 -2
  217. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fr.js +2 -2
  218. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/gl.js +2 -2
  219. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/he.js +2 -2
  220. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/hr.js +2 -2
  221. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/hu.js +2 -2
  222. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/id.js +2 -2
  223. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/it.js +2 -2
  224. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ja.js +2 -2
  225. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/km.js +2 -2
  226. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ko.js +2 -2
  227. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ku.js +2 -2
  228. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/lv.js +5 -5
  229. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/nb.js +2 -2
  230. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/nl.js +2 -2
  231. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/no.js +2 -2
  232. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/oc.js +2 -2
  233. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/pl.js +2 -2
  234. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/pt-br.js +2 -2
  235. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/pt.js +2 -2
  236. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ro.js +12 -0
  237. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ru.js +2 -2
  238. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/si.js +2 -2
  239. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sk.js +2 -2
  240. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sl.js +2 -2
  241. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sq.js +2 -2
  242. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sv.js +2 -2
  243. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/th.js +2 -2
  244. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/tr.js +2 -2
  245. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/tt.js +2 -2
  246. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ug.js +2 -2
  247. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/uk.js +2 -2
  248. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/vi.js +2 -2
  249. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/zh-cn.js +2 -2
  250. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/zh.js +2 -2
  251. data/app/assets/javascripts/ckeditor/plugins/placeholder/plugin.js +3 -3
  252. data/app/assets/javascripts/ckeditor/plugins/placeholder/samples/placeholder.html +6 -6
  253. data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/dialogs/simplebox.js +4 -4
  254. data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/plugin.js +3 -3
  255. data/app/assets/javascripts/ckeditor/plugins/widget/dev/console.js +2 -2
  256. data/app/assets/javascripts/ckeditor/plugins/widget/dev/nestedwidgets.html +2 -2
  257. data/app/assets/javascripts/ckeditor/plugins/widget/dev/widgetstyles.html +2 -2
  258. data/app/assets/javascripts/ckeditor/plugins/widget/lang/af.js +2 -2
  259. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ar.js +2 -2
  260. data/app/assets/javascripts/ckeditor/plugins/widget/lang/az.js +2 -2
  261. data/app/assets/javascripts/ckeditor/plugins/widget/lang/bg.js +3 -3
  262. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ca.js +2 -2
  263. data/app/assets/javascripts/ckeditor/plugins/widget/lang/cs.js +2 -2
  264. data/app/assets/javascripts/ckeditor/plugins/widget/lang/cy.js +2 -2
  265. data/app/assets/javascripts/ckeditor/plugins/widget/lang/da.js +2 -2
  266. data/app/assets/javascripts/ckeditor/plugins/widget/lang/de-ch.js +2 -2
  267. data/app/assets/javascripts/ckeditor/plugins/widget/lang/de.js +2 -2
  268. data/app/assets/javascripts/ckeditor/plugins/widget/lang/el.js +2 -2
  269. data/app/assets/javascripts/ckeditor/plugins/widget/lang/en-au.js +8 -0
  270. data/app/assets/javascripts/ckeditor/plugins/widget/lang/en-gb.js +2 -2
  271. data/app/assets/javascripts/ckeditor/plugins/widget/lang/en.js +2 -2
  272. data/app/assets/javascripts/ckeditor/plugins/widget/lang/eo.js +2 -2
  273. data/app/assets/javascripts/ckeditor/plugins/widget/lang/es-mx.js +2 -2
  274. data/app/assets/javascripts/ckeditor/plugins/widget/lang/es.js +2 -2
  275. data/app/assets/javascripts/ckeditor/plugins/widget/lang/et.js +8 -0
  276. data/app/assets/javascripts/ckeditor/plugins/widget/lang/eu.js +2 -2
  277. data/app/assets/javascripts/ckeditor/plugins/widget/lang/fa.js +3 -3
  278. data/app/assets/javascripts/ckeditor/plugins/widget/lang/fi.js +2 -2
  279. data/app/assets/javascripts/ckeditor/plugins/widget/lang/fr.js +2 -2
  280. data/app/assets/javascripts/ckeditor/plugins/widget/lang/gl.js +2 -2
  281. data/app/assets/javascripts/ckeditor/plugins/widget/lang/he.js +2 -2
  282. data/app/assets/javascripts/ckeditor/plugins/widget/lang/hr.js +2 -2
  283. data/app/assets/javascripts/ckeditor/plugins/widget/lang/hu.js +2 -2
  284. data/app/assets/javascripts/ckeditor/plugins/widget/lang/id.js +2 -2
  285. data/app/assets/javascripts/ckeditor/plugins/widget/lang/it.js +2 -2
  286. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ja.js +2 -2
  287. data/app/assets/javascripts/ckeditor/plugins/widget/lang/km.js +2 -2
  288. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ko.js +2 -2
  289. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ku.js +2 -2
  290. data/app/assets/javascripts/ckeditor/plugins/widget/lang/lv.js +3 -3
  291. data/app/assets/javascripts/ckeditor/plugins/widget/lang/nb.js +2 -2
  292. data/app/assets/javascripts/ckeditor/plugins/widget/lang/nl.js +2 -2
  293. data/app/assets/javascripts/ckeditor/plugins/widget/lang/no.js +2 -2
  294. data/app/assets/javascripts/ckeditor/plugins/widget/lang/oc.js +2 -2
  295. data/app/assets/javascripts/ckeditor/plugins/widget/lang/pl.js +2 -2
  296. data/app/assets/javascripts/ckeditor/plugins/widget/lang/pt-br.js +2 -2
  297. data/app/assets/javascripts/ckeditor/plugins/widget/lang/pt.js +2 -2
  298. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ro.js +8 -0
  299. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ru.js +2 -2
  300. data/app/assets/javascripts/ckeditor/plugins/widget/lang/sk.js +2 -2
  301. data/app/assets/javascripts/ckeditor/plugins/widget/lang/sl.js +2 -2
  302. data/app/assets/javascripts/ckeditor/plugins/widget/lang/sq.js +3 -3
  303. data/app/assets/javascripts/ckeditor/plugins/widget/lang/sv.js +2 -2
  304. data/app/assets/javascripts/ckeditor/plugins/widget/lang/tr.js +2 -2
  305. data/app/assets/javascripts/ckeditor/plugins/widget/lang/tt.js +2 -2
  306. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ug.js +2 -2
  307. data/app/assets/javascripts/ckeditor/plugins/widget/lang/uk.js +2 -2
  308. data/app/assets/javascripts/ckeditor/plugins/widget/lang/vi.js +2 -2
  309. data/app/assets/javascripts/ckeditor/plugins/widget/lang/zh-cn.js +2 -2
  310. data/app/assets/javascripts/ckeditor/plugins/widget/lang/zh.js +2 -2
  311. data/app/assets/javascripts/ckeditor/plugins/widget/plugin.js +235 -64
  312. data/app/assets/javascripts/ckeditor/plugins/widgetselection/plugin.js +6 -11
  313. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ar.js +1 -0
  314. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/bg.js +17 -0
  315. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ca.js +1 -0
  316. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/cs.js +15 -0
  317. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/da.js +1 -0
  318. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/de.js +1 -0
  319. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/el.js +1 -0
  320. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +5 -1
  321. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/es.js +1 -0
  322. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/eu.js +17 -0
  323. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/fa.js +13 -0
  324. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/fi.js +1 -0
  325. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/fr.js +1 -0
  326. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/he.js +1 -0
  327. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/hr.js +1 -0
  328. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/hu.js +14 -0
  329. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/it.js +4 -3
  330. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ja.js +5 -5
  331. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ko.js +16 -0
  332. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/nl.js +3 -2
  333. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/no.js +1 -0
  334. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/pl.js +4 -3
  335. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/pt-br.js +1 -0
  336. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/pt.js +1 -0
  337. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ro.js +15 -0
  338. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +2 -1
  339. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/sk.js +15 -0
  340. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/sv.js +5 -3
  341. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/tr.js +1 -0
  342. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/uk.js +17 -0
  343. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/zh-cn.js +1 -0
  344. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/zh.js +14 -0
  345. data/app/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +485 -302
  346. data/app/assets/javascripts/ckeditor/plugins/wordcount/samples/maxParagraphs.html +26 -0
  347. data/app/assets/javascripts/integral/backend.js +196 -25
  348. data/app/assets/javascripts/integral/frontend.js +37 -2
  349. data/app/assets/javascripts/integral/support/character_counter.js +13 -8
  350. data/app/assets/javascripts/integral/support/confirm_modal.coffee +2 -2
  351. data/app/assets/javascripts/integral/support/date_picker.coffee +54 -59
  352. data/app/assets/javascripts/integral/support/gallery.coffee +71 -54
  353. data/app/assets/javascripts/integral/support/grid.coffee +11 -4
  354. data/app/assets/javascripts/integral/support/lib/lazysizes.js +755 -0
  355. data/app/assets/javascripts/integral/support/lib/materialize-tags.js +49 -44
  356. data/app/assets/javascripts/integral/support/list.coffee +1 -0
  357. data/app/assets/javascripts/integral/support/ls.instagram.js +57 -0
  358. data/app/assets/javascripts/integral/support/ls.twitter.js +66 -0
  359. data/app/assets/javascripts/integral/support/record_selector.coffee +3 -1
  360. data/app/assets/javascripts/integral/support/remote_form.coffee +18 -11
  361. data/app/assets/javascripts/integral/support/slug_generator.coffee +1 -0
  362. data/app/assets/stylesheets/integral/backend.sass +36 -24
  363. data/app/assets/stylesheets/integral/backend/_foundation_settings.scss +5 -6
  364. data/app/assets/stylesheets/integral/backend/dashboard-layout.scss +31 -64
  365. data/app/assets/stylesheets/integral/backend/devise.sass +2 -3
  366. data/app/assets/stylesheets/integral/backend/materialize-tags.sass +2 -1
  367. data/app/assets/stylesheets/integral/backend/modules/dropdown_pane_notifications.scss +150 -0
  368. data/app/assets/stylesheets/integral/backend/modules/dropdown_pane_profile.scss +59 -0
  369. data/app/assets/stylesheets/integral/backend/modules/timeline.scss +214 -0
  370. data/app/assets/stylesheets/integral/backend/shared.sass +121 -13
  371. data/app/assets/stylesheets/integral/frontend.scss +45 -0
  372. data/app/assets/stylesheets/integral/frontend/_foundation_settings.scss +2 -2
  373. data/app/assets/stylesheets/integral/frontend/blog.sass +155 -142
  374. data/app/assets/stylesheets/integral/frontend/layout.sass +13 -3
  375. data/app/assets/stylesheets/integral/frontend/modules/article-footer.scss +55 -0
  376. data/app/assets/stylesheets/integral/frontend/modules/article.scss +34 -0
  377. data/app/assets/stylesheets/integral/frontend/modules/horizontal-post.scss +44 -0
  378. data/app/assets/stylesheets/integral/frontend/modules/inline-articles.scss +23 -0
  379. data/app/assets/stylesheets/integral/frontend/modules/latest-post.scss +37 -0
  380. data/app/assets/stylesheets/integral/frontend/modules/list-widget.scss +50 -0
  381. data/app/assets/stylesheets/integral/frontend/modules/piped-list.scss +33 -0
  382. data/app/assets/stylesheets/integral/frontend/modules/post-tags.scss +19 -0
  383. data/app/assets/stylesheets/integral/frontend/modules/scroll-container.scss +9 -0
  384. data/app/assets/stylesheets/integral/frontend/modules/sidebar-articles.scss +42 -0
  385. data/app/assets/stylesheets/integral/frontend/modules/sidebar-tags.scss +6 -0
  386. data/app/assets/stylesheets/integral/frontend/modules/sidebar-widget.scss +47 -0
  387. data/app/assets/stylesheets/integral/frontend/modules/vertical-post.scss +31 -0
  388. data/app/assets/stylesheets/integral/frontend/share_modal.sass +0 -5
  389. data/app/assets/stylesheets/integral/support/gallery.sass +8 -0
  390. data/app/assets/stylesheets/integral/support/media-query-indicator.sass +9 -3
  391. data/app/controllers/integral/application_controller.rb +10 -3
  392. data/app/controllers/integral/backend/activities_controller.rb +31 -26
  393. data/app/controllers/integral/backend/base_controller.rb +265 -26
  394. data/app/controllers/integral/backend/categories_controller.rb +49 -0
  395. data/app/controllers/integral/backend/images_controller.rb +39 -54
  396. data/app/controllers/integral/backend/lists_controller.rb +16 -98
  397. data/app/controllers/integral/backend/notification_subscriptions_controller.rb +23 -0
  398. data/app/controllers/integral/backend/pages_controller.rb +15 -117
  399. data/app/controllers/integral/backend/posts_controller.rb +22 -108
  400. data/app/controllers/integral/backend/settings_controller.rb +7 -8
  401. data/app/controllers/integral/backend/static_pages_controller.rb +14 -0
  402. data/app/controllers/integral/backend/users_controller.rb +61 -79
  403. data/app/controllers/integral/blog_controller.rb +12 -0
  404. data/app/controllers/integral/categories_controller.rb +45 -0
  405. data/app/controllers/integral/pages_controller.rb +3 -3
  406. data/app/controllers/integral/posts_controller.rb +7 -9
  407. data/app/controllers/integral/tags_controller.rb +5 -2
  408. data/app/decorators/integral/base_decorator.rb +16 -0
  409. data/app/decorators/integral/category_decorator.rb +30 -0
  410. data/app/decorators/integral/image_decorator.rb +3 -3
  411. data/app/decorators/integral/list_decorator.rb +1 -13
  412. data/app/decorators/integral/notification/notification_decorator.rb +74 -0
  413. data/app/decorators/integral/page_decorator.rb +1 -13
  414. data/app/decorators/integral/paginating_decorator.rb +6 -0
  415. data/app/decorators/integral/post_decorator.rb +44 -4
  416. data/app/decorators/integral/user_decorator.rb +1 -13
  417. data/app/decorators/integral/version_decorator.rb +58 -15
  418. data/app/helpers/integral/application_helper.rb +7 -0
  419. data/app/helpers/integral/backend/base_helper.rb +135 -15
  420. data/app/helpers/integral/blog_helper.rb +46 -0
  421. data/app/helpers/integral/social_helper.rb +0 -23
  422. data/app/jobs/integral/application_job.rb +1 -0
  423. data/app/jobs/integral/newsletter_signup_job.rb +0 -2
  424. data/app/jobs/integral/webhook/delivery_job.rb +37 -0
  425. data/app/mailers/integral/contact_mailer.rb +4 -1
  426. data/app/mailers/integral/devise_mailer.rb +6 -0
  427. data/app/models/concerns/integral/lazy_contentable.rb +54 -0
  428. data/app/models/concerns/integral/notification/subscribable.rb +67 -0
  429. data/app/models/concerns/integral/webhook/delivery.rb +30 -0
  430. data/app/models/concerns/integral/webhook/observable.rb +23 -0
  431. data/app/models/integral/application_record.rb +9 -0
  432. data/app/models/integral/category.rb +29 -0
  433. data/app/models/integral/category_version.rb +8 -0
  434. data/app/models/integral/image.rb +40 -3
  435. data/app/models/integral/list.rb +11 -4
  436. data/app/models/integral/list_item.rb +15 -16
  437. data/app/models/integral/list_item_connection.rb +6 -0
  438. data/app/models/integral/notification/notification.rb +28 -0
  439. data/app/models/integral/notification/subscription.rb +14 -0
  440. data/app/models/integral/page.rb +32 -10
  441. data/app/models/integral/post.rb +39 -14
  442. data/app/models/integral/user.rb +51 -2
  443. data/app/models/integral/version.rb +2 -2
  444. data/app/models/integral/webhook/endpoint.rb +40 -0
  445. data/app/models/integral/webhook/event.rb +20 -0
  446. data/app/policies/integral/base_policy.rb +7 -11
  447. data/app/policies/integral/category_policy.rb +9 -0
  448. data/app/policies/integral/page_policy.rb +1 -0
  449. data/app/policies/integral/version_policy.rb +0 -8
  450. data/app/serializers/integral/post_serializer.rb +24 -0
  451. data/app/uploaders/integral/avatar_uploader.rb +1 -1
  452. data/app/views/devise/invitations/edit.haml +1 -4
  453. data/app/views/devise/mailer/invitation_instructions.inky-haml +20 -0
  454. data/app/views/devise/sessions/new.haml +2 -2
  455. data/app/views/integral/backend/activities/_activity.haml +21 -0
  456. data/app/views/integral/backend/activities/grid/_dropdown_actions.haml +1 -0
  457. data/app/views/integral/backend/activities/grid/_row_content.haml +13 -0
  458. data/app/views/integral/backend/activities/index.haml +7 -13
  459. data/app/views/integral/backend/activities/shared/_grid.haml +35 -19
  460. data/app/views/integral/backend/activities/shared/index.haml +15 -0
  461. data/app/views/integral/backend/activities/shared/{_log.haml → show.haml} +7 -7
  462. data/app/views/integral/backend/activities/show.haml +1 -1
  463. data/app/views/integral/backend/categories/_modal.haml +24 -0
  464. data/app/views/integral/backend/images/_form.haml +16 -28
  465. data/app/views/integral/backend/images/edit.haml +2 -2
  466. data/app/views/integral/backend/images/grid/_dropdown_actions.haml +5 -0
  467. data/app/views/integral/backend/images/grid/_row_content.haml +5 -0
  468. data/app/views/integral/backend/images/index.haml +11 -17
  469. data/app/views/integral/backend/images/list.haml +11 -0
  470. data/app/views/integral/backend/images/show.haml +26 -0
  471. data/app/views/integral/backend/lists/_form.haml +7 -20
  472. data/app/views/integral/backend/lists/_item_container.haml +1 -1
  473. data/app/views/integral/backend/lists/_item_modal.haml +3 -3
  474. data/app/views/integral/backend/lists/_list_item_fields.haml +3 -2
  475. data/app/views/integral/backend/lists/_manager.haml +11 -13
  476. data/app/views/integral/backend/lists/edit.haml +11 -11
  477. data/app/views/integral/backend/lists/grid/_dropdown_actions.haml +9 -0
  478. data/app/views/integral/backend/lists/grid/_row_content.haml +3 -0
  479. data/app/views/integral/backend/lists/index.haml +11 -17
  480. data/app/views/integral/backend/lists/list.haml +11 -0
  481. data/app/views/integral/backend/lists/show.haml +30 -0
  482. data/app/views/integral/backend/notifications/_notification.haml +21 -0
  483. data/app/views/integral/backend/pages/_form.haml +20 -47
  484. data/app/views/integral/backend/pages/edit.haml +18 -0
  485. data/app/views/integral/backend/pages/grid/_dropdown_actions.haml +11 -0
  486. data/app/views/integral/backend/pages/grid/_row_content.haml +5 -0
  487. data/app/views/integral/backend/pages/index.haml +11 -21
  488. data/app/views/integral/backend/pages/list.haml +15 -0
  489. data/app/views/integral/backend/pages/show.haml +32 -0
  490. data/app/views/integral/backend/posts/_form.haml +19 -51
  491. data/app/views/integral/backend/posts/edit.haml +5 -10
  492. data/app/views/integral/backend/posts/grid/_dropdown_actions.haml +10 -0
  493. data/app/views/integral/backend/posts/grid/_row_content.haml +6 -0
  494. data/app/views/integral/backend/posts/index.haml +13 -19
  495. data/app/views/integral/backend/posts/list.haml +13 -0
  496. data/app/views/integral/backend/posts/new.haml +0 -1
  497. data/app/views/integral/backend/posts/show.haml +31 -0
  498. data/app/views/integral/backend/settings/sections/_social.haml +1 -3
  499. data/app/views/integral/backend/shared/_activity_modal.haml +13 -0
  500. data/app/views/integral/backend/shared/_breadcrumbs.haml +7 -4
  501. data/app/views/integral/backend/shared/_image_preview.haml +10 -3
  502. data/app/views/integral/backend/shared/_image_selector.haml +1 -1
  503. data/app/views/integral/backend/shared/_notification_subscription_toggle.haml +22 -0
  504. data/app/views/integral/backend/shared/action_bar/_index.haml +9 -0
  505. data/app/views/integral/backend/shared/action_bar/_show.haml +3 -0
  506. data/app/views/integral/backend/shared/cards/_at_a_glance.haml +3 -3
  507. data/app/views/integral/backend/shared/cards/_categories.haml +33 -0
  508. data/app/views/integral/backend/{static_pages/_card.haml → shared/cards/_object.haml} +1 -1
  509. data/app/views/integral/backend/shared/cards/_recent_activity.haml +20 -0
  510. data/app/views/integral/backend/shared/cards/_recent_resources.haml +17 -0
  511. data/app/views/integral/backend/shared/cards/_recent_user_activity.haml +1 -0
  512. data/app/views/integral/backend/shared/cards/_top_post_authors.haml +18 -0
  513. data/app/views/integral/backend/shared/cards/_welcome.haml +24 -25
  514. data/app/views/integral/backend/shared/{_empty_grid.haml → grid/_empty.haml} +0 -0
  515. data/app/views/integral/backend/shared/grid/_form.haml +9 -0
  516. data/app/views/integral/backend/shared/grid/_grid.haml +21 -0
  517. data/app/views/integral/backend/shared/{_pagination.haml → grid/_pagination.haml} +0 -0
  518. data/app/views/integral/backend/shared/grid/_row_layout.haml +8 -0
  519. data/app/views/integral/backend/shared/record_selector/_collection.haml +1 -0
  520. data/app/views/integral/backend/shared/record_selector/_modal.haml +9 -10
  521. data/app/views/integral/backend/shared/record_selector/_record.haml +6 -4
  522. data/app/views/integral/backend/static_pages/dashboard.haml +17 -16
  523. data/app/views/integral/backend/users/_form.haml +35 -47
  524. data/app/views/integral/backend/users/edit.haml +1 -1
  525. data/app/views/integral/backend/users/grid/_dropdown_actions.haml +17 -0
  526. data/app/views/integral/backend/users/grid/_row_content.haml +8 -0
  527. data/app/views/integral/backend/users/index.haml +11 -17
  528. data/app/views/integral/backend/users/list.haml +12 -0
  529. data/app/views/integral/backend/users/show.haml +22 -19
  530. data/app/views/integral/categories/show.haml +5 -0
  531. data/app/views/integral/posts/_article_footer.haml +17 -0
  532. data/app/views/integral/posts/_card.haml +11 -0
  533. data/app/views/integral/posts/_latest_post.haml +8 -0
  534. data/app/views/integral/posts/_most_read_section.haml +8 -0
  535. data/app/views/integral/posts/_post.haml +11 -0
  536. data/app/views/integral/posts/_similar_posts.haml +5 -0
  537. data/app/views/integral/posts/index.haml +7 -5
  538. data/app/views/integral/posts/templates/default.haml +35 -35
  539. data/app/views/integral/shared/_share_modal.haml +0 -3
  540. data/app/views/integral/shared/_social_list_items.haml +6 -12
  541. data/app/views/integral/shared/_subscribe_modal.haml +14 -0
  542. data/app/views/integral/shared/blog/_categories.haml +15 -0
  543. data/app/views/integral/shared/blog/_layout.haml +9 -0
  544. data/app/views/integral/shared/blog/_sidebar.haml +10 -0
  545. data/app/views/integral/shared/gallery/_placeholder.haml +1 -1
  546. data/app/views/integral/shared/gallery/_slide.haml +2 -2
  547. data/app/views/integral/shared/gallery/gallery.haml +5 -2
  548. data/app/views/integral/shared/sidebar/_item.haml +8 -0
  549. data/app/views/integral/shared/sidebar/_newsletter_signup.haml +7 -0
  550. data/app/views/integral/shared/sidebar/_popular_posts.haml +7 -0
  551. data/app/views/integral/shared/sidebar/_popular_tags.haml +7 -0
  552. data/app/views/integral/shared/sidebar/_recent_posts.haml +7 -0
  553. data/app/views/integral/tags/index.haml +2 -2
  554. data/app/views/integral/tags/show.haml +3 -6
  555. data/app/views/layouts/integral/backend.html.haml +27 -5
  556. data/app/views/layouts/integral/backend/_create_dropdown.haml +1 -30
  557. data/app/views/layouts/integral/backend/_main_menu_items.haml +1 -91
  558. data/app/views/layouts/integral/frontend.html.haml +3 -3
  559. data/config/initializers/devise.rb +1 -1
  560. data/config/locales/en.yml +127 -55
  561. data/config/routes.rb +2 -0
  562. data/db/migrate/20190414172018_create_webhook_endpoints.rb +10 -0
  563. data/db/migrate/20190929191412_add_integral_post_categories.rb +13 -0
  564. data/db/migrate/20191203090008_add_image_to_integral_categories.rb +6 -0
  565. data/db/migrate/20200401210442_create_category_versions.rb +20 -0
  566. data/db/migrate/20200407022636_create_integral_notifications.rb +25 -0
  567. data/db/migrate/20200421223602_add_status_to_integral_users.rb +5 -0
  568. data/db/seeds.rb +15 -9
  569. data/lib/generators/integral/assets_generator.rb +2 -2
  570. data/lib/generators/integral/install_generator.rb +1 -1
  571. data/lib/generators/integral/views_generator.rb +1 -1
  572. data/lib/generators/templates/app.yml +0 -1
  573. data/lib/generators/templates/integral.rb +5 -0
  574. data/lib/integral.rb +4 -30
  575. data/lib/integral/acts_as_integral.rb +115 -0
  576. data/lib/integral/acts_as_listable.rb +3 -3
  577. data/lib/integral/chart_renderer/base.rb +2 -0
  578. data/lib/integral/content_renderer.rb +2 -2
  579. data/lib/integral/engine.rb +12 -2
  580. data/lib/integral/grids/activities_grid.rb +15 -2
  581. data/lib/integral/grids/lists_grid.rb +1 -0
  582. data/lib/integral/grids/posts_grid.rb +5 -1
  583. data/lib/integral/grids/users_grid.rb +5 -0
  584. data/lib/integral/list_item_renderer.rb +4 -2
  585. data/lib/integral/list_renderer.rb +6 -1
  586. data/lib/integral/middleware/page_router.rb +15 -6
  587. data/lib/integral/router.rb +42 -8
  588. data/lib/integral/version.rb +1 -1
  589. data/lib/integral/widgets/swiper_list.rb +3 -2
  590. data/public/images/integral/demo/continous-integration.png +0 -0
  591. data/public/images/integral/demo/foundation-frontend-framework.jpg +0 -0
  592. data/public/images/integral/demo/heroku.png +0 -0
  593. data/public/images/integral/demo/integral-cms-without-hassle.jpg +0 -0
  594. data/public/images/integral/demo/integral-features-activity-tracking.jpg +0 -0
  595. data/public/images/integral/demo/integral-features-contact-form.png +0 -0
  596. data/public/images/integral/demo/integral-features-design.jpg +0 -0
  597. data/public/images/integral/demo/integral-features-dynamic-pages.jpg +0 -0
  598. data/public/images/integral/demo/integral-features-image-management.jpg +0 -0
  599. data/public/images/integral/demo/integral-features-integrated-blog.jpg +0 -0
  600. data/public/images/integral/demo/integral-features-list-management.jpg +0 -0
  601. data/public/images/integral/demo/integral-features-seo-ready.jpg +0 -0
  602. data/public/images/integral/demo/integral-features-user-management.jpg +0 -0
  603. data/public/images/integral/demo/integral-presentation.png +0 -0
  604. data/public/integral/ckeditor_demo_content.html +0 -13
  605. data/spec/factories.rb +30 -8
  606. metadata +305 -113
  607. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/jp.js +0 -13
  608. data/app/assets/javascripts/integral/support/date_picker/picker.date.js +0 -1435
  609. data/app/assets/javascripts/integral/support/date_picker/picker.js +0 -1132
  610. data/app/assets/stylesheets/integral/frontend.sass +0 -26
  611. data/app/assets/stylesheets/integral/support/date-picker.scss +0 -16
  612. data/app/assets/stylesheets/integral/support/date_picker/_default.date.scss +0 -452
  613. data/app/assets/stylesheets/integral/support/date_picker/_default.scss +0 -201
  614. data/app/assets/stylesheets/integral/support/date_picker/materialize_clockpicker.sass +0 -220
  615. data/app/views/devise/mailer/invitation_instructions.html.erb +0 -13
  616. data/app/views/integral/backend/activities/_grid.haml +0 -23
  617. data/app/views/integral/backend/activities/shared/_listing.haml +0 -14
  618. data/app/views/integral/backend/images/_grid.haml +0 -16
  619. data/app/views/integral/backend/lists/_grid.haml +0 -14
  620. data/app/views/integral/backend/pages/_grid.haml +0 -21
  621. data/app/views/integral/backend/pages/activities.haml +0 -2
  622. data/app/views/integral/backend/pages/activity.haml +0 -1
  623. data/app/views/integral/backend/pages/edit.html.haml +0 -15
  624. data/app/views/integral/backend/posts/_grid.haml +0 -25
  625. data/app/views/integral/backend/posts/activities.haml +0 -3
  626. data/app/views/integral/backend/posts/activity.haml +0 -1
  627. data/app/views/integral/backend/shared/_grid.haml +0 -18
  628. data/app/views/integral/backend/users/_grid.haml +0 -19
  629. data/app/views/integral/posts/_collection.haml +0 -4
  630. data/app/views/integral/posts/_item.haml +0 -16
  631. data/app/views/integral/shared/_blog_layout.haml +0 -15
  632. data/app/views/integral/shared/_blog_sidebar.haml +0 -49
  633. data/lib/integral/slack_bot.rb +0 -45
@@ -1,1132 +0,0 @@
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
-