diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2012-08-17 23:56:32 -0400 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2012-08-17 23:56:32 -0400 |
commit | 455e8380f33bc7b4d7658e2ea153aae8a250b318 (patch) | |
tree | f7dd20e7682b46ce562a8aab98c6d156615fef70 /js | |
parent | 45e7d2dfd727315d3a102aa9ba97c6c2eebec68e (diff) |
different small fixes
Diffstat (limited to 'js')
-rw-r--r-- | js/news.js | 68 |
1 files changed, 20 insertions, 48 deletions
diff --git a/js/news.js b/js/news.js index 1ae753fa2..ff722dbaf 100644 --- a/js/news.js +++ b/js/news.js @@ -1,3 +1,17 @@ +/** +* ownCloud - News app +* +* @author Alessandro Cosentino +* Copyright (c) 2012 - Alessandro Cosentino <cosenal@gmail.com> +* +* @author Bernhard Posselt +* Copyright (c) 2012 - Bernhard Posselt <nukeawhale@gmail.com> +* +* This file is licensed under the Affero General Public License version 3 or later. +* See the COPYING-README file +* +*/ + News={ DropDownMenu: { fade:function(menu){ @@ -115,8 +129,11 @@ News={ $(button).attr("disabled", true); $(button).prop('value', t('news', 'Adding...')); - - var folderid = $('#inputfolderid:input[name="folderid"]').val(); + + var folderid = 0; + if($('#firstrun').length == 0){ + folderid = $('#inputfolderid:input[name="folderid"]').val(); + } $.ajax({ type: "POST", @@ -161,51 +178,6 @@ News={ } }); }, - submitFirstRun: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; - } - - $(button).attr("disabled", true); - $(button).prop('value', t('news', 'Adding...')); - - $.ajax({ - type: "POST", - url: OC.filePath('news', 'ajax', 'createfeed.php'), - data: { 'feedurl': feedurl, 'folderid': folderid }, - dataType: "json", - success: function(jsondata){ - if(jsondata.status == 'success'){ - $('.collapsable_container[data-id="' + folderid + '"] > ul').append(jsondata.data.listfeed); - setupFeedList(); - News.Feed.load(jsondata.data.feedid); - window.reload(); - - OC.dialogs.confirm(t('news', 'Do you want to add another feed?'), t('news', 'Feed added!'), function(answer) { - if(!answer) { - $('#addfeed_dialog').dialog('destroy').remove(); - $('ul.accordion').before(jsondata.data.part_newfeed); - } - }); - } else { - OC.dialogs.alert(jsondata.data.message, t('news', 'Error')); - } - $("#feed_add_url").val(''); - $(button).attr("disabled", false); - $(button).prop('value', t('news', 'Add feed')); - }, - error: function(xhr) { - OC.dialogs.alert(t('news', 'Error while parsing the feed'), t('news', 'Fatal Error')); - $("#feed_add_url").val(''); - $(button).attr("disabled", false); - $(button).prop('value', t('news', 'Add feed')); - } - }); - }, 'delete':function(feedid) { $('.feeds_delete').tipsy('hide'); OC.dialogs.confirm(t('news', 'Are you sure you want to delete this feed?'), t('news', 'Warning'), function(answer) { @@ -721,7 +693,7 @@ $(document).ready(function(){ $('#addfeedfolder').click(function(event) { News.DropDownMenu.fade($(this).children('ul')); - event.stopPropagation(); + event.stopPropagation(); }); $('#settingsbtn').on('click keydown', function() { |