ueditor_rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (355) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.markdown +36 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/javascripts/ueditor_rails/config.js.erb +207 -0
  5. data/app/assets/javascripts/ueditor_rails/init.js +12 -0
  6. data/app/controllers/ueditor_rails/application_controller.rb +5 -0
  7. data/app/controllers/ueditor_rails/dialogs_controller.rb +13 -0
  8. data/app/controllers/ueditor_rails/libs_controller.rb +20 -0
  9. data/app/helpers/ueditor_rails/application_helper.rb +4 -0
  10. data/app/views/ueditor_rails/dialogs/attachment.html.erb +128 -0
  11. data/app/views/ueditor_rails/dialogs/image.html.erb +205 -0
  12. data/config/routes.rb +11 -0
  13. data/lib/generators/ueditor_rails/USAGE +8 -0
  14. data/lib/generators/ueditor_rails/install_generator.rb +15 -0
  15. data/lib/generators/ueditor_rails/templates/ueditor_config.js.erb +204 -0
  16. data/lib/tasks/ueditor_rails_tasks.rake +4 -0
  17. data/lib/ueditor_rails.rb +25 -0
  18. data/lib/ueditor_rails/engine.rb +17 -0
  19. data/lib/ueditor_rails/helpers/form_builder.rb +11 -0
  20. data/lib/ueditor_rails/helpers/form_helper.rb +26 -0
  21. data/lib/ueditor_rails/helpers/view_helper.rb +21 -0
  22. data/lib/ueditor_rails/util.rb +32 -0
  23. data/lib/ueditor_rails/version.rb +3 -0
  24. data/test/dummy/README.rdoc +261 -0
  25. data/test/dummy/Rakefile +7 -0
  26. data/test/dummy/app/assets/javascripts/application.js +17 -0
  27. data/test/dummy/app/assets/javascripts/posts.js +2 -0
  28. data/test/dummy/app/assets/javascripts/ueditor_config.js.erb +201 -0
  29. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  30. data/test/dummy/app/assets/stylesheets/posts.css +4 -0
  31. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  32. data/test/dummy/app/controllers/application_controller.rb +3 -0
  33. data/test/dummy/app/controllers/posts_controller.rb +83 -0
  34. data/test/dummy/app/helpers/application_helper.rb +2 -0
  35. data/test/dummy/app/helpers/posts_helper.rb +2 -0
  36. data/test/dummy/app/models/post.rb +3 -0
  37. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  38. data/test/dummy/app/views/posts/_form.html.erb +25 -0
  39. data/test/dummy/app/views/posts/edit.html.erb +6 -0
  40. data/test/dummy/app/views/posts/index.html.erb +29 -0
  41. data/test/dummy/app/views/posts/new.html.erb +5 -0
  42. data/test/dummy/app/views/posts/show.html.erb +14 -0
  43. data/test/dummy/config.ru +4 -0
  44. data/test/dummy/config/application.rb +59 -0
  45. data/test/dummy/config/boot.rb +10 -0
  46. data/test/dummy/config/database.yml +25 -0
  47. data/test/dummy/config/environment.rb +5 -0
  48. data/test/dummy/config/environments/development.rb +37 -0
  49. data/test/dummy/config/environments/production.rb +67 -0
  50. data/test/dummy/config/environments/test.rb +37 -0
  51. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  52. data/test/dummy/config/initializers/inflections.rb +15 -0
  53. data/test/dummy/config/initializers/mime_types.rb +5 -0
  54. data/test/dummy/config/initializers/secret_token.rb +7 -0
  55. data/test/dummy/config/initializers/session_store.rb +8 -0
  56. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  57. data/test/dummy/config/locales/en.yml +5 -0
  58. data/test/dummy/config/routes.rb +8 -0
  59. data/test/dummy/db/development.sqlite3 +0 -0
  60. data/test/dummy/db/migrate/20130327173045_create_posts.rb +10 -0
  61. data/test/dummy/db/schema.rb +23 -0
  62. data/test/dummy/log/development.log +12037 -0
  63. data/test/dummy/log/production.log +7 -0
  64. data/test/dummy/public/404.html +26 -0
  65. data/test/dummy/public/422.html +26 -0
  66. data/test/dummy/public/500.html +25 -0
  67. data/test/dummy/public/favicon.ico +0 -0
  68. data/test/dummy/script/rails +6 -0
  69. data/test/dummy/test/fixtures/posts.yml +9 -0
  70. data/test/dummy/test/functional/posts_controller_test.rb +49 -0
  71. data/test/dummy/test/unit/helpers/posts_helper_test.rb +4 -0
  72. data/test/dummy/test/unit/post_test.rb +7 -0
  73. data/test/dummy/tmp/cache/assets/BDF/630/sprockets%2F5614511158c119e0843a3290422f62c4 +0 -0
  74. data/test/dummy/tmp/cache/assets/C2B/2B0/sprockets%2F6197f74231bf6577350613931d3f68d2 +0 -0
  75. data/test/dummy/tmp/cache/assets/C45/6F0/sprockets%2F8d0029260fa306414726778ccc2114f5 +0 -0
  76. data/test/dummy/tmp/cache/assets/C54/700/sprockets%2Ff3a117b56f12646d477370198ef50526 +0 -0
  77. data/test/dummy/tmp/cache/assets/C5C/D10/sprockets%2F46f8f094709b1722d4b908743489c22b +0 -0
  78. data/test/dummy/tmp/cache/assets/C60/B40/sprockets%2F54d01774a089b4d6669dee7038085556 +0 -0
  79. data/test/dummy/tmp/cache/assets/C6D/9D0/sprockets%2F0c0b92de372485111abd31809d680064 +0 -0
  80. data/test/dummy/tmp/cache/assets/C72/EA0/sprockets%2Fe282c06e62457331c3b56d36c320615d +0 -0
  81. data/test/dummy/tmp/cache/assets/C7A/940/sprockets%2F5799f5e28166414991897d6f9127d5fc +0 -0
  82. data/test/dummy/tmp/cache/assets/C7A/9C0/sprockets%2F492d15f65b17b6cfa0b7351378602147 +0 -0
  83. data/test/dummy/tmp/cache/assets/C84/AA0/sprockets%2F98093181296cc04f03f7580efb00c973 +0 -0
  84. data/test/dummy/tmp/cache/assets/C89/310/sprockets%2Fd1d06f948d748a7068c0e146154d8229 +0 -0
  85. data/test/dummy/tmp/cache/assets/C8A/8E0/sprockets%2F646396c661345dcc625cc575bf061577 +0 -0
  86. data/test/dummy/tmp/cache/assets/C8C/B80/sprockets%2F371bf96e99717688ed7313a0c53f4212 +0 -0
  87. data/test/dummy/tmp/cache/assets/C99/A70/sprockets%2F015fa15293ee9b3456140aa71fa44160 +0 -0
  88. data/test/dummy/tmp/cache/assets/CA7/4B0/sprockets%2Fa126b67ca393a693b7520818dc36c404 +0 -0
  89. data/test/dummy/tmp/cache/assets/CAC/3D0/sprockets%2F0839a13780ffe1bba453564492f04f70 +0 -0
  90. data/test/dummy/tmp/cache/assets/CAC/F50/sprockets%2Fd2c5808102c08c0f1626871aa59d796b +0 -0
  91. data/test/dummy/tmp/cache/assets/CC4/520/sprockets%2F985cf9f9b78b2869f70270770b134c3a +0 -0
  92. data/test/dummy/tmp/cache/assets/CC4/9A0/sprockets%2F2479c7a9ae4286405682d75dcb378d48 +0 -0
  93. data/test/dummy/tmp/cache/assets/CC7/220/sprockets%2Fd066c004d1fd26ae76a61303a7a18145 +0 -0
  94. data/test/dummy/tmp/cache/assets/CD1/E30/sprockets%2F07e2a3e7922a96e0bf582b3ed2160214 +0 -0
  95. data/test/dummy/tmp/cache/assets/CD4/5E0/sprockets%2F9bb402071b005bd61ca675149f1bf697 +0 -0
  96. data/test/dummy/tmp/cache/assets/CD5/B70/sprockets%2F416150dc3ac35079c94273cc46e90aa6 +0 -0
  97. data/test/dummy/tmp/cache/assets/CD6/630/sprockets%2Fe020a12eeaf2399ab542086e57d74056 +0 -0
  98. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  99. data/test/dummy/tmp/cache/assets/CD8/4D0/sprockets%2Fa24d9ba34e6c16d99323053382f150df +0 -0
  100. data/test/dummy/tmp/cache/assets/CDC/F80/sprockets%2F7bd94371d531b3f85d02c7a9427841aa +0 -0
  101. data/test/dummy/tmp/cache/assets/CDE/4B0/sprockets%2F342f1d7b7ca0569074f9128b9bda7125 +0 -0
  102. data/test/dummy/tmp/cache/assets/CDE/550/sprockets%2F6a69b27076b361fd10f64874f2c1b46b +0 -0
  103. data/test/dummy/tmp/cache/assets/CDF/860/sprockets%2F8a563174551315a923fc9a78d22fcb7a +0 -0
  104. data/test/dummy/tmp/cache/assets/CE1/3B0/sprockets%2F11a824a4c96529c2912f753ecf8b506d +0 -0
  105. data/test/dummy/tmp/cache/assets/CE3/A20/sprockets%2F9154bb14d747165e7f19d8161d4d2e4b +0 -0
  106. data/test/dummy/tmp/cache/assets/CE4/5E0/sprockets%2F1d31011d7c1599edc54d31d597f856e3 +0 -0
  107. data/test/dummy/tmp/cache/assets/CE5/8C0/sprockets%2F5abcadff90738332520786578cf1733c +0 -0
  108. data/test/dummy/tmp/cache/assets/CE6/070/sprockets%2F85808d5f0458f045dea0e9036d7f53c1 +0 -0
  109. data/test/dummy/tmp/cache/assets/CE7/DB0/sprockets%2F8e9537e225fe8d0a543dbf320c949325 +0 -0
  110. data/test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2 +0 -0
  111. data/test/dummy/tmp/cache/assets/CF0/C10/sprockets%2Fba2886d474f933456975a52ed2f1c66d +0 -0
  112. data/test/dummy/tmp/cache/assets/CF4/050/sprockets%2F07e64101425f48db3e2b5a4a61d02cc3 +0 -0
  113. data/test/dummy/tmp/cache/assets/CF6/2D0/sprockets%2Ffeef88a45781660a21645e8fbe276297 +0 -0
  114. data/test/dummy/tmp/cache/assets/CF9/3D0/sprockets%2Fd3a2bd3092fe687b0687869fe956493b +0 -0
  115. data/test/dummy/tmp/cache/assets/CF9/970/sprockets%2Fca43c206a5f90a0505194d56e635a1da +0 -0
  116. data/test/dummy/tmp/cache/assets/D04/9C0/sprockets%2F826e5acfd685ead033361021fa9723c1 +0 -0
  117. data/test/dummy/tmp/cache/assets/D07/000/sprockets%2F31610287c7cc1435a7c99f3e132abdc7 +0 -0
  118. data/test/dummy/tmp/cache/assets/D07/BB0/sprockets%2Ff7bbd33ae141463d938437050ac3d5d8 +0 -0
  119. data/test/dummy/tmp/cache/assets/D09/590/sprockets%2F0f074320e9adb54e1f4f69cb6392e420 +0 -0
  120. data/test/dummy/tmp/cache/assets/D0A/5D0/sprockets%2F131bc060fc89d617bc9c9571d2537ab3 +0 -0
  121. data/test/dummy/tmp/cache/assets/D10/3A0/sprockets%2F158f48165ddb9cfa4518a02159a4ec19 +0 -0
  122. data/test/dummy/tmp/cache/assets/D11/3D0/sprockets%2F95e3f52aa53952013be443db8d395c7e +0 -0
  123. data/test/dummy/tmp/cache/assets/D11/A80/sprockets%2Fc2fb6624be686158b2401b4d4a885e7d +0 -0
  124. data/test/dummy/tmp/cache/assets/D11/E20/sprockets%2Fbdd46b652f74de0b46055c41948c2d84 +0 -0
  125. data/test/dummy/tmp/cache/assets/D12/0B0/sprockets%2F671f91009e9f5a07db9c719430ed02cf +0 -0
  126. data/test/dummy/tmp/cache/assets/D12/F90/sprockets%2F397710de23c0f7b3f6cc3ad8635f7812 +0 -0
  127. data/test/dummy/tmp/cache/assets/D1A/310/sprockets%2F5384ad85f52d3272dbc64d46ef3876a4 +0 -0
  128. data/test/dummy/tmp/cache/assets/D1B/EA0/sprockets%2F5110d4ac9e35fe6749c40d2f99bf9191 +0 -0
  129. data/test/dummy/tmp/cache/assets/D1C/910/sprockets%2F0fb26515c30c3b1656a3f4410afb1d2b +0 -0
  130. data/test/dummy/tmp/cache/assets/D1C/C30/sprockets%2F6c41af8340e06f9fd28928991fea3c42 +0 -0
  131. data/test/dummy/tmp/cache/assets/D21/A00/sprockets%2F3207bde101a4d88963b9df6e869e267f +0 -0
  132. data/test/dummy/tmp/cache/assets/D22/DA0/sprockets%2F8a5776bdd0a1e1690c2e7f8bd5798908 +0 -0
  133. data/test/dummy/tmp/cache/assets/D25/7D0/sprockets%2F560b2b61bc3cb739ccb701c2b657311c +0 -0
  134. data/test/dummy/tmp/cache/assets/D28/A40/sprockets%2Fbba251ea4d111ae85160c127f4ab8756 +0 -0
  135. data/test/dummy/tmp/cache/assets/D2A/A10/sprockets%2F0459c22963b25c20faa51ac6dad617d2 +0 -0
  136. data/test/dummy/tmp/cache/assets/D2A/B10/sprockets%2F84f48544cf0b378928b7d6f59e392ccc +0 -0
  137. data/test/dummy/tmp/cache/assets/D31/800/sprockets%2F1e3ed31b0bc5875c2b1557f20b169ad7 +0 -0
  138. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  139. data/test/dummy/tmp/cache/assets/D32/A50/sprockets%2F11b9b104e2626ae5b506fd28b0b68af8 +0 -0
  140. data/test/dummy/tmp/cache/assets/D38/840/sprockets%2F12b5bf92ed12d821b47e92fa804855aa +0 -0
  141. data/test/dummy/tmp/cache/assets/D39/CF0/sprockets%2F8571123a9e73ccd7c112e35e39aca6a7 +0 -0
  142. data/test/dummy/tmp/cache/assets/D3A/F30/sprockets%2F15a0362cc0f96f824d2e192dc23c4fd9 +0 -0
  143. data/test/dummy/tmp/cache/assets/D3C/170/sprockets%2F916c8d4a702e456a3963151dcfd8bfa0 +0 -0
  144. data/test/dummy/tmp/cache/assets/D3C/9C0/sprockets%2Fab97a93e34581b3aa9fd71ac1f384019 +0 -0
  145. data/test/dummy/tmp/cache/assets/D3F/6C0/sprockets%2Ffb767a73ef0afcc0165723ec081903f9 +0 -0
  146. data/test/dummy/tmp/cache/assets/D3F/C90/sprockets%2F9da014b6c3ba9a861d11299abe96d476 +0 -0
  147. data/test/dummy/tmp/cache/assets/D3F/DC0/sprockets%2F82ef6bb4f2ec0237011ff08c692e429f +0 -0
  148. data/test/dummy/tmp/cache/assets/D41/4D0/sprockets%2F4b5e8493a27349a2c6b62acf462b58dd +0 -0
  149. data/test/dummy/tmp/cache/assets/D42/5C0/sprockets%2F054be4bebb7d59a4a747b3464e91f329 +0 -0
  150. data/test/dummy/tmp/cache/assets/D42/7C0/sprockets%2Ffcae5059b63412f6b286ddf1715e4b94 +0 -0
  151. data/test/dummy/tmp/cache/assets/D43/CF0/sprockets%2Fa8f40f4e4b38284009db82d3ee59a3c7 +0 -0
  152. data/test/dummy/tmp/cache/assets/D43/FB0/sprockets%2F400daf4968c6654111b9a7fd0a5f96fd +0 -0
  153. data/test/dummy/tmp/cache/assets/D44/400/sprockets%2F9f62068ab2f5e6f245e6090cbcda5845 +0 -0
  154. data/test/dummy/tmp/cache/assets/D45/A50/sprockets%2Fe86f7863ca9e1239c3a0cc78cc81209a +0 -0
  155. data/test/dummy/tmp/cache/assets/D4A/400/sprockets%2F9d22629fae12423fde39a8bc663796ea +0 -0
  156. data/test/dummy/tmp/cache/assets/D4B/710/sprockets%2Fe191069e1e69dbe5206ce3893d0fb6e8 +0 -0
  157. data/test/dummy/tmp/cache/assets/D4C/370/sprockets%2F9f8871ddc326d27fb2444e2b9e630c8e +0 -0
  158. data/test/dummy/tmp/cache/assets/D4C/730/sprockets%2F63a49b3364c4469aefe69ade635508fb +0 -0
  159. data/test/dummy/tmp/cache/assets/D4D/060/sprockets%2Fdf8071fd9e383d72ba1f17b5d5e98516 +0 -0
  160. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  161. data/test/dummy/tmp/cache/assets/D51/190/sprockets%2Fbde53d033a467778f7e5d2095d78fb4f +0 -0
  162. data/test/dummy/tmp/cache/assets/D52/080/sprockets%2Fbdb460a11eea94fd16071a7ea1f35210 +0 -0
  163. data/test/dummy/tmp/cache/assets/D52/890/sprockets%2Fbdd9c7f2d6d70b352f318578941ef9a7 +0 -0
  164. data/test/dummy/tmp/cache/assets/D53/E70/sprockets%2F856560debef90857ce907e1ae35fd079 +0 -0
  165. data/test/dummy/tmp/cache/assets/D57/580/sprockets%2Fc693d77ad959894ad2460c9eeb958a2a +0 -0
  166. data/test/dummy/tmp/cache/assets/D5A/630/sprockets%2F4ac0ab0666b16174df72ccb05c742ad7 +0 -0
  167. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  168. data/test/dummy/tmp/cache/assets/D5B/6E0/sprockets%2F01f2ef3b2303b7c39612f0755dcdda3c +0 -0
  169. data/test/dummy/tmp/cache/assets/D5E/C40/sprockets%2F3dd04e28364ca3b9aff00660e3028caf +0 -0
  170. data/test/dummy/tmp/cache/assets/D5E/E70/sprockets%2F85bf39edf8bd33f53b98060c75979cc9 +0 -0
  171. data/test/dummy/tmp/cache/assets/D63/E30/sprockets%2F8bb9b1b4042fa39f01e8b7a2d0388ca5 +0 -0
  172. data/test/dummy/tmp/cache/assets/D68/E70/sprockets%2F0d2ae672147c167b2c2f42d8cbe8c7b5 +0 -0
  173. data/test/dummy/tmp/cache/assets/D69/B40/sprockets%2F60528372c4d9ea38ee60b3fde0d0ba84 +0 -0
  174. data/test/dummy/tmp/cache/assets/D69/C00/sprockets%2Fb71f8a5e0942ae7d4b2b814238ff2e0c +0 -0
  175. data/test/dummy/tmp/cache/assets/D6A/660/sprockets%2F498dedb0ef6a80d452a4b07782d6b1a4 +0 -0
  176. data/test/dummy/tmp/cache/assets/D6C/0A0/sprockets%2F21ec0bf9b2152153f3942fcf8eba9f09 +0 -0
  177. data/test/dummy/tmp/cache/assets/D6D/570/sprockets%2Fb37f4aac840a59d278d8c57a338ccd20 +0 -0
  178. data/test/dummy/tmp/cache/assets/D6E/920/sprockets%2F9ebedf09390f21a580b35c937e24cb1f +0 -0
  179. data/test/dummy/tmp/cache/assets/D6E/AD0/sprockets%2F1dc84fc453b1ddb966271ae54d6b54d5 +0 -0
  180. data/test/dummy/tmp/cache/assets/D6E/F20/sprockets%2F2bb516def8c3a08b7174648da9dd40f3 +0 -0
  181. data/test/dummy/tmp/cache/assets/D70/B70/sprockets%2F6ebaed371aa715b95667e416378cba4d +0 -0
  182. data/test/dummy/tmp/cache/assets/D71/740/sprockets%2F1db90d964be0b67d1b79f5a5e5391ce1 +0 -0
  183. data/test/dummy/tmp/cache/assets/D75/860/sprockets%2Fe8fa1c4ebb9335f1fa16379c842fe750 +0 -0
  184. data/test/dummy/tmp/cache/assets/D75/EF0/sprockets%2F1d96674c67d405c6b50cddfd3b6c3e39 +0 -0
  185. data/test/dummy/tmp/cache/assets/D78/010/sprockets%2Faef73289dfbc84248a6aa0183feb8772 +0 -0
  186. data/test/dummy/tmp/cache/assets/D78/550/sprockets%2F0331b677d4885ee27b9c418f4fedaea4 +0 -0
  187. data/test/dummy/tmp/cache/assets/D7B/B50/sprockets%2F4685b399157deeddba90ea877df710b2 +0 -0
  188. data/test/dummy/tmp/cache/assets/D7C/2E0/sprockets%2Fbf5c619eecd922259e6b45e2f8e02b86 +0 -0
  189. data/test/dummy/tmp/cache/assets/D7C/8A0/sprockets%2Fcaf9df030f62b864de4e3944a9d477d4 +0 -0
  190. data/test/dummy/tmp/cache/assets/D7C/DE0/sprockets%2F4f4705ac7f29f60e99355fb3abf0af78 +0 -0
  191. data/test/dummy/tmp/cache/assets/D7D/510/sprockets%2Fee497e95e73cc27afe781b6bb90b5424 +0 -0
  192. data/test/dummy/tmp/cache/assets/D81/F00/sprockets%2Fac659dac860cb3646df9806f668ac39d +0 -0
  193. data/test/dummy/tmp/cache/assets/D86/620/sprockets%2F01395e5b7993cede6976336b9cfa9bbe +0 -0
  194. data/test/dummy/tmp/cache/assets/D86/6F0/sprockets%2F1526f063df1a7cc0e4fa0460cb6ba44d +0 -0
  195. data/test/dummy/tmp/cache/assets/D87/BB0/sprockets%2Fcd4ae785e2fdf9282a2f36c9543995de +0 -0
  196. data/test/dummy/tmp/cache/assets/D88/E00/sprockets%2Ff5b3e902fad33c44ff6a0e9db20501a0 +0 -0
  197. data/test/dummy/tmp/cache/assets/D8C/6D0/sprockets%2F0ead4d15ad8a9d31d33a14dc191da657 +0 -0
  198. data/test/dummy/tmp/cache/assets/D92/1B0/sprockets%2F1fa31cfb668a21f6d4bb0f6b2536e34e +0 -0
  199. data/test/dummy/tmp/cache/assets/D98/C50/sprockets%2Fcfa37bd769d589c2da1d3116a6db0b90 +0 -0
  200. data/test/dummy/tmp/cache/assets/D9C/790/sprockets%2Fc1bb1797c7e487ea4a940cfd3423da5c +0 -0
  201. data/test/dummy/tmp/cache/assets/D9C/CD0/sprockets%2Fc85016e7bbd4f3adbb7635d01f85d39b +0 -0
  202. data/test/dummy/tmp/cache/assets/D9D/0A0/sprockets%2Fcf40aaefd8ac6ea638790e4a2d367541 +0 -0
  203. data/test/dummy/tmp/cache/assets/D9D/930/sprockets%2F1229f6eab13c794c3ce94ad629d3bbb6 +0 -0
  204. data/test/dummy/tmp/cache/assets/D9D/CB0/sprockets%2F5ffa3729fab74e9b171334f933bbcd2a +0 -0
  205. data/test/dummy/tmp/cache/assets/D9D/D30/sprockets%2F7c202fe7098da9201fe66d37cc60eadd +0 -0
  206. data/test/dummy/tmp/cache/assets/D9E/1F0/sprockets%2Fb913f5de5b049aa041b8ad77ca576b9f +0 -0
  207. data/test/dummy/tmp/cache/assets/DA0/870/sprockets%2F92b550d7b5e47436b5d1db5b47daec8e +0 -0
  208. data/test/dummy/tmp/cache/assets/DA0/C70/sprockets%2Fd04dbacd60d1e2be636849d485b8d75b +0 -0
  209. data/test/dummy/tmp/cache/assets/DA1/C50/sprockets%2F2f73ec238cc2edfeecf185428d06435b +0 -0
  210. data/test/dummy/tmp/cache/assets/DA2/9C0/sprockets%2F5d2fe3ca5cf7ad9e2c5939a291f214a7 +0 -0
  211. data/test/dummy/tmp/cache/assets/DA4/390/sprockets%2F5cdc49a8aad8844bdc5b0a55b28666d8 +0 -0
  212. data/test/dummy/tmp/cache/assets/DA5/850/sprockets%2Ffedd0769ffb447639ab123e2db9a3c29 +0 -0
  213. data/test/dummy/tmp/cache/assets/DAE/160/sprockets%2F6cec68e7a5a848c93ade0e89e7c3501e +0 -0
  214. data/test/dummy/tmp/cache/assets/DAE/260/sprockets%2Fce5fe9569d7e18ea8a136cac298e3f12 +0 -0
  215. data/test/dummy/tmp/cache/assets/DB0/DB0/sprockets%2Fc39fd8a8e5ea5f6a1636c4707c9ef4a7 +0 -0
  216. data/test/dummy/tmp/cache/assets/DB3/C60/sprockets%2F0b0030d24fc428acb4c74c3edd0b94eb +0 -0
  217. data/test/dummy/tmp/cache/assets/DB8/F30/sprockets%2F91c7bb3a08ba6cd159d4b02313deaa7d +0 -0
  218. data/test/dummy/tmp/cache/assets/DC1/E50/sprockets%2F92af4d6d0bafa3ab109c5856ed14e34b +0 -0
  219. data/test/dummy/tmp/cache/assets/DC7/A30/sprockets%2Ff1eccc7f669f63b03bbb55750b50edc1 +0 -0
  220. data/test/dummy/tmp/cache/assets/DC8/B40/sprockets%2F9af180717bb0bacb7e27ce5d53fd1d74 +0 -0
  221. data/test/dummy/tmp/cache/assets/DC9/540/sprockets%2F608262feadebbf52a6d81168ab76b0fd +0 -0
  222. data/test/dummy/tmp/cache/assets/DC9/C10/sprockets%2Fa94c69d0007efe2ef0dbec32e82c942a +0 -0
  223. data/test/dummy/tmp/cache/assets/DCB/790/sprockets%2Ffa6e0afb98324ab70f6f2add80ab9546 +0 -0
  224. data/test/dummy/tmp/cache/assets/DCE/F10/sprockets%2Fa10ef3bf2ea4459a641b3fedfa78785b +0 -0
  225. data/test/dummy/tmp/cache/assets/DD5/A40/sprockets%2F773b57e8cbaba49a2858c9acd5ed930a +0 -0
  226. data/test/dummy/tmp/cache/assets/DD7/600/sprockets%2F0cec2cc545e1d3bd889d195f68dea4b7 +0 -0
  227. data/test/dummy/tmp/cache/assets/DDA/AC0/sprockets%2F8cce49d0b8e0a2de9cbc08fc2279865f +0 -0
  228. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  229. data/test/dummy/tmp/cache/assets/DDE/500/sprockets%2Fcff617ff0b83b5a38c991e1a2bff589f +0 -0
  230. data/test/dummy/tmp/cache/assets/DE0/790/sprockets%2Fe508b8ce9b8ef49ab69cf5bbc3d09680 +0 -0
  231. data/test/dummy/tmp/cache/assets/DFA/3D0/sprockets%2F969dbba9b0b881d0fe3ead044ce6b6a4 +0 -0
  232. data/test/dummy/tmp/cache/assets/DFD/610/sprockets%2F5fa40e7fbec251546395f4adbb7aecf4 +0 -0
  233. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  234. data/test/dummy/tmp/cache/assets/E0C/D50/sprockets%2Fdd746cdf1870fea2d4fef3db2c96c694 +0 -0
  235. data/test/dummy/tmp/cache/assets/E0E/0D0/sprockets%2F9fab330147d57668f6aff14ccefbfe9e +0 -0
  236. data/test/dummy/tmp/cache/assets/E12/430/sprockets%2F83cde7e665d636ba5b5f98d2dec7fdc3 +0 -0
  237. data/test/dummy/tmp/cache/assets/E23/590/sprockets%2F467d2a58abfbf81d715fdacd6ac3b2b2 +0 -0
  238. data/test/dummy/tmp/cache/assets/E30/F10/sprockets%2Feb96e11c82be8b736df1fcccbcaa8529 +0 -0
  239. data/test/dummy/tmp/cache/assets/E33/680/sprockets%2F1c62bdad5d5cc668bc73eeadc944c97c +0 -0
  240. data/test/dummy/tmp/cache/assets/E34/9F0/sprockets%2F2dbdbaffe3f466f85cee37cee4331f34 +0 -0
  241. data/test/dummy/tmp/cache/assets/E44/410/sprockets%2Fcfdd750d7776be51e48bfefe3cbc99e4 +0 -0
  242. data/test/dummy/tmp/cache/assets/E44/560/sprockets%2Fd728f19f2f5dfac9f555babd49ebb89d +0 -0
  243. data/test/dummy/tmp/cache/assets/E6C/C10/sprockets%2F837ca65eade4def9af9b6ada7cb394f4 +0 -0
  244. data/test/dummy/tmp/cache/assets/E86/510/sprockets%2F6de0e7ce2c9b7e2c7ced4bcfac2b2d06 +0 -0
  245. data/test/functional/ueditor_rails/dialogs_controller_test.rb +16 -0
  246. data/test/functional/ueditor_rails/libs_controller_test.rb +21 -0
  247. data/test/integration/navigation_test.rb +10 -0
  248. data/test/test_helper.rb +15 -0
  249. data/test/ueditor_rails_test.rb +7 -0
  250. data/vendor/assets/javascripts/ueditor/dialogs/attachment/attachment.css.erb +130 -0
  251. data/vendor/assets/javascripts/ueditor/dialogs/attachment/attachment.html.erb +128 -0
  252. data/vendor/assets/javascripts/ueditor/dialogs/attachment/callbacks.js +166 -0
  253. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_chm.gif +0 -0
  254. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_default.png +0 -0
  255. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_doc.gif +0 -0
  256. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_exe.gif +0 -0
  257. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_mp3.gif +0 -0
  258. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_mv.gif +0 -0
  259. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_pdf.gif +0 -0
  260. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_ppt.gif +0 -0
  261. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_psd.gif +0 -0
  262. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_rar.gif +0 -0
  263. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_txt.gif +0 -0
  264. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeImages/icon_xls.gif +0 -0
  265. data/vendor/assets/javascripts/ueditor/dialogs/attachment/fileTypeMaps.js +29 -0
  266. data/vendor/assets/javascripts/ueditor/dialogs/emotion/emotion.css.erb +44 -0
  267. data/vendor/assets/javascripts/ueditor/dialogs/emotion/emotion.html.erb +54 -0
  268. data/vendor/assets/javascripts/ueditor/dialogs/emotion/emotion.js +186 -0
  269. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/0.gif +0 -0
  270. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/bface.gif +0 -0
  271. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/cface.gif +0 -0
  272. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/fface.gif +0 -0
  273. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/jxface2.gif +0 -0
  274. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/neweditor-tab-bg.png +0 -0
  275. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/tface.gif +0 -0
  276. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/wface.gif +0 -0
  277. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/yface.gif +0 -0
  278. data/vendor/assets/javascripts/ueditor/dialogs/help/help.css +7 -0
  279. data/vendor/assets/javascripts/ueditor/dialogs/help/help.html.erb +82 -0
  280. data/vendor/assets/javascripts/ueditor/dialogs/help/help.js +54 -0
  281. data/vendor/assets/javascripts/ueditor/dialogs/image/image.css.erb +74 -0
  282. data/vendor/assets/javascripts/ueditor/dialogs/image/image.html.erb +204 -0
  283. data/vendor/assets/javascripts/ueditor/dialogs/image/image.js +712 -0
  284. data/vendor/assets/javascripts/ueditor/dialogs/image/imageUploader.swf +0 -0
  285. data/vendor/assets/javascripts/ueditor/dialogs/image/images/center_focus.jpg +0 -0
  286. data/vendor/assets/javascripts/ueditor/dialogs/image/images/left_focus.jpg +0 -0
  287. data/vendor/assets/javascripts/ueditor/dialogs/image/images/none_focus.jpg +0 -0
  288. data/vendor/assets/javascripts/ueditor/dialogs/image/images/right_focus.jpg +0 -0
  289. data/vendor/assets/javascripts/ueditor/dialogs/internal.js +79 -0
  290. data/vendor/assets/javascripts/ueditor/dialogs/link/link.html.erb +126 -0
  291. data/vendor/assets/javascripts/ueditor/dialogs/spechars/spechars.html.erb +21 -0
  292. data/vendor/assets/javascripts/ueditor/dialogs/spechars/spechars.js +56 -0
  293. data/vendor/assets/javascripts/ueditor/dialogs/table/dragicon.png +0 -0
  294. data/vendor/assets/javascripts/ueditor/dialogs/table/edittable.css +75 -0
  295. data/vendor/assets/javascripts/ueditor/dialogs/table/edittable.html.erb +56 -0
  296. data/vendor/assets/javascripts/ueditor/dialogs/table/edittable.js +182 -0
  297. data/vendor/assets/javascripts/ueditor/dialogs/table/edittd.html.erb +50 -0
  298. data/vendor/assets/javascripts/ueditor/dialogs/table/edittip.html.erb +33 -0
  299. data/vendor/assets/javascripts/ueditor/dialogs/tangram.js +1238 -0
  300. data/vendor/assets/javascripts/ueditor/dialogs/video/images/center_focus.jpg +0 -0
  301. data/vendor/assets/javascripts/ueditor/dialogs/video/images/left_focus.jpg +0 -0
  302. data/vendor/assets/javascripts/ueditor/dialogs/video/images/none_focus.jpg +0 -0
  303. data/vendor/assets/javascripts/ueditor/dialogs/video/images/right_focus.jpg +0 -0
  304. data/vendor/assets/javascripts/ueditor/dialogs/video/video.css +59 -0
  305. data/vendor/assets/javascripts/ueditor/dialogs/video/video.html.erb +67 -0
  306. data/vendor/assets/javascripts/ueditor/dialogs/video/video.js +402 -0
  307. data/vendor/assets/javascripts/ueditor/editor_all.js.erb +17707 -0
  308. data/vendor/assets/javascripts/ueditor/editor_config.js +238 -0
  309. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/copy.png +0 -0
  310. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/imglabel.png +0 -0
  311. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/localimage.png +0 -0
  312. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/music.png +0 -0
  313. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/upload.png +0 -0
  314. data/vendor/assets/javascripts/ueditor/lang/zh-cn/zh-cn.js +492 -0
  315. data/vendor/assets/javascripts/ueditor/themes/default/css/ueditor.css +1582 -0
  316. data/vendor/assets/javascripts/ueditor/themes/default/dialogbase.css.erb +100 -0
  317. data/vendor/assets/javascripts/ueditor/themes/default/images/anchor.gif +0 -0
  318. data/vendor/assets/javascripts/ueditor/themes/default/images/arrow.png +0 -0
  319. data/vendor/assets/javascripts/ueditor/themes/default/images/button-bg.gif +0 -0
  320. data/vendor/assets/javascripts/ueditor/themes/default/images/cancelbutton.gif +0 -0
  321. data/vendor/assets/javascripts/ueditor/themes/default/images/cursor_h.gif +0 -0
  322. data/vendor/assets/javascripts/ueditor/themes/default/images/cursor_h.png +0 -0
  323. data/vendor/assets/javascripts/ueditor/themes/default/images/cursor_v.gif +0 -0
  324. data/vendor/assets/javascripts/ueditor/themes/default/images/cursor_v.png +0 -0
  325. data/vendor/assets/javascripts/ueditor/themes/default/images/dialog-title-bg.png +0 -0
  326. data/vendor/assets/javascripts/ueditor/themes/default/images/filescan.png +0 -0
  327. data/vendor/assets/javascripts/ueditor/themes/default/images/highlighted.gif +0 -0
  328. data/vendor/assets/javascripts/ueditor/themes/default/images/icons-all.gif +0 -0
  329. data/vendor/assets/javascripts/ueditor/themes/default/images/icons.gif +0 -0
  330. data/vendor/assets/javascripts/ueditor/themes/default/images/icons.png +0 -0
  331. data/vendor/assets/javascripts/ueditor/themes/default/images/lock.gif +0 -0
  332. data/vendor/assets/javascripts/ueditor/themes/default/images/neweditor-tab-bg.png +0 -0
  333. data/vendor/assets/javascripts/ueditor/themes/default/images/pagebreak.gif +0 -0
  334. data/vendor/assets/javascripts/ueditor/themes/default/images/scale.png +0 -0
  335. data/vendor/assets/javascripts/ueditor/themes/default/images/spacer.gif +0 -0
  336. data/vendor/assets/javascripts/ueditor/themes/default/images/sparator_v.png +0 -0
  337. data/vendor/assets/javascripts/ueditor/themes/default/images/toolbar_bg.png +0 -0
  338. data/vendor/assets/javascripts/ueditor/themes/default/images/unhighlighted.gif +0 -0
  339. data/vendor/assets/javascripts/ueditor/themes/default/images/upload.png +0 -0
  340. data/vendor/assets/javascripts/ueditor/themes/default/images/videologo.gif +0 -0
  341. data/vendor/assets/javascripts/ueditor/themes/default/images/word.gif +0 -0
  342. data/vendor/assets/javascripts/ueditor/themes/default/images/wordpaste.png +0 -0
  343. data/vendor/assets/javascripts/ueditor/themes/iframe.css +1 -0
  344. data/vendor/assets/javascripts/ueditor/third-party/codemirror/codemirror.css +104 -0
  345. data/vendor/assets/javascripts/ueditor/third-party/codemirror/codemirror.js +3581 -0
  346. data/vendor/assets/javascripts/ueditor/third-party/swfupload/fileprogress.js +215 -0
  347. data/vendor/assets/javascripts/ueditor/third-party/swfupload/swfupload.cookies.js +53 -0
  348. data/vendor/assets/javascripts/ueditor/third-party/swfupload/swfupload.js +1132 -0
  349. data/vendor/assets/javascripts/ueditor/third-party/swfupload/swfupload.proxy.js +96 -0
  350. data/vendor/assets/javascripts/ueditor/third-party/swfupload/swfupload.queue.js +98 -0
  351. data/vendor/assets/javascripts/ueditor/third-party/swfupload/swfupload.speed.js +346 -0
  352. data/vendor/assets/javascripts/ueditor/third-party/swfupload/swfupload.swf +0 -0
  353. data/vendor/assets/javascripts/ueditor/third-party/swfupload/swfupload_fp9.swf +0 -0
  354. data/vendor/assets/javascripts/ueditor/uparse.js +358 -0
  355. metadata +674 -0
@@ -0,0 +1,215 @@
1
+ /*
2
+ A simple class for displaying file information and progress
3
+ Note: This is a demonstration only and not part of SWFUpload.
4
+ Note: Some have had problems adapting this class in IE7. It may not be suitable for your application.
5
+ */
6
+
7
+ // Constructor
8
+ // file is a SWFUpload file object
9
+ // targetID is the HTML element id attribute that the FileProgress HTML structure will be added to.
10
+ // Instantiating a new FileProgress object with an existing file will reuse/update the existing DOM elements
11
+ function FileProgress(file, targetID) {
12
+ this.fileProgressID = file.id;
13
+
14
+ this.opacity = 100;
15
+ this.height = 0;
16
+
17
+
18
+ this.fileProgressWrapper = document.getElementById(this.fileProgressID);
19
+ if (!this.fileProgressWrapper) {
20
+ this.fileProgressWrapper = document.createElement("div");
21
+ this.fileProgressWrapper.className = "progressWrapper";
22
+ this.fileProgressWrapper.id = this.fileProgressID;
23
+
24
+ this.fileProgressElement = document.createElement("div");
25
+ this.fileProgressElement.className = "progressContainer";
26
+
27
+ var progressCancel = document.createElement("a");
28
+ progressCancel.className = "progressCancel";
29
+ progressCancel.href = "#";
30
+ progressCancel.style.visibility = "hidden";
31
+ progressCancel.appendChild(document.createTextNode(" "));
32
+
33
+ //by ue
34
+ progressCancel.onclick = function(){
35
+ alert(1);
36
+ }
37
+
38
+ var progressText = document.createElement("div");
39
+ progressText.className = "progressName";
40
+ progressText.appendChild(document.createTextNode(file.name));
41
+
42
+ var progressBar = document.createElement("div");
43
+ progressBar.className = "progressBarInProgress";
44
+
45
+ var progressStatus = document.createElement("div");
46
+ progressStatus.className = "progressBarStatus";
47
+ progressStatus.innerHTML = " ";
48
+
49
+ this.fileProgressElement.appendChild(progressCancel);
50
+ this.fileProgressElement.appendChild(progressText);
51
+ this.fileProgressElement.appendChild(progressStatus);
52
+ this.fileProgressElement.appendChild(progressBar);
53
+
54
+ this.fileProgressWrapper.appendChild(this.fileProgressElement);
55
+
56
+ document.getElementById(targetID).appendChild(this.fileProgressWrapper);
57
+ } else {
58
+ this.fileProgressElement = this.fileProgressWrapper.firstChild;
59
+ this.reset();
60
+ }
61
+
62
+ this.height = this.fileProgressWrapper.offsetHeight;
63
+ this.setTimer(null);
64
+
65
+
66
+ }
67
+
68
+ FileProgress.prototype.setTimer = function (timer) {
69
+ this.fileProgressElement["FP_TIMER"] = timer;
70
+ };
71
+ FileProgress.prototype.getTimer = function (timer) {
72
+ return this.fileProgressElement["FP_TIMER"] || null;
73
+ };
74
+
75
+ FileProgress.prototype.reset = function () {
76
+ this.fileProgressElement.className = "progressContainer";
77
+
78
+ this.fileProgressElement.childNodes[2].innerHTML = " ";
79
+ this.fileProgressElement.childNodes[2].className = "progressBarStatus";
80
+
81
+ this.fileProgressElement.childNodes[3].className = "progressBarInProgress";
82
+ this.fileProgressElement.childNodes[3].style.width = "0%";
83
+
84
+ this.appear();
85
+ };
86
+
87
+ FileProgress.prototype.setProgress = function (percentage) {
88
+ this.fileProgressElement.className = "progressContainer green";
89
+ this.fileProgressElement.childNodes[3].className = "progressBarInProgress";
90
+ this.fileProgressElement.childNodes[3].style.width = percentage + "%";
91
+
92
+ this.appear();
93
+ };
94
+ FileProgress.prototype.setComplete = function () {
95
+ this.fileProgressElement.className = "progressContainer blue";
96
+ this.fileProgressElement.childNodes[3].className = "progressBarComplete";
97
+ this.fileProgressElement.childNodes[3].style.width = "";
98
+
99
+ var oSelf = this;
100
+ this.setTimer(setTimeout(function () {
101
+ //oSelf.disappear(); //隐藏已完成列表
102
+ }, 10000));
103
+ };
104
+ FileProgress.prototype.setError = function () {
105
+ this.fileProgressElement.className = "progressContainer red";
106
+ this.fileProgressElement.childNodes[3].className = "progressBarError";
107
+ this.fileProgressElement.childNodes[3].style.width = "";
108
+ //edir by ue
109
+ var oSelf = this;
110
+ this.setTimer(setTimeout(function () {
111
+ //oSelf.disappear();
112
+ }, 3000));
113
+ };
114
+ FileProgress.prototype.setCancelled = function () {
115
+ this.fileProgressElement.className = "progressContainer";
116
+ this.fileProgressElement.childNodes[3].className = "progressBarError";
117
+ this.fileProgressElement.childNodes[3].style.width = "";
118
+
119
+ var oSelf = this;
120
+ this.setTimer(setTimeout(function () {
121
+ oSelf.disappear();
122
+ }, 1000));
123
+ };
124
+ FileProgress.prototype.setStatus = function (status) {
125
+ this.fileProgressElement.childNodes[2].innerHTML = status;
126
+ };
127
+
128
+ // Show/Hide the cancel button
129
+ FileProgress.prototype.toggleCancel = function (show, swfUploadInstance,message) {
130
+ //edit by ue
131
+ var cancelBtn = this.fileProgressElement.childNodes[0];
132
+ cancelBtn.style.visibility = show ? "visible" : "hidden";
133
+ cancelBtn.title = message?message:"取消上传";
134
+ if (swfUploadInstance) {
135
+ //edit by ue
136
+ var me = this;
137
+ var fileID = me.fileProgressID,
138
+ e = me.fileProgressElement;
139
+ e.children[0].onclick = function () {
140
+ me.disappear();
141
+ swfUploadInstance.cancelUpload(fileID);
142
+ return false;
143
+ };
144
+ }
145
+ };
146
+
147
+ FileProgress.prototype.appear = function () {
148
+ if (this.getTimer() !== null) {
149
+ clearTimeout(this.getTimer());
150
+ this.setTimer(null);
151
+ }
152
+
153
+ if (this.fileProgressWrapper.filters) {
154
+ try {
155
+ this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity = 100;
156
+ } catch (e) {
157
+ // If it is not set initially, the browser will throw an error. This will set it if it is not set yet.
158
+ this.fileProgressWrapper.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=100)";
159
+ }
160
+ } else {
161
+ this.fileProgressWrapper.style.opacity = 1;
162
+ }
163
+
164
+ this.fileProgressWrapper.style.height = "";
165
+
166
+ this.height = this.fileProgressWrapper.offsetHeight;
167
+ this.opacity = 100;
168
+ this.fileProgressWrapper.style.display = "";
169
+
170
+ };
171
+
172
+ // Fades out and clips away the FileProgress box.
173
+ FileProgress.prototype.disappear = function () {
174
+
175
+ var reduceOpacityBy = 15;
176
+ var reduceHeightBy = 4;
177
+ var rate = 30; // 15 fps
178
+
179
+ if (this.opacity > 0) {
180
+ this.opacity -= reduceOpacityBy;
181
+ if (this.opacity < 0) {
182
+ this.opacity = 0;
183
+ }
184
+
185
+ if (this.fileProgressWrapper.filters) {
186
+ try {
187
+ this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity = this.opacity;
188
+ } catch (e) {
189
+ // If it is not set initially, the browser will throw an error. This will set it if it is not set yet.
190
+ this.fileProgressWrapper.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + this.opacity + ")";
191
+ }
192
+ } else {
193
+ this.fileProgressWrapper.style.opacity = this.opacity / 100;
194
+ }
195
+ }
196
+
197
+ if (this.height > 0) {
198
+ this.height -= reduceHeightBy;
199
+ if (this.height < 0) {
200
+ this.height = 0;
201
+ }
202
+
203
+ this.fileProgressWrapper.style.height = this.height + "px";
204
+ }
205
+
206
+ if (this.height > 0 || this.opacity > 0) {
207
+ var oSelf = this;
208
+ this.setTimer(setTimeout(function () {
209
+ oSelf.disappear();
210
+ }, rate));
211
+ } else {
212
+ this.fileProgressWrapper.style.display = "none";
213
+ this.setTimer(null);
214
+ }
215
+ };
@@ -0,0 +1,53 @@
1
+ /*
2
+ Cookie Plug-in
3
+
4
+ This plug in automatically gets all the cookies for this site and adds them to the post_params.
5
+ Cookies are loaded only on initialization. The refreshCookies function can be called to update the post_params.
6
+ The cookies will override any other post params with the same name.
7
+ */
8
+
9
+ var SWFUpload;
10
+ if (typeof(SWFUpload) === "function") {
11
+ SWFUpload.prototype.initSettings = function (oldInitSettings) {
12
+ return function (userSettings) {
13
+ if (typeof(oldInitSettings) === "function") {
14
+ oldInitSettings.call(this, userSettings);
15
+ }
16
+
17
+ this.refreshCookies(false); // The false parameter must be sent since SWFUpload has not initialzed at this point
18
+ };
19
+ }(SWFUpload.prototype.initSettings);
20
+
21
+ // refreshes the post_params and updates SWFUpload. The sendToFlash parameters is optional and defaults to True
22
+ SWFUpload.prototype.refreshCookies = function (sendToFlash) {
23
+ if (sendToFlash === undefined) {
24
+ sendToFlash = true;
25
+ }
26
+ sendToFlash = !!sendToFlash;
27
+
28
+ // Get the post_params object
29
+ var postParams = this.settings.post_params;
30
+
31
+ // Get the cookies
32
+ var i, cookieArray = document.cookie.split(';'), caLength = cookieArray.length, c, eqIndex, name, value;
33
+ for (i = 0; i < caLength; i++) {
34
+ c = cookieArray[i];
35
+
36
+ // Left Trim spaces
37
+ while (c.charAt(0) === " ") {
38
+ c = c.substring(1, c.length);
39
+ }
40
+ eqIndex = c.indexOf("=");
41
+ if (eqIndex > 0) {
42
+ name = c.substring(0, eqIndex);
43
+ value = c.substring(eqIndex + 1);
44
+ postParams[name] = value;
45
+ }
46
+ }
47
+
48
+ if (sendToFlash) {
49
+ this.setPostParams(postParams);
50
+ }
51
+ };
52
+
53
+ }
@@ -0,0 +1,1132 @@
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 Nilzn 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
+ * SWFObject v2.2 <http://code.google.com/p/swfobject/>
13
+ * is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
14
+ */
15
+
16
+
17
+
18
+ /* ******************* */
19
+ /* Constructor & Init */
20
+ /* ******************* */
21
+ var SWFUpload;
22
+ var swfobject;
23
+
24
+ if (SWFUpload == undefined) {
25
+ SWFUpload = function (settings) {
26
+ this.initSWFUpload(settings);
27
+ };
28
+ }
29
+
30
+ SWFUpload.prototype.initSWFUpload = function (userSettings) {
31
+ try {
32
+ this.customSettings = {}; // A container where developers can place their own settings associated with this instance.
33
+ this.settings = {};
34
+ this.eventQueue = [];
35
+ this.movieName = "SWFUpload_" + SWFUpload.movieCount++;
36
+ this.movieElement = null;
37
+
38
+
39
+ // Setup global control tracking
40
+ SWFUpload.instances[this.movieName] = this;
41
+
42
+ // Load the settings. Load the Flash movie.
43
+ this.initSettings(userSettings);
44
+ this.loadSupport();
45
+ if (this.swfuploadPreload()) {
46
+ this.loadFlash();
47
+ }
48
+
49
+ this.displayDebugInfo();
50
+ } catch (ex) {
51
+ delete SWFUpload.instances[this.movieName];
52
+ throw ex;
53
+ }
54
+ };
55
+
56
+ /* *************** */
57
+ /* Static Members */
58
+ /* *************** */
59
+ SWFUpload.instances = {};
60
+ SWFUpload.movieCount = 0;
61
+ SWFUpload.version = "2.5.0 2010-01-15 Beta 2";
62
+ SWFUpload.QUEUE_ERROR = {
63
+ QUEUE_LIMIT_EXCEEDED : -100,
64
+ FILE_EXCEEDS_SIZE_LIMIT : -110,
65
+ ZERO_BYTE_FILE : -120,
66
+ INVALID_FILETYPE : -130
67
+ };
68
+ SWFUpload.UPLOAD_ERROR = {
69
+ HTTP_ERROR : -200,
70
+ MISSING_UPLOAD_URL : -210,
71
+ IO_ERROR : -220,
72
+ SECURITY_ERROR : -230,
73
+ UPLOAD_LIMIT_EXCEEDED : -240,
74
+ UPLOAD_FAILED : -250,
75
+ SPECIFIED_FILE_ID_NOT_FOUND : -260,
76
+ FILE_VALIDATION_FAILED : -270,
77
+ FILE_CANCELLED : -280,
78
+ UPLOAD_STOPPED : -290,
79
+ RESIZE : -300
80
+ };
81
+ SWFUpload.FILE_STATUS = {
82
+ QUEUED : -1,
83
+ IN_PROGRESS : -2,
84
+ ERROR : -3,
85
+ COMPLETE : -4,
86
+ CANCELLED : -5
87
+ };
88
+ SWFUpload.UPLOAD_TYPE = {
89
+ NORMAL : -1,
90
+ RESIZED : -2
91
+ };
92
+
93
+ SWFUpload.BUTTON_ACTION = {
94
+ SELECT_FILE : -100,
95
+ SELECT_FILES : -110,
96
+ START_UPLOAD : -120,
97
+ JAVASCRIPT : -130, // DEPRECATED
98
+ NONE : -130
99
+ };
100
+ SWFUpload.CURSOR = {
101
+ ARROW : -1,
102
+ HAND : -2
103
+ };
104
+ SWFUpload.WINDOW_MODE = {
105
+ WINDOW : "window",
106
+ TRANSPARENT : "transparent",
107
+ OPAQUE : "opaque"
108
+ };
109
+
110
+ SWFUpload.RESIZE_ENCODING = {
111
+ JPEG : -1,
112
+ PNG : -2
113
+ };
114
+
115
+ // Private: takes a URL, determines if it is relative and converts to an absolute URL
116
+ // using the current site. Only processes the URL if it can, otherwise returns the URL untouched
117
+ SWFUpload.completeURL = function (url) {
118
+ try {
119
+ var path = "", indexSlash = -1;
120
+ if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//) || url === "") {
121
+ return url;
122
+ }
123
+
124
+ indexSlash = window.location.pathname.lastIndexOf("/");
125
+ if (indexSlash <= 0) {
126
+ path = "/";
127
+ } else {
128
+ path = window.location.pathname.substr(0, indexSlash) + "/";
129
+ }
130
+
131
+ return path + url;
132
+ } catch (ex) {
133
+ return url;
134
+ }
135
+ };
136
+
137
+ // Public: assign a new function to onload to use swfobject's domLoad functionality
138
+ SWFUpload.onload = function () {};
139
+
140
+
141
+ /* ******************** */
142
+ /* Instance Members */
143
+ /* ******************** */
144
+
145
+ // Private: initSettings ensures that all the
146
+ // settings are set, getting a default value if one was not assigned.
147
+ SWFUpload.prototype.initSettings = function (userSettings) {
148
+ this.ensureDefault = function (settingName, defaultValue) {
149
+ var setting = userSettings[settingName];
150
+ if (setting != undefined) {
151
+ this.settings[settingName] = setting;
152
+ } else {
153
+ this.settings[settingName] = defaultValue;
154
+ }
155
+ };
156
+
157
+ // Upload backend settings
158
+ this.ensureDefault("upload_url", "");
159
+ this.ensureDefault("preserve_relative_urls", false);
160
+ this.ensureDefault("file_post_name", "Filedata");
161
+ this.ensureDefault("post_params", {});
162
+ this.ensureDefault("use_query_string", false);
163
+ this.ensureDefault("requeue_on_error", false);
164
+ this.ensureDefault("http_success", []);
165
+ this.ensureDefault("assume_success_timeout", 0);
166
+
167
+ // File Settings
168
+ this.ensureDefault("file_types", "*.*");
169
+ this.ensureDefault("file_types_description", "All Files");
170
+ this.ensureDefault("file_size_limit", 0); // Default zero means "unlimited"
171
+ this.ensureDefault("file_upload_limit", 0);
172
+ this.ensureDefault("file_queue_limit", 0);
173
+
174
+ // Flash Settings
175
+ this.ensureDefault("flash_url", "swfupload.swf");
176
+ this.ensureDefault("flash9_url", "swfupload_fp9.swf");
177
+ this.ensureDefault("prevent_swf_caching", true);
178
+
179
+ // Button Settings
180
+ this.ensureDefault("button_image_url", "");
181
+ this.ensureDefault("button_width", 1);
182
+ this.ensureDefault("button_height", 1);
183
+ this.ensureDefault("button_text", "");
184
+ this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;");
185
+ this.ensureDefault("button_text_top_padding", 0);
186
+ this.ensureDefault("button_text_left_padding", 0);
187
+ this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES);
188
+ this.ensureDefault("button_disabled", false);
189
+ this.ensureDefault("button_placeholder_id", "");
190
+ this.ensureDefault("button_placeholder", null);
191
+ this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW);
192
+ this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW);
193
+
194
+ // Debug Settings
195
+ this.ensureDefault("debug", false);
196
+ this.settings.debug_enabled = this.settings.debug; // Here to maintain v2 API
197
+
198
+ // Event Handlers
199
+ this.settings.return_upload_start_handler = this.returnUploadStart;
200
+ this.ensureDefault("swfupload_preload_handler", null);
201
+ this.ensureDefault("swfupload_load_failed_handler", null);
202
+ this.ensureDefault("swfupload_loaded_handler", null);
203
+ this.ensureDefault("file_dialog_start_handler", null);
204
+ this.ensureDefault("file_queued_handler", null);
205
+ this.ensureDefault("file_queue_error_handler", null);
206
+ this.ensureDefault("file_dialog_complete_handler", null);
207
+
208
+ this.ensureDefault("upload_resize_start_handler", null);
209
+ this.ensureDefault("upload_start_handler", null);
210
+ this.ensureDefault("upload_progress_handler", null);
211
+ this.ensureDefault("upload_error_handler", null);
212
+ this.ensureDefault("upload_success_handler", null);
213
+ this.ensureDefault("upload_complete_handler", null);
214
+
215
+ this.ensureDefault("mouse_click_handler", null);
216
+ this.ensureDefault("mouse_out_handler", null);
217
+ this.ensureDefault("mouse_over_handler", null);
218
+
219
+ this.ensureDefault("debug_handler", this.debugMessage);
220
+
221
+ this.ensureDefault("custom_settings", {});
222
+
223
+ // Other settings
224
+ this.customSettings = this.settings.custom_settings;
225
+
226
+ // Update the flash url if needed
227
+ if (!!this.settings.prevent_swf_caching) {
228
+ this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime();
229
+ this.settings.flash9_url = this.settings.flash9_url + (this.settings.flash9_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime();
230
+ }
231
+
232
+ if (!this.settings.preserve_relative_urls) {
233
+ this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);
234
+ this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url);
235
+ }
236
+
237
+ delete this.ensureDefault;
238
+ };
239
+
240
+ // Initializes the supported functionality based the Flash Player version, state, and event that occur during initialization
241
+ SWFUpload.prototype.loadSupport = function () {
242
+ this.support = {
243
+ loading : swfobject.hasFlashPlayerVersion("9.0.28"),
244
+ imageResize : swfobject.hasFlashPlayerVersion("10.0.0")
245
+ };
246
+
247
+ };
248
+
249
+ // Private: loadFlash replaces the button_placeholder element with the flash movie.
250
+ SWFUpload.prototype.loadFlash = function () {
251
+ var targetElement, tempParent, wrapperType, flashHTML, els;
252
+
253
+ if (!this.support.loading) {
254
+ this.queueEvent("swfupload_load_failed_handler", ["Flash Player doesn't support SWFUpload"]);
255
+ return;
256
+ }
257
+
258
+ // Make sure an element with the ID we are going to use doesn't already exist
259
+ if (document.getElementById(this.movieName) !== null) {
260
+ this.support.loading = false;
261
+ this.queueEvent("swfupload_load_failed_handler", ["Element ID already in use"]);
262
+ return;
263
+ }
264
+
265
+ // Get the element where we will be placing the flash movie
266
+ targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder;
267
+
268
+ if (targetElement == undefined) {
269
+ this.support.loading = false;
270
+ this.queueEvent("swfupload_load_failed_handler", ["button place holder not found"]);
271
+ return;
272
+ }
273
+
274
+ wrapperType = (targetElement.currentStyle && targetElement.currentStyle["display"] || window.getComputedStyle && document.defaultView.getComputedStyle(targetElement, null).getPropertyValue("display")) !== "block" ? "span" : "div";
275
+
276
+ // Append the container and load the flash
277
+ tempParent = document.createElement(wrapperType);
278
+
279
+ flashHTML = this.getFlashHTML();
280
+
281
+ try {
282
+ tempParent.innerHTML = flashHTML; // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers)
283
+ } catch (ex) {
284
+ this.support.loading = false;
285
+ this.queueEvent("swfupload_load_failed_handler", ["Exception loading Flash HTML into placeholder"]);
286
+ return;
287
+ }
288
+
289
+ // Try to get the movie element immediately
290
+ els = tempParent.getElementsByTagName("object");
291
+ if (!els || els.length > 1 || els.length === 0) {
292
+ this.support.loading = false;
293
+ this.queueEvent("swfupload_load_failed_handler", ["Unable to find movie after adding to DOM"]);
294
+ return;
295
+ } else if (els.length === 1) {
296
+ this.movieElement = els[0];
297
+ }
298
+
299
+ targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement);
300
+
301
+ // Fix IE Flash/Form bug
302
+ if (window[this.movieName] == undefined) {
303
+ window[this.movieName] = this.getMovieElement();
304
+ }
305
+ };
306
+
307
+ // Private: getFlashHTML generates the object tag needed to embed the flash in to the document
308
+ SWFUpload.prototype.getFlashHTML = function (flashVersion) {
309
+ // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
310
+ return ['<object id="', this.movieName, '" type="application/x-shockwave-flash" data="', (this.support.imageResize ? this.settings.flash_url : this.settings.flash9_url), '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
311
+ '<param name="wmode" value="', this.settings.button_window_mode, '" />',
312
+ '<param name="movie" value="', (this.support.imageResize ? this.settings.flash_url : this.settings.flash9_url), '" />',
313
+ '<param name="quality" value="high" />',
314
+ '<param name="allowScriptAccess" value="always" />',
315
+ '<param name="flashvars" value="' + this.getFlashVars() + '" />',
316
+ '</object>'].join("");
317
+ };
318
+
319
+ // Private: getFlashVars builds the parameter string that will be passed
320
+ // to flash in the flashvars param.
321
+ SWFUpload.prototype.getFlashVars = function () {
322
+ // Build a string from the post param object
323
+ var httpSuccessString, paramString;
324
+
325
+ paramString = this.buildParamString();
326
+ httpSuccessString = this.settings.http_success.join(",");
327
+
328
+ // Build the parameter string
329
+ return ["movieName=", encodeURIComponent(this.movieName),
330
+ "&amp;uploadURL=", encodeURIComponent(this.settings.upload_url),
331
+ "&amp;useQueryString=", encodeURIComponent(this.settings.use_query_string),
332
+ "&amp;requeueOnError=", encodeURIComponent(this.settings.requeue_on_error),
333
+ "&amp;httpSuccess=", encodeURIComponent(httpSuccessString),
334
+ "&amp;assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout),
335
+ "&amp;params=", encodeURIComponent(paramString),
336
+ "&amp;filePostName=", encodeURIComponent(this.settings.file_post_name),
337
+ "&amp;fileTypes=", encodeURIComponent(this.settings.file_types),
338
+ "&amp;fileTypesDescription=", encodeURIComponent(this.settings.file_types_description),
339
+ "&amp;fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit),
340
+ "&amp;fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit),
341
+ "&amp;fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit),
342
+ "&amp;debugEnabled=", encodeURIComponent(this.settings.debug_enabled),
343
+ "&amp;buttonImageURL=", encodeURIComponent(this.settings.button_image_url),
344
+ "&amp;buttonWidth=", encodeURIComponent(this.settings.button_width),
345
+ "&amp;buttonHeight=", encodeURIComponent(this.settings.button_height),
346
+ "&amp;buttonText=", encodeURIComponent(this.settings.button_text),
347
+ "&amp;buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding),
348
+ "&amp;buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding),
349
+ "&amp;buttonTextStyle=", encodeURIComponent(this.settings.button_text_style),
350
+ "&amp;buttonAction=", encodeURIComponent(this.settings.button_action),
351
+ "&amp;buttonDisabled=", encodeURIComponent(this.settings.button_disabled),
352
+ "&amp;buttonCursor=", encodeURIComponent(this.settings.button_cursor)
353
+ ].join("");
354
+ };
355
+
356
+ // Public: get retrieves the DOM reference to the Flash element added by SWFUpload
357
+ // The element is cached after the first lookup
358
+ SWFUpload.prototype.getMovieElement = function () {
359
+ if (this.movieElement == undefined) {
360
+ this.movieElement = document.getElementById(this.movieName);
361
+ }
362
+
363
+ if (this.movieElement === null) {
364
+ throw "Could not find Flash element";
365
+ }
366
+
367
+ return this.movieElement;
368
+ };
369
+
370
+ // Private: buildParamString takes the name/value pairs in the post_params setting object
371
+ // and joins them up in to a string formatted "name=value&amp;name=value"
372
+ SWFUpload.prototype.buildParamString = function () {
373
+ var name, postParams, paramStringPairs = [];
374
+
375
+ postParams = this.settings.post_params;
376
+
377
+ if (typeof(postParams) === "object") {
378
+ for (name in postParams) {
379
+ if (postParams.hasOwnProperty(name)) {
380
+ paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString()));
381
+ }
382
+ }
383
+ }
384
+
385
+ return paramStringPairs.join("&amp;");
386
+ };
387
+
388
+ // Public: Used to remove a SWFUpload instance from the page. This method strives to remove
389
+ // all references to the SWF, and other objects so memory is properly freed.
390
+ // Returns true if everything was destroyed. Returns a false if a failure occurs leaving SWFUpload in an inconsistant state.
391
+ // Credits: Major improvements provided by steffen
392
+ SWFUpload.prototype.destroy = function () {
393
+ var movieElement;
394
+
395
+ try {
396
+ // Make sure Flash is done before we try to remove it
397
+ this.cancelUpload(null, false);
398
+
399
+ movieElement = this.cleanUp();
400
+
401
+ // Remove the SWFUpload DOM nodes
402
+ if (movieElement) {
403
+ // Remove the Movie Element from the page
404
+ try {
405
+ movieElement.parentNode.removeChild(movieElement);
406
+ } catch (ex) {}
407
+ }
408
+
409
+ // Remove IE form fix reference
410
+ window[this.movieName] = null;
411
+
412
+ // Destroy other references
413
+ SWFUpload.instances[this.movieName] = null;
414
+ delete SWFUpload.instances[this.movieName];
415
+
416
+ this.movieElement = null;
417
+ this.settings = null;
418
+ this.customSettings = null;
419
+ this.eventQueue = null;
420
+ this.movieName = null;
421
+
422
+
423
+ return true;
424
+ } catch (ex2) {
425
+ return false;
426
+ }
427
+ };
428
+
429
+
430
+ // Public: displayDebugInfo prints out settings and configuration
431
+ // information about this SWFUpload instance.
432
+ // This function (and any references to it) can be deleted when placing
433
+ // SWFUpload in production.
434
+ SWFUpload.prototype.displayDebugInfo = function () {
435
+ this.debug(
436
+ [
437
+ "---SWFUpload Instance Info---\n",
438
+ "Version: ", SWFUpload.version, "\n",
439
+ "Movie Name: ", this.movieName, "\n",
440
+ "Settings:\n",
441
+ "\t", "upload_url: ", this.settings.upload_url, "\n",
442
+ "\t", "flash_url: ", this.settings.flash_url, "\n",
443
+ "\t", "flash9_url: ", this.settings.flash9_url, "\n",
444
+ "\t", "use_query_string: ", this.settings.use_query_string.toString(), "\n",
445
+ "\t", "requeue_on_error: ", this.settings.requeue_on_error.toString(), "\n",
446
+ "\t", "http_success: ", this.settings.http_success.join(", "), "\n",
447
+ "\t", "assume_success_timeout: ", this.settings.assume_success_timeout, "\n",
448
+ "\t", "file_post_name: ", this.settings.file_post_name, "\n",
449
+ "\t", "post_params: ", this.settings.post_params.toString(), "\n",
450
+ "\t", "file_types: ", this.settings.file_types, "\n",
451
+ "\t", "file_types_description: ", this.settings.file_types_description, "\n",
452
+ "\t", "file_size_limit: ", this.settings.file_size_limit, "\n",
453
+ "\t", "file_upload_limit: ", this.settings.file_upload_limit, "\n",
454
+ "\t", "file_queue_limit: ", this.settings.file_queue_limit, "\n",
455
+ "\t", "debug: ", this.settings.debug.toString(), "\n",
456
+
457
+ "\t", "prevent_swf_caching: ", this.settings.prevent_swf_caching.toString(), "\n",
458
+
459
+ "\t", "button_placeholder_id: ", this.settings.button_placeholder_id.toString(), "\n",
460
+ "\t", "button_placeholder: ", (this.settings.button_placeholder ? "Set" : "Not Set"), "\n",
461
+ "\t", "button_image_url: ", this.settings.button_image_url.toString(), "\n",
462
+ "\t", "button_width: ", this.settings.button_width.toString(), "\n",
463
+ "\t", "button_height: ", this.settings.button_height.toString(), "\n",
464
+ "\t", "button_text: ", this.settings.button_text.toString(), "\n",
465
+ "\t", "button_text_style: ", this.settings.button_text_style.toString(), "\n",
466
+ "\t", "button_text_top_padding: ", this.settings.button_text_top_padding.toString(), "\n",
467
+ "\t", "button_text_left_padding: ", this.settings.button_text_left_padding.toString(), "\n",
468
+ "\t", "button_action: ", this.settings.button_action.toString(), "\n",
469
+ "\t", "button_cursor: ", this.settings.button_cursor.toString(), "\n",
470
+ "\t", "button_disabled: ", this.settings.button_disabled.toString(), "\n",
471
+
472
+ "\t", "custom_settings: ", this.settings.custom_settings.toString(), "\n",
473
+ "Event Handlers:\n",
474
+ "\t", "swfupload_preload_handler assigned: ", (typeof this.settings.swfupload_preload_handler === "function").toString(), "\n",
475
+ "\t", "swfupload_load_failed_handler assigned: ", (typeof this.settings.swfupload_load_failed_handler === "function").toString(), "\n",
476
+ "\t", "swfupload_loaded_handler assigned: ", (typeof this.settings.swfupload_loaded_handler === "function").toString(), "\n",
477
+ "\t", "mouse_click_handler assigned: ", (typeof this.settings.mouse_click_handler === "function").toString(), "\n",
478
+ "\t", "mouse_over_handler assigned: ", (typeof this.settings.mouse_over_handler === "function").toString(), "\n",
479
+ "\t", "mouse_out_handler assigned: ", (typeof this.settings.mouse_out_handler === "function").toString(), "\n",
480
+ "\t", "file_dialog_start_handler assigned: ", (typeof this.settings.file_dialog_start_handler === "function").toString(), "\n",
481
+ "\t", "file_queued_handler assigned: ", (typeof this.settings.file_queued_handler === "function").toString(), "\n",
482
+ "\t", "file_queue_error_handler assigned: ", (typeof this.settings.file_queue_error_handler === "function").toString(), "\n",
483
+ "\t", "upload_resize_start_handler assigned: ", (typeof this.settings.upload_resize_start_handler === "function").toString(), "\n",
484
+ "\t", "upload_start_handler assigned: ", (typeof this.settings.upload_start_handler === "function").toString(), "\n",
485
+ "\t", "upload_progress_handler assigned: ", (typeof this.settings.upload_progress_handler === "function").toString(), "\n",
486
+ "\t", "upload_error_handler assigned: ", (typeof this.settings.upload_error_handler === "function").toString(), "\n",
487
+ "\t", "upload_success_handler assigned: ", (typeof this.settings.upload_success_handler === "function").toString(), "\n",
488
+ "\t", "upload_complete_handler assigned: ", (typeof this.settings.upload_complete_handler === "function").toString(), "\n",
489
+ "\t", "debug_handler assigned: ", (typeof this.settings.debug_handler === "function").toString(), "\n",
490
+
491
+ "Support:\n",
492
+ "\t", "Load: ", (this.support.loading ? "Yes" : "No"), "\n",
493
+ "\t", "Image Resize: ", (this.support.imageResize ? "Yes" : "No"), "\n"
494
+
495
+ ].join("")
496
+ );
497
+ };
498
+
499
+ /* Note: addSetting and getSetting are no longer used by SWFUpload but are included
500
+ the maintain v2 API compatibility
501
+ */
502
+ // Public: (Deprecated) addSetting adds a setting value. If the value given is undefined or null then the default_value is used.
503
+ SWFUpload.prototype.addSetting = function (name, value, default_value) {
504
+ if (value == undefined) {
505
+ return (this.settings[name] = default_value);
506
+ } else {
507
+ return (this.settings[name] = value);
508
+ }
509
+ };
510
+
511
+ // Public: (Deprecated) getSetting gets a setting. Returns an empty string if the setting was not found.
512
+ SWFUpload.prototype.getSetting = function (name) {
513
+ if (this.settings[name] != undefined) {
514
+ return this.settings[name];
515
+ }
516
+
517
+ return "";
518
+ };
519
+
520
+
521
+
522
+ // Private: callFlash handles function calls made to the Flash element.
523
+ // Calls are made with a setTimeout for some functions to work around
524
+ // bugs in the ExternalInterface library.
525
+ SWFUpload.prototype.callFlash = function (functionName, argumentArray) {
526
+ var movieElement, returnValue, returnString;
527
+
528
+ argumentArray = argumentArray || [];
529
+ movieElement = this.getMovieElement();
530
+
531
+ // Flash's method if calling ExternalInterface methods (code adapted from MooTools).
532
+ try {
533
+ if (movieElement != undefined) {
534
+ returnString = movieElement.CallFunction('<invoke name="' + functionName + '" returntype="javascript">' + __flash__argumentsToXML(argumentArray, 0) + '</invoke>');
535
+ returnValue = eval(returnString);
536
+ } else {
537
+ this.debug("Can't call flash because the movie wasn't found.");
538
+ }
539
+ } catch (ex) {
540
+ this.debug("Exception calling flash function '" + functionName + "': " + ex.message);
541
+ }
542
+
543
+ // Unescape file post param values
544
+ if (returnValue != undefined && typeof returnValue.post === "object") {
545
+ returnValue = this.unescapeFilePostParams(returnValue);
546
+ }
547
+
548
+ return returnValue;
549
+ };
550
+
551
+ /* *****************************
552
+ -- Flash control methods --
553
+ Your UI should use these
554
+ to operate SWFUpload
555
+ ***************************** */
556
+
557
+ // WARNING: this function does not work in Flash Player 10
558
+ // Public: selectFile causes a File Selection Dialog window to appear. This
559
+ // dialog only allows 1 file to be selected.
560
+ SWFUpload.prototype.selectFile = function () {
561
+ this.callFlash("SelectFile");
562
+ };
563
+
564
+ // WARNING: this function does not work in Flash Player 10
565
+ // Public: selectFiles causes a File Selection Dialog window to appear/ This
566
+ // dialog allows the user to select any number of files
567
+ // Flash Bug Warning: Flash limits the number of selectable files based on the combined length of the file names.
568
+ // If the selection name length is too long the dialog will fail in an unpredictable manner. There is no work-around
569
+ // for this bug.
570
+ SWFUpload.prototype.selectFiles = function () {
571
+ this.callFlash("SelectFiles");
572
+ };
573
+
574
+
575
+ // Public: startUpload starts uploading the first file in the queue unless
576
+ // the optional parameter 'fileID' specifies the ID
577
+ SWFUpload.prototype.startUpload = function (fileID) {
578
+ this.callFlash("StartUpload", [fileID]);
579
+ };
580
+
581
+ // Public: startUpload starts uploading the first file in the queue unless
582
+ // the optional parameter 'fileID' specifies the ID
583
+ SWFUpload.prototype.startResizedUpload = function (fileID, width, height, encoding, quality, allowEnlarging) {
584
+ this.callFlash("StartUpload", [fileID, { "width": width, "height" : height, "encoding" : encoding, "quality" : quality, "allowEnlarging" : allowEnlarging }]);
585
+ };
586
+
587
+ // Public: cancelUpload cancels any queued file. The fileID parameter may be the file ID or index.
588
+ // If you do not specify a fileID the current uploading file or first file in the queue is cancelled.
589
+ // If you do not want the uploadError event to trigger you can specify false for the triggerErrorEvent parameter.
590
+ SWFUpload.prototype.cancelUpload = function (fileID, triggerErrorEvent) {
591
+ if (triggerErrorEvent !== false) {
592
+ triggerErrorEvent = true;
593
+ }
594
+ this.callFlash("CancelUpload", [fileID, triggerErrorEvent]);
595
+ };
596
+
597
+ // Public: stopUpload stops the current upload and requeues the file at the beginning of the queue.
598
+ // If nothing is currently uploading then nothing happens.
599
+ SWFUpload.prototype.stopUpload = function () {
600
+ this.callFlash("StopUpload");
601
+ };
602
+
603
+
604
+ // Public: requeueUpload requeues any file. If the file is requeued or already queued true is returned.
605
+ // If the file is not found or is currently uploading false is returned. Requeuing a file bypasses the
606
+ // file size, queue size, upload limit and other queue checks. Certain files can't be requeued (e.g, invalid or zero bytes files).
607
+ SWFUpload.prototype.requeueUpload = function (indexOrFileID) {
608
+ return this.callFlash("RequeueUpload", [indexOrFileID]);
609
+ };
610
+
611
+
612
+ /* ************************
613
+ * Settings methods
614
+ * These methods change the SWFUpload settings.
615
+ * SWFUpload settings should not be changed directly on the settings object
616
+ * since many of the settings need to be passed to Flash in order to take
617
+ * effect.
618
+ * *********************** */
619
+
620
+ // Public: getStats gets the file statistics object.
621
+ SWFUpload.prototype.getStats = function () {
622
+ return this.callFlash("GetStats");
623
+ };
624
+
625
+ // Public: setStats changes the SWFUpload statistics. You shouldn't need to
626
+ // change the statistics but you can. Changing the statistics does not
627
+ // affect SWFUpload accept for the successful_uploads count which is used
628
+ // by the upload_limit setting to determine how many files the user may upload.
629
+ SWFUpload.prototype.setStats = function (statsObject) {
630
+ this.callFlash("SetStats", [statsObject]);
631
+ };
632
+
633
+ // Public: getFile retrieves a File object by ID or Index. If the file is
634
+ // not found then 'null' is returned.
635
+ SWFUpload.prototype.getFile = function (fileID) {
636
+ if (typeof(fileID) === "number") {
637
+ return this.callFlash("GetFileByIndex", [fileID]);
638
+ } else {
639
+ return this.callFlash("GetFile", [fileID]);
640
+ }
641
+ };
642
+
643
+ // Public: getFileFromQueue retrieves a File object by ID or Index. If the file is
644
+ // not found then 'null' is returned.
645
+ SWFUpload.prototype.getQueueFile = function (fileID) {
646
+ if (typeof(fileID) === "number") {
647
+ return this.callFlash("GetFileByQueueIndex", [fileID]);
648
+ } else {
649
+ return this.callFlash("GetFile", [fileID]);
650
+ }
651
+ };
652
+
653
+
654
+ // Public: addFileParam sets a name/value pair that will be posted with the
655
+ // file specified by the Files ID. If the name already exists then the
656
+ // exiting value will be overwritten.
657
+ SWFUpload.prototype.addFileParam = function (fileID, name, value) {
658
+ return this.callFlash("AddFileParam", [fileID, name, value]);
659
+ };
660
+
661
+ // Public: removeFileParam removes a previously set (by addFileParam) name/value
662
+ // pair from the specified file.
663
+ SWFUpload.prototype.removeFileParam = function (fileID, name) {
664
+ this.callFlash("RemoveFileParam", [fileID, name]);
665
+ };
666
+
667
+ // Public: setUploadUrl changes the upload_url setting.
668
+ SWFUpload.prototype.setUploadURL = function (url) {
669
+ this.settings.upload_url = url.toString();
670
+ this.callFlash("SetUploadURL", [url]);
671
+ };
672
+
673
+ // Public: setPostParams changes the post_params setting
674
+ SWFUpload.prototype.setPostParams = function (paramsObject) {
675
+ this.settings.post_params = paramsObject;
676
+ this.callFlash("SetPostParams", [paramsObject]);
677
+ };
678
+
679
+ // Public: addPostParam adds post name/value pair. Each name can have only one value.
680
+ SWFUpload.prototype.addPostParam = function (name, value) {
681
+ this.settings.post_params[name] = value;
682
+ this.callFlash("SetPostParams", [this.settings.post_params]);
683
+ };
684
+
685
+ // Public: removePostParam deletes post name/value pair.
686
+ SWFUpload.prototype.removePostParam = function (name) {
687
+ delete this.settings.post_params[name];
688
+ this.callFlash("SetPostParams", [this.settings.post_params]);
689
+ };
690
+
691
+ // Public: setFileTypes changes the file_types setting and the file_types_description setting
692
+ SWFUpload.prototype.setFileTypes = function (types, description) {
693
+ this.settings.file_types = types;
694
+ this.settings.file_types_description = description;
695
+ this.callFlash("SetFileTypes", [types, description]);
696
+ };
697
+
698
+ // Public: setFileSizeLimit changes the file_size_limit setting
699
+ SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) {
700
+ this.settings.file_size_limit = fileSizeLimit;
701
+ this.callFlash("SetFileSizeLimit", [fileSizeLimit]);
702
+ };
703
+
704
+ // Public: setFileUploadLimit changes the file_upload_limit setting
705
+ SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) {
706
+ this.settings.file_upload_limit = fileUploadLimit;
707
+ this.callFlash("SetFileUploadLimit", [fileUploadLimit]);
708
+ };
709
+
710
+ // Public: setFileQueueLimit changes the file_queue_limit setting
711
+ SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) {
712
+ this.settings.file_queue_limit = fileQueueLimit;
713
+ this.callFlash("SetFileQueueLimit", [fileQueueLimit]);
714
+ };
715
+
716
+ // Public: setFilePostName changes the file_post_name setting
717
+ SWFUpload.prototype.setFilePostName = function (filePostName) {
718
+ this.settings.file_post_name = filePostName;
719
+ this.callFlash("SetFilePostName", [filePostName]);
720
+ };
721
+
722
+ // Public: setUseQueryString changes the use_query_string setting
723
+ SWFUpload.prototype.setUseQueryString = function (useQueryString) {
724
+ this.settings.use_query_string = useQueryString;
725
+ this.callFlash("SetUseQueryString", [useQueryString]);
726
+ };
727
+
728
+ // Public: setRequeueOnError changes the requeue_on_error setting
729
+ SWFUpload.prototype.setRequeueOnError = function (requeueOnError) {
730
+ this.settings.requeue_on_error = requeueOnError;
731
+ this.callFlash("SetRequeueOnError", [requeueOnError]);
732
+ };
733
+
734
+ // Public: setHTTPSuccess changes the http_success setting
735
+ SWFUpload.prototype.setHTTPSuccess = function (http_status_codes) {
736
+ if (typeof http_status_codes === "string") {
737
+ http_status_codes = http_status_codes.replace(" ", "").split(",");
738
+ }
739
+
740
+ this.settings.http_success = http_status_codes;
741
+ this.callFlash("SetHTTPSuccess", [http_status_codes]);
742
+ };
743
+
744
+ // Public: setHTTPSuccess changes the http_success setting
745
+ SWFUpload.prototype.setAssumeSuccessTimeout = function (timeout_seconds) {
746
+ this.settings.assume_success_timeout = timeout_seconds;
747
+ this.callFlash("SetAssumeSuccessTimeout", [timeout_seconds]);
748
+ };
749
+
750
+ // Public: setDebugEnabled changes the debug_enabled setting
751
+ SWFUpload.prototype.setDebugEnabled = function (debugEnabled) {
752
+ this.settings.debug_enabled = debugEnabled;
753
+ this.callFlash("SetDebugEnabled", [debugEnabled]);
754
+ };
755
+
756
+ // Public: setButtonImageURL loads a button image sprite
757
+ SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) {
758
+ if (buttonImageURL == undefined) {
759
+ buttonImageURL = "";
760
+ }
761
+
762
+ this.settings.button_image_url = buttonImageURL;
763
+ this.callFlash("SetButtonImageURL", [buttonImageURL]);
764
+ };
765
+
766
+ // Public: setButtonDimensions resizes the Flash Movie and button
767
+ SWFUpload.prototype.setButtonDimensions = function (width, height) {
768
+ this.settings.button_width = width;
769
+ this.settings.button_height = height;
770
+
771
+ var movie = this.getMovieElement();
772
+ if (movie != undefined) {
773
+ movie.style.width = width + "px";
774
+ movie.style.height = height + "px";
775
+ }
776
+
777
+ this.callFlash("SetButtonDimensions", [width, height]);
778
+ };
779
+ // Public: setButtonText Changes the text overlaid on the button
780
+ SWFUpload.prototype.setButtonText = function (html) {
781
+ this.settings.button_text = html;
782
+ this.callFlash("SetButtonText", [html]);
783
+ };
784
+ // Public: setButtonTextPadding changes the top and left padding of the text overlay
785
+ SWFUpload.prototype.setButtonTextPadding = function (left, top) {
786
+ this.settings.button_text_top_padding = top;
787
+ this.settings.button_text_left_padding = left;
788
+ this.callFlash("SetButtonTextPadding", [left, top]);
789
+ };
790
+
791
+ // Public: setButtonTextStyle changes the CSS used to style the HTML/Text overlaid on the button
792
+ SWFUpload.prototype.setButtonTextStyle = function (css) {
793
+ this.settings.button_text_style = css;
794
+ this.callFlash("SetButtonTextStyle", [css]);
795
+ };
796
+ // Public: setButtonDisabled disables/enables the button
797
+ SWFUpload.prototype.setButtonDisabled = function (isDisabled) {
798
+ this.settings.button_disabled = isDisabled;
799
+ this.callFlash("SetButtonDisabled", [isDisabled]);
800
+ };
801
+ // Public: setButtonAction sets the action that occurs when the button is clicked
802
+ SWFUpload.prototype.setButtonAction = function (buttonAction) {
803
+ this.settings.button_action = buttonAction;
804
+ this.callFlash("SetButtonAction", [buttonAction]);
805
+ };
806
+
807
+ // Public: setButtonCursor changes the mouse cursor displayed when hovering over the button
808
+ SWFUpload.prototype.setButtonCursor = function (cursor) {
809
+ this.settings.button_cursor = cursor;
810
+ this.callFlash("SetButtonCursor", [cursor]);
811
+ };
812
+
813
+ /* *******************************
814
+ Flash Event Interfaces
815
+ These functions are used by Flash to trigger the various
816
+ events.
817
+
818
+ All these functions a Private.
819
+
820
+ Because the ExternalInterface library is buggy the event calls
821
+ are added to a queue and the queue then executed by a setTimeout.
822
+ This ensures that events are executed in a determinate order and that
823
+ the ExternalInterface bugs are avoided.
824
+ ******************************* */
825
+
826
+ SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) {
827
+ // Warning: Don't call this.debug inside here or you'll create an infinite loop
828
+ var self = this;
829
+
830
+ if (argumentArray == undefined) {
831
+ argumentArray = [];
832
+ } else if (!(argumentArray instanceof Array)) {
833
+ argumentArray = [argumentArray];
834
+ }
835
+
836
+ if (typeof this.settings[handlerName] === "function") {
837
+ // Queue the event
838
+ this.eventQueue.push(function () {
839
+ this.settings[handlerName].apply(this, argumentArray);
840
+ });
841
+
842
+ // Execute the next queued event
843
+ setTimeout(function () {
844
+ self.executeNextEvent();
845
+ }, 0);
846
+
847
+ } else if (this.settings[handlerName] !== null) {
848
+ throw "Event handler " + handlerName + " is unknown or is not a function";
849
+ }
850
+ };
851
+
852
+ // Private: Causes the next event in the queue to be executed. Since events are queued using a setTimeout
853
+ // we must queue them in order to garentee that they are executed in order.
854
+ SWFUpload.prototype.executeNextEvent = function () {
855
+ // Warning: Don't call this.debug inside here or you'll create an infinite loop
856
+
857
+ var f = this.eventQueue ? this.eventQueue.shift() : null;
858
+ if (typeof(f) === "function") {
859
+ f.apply(this);
860
+ }
861
+ };
862
+
863
+ // Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterface cannot have
864
+ // properties that contain characters that are not valid for JavaScript identifiers. To work around this
865
+ // the Flash Component escapes the parameter names and we must unescape again before passing them along.
866
+ SWFUpload.prototype.unescapeFilePostParams = function (file) {
867
+ var reg = /[$]([0-9a-f]{4})/i, unescapedPost = {}, uk, k, match;
868
+
869
+ if (file != undefined) {
870
+ for (k in file.post) {
871
+ if (file.post.hasOwnProperty(k)) {
872
+ uk = k;
873
+ while ((match = reg.exec(uk)) !== null) {
874
+ uk = uk.replace(match[0], String.fromCharCode(parseInt("0x" + match[1], 16)));
875
+ }
876
+ unescapedPost[uk] = file.post[k];
877
+ }
878
+ }
879
+
880
+ file.post = unescapedPost;
881
+ }
882
+
883
+ return file;
884
+ };
885
+
886
+ // Private: This event is called by SWFUpload Init after we've determined what the user's Flash Player supports.
887
+ // Use the swfupload_preload_handler event setting to execute custom code when SWFUpload has loaded.
888
+ // Return false to prevent SWFUpload from loading and allow your script to do something else if your required feature is
889
+ // not supported
890
+ SWFUpload.prototype.swfuploadPreload = function () {
891
+ var returnValue;
892
+ if (typeof this.settings.swfupload_preload_handler === "function") {
893
+ returnValue = this.settings.swfupload_preload_handler.call(this);
894
+ } else if (this.settings.swfupload_preload_handler != undefined) {
895
+ throw "upload_start_handler must be a function";
896
+ }
897
+
898
+ // Convert undefined to true so if nothing is returned from the upload_start_handler it is
899
+ // interpretted as 'true'.
900
+ if (returnValue === undefined) {
901
+ returnValue = true;
902
+ }
903
+
904
+ return !!returnValue;
905
+ }
906
+
907
+ // Private: This event is called by Flash when it has finished loading. Don't modify this.
908
+ // Use the swfupload_loaded_handler event setting to execute custom code when SWFUpload has loaded.
909
+ SWFUpload.prototype.flashReady = function () {
910
+ // Check that the movie element is loaded correctly with its ExternalInterface methods defined
911
+ var movieElement = this.cleanUp();
912
+
913
+ if (!movieElement) {
914
+ this.debug("Flash called back ready but the flash movie can't be found.");
915
+ return;
916
+ }
917
+
918
+ this.queueEvent("swfupload_loaded_handler");
919
+ };
920
+
921
+ // Private: removes Flash added fuctions to the DOM node to prevent memory leaks in IE.
922
+ // This function is called by Flash each time the ExternalInterface functions are created.
923
+ SWFUpload.prototype.cleanUp = function () {
924
+ var key, movieElement = this.getMovieElement();
925
+
926
+ // Pro-actively unhook all the Flash functions
927
+ try {
928
+ if (movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
929
+ this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");
930
+ for (key in movieElement) {
931
+ try {
932
+ if (typeof(movieElement[key]) === "function") {
933
+ movieElement[key] = null;
934
+ }
935
+ } catch (ex) {
936
+ }
937
+ }
938
+ }
939
+ } catch (ex1) {
940
+
941
+ }
942
+
943
+ // Fix Flashes own cleanup code so if the SWF Movie was removed from the page
944
+ // it doesn't display errors.
945
+ window["__flash__removeCallback"] = function (instance, name) {
946
+ try {
947
+ if (instance) {
948
+ instance[name] = null;
949
+ }
950
+ } catch (flashEx) {
951
+
952
+ }
953
+ };
954
+
955
+ return movieElement;
956
+ };
957
+
958
+ /* When the button_action is set to None this event gets fired and executes the mouse_click_handler */
959
+ SWFUpload.prototype.mouseClick = function () {
960
+ this.queueEvent("mouse_click_handler");
961
+ };
962
+ SWFUpload.prototype.mouseOver = function () {
963
+ this.queueEvent("mouse_over_handler");
964
+ };
965
+ SWFUpload.prototype.mouseOut = function () {
966
+ this.queueEvent("mouse_out_handler");
967
+ };
968
+
969
+ /* This is a chance to do something before the browse window opens */
970
+ SWFUpload.prototype.fileDialogStart = function () {
971
+ this.queueEvent("file_dialog_start_handler");
972
+ };
973
+
974
+
975
+ /* Called when a file is successfully added to the queue. */
976
+ SWFUpload.prototype.fileQueued = function (file) {
977
+ file = this.unescapeFilePostParams(file);
978
+ this.queueEvent("file_queued_handler", file);
979
+ };
980
+
981
+
982
+ /* Handle errors that occur when an attempt to queue a file fails. */
983
+ SWFUpload.prototype.fileQueueError = function (file, errorCode, message) {
984
+ file = this.unescapeFilePostParams(file);
985
+ this.queueEvent("file_queue_error_handler", [file, errorCode, message]);
986
+ };
987
+
988
+ /* Called after the file dialog has closed and the selected files have been queued.
989
+ You could call startUpload here if you want the queued files to begin uploading immediately. */
990
+ SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued, numFilesInQueue) {
991
+ this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued, numFilesInQueue]);
992
+ };
993
+
994
+ SWFUpload.prototype.uploadResizeStart = function (file, resizeSettings) {
995
+ file = this.unescapeFilePostParams(file);
996
+ this.queueEvent("upload_resize_start_handler", [file, resizeSettings.width, resizeSettings.height, resizeSettings.encoding, resizeSettings.quality]);
997
+ };
998
+
999
+ SWFUpload.prototype.uploadStart = function (file) {
1000
+ file = this.unescapeFilePostParams(file);
1001
+ this.queueEvent("return_upload_start_handler", file);
1002
+ };
1003
+
1004
+ SWFUpload.prototype.returnUploadStart = function (file) {
1005
+ var returnValue;
1006
+ if (typeof this.settings.upload_start_handler === "function") {
1007
+ file = this.unescapeFilePostParams(file);
1008
+ returnValue = this.settings.upload_start_handler.call(this, file);
1009
+ } else if (this.settings.upload_start_handler != undefined) {
1010
+ throw "upload_start_handler must be a function";
1011
+ }
1012
+
1013
+ // Convert undefined to true so if nothing is returned from the upload_start_handler it is
1014
+ // interpretted as 'true'.
1015
+ if (returnValue === undefined) {
1016
+ returnValue = true;
1017
+ }
1018
+
1019
+ returnValue = !!returnValue;
1020
+
1021
+ this.callFlash("ReturnUploadStart", [returnValue]);
1022
+ };
1023
+
1024
+
1025
+
1026
+ SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) {
1027
+ file = this.unescapeFilePostParams(file);
1028
+ this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal]);
1029
+ };
1030
+
1031
+ SWFUpload.prototype.uploadError = function (file, errorCode, message) {
1032
+ file = this.unescapeFilePostParams(file);
1033
+ this.queueEvent("upload_error_handler", [file, errorCode, message]);
1034
+ };
1035
+
1036
+ SWFUpload.prototype.uploadSuccess = function (file, serverData, responseReceived) {
1037
+ file = this.unescapeFilePostParams(file);
1038
+ this.queueEvent("upload_success_handler", [file, serverData, responseReceived]);
1039
+ };
1040
+
1041
+ SWFUpload.prototype.uploadComplete = function (file) {
1042
+ file = this.unescapeFilePostParams(file);
1043
+ this.queueEvent("upload_complete_handler", file);
1044
+ };
1045
+
1046
+ /* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the
1047
+ internal debug console. You can override this event and have messages written where you want. */
1048
+ SWFUpload.prototype.debug = function (message) {
1049
+ this.queueEvent("debug_handler", message);
1050
+ };
1051
+
1052
+
1053
+ /* **********************************
1054
+ Debug Console
1055
+ The debug console is a self contained, in page location
1056
+ for debug message to be sent. The Debug Console adds
1057
+ itself to the body if necessary.
1058
+
1059
+ The console is automatically scrolled as messages appear.
1060
+
1061
+ If you are using your own debug handler or when you deploy to production and
1062
+ have debug disabled you can remove these functions to reduce the file size
1063
+ and complexity.
1064
+ ********************************** */
1065
+
1066
+ // Private: debugMessage is the default debug_handler. If you want to print debug messages
1067
+ // call the debug() function. When overriding the function your own function should
1068
+ // check to see if the debug setting is true before outputting debug information.
1069
+ SWFUpload.prototype.debugMessage = function (message) {
1070
+ var exceptionMessage, exceptionValues, key;
1071
+
1072
+ if (this.settings.debug) {
1073
+ exceptionValues = [];
1074
+
1075
+ // Check for an exception object and print it nicely
1076
+ if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") {
1077
+ for (key in message) {
1078
+ if (message.hasOwnProperty(key)) {
1079
+ exceptionValues.push(key + ": " + message[key]);
1080
+ }
1081
+ }
1082
+ exceptionMessage = exceptionValues.join("\n") || "";
1083
+ exceptionValues = exceptionMessage.split("\n");
1084
+ exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: ");
1085
+ SWFUpload.Console.writeLine(exceptionMessage);
1086
+ } else {
1087
+ SWFUpload.Console.writeLine(message);
1088
+ }
1089
+ }
1090
+ };
1091
+
1092
+ SWFUpload.Console = {};
1093
+ SWFUpload.Console.writeLine = function (message) {
1094
+ var console, documentForm;
1095
+
1096
+ try {
1097
+ console = document.getElementById("SWFUpload_Console");
1098
+
1099
+ if (!console) {
1100
+ documentForm = document.createElement("form");
1101
+ document.getElementsByTagName("body")[0].appendChild(documentForm);
1102
+
1103
+ console = document.createElement("textarea");
1104
+ console.id = "SWFUpload_Console";
1105
+ console.style.fontFamily = "monospace";
1106
+ console.setAttribute("wrap", "off");
1107
+ console.wrap = "off";
1108
+ console.style.overflow = "auto";
1109
+ console.style.width = "700px";
1110
+ console.style.height = "350px";
1111
+ console.style.margin = "5px";
1112
+ documentForm.appendChild(console);
1113
+ }
1114
+
1115
+ console.value += message + "\n";
1116
+
1117
+ console.scrollTop = console.scrollHeight - console.clientHeight;
1118
+ } catch (ex) {
1119
+ alert("Exception: " + ex.name + " Message: " + ex.message);
1120
+ }
1121
+ };
1122
+
1123
+
1124
+ /* SWFObject v2.2 <http://code.google.com/p/swfobject/>
1125
+ is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
1126
+ */
1127
+ swfobject = function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
1128
+ swfobject.addDomLoadEvent(function () {
1129
+ if (typeof(SWFUpload.onload) === "function") {
1130
+ SWFUpload.onload.call(window);
1131
+ }
1132
+ });