spina 0.12.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of spina might be problematic. Click here for more details.

Files changed (210) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +65 -7
  3. data/app/assets/fonts/spina/ics_spina.eot +0 -0
  4. data/app/assets/fonts/spina/ics_spina.svg +65 -61
  5. data/app/assets/fonts/spina/ics_spina.ttf +0 -0
  6. data/app/assets/fonts/spina/ics_spina.woff +0 -0
  7. data/app/assets/fonts/spina/ics_spina.woff2 +0 -0
  8. data/app/assets/icons/spina/export.svg +10 -0
  9. data/app/assets/icons/spina/preview/ics_spina-preview.html +17 -1
  10. data/app/assets/images/spina/media_folder_placeholder.png +0 -0
  11. data/app/assets/images/spina/{admin/spina.png → spina-large.png} +0 -0
  12. data/app/assets/javascripts/spina/admin/application.js +50 -0
  13. data/app/assets/javascripts/spina/admin/controllers/infinite_scroll_controller.js +40 -0
  14. data/app/assets/javascripts/spina/admin/media_gallery.coffee +65 -0
  15. data/app/assets/javascripts/spina/admin/modal.coffee +0 -1
  16. data/app/assets/javascripts/spina/admin/pages.coffee.erb +2 -2
  17. data/app/assets/javascripts/spina/admin/{application.coffee.erb → scaffold.coffee} +20 -61
  18. data/app/assets/javascripts/spina/admin/trix.coffee.erb +5 -8
  19. data/app/assets/javascripts/spina/admin/uploads.coffee +2 -2
  20. data/app/assets/stylesheets/spina.sass +3 -3
  21. data/app/assets/stylesheets/spina/_buttons.sass +0 -1
  22. data/app/assets/stylesheets/spina/{_configuration.sass → _configuration.sass.erb} +5 -1
  23. data/app/assets/stylesheets/spina/_forms.sass +79 -20
  24. data/app/assets/stylesheets/spina/_gallery.sass +91 -3
  25. data/app/assets/stylesheets/spina/_ics_spina.scss +1 -0
  26. data/app/assets/stylesheets/spina/_tables.sass +4 -0
  27. data/app/assets/stylesheets/spina/_trix.sass +7 -4
  28. data/app/assets/stylesheets/spina_front_end.sass +19 -0
  29. data/app/controllers/concerns/spina/frontend.rb +29 -12
  30. data/app/controllers/spina/admin/admin_controller.rb +1 -1
  31. data/app/controllers/spina/admin/attachments_controller.rb +10 -5
  32. data/app/controllers/spina/admin/images_controller.rb +51 -0
  33. data/app/controllers/spina/admin/media_folders_controller.rb +37 -0
  34. data/app/controllers/spina/admin/media_picker_controller.rb +28 -0
  35. data/app/controllers/spina/admin/pages_controller.rb +16 -6
  36. data/app/controllers/spina/admin/resources_controller.rb +33 -0
  37. data/app/controllers/spina/admin/settings_controller.rb +56 -0
  38. data/app/controllers/spina/pages_controller.rb +0 -6
  39. data/app/helpers/spina/admin/pages_helper.rb +2 -2
  40. data/app/helpers/spina/admin_nav_helper.rb +7 -0
  41. data/app/helpers/spina/files_helper.rb +9 -0
  42. data/app/helpers/spina/images_helper.rb +17 -0
  43. data/app/helpers/spina/pages_helper.rb +17 -0
  44. data/app/models/concerns/spina/image_collectable.rb +23 -0
  45. data/app/models/concerns/spina/part.rb +7 -4
  46. data/app/models/spina/account.rb +10 -14
  47. data/app/models/spina/attachment.rb +8 -10
  48. data/app/models/spina/attachment_collection.rb +6 -1
  49. data/app/models/spina/current.rb +5 -0
  50. data/app/models/spina/image.rb +26 -0
  51. data/app/models/spina/{photo_collection.rb → image_collection.rb} +6 -6
  52. data/app/models/spina/image_collections_image.rb +6 -0
  53. data/app/models/spina/line.rb +1 -0
  54. data/app/models/spina/media_folder.rb +7 -0
  55. data/app/models/spina/navigation.rb +4 -0
  56. data/app/models/spina/navigation_item.rb +1 -1
  57. data/app/models/spina/page.rb +18 -13
  58. data/app/models/spina/page_part.rb +1 -0
  59. data/app/models/spina/resource.rb +16 -0
  60. data/app/models/spina/setting.rb +7 -0
  61. data/app/models/spina/structure.rb +2 -0
  62. data/app/models/spina/structure_item.rb +2 -0
  63. data/app/models/spina/structure_part.rb +2 -1
  64. data/app/models/spina/text.rb +1 -0
  65. data/app/views/dummy/show.html.haml +1 -0
  66. data/app/views/layouts/spina/admin/media_library.html.haml +6 -3
  67. data/app/views/layouts/spina/admin/pages.html.haml +4 -1
  68. data/app/views/layouts/spina/admin/resources.html.haml +10 -0
  69. data/app/views/spina/admin/accounts/style.html.haml +3 -2
  70. data/app/views/spina/admin/attachments/_attachment.html.haml +3 -3
  71. data/app/views/spina/admin/attachments/_select.html.haml +7 -15
  72. data/app/views/spina/admin/attachments/_select_collection.html.haml +7 -14
  73. data/app/views/spina/admin/attachments/create.js.erb +1 -3
  74. data/app/views/spina/admin/attachments/index.html.haml +4 -3
  75. data/app/views/spina/admin/attachments/insert.js.erb +5 -0
  76. data/app/views/spina/admin/image_collections/_image_collection.html.haml +5 -0
  77. data/app/views/spina/admin/images/_form.html.haml +5 -0
  78. data/app/views/spina/admin/images/_image.html.haml +10 -0
  79. data/app/views/spina/admin/images/create.js.erb +8 -0
  80. data/app/views/spina/admin/images/index.html.haml +22 -0
  81. data/app/views/spina/admin/images/index.js.erb +7 -0
  82. data/app/views/spina/admin/media_folders/_form.html.haml +14 -0
  83. data/app/views/spina/admin/media_folders/_media_folder.html.haml +8 -0
  84. data/app/views/spina/admin/media_folders/new.js.erb +1 -0
  85. data/app/views/spina/admin/media_folders/show.html.haml +17 -0
  86. data/app/views/spina/admin/media_picker/_modal.html.haml +26 -0
  87. data/app/views/spina/admin/media_picker/infinite_scroll.js.erb +5 -0
  88. data/app/views/spina/admin/media_picker/select.js.erb +28 -0
  89. data/app/views/spina/admin/media_picker/show.js.erb +1 -0
  90. data/app/views/spina/admin/navigations/_page.html.haml +2 -2
  91. data/app/views/spina/admin/navigations/edit.html.haml +1 -1
  92. data/app/views/spina/admin/pages/_form.html.haml +21 -15
  93. data/app/views/spina/admin/pages/_form_advanced.html.haml +53 -43
  94. data/app/views/spina/admin/pages/_form_page_content.html.haml +1 -1
  95. data/app/views/spina/admin/pages/_form_page_seo.html.haml +1 -1
  96. data/app/views/spina/admin/pages/_page_nested_list.html.haml +3 -3
  97. data/app/views/spina/admin/pages/index.html.haml +1 -1
  98. data/app/views/spina/admin/{page_partables → partables}/attachment_collections/_form.html.haml +1 -1
  99. data/app/views/spina/admin/{page_partables → partables}/attachments/_form.html.haml +4 -4
  100. data/app/views/spina/admin/partables/image_collections/_form.html.haml +16 -0
  101. data/app/views/spina/admin/partables/images/_form.html.haml +14 -0
  102. data/app/views/spina/admin/{page_partables → partables}/lines/_form.html.haml +1 -1
  103. data/app/views/spina/admin/{structure_partables → partables}/options/_form.html.haml +1 -1
  104. data/app/views/spina/admin/partables/photo_collections/_form.html.haml +4 -0
  105. data/app/views/spina/admin/partables/photos/_form.html.haml +4 -0
  106. data/app/views/spina/admin/{page_partables → partables}/structures/_form.html.haml +3 -3
  107. data/app/views/spina/admin/{page_partables → partables}/texts/_form.html.haml +1 -1
  108. data/app/views/spina/admin/password_resets/edit.html.haml +1 -1
  109. data/app/views/spina/admin/password_resets/new.html.haml +1 -1
  110. data/app/views/spina/admin/resources/edit.html.haml +49 -0
  111. data/app/views/spina/admin/resources/show.html.haml +14 -0
  112. data/app/views/spina/admin/sessions/new.html.haml +1 -1
  113. data/app/views/spina/admin/settings/_string_field.html.haml +4 -0
  114. data/app/views/spina/admin/settings/_wysiwyg_field.html.haml +4 -0
  115. data/app/views/spina/admin/settings/edit.html.haml +13 -0
  116. data/app/views/spina/admin/shared/_primary_navigation.html.haml +13 -5
  117. data/app/views/spina/admin/shared/_rich_text_field.html.haml +10 -10
  118. data/app/views/spina/admin/structure_items/_fields.html.haml +1 -1
  119. data/app/views/spina/admin/structure_partables/attachment_collections/_form.html.haml +14 -0
  120. data/app/views/spina/admin/structure_partables/attachments/_form.html.haml +13 -0
  121. data/app/views/spina/shared/_analytics.html.erb +8 -8
  122. data/app/views/spina/shared/_navigation.html.haml +3 -3
  123. data/app/views/spina/shared/_spina_link.html.haml +2 -0
  124. data/app/views/spina/sitemaps/show.xml.builder +2 -2
  125. data/config/initializers/assets.rb +6 -1
  126. data/config/locales/TH.yml +243 -0
  127. data/config/locales/bg.yml +250 -0
  128. data/config/locales/de.yml +67 -22
  129. data/config/locales/en.yml +29 -2
  130. data/config/locales/es.yml +58 -1
  131. data/config/locales/fr.yml +80 -32
  132. data/config/locales/id.yml +228 -0
  133. data/config/locales/nl.yml +32 -0
  134. data/config/locales/pl.yml +225 -0
  135. data/config/locales/pt-BR.yml +34 -3
  136. data/config/locales/ro.yml +225 -0
  137. data/config/locales/ru.yml +10 -0
  138. data/config/locales/sv.yml +223 -0
  139. data/config/routes.rb +13 -13
  140. data/db/migrate/10_create_spina_image_collections.rb +16 -0
  141. data/db/migrate/11_create_spina_resources.rb +15 -0
  142. data/db/migrate/1_create_spina_tables.rb +0 -19
  143. data/db/migrate/2_create_spina_translation_tables.rb +36 -6
  144. data/db/migrate/7_create_spina_settings.rb +11 -0
  145. data/db/migrate/8_create_spina_media_folders.rb +8 -0
  146. data/db/migrate/9_create_spina_images.rb +10 -0
  147. data/lib/generators/spina/install_generator.rb +2 -2
  148. data/lib/generators/spina/templates/app/views/default/pages/homepage.html.haml +3 -2
  149. data/lib/generators/spina/templates/app/views/default/pages/show.html.haml +2 -2
  150. data/lib/generators/spina/templates/app/views/default/shared/_navigation.html.haml +3 -5
  151. data/lib/generators/spina/templates/app/views/demo/pages/demo.html.haml +20 -23
  152. data/lib/generators/spina/templates/app/views/demo/pages/homepage.html.haml +2 -2
  153. data/lib/generators/spina/templates/app/views/demo/pages/show.html.haml +2 -2
  154. data/lib/generators/spina/templates/app/views/demo/shared/_navigation.html.haml +3 -5
  155. data/lib/generators/spina/templates/config/initializers/mobility.rb +6 -0
  156. data/lib/generators/spina/templates/config/initializers/spina.rb +3 -0
  157. data/lib/generators/spina/templates/config/initializers/themes/demo.rb +7 -7
  158. data/lib/spina.rb +0 -1
  159. data/lib/spina/engine.rb +6 -7
  160. data/lib/spina/plugin.rb +48 -3
  161. data/lib/spina/version.rb +1 -1
  162. data/vendor/assets/javascripts/spina/stimulus.umd.js +5 -0
  163. data/vendor/assets/javascripts/spina/trix.js +10 -9
  164. metadata +106 -103
  165. data/app/assets/images/spina/danger-zone-ribbon.png +0 -0
  166. data/app/assets/images/spina/spina_small.png +0 -0
  167. data/app/assets/javascripts/spina/admin/infinite_scroll.coffee +0 -25
  168. data/app/controllers/spina/admin/photos_controller.rb +0 -100
  169. data/app/models/concerns/spina/photo_collectable.rb +0 -24
  170. data/app/models/spina/photo.rb +0 -29
  171. data/app/models/spina/photo_collections_photo.rb +0 -6
  172. data/app/presenters/spina/pages/menu_presenter.rb +0 -63
  173. data/app/uploaders/spina/default_store_uploader.rb +0 -15
  174. data/app/uploaders/spina/file_uploader.rb +0 -6
  175. data/app/uploaders/spina/logo_uploader.rb +0 -13
  176. data/app/uploaders/spina/photo_uploader.rb +0 -23
  177. data/app/views/spina/admin/attachments/_fields.html.haml +0 -8
  178. data/app/views/spina/admin/attachments/insert.js.coffee +0 -5
  179. data/app/views/spina/admin/page_partables/options/_form.html.haml +0 -6
  180. data/app/views/spina/admin/page_partables/photo_collections/_form.html.haml +0 -17
  181. data/app/views/spina/admin/page_partables/photos/_form.html.haml +0 -14
  182. data/app/views/spina/admin/photos/_photo.html.haml +0 -8
  183. data/app/views/spina/admin/photos/_photo_collection.html.haml +0 -5
  184. data/app/views/spina/admin/photos/_photo_collection_select.html.haml +0 -23
  185. data/app/views/spina/admin/photos/_photo_link.html.haml +0 -11
  186. data/app/views/spina/admin/photos/_photo_multi_picker.html.haml +0 -3
  187. data/app/views/spina/admin/photos/_photo_select.html.haml +0 -16
  188. data/app/views/spina/admin/photos/_photo_single_picker.html.haml +0 -3
  189. data/app/views/spina/admin/photos/_photo_uploaded.html.haml +0 -4
  190. data/app/views/spina/admin/photos/_trix_select.html.haml +0 -11
  191. data/app/views/spina/admin/photos/create.js.erb +0 -4
  192. data/app/views/spina/admin/photos/index.html.haml +0 -13
  193. data/app/views/spina/admin/photos/index.js.erb +0 -5
  194. data/app/views/spina/admin/photos/insert_photo.js.erb +0 -10
  195. data/app/views/spina/admin/photos/insert_photo_collection.js.erb +0 -25
  196. data/app/views/spina/admin/photos/link.js.erb +0 -2
  197. data/app/views/spina/admin/photos/multi_picker_infinite_scroll.js.erb +0 -6
  198. data/app/views/spina/admin/photos/photo_collection_select.js.erb +0 -3
  199. data/app/views/spina/admin/photos/photo_select.js.erb +0 -3
  200. data/app/views/spina/admin/photos/single_picker_infinite_scroll.js.erb +0 -6
  201. data/app/views/spina/admin/photos/trix_infinite_scroll.js.erb +0 -4
  202. data/app/views/spina/admin/photos/trix_insert.js.erb +0 -2
  203. data/app/views/spina/admin/photos/trix_select.js.erb +0 -3
  204. data/app/views/spina/admin/structure_partables/lines/_form.html.haml +0 -5
  205. data/app/views/spina/admin/structure_partables/photo_collections/_form.html.haml +0 -17
  206. data/app/views/spina/admin/structure_partables/photos/_form.html.haml +0 -11
  207. data/app/views/spina/admin/structure_partables/texts/_form.html.haml +0 -5
  208. data/config/initializers/spina.rb +0 -0
  209. data/lib/generators/spina/templates/config/initializers/carrierwave.rb +0 -17
  210. data/lib/spina/railtie.rb +0 -9
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="256px" height="256px" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
4
+ <title>Shape</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <path d="M256,16 L256,96 C256,104.836 248.837,112 240,112 C231.163,112 224,104.836 224,96 L224,54.628 L139.313,139.314 C136.189,142.438 132.093,144.001 128,144.001 C123.905,144.001 119.811,142.439 116.687,139.314 C110.438,133.066 110.438,122.935 116.687,116.687 L201.374,32 L160,32 C151.163,32 144,24.836 144,16 C144,7.164 151.163,0 160,0 L240,0 C248.837,0 256,7.164 256,16 Z M208,256 C216.837,256 224,248.836 224,240 L224,160 C224,151.164 216.837,144 208,144 C199.163,144 192,151.164 192,160 L192,224 L32,224 L32,64 L96,64 C104.837,64 112,56.836 112,48 C112,39.164 104.837,32 96,32 L16,32 C7.163,32 0,39.164 0,48 L0,240 C0,248.836 7.163,256 16,256 L208,256 Z" id="Shape" fill="#797C7C" fill-rule="nonzero"></path>
9
+ </g>
10
+ </svg>
@@ -143,6 +143,7 @@
143
143
  font-family: "ics_spina";
144
144
  src: url("../../../fonts/spina/ics_spina.eot");
145
145
  src: url("../../../fonts/spina/ics_spina.eot?#iefix") format("embedded-opentype"),
146
+ url("../../../fonts/spina/ics_spina.woff2") format("woff2"),
146
147
  url("../../../fonts/spina/ics_spina.woff") format("woff"),
147
148
  url("../../../fonts/spina/ics_spina.ttf") format("truetype"),
148
149
  url("../../../fonts/spina/ics_spina.svg#ics_spina") format("svg");
@@ -185,6 +186,7 @@
185
186
  .icon-document:before,
186
187
  .icon-dots:before,
187
188
  .icon-exclamation:before,
189
+ .icon-export:before,
188
190
  .icon-eye:before,
189
191
  .icon-filter:before,
190
192
  .icon-home:before,
@@ -256,6 +258,7 @@
256
258
  .icon-document:before { content: "\f116"; }
257
259
  .icon-dots:before { content: "\f117"; }
258
260
  .icon-exclamation:before { content: "\f118"; }
261
+ .icon-export:before { content: "\f139"; }
259
262
  .icon-eye:before { content: "\f119"; }
260
263
  .icon-filter:before { content: "\f11a"; }
261
264
  .icon-home:before { content: "\f11b"; }
