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
1731ffbf
Commit
1731ffbf
authored
Jul 11, 2013
by
Vadim Makeev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #139 (Shift-F5 bug) and #95 (Cmd-Alt-P feature)
parent
25382541
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
40 deletions
+35
-40
shower.js
shower.js
+34
-39
shower.min.js
shower.min.js
+1
-1
No files found.
shower.js
View file @
1731ffbf
...
...
@@ -798,30 +798,34 @@ window.shower = window.shower || (function(window, document, undefined) {
},
false
);
document
.
addEventListener
(
'keydown'
,
function
(
e
)
{
var
currentSlideNumber
,
slide
;
var
currentSlideNumber
=
shower
.
getCurrentSlideNumber
(),
slide
=
shower
.
slideList
[
currentSlideNumber
!==
-
1
?
currentSlideNumber
:
0
],
slideNumber
;
// Shortcut for alt, ctrl and meta keys
if
(
e
.
altKey
||
e
.
ctrlKey
||
e
.
metaKey
)
{
return
;
}
switch
(
e
.
which
)
{
case
80
:
// P Alt Cmd
if
(
shower
.
isListMode
()
&&
e
.
altKey
&&
e
.
metaKey
)
{
e
.
preventDefault
();
currentSlideNumber
=
shower
.
getCurrentSlideNumber
();
slide
=
shower
.
slideList
[
currentSlideNumber
];
slideNumber
=
slide
.
number
;
switch
(
e
.
which
)
{
case
116
:
// F5
e
.
preventDefault
();
shower
.
go
(
slideNumber
);
shower
.
enterSlideMode
();
shower
.
showPresenterNotes
(
slideNumber
);
slide
.
timing
&&
slide
.
initTimer
(
shower
);
}
break
;
case
116
:
// F5 (Shift)
e
.
preventDefault
();
if
(
shower
.
isListMode
())
{
var
slideNumber
=
e
.
shiftKey
?
currentSlideNumber
:
0
,
slide
;
slideNumber
=
e
.
shiftKey
?
slide
.
number
:
0
;
// Warning: go must be before enterSlideMode.
// Otherwise there is a bug in Chrome
shower
.
go
(
slideNumber
);
shower
.
enterSlideMode
();
shower
.
showPresenterNotes
(
slideNumber
);
slide
=
shower
.
slideList
[
currentSlideNumber
];
slide
.
timing
&&
slide
.
initTimer
(
shower
);
}
else
{
shower
.
enterListMode
();
...
...
@@ -831,12 +835,11 @@ window.shower = window.shower || (function(window, document, undefined) {
case
13
:
// Enter
if
(
shower
.
isListMode
()
&&
-
1
!==
currentSlideNumber
)
{
e
.
preventDefault
();
shower
.
enterSlideMode
();
shower
.
showPresenterNotes
(
currentSlideNumber
);
if
(
slide
.
timing
)
{
slide
.
initTimer
(
shower
);
}
slide
.
timing
&&
slide
.
initTimer
(
shower
);
}
break
;
...
...
@@ -852,10 +855,9 @@ window.shower = window.shower || (function(window, document, undefined) {
case
37
:
// Left
case
72
:
// H
case
75
:
// K
if
(
shower
.
isSlideMode
())
{
e
.
preventDefault
();
shower
.
_turnPreviousSlide
();
}
if
(
e
.
altKey
||
e
.
ctrlKey
||
e
.
metaKey
)
{
return
;
}
e
.
preventDefault
();
shower
.
_turnPreviousSlide
();
break
;
case
34
:
// PgDown
...
...
@@ -863,32 +865,25 @@ window.shower = window.shower || (function(window, document, undefined) {
case
39
:
// Right
case
76
:
// L
case
74
:
// J
if
(
shower
.
isSlideMode
())
{
e
.
preventDefault
();
shower
.
_turnNextSlide
();
}
if
(
e
.
altKey
||
e
.
ctrlKey
||
e
.
metaKey
)
{
return
;
}
e
.
preventDefault
();
shower
.
_turnNextSlide
();
break
;
case
36
:
// Home
if
(
shower
.
isSlideMode
())
{
e
.
preventDefault
();
shower
.
first
();
}
e
.
preventDefault
();
shower
.
first
();
break
;
case
35
:
// End
if
(
shower
.
isSlideMode
())
{
e
.
preventDefault
();
shower
.
last
();
}
e
.
preventDefault
();
shower
.
last
();
break
;
case
9
:
// Tab = +1; Shift + Tab = -1
case
32
:
// Space = +1; Shift + Space = -1
if
(
shower
.
isSlideMode
())
{
e
.
preventDefault
();
shower
[
e
.
shiftKey
?
'_turnPreviousSlide'
:
'_turnNextSlide'
]();
}
case
9
:
// Tab (Shift)
case
32
:
// Space (Shift)
e
.
preventDefault
();
shower
[
e
.
shiftKey
?
'_turnPreviousSlide'
:
'_turnNextSlide'
]();
break
;
default
:
...
...
shower.min.js
View file @
1731ffbf
This diff is collapsed.
Click to expand it.
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