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
* Shower HTML presentation engine: github.com/shower/shower
// Licensed under MIT license: github.com/shower/shower/wiki/MIT-License
* @copyright 2010–2013 Vadim Makeev, pepelsbey.net
* @license MIT license: github.com/shower/shower/wiki/MIT-License
*/
window
.
shower
=
(
function
(
window
,
document
,
undefined
)
{
window
.
shower
=
(
function
(
window
,
document
,
undefined
)
{
var
shower
=
{},
var
shower
=
{},
url
=
window
.
location
,
url
=
window
.
location
,
...
@@ -25,7 +26,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -25,7 +26,7 @@ window.shower = (function(window, document, undefined) {
};
};
for
(
i
=
0
;
i
<
l
;
i
++
)
{
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
// slide number
if
(
!
slides
[
i
].
id
)
{
if
(
!
slides
[
i
].
id
)
{
slides
[
i
].
id
=
i
+
1
;
slides
[
i
].
id
=
i
+
1
;
...
@@ -148,9 +149,11 @@ window.shower = (function(window, document, undefined) {
...
@@ -148,9 +149,11 @@ window.shower = (function(window, document, undefined) {
slideNumber
;
slideNumber
;
if
(
slideId
===
''
)
{
if
(
slideId
===
''
)
{
slideNumber
=
0
;
slideNumber
=
0
;
}
}
// As fast as you can ;-)
// http://jsperf.com/for-vs-foreach/46
for
(;
i
>=
0
;
--
i
)
{
for
(;
i
>=
0
;
--
i
)
{
if
(
slideId
===
slideList
[
i
].
id
)
{
if
(
slideId
===
slideList
[
i
].
id
)
{
slideNumber
=
i
;
slideNumber
=
i
;
...
@@ -184,7 +187,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -184,7 +187,7 @@ window.shower = (function(window, document, undefined) {
// slides starts from 0
// slides starts from 0
ret
=
currentSlideNumber
+
2
;
ret
=
currentSlideNumber
+
2
;
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
callback
();
}
}
}
else
{
}
else
{
...
@@ -209,7 +212,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -209,7 +212,7 @@ window.shower = (function(window, document, undefined) {
ret
=
currentSlideNumber
;
ret
=
currentSlideNumber
;
shower
.
go
(
currentSlideNumber
-
1
);
shower
.
go
(
currentSlideNumber
-
1
);
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
callback
();
}
}
}
else
{
}
else
{
...
@@ -225,7 +228,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -225,7 +228,7 @@ window.shower = (function(window, document, undefined) {
* @returns {Number}
* @returns {Number}
*/
*/
shower
.
first
=
function
(
callback
)
{
shower
.
first
=
function
(
callback
)
{
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
callback
();
}
}
...
@@ -238,7 +241,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -238,7 +241,7 @@ window.shower = (function(window, document, undefined) {
* @returns {Number}
* @returns {Number}
*/
*/
shower
.
last
=
function
(
callback
)
{
shower
.
last
=
function
(
callback
)
{
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
callback
();
}
}
return
shower
.
go
(
slideList
.
length
-
1
);
return
shower
.
go
(
slideList
.
length
-
1
);
...
@@ -274,7 +277,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -274,7 +277,7 @@ window.shower = (function(window, document, undefined) {
shower
.
updateCurrentAndPassedSlides
(
currentSlideNumber
);
shower
.
updateCurrentAndPassedSlides
(
currentSlideNumber
);
shower
.
runSlideshowIfPresented
(
currentSlideNumber
);
shower
.
runSlideshowIfPresented
(
currentSlideNumber
);
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
callback
();
}
}
...
@@ -298,7 +301,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -298,7 +301,7 @@ window.shower = (function(window, document, undefined) {
shower
.
scrollToSlide
(
currentSlideNumber
);
shower
.
scrollToSlide
(
currentSlideNumber
);
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
callback
();
}
}
...
@@ -316,7 +319,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -316,7 +319,7 @@ window.shower = (function(window, document, undefined) {
shower
.
enterListMode
();
shower
.
enterListMode
();
}
}
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
callback
();
}
}
...
@@ -455,15 +458,17 @@ window.shower = (function(window, document, undefined) {
...
@@ -455,15 +458,17 @@ window.shower = (function(window, document, undefined) {
if
(
window
.
console
)
{
if
(
window
.
console
)
{
slideNumber
=
shower
.
_normalizeSlideNumber
(
slideNumber
);
slideNumber
=
shower
.
_normalizeSlideNumber
(
slideNumber
);
var
slideId
=
slideList
[
slideNumber
].
id
;
var
slideId
=
slideList
[
slideNumber
].
id
,
var
nextSlideId
=
slideList
[
slideNumber
+
1
]
?
slideList
[
slideNumber
+
1
].
id
:
null
;
nextSlideId
=
slideList
[
slideNumber
+
1
]
?
slideList
[
slideNumber
+
1
].
id
:
null
,
notes
=
document
.
getElementById
(
slideId
).
querySelector
(
'footer'
);
var
notes
=
document
.
getElementById
(
slideId
).
querySelector
(
'footer'
);
if
(
notes
)
{
if
(
notes
)
{
console
.
info
(
notes
.
innerHTML
.
replace
(
/
\n\s
+/g
,
'
\
n'
));
console
.
info
(
notes
.
innerHTML
.
replace
(
/
\n\s
+/g
,
'
\
n'
));
}
}
if
(
nextSlideId
)
{
if
(
nextSlideId
)
{
var
next
=
document
.
getElementById
(
nextSlideId
).
querySelector
(
'h2'
);
var
next
=
document
.
getElementById
(
nextSlideId
).
querySelector
(
'h2'
);
if
(
next
)
{
if
(
next
)
{
next
=
next
.
innerHTML
.
replace
(
/^
\s
+|<
[^
>
]
+>/g
,
''
);
next
=
next
.
innerHTML
.
replace
(
/^
\s
+|<
[^
>
]
+>/g
,
''
);
console
.
info
(
'NEXT: '
+
next
);
console
.
info
(
'NEXT: '
+
next
);
...
@@ -505,7 +510,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -505,7 +510,7 @@ window.shower = (function(window, document, undefined) {
shower
.
updateCurrentAndPassedSlides
(
slideNumber
);
shower
.
updateCurrentAndPassedSlides
(
slideNumber
);
shower
.
showPresenterNotes
(
slideNumber
);
shower
.
showPresenterNotes
(
slideNumber
);
if
(
typeof
(
callback
)
===
"function"
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
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