diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-26 16:27:23 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-26 16:27:23 +0000 |
commit | f6169047b12346f82aa3214337256b41c595cb8a (patch) | |
tree | b8a61583fddfd94c48570c2e83f96191dc524f6a /modules/local_import/js/local_import.js | |
parent | c3fcd3a79bd2f171b15384ea0ff44677b0c7a730 (diff) |
Fix up add from server:
1) Upload requests are serialized so we don't over load the server or get
race conditions occurring.
2) new albums are created based on the file structure of the
authorized path that is the source directory.
Diffstat (limited to 'modules/local_import/js/local_import.js')
-rw-r--r-- | modules/local_import/js/local_import.js | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/modules/local_import/js/local_import.js b/modules/local_import/js/local_import.js index 2e84c0d6..66952d63 100644 --- a/modules/local_import/js/local_import.js +++ b/modules/local_import/js/local_import.js @@ -1,3 +1,11 @@ +$("#gLocalImport").ready(function() { + $("#gLocalImport :submit").click(function(event) { + do_import(this, event); + }); + $("#gProgressBar").progressbar(); + $("#gLocalImport ul").css("display", "block"); +}); + function open_close_branch(icon, event) { var parent = icon.parentNode; var children = $(parent).find(".gCheckboxTree"); @@ -15,8 +23,8 @@ function open_close_branch(icon, event) { } else { $(icon).addClass("ui-icon-minus"); $(icon).removeClass("ui-icon-plus"); - $(parent).children("ul").slideDown("fast"); } + $(parent).children("ul").slideDown("fast"); } else { $(icon).addClass("ui-icon-plus"); $(icon).removeClass("ui-icon-minus"); @@ -96,8 +104,13 @@ function process_checkbox(checkbox) { } function process_file(li_element, parms) { - var url = $("#gLocalImport form").attr("action"); - $.post(url, parms, function(data, status) { + $.ajax({async: false, + success: function(data, status) { + }, + data: parms, + dataType: "html", + type: "POST", + url: $("#gLocalImport form").attr("action") }); current++; $("#gProgressBar").progressbar('value', current / process_length * 100); |