Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
JUNCA24 RevealJS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PGI15-Teaching
JUNCA24 RevealJS
Commits
7d0d3c24
Commit
7d0d3c24
authored
7 years ago
by
Hakim El Hattab
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://github.com/linux-man/reveal.js
into dev
parents
af7c33b9
ce467b53
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
demo.html
+1
-0
1 addition, 0 deletions
demo.html
plugin/search/search.js
+21
-20
21 additions, 20 deletions
plugin/search/search.js
plugin/zoom-js/zoom.js
+6
-23
6 additions, 23 deletions
plugin/zoom-js/zoom.js
with
28 additions
and
43 deletions
demo.html
+
1
−
0
View file @
7d0d3c24
...
...
@@ -398,6 +398,7 @@ Reveal.addEventListener( 'customevent', function() {
{
src
:
'
plugin/markdown/marked.js
'
,
condition
:
function
()
{
return
!!
document
.
querySelector
(
'
[data-markdown]
'
);
}
},
{
src
:
'
plugin/markdown/markdown.js
'
,
condition
:
function
()
{
return
!!
document
.
querySelector
(
'
[data-markdown]
'
);
}
},
{
src
:
'
plugin/highlight/highlight.js
'
,
async
:
true
,
callback
:
function
()
{
hljs
.
initHighlightingOnLoad
();
}
},
{
src
:
'
plugin/search/search.js
'
,
async
:
true
},
{
src
:
'
plugin/zoom-js/zoom.js
'
,
async
:
true
},
{
src
:
'
plugin/notes/notes.js
'
,
async
:
true
}
]
...
...
This diff is collapsed.
Click to expand it.
plugin/search/search.js
+
21
−
20
View file @
7d0d3c24
...
...
@@ -21,7 +21,7 @@ function Hilitor(id, tag)
var
targetNode
=
document
.
getElementById
(
id
)
||
document
.
body
;
var
hiliteTag
=
tag
||
"
EM
"
;
var
skipTags
=
new
RegExp
(
"
^(?:
"
+
hiliteTag
+
"
|SCRIPT|FORM
|SPAN
)$
"
);
var
skipTags
=
new
RegExp
(
"
^(?:
"
+
hiliteTag
+
"
|SCRIPT|FORM)$
"
);
var
colors
=
[
"
#ff6
"
,
"
#a0ffff
"
,
"
#9f9
"
,
"
#f99
"
,
"
#f6f
"
];
var
wordColor
=
[];
var
colorIdx
=
0
;
...
...
@@ -53,11 +53,11 @@ function Hilitor(id, tag)
if
(
node
.
nodeType
==
3
)
{
// NODE_TEXT
if
((
nv
=
node
.
nodeValue
)
&&
(
regs
=
matchRegex
.
exec
(
nv
)))
{
//find the slide's section element and save it in our list of matching slides
var
secnode
=
node
.
parentNode
;
while
(
secnode
.
nodeName
!=
'
SECTION
'
)
{
var
secnode
=
node
;
while
(
secnode
!=
null
&&
secnode
.
nodeName
!=
'
SECTION
'
)
{
secnode
=
secnode
.
parentNode
;
}
var
slideIndex
=
Reveal
.
getIndices
(
secnode
);
var
slidelen
=
matchingSlides
.
length
;
var
alreadyAdded
=
false
;
...
...
@@ -69,7 +69,7 @@ function Hilitor(id, tag)
if
(
!
alreadyAdded
)
{
matchingSlides
.
push
(
slideIndex
);
}
if
(
!
wordColor
[
regs
[
0
].
toLowerCase
()])
{
wordColor
[
regs
[
0
].
toLowerCase
()]
=
colors
[
colorIdx
++
%
colors
.
length
];
}
...
...
@@ -110,20 +110,26 @@ function Hilitor(id, tag)
function
openSearch
()
{
//ensure the search term input dialog is visible and has focus:
var
inputboxdiv
=
document
.
getElementById
(
"
searchinputdiv
"
);
var
inputbox
=
document
.
getElementById
(
"
searchinput
"
);
inputbox
.
style
.
display
=
"
inline
"
;
inputbox
div
.
style
.
display
=
"
inline
"
;
inputbox
.
focus
();
inputbox
.
select
();
}
function
closeSearch
()
{
var
inputboxdiv
=
document
.
getElementById
(
"
searchinputdiv
"
);
inputboxdiv
.
style
.
display
=
"
none
"
;
if
(
myHilitor
)
myHilitor
.
remove
();
}
function
toggleSearch
()
{
var
inputbox
=
document
.
getElementById
(
"
searchinput
"
);
if
(
inputbox
.
style
.
display
!==
"
inline
"
)
{
var
inputbox
div
=
document
.
getElementById
(
"
searchinput
div
"
);
if
(
inputbox
div
.
style
.
display
!==
"
inline
"
)
{
openSearch
();
}
else
{
inputbox
.
style
.
display
=
"
none
"
;
myHilitor
.
remove
();
closeSearch
();
}
}
...
...
@@ -157,7 +163,8 @@ function Hilitor(id, tag)
searchElement
.
classList
.
add
(
'
searchdiv
'
);
searchElement
.
style
.
position
=
'
absolute
'
;
searchElement
.
style
.
top
=
'
10px
'
;
searchElement
.
style
.
left
=
'
10px
'
;
searchElement
.
style
.
right
=
'
10px
'
;
searchElement
.
style
.
zIndex
=
10
;
//embedded base64 search icon Designed by Sketchdock - http://www.sketchdock.com/:
searchElement
.
innerHTML
=
'
<span><input type="search" id="searchinput" class="searchinput" style="vertical-align: top;"/><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJiSURBVHjatFZNaxNBGH5md+Mmu92NVdKDRipSAyqCghgQD4L4cRe86UUtAQ+eFCxoa4/25EXBFi8eBE+eRPoDhB6KgiiixdAPCEkx2pjvTXadd9yNsflwuyUDD/O+u8PzzDPvzOwyx3EwyCZhwG3gAkp7MnpjgbopjsltcD4gjuXZZKeAR348MYLYTm3LzOs/y3j3JTfZxgXWXmTuwPHIc4VmoOmv5IrI53+AO2DdHLjkDWQ3GoEEVFXtXQOvkSnPWcyUceviLhwbDYv8/XIVj97kse7TodLvZXxYxrPUHkQ1ufXs3FEdybEIxucySOesoNvUgWU1cP3MkCBfTFdw9fGaAMVmRELq7LBw2Q3/FaAxxWIRpw+ZIr/7IouPqzUBiqmdHAv7EuhRAwf1er2Vy4x1jW3b2d5Jfvu5IPp7l2LYbcgCFFNb+FoJ7oBqEAqFMPNqFcmEgVMJDfMT+1tvN0pNjERlMS6QA5pFOKxiKVPFhakPeL3It+WGJUDxt2wFR+JhzI7v5ctkd8DXOZAkCYYxhO+lKm4+Xfqz/rIixBuNBl7eOYzkQQNzqX249mRl6zUgEcYkaJrGhUwBinVdh6IouPzwE6/DL5w4oLkH8y981aDf+uq6hlKpJESiUdNfDZi7/ehG9K6KfiA3pml0PLcsq+cSMTj2NL9ukc4UOmz7AZ3+crkC4mHujFvXNaMFB3bEr8xPS6p5O+jXxq4VZtaen7/PwzrntjcLUE0iHPS1Ud1cdiEJl/8WivZk0wXd7zWOMkeF8s0CcAmkNrC2nvXZDbbbN73ccYnZoH9bfgswAFzAe9/h3dbKAAAAAElFTkSuQmCC" id="searchbutton" class="searchicon" style="vertical-align: top; margin-top: -1px;"/></span>
'
;
dom
.
wrapper
.
appendChild
(
searchElement
);
...
...
@@ -179,18 +186,12 @@ function Hilitor(id, tag)
}
},
false
);
// Open the search when the 's' key is hit (yes, this conflicts with the notes plugin, disabling for now)
/*
document
.
addEventListener
(
'
keydown
'
,
function
(
event
)
{
// Disregard the event if the target is editable or a
// modifier is present
if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return;
if( event.keyCode === 83 ) {
if
(
event
.
key
==
"
F
"
&&
(
event
.
ctrlKey
||
event
.
metaKey
)
)
{
//Control+Shift+f
event
.
preventDefault
();
open
Search();
toggle
Search
();
}
},
false
);
*/
closeSearch
();
return
{
open
:
openSearch
};
})();
This diff is collapsed.
Click to expand it.
plugin/zoom-js/zoom.js
+
6
−
23
View file @
7d0d3c24
...
...
@@ -3,31 +3,17 @@
var
isEnabled
=
true
;
document
.
querySelector
(
'
.reveal .slides
'
).
addEventListener
(
'
mousedown
'
,
function
(
event
)
{
var
modifier
=
(
Reveal
.
getConfig
().
zoomKey
?
Reveal
.
getConfig
().
zoomKey
:
'
alt
'
)
+
'
Key
'
;
var
zoomPadding
=
20
;
var
revealScale
=
Reveal
.
getScale
();
var
modifier
=
(
Reveal
.
getConfig
().
zoomKey
?
Reveal
.
getConfig
().
zoomKey
:
'
ctrl
'
)
+
'
Key
'
;
var
zoomLevel
=
(
Reveal
.
getConfig
().
zoomLevel
?
Reveal
.
getConfig
().
zoomLevel
:
2
);
if
(
event
[
modifier
]
&&
isEnabled
)
{
event
.
preventDefault
();
var
bounds
;
var
originalDisplay
=
event
.
target
.
style
.
display
;
// Get the bounding rect of the contents, not the containing box
if
(
window
.
getComputedStyle
(
event
.
target
).
display
===
'
block
'
)
{
event
.
target
.
style
.
display
=
'
inline-block
'
;
bounds
=
event
.
target
.
getBoundingClientRect
();
event
.
target
.
style
.
display
=
originalDisplay
;
}
else
{
bounds
=
event
.
target
.
getBoundingClientRect
();
}
zoom
.
to
({
x
:
(
bounds
.
left
*
revealScale
)
-
zoomPadding
,
y
:
(
bounds
.
top
*
revealScale
)
-
zoomPadding
,
width
:
(
bounds
.
width
*
revealScale
)
+
(
zoomPadding
*
2
)
,
height
:
(
bounds
.
height
*
revealScale
)
+
(
zoomPadding
*
2
)
,
x
:
event
.
clientX
-
window
.
innerWidth
/
(
zoomLevel
*
2
)
,
y
:
event
.
clientY
-
window
.
innerHeight
/
(
zoomLevel
*
2
)
,
width
:
window
.
innerWidth
/
zoomLevel
,
height
:
window
.
innerHeight
/
zoomLevel
,
pan
:
false
});
}
...
...
@@ -283,6 +269,3 @@ var zoom = (function(){
}
})();
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment