summaryrefslogtreecommitdiffstats
path: root/js/news.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/news.js')
-rw-r--r--js/news.js24
1 files changed, 23 insertions, 1 deletions
diff --git a/js/news.js b/js/news.js
index e97d1227c..4014aca6e 100644
--- a/js/news.js
+++ b/js/news.js
@@ -20,7 +20,7 @@ News={
return false;
}
},
- Feeds: {
+ Folder: {
submit:function(button){
var displayname = $("#folder_add_name").val().trim();
@@ -41,6 +41,28 @@ News={
}
});
}
+ },
+ Feed: {
+ submit:function(button){
+ var feedurl = $("#feed_add_url").val().trim();
+
+ if(feedurl.length == 0) {
+ OC.dialogs.alert(t('news', 'URL cannot be empty.'), t('news', 'Error'));
+ return false;
+ }
+
+ var url;
+ url = OC.filePath('news', 'ajax', 'newfeed.php');
+
+ $.post(url, { feedurl: feedurl },
+ function(jsondata){
+ if(jsondata.status == 'success'){
+ $(button).closest('tr').prev().html(jsondata.page).show().next().remove();
+ } else {
+ OC.dialogs.alert(jsondata.data.message, t('news', 'Error'));
+ }
+ });
+ }
}
}