Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
shower-presentation
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
Шардт Максим Александрович
shower-presentation
Commits
03d73e8d
Commit
03d73e8d
authored
May 04, 2013
by
miripiruni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added slide::stopTimer, fixed pageDown to next step of inner navigation
parent
b8fd510d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
30 deletions
+31
-30
shower.js
shower.js
+31
-30
No files found.
shower.js
View file @
03d73e8d
...
@@ -80,18 +80,18 @@ window.shower = window.shower || (function(window, document, undefined) {
...
@@ -80,18 +80,18 @@ window.shower = window.shower || (function(window, document, undefined) {
return
false
;
return
false
;
}
}
clearInterval
(
timer
);
slide
.
stopTimer
(
);
if
(
slide
.
isFinished
())
{
if
(
slide
.
isFinished
())
{
timer
=
setInterval
(
function
()
{
timer
=
setInterval
(
function
()
{
clearInterval
(
timer
);
slide
.
stopTimer
(
);
shower
.
next
();
shower
.
next
();
},
},
slide
.
timing
*
(
slide
.
innerLength
||
1
));
slide
.
timing
*
(
slide
.
innerLength
||
1
));
}
else
{
}
else
{
timer
=
setInterval
(
function
()
{
timer
=
setInterval
(
function
()
{
if
(
slide
.
isFinished
())
{
if
(
slide
.
isFinished
())
{
clearInterval
(
timer
);
slide
.
stopTimer
(
);
shower
.
next
();
shower
.
next
();
}
else
{
}
else
{
slide
.
next
(
shower
);
slide
.
next
(
shower
);
...
@@ -103,6 +103,18 @@ window.shower = window.shower || (function(window, document, undefined) {
...
@@ -103,6 +103,18 @@ window.shower = window.shower || (function(window, document, undefined) {
return
this
;
return
this
;
},
},
/**
* Stop timer
*/
stopTimer
:
function
()
{
if
(
timer
)
{
clearInterval
(
timer
);
timer
=
false
;
}
return
this
;
},
/**
/**
* Previous step of inner navigation or if current step is step 0 then go to previous slide.
* Previous step of inner navigation or if current step is step 0 then go to previous slide.
* @returns {Object|Boolean} Current slide
* @returns {Object|Boolean} Current slide
...
@@ -399,32 +411,19 @@ window.shower = window.shower || (function(window, document, undefined) {
...
@@ -399,32 +411,19 @@ window.shower = window.shower || (function(window, document, undefined) {
/**
/**
*
*
* @param {Function} [callback]
* @param {Function} [callback]
* @returns {boolean}
*/
*/
shower
.
_turnNextSlide
=
function
(
callback
)
{
shower
.
_turnNextSlide
=
function
(
callback
)
{
var
currentSlideNumber
=
shower
.
getCurrentSlideNumber
(),
var
currentSlideNumber
=
shower
.
getCurrentSlideNumber
(),
ret
=
false
,
slide
=
shower
.
slideList
[
currentSlideNumber
];
slide
;
slide
=
shower
.
slideList
[
currentSlideNumber
];
if
(
shower
.
isSlideMode
())
{
slide
.
stopTimer
();
if
(
slide
.
hasInnerNavigation
&&
!
slide
.
isFinished
())
{
slide
.
next
(
shower
);
slide
.
process
(
shower
);
}
else
{
shower
.
next
();
}
}
else
{
// listMode
shower
.
next
();
// Slides starts from 0. So return next slide number.
ret
=
currentSlideNumber
+
2
;
}
if
(
typeof
(
callback
)
===
'function'
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
callback
();
}
}
return
ret
;
return
;
};
};
/**
/**
...
@@ -464,7 +463,7 @@ window.shower = window.shower || (function(window, document, undefined) {
...
@@ -464,7 +463,7 @@ window.shower = window.shower || (function(window, document, undefined) {
}
}
slide
=
shower
.
slideList
[
currentSlideNumber
];
slide
=
shower
.
slideList
[
currentSlideNumber
];
slide
.
timing
&&
clearInterval
(
timer
);
slide
.
timing
&&
slide
.
stopTimer
(
);
if
(
shower
.
isSlideMode
())
{
if
(
shower
.
isSlideMode
())
{
slide
.
prev
(
shower
);
slide
.
prev
(
shower
);
...
@@ -482,28 +481,31 @@ window.shower = window.shower || (function(window, document, undefined) {
...
@@ -482,28 +481,31 @@ window.shower = window.shower || (function(window, document, undefined) {
/**
/**
* Show first slide.
* Show first slide.
* @param {Function} [callback]
* @param {Function} [callback]
* @returns {Number}
*/
*/
shower
.
first
=
function
(
callback
)
{
shower
.
first
=
function
(
callback
)
{
var
slide
=
shower
.
slideList
[
shower
.
getCurrentSlideNumber
()];
slide
.
timing
&&
slide
.
stopTimer
();
shower
.
go
(
0
);
if
(
typeof
(
callback
)
===
'function'
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
callback
();
}
}
return
shower
.
go
(
0
);
};
};
/**
/**
* Show last slide.
* Show last slide.
* @param {Function} [callback]
* @param {Function} [callback]
* @returns {Boolean}
*/
*/
shower
.
last
=
function
(
callback
)
{
shower
.
last
=
function
(
callback
)
{
var
slide
=
shower
.
slideList
[
shower
.
getCurrentSlideNumber
()];
slide
.
timing
&&
slide
.
stopTimer
();
shower
.
go
(
shower
.
slideList
.
length
-
1
);
shower
.
go
(
shower
.
slideList
.
length
-
1
);
if
(
typeof
(
callback
)
===
'function'
)
{
if
(
typeof
(
callback
)
===
'function'
)
{
callback
();
callback
();
}
}
return
true
;
};
};
/**
/**
...
@@ -552,7 +554,7 @@ window.shower = window.shower || (function(window, document, undefined) {
...
@@ -552,7 +554,7 @@ window.shower = window.shower || (function(window, document, undefined) {
currentSlideNumber
=
shower
.
getCurrentSlideNumber
();
currentSlideNumber
=
shower
.
getCurrentSlideNumber
();
clearInterval
(
timer
);
shower
.
slideList
[
currentSlideNumber
].
stopTimer
(
);
if
(
shower
.
isSlideMode
()
&&
isHistoryApiSupported
)
{
if
(
shower
.
isSlideMode
()
&&
isHistoryApiSupported
)
{
history
.
pushState
(
null
,
null
,
url
.
pathname
+
shower
.
getSlideHash
(
currentSlideNumber
));
history
.
pushState
(
null
,
null
,
url
.
pathname
+
shower
.
getSlideHash
(
currentSlideNumber
));
...
@@ -851,20 +853,19 @@ window.shower = window.shower || (function(window, document, undefined) {
...
@@ -851,20 +853,19 @@ window.shower = window.shower || (function(window, document, undefined) {
case
36
:
// Home
case
36
:
// Home
e
.
preventDefault
();
e
.
preventDefault
();
slide
.
timing
&&
clearInterval
(
timer
);
shower
.
first
();
shower
.
first
();
break
;
break
;
case
35
:
// End
case
35
:
// End
e
.
preventDefault
();
e
.
preventDefault
();
slide
.
timing
&&
clearInterval
(
timer
);
shower
.
last
();
shower
.
last
();
break
;
break
;
case
9
:
// Tab = +1; Shift + Tab = -1
case
9
:
// Tab = +1; Shift + Tab = -1
case
32
:
// Space = +1; Shift + Space = -1
case
32
:
// Space = +1; Shift + Space = -1
e
.
preventDefault
();
e
.
preventDefault
();
shower
[
e
.
shiftKey
?
'
previous'
:
'next
'
]();
shower
[
e
.
shiftKey
?
'
_turnPreviousSlide'
:
'_turnNextSlide
'
]();
break
;
break
;
default
:
default
:
...
...
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