diff --git a/js/swad18.51.js b/js/swad18.56.js similarity index 97% rename from js/swad18.51.js rename to js/swad18.56.js index f7b4dc46..8937a2df 100644 --- a/js/swad18.51.js +++ b/js/swad18.56.js @@ -1373,7 +1373,7 @@ function ExpandChildren (idParent) { } function ContractFolder (idParent) { - var parent = document.getElementById(idParent); + var parent = document.getElementById(idParent); var iconToExpand = document.getElementById('expand_' + idParent); var iconToContract = document.getElementById('contract_' + idParent); var iconFolderClosed = document.getElementById('folder_closed_' + idParent); @@ -1403,3 +1403,31 @@ function ContractChildren (idParent) { row.style.display = 'none'; // hide } } + +/*****************************************************************************/ +/**************** Animate icon "recycle" when click on a link ****************/ +/*****************************************************************************/ + +function FavSocial (idParent) { + var parent = document.getElementById(idParent); + var iconToFav = document.getElementById('fav_' + idParent); + var iconToUnfav = document.getElementById('unfav_' + idParent); + + if (parent.dataset.status == 'unfaved') { + parent.dataset.status = 'faved'; + iconToFav.style.display = 'none'; + iconToUnfav.style.display = ''; + } +} + +function UnfavSocial (idParent) { + var parent = document.getElementById(idParent); + var iconToFav = document.getElementById('fav_' + idParent); + var iconToUnfav = document.getElementById('unfav_' + idParent); + + if (parent.dataset.status == 'faved') { + parent.dataset.status = 'unfaved'; + iconToUnfav.style.display = 'none'; + iconToFav.style.display = ''; + } +} diff --git a/swad_action.c b/swad_action.c index 3d9b1144..282a35ba 100644 --- a/swad_action.c +++ b/swad_action.c @@ -1615,8 +1615,10 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActRcvSocComGbl */{1503,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_DATA,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_ReceiveCommentGbl ,NULL}, /* ActShaSocNotGbl */{1495,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_ShareSocialNoteGbl ,NULL}, /* ActUnsSocNotGbl */{1496,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_UnshareSocialNoteGbl ,NULL}, - /* ActFavSocNotGbl */{1512,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_FavSocialNoteGbl ,NULL}, - /* ActUnfSocNotGbl */{1513,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_UnfavSocialNoteGbl ,NULL}, +// /* ActFavSocNotGbl */{1512,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_FavSocialNoteGbl ,NULL}, + /* ActFavSocNotGbl */{1512,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_204_NO_CONT,Soc_FavSocialNoteGbl_new ,NULL ,NULL}, +// /* ActUnfSocNotGbl */{1513,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_UnfavSocialNoteGbl ,NULL}, + /* ActUnfSocNotGbl */{1513,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_204_NO_CONT,Soc_UnfavSocialNoteGbl_new ,NULL ,NULL}, /* ActFavSocComGbl */{1516,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_FavSocialCommentGbl ,NULL}, /* ActUnfSocComGbl */{1517,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_UnfavSocialCommentGbl ,NULL}, /* ActReqRemSocPubGbl*/{1494,-1,TabUnk,ActSeeSocTmlGbl ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Soc_ShowTimelineGbl1 ,Soc_RequestRemSocialNoteGbl ,NULL}, diff --git a/swad_changelog.h b/swad_changelog.h index 1dbd8ded..e46fca6b 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -429,10 +429,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.55 (2019-02-21)" +#define Log_PLATFORM_VERSION "SWAD 18.56 (2019-02-23)" #define CSS_FILE "swad18.55.css" -#define JS_FILE "swad18.51.js" +#define JS_FILE "swad18.56.js" /* + Version 18.56: Feb 23, 2019 Favourite is made in Javascript without reloading page. (237787 lines) Version 18.55: Feb 22, 2019 Changes in CSS styles related to forms. (237585 lines) Version 18.54.1: Feb 22, 2019 Following and followers shown in photo zoom. (237586 lines) Version 18.54: Feb 21, 2019 Selection of users scope in timeline is made with icons. (237534 lines) diff --git a/swad_form.c b/swad_form.c index 6976369e..a1ddedde 100644 --- a/swad_form.c +++ b/swad_form.c @@ -97,6 +97,15 @@ void Frm_StartFormUniqueAnchor (Act_Action_t NextAction,const char *Anchor) Frm_StartFormInternal (NextAction,true,Gbl.Form.UniqueId,Anchor,NULL); // Do put now parameter location (if no open session) } +void Frm_StartFormUniqueAnchorOnSubmit (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit) + { + Gbl.Form.Num++; // Initialized to -1. The first time it is incremented, it will be equal to 0 + snprintf (Gbl.Form.UniqueId,sizeof (Gbl.Form.UniqueId), + "form_%s_%d", + Gbl.UniqueNameEncrypted,Gbl.Form.Num); + Frm_StartFormInternal (NextAction,true,Gbl.Form.UniqueId,Anchor,OnSubmit); // Do put now parameter location (if no open session) + } + void Frm_StartFormId (Act_Action_t NextAction,const char *Id) { Gbl.Form.Num++; // Initialized to -1. The first time it is incremented, it will be equal to 0 diff --git a/swad_form.h b/swad_form.h index dbdaba59..47731908 100644 --- a/swad_form.h +++ b/swad_form.h @@ -57,6 +57,7 @@ void Frm_StartFormAnchorOnSubmit (Act_Action_t NextAction,const char *Anchor,con void Frm_StartFormUnique (Act_Action_t NextAction); void Frm_StartFormAnchor (Act_Action_t NextAction,const char *Anchor); void Frm_StartFormUniqueAnchor (Act_Action_t NextAction,const char *Anchor); +void Frm_StartFormUniqueAnchorOnSubmit (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit); void Frm_StartFormId (Act_Action_t NextAction,const char *Id); void Frm_SetParamsForm (char ParamsStr[Frm_MAX_BYTES_PARAMS_STR],Act_Action_t NextAction, bool PutParameterLocationIfNoSesion); diff --git a/swad_profile.c b/swad_profile.c index 8aa20cdc..a412e403 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -745,7 +745,7 @@ static unsigned long Prf_GetNumUsrsWithNumClicksPerDay (void) static void Prf_ShowRanking (unsigned long Rank,unsigned long NumUsrs) { - extern const char *The_ClassFormInBox[The_NUM_THEMES]; + extern const char *The_ClassFormOutBox[The_NUM_THEMES]; extern const char *Txt_of_PART_OF_A_TOTAL; /***** Part of a total and end container *****/ @@ -757,7 +757,7 @@ static void Prf_ShowRanking (unsigned long Rank,unsigned long NumUsrs) Frm_StartForm (ActSeeUseGbl); Sco_PutParamScope ("ScopeSta",Sco_SCOPE_SYS); Par_PutHiddenParamUnsigned ("FigureType",(unsigned) Fig_USERS_RANKING); - Frm_LinkFormSubmit (Gbl.Title,The_ClassFormInBox[Gbl.Prefs.Theme],NULL); + Frm_LinkFormSubmit (Gbl.Title,The_ClassFormOutBox[Gbl.Prefs.Theme],NULL); fprintf (Gbl.F.Out,"#%lu",Rank); Frm_EndForm (); } diff --git a/swad_social.c b/swad_social.c index 0a239456..d9c7eb6a 100644 --- a/swad_social.c +++ b/swad_social.c @@ -198,6 +198,8 @@ static void Soc_PutDisabledIconShare (unsigned NumShared); static void Soc_PutDisabledIconFav (unsigned NumFavs); static void Soc_PutFormToShareSocialNote (long NotCod); +static void Soc_PutFormToFavSocialNote_new (long NotCod,const char *FavId,bool Hidden); +static void Soc_PutFormToUnfavSocialNote_new (long NotCod,const char *FavId,bool Hidden); static void Soc_PutFormToFavSocialNote (long NotCod); static void Soc_PutFormToUnshareSocialNote (long NotCod); @@ -213,12 +215,14 @@ static long Soc_GetParamPubCod (void); static long Soc_ReceiveComment (void); static long Soc_ShareSocialNote (void); +static long Soc_FavSocialNote_new (void); static long Soc_FavSocialNote (void); static long Soc_FavSocialComment (void); static void Soc_CreateNotifToAuthor (long AuthorCod,long PubCod, Ntf_NotifyEvent_t NotifyEvent); static long Soc_UnshareSocialNote (void); +static long Soc_UnfavSocialNote_new (void); static long Soc_UnfavSocialNote (void); static long Soc_UnfavSocialComment (void); @@ -1373,6 +1377,8 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot, char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1]; unsigned NumComments; char IdNewComment[Frm_MAX_BYTES_ID + 1]; + static unsigned Num = 0; + char FavId[Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64 + 1 + 10 + 1]; /***** Start box ****/ if (ShowNoteAlone) @@ -1563,18 +1569,37 @@ static void Soc_WriteSocialNote (const struct SocialNote *SocNot, "