Commit 630ccf00 authored by yPhil's avatar yPhil
Browse files

Pretty much working now

- plus indentation fixes all over the place due do js-mode mishaps
parent 3ba52686
......@@ -199,7 +199,6 @@ table#jsLicenseTable td a:link {
div#logoTitle {
display: flex;
/* cursor: pointer; */
}
.feedHeader > .feedToggle,
......@@ -1192,6 +1191,21 @@ div.fancybox-caption a.ui-button.ui-corner-all:hover {
margin: 0.3em 0 0 0;
}
li.tabTitle,
.suggestionListButton button {
text-transform:capitalize;
cursor: pointer;
padding-bottom: 0.2em;
}
li.tabLi {
border-radius: 3px;
padding: 0.2em;
margin: 0 0 0.2em 0;
background: #32303e;
}
.ui-dialog div#messageZone {
text-align: right;
font-size: 75%;
......@@ -1294,6 +1308,11 @@ video {
.feedsListIcon {
margin: 0 .2em 0 0;
font-size: 1.2em;
}
.suggestionListButton,
.suggestionListFavicon,
.feedsListIcon {
flex: 0 1;
}
......
......@@ -372,46 +372,74 @@ PTL.dialog = {
$addButtonText.text(PTL.tr('Add'));
},
suggestionList: function(tabs) {
suggestionList: function(tabs, $dialog) {
const $masterList = $('<ul>');
tabs.forEach(function(tab) {
console.error('tab.name: %s (%s)', tab.name);
if (tab.name == 'rename me') tab.name = 'General';
const $tabLi = $('<li>')
.attr('class', 'tabLi')
.appendTo($masterList)
.on('click', function() {
$(this).children('ul').children('li.feedLi').show('slow');
});
.appendTo($masterList) ;
const $feedUl = $('<ul>')
.attr('class', 'tabUl')
.appendTo($tabLi);
const $feedLi = $('<li>')
.attr('class', 'feedLi hidden')
.appendTo($feedUl);
$feedUl
.append($('<li>')
.attr('class', 'tabTitle closed hover')
.append($('<strong>')
.attr('class', 'tabLi')
.text(tab.name)
)
.on('click', function() {
if ($(this).hasClass('open')) {
$('li.feedLi').hide('fast');
$(this).addClass('closed')
.removeClass('open');
} else {
$('li.feedLi').hide('fast');
$(this).addClass('open')
.removeClass('closed')
.siblings('li.feedLi')
.show('fast');
}
$feedUl.append($('<li>')
.attr('class', 'tabTitle')
.text(tab.name));
}));
$.each(tab.columns, function(i, col) {
$.each(col, function(i, feed) {
$feedUl.append($('<li>')
.attr('class', 'feedLi hidden')
.text(feed.name)
.on('click', function() {
PTL.dialog.tour('feedNew');
}));
console.error('feed: %s (%s)', feed.name, i);
.attr('class', 'flexBox feedLi')
.append($('<div>')
.attr('class', 'suggestionListFavicon shrink')
.append($('<img>')
.attr({'src': '/favicons/' + feed.iconhash + '.favicon',
onerror: "this.src='/static/images/rss.gif';",
'class': 'favicon'})))
.append($('<div>')
.attr('class', 'suggestionListLink grow')
.append($('<a>')
.attr({'class': 'docLink', 'href': feed.url})
.text(feed.name)))
.append($('<div>')
.attr({'class': 'suggestionListButton grow', 'title': 'Add this feed'})
.data('title', 'Add this feed')
.append($('<button>')
.on('click', function() {
PTL.feed.add(PTL.util.firstColumn(), feed.url, '', 'mixed', 220, 'on', '', 16, '', true);
PTL.dialog.kill($dialog);
})
.append($('<i>')
.attr('class', 'icon-plus'))))
.hide());
});
});
......@@ -437,7 +465,13 @@ PTL.dialog = {
title: PTL.tr('Suggestions'),
class: 'translate',
click: function() {
$('div#feedNewListDiv').html(PTL.dialog.suggestionList(PTL.prefs.getDefaultFeeds()));
$('div#feedNewListDiv')
.empty()
.append($('<p>')
.attr('class', 'feedsAddDivListP translate')
.text(PTL.tr('Feed categories'))
.data('content', 'Feed categories')
.append(PTL.dialog.suggestionList(PTL.prefs.getDefaultFeeds(), $dialog)));
}
},
{
......
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment