diff options
-rw-r--r-- | templates/web/base/questionnaire/index.html | 4 | ||||
-rw-r--r-- | templates/web/base/report/new/form_report.html | 4 | ||||
-rw-r--r-- | templates/web/base/report/update/form_update.html | 4 | ||||
-rw-r--r-- | templates/web/bromley/report/display.html | 4 | ||||
-rw-r--r-- | templates/web/bromley/report/new/fill_in_details_form.html | 4 | ||||
-rw-r--r-- | templates/web/eastsussex/report/update-form.html | 4 | ||||
-rw-r--r-- | templates/web/zurich/report/new/fill_in_details_form.html | 4 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 19 |
8 files changed, 10 insertions, 37 deletions
diff --git a/templates/web/base/questionnaire/index.html b/templates/web/base/questionnaire/index.html index c8b6907a1..5a5efee30 100644 --- a/templates/web/base/questionnaire/index.html +++ b/templates/web/base/questionnaire/index.html @@ -80,10 +80,6 @@ <div id="form_photos"> [% IF upload_fileid %] - <script> - var fixmystreet = fixmystreet || {}; - fixmystreet.uploaded_files = "[% upload_fileid %]".split(','); - </script> <p>[% loc('You have already attached photos to this update. Note that you can attach a maximum of 3 to this update (if you try to upload more, the oldest will be removed).') %]</p> [% FOREACH id IN upload_fileid.split(',') %] <img align="right" src="/photo/[% id %].temp.jpeg" alt=""> diff --git a/templates/web/base/report/new/form_report.html b/templates/web/base/report/new/form_report.html index a236b6a1f..d76d69ec0 100644 --- a/templates/web/base/report/new/form_report.html +++ b/templates/web/base/report/new/form_report.html @@ -29,10 +29,6 @@ <div id="form_photos"> [% IF upload_fileid %] - <script> - var fixmystreet = fixmystreet || {}; - fixmystreet.uploaded_files = "[% upload_fileid %]".split(','); - </script> <p>[% loc('You have already attached photos to this report. Note that you can attach a maximum of 3 to this report (if you try to upload more, the oldest will be removed).') %]</p> [% FOREACH id IN upload_fileid.split(',') %] <img align="right" src="/photo/[% id %].temp.jpeg" alt=""> diff --git a/templates/web/base/report/update/form_update.html b/templates/web/base/report/update/form_update.html index 3a46694cf..40260886c 100644 --- a/templates/web/base/report/update/form_update.html +++ b/templates/web/base/report/update/form_update.html @@ -11,10 +11,6 @@ <div id="form_photos"> [% IF upload_fileid %] - <script> - var fixmystreet = fixmystreet || {}; - fixmystreet.uploaded_files = "[% upload_fileid %]".split(','); - </script> <p>[% loc('You have already attached photos to this update. Note that you can attach a maximum of 3 to this update (if you try to upload more, the oldest will be removed).') %]</p> [% FOREACH id IN upload_fileid.split(',') %] <img align="right" src="/photo/[% id %].temp.jpeg" alt=""> diff --git a/templates/web/bromley/report/display.html b/templates/web/bromley/report/display.html index 569275841..88a6fbddc 100644 --- a/templates/web/bromley/report/display.html +++ b/templates/web/bromley/report/display.html @@ -70,10 +70,6 @@ <div id="form_photos"> [% IF upload_fileid %] - <script> - var fixmystreet = fixmystreet || {}; - fixmystreet.uploaded_files = "[% upload_fileid %]".split(','); - </script> <p>[% loc('You have already attached photos to this update. Note that you can attach a maximum of 3 to this update (if you try to upload more, the oldest will be removed).') %]</p> [% FOREACH id IN upload_fileid.split(',') %] <img align="right" src="/photo/[% id %].temp.jpeg" alt=""> diff --git a/templates/web/bromley/report/new/fill_in_details_form.html b/templates/web/bromley/report/new/fill_in_details_form.html index 2f853b506..c953f53c7 100644 --- a/templates/web/bromley/report/new/fill_in_details_form.html +++ b/templates/web/bromley/report/new/fill_in_details_form.html @@ -58,10 +58,6 @@ <div id="form_photos"> [% IF upload_fileid %] - <script> - var fixmystreet = fixmystreet || {}; - fixmystreet.uploaded_files = "[% upload_fileid %]".split(','); - </script> <p>[% loc('You have already attached photos to this report. Note that you can attach a maximum of 3 to this report (if you try to upload more, the oldest will be removed).') %]</p> [% FOREACH id IN upload_fileid.split(',') %] <img align="right" src="/photo/[% id %].temp.jpeg" alt=""> diff --git a/templates/web/eastsussex/report/update-form.html b/templates/web/eastsussex/report/update-form.html index 8c15db904..c2e445f22 100644 --- a/templates/web/eastsussex/report/update-form.html +++ b/templates/web/eastsussex/report/update-form.html @@ -70,10 +70,6 @@ <div id="form_photos"> [% IF upload_fileid %] - <script> - var fixmystreet = fixmystreet || {}; - fixmystreet.uploaded_files = "[% upload_fileid %]".split(','); - </script> <p>[% loc('You have already attached photos to this update. Note that you can attach a maximum of 3 to this update (if you try to upload more, the oldest will be removed).') %]</p> [% FOREACH id IN upload_fileid.split(',') %] <img align="right" src="/photo/[% id %].temp.jpeg" alt=""> diff --git a/templates/web/zurich/report/new/fill_in_details_form.html b/templates/web/zurich/report/new/fill_in_details_form.html index 1e036c087..d24474084 100644 --- a/templates/web/zurich/report/new/fill_in_details_form.html +++ b/templates/web/zurich/report/new/fill_in_details_form.html @@ -52,10 +52,6 @@ <div id="form_photos"> [% IF upload_fileid %] - <script> - var fixmystreet = fixmystreet || {}; - fixmystreet.uploaded_files = "[% upload_fileid %]".split(','); - </script> <p>[% loc('You have already attached photos to this report. Note that you can attach a maximum of 3 to this report (if you try to upload more, the oldest will be removed).') %]</p> [% FOREACH id IN upload_fileid.split(',') %] <img align="right" src="/photo/[% id %].temp.jpeg" alt=""> diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 7c0a752d2..21701ce5f 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -246,15 +246,16 @@ $(function(){ } }); - if (typeof fixmystreet !== 'undefined') { - $.each(fixmystreet.uploaded_files || [], function(i, f) { - var mockFile = { name: f, server_id: f }; - photodrop.emit("addedfile", mockFile); - photodrop.createThumbnailFromUrl(mockFile, '/photo/' + f + '.temp.jpeg'); - photodrop.emit("complete", mockFile); - photodrop.options.maxFiles -= 1; - }); - } + $.each($('input[name=upload_fileid]').val().split(','), function(i, f) { + if (!f) { + return; + } + var mockFile = { name: f, server_id: f }; + photodrop.emit("addedfile", mockFile); + photodrop.createThumbnailFromUrl(mockFile, '/photo/' + f + '.temp.jpeg'); + photodrop.emit("complete", mockFile); + photodrop.options.maxFiles -= 1; + }); } /* |