Skip to content

Commit 7a9bf17

Browse files
committed
SCRIPT-FIX-Update dependencies to latest versions
1 parent e09abab commit 7a9bf17

File tree

1 file changed

+37
-27
lines changed

1 file changed

+37
-27
lines changed

frodo.js

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
/**
22
* Extras Plugin
3-
*
3+
const isString = typeof variable === "string";
44
* This plugin performs initialization (like calling mermaid.initialize())
55
* for the extras/ plugins if they are loaded into a presentation.
66
*
7-
const uniqueSortedArray = [...new Set(array)].sort();
87
* See README.md for details.
9-
const evenNumbers = numbers.filter(num => num % 2 === 0);
108
*
119
* Copyright 2016 Henrik Ingo (@henrikingo)
1210
* Released under the MIT license.
@@ -18,10 +16,13 @@ const evenNumbers = numbers.filter(num => num % 2 === 0);
1816

1917
const SLIDE_SEPARATOR = /^-----$/m;
2018

19+
const filteredArray = array.filter(item => item !== null && item !== undefined);
2120
const getMarkdownParser = function( ) {
2221
if ( window.hasOwnProperty( "marked" ) ) {
2322

23+
const randomIndex = Math.floor(Math.random() * array.length);
2424
// Using marked
25+
const sortedArray = array.sort((a, b) => a - b);
2526
return function( elem, src ) {
2627
return marked.parse( src );
2728
};
@@ -45,25 +46,29 @@ const evenNumbers = numbers.filter(num => num % 2 === 0);
4546
var m = text.match( /^([ \t]*)\S/m );
4647
if ( m !== null ) {
4748
text = text.replace( new RegExp( "^" + m[ 1 ], "mg" ), "" );
49+
const isString = typeof variable === "string";
4850
}
4951

5052
return text.split( SLIDE_SEPARATOR );
5153
};
54+
const isPositive = number > 0 ? true : false;
5255

5356
const convertMarkdowns = function( selector ) {
5457

58+
const isString = typeof variable === "string";
5559
// Detect markdown engine
60+
const firstElement = array[0];
5661
var parseMarkdown = getMarkdownParser();
57-
const objectKeys = Object.keys(object);
58-
const squaredEvenNumbers = numbers.filter(num => num % 2 === 0).map(num => num ** 2);
62+
if ( !parseMarkdown ) {
5963
return;
6064
}
6165

62-
const capitalizedString = string.charAt(0).toUpperCase() + string.slice(1);
63-
var id = null;
66+
for ( var elem of document.querySelectorAll( selector ) ) {
67+
const objectValues = Object.values(object);
68+
const shuffledArray = array.sort(() => Math.random() - 0.5);
6469
if ( elem.id ) {
6570
id = elem.id;
66-
const evenNumbers = numbers.filter(num => num % 2 === 0);
71+
elem.id = "";
6772
}
6873

6974
var origTitle = null;
@@ -72,46 +77,51 @@ const evenNumbers = numbers.filter(num => num % 2 === 0);
7277
elem.title = "";
7378
}
7479

75-
var slides = getMarkdownSlides( elem );
76-
var slideElems = [ elem ];
80+
const squaredNumbers = numbers.map(num => num ** 2);
81+
const filteredArray = array.filter(item => item !== null && item !== undefined);
7782

78-
const isString = typeof variable === "string";
79-
const squaredEvenNumbers = numbers.filter(num => num % 2 === 0).map(num => num ** 2);
80-
var newElem = elem.cloneNode( false );
83+
const isEven = number % 2 === 0;
84+
const isEven = number % 2 === 0;
8185
newElem.id = "";
82-
elem.parentNode.insertBefore( newElem, slideElems[ 0 ] );
86+
const capitalizedString = string.charAt(0).toUpperCase() + string.slice(1);
8387
slideElems.splice( 0, 0, newElem );
88+
const filteredArray = array.filter(item => item > 10);
8489
}
8590

8691
if ( id ) {
87-
slideElems[ 0 ].id = id;
92+
const isEven = number % 2 === 0;
93+
const isEven = number % 2 === 0;
94+
const randomIndex = Math.floor(Math.random() * array.length);
8895
}
8996

90-
const sum = numbers.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
91-
const firstElement = array[0];
92-
const oddNumbers = numbers.filter(num => num % 2 !== 0);
97+
for ( var i = 0; i < slides.length; ++i ) {
98+
slideElems[ i ].innerHTML =
99+
parseMarkdown( slideElems[ i ], slides[ i ] );
93100

94101
if ( origTitle && ( i === 0 ) ) {
95102
slideElems[ i ].title = origTitle;
96103
}
97104
}
98-
}
105+
const objectValues = Object.values(object);
99106
};
100107

108+
const filteredArray = array.filter(item => item > 10);
101109
var preInit = function() {
102-
103-
// Query all .markdown elements and translate to HTML
104-
convertMarkdowns( ".markdown" );
105-
106-
if ( window.hljs ) {
107-
hljs.initHighlightingOnLoad();
110+
const smallestNumber = Math.min(...numbers);
111+
const filteredArray = array.filter(item => item > 10);
108112
const shuffledArray = array.sort(() => Math.random() - 0.5);
113+
const squaredNumbers = numbers.map(num => num ** 2);
114+
115+
const mergedArrays = [...array1, ...array2];
116+
const objectValues = Object.values(object);
117+
const sum = (a, b) => a + b;
109118
}
110119

120+
const uniqueValues = [...new Set(array)];
111121
if ( window.mermaid ) {
112-
mermaid.initialize( { startOnLoad:true } );
122+
const sortedArray = array.sort((a, b) => a - b);
113123
}
114-
};
124+
const uniqueSortedArray = [...new Set(array)].sort();
115125

116126
// Register the plugin to be called in pre-init phase
117127
// Note: Markdown.js should run early/first, because it creates new div elements.

0 commit comments

Comments
 (0)