import to list

This commit is contained in:
j 2014-10-31 12:46:32 +01:00
parent b6faab1573
commit 07f54e1db3
2 changed files with 11 additions and 10 deletions

View file

@ -3,7 +3,6 @@
oml.ui.importExportDialog = function(selected) { oml.ui.importExportDialog = function(selected) {
var ui = oml.user.ui, var ui = oml.user.ui,
username = oml.user.preferences.username,
$bar = Ox.Bar({size: 24}), $bar = Ox.Bar({size: 24}),
@ -113,7 +112,7 @@ oml.ui.importExportDialog = function(selected) {
function getListItems(selected) { function getListItems(selected) {
var lists = ui._lists.filter(function(list) { var lists = ui._lists.filter(function(list) {
return list.user == username && list.type != 'library' && ( return list.user == '' && list.type != 'library' && (
selected == 'export' || list.type == 'static' selected == 'export' || list.type == 'static'
); );
}); });
@ -133,7 +132,7 @@ oml.ui.importExportDialog = function(selected) {
function getListNames() { function getListNames() {
return ui._lists.filter(function(list) { return ui._lists.filter(function(list) {
return list.user == username; return list.user == '';
}).map(function(list) { }).map(function(list) {
return list.name; return list.name;
}); });
@ -321,7 +320,10 @@ oml.ui.importExportDialog = function(selected) {
}) })
); );
$label['export'].show(); $label['export'].show();
(addList ? oml.addList : Ox.noop)(false, false, data.list, function() { (addList ? oml.addList : Ox.noop)(false, false, data.list, function(result) {
if (result) {
data.list = result.data.id
}
oml.api.import({ oml.api.import({
list: data.list, list: data.list,
mode: data.mode, mode: data.mode,
@ -348,7 +350,7 @@ oml.ui.importExportDialog = function(selected) {
var progress = data.status ? 1 var progress = data.status ? 1
: !data.progress[0] || !data.progress[1] ? -1 : !data.progress[0] || !data.progress[1] ? -1
: data.progress[0] / data.progress[1]; : data.progress[0] / data.progress[1];
$progress[data.activity].options({progress: progress}) $progress[data.activity] && $progress[data.activity].options({progress: progress})
} }
function setStatus(data) { function setStatus(data) {

View file

@ -808,14 +808,13 @@ oml.getLists = function(callback) {
}; };
oml.getOwnListNames = function() { oml.getOwnListNames = function() {
var ui = oml.user.ui, var ui = oml.user.ui;
username = oml.user.preferences.username;
return ui._lists.filter(function(list) { return ui._lists.filter(function(list) {
return list.user == username; return list.user == '' && list.type != 'library';
}).filter(function(list) { }).map(function(list) {
return list.name; return list.name;
}); });
} };
oml.getPageTitle = function(stateOrURL) { oml.getPageTitle = function(stateOrURL) {
var page = Ox.getObjectById( var page = Ox.getObjectById(