Version18.91.1

This commit is contained in:
Antonio Cañas Vargas 2019-03-29 11:24:02 +01:00
parent 217bb7b19d
commit 62a376fd08
5 changed files with 68 additions and 66 deletions

View File

@ -2903,6 +2903,11 @@ a:hover img.CENTRE_PHOTO_SHOW
.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 */
}
@media only screen and (min-width: 590px)
{ /* For tablets and desktop (maximum width visible on Moto G4 horizontal) */
@ -2912,6 +2917,9 @@ a:hover img.CENTRE_PHOTO_SHOW
.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_NEW_PUB
@ -2951,7 +2959,7 @@ a:hover img.CENTRE_PHOTO_SHOW
display:inline-block;
box-sizing:border-box;
width:56px;
height:70px;
height:76px;
padding:10px 0;
text-align:left;
vertical-align:top;
@ -3000,7 +3008,7 @@ a:hover img.CENTRE_PHOTO_SHOW
{
display:inline-block;
box-sizing:border-box;
padding:10px 0;
padding-top:10px;
}
.TL_COMMENT_AUTHOR
{
@ -3041,6 +3049,8 @@ a:hover img.CENTRE_PHOTO_SHOW
display:inline-block;
box-sizing:border-box;
width:56px;
text-align:center;
padding-right:10px;
vertical-align:bottom;
}
.TL_BOTTOM_RIGHT /* Container for fav, share, remove and comments */
@ -3049,10 +3059,6 @@ a:hover img.CENTRE_PHOTO_SHOW
box-sizing:border-box;
vertical-align:top;
}
.TL_ICO_FAV_SHA_REM /* Container for fav, share and remove */
{
padding-bottom:10px;
}
.TL_FORM
{
padding-top:8px;
@ -3094,29 +3100,28 @@ a:hover img.CENTRE_PHOTO_SHOW
padding-bottom:10px;
opacity:0.1;
}
.TL_BOTTOM
.TL_FOOT /* Container for favs, shares and remove */
{
display:table;
width:100%;
vertical-align:top;
padding-bottom:10px;
}
.TL_FAV_NOT, .TL_SHA_NOT
{
display:table-cell;
width:50%;
text-align:left;
vertical-align:top;
}
.TL_FAV_COM
{
display:table-cell;
width:100%;
text-align:left;
vertical-align:top;
}
.TL_REM
{
display:table-cell;
width:20px;
text-align:right;
vertical-align:bottom;
}

View File

@ -713,11 +713,9 @@ function evalScriptsInElem (elem) {
/*****************************************************************************/
// This function is called when user submit a form just inside a parent div
function updateParentDiv (elem,Params) {
function updateDivFaversSharers (form,Params) {
var objXMLHttp = false;
var parent = elem.parentNode;
var parentOfParent = parent.parentNode;
var idDiv = parentOfParent.id;
var id = form.parentNode.parentNode.id;
objXMLHttp = AJAXCreateObject ();
if (objXMLHttp) {
@ -725,8 +723,8 @@ function updateParentDiv (elem,Params) {
objXMLHttp.onreadystatechange = function() { // onreadystatechange must be lowercase
if (objXMLHttp.readyState == 4) { // Check if data have been received
if (objXMLHttp.status == 200)
if (idDiv) {
var div = document.getElementById(idDiv); // Access to DIV
if (id) {
var div = document.getElementById(id); // Access to DIV
if (div)
div.innerHTML = objXMLHttp.responseText; // Update DIV content
}

View File

@ -464,10 +464,11 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 18.91 (2019-03-29)"
#define Log_PLATFORM_VERSION "SWAD 18.91.1 (2019-03-29)"
#define CSS_FILE "swad18.91.css"
#define JS_FILE "swad18.91.js"
/*
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)
Version 18.90.3: Mar 28, 2019 Show all users who have shared/faved social notes and comments. (241307 lines)

View File

@ -663,8 +663,6 @@ static void Lay_WriteScriptInit (void)
case ActSeeSocTmlGbl:
case ActRcvSocPstGbl:
case ActRcvSocComGbl:
case ActShaSocNotGbl: // TODO: Remove?
case ActUnsSocNotGbl: // TODO: Remove?
case ActReqRemSocPubGbl:
case ActRemSocPubGbl:
case ActReqRemSocComGbl:

View File

@ -59,7 +59,7 @@
#define TL_NUM_VISIBLE_COMMENTS 3 // Maximum number of comments visible before expanding them
#define TL_DEF_USRS_SHOWN 3 // Default maximum number of users shown who have share/fav a note
#define TL_DEF_USRS_SHOWN 5 // Default maximum number of users shown who have share/fav a note
#define TL_MAX_USRS_SHOWN 1000 // Top maximum number of users shown who have share/fav a note
#define TL_MAX_CHARS_IN_POST 1000
@ -1120,11 +1120,26 @@ static void TL_FormFavSha (Act_Action_t ActionGbl,Act_Action_t ActionUsr,
{
char *OnSubmit;
/*
+---------------------------------------------------------------------------+
| div which content will be updated (parent of parent of form) |
| +---------------------+ +-------+ +-------------------------------------+ |
| | div (parent of form)| | div | | div for users | |
| | +-----------------+ | | for | | +------+ +------+ +------+ +------+ | |
| | | this form | | | num. | | | | | | | | | form | | |
| | | +-------------+ | | | of | | | user | | user | | user | | to | | |
| | | | fav icon | | | | users | | | 1 | | 2 | | 3 | | show | | |
| | | +-------------+ | | | | | | | | | | | | all | | |
| | +-----------------+ | | | | +------+ +------+ +------+ +------+ | |
| +---------------------+ +-------+ +-------------------------------------+ |
+---------------------------------------------------------------------------+
*/
/***** Form and icon to mark note as favourite *****/
/* Form with icon */
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
{
if (asprintf (&OnSubmit,"updateParentDiv(this,"
if (asprintf (&OnSubmit,"updateDivFaversSharers(this,"
"'act=%ld&ses=%s&%s&OtherUsrCod=%s');"
" return false;", // return false is necessary to not submit form
Act_GetActCod (ActionUsr),
@ -1136,7 +1151,7 @@ static void TL_FormFavSha (Act_Action_t ActionGbl,Act_Action_t ActionUsr,
}
else
{
if (asprintf (&OnSubmit,"updateParentDiv(this,"
if (asprintf (&OnSubmit,"updateDivFaversSharers(this,"
"'act=%ld&ses=%s&%s');"
" return false;", // return false is necessary to not submit form
Act_GetActCod (ActionGbl),
@ -1442,7 +1457,6 @@ static void TL_PutLinkToViewOldPublications (void)
/*****************************************************************************/
/******************************** Write note *********************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void TL_WriteNote (const struct TL_Note *SocNot,
TL_TopMessage_t TopMessage,long UsrCod,
@ -1514,7 +1528,7 @@ static void TL_WriteNote (const struct TL_Note *SocNot,
ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO42x56",Pho_ZOOM,true); // Use unique id
"PHOTO45x60",Pho_ZOOM,true); // Use unique id
fprintf (Gbl.F.Out,"</div>");
/***** Right: author's name, time, summary and buttons *****/
@ -1638,39 +1652,40 @@ static void TL_WriteNote (const struct TL_Note *SocNot,
fprintf (Gbl.F.Out,"</div>");
fprintf (Gbl.F.Out,"<div class=\"TL_BOTTOM_RIGHT TL_RIGHT_WIDTH\">"
"<div class=\"TL_ICO_FAV_SHA_REM\">");
/* Start container for buttons and comments */
fprintf (Gbl.F.Out,"<div class=\"TL_BOTTOM_RIGHT TL_RIGHT_WIDTH\">");
/* Start bottom container */
fprintf (Gbl.F.Out,"<div class=\"TL_BOTTOM\">");
/* Start foot container */
fprintf (Gbl.F.Out,"<div class=\"TL_FOOT TL_RIGHT_WIDTH\">");
/* Put form to mark/unmark this note as favourite */
fprintf (Gbl.F.Out,"<div id=\"fav_not_%s_%u\" class=\"TL_FAV_NOT\">",
/* Fav zone */
fprintf (Gbl.F.Out,"<div id=\"fav_not_%s_%u\""
" class=\"TL_FAV_NOT TL_FAV_NOT_WIDTH\">",
Gbl.UniqueNameEncrypted,NumDiv);
TL_PutFormToFavUnfNote (SocNot,TL_SHOW_A_FEW_USRS);
fprintf (Gbl.F.Out,"</div>");
/* Put form to share/unshare */
fprintf (Gbl.F.Out,"<div id=\"sha_not_%s_%u\" class=\"TL_SHA_NOT\">",
/* Share zone */
fprintf (Gbl.F.Out,"<div id=\"sha_not_%s_%u\""
" class=\"TL_SHA_NOT TL_SHA_NOT_WIDTH\">",
Gbl.UniqueNameEncrypted,NumDiv);
TL_PutFormToShaUnsNote (SocNot,TL_SHOW_A_FEW_USRS);
fprintf (Gbl.F.Out,"</div>");
/* Put icon to remove this note */
fprintf (Gbl.F.Out,"<div class=\"TL_REM\">");
if (IAmTheAuthor)
TL_PutFormToRemovePublication (SocNot->NotCod);
/* Start bottom container */
fprintf (Gbl.F.Out,"</div>");
/* End of icon bar */
/* End foot container */
fprintf (Gbl.F.Out,"</div>");
/* Show comments */
if (NumComments)
TL_WriteCommentsInNote (SocNot);
/* End of bottom right */
/* End container for buttons and comments */
fprintf (Gbl.F.Out,"</div>");
/* Put hidden form to write a new comment */
@ -1694,7 +1709,6 @@ static void TL_WriteNote (const struct TL_Note *SocNot,
/*****************************************************************************/
/*************** Write sharer/commenter if distinct to author ****************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void TL_WriteTopMessage (TL_TopMessage_t TopMessage,long UsrCod)
{
@ -1738,7 +1752,6 @@ static void TL_WriteTopMessage (TL_TopMessage_t TopMessage,long UsrCod)
/*****************************************************************************/
/*************** Write name and nickname of author of a note *****************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void TL_WriteAuthorNote (const struct UsrData *UsrDat)
{
@ -1860,7 +1873,6 @@ static void TL_GetAndWritePost (long PstCod)
/*****************************************************************************/
/************* Put form to go to an action depending on the note *************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void TL_PutFormGoToAction (const struct TL_Note *SocNot)
{
@ -2327,7 +2339,7 @@ static void TL_PutFormToWriteNewPost (void)
ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (&Gbl.Usrs.Me.UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&Gbl.Usrs.Me.UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO42x56",Pho_ZOOM,false);
"PHOTO45x60",Pho_ZOOM,false);
fprintf (Gbl.F.Out,"</div>");
/***** Right: author's name, time, summary and buttons *****/
@ -2535,7 +2547,6 @@ static void TL_PutIconCommentDisabled (void)
/*****************************************************************************/
/********************** Form to comment a publication ************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void TL_PutHiddenFormToWriteNewCommentToNote (long NotCod,
const char IdNewComment[Frm_MAX_BYTES_ID + 1])
@ -2595,7 +2606,6 @@ static unsigned long TL_GetNumCommentsInNote (long NotCod)
/*****************************************************************************/
/*********************** Write comments in a note ****************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void TL_WriteCommentsInNote (const struct TL_Note *SocNot)
{
@ -2721,7 +2731,6 @@ static void TL_PutIconToToggleComments (const char *UniqueId,
/*****************************************************************************/
/******************************** Write comment ******************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void TL_WriteComment (struct TL_Comment *SocCom,
TL_TopMessage_t TopMessage,long UsrCod,
@ -2790,32 +2799,34 @@ static void TL_WriteComment (struct TL_Comment *SocCom,
TL_WriteDateTime (SocCom->DateTimeUTC);
/* Write content of the comment */
fprintf (Gbl.F.Out,"<div class=\"TL_TXT\">");
Msg_WriteMsgContent (SocCom->Content,Cns_MAX_BYTES_LONG_TEXT,true,false);
fprintf (Gbl.F.Out,"</div>");
if (SocCom->Content[0])
{
fprintf (Gbl.F.Out,"<div class=\"TL_TXT\">");
Msg_WriteMsgContent (SocCom->Content,Cns_MAX_BYTES_LONG_TEXT,true,false);
fprintf (Gbl.F.Out,"</div>");
}
/* Show image */
Med_ShowMedia (&SocCom->Media,"TL_COMMENT_MED_CONTAINER TL_COMMENT_WIDTH",
"TL_COMMENT_MED TL_COMMENT_WIDTH");
/* Start bottom container */
fprintf (Gbl.F.Out,"<div class=\"TL_BOTTOM\">");
/* Start foot container */
fprintf (Gbl.F.Out,"<div class=\"TL_FOOT TL_COMMENT_WIDTH\">");
/* Start favs container */
fprintf (Gbl.F.Out,"<div id=\"fav_com_%s_%u\" class=\"TL_FAV_COM\">",
/* Fav zone */
fprintf (Gbl.F.Out,"<div id=\"fav_com_%s_%u\""
" class=\"TL_FAV_COM TL_FAV_WIDTH\">",
Gbl.UniqueNameEncrypted,NumDiv);
/* Write HTML inside DIV with form to fav/unfav */
TL_PutFormToFavUnfComment (SocCom,TL_SHOW_A_FEW_USRS);
/* End favs container */
fprintf (Gbl.F.Out,"</div>");
/* Put icon to remove this comment */
fprintf (Gbl.F.Out,"<div class=\"TL_REM\">");
if (IAmTheAuthor && !ShowCommentAlone)
TL_PutFormToRemoveComment (SocCom->PubCod);
fprintf (Gbl.F.Out,"</div>");
/* End bottom container */
/* End foot container */
fprintf (Gbl.F.Out,"</div>");
/***** Free memory used for user's data *****/
@ -2836,7 +2847,6 @@ static void TL_WriteComment (struct TL_Comment *SocCom,
/*****************************************************************************/
/********* Write name and nickname of author of a comment to a note **********/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void TL_WriteAuthorComment (struct UsrData *UsrDat)
{
@ -2872,19 +2882,16 @@ static void TL_WriteAuthorComment (struct UsrData *UsrDat)
/*****************************************************************************/
/************************* Form to remove comment ****************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void TL_PutFormToRemoveComment (long PubCod)
{
extern const char *Txt_Remove;
/***** Form to remove publication *****/
fprintf (Gbl.F.Out,"<div class=\"TL_REM\">");
TL_FormStart (ActReqRemSocComGbl,ActReqRemSocComUsr);
TL_PutHiddenParamPubCod (PubCod);
Ico_PutIconLink ("trash.svg",Txt_Remove);
Frm_EndForm ();
fprintf (Gbl.F.Out,"</div>");
}
/*****************************************************************************/
@ -2934,7 +2941,6 @@ static void TL_PutDisabledIconFav (unsigned NumFavs)
/*****************************************************************************/
/*********************** Form to share/unshare note **************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void TL_PutFormToSeeAllSharersNote (const struct TL_Note *SocNot,
TL_HowMany_t HowMany)
@ -2981,7 +2987,6 @@ static void TL_PutFormToUnsNote (const struct TL_Note *SocNot)
/*****************************************************************************/
/************************** Form to fav/unfav note ***************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void TL_PutFormToSeeAllFaversNote (const struct TL_Note *SocNot,
TL_HowMany_t HowMany)
@ -3028,7 +3033,6 @@ static void TL_PutFormToUnfNote (const struct TL_Note *SocNot)
/*****************************************************************************/
/************************** Form to fav/unfav comment ************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void TL_PutFormToSeeAllFaversComment (const struct TL_Comment *SocCom,
TL_HowMany_t HowMany)
@ -3075,19 +3079,16 @@ static void TL_PutFormToUnfComment (const struct TL_Comment *SocCom)
/*****************************************************************************/
/************************ Form to remove publication *************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void TL_PutFormToRemovePublication (long NotCod)
{
extern const char *Txt_Remove;
/***** Form to remove publication *****/
fprintf (Gbl.F.Out,"<div class=\"TL_REM\">");
TL_FormStart (ActReqRemSocPubGbl,ActReqRemSocPubUsr);
TL_PutHiddenParamNotCod (NotCod);
Ico_PutIconLink ("trash.svg",Txt_Remove);
Frm_EndForm ();
fprintf (Gbl.F.Out,"</div>");
}
/*****************************************************************************/
@ -4660,7 +4661,6 @@ static void TL_ShowUsrsWhoHaveMarkedCommAsFav (const struct TL_Comment *SocCom,
/*****************************************************************************/
/************************ Show sharers or favouriters ************************/
/*****************************************************************************/
// All forms in this function and nested functions must have unique identifiers
static void TL_ShowNumSharersOrFavers (unsigned NumUsrs)
{