Skip to content
Permalink
Browse files

Merge pull request #12950 from aeslaughter/MOOSEDocs-reveal

MooseDocs presentations and AD for minitutorial
  • Loading branch information...
lindsayad committed Feb 22, 2019
2 parents 7462455 + 5bef1e6 commit c8e8cd817470326b00ab00f7edfc70e49ef9de98
Showing with 10,016 additions and 148 deletions.
  1. +147 −0 framework/doc/content/contrib/reveal/notes.js
  2. +1,591 −0 framework/doc/content/contrib/reveal/reveal.css
  3. +5,577 −0 framework/doc/content/contrib/reveal/reveal.js
  4. +276 −0 framework/doc/content/contrib/reveal/simple.css
  5. +25 −0 framework/doc/content/css/katex_moose.css
  6. +2 −25 framework/doc/content/css/moose.css
  7. +221 −0 framework/doc/content/css/reveal_moose.css
  8. +11 −0 framework/doc/content/js/reveal_init.js
  9. +1 −1 framework/include/kernels/ADDiffusion.h
  10. +8 −0 framework/include/kernels/ADKernel.h
  11. +11 −1 framework/include/utils/MooseTypes.h
  12. +3 −1 framework/src/kernels/ADKernel.C
  13. +1 −1 python/MooseDocs/__init__.py
  14. +1 −0 python/MooseDocs/base/__init__.py
  15. +60 −7 python/MooseDocs/base/renderers.py
  16. +1 −0 python/MooseDocs/extensions/__init__.py
  17. +110 −17 python/MooseDocs/extensions/appsyntax.py
  18. +15 −0 python/MooseDocs/extensions/core.py
  19. +27 −1 python/MooseDocs/extensions/include.py
  20. +2 −1 python/MooseDocs/extensions/katex.py
  21. +6 −3 python/MooseDocs/extensions/listing.py
  22. +112 −0 python/MooseDocs/extensions/reveal.py
  23. +59 −0 python/MooseDocs/extensions/style.py
  24. +792 −0 python/MooseDocs/test/gold/html/contrib/reveal/notes.html
  25. +1 −1 python/MooseDocs/test/gold/html/extensions/acronym.html
  26. +2 −2 python/MooseDocs/test/gold/html/extensions/alert.html
  27. +1 −1 python/MooseDocs/test/gold/html/extensions/amendments.html
  28. +2 −2 python/MooseDocs/test/gold/html/extensions/appsyntax.html
  29. +2 −2 python/MooseDocs/test/gold/html/extensions/autolink.html
  30. +2 −2 python/MooseDocs/test/gold/html/extensions/bibtex.html
  31. +1 −1 python/MooseDocs/test/gold/html/extensions/common.html
  32. +1 −1 python/MooseDocs/test/gold/html/extensions/config.html
  33. +1 −1 python/MooseDocs/test/gold/html/extensions/content.html
  34. +2 −2 python/MooseDocs/test/gold/html/extensions/core.html
  35. +2 −2 python/MooseDocs/test/gold/html/extensions/devel.html
  36. +1 −1 python/MooseDocs/test/gold/html/extensions/example.template.html
  37. +1 −1 python/MooseDocs/test/gold/html/extensions/first.html
  38. +1 −1 python/MooseDocs/test/gold/html/extensions/folder/folder.html
  39. +1 −1 python/MooseDocs/test/gold/html/extensions/folder/index.html
  40. +1 −1 python/MooseDocs/test/gold/html/extensions/gallery.html
  41. +2 −2 python/MooseDocs/test/gold/html/extensions/graph.html
  42. +1 −1 python/MooseDocs/test/gold/html/extensions/include.html
  43. +1 −1 python/MooseDocs/test/gold/html/extensions/katex.html
  44. +1 −1 python/MooseDocs/test/gold/html/extensions/katex_include.html
  45. +1 −1 python/MooseDocs/test/gold/html/extensions/layout.html
  46. +2 −2 python/MooseDocs/test/gold/html/extensions/listing.html
  47. +1 −1 python/MooseDocs/test/gold/html/extensions/listing_include.html
  48. +1 −1 python/MooseDocs/test/gold/html/extensions/materialicon.html
  49. +1 −1 python/MooseDocs/test/gold/html/extensions/media.html
  50. +1 −1 python/MooseDocs/test/gold/html/extensions/navigation.html
  51. +2 −2 python/MooseDocs/test/gold/html/extensions/package.html
  52. +1 −1 python/MooseDocs/test/gold/html/extensions/preamble.html
  53. +1 −1 python/MooseDocs/test/gold/html/extensions/second.html
  54. +2 −2 python/MooseDocs/test/gold/html/extensions/sqa.html
  55. +1 −1 python/MooseDocs/test/gold/html/extensions/table.html
  56. +1 −1 python/MooseDocs/test/gold/html/extensions/template.html
  57. +1 −1 python/MooseDocs/test/gold/html/index.html
  58. +1 −1 python/MooseDocs/test/gold/html/mega.menu.html
  59. +792 −0 python/MooseDocs/test/gold/materialize/contrib/reveal/notes.html
  60. +1 −1 python/MooseDocs/test/gold/materialize/extensions/acronym.html
  61. +2 −2 python/MooseDocs/test/gold/materialize/extensions/alert.html
  62. +1 −1 python/MooseDocs/test/gold/materialize/extensions/amendments.html
  63. +2 −2 python/MooseDocs/test/gold/materialize/extensions/appsyntax.html
  64. +2 −2 python/MooseDocs/test/gold/materialize/extensions/autolink.html
  65. +2 −2 python/MooseDocs/test/gold/materialize/extensions/bibtex.html
  66. +1 −1 python/MooseDocs/test/gold/materialize/extensions/common.html
  67. +1 −1 python/MooseDocs/test/gold/materialize/extensions/config.html
  68. +1 −1 python/MooseDocs/test/gold/materialize/extensions/content.html
  69. +2 −2 python/MooseDocs/test/gold/materialize/extensions/core.html
  70. +2 −2 python/MooseDocs/test/gold/materialize/extensions/devel.html
  71. +2 −2 python/MooseDocs/test/gold/materialize/extensions/example.template.html
  72. +1 −1 python/MooseDocs/test/gold/materialize/extensions/first.html
  73. +1 −1 python/MooseDocs/test/gold/materialize/extensions/folder/folder.html
  74. +1 −1 python/MooseDocs/test/gold/materialize/extensions/folder/index.html
  75. +1 −1 python/MooseDocs/test/gold/materialize/extensions/gallery.html
  76. +2 −2 python/MooseDocs/test/gold/materialize/extensions/graph.html
  77. +1 −1 python/MooseDocs/test/gold/materialize/extensions/include.html
  78. +1 −1 python/MooseDocs/test/gold/materialize/extensions/katex.html
  79. +1 −1 python/MooseDocs/test/gold/materialize/extensions/katex_include.html
  80. +1 −1 python/MooseDocs/test/gold/materialize/extensions/layout.html
  81. +2 −2 python/MooseDocs/test/gold/materialize/extensions/listing.html
  82. +1 −1 python/MooseDocs/test/gold/materialize/extensions/listing_include.html
  83. +1 −1 python/MooseDocs/test/gold/materialize/extensions/materialicon.html
  84. +1 −1 python/MooseDocs/test/gold/materialize/extensions/media.html
  85. +1 −1 python/MooseDocs/test/gold/materialize/extensions/navigation.html
  86. +2 −2 python/MooseDocs/test/gold/materialize/extensions/package.html
  87. +1 −1 python/MooseDocs/test/gold/materialize/extensions/preamble.html
  88. +1 −1 python/MooseDocs/test/gold/materialize/extensions/second.html
  89. +2 −2 python/MooseDocs/test/gold/materialize/extensions/sqa.html
  90. +1 −1 python/MooseDocs/test/gold/materialize/extensions/table.html
  91. +2 −2 python/MooseDocs/test/gold/materialize/extensions/template.html
  92. +1 −1 python/MooseDocs/test/gold/materialize/index.html
  93. +1 −1 python/MooseDocs/test/gold/materialize/mega.menu.html
  94. +75 −0 python/MooseDocs/test/reveal.yml
