diff --git a/index.html b/index.html index f1f5eeb..4baa526 100755 --- a/index.html +++ b/index.html @@ -61,7 +61,7 @@
- +


@@ -140,7 +140,7 @@ - + + - + + - + + + diff --git a/js/script.js b/js/script.js index 44d188c..56076bb 100755 --- a/js/script.js +++ b/js/script.js @@ -55,8 +55,24 @@ $(function() { clear_dialogs(); update_ui(); $('#newDownload').click(function() { + $('#newDownload_url').val(""); + $('.download_urls').html(""); modals.newDownload_modal.modal('show'); }); + $('#multiple_uris').click(function() { + var url = $('#newDownload_url').val(); + var html = '
  • '; + html += ''; + html += url; + html += ''; + html += ' '; + html += '
  • '; + $(html).appendTo('.download_urls'); + $('#newDownload_url').val(""); + $('.download_urls a').click(function() { + $(this).parents('li').remove(); + }); + }); $('#addNewDownload').click(newDownload); }); @@ -74,8 +90,14 @@ function addDownload(uris) { } function newDownload() { - var url = $('#newDownload_url').val(); - addDownload([[url]]); + var li = $('.download_urls li'); + var urls = []; + for(var i = 0; i < li.length; i++) { + urls.push($(li[i]).text().trim()); + + } + alert(JSON.stringify(urls)); + addDownload([urls]); } var d_files = {