@@ -303,7 +306,7 @@
303
306
  <body class="characters-off">
304
307
  <div id="page" class="container">
305
308
  <header>
306
- <h1>ics_spina contains 57 glyphs:</h1>
309
+ <h1>ics_spina contains 58 glyphs:</h1>
307
310
  <a onclick="toggleCharacters(); return false;" href="#">Toggle Preview Characters</a>
308
311
  </header>
309
312
 
@@ -633,6 +636,19 @@
633
636
  </div>
634
637
  </div>
635
638
 
639
+ <div class="glyph">
640
+ <div class="preview-glyphs">
641
+ <span class="step size-12"><span class="letters">Pp</span><i id="icon-export" class="icon-export"></i></span><span class="step size-14"><span class="letters">Pp</span><i id="icon-export" class="icon-export"></i></span><span class="step size-16"><span class="letters">Pp</span><i id="icon-export" class="icon-export"></i></span><span class="step size-18"><span class="letters">Pp</span><i id="icon-export" class="icon-export"></i></span><span class="step size-21"><span class="letters">Pp</span><i id="icon-export" class="icon-export"></i></span><span class="step size-24"><span class="letters">Pp</span><i id="icon-export" class="icon-export"></i></span><span class="step size-36"><span class="letters">Pp</span><i id="icon-export" class="icon-export"></i></span><span class="step size-48"><span class="letters">Pp</span><i id="icon-export" class="icon-export"></i></span><span class="step size-60"><span class="letters">Pp</span><i id="icon-export" class="icon-export"></i></span><span class="step size-72"><span class="letters">Pp</span><i id="icon-export" class="icon-export"></i></span>
642
+ </div>
643
+ <div class="preview-scale">
644
+ <span class="step">12</span><span class="step">14</span><span class="step">16</span><span class="step">18</span><span class="step">21</span><span class="step">24</span><span class="step">36</span><span class="step">48</span><span class="step">60</span><span class="step">72</span>
645
+ </div>
646
+ <div class="usage">
647
+ <input class="class" type="text" readonly="readonly" onClick="this.select();" value=".icon-export" />
648
+ <input class="point" type="text" readonly="readonly" onClick="this.select();" value="&amp;#xf139;" />
649
+ </div>
650
+ </div>
651
+
636
652
  <div class="glyph">
637
653
  <div class="preview-glyphs">
638
654
  <span class="step size-12"><span class="letters">Pp</span><i id="icon-eye" class="icon-eye"></i></span><span class="step size-14"><span class="letters">Pp</span><i id="icon-eye" class="icon-eye"></i></span><span class="step size-16"><span class="letters">Pp</span><i id="icon-eye" class="icon-eye"></i></span><span class="step size-18"><span class="letters">Pp</span><i id="icon-eye" class="icon-eye"></i></span><span class="step size-21"><span class="letters">Pp</span><i id="icon-eye" class="icon-eye"></i></span><span class="step size-24"><span class="letters">Pp</span><i id="icon-eye" class="icon-eye"></i></span><span class="step size-36"><span class="letters">Pp</span><i id="icon-eye" class="icon-eye"></i></span><span class="step size-48"><span class="letters">Pp</span><i id="icon-eye" class="icon-eye"></i></span><span class="step size-60"><span class="letters">Pp</span><i id="icon-eye" class="icon-eye"></i></span><span class="step size-72"><span class="letters">Pp</span><i id="icon-eye" class="icon-eye"></i></span>
@@ -0,0 +1,50 @@
1
+ // jQuery
2
+
3
+ //= require jquery
4
+ //= require jquery_ujs
5
+
6
+ // Turbolinks
7
+
8
+ //= require turbolinks
9
+
10
+ // Stimulus
11
+
12
+ //= require spina/stimulus.umd
13
+ //= require_tree ./controllers
14
+
15
+ // File Upload
16
+
17
+ //= require activestorage
18
+ //= require spina/jquery.customfileinput
19
+
20
+ // jQuery Plugins
21
+
22
+ //= require spina/jquery.ui
23
+ //= require spina/jquery.nestable
24
+
25
+ // Misc Plugins
26
+
27
+ //= require spina/sortable
28
+ //= require spina/trix
29
+
30
+ // Spina's code
31
+
32
+ //= require ./switch
33
+ //= require ./modal
34
+ //= require ./tabs
35
+ //= require ./forms
36
+ //= require ./dropdown
37
+ //= require ./galleryselect
38
+ //= require ./navigation
39
+ //= require ./notifications
40
+ //= require ./media_gallery
41
+
42
+ //= require ./account
43
+ //= require ./confirm_delete
44
+ //= require ./pages
45
+
46
+ //= require ./trix
47
+
48
+ // Scaffolding
49
+
50
+ //= require ./scaffold
@@ -0,0 +1,40 @@
1
+ (() => {
2
+ const application = Stimulus.Application.start()
3
+
4
+ application.register("infinite-scroll", class extends Stimulus.Controller {
5
+ static get targets() {
6
+ return ["link"]
7
+ }
8
+
9
+ connect() {
10
+ // Disable scroll event listeners
11
+ $(window).off('scroll.infiniteScroll')
12
+ $('#overlay section').off('scroll.infiniteScroll')
13
+
14
+ let $link = $(this.linkTarget)
15
+
16
+ // If the link has an actual href
17
+ if ($link.attr('href').length > 0) {
18
+ // If the window scrolls
19
+ $(window).on('scroll.infiniteScroll', this.loadNextPage($link))
20
+
21
+ // If the overlay scrolls
22
+ $('#overlay section').on('scroll.infiniteScroll', function() {
23
+ $(window).trigger('scroll.infiniteScroll')
24
+ })
25
+
26
+ $(window).trigger('scroll.infiniteScroll')
27
+ }
28
+ }
29
+
30
+ loadNextPage(link) {
31
+ if ($(window).scrollTop() > link.offset().top - $(window).height() - 500) {
32
+ $(window).off('scroll.infiniteScroll')
33
+ $('#overlay section').off('scroll.infiniteScroll')
34
+ $.rails.disableElement(link)
35
+ $.getScript(link.attr('href'))
36
+ }
37
+ }
38
+
39
+ })
40
+ })()
@@ -0,0 +1,65 @@
1
+ $(document).on 'direct-uploads:start', 'form', (e) ->
2
+ $(this).find('.customfile').addClass('loading')
3
+
4
+ $(document).on 'direct-uploads:end', 'form', (e) ->
5
+ $(this).find('.customfile').removeClass('loading')
6
+
7
+ $(document).on 'direct-upload:progress', 'input', (e) ->
8
+ console.log(e.detail.progress)
9
+
10
+ $(document).on 'change', 'input[type="file"]', (e) ->
11
+ $form = $(this).parents('form')
12
+ $form.find('input[type="submit"]').click()
13
+
14
+ $(document).on 'click', '.organize-switch', (e) ->
15
+ $items = $('.gallery .infinite-scroll .item')
16
+ disabled = $items.draggable('option', 'disabled')
17
+ if disabled
18
+ $(this).addClass('button-success')
19
+ $(this).text($(this).attr('data-done-organizing'))
20
+ $(this).prepend('<i class="icon icon-random"></i>')
21
+ else
22
+ $(this).removeClass('button-success')
23
+ $(this).text($(this).attr('data-organize-images'))
24
+ $(this).prepend('<i class="icon icon-random"></i>')
25
+ $items.draggable('option', 'disabled', !disabled)
26
+ e.preventDefault()
27
+
28
+ ready = ->
29
+ $('.media-folder').droppable(
30
+ drop: (event, ui) ->
31
+ url = $(this).attr('data-add-to-media-folder-url')
32
+ image_id = $(ui.draggable).find('input[type="radio"]').val()
33
+
34
+ $.ajax
35
+ url: url,
36
+ type: 'PUT',
37
+ data: {
38
+ image_id: image_id
39
+ },
40
+ dataType: 'json',
41
+ success: (result) =>
42
+ $(ui.draggable).addClass('dropped').fadeOut()
43
+ imageCount = parseInt($(this).find('.media-folder-thumbnail').attr('data-badge'))
44
+ imgSrc = $(ui.draggable).find('img').attr('src')
45
+
46
+ $(this).removeClass('dropping')
47
+ $(this).find('.media-folder-thumbnail').attr('data-badge', imageCount + 1)
48
+ $(this).find('.media-folder-thumbnail img').attr('src', imgSrc)
49
+
50
+ over: (event, ui) ->
51
+ $(ui.draggable).addClass('dropping')
52
+
53
+ $(this).addClass('dropping')
54
+ out: (event, ui) ->
55
+ $(ui.draggable).removeClass('dropping')
56
+
57
+ $(this).removeClass('dropping')
58
+ )
59
+
60
+ $('.gallery .infinite-scroll .item').draggable(
61
+ revert: 'invalid',
62
+ disabled: true
63
+ )
64
+
65
+ $(document).on 'turbolinks:load', ready
@@ -48,7 +48,6 @@ showModal = (element) ->
48
48
  modal.show()
49
49
 
50
50
  modal.find('input[type="file"][data-customfileinput]').customFileInput()
51
- modal.find('.new_photo').uploadPhoto()
52
51
 
53
52
  $('body').addClass('overlay')
54
53
  return false
@@ -10,8 +10,8 @@ ready = ->
10
10
  $('.sortable-grid').sortable().bind 'sortupdate', (e) ->
11
11
  position_array = []
12
12
  $(e.target).find('li.image').each (index) ->
13
- position_array.push $(this).data('photo-id')
14
- $(e.target).parents('.horizontal-form-content').find('.photo-positions').val(position_array.join(","))
13
+ position_array.push $(this).data('image-id')
14
+ $(e.target).parents('.horizontal-form-content').find('.image-positions').val(position_array.join(","))
15
15
 
16
16
  $('.structure-form-menu ul').sortable().bind 'sortupdate', (e) ->
17
17
  $(e.target).find('li').each (index) ->
@@ -1,45 +1,5 @@
1
- # jQuery
2
-
3
- #= require jquery
4
- #= require jquery_ujs
5
-
6
- # Turbolinks
7
-
8
- #= require turbolinks
9
-
10
- # jQuery plugins
11
-
12
- #= require spina/jquery.ui
13
- #= require spina/jquery.nestable
14
- #= require spina/jquery.customfileinput
15
- #= require jquery-fileupload/basic
16
-
17
- # Misc plugins
18
-
19
- #= require spina/sortable
20
- #= require spina/trix
21
-
22
- # Own code
23
-
24
- #= require ./switch
25
- #= require ./modal
26
- #= require ./tabs
27
- #= require ./forms
28
- #= require ./dropdown
29
- #= require ./galleryselect
30
- #= require ./uploads
31
- #= require ./navigation
32
- #= require ./notifications
33
-
34
- #= require ./account
35
- #= require ./confirm_delete
36
- #= require ./pages
37
-
38
- #= require ./trix
39
- #= require ./infinite_scroll
40
-
41
1
  # Scaffold
