refinerycms-core 2.1.5 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (449) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/refinery/add.png +0 -0
  3. data/app/assets/images/refinery/admin_bg.png +0 -0
  4. data/app/assets/images/refinery/ajax-loader.gif +0 -0
  5. data/app/assets/images/refinery/branch-end.gif +0 -0
  6. data/app/assets/images/refinery/branch.gif +0 -0
  7. data/app/assets/images/refinery/cross.png +0 -0
  8. data/app/assets/images/refinery/dialogLoadingAnimation.gif +0 -0
  9. data/app/assets/images/refinery/header_background.png +0 -0
  10. data/app/assets/images/refinery/hover-gradient.jpg +0 -0
  11. data/app/assets/images/refinery/icons/accept.png +0 -0
  12. data/app/assets/images/refinery/icons/add.png +0 -0
  13. data/app/assets/images/refinery/icons/ajax-loader.gif +0 -0
  14. data/app/assets/images/refinery/icons/application_edit.png +0 -0
  15. data/app/assets/images/refinery/icons/application_go.png +0 -0
  16. data/app/assets/images/refinery/icons/arrow_left.png +0 -0
  17. data/app/assets/images/refinery/icons/arrow_left_right.png +0 -0
  18. data/app/assets/images/refinery/icons/arrow_switch.png +0 -0
  19. data/app/assets/images/refinery/icons/arrow_up.png +0 -0
  20. data/app/assets/images/refinery/icons/arrow_up_down.png +0 -0
  21. data/app/assets/images/refinery/icons/bin.png +0 -0
  22. data/app/assets/images/refinery/icons/bin_closed.png +0 -0
  23. data/app/assets/images/refinery/icons/cancel.png +0 -0
  24. data/app/assets/images/refinery/icons/cog_add.png +0 -0
  25. data/app/assets/images/refinery/icons/cog_edit.png +0 -0
  26. data/app/assets/images/refinery/icons/cross.png +0 -0
  27. data/app/assets/images/refinery/icons/delete.png +0 -0
  28. data/app/assets/images/refinery/icons/doc.png +0 -0
  29. data/app/assets/images/refinery/icons/down.gif +0 -0
  30. data/app/assets/images/refinery/icons/edit.png +0 -0
  31. data/app/assets/images/refinery/icons/email.png +0 -0
  32. data/app/assets/images/refinery/icons/email_edit.png +0 -0
  33. data/app/assets/images/refinery/icons/email_go.png +0 -0
  34. data/app/assets/images/refinery/icons/email_open.png +0 -0
  35. data/app/assets/images/refinery/icons/eye.png +0 -0
  36. data/app/assets/images/refinery/icons/folder.png +0 -0
  37. data/app/assets/images/refinery/icons/folder_open.png +0 -0
  38. data/app/assets/images/refinery/icons/folder_page_white.png +0 -0
  39. data/app/assets/images/refinery/icons/image_add.png +0 -0
  40. data/app/assets/images/refinery/icons/image_edit.png +0 -0
  41. data/app/assets/images/refinery/icons/img.png +0 -0
  42. data/app/assets/images/refinery/icons/information.png +0 -0
  43. data/app/assets/images/refinery/icons/layout_add.png +0 -0
  44. data/app/assets/images/refinery/icons/layout_edit.png +0 -0
  45. data/app/assets/images/refinery/icons/locale-blue.svg +15 -0
  46. data/app/assets/images/refinery/icons/locale.svg +11 -0
  47. data/app/assets/images/refinery/icons/music.png +0 -0
  48. data/app/assets/images/refinery/icons/page.png +0 -0
  49. data/app/assets/images/refinery/icons/page_add.png +0 -0
  50. data/app/assets/images/refinery/icons/page_edit.png +0 -0
  51. data/app/assets/images/refinery/icons/page_white_edit.png +0 -0
  52. data/app/assets/images/refinery/icons/page_white_gear.png +0 -0
  53. data/app/assets/images/refinery/icons/page_white_put.png +0 -0
  54. data/app/assets/images/refinery/icons/pdf.png +0 -0
  55. data/app/assets/images/refinery/icons/ppt.png +0 -0
  56. data/app/assets/images/refinery/icons/star.png +0 -0
  57. data/app/assets/images/refinery/icons/tick.png +0 -0
  58. data/app/assets/images/refinery/icons/up.gif +0 -0
  59. data/app/assets/images/refinery/icons/user_add.png +0 -0
  60. data/app/assets/images/refinery/icons/user_comment.png +0 -0
  61. data/app/assets/images/refinery/icons/user_edit.png +0 -0
  62. data/app/assets/images/refinery/icons/xls.png +0 -0
  63. data/app/assets/images/refinery/icons/zip.png +0 -0
  64. data/app/assets/images/refinery/icons/zoom.png +0 -0
  65. data/app/assets/images/refinery/logo-large.png +0 -0
  66. data/app/assets/images/refinery/logo-medium.png +0 -0
  67. data/app/assets/images/refinery/logo-site-bar.png +0 -0
  68. data/app/assets/images/refinery/logo-small-medium.png +0 -0
  69. data/app/assets/images/refinery/logo-small.png +0 -0
  70. data/app/assets/images/refinery/logo-tiny.png +0 -0
  71. data/app/assets/images/refinery/logo.png +0 -0
  72. data/app/assets/images/refinery/nav-3-background.gif +0 -0
  73. data/app/assets/images/refinery/nav_inactive_background.png +0 -0
  74. data/app/assets/images/refinery/orange_button.png +0 -0
  75. data/app/assets/images/refinery/page_bg.png +0 -0
  76. data/app/assets/images/refinery/text_field_background.png +0 -0
  77. data/app/assets/images/refinery/tooltip-nib.gif +0 -0
  78. data/app/assets/images/refinery/tooltip-nib.png +0 -0
  79. data/app/assets/javascripts/admin.js +7 -6
  80. data/app/assets/javascripts/refinery/admin.js.erb +99 -60
  81. data/app/assets/javascripts/refinery/ajaxy_pagination.js.coffee +2 -5
  82. data/app/assets/javascripts/refinery/application.js +8 -0
  83. data/app/assets/javascripts/refinery/core.js +4 -18
  84. data/app/assets/javascripts/refinery/interface.js.coffee.erb +5 -29
  85. data/app/assets/javascripts/refinery/modal_dialogs.js.erb +0 -105
  86. data/app/assets/javascripts/refinery/nestedsortables.js +183 -110
  87. data/app/assets/javascripts/refinery/refinery.js.erb +3 -9
  88. data/app/assets/javascripts/refinery/serializelist.js +1 -1
  89. data/app/assets/javascripts/refinery/site_bar.js +0 -5
  90. data/app/assets/javascripts/refinery/sortable_list.js +10 -11
  91. data/app/assets/javascripts/refinery/submit_continue.js.coffee.erb +1 -1
  92. data/app/assets/stylesheets/application.scss +2 -0
  93. data/app/assets/stylesheets/refinery/_colours.scss +18 -0
  94. data/app/assets/stylesheets/refinery/_icons.scss +85 -0
  95. data/app/assets/stylesheets/refinery/{layout.css.scss → _layout.scss} +306 -338
  96. data/app/assets/stylesheets/refinery/_mixins.scss +84 -0
  97. data/app/assets/stylesheets/refinery/{submenu.css.scss → _submenu.scss} +2 -2
  98. data/app/assets/stylesheets/refinery/{tooltips.css.scss → _tooltips.scss} +0 -0
  99. data/app/assets/stylesheets/refinery/_ui.scss +252 -0
  100. data/app/assets/stylesheets/refinery/{formatting.css.scss → formatting.scss} +0 -0
  101. data/app/assets/stylesheets/refinery/refinery.scss +10 -0
  102. data/app/assets/stylesheets/refinery/site_bar.scss +126 -0
  103. data/app/assets/stylesheets/refinery/{theme.css.scss → theme.scss} +0 -0
  104. data/app/controllers/refinery/admin/core_controller.rb +2 -7
  105. data/app/controllers/refinery/admin/dialogs_controller.rb +4 -3
  106. data/app/controllers/refinery/admin_controller.rb +0 -1
  107. data/app/controllers/refinery/fast_controller.rb +0 -4
  108. data/app/helpers/refinery/admin/visual_editor_helper.rb +13 -0
  109. data/app/helpers/refinery/admin_helper.rb +4 -0
  110. data/app/helpers/refinery/custom_assets_helper.rb +2 -2
  111. data/app/helpers/refinery/image_helper.rb +9 -8
  112. data/app/helpers/refinery/meta_helper.rb +1 -1
  113. data/app/helpers/refinery/site_bar_helper.rb +16 -2
  114. data/app/helpers/refinery/tag_helper.rb +38 -5
  115. data/app/models/refinery/core/base_model.rb +3 -1
  116. data/app/views/layouts/refinery/admin.html.erb +12 -10
  117. data/app/views/layouts/refinery/admin_dialog.html.erb +1 -4
  118. data/app/views/refinery/_content_page.html.erb +1 -1
  119. data/app/views/refinery/_google_analytics.html.erb +8 -9
  120. data/app/views/refinery/_head.html.erb +1 -1
  121. data/app/views/refinery/_javascripts.html.erb +0 -15
  122. data/app/views/refinery/_message.html.erb +1 -1
  123. data/app/views/refinery/_site_bar.html.erb +9 -6
  124. data/app/views/refinery/admin/_error_messages.html.erb +4 -4
  125. data/app/views/refinery/admin/_form_actions.html.erb +1 -0
  126. data/app/views/refinery/admin/_form_advanced_options_menu.html.erb +3 -4
  127. data/app/views/refinery/admin/_head.html.erb +3 -0
  128. data/app/views/refinery/admin/_image_picker.html.erb +4 -5
  129. data/app/views/refinery/admin/_javascripts.html.erb +4 -9
  130. data/app/views/refinery/admin/_locale_picker.html.erb +9 -2
  131. data/app/views/refinery/admin/_make_sortable.html.erb +8 -6
  132. data/app/views/refinery/admin/_menu.html.erb +2 -15
  133. data/app/views/refinery/admin/_menu_item.html.erb +3 -0
  134. data/app/views/refinery/admin/_resource_picker.html.erb +12 -22
  135. data/app/views/refinery/admin/_search.html.erb +1 -1
  136. data/app/views/refinery/admin/_tabbed_fields.html.erb +2 -2
  137. data/app/views/refinery/admin/_wysiwyg.html.erb +1 -1
  138. data/{lib/generators/refinery/cms/templates/app/decorators/controllers/refinery/.gitkeep → app/views/refinery/admin/dialog_success.html.erb} +0 -0
  139. data/app/views/refinery/admin/dialogs/show.html.erb +1 -19
  140. data/config/initializers/assets.rb +6 -0
  141. data/config/locales/ca.yml +84 -0
  142. data/config/locales/cs.yml +12 -5
  143. data/config/locales/en.yml +6 -2
  144. data/config/locales/fr.yml +15 -11
  145. data/config/locales/hu.yml +3 -1
  146. data/config/locales/it.yml +5 -1
  147. data/config/locales/ja.yml +2 -2
  148. data/config/locales/pt.yml +5 -3
  149. data/config/locales/ru.yml +7 -0
  150. data/config/locales/sl.yml +0 -3
  151. data/config/locales/tr.yml +43 -41
  152. data/config/routes.rb +1 -4
  153. data/lib/generators/refinery/cms/cms_generator.rb +68 -26
  154. data/lib/generators/refinery/cms/templates/app/decorators/{models/refinery/.gitkeep → controllers/refinery/.keep} +0 -0
  155. data/lib/generators/refinery/{form/templates/.gitkeep → cms/templates/app/decorators/models/refinery/.keep} +0 -0
  156. data/lib/generators/refinery/cms/templates/config/database.yml.mysql +3 -3
  157. data/lib/generators/refinery/cms/templates/config/database.yml.postgresql +3 -3
  158. data/lib/generators/refinery/core/templates/config/initializers/refinery/core.rb.erb +18 -5
  159. data/lib/generators/refinery/dummy/dummy_generator.rb +3 -1
  160. data/lib/generators/refinery/dummy/templates/rails/application.js +3 -0
  161. data/lib/generators/refinery/dummy/templates/rails/application.rb.erb +0 -2
  162. data/lib/generators/refinery/dummy/templates/rails/blank.png +0 -0
  163. data/lib/generators/refinery/dummy/templates/rails/routes.rb +1 -1
  164. data/lib/generators/refinery/engine/engine_generator.rb +3 -2
  165. data/lib/generators/refinery/engine/templates/Gemfile +9 -4
  166. data/lib/generators/refinery/engine/templates/Rakefile +3 -4
  167. data/lib/generators/refinery/engine/templates/app/controllers/refinery/namespace/admin/plural_name_controller.rb.erb +11 -2
  168. data/lib/generators/refinery/engine/templates/app/controllers/refinery/namespace/plural_name_controller.rb.erb +2 -2
  169. data/lib/generators/refinery/engine/templates/app/models/refinery/namespace/singular_name.rb.erb +5 -5
  170. data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_actions.html.erb +7 -12
  171. data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_form.html.erb +8 -8
  172. data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_records.html.erb +3 -3
  173. data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_singular_name.html.erb +6 -11
  174. data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/index.html.erb +1 -1
  175. data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/plural_name/show.html.erb +4 -4
  176. data/lib/generators/refinery/engine/templates/db/migrate/1_create_namespace_plural_name.rb.erb +2 -9
  177. data/lib/generators/refinery/engine/templates/db/seeds.rb.erb +13 -19
  178. data/lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb.erb +0 -4
  179. data/lib/generators/refinery/engine/templates/readme.md +3 -3
  180. data/lib/generators/refinery/engine/templates/refinerycms-extension_plural_name.gemspec +1 -0
  181. data/lib/generators/refinery/engine/templates/spec/features/refinery/namespace/admin/plural_name_spec.rb.erb +25 -28
  182. data/lib/generators/refinery/engine/templates/spec/models/refinery/namespace/singular_name_spec.rb.erb +1 -1
  183. data/lib/generators/refinery/engine/templates/spec/spec_helper.rb +1 -1
  184. data/lib/refinery.rb +7 -9
  185. data/lib/refinery/admin/base_controller.rb +42 -32
  186. data/lib/refinery/application_controller.rb +25 -17
  187. data/lib/refinery/cli.rb +54 -19
  188. data/lib/refinery/core.rb +5 -0
  189. data/lib/refinery/core/authorisation_adapter.rb +11 -0
  190. data/lib/refinery/core/authorisation_manager.rb +14 -0
  191. data/lib/refinery/core/configuration.rb +25 -4
  192. data/lib/refinery/core/default_route.rb +16 -0
  193. data/lib/refinery/core/engine.rb +44 -25
  194. data/lib/refinery/core/nil_user.rb +42 -0
  195. data/lib/refinery/crud.rb +40 -29
  196. data/lib/refinery/extension_generation.rb +11 -22
  197. data/lib/refinery/generators/generated_attribute.rb +54 -0
  198. data/lib/refinery/generators/named_base.rb +16 -0
  199. data/lib/refinery/menu.rb +3 -2
  200. data/lib/refinery/menu_item.rb +1 -1
  201. data/lib/refinery/plugin.rb +27 -43
  202. data/lib/refinery/plugins.rb +22 -26
  203. data/lib/refinery/users_manager.rb +8 -0
  204. data/lib/refinery/version.rb +7 -3
  205. data/lib/tasks/refinery.rake +7 -0
  206. data/license.md +1 -1
  207. data/refinerycms-core.gemspec +11 -8
  208. data/spec/controllers/refinery/admin/dummy_controller_spec.rb +23 -11
  209. data/spec/controllers/refinery/sitemap_controller_spec.rb +2 -2
  210. data/spec/features/refinery/admin/custom_assets_spec.rb +12 -10
  211. data/spec/features/refinery/admin/dialogs_spec.rb +5 -5
  212. data/spec/features/refinery/admin/xhr_paging_spec.rb +24 -38
  213. data/spec/features/refinery/application_layout_spec.rb +3 -3
  214. data/spec/features/refinery/core_spec.rb +1 -1
  215. data/spec/features/refinery/site_bar_spec.rb +44 -23
  216. data/spec/helpers/refinery/admin_helper_spec.rb +15 -0
  217. data/spec/helpers/refinery/custom_assets_helper_spec.rb +15 -23
  218. data/spec/helpers/refinery/html_truncation_helper_spec.rb +10 -5
  219. data/spec/helpers/refinery/meta_helper_spec.rb +3 -3
  220. data/spec/helpers/refinery/pagination_helper_spec.rb +7 -7
  221. data/spec/helpers/refinery/tag_helper_spec.rb +4 -4
  222. data/spec/helpers/refinery/translation_helper_spec.rb +3 -3
  223. data/spec/lib/generators/refinery/cms/cms_generator_spec.rb +30 -25
  224. data/spec/lib/generators/refinery/core/core_generator_spec.rb +1 -1
  225. data/spec/lib/generators/refinery/engine/engine_generator_multiple_resources_spec.rb +7 -8
  226. data/spec/lib/generators/refinery/engine/engine_generator_sanity_check_spec.rb +15 -15
  227. data/spec/lib/generators/refinery/engine/engine_generator_spec.rb +9 -9
  228. data/spec/lib/generators/refinery/engine/engine_generator_with_i18n_spec.rb +1 -1
  229. data/spec/lib/generators/refinery/engine/engine_generator_without_frontend_spec.rb +1 -1
  230. data/spec/lib/refinery/application_controller_spec.rb +16 -16
  231. data/spec/lib/refinery/authorisation_manager_spec.rb +10 -0
  232. data/spec/lib/refinery/cli_spec.rb +83 -21
  233. data/spec/lib/refinery/core/configuration_spec.rb +5 -5
  234. data/spec/lib/refinery/core/nil_user_spec.rb +39 -0
  235. data/spec/lib/refinery/core_spec.rb +39 -30
  236. data/spec/lib/refinery/crud_spec.rb +70 -59
  237. data/spec/lib/refinery/menu_spec.rb +4 -4
  238. data/spec/lib/refinery/plugin_spec.rb +56 -45
  239. data/spec/lib/refinery/plugins_spec.rb +39 -87
  240. data/spec/lib/refinery/users_manager_spec.rb +9 -0
  241. data/spec/support/refinery.rb +3 -8
  242. data/vendor/assets/fonts/font-awesome/FontAwesome.otf +0 -0
  243. data/vendor/assets/fonts/font-awesome/fontawesome-webfont.eot +0 -0
  244. data/vendor/assets/fonts/font-awesome/fontawesome-webfont.svg +565 -0
  245. data/vendor/assets/fonts/font-awesome/fontawesome-webfont.ttf +0 -0
  246. data/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff +0 -0
  247. data/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff2 +0 -0
  248. data/vendor/assets/stylesheets/_font-awesome-compass.scss +5 -0
  249. data/vendor/assets/stylesheets/_font-awesome-sprockets.scss +5 -0
  250. data/vendor/assets/stylesheets/_font-awesome.scss +17 -0
  251. data/vendor/assets/stylesheets/font-awesome/_animated.scss +34 -0
  252. data/vendor/assets/stylesheets/font-awesome/_bordered-pulled.scss +16 -0
  253. data/vendor/assets/stylesheets/font-awesome/_core.scss +12 -0
  254. data/vendor/assets/stylesheets/font-awesome/_extras.scss +44 -0
  255. data/vendor/assets/stylesheets/font-awesome/_fixed-width.scss +6 -0
  256. data/vendor/assets/stylesheets/font-awesome/_icons.scss +596 -0
  257. data/vendor/assets/stylesheets/font-awesome/_larger.scss +13 -0
  258. data/vendor/assets/stylesheets/font-awesome/_list.scss +19 -0
  259. data/vendor/assets/stylesheets/font-awesome/_mixins.scss +26 -0
  260. data/vendor/assets/stylesheets/font-awesome/_path.scss +14 -0
  261. data/vendor/assets/stylesheets/font-awesome/_rotated-flipped.scss +20 -0
  262. data/vendor/assets/stylesheets/font-awesome/_stacked.scss +20 -0
  263. data/vendor/assets/stylesheets/font-awesome/_variables.scss +606 -0
  264. metadata +144 -441
  265. data/app/assets/images/refinery/carousel-left.png +0 -0
  266. data/app/assets/images/refinery/carousel-right.png +0 -0
  267. data/app/assets/images/wymeditor/skins/refinery/arrow_redo.png +0 -0
  268. data/app/assets/images/wymeditor/skins/refinery/arrow_undo.png +0 -0
  269. data/app/assets/images/wymeditor/skins/refinery/eye.png +0 -0
  270. data/app/assets/images/wymeditor/skins/refinery/html5/article.png +0 -0
  271. data/app/assets/images/wymeditor/skins/refinery/html5/aside.png +0 -0
  272. data/app/assets/images/wymeditor/skins/refinery/html5/blockquote.png +0 -0
  273. data/app/assets/images/wymeditor/skins/refinery/html5/command.png +0 -0
  274. data/app/assets/images/wymeditor/skins/refinery/html5/details.png +0 -0
  275. data/app/assets/images/wymeditor/skins/refinery/html5/figcaption.png +0 -0
  276. data/app/assets/images/wymeditor/skins/refinery/html5/figure.png +0 -0
  277. data/app/assets/images/wymeditor/skins/refinery/html5/footer.png +0 -0
  278. data/app/assets/images/wymeditor/skins/refinery/html5/h1.png +0 -0
  279. data/app/assets/images/wymeditor/skins/refinery/html5/h2.png +0 -0
  280. data/app/assets/images/wymeditor/skins/refinery/html5/h3.png +0 -0
  281. data/app/assets/images/wymeditor/skins/refinery/html5/h4.png +0 -0
  282. data/app/assets/images/wymeditor/skins/refinery/html5/h5.png +0 -0
  283. data/app/assets/images/wymeditor/skins/refinery/html5/h6.png +0 -0
  284. data/app/assets/images/wymeditor/skins/refinery/html5/header.png +0 -0
  285. data/app/assets/images/wymeditor/skins/refinery/html5/hgroup.png +0 -0
  286. data/app/assets/images/wymeditor/skins/refinery/html5/mark.png +0 -0
  287. data/app/assets/images/wymeditor/skins/refinery/html5/meter.png +0 -0
  288. data/app/assets/images/wymeditor/skins/refinery/html5/nav.png +0 -0
  289. data/app/assets/images/wymeditor/skins/refinery/html5/p.png +0 -0
  290. data/app/assets/images/wymeditor/skins/refinery/html5/pre.png +0 -0
  291. data/app/assets/images/wymeditor/skins/refinery/html5/progress.png +0 -0
  292. data/app/assets/images/wymeditor/skins/refinery/html5/readme.md +0 -1
  293. data/app/assets/images/wymeditor/skins/refinery/html5/rp.png +0 -0
  294. data/app/assets/images/wymeditor/skins/refinery/html5/rt.png +0 -0
  295. data/app/assets/images/wymeditor/skins/refinery/html5/ruby.png +0 -0
  296. data/app/assets/images/wymeditor/skins/refinery/html5/section.png +0 -0
  297. data/app/assets/images/wymeditor/skins/refinery/html5/summary.png +0 -0
  298. data/app/assets/images/wymeditor/skins/refinery/html5/time.png +0 -0
  299. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-blockquote.png +0 -0
  300. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h1.png +0 -0
  301. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h2.png +0 -0
  302. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h3.png +0 -0
  303. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h4.png +0 -0
  304. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h5.png +0 -0
  305. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h6.png +0 -0
  306. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-p.png +0 -0
  307. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-pre.png +0 -0
  308. data/app/assets/images/wymeditor/skins/refinery/link_add.png +0 -0
  309. data/app/assets/images/wymeditor/skins/refinery/link_break.png +0 -0
  310. data/app/assets/images/wymeditor/skins/refinery/page_code.png +0 -0
  311. data/app/assets/images/wymeditor/skins/refinery/page_paste.png +0 -0
  312. data/app/assets/images/wymeditor/skins/refinery/photo_add.png +0 -0
  313. data/app/assets/images/wymeditor/skins/refinery/right.png +0 -0
  314. data/app/assets/images/wymeditor/skins/refinery/style.png +0 -0
  315. data/app/assets/images/wymeditor/skins/refinery/table_add.png +0 -0
  316. data/app/assets/images/wymeditor/skins/refinery/text_align_center.png +0 -0
  317. data/app/assets/images/wymeditor/skins/refinery/text_align_justify.png +0 -0
  318. data/app/assets/images/wymeditor/skins/refinery/text_align_left.png +0 -0
  319. data/app/assets/images/wymeditor/skins/refinery/text_align_right.png +0 -0
  320. data/app/assets/images/wymeditor/skins/refinery/text_bold.png +0 -0
  321. data/app/assets/images/wymeditor/skins/refinery/text_heading_1.png +0 -0
  322. data/app/assets/images/wymeditor/skins/refinery/text_heading_2.png +0 -0
  323. data/app/assets/images/wymeditor/skins/refinery/text_heading_3.png +0 -0
  324. data/app/assets/images/wymeditor/skins/refinery/text_heading_4.png +0 -0
  325. data/app/assets/images/wymeditor/skins/refinery/text_heading_5.png +0 -0
  326. data/app/assets/images/wymeditor/skins/refinery/text_heading_6.png +0 -0
  327. data/app/assets/images/wymeditor/skins/refinery/text_indent.png +0 -0
  328. data/app/assets/images/wymeditor/skins/refinery/text_indent_remove.png +0 -0
  329. data/app/assets/images/wymeditor/skins/refinery/text_italic.png +0 -0
  330. data/app/assets/images/wymeditor/skins/refinery/text_list_bullets.png +0 -0
  331. data/app/assets/images/wymeditor/skins/refinery/text_list_numbers.png +0 -0
  332. data/app/assets/images/wymeditor/skins/refinery/text_paragraph.png +0 -0
  333. data/app/assets/images/wymeditor/skins/refinery/text_strikethrough.png +0 -0
  334. data/app/assets/images/wymeditor/skins/refinery/text_subscript.png +0 -0
  335. data/app/assets/images/wymeditor/skins/refinery/text_superscript.png +0 -0
  336. data/app/assets/images/wymeditor/skins/refinery/text_underline.png +0 -0
  337. data/app/assets/images/wymeditor/skins/wymeditor_icon.png +0 -0
  338. data/app/assets/javascripts/refinery/boot_wym.js.erb +0 -285
  339. data/app/assets/javascripts/refinery/sortable_menu.js.coffee.erb +0 -20
  340. data/app/assets/javascripts/refinery/wymeditor.js +0 -37
  341. data/app/assets/javascripts/wymeditor/GPL-license.txt +0 -278
  342. data/app/assets/javascripts/wymeditor/MIT-license.txt +0 -20
  343. data/app/assets/javascripts/wymeditor/README +0 -35
  344. data/app/assets/javascripts/wymeditor/browsers/ie.js.erb +0 -224
  345. data/app/assets/javascripts/wymeditor/browsers/mozilla.js.erb +0 -292
  346. data/app/assets/javascripts/wymeditor/browsers/opera.js.erb +0 -123
  347. data/app/assets/javascripts/wymeditor/browsers/webkit.js.erb +0 -283
  348. data/app/assets/javascripts/wymeditor/classes.js.erb +0 -1575
  349. data/app/assets/javascripts/wymeditor/functions.js.erb +0 -222
  350. data/app/assets/javascripts/wymeditor/lang/bg.js +0 -57
  351. data/app/assets/javascripts/wymeditor/lang/ca.js +0 -45
  352. data/app/assets/javascripts/wymeditor/lang/cs.js +0 -58
  353. data/app/assets/javascripts/wymeditor/lang/da.js +0 -48
  354. data/app/assets/javascripts/wymeditor/lang/de.js +0 -45
  355. data/app/assets/javascripts/wymeditor/lang/en.js +0 -57
  356. data/app/assets/javascripts/wymeditor/lang/es.js +0 -58
  357. data/app/assets/javascripts/wymeditor/lang/fa.js +0 -46
  358. data/app/assets/javascripts/wymeditor/lang/fi.js +0 -57
  359. data/app/assets/javascripts/wymeditor/lang/fr.js +0 -58
  360. data/app/assets/javascripts/wymeditor/lang/he.js +0 -45
  361. data/app/assets/javascripts/wymeditor/lang/hu.js +0 -45
  362. data/app/assets/javascripts/wymeditor/lang/it.js +0 -48
  363. data/app/assets/javascripts/wymeditor/lang/ja.js +0 -47
  364. data/app/assets/javascripts/wymeditor/lang/lv.js +0 -47
  365. data/app/assets/javascripts/wymeditor/lang/nb.js +0 -48
  366. data/app/assets/javascripts/wymeditor/lang/nl.js +0 -57
  367. data/app/assets/javascripts/wymeditor/lang/nn.js +0 -45
  368. data/app/assets/javascripts/wymeditor/lang/pl.js +0 -56
  369. data/app/assets/javascripts/wymeditor/lang/pt-BR.js +0 -58
  370. data/app/assets/javascripts/wymeditor/lang/pt.js +0 -45
  371. data/app/assets/javascripts/wymeditor/lang/rs.js +0 -47
  372. data/app/assets/javascripts/wymeditor/lang/ru.js +0 -57
  373. data/app/assets/javascripts/wymeditor/lang/sk.js +0 -56
  374. data/app/assets/javascripts/wymeditor/lang/sl.js +0 -47
  375. data/app/assets/javascripts/wymeditor/lang/sv.js +0 -45
  376. data/app/assets/javascripts/wymeditor/lang/tr.js +0 -45
  377. data/app/assets/javascripts/wymeditor/lang/vi.js +0 -47
  378. data/app/assets/javascripts/wymeditor/lang/zh-CN.js +0 -47
  379. data/app/assets/javascripts/wymeditor/prototypes.js.erb +0 -1103
  380. data/app/assets/javascripts/wymeditor/setup.js.erb +0 -622
  381. data/app/assets/javascripts/wymeditor/skins/refinery/skin.js +0 -45
  382. data/app/assets/javascripts/wymeditor/validators.js.erb +0 -777
  383. data/app/assets/stylesheets/refinery/refinery.css +0 -15
  384. data/app/assets/stylesheets/refinery/site_bar.css.scss +0 -92
  385. data/app/assets/stylesheets/refinery/ui.css.scss +0 -103
  386. data/app/assets/stylesheets/wymeditor/skins/refinery/skin.css.scss +0 -530
  387. data/app/assets/stylesheets/wymeditor/skins/refinery/wymiframe.css.scss +0 -156
  388. data/app/helpers/refinery/admin/core_helper.rb +0 -6
  389. data/app/helpers/refinery/admin/dialogs_helper.rb +0 -6
  390. data/app/helpers/refinery/fast_helper.rb +0 -4
  391. data/app/helpers/refinery/sitemap_helper.rb +0 -4
  392. data/app/views/refinery/wymiframe.html.erb +0 -14
  393. data/lib/generators/refinery/form/USAGE +0 -20
  394. data/lib/generators/refinery/form/form_generator.rb +0 -25
  395. data/lib/generators/refinery/form/templates/.gitignore +0 -2
  396. data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/admin/plural_name_controller.rb.erb +0 -54
  397. data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/admin/settings_controller.rb.erb +0 -45
  398. data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/plural_name_controller.rb.erb +0 -53
  399. data/lib/generators/refinery/form/templates/app/mailers/refinery/namespace/mailer.rb.erb +0 -22
  400. data/lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb.erb +0 -34
  401. data/lib/generators/refinery/form/templates/app/models/refinery/namespace/singular_name.rb.erb +0 -49
  402. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/_records.html.erb +0 -23
  403. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/_singular_name.html.erb +0 -25
  404. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/_submenu.html.erb +0 -29
  405. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/index.html.erb +0 -4
  406. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/show.html.erb +0 -52
  407. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/spam.html.erb +0 -27
  408. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/_confirmation_email_form.html.erb +0 -51
  409. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/_notification_recipients_form.html.erb +0 -21
  410. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/edit.html.erb +0 -5
  411. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/mailer/confirmation.html.erb +0 -1
  412. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/mailer/notification.html.erb +0 -17
  413. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb +0 -43
  414. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/thank_you.html.erb +0 -1
  415. data/lib/generators/refinery/form/templates/config/locales/cs.yml +0 -78
  416. data/lib/generators/refinery/form/templates/config/locales/da.yml +0 -66
  417. data/lib/generators/refinery/form/templates/config/locales/de.yml +0 -78
  418. data/lib/generators/refinery/form/templates/config/locales/en.yml +0 -78
  419. data/lib/generators/refinery/form/templates/config/locales/es.yml +0 -66
  420. data/lib/generators/refinery/form/templates/config/locales/fr.yml +0 -78
  421. data/lib/generators/refinery/form/templates/config/locales/it.yml +0 -66
  422. data/lib/generators/refinery/form/templates/config/locales/lv.yml +0 -77
  423. data/lib/generators/refinery/form/templates/config/locales/nb.yml +0 -75
  424. data/lib/generators/refinery/form/templates/config/locales/nl.yml +0 -78
  425. data/lib/generators/refinery/form/templates/config/locales/pt-BR.yml +0 -78
  426. data/lib/generators/refinery/form/templates/config/locales/ru.yml +0 -77
  427. data/lib/generators/refinery/form/templates/config/locales/sk.yml +0 -78
  428. data/lib/generators/refinery/form/templates/config/locales/sl.yml +0 -67
  429. data/lib/generators/refinery/form/templates/config/locales/tr.yml +0 -78
  430. data/lib/generators/refinery/form/templates/config/locales/zh-CN.yml +0 -78
  431. data/lib/generators/refinery/form/templates/config/routes.rb.erb +0 -26
  432. data/lib/generators/refinery/form/templates/db/migrate/1_create_plural_name.rb.erb +0 -39
  433. data/lib/generators/refinery/form/templates/db/seeds.rb.erb +0 -31
  434. data/lib/generators/refinery/form/templates/lib/generators/refinery/plural_name_generator.rb.erb +0 -20
  435. data/lib/generators/refinery/form/templates/lib/refinery/plural_name.rb.erb +0 -18
  436. data/lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb.erb +0 -27
  437. data/lib/generators/refinery/form/templates/lib/refinerycms-plural_name.rb.erb +0 -1
  438. data/lib/generators/refinery/form/templates/refinerycms-plural_name.gemspec +0 -16
  439. data/lib/generators/refinery/form/templates/script/rails +0 -10
  440. data/lib/refinery/activity.rb +0 -113
  441. data/lib/refinery/ext/action_view/helpers/form_builder.rb +0 -9
  442. data/lib/refinery/ext/action_view/helpers/form_helper.rb +0 -20
  443. data/lib/refinery/ext/action_view/helpers/form_tag_helper.rb +0 -10
  444. data/spec/controllers/refinery/admin/refinery_core_controller_spec.rb +0 -19
  445. data/spec/controllers/refinery/fast_controller_spec.rb +0 -12
  446. data/spec/lib/generators/refinery/form/form_generator_spec.rb +0 -99
  447. data/spec/lib/refinery/activity_spec.rb +0 -46
  448. data/spec/support/background_selenium_firefox_driver.rb +0 -14
  449. data/vendor/assets/javascripts/jquery/jquery.jcarousel.js +0 -900
