From 006895be7dd927ab565cc631b3acb14a7cbde4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Fri, 29 Mar 2019 15:12:51 +0100 Subject: [PATCH] Version18.92 --- css/{swad18.91.css => swad18.92.css} | 100 +++++++++++++++------------ js/{swad18.91.js => swad18.92.js} | 14 ++++ swad_changelog.h | 7 +- swad_timeline.c | 64 +++++++++-------- 4 files changed, 104 insertions(+), 81 deletions(-) rename css/{swad18.91.css => swad18.92.css} (98%) rename js/{swad18.91.js => swad18.92.js} (99%) diff --git a/css/swad18.91.css b/css/swad18.92.css similarity index 98% rename from css/swad18.91.css rename to css/swad18.92.css index 1cb656ce..65fd5c55 100644 --- a/css/swad18.91.css +++ b/css/swad18.92.css @@ -2897,29 +2897,29 @@ a:hover img.CENTRE_PHOTO_SHOW @media only screen and (max-width: 590px) { /* For mobile-phones (maximum width visible on Moto G4 vertical) */ - .TL_WIDTH {width:316px;} /* 556-240 */ - .TL_RIGHT_WIDTH {width:260px;} /* 500-240 */ - .TL_RIGHT_AUTHOR_WIDTH {width:100px;} /* 340-240 */ - .TL_COMMENT_WIDTH {width:220px;} /* 460-240 */ - .TL_COMMENT_AUTHOR_WIDTH {width: 60px;} /* 300-240 */ - .TL_MED_INPUT_WIDTH {width:160px;} /* 400-240 */ - .TL_NOTE_FOOT_WIDTH {width:260px;} /* 500-240 */ - .TL_COMM_FOOT_WIDTH {width:220px;} /* 460-240 */ - .TL_FAV_NOT_WIDTH {width:120px;} /* (480-240)/2 */ - .TL_SHA_NOT_WIDTH {width:120px;} /* (480-240)/2 */ - .TL_FAV_COM_WIDTH {width:200px;} /* 440-240 */ + .TL_WIDTH {width:316px;} /* 556-240 */ + .TL_RIGHT_WIDTH {width:260px;} /* 500-240 */ + .TL_RIGHT_AUTHOR_WIDTH {width:100px;} /* 340-240 */ + .TL_COMM_WIDTH {width:220px;} /* 460-240 */ + .TL_COMM_AUTHOR_WIDTH {width: 60px;} /* 300-240 */ + .TL_MED_INPUT_WIDTH {width:160px;} /* 400-240 */ + .TL_NOTE_FOOT_WIDTH {width:260px;} /* 500-240 */ + .TL_COMM_FOOT_WIDTH {width:220px;} /* 460-240 */ + .TL_FAV_NOT_WIDTH {width:120px;} /* (480-240)/2 */ + .TL_SHA_NOT_WIDTH {width:120px;} /* (480-240)/2 */ + .TL_FAV_COM_WIDTH {width:200px;} /* 440-240 */ } @media only screen and (min-width: 590px) { /* For tablets and desktop (maximum width visible on Moto G4 horizontal) */ - .TL_WIDTH {width:556px;} - .TL_RIGHT_WIDTH {width:500px;} - .TL_RIGHT_AUTHOR_WIDTH {width:340px;} - .TL_COMMENT_WIDTH {width:460px;} - .TL_COMMENT_AUTHOR_WIDTH {width:300px;} - .TL_MED_INPUT_WIDTH {width:400px;} - .TL_FAV_NOT_WIDTH {width:240px;} - .TL_SHA_NOT_WIDTH {width:240px;} - .TL_FAV_COM_WIDTH {width:440px;} + .TL_WIDTH {width:556px;} + .TL_RIGHT_WIDTH {width:500px;} + .TL_RIGHT_AUTHOR_WIDTH {width:340px;} + .TL_COMM_WIDTH {width:460px;} + .TL_COMM_AUTHOR_WIDTH {width:300px;} + .TL_MED_INPUT_WIDTH {width:400px;} + .TL_FAV_NOT_WIDTH {width:240px;} + .TL_SHA_NOT_WIDTH {width:240px;} + .TL_FAV_COM_WIDTH {width:440px;} } .TL_NEW_PUB @@ -2931,7 +2931,7 @@ a:hover img.CENTRE_PHOTO_SHOW { to {background-color:white;} } -.TL_FORM_NEW_POST +.TL_FORM_NEW_PST { padding:10px 0; text-align:center; @@ -2940,7 +2940,7 @@ a:hover img.CENTRE_PHOTO_SHOW { border-top:1px solid silver; } -.TL_TOP_CONTAINER +.TL_TOP_CONT { box-sizing:border-box; padding-top:10px; @@ -2964,7 +2964,7 @@ a:hover img.CENTRE_PHOTO_SHOW text-align:left; vertical-align:top; } -.TL_RIGHT_CONTAINER +.TL_RIGHT_CONT { display:inline-block; box-sizing:border-box; @@ -2988,29 +2988,29 @@ a:hover img.CENTRE_PHOTO_SHOW text-align:right; vertical-align:top; } -.TL_POST_TEXTAREA +.TL_PST_TEXTAREA { box-sizing:border-box; margin:0; resize:none; } -.TL_POST_MED_CONTAINER +.TL_PST_MED_CONT { box-sizing:border-box; - margin:10px 0; + margin-top:10px; } -.TL_POST_MED +.TL_PST_MED { box-sizing:border-box; border-radius:4px; } -.TL_COMMENT_CONTAINER +.TL_COM_CONT { display:inline-block; box-sizing:border-box; padding-top:10px; } -.TL_COMMENT_AUTHOR +.TL_COM_AUTHOR { display:inline-block; box-sizing:border-box; @@ -3020,17 +3020,17 @@ a:hover img.CENTRE_PHOTO_SHOW overflow:hidden; text-overflow:ellipsis; } -.TL_COMMENT_MED_CONTAINER +.TL_COM_MED_CONT { box-sizing:border-box; - margin:10px 0; + margin-top:10px; } -.TL_COMMENT_MED +.TL_COM_MED { box-sizing:border-box; border-radius:4px; } -.TL_FORM_NEW_COMMENT +.TL_FORM_NEW_COM { display:inline-block; margin-left:56px; @@ -3038,7 +3038,7 @@ a:hover img.CENTRE_PHOTO_SHOW padding-bottom:10px; text-align:center; } -.TL_COMMENT_TEXTAREA +.TL_COM_TEXTAREA { box-sizing:border-box; margin:0; @@ -3049,8 +3049,8 @@ a:hover img.CENTRE_PHOTO_SHOW display:inline-block; box-sizing:border-box; width:56px; + padding-right:11px; text-align:center; - padding-right:10px; vertical-align:bottom; } .TL_BOTTOM_RIGHT /* Container for fav, share, remove and comments */ @@ -3076,35 +3076,45 @@ a:hover img.CENTRE_PHOTO_SHOW } .TL_TXT { - padding:5px 0; + padding-top:5px; color:#202020; font-size:13pt; line-height:1.4; overflow:hidden; text-overflow:ellipsis; } -.TL_EXPAND_COMMENTS +.TL_EXPAND_COM { text-align:center; vertical-align:top; padding-bottom:10px; } -.TL_ICO_COMMENT +.TL_ICO_COM_OFF { display:inline-block; - padding-bottom:10px; + box-sizing:border-box; + padding:6px; + text-align:center; + vertical-align:middle; + border:solid 1px; + border-color:transparent; } -.TL_ICO_COMMENT_DISABLED +.TL_ICO_COM_ON { display:inline-block; - padding-bottom:10px; - opacity:0.1; + box-sizing:border-box; + padding:6px; + text-align:center; + vertical-align:middle; + border:solid 1px; + border-color:#C0DAE4; + background-color:#DDECF1; } .TL_FOOT /* Container for favs, shares and remove */ { display:table; vertical-align:top; - padding-bottom:10px; + padding:7px 0; } .TL_FAV_NOT, .TL_SHA_NOT { @@ -3150,11 +3160,11 @@ a:hover img.CENTRE_PHOTO_SHOW padding-left:4px; vertical-align:bottom; } -.TL_COMMENT +.TL_COM { border-top:1px solid silver; } -.TL_COMMENT_PHOTO +.TL_COM_PHOTO { display:inline-block; box-sizing:border-box; diff --git a/js/swad18.91.js b/js/swad18.92.js similarity index 99% rename from js/swad18.91.js rename to js/swad18.92.js index 9a077669..e6911a10 100644 --- a/js/swad18.91.js +++ b/js/swad18.92.js @@ -956,6 +956,20 @@ function toggleOffGIF (elem, staticURL) { } } +/*****************************************************************************/ +/******* Change display of edition of a new comment in a social note *********/ +/*****************************************************************************/ + +function toggleNewComment (id) { + var iconDiv = document.getElementById (id + '_ico'); + + if (iconDiv.className == 'TL_ICO_COM_OFF') + iconDiv.className = 'TL_ICO_COM_ON'; + else + iconDiv.className = 'TL_ICO_COM_OFF'; + toggleDisplay(id); +} + /*****************************************************************************/ /*************** Change display of comments in a social note *****************/ /*****************************************************************************/ diff --git a/swad_changelog.h b/swad_changelog.h index e06c7c87..1fe391bf 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -464,10 +464,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.91.1 (2019-03-29)" -#define CSS_FILE "swad18.91.css" -#define JS_FILE "swad18.91.js" +#define Log_PLATFORM_VERSION "SWAD 18.92 (2019-03-29)" +#define CSS_FILE "swad18.92.css" +#define JS_FILE "swad18.92.js" /* + Version 18.92: Mar 29, 2019 Changes in timeline layout. (241367 lines) Version 18.91.1: Mar 29, 2019 Changes in timeline layout. (241345 lines) Version 18.91: Mar 29, 2019 Code refactoring in timeline. (241341 lines) Version 18.90.4: Mar 29, 2019 Changes in layout of shared/faved social notes and comments. (241394 lines) diff --git a/swad_timeline.c b/swad_timeline.c index b6dd507d..97aa844d 100644 --- a/swad_timeline.c +++ b/swad_timeline.c @@ -1191,7 +1191,7 @@ static void TL_PutFormWhichUsrs (void) { fprintf (Gbl.F.Out,"
", WhichUsrs == Gbl.Timeline.WhichUsrs ? "PREF_ON" : - "PREF_OFF"); + "PREF_OFF"); Frm_StartForm (ActSeeSocTmlGbl); Par_PutHiddenParamUnsigned ("WhichUsrs",WhichUsrs); Ico_PutSettingIconLink (Icon[WhichUsrs],Txt_TIMELINE_WHICH_USERS[WhichUsrs]); @@ -1532,7 +1532,7 @@ static void TL_WriteNote (const struct TL_Note *SocNot, fprintf (Gbl.F.Out,"
"); /***** Right: author's name, time, summary and buttons *****/ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); /* Write author's full name and nickname */ TL_WriteAuthorNote (&UsrDat); @@ -1636,8 +1636,6 @@ static void TL_WriteNote (const struct TL_Note *SocNot, /* End of right part */ fprintf (Gbl.F.Out,"
"); - fprintf (Gbl.F.Out,"
"); - /* Create unique id for new comment */ Frm_SetUniqueId (IdNewComment); @@ -1645,11 +1643,11 @@ static void TL_WriteNote (const struct TL_Note *SocNot, NumComments = TL_GetNumCommentsInNote (SocNot->NotCod); /* Put icon to add a comment */ + fprintf (Gbl.F.Out,"
"); if (SocNot->Unavailable) // Unavailable notes can not be commented TL_PutIconCommentDisabled (); else TL_PutIconToToggleCommentNote (IdNewComment); - fprintf (Gbl.F.Out,"
"); /* Start container for buttons and comments */ @@ -1658,21 +1656,21 @@ static void TL_WriteNote (const struct TL_Note *SocNot, /* Start foot container */ fprintf (Gbl.F.Out,"
"); - /* Fav zone */ + /* Foot column 1: Fav zone */ fprintf (Gbl.F.Out,"
", Gbl.UniqueNameEncrypted,NumDiv); TL_PutFormToFavUnfNote (SocNot,TL_SHOW_A_FEW_USRS); fprintf (Gbl.F.Out,"
"); - /* Share zone */ + /* Foot column 2: Share zone */ fprintf (Gbl.F.Out,"
", Gbl.UniqueNameEncrypted,NumDiv); TL_PutFormToShaUnsNote (SocNot,TL_SHOW_A_FEW_USRS); fprintf (Gbl.F.Out,"
"); - /* Put icon to remove this note */ + /* Foot column 3: Icon to remove this note */ fprintf (Gbl.F.Out,"
"); if (IAmTheAuthor) TL_PutFormToRemovePublication (SocNot->NotCod); @@ -1727,7 +1725,7 @@ static void TL_WriteTopMessage (TL_TopMessage_t TopMessage,long UsrCod) UsrDat.UsrCod = UsrCod; if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS)) // Really we only need EncryptedUsrCod and FullName { - fprintf (Gbl.F.Out,"
"); /***** Show user's name inside form to go to user's public profile *****/ @@ -1863,8 +1861,8 @@ static void TL_GetAndWritePost (long PstCod) } /***** Show image *****/ - Med_ShowMedia (&Media,"TL_POST_MED_CONTAINER TL_RIGHT_WIDTH", - "TL_POST_MED TL_RIGHT_WIDTH"); + Med_ShowMedia (&Media,"TL_PST_MED_CONT TL_RIGHT_WIDTH", + "TL_PST_MED TL_RIGHT_WIDTH"); /***** Free image *****/ Med_MediaDestructor (&Media); @@ -2343,7 +2341,7 @@ static void TL_PutFormToWriteNewPost (void) fprintf (Gbl.F.Out,"
"); /***** Right: author's name, time, summary and buttons *****/ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); /* Write author's full name and nickname */ fprintf (Gbl.F.Out,"
" @@ -2354,14 +2352,14 @@ static void TL_PutFormToWriteNewPost (void) /***** Form to write the post *****/ /* Start container */ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); /* Start form to write the post */ TL_FormStart (ActRcvSocPstGbl,ActRcvSocPstUsr); /* Textarea and button */ TL_PutTextarea (Txt_New_TIMELINE_post, - "TL_POST_TEXTAREA TL_RIGHT_WIDTH"); + "TL_PST_TEXTAREA TL_RIGHT_WIDTH"); /* End form */ Frm_EndForm (); @@ -2514,14 +2512,14 @@ static void TL_PutIconToToggleCommentNote (const char UniqueId[Frm_MAX_BYTES_ID extern const char *Txt_Comment; /***** Link to toggle on/off the form to comment a note *****/ - fprintf (Gbl.F.Out,"
" + fprintf (Gbl.F.Out,"", - UniqueId, + UniqueId,UniqueId, Cfg_URL_ICON_PUBLIC, Txt_Comment,Txt_Comment); } @@ -2535,7 +2533,7 @@ static void TL_PutIconCommentDisabled (void) extern const char *Txt_Comment; /***** Disabled icon to comment a note *****/ - fprintf (Gbl.F.Out,"
" + fprintf (Gbl.F.Out,"
" "\"%s\"" @@ -2557,12 +2555,12 @@ static void TL_PutHiddenFormToWriteNewCommentToNote (long NotCod, /***** Start container *****/ fprintf (Gbl.F.Out,"
", IdNewComment); /***** Left: write author's photo (my photo) *****/ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (&Gbl.Usrs.Me.UsrDat,PhotoURL); Pho_ShowUsrPhoto (&Gbl.Usrs.Me.UsrDat,ShowPhoto ? PhotoURL : NULL, @@ -2571,7 +2569,7 @@ static void TL_PutHiddenFormToWriteNewCommentToNote (long NotCod, /***** Right: form to write the comment *****/ /* Start right container */ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); /* Start form to write the post */ TL_FormStart (ActRcvSocComGbl,ActRcvSocComUsr); @@ -2579,7 +2577,7 @@ static void TL_PutHiddenFormToWriteNewCommentToNote (long NotCod, /* Textarea and button */ TL_PutTextarea (Txt_New_TIMELINE_comment, - "TL_COMMENT_TEXTAREA TL_COMMENT_WIDTH"); + "TL_COM_TEXTAREA TL_COMM_WIDTH"); /* End form */ Frm_EndForm (); @@ -2647,7 +2645,7 @@ static void TL_WriteCommentsInNote (const struct TL_Note *SocNot) /***** Link to toggle on/off comments *****/ fprintf (Gbl.F.Out,"
", // Initially hidden IdComments); TL_PutIconToToggleComments (IdComments,"angle-down.svg", @@ -2666,7 +2664,7 @@ static void TL_WriteCommentsInNote (const struct TL_Note *SocNot) /***** Link to toggle on/off comments *****/ fprintf (Gbl.F.Out,"
", + " class=\"TL_EXPAND_COM TL_RIGHT_WIDTH\">", IdComments); snprintf (Gbl.Title,sizeof (Gbl.Title), Txt_See_the_previous_X_COMMENTS, @@ -2759,14 +2757,14 @@ static void TL_WriteComment (struct TL_Comment *SocCom, fprintf (Gbl.F.Out,"
" "
" - "
" + "
" "
    "); } /***** Start list item *****/ fprintf (Gbl.F.Out,""); if (SocCom->PubCod <= 0 || @@ -2782,7 +2780,7 @@ static void TL_WriteComment (struct TL_Comment *SocCom, IAmTheAuthor = Usr_ItsMe (UsrDat.UsrCod); /***** Left: write author's photo *****/ - fprintf (Gbl.F.Out,"
    "); + fprintf (Gbl.F.Out,"
    "); ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (&UsrDat,PhotoURL); Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL : NULL, @@ -2790,7 +2788,7 @@ static void TL_WriteComment (struct TL_Comment *SocCom, fprintf (Gbl.F.Out,"
    "); /***** Right: author's name, time, content, image and buttons *****/ - fprintf (Gbl.F.Out,"
    "); + fprintf (Gbl.F.Out,"
    "); /* Write author's full name and nickname */ TL_WriteAuthorComment (&UsrDat); @@ -2807,11 +2805,11 @@ static void TL_WriteComment (struct TL_Comment *SocCom, } /* Show image */ - Med_ShowMedia (&SocCom->Media,"TL_COMMENT_MED_CONTAINER TL_COMMENT_WIDTH", - "TL_COMMENT_MED TL_COMMENT_WIDTH"); + Med_ShowMedia (&SocCom->Media,"TL_COM_MED_CONT TL_COMM_WIDTH", + "TL_COM_MED TL_COMM_WIDTH"); /* Start foot container */ - fprintf (Gbl.F.Out,"
    "); + fprintf (Gbl.F.Out,"
    "); /* Fav zone */ fprintf (Gbl.F.Out,"
    UsrCod); /***** Start container *****/ - fprintf (Gbl.F.Out,"
    "); + fprintf (Gbl.F.Out,"
    "); /***** Show user's name inside form to go to user's public profile *****/ Frm_StartFormUnique (ActSeeOthPubPrf);