42
- $(document).on 'click', '.table-clickable tbody tr', (e) ->
2
+ $(document).on 'click', '.table-clickable tr', (e) ->
43
3
  $row = $(this).closest('tr')
44
4
  link = $row.find('a.table-link:first')[0]
45
5
  if link
@@ -48,20 +8,27 @@ $(document).on 'click', '.table-clickable tbody tr', (e) ->
48
8
  checkbox = $(this).find('input[type="checkbox"]:first, input[type="radio"]:first')
49
9
 
50
10
  if checkbox.length > 0
51
- checkbox.prop("checked", !checkbox.prop("checked"))
52
- e.stopPropagation()
53
11
 
54
- $(document).on 'click', '.table-clickable tbody tr td', (e) ->
55
- checkbox = $(this).find('input[type="checkbox"]:first, input[type="radio"]:first')
12
+ # Get shifty
13
+ if !checkbox.prop("checked") && e.shiftKey
14
+ $firstRow = $('.table-clickable tr input[type="checkbox"]:checked:first').closest('tr')
15
+
16
+ if $firstRow.index() < $row.index()
17
+ $firstRow.nextUntil($row).each ->
18
+ $(this).find('input[type="checkbox"]:first').prop("checked", true)
19
+ else
20
+ $firstRow.prevUntil($row).each ->
21
+ $(this).find('input[type="checkbox"]:first').prop("checked", true)
22
+ document.getSelection().removeAllRanges()
56
23
 
