diff --git a/css/swad18.89.3.css b/css/swad18.89.3.css
index a37505794..9053fa63c 100644
--- a/css/swad18.89.3.css
+++ b/css/swad18.89.3.css
@@ -2720,6 +2720,7 @@ a:hover img.CENTRE_PHOTO_SHOW
/*********************** Media (image/video) uploading ***********************/
.MED_ICO
{
+ text-align:center;
margin-bottom:10px;
}
.MED_PLAY
diff --git a/swad_changelog.h b/swad_changelog.h
index 386630c9f..1912f4dde 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -464,13 +464,14 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
-#define Log_PLATFORM_VERSION "SWAD 18.89.3 (2019-03-27)"
+#define Log_PLATFORM_VERSION "SWAD 18.89.4 (2019-03-27)"
#define CSS_FILE "swad18.89.3.css"
#define JS_FILE "swad18.89.3.js"
/*
- Version 18.89.3: Mar 27, 2019 Changes in multimedia attachment form. (241139 lines)
+ Version 18.89.4: Mar 27, 2019 Code refactoring in media uploader. (241144 lines)
+ Version 18.89.3: Mar 27, 2019 Changes in media attachment form. (241139 lines)
Version 18.89.2: Mar 27, 2019 Help link when writing a test question.
- Changes in multimedia attachment form. (241111 lines)
+ Changes in media attachment form. (241111 lines)
Version 18.89.1: Mar 26, 2019 Corrections in help links after recent changes. (241090 lines)
Version 18.89: Mar 26, 2019 Corrections in help links after recent changes.
Module swad_preference is renamed swad_setting. (241090 lines)
diff --git a/swad_media.c b/swad_media.c
index 31bbf9a7c..22cce247f 100644
--- a/swad_media.c
+++ b/swad_media.c
@@ -113,6 +113,12 @@ static void Med_ResetMediaExceptURLAndTitle (struct Media *Media);
static void Med_FreeMediaURL (struct Media *Media);
static void Med_FreeMediaTitle (struct Media *Media);
+static void Med_PutIconMediaUploader (const char UniqueId[Frm_MAX_BYTES_ID + 1],
+ const char *IdSuffix,
+ const char *FunctionName,
+ const char *Icon,
+ const char *Title);
+
static Med_Action_t Med_GetMediaActionFromForm (const char *ParamAction);
static Med_FormType_t Usr_GetFormTypeFromForm (struct ParamUploadMedia *ParamUploadMedia);
static void Usr_GetURLFromForm (const char *ParamName,struct Media *Media);
@@ -369,43 +375,22 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
"
"); // icons container
/* Upload icon */
- fprintf (Gbl.F.Out,"
_ico_upl
- " class=\"PREF_OFF\">"
- "
"
- "
", //
_ico_upl
- Id,
- Cfg_URL_ICON_PUBLIC,
- Txt_Image_video,Txt_Image_video,
- Id);
+ Med_PutIconMediaUploader (Id,"ico_upl", // _ico_upl
+ "mediaClickOnActivateUpload",
+ "file-image.svg",
+ Txt_Image_video);
/* YouTube icon */
- fprintf (Gbl.F.Out,"_ico_you
- " class=\"PREF_OFF\">"
- "
"
- "
", // _ico_you
- Id,
- Cfg_URL_ICON_PUBLIC,
- "YouTube","YouTube",
- Id);
+ Med_PutIconMediaUploader (Id,"ico_you", // _ico_you
+ "mediaClickOnActivateYoutube",
+ "youtube-brands.svg",
+ "YouTube");
/* Embed icon */
- fprintf (Gbl.F.Out,"_ico_emb
- " class=\"PREF_OFF\">"
- "
"
- "
", // _ico_emb
- Id,
- Cfg_URL_ICON_PUBLIC,
- "Embed","Embed",
- Id);
+ Med_PutIconMediaUploader (Id,"ico_emb", // _ico_emb
+ "mediaClickOnActivateEmbed",
+ "code.svg",
+ "Embed");
/* End icons */
fprintf (Gbl.F.Out," " // icons container
@@ -479,6 +464,28 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
fprintf (Gbl.F.Out,""); // container _med_upl
}
+/*****************************************************************************/
+/********* Put an icon to toggle on/off the form to comment a note ***********/
+/*****************************************************************************/
+
+static void Med_PutIconMediaUploader (const char UniqueId[Frm_MAX_BYTES_ID + 1],
+ const char *IdSuffix,
+ const char *FunctionName,
+ const char *Icon,
+ const char *Title)
+ {
+ /***** Icon to activate form in media uploader *****/
+ fprintf (Gbl.F.Out,"", // _IdSuffix
+ UniqueId,IdSuffix,
+ FunctionName,UniqueId,
+ Cfg_URL_ICON_PUBLIC,Icon,Title,Title);
+ }
+
/*****************************************************************************/
/******************** Get media (image/video) from form **********************/
/*****************************************************************************/
diff --git a/swad_timeline.c b/swad_timeline.c
index e03363f4d..8c0818251 100644
--- a/swad_timeline.c
+++ b/swad_timeline.c
@@ -2520,9 +2520,8 @@ static void TL_PutIconToToggleCommentNote (const char UniqueId[Frm_MAX_BYTES_ID
/***** Link to toggle on/off the form to comment a note *****/
fprintf (Gbl.F.Out,"",