card 1.18.6 → 1.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1469) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +3 -0
  3. data/README_Developers.rdoc +9 -9
  4. data/VERSION +1 -1
  5. data/card.gemspec +28 -31
  6. data/config/i18n-tasks.yml +126 -0
  7. data/config/initializers/01_core_extensions/hash.rb +4 -4
  8. data/config/initializers/01_core_extensions/module.rb +9 -0
  9. data/config/initializers/01_core_extensions/object.rb +5 -1
  10. data/config/initializers/02_extensions/kaminari.rb +1 -1
  11. data/config/initializers/inflections.rb +4 -4
  12. data/config/initializers/internationalization.rb +44 -0
  13. data/config/initializers/mime_types.rb +2 -2
  14. data/config/initializers/recaptcha.rb +10 -5
  15. data/config/initializers/uuid_state_file.rb +2 -2
  16. data/config/locales/de.yml +552 -0
  17. data/config/locales/en.yml +70 -0
  18. data/config/simplecov_helper.rb +70 -0
  19. data/db/migrate/20110511221913_require_earlier_migrations.rb +2 -2
  20. data/db/migrate/20120105203350_require_1_8_migrations.rb +1 -1
  21. data/db/migrate/20121111025347_require_1_10_migrations.rb +1 -1
  22. data/db/migrate/20121118115000_update_link_type.rb +7 -7
  23. data/db/migrate/20140822073704_create_new_revision_tables.rb +5 -5
  24. data/db/migrate/20141001105348_move_revisions_to_actions.rb +8 -8
  25. data/db/migrate/20141121172918_rename_card_migration_table.rb +2 -2
  26. data/db/migrate/20141216053032_better_index_names.rb +13 -13
  27. data/db/migrate/20160122153608_new_indeces.rb +5 -5
  28. data/db/migrate_core_cards/20120611203506_rails_inflection_updates.rb +5 -5
  29. data/db/migrate_core_cards/20130411191151_renaming_for_menu.rb +11 -11
  30. data/db/migrate_core_cards/20130411211600_delete_old_related_tab_cards.rb +7 -7
  31. data/db/migrate_core_cards/20130419215612_import_help_text.rb +4 -4
  32. data/db/migrate_core_cards/20130823192433_add_style_cards.rb +15 -15
  33. data/db/migrate_core_cards/20130910183318_move_styles_to_content.rb +3 -3
  34. data/db/migrate_core_cards/20130920214038_jsonize_tinymce.rb +2 -2
  35. data/db/migrate_core_cards/20130920291703_update_stylesheets.rb +4 -4
  36. data/db/migrate_core_cards/20130927191728_account_events.rb +6 -6
  37. data/db/migrate_core_cards/20131016172445_common_css_patch.rb +3 -3
  38. data/db/migrate_core_cards/20140110193325_reset_account_request_type.rb +1 -1
  39. data/db/migrate_core_cards/20140307231621_user_data_to_cards.rb +13 -13
  40. data/db/migrate_core_cards/20140317035504_account_requests_to_signups.rb +5 -5
  41. data/db/migrate_core_cards/20140512155840_add_script_cards.rb +13 -13
  42. data/db/migrate_core_cards/20140629222005_add_email_cards.rb +22 -22
  43. data/db/migrate_core_cards/20140725180118_config_card_updates.rb +3 -3
  44. data/db/migrate_core_cards/20141111083921_delete_machine_output.rb +2 -2
  45. data/db/migrate_core_cards/20141115034214_config_descriptions_etc.rb +4 -4
  46. data/db/migrate_core_cards/20141119001955_make_symlinks_relative.rb +2 -2
  47. data/db/migrate_core_cards/20141120120605_fix_notification_html_message.rb +3 -3
  48. data/db/migrate_core_cards/20141204061304_watchers_to_following.rb +3 -3
  49. data/db/migrate_core_cards/20141208132416_partial_reference_type.rb +1 -1
  50. data/db/migrate_core_cards/20141216155251_add_more_following_cards.rb +14 -14
  51. data/db/migrate_core_cards/20141230204340_uri_codename.rb +2 -2
  52. data/db/migrate_core_cards/20150202143810_import_bootstrap_layout.rb +21 -21
  53. data/db/migrate_core_cards/20150220134731_following_to_follow_rule.rb +4 -4
  54. data/db/migrate_core_cards/20150317162412_bootstrap_themes.rb +9 -9
  55. data/db/migrate_core_cards/20150326205655_bootswatch_themes.rb +9 -9
  56. data/db/migrate_core_cards/20150331135745_new_card_menu.rb +1 -1
  57. data/db/migrate_core_cards/20150429090551_search_card_context.rb +6 -6
  58. data/db/migrate_core_cards/20150501010515_responsive_sidebar.rb +3 -3
  59. data/db/migrate_core_cards/20150508212032_menu_compatibility.rb +2 -2
  60. data/db/migrate_core_cards/20150510031118_fix_skin_images.rb +2 -2
  61. data/db/migrate_core_cards/20150528084659_add_session_cardtype.rb +9 -6
  62. data/db/migrate_core_cards/20150601133433_add_recent_setting_session_card.rb +7 -7
  63. data/db/migrate_core_cards/20150605115802_add_performance_log_card.rb +2 -2
  64. data/db/migrate_core_cards/20150610171702_add_debugger_session_card.rb +5 -5
  65. data/db/migrate_core_cards/20150610180019_add_recaptcha_key_and_admin_info_cards.rb +10 -10
  66. data/db/migrate_core_cards/20150627205133_fix_script_bootstrap_card_type.rb +1 -1
  67. data/db/migrate_core_cards/20150702130543_remove_edit_toolbar_pinned.rb +1 -1
  68. data/db/migrate_core_cards/20150708224756_add_list_cards.rb +11 -11
  69. data/db/migrate_core_cards/20150724123438_update_file_and_image_cards.rb +78 -49
  70. data/db/migrate_core_cards/20150807205221_create_references_for_search_cards.rb +1 -1
  71. data/db/migrate_core_cards/20150824135418_update_file_history.rb +3 -3
  72. data/db/migrate_core_cards/20150903130006_attachment_upload_cards.rb +6 -6
  73. data/db/migrate_core_cards/20150910085603_remove_performance_log_card.rb +1 -1
  74. data/db/migrate_core_cards/20151120180631_add_token_expiration.rb +1 -1
  75. data/db/migrate_core_cards/20160801143221_change_bootstrap_card_type_to_scss.rb +9 -0
  76. data/db/migrate_core_cards/20160801175002_add_machine_cache_card.rb +7 -0
  77. data/db/migrate_core_cards/20160804112510_reorganize_scripts.rb +26 -0
  78. data/db/migrate_core_cards/20160811115836_rename_stats_to_admin.rb +8 -0
  79. data/db/migrate_core_cards/data/skin_images.json +16 -16
  80. data/db/schema.rb +15 -9
  81. data/db/seed/new/card_actions.yml +802 -650
  82. data/db/seed/new/card_acts.yml +208 -184
  83. data/db/seed/new/card_changes.yml +5195 -4709
  84. data/db/seed/new/card_references.yml +628 -677
  85. data/db/seed/new/cards.yml +3964 -3615
  86. data/db/seed/test/fixtures/card_actions.yml +1884 -1732
  87. data/db/seed/test/fixtures/card_acts.yml +466 -544
  88. data/db/seed/test/fixtures/card_changes.yml +8435 -7998
  89. data/db/seed/test/fixtures/card_references.yml +1057 -1092
  90. data/db/seed/test/fixtures/cards.yml +6007 -5656
  91. data/db/seed/test/seed.rb +99 -103
  92. data/db/version_core_cards.txt +1 -1
  93. data/lib/active_record/connection_adapters_ext.rb +52 -0
  94. data/lib/active_support/callbacks_ext.rb +9 -0
  95. data/lib/card.rb +25 -25
  96. data/lib/card/auth.rb +20 -215
  97. data/lib/card/auth/current.rb +130 -0
  98. data/lib/card/auth/permissions.rb +60 -0
  99. data/lib/card/auth/proxy.rb +58 -0
  100. data/lib/card/auth/setup.rb +38 -0
  101. data/lib/card/cache.rb +108 -68
  102. data/lib/card/cache/persistent.rb +118 -78
  103. data/lib/card/cache/prepopulate.rb +26 -0
  104. data/lib/card/cache/temporary.rb +54 -35
  105. data/lib/card/cache/view_cache.rb +103 -0
  106. data/lib/card/codename.rb +50 -31
  107. data/lib/card/content.rb +65 -153
  108. data/lib/card/content/chunk.rb +28 -10
  109. data/lib/card/content/clean.rb +84 -0
  110. data/lib/card/content/diff.rb +71 -0
  111. data/lib/card/content/diff/lcs.rb +94 -0
  112. data/lib/card/content/diff/processor.rb +161 -0
  113. data/lib/card/content/diff/result.rb +145 -0
  114. data/lib/card/content/parser.rb +78 -50
  115. data/lib/card/content/truncate.rb +62 -0
  116. data/lib/card/director_register.rb +29 -6
  117. data/lib/card/env.rb +49 -66
  118. data/lib/card/env/location.rb +44 -0
  119. data/lib/card/env/location_history.rb +52 -0
  120. data/lib/card/env/success.rb +144 -0
  121. data/lib/card/error.rb +95 -0
  122. data/lib/card/format.rb +54 -152
  123. data/lib/card/format/content.rb +57 -0
  124. data/lib/card/format/error.rb +27 -0
  125. data/lib/card/format/names.rb +47 -0
  126. data/lib/card/format/nest.rb +47 -141
  127. data/lib/card/format/nest/fetch.rb +52 -0
  128. data/lib/card/format/nest/main.rb +36 -0
  129. data/lib/card/format/nest/subformat.rb +32 -0
  130. data/lib/card/format/nest/view.rb +74 -0
  131. data/lib/card/format/registration.rb +69 -0
  132. data/lib/card/format/render.rb +43 -68
  133. data/lib/card/mailer.rb +2 -2
  134. data/lib/card/migration.rb +8 -8
  135. data/lib/card/migration/core.rb +10 -0
  136. data/lib/card/migration/import.rb +105 -0
  137. data/lib/card/migration/import/import_data.rb +135 -0
  138. data/lib/card/mod/dirs.rb +72 -0
  139. data/lib/card/mod/loader.rb +176 -0
  140. data/lib/card/model/save_helper.rb +61 -0
  141. data/lib/card/name.rb +13 -10
  142. data/lib/card/name/view_name.rb +48 -0
  143. data/lib/card/query.rb +30 -26
  144. data/lib/card/query/attributes.rb +4 -4
  145. data/lib/card/query/conjunctions.rb +1 -1
  146. data/lib/card/query/interpretation.rb +4 -3
  147. data/lib/card/query/join.rb +6 -6
  148. data/lib/card/query/reference.rb +7 -7
  149. data/lib/card/query/relational_attributes.rb +9 -9
  150. data/lib/card/query/sorting.rb +13 -13
  151. data/lib/card/query/sql_statement.rb +17 -17
  152. data/lib/card/query/value.rb +7 -7
  153. data/lib/card/reference.rb +7 -7
  154. data/lib/card/set.rb +5 -2
  155. data/lib/card/set/advanced_api.rb +44 -0
  156. data/lib/card/set/basket.rb +52 -0
  157. data/lib/card/set/event.rb +73 -42
  158. data/lib/card/set/format.rb +4 -17
  159. data/lib/card/set/helpers.rb +4 -78
  160. data/lib/card/set/inheritance.rb +57 -0
  161. data/lib/card/set/loader.rb +26 -26
  162. data/lib/card/set_pattern.rb +162 -149
  163. data/lib/card/stage.rb +23 -14
  164. data/lib/card/stage_director.rb +81 -32
  165. data/lib/card/subcards.rb +78 -70
  166. data/lib/card/subdirector_array.rb +3 -4
  167. data/lib/card/tasks/card.rake +57 -0
  168. data/lib/card/version.rb +1 -1
  169. data/lib/cardio.rb +34 -77
  170. data/lib/cardio/schema.rb +41 -0
  171. data/lib/generators/card.rb +4 -4
  172. data/lib/generators/card/format/USAGE +3 -3
  173. data/lib/generators/card/format/format_generator.rb +10 -10
  174. data/lib/generators/card/migration/migration_generator.rb +7 -7
  175. data/lib/generators/card/set/USAGE +6 -6
  176. data/lib/generators/card/set/set_generator.rb +10 -10
  177. data/mod/Modfile +18 -0
  178. data/mod/account/set/all/account.rb +65 -0
  179. data/mod/account/set/right/account.rb +189 -0
  180. data/mod/account/set/right/email.rb +54 -0
  181. data/mod/account/set/right/password.rb +47 -0
  182. data/mod/account/set/right/salt.rb +5 -0
  183. data/mod/account/set/right/status.rb +9 -0
  184. data/mod/account/set/right/token.rb +50 -0
  185. data/mod/account/set/self/account_links.rb +65 -0
  186. data/mod/account/set/self/signin.rb +158 -0
  187. data/mod/account/set/type/signup.rb +168 -0
  188. data/mod/account/set/type/user.rb +81 -0
  189. data/mod/account/spec/set/all/account_spec.rb +138 -0
  190. data/mod/account/spec/set/right/account_spec.rb +187 -0
  191. data/mod/account/spec/set/right/email_spec.rb +53 -0
  192. data/mod/account/spec/set/right/password_spec.rb +41 -0
  193. data/mod/account/spec/set/right/salt_spec.rb +6 -0
  194. data/mod/{05_standard → account}/spec/set/right/status_spec.rb +0 -0
  195. data/mod/account/spec/set/right/token_spec.rb +23 -0
  196. data/mod/account/spec/set/self/account_links_spec.rb +10 -0
  197. data/mod/account/spec/set/self/signin_spec.rb +69 -0
  198. data/mod/account/spec/set/type/signup_spec.rb +242 -0
  199. data/mod/{05_standard → account}/spec/set/type/user_spec.rb +0 -0
  200. data/mod/ace_editor/db/migrate_cards/20160804112538_add_ace_cards.rb +30 -0
  201. data/mod/{03_machines → ace_editor}/lib/javascript/script_ace.js +0 -0
  202. data/mod/ace_editor/lib/javascript/script_ace_config.js.coffee +71 -0
  203. data/mod/ace_editor/set/abstract/ace_editor.rb +11 -0
  204. data/mod/ace_editor/set/self/script_ace.rb +3 -0
  205. data/mod/ace_editor/set/self/script_ace_config.rb +5 -0
  206. data/mod/admin/set/self/admin.rb +106 -0
  207. data/mod/admin/set/self/admin_info.rb +103 -0
  208. data/mod/admin/set/self/version.rb +8 -0
  209. data/mod/admin/spec/set/self/admin_spec.rb +50 -0
  210. data/mod/admin/spec/set/self/version_spec.rb +7 -0
  211. data/mod/basic_formats/format/css_format.rb +8 -0
  212. data/mod/basic_formats/format/csv_format.rb +8 -0
  213. data/mod/basic_formats/format/file_format.rb +7 -0
  214. data/mod/basic_formats/format/js_format.rb +8 -0
  215. data/mod/basic_formats/format/json_format.rb +8 -0
  216. data/mod/basic_formats/format/rss_format.rb +12 -0
  217. data/mod/basic_formats/format/xml_format.rb +8 -0
  218. data/mod/basic_formats/set/all/all_css.rb +38 -0
  219. data/mod/basic_formats/set/all/all_csv.rb +49 -0
  220. data/mod/{02_basic_types → basic_formats}/set/all/all_js.rb +0 -0
  221. data/mod/basic_formats/set/all/base.rb +148 -0
  222. data/mod/basic_formats/set/all/file.rb +9 -0
  223. data/mod/basic_formats/set/all/json.rb +69 -0
  224. data/mod/basic_formats/set/all/rss.rb +70 -0
  225. data/mod/{02_basic_types → basic_formats}/set/all/text.rb +0 -0
  226. data/mod/basic_formats/set/self/01_head/javascript.rb +73 -0
  227. data/mod/basic_formats/set/self/head.rb +94 -0
  228. data/mod/basic_types/set/type/html.rb +19 -0
  229. data/mod/basic_types/set/type/plain_text.rb +12 -0
  230. data/mod/basic_types/spec/set/all/all_css_spec.rb +10 -0
  231. data/mod/basic_types/spec/set/all/all_csv_spec.rb +11 -0
  232. data/mod/basic_types/spec/set/all/base_spec.rb +89 -0
  233. data/mod/{02_basic_types → basic_types}/spec/set/all/file_spec.rb +0 -0
  234. data/mod/basic_types/spec/set/all/json_spec.rb +34 -0
  235. data/mod/basic_types/spec/set/all/rss_spec.rb +22 -0
  236. data/mod/{02_basic_types → basic_types}/spec/set/all/text_spec.rb +0 -0
  237. data/mod/basic_types/spec/set/type/plain_text_spec.rb +12 -0
  238. data/mod/basic_types/spec/set/type/pointer_spec.rb +217 -0
  239. data/mod/{06_bootstrap → bootstrap}/file/cerulean_skin_image/image-icon.png +0 -0
  240. data/mod/{06_bootstrap → bootstrap}/file/cerulean_skin_image/image-large.png +0 -0
  241. data/mod/{06_bootstrap → bootstrap}/file/cerulean_skin_image/image-medium.png +0 -0
  242. data/mod/{06_bootstrap → bootstrap}/file/cerulean_skin_image/image-original.png +0 -0
  243. data/mod/{06_bootstrap → bootstrap}/file/cerulean_skin_image/image-small.png +0 -0
  244. data/mod/{06_bootstrap → bootstrap}/file/cosmo_skin_image/image-icon.png +0 -0
  245. data/mod/{06_bootstrap → bootstrap}/file/cosmo_skin_image/image-large.png +0 -0
  246. data/mod/{06_bootstrap → bootstrap}/file/cosmo_skin_image/image-medium.png +0 -0
  247. data/mod/{06_bootstrap → bootstrap}/file/cosmo_skin_image/image-original.png +0 -0
  248. data/mod/{06_bootstrap → bootstrap}/file/cosmo_skin_image/image-small.png +0 -0
  249. data/mod/{06_bootstrap → bootstrap}/file/cyborg_skin_image/image-icon.png +0 -0
  250. data/mod/{06_bootstrap → bootstrap}/file/cyborg_skin_image/image-large.png +0 -0
  251. data/mod/{06_bootstrap → bootstrap}/file/cyborg_skin_image/image-medium.png +0 -0
  252. data/mod/{06_bootstrap → bootstrap}/file/cyborg_skin_image/image-original.png +0 -0
  253. data/mod/{06_bootstrap → bootstrap}/file/cyborg_skin_image/image-small.png +0 -0
  254. data/mod/{06_bootstrap → bootstrap}/file/darkly_skin_image/image-icon.png +0 -0
  255. data/mod/{06_bootstrap → bootstrap}/file/darkly_skin_image/image-large.png +0 -0
  256. data/mod/{06_bootstrap → bootstrap}/file/darkly_skin_image/image-medium.png +0 -0
  257. data/mod/{06_bootstrap → bootstrap}/file/darkly_skin_image/image-original.png +0 -0
  258. data/mod/{06_bootstrap → bootstrap}/file/darkly_skin_image/image-small.png +0 -0
  259. data/mod/{06_bootstrap → bootstrap}/file/flatly_skin_image/image-icon.png +0 -0
  260. data/mod/{06_bootstrap → bootstrap}/file/flatly_skin_image/image-large.png +0 -0
  261. data/mod/{06_bootstrap → bootstrap}/file/flatly_skin_image/image-medium.png +0 -0
  262. data/mod/{06_bootstrap → bootstrap}/file/flatly_skin_image/image-original.png +0 -0
  263. data/mod/{06_bootstrap → bootstrap}/file/flatly_skin_image/image-small.png +0 -0
  264. data/mod/{06_bootstrap → bootstrap}/file/journal_skin_image/image-icon.png +0 -0
  265. data/mod/{06_bootstrap → bootstrap}/file/journal_skin_image/image-large.png +0 -0
  266. data/mod/{06_bootstrap → bootstrap}/file/journal_skin_image/image-medium.png +0 -0
  267. data/mod/{06_bootstrap → bootstrap}/file/journal_skin_image/image-original.png +0 -0
  268. data/mod/{06_bootstrap → bootstrap}/file/journal_skin_image/image-small.png +0 -0
  269. data/mod/{06_bootstrap → bootstrap}/file/lumen_skin_image/image-icon.png +0 -0
  270. data/mod/{06_bootstrap → bootstrap}/file/lumen_skin_image/image-large.png +0 -0
  271. data/mod/{06_bootstrap → bootstrap}/file/lumen_skin_image/image-medium.png +0 -0
  272. data/mod/{06_bootstrap → bootstrap}/file/lumen_skin_image/image-original.png +0 -0
  273. data/mod/{06_bootstrap → bootstrap}/file/lumen_skin_image/image-small.png +0 -0
  274. data/mod/{06_bootstrap → bootstrap}/file/paper_skin_image/image-icon.png +0 -0
  275. data/mod/{06_bootstrap → bootstrap}/file/paper_skin_image/image-large.png +0 -0
  276. data/mod/{06_bootstrap → bootstrap}/file/paper_skin_image/image-medium.png +0 -0
  277. data/mod/{06_bootstrap → bootstrap}/file/paper_skin_image/image-original.png +0 -0
  278. data/mod/{06_bootstrap → bootstrap}/file/paper_skin_image/image-small.png +0 -0
  279. data/mod/{06_bootstrap → bootstrap}/file/readable_skin_image/image-icon.png +0 -0
  280. data/mod/{06_bootstrap → bootstrap}/file/readable_skin_image/image-large.png +0 -0
  281. data/mod/{06_bootstrap → bootstrap}/file/readable_skin_image/image-medium.png +0 -0
  282. data/mod/{06_bootstrap → bootstrap}/file/readable_skin_image/image-original.png +0 -0
  283. data/mod/{06_bootstrap → bootstrap}/file/readable_skin_image/image-small.png +0 -0
  284. data/mod/{06_bootstrap → bootstrap}/file/sandstone_skin_image/image-icon.png +0 -0
  285. data/mod/{06_bootstrap → bootstrap}/file/sandstone_skin_image/image-large.png +0 -0
  286. data/mod/{06_bootstrap → bootstrap}/file/sandstone_skin_image/image-medium.png +0 -0
  287. data/mod/{06_bootstrap → bootstrap}/file/sandstone_skin_image/image-original.png +0 -0
  288. data/mod/{06_bootstrap → bootstrap}/file/sandstone_skin_image/image-small.png +0 -0
  289. data/mod/{06_bootstrap → bootstrap}/file/simplex_skin_image/image-icon.png +0 -0
  290. data/mod/{06_bootstrap → bootstrap}/file/simplex_skin_image/image-large.png +0 -0
  291. data/mod/{06_bootstrap → bootstrap}/file/simplex_skin_image/image-medium.png +0 -0
  292. data/mod/{06_bootstrap → bootstrap}/file/simplex_skin_image/image-original.png +0 -0
  293. data/mod/{06_bootstrap → bootstrap}/file/simplex_skin_image/image-small.png +0 -0
  294. data/mod/{06_bootstrap → bootstrap}/file/slate_skin_image/image-icon.png +0 -0
  295. data/mod/{06_bootstrap → bootstrap}/file/slate_skin_image/image-large.png +0 -0
  296. data/mod/{06_bootstrap → bootstrap}/file/slate_skin_image/image-medium.png +0 -0
  297. data/mod/{06_bootstrap → bootstrap}/file/slate_skin_image/image-original.png +0 -0
  298. data/mod/{06_bootstrap → bootstrap}/file/slate_skin_image/image-small.png +0 -0
  299. data/mod/{06_bootstrap → bootstrap}/file/spacelab_skin_image/image-icon.png +0 -0
  300. data/mod/{06_bootstrap → bootstrap}/file/spacelab_skin_image/image-large.png +0 -0
  301. data/mod/{06_bootstrap → bootstrap}/file/spacelab_skin_image/image-medium.png +0 -0
  302. data/mod/{06_bootstrap → bootstrap}/file/spacelab_skin_image/image-original.png +0 -0
  303. data/mod/{06_bootstrap → bootstrap}/file/spacelab_skin_image/image-small.png +0 -0
  304. data/mod/{06_bootstrap → bootstrap}/file/superhero_skin_image/image-icon.png +0 -0
  305. data/mod/{06_bootstrap → bootstrap}/file/superhero_skin_image/image-large.png +0 -0
  306. data/mod/{06_bootstrap → bootstrap}/file/superhero_skin_image/image-medium.png +0 -0
  307. data/mod/{06_bootstrap → bootstrap}/file/superhero_skin_image/image-original.png +0 -0
  308. data/mod/{06_bootstrap → bootstrap}/file/superhero_skin_image/image-small.png +0 -0
  309. data/mod/{06_bootstrap → bootstrap}/file/united_skin_image/image-icon.png +0 -0
  310. data/mod/{06_bootstrap → bootstrap}/file/united_skin_image/image-large.png +0 -0
  311. data/mod/{06_bootstrap → bootstrap}/file/united_skin_image/image-medium.png +0 -0
  312. data/mod/{06_bootstrap → bootstrap}/file/united_skin_image/image-original.png +0 -0
  313. data/mod/{06_bootstrap → bootstrap}/file/united_skin_image/image-small.png +0 -0
  314. data/mod/{06_bootstrap → bootstrap}/file/yeti_skin_image/image-icon.png +0 -0
  315. data/mod/{06_bootstrap → bootstrap}/file/yeti_skin_image/image-large.png +0 -0
  316. data/mod/{06_bootstrap → bootstrap}/file/yeti_skin_image/image-medium.png +0 -0
  317. data/mod/{06_bootstrap → bootstrap}/file/yeti_skin_image/image-original.png +0 -0
  318. data/mod/{06_bootstrap → bootstrap}/file/yeti_skin_image/image-small.png +0 -0
  319. data/mod/{06_bootstrap → bootstrap}/lib/javascript/bootstrap.js +0 -0
  320. data/mod/{06_bootstrap → bootstrap}/lib/javascript/bootstrap.min.js +0 -0
  321. data/mod/{06_bootstrap → bootstrap}/lib/javascript/bootstrap_modal_wagn.js +0 -0
  322. data/mod/{06_bootstrap → bootstrap}/lib/javascript/smartmenu.js +0 -0
  323. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_alerts.scss +0 -0
  324. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_badges.scss +0 -0
  325. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_breadcrumbs.scss +0 -0
  326. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_button-groups.scss +0 -0
  327. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_buttons.scss +0 -0
  328. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_carousel.scss +0 -0
  329. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_close.scss +0 -0
  330. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_code.scss +0 -0
  331. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_component-animations.scss +0 -0
  332. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_dropdowns.scss +0 -0
  333. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_forms.scss +0 -0
  334. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_glyphicons.scss +0 -0
  335. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_grid.scss +0 -0
  336. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_input-groups.scss +0 -0
  337. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_jumbotron.scss +0 -0
  338. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_labels.scss +0 -0
  339. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_list-group.scss +0 -0
  340. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_media.scss +0 -0
  341. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_mixins.scss +0 -0
  342. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_modals.scss +0 -0
  343. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_navbar.scss +0 -0
  344. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_navs.scss +0 -0
  345. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_normalize.scss +0 -0
  346. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_pager.scss +0 -0
  347. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_pagination.scss +0 -0
  348. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_panels.scss +0 -0
  349. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_popovers.scss +0 -0
  350. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_print.scss +0 -0
  351. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_progress-bars.scss +0 -0
  352. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_responsive-embed.scss +0 -0
  353. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_responsive-utilities.scss +0 -0
  354. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_scaffolding.scss +0 -0
  355. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_tables.scss +0 -0
  356. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_theme.scss +0 -0
  357. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_thumbnails.scss +0 -0
  358. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_tooltip.scss +0 -0
  359. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_type.scss +0 -0
  360. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_utilities.scss +0 -0
  361. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_variables.scss +0 -0
  362. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/_wells.scss +0 -0
  363. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_alerts.scss +0 -0
  364. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_background-variant.scss +0 -0
  365. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_border-radius.scss +0 -0
  366. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_buttons.scss +0 -0
  367. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_center-block.scss +0 -0
  368. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_clearfix.scss +0 -0
  369. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_forms.scss +0 -0
  370. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_gradients.scss +0 -0
  371. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -0
  372. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_grid.scss +0 -0
  373. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_hide-text.scss +0 -0
  374. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_image.scss +0 -0
  375. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_labels.scss +0 -0
  376. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_list-group.scss +0 -0
  377. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -0
  378. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +0 -0
  379. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_opacity.scss +0 -0
  380. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_pagination.scss +0 -0
  381. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_panels.scss +0 -0
  382. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_progress-bar.scss +0 -0
  383. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_reset-filter.scss +0 -0
  384. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_resize.scss +0 -0
  385. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_responsive-visibility.scss +0 -0
  386. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_size.scss +0 -0
  387. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_tab-focus.scss +0 -0
  388. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_table-row.scss +0 -0
  389. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -0
  390. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_text-overflow.scss +0 -0
  391. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +0 -0
  392. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/bootstrap_cards.scss +0 -0
  393. data/mod/{06_bootstrap → bootstrap}/lib/stylesheets/smartmenu.css +0 -0
  394. data/mod/bootstrap/set/all/bootstrap/form.rb +35 -0
  395. data/mod/bootstrap/set/all/bootstrap/helper.rb +229 -0
  396. data/mod/bootstrap/set/all/bootstrap/table.rb +61 -0
  397. data/mod/bootstrap/set/all/bootstrap/tabs.rb +81 -0
  398. data/mod/bootstrap/set/all/bootstrap/wrapper.rb +11 -0
  399. data/mod/bootstrap/set/all/rich_bootstrap.rb +6 -0
  400. data/mod/{06_bootstrap → bootstrap}/set/self/bootstrap_cards.rb +0 -0
  401. data/mod/bootstrap/set/self/bootstrap_js.rb +5 -0
  402. data/mod/bootstrap/set/self/bootswatch_shared.rb +40 -0
  403. data/mod/bootstrap/set/self/script_mods.rb +1 -0
  404. data/mod/bootstrap/set/self/smartmenu_css.rb +5 -0
  405. data/mod/bootstrap/set/self/smartmenu_js.rb +5 -0
  406. data/mod/bootstrap/spec/set/all/bootstrap/form_spec.rb +15 -0
  407. data/mod/carrierwave/lib/carrier_wave/cardmount.rb +113 -0
  408. data/mod/carrierwave/lib/carrier_wave/file_card_uploader.rb +152 -0
  409. data/mod/carrierwave/lib/carrier_wave/image_card_uploader.rb +54 -0
  410. data/mod/carrierwave/set/abstract/attachment.rb +275 -0
  411. data/mod/carrierwave/set/type/file.rb +148 -0
  412. data/mod/carrierwave/set/type/image.rb +89 -0
  413. data/mod/core/chunk/include.rb +129 -0
  414. data/mod/core/chunk/link.rb +96 -0
  415. data/mod/core/chunk/literal.rb +27 -0
  416. data/mod/core/chunk/query_reference.rb +83 -0
  417. data/mod/{01_core → core}/chunk/reference.rb +0 -0
  418. data/mod/core/chunk/uri.rb +144 -0
  419. data/mod/core/format/data_format.rb +6 -0
  420. data/mod/core/format/html_format.rb +78 -0
  421. data/mod/core/format/text_format.rb +11 -0
  422. data/mod/{01_core → core}/layout/blank.html +0 -0
  423. data/mod/{01_core → core}/layout/default.html +0 -0
  424. data/mod/{01_core → core}/layout/modal.html +0 -0
  425. data/mod/{01_core → core}/layout/noside.html +0 -0
  426. data/mod/{01_core → core}/layout/pre.html +0 -0
  427. data/mod/{01_core → core}/layout/simple.html +0 -0
  428. data/mod/core/set/abstract/code_file.rb +72 -0
  429. data/mod/core/set/all/actify.rb +94 -0
  430. data/mod/{01_core → core}/set/all/active_card.rb +0 -0
  431. data/mod/core/set/all/collection.rb +306 -0
  432. data/mod/core/set/all/content.rb +62 -0
  433. data/mod/core/set/all/erb.rb +11 -0
  434. data/mod/core/set/all/event.rb +55 -0
  435. data/mod/core/set/all/export.rb +42 -0
  436. data/mod/core/set/all/fetch.rb +328 -0
  437. data/mod/{01_core → core}/set/all/haml.rb +0 -0
  438. data/mod/core/set/all/initialize.rb +35 -0
  439. data/mod/{01_core → core}/set/all/location_history.rb +0 -0
  440. data/mod/core/set/all/name.rb +275 -0
  441. data/mod/core/set/all/name_validations.rb +58 -0
  442. data/mod/core/set/all/pattern.rb +60 -0
  443. data/mod/core/set/all/permissions.rb +302 -0
  444. data/mod/core/set/all/phases.rb +16 -0
  445. data/mod/core/set/all/references.rb +180 -0
  446. data/mod/core/set/all/rules.rb +304 -0
  447. data/mod/core/set/all/stages.rb +24 -0
  448. data/mod/core/set/all/states.rb +24 -0
  449. data/mod/core/set/all/subcards.rb +78 -0
  450. data/mod/core/set/all/templating.rb +71 -0
  451. data/mod/core/set/all/tracked_attributes.rb +147 -0
  452. data/mod/core/set/all/trash.rb +56 -0
  453. data/mod/core/set/all/type.rb +53 -0
  454. data/mod/core/set/all/utils.rb +129 -0
  455. data/mod/core/set/all/view_cache.rb +9 -0
  456. data/mod/core/set_pattern/01_all.rb +11 -0
  457. data/mod/core/set_pattern/02_all_plus.rb +13 -0
  458. data/mod/{01_core → core}/set_pattern/03_type.rb +0 -0
  459. data/mod/core/set_pattern/04_star.rb +15 -0
  460. data/mod/core/set_pattern/05_rstar.rb +17 -0
  461. data/mod/{01_core → core}/set_pattern/06_right.rb +0 -0
  462. data/mod/core/set_pattern/07_type_plus_right.rb +26 -0
  463. data/mod/{01_core → core}/set_pattern/08_self.rb +0 -0
  464. data/mod/core/spec/chunk/literal_spec.rb +13 -0
  465. data/mod/core/spec/chunk/uri_spec.rb +297 -0
  466. data/mod/core/spec/format/data_format_spec.rb +5 -0
  467. data/mod/core/spec/format/html_format_spec.rb +153 -0
  468. data/mod/core/spec/format/text_format_spec.rb +5 -0
  469. data/mod/core/spec/set/all/actify_spec.rb +139 -0
  470. data/mod/{01_core → core}/spec/set/all/active_card_spec.rb +0 -0
  471. data/mod/{01_core → core}/spec/set/all/attribute_tracking_spec.rb +0 -0
  472. data/mod/core/spec/set/all/collection_spec.rb +162 -0
  473. data/mod/core/spec/set/all/content_spec.rb +15 -0
  474. data/mod/core/spec/set/all/export_spec.rb +135 -0
  475. data/mod/core/spec/set/all/fetch_spec.rb +285 -0
  476. data/mod/core/spec/set/all/initialize_spec.rb +88 -0
  477. data/mod/core/spec/set/all/name_spec.rb +60 -0
  478. data/mod/core/spec/set/all/pattern_spec.rb +94 -0
  479. data/mod/core/spec/set/all/permissions_spec.rb +536 -0
  480. data/mod/{01_core → core}/spec/set/all/phases_spec.rb +0 -0
  481. data/mod/core/spec/set/all/references_spec.rb +9 -0
  482. data/mod/core/spec/set/all/rules2_spec.rb +247 -0
  483. data/mod/core/spec/set/all/rules_spec.rb +137 -0
  484. data/mod/{01_core → core}/spec/set/all/states_spec.rb +0 -0
  485. data/mod/core/spec/set/all/templating_spec.rb +119 -0
  486. data/mod/core/spec/set/all/tracked_attributes_spec.rb +314 -0
  487. data/mod/core/spec/set/all/trash_spec.rb +81 -0
  488. data/mod/core/spec/set/all/type_spec.rb +51 -0
  489. data/mod/{01_core → core}/spec/set/all/utils_spec.rb +0 -0
  490. data/mod/developer/db/migrate_cards/20160812112513_add_developer_cards.rb +11 -0
  491. data/mod/developer/set/all/event_viz.rb +52 -0
  492. data/mod/developer/set/all/view_viz.rb +23 -0
  493. data/mod/developer/set/right/debug.rb +89 -0
  494. data/mod/{05_standard → developer}/spec/set/all/event_viz_spec.rb +0 -0
  495. data/mod/developer/spec/set/right/debug_spec.rb +12 -0
  496. data/mod/email/format/email_html_format.rb +12 -0
  497. data/mod/email/format/email_text_format.rb +15 -0
  498. data/mod/email/lib/card/follow_option.rb +89 -0
  499. data/mod/email/set/all/email_html.rb +4 -0
  500. data/mod/email/set/all/email_text.rb +5 -0
  501. data/mod/email/set/all/follow.rb +246 -0
  502. data/mod/email/set/all/notify.rb +264 -0
  503. data/mod/{05_email → email}/set/all/observer.rb +0 -0
  504. data/mod/email/set/right/bcc.rb +40 -0
  505. data/mod/{05_email → email}/set/right/cc.rb +0 -0
  506. data/mod/email/set/right/follow.rb +99 -0
  507. data/mod/{05_email → email}/set/right/follow_fields.rb +0 -0
  508. data/mod/email/set/right/followers.rb +34 -0
  509. data/mod/email/set/right/following.rb +58 -0
  510. data/mod/{05_email → email}/set/right/from.rb +0 -0
  511. data/mod/{05_email → email}/set/right/html_message.rb +0 -0
  512. data/mod/{05_email → email}/set/right/to.rb +0 -0
  513. data/mod/email/set/self/always.rb +13 -0
  514. data/mod/email/set/self/created.rb +19 -0
  515. data/mod/email/set/self/edited.rb +20 -0
  516. data/mod/{05_email → email}/set/self/follow.rb +0 -0
  517. data/mod/email/set/self/follow_defaults.rb +68 -0
  518. data/mod/email/set/self/never.rb +13 -0
  519. data/mod/email/set/type/email_template.rb +126 -0
  520. data/mod/email/set/type_plus_right/user/follow.rb +177 -0
  521. data/mod/email/spec/set/all/follow_spec.rb +134 -0
  522. data/mod/email/spec/set/all/notify_spec.rb +396 -0
  523. data/mod/email/spec/set/all/observer_spec.rb +98 -0
  524. data/mod/email/spec/set/right/followers_spec.rb +121 -0
  525. data/mod/{05_email → email}/spec/set/right/following_spec.rb +0 -0
  526. data/mod/email/spec/set/self/follow_defaults_spec.rb +18 -0
  527. data/mod/history/lib/card/act.rb +116 -0
  528. data/mod/history/lib/card/action.rb +178 -0
  529. data/mod/history/lib/card/action/admin.rb +30 -0
  530. data/mod/history/lib/card/action/differ.rb +53 -0
  531. data/mod/history/lib/card/change.rb +68 -0
  532. data/mod/history/set/all/actions.rb +53 -0
  533. data/mod/history/set/all/content_history.rb +161 -0
  534. data/mod/history/set/all/history.rb +400 -0
  535. data/mod/machines/lib/card/machine.rb +261 -0
  536. data/mod/machines/lib/card/machine_input.rb +80 -0
  537. data/mod/{03_machines → machines}/lib/javascript/jquery-ui.js +0 -0
  538. data/mod/{03_machines → machines}/lib/javascript/jquery.autosize.js +0 -0
  539. data/mod/{03_machines → machines}/lib/javascript/jquery.fileupload.js +0 -0
  540. data/mod/{03_machines → machines}/lib/javascript/jquery.iframe-transport.js +0 -0
  541. data/mod/{03_machines → machines}/lib/javascript/jquery.ui.autocomplete.html.js +0 -0
  542. data/mod/{03_machines → machines}/lib/javascript/jquery_ujs.js +0 -0
  543. data/mod/{03_machines → machines}/lib/javascript/jquerymobile.js +0 -0
  544. data/mod/{03_machines → machines}/lib/javascript/script_card_menu.js.coffee +0 -0
  545. data/mod/{03_machines → machines}/lib/javascript/script_html5shiv_printshiv.js +0 -0
  546. data/mod/{03_machines → machines}/lib/javascript/script_jquery.js +0 -0
  547. data/mod/{03_machines → machines}/lib/javascript/theme-textmate.js +0 -0
  548. data/mod/machines/lib/javascript/wagn.js.coffee +387 -0
  549. data/mod/machines/lib/javascript/wagn_editor.js.coffee +33 -0
  550. data/mod/machines/lib/javascript/wagn_layout.js.coffee +61 -0
  551. data/mod/machines/lib/javascript/wagn_mod.js.coffee +237 -0
  552. data/mod/machines/lib/javascript/wagn_navbox.js.coffee +72 -0
  553. data/mod/machines/lib/javascript/wagn_upload.js.coffee +57 -0
  554. data/mod/{03_machines → machines}/lib/stylesheets/style_bootstrap_compatible.css +0 -0
  555. data/mod/machines/lib/stylesheets/style_cards.scss +934 -0
  556. data/mod/{03_machines → machines}/lib/stylesheets/style_jquery_ui_smoothness.css +0 -0
  557. data/mod/machines/set/abstract/script.rb +42 -0
  558. data/mod/machines/set/all/reset_machines.rb +12 -0
  559. data/mod/machines/set/right/machine_cache.rb +11 -0
  560. data/mod/{03_machines → machines}/set/right/machine_input.rb +0 -0
  561. data/mod/{03_machines → machines}/set/right/machine_output.rb +0 -0
  562. data/mod/{03_machines → machines}/set/self/script_card_menu.rb +0 -0
  563. data/mod/{03_machines → machines}/set/self/script_html5shiv_printshiv.rb +0 -0
  564. data/mod/{03_machines → machines}/set/self/script_jquery.rb +0 -0
  565. data/mod/{03_machines → machines}/set/self/script_jquery_helper.rb +0 -0
  566. data/mod/machines/set/self/script_slot.rb +7 -0
  567. data/mod/{03_machines → machines}/set/self/style_bootstrap_compatible.rb +0 -0
  568. data/mod/{03_machines → machines}/set/self/style_cards.rb +0 -0
  569. data/mod/{03_machines → machines}/set/self/style_jquery_ui_smoothness.rb +0 -0
  570. data/mod/machines/set/type/coffee_script.rb +40 -0
  571. data/mod/machines/set/type/css.rb +60 -0
  572. data/mod/machines/set/type/java_script.rb +29 -0
  573. data/mod/machines/set/type/scss.rb +14 -0
  574. data/mod/machines/set/type/skin.rb +6 -0
  575. data/mod/machines/spec/lib/shared_machine_examples.rb +181 -0
  576. data/mod/machines/spec/lib/shared_machine_input_examples.rb +69 -0
  577. data/mod/{03_machines → machines}/spec/set/right/machine_output_spec.rb +0 -0
  578. data/mod/{03_machines → machines}/spec/set/self/style_jquery_ui_smoothness_spec.rb +0 -0
  579. data/mod/machines/spec/set/type/coffeescript_spec.rb +41 -0
  580. data/mod/machines/spec/set/type/css_spec.rb +40 -0
  581. data/mod/machines/spec/set/type/javascript_spec.rb +44 -0
  582. data/mod/machines/spec/set/type/scss_spec.rb +62 -0
  583. data/mod/machines/spec/set/type/skin_spec.rb +84 -0
  584. data/mod/pointer/db/migrate_cards/20160804112340_add_pointer_cards.rb +9 -0
  585. data/mod/pointer/lib/javascript/script_pointer_config.js.coffee +41 -0
  586. data/mod/pointer/set/abstract/01_pointer.rb +186 -0
  587. data/mod/pointer/set/abstract/01_pointer/edit.rb +217 -0
  588. data/mod/pointer/set/abstract/code_pointer.rb +9 -0
  589. data/mod/pointer/set/self/script_editors.rb +1 -0
  590. data/mod/pointer/set/self/script_mods.rb +1 -0
  591. data/mod/pointer/set/self/script_pointer_config.rb +3 -0
  592. data/mod/pointer/set/type/pointer.rb +1 -0
  593. data/mod/prosemirror_editor/db/migrate_cards/20160804112547_add_prosemirror_cards.rb +27 -0
  594. data/mod/prosemirror_editor/lib/javascript/script_prosemirror.js +12403 -0
  595. data/mod/prosemirror_editor/lib/javascript/script_prosemirror_config.js.coffee +31 -0
  596. data/mod/prosemirror_editor/set/abstract/prosemirror_editor.rb +7 -0
  597. data/mod/prosemirror_editor/set/self/script_prosemirror.rb +3 -0
  598. data/mod/prosemirror_editor/set/self/script_prosemirror_config.rb +6 -0
  599. data/mod/settings/lib/card/setting.rb +82 -0
  600. data/mod/settings/set/abstract/permission.rb +112 -0
  601. data/mod/{04_settings → settings}/set/right/add_help.rb +0 -0
  602. data/mod/settings/set/right/comment.rb +1 -0
  603. data/mod/settings/set/right/create.rb +1 -0
  604. data/mod/{04_settings → settings}/set/right/default.rb +0 -0
  605. data/mod/settings/set/right/delete.rb +1 -0
  606. data/mod/{04_settings → settings}/set/right/help.rb +0 -0
  607. data/mod/{04_settings → settings}/set/right/read.rb +0 -0
  608. data/mod/settings/set/right/script.rb +9 -0
  609. data/mod/{04_settings → settings}/set/right/structure.rb +0 -0
  610. data/mod/settings/set/right/style.rb +10 -0
  611. data/mod/settings/set/right/update.rb +1 -0
  612. data/mod/settings/set/self/accountable.rb +3 -0
  613. data/mod/{04_settings → settings}/set/self/add_help.rb +0 -0
  614. data/mod/{04_settings → settings}/set/self/autoname.rb +0 -0
  615. data/mod/{04_settings → settings}/set/self/captcha.rb +0 -0
  616. data/mod/{04_settings → settings}/set/self/create.rb +0 -0
  617. data/mod/{04_settings → settings}/set/self/default.rb +0 -0
  618. data/mod/{04_settings → settings}/set/self/default_html_view.rb +0 -0
  619. data/mod/{04_settings → settings}/set/self/delete.rb +0 -0
  620. data/mod/{04_settings → settings}/set/self/follow_fields.rb +0 -0
  621. data/mod/{04_settings → settings}/set/self/help.rb +0 -0
  622. data/mod/settings/set/self/input.rb +4 -0
  623. data/mod/{04_settings → settings}/set/self/layout.rb +0 -0
  624. data/mod/{04_settings → settings}/set/self/on_create.rb +0 -0
  625. data/mod/{04_settings → settings}/set/self/on_delete.rb +0 -0
  626. data/mod/{04_settings → settings}/set/self/on_update.rb +0 -0
  627. data/mod/settings/set/self/options.rb +4 -0
  628. data/mod/settings/set/self/options_label.rb +4 -0
  629. data/mod/{04_settings → settings}/set/self/read.rb +0 -0
  630. data/mod/{04_settings → settings}/set/self/recent_settings.rb +0 -0
  631. data/mod/{04_settings → settings}/set/self/script.rb +0 -0
  632. data/mod/{04_settings → settings}/set/self/structure.rb +0 -0
  633. data/mod/{04_settings → settings}/set/self/style.rb +0 -0
  634. data/mod/{04_settings → settings}/set/self/table_of_contents.rb +0 -0
  635. data/mod/{04_settings → settings}/set/self/thanks.rb +0 -0
  636. data/mod/{04_settings → settings}/set/self/update.rb +0 -0
  637. data/mod/settings/set/type/setting.rb +104 -0
  638. data/mod/{04_settings → settings}/spec/set/right/add_help_spec.rb +0 -0
  639. data/mod/settings/spec/set/right/comment_spec.rb +41 -0
  640. data/mod/settings/spec/set/right/create_spec.rb +10 -0
  641. data/mod/{04_settings → settings}/spec/set/right/default_spec.rb +0 -0
  642. data/mod/{04_settings → settings}/spec/set/right/delete_spec.rb +0 -0
  643. data/mod/{04_settings → settings}/spec/set/right/help_spec.rb +0 -0
  644. data/mod/{04_settings → settings}/spec/set/right/read_spec.rb +0 -0
  645. data/mod/settings/spec/set/right/script_spec.rb +35 -0
  646. data/mod/settings/spec/set/right/structure_spec.rb +25 -0
  647. data/mod/settings/spec/set/right/style_spec.rb +34 -0
  648. data/mod/{04_settings → settings}/spec/set/right/update_spec.rb +0 -0
  649. data/mod/settings/spec/set/type/setting_spec.rb +10 -0
  650. data/mod/solid_cache/db/migrate_cards/20160806112710_add_solid_cache_cards.rb +10 -0
  651. data/mod/solid_cache/set/abstract/solid_cache.rb +99 -0
  652. data/mod/solid_cache/set/all/solid_cache.rb +14 -0
  653. data/mod/solid_cache/set/right/solid_cache.rb +32 -0
  654. data/mod/solid_cache/spec/set/abstract/solid_cache_spec.rb +98 -0
  655. data/mod/{05_standard → standard}/file/credit/icon-image.png +0 -0
  656. data/mod/{05_standard → standard}/file/credit/large-image.png +0 -0
  657. data/mod/{05_standard → standard}/file/credit/medium-image.png +0 -0
  658. data/mod/{05_standard → standard}/file/credit/original-image.png +0 -0
  659. data/mod/{05_standard → standard}/file/credit/small-image.png +0 -0
  660. data/mod/{05_standard → standard}/file/credit_image/image-icon.png +0 -0
  661. data/mod/{05_standard → standard}/file/credit_image/image-large.png +0 -0
  662. data/mod/{05_standard → standard}/file/credit_image/image-medium.png +0 -0
  663. data/mod/{05_standard → standard}/file/credit_image/image-original.png +0 -0
  664. data/mod/{05_standard → standard}/file/credit_image/image-small.png +0 -0
  665. data/mod/standard/file/favicon/image-icon.png +0 -0
  666. data/mod/standard/file/favicon/image-large.png +0 -0
  667. data/mod/standard/file/favicon/image-medium.png +0 -0
  668. data/mod/standard/file/favicon/image-original.png +0 -0
  669. data/mod/standard/file/favicon/image-small.png +0 -0
  670. data/mod/{05_standard → standard}/file/logo/image-icon.png +0 -0
  671. data/mod/{05_standard → standard}/file/logo/image-large.png +0 -0
  672. data/mod/{05_standard → standard}/file/logo/image-medium.png +0 -0
  673. data/mod/{05_standard → standard}/file/logo/image-original.png +0 -0
  674. data/mod/{05_standard → standard}/file/logo/image-small.png +0 -0
  675. data/mod/standard/set/all/comment.rb +60 -0
  676. data/mod/standard/set/all/error.rb +222 -0
  677. data/mod/standard/set/all/links.rb +158 -0
  678. data/mod/standard/set/all/list_changes.rb +46 -0
  679. data/mod/standard/set/all/rich_html/content.rb +254 -0
  680. data/mod/standard/set/all/rich_html/editing.rb +240 -0
  681. data/mod/standard/set/all/rich_html/form.rb +291 -0
  682. data/mod/standard/set/all/rich_html/header.rb +71 -0
  683. data/mod/standard/set/all/rich_html/menu.rb +147 -0
  684. data/mod/standard/set/all/rich_html/modal.rb +51 -0
  685. data/mod/standard/set/all/rich_html/toolbar.rb +305 -0
  686. data/mod/standard/set/all/rich_html/wrapper.rb +184 -0
  687. data/mod/{05_standard → standard}/set/right/discussion.rb +0 -0
  688. data/mod/standard/set/right/when_created.rb +7 -0
  689. data/mod/standard/set/right/when_last_edited.rb +7 -0
  690. data/mod/{05_standard → standard}/set/rstar/rules.rb +0 -0
  691. data/mod/standard/set/rstar/rules_editor.rb +364 -0
  692. data/mod/standard/set/self/alerts.rb +5 -0
  693. data/mod/{05_standard → standard}/set/self/codenames.rb +0 -0
  694. data/mod/standard/set/self/foot.rb +8 -0
  695. data/mod/standard/set/self/navbox.rb +29 -0
  696. data/mod/standard/set/self/now.rb +7 -0
  697. data/mod/standard/set/self/recent.rb +27 -0
  698. data/mod/standard/set/self/search.rb +64 -0
  699. data/mod/standard/set/type/basic.rb +52 -0
  700. data/mod/standard/set/type/cardtype.rb +74 -0
  701. data/mod/standard/set/type/date.rb +8 -0
  702. data/mod/standard/set/type/layout_type.rb +10 -0
  703. data/mod/standard/set/type/list.rb +113 -0
  704. data/mod/standard/set/type/listed_by.rb +78 -0
  705. data/mod/standard/set/type/number.rb +18 -0
  706. data/mod/standard/set/type/phrase.rb +3 -0
  707. data/mod/standard/set/type/search_type.rb +332 -0
  708. data/mod/standard/set/type/session.rb +35 -0
  709. data/mod/standard/set/type/set.rb +364 -0
  710. data/mod/standard/set/type/toggle.rb +12 -0
  711. data/mod/{05_standard → standard}/set/type/uri.rb +0 -0
  712. data/mod/standard/spec/chunk/include_spec.rb +203 -0
  713. data/mod/standard/spec/chunk/link_spec.rb +98 -0
  714. data/mod/standard/spec/chunk/query_reference_spec.rb +49 -0
  715. data/mod/standard/spec/format/css_format_spec.rb +5 -0
  716. data/mod/standard/spec/format/csv_format_spec.rb +5 -0
  717. data/mod/standard/spec/format/email_html_format_spec.rb +5 -0
  718. data/mod/standard/spec/format/file_format_spec.rb +5 -0
  719. data/mod/standard/spec/format/js_format_spec.rb +5 -0
  720. data/mod/standard/spec/format/json_format_spec.rb +5 -0
  721. data/mod/standard/spec/format/rss_format_spec.rb +5 -0
  722. data/mod/standard/spec/format/xml_format_spec.rb +5 -0
  723. data/mod/{05_standard → standard}/spec/set/all/comment_spec.rb +0 -0
  724. data/mod/standard/spec/set/all/email_html_spec.rb +15 -0
  725. data/mod/standard/spec/set/all/error_spec.rb +9 -0
  726. data/mod/standard/spec/set/all/history_spec.rb +218 -0
  727. data/mod/standard/spec/set/all/links_spec.rb +15 -0
  728. data/mod/standard/spec/set/all/rich_html/editing_spec.rb +61 -0
  729. data/mod/standard/spec/set/all/rich_html/form_spec.rb +47 -0
  730. data/mod/standard/spec/set/all/rich_html/wrapper_spec.rb +37 -0
  731. data/mod/standard/spec/set/right/when_created_spec.rb +7 -0
  732. data/mod/standard/spec/set/right/when_last_edited_spec.rb +7 -0
  733. data/mod/standard/spec/set/rstar/rules_spec.rb +27 -0
  734. data/mod/{05_standard → standard}/spec/set/self/alerts_spec.rb +0 -0
  735. data/mod/{05_standard → standard}/spec/set/self/foot_spec.rb +0 -0
  736. data/mod/standard/spec/set/self/head_spec.rb +16 -0
  737. data/mod/standard/spec/set/self/navbox_spec.rb +8 -0
  738. data/mod/standard/spec/set/self/now_spec.rb +7 -0
  739. data/mod/{05_standard → standard}/spec/set/self/recent_spec.rb +0 -0
  740. data/mod/{05_standard → standard}/spec/set/self/search_spec.rb +0 -0
  741. data/mod/{05_standard → standard}/spec/set/type/basic_spec.rb +0 -0
  742. data/mod/standard/spec/set/type/cardtype_spec.rb +18 -0
  743. data/mod/standard/spec/set/type/date_spec.rb +7 -0
  744. data/mod/standard/spec/set/type/email_template_spec.rb +212 -0
  745. data/mod/standard/spec/set/type/file_spec.rb +99 -0
  746. data/mod/standard/spec/set/type/html_spec.rb +28 -0
  747. data/mod/standard/spec/set/type/image_spec.rb +135 -0
  748. data/mod/standard/spec/set/type/layout_type_spec.rb +7 -0
  749. data/mod/standard/spec/set/type/list_spec.rb +140 -0
  750. data/mod/standard/spec/set/type/listed_by_spec.rb +158 -0
  751. data/mod/standard/spec/set/type/number_spec.rb +7 -0
  752. data/mod/standard/spec/set/type/phrase_spec.rb +7 -0
  753. data/mod/standard/spec/set/type/search_type_spec.rb +67 -0
  754. data/mod/standard/spec/set/type/set_spec.rb +26 -0
  755. data/mod/standard/spec/set/type/toggle_spec.rb +13 -0
  756. data/mod/standard/spec/set/type/uri_spec.rb +54 -0
  757. data/mod/tinymce_editor/db/migrate_cards/20160804112560_add_tinymce_cards.rb +40 -0
  758. data/mod/{03_machines → tinymce_editor}/lib/javascript/script_tinymce.js +0 -0
  759. data/mod/tinymce_editor/lib/javascript/script_tinymce_config.js.coffee +35 -0
  760. data/mod/tinymce_editor/set/abstract/tinymce_editor.rb +6 -0
  761. data/mod/tinymce_editor/set/self/script_tinymce.rb +3 -0
  762. data/mod/tinymce_editor/set/self/script_tinymce_config.rb +5 -0
  763. data/spec/card_spec_helper.rb +137 -0
  764. data/spec/config/initializers/core_extensions_spec.rb +3 -3
  765. data/spec/lib/card/action_spec.rb +6 -6
  766. data/spec/lib/card/auth_spec.rb +18 -18
  767. data/spec/lib/card/cache_spec.rb +46 -46
  768. data/spec/lib/card/chunk_spec.rb +9 -8
  769. data/spec/lib/card/codename_spec.rb +4 -4
  770. data/spec/lib/card/content_spec.rb +115 -115
  771. data/spec/lib/card/diff_spec.rb +68 -68
  772. data/spec/lib/card/format/nest_spec.rb +11 -0
  773. data/spec/lib/card/format_spec.rb +28 -28
  774. data/spec/lib/card/i18n_spec.rb +40 -0
  775. data/spec/lib/card/loader/Modfile +2 -0
  776. data/spec/lib/card/loader/mod_dirs.rb +8 -0
  777. data/spec/lib/card/loader_spec.rb +3 -3
  778. data/spec/lib/card/migration/import_spec.rb +72 -0
  779. data/spec/lib/card/name_spec.rb +147 -147
  780. data/spec/lib/card/query_spec.rb +282 -280
  781. data/spec/lib/card/reference_spec.rb +124 -124
  782. data/spec/lib/card/set/trait_spec.rb +38 -22
  783. data/spec/lib/card/set_pattern_spec.rb +30 -32
  784. data/spec/lib/card/set_spec.rb +4 -3
  785. data/spec/lib/card/stage_director_spec.rb +145 -75
  786. data/spec/lib/card/subcards_spec.rb +72 -68
  787. data/spec/lib/card/success_spec.rb +55 -55
  788. data/spec/lib/card/view_cache_spec.rb +5 -5
  789. data/spec/mailers/mailer_spec.rb +1 -1
  790. data/spec/models/card/cardtype_spec.rb +62 -62
  791. data/spec/models/card/create_spec.rb +44 -44
  792. data/spec/models/card/trash_spec.rb +86 -86
  793. data/spec/models/card/type_transition_spec.rb +28 -28
  794. data/spec/models/card/validation_spec.rb +11 -11
  795. data/spec/models/card_spec.rb +69 -69
  796. data/spec/spec_helper.rb +59 -23
  797. data/tmpsets/set/mod001-core/abstract/code_file.rb +79 -0
  798. data/tmpsets/set/mod001-core/all/actify.rb +100 -0
  799. data/tmpsets/set/mod001-core/all/active_card.rb +42 -0
  800. data/tmpsets/set/mod001-core/all/collection.rb +313 -0
  801. data/tmpsets/set/mod001-core/all/content.rb +69 -0
  802. data/tmpsets/set/mod001-core/all/erb.rb +18 -0
  803. data/tmpsets/set/mod001-core/all/event.rb +62 -0
  804. data/tmpsets/set/mod001-core/all/export.rb +49 -0
  805. data/tmpsets/set/mod001-core/all/fetch.rb +335 -0
  806. data/tmpsets/set/mod001-core/all/haml.rb +14 -0
  807. data/tmpsets/set/mod001-core/all/initialize.rb +42 -0
  808. data/tmpsets/set/mod001-core/all/location_history.rb +15 -0
  809. data/tmpsets/set/mod001-core/all/name.rb +282 -0
  810. data/tmpsets/set/mod001-core/all/name_validations.rb +65 -0
  811. data/tmpsets/set/mod001-core/all/pattern.rb +67 -0
  812. data/tmpsets/set/mod001-core/all/permissions.rb +309 -0
  813. data/tmpsets/set/mod001-core/all/phases.rb +23 -0
  814. data/tmpsets/set/mod001-core/all/references.rb +187 -0
  815. data/tmpsets/set/mod001-core/all/rules.rb +311 -0
  816. data/tmpsets/set/mod001-core/all/stages.rb +31 -0
  817. data/tmpsets/set/mod001-core/all/states.rb +31 -0
  818. data/tmpsets/set/mod001-core/all/subcards.rb +85 -0
  819. data/tmpsets/set/mod001-core/all/templating.rb +78 -0
  820. data/tmpsets/set/mod001-core/all/tracked_attributes.rb +154 -0
  821. data/tmpsets/set/mod001-core/all/trash.rb +63 -0
  822. data/tmpsets/set/mod001-core/all/type.rb +60 -0
  823. data/tmpsets/set/mod001-core/all/utils.rb +132 -0
  824. data/tmpsets/set/mod001-core/all/view_cache.rb +16 -0
  825. data/tmpsets/set/mod002-history/all/actions.rb +60 -0
  826. data/tmpsets/set/mod002-history/all/content_history.rb +168 -0
  827. data/tmpsets/set/mod002-history/all/history.rb +407 -0
  828. data/tmpsets/set/mod003-basic_formats/all/all_css.rb +45 -0
  829. data/tmpsets/set/mod003-basic_formats/all/all_csv.rb +56 -0
  830. data/tmpsets/set/mod003-basic_formats/all/all_js.rb +13 -0
  831. data/tmpsets/set/mod003-basic_formats/all/base.rb +155 -0
  832. data/tmpsets/set/mod003-basic_formats/all/file.rb +16 -0
  833. data/tmpsets/set/mod003-basic_formats/all/json.rb +76 -0
  834. data/tmpsets/set/mod003-basic_formats/all/rss.rb +77 -0
  835. data/tmpsets/set/mod003-basic_formats/all/text.rb +13 -0
  836. data/tmpsets/set/mod003-basic_formats/self/01_head/javascript.rb +79 -0
  837. data/tmpsets/set/mod003-basic_formats/self/head.rb +101 -0
  838. data/tmpsets/set/mod004-pointer/abstract/01_pointer.rb +193 -0
  839. data/tmpsets/set/mod004-pointer/abstract/01_pointer/edit.rb +224 -0
  840. data/tmpsets/set/mod004-pointer/abstract/code_pointer.rb +16 -0
  841. data/tmpsets/set/mod004-pointer/self/script_editors.rb +8 -0
  842. data/tmpsets/set/mod004-pointer/self/script_mods.rb +8 -0
  843. data/tmpsets/set/mod004-pointer/self/script_pointer_config.rb +10 -0
  844. data/tmpsets/set/mod004-pointer/type/pointer.rb +8 -0
  845. data/tmpsets/set/mod005-ace_editor/abstract/ace_editor.rb +18 -0
  846. data/tmpsets/set/mod005-ace_editor/self/script_ace.rb +10 -0
  847. data/tmpsets/set/mod005-ace_editor/self/script_ace_config.rb +12 -0
  848. data/tmpsets/set/mod006-prosemirror_editor/abstract/prosemirror_editor.rb +14 -0
  849. data/tmpsets/set/mod006-prosemirror_editor/self/script_prosemirror.rb +10 -0
  850. data/tmpsets/set/mod006-prosemirror_editor/self/script_prosemirror_config.rb +13 -0
  851. data/tmpsets/set/mod008-solid_cache/abstract/solid_cache.rb +106 -0
  852. data/tmpsets/set/mod008-solid_cache/all/solid_cache.rb +21 -0
  853. data/tmpsets/set/mod008-solid_cache/right/solid_cache.rb +39 -0
  854. data/tmpsets/set/mod009-basic_types/type/html.rb +26 -0
  855. data/tmpsets/set/mod009-basic_types/type/plain_text.rb +19 -0
  856. data/tmpsets/set/mod010-machines/abstract/script.rb +49 -0
  857. data/tmpsets/set/mod010-machines/all/reset_machines.rb +19 -0
  858. data/tmpsets/set/mod010-machines/right/machine_cache.rb +18 -0
  859. data/tmpsets/set/mod010-machines/right/machine_input.rb +10 -0
  860. data/tmpsets/set/mod010-machines/right/machine_output.rb +39 -0
  861. data/tmpsets/set/mod010-machines/self/script_card_menu.rb +8 -0
  862. data/tmpsets/set/mod010-machines/self/script_html5shiv_printshiv.rb +8 -0
  863. data/tmpsets/set/mod010-machines/self/script_jquery.rb +8 -0
  864. data/tmpsets/set/mod010-machines/self/script_jquery_helper.rb +16 -0
  865. data/tmpsets/set/mod010-machines/self/script_slot.rb +14 -0
  866. data/tmpsets/set/mod010-machines/self/style_bootstrap_compatible.rb +8 -0
  867. data/tmpsets/set/mod010-machines/self/style_cards.rb +8 -0
  868. data/tmpsets/set/mod010-machines/self/style_jquery_ui_smoothness.rb +8 -0
  869. data/tmpsets/set/mod010-machines/type/coffee_script.rb +47 -0
  870. data/tmpsets/set/mod010-machines/type/css.rb +67 -0
  871. data/tmpsets/set/mod010-machines/type/java_script.rb +36 -0
  872. data/tmpsets/set/mod010-machines/type/scss.rb +21 -0
  873. data/tmpsets/set/mod010-machines/type/skin.rb +13 -0
  874. data/tmpsets/set/mod011-settings/abstract/permission.rb +119 -0
  875. data/tmpsets/set/mod011-settings/right/add_help.rb +18 -0
  876. data/tmpsets/set/mod011-settings/right/comment.rb +8 -0
  877. data/tmpsets/set/mod011-settings/right/create.rb +8 -0
  878. data/tmpsets/set/mod011-settings/right/default.rb +14 -0
  879. data/tmpsets/set/mod011-settings/right/delete.rb +8 -0
  880. data/tmpsets/set/mod011-settings/right/help.rb +10 -0
  881. data/tmpsets/set/mod011-settings/right/read.rb +10 -0
  882. data/tmpsets/set/mod011-settings/right/script.rb +16 -0
  883. data/tmpsets/set/mod011-settings/right/structure.rb +68 -0
  884. data/tmpsets/set/mod011-settings/right/style.rb +17 -0
  885. data/tmpsets/set/mod011-settings/right/update.rb +8 -0
  886. data/tmpsets/set/mod011-settings/self/accountable.rb +10 -0
  887. data/tmpsets/set/mod011-settings/self/add_help.rb +9 -0
  888. data/tmpsets/set/mod011-settings/self/autoname.rb +9 -0
  889. data/tmpsets/set/mod011-settings/self/captcha.rb +9 -0
  890. data/tmpsets/set/mod011-settings/self/create.rb +9 -0
  891. data/tmpsets/set/mod011-settings/self/default.rb +9 -0
  892. data/tmpsets/set/mod011-settings/self/default_html_view.rb +9 -0
  893. data/tmpsets/set/mod011-settings/self/delete.rb +9 -0
  894. data/tmpsets/set/mod011-settings/self/follow_fields.rb +9 -0
  895. data/tmpsets/set/mod011-settings/self/help.rb +9 -0
  896. data/tmpsets/set/mod011-settings/self/input.rb +11 -0
  897. data/tmpsets/set/mod011-settings/self/layout.rb +9 -0
  898. data/tmpsets/set/mod011-settings/self/on_create.rb +9 -0
  899. data/tmpsets/set/mod011-settings/self/on_delete.rb +9 -0
  900. data/tmpsets/set/mod011-settings/self/on_update.rb +9 -0
  901. data/tmpsets/set/mod011-settings/self/options.rb +11 -0
  902. data/tmpsets/set/mod011-settings/self/options_label.rb +11 -0
  903. data/tmpsets/set/mod011-settings/self/read.rb +9 -0
  904. data/tmpsets/set/mod011-settings/self/recent_settings.rb +10 -0
  905. data/tmpsets/set/mod011-settings/self/script.rb +9 -0
  906. data/tmpsets/set/mod011-settings/self/structure.rb +9 -0
  907. data/tmpsets/set/mod011-settings/self/style.rb +9 -0
  908. data/tmpsets/set/mod011-settings/self/table_of_contents.rb +9 -0
  909. data/tmpsets/set/mod011-settings/self/thanks.rb +9 -0
  910. data/tmpsets/set/mod011-settings/self/update.rb +9 -0
  911. data/tmpsets/set/mod011-settings/type/setting.rb +111 -0
  912. data/tmpsets/set/mod012-email/all/email_html.rb +11 -0
  913. data/tmpsets/set/mod012-email/all/email_text.rb +12 -0
  914. data/tmpsets/set/mod012-email/all/follow.rb +253 -0
  915. data/tmpsets/set/mod012-email/all/notify.rb +271 -0
  916. data/tmpsets/set/mod012-email/all/observer.rb +33 -0
  917. data/tmpsets/set/mod012-email/right/bcc.rb +47 -0
  918. data/tmpsets/set/mod012-email/right/cc.rb +10 -0
  919. data/tmpsets/set/mod012-email/right/follow.rb +106 -0
  920. data/tmpsets/set/mod012-email/right/follow_fields.rb +10 -0
  921. data/tmpsets/set/mod012-email/right/followers.rb +41 -0
  922. data/tmpsets/set/mod012-email/right/following.rb +65 -0
  923. data/tmpsets/set/mod012-email/right/from.rb +10 -0
  924. data/tmpsets/set/mod012-email/right/html_message.rb +10 -0
  925. data/tmpsets/set/mod012-email/right/to.rb +10 -0
  926. data/tmpsets/set/mod012-email/self/always.rb +20 -0
  927. data/tmpsets/set/mod012-email/self/created.rb +26 -0
  928. data/tmpsets/set/mod012-email/self/edited.rb +27 -0
  929. data/tmpsets/set/mod012-email/self/follow.rb +9 -0
  930. data/tmpsets/set/mod012-email/self/follow_defaults.rb +75 -0
  931. data/tmpsets/set/mod012-email/self/never.rb +20 -0
  932. data/tmpsets/set/mod012-email/type/email_template.rb +133 -0
  933. data/tmpsets/set/mod012-email/type_plus_right/user/follow.rb +184 -0
  934. data/tmpsets/set/mod013-carrierwave/abstract/attachment.rb +282 -0
  935. data/tmpsets/set/mod013-carrierwave/type/file.rb +155 -0
  936. data/tmpsets/set/mod013-carrierwave/type/image.rb +96 -0
  937. data/tmpsets/set/mod014-admin/self/admin.rb +113 -0
  938. data/tmpsets/set/mod014-admin/self/admin_info.rb +110 -0
  939. data/tmpsets/set/mod014-admin/self/version.rb +15 -0
  940. data/tmpsets/set/mod015-developer/all/event_viz.rb +59 -0
  941. data/tmpsets/set/mod015-developer/all/view_viz.rb +30 -0
  942. data/tmpsets/set/mod015-developer/right/debug.rb +96 -0
  943. data/tmpsets/set/mod016-standard/all/comment.rb +67 -0
  944. data/tmpsets/set/mod016-standard/all/error.rb +229 -0
  945. data/tmpsets/set/mod016-standard/all/links.rb +165 -0
  946. data/tmpsets/set/mod016-standard/all/list_changes.rb +53 -0
  947. data/tmpsets/set/mod016-standard/all/rich_html/content.rb +261 -0
  948. data/tmpsets/set/mod016-standard/all/rich_html/editing.rb +247 -0
  949. data/tmpsets/set/mod016-standard/all/rich_html/form.rb +298 -0
  950. data/tmpsets/set/mod016-standard/all/rich_html/header.rb +78 -0
  951. data/tmpsets/set/mod016-standard/all/rich_html/menu.rb +154 -0
  952. data/tmpsets/set/mod016-standard/all/rich_html/modal.rb +58 -0
  953. data/tmpsets/set/mod016-standard/all/rich_html/toolbar.rb +312 -0
  954. data/tmpsets/set/mod016-standard/all/rich_html/wrapper.rb +191 -0
  955. data/tmpsets/set/mod016-standard/right/discussion.rb +10 -0
  956. data/tmpsets/set/mod016-standard/right/when_created.rb +14 -0
  957. data/tmpsets/set/mod016-standard/right/when_last_edited.rb +14 -0
  958. data/tmpsets/set/mod016-standard/rstar/rules.rb +107 -0
  959. data/tmpsets/set/mod016-standard/rstar/rules_editor.rb +371 -0
  960. data/tmpsets/set/mod016-standard/self/alerts.rb +12 -0
  961. data/tmpsets/set/mod016-standard/self/codenames.rb +7 -0
  962. data/tmpsets/set/mod016-standard/self/foot.rb +15 -0
  963. data/tmpsets/set/mod016-standard/self/navbox.rb +36 -0
  964. data/tmpsets/set/mod016-standard/self/now.rb +14 -0
  965. data/tmpsets/set/mod016-standard/self/recent.rb +34 -0
  966. data/tmpsets/set/mod016-standard/self/search.rb +71 -0
  967. data/tmpsets/set/mod016-standard/type/basic.rb +59 -0
  968. data/tmpsets/set/mod016-standard/type/cardtype.rb +81 -0
  969. data/tmpsets/set/mod016-standard/type/date.rb +15 -0
  970. data/tmpsets/set/mod016-standard/type/layout_type.rb +17 -0
  971. data/tmpsets/set/mod016-standard/type/list.rb +120 -0
  972. data/tmpsets/set/mod016-standard/type/listed_by.rb +85 -0
  973. data/tmpsets/set/mod016-standard/type/number.rb +25 -0
  974. data/tmpsets/set/mod016-standard/type/phrase.rb +10 -0
  975. data/tmpsets/set/mod016-standard/type/search_type.rb +339 -0
  976. data/tmpsets/set/mod016-standard/type/session.rb +42 -0
  977. data/tmpsets/set/mod016-standard/type/set.rb +371 -0
  978. data/tmpsets/set/mod016-standard/type/toggle.rb +19 -0
  979. data/tmpsets/set/mod016-standard/type/uri.rb +18 -0
  980. data/tmpsets/set/mod017-account/all/account.rb +72 -0
  981. data/tmpsets/set/mod017-account/right/account.rb +196 -0
  982. data/tmpsets/set/mod017-account/right/email.rb +61 -0
  983. data/tmpsets/set/mod017-account/right/password.rb +54 -0
  984. data/tmpsets/set/mod017-account/right/salt.rb +12 -0
  985. data/tmpsets/set/mod017-account/right/status.rb +16 -0
  986. data/tmpsets/set/mod017-account/right/token.rb +57 -0
  987. data/tmpsets/set/mod017-account/self/account_links.rb +72 -0
  988. data/tmpsets/set/mod017-account/self/signin.rb +165 -0
  989. data/tmpsets/set/mod017-account/type/signup.rb +175 -0
  990. data/tmpsets/set/mod017-account/type/user.rb +88 -0
  991. data/tmpsets/set/mod018-bootstrap/all/bootstrap/form.rb +42 -0
  992. data/tmpsets/set/mod018-bootstrap/all/bootstrap/helper.rb +236 -0
  993. data/tmpsets/set/mod018-bootstrap/all/bootstrap/table.rb +68 -0
  994. data/tmpsets/set/mod018-bootstrap/all/bootstrap/tabs.rb +88 -0
  995. data/tmpsets/set/mod018-bootstrap/all/bootstrap/wrapper.rb +18 -0
  996. data/tmpsets/set/mod018-bootstrap/all/rich_bootstrap.rb +13 -0
  997. data/tmpsets/set/mod018-bootstrap/self/bootstrap_cards.rb +8 -0
  998. data/tmpsets/set/mod018-bootstrap/self/bootstrap_js.rb +12 -0
  999. data/tmpsets/set/mod018-bootstrap/self/bootswatch_shared.rb +47 -0
  1000. data/tmpsets/set/mod018-bootstrap/self/script_mods.rb +7 -0
  1001. data/tmpsets/set/mod018-bootstrap/self/smartmenu_css.rb +12 -0
  1002. data/tmpsets/set/mod018-bootstrap/self/smartmenu_js.rb +12 -0
  1003. data/tmpsets/set_pattern/100-all.rb +8 -8
  1004. data/tmpsets/set_pattern/101-all_plus.rb +7 -7
  1005. data/tmpsets/set_pattern/102-type.rb +5 -5
  1006. data/tmpsets/set_pattern/103-star.rb +7 -7
  1007. data/tmpsets/set_pattern/104-rstar.rb +7 -7
  1008. data/tmpsets/set_pattern/105-right.rb +5 -5
  1009. data/tmpsets/set_pattern/106-type_plus_right.rb +6 -6
  1010. data/tmpsets/set_pattern/107-self.rb +4 -4
  1011. metadata +855 -735
  1012. data/.yardoc/checksums +0 -268
  1013. data/.yardoc/object_types +0 -0
  1014. data/.yardoc/objects/root.dat +0 -0
  1015. data/.yardoc/proxy_types +0 -0
  1016. data/db/migrate_core_cards/20141208162106_add_ace_script.rb +0 -9
  1017. data/lib/card/active_record_ext.rb +0 -75
  1018. data/lib/card/active_record_helper.rb +0 -53
  1019. data/lib/card/core_migration.rb +0 -6
  1020. data/lib/card/diff.rb +0 -69
  1021. data/lib/card/diff/lcs.rb +0 -247
  1022. data/lib/card/diff/result.rb +0 -131
  1023. data/lib/card/exceptions.rb +0 -42
  1024. data/lib/card/loader.rb +0 -181
  1025. data/lib/card/location.rb +0 -36
  1026. data/lib/card/simplecov_helper.rb +0 -70
  1027. data/lib/card/spec_helper.rb +0 -147
  1028. data/lib/card/success.rb +0 -142
  1029. data/lib/card/view_cache.rb +0 -94
  1030. data/lib/card/view_name.rb +0 -46
  1031. data/mod/01_core/chunk/include.rb +0 -131
  1032. data/mod/01_core/chunk/link.rb +0 -96
  1033. data/mod/01_core/chunk/literal.rb +0 -27
  1034. data/mod/01_core/chunk/query_reference.rb +0 -83
  1035. data/mod/01_core/chunk/uri.rb +0 -128
  1036. data/mod/01_core/format/data_format.rb +0 -2
  1037. data/mod/01_core/format/html_format.rb +0 -77
  1038. data/mod/01_core/format/text_format.rb +0 -10
  1039. data/mod/01_core/set/all/actify.rb +0 -107
  1040. data/mod/01_core/set/all/collection.rb +0 -303
  1041. data/mod/01_core/set/all/content.rb +0 -62
  1042. data/mod/01_core/set/all/erb.rb +0 -11
  1043. data/mod/01_core/set/all/event.rb +0 -74
  1044. data/mod/01_core/set/all/fetch.rb +0 -339
  1045. data/mod/01_core/set/all/initialize.rb +0 -35
  1046. data/mod/01_core/set/all/name.rb +0 -275
  1047. data/mod/01_core/set/all/name_validations.rb +0 -56
  1048. data/mod/01_core/set/all/pattern.rb +0 -56
  1049. data/mod/01_core/set/all/permissions.rb +0 -301
  1050. data/mod/01_core/set/all/phases.rb +0 -16
  1051. data/mod/01_core/set/all/references.rb +0 -180
  1052. data/mod/01_core/set/all/rules.rb +0 -305
  1053. data/mod/01_core/set/all/stages.rb +0 -24
  1054. data/mod/01_core/set/all/states.rb +0 -24
  1055. data/mod/01_core/set/all/subcards.rb +0 -64
  1056. data/mod/01_core/set/all/templating.rb +0 -69
  1057. data/mod/01_core/set/all/tracked_attributes.rb +0 -147
  1058. data/mod/01_core/set/all/trash.rb +0 -56
  1059. data/mod/01_core/set/all/type.rb +0 -53
  1060. data/mod/01_core/set/all/utils.rb +0 -180
  1061. data/mod/01_core/set/all/view_cache.rb +0 -9
  1062. data/mod/01_core/set_pattern/01_all.rb +0 -11
  1063. data/mod/01_core/set_pattern/02_all_plus.rb +0 -13
  1064. data/mod/01_core/set_pattern/04_star.rb +0 -15
  1065. data/mod/01_core/set_pattern/05_rstar.rb +0 -17
  1066. data/mod/01_core/set_pattern/07_type_plus_right.rb +0 -26
  1067. data/mod/01_core/spec/chunk/literal_spec.rb +0 -13
  1068. data/mod/01_core/spec/chunk/uri_spec.rb +0 -293
  1069. data/mod/01_core/spec/format/data_format_spec.rb +0 -5
  1070. data/mod/01_core/spec/format/html_format_spec.rb +0 -154
  1071. data/mod/01_core/spec/format/text_format_spec.rb +0 -5
  1072. data/mod/01_core/spec/set/all/collection_spec.rb +0 -162
  1073. data/mod/01_core/spec/set/all/content_spec.rb +0 -15
  1074. data/mod/01_core/spec/set/all/fetch_spec.rb +0 -279
  1075. data/mod/01_core/spec/set/all/initialize_spec.rb +0 -88
  1076. data/mod/01_core/spec/set/all/name_spec.rb +0 -60
  1077. data/mod/01_core/spec/set/all/pattern_spec.rb +0 -78
  1078. data/mod/01_core/spec/set/all/permissions_spec.rb +0 -538
  1079. data/mod/01_core/spec/set/all/references_spec.rb +0 -9
  1080. data/mod/01_core/spec/set/all/rules2_spec.rb +0 -238
  1081. data/mod/01_core/spec/set/all/rules_spec.rb +0 -137
  1082. data/mod/01_core/spec/set/all/templating_spec.rb +0 -119
  1083. data/mod/01_core/spec/set/all/tracked_attributes_spec.rb +0 -313
  1084. data/mod/01_core/spec/set/all/trash_spec.rb +0 -81
  1085. data/mod/01_core/spec/set/all/type_spec.rb +0 -51
  1086. data/mod/01_history/lib/card/act.rb +0 -88
  1087. data/mod/01_history/lib/card/action.rb +0 -193
  1088. data/mod/01_history/lib/card/change.rb +0 -41
  1089. data/mod/01_history/set/all/actions.rb +0 -54
  1090. data/mod/01_history/set/all/content_history.rb +0 -161
  1091. data/mod/01_history/set/all/history.rb +0 -400
  1092. data/mod/02_basic_types/format/css_format.rb +0 -6
  1093. data/mod/02_basic_types/format/csv_format.rb +0 -6
  1094. data/mod/02_basic_types/format/file_format.rb +0 -3
  1095. data/mod/02_basic_types/format/js_format.rb +0 -6
  1096. data/mod/02_basic_types/format/json_format.rb +0 -6
  1097. data/mod/02_basic_types/format/rss_format.rb +0 -10
  1098. data/mod/02_basic_types/format/xml_format.rb +0 -6
  1099. data/mod/02_basic_types/set/abstract/code_file.rb +0 -63
  1100. data/mod/02_basic_types/set/all/all_css.rb +0 -38
  1101. data/mod/02_basic_types/set/all/all_csv.rb +0 -49
  1102. data/mod/02_basic_types/set/all/base.rb +0 -150
  1103. data/mod/02_basic_types/set/all/file.rb +0 -9
  1104. data/mod/02_basic_types/set/all/json.rb +0 -67
  1105. data/mod/02_basic_types/set/all/rss.rb +0 -70
  1106. data/mod/02_basic_types/set/type/html.rb +0 -23
  1107. data/mod/02_basic_types/set/type/plain_text.rb +0 -12
  1108. data/mod/02_basic_types/set/type/pointer.rb +0 -384
  1109. data/mod/02_basic_types/spec/set/all/all_css_spec.rb +0 -10
  1110. data/mod/02_basic_types/spec/set/all/all_csv_spec.rb +0 -11
  1111. data/mod/02_basic_types/spec/set/all/base_spec.rb +0 -89
  1112. data/mod/02_basic_types/spec/set/all/json_spec.rb +0 -26
  1113. data/mod/02_basic_types/spec/set/all/rss_spec.rb +0 -22
  1114. data/mod/02_basic_types/spec/set/type/plain_text_spec.rb +0 -11
  1115. data/mod/02_basic_types/spec/set/type/pointer_spec.rb +0 -201
  1116. data/mod/03_machines/lib/card/machine.rb +0 -218
  1117. data/mod/03_machines/lib/card/machine_input.rb +0 -65
  1118. data/mod/03_machines/lib/javascript/wagn.js.coffee +0 -365
  1119. data/mod/03_machines/lib/javascript/wagn_mod.js.coffee +0 -557
  1120. data/mod/03_machines/lib/stylesheets/style_cards.scss +0 -940
  1121. data/mod/03_machines/set/self/script_ace.rb +0 -1
  1122. data/mod/03_machines/set/self/script_slot.rb +0 -5
  1123. data/mod/03_machines/set/self/script_tinymce.rb +0 -1
  1124. data/mod/03_machines/set/type/coffee_script.rb +0 -57
  1125. data/mod/03_machines/set/type/css.rb +0 -57
  1126. data/mod/03_machines/set/type/java_script.rb +0 -50
  1127. data/mod/03_machines/set/type/scss.rb +0 -22
  1128. data/mod/03_machines/set/type/skin.rb +0 -9
  1129. data/mod/03_machines/spec/lib/shared_machine_examples.rb +0 -170
  1130. data/mod/03_machines/spec/lib/shared_machine_input_examples.rb +0 -64
  1131. data/mod/03_machines/spec/set/type/coffeescript_spec.rb +0 -35
  1132. data/mod/03_machines/spec/set/type/css_spec.rb +0 -40
  1133. data/mod/03_machines/spec/set/type/javascript_spec.rb +0 -34
  1134. data/mod/03_machines/spec/set/type/scss_spec.rb +0 -62
  1135. data/mod/03_machines/spec/set/type/skin_spec.rb +0 -68
  1136. data/mod/04_settings/lib/card/setting.rb +0 -82
  1137. data/mod/04_settings/set/abstract/permission.rb +0 -94
  1138. data/mod/04_settings/set/right/comment.rb +0 -3
  1139. data/mod/04_settings/set/right/create.rb +0 -3
  1140. data/mod/04_settings/set/right/delete.rb +0 -3
  1141. data/mod/04_settings/set/right/script.rb +0 -9
  1142. data/mod/04_settings/set/right/style.rb +0 -10
  1143. data/mod/04_settings/set/right/update.rb +0 -3
  1144. data/mod/04_settings/set/self/accountable.rb +0 -3
  1145. data/mod/04_settings/set/self/input.rb +0 -2
  1146. data/mod/04_settings/set/self/options.rb +0 -2
  1147. data/mod/04_settings/set/self/options_label.rb +0 -2
  1148. data/mod/04_settings/set/type/setting.rb +0 -88
  1149. data/mod/04_settings/spec/set/right/comment_spec.rb +0 -38
  1150. data/mod/04_settings/spec/set/right/create_spec.rb +0 -10
  1151. data/mod/04_settings/spec/set/right/script_spec.rb +0 -24
  1152. data/mod/04_settings/spec/set/right/structure_spec.rb +0 -25
  1153. data/mod/04_settings/spec/set/right/style_spec.rb +0 -29
  1154. data/mod/04_settings/spec/set/type/setting_spec.rb +0 -10
  1155. data/mod/05_email/format/email_html_format.rb +0 -9
  1156. data/mod/05_email/format/email_text_format.rb +0 -11
  1157. data/mod/05_email/lib/card/follow_option.rb +0 -87
  1158. data/mod/05_email/set/all/email_html.rb +0 -4
  1159. data/mod/05_email/set/all/email_text.rb +0 -5
  1160. data/mod/05_email/set/all/follow.rb +0 -245
  1161. data/mod/05_email/set/all/notify.rb +0 -255
  1162. data/mod/05_email/set/right/bcc.rb +0 -40
  1163. data/mod/05_email/set/right/follow.rb +0 -99
  1164. data/mod/05_email/set/right/followers.rb +0 -34
  1165. data/mod/05_email/set/right/following.rb +0 -58
  1166. data/mod/05_email/set/self/always.rb +0 -13
  1167. data/mod/05_email/set/self/created.rb +0 -19
  1168. data/mod/05_email/set/self/edited.rb +0 -20
  1169. data/mod/05_email/set/self/follow_defaults.rb +0 -68
  1170. data/mod/05_email/set/self/never.rb +0 -13
  1171. data/mod/05_email/set/type/email_template.rb +0 -126
  1172. data/mod/05_email/set/type_plus_right/user/follow.rb +0 -177
  1173. data/mod/05_email/spec/set/all/follow_spec.rb +0 -126
  1174. data/mod/05_email/spec/set/all/notify_spec.rb +0 -378
  1175. data/mod/05_email/spec/set/all/observer_spec.rb +0 -97
  1176. data/mod/05_email/spec/set/right/followers_spec.rb +0 -121
  1177. data/mod/05_email/spec/set/self/follow_defaults_spec.rb +0 -18
  1178. data/mod/05_standard/lib/carrier_wave/cardmount.rb +0 -113
  1179. data/mod/05_standard/lib/file_uploader.rb +0 -148
  1180. data/mod/05_standard/lib/image_uploader.rb +0 -52
  1181. data/mod/05_standard/set/abstract/attachment.rb +0 -277
  1182. data/mod/05_standard/set/all/account.rb +0 -65
  1183. data/mod/05_standard/set/all/comment.rb +0 -59
  1184. data/mod/05_standard/set/all/error.rb +0 -222
  1185. data/mod/05_standard/set/all/event_viz.rb +0 -56
  1186. data/mod/05_standard/set/all/links.rb +0 -158
  1187. data/mod/05_standard/set/all/list_changes.rb +0 -46
  1188. data/mod/05_standard/set/all/rich_html/content.rb +0 -254
  1189. data/mod/05_standard/set/all/rich_html/editing.rb +0 -241
  1190. data/mod/05_standard/set/all/rich_html/form.rb +0 -301
  1191. data/mod/05_standard/set/all/rich_html/header.rb +0 -65
  1192. data/mod/05_standard/set/all/rich_html/menu.rb +0 -127
  1193. data/mod/05_standard/set/all/rich_html/modal.rb +0 -51
  1194. data/mod/05_standard/set/all/rich_html/toolbar.rb +0 -305
  1195. data/mod/05_standard/set/all/rich_html/wrapper.rb +0 -157
  1196. data/mod/05_standard/set/right/account.rb +0 -189
  1197. data/mod/05_standard/set/right/email.rb +0 -54
  1198. data/mod/05_standard/set/right/password.rb +0 -47
  1199. data/mod/05_standard/set/right/salt.rb +0 -5
  1200. data/mod/05_standard/set/right/stats.rb +0 -32
  1201. data/mod/05_standard/set/right/status.rb +0 -9
  1202. data/mod/05_standard/set/right/token.rb +0 -52
  1203. data/mod/05_standard/set/right/when_created.rb +0 -5
  1204. data/mod/05_standard/set/right/when_last_edited.rb +0 -5
  1205. data/mod/05_standard/set/rstar/rules_editor.rb +0 -364
  1206. data/mod/05_standard/set/self/account_links.rb +0 -48
  1207. data/mod/05_standard/set/self/admin_info.rb +0 -82
  1208. data/mod/05_standard/set/self/alerts.rb +0 -5
  1209. data/mod/05_standard/set/self/all.rb +0 -19
  1210. data/mod/05_standard/set/self/foot.rb +0 -8
  1211. data/mod/05_standard/set/self/head.rb +0 -130
  1212. data/mod/05_standard/set/self/navbox.rb +0 -29
  1213. data/mod/05_standard/set/self/now.rb +0 -6
  1214. data/mod/05_standard/set/self/recent.rb +0 -27
  1215. data/mod/05_standard/set/self/search.rb +0 -64
  1216. data/mod/05_standard/set/self/signin.rb +0 -133
  1217. data/mod/05_standard/set/self/stats.rb +0 -87
  1218. data/mod/05_standard/set/self/version.rb +0 -8
  1219. data/mod/05_standard/set/type/basic.rb +0 -44
  1220. data/mod/05_standard/set/type/cardtype.rb +0 -74
  1221. data/mod/05_standard/set/type/date.rb +0 -7
  1222. data/mod/05_standard/set/type/file.rb +0 -137
  1223. data/mod/05_standard/set/type/image.rb +0 -89
  1224. data/mod/05_standard/set/type/layout_type.rb +0 -16
  1225. data/mod/05_standard/set/type/list.rb +0 -128
  1226. data/mod/05_standard/set/type/listed_by.rb +0 -93
  1227. data/mod/05_standard/set/type/number.rb +0 -18
  1228. data/mod/05_standard/set/type/phrase.rb +0 -3
  1229. data/mod/05_standard/set/type/search_type.rb +0 -316
  1230. data/mod/05_standard/set/type/session.rb +0 -35
  1231. data/mod/05_standard/set/type/set.rb +0 -341
  1232. data/mod/05_standard/set/type/signup.rb +0 -168
  1233. data/mod/05_standard/set/type/toggle.rb +0 -12
  1234. data/mod/05_standard/set/type/user.rb +0 -81
  1235. data/mod/05_standard/spec/chunk/include_spec.rb +0 -203
  1236. data/mod/05_standard/spec/chunk/link_spec.rb +0 -98
  1237. data/mod/05_standard/spec/chunk/query_reference_spec.rb +0 -49
  1238. data/mod/05_standard/spec/format/css_format_spec.rb +0 -5
  1239. data/mod/05_standard/spec/format/csv_format_spec.rb +0 -5
  1240. data/mod/05_standard/spec/format/email_html_format_spec.rb +0 -5
  1241. data/mod/05_standard/spec/format/file_format_spec.rb +0 -5
  1242. data/mod/05_standard/spec/format/js_format_spec.rb +0 -5
  1243. data/mod/05_standard/spec/format/json_format_spec.rb +0 -5
  1244. data/mod/05_standard/spec/format/rss_format_spec.rb +0 -5
  1245. data/mod/05_standard/spec/format/xml_format_spec.rb +0 -5
  1246. data/mod/05_standard/spec/set/all/account_spec.rb +0 -138
  1247. data/mod/05_standard/spec/set/all/email_html_spec.rb +0 -15
  1248. data/mod/05_standard/spec/set/all/error_spec.rb +0 -9
  1249. data/mod/05_standard/spec/set/all/history_spec.rb +0 -217
  1250. data/mod/05_standard/spec/set/all/links_spec.rb +0 -15
  1251. data/mod/05_standard/spec/set/all/rich_html/editing_spec.rb +0 -61
  1252. data/mod/05_standard/spec/set/all/rich_html/form_spec.rb +0 -43
  1253. data/mod/05_standard/spec/set/all/rich_html/wrapper_spec.rb +0 -32
  1254. data/mod/05_standard/spec/set/right/account_spec.rb +0 -187
  1255. data/mod/05_standard/spec/set/right/email_spec.rb +0 -52
  1256. data/mod/05_standard/spec/set/right/password_spec.rb +0 -41
  1257. data/mod/05_standard/spec/set/right/salt_spec.rb +0 -5
  1258. data/mod/05_standard/spec/set/right/stats_spec.rb +0 -12
  1259. data/mod/05_standard/spec/set/right/token_spec.rb +0 -23
  1260. data/mod/05_standard/spec/set/right/when_created_spec.rb +0 -7
  1261. data/mod/05_standard/spec/set/right/when_last_edited_spec.rb +0 -7
  1262. data/mod/05_standard/spec/set/rstar/rules_spec.rb +0 -25
  1263. data/mod/05_standard/spec/set/self/account_links_spec.rb +0 -9
  1264. data/mod/05_standard/spec/set/self/all_spec.rb +0 -43
  1265. data/mod/05_standard/spec/set/self/head_spec.rb +0 -15
  1266. data/mod/05_standard/spec/set/self/navbox_spec.rb +0 -7
  1267. data/mod/05_standard/spec/set/self/now_spec.rb +0 -7
  1268. data/mod/05_standard/spec/set/self/signin_spec.rb +0 -69
  1269. data/mod/05_standard/spec/set/self/stats_spec.rb +0 -12
  1270. data/mod/05_standard/spec/set/self/version_spec.rb +0 -7
  1271. data/mod/05_standard/spec/set/type/cardtype_spec.rb +0 -18
  1272. data/mod/05_standard/spec/set/type/date_spec.rb +0 -7
  1273. data/mod/05_standard/spec/set/type/email_template_spec.rb +0 -212
  1274. data/mod/05_standard/spec/set/type/file_spec.rb +0 -99
  1275. data/mod/05_standard/spec/set/type/html_spec.rb +0 -28
  1276. data/mod/05_standard/spec/set/type/image_spec.rb +0 -135
  1277. data/mod/05_standard/spec/set/type/layout_type_spec.rb +0 -7
  1278. data/mod/05_standard/spec/set/type/list_spec.rb +0 -140
  1279. data/mod/05_standard/spec/set/type/listed_by_spec.rb +0 -157
  1280. data/mod/05_standard/spec/set/type/number_spec.rb +0 -7
  1281. data/mod/05_standard/spec/set/type/phrase_spec.rb +0 -7
  1282. data/mod/05_standard/spec/set/type/search_type_spec.rb +0 -59
  1283. data/mod/05_standard/spec/set/type/set_spec.rb +0 -25
  1284. data/mod/05_standard/spec/set/type/signup_spec.rb +0 -242
  1285. data/mod/05_standard/spec/set/type/toggle_spec.rb +0 -12
  1286. data/mod/05_standard/spec/set/type/uri_spec.rb +0 -41
  1287. data/mod/06_bootstrap/set/all/bootstrap/form.rb +0 -34
  1288. data/mod/06_bootstrap/set/all/bootstrap/helper.rb +0 -140
  1289. data/mod/06_bootstrap/set/all/bootstrap/table.rb +0 -55
  1290. data/mod/06_bootstrap/set/all/bootstrap/tabs.rb +0 -81
  1291. data/mod/06_bootstrap/set/all/bootstrap/wrapper.rb +0 -11
  1292. data/mod/06_bootstrap/set/all/rich_bootstrap.rb +0 -6
  1293. data/mod/06_bootstrap/set/self/bootstrap_js.rb +0 -5
  1294. data/mod/06_bootstrap/set/self/bootswatch_shared.rb +0 -40
  1295. data/mod/06_bootstrap/set/self/smartmenu_css.rb +0 -5
  1296. data/mod/06_bootstrap/set/self/smartmenu_js.rb +0 -5
  1297. data/mod/06_bootstrap/spec/set/all/bootstrap/form_spec.rb +0 -13
  1298. data/tmpsets/README.md +0 -2
  1299. data/tmpsets/set/mod001-01_core/all/active_card.rb +0 -41
  1300. data/tmpsets/set/mod001-01_core/all/collection.rb +0 -348
  1301. data/tmpsets/set/mod001-01_core/all/content.rb +0 -67
  1302. data/tmpsets/set/mod001-01_core/all/erb.rb +0 -18
  1303. data/tmpsets/set/mod001-01_core/all/fetch.rb +0 -345
  1304. data/tmpsets/set/mod001-01_core/all/haml.rb +0 -14
  1305. data/tmpsets/set/mod001-01_core/all/initialize.rb +0 -48
  1306. data/tmpsets/set/mod001-01_core/all/name.rb +0 -348
  1307. data/tmpsets/set/mod001-01_core/all/pattern.rb +0 -64
  1308. data/tmpsets/set/mod001-01_core/all/permissions.rb +0 -298
  1309. data/tmpsets/set/mod001-01_core/all/phases.rb +0 -215
  1310. data/tmpsets/set/mod001-01_core/all/references.rb +0 -106
  1311. data/tmpsets/set/mod001-01_core/all/rules.rb +0 -317
  1312. data/tmpsets/set/mod001-01_core/all/states.rb +0 -29
  1313. data/tmpsets/set/mod001-01_core/all/templating.rb +0 -78
  1314. data/tmpsets/set/mod001-01_core/all/tracked_attributes.rb +0 -152
  1315. data/tmpsets/set/mod001-01_core/all/trash.rb +0 -63
  1316. data/tmpsets/set/mod001-01_core/all/type.rb +0 -73
  1317. data/tmpsets/set/mod001-01_core/all/utils.rb +0 -191
  1318. data/tmpsets/set/mod001-01_core/all/view_cache.rb +0 -15
  1319. data/tmpsets/set/mod002-01_history/all/actions.rb +0 -63
  1320. data/tmpsets/set/mod002-01_history/all/content_history.rb +0 -162
  1321. data/tmpsets/set/mod002-01_history/all/history.rb +0 -382
  1322. data/tmpsets/set/mod003-02_basic_types/all/all_css.rb +0 -49
  1323. data/tmpsets/set/mod003-02_basic_types/all/all_csv.rb +0 -59
  1324. data/tmpsets/set/mod003-02_basic_types/all/all_js.rb +0 -14
  1325. data/tmpsets/set/mod003-02_basic_types/all/base.rb +0 -157
  1326. data/tmpsets/set/mod003-02_basic_types/all/file.rb +0 -19
  1327. data/tmpsets/set/mod003-02_basic_types/all/json.rb +0 -73
  1328. data/tmpsets/set/mod003-02_basic_types/all/rss.rb +0 -77
  1329. data/tmpsets/set/mod003-02_basic_types/all/text.rb +0 -15
  1330. data/tmpsets/set/mod003-02_basic_types/type/html.rb +0 -34
  1331. data/tmpsets/set/mod003-02_basic_types/type/plain_text.rb +0 -20
  1332. data/tmpsets/set/mod003-02_basic_types/type/pointer.rb +0 -386
  1333. data/tmpsets/set/mod004-03_machines/right/machine_input.rb +0 -9
  1334. data/tmpsets/set/mod004-03_machines/right/machine_output.rb +0 -39
  1335. data/tmpsets/set/mod004-03_machines/self/script_ace.rb +0 -19
  1336. data/tmpsets/set/mod004-03_machines/self/script_card_menu.rb +0 -18
  1337. data/tmpsets/set/mod004-03_machines/self/script_html5shiv_printshiv.rb +0 -9
  1338. data/tmpsets/set/mod004-03_machines/self/script_jquery.rb +0 -9
  1339. data/tmpsets/set/mod004-03_machines/self/script_jquery_helper.rb +0 -19
  1340. data/tmpsets/set/mod004-03_machines/self/script_slot.rb +0 -14
  1341. data/tmpsets/set/mod004-03_machines/self/script_tinymce.rb +0 -9
  1342. data/tmpsets/set/mod004-03_machines/self/style_bootstrap_compatible.rb +0 -12
  1343. data/tmpsets/set/mod004-03_machines/self/style_cards.rb +0 -13
  1344. data/tmpsets/set/mod004-03_machines/self/style_jquery_ui_smoothness.rb +0 -10
  1345. data/tmpsets/set/mod004-03_machines/type/coffee_script.rb +0 -68
  1346. data/tmpsets/set/mod004-03_machines/type/css.rb +0 -56
  1347. data/tmpsets/set/mod004-03_machines/type/java_script.rb +0 -44
  1348. data/tmpsets/set/mod004-03_machines/type/scss.rb +0 -29
  1349. data/tmpsets/set/mod004-03_machines/type/skin.rb +0 -19
  1350. data/tmpsets/set/mod005-04_settings/abstract/permission.rb +0 -107
  1351. data/tmpsets/set/mod005-04_settings/right/add_help.rb +0 -18
  1352. data/tmpsets/set/mod005-04_settings/right/comment.rb +0 -10
  1353. data/tmpsets/set/mod005-04_settings/right/create.rb +0 -10
  1354. data/tmpsets/set/mod005-04_settings/right/default.rb +0 -10
  1355. data/tmpsets/set/mod005-04_settings/right/delete.rb +0 -10
  1356. data/tmpsets/set/mod005-04_settings/right/help.rb +0 -10
  1357. data/tmpsets/set/mod005-04_settings/right/read.rb +0 -10
  1358. data/tmpsets/set/mod005-04_settings/right/script.rb +0 -17
  1359. data/tmpsets/set/mod005-04_settings/right/structure.rb +0 -63
  1360. data/tmpsets/set/mod005-04_settings/right/style.rb +0 -17
  1361. data/tmpsets/set/mod005-04_settings/right/update.rb +0 -10
  1362. data/tmpsets/set/mod005-04_settings/self/accountable.rb +0 -10
  1363. data/tmpsets/set/mod005-04_settings/self/add_help.rb +0 -9
  1364. data/tmpsets/set/mod005-04_settings/self/autoname.rb +0 -9
  1365. data/tmpsets/set/mod005-04_settings/self/captcha.rb +0 -9
  1366. data/tmpsets/set/mod005-04_settings/self/create.rb +0 -9
  1367. data/tmpsets/set/mod005-04_settings/self/default.rb +0 -9
  1368. data/tmpsets/set/mod005-04_settings/self/delete.rb +0 -9
  1369. data/tmpsets/set/mod005-04_settings/self/help.rb +0 -9
  1370. data/tmpsets/set/mod005-04_settings/self/input.rb +0 -8
  1371. data/tmpsets/set/mod005-04_settings/self/layout.rb +0 -9
  1372. data/tmpsets/set/mod005-04_settings/self/on_create.rb +0 -9
  1373. data/tmpsets/set/mod005-04_settings/self/on_delete.rb +0 -9
  1374. data/tmpsets/set/mod005-04_settings/self/on_update.rb +0 -9
  1375. data/tmpsets/set/mod005-04_settings/self/options.rb +0 -9
  1376. data/tmpsets/set/mod005-04_settings/self/options_label.rb +0 -9
  1377. data/tmpsets/set/mod005-04_settings/self/read.rb +0 -9
  1378. data/tmpsets/set/mod005-04_settings/self/recent_settings.rb +0 -10
  1379. data/tmpsets/set/mod005-04_settings/self/script.rb +0 -9
  1380. data/tmpsets/set/mod005-04_settings/self/structure.rb +0 -9
  1381. data/tmpsets/set/mod005-04_settings/self/style.rb +0 -9
  1382. data/tmpsets/set/mod005-04_settings/self/table_of_contents.rb +0 -9
  1383. data/tmpsets/set/mod005-04_settings/self/thanks.rb +0 -9
  1384. data/tmpsets/set/mod005-04_settings/self/update.rb +0 -9
  1385. data/tmpsets/set/mod005-04_settings/type/setting.rb +0 -100
  1386. data/tmpsets/set/mod006-05_email/all/email_html.rb +0 -12
  1387. data/tmpsets/set/mod006-05_email/all/email_text.rb +0 -12
  1388. data/tmpsets/set/mod006-05_email/all/follow.rb +0 -260
  1389. data/tmpsets/set/mod006-05_email/all/notify.rb +0 -262
  1390. data/tmpsets/set/mod006-05_email/all/observer.rb +0 -34
  1391. data/tmpsets/set/mod006-05_email/right/bcc.rb +0 -52
  1392. data/tmpsets/set/mod006-05_email/right/cc.rb +0 -10
  1393. data/tmpsets/set/mod006-05_email/right/follow.rb +0 -118
  1394. data/tmpsets/set/mod006-05_email/right/follow_fields.rb +0 -9
  1395. data/tmpsets/set/mod006-05_email/right/followers.rb +0 -39
  1396. data/tmpsets/set/mod006-05_email/right/following.rb +0 -68
  1397. data/tmpsets/set/mod006-05_email/right/from.rb +0 -10
  1398. data/tmpsets/set/mod006-05_email/right/html_message.rb +0 -10
  1399. data/tmpsets/set/mod006-05_email/right/to.rb +0 -10
  1400. data/tmpsets/set/mod006-05_email/self/always.rb +0 -21
  1401. data/tmpsets/set/mod006-05_email/self/created.rb +0 -28
  1402. data/tmpsets/set/mod006-05_email/self/edited.rb +0 -31
  1403. data/tmpsets/set/mod006-05_email/self/follow.rb +0 -9
  1404. data/tmpsets/set/mod006-05_email/self/follow_defaults.rb +0 -76
  1405. data/tmpsets/set/mod006-05_email/self/never.rb +0 -22
  1406. data/tmpsets/set/mod006-05_email/type/email_template.rb +0 -120
  1407. data/tmpsets/set/mod006-05_email/type_plus_right/user/follow.rb +0 -183
  1408. data/tmpsets/set/mod007-05_standard/abstract/attachment.rb +0 -301
  1409. data/tmpsets/set/mod007-05_standard/all/account.rb +0 -72
  1410. data/tmpsets/set/mod007-05_standard/all/comment.rb +0 -68
  1411. data/tmpsets/set/mod007-05_standard/all/error.rb +0 -229
  1412. data/tmpsets/set/mod007-05_standard/all/event_viz.rb +0 -76
  1413. data/tmpsets/set/mod007-05_standard/all/links.rb +0 -164
  1414. data/tmpsets/set/mod007-05_standard/all/rich_html/content.rb +0 -261
  1415. data/tmpsets/set/mod007-05_standard/all/rich_html/editing.rb +0 -251
  1416. data/tmpsets/set/mod007-05_standard/all/rich_html/form.rb +0 -291
  1417. data/tmpsets/set/mod007-05_standard/all/rich_html/header.rb +0 -79
  1418. data/tmpsets/set/mod007-05_standard/all/rich_html/menu.rb +0 -136
  1419. data/tmpsets/set/mod007-05_standard/all/rich_html/modal.rb +0 -56
  1420. data/tmpsets/set/mod007-05_standard/all/rich_html/toolbar.rb +0 -272
  1421. data/tmpsets/set/mod007-05_standard/all/rich_html/wrapper.rb +0 -159
  1422. data/tmpsets/set/mod007-05_standard/right/account.rb +0 -184
  1423. data/tmpsets/set/mod007-05_standard/right/discussion.rb +0 -10
  1424. data/tmpsets/set/mod007-05_standard/right/email.rb +0 -61
  1425. data/tmpsets/set/mod007-05_standard/right/password.rb +0 -53
  1426. data/tmpsets/set/mod007-05_standard/right/salt.rb +0 -12
  1427. data/tmpsets/set/mod007-05_standard/right/stats.rb +0 -42
  1428. data/tmpsets/set/mod007-05_standard/right/status.rb +0 -16
  1429. data/tmpsets/set/mod007-05_standard/right/token.rb +0 -59
  1430. data/tmpsets/set/mod007-05_standard/right/when_created.rb +0 -12
  1431. data/tmpsets/set/mod007-05_standard/right/when_last_edited.rb +0 -12
  1432. data/tmpsets/set/mod007-05_standard/rstar/rules.rb +0 -107
  1433. data/tmpsets/set/mod007-05_standard/self/account_links.rb +0 -56
  1434. data/tmpsets/set/mod007-05_standard/self/alerts.rb +0 -12
  1435. data/tmpsets/set/mod007-05_standard/self/all.rb +0 -35
  1436. data/tmpsets/set/mod007-05_standard/self/foot.rb +0 -15
  1437. data/tmpsets/set/mod007-05_standard/self/head.rb +0 -140
  1438. data/tmpsets/set/mod007-05_standard/self/navbox.rb +0 -40
  1439. data/tmpsets/set/mod007-05_standard/self/now.rb +0 -13
  1440. data/tmpsets/set/mod007-05_standard/self/performance_log.rb +0 -98
  1441. data/tmpsets/set/mod007-05_standard/self/recent.rb +0 -55
  1442. data/tmpsets/set/mod007-05_standard/self/search.rb +0 -73
  1443. data/tmpsets/set/mod007-05_standard/self/signin.rb +0 -140
  1444. data/tmpsets/set/mod007-05_standard/self/stats.rb +0 -110
  1445. data/tmpsets/set/mod007-05_standard/self/version.rb +0 -16
  1446. data/tmpsets/set/mod007-05_standard/type/basic.rb +0 -53
  1447. data/tmpsets/set/mod007-05_standard/type/cardtype.rb +0 -81
  1448. data/tmpsets/set/mod007-05_standard/type/date.rb +0 -15
  1449. data/tmpsets/set/mod007-05_standard/type/file.rb +0 -155
  1450. data/tmpsets/set/mod007-05_standard/type/image.rb +0 -89
  1451. data/tmpsets/set/mod007-05_standard/type/layout_type.rb +0 -22
  1452. data/tmpsets/set/mod007-05_standard/type/number.rb +0 -26
  1453. data/tmpsets/set/mod007-05_standard/type/phrase.rb +0 -10
  1454. data/tmpsets/set/mod007-05_standard/type/search_type.rb +0 -318
  1455. data/tmpsets/set/mod007-05_standard/type/session.rb +0 -43
  1456. data/tmpsets/set/mod007-05_standard/type/set.rb +0 -359
  1457. data/tmpsets/set/mod007-05_standard/type/signup.rb +0 -176
  1458. data/tmpsets/set/mod007-05_standard/type/toggle.rb +0 -19
  1459. data/tmpsets/set/mod007-05_standard/type/uri.rb +0 -18
  1460. data/tmpsets/set/mod007-05_standard/type/user.rb +0 -88
  1461. data/tmpsets/set/mod008-06_bootstrap/all/bootstrap/form.rb +0 -42
  1462. data/tmpsets/set/mod008-06_bootstrap/all/bootstrap/helper.rb +0 -151
  1463. data/tmpsets/set/mod008-06_bootstrap/all/bootstrap/wrapper.rb +0 -19
  1464. data/tmpsets/set/mod008-06_bootstrap/all/rich_bootstrap.rb +0 -15
  1465. data/tmpsets/set/mod008-06_bootstrap/self/bootstrap_cards.rb +0 -16
  1466. data/tmpsets/set/mod008-06_bootstrap/self/bootstrap_js.rb +0 -14
  1467. data/tmpsets/set/mod008-06_bootstrap/self/bootswatch_shared.rb +0 -39
  1468. data/tmpsets/set/mod008-06_bootstrap/self/smartmenu_css.rb +0 -14
  1469. data/tmpsets/set/mod008-06_bootstrap/self/smartmenu_js.rb +0 -13