57
- if checkbox.length > 0
58
- checkbox.prop("checked", !checkbox.prop("checked"))
59
- e.stopPropagation()
24
+ checkbox.prop("checked", !checkbox.prop("checked"))
25
+ checkbox.trigger('checked')
26
+ e.stopPropagation()
60
27
 
61
- $(document).on 'click', '.table-clickable tbody .table-link', (e) ->
28
+ $(document).on 'click', '.table-clickable .table-link', (e) ->
62
29
  e.stopPropagation()
63
30
 
64
- $(document).on 'click', '.table-clickable tbody tr input', (e) ->
31
+ $(document).on 'click', '.table-clickable tr input', (e) ->
65
32
  e.stopPropagation()
66
33
 
67
34
  # Search inputs
@@ -92,8 +59,6 @@ $(document).on 'change', '.dd', ->
92
59
  sort_url = $(this).data('sort-url')
93
60
  $.post sort_url, { list: serialized }
94
61
 
95
- # Datatables
96
-
97
62
  ready = ->
98
63
 
99
64
  # Set paddingTop for section#main
@@ -101,19 +66,13 @@ ready = ->
101
66
  headerHeight = header.getBoundingClientRect().height
102
67
  $('section#main').css({paddingTop: headerHeight})
103
68
 
69
+ # Login wrapper
70
+ $('#login_wrapper').css('margin-top', $(document).innerHeight() / 8)
71
+
104
72
  # Custom file
105
73
  $('input[type="file"][data-customfileinput]:visible').each ->
106
74
  $(this).customFileInput()
107
75
 
108
- # Image upload
109
- $('.new_photo').uploadPhoto()
110
-
111
- # Document upload
112
- $('.new_document').uploadDocument()
113
-
114
- # Login wrapper
115
- $('#login_wrapper').css('margin-top', $(document).innerHeight() / 8)
116
-
117
76
  $(".structure-form-menu ul").sortable
118
77
  handle: '.sortable-handle'
119
78
 
@@ -29,19 +29,16 @@ Trix.config.blockAttributes = $.extend Trix.config.blockAttributes, {
29
29
  }
30
30
 
31
31
  class Spina.TrixAttachment
32
- @photoSelect: (e) ->
33
- console.log 'hi'
32
+ @imageSelect: (e) ->
34
33
  editor_id = $(this).closest('trix-toolbar').data('trix-editor-id')
35
- $.get("<%= Spina::Engine.routes.url_helpers.trix_select_admin_photos_path('') %>/#{editor_id}")
34
+ $.get("<%= Spina::Engine.routes.url_helpers.admin_media_picker_path %>" + "?trix_editor_id=#{editor_id}")
36
35
 
37
- @photoInsert: (e, url) ->
38
- length = this.editor.getDocument().toString().length
39
- this.editor.setSelectedRange(length - 1)
36
+ @imageInsert: (e, url) ->
40
37
  this.editor.insertHTML "<img src='#{ url }' />"
41
38
 
42
39
  document.addEventListener 'trix-file-accept', (e) ->
43
40
  e.preventDefault()
44
41
 
45
- $(document).on 'click', '.js-trix-photo', Spina.TrixAttachment.photoSelect
42
+ $(document).on 'click', '.js-trix-image', Spina.TrixAttachment.imageSelect
46
43
 
47
- $(document).on 'photo-insert', 'trix-editor', Spina.TrixAttachment.photoInsert
44
+ $(document).on 'image-insert', 'trix-editor', Spina.TrixAttachment.imageInsert
@@ -12,7 +12,7 @@ $.fn.uploadPhoto = ->
12
12
  $(this).find('.customfile').addClass('loading')
13
13
  data.submit()
14
14
  else
15
- alert("#{file.name} is geen gif-, jpeg- of png-bestand")
15
+ alert("#{file.name} is not gif-, jpeg- or png- file")
16
16
  done: (e, data) ->
17
17
  $(this).find('.customfile').removeClass('loading')
18
18
 
@@ -30,6 +30,6 @@ $.fn.uploadDocument = ->
30
30
  $(this).find('.customfile').addClass('loading')
31
31
  data.submit()
32
32
  else
33
- alert("#{file.name} is geen pdf-, word-, txt- of rtf-bestand")
33
+ alert("#{file.name} is not pdf-, word-, txt- or rtf- file")
34
34
  done: (e, data) ->
35
35
  $(this).find('.customfile').removeClass('loading')
@@ -47,7 +47,7 @@ body
47
47
 
48
48
  // Primary navigation
49
49
  nav#primary
50
- background: linear-gradient(#3b3f74, #7a76ad)
50
+ background: linear-gradient($primary-color-dark, $primary-color-light)
51
51
  height: 100%
52
52
  overflow: hidden
53
53
  position: fixed
@@ -100,7 +100,7 @@ nav#primary
100
100
  opacity: 1
101
101
 
102
102
  ul li ul
103
- background: linear-gradient(#3b3f74, #7a76ad)
103
+ background: linear-gradient($primary-color-dark, $primary-color-light)
104
104
  bottom: 0
105
105
  left: 80px
106
106
  padding-top: 20px
@@ -132,7 +132,7 @@ nav#primary
132
132
  ul li ul li[data-badge]:after
133
133
  background: rgba(255, 255, 255, .4)
134
134
  border-radius: 9px
135
- color: #3b3f74
135
+ color: $primary-color-dark
136
136
  content: attr(data-badge)
137
137
  display: block
138
138
  font-size: 12px
@@ -26,7 +26,6 @@ button, input[type="submit"], input[type="button"]
26
26
 
27
27
  &:active, &.button-active, &.button-shaded, &.button-shaded:active
28
28
  background: shade(#efefef, 10%)
29
- transform: scale(0.95)
30
29
 
31
30
  &:focus
32
31
  outline: none
@@ -1,4 +1,8 @@
1
- $primary-color: #6865b4
1
+ // Configuration
2
+ $primary-color: <%= Spina.config.primary_color ? Spina.config.primary_color : '#6865b4' %>
3
+ $primary-color-dark: darken($primary-color, 21.4)
4
+ $primary-color-light: lighten($primary-color, 5.5)
5
+
2
6
  $success-color: #80b867
3
7
  $danger-color: #da3939
4
8
  $info-color: #17577c