Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
my-cucumbers-ru-github-io
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Лотуга Данила Сергеевич
my-cucumbers-ru-github-io
Commits
d5cc38e6
Commit
d5cc38e6
authored
Dec 30, 2012
by
Frederic Hemberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add presenter notes support
parent
3d414b19
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
3 deletions
+31
-3
shower.js
shower.js
+31
-3
No files found.
shower.js
View file @
d5cc38e6
...
...
@@ -18,7 +18,7 @@ window.shower = (function(window, document, undefined) {
*/
shower
.
_getData
=
function
(
element
,
name
)
{
return
element
.
dataset
?
element
.
dataset
[
name
]
:
element
.
getAttribute
(
'data-'
+
name
);
}
}
;
for
(
i
=
0
;
i
<
l
;
i
++
)
{
// Slide ID's are optional. In case of missing ID we set it to the
...
...
@@ -136,6 +136,10 @@ window.shower = (function(window, document, undefined) {
body
.
classList
.
remove
(
'list'
);
body
.
classList
.
add
(
'full'
);
if
(
window
.
console
&&
window
.
console
.
clear
)
{
console
.
clear
();
}
shower
.
showPresenterNotes
(
shower
.
getCurrentSlideNumber
()
);
return
shower
.
_applyTransform
(
shower
.
_getTransform
());
};
...
...
@@ -306,6 +310,29 @@ window.shower = (function(window, document, undefined) {
return
true
;
};
/**
* Show presenter notes in console.
* @param {number} slideNumber slide number (sic!). Attention: starts from zero.
*/
shower
.
showPresenterNotes
=
function
(
slideNumber
)
{
if
(
window
.
console
)
{
var
slide
=
slideList
[
shower
.
_normalizeSlideNumber
(
slideNumber
)
].
id
;
var
nextSlide
=
slideList
[
shower
.
_normalizeSlideNumber
(
slideNumber
+
1
)
].
id
;
var
notes
=
document
.
getElementById
(
slide
).
querySelector
(
'.presenter-notes'
);
if
(
notes
)
{
console
.
info
(
notes
.
innerHTML
.
replace
(
/
\n\s
+/g
,
'
\
n'
));
}
if
(
nextSlide
!==
slide
)
{
var
next
=
document
.
getElementById
(
nextSlide
).
querySelector
(
'h2'
);
if
(
next
)
{
next
=
next
.
innerHTML
.
replace
(
/^
\s
+|<
[^
>
]
+>/g
,
''
);
console
.
info
(
'NEXT: '
+
next
);
}
}
}
};
/**
* Get slide hash.
* @param {number} slideNumber slide number (sic!). Attention: starts from zero.
...
...
@@ -336,6 +363,7 @@ window.shower = (function(window, document, undefined) {
if
(
!
shower
.
isListMode
())
{
shower
.
updateProgress
(
slideNumber
);
shower
.
updateCurrentAndPassedSlides
(
slideNumber
);
shower
.
showPresenterNotes
(
slideNumber
);
}
return
slideNumber
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment