mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
readability keyboard shortcut
This commit is contained in:
parent
f590c358d2
commit
b123753d65
@ -237,7 +237,7 @@
|
||||
</dropdown>
|
||||
<button class="toolbar-item"
|
||||
:class="{active: itemSelectedReadability}"
|
||||
@click="getReadable(itemSelectedDetails)"
|
||||
@click="toggleReadability()"
|
||||
title="Read Here">
|
||||
<span class="icon" :class="{'icon-loading': loading.readability}">{% inline "book-open.svg" %}</span>
|
||||
</button>
|
||||
@ -421,6 +421,10 @@
|
||||
<td><kbd>o</kbd></td>
|
||||
<td>open an article's link</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><kbd>i</kbd></td>
|
||||
<td>read here</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<kbd>f</kbd>
|
||||
|
@ -573,11 +573,13 @@ var vm = new Vue({
|
||||
document.location.reload()
|
||||
})
|
||||
},
|
||||
getReadable: function(item) {
|
||||
toggleReadability: function() {
|
||||
if (this.itemSelectedReadability) {
|
||||
this.itemSelectedReadability = null
|
||||
return
|
||||
}
|
||||
var item = this.itemSelectedDetails
|
||||
if (!item) return
|
||||
if (item.link) {
|
||||
this.loading.readability = true
|
||||
api.crawl(item.link).then(function(data) {
|
||||
|
@ -95,6 +95,9 @@ var shortcutFunctions = {
|
||||
window.open(vm.itemSelectedDetails.link, '_blank')
|
||||
}
|
||||
},
|
||||
toggleReadability: function() {
|
||||
vm.toggleReadability()
|
||||
},
|
||||
toggleItemRead: function() {
|
||||
if (vm.itemSelected != null) {
|
||||
vm.toggleItemRead(vm.itemSelectedDetails)
|
||||
@ -146,6 +149,7 @@ var shortcutFunctions = {
|
||||
// If you edit, make sure you update the help modal
|
||||
var keybindings = {
|
||||
"o": shortcutFunctions.openItemLink,
|
||||
"i": shortcutFunctions.toggleReadability,
|
||||
"r": shortcutFunctions.toggleItemRead,
|
||||
"R": shortcutFunctions.markAllRead,
|
||||
"s": shortcutFunctions.toggleItemStarred,
|
||||
|
Loading…
x
Reference in New Issue
Block a user