2013-03-24 09:43:24 +00:00
|
|
|
// vim: et:ts=4:sw=4:sts=4:ft=javascript
|
|
|
|
'use strict';
|
|
|
|
|
2014-01-02 10:11:27 +00:00
|
|
|
pandora.ui.deleteDocumentDialog = function(files, callback) {
|
2013-03-24 09:43:24 +00:00
|
|
|
|
|
|
|
var that = pandora.ui.iconDialog({
|
|
|
|
buttons: [
|
|
|
|
Ox.Button({
|
|
|
|
id: 'keep',
|
2014-01-02 10:11:27 +00:00
|
|
|
title: files.length == 1 ? Ox._('Keep Document') : Ox._('Keep Documents')
|
2013-03-24 09:43:24 +00:00
|
|
|
}).bindEvent({
|
|
|
|
click: function() {
|
|
|
|
that.close();
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
Ox.Button({
|
|
|
|
id: 'delete',
|
2014-01-02 10:11:27 +00:00
|
|
|
title: files.length == 1 ? Ox._('Delete Document') : Ox._('Delete Documents')
|
2013-03-24 09:43:24 +00:00
|
|
|
}).bindEvent({
|
|
|
|
click: function() {
|
|
|
|
that.close();
|
2013-05-27 10:13:59 +00:00
|
|
|
pandora.api.removeDocument({
|
2014-01-02 10:11:27 +00:00
|
|
|
ids: files
|
2013-04-26 09:21:22 +00:00
|
|
|
}, callback);
|
2013-03-24 09:43:24 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
],
|
2014-01-02 10:11:27 +00:00
|
|
|
content: files.length == 1
|
|
|
|
? Ox._('Are you sure you want to delete the document "{0}"?', [files[0]])
|
|
|
|
: Ox._('Are you sure you want to delete {0} documents?', [files.length]),
|
2013-03-24 09:43:24 +00:00
|
|
|
keys: {enter: 'delete', escape: 'keep'},
|
2014-01-02 10:11:27 +00:00
|
|
|
title: files.length == 1 ? Ox._('Delete Document') : Ox._('Delete {0} Documents', [files.length])
|
2013-03-24 09:43:24 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
return that;
|
|
|
|
|
|
|
|
};
|
|
|
|
|