summaryrefslogtreecommitdiffhomepage
path: root/plugin/postmessage/postmessage.js
diff options
context:
space:
mode:
authorHakim El Hattab2015-01-09 18:22:30 +0100
committerHakim El Hattab2015-01-09 18:22:30 +0100
commit20d858deb888fe0ec0ba92a919c8a0526ac52a2e (patch)
tree9a953291ea1716afae558100907c81a3ec745d03 /plugin/postmessage/postmessage.js
parent57977e29239a1115ddfd673fc24f86080203f6d7 (diff)
parent3a8fc9b2742756be2274c8c74f77dbed84407d92 (diff)
Merge pull request #1093 from hakimel/dev
3.0.0
Diffstat (limited to 'plugin/postmessage/postmessage.js')
-rw-r--r--plugin/postmessage/postmessage.js42
1 files changed, 0 insertions, 42 deletions
diff --git a/plugin/postmessage/postmessage.js b/plugin/postmessage/postmessage.js
deleted file mode 100644
index d0f4140..0000000
--- a/plugin/postmessage/postmessage.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-
- simple postmessage plugin
-
- Useful when a reveal slideshow is inside an iframe.
- It allows to call reveal methods from outside.
-
- Example:
- var reveal = window.frames[0];
-
- // Reveal.prev();
- reveal.postMessage(JSON.stringify({method: 'prev', args: []}), '*');
- // Reveal.next();
- reveal.postMessage(JSON.stringify({method: 'next', args: []}), '*');
- // Reveal.slide(2, 2);
- reveal.postMessage(JSON.stringify({method: 'slide', args: [2,2]}), '*');
-
- Add to the slideshow:
-
- dependencies: [
- ...
- { src: 'plugin/postmessage/postmessage.js', async: true, condition: function() { return !!document.body.classList; } }
- ]
-
-*/
-
-(function (){
-
- window.addEventListener( "message", function ( event ) {
- var data = JSON.parse( event.data ),
- method = data.method,
- args = data.args;
-
- if( typeof Reveal[method] === 'function' ) {
- Reveal[method].apply( Reveal, data.args );
- }
- }, false);
-
-}());
-
-
-