@@ -1,56 +0,0 @@
1
- WYMeditor.STRINGS['sk'] = {
2
- Strong: 'Tučné',
3
- Emphasis: 'Kurzíva',
4
- Superscript: 'Horný index',
5
- Subscript: 'Dolný index',
6
- Ordered_List: 'Číslovaný zoznam',
7
- Unordered_List: 'Nečíslovaný zoznam',
8
- Indent: 'Zväčšiť odsadenie',
9
- Outdent: 'Zmeňšiť odsadenie',
10
- Undo: 'Späť',
11
- Redo: 'Znovu',
12
- Link: 'Vytvoriť odkaz',
13
- Unlink: 'Zrušiť odkaz',
14
- Image: 'Obrázok',
15
- Table: 'Tabuľka',
16
- HTML: 'HTML',
17
- Paragraph: 'Odstavec',
18
- Heading_1: 'Nadpis 1. úrovne',
19
- Heading_2: 'Nadpis 2. úrovne',
20
- Heading_3: 'Nadpis 3. úrovne',
21
- Heading_4: 'Nadpis 4. úrovne',
22
- Heading_5: 'Nadpis 5. úrovne',
23
- Heading_6: 'Nadpis 6. úrovne',
24
- Preformatted: 'Predformátovaný text',
25
- Blockquote: 'Citácia',
26
- Table_Header: 'Hlavičková bunka tabulky',
27
- URL: 'Adresa',
28
- Title: 'Text po nabehnutí myšou',
29
- Alternative_Text: 'Text pre prípad nezobrazenia obrázku',
30
- Caption: 'Titulok tabuľky',
31
- Summary: 'Zhrnutie obsahu',
32
- Number_Of_Rows: 'Počet riadkov',
33
- Number_Of_Cols: 'Počet stĺpcov',
34
- Submit: 'Vytvoriť',
35
- Cancel: 'Zrušiť',
36
- Choose: 'Vybrať',
37
- Preview: 'Náhľad',
38
- Paste_From_Word: 'Vložiť z Wordu',
39
- Tools: 'Nástroje',
40
- Containers: 'Typy obsahu',
41
- Classes: 'Triedy',
42
- Status: 'Stav',
43
- Source_Code: 'Zdrojový kód',
44
- Text_Align: 'Zarovnanie textu',
45
- Image_Align: 'Zarovnanie obrázku',
46
- Font_Size: 'Veľkosť písma',
47
- Left: 'Vľavo',
48
- Right: 'Vpravo',
49
- Center: 'Na stred',
50
- Justify: 'Do bloku',
51
- Small: 'Malé',
52
- Normal: 'Normálna',
53
- Large: 'Veľké',
54
- Apply_Style: 'Štýl'
55
- };
56
-
@@ -1,47 +0,0 @@
1
- WYMeditor.STRINGS['sl'] = {
2
- Strong: 'Močno',
3
- Bold: 'Krepko',
4
- Emphasis: 'Ležeče',
5
- Superscript: 'Nadpisano besedilo',
6
- Subscript: 'Podpisano besedilo',
7
- Ordered_List: 'Oštevilčen Seznam',
8
- Unordered_List: 'Označen Seznam',
9
- Indent: 'Povečaj zamik',
10
- Outdent: 'Zmanjšaj zamik',
11
- Undo: 'Razveljavi',
12
- Redo: 'Redo',
13
- Link: 'Dodaj Povezavo',
14
- Unlink: 'Odstrani Povezavo',
15
- Image: 'Vstavi Sliko',
16
- Table: 'Vstavi Tabelo',
17
- HTML: 'HTML',
18
- Paragraph: 'Odstavek',
19
- Heading_1: 'Naslov 1',
20
- Heading_2: 'Naslov 2',
21
- Heading_3: 'Naslov 3',
22
- Heading_4: 'Naslov 4',
23
- Heading_5: 'Naslov 5',
24
- Heading_6: 'Naslov 6',
25
- Preformatted: 'Vnaprej Oblikovano',
26
- Blockquote: 'Navedek',
27
- Table_Header: 'Glava Tabele',
28
- URL: 'URL',
29
- Title: 'Naslov',
30
- Alternative_Text: 'Alternativno besedilo',
31
- Caption: 'Napis',
32
- Summary: 'Povzetek',
33
- Number_Of_Rows: 'Število vrstic',
34
- Number_Of_Cols: 'Število stolpcev',
35
- Insert: 'Vstavi',
36
- Submit: 'Predloži',
37
- Cancel: 'Prekliči',
38
- Choose: 'Izberi',
39
- Preview: 'Predogled',
40
- Paste_From_Word: 'Prilepite vaše besedilo spodaj',
41
- Tools: 'Orodja',
42
- Containers: 'Zabojniki',
43
- Classes: 'Razredi',
44
- Status: 'Status',
45
- Source_Code: 'Izvorna koda',
46
- Apply_Style: 'Uporabi slog'
47
- };
@@ -1,45 +0,0 @@
1
- WYMeditor.STRINGS['sv'] = {
2
- Strong: 'Viktigt',
3
- Emphasis: 'Betoning',
4
- Superscript: 'Upphöjt',
5
- Subscript: 'Nedsänkt',
6
- Ordered_List: 'Nummerlista',
7
- Unordered_List: 'Punktlista',
8
- Indent: 'Indrag',
9
- Outdent: 'Utdrag',
10
- Undo: 'Ångra',
11
- Redo: 'Gör om',
12
- Link: 'Länk',
13
- Unlink: 'Ta bort länk',
14
- Image: 'Bild',
15
- Table: 'Tabell',
16
- HTML: 'HTML',
17
- Paragraph: 'Paragraf',
18
- Heading_1: 'Rubrik 1',
19
- Heading_2: 'Rubrik 2',
20
- Heading_3: 'Rubrik 3',
21
- Heading_4: 'Rubrik 4',
22
- Heading_5: 'Rubrik 5',
23
- Heading_6: 'Rubrik 6',
24
- Preformatted: 'Förformaterad',
25
- Blockquote: 'Blockcitat',
26
- Table_Header: 'Tabellrubrik',
27
- URL: 'URL',
28
- Title: 'Titel',
29
- Alternative_Text: 'Alternativ text',
30
- Caption: 'Överskrift',
31
- Summary: 'Summary',
32
- Number_Of_Rows: 'Antal rader',
33
- Number_Of_Cols: 'Antal kolumner',
34
- Submit: 'Skicka',
35
- Cancel: 'Avbryt',
36
- Choose: 'Välj',
37
- Preview: 'Förhandsgranska',
38
- Paste_From_Word: 'Klistra in från Word',
39
- Tools: 'Verktyg',
40
- Containers: 'Formatering',
41
- Classes: 'Klasser',
42
- Status: 'Status',
43
- Source_Code: 'Källkod'
44
- };
45
-
@@ -1,45 +0,0 @@
1
- WYMeditor.STRINGS['tr'] = {
2
- Strong: 'Kalın',
3
- Emphasis: 'Vurgu',
4
- Superscript: 'Superscript',
5
- Subscript: 'Subscript',
6
- Ordered_List: 'Sıralı List',
7
- Unordered_List: 'Sırasız List',
8
- Indent: 'İçerlek',
9
- Outdent: 'Çıkıntılı',
10
- Undo: 'Geri Al',
11
- Redo: 'Yinele',
12
- Link: 'Bağlantı',
13
- Unlink: 'Bağlantıyı Kaldır',
14
- Image: 'İmaj',
15
- Table: 'Tablo',
16
- HTML: 'HTML',
17
- Paragraph: 'Parağraf',
18
- Heading_1: 'Başlık 1',
19
- Heading_2: 'Başlık 2',
20
- Heading_3: 'Başlık 3',
21
- Heading_4: 'Başlık 4',
22
- Heading_5: 'Başlık 5',
23
- Heading_6: 'Başlık 6',
24
- Preformatted: 'Önceden Formatlı',
25
- Blockquote: 'Alıntı',
26
- Table_Header: 'Tablo Başlığı',
27
- URL: 'URL',
28
- Title: 'Başlık',
29
- Alternative_Text: 'Alternatif Metin',
30
- Caption: 'Etiket',
31
- Summary: 'Summary',
32
- Number_Of_Rows: 'Satır sayısı',
33
- Number_Of_Cols: 'Sütun sayısı',
34
- Submit: 'Gönder',
35
- Cancel: 'İptal',
36
- Choose: 'Seç',
37
- Preview: 'Önizleme',
38
- Paste_From_Word: 'Wordden yapıştır',
39
- Tools: 'Araçlar',
40
- Containers: 'Kapsayıcılar',
41
- Classes: 'Sınıflar',
42
- Status: 'Durum',
43
- Source_Code: 'Kaynak Kodu'
44
- };
45
-
@@ -1,47 +0,0 @@
1
- WYMeditor.STRINGS['vi'] = {
2
- Strong: 'Đậm',
3
- Bold: 'Đậm',
4
- Emphasis: 'Nghiêng',
5
- Superscript: 'Viết lên trên',
6
- Subscript: 'Viết xuống dưới',
7
- Ordered_List: 'Danh sách có đánh số',
8
- Unordered_List: 'Danh sách không đánh số',
9
- Indent: 'Thụt vào',
10
- Outdent: 'Bớt thụt vào',
11
- Undo: 'Undo',
12
- Redo: 'Redo',
13
- Link: 'Tạo liên kết',
14
- Unlink: 'Xóa liên kết',
15
- Image: 'Chèn ảnh',
16
- Table: 'Chèn bảng',
17
- HTML: 'HTML',
18
- Paragraph: 'Đoạn',
19
- Heading_1: 'Tiêu đề 1',
20
- Heading_2: 'Tiêu đề 2',
21
- Heading_3: 'Tiêu đề 3',
22
- Heading_4: 'Tiêu đề 4',
23
- Heading_5: 'Tiêu đề 5',
24
- Heading_6: 'Tiêu đề 6',
25
- Preformatted: 'Định dạng sẵn',
26
- Blockquote: 'Khối trích dẫn',
27
- Table_Header: 'Tiêu đề bảng',
28
- URL: 'Địa chỉ',
29
- Title: 'Tiêu đề',
30
- Alternative_Text: 'Chữ thay thế',
31
- Caption: 'Tiêu đề',
32
- Summary: 'Tóm tắt',
33
- Number_Of_Rows: 'Số dòng',
34
- Number_Of_Cols: 'Số cột',
35
- Insert: 'Chèn',
36
- Submit: 'Gửi',
37
- Cancel: 'Hủy',
38
- Choose: 'Chọn',
39
- Preview: 'Xem trước',
40
- Paste_From_Word: 'Dán đoạn văn bản vào bên dưới',
41
- Tools: 'Công cụ',
42
- Containers: 'Containers',
43
- Classes: 'Các class',
44
- Status: 'Trạng thái',
45
- Source_Code: 'Mã nguồn',
46
- Apply_Style: 'Kiểu'
47
- };
@@ -1,47 +0,0 @@
1
- WYMeditor.STRINGS['zh-CN'] = {
2
- Strong: '加粗',
3
- Emphasis: '斜体',
4
- Superscript: '上标',
5
- Subscript: '下标',
6
- Ordered_List: '有序列表',
7
- Unordered_List: '无序列表',
8
- Indent: '增加缩进',
9
- Outdent: '减少缩进',
10
- Undo: '撤消',
11
- Redo: '重做',
12
- Link: '链接',
13
- Unlink: '取消链接',
14
- Image: '图片',
15
- Table: '表格',
16
- HTML: 'HTML源代码',
17
- Paragraph: '段落',
18
- Heading_1: '标题 1',
19
- Heading_2: '标题 2',
20
- Heading_3: '标题 3',
21
- Heading_4: '标题 4',
22
- Heading_5: '标题 5',
23
- Heading_6: '标题 6',
24
- Preformatted: '原始文本',
25
- Blockquote: '引语',
26
- Table_Header: '表头',
27
- URL: '地址',
28
- Title: '提示文字',
29
- Alternative_Text: '失效文字',
30
- Caption: '标题',
31
- Summary: 'Summary',
32
- Number_Of_Rows: '行数',
33
- Number_Of_Cols: '列数',
34
- Submit: '提交',
35
- Cancel: '放弃',
36
- Choose: '选择',
37
- Preview: '预览',
38
- Paste_From_Word: '从Word粘贴纯文本',
39
- Tools: '工具',
40
- Containers: '容器',
41
- Classes: '预定义样式',
42
- Status: '状态',
43
- Source_Code: '源代码',
44
- Attachment: '附件',
45
- NewParagraph: '新段落'
46
- };
47
-
@@ -1,1103 +0,0 @@
1
- /********** WYMeditor **********/
2
-
3
- /* @name Wymeditor
4
- * @description WYMeditor class
5
- */
6
-
7
- /* @name init
8
- * @description Initializes a WYMeditor instance
9
- */
10
- WYMeditor.editor.prototype.init = function() {
11
-
12
- //load subclass - browser specific
13
- //unsupported browsers: do nothing
14
-
15
- if ($.browser.msie) {
16
- var WymClass = new WYMeditor.WymClassExplorer(this);
17
- }
18
- else if ($.browser.mozilla) {
19
- var WymClass = new WYMeditor.WymClassMozilla(this);
20
- }
21
- else if ($.browser.opera) {
22
- var WymClass = new WYMeditor.WymClassOpera(this);
23
- }
24
- else if ($.browser.webkit) {
25
- var WymClass = new WYMeditor.WymClassSafari(this);
26
- }
27
-
28
- if(WymClass) {
29
-
30
- if($.isFunction(this._options.preInit)) { this._options.preInit(this); }
31
-
32
- var SaxListener = new WYMeditor.XhtmlSaxListener();
33
- $.extend(SaxListener, WymClass);
34
- this.parser = new WYMeditor.XhtmlParser(SaxListener);
35
-
36
- if(this._options.styles || this._options.stylesheet){
37
- this.configureEditorUsingRawCss();
38
- }
39
-
40
- this.helper = new WYMeditor.XmlHelper();
41
-
42
- //extend the Wymeditor object
43
- //don't use $.extend since 1.1.4
44
- //$.extend(this, WymClass);
45
- for (var prop in WymClass) { this[prop] = WymClass[prop]; }
46
-
47
- //load wymbox
48
- this._box = $(this._element).hide().after(this._options.boxHtml).next().addClass('wym_box_' + this._index);
49
-
50
- //store the instance index in wymbox and element replaced by editor instance
51
- //but keep it compatible with jQuery < 1.2.3, see #122
52
- if( $.isFunction( $.fn.data ) ) {
53
- $.data(this._box.get(0), WYMeditor.WYM_INDEX, this._index);
54
- $.data(this._element.get(0), WYMeditor.WYM_INDEX, this._index);
55
- }
56
-
57
- var h = WYMeditor.Helper;
58
-
59
- //construct the iframe
60
- var iframeHtml = this._options.iframeHtml;
61
-
62
- iframeHtml = h.replaceAll(iframeHtml, WYMeditor.INDEX, this._index);
63
- iframeHtml = h.replaceAll(iframeHtml, WYMeditor.IFRAME_BASE_PATH, this._options.iframeBasePath);
64
-
65
- //construct wymbox
66
- var boxHtml = $(this._box).html();
67
-
68
- boxHtml = h.replaceAll(boxHtml, WYMeditor.LOGO, this._options.logoHtml);
69
- boxHtml = h.replaceAll(boxHtml, WYMeditor.TOOLS, this._options.toolsHtml);
70
- boxHtml = h.replaceAll(boxHtml, WYMeditor.CONTAINERS,this._options.containersHtml);
71
- boxHtml = h.replaceAll(boxHtml, WYMeditor.CLASSES, this._options.classesHtml);
72
- boxHtml = h.replaceAll(boxHtml, WYMeditor.HTML, this._options.htmlHtml);
73
- boxHtml = h.replaceAll(boxHtml, WYMeditor.IFRAME, iframeHtml);
74
- boxHtml = h.replaceAll(boxHtml, WYMeditor.STATUS, this._options.statusHtml);
75
-
76
- //construct tools list
77
- var aTools = eval(this._options.toolsItems);
78
- var sTools = "";
79
-
80
- for(var i = 0; i < aTools.length; i++) {
81
- var oTool = aTools[i];
82
- if(oTool.name && oTool.title) {
83
- var sTool = this._options.toolsItemHtml;
84
- var sTool = h.replaceAll(sTool, WYMeditor.TOOL_NAME, oTool.name);
85
- sTool = h.replaceAll(sTool, WYMeditor.TOOL_TITLE, this._options.stringDelimiterLeft
86
- + oTool.title
87
- + this._options.stringDelimiterRight);
88
- sTool = h.replaceAll(sTool, WYMeditor.TOOL_CLASS, oTool.css);
89
- sTools += sTool;
90
- }
91
- }
92
-
93
- boxHtml = h.replaceAll(boxHtml, WYMeditor.TOOLS_ITEMS, sTools);
94
-
95
- //construct classes list
96
- var aClasses = eval(this._options.classesItems);
97
- var sClasses = "";
98
-
99
- for(var i = 0; i < aClasses.length; i++) {
100
- var oClass = aClasses[i];
101
- if(oClass.name) {
102
- if (oClass.rules && oClass.rules.length > 0) {
103
- var sRules = "";
104
- var wym = this;
105
- $.each(oClass.rules, function(index, rule) {
106
- sClass = wym._options.classesItemHtml;
107
- sClass = h.replaceAll(sClass, WYMeditor.CLASS_NAME, oClass.name + (oClass.join || "") + (rule.name || rule));
108
- sClass = h.replaceAll(sClass, WYMeditor.CLASS_TITLE, rule.title || titleize(rule.name || rule));
109
- sRules += sClass;
110
- });
111
-
112
- var sClassMultiple = this._options.classesItemHtmlMultiple;
113
- sClassMultiple = h.replaceAll(sClassMultiple, WYMeditor.CLASS_TITLE, oClass.title || titleize(oClass.name));
114
- sClassMultiple = h.replaceAll(sClassMultiple, '{classesItemHtml}', sRules);
115
- sClasses += sClassMultiple;
116
- }
117
- else {
118
- sClass = this._options.classesItemHtml;
119
- sClass = h.replaceAll(sClass, WYMeditor.CLASS_NAME, oClass.name);
120
- sClass = h.replaceAll(sClass, WYMeditor.CLASS_TITLE, oClass.title || titleize(oClass.name));
121
- sClasses += sClass;
122
- }
123
- }
124
- }
125
-
126
- boxHtml = h.replaceAll(boxHtml, ">"+WYMeditor.APPLY_CLASS+"<",
127
- ">" + this._options.stringDelimiterLeft
128
- + WYMeditor.APPLY_CLASS
129
- + this._options.stringDelimiterRight + "<");
130
- boxHtml = h.replaceAll(boxHtml, WYMeditor.CLASSES_ITEMS, sClasses);
131
-
132
- //construct containers list
133
- var aContainers = eval(this._options.containersItems);
134
- var sContainers = "";
135
-
136
- for(var i = 0; i < aContainers.length; i++) {
137
- var oContainer = aContainers[i];
138
- if(oContainer.name && oContainer.title) {
139
- var sContainer = this._options.containersItemHtml;
140
- sContainer = h.replaceAll(sContainer, WYMeditor.CONTAINER_NAME, oContainer.name);
141
- sContainer = h.replaceAll(sContainer, WYMeditor.CONTAINER_TITLE,
142
- this._options.stringDelimiterLeft
143
- + oContainer.title
144
- + this._options.stringDelimiterRight);
145
- sContainer = h.replaceAll(sContainer, WYMeditor.CONTAINER_CLASS, oContainer.css);
146
- sContainers += sContainer;
147
- }
148
- }
149
-
150
- boxHtml = h.replaceAll(boxHtml, WYMeditor.CONTAINERS_ITEMS, sContainers);
151
-
152
- //l18n
153
- boxHtml = this.replaceStrings(boxHtml);
154
-
155
- //load html in wymbox
156
- $(this._box).html(boxHtml);
157
-
158
- //hide the html value
159
- $(this._box).find(this._options.htmlSelector).hide();
160
-
161
- //enable the skin
162
- this.loadSkin();
163
-
164
- // store which WYMeditor instance the element owns on the element.
165
- $(this._element).data('wymeditor', this);
166
- }
167
- };
168
-
169
- WYMeditor.editor.prototype.bindEvents = function() {
170
-
171
- //copy the instance
172
- var wym = this;
173
-
174
- //handle click event on tools buttons
175
- $(this._box).find(this._options.toolSelector).click(function() {
176
- wym._iframe.contentWindow.focus(); //See #154
177
- wym.exec($(this).attr(WYMeditor.NAME));
178
- return(false);
179
- });
180
-
181
- //handle click event on containers buttons
182
- $(this._box).find(this._options.containerSelector).click(function() {
183
- wym.container($(this).attr(WYMeditor.NAME));
184
- return(false);
185
- });
186
-
187
- //handle keyup event on html value: set the editor value
188
- //handle focus/blur events to check if the element has focus, see #147
189
- $(this._box).find(this._options.htmlValSelector)
190
- .keyup(function() { $(wym._doc.body).html($(this).val());})
191
- .focus(function() { $(this).toggleClass('hasfocus'); })
192
- .blur(function() { $(this).toggleClass('hasfocus'); });
193
-
194
- //handle click event on classes buttons
195
- $(this._box).find(this._options.classSelector).bind('click', function(e) {
196
-
197
- var aClasses = eval(wym._options.classesItems);
198
- var sName = $(this).attr(WYMeditor.NAME);
199
- var oClass = WYMeditor.Helper.findByName(aClasses, sName);
200
- var replacers = $([]);
201
- if (oClass == null) {
202
- $.each(aClasses, function(index, classRule){
203
- if (oClass == null && classRule.rules && classRule.rules.length > 0){
204
- var ruleName = sName.replace(classRule.name + (classRule.join || ""), "");
205
- var indexOf = null;
206
- $.each(classRule.rules, function(i, rule) {
207
- if (ruleName == (rule.name || rule)) {
208
- indexOf = i;
209
- } else {
210
- replacers.push(classRule.name + (classRule.join || "") + (rule.name || rule));
211
- }
212
- });
213
-
214
- if (indexOf != null) oClass = {expr: (classRule.rules[indexOf].expr || null)};
215
- }
216
- });
217
- }
218
-
219
- if(oClass) {
220
- // remove all related classes.
221
- replacers.each(function(index, removable_class){
222
- wym.removeClass(removable_class, oClass.expr);
223
- });
224
-
225
- wym.toggleClass(sName, oClass.expr);
226
- }
227
-
228
- // now hide the menu
229
- wym.exec(WYMeditor.APPLY_CLASS);
230
-
231
- wym._iframe.contentWindow.focus(); //See #154
232
- e.preventDefault();
233
- });
234
-
235
- //handle event on update element
236
- $(this._options.updateSelector).bind(this._options.updateEvent, function() {
237
- wym.update();
238
- });
239
- };
240
-
241
- WYMeditor.editor.prototype.ready = function() {
242
- return(this._doc != null);
243
- };
244
-
245
-
246
- /********** METHODS **********/
247
-
248
- /* @name box
249
- * @description Returns the WYMeditor container
250
- */
251
- WYMeditor.editor.prototype.box = function() {
252
- return(this._box);
253
- };
254
-
255
- /* @name html
256
- * @description Get/Set the html value
257
- */
258
- WYMeditor.editor.prototype.html = function(html) {
259
-
260
- if(typeof html === 'string') {
261
- $(this._doc.body).html(html);
262
- } else {
263
- return($(this._doc.body).html());
264
- }
265
- };
266
-
267
- /* @name intercept_paste
268
- * @description Catch the browser paste action and open the appropriate dialog instead
269
- */
270
- WYMeditor.editor.prototype.intercept_paste = function(e) {
271
- var wym = WYMeditor.INSTANCES[this.title];
272
- wym.format_block();
273
- wym.exec(WYMeditor.PASTE);
274
- if (e) {
275
- e.preventDefault();
276
- }
277
- };
278
-
279
- /* @name xhtml
280
- * @description Cleans up the HTML
281
- */
282
- WYMeditor.editor.prototype.xhtml = function() {
283
- return this.parser.parse(this.html());
284
- };
285
-
286
- /* @name exec
287
- * @description Executes a button command
288
- */
289
- WYMeditor.editor.prototype.exec = function(cmd) {
290
-
291
- //base function for execCommand
292
- //open a dialog or exec
293
- switch(cmd) {
294
- case WYMeditor.CREATE_LINK:
295
- if((container = this.container()) || this._selected_image) {
296
- this.dialog(WYMeditor.DIALOG_LINK);
297
- }
298
- break;
299
-
300
- case WYMeditor.INSERT_IMAGE:
301
- this.dialog(WYMeditor.DIALOG_IMAGE);
302
- break;
303
-
304
- case WYMeditor.INSERT_TABLE:
305
- this.dialog(WYMeditor.DIALOG_TABLE);
306
- break;
307
-
308
- case WYMeditor.PASTE:
309
- this.dialog(WYMeditor.DIALOG_PASTE);
310
- break;
311
-
312
- case WYMeditor.TOGGLE_HTML:
313
- this.update();
314
- this.toggleHtml();
315
-
316
- //partially fixes #121 when the user manually inserts an image
317
- //if(!$(this._box).find(this._options.htmlSelector).is(':visible')) {
318
- // this.listen();
319
- //}
320
- break;
321
-
322
- case WYMeditor.PREVIEW:
323
- this.dialog(WYMeditor.PREVIEW);
324
- break;
325
-
326
- case WYMeditor.APPLY_CLASS:
327
- wym = this;
328
- // determine whether any classes are already selected and add the enabled class to them.
329
- $(wym._box).find(this._options.classUnhiddenSelector).find("a[name]").each(function(index, rule){
330
- if ($(wym.selected()).hasClass($(rule).attr('name'))) {
331
- $(rule).parent().addClass('enabled');
332
- } else {
333
- $(rule).parent().removeClass('enabled');
334
- }
335
- });
336
- break;
337
-
338
- default:
339
- this._exec(cmd);
340
- break;
341
- }
342
- };
343
-
344
- /* @name container
345
- * @description Get/Set the selected container
346
- */
347
- WYMeditor.editor.prototype.container = function(sType) {
348
-
349
- if(sType) {
350
-
351
- var container = null;
352
-
353
- if(sType.toLowerCase() == WYMeditor.TH) {
354
-
355
- container = this.container();
356
-
357
- //find the TD or TH container
358
- switch(container.tagName.toLowerCase()) {
359
-
360
- case WYMeditor.TD: case WYMeditor.TH:
361
- break;
362
- default:
363
- var aTypes = new Array(WYMeditor.TD,WYMeditor.TH);
364
- container = this.findUp(this.container(), aTypes);
365
- break;
366
- }
367
-
368
- //if it exists, switch
369
- if(container!=null) {
370
-
371
- sType = (container.tagName.toLowerCase() == WYMeditor.TD)? WYMeditor.TH: WYMeditor.TD;
372
- this.switchTo(container,sType);
373
- this.update();
374
- }
375
- } else {
376
-
377
- //set the container type
378
- var aTypes=new Array(WYMeditor.P,WYMeditor.H1,WYMeditor.H2,WYMeditor.H3,WYMeditor.H4,WYMeditor.H5,
379
- WYMeditor.H6,WYMeditor.PRE,WYMeditor.BLOCKQUOTE);
380
-
381
- container = this.findUp(this.container(), aTypes);
382
-
383
- if(container) {
384
-
385
- var newNode = null;
386
-
387
- //blockquotes must contain a block level element
388
- if(sType.toLowerCase() == WYMeditor.BLOCKQUOTE) {
389
-
390
- var blockquote = this.findUp(this.container(), WYMeditor.BLOCKQUOTE);
391
-
392
- if(blockquote == null) {
393
-
394
- newNode = this._doc.createElement(sType);
395
- container.parentNode.insertBefore(newNode,container);
396
- newNode.appendChild(container);
397
- this.setFocusToNode(newNode.firstChild);
398
-
399
- } else {
400
-
401
- var nodes = blockquote.childNodes;
402
- var lgt = nodes.length;
403
- var firstNode = null;
404
-
405
- if(lgt > 0) { firstNode = nodes.item(0); }
406
- for(var x=0; x<lgt; x++) {
407
- blockquote.parentNode.insertBefore(nodes.item(0),blockquote);
408
- }
409
- blockquote.parentNode.removeChild(blockquote);
410
- if(firstNode) { this.setFocusToNode(firstNode); }
411
- }
412
- }
413
-
414
- else
415
- {
416
- this.setFocusToNode(this.switchTo(container,sType));
417
- }
418
-
419
- this.update();
420
- }
421
- }
422
- }
423
- else { return(this.selected()); }
424
- };
425
-
426
- /* @name toggleClass
427
- * @description Toggles class on selected element, or one of its parents
428
- */
429
- WYMeditor.editor.prototype.toggleClass = function(sClass, jqexpr) {
430
-
431
- var container = $((this._selected_image ? this._selected_image : this.selected(true)));
432
- if (jqexpr != null) { container = $(container.parentsOrSelf(jqexpr)); }
433
- container.toggleClass(sClass);
434
- if(!container.attr(WYMeditor.CLASS)) { container.removeAttr(this._class); }
435
-
436
- };
437
-
438
- WYMeditor.editor.prototype.toggleClassSelector = function() {
439
- // substring(1) to remove the . at the start
440
- var wym = this;
441
- var disabled = $(wym._box).find(wym._options.classUnhiddenSelector)
442
- .hasClass(wym._options.classHiddenSelector.substring(1));
443
- if (disabled) {
444
- $(wym._box).find(wym._options.classUnhiddenSelector)
445
- .removeClass(wym._options.classHiddenSelector.substring(1));
446
-
447
- $(wym._box).find("a[name=" + WYMeditor.APPLY_CLASS +"]")
448
- .addClass('selected').parent().addClass('activated');
449
- } else {
450
- $(wym._box).find(wym._options.classUnhiddenSelector)
451
- .addClass(wym._options.classHiddenSelector.substring(1));
452
-
453
- $(wym._box).find("a[name=" + WYMeditor.APPLY_CLASS +"]")
454
- .removeClass('selected').parent().removeClass('activated');
455
- }
456
-
457
- wym.exec(WYMeditor.APPLY_CLASS);
458
- }
459
-
460
- /* @name removeClass
461
- * @description Removes class on selected element, or one of its parents
462
- */
463
- WYMeditor.editor.prototype.removeClass = function(sClass, jqexpr) {
464
-
465
- var container = $((this._selected_image ? this._selected_image : $(this.selected(true))));
466
- if (jqexpr != null) { container = $(container.parentsOrSelf(jqexpr)); }
467
- container.removeClass(sClass);
468
-
469
- if(!container.attr(WYMeditor.CLASS)) { container.removeAttr(this._class); }
470
-
471
- };
472
-
473
- /* @name findUp
474
- * @description Returns the first parent or self container, based on its type
475
- */
476
- WYMeditor.editor.prototype.findUp = function(node, filter) {
477
-
478
- //filter is a string or an array of strings
479
-
480
- if(node) {
481
-
482
- var tagname = node.tagName.toLowerCase();
483
-
484
- if(typeof(filter) == WYMeditor.STRING) {
485
-
486
- while(tagname != filter && tagname != WYMeditor.BODY) {
487
-
488
- node = node.parentNode;
489
- tagname = node.tagName.toLowerCase();
490
- }
491
-
492
- } else {
493
-
494
- var bFound = false;
495
-
496
- while(!bFound && tagname != WYMeditor.BODY) {
497
- for(var i = 0; i < filter.length; i++) {
498
- if(tagname == filter[i]) {
499
- bFound = true;
500
- break;
501
- }
502
- }
503
- if(!bFound) {
504
- node = node.parentNode;
505
- tagname = node.tagName.toLowerCase();
506
- }
507
- }
508
- }
509
-
510
- if(tagname != WYMeditor.BODY) {
511
- return(node);
512
- } else {
513
- return(null);
514
- }
515
- } else {
516
- return(null);
517
- }
518
- };
519
-
520
- /* @name switchTo
521
- * @description Switch the node's type
522
- */
523
- WYMeditor.editor.prototype.switchTo = function(selectionOrNode,sType) {
524
-
525
- if (selectionOrNode.getRangeAt) {
526
- // We have a selection object so we need to create a temporary node around it (bold is easy). This node will be replaced anyway.
527
- this.exec(WYMeditor.BOLD);
528
- selectionOrNode = selectionOrNode.focusNode.parentNode;
529
- }
530
-
531
- // we have a node.
532
- var html = $(selectionOrNode).html();
533
- var newNode = this._doc.createElement(sType);
534
- var klass = $(selectionOrNode).attr('class');
535
-
536
- // copy across the css class names.
537
- if(typeof klass !== 'undefined'){
538
- $.each($(selectionOrNode).attr('class').split(" "), function(index, className) {
539
- $(newNode).addClass(className);
540
- });
541
- }
542
-
543
- selectionOrNode.parentNode.replaceChild(newNode,selectionOrNode);
544
-
545
- $(newNode).html(html);
546
- this.setFocusToNode(newNode);
547
-
548
- return newNode;
549
- };
550
-
551
- WYMeditor.editor.prototype.replaceStrings = function(sVal) {
552
- //check if the language file has already been loaded
553
- //if not, get it via a synchronous ajax call
554
- var wym = this;
555
- if(!WYMeditor.STRINGS[wym._options.lang]) {
556
- try {
557
- eval($.ajax({url:wym._options.langPath + wym._options.lang + '.js', async:false}).responseText);
558
- } catch(e) {
559
- if (WYMeditor.console) {
560
- WYMeditor.console.error("WYMeditor: error while parsing language file.");
561
- }
562
- return sVal;
563
- }
564
- }
565
-
566
- //replace all the strings in sVal and return it
567
- $.each(WYMeditor.STRINGS[wym._options.lang], function(key, value) {
568
- sVal = WYMeditor.Helper.replaceAll(sVal, wym.encloseString(key), value);
569
- });
570
-
571
- return(sVal);
572
- };
573
-
574
- WYMeditor.editor.prototype.encloseString = function(sVal) {
575
- return(this._options.stringDelimiterLeft + sVal + this._options.stringDelimiterRight);
576
- };
577
-
578
- /* @name status
579
- * @description Prints a status message
580
- */
581
- WYMeditor.editor.prototype.status = function(sMessage) {
582
-
583
- //print status message
584
- $(this._box).find(this._options.statusSelector).html(sMessage);
585
- };
586
-
587
- /* @name update
588
- * @description Updates the element and textarea values
589
- */
590
- WYMeditor.editor.prototype.update = function() {
591
- var wym = this;
592
-
593
- // the replace function below makes the HTML source code easier to read when end users need to use this view.
594
- var html = wym.xhtml().replace(/<\/([A-Za-z0-9]*)></g, function(m){
595
- return m.split(">").join(">\n");
596
- });
597
-
598
- // ensure system/images calls become /system/images.
599
- html = html.replace(/src=\"system\/images/g, 'src="/system/images');
600
-
601
- // get rid of wym id tags that were forgotten about by replacing them with their content.
602
- $(html).find(bad_spans='span[id|=wym], span[id=undefined]').add($(html).filter(bad_spans)).each(function(i, span) {
603
- html_to_replace_with = wym.parser.parse($(span).html());
604
- html_to_replace = wym.parser.parse($(span).wrap('<div />').parent().html());
605
- if($.browser.msie) {
606
- // converts <SPAN id=wym-1231231>foo</SPAN> to <SPAN id="wym-1231231">foo</SPAN> (note the quotes)
607
- html_to_replace = new RegExp(html_to_replace.replace(/(\ [^\=]+\=)([^\ >]+)/, '$1"$2"'), "ig");
608
- }
609
- html = html.replace(html_to_replace, html_to_replace_with);
610
- });
611
-
612
- // get rid of id='last_paste' tags that were forgotten about.
613
- html = html.replace(/(\ ?id=(\"|\')last\_paste(\"|\'))/igm, '');
614
-
615
- // get rid of any temporary text-only interpolation tags we have inserted for cursor position.
616
- html = html.replace(/[%$]+wym-[^%$]*[%$]+/igm, '');
617
-
618
- // get rid of <br /> tag that appears when empty.
619
- html = html.replace(/^<br\ ?\/?>$/, '')
620
-
621
- // apply changes/
622
- $(wym._element).val(html);
623
- $(wym._box).find(wym._options.htmlValSelector).not('.hasfocus').val(html); //#147
624
- };
625
-
626
- /* @name dialog
627
- * @description Opens a dialog box
628
- */
629
- WYMeditor.editor.prototype.dialog = function( dialogType ) {
630
- var wym = this;
631
-
632
- wym.update();
633
- var path = this._wym._options.dialogPath + dialogType + '?wymeditor=true&' + window.location.href.match(/switch_locale=[a-z]{2}(?:-[A-Z]{2})?/);
634
-
635
- wym._current_unique_stamp = wym.uniqueStamp();
636
- // change undo or redo on cancel to true to have this happen when a user closes (cancels) a dialogue
637
- wym._undo_on_cancel = false;
638
- wym._redo_on_cancel = false;
639
-
640
- var selected = this.selected();
641
- //set to P if parent = BODY unless it's a table going in there.
642
- if (dialogType != WYMeditor.DIALOG_TABLE) {
643
- wym.format_block();
644
- }
645
-
646
- if (dialogType == WYMeditor.DIALOG_LINK && $.browser.mozilla) {
647
- selection = wym._iframe.contentWindow.getSelection();
648
- matches = $($(selected).html().match(new RegExp(RegExp.escape(selection.anchorNode.textContent) + "(.*)" + RegExp.escape(selection.focusNode.textContent))));
649
- if (matches != null && matches.length > 0 && (possible_anchor_tag = matches.last()).length > 0)
650
- {
651
- if (((href_matches = possible_anchor_tag.get(0).match(/href="([^"]*)"/)) != null) && (href = $(href_matches).last().get(0)) != null)
652
- {
653
- $(wym._doc).find('a').each(function(index, possible_match)
654
- {
655
- if ($(possible_match).html() == selection)
656
- {
657
- selected = possible_match;
658
- }
659
- });
660
- }
661
- }
662
- }
663
-
664
- ajax_loaded_callback = function(){wym.dialog_ajax_callback(selected);};
665
-
666
- var parent_node = wym._selected_image ? wym._selected_image.parentNode : selected;
667
- if (typeof(parent_node) != 'undefined' && parent_node !== null) {
668
- if (parent_node.tagName.toLowerCase() != WYMeditor.A) {
669
- // wrap the current selection with a funky span.
670
- if (wym._selected_image == null)
671
- {
672
- if (selected != null && selected.tagName.toLowerCase() != WYMeditor.A && wym._iframe.contentWindow.getSelection) {
673
- // Fixes webkit issue where it would not paste at cursor.
674
- selection = wym._iframe.contentWindow.getSelection();
675
- if (selection.focusNode.insertData) {
676
- // if you highlight backwards, it reverses the order of the anchorNode and focusNode / anchorOffset and focusOffset.
677
- // anchorOffset is where you started the selection, focusOffset is where you ended the selection.
678
- // So, if you highlight forwards then {anchorOffset}some text{focusOffset}
679
- // But, if you highlight backwards then {focusOffset}some text{anchorOffset}
680
- if (selection.anchorOffset > selection.focusOffset) {
681
- start_node = selection.focusNode;
682
- start = selection.focusOffset;
683
-
684
- end_node = selection.anchorNode;
685
- end = selection.anchorOffset;
686
- } else {
687
- start_node = selection.anchorNode;
688
- start = selection.anchorOffset;
689
-
690
- end_node = selection.focusNode;
691
- end = selection.focusOffset;
692
- }
693
-
694
- // for https://github.com/refinery/refinerycms/issues/581
695
- if (typeof (start_node.insertData) === 'undefined') {
696
- var j = start_node.childNodes.length - 1,
697
- tmp_start_node = start_node;
698
-
699
- // @todo what then if function insertData is not found?
700
- while (typeof(end_node.insertData) !== 'function' || !j) {
701
- start_node = tmp_start_node.childNodes[j--];
702
- }
703
-
704
- start = 0;
705
- }
706
-
707
- if (typeof (end_node.insertData) === 'undefined') {
708
- var i = end_node.childNodes.length - 1,
709
- tmp_end_node = end_node;
710
- while (typeof(end_node.insertData) !== 'function' || !i) {
711
- end_node = tmp_end_node.childNodes[i--];
712
- }
713
-
714
- end = end_node.length;
715
- }
716
-
717
- // because .insertData only inserts text, we have to insert some 'meaningful' *text* only interpolation tags (no html).
718
- start_tag = '%%' + wym._current_unique_stamp + '%%';
719
- end_tag = '$$' + wym._current_unique_stamp + '$$';
720
-
721
- // sometimes we may be crossing multiple "nodes" so a simple test for whether this is the case.
722
- // this is important, see this example:
723
- // some text <a href='/'>with some link</a> and then more text
724
- // {start_node}some text {end_start_node}{anotherNode}<a href='/'>with some link</a>{end_anotherNode}{end_node} and then more text{end_end_node}
725
- // the "start_node" is a separate node to the end node and therefore we can't treat them as one long node anymore.
726
- if (start_node === end_node) {
727
- end = end + start_tag.length;
728
- }
729
-
730
- // Insert the 'meaningful' text interpolation tags.
731
- start_node.insertData(start, start_tag);
732
- end_node.insertData(end, end_tag);
733
-
734
- // Now that we can use HTML again, replace the simple text with a span tag.
735
- $(selected).html($(selected).html().replace(start_tag, "<span id='" + wym._current_unique_stamp + "'>")
736
- .replace(end_tag, "</span>"));
737
- } else {
738
- wym.wrap("<span id='" + wym._current_unique_stamp + "'>", "</span>");
739
- }
740
- } else {
741
- wym.wrap("<span id='" + wym._current_unique_stamp + "'>", "</span>");
742
- }
743
- }
744
- }
745
- else {
746
- if (!wym._selected_image) {
747
- parent_node._id_before_replaceable = parent_node.id;
748
- parent_node.id = '' + this._current_unique_stamp;
749
- $(parent_node).attr("_id_before_replaceable", parent_node._id_before_replaceable);
750
- }
751
-
752
- if (dialogType != WYMeditor.DIALOG_PASTE && dialogType != WYMeditor.DIALOG_TABLE) {
753
- path += path.indexOf("?") == -1 ? "?" : "&";
754
- port = (window.location.port.length > 0 ? (":" + window.location.port) : "");
755
- path += "current_link=" + parent_node.href.replace(window.location.protocol + "//" + window.location.hostname + port, "");
756
- path += "&target_blank=" + (parent_node.target == "_blank" ? "true" : "false");
757
- }
758
- }
759
- }
760
-
761
- // launch dialog
762
- dialog_title = wym.replaceStrings(wym.encloseString( dialogType ));
763
- dialog_container = $("<div id='" + wym._options.dialogId + "' class='editor_dialog'></div>");
764
- switch(dialogType) {
765
- case WYMeditor.DIALOG_TABLE:
766
- // create and open dialog
767
- dialog_container.html(wym.replaceStrings(wym._options.dialogTableHtml))
768
- .dialog($.extend(wym._options.dialogInlineFeatures, {
769
- title: dialog_title
770
- }));
771
-
772
- ajax_loaded_callback();
773
- break;
774
- case WYMeditor.DIALOG_PASTE:
775
- dialog_container.html(wym.replaceStrings(wym._options.dialogPasteHtml))
776
- .dialog($.extend(wym._options.dialogInlineFeatures, {
777
- title: dialog_title
778
- }));
779
-
780
- ajax_loaded_callback();
781
- break;
782
- default:
783
- $("<img id='dialog_loading' src='<%= asset_path 'refinery/dialogLoadingAnimation.gif' %>' width='208' height='13' />").appendTo(dialog_container);
784
- dialog_container.dialog($.extend(wym._options.dialogFeatures, {
785
- title: dialog_title
786
- })).load(path, ajax_loaded_callback);
787
- break;
788
- }
789
-
790
- };
791
-
792
- WYMeditor.editor.prototype.dialog_ajax_callback = function(selected) {
793
-
794
- // set variables
795
- wym = this; _selected = selected;
796
- // now fix the height;
797
- $("#" + wym._options.dialogId + ".editor_dialog").css('height', 'auto');
798
-
799
- // look for iframes
800
- (iframes = $("#" + this._options.dialogId).find('iframe')).load(function() {
801
- WYMeditor.INIT_DIALOG(wym, _selected, true);
802
- $(this).unbind('load');
803
- });
804
-
805
- if (iframes.length == 0) {
806
- WYMeditor.INIT_DIALOG(this, selected);
807
- }
808
- };
809
-
810
- /* @name toggleHtml
811
- * @description Shows/Hides the HTML
812
- */
813
- WYMeditor.editor.prototype.toggleHtml = function() {
814
- $(this._box).find(this._options.htmlSelector).toggle();
815
- };
816
-
817
- WYMeditor.editor.prototype.uniqueStamp = function() {
818
- return("wym-" + new Date().getTime());
819
- };
820
-
821
- WYMeditor.editor.prototype.paste = function(sData) {
822
- wym = this;
823
-
824
- wym.format_block();
825
-
826
- var sTmp;
827
- replaceable = $(wym._doc.body).find('#' + wym._current_unique_stamp);
828
-
829
- // replaceable doesn't actually get replaced here, it's just used as a marker for where the cursor was.
830
- container = replaceable.get(0) || this.selected();
831
-
832
- //split the data, using double newlines as the separator
833
- var aP = sData.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").split(wym._newLine + wym._newLine);
834
- var rExp = new RegExp(wym._newLine, "g");
835
-
836
- //add a P for each item
837
- if(container && container.tagName.toLowerCase() != WYMeditor.BODY) {
838
- contentAfterBreak = "";
839
- insertedContentAfterBreak = "";
840
- for(x = aP.length - 1; x >= 0; x--) {
841
- //simple newlines are replaced by a break
842
- sTmp = aP[x].replace(rExp, "<br />");
843
- if (x == 0) {
844
- // if we're inside a p tag but the container is not a p tag
845
- // then we need to close the p tag first before starting a new one.
846
- // Only if we placed more items after it (aP.length)
847
- if (aP.length > 1
848
- && $(container).get(0).tagName.toLowerCase() == "span"
849
- && $(container).attr('id') == ('' + wym._current_unique_stamp)
850
- && $(container).parent().get(0).tagName.toLowerCase() == "p")
851
- {
852
- p = $(container).parent();
853
- matches = p.html().match(new RegExp("([\\s\\S]*)\<span id=[\'|\"]" + wym._current_unique_stamp + "[\'|\"]\>.*\<\/span\>"));
854
- sTmp = matches[1] + sTmp + $(container).html();
855
- p.html(sTmp);
856
- if (insertedContentAfterBreak != null && insertedContentAfterBreak.length > 0) {
857
- p.after(insertedContentAfterBreak);
858
- }
859
- if (contentAfterBreak != null && contentAfterBreak.length > 0) {
860
- if ((last_paste = p.parent().find('p#last_paste')).length == 1) {
861
- last_paste.attr('id', null).html(last_paste.html() + contentAfterBreak);
862
- } else {
863
- p.next().after("<p>" + contentAfterBreak + "</p>");
864
- }
865
- }
866
-
867
- } else {
868
- $(container).html($(container).html().replace(/^<br\/?>$/, '') + sTmp);
869
- }
870
- } else {
871
- if ((aP.length -1) == x) {
872
- var rgx = $(container).parent().html().match(new RegExp("\<span id=[\'|\"]" + wym._current_unique_stamp + "[\'|\"]\>.*\<\/span\>([\\s\\S]*)"));
873
- if(rgx && rgx[1]){
874
- contentAfterBreak = rgx[1].split('</p>')[0];
875
- }
876
- sTmp = "<p id='last_paste'>" + sTmp + "</p>";
877
- } else {
878
- sTmp = "<p>" + sTmp + "</p>";
879
- }
880
-
881
- if (insertedContentAfterBreak == "") {
882
- insertedContentAfterBreak = insertedContentAfterBreak + sTmp;
883
- } else {
884
- insertedContentAfterBreak = sTmp + insertedContentAfterBreak;
885
- }
886
- }
887
- }
888
- } else {
889
- for(x = 0; x < aP.length; x++) {
890
- sTmp = aP[x];
891
- //simple newlines are replaced by a break
892
- sTmp = sTmp.replace(rExp, "<br />");
893
- if (x == 0 && $(container).html().replace(/<br\ ?\/?>/, "").length == 0) {
894
- $(container).html(sTmp);
895
- } else {
896
- $(wym._doc.body).append("<p>" + sTmp + "</p>");
897
- }
898
- }
899
- }
900
-
901
- if (replaceable.get(0) != null) {
902
- // set the id of the container back.
903
- if (replaceable.get(0).tagName.toLowerCase() == 'span') {
904
- replaceable.replaceWith(replaceable.html());
905
- }
906
- replaceable.attr('id', replaceable.get(0)._id_before_replaceable || null);
907
- }
908
- };
909
-
910
- WYMeditor.editor.prototype.insert = function(html) {
911
- // Do we have a selection?
912
- if (this._iframe.contentWindow.getSelection().focusNode != null) {
913
- // Overwrite selection with provided html
914
- this._exec(WYMeditor.INSERT_HTML, html);
915
- } else {
916
- // Fall back to the internal paste function if there's no selection
917
- this.paste(html);
918
- }
919
- };
920
-
921
- WYMeditor.editor.prototype.wrap = function(left, right, selection) {
922
- left = (typeof(left) != 'undefined' ? left : '');
923
- right = (typeof(right) != 'undefined' ? right : '');
924
-
925
- // Do we have a selection?
926
- if (selection == null) { selection = this._iframe.contentWindow.getSelection();}
927
- if (selection.focusNode != null) {
928
- // Wrap selection with provided html
929
- this._exec( WYMeditor.INSERT_HTML, left + selection.toString() + right);
930
- }
931
- };
932
-
933
- WYMeditor.editor.prototype.unwrap = function(selection) {
934
- // Do we have a selection?
935
- if (selection == null) { selection = this._iframe.contentWindow.getSelection();}
936
- if (selection.focusNode != null) {
937
- // Unwrap selection
938
- this._exec( WYMeditor.INSERT_HTML, selection.toString() );
939
- }
940
- };
941
-
942
- WYMeditor.editor.prototype.setFocusToNode = function(node, toStart) {
943
- var range = this._doc.createRange(),
944
- selection = this._iframe.contentWindow.getSelection();
945
- toStart = toStart ? 0 : 1;
946
-
947
- range.selectNodeContents(node);
948
- selection.addRange(range);
949
- selection.collapse(node, toStart);
950
- this._iframe.contentWindow.focus();
951
- };
952
-
953
- WYMeditor.editor.prototype.addCssRules = function(doc, aCss) {
954
- var styles = doc.styleSheets[0];
955
- if(styles) {
956
- for(var i = 0; i < aCss.length; i++) {
957
- var oCss = aCss[i];
958
- if(oCss.name && oCss.css) { this.addCssRule(styles, oCss); }
959
- }
960
- }
961
- };
962
-
963
- WYMeditor.editor.prototype.format_block = function(selected) {
964
-
965
- //'this' should be the wymeditor instance.
966
- var wym = this;
967
- var container = selected || wym.selected() || $(wym._iframe).contents().find('body').get(0);
968
- var name = container.tagName.toLowerCase();
969
-
970
- //fix forbidden main containers
971
- if($.inArray(name, ['strong', 'b', 'em', 'i', 'sub', 'sup', 'a']) > -1) {
972
- name = container.parentNode.tagName.toLowerCase();
973
- }
974
-
975
- if(name == WYMeditor.BODY) {
976
- wym._selected_image = null;
977
- $(wym._iframe).contents().find('.selected_by_wym').removeClass('selected_by_wym');
978
- wym._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P);
979
- }
980
- };
981
-
982
- /********** CONFIGURATION **********/
983
-
984
- WYMeditor.editor.prototype.computeBasePath = function() {
985
- if ((script_path = this.computeWymPath()) != null) {
986
- if ((src_parts = script_path.split('/')).length > 1) { src_parts.pop(); }
987
- return src_parts.join('/') + "/";
988
- }
989
- else {
990
- return null;
991
- }
992
- };
993
-
994
- WYMeditor.editor.prototype.computeWymPath = function() {
995
- return $('script[src*=jquery.refinery.wymeditor]').attr('src');
996
- };
997
-
998
- WYMeditor.editor.prototype.computeJqueryPath = function() {
999
- return $($.grep($('script'), function(s){
1000
- return (s.src && s.src.match(/jquery(-(.*)){0,1}(\.pack|\.min|\.packed)?\.js(\?.*)?$/ ))
1001
- })).attr('src');
1002
- };
1003
-
1004
- WYMeditor.editor.prototype.computeCssPath = function() {
1005
- return $($.grep($('link'), function(s){
1006
- return (s.href && s.href.match(/wymeditor\/skins\/(.*)screen\.css(\?.*)?$/ ))
1007
- })).attr('href');
1008
- };
1009
-
1010
- WYMeditor.editor.prototype.configureEditorUsingRawCss = function() {
1011
-
1012
- var CssParser = new WYMeditor.WymCssParser();
1013
- if(this._options.stylesheet){
1014
- CssParser.parse($.ajax({url: this._options.stylesheet,async:false}).responseText);
1015
- }else{
1016
- CssParser.parse(this._options.styles, false);
1017
- }
1018
-
1019
- if(this._options.classesItems.length == 0) {
1020
- this._options.classesItems = CssParser.css_settings.classesItems;
1021
- }
1022
- if(this._options.editorStyles.length == 0) {
1023
- this._options.editorStyles = CssParser.css_settings.editorStyles;
1024
- }
1025
- if(this._options.dialogStyles.length == 0) {
1026
- this._options.dialogStyles = CssParser.css_settings.dialogStyles;
1027
- }
1028
- };
1029
-
1030
- /********** EVENTS **********/
1031
-
1032
- WYMeditor.editor.prototype.listen = function() {
1033
-
1034
- //don't use $.find() on the iframe body
1035
- //because of MSIE + jQuery + expando issue (#JQ1143)
1036
- //$(this._doc.body).find("*").bind("mouseup", this.mouseup);
1037
-
1038
- $(this._doc.body).bind("mousedown", this.mousedown);
1039
- var images = this._doc.body.getElementsByTagName("img");
1040
- for(var i=0; i < images.length; i++) {
1041
- $(images[i]).bind("mousedown", this.mousedown);
1042
- }
1043
-
1044
- // ensure links can't be navigated to.
1045
- $(this._doc).find('a[href]').click(function(e){
1046
- e.preventDefault();
1047
- });
1048
- };
1049
-
1050
- WYMeditor.editor.prototype.mousedown = function(e) {
1051
-
1052
- var wym = WYMeditor.INSTANCES[this.ownerDocument.title];
1053
-
1054
- wym._selected_image = (e.target.tagName.toLowerCase() == WYMeditor.IMG) ? e.target : null;
1055
- $(wym._iframe).contents().find('.selected_by_wym').removeClass('selected_by_wym');
1056
- if (!$.browser.mozilla) { $(wym._selected_image).addClass('selected_by_wym'); }
1057
- if (!$.browser.webkit) { e.stopPropagation(); }
1058
- };
1059
-
1060
- /********** SKINS **********/
1061
-
1062
- /*
1063
- * Function: WYMeditor.editor.loadSkin
1064
- * Loads the skin CSS and initialization script (if needed).
1065
- */
1066
- WYMeditor.editor.prototype.loadSkin = function() {
1067
-
1068
- //does the user want to automatically load the CSS (default: yes)?
1069
- //we also test if it hasn't been already loaded by another instance
1070
- //see below for a better (second) test
1071
- if(this._options.loadSkin && !WYMeditor.SKINS[this._options.skin]) {
1072
- //check if it hasn't been already loaded
1073
- //so we don't load it more than once
1074
- //(we check the existing <link> elements)
1075
-
1076
- var found = false;
1077
- var rExp = new RegExp(this._options.skin + '\/' + WYMeditor.SKINS_DEFAULT_CSS + '([\?].+?)?$');
1078
-
1079
- $('link').each( function() {
1080
- if(this.href.match(rExp)) found = true;
1081
- });
1082
-
1083
- // if not found, load it, using the skin path
1084
- if(!found) {
1085
- WYMeditor.loadCss( this._options.cssCompiledSkinPath + WYMeditor.SKINS_DEFAULT_CSS );
1086
- }
1087
- }
1088
-
1089
- //put the classname (ex. wym_skin_default) on wym_box
1090
- $(this._box).addClass( "wym_skin_" + this._options.skin );
1091
-
1092
- //does the user want to use some JS to initialize the skin (default: yes)?
1093
- //also check if it hasn't already been loaded by another instance
1094
- if(this._options.initSkin && !WYMeditor.SKINS[this._options.skin]) {
1095
- eval($.ajax({url:this._options.jsCompiledSkinPath + WYMeditor.SKINS_DEFAULT_JS, async:false}).responseText);
1096
- }
1097
-
1098
- //init the skin, if needed
1099
- if(WYMeditor.SKINS[this._options.skin] && WYMeditor.SKINS[this._options.skin].init) {
1100
- WYMeditor.SKINS[this._options.skin].init(this);
1101
- }
1102
-
1103
- };