Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 6 additions & 21 deletions cms/templates/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,15 @@
function(doc, $, CourseDetailsModel, MainView) {
CourseDetailsModel.prototype.videosourceSample = function() {
if (this.has('intro_video')){
//We teach videosourceSample how to handle properly DMCloud URLS and DM Classic ID that might be given
//as they are now stored in the db just like Youtube IDs
//but we also teach videosource Sample to handle DM Cloud ID's as they might also be an input,
//not from db as we explained, but directly from client that inputs DM Cloud ID and not DM Cloud URL
//(unless he computes md5sum in his head of course!).
// This allow videosourceSample to handle public DailyMotion ID that might be given instead of Youtube's
var inputToProcess = this.get('intro_video');
var inputProcessed = inputToProcess;
//now if we have a DMCloud ID (we allow capital letters as user may not be "case sensitive")
//we can only give the DMCloud ID as it is not possible to compute here the signed URL
if(/^[a-fA-F0-9]{24}$/.test(inputToProcess)){
inputProcessed = inputToProcess;
}
//now if we have a DMCloud URL provided by server there is nothing to do
//we do nothing here (case is shown for clarity only)
else if(/^https:\/\/cdn\.dmcloud\.net\//.test(inputToProcess)){
inputProcessed = inputToProcess;
}
//if we have DM Classic ID (public or private)
else if((/^[a-zA-Z0-9]{6,10}$/.test(inputToProcess)) || (/^[a-zA-Z0-9]{19}$/.test(inputToProcess))){
// if we have DailyMotion ID (public or private)
if ((/^[a-zA-Z0-9]{6,10}$/.test(inputToProcess)) || (/^[a-zA-Z0-9]{19}$/.test(inputToProcess))) {
inputProcessed = "//www.dailymotion.com/embed/video/" + inputToProcess;
}
//if we are in none of these cases then we do it as it was done before
//we keep the original solution used to handle youtube videos
else{
// keep the original solution used to handle youtube videos
else {
inputProcessed = "//www.youtube.com/embed/" + inputToProcess;
}
return inputProcessed;
Expand Down Expand Up @@ -382,7 +367,7 @@ <h2 class="title-2">${_("Introducing Your Course")}</h2>
<div class="input">
## Translators: This is the placeholder text for a field that requests a YouTube video ID for a course video
<input type="text" dir="ltr" class="long new-course-introduction-video add-video-data" id="course-introduction-video" value="" placeholder="${_('your video ID')}" autocomplete="off" />
<span class="tip tip-stacked">${_("Enter your video ID (Note : DailyMotion Cloud, DailyMotion Classic and Youtube are supported. Still, the administrator may restrict the use to only one or two of these video web hosting services)")}</span>
<span class="tip tip-stacked">${_("Enter your video ID (Note : DailyMotion and Youtube are supported. Still, the administrator may restrict the use to only one or two of these video web hosting services)")}</span>
</div>
</li>
% endif
Expand Down
Binary file modified conf/locale/fr/LC_MESSAGES/django.mo
Binary file not shown.
10 changes: 5 additions & 5 deletions conf/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -19523,12 +19523,12 @@ msgstr "ID de votre vidéo"

#: cms/templates/settings.html
msgid ""
"Enter your video ID (Note : DailyMotion Cloud, DailyMotion Classic and "
"Youtube are supported. Still, the administrator may restrict the use to "
"only one or two of these video web hosting services)"
"Enter your video ID (Note : DailyMotion and Youtube are supported. Still, "
"the administrator may restrict the use to only one or two of these video "
"web hosting services)"
msgstr ""
"Saisissez l'ID de votre video de teaser. (Notez que DailyMotion Cloud, "
"DailyMotion Classic et Youtube sont supportés. Cependant, l'administrateur "
"Saisissez l'ID de votre video de teaser. (Notez que DailyMotion et "
"Youtube sont supportés. Cependant, l'administrateur "
"peut limiter l'usage d'un ou plusieurs de ces services d'hébergement de "
"vidéos.)"

Expand Down