publify_core 9.0.0.pre1

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

Potentially problematic release.


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

Files changed (372) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +21 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +35 -0
  5. data/app/assets/fonts/open-sans-bold.woff +0 -0
  6. data/app/assets/fonts/open-sans.woff +0 -0
  7. data/app/assets/images/admin/loading.gif +0 -0
  8. data/app/assets/images/admin/typologo.gif +0 -0
  9. data/app/assets/images/calendar_date_select/calendar.gif +0 -0
  10. data/app/assets/images/close.gif +0 -0
  11. data/app/assets/images/closelabel.gif +0 -0
  12. data/app/assets/images/go.png +0 -0
  13. data/app/assets/images/loading.gif +0 -0
  14. data/app/assets/images/nextlabel.gif +0 -0
  15. data/app/assets/images/overlay.png +0 -0
  16. data/app/assets/images/powered.gif +0 -0
  17. data/app/assets/images/prevlabel.gif +0 -0
  18. data/app/assets/images/spinner-blue.gif +0 -0
  19. data/app/assets/images/spinner.gif +0 -0
  20. data/app/assets/images/thumb_blank.jpg +0 -0
  21. data/app/assets/javascripts/application.js +2 -0
  22. data/app/assets/javascripts/cookies.js +60 -0
  23. data/app/assets/javascripts/datetimepicker.js +1470 -0
  24. data/app/assets/javascripts/lang/da_DK.js +17 -0
  25. data/app/assets/javascripts/lang/default.js +21 -0
  26. data/app/assets/javascripts/lang/en_US.js +21 -0
  27. data/app/assets/javascripts/lang/fr_FR.js +21 -0
  28. data/app/assets/javascripts/lang/nl_NL.js +21 -0
  29. data/app/assets/javascripts/lang/zh_TW.js +17 -0
  30. data/app/assets/javascripts/lightbox.js +350 -0
  31. data/app/assets/javascripts/observe.js +28 -0
  32. data/app/assets/javascripts/publify.js +11 -0
  33. data/app/assets/javascripts/publify_admin.js +138 -0
  34. data/app/assets/javascripts/quicktags.js +440 -0
  35. data/app/assets/javascripts/set-timeago-lang.js +3 -0
  36. data/app/assets/javascripts/sidebar.js +28 -0
  37. data/app/assets/javascripts/spinnable.js +5 -0
  38. data/app/assets/javascripts/tagmanager.js +481 -0
  39. data/app/assets/javascripts/typeahead.js +1139 -0
  40. data/app/assets/javascripts/widearea.js +486 -0
  41. data/app/assets/stylesheets/accounts.css.scss +7 -0
  42. data/app/assets/stylesheets/administration_structure.css.scss +239 -0
  43. data/app/assets/stylesheets/coderay.css +135 -0
  44. data/app/assets/stylesheets/datetimepicker.css +306 -0
  45. data/app/assets/stylesheets/lightbox.css +63 -0
  46. data/app/assets/stylesheets/publify.css.scss +9 -0
  47. data/app/assets/stylesheets/publify_admin.css.scss +11 -0
  48. data/app/assets/stylesheets/rss.css +53 -0
  49. data/app/assets/stylesheets/sidebar_admin.css.scss +36 -0
  50. data/app/assets/stylesheets/tagmanager.css +102 -0
  51. data/app/assets/stylesheets/user-styles.css +29 -0
  52. data/app/assets/stylesheets/widearea.css +133 -0
  53. data/app/controllers/accounts_controller.rb +2 -0
  54. data/app/controllers/admin/base_controller.rb +41 -0
  55. data/app/controllers/admin/cache_controller.rb +33 -0
  56. data/app/controllers/admin/content_controller.rb +174 -0
  57. data/app/controllers/admin/dashboard_controller.rb +87 -0
  58. data/app/controllers/admin/feedback_controller.rb +159 -0
  59. data/app/controllers/admin/migrations_controller.rb +20 -0
  60. data/app/controllers/admin/notes_controller.rb +69 -0
  61. data/app/controllers/admin/pages_controller.rb +88 -0
  62. data/app/controllers/admin/post_types_controller.rb +56 -0
  63. data/app/controllers/admin/profiles_controller.rb +48 -0
  64. data/app/controllers/admin/redirects_controller.rb +47 -0
  65. data/app/controllers/admin/resources_controller.rb +30 -0
  66. data/app/controllers/admin/seo_controller.rb +45 -0
  67. data/app/controllers/admin/settings_controller.rb +53 -0
  68. data/app/controllers/admin/sidebar_controller.rb +66 -0
  69. data/app/controllers/admin/tags_controller.rb +53 -0
  70. data/app/controllers/admin/textfilters_controller.rb +6 -0
  71. data/app/controllers/admin/themes_controller.rb +37 -0
  72. data/app/controllers/admin/users_controller.rb +65 -0
  73. data/app/controllers/articles_controller.rb +205 -0
  74. data/app/controllers/authors_controller.rb +27 -0
  75. data/app/controllers/base_controller.rb +45 -0
  76. data/app/controllers/comments_controller.rb +69 -0
  77. data/app/controllers/content_controller.rb +31 -0
  78. data/app/controllers/feedback_controller.rb +47 -0
  79. data/app/controllers/notes_controller.rb +37 -0
  80. data/app/controllers/setup_controller.rb +62 -0
  81. data/app/controllers/tags_controller.rb +55 -0
  82. data/app/controllers/text_controller.rb +9 -0
  83. data/app/controllers/textfilter_controller.rb +3 -0
  84. data/app/controllers/theme_controller.rb +59 -0
  85. data/app/controllers/trackbacks_controller.rb +36 -0
  86. data/app/controllers/xml_controller.rb +70 -0
  87. data/app/helpers/admin/base_helper.rb +87 -0
  88. data/app/helpers/admin/feedback_helper.rb +42 -0
  89. data/app/helpers/articles_helper.rb +8 -0
  90. data/app/helpers/authors_helper.rb +39 -0
  91. data/app/helpers/base_helper.rb +246 -0
  92. data/app/helpers/blog_helper.rb +12 -0
  93. data/app/helpers/xml_helper.rb +16 -0
  94. data/app/mailers/notification_mailer.rb +38 -0
  95. data/app/models/ability.rb +52 -0
  96. data/app/models/archives_sidebar.rb +45 -0
  97. data/app/models/article/factory.rb +56 -0
  98. data/app/models/article/states.rb +178 -0
  99. data/app/models/article.rb +321 -0
  100. data/app/models/blog.rb +290 -0
  101. data/app/models/blog_sweeper.rb +86 -0
  102. data/app/models/comment.rb +53 -0
  103. data/app/models/config_manager.rb +81 -0
  104. data/app/models/content.rb +138 -0
  105. data/app/models/content_base.rb +95 -0
  106. data/app/models/feedback/states.rb +256 -0
  107. data/app/models/feedback.rb +225 -0
  108. data/app/models/meta_sidebar.rb +8 -0
  109. data/app/models/note.rb +144 -0
  110. data/app/models/page.rb +36 -0
  111. data/app/models/page_cache.rb +33 -0
  112. data/app/models/page_sidebar.rb +12 -0
  113. data/app/models/ping.rb +116 -0
  114. data/app/models/post_type.rb +15 -0
  115. data/app/models/redirect.rb +45 -0
  116. data/app/models/redirection.rb +4 -0
  117. data/app/models/resource.rb +28 -0
  118. data/app/models/search_sidebar.rb +7 -0
  119. data/app/models/sidebar.rb +138 -0
  120. data/app/models/static_sidebar.rb +20 -0
  121. data/app/models/tag.rb +63 -0
  122. data/app/models/tag_sidebar.rb +27 -0
  123. data/app/models/text_filter.rb +61 -0
  124. data/app/models/trackback.rb +58 -0
  125. data/app/models/trigger.rb +45 -0
  126. data/app/models/user.rb +148 -0
  127. data/app/services/migrator.rb +25 -0
  128. data/app/services/title_builder.rb +80 -0
  129. data/app/uploaders/resource_uploader.rb +30 -0
  130. data/app/views/accounts/confirm.html.erb +8 -0
  131. data/app/views/admin/cache/show.html.erb +18 -0
  132. data/app/views/admin/content/_article_list.html.erb +26 -0
  133. data/app/views/admin/content/_form.html.erb +165 -0
  134. data/app/views/admin/content/autosave.js.erb +5 -0
  135. data/app/views/admin/content/edit.html.erb +3 -0
  136. data/app/views/admin/content/index.html.erb +48 -0
  137. data/app/views/admin/content/index.js.erb +1 -0
  138. data/app/views/admin/content/new.html.erb +3 -0
  139. data/app/views/admin/dashboard/_comment.html.erb +18 -0
  140. data/app/views/admin/dashboard/_comments.html.erb +10 -0
  141. data/app/views/admin/dashboard/_drafts.html.erb +25 -0
  142. data/app/views/admin/dashboard/_inbound.html.erb +31 -0
  143. data/app/views/admin/dashboard/_overview.html.erb +23 -0
  144. data/app/views/admin/dashboard/_welcome.html.erb +28 -0
  145. data/app/views/admin/dashboard/index.html.erb +17 -0
  146. data/app/views/admin/feedback/_button.html.erb +19 -0
  147. data/app/views/admin/feedback/_feedback.html.erb +7 -0
  148. data/app/views/admin/feedback/_ham.html.erb +17 -0
  149. data/app/views/admin/feedback/_spam.html.erb +23 -0
  150. data/app/views/admin/feedback/article.html.erb +69 -0
  151. data/app/views/admin/feedback/edit.html.erb +48 -0
  152. data/app/views/admin/feedback/ham.js +1 -0
  153. data/app/views/admin/feedback/index.html.erb +53 -0
  154. data/app/views/admin/feedback/spam.js +1 -0
  155. data/app/views/admin/migrations/show.html.erb +39 -0
  156. data/app/views/admin/notes/_form.html.erb +37 -0
  157. data/app/views/admin/notes/_header.html.erb +6 -0
  158. data/app/views/admin/notes/_list.html.erb +13 -0
  159. data/app/views/admin/notes/_note.html.erb +14 -0
  160. data/app/views/admin/notes/edit.html.erb +11 -0
  161. data/app/views/admin/notes/index.html.erb +11 -0
  162. data/app/views/admin/notes/show.html.erb +14 -0
  163. data/app/views/admin/pages/_form.html.erb +101 -0
  164. data/app/views/admin/pages/_pages.html.erb +21 -0
  165. data/app/views/admin/pages/edit.html.erb +1 -0
  166. data/app/views/admin/pages/index.html.erb +17 -0
  167. data/app/views/admin/pages/new.html.erb +1 -0
  168. data/app/views/admin/post_types/_index_and_form.html.erb +65 -0
  169. data/app/views/admin/post_types/edit.html.erb +1 -0
  170. data/app/views/admin/post_types/index.html.erb +1 -0
  171. data/app/views/admin/profiles/index.html.erb +10 -0
  172. data/app/views/admin/redirects/_index_and_form.html.erb +68 -0
  173. data/app/views/admin/redirects/edit.html.erb +1 -0
  174. data/app/views/admin/redirects/index.html.erb +1 -0
  175. data/app/views/admin/resources/index.html.erb +68 -0
  176. data/app/views/admin/seo/_general.html.erb +123 -0
  177. data/app/views/admin/seo/_permalinks.html.erb +53 -0
  178. data/app/views/admin/seo/_titles.html.erb +210 -0
  179. data/app/views/admin/seo/show.html.erb +32 -0
  180. data/app/views/admin/settings/display.html.erb +110 -0
  181. data/app/views/admin/settings/feedback.html.erb +125 -0
  182. data/app/views/admin/settings/index.html.erb +73 -0
  183. data/app/views/admin/settings/write.html.erb +87 -0
  184. data/app/views/admin/shared/_edit.html.erb +4 -0
  185. data/app/views/admin/shared/_menu.html.erb +122 -0
  186. data/app/views/admin/shared/_twitter_alert.html.erb +3 -0
  187. data/app/views/admin/sidebar/_available.html.erb +6 -0
  188. data/app/views/admin/sidebar/_available.json.erb +6 -0
  189. data/app/views/admin/sidebar/_config.html.erb +27 -0
  190. data/app/views/admin/sidebar/_target.html.erb +9 -0
  191. data/app/views/admin/sidebar/_target_sidebar.html.erb +20 -0
  192. data/app/views/admin/sidebar/destroy.js.erb +1 -0
  193. data/app/views/admin/sidebar/index.html.erb +31 -0
  194. data/app/views/admin/sidebar/sortable.js.erb +3 -0
  195. data/app/views/admin/sidebar/update.js.erb +2 -0
  196. data/app/views/admin/tags/_index_and_form.html.erb +59 -0
  197. data/app/views/admin/tags/edit.html.erb +1 -0
  198. data/app/views/admin/tags/index.html.erb +1 -0
  199. data/app/views/admin/themes/index.html.erb +27 -0
  200. data/app/views/admin/users/_form.html.erb +215 -0
  201. data/app/views/admin/users/edit.html.erb +8 -0
  202. data/app/views/admin/users/index.html.erb +39 -0
  203. data/app/views/admin/users/new.html.erb +8 -0
  204. data/app/views/archives_sidebar/_content.html.erb +13 -0
  205. data/app/views/articles/_article.html.erb +9 -0
  206. data/app/views/articles/_article_collection.html.erb +8 -0
  207. data/app/views/articles/_article_content.html.erb +5 -0
  208. data/app/views/articles/_article_excerpt.html.erb +13 -0
  209. data/app/views/articles/_article_links.html.erb +10 -0
  210. data/app/views/articles/_comment.html.erb +1 -0
  211. data/app/views/articles/_comment_errors.html.erb +2 -0
  212. data/app/views/articles/_comment_form.html.erb +48 -0
  213. data/app/views/articles/_comment_list.html.erb +5 -0
  214. data/app/views/articles/_comment_preview.html.erb +4 -0
  215. data/app/views/articles/_full_article_content.html.erb +2 -0
  216. data/app/views/articles/_password_form.html.erb +10 -0
  217. data/app/views/articles/_protected_article_content.html.erb +6 -0
  218. data/app/views/articles/_trackback.html.erb +6 -0
  219. data/app/views/articles/archives.html.erb +25 -0
  220. data/app/views/articles/comment.js.erb +5 -0
  221. data/app/views/articles/comment_failed.js.erb +3 -0
  222. data/app/views/articles/error.html.erb +3 -0
  223. data/app/views/articles/feedback_atom_feed.atom.builder +8 -0
  224. data/app/views/articles/feedback_rss_feed.rss.builder +21 -0
  225. data/app/views/articles/index.html.erb +1 -0
  226. data/app/views/articles/index_atom_feed.atom.builder +8 -0
  227. data/app/views/articles/index_rss_feed.rss.builder +20 -0
  228. data/app/views/articles/live_search.html.erb +10 -0
  229. data/app/views/articles/read.html.erb +61 -0
  230. data/app/views/articles/search.html.erb +8 -0
  231. data/app/views/articles/trackback.xml.builder +5 -0
  232. data/app/views/articles/view_page.html.erb +3 -0
  233. data/app/views/authors/show.html.erb +40 -0
  234. data/app/views/authors/show_atom_feed.atom.builder +8 -0
  235. data/app/views/authors/show_rss_feed.rss.builder +20 -0
  236. data/app/views/comments/_comment.html.erb +16 -0
  237. data/app/views/comments/index.html.erb +1 -0
  238. data/app/views/comments/index_atom_feed.atom.builder +8 -0
  239. data/app/views/comments/index_rss_feed.rss.builder +20 -0
  240. data/app/views/comments/preview.html.erb +1 -0
  241. data/app/views/comments/preview.js.erb +3 -0
  242. data/app/views/devise/mailer/reset_password_instructions.html.erb +13 -0
  243. data/app/views/devise/passwords/edit.html.erb +28 -0
  244. data/app/views/devise/passwords/new.html.erb +20 -0
  245. data/app/views/devise/registrations/new.html.erb +36 -0
  246. data/app/views/devise/sessions/new.html.erb +32 -0
  247. data/app/views/devise/shared/_links.html.erb +15 -0
  248. data/app/views/errors/404.html.erb +2 -0
  249. data/app/views/layouts/accounts.html.erb +33 -0
  250. data/app/views/layouts/administration.html.erb +37 -0
  251. data/app/views/layouts/default.html.erb +32 -0
  252. data/app/views/layouts/editor.html.erb +31 -0
  253. data/app/views/meta_sidebar/_content.html.erb +8 -0
  254. data/app/views/notes/_note.html.erb +15 -0
  255. data/app/views/notes/error.html.erb +3 -0
  256. data/app/views/notes/index.html.erb +15 -0
  257. data/app/views/notes/show.html.erb +5 -0
  258. data/app/views/notes/show_in_reply.html.erb +16 -0
  259. data/app/views/notification_mailer/_mail_footer.html.erb +7 -0
  260. data/app/views/notification_mailer/_mail_header.html.erb +1 -0
  261. data/app/views/notification_mailer/article.html.erb +6 -0
  262. data/app/views/notification_mailer/comment.html.erb +11 -0
  263. data/app/views/notification_mailer/notif_user.html.erb +14 -0
  264. data/app/views/page_sidebar/_content.html.erb +12 -0
  265. data/app/views/search_sidebar/_content.html.erb +10 -0
  266. data/app/views/settings/done.html.erb +2 -0
  267. data/app/views/settings/install.html.erb +12 -0
  268. data/app/views/setup/index.html.erb +13 -0
  269. data/app/views/shared/_atom_header.atom.builder +6 -0
  270. data/app/views/shared/_atom_item_article.atom.builder +39 -0
  271. data/app/views/shared/_atom_item_comment.atom.builder +10 -0
  272. data/app/views/shared/_atom_item_trackback.atom.builder +9 -0
  273. data/app/views/shared/_flash.erb +10 -0
  274. data/app/views/shared/_page_header.html.erb +26 -0
  275. data/app/views/shared/_rss_item_article.rss.builder +35 -0
  276. data/app/views/shared/_rss_item_comment.rss.builder +8 -0
  277. data/app/views/shared/_rss_item_trackback.rss.builder +7 -0
  278. data/app/views/sidebar/_row.html.erb +1 -0
  279. data/app/views/sidebar/_sidebar.html.erb +5 -0
  280. data/app/views/sidebar/display_plugins.html.erb +5 -0
  281. data/app/views/sidebar/show.html.erb +1 -0
  282. data/app/views/static_sidebar/_content.html.erb +2 -0
  283. data/app/views/tag_sidebar/_content.html.erb +10 -0
  284. data/app/views/tags/index.html.erb +15 -0
  285. data/app/views/tags/show.html.erb +1 -0
  286. data/app/views/theme/static_view_test.html.erb +1 -0
  287. data/app/views/trackbacks/index_atom_feed.atom.builder +7 -0
  288. data/app/views/trackbacks/index_rss_feed.rss.builder +20 -0
  289. data/app/views/trackbacks/trackback.xml.builder +4 -0
  290. data/app/views/xml/_googlesitemap_item_article.googlesitemap.builder +5 -0
  291. data/app/views/xml/_googlesitemap_item_category.googlesitemap.builder +4 -0
  292. data/app/views/xml/_googlesitemap_item_page.googlesitemap.builder +4 -0
  293. data/app/views/xml/_googlesitemap_item_tag.googlesitemap.builder +4 -0
  294. data/app/views/xml/feed.googlesitemap.builder +7 -0
  295. data/app/views/xml/rsd.rsd.builder +8 -0
  296. data/config/i18n-tasks.yml +49 -0
  297. data/config/initializers/devise.rb +265 -0
  298. data/config/initializers/mime_types.rb +6 -0
  299. data/config/locales/da.yml +827 -0
  300. data/config/locales/de.yml +827 -0
  301. data/config/locales/en.yml +827 -0
  302. data/config/locales/es-MX.yml +827 -0
  303. data/config/locales/fr.yml +827 -0
  304. data/config/locales/he.yml +827 -0
  305. data/config/locales/it.yml +827 -0
  306. data/config/locales/ja.yml +827 -0
  307. data/config/locales/lt.yml +827 -0
  308. data/config/locales/nb-NO.yml +827 -0
  309. data/config/locales/nl.yml +827 -0
  310. data/config/locales/pl.yml +827 -0
  311. data/config/locales/pt-BR.yml +827 -0
  312. data/config/locales/ro.yml +827 -0
  313. data/config/locales/ru.yml +827 -0
  314. data/config/locales/sidebars.da.yml +20 -0
  315. data/config/locales/sidebars.de.yml +20 -0
  316. data/config/locales/sidebars.en.yml +20 -0
  317. data/config/locales/sidebars.es-MX.yml +20 -0
  318. data/config/locales/sidebars.fr.yml +20 -0
  319. data/config/locales/sidebars.he.yml +20 -0
  320. data/config/locales/sidebars.it.yml +20 -0
  321. data/config/locales/sidebars.ja.yml +20 -0
  322. data/config/locales/sidebars.lt.yml +20 -0
  323. data/config/locales/sidebars.nb-NO.yml +20 -0
  324. data/config/locales/sidebars.nl.yml +20 -0
  325. data/config/locales/sidebars.pl.yml +20 -0
  326. data/config/locales/sidebars.pt-BR.yml +20 -0
  327. data/config/locales/sidebars.ro.yml +20 -0
  328. data/config/locales/sidebars.ru.yml +20 -0
  329. data/config/locales/sidebars.zh-CN.yml +20 -0
  330. data/config/locales/sidebars.zh-TW.yml +20 -0
  331. data/config/locales/zh-CN.yml +827 -0
  332. data/config/locales/zh-TW.yml +827 -0
  333. data/config/routes.rb +177 -0
  334. data/db/migrate/113_initial_schema.rb +205 -0
  335. data/db/migrate/114_fixes_buggy_articles_and_notes.rb +52 -0
  336. data/db/migrate/115_drops_categories_for_tags.rb +34 -0
  337. data/db/migrate/20150207131657_add_missing_indexes.rb +19 -0
  338. data/db/migrate/20150807134129_simplify_redirect_relations.rb +38 -0
  339. data/db/migrate/20150808052637_add_blog_ids.rb +33 -0
  340. data/db/migrate/20150808191127_add_blog_id_to_redirects.rb +15 -0
  341. data/db/migrate/20150810094754_add_blog_id_to_tags.rb +15 -0
  342. data/db/migrate/20160108111120_add_devise_to_users.rb +53 -0
  343. data/db/migrate/20160108184201_move_last_connection_to_last_sign_in_at.rb +16 -0
  344. data/db/migrate/20160110094906_remove_profiles_rights.rb +14 -0
  345. data/db/migrate/20160605103918_replace_profile_id_with_string.rb +30 -0
  346. data/db/migrate/20160605154632_remove_profiles.rb +24 -0
  347. data/db/migrate/20160701061851_demand_blog_id_on_contents.rb +9 -0
  348. data/db/migrate/20160701062604_add_blog_id_to_resources.rb +28 -0
  349. data/db/seeds.rb +37 -0
  350. data/lib/email_notify.rb +26 -0
  351. data/lib/format.rb +17 -0
  352. data/lib/publify_core/engine.rb +23 -0
  353. data/lib/publify_core/lang.rb +5 -0
  354. data/lib/publify_core/version.rb +3 -0
  355. data/lib/publify_core.rb +56 -0
  356. data/lib/publify_guid.rb +9 -0
  357. data/lib/publify_plugins.rb +72 -0
  358. data/lib/publify_textfilter_markdown.rb +44 -0
  359. data/lib/publify_textfilter_none.rb +14 -0
  360. data/lib/publify_textfilter_smartypants.rb +14 -0
  361. data/lib/publify_textfilter_textile.rb +21 -0
  362. data/lib/publify_textfilter_twitterfilter.rb +33 -0
  363. data/lib/publify_time.rb +30 -0
  364. data/lib/sidebar_field.rb +115 -0
  365. data/lib/sidebar_registry.rb +33 -0
  366. data/lib/spam_protection.rb +101 -0
  367. data/lib/stateful.rb +106 -0
  368. data/lib/tasks/publify_core_tasks.rake +4 -0
  369. data/lib/text_filter_plugin.rb +182 -0
  370. data/lib/theme.rb +72 -0
  371. data/lib/transforms.rb +45 -0
  372. metadata +865 -0
