aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-10-19 00:39:09 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-10-19 00:39:09 +0200
commit81536a81e3df86289afcc80308a0bb7f22df3cc1 (patch)
tree4cbc6ea6c449648bca206728b0aed7a9c6824685
parentb9c9fdfe200d42bc75afe42d9ecfa98e3ccef8c1 (diff)
downloadnextcloud-server-81536a81e3df86289afcc80308a0bb7f22df3cc1.tar.gz
nextcloud-server-81536a81e3df86289afcc80308a0bb7f22df3cc1.zip
More js updates for app/type in OCCategories
-rw-r--r--core/js/oc-vcategories.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/core/js/oc-vcategories.js b/core/js/oc-vcategories.js
index f3935911b8c..b0256c7ec0c 100644
--- a/core/js/oc-vcategories.js
+++ b/core/js/oc-vcategories.js
@@ -1,12 +1,12 @@
var OCCategories= {
edit:function() {
- if(OCCategories.app == undefined) {
- OC.dialogs.alert('OCCategories.app is not set!');
+ if(OCCategories.type == undefined) {
+ OC.dialogs.alert('OCCategories.type is not set!');
return;
}
$('body').append('<div id="category_dialog"></div>');
$('#category_dialog').load(
- OC.filePath('core', 'ajax', 'vcategories/edit.php') + '?app=' + OCCategories.app, function(response) {
+ OC.filePath('core', 'ajax', 'vcategories/edit.php') + '?type=' + OCCategories.type, function(response) {
try {
var jsondata = jQuery.parseJSON(response);
if(response.status == 'error') {
@@ -64,7 +64,7 @@ var OCCategories= {
}
},
favorites:function(type, cb) {
- $.getJSON(OC.filePath(OCCategories.app, 'ajax', 'categories/favorites.php'),function(jsondata) {
+ $.getJSON(OC.filePath('core', 'ajax', 'categories/favorites.php'), {type: type},function(jsondata) {
if(jsondata.status === 'success') {
OCCategories._update(jsondata.data.categories);
} else {
@@ -92,13 +92,13 @@ var OCCategories= {
OC.dialogs.alert(t('core', 'No categories selected for deletion.'), t('core', 'Error'));
return false;
}
- categories += '&app=' + OCCategories.app;
- $.post(OC.filePath(OCCategories.app, 'ajax', 'categories/delete.php'), categories, OCCategories._processDeleteResult)
- .error(function(xhr){
- if (xhr.status == 404) {
- $.post(OC.filePath('core', 'ajax', 'vcategories/delete.php'), categories, OCCategories._processDeleteResult);
- }
- });
+ var q = categories + '&type=' + OCCategories.type;
+ if(OCCategories.app) {
+ q += '&app=' + OCCategories.app;
+ $.post(OC.filePath(OCCategories.app, 'ajax', 'categories/delete.php'), q, OCCategories._processDeleteResult);
+ } else {
+ $.post(OC.filePath('core', 'ajax', 'vcategories/delete.php'), q, OCCategories._processDeleteResult);
+ }
},
add:function(category) {
$.post(OC.filePath('core', 'ajax', 'vcategories/add.php'),{'category':category, 'app':OCCategories.app},function(jsondata) {