diff --git a/css/swad18.77.css b/css/swad18.77.css
index aa1ff0e55..b4e3b4353 100644
--- a/css/swad18.77.css
+++ b/css/swad18.77.css
@@ -2716,19 +2716,10 @@ a:hover img.CENTRE_PHOTO_SHOW
/*********************** Media (image/video) uploading ***********************/
.MED_UPL_CON /* Upload container */
{
+ text-align:center;
vertical-align:top;
margin-bottom:10px;
}
-.MED_UPL_ICO_CON /* Upload icon container */
- {
- display:inline-block;
- }
-.MED_UPL_ICO /* Upload icon */
- {
- height:20px;
- margin:5px 20px;
- vertical-align:middle;
- }
.MED_PLAY
{
@@ -2884,7 +2875,7 @@ a:hover img.CENTRE_PHOTO_SHOW
.TL_WIDTH {width:316px;} /* 536-220 */
.TL_RIGHT_WIDTH {width:260px;} /* 480-220 */
.TL_RIGHT_AUTHOR_WIDTH {width:100px;} /* 320-220 */
- .TL_POST_IMG_WIDTH {width:220px;} /* 440-220 */
+ .TL_POST_MED_WIDTH {width:220px;} /* 440-220 */
.TL_COMMENT_WIDTH {width:220px;} /* 440-220 */
.TL_COMMENT_AUTHOR_WIDTH {width: 60px;} /* 280-220 */
}
@@ -2893,7 +2884,7 @@ a:hover img.CENTRE_PHOTO_SHOW
.TL_WIDTH {width:536px;}
.TL_RIGHT_WIDTH {width:480px;}
.TL_RIGHT_AUTHOR_WIDTH {width:320px;}
- .TL_POST_IMG_WIDTH {width:440px;}
+ .TL_POST_MED_WIDTH {width:440px;}
.TL_COMMENT_WIDTH {width:440px;}
.TL_COMMENT_AUTHOR_WIDTH {width:280px;}
}
@@ -2970,7 +2961,7 @@ a:hover img.CENTRE_PHOTO_SHOW
margin:0;
resize:none;
}
-.TL_POST_IMG_TIT_URL
+.TL_POST_MED_INPUT
{
box-sizing:border-box;
}
@@ -3138,7 +3129,7 @@ a:hover img.CENTRE_PHOTO_SHOW
width:100%;
border-radius:4px;
}
-.FOR_IMG_TIT_URL
+.FOR_MED_INPUT
{
box-sizing:border-box;
width:480px;
@@ -3164,7 +3155,7 @@ a:hover img.CENTRE_PHOTO_SHOW
width:100%;
border-radius:4px;
}
-.MSG_IMG_TIT_URL
+.MSG_MED_INPUT
{
box-sizing:border-box;
width:480px;
diff --git a/js/swad18.77.js b/js/swad18.77.js
index a6f782a23..2c5d008a4 100644
--- a/js/swad18.77.js
+++ b/js/swad18.77.js
@@ -786,8 +786,8 @@ function mediaClickOnActivateUpload (id) {
par_emb.disabled = true; // Disable embed
par_upl.disabled = false; // Enable upload
- ico_upl.style.opacity = '1'; // Highlighted upload icon
- ico_emb.style.opacity = '0.5'; // Normal embed icon
+ ico_upl.className = 'PREF_ON'; // Highlighted upload icon
+ ico_emb.className = 'PREF_OFF'; // Normal embed icon
fil.style.display = ''; // Show file input
fil.disabled = false; // Enable file input
@@ -817,8 +817,8 @@ function mediaClickOnActivateEmbed (id) {
par_upl.disabled = true; // Disable upload
par_emb.disabled = false; // Enable embed
- ico_emb.style.opacity = '1'; // Highlighted embed icon
- ico_upl.style.opacity = '0.5'; // Normal upload icon
+ ico_emb.className = 'PREF_ON'; // Highlighted embed icon
+ ico_upl.className = 'PREF_OFF'; // Normal upload icon
fil.style.display = 'none'; // Hide file input
fil.disabled = true; // Disable file input
@@ -845,8 +845,8 @@ function mediaDisableUploadAndEmbed (id) {
par_upl.disabled = true; // Disable upload
par_emb.disabled = true; // Disable embed
- ico_upl.style.opacity = '0.5'; // Normal upload icon
- ico_emb.style.opacity = '0.5'; // Normal embed icon
+ ico_upl.className = 'PREF_OFF'; // Normal upload icon
+ ico_emb.className = 'PREF_OFF'; // Normal embed icon
fil.style.display = 'none'; // Hide file input
fil.disabled = true; // Disable file input
diff --git a/swad_changelog.h b/swad_changelog.h
index d0d77f7ae..1f85b16f8 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -431,6 +431,8 @@ Lo de mutear anuncios, en principio prefiero hacer una opci
// TODO: Los usuarios que no tienes permiso para ver su perfil público, se debería mostrar algo, una mínima ficha sin tinmeline o algo así
+// TODO: Allow timeline posting only for users belonging to courses or admins to avoid user who create accounts only to post
+
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
@@ -468,6 +470,7 @@ que el usuario podr
TODO: Fix edition of media in test edition
+ Version 18.77.4: Mar 16, 2019 Changes in form to upload media. (240256 lines)
Version 18.77.3: Mar 16, 2019 Embedded YouTube videos. Not finished. (240252 lines)
Version 18.77.2: Mar 14, 2019 Embedded YouTube videos. Not finished. (240267 lines)
Version 18.77.1: Mar 14, 2019 Embedded YouTube videos. Not finished. (240217 lines)
diff --git a/swad_forum.c b/swad_forum.c
index 1abfc1a78..9c0635a5b 100644
--- a/swad_forum.c
+++ b/swad_forum.c
@@ -4008,7 +4008,7 @@ static void For_WriteFormForumPst (bool IsReply,const char *Subject)
Lay_HelpPlainEditor ();
/***** Attached image (optional) *****/
- Med_PutMediaUploader (-1,"FOR_IMG_TIT_URL");
+ Med_PutMediaUploader (-1,"FOR_MED_INPUT");
/***** Send button *****/
Btn_PutCreateButton (Txt_Send);
diff --git a/swad_media.c b/swad_media.c
index bca0d84bf..d198b9795 100644
--- a/swad_media.c
+++ b/swad_media.c
@@ -293,17 +293,21 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
Frm_SetUniqueId (Id);
/***** Start container *****/
- fprintf (Gbl.F.Out,"
"); // container
+ fprintf (Gbl.F.Out,"
"); // container
/***** Action to perform on media *****/
Par_PutHiddenParamUnsigned (ParamUploadMedia.Action,(unsigned) Med_ACTION_NEW_MEDIA);
+ /***** Start icons *****/
+ fprintf (Gbl.F.Out,"
" // icons containers
+ "
"); // icons container
+
/***** Upload icon *****/
fprintf (Gbl.F.Out,"
_ico_upl
- " class=\"MED_UPL_ICO_CON\">"
+ " class=\"PREF_OFF\">"
"
"
"
", //
_ico_upl
Id,
@@ -321,10 +325,10 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
/***** Embed icon *****/
fprintf (Gbl.F.Out,"_ico_emb
- " class=\"MED_UPL_ICO_CON\">"
+ " class=\"PREF_OFF\">"
"
"
"
", // _ico_emb
Id,
@@ -332,6 +336,14 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
"YouTube","YouTube",
Id);
+ /***** End icons *****/
+ fprintf (Gbl.F.Out,"" // icons container
+ "
"); // icons containers
+
+ /***** Start input fields *****/
+ fprintf (Gbl.F.Out,"
", // input fields
+ ClassInput);
+
/***** Form type *****/
fprintf (Gbl.F.Out,"_par_emb
@@ -369,8 +381,11 @@ void Med_PutMediaUploader (int NumMediaInForm,const char *ClassInput)
ParamUploadMedia.Title,Txt_Title_attribution,
ClassInput,Med_MAX_CHARS_TITLE);
+ /***** End input fields *****/
+ fprintf (Gbl.F.Out,"
"); // input fields
+
/***** End container *****/
- fprintf (Gbl.F.Out,"
"); // container
+ fprintf (Gbl.F.Out,"
"); // container
}
/*****************************************************************************/
diff --git a/swad_message.c b/swad_message.c
index ef5114172..29658cedb 100644
--- a/swad_message.c
+++ b/swad_message.c
@@ -324,7 +324,7 @@ static void Msg_PutFormMsgUsrs (char Content[Cns_MAX_BYTES_LONG_TEXT + 1])
Lay_HelpPlainEditor ();
/***** Attached image (optional) *****/
- Med_PutMediaUploader (-1,"MSG_IMG_TIT_URL");
+ Med_PutMediaUploader (-1,"MSG_MED_INPUT");
/***** Send button *****/
Btn_PutCreateButton (Txt_Send_message);
diff --git a/swad_test.c b/swad_test.c
index 424006f76..8588b8204 100644
--- a/swad_test.c
+++ b/swad_test.c
@@ -158,7 +158,7 @@ static void Tst_ShowTestResultAfterAssess (long TstCod,unsigned *NumQstsNotBlank
static void Tst_PutFormToEditQstMedia (struct Media *Media,int NumMediaInForm,
const char *ClassContainer,
const char *ClassMedia,
- const char *ClassMediaTitURL,
+ const char *ClassMediaInput,
bool OptionsDisabled);
static void Tst_UpdateScoreQst (long QstCod,float ScoreThisQst,bool AnswerIsNotBlank);
static void Tst_UpdateMyNumAccessTst (unsigned NumAccessesTst);
@@ -1111,7 +1111,7 @@ void Tst_WriteQstStem (const char *Stem,const char *ClassStem)
static void Tst_PutFormToEditQstMedia (struct Media *Media,int NumMediaInForm,
const char *ClassContainer,
const char *ClassMedia,
- const char *ClassMediaTitURL,
+ const char *ClassMediaInput,
bool OptionsDisabled)
{
extern const char *The_ClassFormInBox[The_NUM_THEMES];
@@ -1185,7 +1185,7 @@ static void Tst_PutFormToEditQstMedia (struct Media *Media,int NumMediaInForm,
" placeholder=\"%s (%s)\""
" class=\"%s\" maxlength=\"%u\" value=\"%s\">",
ParamUploadMedia.Title,Txt_Title_attribution,Txt_optional,
- ClassMediaTitURL,Med_MAX_CHARS_TITLE,
+ ClassMediaInput,Med_MAX_CHARS_TITLE,
Media->Title ? Media->Title :
"");
@@ -1195,7 +1195,7 @@ static void Tst_PutFormToEditQstMedia (struct Media *Media,int NumMediaInForm,
" placeholder=\"%s (%s)\""
" class=\"%s\" maxlength=\"%u\" value=\"%s\">",
ParamUploadMedia.URL,Txt_Link,Txt_optional,
- ClassMediaTitURL,Cns_MAX_CHARS_WWW,
+ ClassMediaInput,Cns_MAX_CHARS_WWW,
Media->URL ? Media->URL :
"");
@@ -1204,7 +1204,7 @@ static void Tst_PutFormToEditQstMedia (struct Media *Media,int NumMediaInForm,
}
else // No current image
/***** Attached image (optional) *****/
- Med_PutMediaUploader (NumMediaInForm,ClassMediaTitURL);
+ Med_PutMediaUploader (NumMediaInForm,ClassMediaInput);
}
/*****************************************************************************/
diff --git a/swad_timeline.c b/swad_timeline.c
index 48acc108a..842bb5b26 100644
--- a/swad_timeline.c
+++ b/swad_timeline.c
@@ -183,7 +183,7 @@ static void TL_PublishNoteInTimeline (struct TL_Publication *SocPub);
static void TL_PutFormToWriteNewPost (void);
static void TL_PutTextarea (const char *Placeholder,
- const char *ClassTextArea,const char *ClassImgTit);
+ const char *ClassTextArea,const char *ClassMediaInput);
static long TL_ReceivePost (void);
@@ -2355,8 +2355,8 @@ static void TL_PutFormToWriteNewPost (void)
/* Textarea and button */
TL_PutTextarea (Txt_New_TIMELINE_post,
- "TL_POST_TEXTAREA TL_RIGHT_WIDTH",
- "TL_POST_IMG_TIT_URL TL_POST_IMG_WIDTH");
+ "TL_POST_TEXTAREA TL_RIGHT_WIDTH",
+ "TL_POST_MED_INPUT TL_POST_MED_WIDTH");
/* End form */
Frm_EndForm ();
@@ -2374,7 +2374,7 @@ static void TL_PutFormToWriteNewPost (void)
/*****************************************************************************/
static void TL_PutTextarea (const char *Placeholder,
- const char *ClassTextArea,const char *ClassImgTit)
+ const char *ClassTextArea,const char *ClassMediaInput)
{
extern const char *Txt_Post;
char IdDivImgButton[Frm_MAX_BYTES_ID + 1];
@@ -2386,7 +2386,7 @@ static void TL_PutTextarea (const char *Placeholder,
fprintf (Gbl.F.Out,"",
TL_MAX_CHARS_IN_POST,
Placeholder,ClassTextArea,
@@ -2400,7 +2400,7 @@ static void TL_PutTextarea (const char *Placeholder,
Lay_HelpPlainEditor ();
/***** Attached image (optional) *****/
- Med_PutMediaUploader (-1,ClassImgTit);
+ Med_PutMediaUploader (-1,ClassMediaInput);
/***** Submit button *****/
fprintf (Gbl.F.Out,"