pandora/static/js/deleteItemDialog.js

42 lines
1.4 KiB
JavaScript
Raw Normal View History

// vim: et:ts=4:sw=4:sts=4:ft=javascript
'use strict';
pandora.ui.deleteItemDialog = function(item) {
2013-03-03 05:04:25 +00:00
var that = pandora.ui.iconDialog({
buttons: [
Ox.Button({
id: 'keep',
2013-05-09 10:13:58 +00:00
title: Ox._('Keep {0}', [Ox._(pandora.site.itemName.singular)])
}).bindEvent({
click: function() {
that.close();
}
}),
Ox.Button({
id: 'delete',
2013-05-09 10:13:58 +00:00
title: Ox._('Delete {0}', [Ox._(pandora.site.itemName.singular)])
}).bindEvent({
click: function() {
that.close();
pandora.api.remove({
id: item.id
}, function(result) {
Ox.Request.clearCache();
pandora.UI.set({item: ''});
});
}
})
],
content: Ox._('Are you sure you want to delete the {0} "{1}"?'
2013-05-09 10:13:58 +00:00
+ '<br><br>All data will be removed.',
[Ox._(pandora.site.itemName.singular), item.title]),
keys: {enter: 'delete', escape: 'keep'},
2013-05-09 10:13:58 +00:00
title: Ox._('Delete {0}', [Ox._(pandora.site.itemName.singular)])
});
2013-03-03 05:04:25 +00:00
return that;
};