fixed title of getting started & nav highlighting
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>/gettingStarted :: | DOCS - impress.js</title>
|
<title>gettingStarted :: | DOCS - impress.js</title>
|
||||||
<!--I am using jquery for button animations.-->
|
<!--I am using jquery for button animations.-->
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<a class="navitem" id="gettingStarted" href="/docs/gettingStarted.html">Getting Started</a>
|
<a class="navitem" id="gettingStarted" href="/docs/gettingStarted.html">Getting Started</a>
|
||||||
<a class="navitem" id="referenceNav" onclick="toggleList( 'reference' );">API reference</a>
|
<a class="navitem" id="referenceNav" onclick="toggleList( 'reference' );">API reference</a>
|
||||||
<div class="dropdown" id="reference">
|
<div class="dropdown" id="reference">
|
||||||
<a class="nav-subitem" id="root" href="/docs/reference">Home</a><a class="nav-subitem" id="CSS.html" href="/docs/reference/CSS.html">CSS</a><a class="nav-subitem" id="HTML.html" href="/docs/reference/HTML.html">HTML</a><a class="nav-subitem" id="JavaScript.html" href="/docs/reference/JavaScript.html">JavaScript</a><a class="nav-subitem" id="Plugins.html" href="/docs/reference/Plugins.html">Plugins</a></div>
|
<a class="nav-subitem" id="root" href="/docs/reference">Home</a><a class="nav-subitem" id="CSS" href="/docs/reference/CSS.html">CSS</a><a class="nav-subitem" id="HTML" href="/docs/reference/HTML.html">HTML</a><a class="nav-subitem" id="JavaScript" href="/docs/reference/JavaScript.html">JavaScript</a><a class="nav-subitem" id="Plugins" href="/docs/reference/Plugins.html">Plugins</a></div>
|
||||||
<a class="navitem" id="pluginsNav" onclick="toggleList( 'plugins' );">Plugins</a>
|
<a class="navitem" id="pluginsNav" onclick="toggleList( 'plugins' );">Plugins</a>
|
||||||
<div class="dropdown" id="plugins">
|
<div class="dropdown" id="plugins">
|
||||||
<a class="nav-subitem" id="autoplay" href="/docs/plugins/autoplay.html">autoplay</a><a class="nav-subitem" id="blackout" href="/docs/plugins/blackout.html">blackout</a><a class="nav-subitem" id="extras" href="/docs/plugins/extras.html">extras</a><a class="nav-subitem" id="form" href="/docs/plugins/form.html">form</a><a class="nav-subitem" id="fullscreen" href="/docs/plugins/fullscreen.html">fullscreen</a><a class="nav-subitem" id="goto" href="/docs/plugins/goto.html">goto</a><a class="nav-subitem" id="help" href="/docs/plugins/help.html">help</a><a class="nav-subitem" id="impressConsole" href="/docs/plugins/impressConsole.html">impressConsole</a><a class="nav-subitem" id="media" href="/docs/plugins/media.html">media</a><a class="nav-subitem" id="mobile" href="/docs/plugins/mobile.html">mobile</a><a class="nav-subitem" id="mouse-timeout" href="/docs/plugins/mouse-timeout.html">mouse-timeout</a><a class="nav-subitem" id="navigation" href="/docs/plugins/navigation.html">navigation</a><a class="nav-subitem" id="navigation-ui" href="/docs/plugins/navigation-ui.html">navigation-ui</a><a class="nav-subitem" id="progress" href="/docs/plugins/progress.html">progress</a><a class="nav-subitem" id="rel" href="/docs/plugins/rel.html">rel</a><a class="nav-subitem" id="resize" href="/docs/plugins/resize.html">resize</a><a class="nav-subitem" id="skip" href="/docs/plugins/skip.html">skip</a><a class="nav-subitem" id="stop" href="/docs/plugins/stop.html">stop</a><a class="nav-subitem" id="substep" href="/docs/plugins/substep.html">substep</a><a class="nav-subitem" id="toolbar" href="/docs/plugins/toolbar.html">toolbar</a><a class="nav-subitem" id="touch" href="/docs/plugins/touch.html">touch</a></div>
|
<a class="nav-subitem" id="autoplay" href="/docs/plugins/autoplay.html">autoplay</a><a class="nav-subitem" id="blackout" href="/docs/plugins/blackout.html">blackout</a><a class="nav-subitem" id="extras" href="/docs/plugins/extras.html">extras</a><a class="nav-subitem" id="form" href="/docs/plugins/form.html">form</a><a class="nav-subitem" id="fullscreen" href="/docs/plugins/fullscreen.html">fullscreen</a><a class="nav-subitem" id="goto" href="/docs/plugins/goto.html">goto</a><a class="nav-subitem" id="help" href="/docs/plugins/help.html">help</a><a class="nav-subitem" id="impressConsole" href="/docs/plugins/impressConsole.html">impressConsole</a><a class="nav-subitem" id="media" href="/docs/plugins/media.html">media</a><a class="nav-subitem" id="mobile" href="/docs/plugins/mobile.html">mobile</a><a class="nav-subitem" id="mouse-timeout" href="/docs/plugins/mouse-timeout.html">mouse-timeout</a><a class="nav-subitem" id="navigation" href="/docs/plugins/navigation.html">navigation</a><a class="nav-subitem" id="navigation-ui" href="/docs/plugins/navigation-ui.html">navigation-ui</a><a class="nav-subitem" id="progress" href="/docs/plugins/progress.html">progress</a><a class="nav-subitem" id="rel" href="/docs/plugins/rel.html">rel</a><a class="nav-subitem" id="resize" href="/docs/plugins/resize.html">resize</a><a class="nav-subitem" id="skip" href="/docs/plugins/skip.html">skip</a><a class="nav-subitem" id="stop" href="/docs/plugins/stop.html">stop</a><a class="nav-subitem" id="substep" href="/docs/plugins/substep.html">substep</a><a class="nav-subitem" id="toolbar" href="/docs/plugins/toolbar.html">toolbar</a><a class="nav-subitem" id="touch" href="/docs/plugins/touch.html">touch</a></div>
|
||||||
|
|||||||
@@ -44,9 +44,10 @@ if ( prompt( 'Do you want to regenerate the API reference? (y/n) ' ).toLowerCase
|
|||||||
|
|
||||||
if ( prompt( 'Do you want to regenerate the Getting Started Guide? (y/n) ' ).toLowerCase() == 'y' ) {
|
if ( prompt( 'Do you want to regenerate the Getting Started Guide? (y/n) ' ).toLowerCase() == 'y' ) {
|
||||||
console.log( 'Regenerating Getting Started Guide' );
|
console.log( 'Regenerating Getting Started Guide' );
|
||||||
storeHTML( md2html.render( '' + fs.readFileSync( path.join( __dirname + '/../../../GettingStarted.md' ) ) ), '/gettingStarted', '' );
|
storeHTML( md2html.render( '' + fs.readFileSync( path.join( __dirname + '/../../../GettingStarted.md' ) ) ), 'gettingStarted', '' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log( 'regenerating plugins documentation' );
|
||||||
let docPages = fs.readdirSync( __dirname + '/../../../website/docs/reference' );
|
let docPages = fs.readdirSync( __dirname + '/../../../website/docs/reference' );
|
||||||
for ( let obj in docPages ) {
|
for ( let obj in docPages ) {
|
||||||
if ( docPages[obj] == 'index.html' ) {
|
if ( docPages[obj] == 'index.html' ) {
|
||||||
@@ -54,6 +55,7 @@ for ( let obj in docPages ) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log( 'regenerating Nav' );
|
||||||
generateNav ();
|
generateNav ();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -179,7 +181,7 @@ function generateNav () {
|
|||||||
<div class="dropdown" id="reference">
|
<div class="dropdown" id="reference">
|
||||||
<a class="nav-subitem" id="root" href="/docs/reference">Home</a>`
|
<a class="nav-subitem" id="root" href="/docs/reference">Home</a>`
|
||||||
for ( let item in docPages ) {
|
for ( let item in docPages ) {
|
||||||
fileStruct += `<a class="nav-subitem" id="${ docPages[item] }" href="/docs/reference/${ docPages[item] }">${ docPages[item].slice( 0, docPages[item].length - 5) }</a>`;
|
fileStruct += `<a class="nav-subitem" id="${ docPages[item].slice( 0, docPages[item].length - 5) }" href="/docs/reference/${ docPages[item] }">${ docPages[item].slice( 0, docPages[item].length - 5) }</a>`;
|
||||||
};
|
};
|
||||||
fileStruct += `</div>
|
fileStruct += `</div>
|
||||||
<a class="navitem" id="pluginsNav" onclick="toggleList( 'plugins' );">Plugins</a>
|
<a class="navitem" id="pluginsNav" onclick="toggleList( 'plugins' );">Plugins</a>
|
||||||
@@ -252,7 +254,6 @@ function parseDocumentationMD () {
|
|||||||
} else {
|
} else {
|
||||||
updatedLink = 'https://github.com/impress/impress.js/' + link;
|
updatedLink = 'https://github.com/impress/impress.js/' + link;
|
||||||
};
|
};
|
||||||
console.log( updatedLink + ' at: ' + posArray[item] );
|
|
||||||
updatedPage = page.slice( 0, parseInt( letter ) + 9 ) + updatedLink + page.slice( parseInt( letter ) + i + 2, parseInt( page.length ) );
|
updatedPage = page.slice( 0, parseInt( letter ) + 9 ) + updatedLink + page.slice( parseInt( letter ) + i + 2, parseInt( page.length ) );
|
||||||
}
|
}
|
||||||
} else if ( page.slice( parseInt( letter ), parseInt( letter ) + 4 ) === '<h1>' ) {
|
} else if ( page.slice( parseInt( letter ), parseInt( letter ) + 4 ) === '<h1>' ) {
|
||||||
|
|||||||
@@ -63,4 +63,5 @@ function toggleDarkMode () {
|
|||||||
document.getElementById( 'darkToggle' ).innerHTML = '☽';
|
document.getElementById( 'darkToggle' ).innerHTML = '☽';
|
||||||
setPreferredTheme( 'light' );
|
setPreferredTheme( 'light' );
|
||||||
}
|
}
|
||||||
|
setTimeout( highlightPath, 1000 );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
let bannedIDs = [];
|
let bannedIDs = [];
|
||||||
|
|
||||||
function highlightPath () {
|
function highlightPath () {
|
||||||
|
console.log( 'highlighting' );
|
||||||
if ( $( location ).attr( 'pathname' ).slice( 6, location.pathname.length ) === '' ) {
|
if ( $( location ).attr( 'pathname' ).slice( 6, location.pathname.length ) === '' ) {
|
||||||
$( '#home' ).css( 'background-color', 'black' );
|
$( '#home' ).animate( { 'background-color': 'black' }, 200 );
|
||||||
bannedIDs.push( 'home' );
|
bannedIDs.push( 'home' );
|
||||||
} else if ( $( location ).attr( 'pathname' ).slice( 6, location.pathname.length ) === 'gettingStarted.html' ) {
|
} else if ( $( location ).attr( 'pathname' ).slice( 6, location.pathname.length ) === 'gettingStarted.html' ) {
|
||||||
$( '#gettingStarted' ).css( 'background-color', 'black' );
|
$( '#gettingStarted' ).animate( { 'background-color': 'black' }, 200 );
|
||||||
bannedIDs.push( 'gettingStarted' );
|
bannedIDs.push( 'gettingStarted' );
|
||||||
} else if ( $( location ).attr( 'pathname' ).slice( 6, 16 ) === 'reference/' ) {
|
} else if ( $( location ).attr( 'pathname' ).slice( 6, 16 ) === 'reference/' ) {
|
||||||
$( '#referenceNav' ).css( 'background-color', 'black' );
|
$( '#referenceNav' ).animate( { 'background-color': 'black' }, 200 );
|
||||||
$( '#reference' ).slideDown();
|
$( '#reference' ).slideDown();
|
||||||
bannedIDs.push( 'referenceNav' );
|
bannedIDs.push( 'referenceNav' );
|
||||||
setTimeout( highlightSubPath( 16 ), 300 );
|
setTimeout( highlightSubPath( 16 ), 300 );
|
||||||
} else if ( $( location ).attr( 'pathname' ).slice( 6, 14 ) === 'plugins/' ) {
|
} else if ( $( location ).attr( 'pathname' ).slice( 6, 14 ) === 'plugins/' ) {
|
||||||
$( '#pluginsNav' ).css( 'background-color', 'black' );
|
$( '#pluginsNav' ).animate( { 'background-color': 'black' }, 200 );
|
||||||
$( '#plugins' ).slideDown();
|
$( '#plugins' ).slideDown();
|
||||||
bannedIDs.push( 'pluginsNav' );
|
bannedIDs.push( 'pluginsNav' );
|
||||||
setTimeout( highlightSubPath( 14 ), 300 );
|
setTimeout( highlightSubPath( 14 ), 300 );
|
||||||
@@ -23,10 +24,10 @@ function highlightPath () {
|
|||||||
function highlightSubPath ( sliceStart ) {
|
function highlightSubPath ( sliceStart ) {
|
||||||
console.log( $( location ).attr( 'pathname' ).slice( sliceStart, parseInt( location.pathname.length ) - 5 ) );
|
console.log( $( location ).attr( 'pathname' ).slice( sliceStart, parseInt( location.pathname.length ) - 5 ) );
|
||||||
if ( $( location ).attr( 'pathname' ).slice( sliceStart, parseInt( location.pathname.length ) - 5 ) === '' ) {
|
if ( $( location ).attr( 'pathname' ).slice( sliceStart, parseInt( location.pathname.length ) - 5 ) === '' ) {
|
||||||
$( '#root' ).css( 'background-color', 'black' );
|
$( '#root' ).animate( { 'background-color': 'black' }, 200 );
|
||||||
bannedIDs.push( 'root' );
|
bannedIDs.push( 'root' );
|
||||||
} else {
|
} else {
|
||||||
$( `#${location.pathname.slice( sliceStart, parseInt( location.pathname.length ) - 5 )}` ).css( 'background-color', 'rgb(43, 43, 43)' );
|
$( `#${location.pathname.slice( sliceStart, parseInt( location.pathname.length ) - 5 )}` ).animate( { 'background-color': 'rgb(43, 43, 43)' }, 200 );
|
||||||
bannedIDs.push( `${location.pathname.slice( sliceStart, parseInt( location.pathname.length ) - 5 )}` );
|
bannedIDs.push( `${location.pathname.slice( sliceStart, parseInt( location.pathname.length ) - 5 )}` );
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user