diff --git a/css/swad18.77.css b/css/swad18.77.css index 00d2a00fd..2953df345 100644 --- a/css/swad18.77.css +++ b/css/swad18.77.css @@ -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; diff --git a/js/swad18.77.js b/js/swad18.77.js index f2df976dd..1ba0b9d40 100644 --- a/js/swad18.77.js +++ b/js/swad18.77.js @@ -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 } } diff --git a/swad_changelog.h b/swad_changelog.h index fce9afaa5..cd5f89091 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -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'; diff --git a/swad_media.c b/swad_media.c index 4ef8b6c25..d251035e6 100644 --- a/swad_media.c +++ b/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,"
_ico_upl + fprintf (Gbl.F.Out,"
_ico_upl " class=\"MED_UPL_ICO_CON\">" "\"%s\"" - "
", // _ico_upl + "
", // _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,"_par_upl + " id=\"%s_par_upl\"" // _par_upl " name=\"FormType\" value=\"%u\"" " disabled=\"disabled\" />", Id, (unsigned) Med_FORM_FILE); /***** Embed icon *****/ - fprintf (Gbl.F.Out,"
_ico_emb + fprintf (Gbl.F.Out,"
_ico_emb " class=\"MED_UPL_ICO_CON\">" "\"%s\"" - "
", // _ico_emb + "
", // _ico_emb Id, Gbl.Prefs.URLIcons, - "Embed URL","Embed URL", + "YouTube","YouTube", Id); /***** Form type *****/ fprintf (Gbl.F.Out,"_par_emb + " id=\"%s_par_emb\"" // _par_emb " name=\"FormType\" value=\"%u\"" " disabled=\"disabled\" />", Id, (unsigned) Med_FORM_EMBED); /***** Media file *****/ - fprintf (Gbl.F.Out,"
_fil - " style=\"display:none;\">" - "" - "
", // _fil + fprintf (Gbl.F.Out,"_fil + " name=\"%s\" accept=\"image/,video/\"" + " disabled=\"disabled\"" + " style=\"display:none;\" />", // _fil Id, ParamUploadMedia.File); /***** Media URL *****/ - fprintf (Gbl.F.Out,"
_url - " style=\"display:none;\">" - "" - "
", // _url + fprintf (Gbl.F.Out,"_url + " name=\"%s\" placeholder=\"%s\"" + " class=\"%s\" maxlength=\"%u\" value=\"\"" + " disabled=\"disabled\"" + " style=\"display:none;\" />", // _url Id, - ParamUploadMedia.URL, - Txt_Link, + ParamUploadMedia.URL,Txt_Link, ClassMediaTitURL,Cns_MAX_CHARS_WWW); /***** Media title *****/ - fprintf (Gbl.F.Out,"
_tit - " style=\"display:none;\">" - "", + fprintf (Gbl.F.Out,"_tit + " name=\"%s\" placeholder=\"%s\"" + " class=\"%s\" maxlength=\"%u\" value=\"\"" + " disabled=\"disabled\"" + " style=\"display:none;\" />", // _tit Id, - ParamUploadMedia.Title, - Txt_Title_attribution, + ParamUploadMedia.Title,Txt_Title_attribution, ClassMediaTitURL,Med_MAX_CHARS_TITLE); - fprintf (Gbl.F.Out,"
"); // _tit /***** End container *****/ fprintf (Gbl.F.Out,""); // container