pulitzer 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/pulitzer.js +0 -37
  3. data/app/controllers/pulitzer/post_type_content_element_types_controller.rb +5 -2
  4. data/app/controllers/pulitzer/post_types_controller.rb +1 -1
  5. data/app/controllers/pulitzer/posts_controller.rb +1 -1
  6. data/app/helpers/pulitzer/posts_helper.rb +3 -3
  7. data/app/interactions/pulitzer/create_post_type_content_elements.rb +18 -0
  8. data/app/interactions/pulitzer/destroy_post_type_content_elements.rb +16 -0
  9. data/app/interactions/pulitzer/{setup_post_type_elements.rb → update_post_type_content_elements.rb} +3 -14
  10. data/app/models/pulitzer/post_type.rb +1 -1
  11. data/app/views/pulitzer/content_elements/_form.html.erb +4 -9
  12. data/app/views/pulitzer/content_elements/index.html.erb +3 -1
  13. data/app/views/pulitzer/post_type_content_element_types/_show.html.erb +3 -0
  14. data/app/views/pulitzer/post_types/_show.html.erb +5 -0
  15. data/app/views/pulitzer/post_types/index.html.erb +7 -4
  16. data/app/views/pulitzer/posts/_form.html.erb +2 -0
  17. data/app/views/pulitzer/posts/index.html.erb +7 -6
  18. data/lib/pulitzer/version.rb +1 -1
  19. data/test/dummy/app/assets/javascripts/application.js +0 -1
  20. data/test/dummy/app/assets/stylesheets/application.css +0 -1
  21. data/test/dummy/db/development.sqlite3 +0 -0
  22. data/test/dummy/log/development.log +31215 -0
  23. data/test/dummy/public/uploads/pulitzer/content_element/image/1/about-exec_chris.jpg +0 -0
  24. data/test/dummy/public/uploads/pulitzer/content_element/image/1/thumb_about-exec_chris.jpg +0 -0
  25. data/test/dummy/public/uploads/pulitzer/content_element/image/10/about-exec_james.jpg +0 -0
  26. data/test/dummy/public/uploads/pulitzer/content_element/image/10/thumb_about-exec_james.jpg +0 -0
  27. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/-aWGWb-qzmS6DmfDkl1hlSxhTxXUimiKdFHKI2ABugE.cache +0 -0
  28. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/-lhoWRTCNBjAqI1gVwvwaojnT52BbaUZHmWchlv4dp8.cache +1 -0
  29. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/05Z1U4NHAV6aemagozDFu3hHMw-MXRBgAaxmcB4W1QQ.cache +1 -0
  30. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/0F8GNXqYxHV6GutU7Hu7tB1zvV4sTwaPSN8gIxrBxOU.cache +1 -0
  31. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/0N1jihXPvzdJ3EO7mWXs9TzGCCBQmps9Xh0pAFz4UMQ.cache +2 -0
  32. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/0iFrBdOENhMuFv4wmzsFGy7FJjmfIrzZ6fsgpQ2uNc8.cache +1 -0
  33. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/1ivEVK9ZsSwwcDiBpAuBrci1BQlj5wA2tcuuQ_NM3_Q.cache +2 -0
  34. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/1zWLMRo5JfPGHjdQDbeb1NauNl3qQZiCBeIupYc45kw.cache +0 -0
  35. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/2a8mKFPO6cGAGGpsZB2LzvnZe8YZIsTcLtrUHymKhX8.cache +0 -0
  36. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/3SWou-fb5VEO-DK2Z5RXb1g3m-L3zX_k4lXuSFvmZgU.cache +0 -0
  37. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/3iII0BhnPScWSKlGyui9BSZKcVU6MCymn3hABp9DvcE.cache +1 -0
  38. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/4HW9UnAQfjsnAhtDxJ3BIo5Szf_SlqMzcUrPkJZTat4.cache +1 -0
  39. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/6OKb8nFqM17dsR4bO9oSPSPSnwa5pbjkBtHmB2UxZF4.cache +0 -0
  40. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/6QSXAGS3LExyiPpzylfRHlDcLsZIcb4q0e_ffBaFJBw.cache +1 -0
  41. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/6_5yQDUSs0JKSzzg29tiNwXmqbk_Q1cM_70-JcDT85c.cache +0 -0
  42. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/7W4zxvDWGLsTV19bw3huTbGR_HYvfXftCTZJlWO2Kr8.cache +0 -0
  43. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/7_ywOyxae6Z6sfTisGSCTacj2Xi6frZXH2L4erbISAI.cache +0 -0
  44. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/89xf4cVPrB3pZbMm385xU4FJp-X4bv6trd1qxAeWNJ8.cache +1 -0
  45. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/8Odpe5V-UXsBdktM49vxU4Y8uqb-dKH4yaJb985q6Fg.cache +2 -0
  46. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/8vwh3BQZidHnmHtr_6eiR9ATtb2piLUVqZuZ7XaiJ5I.cache +1 -0
  47. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/9H7yWchYBgcGS3DO6fS-WY-eIPGLYroIFN-9XIrn9w4.cache +1 -0
  48. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/9KcRYn721imI4sznqiua_-i0s9pW41PTDOnfWSasxDE.cache +2 -0
  49. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/9QBFvsCqSEItCNaT6ddZMhnc1byOl2_IqdzXXS9OQKk.cache +0 -0
  50. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/9zIs-7UDMADgh7m6D-YLCH2lP_0q42_gk5yifazzKHo.cache +1 -0
  51. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/AgTKpIzoVV3zgeIGufLkKneZNsGFjkTtt3AIqJfSiuA.cache +0 -0
  52. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/BMphRHxATCDhlOAmnWBPY6198_PmFGzSg4B2_f5H_I4.cache +1 -0
  53. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/BqpjTuORKSMqUXQERT9PzWhVfNT64GE3qT7PlsmToDc.cache +0 -0
  54. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/DddxEl8jjlgEUmeqJZAG1OfN8VglRdYX_EWAX1OV9sw.cache +1 -0
  55. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/DozpiRbA3HrlWxfXydJcdquc4Y9SAsuT8nvwKOxwec4.cache +1 -0
  56. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/EDAOJey_mXc_Ph8l4nrQ8dMmWS4t_IAvc1F0KU6TrTw.cache +0 -0
  57. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/EGoCErp1XNP0kUdtGp0OtB_RB0bI1iBcapTVnExZawE.cache +0 -0
  58. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Fnj57T_Vy3fhpO5aUEhrglbA40MxxI6Zqgx-YZz7EDU.cache +1 -0
  59. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/G7kvfJ5QFPVCrp1hitn3ardVVyhNWQfej8__bFWu7XU.cache +0 -0
  60. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/GQn9-KYJ4xNqtjI_kgXLuBgtc_KxCVsZtT_5WnKCFZ4.cache +0 -0
  61. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/GdiTbc31S29Sso69agawE0lS_CInA2rEN1SVgR3evLM.cache +1 -0
  62. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/GlJMsOlDBXmxbzP6XmLog_KjC3x54rYuTE4GDAYyXaI.cache +0 -0
  63. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/GsViZ2FOqMZcH8Fq-EF2zxLBrhd31164Qo1FaxjN_Lg.cache +1 -0
  64. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/GyD1zn9QNxyCQfdW6_j0HirBNbilmmvrFtB2osgS_B8.cache +3 -0
  65. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/HIjBYvYj78JHx_5Y2li-0OZkRoI1m6VmRT687Yze-NU.cache +1 -0
  66. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/INbsq347uzBTvTrm5YHQUJG1d_ipKWwGRBEpYm5czUk.cache +0 -0
  67. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/J3LkZdWRKcBnm4FmCDMsANuA2apsOqQKpKFjfwfb_3E.cache +1 -0
  68. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/J72aIAJiajq9MJgxVAoOE3tLFJWEXFPGijwxwU77M_U.cache +1 -0
  69. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/JCWtcamLCkqXwtPjZMGZ1sNg1q4zLIHpWa_-sLE8wp0.cache +0 -0
  70. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/JoXVPfO2v1vl3tSW6aDNRTF1KWNBqh6Q1a3ygV1McfU.cache +1 -0
  71. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/KAlo8LYFRPUjOfdCSoGpr7ZsOrATlwATZd7vYS3t_oY.cache +1 -0
  72. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/LNf_f10kXMUJKGRZ9Bzs_mbICDev_XvcS6PBzhkbsko.cache +1 -0
  73. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/LcYfQnpb4skuem1oXGJ3uQb2x7ULff3EwvwO20mG7eE.cache +1 -0
  74. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/MJwZTkWyPrziiKmZK0wF3XQ5ipTwQkWA3Q_Qhiwt9yU.cache +0 -0
  75. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/MnD2-SEmkU95JGcz-5GqzzpwtfO2MU608POWTRMTi4g.cache +1 -0
  76. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/MqJPzk89FMwDB1xqHu8YdKDwEjLPimmAfJahuiwuxR0.cache +1 -0
  77. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/N19nBTuj0vpbca_1dQw5mGnMPYbZdds2k7RL1dz7OWA.cache +0 -0
  78. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/NBtkg2UEFQsOzMsgq84ijGw2B9HRX-xyYHulRAdwwIY.cache +1 -0
  79. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/NMkaFU94xywcmu_Dcew1MQuJIjX36oFGmyyawwma6AI.cache +1 -0
  80. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/OHGHoVuyUUUyF-hesUa4S9LGOykeqvTwo2-1fzxl70c.cache +0 -0
  81. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/OK8Qg1XYyGwMZlPKYwxX4ffWgAa8AYRgqnUTay1TrsA.cache +0 -0
  82. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/PL_dvAGkhy1SAgAwqdiXEwh_22lnga6naApChsdpAXo.cache +1 -0
  83. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/QKDcex1J6UP9qOojC5l60x3Kn-lsMShPwifXiQ11_d0.cache +1 -0
  84. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/QLZGK9ybA6YwEIUvutsAWAlnSwuQddGHMk7n9Own8Og.cache +0 -0
  85. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/QxU2r45WLf26515CeOBhMvZz90E0FJsnTWvN2mUwtMQ.cache +0 -0
  86. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/R15uS8EAZpp4CEW1micnZl3VAXZfvGtfb6r1J5zIvBo.cache +0 -0
  87. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/R3HzBKPqoUYvYxE-10qMYpLZlVeWOsgoWn7iG6SrXUs.cache +1 -0
  88. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/RNOCx02YF-jW0iGYIK5j7PY5SMHBV6dFNbe9Chr4FWI.cache +1 -0
  89. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/S2Lz6BfH9r7Z9Ahd-DnOEfCIAVmK1oaLhxrUIZpr_t0.cache +0 -0
  90. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/SAosnLjR0yu_j1-6zsqlzuoXkZXfbehZ4IPAJZEJRrc.cache +2 -0
  91. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/SEPAmvyrlIRWnlv3zwB1CT5IWMi0R5ZpwO88ise9LTg.cache +0 -0
  92. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/SLNfIuKor9Qpqy0zi8ibkvZTHLSnSMR59o7p-SPvGNQ.cache +1 -0
  93. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/SaQrteM18SMU1EnOLI7lEaCKHkHhKa7TqD5lqu5389U.cache +1 -0
  94. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/T9CgShUmtUPpKV2pqvZut-nzesdCpu1RcAJ6T4vP3Z0.cache +1 -0
  95. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/TDsn8X84aOi5rw2RpL2313z8rlglIVkHRE5teO7TnJk.cache +1 -0
  96. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/TKKSnxurd2QgIx7FuXGsazzPkB2DkTwzaKSBxCRNCBw.cache +1 -0
  97. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/T_lgPdeSRwFnxs57sqzpMFAmXLBzjYMfjXZPLxw0PQc.cache +0 -0
  98. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/TvF1JF5z8FzrGnUjfNpa_603lW-RWlkA3V3sHMd4ykI.cache +0 -0
  99. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/V75Oa3CnpVoeiGSgmKiC03UYCeb2tYtiCNy-iTf2SsI.cache +1 -0
  100. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/VCtm6yrliP9Rl-KDkYAUezf7MJBLXLuGUajlQGaByjs.cache +0 -0
  101. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/WbAFtdv4nL2NLkx-UtwGRZYAySMBKSsg0TSQaO2gMQ4.cache +2 -0
  102. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/We_o646GCjixhQK4oCP8xZCnXaaTdkSFMuGrF7lCZYs.cache +0 -0
  103. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/WrdnVm85QmGbXhFAPp5G5BQq2rz8aqoyqD6aTJEu4mw.cache +1 -0
  104. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Wrkfsj2Xl_9AR5uxAsjDFYFlIlNxTAsN_1hPBvIpZ7w.cache +0 -0
  105. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/WwFdQpEwfs_PtBwIwZ4xtn53IYas9vDVmmhvM-DqVwY.cache +1 -0
  106. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/X0HK_pWDKL-i-rsKi2PWc7HiUh7U8a3yCmvLtaTU-ug.cache +1 -0
  107. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/XQxcQ4S0Z2aekh1FQOcbf7GHaqZW68RTbr95No1z3Rg.cache +0 -0
  108. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/X__C6J82ksGR7nQLkanpal_d-PH6l3wM24UJTwuDOlU.cache +3 -0
  109. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/YbAnXPAGmWWEVs30_cM3By2D5pA0DnT9zuPWnQXDkG4.cache +0 -0
  110. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/ZMfkJzO5ysifpAm_GyOAkvbJJz3ZD-Ixyx80SiUgQ_0.cache +1 -0
  111. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/_afYNwNmAN-XyXOQCpEe8Kvy4ssKsD_ICzkRC1RiVqs.cache +1 -0
  112. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/_fxgUWBTfE-1IynE7MwC3X4fVQDJfYFHSsKSHI4vZK4.cache +0 -0
  113. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/aIb_wBHErOqA0K7SxX_13JmMiLP347BDd4-P_DhBqSM.cache +0 -0
  114. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/alW21eLv2gKd-w5hmlASs7f9WfONgWvs5PfAw1B7sH0.cache +0 -0
  115. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/alZTuvqISkoOLv1TQAidtxjy_-RAoG-RzBbn83o2ZxE.cache +1 -0
  116. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/b8z8ojZC5wiEvrgnECGDpcpAtxgR86LqIBeFqxqaV_w.cache +0 -0
  117. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/bLq3jH9UTdsdaruBBzFlSNqkykf8camRPNO45cEKduQ.cache +0 -0
  118. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/cqd2FCbnF_j-1DEapy-FUEyaxCSDGH1rtSEytC7iRbY.cache +1 -0
  119. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/dGc1gLRuImm-ZJjDp9psxsfSIdTubBF_RNvQnbwGW3I.cache +1 -0
  120. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/dk73XzeYppQ9glln9drSphNBfoiWkmCPeZaSIfUIAYg.cache +0 -0
  121. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/dobdK96txvNs_7W1z_ac8VuSjCwxPw7WxcGOWz7DYh8.cache +0 -0
  122. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/e5C27JrsQUyJZiSyTX9qOSJKWGgWwKBMHkHcqaOyWPo.cache +1 -0
  123. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/eRpQW1r-VLVLHktVh_ESCSlU5vq0tqnbaVKzJ37aVjU.cache +1 -0
  124. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/eo6dUMhj1hgzASfFJBGWD9lC-5ySgF0IoCj6GjgN8D8.cache +1 -0
  125. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/eyZDH6uFox2kqf8qdW3QwslQ6B2OIaf9efD-5_dYYcY.cache +0 -0
  126. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/f-bDpf-aCrisaUgnBngeknbap2oHLvZiVnXv_17BA2k.cache +1 -0
  127. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/fCF4QRWvkgEUIG4NA_vNo9c1iXLSHKNal9rQ76kQXkU.cache +0 -0
  128. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/faM3nW6dvw-krTT3cQeiLf7lARsEvq2rZ-SrxfUnNVk.cache +1 -0
  129. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/fhpvAILNTNuEx_US69MM2WvXbYS7VF_UblGbYdfdFA0.cache +0 -0
  130. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/g-0K3LFsp3LPRE4SZ2PxYea7hzg1HPrqAC691ej29_s.cache +0 -0
  131. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/gRucL76ekJbBfGr140SzbB4Vs8hDu5zDjWjex3NS9E0.cache +1 -0
  132. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/gj-HlsYEE7uArYU7i9GX3_UIJQZoup75AaxXVSSAVmM.cache +1 -0
  133. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/hWApuFfb14JgBPzwg_xBUqTbNoF4JukhiVN7Vkl7AMA.cache +1 -0
  134. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/huvUmfQBrflMvXshFM810Ev4he6-K25Nue_q4YBPHEw.cache +0 -0
  135. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/i1Puy-b76-PmfiwtsDhtNruE2d2UBIKTHbDr6-A9vfU.cache +2 -0
  136. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/i6E8XJL-DqsMmqic0RaVzNgb96HB72H_B76K3NLIMAA.cache +0 -0
  137. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/kFswWhL3QMhGV9h4XKYAvMY3-QnN7DtFo1PHr9EvaGs.cache +1 -0
  138. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/kGcm84FZPW_7nz5LnK5yVBr8QGNASb71lOTNcJnVZ34.cache +1 -0
  139. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/kg2XWH1cgypaP_akLYikTXf16RC4XB2KlWvusunTxwQ.cache +0 -0
  140. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/kmQFB2IqQ18tNCkb0A4TJFI45RJNLjy7JaUcfpHXmDM.cache +1 -0
  141. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/l9dbyIFHJ2vouebP017mHdbETDsWl6KzG4YClpkDEIc.cache +1 -0
  142. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/lrsaRUoiXqck5pT9ANvNPR5ni0ADsutFblSZIe4ehSg.cache +0 -0
  143. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/m7F28XvIR7pXTig6NpBFHf6WDD5QqC_WleDlK6ymrG0.cache +0 -0
  144. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/meI3qg_BE-RpsDzkiMPgLy0GKjiSDQh72AkQZV0HQPI.cache +0 -0
  145. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/mm6_x3B2G57RlCcaR6_sllrUTv6sSjofkvE5i-XU5vI.cache +1 -0
  146. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/mzGATWMyHZ_d3ZPUA85FOFfxgXSHR47v6FyECCltabk.cache +0 -0
  147. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/n76t65yuQZmRbdnmgy8AjIofWN_VF6SrRwNqKhp7LMY.cache +1 -0
  148. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/nBC3kjElixyxUAOy_vcw1C9Gq26CUf4KOVfCjPcRPsQ.cache +0 -0
  149. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/no341Jn06IMDn1lZQ_Lv7zY1nbJVXJ_qzC8ue0To010.cache +1 -0
  150. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/oCsnO7F1C4MEvEMbefkDHGdPoOyK4u9MdiSTfldTXSM.cache +0 -0
  151. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/oFliCFO74tuJWUV1VDamLlfZfmiv8CPbHo1U5kddG48.cache +0 -0
  152. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/pXI0eAbuAmlugh1_9Q-6ujDNPpBm9KIsjUw93GC4pL8.cache +2 -0
  153. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/qA97ho1pLyaG__qt5qkWS62QnTtFXDfsxyO9z5bliZk.cache +1 -0
  154. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/rpQzI4bz19a8Xh5CGNvts1z_4fr4fvPfCGupunC3X-c.cache +0 -0
  155. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/rySyA-xZUNv-0sJ6uxLiYzxnZ0gIHM01evcasqRY8LA.cache +0 -0
  156. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/tK4YZizxgD0R1wj9DouldfbzMNBhOletG0MiwkhMKus.cache +1 -0
  157. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/tnb6JVYXubourRckKeJ0CNwvsoCweZd-D-CnkUlTvos.cache +1 -0
  158. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/v5fEWeibBF3bJnNXl6GDLSSc09uS40w7gvgTemtWJEM.cache +1 -0
  159. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/vIkuzdZRmTP4Zm39V0e7bOPn0A0tkr1sis71UGqyMGg.cache +0 -0
  160. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/vbRYzK7AUgi8KFdTPFs-qIGuv6q4l5U0nkfwa259xeY.cache +2 -0
  161. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/vq4Ueez_d_cutTsmFDCMKW8QF7I467dlv6cxtT1gcqM.cache +0 -0
  162. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/vsoNnhL9ydTAsG82bXQWeidx8oSp4KJP040rmMrtoX8.cache +1 -0
  163. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/w30VpAm5prIt43U6WCFJrcKM3qWtoIPqEoojWV3MqNU.cache +0 -0
  164. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/wZV79IOJkXmYVNuenZTwJ31R6CpBukaiLVcmfAQP1y0.cache +1 -0
  165. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/x0CJc-3DTFsEYN-zIsz7bJiR3uGnmgFbFxCNk4L5PKg.cache +1 -0
  166. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/x8ytRQMIzyHVhCr6BLw1qDwmxMWtTT-GRBVx0XtbE7s.cache +1 -0
  167. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/xdNWaqf5Tso4UD6k3bhU6CqOgoHpmNRfrliS7sDBiME.cache +0 -0
  168. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/yFYEN_PAfWHxKLcxJ_Q3jx-7_LJT-HV4MmtQcugDtGc.cache +1 -0
  169. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/yeeoNX3Qgqailr7LBzxNZ8O8E2H6TnEp-yI_coeeFrI.cache +0 -0
  170. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/z9N_MlH3ciHLi5sH5FwkuoJPGDyy4AqfokO37x0mvu4.cache +1 -0
  171. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/zqQOExGHU4HLUcNUWnrRI_fUWF590L5q9BkmS-km3p0.cache +1 -0
  172. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/zu1q_E_YBDpnceAQWABitXgzccuKfhVR7adF84JNgT0.cache +1 -0
  173. data/test/dummy/tmp/pids/server.pid +1 -0
  174. metadata +289 -13
  175. data/app/assets/javascripts/jquery.uploadify.js +0 -986
  176. data/app/assets/stylesheets/uploadify.scss +0 -93
  177. data/test/dummy/public/uploads/pulitzer/content_element/image/1/demo05.jpeg +0 -0
  178. data/test/dummy/public/uploads/pulitzer/content_element/image/1/thumb_demo05.jpeg +0 -0
  179. data/test/dummy/public/uploads/pulitzer/content_element/image/10/demo03.jpeg +0 -0
  180. data/test/dummy/public/uploads/pulitzer/content_element/image/10/thumb_demo03.jpeg +0 -0
@@ -1,986 +0,0 @@
1
- /*
2
- SWFObject v2.2 <http://code.google.com/p/swfobject/>
3
- is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
4
- */
5
- ;var 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;
6
- 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;
7
- 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);
8
- 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");
9
- 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};
10
- }(),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();
11
- }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);
12
- 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;
13
- }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"));
14
- 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);
15
- }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;
16
- 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);
17
- 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(",");
18
- 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();
19
- })();}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);
20
- 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;
21
- 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");
22
- }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");
23
- }}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;
24
- 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);
25
- }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";
26
- }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";
27
- 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;
28
- }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";
29
- (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");
30
- 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);
31
- }})();}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];
32
- 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));
33
- }}}}}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];
34
- }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]+'" />';
35
- }}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);
36
- 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]);
37
- }}}}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");
38
- 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";
39
- (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;
40
- }}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);
41
- 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;
42
- }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;
43
- 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];
44
- }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+"}"));
45
- }}}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=/[\\\"<>\.;]/;
46
- 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;
47
- 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;
48
- }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;
49
- 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};
50
- 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;
51
- 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];
52
- }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);
53
- 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]};
54
- },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);
55
- }},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;
56
- 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)));
57
- }}}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";
58
- }}if(E){E(B);}}a=false;}}};}();
59
-
60
- /*
61
- SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com
62
-
63
- mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/
64
-
65
- SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilzén and Mammon Media and is released under the MIT License:
66
- http://www.opensource.org/licenses/mit-license.php
67
-
68
- SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License:
69
- http://www.opensource.org/licenses/mit-license.php
70
- */
71
-
72
- var SWFUpload;if(SWFUpload==undefined){SWFUpload=function(a){this.initSWFUpload(a)}}SWFUpload.prototype.initSWFUpload=function(b){try{this.customSettings={};this.settings=b;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo()}catch(a){delete SWFUpload.instances[this.movieName];throw a}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.0 2009-03-25";SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120};SWFUpload.CURSOR={ARROW:-1,HAND:-2};SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};SWFUpload.completeURL=function(a){if(typeof(a)!=="string"||a.match(/^https?:\/\//i)||a.match(/^\//)){return a}var c=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"");var b=window.location.pathname.lastIndexOf("/");if(b<=0){path="/"}else{path=window.location.pathname.substr(0,b)+"/"}return path+a};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(b,a){this.settings[b]=(this.settings[b]==undefined)?a:this.settings[b]};this.ensureDefault("upload_url","");this.ensureDefault("preserve_relative_urls",false);this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);this.ensureDefault("http_success",[]);this.ensureDefault("assume_success_timeout",0);this.ensureDefault("file_types","*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",true);this.ensureDefault("button_image_url","");this.ensureDefault("button_width",1);this.ensureDefault("button_height",1);this.ensureDefault("button_text","");this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;");this.ensureDefault("button_text_top_padding",0);this.ensureDefault("button_text_left_padding",0);this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);this.ensureDefault("button_disabled",false);this.ensureDefault("button_placeholder_id","");this.ensureDefault("button_placeholder",null);this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW);this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW);this.ensureDefault("debug",false);this.settings.debug_enabled=this.settings.debug;this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault("swfupload_loaded_handler",null);this.ensureDefault("file_dialog_start_handler",null);this.ensureDefault("file_queued_handler",null);this.ensureDefault("file_queue_error_handler",null);this.ensureDefault("file_dialog_complete_handler",null);this.ensureDefault("upload_start_handler",null);this.ensureDefault("upload_progress_handler",null);this.ensureDefault("upload_error_handler",null);this.ensureDefault("upload_success_handler",null);this.ensureDefault("upload_complete_handler",null);this.ensureDefault("debug_handler",this.debugMessage);this.ensureDefault("custom_settings",{});this.customSettings=this.settings.custom_settings;if(!!this.settings.prevent_swf_caching){this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+new Date().getTime()}if(!this.settings.preserve_relative_urls){this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url)}delete this.ensureDefault};SWFUpload.prototype.loadFlash=function(){var a,b;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added"}a=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(a==undefined){throw"Could not find the placeholder element: "+this.settings.button_placeholder_id}b=document.createElement("div");b.innerHTML=this.getFlashHTML();a.parentNode.replaceChild(b.firstChild,a);if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement()}};SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload">','<param name="wmode" value="',this.settings.button_window_mode,'" />','<param name="movie" value="',this.settings.flash_url,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />',"</object>"].join("")};SWFUpload.prototype.getFlashVars=function(){var b=this.buildParamString();var a=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(a),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",encodeURIComponent(b),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")};SWFUpload.prototype.getMovieElement=function(){if(this.movieElement==undefined){this.movieElement=document.getElementById(this.movieName)}if(this.movieElement===null){throw"Could not find Flash element"}return this.movieElement};SWFUpload.prototype.buildParamString=function(){var c=this.settings.post_params;var b=[];if(typeof(c)==="object"){for(var a in c){if(c.hasOwnProperty(a)){b.push(encodeURIComponent(a.toString())+"="+encodeURIComponent(c[a].toString()))}}}return b.join("&amp;")};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var a=null;a=this.getMovieElement();if(a&&typeof(a.CallFunction)==="unknown"){for(var c in a){try{if(typeof(a[c])==="function"){a[c]=null}}catch(e){}}try{a.parentNode.removeChild(a)}catch(b){}}window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieElement=null;this.settings=null;this.customSettings=null;this.eventQueue=null;this.movieName=null;return true}catch(d){return false}};SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url: ",this.settings.upload_url,"\n","\t","flash_url: ",this.settings.flash_url,"\n","\t","use_query_string: ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error: ",this.settings.requeue_on_error.toString(),"\n","\t","http_success: ",this.settings.http_success.join(", "),"\n","\t","assume_success_timeout: ",this.settings.assume_success_timeout,"\n","\t","file_post_name: ",this.settings.file_post_name,"\n","\t","post_params: ",this.settings.post_params.toString(),"\n","\t","file_types: ",this.settings.file_types,"\n","\t","file_types_description: ",this.settings.file_types_description,"\n","\t","file_size_limit: ",this.settings.file_size_limit,"\n","\t","file_upload_limit: ",this.settings.file_upload_limit,"\n","\t","file_queue_limit: ",this.settings.file_queue_limit,"\n","\t","debug: ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching: ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id: ",this.settings.button_placeholder_id.toString(),"\n","\t","button_placeholder: ",(this.settings.button_placeholder?"Set":"Not Set"),"\n","\t","button_image_url: ",this.settings.button_image_url.toString(),"\n","\t","button_width: ",this.settings.button_width.toString(),"\n","\t","button_height: ",this.settings.button_height.toString(),"\n","\t","button_text: ",this.settings.button_text.toString(),"\n","\t","button_text_style: ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding: ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action: ",this.settings.button_action.toString(),"\n","\t","button_disabled: ",this.settings.button_disabled.toString(),"\n","\t","custom_settings: ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned: ",(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n","\t","file_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler==="function").toString(),"\n","\t","file_queued_handler assigned: ",(typeof this.settings.file_queued_handler==="function").toString(),"\n","\t","file_queue_error_handler assigned: ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n","\t","upload_start_handler assigned: ",(typeof this.settings.upload_start_handler==="function").toString(),"\n","\t","upload_progress_handler assigned: ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n","\t","upload_error_handler assigned: ",(typeof this.settings.upload_error_handler==="function").toString(),"\n","\t","upload_success_handler assigned: ",(typeof this.settings.upload_success_handler==="function").toString(),"\n","\t","upload_complete_handler assigned: ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n","\t","debug_handler assigned: ",(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""))};SWFUpload.prototype.addSetting=function(b,c,a){if(c==undefined){return(this.settings[b]=a)}else{return(this.settings[b]=c)}};SWFUpload.prototype.getSetting=function(a){if(this.settings[a]!=undefined){return this.settings[a]}return""};SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement();var returnValue,returnString;try{returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+"</invoke>");returnValue=eval(returnString)}catch(ex){throw"Call to "+functionName+" failed"}if(returnValue!=undefined&&typeof returnValue.post==="object"){returnValue=this.unescapeFilePostParams(returnValue)}return returnValue};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")};SWFUpload.prototype.startUpload=function(a){this.callFlash("StartUpload",[a])};SWFUpload.prototype.cancelUpload=function(a,b){if(b!==false){b=true}this.callFlash("CancelUpload",[a,b])};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")};SWFUpload.prototype.setStats=function(a){this.callFlash("SetStats",[a])};SWFUpload.prototype.getFile=function(a){if(typeof(a)==="number"){return this.callFlash("GetFileByIndex",[a])}else{return this.callFlash("GetFile",[a])}};SWFUpload.prototype.addFileParam=function(a,b,c){return this.callFlash("AddFileParam",[a,b,c])};SWFUpload.prototype.removeFileParam=function(a,b){this.callFlash("RemoveFileParam",[a,b])};SWFUpload.prototype.setUploadURL=function(a){this.settings.upload_url=a.toString();this.callFlash("SetUploadURL",[a])};SWFUpload.prototype.setPostParams=function(a){this.settings.post_params=a;this.callFlash("SetPostParams",[a])};SWFUpload.prototype.addPostParam=function(a,b){this.settings.post_params[a]=b;this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.removePostParam=function(a){delete this.settings.post_params[a];this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.setFileTypes=function(a,b){this.settings.file_types=a;this.settings.file_types_description=b;this.callFlash("SetFileTypes",[a,b])};SWFUpload.prototype.setFileSizeLimit=function(a){this.settings.file_size_limit=a;this.callFlash("SetFileSizeLimit",[a])};SWFUpload.prototype.setFileUploadLimit=function(a){this.settings.file_upload_limit=a;this.callFlash("SetFileUploadLimit",[a])};SWFUpload.prototype.setFileQueueLimit=function(a){this.settings.file_queue_limit=a;this.callFlash("SetFileQueueLimit",[a])};SWFUpload.prototype.setFilePostName=function(a){this.settings.file_post_name=a;this.callFlash("SetFilePostName",[a])};SWFUpload.prototype.setUseQueryString=function(a){this.settings.use_query_string=a;this.callFlash("SetUseQueryString",[a])};SWFUpload.prototype.setRequeueOnError=function(a){this.settings.requeue_on_error=a;this.callFlash("SetRequeueOnError",[a])};SWFUpload.prototype.setHTTPSuccess=function(a){if(typeof a==="string"){a=a.replace(" ","").split(",")}this.settings.http_success=a;this.callFlash("SetHTTPSuccess",[a])};SWFUpload.prototype.setAssumeSuccessTimeout=function(a){this.settings.assume_success_timeout=a;this.callFlash("SetAssumeSuccessTimeout",[a])};SWFUpload.prototype.setDebugEnabled=function(a){this.settings.debug_enabled=a;this.callFlash("SetDebugEnabled",[a])};SWFUpload.prototype.setButtonImageURL=function(a){if(a==undefined){a=""}this.settings.button_image_url=a;this.callFlash("SetButtonImageURL",[a])};SWFUpload.prototype.setButtonDimensions=function(c,a){this.settings.button_width=c;this.settings.button_height=a;var b=this.getMovieElement();if(b!=undefined){b.style.width=c+"px";b.style.height=a+"px"}this.callFlash("SetButtonDimensions",[c,a])};SWFUpload.prototype.setButtonText=function(a){this.settings.button_text=a;this.callFlash("SetButtonText",[a])};SWFUpload.prototype.setButtonTextPadding=function(b,a){this.settings.button_text_top_padding=a;this.settings.button_text_left_padding=b;this.callFlash("SetButtonTextPadding",[b,a])};SWFUpload.prototype.setButtonTextStyle=function(a){this.settings.button_text_style=a;this.callFlash("SetButtonTextStyle",[a])};SWFUpload.prototype.setButtonDisabled=function(a){this.settings.button_disabled=a;this.callFlash("SetButtonDisabled",[a])};SWFUpload.prototype.setButtonAction=function(a){this.settings.button_action=a;this.callFlash("SetButtonAction",[a])};SWFUpload.prototype.setButtonCursor=function(a){this.settings.button_cursor=a;this.callFlash("SetButtonCursor",[a])};SWFUpload.prototype.queueEvent=function(b,c){if(c==undefined){c=[]}else{if(!(c instanceof Array)){c=[c]}}var a=this;if(typeof this.settings[b]==="function"){this.eventQueue.push(function(){this.settings[b].apply(this,c)});setTimeout(function(){a.executeNextEvent()},0)}else{if(this.settings[b]!==null){throw"Event handler "+b+" is unknown or is not a function"}}};SWFUpload.prototype.executeNextEvent=function(){var a=this.eventQueue?this.eventQueue.shift():null;if(typeof(a)==="function"){a.apply(this)}};SWFUpload.prototype.unescapeFilePostParams=function(c){var e=/[$]([0-9a-f]{4})/i;var f={};var d;if(c!=undefined){for(var a in c.post){if(c.post.hasOwnProperty(a)){d=a;var b;while((b=e.exec(d))!==null){d=d.replace(b[0],String.fromCharCode(parseInt("0x"+b[1],16)))}f[d]=c.post[a]}}c.post=f}return c};SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(a){return false}};SWFUpload.prototype.flashReady=function(){var a=this.getMovieElement();if(!a){this.debug("Flash called back ready but the flash movie can't be found.");return}this.cleanUp(a);this.queueEvent("swfupload_loaded_handler")};SWFUpload.prototype.cleanUp=function(a){try{if(this.movieElement&&typeof(a.CallFunction)==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var c in a){try{if(typeof(a[c])==="function"){a[c]=null}}catch(b){}}}}catch(d){}window.__flash__removeCallback=function(e,f){try{if(e){e[f]=null}}catch(g){}}};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};SWFUpload.prototype.fileQueued=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("file_queued_handler",a)};SWFUpload.prototype.fileQueueError=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent("file_queue_error_handler",[a,c,b])};SWFUpload.prototype.fileDialogComplete=function(b,c,a){this.queueEvent("file_dialog_complete_handler",[b,c,a])};SWFUpload.prototype.uploadStart=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("return_upload_start_handler",a)};SWFUpload.prototype.returnUploadStart=function(a){var b;if(typeof this.settings.upload_start_handler==="function"){a=this.unescapeFilePostParams(a);b=this.settings.upload_start_handler.call(this,a)}else{if(this.settings.upload_start_handler!=undefined){throw"upload_start_handler must be a function"}}if(b===undefined){b=true}b=!!b;this.callFlash("ReturnUploadStart",[b])};SWFUpload.prototype.uploadProgress=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent("upload_progress_handler",[a,c,b])};SWFUpload.prototype.uploadError=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent("upload_error_handler",[a,c,b])};SWFUpload.prototype.uploadSuccess=function(b,a,c){b=this.unescapeFilePostParams(b);this.queueEvent("upload_success_handler",[b,a,c])};SWFUpload.prototype.uploadComplete=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("upload_complete_handler",a)};SWFUpload.prototype.debug=function(a){this.queueEvent("debug_handler",a)};SWFUpload.prototype.debugMessage=function(c){if(this.settings.debug){var a,d=[];if(typeof c==="object"&&typeof c.name==="string"&&typeof c.message==="string"){for(var b in c){if(c.hasOwnProperty(b)){d.push(b+": "+c[b])}}a=d.join("\n")||"";d=a.split("\n");a="EXCEPTION: "+d.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(a)}else{SWFUpload.Console.writeLine(c)}}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(d){var b,a;try{b=document.getElementById("SWFUpload_Console");if(!b){a=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(a);b=document.createElement("textarea");b.id="SWFUpload_Console";b.style.fontFamily="monospace";b.setAttribute("wrap","off");b.wrap="off";b.style.overflow="auto";b.style.width="700px";b.style.height="350px";b.style.margin="5px";a.appendChild(b)}b.value+=d+"\n";b.scrollTop=b.scrollHeight-b.clientHeight}catch(c){alert("Exception: "+c.name+" Message: "+c.message)}};
73
-
74
- /*
75
- Uploadify v3.2.1
76
- Copyright (c) 2012 Reactive Apps, Ronnie Garcia
77
- Released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
78
- */
79
-
80
- (function($) {
81
-
82
- // These methods can be called by adding them as the first argument in the uploadify plugin call
83
- var methods = {
84
-
85
- init : function(options, swfUploadOptions) {
86
-
87
- return this.each(function() {
88
-
89
- // Create a reference to the jQuery DOM object
90
- var $this = $(this);
91
-
92
- // Clone the original DOM object
93
- var $clone = $this.clone();
94
-
95
- // Setup the default options
96
- var settings = $.extend({
97
- // Required Settings
98
- id : $this.attr('id'), // The ID of the DOM object
99
- swf : 'uploadify.swf', // The path to the uploadify SWF file
100
- uploader : 'uploadify.php', // The path to the server-side upload script
101
-
102
- // Options
103
- auto : true, // Automatically upload files when added to the queue
104
- buttonClass : '', // A class name to add to the browse button DOM object
105
- buttonCursor : 'hand', // The cursor to use with the browse button
106
- buttonImage : null, // (String or null) The path to an image to use for the Flash browse button if not using CSS to style the button
107
- buttonText : 'SELECT FILES', // The text to use for the browse button
108
- checkExisting : false, // The path to a server-side script that checks for existing files on the server
109
- debug : false, // Turn on swfUpload debugging mode
110
- fileObjName : 'Filedata', // The name of the file object to use in your server-side script
111
- fileSizeLimit : 0, // The maximum size of an uploadable file in KB (Accepts units B KB MB GB if string, 0 for no limit)
112
- fileTypeDesc : 'All Files', // The description for file types in the browse dialog
113
- fileTypeExts : '*.*', // Allowed extensions in the browse dialog (server-side validation should also be used)
114
- height : 30, // The height of the browse button
115
- itemTemplate : false, // The template for the file item in the queue
116
- method : 'post', // The method to use when sending files to the server-side upload script
117
- multi : true, // Allow multiple file selection in the browse dialog
118
- formData : {}, // An object with additional data to send to the server-side upload script with every file upload
119
- preventCaching : true, // Adds a random value to the Flash URL to prevent caching of it (conflicts with existing parameters)
120
- progressData : 'percentage', // ('percentage' or 'speed') Data to show in the queue item during a file upload
121
- queueID : false, // The ID of the DOM object to use as a file queue (without the #)
122
- queueSizeLimit : 999, // The maximum number of files that can be in the queue at one time
123
- removeCompleted : true, // Remove queue items from the queue when they are done uploading
124
- removeTimeout : 3, // The delay in seconds before removing a queue item if removeCompleted is set to true
125
- requeueErrors : false, // Keep errored files in the queue and keep trying to upload them
126
- successTimeout : 30, // The number of seconds to wait for Flash to detect the server's response after the file has finished uploading
127
- uploadLimit : 0, // The maximum number of files you can upload
128
- width : 120, // The width of the browse button
129
-
130
- // Events
131
- overrideEvents : [] // (Array) A list of default event handlers to skip
132
- /*
133
- onCancel // Triggered when a file is cancelled from the queue
134
- onClearQueue // Triggered during the 'clear queue' method
135
- onDestroy // Triggered when the uploadify object is destroyed
136
- onDialogClose // Triggered when the browse dialog is closed
137
- onDialogOpen // Triggered when the browse dialog is opened
138
- onDisable // Triggered when the browse button gets disabled
139
- onEnable // Triggered when the browse button gets enabled
140
- onFallback // Triggered is Flash is not detected
141
- onInit // Triggered when Uploadify is initialized
142
- onQueueComplete // Triggered when all files in the queue have been uploaded
143
- onSelectError // Triggered when an error occurs while selecting a file (file size, queue size limit, etc.)
144
- onSelect // Triggered for each file that is selected
145
- onSWFReady // Triggered when the SWF button is loaded
146
- onUploadComplete // Triggered when a file upload completes (success or error)
147
- onUploadError // Triggered when a file upload returns an error
148
- onUploadSuccess // Triggered when a file is uploaded successfully
149
- onUploadProgress // Triggered every time a file progress is updated
150
- onUploadStart // Triggered immediately before a file upload starts
151
- */
152
- }, options);
153
-
154
- // Prepare settings for SWFUpload
155
- var swfUploadSettings = {
156
- assume_success_timeout : settings.successTimeout,
157
- button_placeholder_id : settings.id,
158
- button_width : settings.width,
159
- button_height : settings.height,
160
- button_text : null,
161
- button_text_style : null,
162
- button_text_top_padding : 0,
163
- button_text_left_padding : 0,
164
- button_action : (settings.multi ? SWFUpload.BUTTON_ACTION.SELECT_FILES : SWFUpload.BUTTON_ACTION.SELECT_FILE),
165
- button_disabled : false,
166
- button_cursor : (settings.buttonCursor == 'arrow' ? SWFUpload.CURSOR.ARROW : SWFUpload.CURSOR.HAND),
167
- button_window_mode : SWFUpload.WINDOW_MODE.TRANSPARENT,
168
- debug : settings.debug,
169
- requeue_on_error : settings.requeueErrors,
170
- file_post_name : settings.fileObjName,
171
- file_size_limit : settings.fileSizeLimit,
172
- file_types : settings.fileTypeExts,
173
- file_types_description : settings.fileTypeDesc,
174
- file_queue_limit : settings.queueSizeLimit,
175
- file_upload_limit : settings.uploadLimit,
176
- flash_url : settings.swf,
177
- prevent_swf_caching : settings.preventCaching,
178
- post_params : settings.formData,
179
- upload_url : settings.uploader,
180
- use_query_string : (settings.method == 'get'),
181
-
182
- // Event Handlers
183
- file_dialog_complete_handler : handlers.onDialogClose,
184
- file_dialog_start_handler : handlers.onDialogOpen,
185
- file_queued_handler : handlers.onSelect,
186
- file_queue_error_handler : handlers.onSelectError,
187
- swfupload_loaded_handler : settings.onSWFReady,
188
- upload_complete_handler : handlers.onUploadComplete,
189
- upload_error_handler : handlers.onUploadError,
190
- upload_progress_handler : handlers.onUploadProgress,
191
- upload_start_handler : handlers.onUploadStart,
192
- upload_success_handler : handlers.onUploadSuccess
193
- }
194
-
195
- // Merge the user-defined options with the defaults
196
- if (swfUploadOptions) {
197
- swfUploadSettings = $.extend(swfUploadSettings, swfUploadOptions);
198
- }
199
- // Add the user-defined settings to the swfupload object
200
- swfUploadSettings = $.extend(swfUploadSettings, settings);
201
-
202
- // Detect if Flash is available
203
- var playerVersion = swfobject.getFlashPlayerVersion();
204
- var flashInstalled = (playerVersion.major >= 9);
205
-
206
- if (flashInstalled) {
207
- // Create the swfUpload instance
208
- window['uploadify_' + settings.id] = new SWFUpload(swfUploadSettings);
209
- var swfuploadify = window['uploadify_' + settings.id];
210
-
211
- // Add the SWFUpload object to the elements data object
212
- $this.data('uploadify', swfuploadify);
213
-
214
- // Wrap the instance
215
- var $wrapper = $('<div />', {
216
- 'id' : settings.id,
217
- 'class' : 'uploadify',
218
- 'css' : {
219
- 'height' : settings.height + 'px',
220
- 'width' : settings.width + 'px'
221
- }
222
- });
223
- $('#' + swfuploadify.movieName).wrap($wrapper);
224
- // Recreate the reference to wrapper
225
- $wrapper = $('#' + settings.id);
226
- // Add the data object to the wrapper
227
- $wrapper.data('uploadify', swfuploadify);
228
-
229
- // Create the button
230
- var $button = $('<div />', {
231
- 'id' : settings.id + '-button',
232
- 'class' : 'uploadify-button ' + settings.buttonClass
233
- });
234
- if (settings.buttonImage) {
235
- $button.css({
236
- 'background-image' : "url('" + settings.buttonImage + "')",
237
- 'text-indent' : '-9999px'
238
- });
239
- }
240
- $button.html('<span class="uploadify-button-text">' + settings.buttonText + '</span>')
241
- .css({
242
- 'height' : settings.height + 'px',
243
- 'line-height' : settings.height + 'px',
244
- 'width' : settings.width + 'px'
245
- });
246
- // Append the button to the wrapper
247
- $wrapper.append($button);
248
-
249
- // Adjust the styles of the movie
250
- $('#' + swfuploadify.movieName).css({
251
- 'position' : 'absolute',
252
- 'z-index' : 1
253
- });
254
-
255
- // Create the file queue
256
- if (!settings.queueID) {
257
- var $queue = $('<div />', {
258
- 'id' : settings.id + '-queue',
259
- 'class' : 'uploadify-queue'
260
- });
261
- $wrapper.after($queue);
262
- swfuploadify.settings.queueID = settings.id + '-queue';
263
- swfuploadify.settings.defaultQueue = true;
264
- }
265
-
266
- // Create some queue related objects and variables
267
- swfuploadify.queueData = {
268
- files : {}, // The files in the queue
269
- filesSelected : 0, // The number of files selected in the last select operation
270
- filesQueued : 0, // The number of files added to the queue in the last select operation
271
- filesReplaced : 0, // The number of files replaced in the last select operation
272
- filesCancelled : 0, // The number of files that were cancelled instead of replaced
273
- filesErrored : 0, // The number of files that caused error in the last select operation
274
- uploadsSuccessful : 0, // The number of files that were successfully uploaded
275
- uploadsErrored : 0, // The number of files that returned errors during upload
276
- averageSpeed : 0, // The average speed of the uploads in KB
277
- queueLength : 0, // The number of files in the queue
278
- queueSize : 0, // The size in bytes of the entire queue
279
- uploadSize : 0, // The size in bytes of the upload queue
280
- queueBytesUploaded : 0, // The size in bytes that have been uploaded for the current upload queue
281
- uploadQueue : [], // The files currently to be uploaded
282
- errorMsg : 'Some files were not added to the queue:'
283
- };
284
-
285
- // Save references to all the objects
286
- swfuploadify.original = $clone;
287
- swfuploadify.wrapper = $wrapper;
288
- swfuploadify.button = $button;
289
- swfuploadify.queue = $queue;
290
-
291
- // Call the user-defined init event handler
292
- if (settings.onInit) settings.onInit.call($this, swfuploadify);
293
-
294
- } else {
295
-
296
- // Call the fallback function
297
- if (settings.onFallback) settings.onFallback.call($this);
298
-
299
- }
300
- });
301
-
302
- },
303
-
304
- // Stop a file upload and remove it from the queue
305
- cancel : function(fileID, supressEvent) {
306
-
307
- var args = arguments;
308
-
309
- this.each(function() {
310
- // Create a reference to the jQuery DOM object
311
- var $this = $(this),
312
- swfuploadify = $this.data('uploadify'),
313
- settings = swfuploadify.settings,
314
- delay = -1;
315
-
316
- if (args[0]) {
317
- // Clear the queue
318
- if (args[0] == '*') {
319
- var queueItemCount = swfuploadify.queueData.queueLength;
320
- $('#' + settings.queueID).find('.uploadify-queue-item').each(function() {
321
- delay++;
322
- if (args[1] === true) {
323
- swfuploadify.cancelUpload($(this).attr('id'), false);
324
- } else {
325
- swfuploadify.cancelUpload($(this).attr('id'));
326
- }
327
- $(this).find('.data').removeClass('data').html(' - Cancelled');
328
- $(this).find('.uploadify-progress-bar').remove();
329
- $(this).delay(1000 + 100 * delay).fadeOut(500, function() {
330
- $(this).remove();
331
- });
332
- });
333
- swfuploadify.queueData.queueSize = 0;
334
- swfuploadify.queueData.queueLength = 0;
335
- // Trigger the onClearQueue event
336
- if (settings.onClearQueue) settings.onClearQueue.call($this, queueItemCount);
337
- } else {
338
- for (var n = 0; n < args.length; n++) {
339
- swfuploadify.cancelUpload(args[n]);
340
- $('#' + args[n]).find('.data').removeClass('data').html(' - Cancelled');
341
- $('#' + args[n]).find('.uploadify-progress-bar').remove();
342
- $('#' + args[n]).delay(1000 + 100 * n).fadeOut(500, function() {
343
- $(this).remove();
344
- });
345
- }
346
- }
347
- } else {
348
- var item = $('#' + settings.queueID).find('.uploadify-queue-item').get(0);
349
- $item = $(item);
350
- swfuploadify.cancelUpload($item.attr('id'));
351
- $item.find('.data').removeClass('data').html(' - Cancelled');
352
- $item.find('.uploadify-progress-bar').remove();
353
- $item.delay(1000).fadeOut(500, function() {
354
- $(this).remove();
355
- });
356
- }
357
- });
358
-
359
- },
360
-
361
- // Revert the DOM object back to its original state
362
- destroy : function() {
363
-
364
- this.each(function() {
365
- // Create a reference to the jQuery DOM object
366
- var $this = $(this),
367
- swfuploadify = $this.data('uploadify'),
368
- settings = swfuploadify.settings;
369
-
370
- // Destroy the SWF object and
371
- swfuploadify.destroy();
372
-
373
- // Destroy the queue
374
- if (settings.defaultQueue) {
375
- $('#' + settings.queueID).remove();
376
- }
377
-
378
- // Reload the original DOM element
379
- $('#' + settings.id).replaceWith(swfuploadify.original);
380
-
381
- // Call the user-defined event handler
382
- if (settings.onDestroy) settings.onDestroy.call(this);
383
-
384
- delete swfuploadify;
385
- });
386
-
387
- },
388
-
389
- // Disable the select button
390
- disable : function(isDisabled) {
391
-
392
- this.each(function() {
393
- // Create a reference to the jQuery DOM object
394
- var $this = $(this),
395
- swfuploadify = $this.data('uploadify'),
396
- settings = swfuploadify.settings;
397
-
398
- // Call the user-defined event handlers
399
- if (isDisabled) {
400
- swfuploadify.button.addClass('disabled');
401
- if (settings.onDisable) settings.onDisable.call(this);
402
- } else {
403
- swfuploadify.button.removeClass('disabled');
404
- if (settings.onEnable) settings.onEnable.call(this);
405
- }
406
-
407
- // Enable/disable the browse button
408
- swfuploadify.setButtonDisabled(isDisabled);
409
- });
410
-
411
- },
412
-
413
- // Get or set the settings data
414
- settings : function(name, value, resetObjects) {
415
-
416
- var args = arguments;
417
- var returnValue = value;
418
-
419
- this.each(function() {
420
- // Create a reference to the jQuery DOM object
421
- var $this = $(this),
422
- swfuploadify = $this.data('uploadify'),
423
- settings = swfuploadify.settings;
424
-
425
- if (typeof(args[0]) == 'object') {
426
- for (var n in value) {
427
- setData(n,value[n]);
428
- }
429
- }
430
- if (args.length === 1) {
431
- returnValue = settings[name];
432
- } else {
433
- switch (name) {
434
- case 'uploader':
435
- swfuploadify.setUploadURL(value);
436
- break;
437
- case 'formData':
438
- if (!resetObjects) {
439
- value = $.extend(settings.formData, value);
440
- }
441
- swfuploadify.setPostParams(settings.formData);
442
- break;
443
- case 'method':
444
- if (value == 'get') {
445
- swfuploadify.setUseQueryString(true);
446
- } else {
447
- swfuploadify.setUseQueryString(false);
448
- }
449
- break;
450
- case 'fileObjName':
451
- swfuploadify.setFilePostName(value);
452
- break;
453
- case 'fileTypeExts':
454
- swfuploadify.setFileTypes(value, settings.fileTypeDesc);
455
- break;
456
- case 'fileTypeDesc':
457
- swfuploadify.setFileTypes(settings.fileTypeExts, value);
458
- break;
459
- case 'fileSizeLimit':
460
- swfuploadify.setFileSizeLimit(value);
461
- break;
462
- case 'uploadLimit':
463
- swfuploadify.setFileUploadLimit(value);
464
- break;
465
- case 'queueSizeLimit':
466
- swfuploadify.setFileQueueLimit(value);
467
- break;
468
- case 'buttonImage':
469
- swfuploadify.button.css('background-image', settingValue);
470
- break;
471
- case 'buttonCursor':
472
- if (value == 'arrow') {
473
- swfuploadify.setButtonCursor(SWFUpload.CURSOR.ARROW);
474
- } else {
475
- swfuploadify.setButtonCursor(SWFUpload.CURSOR.HAND);
476
- }
477
- break;
478
- case 'buttonText':
479
- $('#' + settings.id + '-button').find('.uploadify-button-text').html(value);
480
- break;
481
- case 'width':
482
- swfuploadify.setButtonDimensions(value, settings.height);
483
- break;
484
- case 'height':
485
- swfuploadify.setButtonDimensions(settings.width, value);
486
- break;
487
- case 'multi':
488
- if (value) {
489
- swfuploadify.setButtonAction(SWFUpload.BUTTON_ACTION.SELECT_FILES);
490
- } else {
491
- swfuploadify.setButtonAction(SWFUpload.BUTTON_ACTION.SELECT_FILE);
492
- }
493
- break;
494
- }
495
- settings[name] = value;
496
- }
497
- });
498
-
499
- if (args.length === 1) {
500
- return returnValue;
501
- }
502
-
503
- },
504
-
505
- // Stop the current uploads and requeue what is in progress
506
- stop : function() {
507
-
508
- this.each(function() {
509
- // Create a reference to the jQuery DOM object
510
- var $this = $(this),
511
- swfuploadify = $this.data('uploadify');
512
-
513
- // Reset the queue information
514
- swfuploadify.queueData.averageSpeed = 0;
515
- swfuploadify.queueData.uploadSize = 0;
516
- swfuploadify.queueData.bytesUploaded = 0;
517
- swfuploadify.queueData.uploadQueue = [];
518
-
519
- swfuploadify.stopUpload();
520
- });
521
-
522
- },
523
-
524
- // Start uploading files in the queue
525
- upload : function() {
526
-
527
- var args = arguments;
528
-
529
- this.each(function() {
530
- // Create a reference to the jQuery DOM object
531
- var $this = $(this),
532
- swfuploadify = $this.data('uploadify');
533
-
534
- // Reset the queue information
535
- swfuploadify.queueData.averageSpeed = 0;
536
- swfuploadify.queueData.uploadSize = 0;
537
- swfuploadify.queueData.bytesUploaded = 0;
538
- swfuploadify.queueData.uploadQueue = [];
539
-
540
- // Upload the files
541
- if (args[0]) {
542
- if (args[0] == '*') {
543
- swfuploadify.queueData.uploadSize = swfuploadify.queueData.queueSize;
544
- swfuploadify.queueData.uploadQueue.push('*');
545
- swfuploadify.startUpload();
546
- } else {
547
- for (var n = 0; n < args.length; n++) {
548
- swfuploadify.queueData.uploadSize += swfuploadify.queueData.files[args[n]].size;
549
- swfuploadify.queueData.uploadQueue.push(args[n]);
550
- }
551
- swfuploadify.startUpload(swfuploadify.queueData.uploadQueue.shift());
552
- }
553
- } else {
554
- swfuploadify.startUpload();
555
- }
556
-
557
- });
558
-
559
- }
560
-
561
- }
562
-
563
- // These functions handle all the events that occur with the file uploader
564
- var handlers = {
565
-
566
- // Triggered when the file dialog is opened
567
- onDialogOpen : function() {
568
- // Load the swfupload settings
569
- var settings = this.settings;
570
-
571
- // Reset some queue info
572
- this.queueData.errorMsg = 'Some files were not added to the queue:';
573
- this.queueData.filesReplaced = 0;
574
- this.queueData.filesCancelled = 0;
575
-
576
- // Call the user-defined event handler
577
- if (settings.onDialogOpen) settings.onDialogOpen.call(this);
578
- },
579
-
580
- // Triggered when the browse dialog is closed
581
- onDialogClose : function(filesSelected, filesQueued, queueLength) {
582
- // Load the swfupload settings
583
- var settings = this.settings;
584
-
585
- // Update the queue information
586
- this.queueData.filesErrored = filesSelected - filesQueued;
587
- this.queueData.filesSelected = filesSelected;
588
- this.queueData.filesQueued = filesQueued - this.queueData.filesCancelled;
589
- this.queueData.queueLength = queueLength;
590
-
591
- // Run the default event handler
592
- if ($.inArray('onDialogClose', settings.overrideEvents) < 0) {
593
- if (this.queueData.filesErrored > 0) {
594
- alert(this.queueData.errorMsg);
595
- }
596
- }
597
-
598
- // Call the user-defined event handler
599
- if (settings.onDialogClose) settings.onDialogClose.call(this, this.queueData);
600
-
601
- // Upload the files if auto is true
602
- if (settings.auto) $('#' + settings.id).uploadify('upload', '*');
603
- },
604
-
605
- // Triggered once for each file added to the queue
606
- onSelect : function(file) {
607
- // Load the swfupload settings
608
- var settings = this.settings;
609
-
610
- // Check if a file with the same name exists in the queue
611
- var queuedFile = {};
612
- for (var n in this.queueData.files) {
613
- queuedFile = this.queueData.files[n];
614
- if (queuedFile.uploaded != true && queuedFile.name == file.name) {
615
- var replaceQueueItem = confirm('The file named "' + file.name + '" is already in the queue.\nDo you want to replace the existing item in the queue?');
616
- if (!replaceQueueItem) {
617
- this.cancelUpload(file.id);
618
- this.queueData.filesCancelled++;
619
- return false;
620
- } else {
621
- $('#' + queuedFile.id).remove();
622
- this.cancelUpload(queuedFile.id);
623
- this.queueData.filesReplaced++;
624
- }
625
- }
626
- }
627
-
628
- // Get the size of the file
629
- var fileSize = Math.round(file.size / 1024);
630
- var suffix = 'KB';
631
- if (fileSize > 1000) {
632
- fileSize = Math.round(fileSize / 1000);
633
- suffix = 'MB';
634
- }
635
- var fileSizeParts = fileSize.toString().split('.');
636
- fileSize = fileSizeParts[0];
637
- if (fileSizeParts.length > 1) {
638
- fileSize += '.' + fileSizeParts[1].substr(0,2);
639
- }
640
- fileSize += suffix;
641
-
642
- // Truncate the filename if it's too long
643
- var fileName = file.name;
644
- if (fileName.length > 25) {
645
- fileName = fileName.substr(0,25) + '...';
646
- }
647
-
648
- // Create the file data object
649
- itemData = {
650
- 'fileID' : file.id,
651
- 'instanceID' : settings.id,
652
- 'fileName' : fileName,
653
- 'fileSize' : fileSize
654
- }
655
-
656
- // Create the file item template
657
- if (settings.itemTemplate == false) {
658
- settings.itemTemplate = '<div id="${fileID}" class="uploadify-queue-item">\
659
- <div class="cancel">\
660
- <a href="javascript:$(\'#${instanceID}\').uploadify(\'cancel\', \'${fileID}\')">X</a>\
661
- </div>\
662
- <span class="fileName">${fileName} (${fileSize})</span><span class="data"></span>\
663
- <div class="uploadify-progress">\
664
- <div class="uploadify-progress-bar"><!--Progress Bar--></div>\
665
- </div>\
666
- </div>';
667
- }
668
-
669
- // Run the default event handler
670
- if ($.inArray('onSelect', settings.overrideEvents) < 0) {
671
-
672
- // Replace the item data in the template
673
- itemHTML = settings.itemTemplate;
674
- for (var d in itemData) {
675
- itemHTML = itemHTML.replace(new RegExp('\\$\\{' + d + '\\}', 'g'), itemData[d]);
676
- }
677
-
678
- // Add the file item to the queue
679
- $('#' + settings.queueID).append(itemHTML);
680
- }
681
-
682
- this.queueData.queueSize += file.size;
683
- this.queueData.files[file.id] = file;
684
-
685
- // Call the user-defined event handler
686
- if (settings.onSelect) settings.onSelect.apply(this, arguments);
687
- },
688
-
689
- // Triggered when a file is not added to the queue
690
- onSelectError : function(file, errorCode, errorMsg) {
691
- // Load the swfupload settings
692
- var settings = this.settings;
693
-
694
- // Run the default event handler
695
- if ($.inArray('onSelectError', settings.overrideEvents) < 0) {
696
- switch(errorCode) {
697
- case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:
698
- if (settings.queueSizeLimit > errorMsg) {
699
- this.queueData.errorMsg += '\nThe number of files selected exceeds the remaining upload limit (' + errorMsg + ').';
700
- } else {
701
- this.queueData.errorMsg += '\nThe number of files selected exceeds the queue size limit (' + settings.queueSizeLimit + ').';
702
- }
703
- break;
704
- case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
705
- this.queueData.errorMsg += '\nThe file "' + file.name + '" exceeds the size limit (' + settings.fileSizeLimit + ').';
706
- break;
707
- case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
708
- this.queueData.errorMsg += '\nThe file "' + file.name + '" is empty.';
709
- break;
710
- case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
711
- this.queueData.errorMsg += '\nThe file "' + file.name + '" is not an accepted file type (' + settings.fileTypeDesc + ').';
712
- break;
713
- }
714
- }
715
- if (errorCode != SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
716
- delete this.queueData.files[file.id];
717
- }
718
-
719
- // Call the user-defined event handler
720
- if (settings.onSelectError) settings.onSelectError.apply(this, arguments);
721
- },
722
-
723
- // Triggered when all the files in the queue have been processed
724
- onQueueComplete : function() {
725
- if (this.settings.onQueueComplete) this.settings.onQueueComplete.call(this, this.settings.queueData);
726
- },
727
-
728
- // Triggered when a file upload successfully completes
729
- onUploadComplete : function(file) {
730
- // Load the swfupload settings
731
- var settings = this.settings,
732
- swfuploadify = this;
733
-
734
- // Check if all the files have completed uploading
735
- var stats = this.getStats();
736
- this.queueData.queueLength = stats.files_queued;
737
- if (this.queueData.uploadQueue[0] == '*') {
738
- if (this.queueData.queueLength > 0) {
739
- this.startUpload();
740
- } else {
741
- this.queueData.uploadQueue = [];
742
-
743
- // Call the user-defined event handler for queue complete
744
- if (settings.onQueueComplete) settings.onQueueComplete.call(this, this.queueData);
745
- }
746
- } else {
747
- if (this.queueData.uploadQueue.length > 0) {
748
- this.startUpload(this.queueData.uploadQueue.shift());
749
- } else {
750
- this.queueData.uploadQueue = [];
751
-
752
- // Call the user-defined event handler for queue complete
753
- if (settings.onQueueComplete) settings.onQueueComplete.call(this, this.queueData);
754
- }
755
- }
756
-
757
- // Call the default event handler
758
- if ($.inArray('onUploadComplete', settings.overrideEvents) < 0) {
759
- if (settings.removeCompleted) {
760
- switch (file.filestatus) {
761
- case SWFUpload.FILE_STATUS.COMPLETE:
762
- setTimeout(function() {
763
- if ($('#' + file.id)) {
764
- swfuploadify.queueData.queueSize -= file.size;
765
- swfuploadify.queueData.queueLength -= 1;
766
- delete swfuploadify.queueData.files[file.id]
767
- $('#' + file.id).fadeOut(500, function() {
768
- $(this).remove();
769
- });
770
- }
771
- }, settings.removeTimeout * 1000);
772
- break;
773
- case SWFUpload.FILE_STATUS.ERROR:
774
- if (!settings.requeueErrors) {
775
- setTimeout(function() {
776
- if ($('#' + file.id)) {
777
- swfuploadify.queueData.queueSize -= file.size;
778
- swfuploadify.queueData.queueLength -= 1;
779
- delete swfuploadify.queueData.files[file.id];
780
- $('#' + file.id).fadeOut(500, function() {
781
- $(this).remove();
782
- });
783
- }
784
- }, settings.removeTimeout * 1000);
785
- }
786
- break;
787
- }
788
- } else {
789
- file.uploaded = true;
790
- }
791
- }
792
-
793
- // Call the user-defined event handler
794
- if (settings.onUploadComplete) settings.onUploadComplete.call(this, file);
795
- },
796
-
797
- // Triggered when a file upload returns an error
798
- onUploadError : function(file, errorCode, errorMsg) {
799
- // Load the swfupload settings
800
- var settings = this.settings;
801
-
802
- // Set the error string
803
- var errorString = 'Error';
804
- switch(errorCode) {
805
- case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
806
- errorString = 'HTTP Error (' + errorMsg + ')';
807
- break;
808
- case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:
809
- errorString = 'Missing Upload URL';
810
- break;
811
- case SWFUpload.UPLOAD_ERROR.IO_ERROR:
812
- errorString = 'IO Error';
813
- break;
814
- case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
815
- errorString = 'Security Error';
816
- break;
817
- case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
818
- alert('The upload limit has been reached (' + errorMsg + ').');
819
- errorString = 'Exceeds Upload Limit';
820
- break;
821
- case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
822
- errorString = 'Failed';
823
- break;
824
- case SWFUpload.UPLOAD_ERROR.SPECIFIED_FILE_ID_NOT_FOUND:
825
- break;
826
- case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
827
- errorString = 'Validation Error';
828
- break;
829
- case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
830
- errorString = 'Cancelled';
831
- this.queueData.queueSize -= file.size;
832
- this.queueData.queueLength -= 1;
833
- if (file.status == SWFUpload.FILE_STATUS.IN_PROGRESS || $.inArray(file.id, this.queueData.uploadQueue) >= 0) {
834
- this.queueData.uploadSize -= file.size;
835
- }
836
- // Trigger the onCancel event
837
- if (settings.onCancel) settings.onCancel.call(this, file);
838
- delete this.queueData.files[file.id];
839
- break;
840
- case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
841
- errorString = 'Stopped';
842
- break;
843
- }
844
-
845
- // Call the default event handler
846
- if ($.inArray('onUploadError', settings.overrideEvents) < 0) {
847
-
848
- if (errorCode != SWFUpload.UPLOAD_ERROR.FILE_CANCELLED && errorCode != SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED) {
849
- $('#' + file.id).addClass('uploadify-error');
850
- }
851
-
852
- // Reset the progress bar
853
- $('#' + file.id).find('.uploadify-progress-bar').css('width','1px');
854
-
855
- // Add the error message to the queue item
856
- if (errorCode != SWFUpload.UPLOAD_ERROR.SPECIFIED_FILE_ID_NOT_FOUND && file.status != SWFUpload.FILE_STATUS.COMPLETE) {
857
- $('#' + file.id).find('.data').html(' - ' + errorString);
858
- }
859
- }
860
-
861
- var stats = this.getStats();
862
- this.queueData.uploadsErrored = stats.upload_errors;
863
-
864
- // Call the user-defined event handler
865
- if (settings.onUploadError) settings.onUploadError.call(this, file, errorCode, errorMsg, errorString);
866
- },
867
-
868
- // Triggered periodically during a file upload
869
- onUploadProgress : function(file, fileBytesLoaded, fileTotalBytes) {
870
- // Load the swfupload settings
871
- var settings = this.settings;
872
-
873
- // Setup all the variables
874
- var timer = new Date();
875
- var newTime = timer.getTime();
876
- var lapsedTime = newTime - this.timer;
877
- if (lapsedTime > 500) {
878
- this.timer = newTime;
879
- }
880
- var lapsedBytes = fileBytesLoaded - this.bytesLoaded;
881
- this.bytesLoaded = fileBytesLoaded;
882
- var queueBytesLoaded = this.queueData.queueBytesUploaded + fileBytesLoaded;
883
- var percentage = Math.round(fileBytesLoaded / fileTotalBytes * 100);
884
-
885
- // Calculate the average speed
886
- var suffix = 'KB/s';
887
- var mbs = 0;
888
- var kbs = (lapsedBytes / 1024) / (lapsedTime / 1000);
889
- kbs = Math.floor(kbs * 10) / 10;
890
- if (this.queueData.averageSpeed > 0) {
891
- this.queueData.averageSpeed = Math.floor((this.queueData.averageSpeed + kbs) / 2);
892
- } else {
893
- this.queueData.averageSpeed = Math.floor(kbs);
894
- }
895
- if (kbs > 1000) {
896
- mbs = (kbs * .001);
897
- this.queueData.averageSpeed = Math.floor(mbs);
898
- suffix = 'MB/s';
899
- }
900
-
901
- // Call the default event handler
902
- if ($.inArray('onUploadProgress', settings.overrideEvents) < 0) {
903
- if (settings.progressData == 'percentage') {
904
- $('#' + file.id).find('.data').html(' - ' + percentage + '%');
905
- } else if (settings.progressData == 'speed' && lapsedTime > 500) {
906
- $('#' + file.id).find('.data').html(' - ' + this.queueData.averageSpeed + suffix);
907
- }
908
- $('#' + file.id).find('.uploadify-progress-bar').css('width', percentage + '%');
909
- }
910
-
911
- // Call the user-defined event handler
912
- if (settings.onUploadProgress) settings.onUploadProgress.call(this, file, fileBytesLoaded, fileTotalBytes, queueBytesLoaded, this.queueData.uploadSize);
913
- },
914
-
915
- // Triggered right before a file is uploaded
916
- onUploadStart : function(file) {
917
- // Load the swfupload settings
918
- var settings = this.settings;
919
-
920
- var timer = new Date();
921
- this.timer = timer.getTime();
922
- this.bytesLoaded = 0;
923
- if (this.queueData.uploadQueue.length == 0) {
924
- this.queueData.uploadSize = file.size;
925
- }
926
- if (settings.checkExisting) {
927
- $.ajax({
928
- type : 'POST',
929
- async : false,
930
- url : settings.checkExisting,
931
- data : {filename: file.name},
932
- success : function(data) {
933
- if (data == 1) {
934
- var overwrite = confirm('A file with the name "' + file.name + '" already exists on the server.\nWould you like to replace the existing file?');
935
- if (!overwrite) {
936
- this.cancelUpload(file.id);
937
- $('#' + file.id).remove();
938
- if (this.queueData.uploadQueue.length > 0 && this.queueData.queueLength > 0) {
939
- if (this.queueData.uploadQueue[0] == '*') {
940
- this.startUpload();
941
- } else {
942
- this.startUpload(this.queueData.uploadQueue.shift());
943
- }
944
- }
945
- }
946
- }
947
- }
948
- });
949
- }
950
-
951
- // Call the user-defined event handler
952
- if (settings.onUploadStart) settings.onUploadStart.call(this, file);
953
- },
954
-
955
- // Triggered when a file upload returns a successful code
956
- onUploadSuccess : function(file, data, response) {
957
- // Load the swfupload settings
958
- var settings = this.settings;
959
- var stats = this.getStats();
960
- this.queueData.uploadsSuccessful = stats.successful_uploads;
961
- this.queueData.queueBytesUploaded += file.size;
962
-
963
- // Call the default event handler
964
- if ($.inArray('onUploadSuccess', settings.overrideEvents) < 0) {
965
- $('#' + file.id).find('.data').html(' - Complete');
966
- }
967
-
968
- // Call the user-defined event handler
969
- if (settings.onUploadSuccess) settings.onUploadSuccess.call(this, file, data, response);
970
- }
971
-
972
- }
973
-
974
- $.fn.uploadify = function(method) {
975
-
976
- if (methods[method]) {
977
- return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
978
- } else if (typeof method === 'object' || !method) {
979
- return methods.init.apply(this, arguments);
980
- } else {
981
- $.error('The method ' + method + ' does not exist in $.uploadify');
982
- }
983
-
984
- }
985
-
986
- })($);