Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
PrettyNoemieCMS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
64
Issues
64
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Framasoft
PrettyNoemieCMS
Commits
d5ed6406
Commit
d5ed6406
authored
Jul 16, 2018
by
stephane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
généralisation du module vidéo aux autres instances que peertube.cpy.re
parent
a87fe19b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
app/views/modules/video/edit.js
app/views/modules/video/edit.js
+8
-1
app/views/modules/video/info.json
app/views/modules/video/info.json
+4
-0
app/views/modules/video/module.htm
app/views/modules/video/module.htm
+1
-1
No files found.
app/views/modules/video/edit.js
View file @
d5ed6406
...
...
@@ -17,6 +17,10 @@ $(document).ready(function () {
return
(
url
.
split
(
'
/
'
)[
3
])
}
}
getInstance
=
function
(
url
)
{
return
(
url
.
split
(
'
/
'
)[
2
])
}
$
(
'
.editVideoModal
'
).
modal
()
$
(
'
.editVideoForm
'
).
submit
(
function
(
e
)
{
e
.
preventDefault
()
...
...
@@ -25,16 +29,19 @@ $(document).ready(function () {
let
videoUrl
=
$
(
'
#editVideoForm-
'
+
sectionId
+
"
input[name=videoUrl]
"
).
val
()
let
videoId
=
getVideoId
(
videoType
,
videoUrl
)
let
instance
=
getInstance
(
videoUrl
)
if
(
videoType
===
'
youtube
'
){
$
(
'
#videoContainer-
'
+
sectionId
).
html
(
'
<iframe width="560" height="315" src="//www.youtube.com/embed/
'
+
videoId
+
'
" frameborder="0" allowfullscreen></iframe>
'
);
}
else
if
(
videoType
===
'
peertube
'
){
$
(
'
#videoContainer-
'
+
sectionId
).
html
(
'
<iframe width="560" height="315" src="https://peertube.cpy.re/videos/embed/
'
+
videoId
+
'
" frameborder="0" allowfullscreen></iframe>
'
);
//let instance = getInstance(videoUrl)
$
(
'
#videoContainer-
'
+
sectionId
).
html
(
'
<iframe width="560" height="315" src="https://
'
+
instance
+
'
/videos/embed/
'
+
videoId
+
'
" frameborder="0" allowfullscreen></iframe>
'
);
}
else
if
(
videoType
===
"
vimeo
"
){
$
(
'
#videoContainer-
'
+
sectionId
).
html
(
'
<iframe src="https://player.vimeo.com/video/
'
+
videoId
+
'
" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
'
);
}
$
(
'
#uglyForm input[name=uglyForm-
'
+
sectionId
+
'
-videoType]
'
).
val
(
videoType
)
$
(
'
#uglyForm input[name=uglyForm-
'
+
sectionId
+
'
-videoId]
'
).
val
(
videoId
)
$
(
'
#uglyForm input[name=uglyForm-
'
+
sectionId
+
'
-instance]
'
).
val
(
instance
)
// $('#videoTypeModuleVideo-'+sectionId).html(label)
// $('#videoModuleBtn-'+sectionId).attr('href', videoUrl)
$
(
'
.editVideoModal
'
).
modal
(
'
close
'
)
...
...
app/views/modules/video/info.json
View file @
d5ed6406
...
...
@@ -20,6 +20,10 @@
"content"
:
{
"type"
:
"text"
,
"value"
:
"<p>Cette vidéo tutoriel vous guidera dans vos premiers pas avec Noemie CMS</p>"
},
"instance"
:
{
"type"
:
"text"
,
"value"
:
"peertube.cpy.re"
}
}
}
app/views/modules/video/module.htm
View file @
d5ed6406
...
...
@@ -27,7 +27,7 @@
<iframe
width=
"560"
height=
"315"
src=
"//www.youtube.com/embed/{{@fields['videoId']['value']}}"
frameborder=
"0"
allowfullscreen
></iframe>
</check>
<check
if=
"{{ @fields['videoType']['value'] == 'peertube' }}"
>
<iframe
width=
"560"
height=
"315"
src=
"https://
peertube.cpy.re
/videos/embed/{{@fields['videoId']['value']}}"
frameborder=
"0"
allowfullscreen
></iframe>
<iframe
width=
"560"
height=
"315"
src=
"https://
{{@fields['instance']['value']}}
/videos/embed/{{@fields['videoId']['value']}}"
frameborder=
"0"
allowfullscreen
></iframe>
</check>
<check
if=
"{{ @fields['videoType']['value'] == 'vimeo' }}"
>
<iframe
src=
"https://player.vimeo.com/video/{{@fields['videoId']['value']}}"
width=
"640"
height=
"360"
frameborder=
"0"
webkitallowfullscreen
mozallowfullscreen
allowfullscreen
></iframe>
...
...
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