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
fffc98ba
Commit
fffc98ba
authored
Jan 18, 2013
by
miripiruni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consistent code style
parent
0f449f8d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
shower.js
shower.js
+18
-18
No files found.
shower.js
View file @
fffc98ba
...
@@ -72,7 +72,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -72,7 +72,7 @@ window.shower = (function(window, document, undefined) {
* number which been shown.
* number which been shown.
* @returns {number|false}
* @returns {number|false}
*/
*/
shower
.
next
=
function
()
{
shower
.
next
=
function
()
{
var
currentSlideNumber
=
shower
.
getCurrentSlideNumber
(),
var
currentSlideNumber
=
shower
.
getCurrentSlideNumber
(),
ret
;
ret
;
...
@@ -99,7 +99,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -99,7 +99,7 @@ window.shower = (function(window, document, undefined) {
* number which been shown.
* number which been shown.
* @returns {number|false}
* @returns {number|false}
*/
*/
shower
.
previous
=
function
()
{
shower
.
previous
=
function
()
{
var
currentSlideNumber
=
shower
.
getCurrentSlideNumber
(),
var
currentSlideNumber
=
shower
.
getCurrentSlideNumber
(),
ret
;
ret
;
...
@@ -190,7 +190,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -190,7 +190,7 @@ window.shower = (function(window, document, undefined) {
* @returns {boolean}
* @returns {boolean}
*/
*/
shower
.
_isNumber
=
function
(
arg
)
{
shower
.
_isNumber
=
function
(
arg
)
{
if
(
!
(
!
isNaN
(
parseFloat
(
arg
))
&&
isFinite
(
arg
)))
{
if
(
!
(
!
isNaN
(
parseFloat
(
arg
))
&&
isFinite
(
arg
)))
{
return
false
;
return
false
;
}
}
...
@@ -206,11 +206,11 @@ window.shower = (function(window, document, undefined) {
...
@@ -206,11 +206,11 @@ window.shower = (function(window, document, undefined) {
var
currentSlide
,
var
currentSlide
,
ret
;
ret
;
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
throw
new
Error
(
'Gimme slide number as number, baby!'
);
throw
new
Error
(
'Gimme slide number as number, baby!'
);
}
}
if
(
!
shower
.
isListMode
())
{
if
(
!
shower
.
isListMode
())
{
throw
new
Error
(
'You can
\'
t to scroll cause you in slide mode. Please, switch to list mode.'
);
throw
new
Error
(
'You can
\'
t to scroll cause you in slide mode. Please, switch to list mode.'
);
}
}
...
@@ -245,7 +245,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -245,7 +245,7 @@ window.shower = (function(window, document, undefined) {
* @returns {number}
* @returns {number}
*/
*/
shower
.
_normalizeSlideNumber
=
function
(
slideNumber
)
{
shower
.
_normalizeSlideNumber
=
function
(
slideNumber
)
{
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
throw
new
Error
(
'Gimme slide number as number, baby!'
);
throw
new
Error
(
'Gimme slide number as number, baby!'
);
}
}
...
@@ -271,7 +271,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -271,7 +271,7 @@ window.shower = (function(window, document, undefined) {
return
false
;
return
false
;
}
}
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
throw
new
Error
(
'Gimme slide number as number, baby!'
);
throw
new
Error
(
'Gimme slide number as number, baby!'
);
}
}
...
@@ -292,7 +292,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -292,7 +292,7 @@ window.shower = (function(window, document, undefined) {
slideNumber
=
shower
.
_normalizeSlideNumber
(
slideNumber
);
slideNumber
=
shower
.
_normalizeSlideNumber
(
slideNumber
);
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
throw
new
Error
(
'Gimme slide number as number, baby!'
);
throw
new
Error
(
'Gimme slide number as number, baby!'
);
}
}
...
@@ -345,7 +345,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -345,7 +345,7 @@ window.shower = (function(window, document, undefined) {
* @returns {boolean}
* @returns {boolean}
*/
*/
shower
.
getSlideHash
=
function
(
slideNumber
)
{
shower
.
getSlideHash
=
function
(
slideNumber
)
{
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
throw
new
Error
(
'Gimme slide number as number, baby!'
);
throw
new
Error
(
'Gimme slide number as number, baby!'
);
}
}
...
@@ -360,7 +360,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -360,7 +360,7 @@ window.shower = (function(window, document, undefined) {
* @returns {number}
* @returns {number}
*/
*/
shower
.
go
=
function
(
slideNumber
)
{
shower
.
go
=
function
(
slideNumber
)
{
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
throw
new
Error
(
'Gimme slide number as number, baby!'
);
throw
new
Error
(
'Gimme slide number as number, baby!'
);
}
}
...
@@ -436,7 +436,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -436,7 +436,7 @@ window.shower = (function(window, document, undefined) {
* @returns {undefined}
* @returns {undefined}
*/
*/
shower
.
runSlideshowIfPresented
=
function
(
slideNumber
)
{
shower
.
runSlideshowIfPresented
=
function
(
slideNumber
)
{
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
throw
new
Error
(
'Gimme slide number as number, baby!'
);
throw
new
Error
(
'Gimme slide number as number, baby!'
);
}
}
...
@@ -468,7 +468,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -468,7 +468,7 @@ window.shower = (function(window, document, undefined) {
node
,
node
,
ret
=
-
1
;
ret
=
-
1
;
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
if
(
!
shower
.
_isNumber
(
slideNumber
))
{
throw
new
Error
(
'Gimme slide number as number, baby!'
);
throw
new
Error
(
'Gimme slide number as number, baby!'
);
}
}
...
@@ -491,7 +491,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -491,7 +491,7 @@ window.shower = (function(window, document, undefined) {
// Event handlers
// Event handlers
window
.
addEventListener
(
'DOMContentLoaded'
,
function
()
{
window
.
addEventListener
(
'DOMContentLoaded'
,
function
()
{
if
(
!
shower
.
isListMode
())
{
if
(
!
shower
.
isListMode
())
{
// "?full" is present without slide hash, so we should display first slide
// "?full" is present without slide hash, so we should display first slide
if
(
-
1
===
shower
.
getCurrentSlideNumber
())
{
if
(
-
1
===
shower
.
getCurrentSlideNumber
())
{
...
@@ -507,7 +507,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -507,7 +507,7 @@ window.shower = (function(window, document, undefined) {
}
}
},
false
);
},
false
);
window
.
addEventListener
(
'popstate'
,
function
(
e
)
{
window
.
addEventListener
(
'popstate'
,
function
(
e
)
{
if
(
shower
.
isListMode
())
{
if
(
shower
.
isListMode
())
{
shower
.
enterListMode
();
shower
.
enterListMode
();
shower
.
scrollToSlide
(
shower
.
getCurrentSlideNumber
());
shower
.
scrollToSlide
(
shower
.
getCurrentSlideNumber
());
...
@@ -516,13 +516,13 @@ window.shower = (function(window, document, undefined) {
...
@@ -516,13 +516,13 @@ window.shower = (function(window, document, undefined) {
}
}
},
false
);
},
false
);
window
.
addEventListener
(
'resize'
,
function
(
e
)
{
window
.
addEventListener
(
'resize'
,
function
(
e
)
{
if
(
!
shower
.
isListMode
())
{
if
(
!
shower
.
isListMode
())
{
shower
.
_applyTransform
(
shower
.
_getTransform
());
shower
.
_applyTransform
(
shower
.
_getTransform
());
}
}
},
false
);
},
false
);
document
.
addEventListener
(
'keydown'
,
function
(
e
)
{
document
.
addEventListener
(
'keydown'
,
function
(
e
)
{
// Shortcut for alt, ctrl and meta keys
// Shortcut for alt, ctrl and meta keys
if
(
e
.
altKey
||
e
.
ctrlKey
||
e
.
metaKey
)
{
return
;
}
if
(
e
.
altKey
||
e
.
ctrlKey
||
e
.
metaKey
)
{
return
;
}
...
@@ -648,7 +648,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -648,7 +648,7 @@ window.shower = (function(window, document, undefined) {
document
.
addEventListener
(
'click'
,
shower
.
_dispatchSingleSlideMode
,
false
);
document
.
addEventListener
(
'click'
,
shower
.
_dispatchSingleSlideMode
,
false
);
document
.
addEventListener
(
'touchend'
,
shower
.
_dispatchSingleSlideMode
,
false
);
document
.
addEventListener
(
'touchend'
,
shower
.
_dispatchSingleSlideMode
,
false
);
document
.
addEventListener
(
'touchstart'
,
function
(
e
)
{
document
.
addEventListener
(
'touchstart'
,
function
(
e
)
{
if
(
!
shower
.
isListMode
())
{
if
(
!
shower
.
isListMode
())
{
var
currentSlideNumber
=
shower
.
getCurrentSlideNumber
(),
var
currentSlideNumber
=
shower
.
getCurrentSlideNumber
(),
x
=
e
.
touches
[
0
].
pageX
;
x
=
e
.
touches
[
0
].
pageX
;
...
@@ -662,7 +662,7 @@ window.shower = (function(window, document, undefined) {
...
@@ -662,7 +662,7 @@ window.shower = (function(window, document, undefined) {
}
}
},
false
);
},
false
);
document
.
addEventListener
(
'touchmove'
,
function
(
e
)
{
document
.
addEventListener
(
'touchmove'
,
function
(
e
)
{
if
(
!
shower
.
isListMode
())
{
if
(
!
shower
.
isListMode
())
{
e
.
preventDefault
();
e
.
preventDefault
();
}
}
...
...
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