switch to rollup for easier build config

This commit is contained in:
Hakim El Hattab 2020-04-16 14:51:34 +02:00
parent 0c8ac8f1ee
commit d54353c4e1
12 changed files with 304 additions and 1618 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/plugin/math.js vendored
View File

@ -1 +1 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},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=7)}({7:function(e,t,n){"use strict";n.r(t);var r=function(){var e=Reveal.getConfig().math||{},t=(e.mathjax||"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js")+"?config="+(e.config||"TeX-AMS_HTML-full"),n={messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]],skipTags:["script","noscript","style","textarea","pre"]},skipStartupTypeset:!0};function r(e,t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}return{id:"math",init:function(a){r(e,n),r(e.tex2jax,n.tex2jax),e.mathjax=e.config=null,function(e,t){var n=document.querySelector("head"),r=document.createElement("script");r.type="text/javascript",r.src=e;var a=function(){"function"==typeof t&&(t.call(),t=null)};r.onload=a,r.onreadystatechange=function(){"loaded"===this.readyState&&a()},n.appendChild(r)}(t,(function(){MathJax.Hub.Config(e),MathJax.Hub.Queue(["Typeset",MathJax.Hub]),MathJax.Hub.Queue(a.layout),a.on("slidechanged",(function(e){MathJax.Hub.Queue(["Typeset",MathJax.Hub,e.currentSlide])}))}))}}}();Reveal.registerPlugin(r)}}); !function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";var e=function(){var e=Reveal.getConfig().math||{},t=(e.mathjax||"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js")+"?config="+(e.config||"TeX-AMS_HTML-full"),a={messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]],skipTags:["script","noscript","style","textarea","pre"]},skipStartupTypeset:!0};function n(e,t){for(var a in t)e.hasOwnProperty(a)||(e[a]=t[a])}return{id:"math",init:function(i){n(e,a),n(e.tex2jax,a.tex2jax),e.mathjax=e.config=null,function(e,t){var a=document.querySelector("head"),n=document.createElement("script");n.type="text/javascript",n.src=e;var i=function(){"function"==typeof t&&(t.call(),t=null)};n.onload=i,n.onreadystatechange=function(){"loaded"===this.readyState&&i()},a.appendChild(n)}(t,(function(){MathJax.Hub.Config(e),MathJax.Hub.Queue(["Typeset",MathJax.Hub]),MathJax.Hub.Queue(i.layout),i.on("slidechanged",(function(e){MathJax.Hub.Queue(["Typeset",MathJax.Hub,e.currentSlide])}))}))}}}();Reveal.registerPlugin(e)}));

View File

@ -1 +1 @@
!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)}}); !function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";var e=function(){var e,t=null;function n(n){var a;!t||t.closed?(n||(n="plugin/notes/notes.html"),(t=window.open(n,"reveal.js - Notes","width=1100,height=700"))?(a=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(a),e.on("slidechanged",o),e.on("fragmentshown",o),e.on("fragmenthidden",o),e.on("overviewhidden",o),e.on("overviewshown",o),e.on("paused",o),e.on("resumed",o),o()),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 o(n){var a=e.getCurrentSlide(),o=a.querySelector("aside.notes"),s=a.querySelector(".current-fragment"),r={namespace:"reveal-notes",type:"state",notes:"",markdown:!1,whitespace:"normal",state:e.getState()};if(a.hasAttribute("data-notes")&&(r.notes=a.getAttribute("data-notes"),r.whitespace="pre-wrap"),s){var i=s.querySelector("aside.notes");i?o=i:s.hasAttribute("data-notes")&&(r.notes=s.getAttribute("data-notes"),r.whitespace="pre-wrap",o=null)}o&&(r.notes=o.innerHTML,r.markdown="string"==typeof o.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}}();Reveal.registerPlugin(e)}));

View File

