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
f36d5470
Commit
f36d5470
authored
Jan 19, 2013
by
miripiruni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JSDoc; JS code style
parent
ce373040
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
shower.js
shower.js
+22
-17
No files found.
shower.js
View file @
f36d5470
// Shower HTML presentation engine: github.com/shower/shower
// Copyright © 2010–2013 Vadim Makeev, pepelsbey.net
// Licensed under MIT license: github.com/shower/shower/wiki/MIT-License
/**
* Shower HTML presentation engine: github.com/shower/shower
* @copyright 2010–2013 Vadim Makeev, pepelsbey.net
* @license MIT license: github.com/shower/shower/wiki/MIT-License
*/
window
.
shower
=
(
function
(
window
,
document
,
undefined
)
{
var
shower
=
{},
url
=
window
.
location
,
...
...
@@ -25,7 +26,7 @@ window.shower = (function(window, document, undefined) {
};
for
(
i
=
0
;
i
<
l
;
i
++
)
{
// Slide ID
'
s are optional. In case of missing ID we set it to the
// Slide IDs are optional. In case of missing ID we set it to the
// slide number
if
(
!
slides
[
i
].
id
)
{
slides
[
i
].
id
=
i
+
1
;
...
...
@@ -148,9 +149,11 @@ window.shower = (function(window, document, undefined) {
slideNumber
;
if
(
slideId
===
''
)
{
slideNumber
=
0
;
slideNumber
=
0
;
}
// As fast as you can ;-)
// http://jsperf.com/for-vs-foreach/46
for
(;
i
>=
0
;
--
i
)
{
if
(
slideId
===
slideList
[
i
].
id
)
{
slideNumber
=
i
;
...
...
@@ -184,7 +187,7 @@ window.shower = (function(window, document, undefined) {
// slides starts from 0
ret
=
currentSlideNumber
+
2
;
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
}
}
else
{
...
...
@@ -209,7 +212,7 @@ window.shower = (function(window, document, undefined) {
ret
=
currentSlideNumber
;
shower
.
go
(
currentSlideNumber
-
1
);
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
}
}
else
{
...
...
@@ -225,7 +228,7 @@ window.shower = (function(window, document, undefined) {
* @returns {Number}
*/
shower
.
first
=
function
(
callback
)
{
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
}
...
...
@@ -238,7 +241,7 @@ window.shower = (function(window, document, undefined) {
* @returns {Number}
*/
shower
.
last
=
function
(
callback
)
{
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
}
return
shower
.
go
(
slideList
.
length
-
1
);
...
...
@@ -274,7 +277,7 @@ window.shower = (function(window, document, undefined) {
shower
.
updateCurrentAndPassedSlides
(
currentSlideNumber
);
shower
.
runSlideshowIfPresented
(
currentSlideNumber
);
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
}
...
...
@@ -298,7 +301,7 @@ window.shower = (function(window, document, undefined) {
shower
.
scrollToSlide
(
currentSlideNumber
);
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
}
...
...
@@ -316,7 +319,7 @@ window.shower = (function(window, document, undefined) {
shower
.
enterListMode
();
}
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
}
...
...
@@ -455,15 +458,17 @@ window.shower = (function(window, document, undefined) {
if
(
window
.
console
)
{
slideNumber
=
shower
.
_normalizeSlideNumber
(
slideNumber
);
var
slideId
=
slideList
[
slideNumber
].
id
;
var
nextSlideId
=
slideList
[
slideNumber
+
1
]
?
slideList
[
slideNumber
+
1
].
id
:
null
;
var
slideId
=
slideList
[
slideNumber
].
id
,
nextSlideId
=
slideList
[
slideNumber
+
1
]
?
slideList
[
slideNumber
+
1
].
id
:
null
,
notes
=
document
.
getElementById
(
slideId
).
querySelector
(
'footer'
);
var
notes
=
document
.
getElementById
(
slideId
).
querySelector
(
'footer'
);
if
(
notes
)
{
console
.
info
(
notes
.
innerHTML
.
replace
(
/
\n\s
+/g
,
'
\
n'
));
}
if
(
nextSlideId
)
{
var
next
=
document
.
getElementById
(
nextSlideId
).
querySelector
(
'h2'
);
if
(
next
)
{
next
=
next
.
innerHTML
.
replace
(
/^
\s
+|<
[^
>
]
+>/g
,
''
);
console
.
info
(
'NEXT: '
+
next
);
...
...
@@ -505,7 +510,7 @@ window.shower = (function(window, document, undefined) {
shower
.
updateCurrentAndPassedSlides
(
slideNumber
);
shower
.
showPresenterNotes
(
slideNumber
);
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
}
}
...
...
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