OCCategories={
edit:function(){
- console.log('OCCategories.edit');
if(OCCategories.app == undefined) {
OC.dialogs.alert('OCCategories.app is not set!');
return;
modal: true,
height: 350, minHeight:200, width: 250, minWidth: 200,
buttons: {
+ 'Close': function() {
+ $(this).dialog("close");
+ },
'Delete':function() {
OCCategories.doDelete();
},
}
},
doDelete:function(){
- var categories = $('#categorylist').find('input[type="checkbox"]').serialize();
+ var categories = $('#categorylist').find('input:checkbox').serialize();
+ if(categories == '' || categories == undefined) {
+ OC.dialogs.alert(t('core', 'No categories selected for deletion.'), t('core', 'Error'));
+ return false;
+ }
categories += '&app=' + OCCategories.app;
- console.log('OCCategories.delete: ' + categories);
$.post(OC.filePath(OCCategories.app, 'ajax', 'categories/delete.php'), categories, OCCategories._processDeleteResult)
.error(function(xhr){
if (xhr.status == 404) {
});
},
add:function(category){
- console.log('OCCategories.add ' + category);
$.getJSON(OC.filePath('core', 'ajax', 'vcategories/add.php'),{'category':category, 'app':OCCategories.app},function(jsondata){
if(jsondata.status == 'success'){
OCCategories._update(jsondata.data.categories);
return false;
},
rescan:function(){
- console.log('Categories.rescan');
$.getJSON(OC.filePath(OCCategories.app, 'ajax', 'categories/rescan.php'),function(jsondata, status, xhr){
if(jsondata.status == 'success'){
OCCategories._update(jsondata.data.categories);