mirror of https://github.com/acanas/swad-core.git
Version18.77.1
This commit is contained in:
parent
33b7542f38
commit
a95ad3969d
|
@ -2725,7 +2725,7 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
}
|
||||
.MED_UPL_ICO /* Upload icon */
|
||||
{
|
||||
width:16px;
|
||||
/* width:16px; */
|
||||
height:16px;
|
||||
margin:5px 20px;
|
||||
vertical-align:middle;
|
||||
|
|
|
@ -778,11 +778,16 @@ function mediaActivateUpload (id) {
|
|||
document.getElementById (id + '_par_upl').disabled = false; // Enable upload
|
||||
|
||||
document.getElementById (id + '_ico_upl').style.opacity = '1'; // Highlight upload icon
|
||||
document.getElementById (id + '_ico_emb').style.opacity = '0.2'; // Shadow embed icon
|
||||
document.getElementById (id + '_ico_emb').style.opacity = '0.3'; // Shadow embed icon
|
||||
|
||||
document.getElementById (id + '_fil').style.display = ''; // Show input
|
||||
document.getElementById (id + '_url').style.display = ''; // Show input
|
||||
document.getElementById (id + '_tit').style.display = ''; // Show input
|
||||
document.getElementById (id + '_fil').style.display = ''; // Show file input
|
||||
document.getElementById (id + '_fil').disabled = false; // Enable file input
|
||||
|
||||
document.getElementById (id + '_url').style.display = ''; // Show URL input
|
||||
document.getElementById (id + '_url').disabled = false; // Enable URL input
|
||||
|
||||
document.getElementById (id + '_tit').style.display = ''; // Show title input
|
||||
document.getElementById (id + '_tit').disabled = false; // Enable title input
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -793,11 +798,16 @@ function mediaActivateEmbed (id) {
|
|||
document.getElementById (id + '_par_emb').disabled = false; // Enable embed
|
||||
|
||||
document.getElementById (id + '_ico_emb').style.opacity = '1'; // Highlight embed icon
|
||||
document.getElementById (id + '_ico_upl').style.opacity = '0.2'; // Shadow upload icon
|
||||
document.getElementById (id + '_ico_upl').style.opacity = '0.3'; // Shadow upload icon
|
||||
|
||||
document.getElementById (id + '_fil').style.display = 'none'; // Hide input
|
||||
document.getElementById (id + '_url').style.display = ''; // Show input
|
||||
document.getElementById (id + '_tit').style.display = 'none'; // Hide input
|
||||
document.getElementById (id + '_fil').style.display = 'none'; // Hide file input
|
||||
document.getElementById (id + '_fil').disabled = true; // Disable file input
|
||||
|
||||
document.getElementById (id + '_url').style.display = ''; // Show URL input
|
||||
document.getElementById (id + '_url').disabled = false; // Enable URL input
|
||||
|
||||
document.getElementById (id + '_tit').style.display = 'none'; // Hide title input
|
||||
document.getElementById (id + '_tit').disabled = true; // Disable title input
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -450,11 +450,13 @@ En OpenSWAD:
|
|||
ps2pdf source.ps destination.pdf
|
||||
*/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 18.77 (2019-03-15)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 18.77.1 (2019-03-15)"
|
||||
#define CSS_FILE "swad18.77.css"
|
||||
#define JS_FILE "swad18.77.js"
|
||||
/*
|
||||
TODO: Mejorar javascript subida media
|
||||
TODO: Fix edition of media in test edition
|
||||
Version 18.77.1: Mar 14, 2019 Embedded YouTube videos. Not finished. (240217 lines)
|
||||
Version 18.77: Mar 14, 2019 Embedded YouTube videos. Not finished. (240214 lines)
|
||||
7 changes necessary in database:
|
||||
ALTER TABLE forum_post CHANGE COLUMN MediaType MediaType ENUM('none','jpg','gif','mp4','webm','ogg','youtube') NOT NULL DEFAULT 'none';
|
||||
|
|
51
swad_media.c
51
swad_media.c
|
@ -299,13 +299,13 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassMediaTitURL)
|
|||
Par_PutHiddenParamUnsigned (ParamUploadMedia.Action,(unsigned) Med_ACTION_NEW_MEDIA);
|
||||
|
||||
/***** Upload icon *****/
|
||||
fprintf (Gbl.F.Out,"<div id=\"%s_ico_upl\"" // <id>_ico_upl
|
||||
fprintf (Gbl.F.Out,"<div id=\"%s_ico_upl\"" // <id>_ico_upl
|
||||
" class=\"MED_UPL_ICO_CON\">"
|
||||
"<img src=\"%s/file-image.svg\""
|
||||
" alt=\"%s\" title=\"%s\""
|
||||
" class=\"MED_UPL_ICO ICO_HIGHLIGHT\""
|
||||
" onclick=\"mediaActivateUpload('%s');\" />"
|
||||
"</div>", // <id>_ico_upl
|
||||
"</div>", // <id>_ico_upl
|
||||
Id,
|
||||
Gbl.Prefs.URLIcons,
|
||||
Txt_Image_video,Txt_Image_video,
|
||||
|
@ -313,65 +313,60 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassMediaTitURL)
|
|||
|
||||
/***** Form type *****/
|
||||
fprintf (Gbl.F.Out,"<input type=\"hidden\""
|
||||
" id=\"%s_par_upl\"" // <id>_par_upl
|
||||
" id=\"%s_par_upl\"" // <id>_par_upl
|
||||
" name=\"FormType\" value=\"%u\""
|
||||
" disabled=\"disabled\" />",
|
||||
Id,
|
||||
(unsigned) Med_FORM_FILE);
|
||||
|
||||
/***** Embed icon *****/
|
||||
fprintf (Gbl.F.Out,"<div id=\"%s_ico_emb\"" // <id>_ico_emb
|
||||
fprintf (Gbl.F.Out,"<div id=\"%s_ico_emb\"" // <id>_ico_emb
|
||||
" class=\"MED_UPL_ICO_CON\">"
|
||||
"<img src=\"%s/youtube-brands.svg\""
|
||||
" alt=\"%s\" title=\"%s\""
|
||||
" class=\"MED_UPL_ICO ICO_HIGHLIGHT\""
|
||||
" onclick=\"mediaActivateEmbed('%s');\" />"
|
||||
"</div>", // <id>_ico_emb
|
||||
"</div>", // <id>_ico_emb
|
||||
Id,
|
||||
Gbl.Prefs.URLIcons,
|
||||
"Embed URL","Embed URL",
|
||||
"YouTube","YouTube",
|
||||
Id);
|
||||
|
||||
/***** Form type *****/
|
||||
fprintf (Gbl.F.Out,"<input type=\"hidden\""
|
||||
" id=\"%s_par_emb\"" // <id>_par_emb
|
||||
" id=\"%s_par_emb\"" // <id>_par_emb
|
||||
" name=\"FormType\" value=\"%u\""
|
||||
" disabled=\"disabled\" />",
|
||||
Id,
|
||||
(unsigned) Med_FORM_EMBED);
|
||||
|
||||
/***** Media file *****/
|
||||
fprintf (Gbl.F.Out,"<div id=\"%s_fil\"" // <id>_fil
|
||||
" style=\"display:none;\">"
|
||||
"<input type=\"file\" name=\"%s\""
|
||||
" accept=\"image/,video/\" />"
|
||||
"</div>", // <id>_fil
|
||||
fprintf (Gbl.F.Out,"<input id=\"%s_fil\" type=\"file\"" // <id>_fil
|
||||
" name=\"%s\" accept=\"image/,video/\""
|
||||
" disabled=\"disabled\""
|
||||
" style=\"display:none;\" />", // <id>_fil
|
||||
Id,
|
||||
ParamUploadMedia.File);
|
||||
|
||||
/***** Media URL *****/
|
||||
fprintf (Gbl.F.Out,"<div id=\"%s_url\"" // <id>_url
|
||||
" style=\"display:none;\">"
|
||||
"<input type=\"url\" name=\"%s\""
|
||||
" placeholder=\"%s\""
|
||||
" class=\"%s\" maxlength=\"%u\" value=\"\" />"
|
||||
"</div>", // <id>_url
|
||||
fprintf (Gbl.F.Out,"<input id=\"%s_url\" type=\"url\"" // <id>_url
|
||||
" name=\"%s\" placeholder=\"%s\""
|
||||
" class=\"%s\" maxlength=\"%u\" value=\"\""
|
||||
" disabled=\"disabled\""
|
||||
" style=\"display:none;\" />", // <id>_url
|
||||
Id,
|
||||
ParamUploadMedia.URL,
|
||||
Txt_Link,
|
||||
ParamUploadMedia.URL,Txt_Link,
|
||||
ClassMediaTitURL,Cns_MAX_CHARS_WWW);
|
||||
|
||||
/***** Media title *****/
|
||||
fprintf (Gbl.F.Out,"<div id=\"%s_tit\"" // <id>_tit
|
||||
" style=\"display:none;\">"
|
||||
"<input type=\"text\" name=\"%s\""
|
||||
" placeholder=\"%s\""
|
||||
" class=\"%s\" maxlength=\"%u\" value=\"\" />",
|
||||
fprintf (Gbl.F.Out,"<input id=\"%s_tit\" type=\"text\"" // <id>_tit
|
||||
" name=\"%s\" placeholder=\"%s\""
|
||||
" class=\"%s\" maxlength=\"%u\" value=\"\""
|
||||
" disabled=\"disabled\""
|
||||
" style=\"display:none;\" />", // <id>_tit
|
||||
Id,
|
||||
ParamUploadMedia.Title,
|
||||
Txt_Title_attribution,
|
||||
ParamUploadMedia.Title,Txt_Title_attribution,
|
||||
ClassMediaTitURL,Med_MAX_CHARS_TITLE);
|
||||
fprintf (Gbl.F.Out,"</div>"); // <id>_tit
|
||||
|
||||
/***** End container *****/
|
||||
fprintf (Gbl.F.Out,"</div>"); // container
|
||||
|
|
Loading…
Reference in New Issue