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 CSS_FILE "swad22.120.css"
|
||||||
#define JS_FILE "swad22.49.js"
|
#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.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.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)
|
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 *****/
|
/***** Check if YouTube code exists *****/
|
||||||
if (Media->Name[0]) // YouTube code
|
if (Media->Name[0]) // YouTube code
|
||||||
{
|
switch (Gbl.Usrs.Me.UsrDat.Prefs.RefuseAcceptCookies)
|
||||||
if (Gbl.Usrs.Me.UsrDat.Prefs.AcceptCookies)
|
|
||||||
{
|
{
|
||||||
/***** Show linked external media *****/
|
case Coo_REFUSE:
|
||||||
// Example of code given by YouTube:
|
/***** Alert to inform about third party cookies *****/
|
||||||
// <iframe width="560" height="315"
|
Med_AlertThirdPartyCookies ();
|
||||||
// src="https://www.youtube.com/embed/xu9IbeF9CBw"
|
break;
|
||||||
// frameborder="0"
|
case Coo_ACCEPT:
|
||||||
// allow="accelerometer; autoplay; encrypted-media;
|
/***** Show linked external media *****/
|
||||||
// gyroscope; picture-in-picture" allowfullscreen>
|
// Example of code given by YouTube:
|
||||||
// </iframe>
|
// <iframe width="560" height="315"
|
||||||
/* Begin container */
|
// src="https://www.youtube.com/embed/xu9IbeF9CBw"
|
||||||
HTM_DIV_Begin ("class=\"MED_VIDEO_CONT\"");
|
// 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 */
|
/* iframe for video */
|
||||||
HTM_TxtF ("<iframe src=\"https://www.youtube.com/embed/%s\""
|
HTM_TxtF ("<iframe src=\"https://www.youtube.com/embed/%s\""
|
||||||
" frameborder=\"0\""
|
" frameborder=\"0\""
|
||||||
" allow=\"accelerometer; autoplay; encrypted-media;"
|
" allow=\"accelerometer; autoplay; encrypted-media;"
|
||||||
" gyroscope; picture-in-picture\""
|
" gyroscope; picture-in-picture\""
|
||||||
" allowfullscreen=\"allowfullscreen\""
|
" allowfullscreen=\"allowfullscreen\""
|
||||||
" class=\"%s\"",
|
" class=\"%s\"",
|
||||||
Media->Name,ClassMedia);
|
Media->Name,ClassMedia);
|
||||||
if (Media->Title)
|
if (Media->Title)
|
||||||
if (Media->Title[0])
|
if (Media->Title[0])
|
||||||
HTM_TxtF (" title=\"%s\"",Media->Title);
|
HTM_TxtF (" title=\"%s\"",Media->Title);
|
||||||
HTM_Txt (">"
|
HTM_Txt (">"
|
||||||
"</iframe>");
|
"</iframe>");
|
||||||
|
|
||||||
/* End container */
|
/* End container */
|
||||||
HTM_DIV_End ();
|
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 *****/
|
/***** Check if embed URL exists *****/
|
||||||
if (Media->URL[0]) // Embed URL
|
if (Media->URL[0]) // Embed URL
|
||||||
{
|
switch (Gbl.Usrs.Me.UsrDat.Prefs.RefuseAcceptCookies)
|
||||||
if (Gbl.Usrs.Me.UsrDat.Prefs.AcceptCookies)
|
|
||||||
{
|
{
|
||||||
/***** Show linked external media *****/
|
case Coo_REFUSE:
|
||||||
// Example of code given by Slideshare:
|
/***** Alert to inform about third party cookies *****/
|
||||||
// <iframe src="//www.slideshare.net/slideshow/embed_code/key/yngasD9sIZ7GQV"
|
Med_AlertThirdPartyCookies ();
|
||||||
// width="595" height="485" frameborder="0"
|
break;
|
||||||
// marginwidth="0" marginheight="0" scrolling="no"
|
case Coo_ACCEPT:
|
||||||
// style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;"
|
/***** Show linked external media *****/
|
||||||
// allowfullscreen>
|
// Example of code given by Slideshare:
|
||||||
// </iframe>
|
// <iframe src="//www.slideshare.net/slideshow/embed_code/key/yngasD9sIZ7GQV"
|
||||||
/* Begin container */
|
// width="595" height="485" frameborder="0"
|
||||||
HTM_DIV_Begin ("class=\"MED_EMBED_CONT\"");
|
// 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 */
|
/* iframe for external media */
|
||||||
HTM_TxtF ("<iframe src=\"%s\""
|
HTM_TxtF ("<iframe src=\"%s\""
|
||||||
" frameborder=\"0\""
|
" frameborder=\"0\""
|
||||||
" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\""
|
" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\""
|
||||||
" allowfullscreen=\"allowfullscreen\""
|
" allowfullscreen=\"allowfullscreen\""
|
||||||
" class=\"%s\"",
|
" class=\"%s\"",
|
||||||
Media->URL,ClassMedia);
|
Media->URL,ClassMedia);
|
||||||
if (Media->Title)
|
if (Media->Title)
|
||||||
if (Media->Title[0])
|
if (Media->Title[0])
|
||||||
HTM_TxtF (" title=\"%s\"",Media->Title);
|
HTM_TxtF (" title=\"%s\"",Media->Title);
|
||||||
HTM_Txt (">"
|
HTM_Txt (">"
|
||||||
"</iframe>");
|
"</iframe>");
|
||||||
|
|
||||||
/* End container */
|
/* End container */
|
||||||
HTM_DIV_End ();
|
HTM_DIV_End ();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
/***** Alert to inform about third party cookies *****/
|
|
||||||
Med_AlertThirdPartyCookies ();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue