alchemy_cms 2.9.1 → 3.0.0.rc5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (695) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/.travis.yml +14 -3
  4. data/CONTRIBUTING.md +73 -0
  5. data/Gemfile +25 -24
  6. data/LICENSE +19 -16
  7. data/README.md +16 -33
  8. data/alchemy_cms.gemspec +62 -59
  9. data/app/assets/images/alchemy/alchemy-logo.svg +70 -0
  10. data/app/assets/images/alchemy/favicon.ico +0 -0
  11. data/app/assets/images/alchemy/icon.svg +14 -0
  12. data/app/assets/javascripts/alchemy/alchemy.autocomplete.js.coffee +30 -0
  13. data/app/assets/javascripts/alchemy/alchemy.base.js.coffee +28 -30
  14. data/app/assets/javascripts/alchemy/alchemy.browser.js.coffee +20 -26
  15. data/app/assets/javascripts/alchemy/alchemy.confirm_dialog.js.coffee +80 -0
  16. data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +261 -0
  17. data/app/assets/javascripts/alchemy/alchemy.dirty.js.coffee +15 -15
  18. data/app/assets/javascripts/alchemy/alchemy.dragndrop.js.coffee +4 -1
  19. data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +20 -9
  20. data/app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee +67 -68
  21. data/app/assets/javascripts/alchemy/alchemy.file_progress.js.coffee +63 -0
  22. data/app/assets/javascripts/alchemy/alchemy.growler.js.coffee +1 -1
  23. data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +2 -1
  24. data/app/assets/javascripts/alchemy/alchemy.hotkeys.js.coffee +32 -14
  25. data/app/assets/javascripts/alchemy/alchemy.i18n.js.coffee +21 -0
  26. data/app/assets/javascripts/alchemy/alchemy.image_cropper.js.coffee +4 -1
  27. data/app/assets/javascripts/alchemy/{alchemy.onload.js.coffee → alchemy.initializer.js.coffee} +22 -5
  28. data/app/assets/javascripts/alchemy/alchemy.js +13 -11
  29. data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +221 -0
  30. data/app/assets/javascripts/alchemy/alchemy.list_filter.js.coffee +2 -2
  31. data/app/assets/javascripts/alchemy/alchemy.page_sorter.js +0 -2
  32. data/app/assets/javascripts/alchemy/alchemy.preview.js.coffee +37 -35
  33. data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +42 -69
  34. data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +1 -1
  35. data/app/assets/javascripts/alchemy/alchemy.spinner.js.coffee +4 -4
  36. data/app/assets/javascripts/alchemy/alchemy.tinymce.js.coffee.erb +3 -7
  37. data/app/assets/javascripts/alchemy/alchemy.translations.js.coffee +107 -19
  38. data/app/assets/javascripts/alchemy/alchemy.uploader.js.coffee +97 -0
  39. data/app/assets/javascripts/alchemy/alchemy.windows.js.coffee +14 -273
  40. data/app/assets/javascripts/alchemy/menubar.js.coffee +8 -0
  41. data/app/assets/javascripts/alchemy/preview.js +0 -2
  42. data/app/assets/javascripts/tinymce/plugins/alchemy_link/plugin.min.js +19 -0
  43. data/app/assets/stylesheets/alchemy/{defaults.scss → _defaults.scss} +2 -0
  44. data/app/assets/stylesheets/alchemy/{extends.scss → _extends.scss} +7 -61
  45. data/app/assets/stylesheets/alchemy/_mixins.scss +112 -0
  46. data/app/assets/stylesheets/alchemy/{variables.scss → _variables.scss} +31 -11
  47. data/app/assets/stylesheets/alchemy/admin.css.scss +6 -3
  48. data/app/assets/stylesheets/alchemy/archive.scss +27 -32
  49. data/app/assets/stylesheets/alchemy/base.scss +93 -127
  50. data/app/assets/stylesheets/alchemy/buttons.scss +227 -0
  51. data/app/assets/stylesheets/alchemy/dashboard.scss +14 -1
  52. data/app/assets/stylesheets/alchemy/dialogs.scss +209 -0
  53. data/app/assets/stylesheets/alchemy/elements.scss +173 -210
  54. data/app/assets/stylesheets/alchemy/errors.scss +5 -15
  55. data/app/assets/stylesheets/alchemy/flash.scss +12 -11
  56. data/app/assets/stylesheets/alchemy/form_fields.scss +56 -0
  57. data/app/assets/stylesheets/alchemy/forms.scss +161 -0
  58. data/app/assets/stylesheets/alchemy/frame.scss +8 -6
  59. data/app/assets/stylesheets/alchemy/icon-font.css.scss +40 -40
  60. data/app/assets/stylesheets/alchemy/icons.scss +14 -6
  61. data/app/assets/stylesheets/alchemy/jquery-ui.scss +11 -629
  62. data/app/assets/stylesheets/alchemy/menubar.css.scss +27 -72
  63. data/app/assets/stylesheets/alchemy/notices.scss +6 -5
  64. data/app/assets/stylesheets/alchemy/pagination.scss +1 -1
  65. data/app/assets/stylesheets/alchemy/search.scss +4 -3
  66. data/app/assets/stylesheets/alchemy/selects.scss +199 -0
  67. data/app/assets/stylesheets/alchemy/sitemap.scss +31 -60
  68. data/app/assets/stylesheets/alchemy/tables.scss +0 -77
  69. data/app/assets/stylesheets/alchemy/toolbar.scss +0 -2
  70. data/app/assets/stylesheets/alchemy/upload.scss +60 -57
  71. data/app/assets/stylesheets/tinymce/skins/alchemy/content.min.css.scss +81 -0
  72. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/readme.md +1 -0
  73. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.eot +0 -0
  74. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.svg +175 -0
  75. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.ttf +0 -0
  76. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.woff +0 -0
  77. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.eot +0 -0
  78. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.svg +153 -0
  79. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.ttf +0 -0
  80. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.woff +0 -0
  81. data/app/assets/stylesheets/tinymce/skins/alchemy/img/anchor.gif +0 -0
  82. data/app/assets/stylesheets/tinymce/skins/alchemy/img/loader.gif +0 -0
  83. data/app/assets/stylesheets/tinymce/skins/alchemy/img/object.gif +0 -0
  84. data/{vendor/assets/javascripts/tiny_mce/themes/advanced → app/assets/stylesheets/tinymce/skins/alchemy}/img/trans.gif +0 -0
  85. data/app/assets/stylesheets/tinymce/skins/alchemy/img/wline.gif +0 -0
  86. data/app/assets/stylesheets/tinymce/skins/alchemy/skin.ie7.min.css +1 -0
  87. data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +1813 -0
  88. data/app/controllers/alchemy/admin/attachments_controller.rb +39 -50
  89. data/app/controllers/alchemy/admin/base_controller.rb +32 -32
  90. data/app/controllers/alchemy/admin/clipboard_controller.rb +2 -2
  91. data/app/controllers/alchemy/admin/contents_controller.rb +12 -7
  92. data/app/controllers/alchemy/admin/dashboard_controller.rb +1 -1
  93. data/app/controllers/alchemy/admin/elements_controller.rb +41 -32
  94. data/app/controllers/alchemy/admin/essence_files_controller.rb +4 -3
  95. data/app/controllers/alchemy/admin/essence_pictures_controller.rb +13 -16
  96. data/app/controllers/alchemy/admin/languages_controller.rb +0 -1
  97. data/app/controllers/alchemy/admin/layoutpages_controller.rb +2 -1
  98. data/app/controllers/alchemy/admin/pages_controller.rb +106 -166
  99. data/app/controllers/alchemy/admin/pictures_controller.rb +54 -80
  100. data/app/controllers/alchemy/admin/resources_controller.rb +25 -9
  101. data/app/controllers/alchemy/admin/tags_controller.rb +26 -14
  102. data/app/controllers/alchemy/admin/trash_controller.rb +5 -2
  103. data/app/controllers/alchemy/attachments_controller.rb +8 -8
  104. data/app/controllers/alchemy/base_controller.rb +23 -89
  105. data/app/controllers/alchemy/contents_controller.rb +17 -0
  106. data/app/controllers/alchemy/elements_controller.rb +7 -30
  107. data/app/controllers/alchemy/messages_controller.rb +18 -18
  108. data/app/controllers/alchemy/pages_controller.rb +73 -48
  109. data/app/controllers/alchemy/pictures_controller.rb +45 -46
  110. data/app/helpers/alchemy/admin/attachments_helper.rb +1 -0
  111. data/app/helpers/alchemy/admin/base_helper.rb +95 -90
  112. data/app/helpers/alchemy/admin/contents_helper.rb +34 -37
  113. data/app/helpers/alchemy/admin/elements_helper.rb +4 -5
  114. data/app/helpers/alchemy/admin/essences_helper.rb +13 -90
  115. data/app/helpers/alchemy/admin/form_helper.rb +30 -0
  116. data/app/helpers/alchemy/admin/navigation_helper.rb +34 -2
  117. data/app/helpers/alchemy/base_helper.rb +3 -3
  118. data/app/helpers/alchemy/elements_helper.rb +105 -142
  119. data/app/helpers/alchemy/essences_helper.rb +17 -53
  120. data/app/helpers/alchemy/pages_helper.rb +148 -177
  121. data/app/helpers/alchemy/url_helper.rb +5 -25
  122. data/app/models/alchemy/attachment.rb +39 -14
  123. data/app/models/alchemy/cell.rb +18 -4
  124. data/app/models/alchemy/content.rb +69 -79
  125. data/app/models/alchemy/content/factory.rb +2 -6
  126. data/app/models/alchemy/element.rb +94 -89
  127. data/app/models/alchemy/essence_boolean.rb +13 -2
  128. data/app/models/alchemy/essence_date.rb +15 -8
  129. data/app/models/alchemy/essence_file.rb +25 -1
  130. data/app/models/alchemy/essence_html.rb +13 -6
  131. data/app/models/alchemy/essence_link.rb +16 -7
  132. data/app/models/alchemy/essence_picture.rb +102 -21
  133. data/app/models/alchemy/essence_richtext.rb +15 -37
  134. data/app/models/alchemy/essence_select.rb +13 -2
  135. data/app/models/alchemy/essence_text.rb +17 -42
  136. data/app/models/alchemy/folded_page.rb +10 -0
  137. data/app/models/alchemy/language.rb +62 -48
  138. data/app/models/alchemy/legacy_page_url.rb +12 -2
  139. data/app/models/alchemy/message.rb +11 -43
  140. data/app/models/alchemy/page.rb +107 -88
  141. data/app/models/alchemy/page/{page_cells.rb → cells.rb} +2 -2
  142. data/app/models/alchemy/page/{page_elements.rb → elements.rb} +5 -6
  143. data/app/models/alchemy/page/{page_naming.rb → naming.rb} +6 -11
  144. data/app/models/alchemy/page/{page_natures.rb → natures.rb} +29 -5
  145. data/app/models/alchemy/page/{page_scopes.rb → scopes.rb} +14 -14
  146. data/app/models/alchemy/page/{page_users.rb → users.rb} +4 -4
  147. data/app/models/alchemy/picture.rb +113 -41
  148. data/app/models/alchemy/picture/sweeping.rb +17 -0
  149. data/app/models/alchemy/site.rb +14 -2
  150. data/app/models/alchemy/tag.rb +8 -0
  151. data/app/serializers/alchemy/attachment_serializer.rb +15 -0
  152. data/app/serializers/alchemy/cell_serializer.rb +18 -0
  153. data/app/serializers/alchemy/content_serializer.rb +27 -0
  154. data/app/serializers/alchemy/element_serializer.rb +17 -0
  155. data/app/serializers/alchemy/essence_boolean_serializer.rb +11 -0
  156. data/app/serializers/alchemy/essence_date_serializer.rb +11 -0
  157. data/app/serializers/alchemy/essence_file_serializer.rb +12 -0
  158. data/app/serializers/alchemy/essence_html_serializer.rb +11 -0
  159. data/app/serializers/alchemy/essence_link_serializer.rb +14 -0
  160. data/app/serializers/alchemy/essence_picture_serializer.rb +28 -0
  161. data/app/serializers/alchemy/essence_richtext_serializer.rb +12 -0
  162. data/app/serializers/alchemy/essence_select_serializer.rb +11 -0
  163. data/app/serializers/alchemy/essence_text_serializer.rb +22 -0
  164. data/app/serializers/alchemy/page_serializer.rb +29 -0
  165. data/app/serializers/alchemy/picture_serializer.rb +16 -0
  166. data/app/views/alchemy/_menubar.html.erb +16 -0
  167. data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +27 -29
  168. data/app/views/alchemy/admin/attachments/_attachment.html.erb +24 -24
  169. data/app/views/alchemy/admin/attachments/_file_to_assign.html.erb +1 -1
  170. data/app/views/alchemy/admin/attachments/_files_list.html.erb +1 -1
  171. data/app/views/alchemy/admin/attachments/_overlay_file_list.html.erb +2 -2
  172. data/app/views/alchemy/admin/attachments/archive_overlay.js.erb +7 -4
  173. data/app/views/alchemy/admin/attachments/create.js.erb +11 -9
  174. data/app/views/alchemy/admin/attachments/edit.html.erb +9 -26
  175. data/app/views/alchemy/admin/attachments/index.html.erb +4 -4
  176. data/app/views/alchemy/admin/attachments/new.html.erb +13 -10
  177. data/app/views/alchemy/admin/attachments/show.html.erb +1 -1
  178. data/app/views/alchemy/admin/clipboard/clear.js.erb +3 -7
  179. data/app/views/alchemy/admin/clipboard/index.html.erb +21 -22
  180. data/app/views/alchemy/admin/clipboard/insert.js.erb +19 -14
  181. data/app/views/alchemy/admin/contents/_missing.html.erb +10 -12
  182. data/app/views/alchemy/admin/contents/create.js.erb +32 -36
  183. data/app/views/alchemy/admin/contents/destroy.js.coffee +3 -3
  184. data/app/views/alchemy/admin/contents/new.html.erb +9 -21
  185. data/app/views/alchemy/admin/contents/order.js.erb +2 -5
  186. data/app/views/alchemy/admin/dashboard/help.html.erb +21 -0
  187. data/app/views/alchemy/admin/dashboard/index.html.erb +5 -7
  188. data/app/views/alchemy/admin/dashboard/info.html.erb +13 -9
  189. data/app/views/alchemy/admin/elements/_add_picture.html.erb +6 -6
  190. data/app/views/alchemy/admin/elements/_element.html.erb +4 -1
  191. data/app/views/alchemy/admin/elements/_element_head.html.erb +2 -2
  192. data/app/views/alchemy/admin/elements/_new_element_form.html.erb +20 -27
  193. data/app/views/alchemy/admin/elements/_picture_gallery_editor.html.erb +7 -7
  194. data/app/views/alchemy/admin/elements/_refresh_editor.js.erb +1 -1
  195. data/app/views/alchemy/admin/elements/create.js.erb +6 -6
  196. data/app/views/alchemy/admin/elements/fold.js.erb +10 -10
  197. data/app/views/alchemy/admin/elements/index.html.erb +24 -26
  198. data/app/views/alchemy/admin/elements/list.html.erb +16 -0
  199. data/app/views/alchemy/admin/elements/new.html.erb +12 -28
  200. data/app/views/alchemy/admin/elements/trash.js.erb +3 -3
  201. data/app/views/alchemy/admin/elements/update.js.erb +12 -8
  202. data/app/views/alchemy/admin/essence_files/assign.js.erb +9 -14
  203. data/app/views/alchemy/admin/essence_files/edit.html.erb +17 -27
  204. data/app/views/alchemy/admin/essence_pictures/assign.js.erb +18 -0
  205. data/app/views/alchemy/admin/essence_pictures/crop.html.erb +1 -1
  206. data/app/views/alchemy/admin/essence_pictures/destroy.js.erb +9 -13
  207. data/app/views/alchemy/admin/essence_pictures/edit.html.erb +27 -67
  208. data/app/views/alchemy/admin/essence_pictures/save_link.js.erb +1 -1
  209. data/app/views/alchemy/admin/essence_pictures/update.js.erb +3 -3
  210. data/app/views/alchemy/admin/languages/_form.html.erb +13 -55
  211. data/app/views/alchemy/admin/languages/_language.html.erb +10 -16
  212. data/app/views/alchemy/admin/languages/_table.html.erb +1 -1
  213. data/app/views/alchemy/admin/languages/index.html.erb +4 -4
  214. data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +25 -27
  215. data/app/views/alchemy/admin/layoutpages/index.html.erb +5 -5
  216. data/app/views/alchemy/admin/pages/_create_language_form.html.erb +25 -31
  217. data/app/views/alchemy/admin/pages/_external_link.html.erb +24 -35
  218. data/app/views/alchemy/admin/pages/_file_link.html.erb +31 -45
  219. data/app/views/alchemy/admin/pages/_internal_link.html.erb +36 -42
  220. data/app/views/alchemy/admin/pages/_new_page_form.html.erb +8 -26
  221. data/app/views/alchemy/admin/pages/_page.html.erb +76 -75
  222. data/app/views/alchemy/admin/pages/_page_for_links.html.erb +15 -16
  223. data/app/views/alchemy/admin/pages/configure.html.erb +56 -86
  224. data/app/views/alchemy/admin/pages/configure_external.html.erb +32 -39
  225. data/app/views/alchemy/admin/pages/destroy.js.erb +10 -10
  226. data/app/views/alchemy/admin/pages/edit.html.erb +57 -63
  227. data/app/views/alchemy/admin/pages/fold.js.erb +3 -5
  228. data/app/views/alchemy/admin/pages/index.html.erb +11 -13
  229. data/app/views/alchemy/admin/pages/info.html.erb +28 -31
  230. data/app/views/alchemy/admin/pages/link.html.erb +8 -19
  231. data/app/views/alchemy/admin/pages/new.html.erb +11 -35
  232. data/app/views/alchemy/admin/pages/show.html.erb +1 -1
  233. data/app/views/alchemy/admin/pages/sort.js.erb +5 -7
  234. data/app/views/alchemy/admin/pages/update.js.erb +19 -20
  235. data/app/views/alchemy/admin/partials/_autocomplete_tag_list.html.erb +1 -9
  236. data/app/views/alchemy/admin/partials/_language_tree_select.html.erb +8 -19
  237. data/app/views/alchemy/admin/partials/_main_navigation_entry.html.erb +1 -1
  238. data/app/views/alchemy/admin/partials/_sub_navigation.html.erb +1 -1
  239. data/app/views/alchemy/admin/partials/_toolbar_button.html.erb +3 -3
  240. data/app/views/alchemy/admin/partials/_upload_form.html.erb +37 -55
  241. data/app/views/alchemy/admin/pictures/_archive.html.erb +3 -3
  242. data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +11 -13
  243. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +1 -1
  244. data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +4 -2
  245. data/app/views/alchemy/admin/pictures/_picture.html.erb +37 -37
  246. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -1
  247. data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +8 -5
  248. data/app/views/alchemy/admin/pictures/edit.html.erb +8 -21
  249. data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +15 -33
  250. data/app/views/alchemy/admin/pictures/index.html.erb +9 -7
  251. data/app/views/alchemy/admin/pictures/index.js.erb +2 -2
  252. data/app/views/alchemy/admin/pictures/info.html.erb +35 -40
  253. data/app/views/alchemy/admin/pictures/new.html.erb +15 -11
  254. data/app/views/alchemy/admin/pictures/show.html.erb +5 -5
  255. data/app/views/alchemy/admin/resources/_form.html.erb +7 -31
  256. data/app/views/alchemy/admin/resources/_resource.html.erb +9 -16
  257. data/app/views/alchemy/admin/resources/_table.html.erb +1 -1
  258. data/app/views/alchemy/admin/resources/index.html.erb +5 -5
  259. data/app/views/alchemy/admin/sites/index.html.erb +3 -3
  260. data/app/views/alchemy/admin/tags/_tag.html.erb +15 -15
  261. data/app/views/alchemy/admin/tags/edit.html.erb +20 -37
  262. data/app/views/alchemy/admin/tags/index.html.erb +16 -19
  263. data/app/views/alchemy/admin/tags/new.html.erb +6 -15
  264. data/app/views/alchemy/admin/trash/clear.js.coffee +2 -2
  265. data/app/views/alchemy/admin/trash/index.html.erb +24 -20
  266. data/app/views/alchemy/base/500.html.erb +2 -2
  267. data/app/views/alchemy/base/error_notice.js.erb +1 -1
  268. data/app/views/alchemy/base/leave.html.erb +11 -11
  269. data/app/views/alchemy/base/permission_denied.js.erb +1 -1
  270. data/app/views/alchemy/base/redirect.js.erb +12 -1
  271. data/app/views/alchemy/base/update.js.erb +4 -4
  272. data/app/views/alchemy/breadcrumb/_spacer.html.erb +1 -1
  273. data/app/views/alchemy/elements/show.js.erb +1 -5
  274. data/app/views/alchemy/essences/_essence_boolean_editor.html.erb +1 -1
  275. data/app/views/alchemy/essences/_essence_boolean_view.html.erb +3 -1
  276. data/app/views/alchemy/essences/_essence_date_editor.html.erb +4 -3
  277. data/app/views/alchemy/essences/_essence_date_view.html.erb +9 -5
  278. data/app/views/alchemy/essences/_essence_file_editor.html.erb +33 -32
  279. data/app/views/alchemy/essences/_essence_file_view.html.erb +9 -7
  280. data/app/views/alchemy/essences/_essence_html_view.html.erb +3 -1
  281. data/app/views/alchemy/essences/_essence_link_editor.html.erb +2 -2
  282. data/app/views/alchemy/essences/_essence_link_view.html.erb +5 -1
  283. data/app/views/alchemy/essences/_essence_picture_editor.html.erb +11 -11
  284. data/app/views/alchemy/essences/_essence_picture_view.html.erb +3 -1
  285. data/app/views/alchemy/essences/_essence_richtext_editor.html.erb +1 -1
  286. data/app/views/alchemy/essences/_essence_richtext_view.html.erb +3 -4
  287. data/app/views/alchemy/essences/_essence_select_editor.html.erb +1 -1
  288. data/app/views/alchemy/essences/_essence_select_view.html.erb +3 -1
  289. data/app/views/alchemy/essences/_essence_text_editor.html.erb +14 -28
  290. data/app/views/alchemy/essences/_essence_text_view.html.erb +4 -0
  291. data/app/views/alchemy/essences/shared/_essence_picture_tools.html.erb +29 -29
  292. data/app/views/alchemy/essences/shared/_linkable_essence_tools.html.erb +9 -9
  293. data/app/views/alchemy/language_links/_language.html.erb +1 -1
  294. data/app/views/kaminari/{_first_page.html.erb → alchemy/_first_page.html.erb} +1 -1
  295. data/app/views/kaminari/{_gap.html.erb → alchemy/_gap.html.erb} +0 -0
  296. data/app/views/kaminari/{_last_page.html.erb → alchemy/_last_page.html.erb} +1 -1
  297. data/app/views/kaminari/{_next_page.html.erb → alchemy/_next_page.html.erb} +2 -2
  298. data/app/views/kaminari/{_page.html.erb → alchemy/_page.html.erb} +2 -2
  299. data/app/views/kaminari/{_paginator.html.erb → alchemy/_paginator.html.erb} +0 -0
  300. data/app/views/kaminari/{_prev_page.html.erb → alchemy/_prev_page.html.erb} +2 -2
  301. data/app/views/layouts/alchemy/admin.html.erb +17 -17
  302. data/bin/alchemy +179 -44
  303. data/bin/rails +8 -0
  304. data/config/alchemy/config.yml +24 -22
  305. data/config/alchemy/modules.yml +7 -1
  306. data/config/initializers/dragonfly.rb +20 -23
  307. data/config/initializers/simple_form.rb +144 -0
  308. data/config/locales/alchemy.de.yml +42 -33
  309. data/config/locales/alchemy.en.yml +32 -19
  310. data/config/locales/alchemy.nl.yml +937 -0
  311. data/config/locales/simple_form.de.yml +26 -0
  312. data/config/locales/simple_form.en.yml +25 -0
  313. data/config/locales/simple_form.nl.yml +25 -0
  314. data/config/routes.rb +9 -10
  315. data/db/migrate/20130827094554_alchemy_two_point_six.rb +261 -251
  316. data/db/migrate/20130828121054_remove_do_not_index_from_alchemy_essence_texts.rb +5 -0
  317. data/db/migrate/20130828121120_remove_do_not_index_from_alchemy_essence_richtexts.rb +5 -0
  318. data/db/migrate/20130918201742_add_published_at_to_alchemy_pages.rb +5 -0
  319. data/db/migrate/20140107192720_add_missing_unique_indices_to_tags_and_taggings.rb +21 -0
  320. data/lib/alchemy/auth_accessors.rb +23 -2
  321. data/lib/alchemy/cache_digests/template_tracker.rb +65 -0
  322. data/lib/alchemy/capistrano.rb +28 -38
  323. data/lib/alchemy/controller_actions.rb +130 -0
  324. data/lib/alchemy/engine.rb +54 -47
  325. data/lib/alchemy/essence.rb +83 -63
  326. data/lib/alchemy/forms/builder.rb +23 -0
  327. data/lib/alchemy/hints.rb +57 -0
  328. data/lib/alchemy/locale.rb +63 -0
  329. data/lib/alchemy/modules.rb +17 -17
  330. data/lib/alchemy/mount_point.rb +1 -1
  331. data/lib/alchemy/permissions.rb +199 -0
  332. data/lib/alchemy/picture_attributes.rb +1 -1
  333. data/lib/alchemy/resource.rb +13 -17
  334. data/lib/alchemy/resources_helper.rb +16 -18
  335. data/lib/alchemy/seeder.rb +8 -10
  336. data/lib/alchemy/shell.rb +8 -6
  337. data/lib/alchemy/tasks/helpers.rb +6 -4
  338. data/lib/alchemy/test_support/auth_helpers.rb +3 -3
  339. data/lib/alchemy/test_support/controller_requests.rb +1 -1
  340. data/lib/alchemy/test_support/essence_shared_examples.rb +141 -0
  341. data/lib/alchemy/test_support/factories.rb +27 -9
  342. data/lib/alchemy/test_support/integration_helpers.rb +1 -27
  343. data/lib/alchemy/tinymce.rb +12 -32
  344. data/lib/alchemy/touching.rb +41 -0
  345. data/lib/alchemy/upgrader.rb +17 -12
  346. data/lib/alchemy/upgrader/three_point_zero.rb +62 -0
  347. data/lib/alchemy/version.rb +2 -1
  348. data/lib/alchemy_cms.rb +1 -7
  349. data/lib/rails/generators/alchemy/elements/elements_generator.rb +3 -2
  350. data/lib/rails/generators/alchemy/elements/templates/editor.html.erb +0 -2
  351. data/lib/rails/generators/alchemy/elements/templates/editor.html.haml +2 -3
  352. data/lib/rails/generators/alchemy/elements/templates/editor.html.slim +0 -2
  353. data/lib/rails/generators/alchemy/elements/templates/view.html.erb +23 -23
  354. data/lib/rails/generators/alchemy/elements/templates/view.html.haml +16 -17
  355. data/lib/rails/generators/alchemy/elements/templates/view.html.slim +16 -17
  356. data/lib/rails/generators/alchemy/essence/templates/editor.html.erb +1 -1
  357. data/lib/rails/generators/alchemy/scaffold/files/_article_editor.html.erb +5 -0
  358. data/lib/rails/generators/alchemy/scaffold/files/_article_view.html.erb +7 -0
  359. data/lib/rails/generators/alchemy/scaffold/files/alchemy.de.yml +31 -0
  360. data/lib/rails/generators/alchemy/scaffold/files/alchemy.elements.css.scss +30 -0
  361. data/lib/rails/generators/alchemy/scaffold/files/alchemy.en.yml +31 -0
  362. data/lib/rails/generators/alchemy/scaffold/files/application.html.erb +4 -2
  363. data/lib/rails/generators/alchemy/scaffold/files/elements.yml +16 -0
  364. data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +16 -7
  365. data/lib/rails/generators/alchemy/scaffold/templates/page_layouts.yml.tt +3 -2
  366. data/lib/rails/templates/alchemy.rb +3 -6
  367. data/lib/tasks/alchemy/install.rake +29 -38
  368. data/lib/tasks/alchemy/tidy.rake +1 -1
  369. data/spec/controllers/admin/attachments_controller_spec.rb +101 -35
  370. data/spec/controllers/admin/clipboard_controller_spec.rb +16 -18
  371. data/spec/controllers/admin/contents_controller_spec.rb +34 -27
  372. data/spec/controllers/admin/dashboard_controller_spec.rb +2 -4
  373. data/spec/controllers/admin/elements_controller_spec.rb +288 -160
  374. data/spec/controllers/admin/essence_files_controller_spec.rb +11 -18
  375. data/spec/controllers/admin/essence_pictures_controller_spec.rb +15 -24
  376. data/spec/controllers/admin/languages_controller_spec.rb +11 -4
  377. data/spec/controllers/admin/layoutpages_controller_spec.rb +1 -2
  378. data/spec/controllers/admin/pages_controller_spec.rb +137 -167
  379. data/spec/controllers/admin/pictures_controller_spec.rb +286 -14
  380. data/spec/controllers/admin/resources_controller_spec.rb +4 -1
  381. data/spec/controllers/alchemy/admin/tags_controller_spec.rb +63 -0
  382. data/spec/controllers/attachments_controller_spec.rb +3 -3
  383. data/spec/controllers/base_controller_spec.rb +12 -104
  384. data/spec/controllers/elements_controller_spec.rb +2 -5
  385. data/spec/controllers/messages_controller_spec.rb +49 -51
  386. data/spec/controllers/pages_controller_spec.rb +91 -111
  387. data/spec/controllers/pictures_controller_spec.rb +126 -72
  388. data/spec/dummy/Rakefile +0 -1
  389. data/spec/dummy/app/assets/javascripts/application.js +11 -7
  390. data/spec/dummy/app/assets/stylesheets/application.css +11 -5
  391. data/spec/dummy/app/models/ability.rb +9 -0
  392. data/spec/dummy/app/models/dummy_user.rb +7 -0
  393. data/spec/dummy/app/models/event.rb +7 -2
  394. data/spec/dummy/app/models/location.rb +0 -1
  395. data/spec/dummy/app/views/alchemy/elements/_article_editor.html.erb +0 -1
  396. data/spec/dummy/app/views/alchemy/elements/_headline_editor.html.erb +1 -0
  397. data/spec/dummy/app/views/layouts/application.html.erb +3 -1
  398. data/spec/dummy/bin/bundle +3 -0
  399. data/spec/dummy/bin/rails +4 -0
  400. data/spec/dummy/bin/rake +4 -0
  401. data/spec/dummy/config.ru +2 -2
  402. data/spec/dummy/config/alchemy/elements.yml +0 -3
  403. data/spec/dummy/config/alchemy/page_layouts.yml +0 -6
  404. data/spec/dummy/config/application.rb +5 -57
  405. data/spec/dummy/config/boot.rb +4 -9
  406. data/spec/dummy/config/environment.rb +2 -2
  407. data/spec/dummy/config/environments/development.rb +11 -19
  408. data/spec/dummy/config/environments/production.rb +40 -27
  409. data/spec/dummy/config/environments/test.rb +15 -14
  410. data/spec/dummy/config/initializers/alchemy.rb +2 -0
  411. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  412. data/spec/dummy/config/initializers/inflections.rb +9 -3
  413. data/spec/dummy/config/initializers/secret_token.rb +7 -2
  414. data/spec/dummy/config/initializers/session_store.rb +1 -6
  415. data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
  416. data/spec/dummy/config/routes.rb +3 -1
  417. data/spec/dummy/db/migrate/20130827094554_alchemy_two_point_six.rb +261 -251
  418. data/spec/dummy/db/migrate/20130828121054_remove_do_not_index_from_alchemy_essence_texts.rb +5 -0
  419. data/spec/dummy/db/migrate/20130828121120_remove_do_not_index_from_alchemy_essence_richtexts.rb +5 -0
  420. data/spec/dummy/db/migrate/20130918201742_add_published_at_to_alchemy_pages.rb +5 -0
  421. data/spec/dummy/db/migrate/20131209225243_create_dummy_users.rb +9 -0
  422. data/spec/dummy/db/migrate/20140107192720_add_missing_unique_indices_to_tags_and_taggings.rb +21 -0
  423. data/spec/dummy/db/schema.rb +112 -105
  424. data/spec/dummy/public/404.html +46 -26
  425. data/spec/dummy/public/422.html +46 -26
  426. data/spec/dummy/public/500.html +45 -26
  427. data/spec/features/admin/language_tree_feature_spec.rb +2 -2
  428. data/spec/features/admin/modules_integration_spec.rb +7 -13
  429. data/spec/features/admin/page_creation_feature_spec.rb +50 -0
  430. data/spec/features/admin/page_editing_feature_spec.rb +16 -0
  431. data/spec/features/admin/picture_library_integration_spec.rb +4 -4
  432. data/spec/features/admin/resources_integration_spec.rb +11 -11
  433. data/spec/features/page_feature_spec.rb +225 -0
  434. data/spec/features/translation_integration_spec.rb +7 -7
  435. data/spec/fixtures/500x500.png +0 -0
  436. data/spec/helpers/admin/attachments_helper_spec.rb +15 -0
  437. data/spec/helpers/admin/base_helper_spec.rb +88 -13
  438. data/spec/helpers/admin/contents_helper_spec.rb +53 -12
  439. data/spec/helpers/admin/elements_helper_spec.rb +24 -36
  440. data/spec/helpers/admin/essences_helper_spec.rb +48 -10
  441. data/spec/helpers/admin/navigation_helper_spec.rb +64 -29
  442. data/spec/helpers/admin/pages_helper_spec.rb +22 -1
  443. data/spec/helpers/admin/pictures_helper_spec.rb +29 -0
  444. data/spec/helpers/admin/tags_helper_spec.rb +1 -1
  445. data/spec/helpers/base_helper_spec.rb +6 -13
  446. data/spec/helpers/elements_block_helper_spec.rb +3 -3
  447. data/spec/helpers/elements_helper_spec.rb +203 -167
  448. data/spec/helpers/essences_helper_spec.rb +69 -15
  449. data/spec/helpers/pages_helper_spec.rb +28 -66
  450. data/spec/helpers/url_helper_spec.rb +41 -73
  451. data/spec/javascripts/alchemy/dialog_spec.coffee +82 -0
  452. data/spec/javascripts/alchemy/link_overlay_spec.coffee +25 -0
  453. data/spec/javascripts/alchemy_integration_spec.coffee +3 -12
  454. data/spec/javascripts/helpers/mock-ajax.js +52 -60
  455. data/spec/javascripts/support/jasmine.yml +29 -0
  456. data/spec/libraries/auth_accessors_spec.rb +24 -0
  457. data/spec/libraries/config_spec.rb +3 -3
  458. data/spec/libraries/controller_actions_spec.rb +133 -0
  459. data/spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb +30 -0
  460. data/spec/libraries/modules_spec.rb +17 -0
  461. data/spec/libraries/mount_point_spec.rb +7 -7
  462. data/spec/libraries/page_layout_spec.rb +1 -1
  463. data/spec/libraries/permissions_spec.rb +219 -0
  464. data/spec/libraries/resource_spec.rb +61 -68
  465. data/spec/libraries/resources_helper_spec.rb +51 -51
  466. data/spec/libraries/shell_spec.rb +7 -8
  467. data/spec/libraries/template_tracker_spec.rb +94 -0
  468. data/spec/libraries/tinymce_spec.rb +0 -12
  469. data/spec/libraries/userstamp_spec.rb +10 -0
  470. data/spec/models/attachment_spec.rb +51 -18
  471. data/spec/models/cell_spec.rb +5 -5
  472. data/spec/models/content_spec.rb +103 -15
  473. data/spec/models/element_spec.rb +82 -18
  474. data/spec/models/essence_boolean_spec.rb +3 -8
  475. data/spec/models/essence_date_spec.rb +11 -7
  476. data/spec/models/essence_file_spec.rb +24 -4
  477. data/spec/models/essence_html_spec.rb +8 -3
  478. data/spec/models/essence_link_spec.rb +10 -0
  479. data/spec/models/essence_picture_spec.rb +109 -0
  480. data/spec/models/essence_richtext_spec.rb +6 -35
  481. data/spec/models/essence_select_spec.rb +3 -8
  482. data/spec/models/essence_text_spec.rb +83 -39
  483. data/spec/models/language_spec.rb +20 -54
  484. data/spec/models/message_spec.rb +12 -7
  485. data/spec/models/page_spec.rb +192 -185
  486. data/spec/models/picture_spec.rb +200 -45
  487. data/spec/models/resource_spec.rb +4 -24
  488. data/spec/models/site_spec.rb +69 -3
  489. data/spec/models/tag_spec.rb +6 -6
  490. data/spec/routing/routing_spec.rb +0 -32
  491. data/spec/spec_helper.rb +29 -38
  492. data/spec/support/hint_examples.rb +30 -0
  493. data/spec/support/phantomjs_mavericks_fix.rb +32 -0
  494. data/spec/support/test_tweaks.rb +31 -0
  495. data/spec/views/essences/essence_boolean_view_spec.rb +25 -0
  496. data/spec/views/essences/essence_date_view_spec.rb +39 -0
  497. data/spec/views/essences/essence_file_view_spec.rb +24 -0
  498. data/spec/views/essences/essence_html_view_spec.rb +22 -0
  499. data/spec/views/essences/essence_link_view_spec.rb +30 -0
  500. data/spec/views/essences/essence_picture_view_spec.rb +1 -1
  501. data/spec/views/essences/essence_richtext_view_spec.rb +20 -0
  502. data/spec/views/essences/essence_select_view_spec.rb +12 -0
  503. data/spec/views/essences/essence_text_view_spec.rb +40 -0
  504. data/vendor/assets/javascripts/fileupload/jquery.fileupload-process.js +172 -0
  505. data/vendor/assets/javascripts/fileupload/jquery.fileupload-validate.js +120 -0
  506. data/vendor/assets/javascripts/fileupload/jquery.fileupload.js +1416 -0
  507. data/vendor/assets/javascripts/fileupload/jquery.iframe-transport.js +210 -0
  508. data/vendor/assets/javascripts/jquery_plugins/jquery.ui.nestedSortable.js +381 -352
  509. data/vendor/assets/javascripts/jquery_plugins/jquery.ui.tabspaging.js +1 -52
  510. data/vendor/assets/javascripts/keymaster.js +296 -0
  511. data/vendor/assets/javascripts/requestAnimationFrame.js +31 -0
  512. data/vendor/assets/javascripts/tinymce/langs/de.js +179 -0
  513. data/vendor/assets/javascripts/tinymce/langs/nl.js +179 -0
  514. data/vendor/assets/javascripts/{tiny_mce → tinymce}/license.txt +504 -504
  515. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.min.js +1 -0
  516. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.min.js +1 -0
  517. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.min.js +1 -0
  518. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.min.js +1 -0
  519. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.min.js +1 -0
  520. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.min.js +1 -0
  521. data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.min.js +1 -0
  522. data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.min.js +1 -0
  523. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.min.js +1 -0
  524. data/vendor/assets/javascripts/tinymce/themes/modern/theme.min.js +1 -0
  525. data/vendor/assets/javascripts/tinymce/tinymce.min.js +10 -0
  526. metadata +351 -332
  527. data/.simplecov +0 -14
  528. data/app/assets/images/alchemy/alchemy-logo.png +0 -0
  529. data/app/assets/images/alchemy/swfupload/browse_button.png +0 -0
  530. data/app/assets/javascripts/alchemy/alchemy.file_progress.js +0 -102
  531. data/app/assets/javascripts/alchemy/alchemy.link_overlay.js.coffee +0 -227
  532. data/app/assets/javascripts/alchemy/alchemy.menubar.js +0 -62
  533. data/app/assets/javascripts/alchemy/alchemy.swf_upload.js +0 -212
  534. data/app/assets/javascripts/alchemy/alchemy.uploader.js +0 -274
  535. data/app/assets/javascripts/alchemy/menubar.js +0 -2
  536. data/app/assets/javascripts/tiny_mce/plugins/alchemy_link/editor_plugin.js +0 -42
  537. data/app/assets/javascripts/tiny_mce/plugins/alchemy_link/langs/de.js +0 -4
  538. data/app/assets/javascripts/tiny_mce/plugins/alchemy_link/langs/en.js +0 -4
  539. data/app/assets/stylesheets/alchemy/form_elements.scss +0 -538
  540. data/app/assets/stylesheets/alchemy/login.scss +0 -55
  541. data/app/assets/stylesheets/alchemy/tinymce_content.css.scss +0 -98
  542. data/app/assets/stylesheets/alchemy/tinymce_dialog.css.scss +0 -420
  543. data/app/assets/stylesheets/tiny_mce/plugins/inlinepopups/skins/alchemy-tinymce-dialog/window.css.scss +0 -434
  544. data/app/controllers/alchemy/admin/users_controller.rb +0 -76
  545. data/app/models/alchemy/tree_node.rb +0 -4
  546. data/app/sweepers/alchemy/content_sweeper.rb +0 -41
  547. data/app/sweepers/alchemy/pages_sweeper.rb +0 -44
  548. data/app/sweepers/alchemy/pictures_sweeper.rb +0 -21
  549. data/app/views/alchemy/admin/elements/_elements_select.html.erb +0 -9
  550. data/app/views/alchemy/admin/elements/list.js.erb +0 -22
  551. data/app/views/alchemy/admin/essence_pictures/assign.js.coffee +0 -15
  552. data/app/views/alchemy/admin/pages/_contactform_links.html.erb +0 -62
  553. data/app/views/alchemy/admin/partials/_flash_upload.html.erb +0 -37
  554. data/app/views/alchemy/admin/partials/_pagination_links.html.erb +0 -1
  555. data/app/views/alchemy/admin/pictures/create.js.erb +0 -3
  556. data/app/views/alchemy/admin/resources/_boolean.html.erb +0 -5
  557. data/app/views/alchemy/admin/resources/_date.html.erb +0 -8
  558. data/app/views/alchemy/admin/resources/_datetime.html.erb +0 -1
  559. data/app/views/alchemy/admin/resources/_string.html.erb +0 -5
  560. data/app/views/alchemy/admin/resources/_text.html.erb +0 -5
  561. data/app/views/alchemy/admin/resources/destroy.js.erb +0 -1
  562. data/app/views/alchemy/base/remote_errors.js.erb +0 -6
  563. data/app/views/alchemy/search/_form.html.erb +0 -11
  564. data/app/views/alchemy/search/_result.html.erb +0 -7
  565. data/app/views/alchemy/search/_results.html.erb +0 -27
  566. data/config/authorization_rules.rb +0 -110
  567. data/config/initializers/cache_storage.rb +0 -1
  568. data/lib/alchemy/auth/engine.rb +0 -9
  569. data/lib/alchemy/ferret/search.rb +0 -86
  570. data/lib/alchemy/language_helpers.rb +0 -55
  571. data/lib/alchemy/upgrader/two_point_five.rb +0 -86
  572. data/lib/alchemy/upgrader/two_point_four.rb +0 -25
  573. data/lib/alchemy/upgrader/two_point_nine.rb +0 -33
  574. data/lib/alchemy/upgrader/two_point_one.rb +0 -95
  575. data/lib/alchemy/upgrader/two_point_six.rb +0 -32
  576. data/lib/alchemy/upgrader/two_point_three.rb +0 -25
  577. data/lib/alchemy/upgrader/two_point_two.rb +0 -114
  578. data/lib/alchemy/upgrader/two_point_zero.rb +0 -13
  579. data/lib/middleware/flash_session_cookie.rb +0 -22
  580. data/lib/rails/generators/alchemy/gallery_pictures_migration/gallery_pictures_migration_generator.rb +0 -40
  581. data/lib/tasks/ferret.rake +0 -10
  582. data/script/rails +0 -6
  583. data/spec/dummy/app/models/user.rb +0 -14
  584. data/spec/dummy/app/views/alchemy/elements/_searchresult_view.html.erb +0 -4
  585. data/spec/dummy/config/authorization_rules.rb +0 -7
  586. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  587. data/spec/dummy/script/rails +0 -6
  588. data/spec/fast_specs.rb +0 -15
  589. data/spec/features/admin/element_create_feature_spec.rb +0 -18
  590. data/spec/features/admin/element_trash_feature_spec.rb +0 -21
  591. data/spec/features/admin/pages_controller_spec.rb +0 -59
  592. data/spec/features/pages_controller_spec.rb +0 -262
  593. data/spec/javascripts/alchemy/link_overlay_spec.js.coffee +0 -42
  594. data/spec/javascripts/helpers/.gitkeep +0 -0
  595. data/spec/javascripts/helpers/jasmine-jquery-1.3.1.js +0 -289
  596. data/spec/javascripts/spec.css +0 -3
  597. data/spec/javascripts/spec.js +0 -2
  598. data/spec/libraries/essence_spec.rb +0 -76
  599. data/spec/support/alchemy/controller_hacks.rb +0 -41
  600. data/vendor/assets/javascripts/jquery_plugins/jquery.dialogextend.js +0 -684
  601. data/vendor/assets/javascripts/jquery_plugins/jquery.html5uploader.js +0 -271
  602. data/vendor/assets/javascripts/jquery_plugins/jquery.selectboxit.min.js +0 -11
  603. data/vendor/assets/javascripts/jquery_plugins/preloadCssImages.jQuery_v5.js +0 -152
  604. data/vendor/assets/javascripts/keymage.min.js +0 -6
  605. data/vendor/assets/javascripts/swfupload/SWFObject License.txt +0 -4
  606. data/vendor/assets/javascripts/swfupload/swfupload.cookies.js +0 -53
  607. data/vendor/assets/javascripts/swfupload/swfupload.js +0 -980
  608. data/vendor/assets/javascripts/swfupload/swfupload.queue.js +0 -98
  609. data/vendor/assets/javascripts/swfupload/swfupload.speed.js +0 -342
  610. data/vendor/assets/javascripts/swfupload/swfupload.swf +0 -0
  611. data/vendor/assets/javascripts/swfupload/swfupload.swfobject.js +0 -715
  612. data/vendor/assets/javascripts/tiny_mce/langs/de.js +0 -1
  613. data/vendor/assets/javascripts/tiny_mce/langs/en.js +0 -1
  614. data/vendor/assets/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js +0 -1
  615. data/vendor/assets/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js +0 -1
  616. data/vendor/assets/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm +0 -110
  617. data/vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js +0 -1
  618. data/vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/template.htm +0 -387
  619. data/vendor/assets/javascripts/tiny_mce/plugins/paste/editor_plugin.js +0 -1
  620. data/vendor/assets/javascripts/tiny_mce/plugins/paste/js/pastetext.js +0 -36
  621. data/vendor/assets/javascripts/tiny_mce/plugins/paste/js/pasteword.js +0 -51
  622. data/vendor/assets/javascripts/tiny_mce/plugins/paste/langs/de_dlg.js +0 -1
  623. data/vendor/assets/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js +0 -1
  624. data/vendor/assets/javascripts/tiny_mce/plugins/paste/pastetext.htm +0 -27
  625. data/vendor/assets/javascripts/tiny_mce/plugins/paste/pasteword.htm +0 -21
  626. data/vendor/assets/javascripts/tiny_mce/plugins/table/cell.htm +0 -180
  627. data/vendor/assets/javascripts/tiny_mce/plugins/table/css/cell.css +0 -17
  628. data/vendor/assets/javascripts/tiny_mce/plugins/table/css/row.css +0 -25
  629. data/vendor/assets/javascripts/tiny_mce/plugins/table/css/table.css +0 -13
  630. data/vendor/assets/javascripts/tiny_mce/plugins/table/editor_plugin.js +0 -1
  631. data/vendor/assets/javascripts/tiny_mce/plugins/table/js/cell.js +0 -319
  632. data/vendor/assets/javascripts/tiny_mce/plugins/table/js/merge_cells.js +0 -27
  633. data/vendor/assets/javascripts/tiny_mce/plugins/table/js/row.js +0 -254
  634. data/vendor/assets/javascripts/tiny_mce/plugins/table/js/table.js +0 -501
  635. data/vendor/assets/javascripts/tiny_mce/plugins/table/langs/de_dlg.js +0 -1
  636. data/vendor/assets/javascripts/tiny_mce/plugins/table/langs/en_dlg.js +0 -1
  637. data/vendor/assets/javascripts/tiny_mce/plugins/table/merge_cells.htm +0 -32
  638. data/vendor/assets/javascripts/tiny_mce/plugins/table/row.htm +0 -158
  639. data/vendor/assets/javascripts/tiny_mce/plugins/table/table.htm +0 -188
  640. data/vendor/assets/javascripts/tiny_mce/themes/advanced/about.htm +0 -52
  641. data/vendor/assets/javascripts/tiny_mce/themes/advanced/anchor.htm +0 -26
  642. data/vendor/assets/javascripts/tiny_mce/themes/advanced/charmap.htm +0 -55
  643. data/vendor/assets/javascripts/tiny_mce/themes/advanced/color_picker.htm +0 -70
  644. data/vendor/assets/javascripts/tiny_mce/themes/advanced/editor_template.js +0 -1
  645. data/vendor/assets/javascripts/tiny_mce/themes/advanced/image.htm +0 -80
  646. data/vendor/assets/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
  647. data/vendor/assets/javascripts/tiny_mce/themes/advanced/img/flash.gif +0 -0
  648. data/vendor/assets/javascripts/tiny_mce/themes/advanced/img/icons.gif +0 -0
  649. data/vendor/assets/javascripts/tiny_mce/themes/advanced/img/iframe.gif +0 -0
  650. data/vendor/assets/javascripts/tiny_mce/themes/advanced/img/pagebreak.gif +0 -0
  651. data/vendor/assets/javascripts/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
  652. data/vendor/assets/javascripts/tiny_mce/themes/advanced/img/realmedia.gif +0 -0
  653. data/vendor/assets/javascripts/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
  654. data/vendor/assets/javascripts/tiny_mce/themes/advanced/img/video.gif +0 -0
  655. data/vendor/assets/javascripts/tiny_mce/themes/advanced/img/windowsmedia.gif +0 -0
  656. data/vendor/assets/javascripts/tiny_mce/themes/advanced/js/about.js +0 -73
  657. data/vendor/assets/javascripts/tiny_mce/themes/advanced/js/anchor.js +0 -56
  658. data/vendor/assets/javascripts/tiny_mce/themes/advanced/js/charmap.js +0 -363
  659. data/vendor/assets/javascripts/tiny_mce/themes/advanced/js/color_picker.js +0 -345
  660. data/vendor/assets/javascripts/tiny_mce/themes/advanced/js/image.js +0 -253
  661. data/vendor/assets/javascripts/tiny_mce/themes/advanced/js/link.js +0 -159
  662. data/vendor/assets/javascripts/tiny_mce/themes/advanced/js/source_editor.js +0 -78
  663. data/vendor/assets/javascripts/tiny_mce/themes/advanced/langs/de.js +0 -1
  664. data/vendor/assets/javascripts/tiny_mce/themes/advanced/langs/de_dlg.js +0 -1
  665. data/vendor/assets/javascripts/tiny_mce/themes/advanced/langs/en.js +0 -1
  666. data/vendor/assets/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js +0 -1
  667. data/vendor/assets/javascripts/tiny_mce/themes/advanced/link.htm +0 -57
  668. data/vendor/assets/javascripts/tiny_mce/themes/advanced/shortcuts.htm +0 -47
  669. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/content.css +0 -50
  670. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css +0 -118
  671. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
  672. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
  673. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  674. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  675. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
  676. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
  677. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/default/ui.css +0 -219
  678. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/highcontrast/content.css +0 -24
  679. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +0 -106
  680. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css +0 -106
  681. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css +0 -48
  682. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css +0 -118
  683. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  684. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  685. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  686. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css +0 -222
  687. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +0 -8
  688. data/vendor/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +0 -5
  689. data/vendor/assets/javascripts/tiny_mce/themes/advanced/source_editor.htm +0 -25
  690. data/vendor/assets/javascripts/tiny_mce/tiny_mce.js +0 -1
  691. data/vendor/assets/javascripts/tiny_mce/tiny_mce_popup.js +0 -5
  692. data/vendor/assets/javascripts/tiny_mce/utils/editable_selects.js +0 -70
  693. data/vendor/assets/javascripts/tiny_mce/utils/form_utils.js +0 -210
  694. data/vendor/assets/javascripts/tiny_mce/utils/mctabs.js +0 -162
  695. data/vendor/assets/javascripts/tiny_mce/utils/validate.js +0 -252
@@ -1,980 +0,0 @@
1
- /**
2
- * SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com
3
- *
4
- * mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/
5
- *
6
- * SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilzén and Mammon Media and is released under the MIT License:
7
- * http://www.opensource.org/licenses/mit-license.php
8
- *
9
- * SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License:
10
- * http://www.opensource.org/licenses/mit-license.php
11
- *
12
- */
13
-
14
-
15
- /* ******************* */
16
- /* Constructor & Init */
17
- /* ******************* */
18
- var SWFUpload;
19
-
20
- if (SWFUpload == undefined) {
21
- SWFUpload = function (settings) {
22
- this.initSWFUpload(settings);
23
- };
24
- }
25
-
26
- SWFUpload.prototype.initSWFUpload = function (settings) {
27
- try {
28
- this.customSettings = {}; // A container where developers can place their own settings associated with this instance.
29
- this.settings = settings;
30
- this.eventQueue = [];
31
- this.movieName = "SWFUpload_" + SWFUpload.movieCount++;
32
- this.movieElement = null;
33
-
34
-
35
- // Setup global control tracking
36
- SWFUpload.instances[this.movieName] = this;
37
-
38
- // Load the settings. Load the Flash movie.
39
- this.initSettings();
40
- this.loadFlash();
41
- this.displayDebugInfo();
42
- } catch (ex) {
43
- delete SWFUpload.instances[this.movieName];
44
- throw ex;
45
- }
46
- };
47
-
48
- /* *************** */
49
- /* Static Members */
50
- /* *************** */
51
- SWFUpload.instances = {};
52
- SWFUpload.movieCount = 0;
53
- SWFUpload.version = "2.2.0 2009-03-25";
54
- SWFUpload.QUEUE_ERROR = {
55
- QUEUE_LIMIT_EXCEEDED:-100,
56
- FILE_EXCEEDS_SIZE_LIMIT:-110,
57
- ZERO_BYTE_FILE:-120,
58
- INVALID_FILETYPE:-130
59
- };
60
- SWFUpload.UPLOAD_ERROR = {
61
- HTTP_ERROR:-200,
62
- MISSING_UPLOAD_URL:-210,
63
- IO_ERROR:-220,
64
- SECURITY_ERROR:-230,
65
- UPLOAD_LIMIT_EXCEEDED:-240,
66
- UPLOAD_FAILED:-250,
67
- SPECIFIED_FILE_ID_NOT_FOUND:-260,
68
- FILE_VALIDATION_FAILED:-270,
69
- FILE_CANCELLED:-280,
70
- UPLOAD_STOPPED:-290
71
- };
72
- SWFUpload.FILE_STATUS = {
73
- QUEUED:-1,
74
- IN_PROGRESS:-2,
75
- ERROR:-3,
76
- COMPLETE:-4,
77
- CANCELLED:-5
78
- };
79
- SWFUpload.BUTTON_ACTION = {
80
- SELECT_FILE:-100,
81
- SELECT_FILES:-110,
82
- START_UPLOAD:-120
83
- };
84
- SWFUpload.CURSOR = {
85
- ARROW:-1,
86
- HAND:-2
87
- };
88
- SWFUpload.WINDOW_MODE = {
89
- WINDOW:"window",
90
- TRANSPARENT:"transparent",
91
- OPAQUE:"opaque"
92
- };
93
-
94
- // Private: takes a URL, determines if it is relative and converts to an absolute URL
95
- // using the current site. Only processes the URL if it can, otherwise returns the URL untouched
96
- SWFUpload.completeURL = function (url) {
97
- if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//)) {
98
- return url;
99
- }
100
-
101
- var currentURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
102
-
103
- var indexSlash = window.location.pathname.lastIndexOf("/");
104
- if (indexSlash <= 0) {
105
- path = "/";
106
- } else {
107
- path = window.location.pathname.substr(0, indexSlash) + "/";
108
- }
109
-
110
- return /*currentURL +*/ path + url;
111
-
112
- };
113
-
114
-
115
- /* ******************** */
116
- /* Instance Members */
117
- /* ******************** */
118
-
119
- // Private: initSettings ensures that all the
120
- // settings are set, getting a default value if one was not assigned.
121
- SWFUpload.prototype.initSettings = function () {
122
- this.ensureDefault = function (settingName, defaultValue) {
123
- this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];
124
- };
125
-
126
- // Upload backend settings
127
- this.ensureDefault("upload_url", "");
128
- this.ensureDefault("preserve_relative_urls", false);
129
- this.ensureDefault("file_post_name", "Filedata");
130
- this.ensureDefault("post_params", {});
131
- this.ensureDefault("use_query_string", false);
132
- this.ensureDefault("requeue_on_error", false);
133
- this.ensureDefault("http_success", []);
134
- this.ensureDefault("assume_success_timeout", 0);
135
-
136
- // File Settings
137
- this.ensureDefault("file_types", "*.*");
138
- this.ensureDefault("file_types_description", "All Files");
139
- this.ensureDefault("file_size_limit", 0); // Default zero means "unlimited"
140
- this.ensureDefault("file_upload_limit", 0);
141
- this.ensureDefault("file_queue_limit", 0);
142
-
143
- // Flash Settings
144
- this.ensureDefault("flash_url", "swfupload.swf");
145
- this.ensureDefault("prevent_swf_caching", true);
146
-
147
- // Button Settings
148
- this.ensureDefault("button_image_url", "");
149
- this.ensureDefault("button_width", 1);
150
- this.ensureDefault("button_height", 1);
151
- this.ensureDefault("button_text", "");
152
- this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;");
153
- this.ensureDefault("button_text_top_padding", 0);
154
- this.ensureDefault("button_text_left_padding", 0);
155
- this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES);
156
- this.ensureDefault("button_disabled", false);
157
- this.ensureDefault("button_placeholder_id", "");
158
- this.ensureDefault("button_placeholder", null);
159
- this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW);
160
- this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW);
161
-
162
- // Debug Settings
163
- this.ensureDefault("debug", false);
164
- this.settings.debug_enabled = this.settings.debug; // Here to maintain v2 API
165
-
166
- // Event Handlers
167
- this.settings.return_upload_start_handler = this.returnUploadStart;
168
- this.ensureDefault("swfupload_loaded_handler", null);
169
- this.ensureDefault("file_dialog_start_handler", null);
170
- this.ensureDefault("file_queued_handler", null);
171
- this.ensureDefault("file_queue_error_handler", null);
172
- this.ensureDefault("file_dialog_complete_handler", null);
173
-
174
- this.ensureDefault("upload_start_handler", null);
175
- this.ensureDefault("upload_progress_handler", null);
176
- this.ensureDefault("upload_error_handler", null);
177
- this.ensureDefault("upload_success_handler", null);
178
- this.ensureDefault("upload_complete_handler", null);
179
-
180
- this.ensureDefault("debug_handler", this.debugMessage);
181
-
182
- this.ensureDefault("custom_settings", {});
183
-
184
- // Other settings
185
- this.customSettings = this.settings.custom_settings;
186
-
187
- // Update the flash url if needed
188
- if (!!this.settings.prevent_swf_caching) {
189
- this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime();
190
- }
191
-
192
- if (!this.settings.preserve_relative_urls) {
193
- //this.settings.flash_url = SWFUpload.completeURL(this.settings.flash_url); // Don't need to do this one since flash doesn't look at it
194
- this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);
195
- this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url);
196
- }
197
-
198
- delete this.ensureDefault;
199
- };
200
-
201
- // Private: loadFlash replaces the button_placeholder element with the flash movie.
202
- SWFUpload.prototype.loadFlash = function () {
203
- var targetElement, tempParent;
204
-
205
- // Make sure an element with the ID we are going to use doesn't already exist
206
- if (document.getElementById(this.movieName) !== null) {
207
- throw "ID " + this.movieName + " is already in use. The Flash Object could not be added";
208
- }
209
-
210
- // Get the element where we will be placing the flash movie
211
- targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder;
212
-
213
- if (targetElement == undefined) {
214
- throw "Could not find the placeholder element: " + this.settings.button_placeholder_id;
215
- }
216
-
217
- // Append the container and load the flash
218
- tempParent = document.createElement("div");
219
- tempParent.innerHTML = this.getFlashHTML(); // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers)
220
- targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement);
221
-
222
- // Fix IE Flash/Form bug
223
- if (window[this.movieName] == undefined) {
224
- window[this.movieName] = this.getMovieElement();
225
- }
226
-
227
- };
228
-
229
- // Private: getFlashHTML generates the object tag needed to embed the flash in to the document
230
- SWFUpload.prototype.getFlashHTML = function () {
231
- // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
232
- return ['<object id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
233
- '<param name="wmode" value="', this.settings.button_window_mode, '" />',
234
- '<param name="movie" value="', this.settings.flash_url, '" />',
235
- '<param name="quality" value="high" />',
236
- '<param name="menu" value="false" />',
237
- '<param name="allowScriptAccess" value="always" />',
238
- '<param name="flashvars" value="' + this.getFlashVars() + '" />',
239
- '</object>'].join("");
240
- };
241
-
242
- // Private: getFlashVars builds the parameter string that will be passed
243
- // to flash in the flashvars param.
244
- SWFUpload.prototype.getFlashVars = function () {
245
- // Build a string from the post param object
246
- var paramString = this.buildParamString();
247
- var httpSuccessString = this.settings.http_success.join(",");
248
-
249
- // Build the parameter string
250
- return ["movieName=", encodeURIComponent(this.movieName),
251
- "&amp;uploadURL=", encodeURIComponent(this.settings.upload_url),
252
- "&amp;useQueryString=", encodeURIComponent(this.settings.use_query_string),
253
- "&amp;requeueOnError=", encodeURIComponent(this.settings.requeue_on_error),
254
- "&amp;httpSuccess=", encodeURIComponent(httpSuccessString),
255
- "&amp;assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout),
256
- "&amp;params=", encodeURIComponent(paramString),
257
- "&amp;filePostName=", encodeURIComponent(this.settings.file_post_name),
258
- "&amp;fileTypes=", encodeURIComponent(this.settings.file_types),
259
- "&amp;fileTypesDescription=", encodeURIComponent(this.settings.file_types_description),
260
- "&amp;fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit),
261
- "&amp;fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit),
262
- "&amp;fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit),
263
- "&amp;debugEnabled=", encodeURIComponent(this.settings.debug_enabled),
264
- "&amp;buttonImageURL=", encodeURIComponent(this.settings.button_image_url),
265
- "&amp;buttonWidth=", encodeURIComponent(this.settings.button_width),
266
- "&amp;buttonHeight=", encodeURIComponent(this.settings.button_height),
267
- "&amp;buttonText=", encodeURIComponent(this.settings.button_text),
268
- "&amp;buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding),
269
- "&amp;buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding),
270
- "&amp;buttonTextStyle=", encodeURIComponent(this.settings.button_text_style),
271
- "&amp;buttonAction=", encodeURIComponent(this.settings.button_action),
272
- "&amp;buttonDisabled=", encodeURIComponent(this.settings.button_disabled),
273
- "&amp;buttonCursor=", encodeURIComponent(this.settings.button_cursor)
274
- ].join("");
275
- };
276
-
277
- // Public: getMovieElement retrieves the DOM reference to the Flash element added by SWFUpload
278
- // The element is cached after the first lookup
279
- SWFUpload.prototype.getMovieElement = function () {
280
- if (this.movieElement == undefined) {
281
- this.movieElement = document.getElementById(this.movieName);
282
- }
283
-
284
- if (this.movieElement === null) {
285
- throw "Could not find Flash element";
286
- }
287
-
288
- return this.movieElement;
289
- };
290
-
291
- // Private: buildParamString takes the name/value pairs in the post_params setting object
292
- // and joins them up in to a string formatted "name=value&amp;name=value"
293
- SWFUpload.prototype.buildParamString = function () {
294
- var postParams = this.settings.post_params;
295
- var paramStringPairs = [];
296
-
297
- if (typeof(postParams) === "object") {
298
- for (var name in postParams) {
299
- if (postParams.hasOwnProperty(name)) {
300
- paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString()));
301
- }
302
- }
303
- }
304
-
305
- return paramStringPairs.join("&amp;");
306
- };
307
-
308
- // Public: Used to remove a SWFUpload instance from the page. This method strives to remove
309
- // all references to the SWF, and other objects so memory is properly freed.
310
- // Returns true if everything was destroyed. Returns a false if a failure occurs leaving SWFUpload in an inconsistant state.
311
- // Credits: Major improvements provided by steffen
312
- SWFUpload.prototype.destroy = function () {
313
- try {
314
- // Make sure Flash is done before we try to remove it
315
- this.cancelUpload(null, false);
316
-
317
-
318
- // Remove the SWFUpload DOM nodes
319
- var movieElement = null;
320
- movieElement = this.getMovieElement();
321
-
322
- if (movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
323
- // Loop through all the movie's properties and remove all function references (DOM/JS IE 6/7 memory leak workaround)
324
- for (var i in movieElement) {
325
- try {
326
- if (typeof(movieElement[i]) === "function") {
327
- movieElement[i] = null;
328
- }
329
- } catch (ex1) {
330
- }
331
- }
332
-
333
- // Remove the Movie Element from the page
334
- try {
335
- movieElement.parentNode.removeChild(movieElement);
336
- } catch (ex) {
337
- }
338
- }
339
-
340
- // Remove IE form fix reference
341
- window[this.movieName] = null;
342
-
343
- // Destroy other references
344
- SWFUpload.instances[this.movieName] = null;
345
- delete SWFUpload.instances[this.movieName];
346
-
347
- this.movieElement = null;
348
- this.settings = null;
349
- this.customSettings = null;
350
- this.eventQueue = null;
351
- this.movieName = null;
352
-
353
-
354
- return true;
355
- } catch (ex2) {
356
- return false;
357
- }
358
- };
359
-
360
-
361
- // Public: displayDebugInfo prints out settings and configuration
362
- // information about this SWFUpload instance.
363
- // This function (and any references to it) can be deleted when placing
364
- // SWFUpload in production.
365
- SWFUpload.prototype.displayDebugInfo = function () {
366
- this.debug(
367
- [
368
- "---SWFUpload Instance Info---\n",
369
- "Version: ", SWFUpload.version, "\n",
370
- "Movie Name: ", this.movieName, "\n",
371
- "Settings:\n",
372
- "\t", "upload_url: ", this.settings.upload_url, "\n",
373
- "\t", "flash_url: ", this.settings.flash_url, "\n",
374
- "\t", "use_query_string: ", this.settings.use_query_string.toString(), "\n",
375
- "\t", "requeue_on_error: ", this.settings.requeue_on_error.toString(), "\n",
376
- "\t", "http_success: ", this.settings.http_success.join(", "), "\n",
377
- "\t", "assume_success_timeout: ", this.settings.assume_success_timeout, "\n",
378
- "\t", "file_post_name: ", this.settings.file_post_name, "\n",
379
- "\t", "post_params: ", this.settings.post_params.toString(), "\n",
380
- "\t", "file_types: ", this.settings.file_types, "\n",
381
- "\t", "file_types_description: ", this.settings.file_types_description, "\n",
382
- "\t", "file_size_limit: ", this.settings.file_size_limit, "\n",
383
- "\t", "file_upload_limit: ", this.settings.file_upload_limit, "\n",
384
- "\t", "file_queue_limit: ", this.settings.file_queue_limit, "\n",
385
- "\t", "debug: ", this.settings.debug.toString(), "\n",
386
-
387
- "\t", "prevent_swf_caching: ", this.settings.prevent_swf_caching.toString(), "\n",
388
-
389
- "\t", "button_placeholder_id: ", this.settings.button_placeholder_id.toString(), "\n",
390
- "\t", "button_placeholder: ", (this.settings.button_placeholder ? "Set" : "Not Set"), "\n",
391
- "\t", "button_image_url: ", this.settings.button_image_url.toString(), "\n",
392
- "\t", "button_width: ", this.settings.button_width.toString(), "\n",
393
- "\t", "button_height: ", this.settings.button_height.toString(), "\n",
394
- "\t", "button_text: ", this.settings.button_text.toString(), "\n",
395
- "\t", "button_text_style: ", this.settings.button_text_style.toString(), "\n",
396
- "\t", "button_text_top_padding: ", this.settings.button_text_top_padding.toString(), "\n",
397
- "\t", "button_text_left_padding: ", this.settings.button_text_left_padding.toString(), "\n",
398
- "\t", "button_action: ", this.settings.button_action.toString(), "\n",
399
- "\t", "button_disabled: ", this.settings.button_disabled.toString(), "\n",
400
-
401
- "\t", "custom_settings: ", this.settings.custom_settings.toString(), "\n",
402
- "Event Handlers:\n",
403
- "\t", "swfupload_loaded_handler assigned: ", (typeof this.settings.swfupload_loaded_handler === "function").toString(), "\n",
404
- "\t", "file_dialog_start_handler assigned: ", (typeof this.settings.file_dialog_start_handler === "function").toString(), "\n",
405
- "\t", "file_queued_handler assigned: ", (typeof this.settings.file_queued_handler === "function").toString(), "\n",
406
- "\t", "file_queue_error_handler assigned: ", (typeof this.settings.file_queue_error_handler === "function").toString(), "\n",
407
- "\t", "upload_start_handler assigned: ", (typeof this.settings.upload_start_handler === "function").toString(), "\n",
408
- "\t", "upload_progress_handler assigned: ", (typeof this.settings.upload_progress_handler === "function").toString(), "\n",
409
- "\t", "upload_error_handler assigned: ", (typeof this.settings.upload_error_handler === "function").toString(), "\n",
410
- "\t", "upload_success_handler assigned: ", (typeof this.settings.upload_success_handler === "function").toString(), "\n",
411
- "\t", "upload_complete_handler assigned: ", (typeof this.settings.upload_complete_handler === "function").toString(), "\n",
412
- "\t", "debug_handler assigned: ", (typeof this.settings.debug_handler === "function").toString(), "\n"
413
- ].join("")
414
- );
415
- };
416
-
417
- /* Note: addSetting and getSetting are no longer used by SWFUpload but are included
418
- the maintain v2 API compatibility
419
- */
420
- // Public: (Deprecated) addSetting adds a setting value. If the value given is undefined or null then the default_value is used.
421
- SWFUpload.prototype.addSetting = function (name, value, default_value) {
422
- if (value == undefined) {
423
- return (this.settings[name] = default_value);
424
- } else {
425
- return (this.settings[name] = value);
426
- }
427
- };
428
-
429
- // Public: (Deprecated) getSetting gets a setting. Returns an empty string if the setting was not found.
430
- SWFUpload.prototype.getSetting = function (name) {
431
- if (this.settings[name] != undefined) {
432
- return this.settings[name];
433
- }
434
-
435
- return "";
436
- };
437
-
438
-
439
- // Private: callFlash handles function calls made to the Flash element.
440
- // Calls are made with a setTimeout for some functions to work around
441
- // bugs in the ExternalInterface library.
442
- SWFUpload.prototype.callFlash = function (functionName, argumentArray) {
443
- argumentArray = argumentArray || [];
444
-
445
- var movieElement = this.getMovieElement();
446
- var returnValue, returnString;
447
-
448
- // Flash's method if calling ExternalInterface methods (code adapted from MooTools).
449
- try {
450
- returnString = movieElement.CallFunction('<invoke name="' + functionName + '" returntype="javascript">' + __flash__argumentsToXML(argumentArray, 0) + '</invoke>');
451
- returnValue = eval(returnString);
452
- } catch (ex) {
453
- throw "Call to " + functionName + " failed";
454
- }
455
-
456
- // Unescape file post param values
457
- if (returnValue != undefined && typeof returnValue.post === "object") {
458
- returnValue = this.unescapeFilePostParams(returnValue);
459
- }
460
-
461
- return returnValue;
462
- };
463
-
464
- /* *****************************
465
- -- Flash control methods --
466
- Your UI should use these
467
- to operate SWFUpload
468
- ***************************** */
469
-
470
- // WARNING: this function does not work in Flash Player 10
471
- // Public: selectFile causes a File Selection Dialog window to appear. This
472
- // dialog only allows 1 file to be selected.
473
- SWFUpload.prototype.selectFile = function () {
474
- this.callFlash("SelectFile");
475
- };
476
-
477
- // WARNING: this function does not work in Flash Player 10
478
- // Public: selectFiles causes a File Selection Dialog window to appear/ This
479
- // dialog allows the user to select any number of files
480
- // Flash Bug Warning: Flash limits the number of selectable files based on the combined length of the file names.
481
- // If the selection name length is too long the dialog will fail in an unpredictable manner. There is no work-around
482
- // for this bug.
483
- SWFUpload.prototype.selectFiles = function () {
484
- this.callFlash("SelectFiles");
485
- };
486
-
487
-
488
- // Public: startUpload starts uploading the first file in the queue unless
489
- // the optional parameter 'fileID' specifies the ID
490
- SWFUpload.prototype.startUpload = function (fileID) {
491
- this.callFlash("StartUpload", [fileID]);
492
- };
493
-
494
- // Public: cancelUpload cancels any queued file. The fileID parameter may be the file ID or index.
495
- // If you do not specify a fileID the current uploading file or first file in the queue is cancelled.
496
- // If you do not want the uploadError event to trigger you can specify false for the triggerErrorEvent parameter.
497
- SWFUpload.prototype.cancelUpload = function (fileID, triggerErrorEvent) {
498
- if (triggerErrorEvent !== false) {
499
- triggerErrorEvent = true;
500
- }
501
- this.callFlash("CancelUpload", [fileID, triggerErrorEvent]);
502
- };
503
-
504
- // Public: stopUpload stops the current upload and requeues the file at the beginning of the queue.
505
- // If nothing is currently uploading then nothing happens.
506
- SWFUpload.prototype.stopUpload = function () {
507
- this.callFlash("StopUpload");
508
- };
509
-
510
- /* ************************
511
- * Settings methods
512
- * These methods change the SWFUpload settings.
513
- * SWFUpload settings should not be changed directly on the settings object
514
- * since many of the settings need to be passed to Flash in order to take
515
- * effect.
516
- * *********************** */
517
-
518
- // Public: getStats gets the file statistics object.
519
- SWFUpload.prototype.getStats = function () {
520
- return this.callFlash("GetStats");
521
- };
522
-
523
- // Public: setStats changes the SWFUpload statistics. You shouldn't need to
524
- // change the statistics but you can. Changing the statistics does not
525
- // affect SWFUpload accept for the successful_uploads count which is used
526
- // by the upload_limit setting to determine how many files the user may upload.
527
- SWFUpload.prototype.setStats = function (statsObject) {
528
- this.callFlash("SetStats", [statsObject]);
529
- };
530
-
531
- // Public: getFile retrieves a File object by ID or Index. If the file is
532
- // not found then 'null' is returned.
533
- SWFUpload.prototype.getFile = function (fileID) {
534
- if (typeof(fileID) === "number") {
535
- return this.callFlash("GetFileByIndex", [fileID]);
536
- } else {
537
- return this.callFlash("GetFile", [fileID]);
538
- }
539
- };
540
-
541
- // Public: addFileParam sets a name/value pair that will be posted with the
542
- // file specified by the Files ID. If the name already exists then the
543
- // exiting value will be overwritten.
544
- SWFUpload.prototype.addFileParam = function (fileID, name, value) {
545
- return this.callFlash("AddFileParam", [fileID, name, value]);
546
- };
547
-
548
- // Public: removeFileParam removes a previously set (by addFileParam) name/value
549
- // pair from the specified file.
550
- SWFUpload.prototype.removeFileParam = function (fileID, name) {
551
- this.callFlash("RemoveFileParam", [fileID, name]);
552
- };
553
-
554
- // Public: setUploadUrl changes the upload_url setting.
555
- SWFUpload.prototype.setUploadURL = function (url) {
556
- this.settings.upload_url = url.toString();
557
- this.callFlash("SetUploadURL", [url]);
558
- };
559
-
560
- // Public: setPostParams changes the post_params setting
561
- SWFUpload.prototype.setPostParams = function (paramsObject) {
562
- this.settings.post_params = paramsObject;
563
- this.callFlash("SetPostParams", [paramsObject]);
564
- };
565
-
566
- // Public: addPostParam adds post name/value pair. Each name can have only one value.
567
- SWFUpload.prototype.addPostParam = function (name, value) {
568
- this.settings.post_params[name] = value;
569
- this.callFlash("SetPostParams", [this.settings.post_params]);
570
- };
571
-
572
- // Public: removePostParam deletes post name/value pair.
573
- SWFUpload.prototype.removePostParam = function (name) {
574
- delete this.settings.post_params[name];
575
- this.callFlash("SetPostParams", [this.settings.post_params]);
576
- };
577
-
578
- // Public: setFileTypes changes the file_types setting and the file_types_description setting
579
- SWFUpload.prototype.setFileTypes = function (types, description) {
580
- this.settings.file_types = types;
581
- this.settings.file_types_description = description;
582
- this.callFlash("SetFileTypes", [types, description]);
583
- };
584
-
585
- // Public: setFileSizeLimit changes the file_size_limit setting
586
- SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) {
587
- this.settings.file_size_limit = fileSizeLimit;
588
- this.callFlash("SetFileSizeLimit", [fileSizeLimit]);
589
- };
590
-
591
- // Public: setFileUploadLimit changes the file_upload_limit setting
592
- SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) {
593
- this.settings.file_upload_limit = fileUploadLimit;
594
- this.callFlash("SetFileUploadLimit", [fileUploadLimit]);
595
- };
596
-
597
- // Public: setFileQueueLimit changes the file_queue_limit setting
598
- SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) {
599
- this.settings.file_queue_limit = fileQueueLimit;
600
- this.callFlash("SetFileQueueLimit", [fileQueueLimit]);
601
- };
602
-
603
- // Public: setFilePostName changes the file_post_name setting
604
- SWFUpload.prototype.setFilePostName = function (filePostName) {
605
- this.settings.file_post_name = filePostName;
606
- this.callFlash("SetFilePostName", [filePostName]);
607
- };
608
-
609
- // Public: setUseQueryString changes the use_query_string setting
610
- SWFUpload.prototype.setUseQueryString = function (useQueryString) {
611
- this.settings.use_query_string = useQueryString;
612
- this.callFlash("SetUseQueryString", [useQueryString]);
613
- };
614
-
615
- // Public: setRequeueOnError changes the requeue_on_error setting
616
- SWFUpload.prototype.setRequeueOnError = function (requeueOnError) {
617
- this.settings.requeue_on_error = requeueOnError;
618
- this.callFlash("SetRequeueOnError", [requeueOnError]);
619
- };
620
-
621
- // Public: setHTTPSuccess changes the http_success setting
622
- SWFUpload.prototype.setHTTPSuccess = function (http_status_codes) {
623
- if (typeof http_status_codes === "string") {
624
- http_status_codes = http_status_codes.replace(" ", "").split(",");
625
- }
626
-
627
- this.settings.http_success = http_status_codes;
628
- this.callFlash("SetHTTPSuccess", [http_status_codes]);
629
- };
630
-
631
- // Public: setHTTPSuccess changes the http_success setting
632
- SWFUpload.prototype.setAssumeSuccessTimeout = function (timeout_seconds) {
633
- this.settings.assume_success_timeout = timeout_seconds;
634
- this.callFlash("SetAssumeSuccessTimeout", [timeout_seconds]);
635
- };
636
-
637
- // Public: setDebugEnabled changes the debug_enabled setting
638
- SWFUpload.prototype.setDebugEnabled = function (debugEnabled) {
639
- this.settings.debug_enabled = debugEnabled;
640
- this.callFlash("SetDebugEnabled", [debugEnabled]);
641
- };
642
-
643
- // Public: setButtonImageURL loads a button image sprite
644
- SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) {
645
- if (buttonImageURL == undefined) {
646
- buttonImageURL = "";
647
- }
648
-
649
- this.settings.button_image_url = buttonImageURL;
650
- this.callFlash("SetButtonImageURL", [buttonImageURL]);
651
- };
652
-
653
- // Public: setButtonDimensions resizes the Flash Movie and button
654
- SWFUpload.prototype.setButtonDimensions = function (width, height) {
655
- this.settings.button_width = width;
656
- this.settings.button_height = height;
657
-
658
- var movie = this.getMovieElement();
659
- if (movie != undefined) {
660
- movie.style.width = width + "px";
661
- movie.style.height = height + "px";
662
- }
663
-
664
- this.callFlash("SetButtonDimensions", [width, height]);
665
- };
666
- // Public: setButtonText Changes the text overlaid on the button
667
- SWFUpload.prototype.setButtonText = function (html) {
668
- this.settings.button_text = html;
669
- this.callFlash("SetButtonText", [html]);
670
- };
671
- // Public: setButtonTextPadding changes the top and left padding of the text overlay
672
- SWFUpload.prototype.setButtonTextPadding = function (left, top) {
673
- this.settings.button_text_top_padding = top;
674
- this.settings.button_text_left_padding = left;
675
- this.callFlash("SetButtonTextPadding", [left, top]);
676
- };
677
-
678
- // Public: setButtonTextStyle changes the CSS used to style the HTML/Text overlaid on the button
679
- SWFUpload.prototype.setButtonTextStyle = function (css) {
680
- this.settings.button_text_style = css;
681
- this.callFlash("SetButtonTextStyle", [css]);
682
- };
683
- // Public: setButtonDisabled disables/enables the button
684
- SWFUpload.prototype.setButtonDisabled = function (isDisabled) {
685
- this.settings.button_disabled = isDisabled;
686
- this.callFlash("SetButtonDisabled", [isDisabled]);
687
- };
688
- // Public: setButtonAction sets the action that occurs when the button is clicked
689
- SWFUpload.prototype.setButtonAction = function (buttonAction) {
690
- this.settings.button_action = buttonAction;
691
- this.callFlash("SetButtonAction", [buttonAction]);
692
- };
693
-
694
- // Public: setButtonCursor changes the mouse cursor displayed when hovering over the button
695
- SWFUpload.prototype.setButtonCursor = function (cursor) {
696
- this.settings.button_cursor = cursor;
697
- this.callFlash("SetButtonCursor", [cursor]);
698
- };
699
-
700
- /* *******************************
701
- Flash Event Interfaces
702
- These functions are used by Flash to trigger the various
703
- events.
704
-
705
- All these functions a Private.
706
-
707
- Because the ExternalInterface library is buggy the event calls
708
- are added to a queue and the queue then executed by a setTimeout.
709
- This ensures that events are executed in a determinate order and that
710
- the ExternalInterface bugs are avoided.
711
- ******************************* */
712
-
713
- SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) {
714
- // Warning: Don't call this.debug inside here or you'll create an infinite loop
715
-
716
- if (argumentArray == undefined) {
717
- argumentArray = [];
718
- } else if (!(argumentArray instanceof Array)) {
719
- argumentArray = [argumentArray];
720
- }
721
-
722
- var self = this;
723
- if (typeof this.settings[handlerName] === "function") {
724
- // Queue the event
725
- this.eventQueue.push(function () {
726
- this.settings[handlerName].apply(this, argumentArray);
727
- });
728
-
729
- // Execute the next queued event
730
- setTimeout(function () {
731
- self.executeNextEvent();
732
- }, 0);
733
-
734
- } else if (this.settings[handlerName] !== null) {
735
- throw "Event handler " + handlerName + " is unknown or is not a function";
736
- }
737
- };
738
-
739
- // Private: Causes the next event in the queue to be executed. Since events are queued using a setTimeout
740
- // we must queue them in order to garentee that they are executed in order.
741
- SWFUpload.prototype.executeNextEvent = function () {
742
- // Warning: Don't call this.debug inside here or you'll create an infinite loop
743
-
744
- var f = this.eventQueue ? this.eventQueue.shift() : null;
745
- if (typeof(f) === "function") {
746
- f.apply(this);
747
- }
748
- };
749
-
750
- // Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterface cannot have
751
- // properties that contain characters that are not valid for JavaScript identifiers. To work around this
752
- // the Flash Component escapes the parameter names and we must unescape again before passing them along.
753
- SWFUpload.prototype.unescapeFilePostParams = function (file) {
754
- var reg = /[$]([0-9a-f]{4})/i;
755
- var unescapedPost = {};
756
- var uk;
757
-
758
- if (file != undefined) {
759
- for (var k in file.post) {
760
- if (file.post.hasOwnProperty(k)) {
761
- uk = k;
762
- var match;
763
- while ((match = reg.exec(uk)) !== null) {
764
- uk = uk.replace(match[0], String.fromCharCode(parseInt("0x" + match[1], 16)));
765
- }
766
- unescapedPost[uk] = file.post[k];
767
- }
768
- }
769
-
770
- file.post = unescapedPost;
771
- }
772
-
773
- return file;
774
- };
775
-
776
- // Private: Called by Flash to see if JS can call in to Flash (test if External Interface is working)
777
- SWFUpload.prototype.testExternalInterface = function () {
778
- try {
779
- return this.callFlash("TestExternalInterface");
780
- } catch (ex) {
781
- return false;
782
- }
783
- };
784
-
785
- // Private: This event is called by Flash when it has finished loading. Don't modify this.
786
- // Use the swfupload_loaded_handler event setting to execute custom code when SWFUpload has loaded.
787
- SWFUpload.prototype.flashReady = function () {
788
- // Check that the movie element is loaded correctly with its ExternalInterface methods defined
789
- var movieElement = this.getMovieElement();
790
-
791
- if (!movieElement) {
792
- this.debug("Flash called back ready but the flash movie can't be found.");
793
- return;
794
- }
795
-
796
- this.cleanUp(movieElement);
797
-
798
- this.queueEvent("swfupload_loaded_handler");
799
- };
800
-
801
- // Private: removes Flash added fuctions to the DOM node to prevent memory leaks in IE.
802
- // This function is called by Flash each time the ExternalInterface functions are created.
803
- SWFUpload.prototype.cleanUp = function (movieElement) {
804
- // Pro-actively unhook all the Flash functions
805
- try {
806
- if (this.movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
807
- this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");
808
- for (var key in movieElement) {
809
- try {
810
- if (typeof(movieElement[key]) === "function") {
811
- movieElement[key] = null;
812
- }
813
- } catch (ex) {
814
- }
815
- }
816
- }
817
- } catch (ex1) {
818
-
819
- }
820
-
821
- // Fix Flashes own cleanup code so if the SWFMovie was removed from the page
822
- // it doesn't display errors.
823
- window["__flash__removeCallback"] = function (instance, name) {
824
- try {
825
- if (instance) {
826
- instance[name] = null;
827
- }
828
- } catch (flashEx) {
829
-
830
- }
831
- };
832
-
833
- };
834
-
835
-
836
- /* This is a chance to do something before the browse window opens */
837
- SWFUpload.prototype.fileDialogStart = function () {
838
- this.queueEvent("file_dialog_start_handler");
839
- };
840
-
841
-
842
- /* Called when a file is successfully added to the queue. */
843
- SWFUpload.prototype.fileQueued = function (file) {
844
- file = this.unescapeFilePostParams(file);
845
- this.queueEvent("file_queued_handler", file);
846
- };
847
-
848
-
849
- /* Handle errors that occur when an attempt to queue a file fails. */
850
- SWFUpload.prototype.fileQueueError = function (file, errorCode, message) {
851
- file = this.unescapeFilePostParams(file);
852
- this.queueEvent("file_queue_error_handler", [file, errorCode, message]);
853
- };
854
-
855
- /* Called after the file dialog has closed and the selected files have been queued.
856
- You could call startUpload here if you want the queued files to begin uploading immediately. */
857
- SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued, numFilesInQueue) {
858
- this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued, numFilesInQueue]);
859
- };
860
-
861
- SWFUpload.prototype.uploadStart = function (file) {
862
- file = this.unescapeFilePostParams(file);
863
- this.queueEvent("return_upload_start_handler", file);
864
- };
865
-
866
- SWFUpload.prototype.returnUploadStart = function (file) {
867
- var returnValue;
868
- if (typeof this.settings.upload_start_handler === "function") {
869
- file = this.unescapeFilePostParams(file);
870
- returnValue = this.settings.upload_start_handler.call(this, file);
871
- } else if (this.settings.upload_start_handler != undefined) {
872
- throw "upload_start_handler must be a function";
873
- }
874
-
875
- // Convert undefined to true so if nothing is returned from the upload_start_handler it is
876
- // interpretted as 'true'.
877
- if (returnValue === undefined) {
878
- returnValue = true;
879
- }
880
-
881
- returnValue = !!returnValue;
882
-
883
- this.callFlash("ReturnUploadStart", [returnValue]);
884
- };
885
-
886
-
887
- SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) {
888
- file = this.unescapeFilePostParams(file);
889
- this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal]);
890
- };
891
-
892
- SWFUpload.prototype.uploadError = function (file, errorCode, message) {
893
- file = this.unescapeFilePostParams(file);
894
- this.queueEvent("upload_error_handler", [file, errorCode, message]);
895
- };
896
-
897
- SWFUpload.prototype.uploadSuccess = function (file, serverData, responseReceived) {
898
- file = this.unescapeFilePostParams(file);
899
- this.queueEvent("upload_success_handler", [file, serverData, responseReceived]);
900
- };
901
-
902
- SWFUpload.prototype.uploadComplete = function (file) {
903
- file = this.unescapeFilePostParams(file);
904
- this.queueEvent("upload_complete_handler", file);
905
- };
906
-
907
- /* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the
908
- internal debug console. You can override this event and have messages written where you want. */
909
- SWFUpload.prototype.debug = function (message) {
910
- this.queueEvent("debug_handler", message);
911
- };
912
-
913
-
914
- /* **********************************
915
- Debug Console
916
- The debug console is a self contained, in page location
917
- for debug message to be sent. The Debug Console adds
918
- itself to the body if necessary.
919
-
920
- The console is automatically scrolled as messages appear.
921
-
922
- If you are using your own debug handler or when you deploy to production and
923
- have debug disabled you can remove these functions to reduce the file size
924
- and complexity.
925
- ********************************** */
926
-
927
- // Private: debugMessage is the default debug_handler. If you want to print debug messages
928
- // call the debug() function. When overriding the function your own function should
929
- // check to see if the debug setting is true before outputting debug information.
930
- SWFUpload.prototype.debugMessage = function (message) {
931
- if (this.settings.debug) {
932
- var exceptionMessage, exceptionValues = [];
933
-
934
- // Check for an exception object and print it nicely
935
- if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") {
936
- for (var key in message) {
937
- if (message.hasOwnProperty(key)) {
938
- exceptionValues.push(key + ": " + message[key]);
939
- }
940
- }
941
- exceptionMessage = exceptionValues.join("\n") || "";
942
- exceptionValues = exceptionMessage.split("\n");
943
- exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: ");
944
- SWFUpload.Console.writeLine(exceptionMessage);
945
- } else {
946
- SWFUpload.Console.writeLine(message);
947
- }
948
- }
949
- };
950
-
951
- SWFUpload.Console = {};
952
- SWFUpload.Console.writeLine = function (message) {
953
- var console, documentForm;
954
-
955
- try {
956
- console = document.getElementById("SWFUpload_Console");
957
-
958
- if (!console) {
959
- documentForm = document.createElement("form");
960
- document.getElementsByTagName("body")[0].appendChild(documentForm);
961
-
962
- console = document.createElement("textarea");
963
- console.id = "SWFUpload_Console";
964
- console.style.fontFamily = "monospace";
965
- console.setAttribute("wrap", "off");
966
- console.wrap = "off";
967
- console.style.overflow = "auto";
968
- console.style.width = "700px";
969
- console.style.height = "350px";
970
- console.style.margin = "5px";
971
- documentForm.appendChild(console);
972
- }
973
-
974
- console.value += message + "\n";
975
-
976
- console.scrollTop = console.scrollHeight - console.clientHeight;
977
- } catch (ex) {
978
- alert("Exception: " + ex.name + " Message: " + ex.message);
979
- }
980
- };