1
0
mirror of https://github.com/chylex/Nextcloud-News.git synced 2025-04-09 19:15:42 +02:00
This commit is contained in:
Bernhard Posselt 2015-04-30 18:25:49 +02:00
parent 5515371a80
commit 2e54780c14
11 changed files with 71 additions and 25 deletions

View File

@ -1,3 +1,6 @@
owncloud-news (5.3.3)
* **Enhancement**: Add shortcut for marking the current article's feed/folder read, #635
owncloud-news (5.3.2)
* **Enhancement**: Disable expand on key navigation setting if compact view is not enabled, #774
* **Bugfix**: Update picoFeed to the latest version to fix a bug that would cause the fetcher timeout setting to be ignored

2
css/news.min.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2079,6 +2079,14 @@ app.service('SettingsResource', ["$http", "BASE_URL", function ($http, BASE_URL)
);
};
var markAllRead = function (navigationArea) {
var selector = '.active > .app-navigation-entry-menu .mark-read button';
var button = navigationArea.find(selector);
if (button.length > 0) {
button.trigger('click');
}
};
var isInScrollView = function (elem, scrollArea) {
// offset().top adds the navigation bar too so we have to subract it
var elemTop = elem.offset().top - scrollArea.offset().top;
@ -2384,15 +2392,15 @@ app.service('SettingsResource', ["$http", "BASE_URL", function ($http, BASE_URL)
$(document).keyup(function (event) {
if (noInputFocused($(':focus')) && noModifierKey(event)) {
var keyCode = event.keyCode;
var scrollArea = $('#app-content');
var navigationArea = $('#app-navigation');
var isCompactView = $('#articles.compact').length > 0;
var isExpandItem = $('#articles')
.attr('news-compact-expand') === 'true';
var expandItemInCompact = isCompactView && isExpandItem;
var keyCode = event.keyCode;
var scrollArea = $('#app-content');
var navigationArea = $('#app-navigation');
var isCompactView = $('#articles.compact').length > 0;
var isExpandItem = $('#articles')
.attr('news-compact-expand') === 'true';
var expandItemInCompact = isCompactView && isExpandItem;
if (noInputFocused($(':focus')) && noModifierKey(event)) {
// j, n, right arrow
if ([74, 78, 39].indexOf(keyCode) >= 0) {
@ -2481,9 +2489,21 @@ app.service('SettingsResource', ["$http", "BASE_URL", function ($http, BASE_URL)
// page up
} else if ([33].indexOf(keyCode) >= 0) {
tryReload(navigationArea, scrollArea);
}
// everything with shift
} else if (noInputFocused($(':focus')) && event.shiftKey) {
// shift + a
if ([65].indexOf(keyCode) >= 0) {
event.preventDefault();
markAllRead(navigationArea);
}
}
});

5
js/build/app.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -34,6 +34,14 @@
);
};
var markAllRead = function (navigationArea) {
var selector = '.active > .app-navigation-entry-menu .mark-read button';
var button = navigationArea.find(selector);
if (button.length > 0) {
button.trigger('click');
}
};
var isInScrollView = function (elem, scrollArea) {
// offset().top adds the navigation bar too so we have to subract it
var elemTop = elem.offset().top - scrollArea.offset().top;
@ -339,15 +347,15 @@
$(document).keyup(function (event) {
if (noInputFocused($(':focus')) && noModifierKey(event)) {
var keyCode = event.keyCode;
var scrollArea = $('#app-content');
var navigationArea = $('#app-navigation');
var isCompactView = $('#articles.compact').length > 0;
var isExpandItem = $('#articles')
.attr('news-compact-expand') === 'true';
var expandItemInCompact = isCompactView && isExpandItem;
var keyCode = event.keyCode;
var scrollArea = $('#app-content');
var navigationArea = $('#app-navigation');
var isCompactView = $('#articles.compact').length > 0;
var isExpandItem = $('#articles')
.attr('news-compact-expand') === 'true';
var expandItemInCompact = isCompactView && isExpandItem;
if (noInputFocused($(':focus')) && noModifierKey(event)) {
// j, n, right arrow
if ([74, 78, 39].indexOf(keyCode) >= 0) {
@ -436,9 +444,21 @@
// page up
} else if ([33].indexOf(keyCode) >= 0) {
tryReload(navigationArea, scrollArea);
}
// everything with shift
} else if (noInputFocused($(':focus')) && event.shiftKey) {
// shift + a
if ([65].indexOf(keyCode) >= 0) {
event.preventDefault();
markAllRead(navigationArea);
}
}
});

View File

@ -69,6 +69,10 @@
<td>q</td>
<td><?php p($l->t('Focus search field')); ?></td>
</tr>
<tr>
<td>shift + a</td>
<td><?php p($l->t('Mark current article\'s feed/folder read')); ?></td>
</tr>
</table>
</div>
</div>

View File

@ -112,7 +112,7 @@
title="<?php p($l->t('Delete feed')); ?>">
</button>
</li>
<li ng-show="Navigation.getFeedUnreadCount(feed.id) > 0">
<li ng-show="Navigation.getFeedUnreadCount(feed.id) > 0" class="mark-read">
<button class="icon-checkmark"
ng-click="Navigation.markFeedRead(feed.id)"
title="<?php p($l->t('Mark all articles read')); ?>">

View File

@ -120,7 +120,7 @@
title="<?php p($l->t('Delete folder')); ?>">
</button>
</li>
<li ng-show="Navigation.getFolderUnreadCount(folder.id) > 0">
<li ng-show="Navigation.getFolderUnreadCount(folder.id) > 0" class="mark-read">
<button class="icon-checkmark"
ng-click="Navigation.markFolderRead(folder.id)"
title="<?php p($l->t('Mark all articles read')); ?>">

View File

@ -29,7 +29,7 @@
<div class="app-navigation-entry-menu">
<ul>
<li><button class="icon-checkmark"
<li class="mark-read"><button class="icon-checkmark"
title="<?php p($l->t('Mark all articles read')); ?>"
ng-click="Navigation.markRead()"></button>
</li>