added keyboard shortcuts
This commit is contained in:
parent
2d5e1f00e7
commit
a70306da82
1 changed files with 9 additions and 1 deletions
10
js/App.js
10
js/App.js
|
@ -15,6 +15,10 @@ function App() {
|
||||||
_this.showNext();
|
_this.showNext();
|
||||||
} else if(e.keyCode == 37) {
|
} else if(e.keyCode == 37) {
|
||||||
_this.showPrevious();
|
_this.showPrevious();
|
||||||
|
} else if(e.keyCode == 13) {
|
||||||
|
_this.openInBrowser();
|
||||||
|
} else if(e.keyCode == 82) {
|
||||||
|
_this.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -298,7 +302,7 @@ App.prototype.showFull = function(article, slide_back) {
|
||||||
|
|
||||||
var content = article.content;
|
var content = article.content;
|
||||||
if(content.replace(/^\s+|\s+$/g,'').length == 0) content = article.title;
|
if(content.replace(/^\s+|\s+$/g,'').length == 0) content = article.title;
|
||||||
$(page_id + " .article").innerHTML = content;
|
$(page_id + " .article").innerHTML = content.urlify();
|
||||||
$$(page_id + " .article a").forEach(function(o, i) {
|
$$(page_id + " .article a").forEach(function(o, i) {
|
||||||
o.target = "_blank";
|
o.target = "_blank";
|
||||||
});
|
});
|
||||||
|
@ -339,6 +343,10 @@ App.prototype.showPrevious = function() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
App.prototype.openInBrowser = function() {
|
||||||
|
$("#full .link").click();
|
||||||
|
};
|
||||||
|
|
||||||
App.prototype.setCurrentRead = function() {
|
App.prototype.setCurrentRead = function() {
|
||||||
var article = this.unread_articles[this.currentIndex];
|
var article = this.unread_articles[this.currentIndex];
|
||||||
if(!article) return; // happens if we're not on a full article site
|
if(!article) return; // happens if we're not on a full article site
|
||||||
|
|
Reference in a new issue