@ -1 +1 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},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=4)}({4:function(e,t,n){"use strict";n.r(t);var r=function(){var e,t,n,r;function i(e,t){var n=document.getElementById(e)||document.body,r=t||"EM",i=new RegExp("^(?:"+r+"|SCRIPT|FORM)$"),o=["#ff6","#a0ffff","#9f9","#f99","#f6f"],l=[],a=0,c="",d=[];this.setRegex=function(e){e=e.replace(/^[^\w]+|[^\w]+$/g,"").replace(/[^\w'-]+/g,"|"),c=new RegExp("("+e+")","i")},this.getRegex=function(){return c.toString().replace(/^\/\\b\(|\)\\b\/i$/g,"").replace(/\|/g," ")},this.hiliteWords=function(e){if(null!=e&&e&&c&&!i.test(e.nodeName)){if(e.hasChildNodes())for(var t=0;t<e.childNodes.length;t++)this.hiliteWords(e.childNodes[t]);if(3==e.nodeType&&(nv=e.nodeValue)&&(regs=c.exec(nv))){for(var n=e;null!=n&&"SECTION"!=n.nodeName;)n=n.parentNode;var u=Reveal.getIndices(n),s=d.length,p=!1;for(t=0;t<s;t++)d[t].h===u.h&&d[t].v===u.v&&(p=!0);p||d.push(u),l[regs[0].toLowerCase()]||(l[regs[0].toLowerCase()]=o[a++%o.length]);var f=document.createElement(r);f.appendChild(document.createTextNode(regs[0])),f.style.backgroundColor=l[regs[0].toLowerCase()],f.style.fontStyle="inherit",f.style.color="#000";var g=e.splitText(regs.index);g.nodeValue=g.nodeValue.substring(regs[0].length),e.parentNode.insertBefore(f,g)}}},this.remove=function(){for(var e=document.getElementsByTagName(r);e.length&&(el=e[0]);)el.parentNode.replaceChild(el.firstChild,el)},this.apply=function(e){if(null!=e&&e)return this.remove(),this.setRegex(e),this.hiliteWords(n),d}}function o(){var e=document.getElementById("searchinputdiv"),t=document.getElementById("searchinput");e.style.display="inline",t.focus(),t.select()}function l(){document.getElementById("searchinputdiv").style.display="none",r&&r.remove()}function a(){if(n){var o=document.getElementById("searchinput").value;""===o?(r&&r.remove(),e=null):(r=new i("slidecontent"),e=r.apply(o),t=0)}e&&(e.length&&e.length<=t&&(t=0),e.length>t&&(Reveal.slide(e[t].h,e[t].v),t++))}var c={};if(c.wrapper=document.querySelector(".reveal"),!c.wrapper.querySelector(".searchbox")){var d=document.createElement("div");d.id="searchinputdiv",d.classList.add("searchdiv"),d.style.position="absolute",d.style.top="10px",d.style.right="10px",d.style.zIndex=10,d.innerHTML='<span><input type="search" id="searchinput" class="searchinput" style="vertical-align: top;"/><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJiSURBVHjatFZNaxNBGH5md+Mmu92NVdKDRipSAyqCghgQD4L4cRe86UUtAQ+eFCxoa4/25EXBFi8eBE+eRPoDhB6KgiiixdAPCEkx2pjvTXadd9yNsflwuyUDD/O+u8PzzDPvzOwyx3EwyCZhwG3gAkp7MnpjgbopjsltcD4gjuXZZKeAR348MYLYTm3LzOs/y3j3JTfZxgXWXmTuwPHIc4VmoOmv5IrI53+AO2DdHLjkDWQ3GoEEVFXtXQOvkSnPWcyUceviLhwbDYv8/XIVj97kse7TodLvZXxYxrPUHkQ1ufXs3FEdybEIxucySOesoNvUgWU1cP3MkCBfTFdw9fGaAMVmRELq7LBw2Q3/FaAxxWIRpw+ZIr/7IouPqzUBiqmdHAv7EuhRAwf1er2Vy4x1jW3b2d5Jfvu5IPp7l2LYbcgCFFNb+FoJ7oBqEAqFMPNqFcmEgVMJDfMT+1tvN0pNjERlMS6QA5pFOKxiKVPFhakPeL3It+WGJUDxt2wFR+JhzI7v5ctkd8DXOZAkCYYxhO+lKm4+Xfqz/rIixBuNBl7eOYzkQQNzqX249mRl6zUgEcYkaJrGhUwBinVdh6IouPzwE6/DL5w4oLkH8y981aDf+uq6hlKpJESiUdNfDZi7/ehG9K6KfiA3pml0PLcsq+cSMTj2NL9ukc4UOmz7AZ3+crkC4mHujFvXNaMFB3bEr8xPS6p5O+jXxq4VZtaen7/PwzrntjcLUE0iHPS1Ud1cdiEJl/8WivZk0wXd7zWOMkeF8s0CcAmkNrC2nvXZDbbbN73ccYnZoH9bfgswAFzAe9/h3dbKAAAAAElFTkSuQmCC" id="searchbutton" class="searchicon" style="vertical-align: top; margin-top: -1px;"/></span>',c.wrapper.appendChild(d)}return document.getElementById("searchbutton").addEventListener("click",(function(e){a()}),!1),document.getElementById("searchinput").addEventListener("keyup",(function(e){switch(e.keyCode){case 13:e.preventDefault(),a(),n=!1;break;default:n=!0}}),!1),document.addEventListener("keydown",(function(e){"F"==e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),"inline"!==document.getElementById("searchinputdiv").style.display?o():l())}),!1),l(),{id:"search",init:function(e){e.registerKeyboardShortcut("CTRL + Shift + F","Search")},open:o}}();Reveal.registerPlugin(r)}}); !function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";var e=function(){var e,t,n,i;function r(e,t){var n=document.getElementById(e)||document.body,i=t||"EM",r=new RegExp("^(?:"+i+"|SCRIPT|FORM)$"),l=["#ff6","#a0ffff","#9f9","#f99","#f6f"],a=[],d=0,o="",c=[];this.setRegex=function(e){e=e.replace(/^[^\w]+|[^\w]+$/g,"").replace(/[^\w'-]+/g,"|"),o=new RegExp("("+e+")","i")},this.getRegex=function(){return o.toString().replace(/^\/\\b\(|\)\\b\/i$/g,"").replace(/\|/g," ")},this.hiliteWords=function(e){if(null!=e&&e&&o&&!r.test(e.nodeName)){if(e.hasChildNodes())for(var t=0;t<e.childNodes.length;t++)this.hiliteWords(e.childNodes[t]);if(3==e.nodeType&&(nv=e.nodeValue)&&(regs=o.exec(nv))){for(var n=e;null!=n&&"SECTION"!=n.nodeName;)n=n.parentNode;var s=Reveal.getIndices(n),u=c.length,h=!1;for(t=0;t<u;t++)c[t].h===s.h&&c[t].v===s.v&&(h=!0);h||c.push(s),a[regs[0].toLowerCase()]||(a[regs[0].toLowerCase()]=l[d++%l.length]);var p=document.createElement(i);p.appendChild(document.createTextNode(regs[0])),p.style.backgroundColor=a[regs[0].toLowerCase()],p.style.fontStyle="inherit",p.style.color="#000";var g=e.splitText(regs.index);g.nodeValue=g.nodeValue.substring(regs[0].length),e.parentNode.insertBefore(p,g)}}},this.remove=function(){for(var e=document.getElementsByTagName(i);e.length&&(el=e[0]);)el.parentNode.replaceChild(el.firstChild,el)},this.apply=function(e){if(null!=e&&e)return this.remove(),this.setRegex(e),this.hiliteWords(n),c}}function l(){var e=document.getElementById("searchinputdiv"),t=document.getElementById("searchinput");e.style.display="inline",t.focus(),t.select()}function a(){document.getElementById("searchinputdiv").style.display="none",i&&i.remove()}function d(){if(n){var l=document.getElementById("searchinput").value;""===l?(i&&i.remove(),e=null):(i=new r("slidecontent"),e=i.apply(l),t=0)}e&&(e.length&&e.length<=t&&(t=0),e.length>t&&(Reveal.slide(e[t].h,e[t].v),t++))}var o={};if(o.wrapper=document.querySelector(".reveal"),!o.wrapper.querySelector(".searchbox")){var c=document.createElement("div");c.id="searchinputdiv",c.classList.add("searchdiv"),c.style.position="absolute",c.style.top="10px",c.style.right="10px",c.style.zIndex=10,c.innerHTML='<span><input type="search" id="searchinput" class="searchinput" style="vertical-align: top;"/><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJiSURBVHjatFZNaxNBGH5md+Mmu92NVdKDRipSAyqCghgQD4L4cRe86UUtAQ+eFCxoa4/25EXBFi8eBE+eRPoDhB6KgiiixdAPCEkx2pjvTXadd9yNsflwuyUDD/O+u8PzzDPvzOwyx3EwyCZhwG3gAkp7MnpjgbopjsltcD4gjuXZZKeAR348MYLYTm3LzOs/y3j3JTfZxgXWXmTuwPHIc4VmoOmv5IrI53+AO2DdHLjkDWQ3GoEEVFXtXQOvkSnPWcyUceviLhwbDYv8/XIVj97kse7TodLvZXxYxrPUHkQ1ufXs3FEdybEIxucySOesoNvUgWU1cP3MkCBfTFdw9fGaAMVmRELq7LBw2Q3/FaAxxWIRpw+ZIr/7IouPqzUBiqmdHAv7EuhRAwf1er2Vy4x1jW3b2d5Jfvu5IPp7l2LYbcgCFFNb+FoJ7oBqEAqFMPNqFcmEgVMJDfMT+1tvN0pNjERlMS6QA5pFOKxiKVPFhakPeL3It+WGJUDxt2wFR+JhzI7v5ctkd8DXOZAkCYYxhO+lKm4+Xfqz/rIixBuNBl7eOYzkQQNzqX249mRl6zUgEcYkaJrGhUwBinVdh6IouPzwE6/DL5w4oLkH8y981aDf+uq6hlKpJESiUdNfDZi7/ehG9K6KfiA3pml0PLcsq+cSMTj2NL9ukc4UOmz7AZ3+crkC4mHujFvXNaMFB3bEr8xPS6p5O+jXxq4VZtaen7/PwzrntjcLUE0iHPS1Ud1cdiEJl/8WivZk0wXd7zWOMkeF8s0CcAmkNrC2nvXZDbbbN73ccYnZoH9bfgswAFzAe9/h3dbKAAAAAElFTkSuQmCC" id="searchbutton" class="searchicon" style="vertical-align: top; margin-top: -1px;"/></span>',o.wrapper.appendChild(c)}return document.getElementById("searchbutton").addEventListener("click",(function(e){d()}),!1),document.getElementById("searchinput").addEventListener("keyup",(function(e){switch(e.keyCode){case 13:e.preventDefault(),d(),n=!1;break;default:n=!0}}),!1),document.addEventListener("keydown",(function(e){"F"==e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),"inline"!==document.getElementById("searchinputdiv").style.display?l():a())}),!1),a(),{id:"search",init:function(e){e.registerKeyboardShortcut("CTRL + Shift + F","Search")},open:l}}();Reveal.registerPlugin(e)}));

6
dist/plugin/zoom.js vendored
View File

@ -1,11 +1,11 @@
!function(e){var t={};function o(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=6)}({6:function(e,t,o){"use strict";o.r(t); !function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";
/*! /*!
* reveal.js Zoom plugin * reveal.js Zoom plugin
*/var n={id:"zoom",init:function(e){e.getRevealElement().addEventListener("mousedown",(function(t){var o=/Linux/.test(window.navigator.platform)?"ctrl":"alt",n=(e.getConfig().zoomKey?e.getConfig().zoomKey:o)+"Key",r=e.getConfig().zoomLevel?e.getConfig().zoomLevel:2;t[n]&&!e.isOverview()&&(t.preventDefault(),i.to({x:t.clientX,y:t.clientY,scale:r,pan:!1}))}))}},i=function(){var e=1,t=0,o=0,n=-1,r=-1,d="WebkitTransform"in document.body.style||"MozTransform"in document.body.style||"msTransform"in document.body.style||"OTransform"in document.body.style||"transform"in document.body.style;function s(t,o){var n=u();if(t.width=t.width||1,t.height=t.height||1,t.x-=(window.innerWidth-t.width*o)/2,t.y-=(window.innerHeight-t.height*o)/2,d)if(1===o)document.body.style.transform="",document.body.style.OTransform="",document.body.style.msTransform="",document.body.style.MozTransform="",document.body.style.WebkitTransform="";else{var i=n.x+"px "+n.y+"px",r="translate("+-t.x+"px,"+-t.y+"px) scale("+o+")";document.body.style.transformOrigin=i,document.body.style.OTransformOrigin=i,document.body.style.msTransformOrigin=i,document.body.style.MozTransformOrigin=i,document.body.style.WebkitTransformOrigin=i,document.body.style.transform=r,document.body.style.OTransform=r,document.body.style.msTransform=r,document.body.style.MozTransform=r,document.body.style.WebkitTransform=r}else 1===o?(document.body.style.position="",document.body.style.left="",document.body.style.top="",document.body.style.width="",document.body.style.height="",document.body.style.zoom=""):(document.body.style.position="relative",document.body.style.left=-(n.x+t.x)/o+"px",document.body.style.top=-(n.y+t.y)/o+"px",document.body.style.width=100*o+"%",document.body.style.height=100*o+"%",document.body.style.zoom=o);e=o,document.documentElement.classList&&(1!==e?document.documentElement.classList.add("zoomed"):document.documentElement.classList.remove("zoomed"))}function l(){var n=.12*window.innerWidth,i=.12*window.innerHeight,r=u();o<i?window.scroll(r.x,r.y-14/e*(1-o/i)):o>window.innerHeight-i&&window.scroll(r.x,r.y+(1-(window.innerHeight-o)/i)*(14/e)),t<n?window.scroll(r.x-14/e*(1-t/n),r.y):t>window.innerWidth-n&&window.scroll(r.x+(1-(window.innerWidth-t)/n)*(14/e),r.y)}function u(){return{x:void 0!==window.scrollX?window.scrollX:window.pageXOffset,y:void 0!==window.scrollY?window.scrollY:window.pageYOffset}}return d&&(document.body.style.transition="transform 0.8s ease",document.body.style.OTransition="-o-transform 0.8s ease",document.body.style.msTransition="-ms-transform 0.8s ease",document.body.style.MozTransition="-moz-transform 0.8s ease",document.body.style.WebkitTransition="-webkit-transform 0.8s ease"),document.addEventListener("keyup",(function(t){1!==e&&27===t.keyCode&&i.out()})),document.addEventListener("mousemove",(function(n){1!==e&&(t=n.clientX,o=n.clientY)})),{to:function(t){if(1!==e)i.out();else{if(t.x=t.x||0,t.y=t.y||0,t.element){var o=t.element.getBoundingClientRect();t.x=o.left-20,t.y=o.top-20,t.width=o.width+40,t.height=o.height+40}void 0!==t.width&&void 0!==t.height&&(t.scale=Math.max(Math.min(window.innerWidth/t.width,window.innerHeight/t.height),1)),t.scale>1&&(t.x*=t.scale,t.y*=t.scale,s(t,t.scale),!1!==t.pan&&(n=setTimeout((function(){r=setInterval(l,1e3/60)}),800)))}},out:function(){clearTimeout(n),clearInterval(r),s({x:0,y:0},1),e=1},magnify:function(e){this.to(e)},reset:function(){this.out()},zoomLevel:function(){return e}}}(); */var e={id:"zoom",init:function(e){e.getRevealElement().addEventListener("mousedown",(function(o){var n=/Linux/.test(window.navigator.platform)?"ctrl":"alt",i=(e.getConfig().zoomKey?e.getConfig().zoomKey:n)+"Key",d=e.getConfig().zoomLevel?e.getConfig().zoomLevel:2;o[i]&&!e.isOverview()&&(o.preventDefault(),t.to({x:o.clientX,y:o.clientY,scale:d,pan:!1}))}))}},t=function(){var e=1,o=0,n=0,i=-1,d=-1,s="WebkitTransform"in document.body.style||"MozTransform"in document.body.style||"msTransform"in document.body.style||"OTransform"in document.body.style||"transform"in document.body.style;function r(t,o){var n=y();if(t.width=t.width||1,t.height=t.height||1,t.x-=(window.innerWidth-t.width*o)/2,t.y-=(window.innerHeight-t.height*o)/2,s)if(1===o)document.body.style.transform="",document.body.style.OTransform="",document.body.style.msTransform="",document.body.style.MozTransform="",document.body.style.WebkitTransform="";else{var i=n.x+"px "+n.y+"px",d="translate("+-t.x+"px,"+-t.y+"px) scale("+o+")";document.body.style.transformOrigin=i,document.body.style.OTransformOrigin=i,document.body.style.msTransformOrigin=i,document.body.style.MozTransformOrigin=i,document.body.style.WebkitTransformOrigin=i,document.body.style.transform=d,document.body.style.OTransform=d,document.body.style.msTransform=d,document.body.style.MozTransform=d,document.body.style.WebkitTransform=d}else 1===o?(document.body.style.position="",document.body.style.left="",document.body.style.top="",document.body.style.width="",document.body.style.height="",document.body.style.zoom=""):(document.body.style.position="relative",document.body.style.left=-(n.x+t.x)/o+"px",document.body.style.top=-(n.y+t.y)/o+"px",document.body.style.width=100*o+"%",document.body.style.height=100*o+"%",document.body.style.zoom=o);e=o,document.documentElement.classList&&(1!==e?document.documentElement.classList.add("zoomed"):document.documentElement.classList.remove("zoomed"))}function m(){var t=.12*window.innerWidth,i=.12*window.innerHeight,d=y();n<i?window.scroll(d.x,d.y-14/e*(1-n/i)):n>window.innerHeight-i&&window.scroll(d.x,d.y+(1-(window.innerHeight-n)/i)*(14/e)),o<t?window.scroll(d.x-14/e*(1-o/t),d.y):o>window.innerWidth-t&&window.scroll(d.x+(1-(window.innerWidth-o)/t)*(14/e),d.y)}function y(){return{x:void 0!==window.scrollX?window.scrollX:window.pageXOffset,y:void 0!==window.scrollY?window.scrollY:window.pageYOffset}}return s&&(document.body.style.transition="transform 0.8s ease",document.body.style.OTransition="-o-transform 0.8s ease",document.body.style.msTransition="-ms-transform 0.8s ease",document.body.style.MozTransition="-moz-transform 0.8s ease",document.body.style.WebkitTransition="-webkit-transform 0.8s ease"),document.addEventListener("keyup",(function(o){1!==e&&27===o.keyCode&&t.out()})),document.addEventListener("mousemove",(function(t){1!==e&&(o=t.clientX,n=t.clientY)})),{to:function(o){if(1!==e)t.out();else{if(o.x=o.x||0,o.y=o.y||0,o.element){var n=o.element.getBoundingClientRect();o.x=n.left-20,o.y=n.top-20,o.width=n.width+40,o.height=n.height+40}void 0!==o.width&&void 0!==o.height&&(o.scale=Math.max(Math.min(window.innerWidth/o.width,window.innerHeight/o.height),1)),o.scale>1&&(o.x*=o.scale,o.y*=o.scale,r(o,o.scale),!1!==o.pan&&(i=setTimeout((function(){d=setInterval(m,1e3/60)}),800)))}},out:function(){clearTimeout(i),clearInterval(d),r({x:0,y:0},1),e=1},magnify:function(e){this.to(e)},reset:function(){this.out()},zoomLevel:function(){return e}}}();
/*! /*!
* zoom.js 0.3 (modified for use with reveal.js) * zoom.js 0.3 (modified for use with reveal.js)
* http://lab.hakim.se/zoom-js * http://lab.hakim.se/zoom-js
* MIT licensed * MIT licensed
* *
* Copyright (C) 2011-2014 Hakim El Hattab, http://hakim.se * Copyright (C) 2011-2014 Hakim El Hattab, http://hakim.se
*/Reveal.registerPlugin(n)}}); */Reveal.registerPlugin(e)}));

4
dist/reveal.css vendored

File diff suppressed because one or more lines are too long

4
dist/reveal.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -3,8 +3,12 @@ const path = require('path')
const glob = require('glob') const glob = require('glob')
const yargs = require('yargs') const yargs = require('yargs')
const colors = require('colors') const colors = require('colors')
const webpack = require('webpack-stream') const qunit = require('node-qunit-puppeteer')
const { runQunitPuppeteer, printResultSummary, printFailedTests } = require('node-qunit-puppeteer')
const {rollup} = require('rollup');
const {terser} = require('rollup-plugin-terser');
const babel = require('rollup-plugin-babel');
const resolve = require('@rollup/plugin-node-resolve');
const gulp = require('gulp') const gulp = require('gulp')
const tap = require('gulp-tap') const tap = require('gulp-tap')
@ -12,8 +16,6 @@ const zip = require('gulp-zip')
const sass = require('gulp-sass') const sass = require('gulp-sass')
const header = require('gulp-header') const header = require('gulp-header')
const eslint = require('gulp-eslint') const eslint = require('gulp-eslint')
const uglify = require('gulp-uglify')
const rename = require('gulp-rename')
const minify = require('gulp-clean-css') const minify = require('gulp-clean-css')
const connect = require('gulp-connect') const connect = require('gulp-connect')
const autoprefixer = require('gulp-autoprefixer') const autoprefixer = require('gulp-autoprefixer')
@ -21,65 +23,83 @@ const autoprefixer = require('gulp-autoprefixer')
const root = yargs.argv.root || '.' const root = yargs.argv.root || '.'
const port = yargs.argv.port || 8000 const port = yargs.argv.port || 8000
const license = `/*! const banner = `/*!
* reveal.js <%= pkg.version %> (<%= new Date().toDateString() %>) * reveal.js ${pkg.version} (${new Date().toDateString()})
* <%= pkg.homepage %> * ${pkg.homepage}
* MIT licensed * MIT licensed
* *
* Copyright (C) 2020 Hakim El Hattab, https://hakim.se * Copyright (C) 2020 Hakim El Hattab, https://hakim.se
*/\n` */\n`
const rollupConfig = {
const swallowError = function(error) { plugins: [
console.log(error.toString()) babel({
this.emit('end') exclude: 'node_modules/**',
compact: false,
presets: [
[
'@babel/preset-env',
{
corejs: 3,
useBuiltIns: 'entry',
modules: false
} }
]
]
}),
resolve(),
terser()
]
};
gulp.task('js', () => gulp.src(['./js/index.js']) gulp.task('js', () => {
.pipe(webpack(require('./webpack.config.js'))) return rollup({
.on('error', swallowError) input: 'js/index.js',
.pipe(header(license, {pkg: pkg})) ...rollupConfig
.pipe(rename('reveal.min.js')) }).then( bundle => {
.pipe(gulp.dest('./dist'))) bundle.write({
file: './dist/reveal.min.js',
format: 'umd',
banner: banner
});
});
})
gulp.task('plugins', () => gulp.src(['./js/index.js']) gulp.task('plugins', () => {
.pipe(webpack({ return Promise.all([
...require('./webpack.config.js'), { input: './plugin/highlight/highlight.es5', output: './dist/plugin/highlight.js' },
entry: { { input: './plugin/markdown/markdown.es5', output: './dist/plugin/markdown.js' },
'highlight': './plugin/highlight/highlight.es5', { input: './plugin/search/search.es5', output: './dist/plugin/search.js' },
'markdown': './plugin/markdown/markdown.es5', { input: './plugin/notes/notes.es5', output: './dist/plugin/notes.js' },
'search': './plugin/search/search.es5', { input: './plugin/zoom/zoom.es5', output: './dist/plugin/zoom.js' },
'notes': './plugin/notes/notes.es5', { input: './plugin/math/math.es5', output: './dist/plugin/math.js' }
'zoom': './plugin/zoom/zoom.es5', ].map( plugin => {
'math': './plugin/math/math.es5' return rollup({
}, input: plugin.input,
output: { ...rollupConfig
filename: '[name].js' }).then( bundle => {
} return bundle.write({
})) file: plugin.output,
.on('error', swallowError) format: 'umd'
.pipe(gulp.dest('./dist/plugin'))) })
});
} ));
})
gulp.task('css-themes', () => gulp.src(['./css/theme/source/*.{sass,scss}']) gulp.task('css-themes', () => gulp.src(['./css/theme/source/*.{sass,scss}'])
.pipe(sass()) .pipe(sass())
.pipe(gulp.dest('./dist/theme'))) .pipe(gulp.dest('./dist/theme')))
gulp.task('css-core', gulp.series( gulp.task('css-core', () => gulp.src(['css/reveal.scss'])
() => gulp.src(['css/reveal.scss'])
.pipe(sass()) .pipe(sass())
.pipe(autoprefixer()) .pipe(autoprefixer())
.pipe(gulp.dest('./dist')),
() => gulp.src(['dist/reveal.css'])
.pipe(minify({compatibility: 'ie9'})) .pipe(minify({compatibility: 'ie9'}))
.pipe(header(license, {pkg: pkg})) .pipe(header(banner))
.pipe(gulp.dest('./dist')) .pipe(gulp.dest('./dist')))
))
gulp.task('css', gulp.parallel('css-themes', 'css-core')) gulp.task('css', gulp.parallel('css-themes', 'css-core'))
gulp.task('test-qunit', function() { gulp.task('qunit', () => {
let serverConfig = { let serverConfig = {
root, root,
@ -97,7 +117,7 @@ gulp.task('test-qunit', function() {
let tests = Promise.all( testFiles.map( filename => { let tests = Promise.all( testFiles.map( filename => {
return new Promise( ( resolve, reject ) => { return new Promise( ( resolve, reject ) => {
runQunitPuppeteer({ qunit.runQunitPuppeteer({
targetUrl: `http://${serverConfig.host}:${serverConfig.port}/${filename}`, targetUrl: `http://${serverConfig.host}:${serverConfig.port}/${filename}`,
timeout: 20000, timeout: 20000,
redirectConsole: false, redirectConsole: false,
@ -106,8 +126,8 @@ gulp.task('test-qunit', function() {
.then(result => { .then(result => {
if( result.stats.failed > 0 ) { if( result.stats.failed > 0 ) {
console.log(`${'!'} ${filename} [${result.stats.passed}/${result.stats.total}] in ${result.stats.runtime}ms`.red); console.log(`${'!'} ${filename} [${result.stats.passed}/${result.stats.total}] in ${result.stats.runtime}ms`.red);
// printResultSummary(result, console); // qunit.printResultSummary(result, console);
printFailedTests(result, console); qunit.printFailedTests(result, console);
} }
else { else {
console.log(`${'✔'} ${filename} [${result.stats.passed}/${result.stats.total}] in ${result.stats.runtime}ms`.green); console.log(`${'✔'} ${filename} [${result.stats.passed}/${result.stats.total}] in ${result.stats.runtime}ms`.green);
@ -146,14 +166,13 @@ gulp.task('test-qunit', function() {
} ); } );
} ) } )
gulp.task('test', gulp.series( gulp.task('eslint', () => gulp.src(['./js/**', 'gulpfile.js'])
.pipe(eslint())
.pipe(eslint.format()))
() => gulp.src(['./js/**', 'gulpfile.js']).pipe(eslint()).pipe(eslint.format()), gulp.task('test', gulp.series( 'eslint', 'qunit' ))
'test-qunit'
)) gulp.task('default', gulp.series(gulp.parallel('js', 'css', 'plugins'), 'test'))
gulp.task('default', gulp.series(gulp.parallel('js', 'css'), 'test'))
gulp.task('build', gulp.parallel('js', 'css')) gulp.task('build', gulp.parallel('js', 'css'))
@ -181,6 +200,8 @@ gulp.task('serve', () => {
gulp.watch(['js/**'], gulp.series('js', 'test')) gulp.watch(['js/**'], gulp.series('js', 'test'))
gulp.watch(['plugin/**/*.js'], gulp.series('plugins'))
gulp.watch(['test/*.html'], gulp.series('test')) gulp.watch(['test/*.html'], gulp.series('test'))
gulp.watch([ gulp.watch([

1702
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -26,30 +26,29 @@
"devDependencies": { "devDependencies": {
"@babel/core": "^7.8.7", "@babel/core": "^7.8.7",
"@babel/preset-env": "^7.8.7", "@babel/preset-env": "^7.8.7",
"@rollup/plugin-node-resolve": "^7.1.3",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"colors": "^1.4.0", "colors": "^1.4.0",
"express": "^4.17.1", "express": "^4.17.1",
"glob": "^7.1.6", "glob": "^7.1.6",
"gulp": "^4.0.2", "gulp": "^4.0.2",
"gulp-autoprefixer": "^7.0.1", "gulp-autoprefixer": "^7.0.1",
"gulp-babel": "^8.0.0",
"gulp-clean-css": "^4.2.0", "gulp-clean-css": "^4.2.0",
"gulp-connect": "^5.7.0", "gulp-connect": "^5.7.0",
"gulp-eslint": "^6.0.0", "gulp-eslint": "^6.0.0",
"gulp-header": "^2.0.9", "gulp-header": "^2.0.9",
"gulp-rename": "^2.0.0",
"gulp-sass": "^4.0.2", "gulp-sass": "^4.0.2",
"gulp-tap": "^2.0.0", "gulp-tap": "^2.0.0",
"gulp-uglify": "^3.0.2",
"gulp-zip": "^5.0.1", "gulp-zip": "^5.0.1",
"mustache": "^4.0.0", "mustache": "^4.0.0",
"node-qunit-puppeteer": "^2.0.1", "node-qunit-puppeteer": "^2.0.1",
"rollup": "^2.6.1",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-terser": "^5.3.0",
"socket.io": "^2.3.0", "socket.io": "^2.3.0",
"webpack-stream": "^5.2.1",
"yargs": "^15.1.0" "yargs": "^15.1.0"
}, },
"browserslist": "last 2 versions, > 0.5%, not dead", "browserslist": "> 0.5%, IE 11, not dead",
"eslintConfig": { "eslintConfig": {
"env": { "env": {
"browser": true, "browser": true,
@ -89,6 +88,6 @@
} }
}, },
"dependencies": { "dependencies": {
"highlight.js": "^9.18.1" "core-js": "^3.6.5"
} }
} }

View File

@ -1,24 +0,0 @@
const path = require('path');
module.exports = {
mode: 'production',
entry: ['./js/index.js'],
output: {
path: path.join(__dirname, '/dist'),
filename: 'reveal.min.js',
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
loader: 'babel-loader',
query: {
presets: [
[ '@babel/preset-env' ]
]
}
}
]
}
};