Created
November 18, 2012 15:54
-
-
Save hamaco/4105959 to your computer and use it in GitHub Desktop.
SpeakerDeck vimperator plugin.
This file contains hidden or 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
(function() { | |
var SpeakerDeck = function() { | |
var doc = content.document; | |
if (doc.location.host !== 'speakerdeck.com') { | |
return liberator.echoerr('Current page is not speakerdeck.'); | |
} | |
var iframe = doc.wrappedJSObject.getElementsByClassName('speakerdeck-iframe')[0]; | |
var player = iframe.contentWindow.player; | |
return { | |
next: function() { | |
player.nextSlide(); | |
}, | |
prev: function() { | |
player.previousSlide(); | |
} | |
} | |
}; | |
commands.addUserCommand( | |
['speakerdeck'], | |
'Speaker Deck controller', | |
function() {}, | |
{ | |
subCommands: [ | |
new Command(['n[ext]'], 'Go next page', function() SpeakerDeck().next()), | |
new Command(['p[rev]'], 'Go previous page', function() SpeakerDeck().prev()), | |
] | |
}, | |
true | |
); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment