Skip to content
This repository has been archived by the owner on Oct 8, 2022. It is now read-only.

Commit

Permalink
return home after playing episode
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorgalvao committed Mar 9, 2016
1 parent 67abba6 commit 3977bda
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/webview-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ require('mousetrap');
require('sweetalert');
const clipboard = require('electron').clipboard;

function return_home() {
window.location.href = 'https://overcast.fm/podcasts/';
}

// Which page type we are on
function page_type() {
if (/^\/podcasts/.test(window.location.pathname)) { return 'home' }
Expand Down Expand Up @@ -54,7 +58,7 @@ function navigate_cells(direction) {

// Non-global shortcuts
Mousetrap.bind('backspace', function() {
window.location.href = 'https://overcast.fm/podcasts/';
return_home();
});

Mousetrap.bind('command+backspace', function() {
Expand Down Expand Up @@ -117,5 +121,10 @@ document.addEventListener('DOMContentLoaded', function() {

share.addEventListener('click', function() { copy_link(event, share) });
share_with_timestamp.addEventListener('click', function() { copy_link(event, share_with_timestamp) });

// return home after playing episode
document.getElementById('audioplayer').addEventListener('ended', function() {
return_home();
});
}
});

0 comments on commit 3977bda

Please sign in to comment.