Last active
December 19, 2016 00:48
-
-
Save rollbackpt/32801464e4b8ed781fe71181456d4aaf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this code is not amazing. Was not suppose to be... | |
// like I was lazy to check the news, I was also lazy to code ahahah | |
// check the reason of this gist here: https://www.youtube.com/watch?v=7w9p3beJHyA | |
// define slideshow time in seconds | |
var slideTime = 3; | |
// fail safe clear | |
window.feedlySlide = undefined; | |
$(document).on('keyup', function(e) { | |
if(e.which == 81) { // use 'q' key to start the slideshow | |
if (window.feedlySlide == undefined) { | |
// start the interval for the slideshow | |
window.feedlySlide = setInterval(function () { | |
$(".slideBumper-right").click(); | |
}, slideTime * 1000); | |
// add element showing tht slishow is running | |
var span = document.createElement('div'); | |
span.innerHTML = "<span id='feedly-slide-indicator' style='background: green;position: absolute;top:0;right:0;color: white; z-index: 5000;'>Running Slideshow!</span>"; | |
document.getElementsByClassName('sliderContainer')[0].appendChild(span); | |
} | |
} else if (e.which == 87) { // use 'w' key to stop the slideshow | |
// stop the slideshow interval | |
clearInterval(window.feedlySlide); | |
window.feedlySlide = undefined; | |
// clear element | |
$("span#feedly-slide-indicator").remove(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment