From 140855c03cf204c1b8ead0830b2a91a8db935399 Mon Sep 17 00:00:00 2001 From: Dave Cranwell Date: Wed, 8 Oct 2014 14:17:58 +0100 Subject: [PATCH] less poluting method of variable scoping --- .../static/wagtailimages/js/add-multiple.js | 10 +++++----- .../templates/wagtailimages/multiple/add.html | 14 +++++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/wagtail/wagtailimages/static/wagtailimages/js/add-multiple.js b/wagtail/wagtailimages/static/wagtailimages/js/add-multiple.js index dd9525007..d08d45863 100644 --- a/wagtail/wagtailimages/static/wagtailimages/js/add-multiple.js +++ b/wagtail/wagtailimages/static/wagtailimages/js/add-multiple.js @@ -1,7 +1,7 @@ $(function(){ // Redirect users that don't support filereader if(!$('html').hasClass('filereader')){ - document.location.href = window.simple_upload_url; + document.location.href = window.fileupload_opts.simple_upload_url; return false; } @@ -14,15 +14,15 @@ $(function(){ dataType: 'html', sequentialUploads: true, dropZone: $('.drop-zone'), - acceptFileTypes: window.accepted_file_types, - maxFileSize: window.max_file_size, + acceptFileTypes: window.fileupload_opts.accepted_file_types, + maxFileSize: window.fileupload_opts.max_file_size, previewMinWidth:150, previewMaxWidth:150, previewMinHeight:150, previewMaxHeight:150, messages: { - acceptFileTypes: window.message_accepted_file_types, - maxFileSize: window.messages_max_filesize + acceptFileTypes: window.fileupload_opts.messages.accepted_file_types, + maxFileSize: window.fileupload_opts.messages.max_file_size }, add: function (e, data) { var $this = $(this); diff --git a/wagtail/wagtailimages/templates/wagtailimages/multiple/add.html b/wagtail/wagtailimages/templates/wagtailimages/multiple/add.html index 354325366..f8dda2d30 100644 --- a/wagtail/wagtailimages/templates/wagtailimages/multiple/add.html +++ b/wagtail/wagtailimages/templates/wagtailimages/multiple/add.html @@ -70,11 +70,15 @@ {% url 'wagtailadmin_tag_autocomplete' as autocomplete_url %}