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
Show 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) {
/**
* Show next slide. If slide is last returns false, otherwise return slide
* number which been shown.
* 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
;
};
/**
* 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
* @returns {Number|Boolean}
*/
...
...
@@ -176,13 +202,17 @@ window.shower = (function(window, document, undefined) {
!
shower
.
increaseInnerNavigation
(
currentSlideNumber
)
)
{
shower
.
go
(
currentSlideNumber
+
1
);
//
slides starts from 0
//
Slides starts from 0. So return next slide number.
ret
=
currentSlideNumber
+
2
;
}
if
(
shower
.
isSlideMode
())
{
shower
.
runInnerNavigation
(
currentSlideNumber
+
1
);
}
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
}
}
return
ret
;
};
...
...
@@ -481,32 +511,6 @@ window.shower = (function(window, document, undefined) {
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.
* @param {Number} slideNumber
...
...
@@ -528,8 +532,7 @@ window.shower = (function(window, document, undefined) {
timing
=
parseInt
(
timing
[
0
],
10
)
*
60
*
1000
+
parseInt
(
timing
[
1
],
10
)
*
1000
;
timer
=
setTimeout
(
function
()
{
shower
.
go
(
slideNumber
+
1
);
shower
.
runInnerNavigation
(
slideNumber
+
1
);
shower
.
next
();
},
timing
);
}
...
...
@@ -639,27 +642,7 @@ window.shower = (function(window, document, undefined) {
case
76
:
// l
case
74
:
// j
e
.
preventDefault
();
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
);
}
}
shower
.
next
();
break
;
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