@@ -0,0 +1,17 @@
1
+ window._lang = "da_DK" ;
2
+ window._l10s = window._l10s || { } ;
3
+ window._l10s["da_DK"] = {
4
+
5
+ "#{0} from now": "#{0} fra nn",
6
+ "#{0} ago": "#{0} siden",
7
+ "on #{0}": "på #{0}",
8
+ "less than a minute": "mindre end et minut",
9
+ "#{0} minute": "#{0} minut",
10
+ "#{0} minutes": "#{0} minutter",
11
+ "about one hour": "omkring en time",
12
+ "#{0} hours": "#{0} timer",
13
+ "one day": "en dag",
14
+ "about one day": "ca. en dag",
15
+ "#{0} days": "#{0} dage"
16
+
17
+ };
@@ -0,0 +1,21 @@
1
+ window._lang = "en_US" ;
2
+ window._l10s = window._l10s || { } ;
3
+ window._l10s["en_US"] = {
4
+
5
+ "#{0} from now": "#{0} from now",
6
+ "#{0} ago": "#{0} ago",
7
+ "on #{0}": "on #{0}",
8
+ "less than a minute": "less than a minute",
9
+ "#{0} minute": "#{0} minute",
10
+ "#{0} minutes": "#{0} minutes",
11
+ "about one hour": "about one hour",
12
+ "#{0} hours": "#{0} hours",
13
+ "one day": "one day",
14
+ "about one day": "about one day",
15
+ "#{0} days": "#{0} days"
16
+
17
+ } ;
18
+
19
+
20
+
21
+
@@ -0,0 +1,21 @@
1
+ window._lang = "en_US" ;
2
+ window._l10s = window._l10s || { } ;
3
+ window._l10s["en_US"] = {
4
+
5
+ "#{0} from now": "#{0} from now",
6
+ "#{0} ago": "#{0} ago",
7
+ "on #{0}": "on #{0}",
8
+ "less than a minute": "less than a minute",
9
+ "#{0} minute": "#{0} minute",
10
+ "#{0} minutes": "#{0} minutes",
11
+ "about one hour": "about one hour",
12
+ "#{0} hours": "#{0} hours",
13
+ "one day": "one day",
14
+ "about one day": "about one day",
15
+ "#{0} days": "#{0} days"
16
+
17
+ } ;
18
+
19
+
20
+
21
+
@@ -0,0 +1,21 @@
1
+ window._lang = "fr_FR" ;
2
+ window._l10s = window._l10s || { } ;
3
+ window._l10s["fr_FR"] = {
4
+
5
+ "#{0} from now": "dans #{0}",
6
+ "#{0} ago": "il y a #{0}",
7
+ "on #{0}": "le #{0}",
8
+ "less than a minute": "moins d'une minute",
9
+ "#{0} minute": "#{0} minute",
10
+ "#{0} minutes": "#{0} minutes",
11
+ "about one hour": "environ une heure",
12
+ "#{0} hours": "#{0} heures",
13
+ "one day": "un jour",
14
+ "about one day": "environ un jour",
15
+ "#{0} days": "#{0} jours"
16
+
17
+ } ;
18
+
19
+
20
+
21
+
@@ -0,0 +1,21 @@
1
+ window._lang = "nl_NL" ;
2
+ window._l10s = window._l10s || { } ;
3
+ window._l10s["nl_NL"] = {
4
+
5
+ "#{0} from now": "#{0} vanaf nu",
6
+ "#{0} ago": "#{0} geleden",
7
+ "on #{0}": "op #{0}",
8
+ "less than a minute": "minder dan een minuut",
9
+ "#{0} minute": "#{0} minuut",
10
+ "#{0} minutes": "#{0} minuten",
11
+ "about one hour": "ongeveer een uur",
12
+ "#{0} hours": "#{0} uren",
13
+ "one day": "een dag",
14
+ "about one day": "ongeveer een dag",
15
+ "#{0} days": "#{0} dagen"
16
+
17
+ } ;
18
+
19
+
20
+
21
+
@@ -0,0 +1,17 @@
1
+ window._lang = "zh_TW" ;
2
+ window._l10s = window._l10s || { } ;
3
+ window._l10s["zh_TW"] = {
4
+
5
+ "#{0} from now": "距離現在#{0}",
6
+ "#{0} ago": "#{0} 之前",
7
+ "on #{0}": "在 #{0}",
8
+ "less than a minute": "少於一分鐘",
9
+ "#{0} minute": "#{0} 分鐘",
10
+ "#{0} minutes": "#{0} 分鐘",
11
+ "about one hour": "大約一小時",
12
+ "#{0} hours": "#{0} 小時",
13
+ "one day": "一天",
14
+ "about one day": "大約一天",
15
+ "#{0} days": "#{0} 天"
16
+
17
+ } ;
@@ -0,0 +1,350 @@
1
+ /*
2
+ Lightbox for Bootstrap 3 by @ashleydw
3
+ https://github.com/ashleydw/lightbox
4
+
5
+ License: https://github.com/ashleydw/lightbox/blob/master/LICENSE
6
+ */
7
+
8
+
9
+ (function() {
10
+ "use strict";
11
+ var $, EkkoLightbox;
12
+
13
+ $ = jQuery;
14
+
15
+ EkkoLightbox = function(element, options) {
16
+ var content, footer, header,
17
+ _this = this;
18
+ this.options = $.extend({
19
+ title: null,
20
+ footer: null,
21
+ remote: null
22
+ }, $.fn.ekkoLightbox.defaults, options || {});
23
+ this.$element = $(element);
24
+ content = '';
25
+ this.modal_id = this.options.modal_id ? this.options.modal_id : 'ekkoLightbox-' + Math.floor((Math.random() * 1000) + 1);
26
+ header = '<div class="modal-header"' + (this.options.title || this.options.always_show_close ? '' : ' style="display:none"') + '><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title">' + (this.options.title || "&nbsp;") + '</h4></div>';
27
+ footer = '<div class="modal-footer"' + (this.options.footer ? '' : ' style="display:none"') + '>' + this.options.footer + '</div>';
28
+ $(document.body).append('<div id="' + this.modal_id + '" class="ekko-lightbox modal fade" tabindex="-1"><div class="modal-dialog"><div class="modal-content">' + header + '<div class="modal-body"><div class="ekko-lightbox-container"><div></div></div></div>' + footer + '</div></div></div>');
29
+ this.modal = $('#' + this.modal_id);
30
+ this.modal_dialog = this.modal.find('.modal-dialog').first();
31
+ this.modal_content = this.modal.find('.modal-content').first();
32
+ this.modal_body = this.modal.find('.modal-body').first();
33
+ this.lightbox_container = this.modal_body.find('.ekko-lightbox-container').first();
34
+ this.lightbox_body = this.lightbox_container.find('> div:first-child').first();
35
+ this.showLoading();
36
+ this.modal_arrows = null;
37
+ this.border = {
38
+ top: parseFloat(this.modal_dialog.css('border-top-width')) + parseFloat(this.modal_content.css('border-top-width')) + parseFloat(this.modal_body.css('border-top-width')),
39
+ right: parseFloat(this.modal_dialog.css('border-right-width')) + parseFloat(this.modal_content.css('border-right-width')) + parseFloat(this.modal_body.css('border-right-width')),
40
+ bottom: parseFloat(this.modal_dialog.css('border-bottom-width')) + parseFloat(this.modal_content.css('border-bottom-width')) + parseFloat(this.modal_body.css('border-bottom-width')),
41
+ left: parseFloat(this.modal_dialog.css('border-left-width')) + parseFloat(this.modal_content.css('border-left-width')) + parseFloat(this.modal_body.css('border-left-width'))
42
+ };
43
+ this.padding = {
44
+ top: parseFloat(this.modal_dialog.css('padding-top')) + parseFloat(this.modal_content.css('padding-top')) + parseFloat(this.modal_body.css('padding-top')),
45
+ right: parseFloat(this.modal_dialog.css('padding-right')) + parseFloat(this.modal_content.css('padding-right')) + parseFloat(this.modal_body.css('padding-right')),
46
+ bottom: parseFloat(this.modal_dialog.css('padding-bottom')) + parseFloat(this.modal_content.css('padding-bottom')) + parseFloat(this.modal_body.css('padding-bottom')),
47
+ left: parseFloat(this.modal_dialog.css('padding-left')) + parseFloat(this.modal_content.css('padding-left')) + parseFloat(this.modal_body.css('padding-left'))
48
+ };
49
+ this.modal.on('show.bs.modal', this.options.onShow.bind(this)).on('shown.bs.modal', function() {
50
+ _this.modal_shown();
51
+ return _this.options.onShown.call(_this);
52
+ }).on('hide.bs.modal', this.options.onHide.bind(this)).on('hidden.bs.modal', function() {
53
+ if (_this.gallery) {
54
+ $(document).off('keydown.ekkoLightbox');
55
+ }
56
+ _this.modal.remove();
57
+ return _this.options.onHidden.call(_this);
58
+ }).modal('show', options);
59
+ return this.modal;
60
+ };
61
+
62
+ EkkoLightbox.prototype = {
63
+ modal_shown: function() {
64
+ var video_id,
65
+ _this = this;
66
+ if (!this.options.remote) {
67
+ return this.error('No remote target given');
68
+ } else {
69
+ this.gallery = this.$element.data('gallery');
70
+ if (this.gallery) {
71
+ if (this.options.gallery_parent_selector === 'document.body' || this.options.gallery_parent_selector === '') {
72
+ this.gallery_items = $(document.body).find('*[data-toggle="lightbox"][data-gallery="' + this.gallery + '"]');
73
+ } else {
74
+ this.gallery_items = this.$element.parents(this.options.gallery_parent_selector).first().find('*[data-toggle="lightbox"][data-gallery="' + this.gallery + '"]');
75
+ }
76
+ this.gallery_index = this.gallery_items.index(this.$element);
77
+ $(document).on('keydown.ekkoLightbox', this.navigate.bind(this));
78
+ if (this.options.directional_arrows && this.gallery_items.length > 1) {
79
+ this.lightbox_container.prepend('<div class="ekko-lightbox-nav-overlay"><a href="#" class="' + this.strip_stops(this.options.left_arrow_class) + '"></a><a href="#" class="' + this.strip_stops(this.options.right_arrow_class) + '"></a></div>');
80
+ this.modal_arrows = this.lightbox_container.find('div.ekko-lightbox-nav-overlay').first();
81
+ this.lightbox_container.find('a' + this.strip_spaces(this.options.left_arrow_class)).on('click', function(event) {
82
+ event.preventDefault();
83
+ return _this.navigate_left();
84
+ });
85
+ this.lightbox_container.find('a' + this.strip_spaces(this.options.right_arrow_class)).on('click', function(event) {
86
+ event.preventDefault();
87
+ return _this.navigate_right();
88
+ });
89
+ }
90
+ }
91
+ if (this.options.type) {
92
+ if (this.options.type === 'image') {
93
+ return this.preloadImage(this.options.remote, true);
94
+ } else if (this.options.type === 'youtube' && (video_id = this.getYoutubeId(this.options.remote))) {
95
+ return this.showYoutubeVideo(video_id);
96
+ } else if (this.options.type === 'vimeo') {
97
+ return this.showVimeoVideo(this.options.remote);
98
+ } else if (this.options.type === 'instagram') {
99
+ return this.showInstagramVideo(this.options.remote);
100
+ } else {
101
+ return this.error("Could not detect remote target type. Force the type using data-type=\"image|youtube|vimeo\"");
102
+ }
103
+ } else {
104
+ return this.detectRemoteType(this.options.remote);
105
+ }
106
+ }
107
+ },
108
+ strip_stops: function(str) {
109
+ return str.replace(/\./g, '');
110
+ },
111
+ strip_spaces: function(str) {
112
+ return str.replace(/\s/g, '');
113
+ },
114
+ isImage: function(str) {
115
+ return str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i);
116
+ },
117
+ isSwf: function(str) {
118
+ return str.match(/\.(swf)((\?|#).*)?$/i);
119
+ },
120
+ getYoutubeId: function(str) {
121
+ var match;
122
+ match = str.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);
123
+ if (match && match[2].length === 11) {
124
+ return match[2];
125
+ } else {
126
+ return false;
127
+ }
128
+ },
129
+ getVimeoId: function(str) {
130
+ if (str.indexOf('vimeo') > 0) {
131
+ return str;
132
+ } else {
133
+ return false;
134
+ }
135
+ },
136
+ getInstagramId: function(str) {
137
+ if (str.indexOf('instagram') > 0) {
138
+ return str;
139
+ } else {
140
+ return false;
141
+ }
142
+ },
143
+ navigate: function(event) {
144
+ event = event || window.event;
145
+ if (event.keyCode === 39 || event.keyCode === 37) {
146
+ if (event.keyCode === 39) {
147
+ return this.navigate_right();
148
+ } else if (event.keyCode === 37) {
149
+ return this.navigate_left();
150
+ }
151
+ }
152
+ },
153
+ navigate_left: function() {
154
+ var src;
155
+ this.showLoading();
156
+ if (this.gallery_items.length === 1) {
157
+ return;
158
+ }
159
+ if (this.gallery_index === 0) {
160
+ this.gallery_index = this.gallery_items.length - 1;
161
+ } else {
162
+ this.gallery_index--;
163
+ }
164
+ this.$element = $(this.gallery_items.get(this.gallery_index));
165
+ this.updateTitleAndFooter();
166
+ src = this.$element.attr('data-remote') || this.$element.attr('href');
167
+ return this.detectRemoteType(src, this.$element.attr('data-type'));
168
+ },
169
+ navigate_right: function() {
170
+ var next, src;
171
+ this.showLoading();
172
+ if (this.gallery_items.length === 1) {
173
+ return;
174
+ }
175
+ if (this.gallery_index === this.gallery_items.length - 1) {
176
+ this.gallery_index = 0;
177
+ } else {
178
+ this.gallery_index++;
179
+ }
180
+ this.$element = $(this.gallery_items.get(this.gallery_index));
181
+ src = this.$element.attr('data-remote') || this.$element.attr('href');
182
+ this.updateTitleAndFooter();
183
+ this.detectRemoteType(src, this.$element.attr('data-type'));
184
+ if (this.gallery_index + 1 < this.gallery_items.length) {
185
+ next = $(this.gallery_items.get(this.gallery_index + 1), false);
186
+ src = next.attr('data-remote') || next.attr('href');
187
+ if (next.attr('data-type') === 'image' || this.isImage(src)) {
188
+ return this.preloadImage(src, false);
189
+ }
190
+ }
191
+ },
192
+ detectRemoteType: function(src, type) {
193
+ var video_id;
194
+ if (type === 'image' || this.isImage(src)) {
195
+ this.options.type = 'image';
196
+ return this.preloadImage(src, true);
197
+ } else if (type === 'youtube' || (video_id = this.getYoutubeId(src))) {
198
+ this.options.type = 'youtube';
199
+ return this.showYoutubeVideo(video_id);
200
+ } else if (type === 'vimeo' || (video_id = this.getVimeoId(src))) {
201
+ this.options.type = 'vimeo';
202
+ return this.showVimeoVideo(video_id);
203
+ } else if (type === 'instagram' || (video_id = this.getInstagramId(src))) {
204
+ this.options.type = 'instagram';
205
+ return this.showInstagramVideo(video_id);
206
+ } else {
207
+ return this.error("Could not detect remote target type. Force the type using data-type=\"image|youtube|vimeo\"");
208
+ }
209
+ },
210
+ updateTitleAndFooter: function() {
211
+ var caption, footer, header, title;
212
+ header = this.modal_content.find('.modal-header');
213
+ footer = this.modal_content.find('.modal-footer');
214
+ title = this.$element.data('title') || "";
215
+ caption = this.$element.data('footer') || "";
216
+ if (title || this.options.always_show_close) {
217
+ header.css('display', '').find('.modal-title').html(title || "&nbsp;");
218
+ } else {
219
+ header.css('display', 'none');
220
+ }
221
+ if (caption) {
222
+ footer.css('display', '').html(caption);
223
+ } else {
224
+ footer.css('display', 'none');
225
+ }
226
+ return this;
227
+ },
228
+ showLoading: function() {
229
+ this.lightbox_body.html('<div class="modal-loading">Loading..</div>');
230
+ return this;
231
+ },
232
+ showYoutubeVideo: function(id) {
233
+ var aspectRatio, height, width;
234
+ aspectRatio = 560 / 315;
235
+ width = this.$element.data('width') || 560;
236
+ width = this.checkDimensions(width);
237
+ height = width / aspectRatio;
238
+ this.resize(width);
239
+ this.lightbox_body.html('<iframe width="' + width + '" height="' + height + '" src="//www.youtube.com/embed/' + id + '?badge=0&autoplay=1&html5=1" frameborder="0" allowfullscreen></iframe>');
240
+ if (this.modal_arrows) {
241
+ return this.modal_arrows.css('display', 'none');
242
+ }
243
+ },
244
+ showVimeoVideo: function(id) {
245
+ var aspectRatio, height, width;
246
+ aspectRatio = 500 / 281;
247
+ width = this.$element.data('width') || 560;
248
+ width = this.checkDimensions(width);
249
+ height = width / aspectRatio;
250
+ this.resize(width);
251
+ this.lightbox_body.html('<iframe width="' + width + '" height="' + height + '" src="' + id + '?autoplay=1" frameborder="0" allowfullscreen></iframe>');
252
+ if (this.modal_arrows) {
253
+ return this.modal_arrows.css('display', 'none');
254
+ }
255
+ },
256
+ showInstagramVideo: function(id) {
257
+ var height, width;
258
+ width = this.$element.data('width') || 612;
259
+ width = this.checkDimensions(width);
260
+ height = width;
261
+ this.resize(width);
262
+ this.lightbox_body.html('<iframe width="' + width + '" height="' + height + '" src="' + this.addTrailingSlash(id) + 'embed/" frameborder="0" allowfullscreen></iframe>');
263
+ if (this.modal_arrows) {
264
+ return this.modal_arrows.css('display', 'none');
265
+ }
266
+ },
267
+ error: function(message) {
268
+ this.lightbox_body.html(message);
269
+ return this;
270
+ },
271
+ preloadImage: function(src, onLoadShowImage) {
272
+ var img,
273
+ _this = this;
274
+ img = new Image();
275
+ if ((onLoadShowImage == null) || onLoadShowImage === true) {
276
+ img.onload = function() {
277
+ var image;
278
+ image = $('<img />');
279
+ image.attr('src', img.src);
280
+ image.addClass('img-responsive');
281
+ _this.lightbox_body.html(image);
282
+ if (_this.modal_arrows) {
283
+ _this.modal_arrows.css('display', 'block');
284
+ }
285
+ return _this.resize(img.width);
286
+ };
287
+ img.onerror = function() {
288
+ return _this.error('Failed to load image: ' + src);
289
+ };
290
+ }
291
+ img.src = src;
292
+ return img;
293
+ },
294
+ resize: function(width) {
295
+ var width_total;
296
+ width_total = width + this.border.left + this.padding.left + this.padding.right + this.border.right;
297
+ this.modal_dialog.css('width', 'auto').css('max-width', width_total);
298
+ this.lightbox_container.find('a').css('padding-top', function() {
299
+ return $(this).parent().height() / 2;
300
+ });
301
+ return this;
302
+ },
303
+ checkDimensions: function(width) {
304
+ var body_width, width_total;
305
+ width_total = width + this.border.left + this.padding.left + this.padding.right + this.border.right;
306
+ body_width = document.body.clientWidth;
307
+ if (width_total > body_width) {
308
+ width = this.modal_body.width();
309
+ }
310
+ return width;
311
+ },
312
+ close: function() {
313
+ return this.modal.modal('hide');
314
+ },
315
+ addTrailingSlash: function(url) {
316
+ if (url.substr(-1) !== '/') {
317
+ url += '/';
318
+ }
319
+ return url;
320
+ }
321
+ };
322
+
323
+ $.fn.ekkoLightbox = function(options) {
324
+ return this.each(function() {
325
+ var $this;
326
+ $this = $(this);
327
+ options = $.extend({
328
+ remote: $this.attr('data-remote') || $this.attr('href'),
329
+ gallery_parent_selector: $this.attr('data-parent'),
330
+ type: $this.attr('data-type')
331
+ }, options, $this.data());
332
+ new EkkoLightbox(this, options);
333
+ return this;
334
+ });
335
+ };
336
+
337
+ $.fn.ekkoLightbox.defaults = {
338
+ gallery_parent_selector: '*:not(.row)',
339
+ left_arrow_class: '.glyphicon .glyphicon-chevron-left',
340
+ right_arrow_class: '.glyphicon .glyphicon-chevron-right',
341
+ directional_arrows: true,
342
+ type: null,
343
+ always_show_close: true,
344
+ onShow: function() {},
345
+ onShown: function() {},
346
+ onHide: function() {},
347
+ onHidden: function() {}
348
+ };
349
+
350
+ }).call(this);
@@ -0,0 +1,28 @@
1
+ $(document).ready(function(){
2
+ var timer = 0;
3
+
4
+ var handle_field_change = function(evt) {
5
+ var $field = $(evt.target);
6
+ var url = $field.data('url');
7
+ var target = $field.data('target');
8
+ var spinner = $field.data('spinner');
9
+ $(spinner).show();
10
+ $.ajax({
11
+ type: 'GET',
12
+ url: url,
13
+ dataType: 'html',
14
+ data: $field.serialize(),
15
+ success: function(data) { $(target).html(data); },
16
+ complete: function() { $(spinner).hide(); }
17
+ });
18
+ };
19
+
20
+ var delay_callback = function(callback) {
21
+ clearTimeout(timer);
22
+ timer = setTimeout(callback, 200);
23
+ }
24
+
25
+ $('.observable').on('keyup keydown paste', function(evt) {
26
+ delay_callback(function() { handle_field_change(evt) });
27
+ });
28
+ });
@@ -0,0 +1,11 @@
1
+ // Front-end javascript manifest
2
+ //
3
+ //= require jquery
4
+ //= require cookies
5
+ //= require rails-timeago-all
6
+ //= require set-timeago-lang
7
+ //= require jquery_ujs
8
+ //= require lightbox
9
+ //= require observe
10
+ //
11
+ //= require_self
@@ -0,0 +1,138 @@
1
+ // Admin javascript manifest
2
+ //
3
+ //= require jquery
4
+ //= require jquery_ujs
5
+ //= require jquery-ui
6
+ //= require jquery-ui/datepicker-da
7
+ //= require jquery-ui/datepicker-de
8
+ //= require jquery-ui/datepicker-es
9
+ //= require jquery-ui/datepicker-fr
10
+ //= require jquery-ui/datepicker-he
11
+ //= require jquery-ui/datepicker-it
12
+ //= require jquery-ui/datepicker-ja
13
+ //= require jquery-ui/datepicker-lt
14
+ //= require jquery-ui/datepicker-nb
15
+ //= require jquery-ui/datepicker-nl
16
+ //= require jquery-ui/datepicker-pl
17
+ //= require jquery-ui/datepicker-pt-BR
18
+ //= require jquery-ui/datepicker-ro
19
+ //= require jquery-ui/datepicker-ru
20
+ //= require jquery-ui/datepicker-zh-CN
21
+ //= require jquery-ui/datepicker-zh-TW
22
+ //= require datetimepicker
23
+ //= require bootstrap
24
+ //= require quicktags
25
+ //= require widearea
26
+ //= require tagmanager
27
+ //= require typeahead
28
+ //= require sidebar
29
+ //= require spinnable
30
+ //= require lightbox
31
+ //
32
+ //= require_self
33
+
34
+ /* typewatch() borrowed from
35
+ * http://stackoverflow.com/questions/2219924/idiomatic-jquery-delayed-event-only-after-a-short-pause-in-typing-e-g-timew
36
+ */
37
+ var typewatch = (function(){
38
+ var timer = 0;
39
+ return function(callback, ms){
40
+ clearTimeout (timer);
41
+ timer = setTimeout(callback, ms);
42
+ }
43
+ })();
44
+
45
+ function autosave_request(e) {
46
+ $('#article_form').keyup(function() {
47
+ typewatch(function() {
48
+ $.ajax({
49
+ type: "POST",
50
+ url: '/admin/content/autosave',
51
+ data: $("#article_form").serialize()});
52
+ }, 5000)
53
+ });
54
+ }
55
+
56
+ function set_widerea(element) {
57
+ if ($("#article_id").val() == "") {
58
+ wideArea().clearData(element);
59
+ }
60
+
61
+ wideArea();
62
+ }
63
+
64
+ function tag_manager() {
65
+ var tagApi = jQuery("#article_keywords").tagsManager({
66
+ prefilled: $('#article_keywords').val()
67
+ });
68
+
69
+ jQuery("#article_keywords").typeahead({
70
+ name: 'tags',
71
+ limit: 15,
72
+ prefetch: '/admin/content/auto_complete_for_article_keywords'
73
+ }).on('typeahead:selected', function (e, d) {
74
+ tagApi.tagsManager("pushTag", d.value);
75
+ });
76
+ }
77
+
78
+ function save_article_tags() {
79
+ $('#article_keywords').val($('#article_form').find('input[name="hidden-article[keywords]"]').val());
80
+ }
81
+
82
+ function doneTyping () {
83
+ $( "#save-bar").fadeIn(2000, function() {
84
+
85
+ });
86
+ }
87
+
88
+ function set_savebar() {
89
+ var typingTimer;
90
+ var doneTypingInterval = 3000;
91
+
92
+ $( "#article_body_and_extended" ).keydown(function() {
93
+ $( "#save-bar").fadeOut(2000, function() {
94
+
95
+ });
96
+ clearTimeout(typingTimer);
97
+ });
98
+
99
+ $('#article_body_and_extended').keyup(function(){
100
+ typingTimer = setTimeout(doneTyping, doneTypingInterval);
101
+ });
102
+ }
103
+
104
+ // From http://www.shawnolson.net/scripts/public_smo_scripts.js
105
+ function check_all(checkbox) {
106
+ var form = checkbox.form, z = 0;
107
+ for(z=0; z<form.length;z++){
108
+ if(form[z].type == 'checkbox' && form[z].name != 'checkall'){
109
+ form[z].checked = checkbox.checked;
110
+ }
111
+ }
112
+ }
113
+
114
+ $(document).ready(function() {
115
+ $('#article_form').each(function(e){autosave_request(e)});
116
+ $('#article_form').submit(function(e){save_article_tags()});
117
+ $('#article_form').each(function(e){tag_manager()});
118
+ $('#article_form').each(function(e){set_widerea($('#article_body_and_extended'))});
119
+ $('#article_body_and_extended').each(function(e){set_savebar()});
120
+ $('#page_form').each(function(e){set_widerea($('#page_body'))});
121
+
122
+ // DatePickers
123
+ $('.datepicker').each(function() {
124
+ $(this).datepicker($.datepicker.regional[this.dataset.locale]);
125
+ });
126
+
127
+ // Date time picker (not related to date picker at all!)
128
+ $( "#article_published_at" ).datetimepicker();
129
+
130
+ // DropDown
131
+ $(".dropdown-toggle").dropdown();
132
+ });
133
+
134
+ $(document).delegate('*[data-toggle="lightbox"]', 'click',
135
+ function(event) {
136
+ event.preventDefault();
137
+ $(this).ekkoLightbox();
138
+ });