1
0
Fork 0
why-cant-we-deploy-today/dist/plugin/notes.js

1 line
2.8 KiB
JavaScript

!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}({5:function(e,t,n){"use strict";n.r(t);var o=function(){var e,t=null;function n(n){var o;!t||t.closed?(n||(n="plugin/notes/notes.html"),(t=window.open(n,"reveal.js - Notes","width=1100,height=700"))?(o=setInterval((function(){t.postMessage(JSON.stringify({namespace:"reveal-notes",type:"connect",url:window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,state:e.getState()}),"*")}),500),window.addEventListener("message",(function(n){var a,i,s,l,u=JSON.parse(n.data);u&&"reveal-notes"===u.namespace&&"connected"===u.type&&(clearInterval(o),e.on("slidechanged",r),e.on("fragmentshown",r),e.on("fragmenthidden",r),e.on("overviewhidden",r),e.on("overviewshown",r),e.on("paused",r),e.on("resumed",r),r()),u&&"reveal-notes"===u.namespace&&"call"===u.type&&(a=u.methodName,i=u.arguments,s=u.callId,l=e[a].apply(e,i),t.postMessage(JSON.stringify({namespace:"reveal-notes",type:"return",result:l,callId:s}),"*"))}))):alert("Speaker view popup failed to open. Please make sure popups are allowed and reopen the speaker view.")):t.focus();function r(n){var o=e.getCurrentSlide(),r=o.querySelector("aside.notes"),a=o.querySelector(".current-fragment"),i={namespace:"reveal-notes",type:"state",notes:"",markdown:!1,whitespace:"normal",state:e.getState()};if(o.hasAttribute("data-notes")&&(i.notes=o.getAttribute("data-notes"),i.whitespace="pre-wrap"),a){var s=a.querySelector("aside.notes");s?r=s:a.hasAttribute("data-notes")&&(i.notes=a.getAttribute("data-notes"),i.whitespace="pre-wrap",r=null)}r&&(i.notes=r.innerHTML,i.markdown="string"==typeof r.getAttribute("data-markdown")),t.postMessage(JSON.stringify(i),"*")}}return{id:"notes",init:function(t){e=t,/receiver/i.test(window.location.search)||(null!==window.location.search.match(/(\?|\&)notes/gi)&&n(),e.addKeyBinding({keyCode:83,key:"S",description:"Speaker notes view"},(function(){n()})))},open:n}}();Reveal.registerPlugin(o)}});