aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCesar G <prototech91@gmail.com>2014-01-24 04:37:29 -0800
committerCesar G <prototech91@gmail.com>2014-01-24 04:37:29 -0800
commita8a349670a83754afc761cd5e3c66db6a70cc8bb (patch)
tree5815a38ba4bc746f315410d127fd5bced942beb3
parent4c102322c122d6839beddde496483e639739b7db (diff)
downloadforums-a8a349670a83754afc761cd5e3c66db6a70cc8bb.tar
forums-a8a349670a83754afc761cd5e3c66db6a70cc8bb.tar.gz
forums-a8a349670a83754afc761cd5e3c66db6a70cc8bb.tar.bz2
forums-a8a349670a83754afc761cd5e3c66db6a70cc8bb.tar.xz
forums-a8a349670a83754afc761cd5e3c66db6a70cc8bb.zip
[ticket/12124] Revert to basic uploader if the html5 runtime is not supported.
PHPBB3-12124
-rw-r--r--phpBB/assets/javascript/plupload.js35
1 files changed, 20 insertions, 15 deletions
diff --git a/phpBB/assets/javascript/plupload.js b/phpBB/assets/javascript/plupload.js
index 6b37b009a4..2a5e290384 100644
--- a/phpBB/assets/javascript/plupload.js
+++ b/phpBB/assets/javascript/plupload.js
@@ -11,25 +11,30 @@ phpbb.plupload.ids = [];
* @return undefined
*/
phpbb.plupload.initialize = function() {
- phpbb.plupload.form = $(phpbb.plupload.config.form_hook)[0],
- phpbb.plupload.rowTpl = $('#attach-row-tpl')[0].outerHTML;
+ // Initialize the Plupload uploader.
+ uploader.init();
- // Hide the basic upload panel and remove the attach row template.
- $('#attach-row-tpl, #attach-panel-basic').remove();
- // Show multi-file upload options.
- $('#attach-panel-multi').show();
+ // Only execute if Plupload initialized successfully.
+ uploader.bind('Init', function() {
+ phpbb.plupload.form = $(phpbb.plupload.config.form_hook)[0],
+ phpbb.plupload.rowTpl = $('#attach-row-tpl')[0].outerHTML;
- // Set attachment data.
- phpbb.plupload.setData(phpbb.plupload.data);
- phpbb.plupload.updateMultipartParams(phpbb.plupload.getSerializedData());
+ // Hide the basic upload panel and remove the attach row template.
+ $('#attach-row-tpl, #attach-panel-basic').remove();
+ // Show multi-file upload options.
+ $('#attach-panel-multi').show();
- // Initialize the Plupload uploader.
- uploader.init();
+ // Set attachment data.
+ phpbb.plupload.setData(phpbb.plupload.data);
+ phpbb.plupload.updateMultipartParams(phpbb.plupload.getSerializedData());
+ });
- // Point out the drag-and-drop zone if it's supported.
- if (!uploader.features.dragdrop) {
- $('#drag-n-drop-message').show();
- }
+ uploader.bind('PostInit', function() {
+ // Point out the drag-and-drop zone if it's supported.
+ if (!!uploader.features.dragdrop) {
+ $('#drag-n-drop-message').show();
+ }
+ });
};
/**