diff --git a/css/swad22.46.css b/css/swad22.48.css similarity index 99% rename from css/swad22.46.css rename to css/swad22.48.css index 1b77933c..99f89e69 100644 --- a/css/swad22.46.css +++ b/css/swad22.48.css @@ -113,6 +113,40 @@ a:hover /* Default ==> underlined */ text-decoration:underline; opacity:1; } +.NICK_WHITE, +.NICK_GREY, +.NICK_PURPLE, +.NICK_BLUE, +.NICK_YELLOW, +.NICK_PINK + { + background:transparent; + border:none; + padding:0; + font:inherit; + color:#4d88a1; + text-decoration:none; + } +.NICK_DARK + { + background:transparent; + border:none; + padding:0; + font:inherit; + color:#afc4cc; + } +.NICK_WHITE:hover, +.NICK_GREY:hover, +.NICK_PURPLE:hover, +.NICK_BLUE:hover, +.NICK_YELLOW:hover, +.NICK_PINK:hover, +.NICK_DARK:hover + { + cursor:pointer; + text-decoration:underline; + } + /****************** Layout (the whole page with a background) ****************/ #whole_page { diff --git a/swad_HTML.c b/swad_HTML.c index 143f83b3..ffd8c8c6 100644 --- a/swad_HTML.c +++ b/swad_HTML.c @@ -1486,10 +1486,6 @@ void HTM_BUTTON_Submit_Begin (const char *Title,const char *fmt,...) free (Attr); } } -/* - if (OnSubmit) // JavaScript function to be called before submitting the form - if (OnSubmit[0]) - HTM_TxtF (" onsubmit=\"%s;\"",OnSubmit); */ HTM_Txt (">"); HTM_BUTTON_NestingLevel++; diff --git a/swad_autolink.c b/swad_autolink.c index e45cbaaa..13b262b3 100644 --- a/swad_autolink.c +++ b/swad_autolink.c @@ -137,11 +137,10 @@ The web site of @rms is +
- + @acanas
@@ -554,8 +553,8 @@ static ALn_LinkType_t ALn_CheckNickname (char **PtrSrc,char PrevCh, /***** Store second part of anchor *****/ if (asprintf (&(*Link)->NickAnchor[1].Str, "\">" - "") < 0) + "" + "" + "%s" + "%s", CaptionStr, ImgStr) < 0) Err_NotEnoughMemoryExit (); diff --git a/swad_browser.c b/swad_browser.c index eb8f3808..92a5336b 100644 --- a/swad_browser.c +++ b/swad_browser.c @@ -6890,7 +6890,6 @@ static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow) /***** Form to upload files using the library Dropzone.js *****/ // Use min-height:125px; or other number to stablish the height? - Gbl.Form.Num++; HTM_TxtF ("
MchCod, + Mch_PutBigButton (ActBckMch,Match->MchCod, Mch_ICON_PREVIOUS,Txt_Go_back); break; } @@ -2546,7 +2546,7 @@ static void Mch_PutMatchControlButtons (const struct Mch_Match *Match) HTM_DIV_Begin ("class=\"MCH_BUTTON_CENTER_CONT\""); if (Match->Status.Playing) // Match is being played /* Put button to pause match */ - Mch_PutBigButton (ActPlyPauMch,"play_pause",Match->MchCod, + Mch_PutBigButton (ActPlyPauMch,Match->MchCod, Mch_ICON_PAUSE,Txt_Pause); else // Match is paused, not being played { @@ -2554,7 +2554,7 @@ static void Mch_PutMatchControlButtons (const struct Mch_Match *Match) { case Mch_START: // Match just started, before first question /* Put button to start playing match */ - Mch_PutBigButton (ActPlyPauMch,"play_pause",Match->MchCod, + Mch_PutBigButton (ActPlyPauMch,Match->MchCod, Mch_ICON_PLAY,Txt_Start); break; case Mch_END: // Match over @@ -2563,7 +2563,7 @@ static void Mch_PutMatchControlButtons (const struct Mch_Match *Match) break; default: /* Put button to resume match */ - Mch_PutBigButton (ActPlyPauMch,"play_pause",Match->MchCod, + Mch_PutBigButton (ActPlyPauMch,Match->MchCod, Mch_ICON_PLAY,Txt_Resume); } } @@ -2576,7 +2576,7 @@ static void Mch_PutMatchControlButtons (const struct Mch_Match *Match) Mch_PutBigButtonClose (); else // Match not over /* Put button to show answers */ - Mch_PutBigButton (ActFwdMch,"forward",Match->MchCod, + Mch_PutBigButton (ActFwdMch,Match->MchCod, Mch_ICON_NEXT,Txt_Go_forward); HTM_DIV_End (); @@ -3261,11 +3261,11 @@ static unsigned Mch_GetParamNumOpt (void) /*********************** Put a big button to do action ***********************/ /*****************************************************************************/ -static void Mch_PutBigButton (Act_Action_t NextAction,const char *Id, +static void Mch_PutBigButton (Act_Action_t NextAction, long MchCod,const char *Icon,const char *Txt) { /***** Begin form *****/ - Frm_BeginFormId (NextAction,Id); + Frm_BeginForm (NextAction); Mch_PutParamMchCod (MchCod); /***** Put icon with link *****/ diff --git a/swad_notification.c b/swad_notification.c index d321fa8c..d6ae9bc7 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -1682,7 +1682,7 @@ void Ntf_WriteNumberOfNewNtfs (void) NumNewNtfs = Ntf_DB_GetNumMyNewUnseenNtfs (); /***** Begin form *****/ - Frm_BeginFormId (ActSeeNewNtf,"form_ntf"); + Frm_BeginForm (ActSeeNewNtf); /***** Begin link *****/ HTM_BUTTON_Submit_Begin (Txt_See_notifications,"class=\"BT_LINK\""); diff --git a/swad_photo.c b/swad_photo.c index d197db0a..f3233f01 100644 --- a/swad_photo.c +++ b/swad_photo.c @@ -577,12 +577,13 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct Usr_Data *Us bool WrongType = false; char Command[256 + PATH_MAX]; // Command to call the program of preprocessing of photos int ReturnCode; - int NumLastForm = 0; // Initialized to avoid warning char FormId[32]; - unsigned NumFacesTotal = 0; - unsigned NumFacesGreen = 0; - unsigned NumFacesRed = 0; - unsigned NumFace; + struct + { + unsigned Green; + unsigned Red; + unsigned Total; + } NumFaces; unsigned X; unsigned Y; unsigned Radius; @@ -661,6 +662,7 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct Usr_Data *Us /***** Write message depending on return code *****/ ReturnCode = WEXITSTATUS(ReturnCode); + NumFaces.Green = NumFaces.Red = 0; switch (ReturnCode) { case 0: // Faces detected @@ -671,32 +673,29 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct Usr_Data *Us Err_ShowErrorAndExit ("Can not read text file with coordinates of detected faces."); /***** Read file with coordinates for image map and compute the number of faces *****/ - NumLastForm = Gbl.Form.Num; - while (!feof (FileTxtMap)) + while (!feof (FileTxtMap)) { if (fscanf (FileTxtMap,"%u %u %u %u %s\n",&X,&Y,&Radius,&BackgroundCode,StrFileName) != 5) // Example of StrFileName = "4924a838630e_016" break; if (BackgroundCode == 1) { - NumFacesGreen++; + snprintf (FormId,sizeof (FormId),"photo_%u",++NumFaces.Green); if (ItsMe) - Frm_BeginForm (ActUpdMyPho); + Frm_BeginFormId (ActUpdMyPho,FormId); else { - Frm_BeginForm (NextAction[Gbl.Usrs.Other.UsrDat.Roles.InCurrentCrs]); + Frm_BeginFormId (NextAction[Gbl.Usrs.Other.UsrDat.Roles.InCurrentCrs],FormId); Usr_PutParamUsrCodEncrypted (UsrDat->EnUsrCod); } Par_PutHiddenParamString (NULL,"FileName",StrFileName); Frm_EndForm (); } else - NumFacesRed++; + NumFaces.Red++; } - NumFacesTotal = NumFacesGreen + NumFacesRed; break; case 1: // No faces detected - NumFacesTotal = NumFacesGreen = NumFacesRed = 0; break; default: // Error snprintf (ErrorTxt,sizeof (ErrorTxt), @@ -706,53 +705,54 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct Usr_Data *Us Err_ShowErrorAndExit (ErrorTxt); break; } + NumFaces.Total = NumFaces.Green + NumFaces.Red; /***** Begin alert to the user about the number of faces detected in the image*****/ - if (NumFacesTotal == 0) + if (NumFaces.Total == 0) Ale_ShowAlertAndButton1 (Ale_WARNING,Txt_Could_not_detect_any_face_in_front_position_); - else if (NumFacesTotal == 1) + else if (NumFaces.Total == 1) { - if (NumFacesGreen == 1) + if (NumFaces.Green == 1) Ale_ShowAlertAndButton1 (Ale_SUCCESS,Txt_A_face_marked_in_green_has_been_detected_); else Ale_ShowAlertAndButton1 (Ale_WARNING,Txt_A_face_marked_in_red_has_been_detected_); } else // NumFacesTotal > 1 { - if (NumFacesRed == 0) + if (NumFaces.Red == 0) Ale_ShowAlertAndButton1 (Ale_SUCCESS,Txt_X_faces_marked_in_green_have_been_detected_, - NumFacesGreen); - else if (NumFacesGreen == 0) + NumFaces.Green); + else if (NumFaces.Green == 0) Ale_ShowAlertAndButton1 (Ale_WARNING,Txt_X_faces_marked_in_red_have_been_detected_, - NumFacesRed); - else // NumFacesGreen > 0 + NumFaces.Red); + else // NumFaces.Green > 0 { - if (NumFacesGreen == 1) + if (NumFaces.Green == 1) Ale_ShowAlertAndButton1 (Ale_SUCCESS,Txt_X_faces_have_been_detected_in_front_position_1_Z_, - NumFacesTotal,NumFacesRed); + NumFaces.Total,NumFaces.Red); else Ale_ShowAlertAndButton1 (Ale_SUCCESS,Txt_X_faces_have_been_detected_in_front_position_Y_Z_, - NumFacesTotal,NumFacesGreen,NumFacesRed); + NumFaces.Total,NumFaces.Green,NumFaces.Red); } } /***** Create map *****/ HTM_Txt ("\n"); - if (NumFacesTotal) + if (NumFaces.Total) { /***** Read again the file with coordinates and create area shapes *****/ rewind (FileTxtMap); - for (NumFace = 0; !feof (FileTxtMap);) + NumFaces.Green = 0; + while (!feof (FileTxtMap)) { if (fscanf (FileTxtMap,"%u %u %u %u %s\n",&X,&Y,&Radius,&BackgroundCode,StrFileName) != 5) break; if (BackgroundCode == 1) { - NumFace++; - snprintf (FormId,sizeof (FormId),"form_%d",NumLastForm + NumFace); + snprintf (FormId,sizeof (FormId),"photo_%u",++NumFaces.Green); HTM_TxtF ("\n", FormId,X,Y,Radius); } @@ -778,7 +778,7 @@ static bool Pho_ReceivePhotoAndDetectFaces (bool ItsMe,const struct Usr_Data *Us Btn_NO_BUTTON,NULL); /***** Button to send another photo *****/ - return (NumFacesGreen != 0); + return (NumFaces.Green != 0); } /*****************************************************************************/