diff options
Diffstat (limited to 'js/main.js')
-rw-r--r-- | js/main.js | 51 |
1 files changed, 46 insertions, 5 deletions
diff --git a/js/main.js b/js/main.js index 740e429cb..8032987ae 100644 --- a/js/main.js +++ b/js/main.js @@ -29,17 +29,40 @@ $(document).ready(function(){ /* first run script ends */ $('#addfeed').click(function() { - News.UI.overview('#addfeed_dialog','feeddialog.php'); + $('#addfeed_dialog').dialog('open'); + $('#feed_add_url').html(''); + + // populate folderlist + $('#addfeed_dialog .menu').empty(); + + // http://9gag.com/trending + + var $rootFolder = $('<li>').addClass('menuItem').html($('<b>').html(t('News', 'None'))); + $rootFolder.click(function(){ + News.DropDownMenu.selectItem(this, 0); + }); + $('#addfeed_dialog .menu').append($rootFolder); + + $('#feeds .folder').each(function(){ + var title = $(this).children('.title').html(); + var id = parseInt($(this).data('id')); + var $folder = $('<li>').addClass('menuItem').html(title); + $folder.click(function(){ + News.DropDownMenu.selectItem(this, id); + }); + $('#addfeed_dialog .menu').append($folder); + }); }); + $('#addfolder').click(function() { + $('#addfolder_dialog').dialog('open'); + $('#folder_add_name').val(''); + }); + $('#addfeedbtn').click(function() { $(this).hide(); $('#addfeed_dialog_firstrun').show(); }); - - $('#addfolder').click(function() { - News.UI.overview('#addfolder_dialog','folderdialog.php'); - }); $('#addfeedfolder').click(function(event) { News.DropDownMenu.fade($(this).children('ul')); @@ -54,6 +77,24 @@ $(document).ready(function(){ } }); + $('#addfolder_dialog,#addfeed_dialog').dialog({ + dialogClass:'dialog', + minWidth: 600, + autoOpen: false + }).css('overflow','visible'); + + $('#folder_add_submit').click(function(){ + News.Folder.submit(this); + }); + + $('.dropdownBtn').click(function(){ + News.DropDownMenu.dropdown(this); + }); + + $('#feed_add_submit').click(function(){ + News.Feed.submit(this); + }); + $('#view').click(function(){ var data = {}; if($(this).hasClass('show_all')){ |