app.dialog.alert("There was a network or server issue while uploading the list. Please try again.","Error");
}
});
}
functiondownloadItemList(code){
if(typeofcode=="undefined"){
code=$("#getlistidbox").val();
}
if(code.match(/^[a-f0-9]{10}$/i)){
app.dialog.preloader("Downloading...");
vardownloadlistdialogopen=true;
$.ajax({
url:SETTINGS.sharelistapi,
dataType:'json',
method:'get',
data:{
uuid:code
},
timeout:15*1000,
success:function(resp){
if(downloadlistdialogopen){
app.dialog.close();
downloadlistdialogopen=false;
}
if(resp.status=="OK"){
varskipped=importPackageList(resp.packages);
if(skipped>0){
app.dialog.alert("List imported and merged with the existing one. "+skipped+" items already existed locally and were skipped. Verify their delivery status manually.","Import Complete");
}else{
app.dialog.alert("List imported and merged with the existing one.","Import Complete");
}
}else{
app.dialog.alert(resp.message,"Error");
}
},
error:function(jqXHR,status,errorThrown){
if(downloadlistdialogopen){
app.dialog.close();
downloadlistdialogopen=false;
}
app.dialog.alert("There was a network or server issue while downloading the list. Please try again.","Error");
}
});
}else{
app.dialog.alert("That's not a valid list ID.","Error");