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
496e0097
Commit
496e0097
authored
Jan 20, 2013
by
miripiruni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring keydown listener PgDown/Down/Right/l/j
parent
09750b07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
55 deletions
+38
-55
shower.js
shower.js
+38
-55
No files found.
shower.js
View file @
496e0097
...
@@ -158,8 +158,34 @@ window.shower = (function(window, document, undefined) {
...
@@ -158,8 +158,34 @@ window.shower = (function(window, document, undefined) {
/**
/**
* Show next slide. If slide is last returns false, otherwise return slide
* Go to slide number...
* number which been shown.
* @param {Number} slideNumber slide number (sic!). Attention: starts from zero.
* @param {Function} [callback] runs only if you not in List mode
* @returns {Number}
*/
shower
.
go
=
function
(
slideNumber
,
callback
)
{
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
throw
new
Error
(
'Gimme slide number as Number, baby!'
);
}
url
.
hash
=
shower
.
getSlideHash
(
slideNumber
);
if
(
shower
.
isSlideMode
())
{
shower
.
updateProgress
(
slideNumber
);
shower
.
updateCurrentAndPassedSlides
(
slideNumber
);
shower
.
showPresenterNotes
(
slideNumber
);
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
}
}
return
slideNumber
;
};
/**
* Show next slide or show next item of Inner navigation. If slide is last
* returns false, otherwise return slide number which been shown.
* @param {Function} [callback] runs only if shower.next() complete successfully
* @param {Function} [callback] runs only if shower.next() complete successfully
* @returns {Number|Boolean}
* @returns {Number|Boolean}
*/
*/
...
@@ -176,12 +202,16 @@ window.shower = (function(window, document, undefined) {
...
@@ -176,12 +202,16 @@ window.shower = (function(window, document, undefined) {
!
shower
.
increaseInnerNavigation
(
currentSlideNumber
)
!
shower
.
increaseInnerNavigation
(
currentSlideNumber
)
)
{
)
{
shower
.
go
(
currentSlideNumber
+
1
);
shower
.
go
(
currentSlideNumber
+
1
);
//
slides starts from 0
//
Slides starts from 0. So return next slide number.
ret
=
currentSlideNumber
+
2
;
ret
=
currentSlideNumber
+
2
;
}
if
(
typeof
(
callback
)
===
'function'
)
{
if
(
shower
.
isSlideMode
())
{
callback
();
shower
.
runInnerNavigation
(
currentSlideNumber
+
1
);
}
}
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
}
}
return
ret
;
return
ret
;
...
@@ -481,32 +511,6 @@ window.shower = (function(window, document, undefined) {
...
@@ -481,32 +511,6 @@ window.shower = (function(window, document, undefined) {
return
'#'
+
slideList
[
slideNumber
].
id
;
return
'#'
+
slideList
[
slideNumber
].
id
;
};
};
/**
* Go to slide number...
* @param {Number} slideNumber slide number (sic!). Attention: starts from zero.
* @param {Function} [callback] runs only if you not in List mode
* @returns {Number}
*/
shower
.
go
=
function
(
slideNumber
,
callback
)
{
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
throw
new
Error
(
'Gimme slide number as Number, baby!'
);
}
url
.
hash
=
shower
.
getSlideHash
(
slideNumber
);
if
(
shower
.
isSlideMode
())
{
shower
.
updateProgress
(
slideNumber
);
shower
.
updateCurrentAndPassedSlides
(
slideNumber
);
shower
.
showPresenterNotes
(
slideNumber
);
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
}
}
return
slideNumber
;
};
/**
/**
* Run slide show if presented.
* Run slide show if presented.
* @param {Number} slideNumber
* @param {Number} slideNumber
...
@@ -528,8 +532,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -528,8 +532,7 @@ window.shower = (function(window, document, undefined) {
timing
=
parseInt
(
timing
[
0
],
10
)
*
60
*
1000
+
parseInt
(
timing
[
1
],
10
)
*
1000
;
timing
=
parseInt
(
timing
[
0
],
10
)
*
60
*
1000
+
parseInt
(
timing
[
1
],
10
)
*
1000
;
timer
=
setTimeout
(
function
()
{
timer
=
setTimeout
(
function
()
{
shower
.
go
(
slideNumber
+
1
);
shower
.
next
();
shower
.
runInnerNavigation
(
slideNumber
+
1
);
},
},
timing
);
timing
);
}
}
...
@@ -639,27 +642,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -639,27 +642,7 @@ window.shower = (function(window, document, undefined) {
case
76
:
// l
case
76
:
// l
case
74
:
// j
case
74
:
// j
e
.
preventDefault
();
e
.
preventDefault
();
shower
.
next
();
if
(
shower
.
isSlideMode
())
{
// Inner navigation is "completed" if current slide have
// no inner navigation or inner navigation is fully shown
isInnerNavCompleted
=
!
slideList
[
currentSlideNumber
].
hasInnerNavigation
||
!
shower
.
increaseInnerNavigation
(
currentSlideNumber
);
}
else
{
// Also inner navigation is always "completed" if we are in
// list mode
isInnerNavCompleted
=
true
;
}
if
(
-
1
===
currentSlideNumber
||
isInnerNavCompleted
)
{
currentSlideNumber
++
;
shower
.
go
(
currentSlideNumber
);
if
(
shower
.
isSlideMode
())
{
shower
.
runInnerNavigation
(
currentSlideNumber
);
}
}
break
;
break
;
case
36
:
// Home
case
36
:
// Home
...
...
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