From 619b3a087cc845333d5f2cec5d19e0f9b0fe4d26 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Wed, 29 Apr 2020 11:56:43 +0200 Subject: [PATCH] plugin consistency --- dist/plugin/notes.js | 2 +- plugin/highlight/highlight.js | 2 +- plugin/notes/notes.js | 6 +++--- plugin/zoom/zoom.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/plugin/notes.js b/dist/plugin/notes.js index 1697217..530cc89 100644 --- a/dist/plugin/notes.js +++ b/dist/plugin/notes.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).RevealNotes=t()}(this,(function(){"use strict";var e=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 s,r,i,d,c=JSON.parse(n.data);c&&"reveal-notes"===c.namespace&&"connected"===c.type&&(clearInterval(o),e.on("slidechanged",a),e.on("fragmentshown",a),e.on("fragmenthidden",a),e.on("overviewhidden",a),e.on("overviewshown",a),e.on("paused",a),e.on("resumed",a),a()),c&&"reveal-notes"===c.namespace&&"call"===c.type&&(s=c.methodName,r=c.arguments,i=c.callId,d=e[s].apply(e,r),t.postMessage(JSON.stringify({namespace:"reveal-notes",type:"return",result:d,callId:i}),"*"))}))):alert("Speaker view popup failed to open. Please make sure popups are allowed and reopen the speaker view.")):t.focus();function a(n){var o=e.getCurrentSlide(),a=o.querySelector("aside.notes"),s=o.querySelector(".current-fragment"),r={namespace:"reveal-notes",type:"state",notes:"",markdown:!1,whitespace:"normal",state:e.getState()};if(o.hasAttribute("data-notes")&&(r.notes=o.getAttribute("data-notes"),r.whitespace="pre-wrap"),s){var i=s.querySelector("aside.notes");i?a=i:s.hasAttribute("data-notes")&&(r.notes=s.getAttribute("data-notes"),r.whitespace="pre-wrap",a=null)}a&&(r.notes=a.innerHTML,r.markdown="string"==typeof a.getAttribute("data-markdown")),t.postMessage(JSON.stringify(r),"*")}}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}}();return function(){return e}})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).RevealNotes=t()}(this,(function(){"use strict";return 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 s,r,i,d,l=JSON.parse(n.data);l&&"reveal-notes"===l.namespace&&"connected"===l.type&&(clearInterval(o),e.on("slidechanged",a),e.on("fragmentshown",a),e.on("fragmenthidden",a),e.on("overviewhidden",a),e.on("overviewshown",a),e.on("paused",a),e.on("resumed",a),a()),l&&"reveal-notes"===l.namespace&&"call"===l.type&&(s=l.methodName,r=l.arguments,i=l.callId,d=e[s].apply(e,r),t.postMessage(JSON.stringify({namespace:"reveal-notes",type:"return",result:d,callId:i}),"*"))}))):alert("Speaker view popup failed to open. Please make sure popups are allowed and reopen the speaker view.")):t.focus();function a(n){var o=e.getCurrentSlide(),a=o.querySelector("aside.notes"),s=o.querySelector(".current-fragment"),r={namespace:"reveal-notes",type:"state",notes:"",markdown:!1,whitespace:"normal",state:e.getState()};if(o.hasAttribute("data-notes")&&(r.notes=o.getAttribute("data-notes"),r.whitespace="pre-wrap"),s){var i=s.querySelector("aside.notes");i?a=i:s.hasAttribute("data-notes")&&(r.notes=s.getAttribute("data-notes"),r.whitespace="pre-wrap",a=null)}a&&(r.notes=a.innerHTML,r.markdown="string"==typeof a.getAttribute("data-markdown")),t.postMessage(JSON.stringify(r),"*")}}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}}})); diff --git a/plugin/highlight/highlight.js b/plugin/highlight/highlight.js index 4dd9635..4d93ba1 100644 --- a/plugin/highlight/highlight.js +++ b/plugin/highlight/highlight.js @@ -5,7 +5,7 @@ import './highlight-line-numbers.js' * reveal.js plugin that adds syntax highlight support. */ -let Plugin = { +const Plugin = { id: 'highlight', diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js index b4bbbc2..8af8ff0 100644 --- a/plugin/notes/notes.js +++ b/plugin/notes/notes.js @@ -9,7 +9,7 @@ * 3. This window proceeds to send the current presentation state * to the notes window */ -let Plugin = (function() { +const Plugin = () => { var notesPopup = null; @@ -180,6 +180,6 @@ let Plugin = (function() { open: openNotes }; -})(); +}; -export default () => Plugin; +export default Plugin; diff --git a/plugin/zoom/zoom.js b/plugin/zoom/zoom.js index a4de3f3..0d4624d 100644 --- a/plugin/zoom/zoom.js +++ b/plugin/zoom/zoom.js @@ -1,7 +1,7 @@ /*! * reveal.js Zoom plugin */ -var Plugin = { +const Plugin = { id: 'zoom',