Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Firefox Extension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lukas Joisten
Firefox Extension
Commits
9621e3a3
Commit
9621e3a3
authored
4 years ago
by
Richard Zameitat
Browse files
Options
Downloads
Patches
Plain Diff
styling and housekeeping
parent
e7b34ac7
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
free.css
+21
-0
21 additions, 0 deletions
free.css
free.js
+14
-25
14 additions, 25 deletions
free.js
manifest.json
+3
-2
3 additions, 2 deletions
manifest.json
with
38 additions
and
27 deletions
free.css
0 → 100644
+
21
−
0
View file @
9621e3a3
._ext-openExcellenceMedia_container
.videoLinkList
{
--c-rwth-violett
:
rgb
(
97
,
33
,
88
);
--c-link-bg
:
var
(
--c-rwth-violett
);
--c-link-fg
:
#fff
;
}
._ext-openExcellenceMedia_container
.videoLinkList
{
list-style-type
:
none
;
padding
:
0
;
display
:
flex
;
flex-direction
:
row
;
}
._ext-openExcellenceMedia_container
.videoLinkList
.videoLink
{
display
:
inline-block
;
padding
:
.5em
1em
;
background
:
var
(
--c-link-bg
);
color
:
var
(
--c-link-fg
);
margin
:
.25em
.5em
;
border-radius
:
.2em
;
}
This diff is collapsed.
Click to expand it.
free.js
+
14
−
25
View file @
9621e3a3
console
.
debug
(
document
.
readyState
,
''
+
window
.
location
)
if
(
window
.
location
.
host
===
'
engage.streaming.rwth-aachen.de
'
)
{
console
.
debug
(
window
,
window
.
parent
,
window
.
top
)
if
(
!
window
.
location
.
href
.
startsWith
(
'
https://engage.streaming.rwth-aachen.de/paella/ui/watch.html
'
))
console
.
warn
(
'
looks like we are running outside a player context‽
'
)
const
inFrame
=
(
window
.
parent
!==
window
)
console
.
debug
(
'
running in video context ... deatching URLs ...
'
,
inFrame
)
let
vId
=
new
URLSearchParams
(
location
.
search
).
get
(
'
id
'
)
fetch
(
`https://engage.streaming.rwth-aachen.de/search/episode.json?id=
${
new
URLSearchParams
(
location
.
search
).
get
(
'
id
'
)}
`
)
const
vId
=
new
URLSearchParams
(
location
.
search
).
get
(
'
id
'
)
fetch
(
`https://engage.streaming.rwth-aachen.de/search/episode.json?
${
new
URLSearchParams
({
id
:
vId
}).
toString
()}
`
)
.
then
(
d
=>
d
.
json
())
.
then
(
meta
=>
{
window
.
_meta
=
meta
...
...
@@ -20,22 +19,15 @@ if (window.location.host === 'engage.streaming.rwth-aachen.de') {
if
(
resAI
<
resBI
)
return
-
1
return
0
})
videoTracks
.
forEach
(
t
=>
console
.
lo
g
(
t
.
id
,
t
.
mimetype
,
t
.
video
.
resolution
,
t
.
url
))
videoTracks
.
forEach
(
t
=>
console
.
debu
g
(
t
.
id
,
t
.
mimetype
,
t
.
video
.
resolution
,
t
.
url
))
if
(
inFrame
)
{
console
.
debug
(
'
posting message
'
)
window
.
parent
.
postMessage
({
videoTracks
,
meta
},
'
*
'
)
window
.
addEventListener
(
'
message
'
,
msg
=>
{
console
.
debug
(
'
got message in frame
'
,
msg
)
console
.
debug
(
'
is from parent
'
,
msg
.
origin
===
window
.
parent
)
})
}
else
{
// TODO: add download links to video
}
})
}
else
if
(
window
.
location
.
host
===
'
moodle.rwth-aachen.de
'
)
{
window
.
addEventListener
(
'
message
'
,
msg
=>
{
window
.
_lastMsg
=
msg
;
window
.
_msgSrc
=
msg
.
source
;
console
.
log
(
'
msg
'
,
msg
)
let
mainFrame
=
document
.
querySelector
(
'
div[role=main]
'
)
let
sourceFrame
=
null
;
let
_frames
=
[...
document
.
querySelectorAll
(
'
iframe
'
)].
filter
(
f
=>
f
.
contentWindow
===
msg
.
source
)
...
...
@@ -44,38 +36,35 @@ if (window.location.host === 'engage.streaming.rwth-aachen.de') {
let
videoLinkList
=
genLinkContainer
(
msg
.
data
.
videoTracks
,
msg
.
data
.
meta
)
mainFrame
.
appendChild
(
videoLinkList
)
window
.
_sf
=
sourceFrame
console
.
debug
(
'
sourceFrame
'
,
sourceFrame
,
sourceFrame
.
parentNode
)
// if video frame was found: step out of the video container(s) and place links just below the frame
let
beforeNode
=
sourceFrame
while
(
beforeNode
.
parentNode
&&
beforeNode
.
parentNode
.
matches
(
'
.occontainer_inner,.occontainer_outer
'
))
{
beforeNode
=
beforeNode
.
parentNode
}
if
(
beforeNode
&&
beforeNode
.
parentNode
)
{
beforeNode
.
parentNode
.
insertBefore
(
videoLinkList
,
beforeNode
)
beforeNode
.
parentNode
.
insertBefore
(
videoLinkList
,
beforeNode
.
nextSibling
)
}
return
false
;
})
let
frame
=
document
.
querySelector
(
'
iframe.ocplayer
'
)
if
(
frame
)
{
console
.
debug
(
'
posting to child
'
)
frame
.
contentWindow
.
postMessage
(
'
hello child
'
,
'
*
'
)
}
}
function
genLinkContainer
(
tracks
,
meta
)
{
let
videoTitle
=
meta
[
'
search-results
'
].
result
.
dcTitle
||
'
?
'
let
details
=
document
.
createElement
(
'
details
'
)
details
.
classList
.
add
(
'
_ext-openExcellenceMedia_container
'
)
let
summary
=
document
.
createElement
(
'
summary
'
)
summary
.
innerText
=
`Download video:
${
videoTitle
}
`
details
.
appendChild
(
summary
)
let
videoLinkList
=
document
.
createElement
(
'
ul
'
)
videoLinkList
.
classList
.
add
(
'
videoLinkList
'
)
tracks
.
forEach
(
track
=>
{
let
li
=
document
.
createElement
(
'
li
'
)
let
a
=
document
.
createElement
(
'
a
'
)
a
.
classList
.
add
(
'
videoLink
'
)
a
.
href
=
track
.
url
a
.
innerText
=
`
${
track
.
video
.
resolution
}
(
${
track
.
mimetype
}
)`
a
.
innerText
=
`
${
track
.
video
.
resolution
}
(
${
track
.
mimetype
.
replace
(
/^video
\/
/
,
''
)
}
)`
li
.
appendChild
(
a
)
videoLinkList
.
appendChild
(
li
)
})
...
...
This diff is collapsed.
Click to expand it.
manifest.json
+
3
−
2
View file @
9621e3a3
{
"manifest_version"
:
2
,
"name"
:
"openExcellence"
,
"name"
:
"openExcellence
Media
"
,
"version"
:
"0.0.1"
,
"description"
:
""
,
"icons"
:
{
...
...
@@ -11,7 +11,8 @@
{
"all_frames"
:
true
,
"matches"
:
[
"https://moodle.rwth-aachen.de/*"
,
"https://engage.streaming.rwth-aachen.de/*"
],
"js"
:
[
"free.js"
]
"js"
:
[
"free.js"
],
"css"
:
[
"free.css"
]
}
]
...
...
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