@@ -0,0 +1,147 @@
/**
* Handles opening of and synchronization with the reveal.js
* notes window.
*
* Handshake process:
* 1. This window posts 'connect' to notes window
* - Includes URL of presentation to show
* 2. Notes window responds with 'connected' when it is available
* 3. This window proceeds to send the current presentation state
* to the notes window
*/
var RevealNotes = (function() {

function openNotes( notesFilePath ) {

if( !notesFilePath ) {
var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path
jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path
notesFilePath = jsFileLocation + 'notes.html';
}

var notesPopup = window.open( notesFilePath, 'reveal.js - Notes', 'width=1100,height=700' );

if( !notesPopup ) {
alert( 'Speaker view popup failed to open. Please make sure popups are allowed and reopen the speaker view.' );
return;
}

// Allow popup window access to Reveal API
notesPopup.Reveal = window.Reveal;

/**
* Connect to the notes window through a postmessage handshake.
* Using postmessage enables us to work in situations where the
* origins differ, such as a presentation being opened from the
* file system.
*/
function connect() {
// Keep trying to connect until we get a 'connected' message back
var connectInterval = setInterval( function() {
notesPopup.postMessage( JSON.stringify( {
namespace: 'reveal-notes',
type: 'connect',
url: window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search,
state: Reveal.getState()
} ), '*' );
}, 500 );

window.addEventListener( 'message', function( event ) {
var data = JSON.parse( event.data );
if( data && data.namespace === 'reveal-notes' && data.type === 'connected' ) {
clearInterval( connectInterval );
onConnected();
}
} );
}

/**
* Posts the current slide data to the notes window
*/
function post( event ) {

var slideElement = Reveal.getCurrentSlide(),
notesElement = slideElement.querySelector( 'aside.notes' ),
fragmentElement = slideElement.querySelector( '.current-fragment' );

var messageData = {
namespace: 'reveal-notes',
type: 'state',
notes: '',
markdown: false,
whitespace: 'normal',
state: Reveal.getState()
};

// Look for notes defined in a slide attribute
if( slideElement.hasAttribute( 'data-notes' ) ) {
messageData.notes = slideElement.getAttribute( 'data-notes' );
messageData.whitespace = 'pre-wrap';
}

// Look for notes defined in a fragment
if( fragmentElement ) {
var fragmentNotes = fragmentElement.querySelector( 'aside.notes' );
if( fragmentNotes ) {
notesElement = fragmentNotes;
}
else if( fragmentElement.hasAttribute( 'data-notes' ) ) {
messageData.notes = fragmentElement.getAttribute( 'data-notes' );
messageData.whitespace = 'pre-wrap';

// In case there are slide notes
notesElement = null;
}
}

// Look for notes defined in an aside element
if( notesElement ) {
messageData.notes = notesElement.innerHTML;
messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string';
}

notesPopup.postMessage( JSON.stringify( messageData ), '*' );

}

/**
* Called once we have established a connection to the notes
* window.
*/
function onConnected() {

// Monitor events that trigger a change in state
Reveal.addEventListener( 'slidechanged', post );
Reveal.addEventListener( 'fragmentshown', post );
Reveal.addEventListener( 'fragmenthidden', post );
Reveal.addEventListener( 'overviewhidden', post );
Reveal.addEventListener( 'overviewshown', post );
Reveal.addEventListener( 'paused', post );
Reveal.addEventListener( 'resumed', post );

// Post the initial state
post();

}

connect();

}

if( !/receiver/i.test( window.location.search ) ) {

// If the there's a 'notes' query set, open directly
if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) {
openNotes();
}

// Open the notes when the 's' key is hit
Reveal.addKeyBinding({keyCode: 83, key: 'S', description: 'Speaker notes view'}, function() {
openNotes();
} );

}

return { open: openNotes };

})();
Oops, something went wrong.

0 comments on commit c8e8cd8

Please sign in to comment.
You can’t perform that action at this time.