@@ -0,0 +1,261 @@
1
+ class Card
2
+ # ## What are Machines?
3
+ # {Machine} and {MachineInput} together implement a kind of observer pattern.
4
+ # {Machine} processes a collection of input cards to generate an output card
5
+ # (a {Set::Type::File} card by default). If one of the input cards is changed
6
+ # the output card will be updated.
7
+ #
8
+ # The classic example: A style card observes a collection of css and sccs card
9
+ # to generate a file card with a css file that contains the assembled
10
+ # compressed css.
11
+ #
12
+ # ## Using Machines
13
+ # Include the Machine module in the card set that is supposed to produce the
14
+ # output card. If the output card should be automatically updated when a input
15
+ # card is changed the input card has to be in a set that includes the
16
+ # MachineInput module.
17
+ #
18
+ # The default machine:
19
+ #
20
+ # - uses its item cards as input cards or the card itself if there are no
21
+ # item cards;
22
+ # - can be changed by passing a block to collect_input_cards
23
+ # - takes the raw view of the input cards to generate the output;
24
+ # - can be changed by passing a block to machine_input (in the input card
25
+ # set)
26
+ # - stores the output as a .txt file in the '+machine output' card;
27
+ # - can be changed by passing a filetype and/or a block to
28
+ # store_machine_output
29
+ #
30
+ #
31
+ # ## How does it work?
32
+ # Machine cards have a '+machine input' and a '+machine output' card. The
33
+ # '+machine input' card is a pointer to all input cards. Including the
34
+ # MachineInput module creates an 'on: save' event that runs the machines of
35
+ # all cards that are linked to that card via the +machine input pointer.
36
+ module Machine
37
+ module ClassMethods
38
+ attr_accessor :output_config
39
+
40
+ def collect_input_cards &block
41
+ define_method :engine_input, &block
42
+ end
43
+
44
+ def prepare_machine_input &block
45
+ define_method :before_engine, &block
46
+ end
47
+
48
+ def machine_engine &block
49
+ define_method :engine, &block
50
+ end
51
+
52
+ def store_machine_output args={}, &block
53
+ output_config.merge!(args)
54
+ return unless block_given?
55
+ define_method :after_engine, &block
56
+ end
57
+ end
58
+
59
+ class << self
60
+ def included host_class
61
+ host_class.extend(ClassMethods)
62
+ host_class.output_config = { filetype: "txt" }
63
+
64
+ # for compatibility with old migrations
65
+ return unless Codename[:machine_output]
66
+
67
+ host_class.card_accessor :machine_output, type: :file
68
+ host_class.card_accessor :machine_input, type: :pointer
69
+
70
+ set_default_machine_behaviour host_class
71
+ define_machine_views host_class
72
+ define_machine_events host_class
73
+ end
74
+
75
+ def define_machine_events host_class
76
+ event_suffix = host_class.name.tr ":", "_"
77
+ event_name = "reset_machine_output_#{event_suffix}".to_sym
78
+ host_class.event event_name, after: :expire_related, on: :save do
79
+ reset_machine_output
80
+ end
81
+ end
82
+
83
+ def define_machine_views host_class
84
+ host_class.format do
85
+ view :machine_output_url do |_args|
86
+ machine_output_url
87
+ end
88
+ end
89
+ end
90
+
91
+ def set_default_machine_behaviour host_class
92
+ set_default_input_collection_method host_class
93
+ set_default_input_preparation_method host_class
94
+ set_default_output_storage_method host_class
95
+ host_class.machine_engine { |input| input }
96
+ end
97
+
98
+ def set_default_input_preparation_method host_class
99
+ host_class.prepare_machine_input {}
100
+ end
101
+
102
+ def set_default_output_storage_method host_class
103
+ host_class.store_machine_output do |output|
104
+ filetype = host_class.output_config[:filetype]
105
+ file = Tempfile.new [id.to_s, ".#{filetype}"]
106
+ file.write output
107
+ file.rewind
108
+ Card::Auth.as_bot do
109
+ p = machine_output_card
110
+ p.file = file
111
+ p.save!
112
+ end
113
+ file.close
114
+ file.unlink
115
+ end
116
+ end
117
+
118
+ def set_default_input_collection_method host_class
119
+ host_class.collect_input_cards do
120
+ # traverse through all levels of pointers and
121
+ # collect all item cards as input
122
+ items = [self]
123
+ new_input = []
124
+ already_extended = {} # avoid loops
125
+ loop_limit = 5
126
+ until items.empty?
127
+ item = items.shift
128
+ next if item.trash || already_extended[item.id].to_i > loop_limit
129
+ if item.item_cards == [item] # no pointer card
130
+ new_input << item
131
+ else
132
+ # item_cards instantiates non-existing cards
133
+ # we don't want those
134
+ items.insert(0, item.item_cards.reject(&:unknown?))
135
+ items.flatten!
136
+
137
+ new_input << item if item != self && item.known?
138
+ already_extended[item] = already_extended[item].to_i + 1
139
+ end
140
+ end
141
+ new_input
142
+ end
143
+ end
144
+ end
145
+
146
+ def run_machine joint="\n"
147
+ before_engine
148
+ output =
149
+ input_item_cards.map do |input_card|
150
+ run_engine input_card
151
+ end.select(&:present?).join(joint)
152
+ after_engine output
153
+ end
154
+
155
+ def run_engine input_card
156
+ return if input_card.is_a? Card::Set::Type::Pointer
157
+ if (cached = fetch_cache_card(input_card))
158
+ return cached.content
159
+ end
160
+
161
+ input = if input_card.respond_to? :machine_input
162
+ input_card.machine_input
163
+ else
164
+ input_card.format._render_raw
165
+ end
166
+ output = engine(input)
167
+ cache_output_part input_card, output
168
+ output
169
+ end
170
+
171
+ def fetch_cache_card input_card, new=nil
172
+ new &&= { type_id: PlainTextID }
173
+ Card.fetch input_card.name, name, :machine_cache, new: new
174
+ end
175
+
176
+ def cache_output_part input_card, output
177
+ Auth.as_bot do
178
+ cache_card = fetch_cache_card(input_card, true)
179
+ cache_card.update_attributes! content: output
180
+ end
181
+ end
182
+
183
+ def reset_machine_output
184
+ Auth.as_bot do
185
+ (moc = machine_output_card) && moc.real? && moc.delete!
186
+ update_input_card
187
+ end
188
+ end
189
+
190
+ def update_machine_output
191
+ lock do
192
+ update_input_card
193
+ run_machine
194
+ end
195
+ end
196
+
197
+ def regenerate_machine_output
198
+ lock do
199
+ run_machine
200
+ end
201
+ end
202
+
203
+ def lock
204
+ if ok?(:read) && !(was_already_locked = locked?)
205
+ Auth.as_bot do
206
+ lock!
207
+ yield
208
+ end
209
+ end
210
+ ensure
211
+ unlock! unless was_already_locked
212
+ end
213
+
214
+ def lock_cache_key
215
+ "UPDATE-LOCK:#{key}"
216
+ end
217
+
218
+ def locked?
219
+ Card.cache.read lock_cache_key
220
+ end
221
+
222
+ def lock!
223
+ Card.cache.write lock_cache_key, true
224
+ end
225
+
226
+ def unlock!
227
+ Card.cache.write lock_cache_key, false
228
+ end
229
+
230
+ def update_input_card
231
+ if DirectorRegister.running_act?
232
+ input_card = attach_subcard! machine_input_card
233
+ input_card.content = ""
234
+ engine_input.each { |input| input_card << input }
235
+ else
236
+ machine_input_card.items = engine_input
237
+ end
238
+ end
239
+
240
+ def input_item_cards
241
+ machine_input_card.item_cards
242
+ end
243
+
244
+ def machine_output_url
245
+ ensure_machine_output
246
+ machine_output_card.file.url # (:default, timestamp: false)
247
+ # to get rid of additional number in url
248
+ end
249
+
250
+ def machine_output_path
251
+ ensure_machine_output
252
+ machine_output_card.file.path
253
+ end
254
+
255
+ def ensure_machine_output
256
+ output = fetch trait: :machine_output
257
+ return if output && output.selected_content_action_id
258
+ update_machine_output
259
+ end
260
+ end
261
+ end
@@ -0,0 +1,80 @@
1
+ class Card
2
+ module MachineInput
3
+ module ClassMethods
4
+ attr_accessor :machines_wql
5
+
6
+ def machine_input_for args
7
+ @machines_wql = args
8
+ end
9
+
10
+ def machine_input &block
11
+ define_method :machine_input, block
12
+ end
13
+ end
14
+
15
+ def self.included host_class
16
+ host_class.extend(ClassMethods)
17
+ host_class.machines_wql = {}
18
+ host_class.machine_input do
19
+ format._render_raw
20
+ end
21
+ event_suffix = host_class.name.tr ":", "_"
22
+ define_update_event event_suffix, host_class
23
+ define_delete_events event_suffix, host_class
24
+ end
25
+
26
+ def self.define_delete_events event_suffix, host_class
27
+ event_name = "before_machine_input_deleted_#{event_suffix}".to_sym
28
+ host_class.event event_name, :store, on: :delete do
29
+ # exclude self because it's on the way to the trash
30
+ # otherwise it will be created again with the reset_machine_output
31
+ # call in the event below
32
+ @involved_machines =
33
+ Card::MachineInput.search_involved_machines(name, host_class)
34
+ .reject { |card| card == self }
35
+ end
36
+ event_name = "after_machine_input_deleted_#{event_suffix}".to_sym
37
+ host_class.event event_name, :finalize, on: :delete do
38
+ expire_machine_cache
39
+ @involved_machines.each do |item|
40
+ item.reset_machine_output if item.is_a? Machine
41
+ end
42
+ end
43
+ end
44
+
45
+ def self.define_update_event event_suffix, host_class
46
+ host_class.event(
47
+ "after_machine_input_updated_#{event_suffix}".to_sym, :integrate,
48
+ on: :save
49
+ ) do
50
+ expire_machine_cache
51
+ Card::MachineInput.search_involved_machines(name, host_class)
52
+ .each do |item|
53
+ item.reset_machine_output if item.is_a? Machine
54
+ end
55
+ end
56
+ end
57
+
58
+ def self.search_involved_machines name, host_class
59
+ wql_statement =
60
+ { right_plus: [
61
+ { codename: "machine_input" },
62
+ { link_to: name }
63
+ ] }.merge(host_class.machines_wql)
64
+ Card.search(wql_statement)
65
+ end
66
+
67
+ def expire_machine_cache
68
+ Card.search(right_plus: [
69
+ { codename: "machine_input" },
70
+ { link_to: name }
71
+ ],
72
+ return: :name).each do |machine_name|
73
+ next unless (cache = Card.fetch(name, machine_name, :machine_cache))
74
+ Auth.as_bot do
75
+ cache.update_attributes! trash: true
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,387 @@
1
+ $.extend wagn,
2
+ initializeEditors: (range, map) ->
3
+ map = wagn.editorInitFunctionMap unless map?
4
+ $.each map, (selector, fn) ->
5
+ $.each range.find(selector), ->
6
+ fn.call $(this)
7
+
8
+ prepUrl: (url, slot)->
9
+ xtra = {}
10
+ main = $('#main').children('.card-slot').data 'cardName'
11
+ xtra['main'] = main if main?
12
+ if slot
13
+ xtra['is_main'] = true if slot.isMain()
14
+ slotdata = slot.data 'slot'
15
+ wagn.slotParams slotdata, xtra, 'slot' if slotdata?
16
+
17
+ url + ( (if url.match /\?/ then '&' else '?') + $.param(xtra) )
18
+
19
+ slotParams: (raw, processed, prefix)->
20
+ $.each raw, (key, value)->
21
+ cgiKey = prefix + '[' + snakeCase(key) + ']'
22
+ if key == 'items'
23
+ wagn.slotParams value, processed, cgiKey
24
+ else
25
+ processed[cgiKey] = value
26
+
27
+ slotReady: (func)->
28
+ $('document').ready ->
29
+ $('body').on 'slotReady', '.card-slot', (e) ->
30
+ e.stopPropagation()
31
+ func.call this, $(this)
32
+
33
+ pingName: (name, success)->
34
+ $.getJSON wagn.rootPath + '/',
35
+ format: 'json', view: 'status', 'card[name]': name,
36
+ success
37
+
38
+ isTouchDevice: ->
39
+ if 'ontouchstart' of window or window.DocumentTouch and
40
+ document instanceof DocumentTouch
41
+ return true
42
+ else
43
+ return detectMobileBrowser()
44
+
45
+ # source for this method: detectmobilebrowsers.com
46
+ detectMobileBrowser = (userAgent) ->
47
+ userAgent = navigator.userAgent or navigator.vendor or window.opera
48
+ /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(userAgent) or /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(userAgent.substr(0, 4))
49
+
50
+ jQuery.fn.extend {
51
+ slot: ->
52
+ if @data('slot-selector')
53
+ target_slot = @closest(@data('slot-selector'))
54
+ parent_slot = @closest '.card-slot'
55
+
56
+ # if slot-selector doesn't apply to a child, search in all parent slots and finally in the body
57
+ while target_slot.length == 0 and parent_slot.length > 0
58
+ target_slot = $(parent_slot).find(@data('slot-selector'))
59
+ parent_slot = $(parent_slot).parent().closest '.card-slot'
60
+ if target_slot.length == 0
61
+ $(@data('slot-selector'))
62
+ else
63
+ target_slot
64
+ else
65
+ @closest '.card-slot'
66
+
67
+ setSlotContent: (val) ->
68
+ s = @slot()
69
+ v = $(val)
70
+ unless v[0]
71
+ # if slotdata = s.attr 'data-slot'
72
+ # v.attr 'data-slot', slotdata if slotdata?
73
+ # else #simple text (not html)
74
+ v = val
75
+ s.replaceWith v
76
+ v.trigger 'slotReady'
77
+ v
78
+
79
+ slotSuccess: (data) ->
80
+ if data.redirect
81
+ window.location=data.redirect
82
+ else
83
+ notice = @attr('notify-success')
84
+ newslot = @setSlotContent data
85
+
86
+ if newslot.jquery # sometimes response is plaintext
87
+ wagn.initializeEditors newslot
88
+ if notice?
89
+ newslot.notify notice
90
+
91
+ slotError: (status, result) ->
92
+ if status == 403 #permission denied
93
+ @setSlotContent result
94
+ else
95
+ @notify result
96
+ if status == 409 #edit conflict
97
+ @slot().find('.current_revision_id').val(
98
+ @slot().find('.new-current-revision-id').text()
99
+ )
100
+ else if status == 449
101
+ @slot().find('g-recaptcha').reloadCaptcha()
102
+
103
+ notify: (message) ->
104
+ slot = @slot()
105
+ notice = slot.find '.card-notice'
106
+ unless notice[0]
107
+ notice = $('<div class="card-notice"></div>')
108
+ form = slot.find('.card-form')
109
+ if form[0]
110
+ $(form[0]).append notice
111
+ else
112
+ slot.append notice
113
+ notice.html message
114
+ notice.show 'blind'
115
+
116
+ report: (message) ->
117
+ report = @slot().find '.card-report'
118
+ return false unless report[0]
119
+ report.hide()
120
+ report.html message
121
+ report.show 'drop', 750
122
+ setTimeout (->report.hide 'drop', 750), 3000
123
+
124
+ isMain: -> @slot().parent('#main')[0]
125
+
126
+ reloadCaptcha: ->
127
+ this[0].empty()
128
+ grecaptcha.render this[0],
129
+ sitekey: wagn.recaptchaKey
130
+
131
+ autosave: ->
132
+ slot = @slot()
133
+ return if @attr 'no-autosave'
134
+ multi = @closest '.form-group'
135
+ if multi[0]
136
+ return unless id = multi.data 'cardId'
137
+ reportee = ': ' + multi.data 'cardName'
138
+ else
139
+ id = slot.data 'cardId'
140
+ reportee = ''
141
+
142
+ # #might be better to put this href base in the html
143
+ submit_url = wagn.rootPath + '/update/~' + id
144
+ form_data = $('#edit_card_'+id).serializeArray().reduce( ((obj, item) ->
145
+ obj[item.name] = item.value
146
+ return obj
147
+ ), { 'draft' : 'true', 'success[view]' : 'blank'});
148
+ $.ajax submit_url, {
149
+ data : form_data,
150
+ type : 'POST'
151
+ }
152
+ ##{ 'card[content]' : @val() },
153
+ }
154
+
155
+ #~~~~~ ( EVENTS )
156
+
157
+ setInterval (-> $('.card-form').setContentFieldsFromMap()), 20000
158
+
159
+ $(window).ready ->
160
+ $.ajaxSetup cache: false
161
+
162
+ setTimeout (-> wagn.initializeEditors $('body')), 10
163
+ # dislike the timeout, but without this forms with multiple TinyMCE editors
164
+ # were failing to load properly
165
+
166
+
167
+ $('body').on 'ajax:success', '.slotter', (event, data, c, d) ->
168
+ unless event.slotSuccessful
169
+ slot_top_pos = $(this).slot().offset().top
170
+ $(this).slotSuccess data
171
+ if $(this).hasClass "close-modal"
172
+ $(this).closest('.modal').modal('hide')
173
+ # should scroll to top after clicking on new page
174
+ if $(this).hasClass "card-paging-link"
175
+ $("body").scrollTop slot_top_pos
176
+ event.slotSuccessful = true
177
+
178
+
179
+ $('body').on 'loaded.bs.modal', null, (event) ->
180
+ unless event.slotSuccessful
181
+ wagn.initializeEditors $(event.target)
182
+ $(event.target).find(".card-slot").trigger("slotReady")
183
+ event.slotSuccessful = true
184
+
185
+ $('body').on 'ajax:error', '.slotter', (event, xhr) ->
186
+ $(this).slotError xhr.status, xhr.responseText
187
+
188
+ $('body').on 'click', 'button.slotter', (event)->
189
+ return false if !$.rails.allowAction $(this)
190
+ $.rails.handleRemote $(this)
191
+
192
+ $('body').on 'ajax:beforeSend', '.slotter', (event, xhr, opt)->
193
+ return if opt.skip_before_send
194
+
195
+ # avoiding duplication. could be better test?
196
+ unless opt.url.match /home_view/
197
+ opt.url = wagn.prepUrl opt.url, $(this).slot()
198
+
199
+ if $(this).is('form')
200
+ if wagn.recaptchaKey and $(this).attr('recaptcha')=='on' and
201
+ !($(this).find('.g-recaptcha')[0])
202
+ # if there is already a recaptcha on the page then we don't have to
203
+ # load the recaptcha script
204
+ if $('.g-recaptcha')[0]
205
+ addCaptcha(this)
206
+ else
207
+ initCaptcha(this)
208
+ return false
209
+
210
+ if data = $(this).data 'file-data'
211
+ # NOTE - this entire solution is temporary.
212
+ input = $(this).find '.file-upload'
213
+ if input[1]
214
+ $(this).notify(
215
+ "Wagn does not yet support multiple files in a single form."
216
+ )
217
+ return false
218
+
219
+ widget = input.data 'blueimpFileupload' #jQuery UI widget
220
+
221
+ # browsers that can't do ajax uploads use iframe
222
+ unless widget._isXHRUpload(widget.options)
223
+ # can't do normal redirects.
224
+ $(this).find('[name=success]').val('_self')
225
+ # iframe response not passed back;
226
+ # all responses treated as success. boo
227
+ opt.url += '&simulate_xhr=true'
228
+ # iframe is not xhr request,
229
+ # so would otherwise get full response with layout
230
+ iframeUploadFilter = (data)-> data.find('body').html()
231
+ opt.dataFilter = iframeUploadFilter
232
+ # gets rid of default html and body tags
233
+
234
+ args = $.extend opt, (widget._getAJAXSettings data), url: opt.url
235
+ # combines settings from wagn's slotter and jQuery UI's upload widget
236
+ args.skip_before_send = true #avoid looping through this method again
237
+
238
+ $.ajax( args )
239
+ false
240
+
241
+ $('body').on 'submit', '.card-form', ->
242
+ $(this).setContentFieldsFromMap()
243
+ $(this).find('.card-content').attr('no-autosave','true')
244
+ true
245
+
246
+ $('body').on 'click', '.submitter', ->
247
+ $(this).closest('form').submit()
248
+
249
+ $('body').on 'click', '.renamer-updater', ->
250
+ $(this).closest('form').find('#card_update_referers').val 'true'
251
+
252
+ $('body').on 'submit', '.edit_name-view .card-form', ->
253
+ confirmer = $(this).find '.alert'
254
+ if confirmer.is ':hidden'
255
+ if $(this).find('#referers').val() > 0
256
+ $(this).find('.renamer-updater').show()
257
+
258
+ confirmer.show 'blind'
259
+ false
260
+
261
+
262
+
263
+ $('body').on 'click', '.follow-updater', ->
264
+ $(this).closest('form').find('#card_update_all_users').val 'true'
265
+
266
+ $('body').on 'submit', '.edit-view.SELF-Xfollow_default .card-form', ->
267
+ confirmer = $(this).find '.confirm_update_all-view'
268
+ if confirmer.is ':hidden'
269
+ $(this).find('.follow-updater').show()
270
+
271
+ confirmer.show 'blind'
272
+ false
273
+
274
+
275
+ $('body').on 'click', 'button.redirecter', ->
276
+ window.location = $(this).attr('href')
277
+
278
+ unless wagn.noDoubleClick
279
+ $('body').on 'dblclick', 'div', (event) ->
280
+ t = $(this)
281
+ return false if t.closest( '.nodblclick' )[0]
282
+ # fail if inside a div with "nodblclick" class
283
+ return false if t.closest( '.card-header' )[0]
284
+ # fail if inside a card header
285
+ s = t.slot()
286
+ return false if s.find( '.card-editor' )[0]
287
+ # fail if there is an editor open in your slot
288
+ return false unless s.data('cardId')
289
+ # fail if slot has not card id
290
+ s.addClass 'slotter'
291
+ s.attr 'href', wagn.rootPath + '/card/edit/~' + s.data('cardId')
292
+ $.rails.handleRemote(s)
293
+ false # don't propagate up to next slot
294
+
295
+ # $('body').on 'dblclick', '.nodblclick', -> false
296
+
297
+ $('body').on 'submit', 'form.slotter', (event)->
298
+ if (target = $(this).attr 'main-success') and $(this).isMain()
299
+ input = $(this).find '[name=success]'
300
+ if input and !(input.val().match /^REDIRECT/)
301
+ input.val(
302
+ (if target == 'REDIRECT' then target + ': ' + input.val() else target)
303
+ )
304
+
305
+ $('body').on 'change', '.live-type-field', ->
306
+ $(this).data 'params', $(this).closest('form').serialize()
307
+ $(this).data 'url', $(this).attr 'href'
308
+
309
+ $('body').on 'change', '.edit-type-field', ->
310
+ $(this).closest('form').submit()
311
+
312
+ $('body').on 'change', '.autosave .card-content', ->
313
+ content_field = $(this)
314
+ setTimeout ( -> content_field.autosave() ), 500
315
+
316
+ $('body').on 'mouseenter', '[hover_content]', ->
317
+ $(this).attr 'hover_restore', $(this).html()
318
+ $(this).html $(this).attr( 'hover_content' )
319
+ $('body').on 'mouseleave', '[hover_content]', ->
320
+ $(this).html $(this).attr( 'hover_restore' )
321
+
322
+ $('body').on 'keyup', '.name-editor input', ->
323
+ box = $(this)
324
+ name = box.val()
325
+ wagn.pingName name, (data)->
326
+ return null if box.val() != name # avert race conditions
327
+ status = data['status']
328
+ if status
329
+ ed = box.parent()
330
+ leg = box.closest('fieldset').find('legend')
331
+ msg = leg.find '.name-messages'
332
+ unless msg[0]
333
+ msg = $('<span class="name-messages"></span>')
334
+ leg.append msg
335
+ ed.removeClass 'real-name virtual-name known-name'
336
+
337
+ # use id to avoid warning when renaming to name variant
338
+ slot_id = box.slot().data 'cardId'
339
+ if status != 'unknown' and !(slot_id && parseInt(slot_id) == data['id'])
340
+ ed.addClass status + '-name known-name'
341
+ link =
342
+ # wish coffee would let me use a ? b : c syntax here
343
+ qualifier = if status == 'virtual'
344
+ 'in virtual'
345
+ else
346
+ 'already in'
347
+ msg.html '"<a href="' + wagn.rootPath + '/' + data['url_key'] + '">' +
348
+ name + '</a>" ' + qualifier + ' use'
349
+ else
350
+ msg.html ''
351
+
352
+ $('body').on 'click', '.render-error-link', (event) ->
353
+ msg = $(this).closest('.render-error').find '.render-error-message'
354
+ msg.show()
355
+ # msg.dialog()
356
+ event.preventDefault()
357
+
358
+
359
+ # important: this prevents jquery-mobile from taking over everything
360
+ # $( document ).on "mobileinit", ->
361
+ # $.extend $.mobile , {
362
+ # #autoInitializePage: false
363
+ # #ajaxEnabled: false
364
+ # }
365
+
366
+
367
+ initCaptcha = (form)->
368
+ recapDiv = $("<div class='g-recaptcha' data-sitekey='#{wagn.recaptchaKey}'>" +
369
+ "</div>")
370
+ $(form).children().last().after recapDiv
371
+ recapUri = "https://www.google.com/recaptcha/api.js"
372
+
373
+ # renders the first element with "g-recaptcha" class when loaded
374
+ $.getScript recapUri
375
+
376
+ # call this if the recaptcha script is already initialized (via initCaptcha)
377
+ addCaptcha = (form)->
378
+ recapDiv = $('<div class="g-recaptcha"></div>')
379
+ $(form).children().last().after recapDiv
380
+ grecaptcha.render recapDiv,
381
+ sitekey: wagn.recaptchaKey
382
+
383
+ snakeCase = (str)->
384
+ str.replace /([a-z])([A-Z])/g, (match) -> match[0] + '_' +
385
+ match[1].toLowerCase()
386
+
387
+ warn = (stuff) -> console.log stuff if console?