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
50972bb7
Commit
50972bb7
authored
Mar 01, 2012
by
Oleg Roschupkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add slideshow (via data-timing).
Closes issue #17.
parent
e143625e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
3 deletions
+29
-3
en.htm
en.htm
+2
-2
script.js
scripts/script.js
+27
-1
No files found.
en.htm
View file @
50972bb7
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<h1>
Shower Presentation Template
</h1>
<h1>
Shower Presentation Template
</h1>
<p>
Vadim Makeev, Opera Software
</p>
<p>
Vadim Makeev, Opera Software
</p>
</header>
</header>
<div
class=
"slide cover"
><div>
<div
class=
"slide cover"
data-timing=
"00:05"
><div>
<section>
<section>
<header>
<header>
<h2>
Shower Presentation Template
</h2>
<h2>
Shower Presentation Template
</h2>
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
<img
src=
"pictures/cover.jpg"
alt=
""
>
<img
src=
"pictures/cover.jpg"
alt=
""
>
</section>
</section>
</div></div>
</div></div>
<div
class=
"slide"
><div>
<div
class=
"slide"
data-timing=
"00:05"
><div>
<section>
<section>
<header>
<header>
<h2>
Header
</h2>
<h2>
Header
</h2>
...
...
scripts/script.js
View file @
50972bb7
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
slides
=
document
.
querySelectorAll
(
'div.slide'
),
slides
=
document
.
querySelectorAll
(
'div.slide'
),
progress
=
document
.
querySelector
(
'div.progress div'
),
progress
=
document
.
querySelector
(
'div.progress div'
),
slideList
=
[],
slideList
=
[],
timer
,
l
=
slides
.
length
,
i
;
l
=
slides
.
length
,
i
;
for
(
i
=
0
;
i
<
l
;
i
++
)
{
for
(
i
=
0
;
i
<
l
;
i
++
)
{
...
@@ -15,7 +16,8 @@
...
@@ -15,7 +16,8 @@
slideList
.
push
({
slideList
.
push
({
id
:
slides
[
i
].
id
,
id
:
slides
[
i
].
id
,
hasInnerNavigation
:
null
!==
slides
[
i
].
querySelector
(
'.next'
)
hasInnerNavigation
:
null
!==
slides
[
i
].
querySelector
(
'.next'
),
hasTiming
:
null
!=
slides
[
i
].
dataset
.
timing
});
});
}
}
...
@@ -147,6 +149,25 @@
...
@@ -147,6 +149,25 @@
updateProgress
(
getCurrentSlideNumber
());
updateProgress
(
getCurrentSlideNumber
());
updateCurrentAndPassedSlides
(
getCurrentSlideNumber
());
updateCurrentAndPassedSlides
(
getCurrentSlideNumber
());
runSlideshowIfPresented
(
getCurrentSlideNumber
());
}
}
function
runSlideshowIfPresented
(
slideNumber
)
{
slideNumber
=
normalizeSlideNumber
(
slideNumber
);
clearTimeout
(
timer
);
if
(
slideList
[
slideNumber
].
hasTiming
)
{
// Compute number of milliseconds from format "X:Y", where X is
// number of minutes, and Y is number of seconds
var
timing
=
document
.
getElementById
(
slideList
[
slideNumber
].
id
).
dataset
.
timing
.
split
(
':'
);
timing
=
parseInt
(
timing
[
0
])
*
60
*
1000
+
parseInt
(
timing
[
1
])
*
1000
;
timer
=
setTimeout
(
function
()
{
goToSlide
(
slideNumber
+
1
);
runSlideshowIfPresented
(
slideNumber
+
1
);
},
timing
);
}
}
}
}
...
@@ -179,6 +200,7 @@
...
@@ -179,6 +200,7 @@
enterSlideMode
();
enterSlideMode
();
updateProgress
(
getCurrentSlideNumber
());
updateProgress
(
getCurrentSlideNumber
());
updateCurrentAndPassedSlides
(
getCurrentSlideNumber
());
updateCurrentAndPassedSlides
(
getCurrentSlideNumber
());
runSlideshowIfPresented
(
getCurrentSlideNumber
())
}
}
},
false
);
},
false
);
...
@@ -214,6 +236,7 @@
...
@@ -214,6 +236,7 @@
updateProgress
(
currentSlideNumber
);
updateProgress
(
currentSlideNumber
);
updateCurrentAndPassedSlides
(
currentSlideNumber
);
updateCurrentAndPassedSlides
(
currentSlideNumber
);
runSlideshowIfPresented
(
currentSlideNumber
);
}
}
break
;
break
;
...
@@ -255,6 +278,9 @@
...
@@ -255,6 +278,9 @@
)
{
)
{
currentSlideNumber
++
;
currentSlideNumber
++
;
goToSlide
(
currentSlideNumber
);
goToSlide
(
currentSlideNumber
);
if
(
!
isListMode
())
{
runSlideshowIfPresented
(
currentSlideNumber
);
}
}
}
break
;
break
;
...
...
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