Compare commits
No commits in common. "d4576532e9a74fd7cdec99a7e308dcba574e5783" and "9f25e5698c23ae30326ae869791066ae25677831" have entirely different histories.
d4576532e9
...
9f25e5698c
@ -1,12 +0,0 @@
|
|||||||
<input type="checkbox" id="help-menu-checkbox" />
|
|
||||||
<label for="help-menu-checkbox" id="help-menu-toggle">?</label>
|
|
||||||
<div id="help-menu-wrapper">
|
|
||||||
<h2>How to use this presentation</h2>
|
|
||||||
<ul>
|
|
||||||
<li>Next slide: <kbd>↓</kbd> or <kbd>→</kbd></li>
|
|
||||||
<li>Previous slide: <kbd>↑</kbd> or <kbd>←</kbd></li>
|
|
||||||
<li>Open slide overview: Hit <kbd>Ctrl</kbd> twice.</li>
|
|
||||||
<li>Close slide overview: <kbd>Esc</kbd></li>
|
|
||||||
<li>Open the help menu: <kbd>H</kbd></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
10
helper.py
10
helper.py
@ -33,7 +33,7 @@ def get_modification_time(path):
|
|||||||
return os.stat(path)[stat.ST_MTIME]
|
return os.stat(path)[stat.ST_MTIME]
|
||||||
|
|
||||||
# Replace the "src" attribute on images by "data-src".
|
# Replace the "src" attribute on images by "data-src".
|
||||||
# Should be done after caching because fragments#defragmentize requires
|
# Should be done after caching because fragments#defragmentize requires
|
||||||
# valid XHTML and data-src causes problems with that.
|
# valid XHTML and data-src causes problems with that.
|
||||||
# Also: Toggling lazyload is easier this way.
|
# Also: Toggling lazyload is easier this way.
|
||||||
def add_lazyload(source, lazyload_images):
|
def add_lazyload(source, lazyload_images):
|
||||||
@ -41,11 +41,3 @@ def add_lazyload(source, lazyload_images):
|
|||||||
return re.sub(r'<img(.*)src=', r'<img\1data-src=', source)
|
return re.sub(r'<img(.*)src=', r'<img\1data-src=', source)
|
||||||
else:
|
else:
|
||||||
return source
|
return source
|
||||||
|
|
||||||
# Replace all occurrences of "@help" by the content specified
|
|
||||||
# in "help-menu.html". The "@help" annotation should be used only once
|
|
||||||
# per presentation.
|
|
||||||
def add_help_menu(source, root):
|
|
||||||
help_menu_code = open(os.path.join(
|
|
||||||
root, 'onpoint/help-menu.html'), "r").read()
|
|
||||||
return re.sub('@help', help_menu_code, source)
|
|
||||||
|
|||||||
1
main.py
1
main.py
@ -19,7 +19,6 @@ def compile(root, language='en', force_recompile=False, lazyload_images=False):
|
|||||||
wrapper = helper.insert_metadata(wrapper, root, language)
|
wrapper = helper.insert_metadata(wrapper, root, language)
|
||||||
wrapper = fragments.defragmentize(wrapper)
|
wrapper = fragments.defragmentize(wrapper)
|
||||||
wrapper = helper.add_lazyload(wrapper, lazyload_images)
|
wrapper = helper.add_lazyload(wrapper, lazyload_images)
|
||||||
wrapper = helper.add_help_menu(wrapper, root)
|
|
||||||
with open(os.path.join(root, 'slides.' + language + '.html'), 'w+') as output:
|
with open(os.path.join(root, 'slides.' + language + '.html'), 'w+') as output:
|
||||||
output.write(wrapper)
|
output.write(wrapper)
|
||||||
print('done')
|
print('done')
|
||||||
|
|||||||
16
onpoint.js
16
onpoint.js
@ -92,10 +92,6 @@ function onKeyPressed(event) {
|
|||||||
break;
|
break;
|
||||||
case 27: // esc
|
case 27: // esc
|
||||||
hideTopicList();
|
hideTopicList();
|
||||||
hideHelpMenu();
|
|
||||||
break;
|
|
||||||
case 72: // H
|
|
||||||
toggleHelpMenu();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -240,7 +236,7 @@ class Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getTopicListContent() {
|
function getTopicListContent() {
|
||||||
let results = [...document.querySelectorAll('section h1, section h2, section h3, section h4, section h5, section h6')];
|
let results = [...document.querySelectorAll('h1, h2, h3, h4, h5, h6')];
|
||||||
let resultHTML = `<input type="text" class="${topicListSearchClass}"/>`;
|
let resultHTML = `<input type="text" class="${topicListSearchClass}"/>`;
|
||||||
let currentLevel = 1;
|
let currentLevel = 1;
|
||||||
|
|
||||||
@ -356,7 +352,6 @@ function toggleTopicList() {
|
|||||||
if (topicList.style.visibility === 'visible') {
|
if (topicList.style.visibility === 'visible') {
|
||||||
hideTopicList();
|
hideTopicList();
|
||||||
} else {
|
} else {
|
||||||
hideHelpMenu();
|
|
||||||
topicListSearch.value = '';
|
topicListSearch.value = '';
|
||||||
onTopicListSearchInput();
|
onTopicListSearchInput();
|
||||||
topicList.style.visibility = 'visible';
|
topicList.style.visibility = 'visible';
|
||||||
@ -376,13 +371,4 @@ function hideTopicList() {
|
|||||||
|
|
||||||
function reactToResizing() {
|
function reactToResizing() {
|
||||||
goToSlide(currentSlide);
|
goToSlide(currentSlide);
|
||||||
}
|
|
||||||
|
|
||||||
function toggleHelpMenu() {
|
|
||||||
hideTopicList();
|
|
||||||
document.getElementById('help-menu-toggle').click();
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideHelpMenu() {
|
|
||||||
document.getElementById('help-menu-checkbox').checked = false;
|
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user