Skip to content

Commit

Permalink
Merge pull request #4 from naamor/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
naamor authored Nov 26, 2019
2 parents 9440ffd + 05af027 commit fa6806e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 38 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ Reveal.initialize({
// Specifies the position of the table of contents slide in the presentation
position: 2,

// Specifies html tag in which the table of contents title stands
titleTag: "h1",

// Specifies which slide tag elements will be used
// for generating the table of contents.
titleTagSelector: "h1, h2, h3, h4, h5, h6",
Expand Down
38 changes: 0 additions & 38 deletions tableofcontents.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
*/

var RevealTableOfContents = window.RevealTableOfContents || (function () {
loadResource("plugin/table-of-contents/table-of-contents.css", "stylesheet");

// Set all option defaults
var options = Reveal.getConfig().tableofcontents || {};
var titleTag = options.titleTag || "h1";
Expand Down Expand Up @@ -116,40 +114,4 @@ var RevealTableOfContents = window.RevealTableOfContents || (function () {
if (valueA.tagName > valueB.tagName) return 1;
return 0;
}

// Modified from math plugin
function loadResource(url, type, callback) {
var head = document.querySelector("head");
var resource;

if (type === "script") {
resource = document.createElement("script");
resource.type = "text/javascript";
resource.src = url;
} else if (type === "stylesheet") {
resource = document.createElement("link");
resource.rel = "stylesheet";
resource.href = url;
}

// Wrapper for callback to make sure it only fires once
var finish = function () {
if (typeof callback === "function") {
callback.call();
callback = null;
}
};

resource.onload = finish;

// IE
resource.onreadystatechange = function () {
if (this.readyState === "loaded") {
finish();
}
};

// Normal browsers
head.appendChild(resource);
}
})();

0 comments on commit fa6806e

Please sign in to comment.