mirror of https://github.com/acanas/swad-core.git
Version 22.120.2: Jun 07, 2023 Code refactoring related to cookies and hidden-visible.
This commit is contained in:
parent
6408f2f54b
commit
9b9f081200
|
@ -633,7 +633,7 @@ TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la ho
|
|||
#define CSS_FILE "swad22.120.css"
|
||||
#define JS_FILE "swad22.49.js"
|
||||
/*
|
||||
Version 22.120.2: Jun 07, 2023 Code refactoring related to cookies and hidden-visible. (337640 lines)
|
||||
Version 22.120.2: Jun 07, 2023 Code refactoring related to cookies and hidden-visible. (337642 lines)
|
||||
Version 22.120.1: Jun 06, 2023 Translation of messages about cookies. (337620 lines)
|
||||
Version 22.120: Jun 06, 2023 Code refactoring related to hidden-visible. (337561 lines)
|
||||
Version 22.119: Jun 06, 2023 Code refactoring related to hidden-visible. (337588 lines)
|
||||
|
|
124
swad_media.c
124
swad_media.c
|
@ -1739,41 +1739,42 @@ static void Med_ShowYoutube (const struct Med_Media *Media,const char *ClassMedi
|
|||
{
|
||||
/***** Check if YouTube code exists *****/
|
||||
if (Media->Name[0]) // YouTube code
|
||||
{
|
||||
if (Gbl.Usrs.Me.UsrDat.Prefs.AcceptCookies)
|
||||
switch (Gbl.Usrs.Me.UsrDat.Prefs.RefuseAcceptCookies)
|
||||
{
|
||||
/***** Show linked external media *****/
|
||||
// Example of code given by YouTube:
|
||||
// <iframe width="560" height="315"
|
||||
// src="https://www.youtube.com/embed/xu9IbeF9CBw"
|
||||
// frameborder="0"
|
||||
// allow="accelerometer; autoplay; encrypted-media;
|
||||
// gyroscope; picture-in-picture" allowfullscreen>
|
||||
// </iframe>
|
||||
/* Begin container */
|
||||
HTM_DIV_Begin ("class=\"MED_VIDEO_CONT\"");
|
||||
case Coo_REFUSE:
|
||||
/***** Alert to inform about third party cookies *****/
|
||||
Med_AlertThirdPartyCookies ();
|
||||
break;
|
||||
case Coo_ACCEPT:
|
||||
/***** Show linked external media *****/
|
||||
// Example of code given by YouTube:
|
||||
// <iframe width="560" height="315"
|
||||
// src="https://www.youtube.com/embed/xu9IbeF9CBw"
|
||||
// frameborder="0"
|
||||
// allow="accelerometer; autoplay; encrypted-media;
|
||||
// gyroscope; picture-in-picture" allowfullscreen>
|
||||
// </iframe>
|
||||
/* Begin container */
|
||||
HTM_DIV_Begin ("class=\"MED_VIDEO_CONT\"");
|
||||
|
||||
/* iframe for video */
|
||||
HTM_TxtF ("<iframe src=\"https://www.youtube.com/embed/%s\""
|
||||
" frameborder=\"0\""
|
||||
" allow=\"accelerometer; autoplay; encrypted-media;"
|
||||
" gyroscope; picture-in-picture\""
|
||||
" allowfullscreen=\"allowfullscreen\""
|
||||
" class=\"%s\"",
|
||||
Media->Name,ClassMedia);
|
||||
if (Media->Title)
|
||||
if (Media->Title[0])
|
||||
HTM_TxtF (" title=\"%s\"",Media->Title);
|
||||
HTM_Txt (">"
|
||||
"</iframe>");
|
||||
/* iframe for video */
|
||||
HTM_TxtF ("<iframe src=\"https://www.youtube.com/embed/%s\""
|
||||
" frameborder=\"0\""
|
||||
" allow=\"accelerometer; autoplay; encrypted-media;"
|
||||
" gyroscope; picture-in-picture\""
|
||||
" allowfullscreen=\"allowfullscreen\""
|
||||
" class=\"%s\"",
|
||||
Media->Name,ClassMedia);
|
||||
if (Media->Title)
|
||||
if (Media->Title[0])
|
||||
HTM_TxtF (" title=\"%s\"",Media->Title);
|
||||
HTM_Txt (">"
|
||||
"</iframe>");
|
||||
|
||||
/* End container */
|
||||
HTM_DIV_End ();
|
||||
/* End container */
|
||||
HTM_DIV_End ();
|
||||
break;
|
||||
}
|
||||
else
|
||||
/***** Alert to inform about third party cookies *****/
|
||||
Med_AlertThirdPartyCookies ();
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1784,40 +1785,41 @@ static void Med_ShowEmbed (const struct Med_Media *Media,const char *ClassMedia)
|
|||
{
|
||||
/***** Check if embed URL exists *****/
|
||||
if (Media->URL[0]) // Embed URL
|
||||
{
|
||||
if (Gbl.Usrs.Me.UsrDat.Prefs.AcceptCookies)
|
||||
switch (Gbl.Usrs.Me.UsrDat.Prefs.RefuseAcceptCookies)
|
||||
{
|
||||
/***** Show linked external media *****/
|
||||
// Example of code given by Slideshare:
|
||||
// <iframe src="//www.slideshare.net/slideshow/embed_code/key/yngasD9sIZ7GQV"
|
||||
// width="595" height="485" frameborder="0"
|
||||
// marginwidth="0" marginheight="0" scrolling="no"
|
||||
// style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;"
|
||||
// allowfullscreen>
|
||||
// </iframe>
|
||||
/* Begin container */
|
||||
HTM_DIV_Begin ("class=\"MED_EMBED_CONT\"");
|
||||
case Coo_REFUSE:
|
||||
/***** Alert to inform about third party cookies *****/
|
||||
Med_AlertThirdPartyCookies ();
|
||||
break;
|
||||
case Coo_ACCEPT:
|
||||
/***** Show linked external media *****/
|
||||
// Example of code given by Slideshare:
|
||||
// <iframe src="//www.slideshare.net/slideshow/embed_code/key/yngasD9sIZ7GQV"
|
||||
// width="595" height="485" frameborder="0"
|
||||
// marginwidth="0" marginheight="0" scrolling="no"
|
||||
// style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;"
|
||||
// allowfullscreen>
|
||||
// </iframe>
|
||||
/* Begin container */
|
||||
HTM_DIV_Begin ("class=\"MED_EMBED_CONT\"");
|
||||
|
||||
/* iframe for external media */
|
||||
HTM_TxtF ("<iframe src=\"%s\""
|
||||
" frameborder=\"0\""
|
||||
" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\""
|
||||
" allowfullscreen=\"allowfullscreen\""
|
||||
" class=\"%s\"",
|
||||
Media->URL,ClassMedia);
|
||||
if (Media->Title)
|
||||
if (Media->Title[0])
|
||||
HTM_TxtF (" title=\"%s\"",Media->Title);
|
||||
HTM_Txt (">"
|
||||
"</iframe>");
|
||||
/* iframe for external media */
|
||||
HTM_TxtF ("<iframe src=\"%s\""
|
||||
" frameborder=\"0\""
|
||||
" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\""
|
||||
" allowfullscreen=\"allowfullscreen\""
|
||||
" class=\"%s\"",
|
||||
Media->URL,ClassMedia);
|
||||
if (Media->Title)
|
||||
if (Media->Title[0])
|
||||
HTM_TxtF (" title=\"%s\"",Media->Title);
|
||||
HTM_Txt (">"
|
||||
"</iframe>");
|
||||
|
||||
/* End container */
|
||||
HTM_DIV_End ();
|
||||
/* End container */
|
||||
HTM_DIV_End ();
|
||||
break;
|
||||
}
|
||||
else
|
||||
/***** Alert to inform about third party cookies *****/
|
||||
Med_AlertThirdPartyCookies ();
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue