Version19.51.14

This commit is contained in:
Antonio Cañas Vargas 2019-11-04 13:40:33 +01:00
parent 6f2ad51092
commit 84fa9da87b
6 changed files with 38 additions and 43 deletions

View File

@ -929,6 +929,23 @@ void HTM_INPUT_IMAGE (const char *ImgFile,const char *Title,const char *Class)
Title,Title,Class);
}
void HTM_INPUT_PASSWORD (const char *Name,const char *PlaceHolder,
const char *AutoComplete,bool Required)
{
fprintf (Gbl.F.Out,"<input type=\"password\" id=\"%s\" name=\"%s\""
" size=\"18\" maxlength=\"%u\"",
Name,Name,Pwd_MIN_CHARS_PLAIN_PASSWORD);
if (PlaceHolder)
if (PlaceHolder[0])
fprintf (Gbl.F.Out," placeholder=\"%s\"",PlaceHolder);
if (AutoComplete)
if (AutoComplete[0])
fprintf (Gbl.F.Out," autocomplete=\"%s\"",AutoComplete);
if (Required)
fprintf (Gbl.F.Out," required=\"required\"");
fprintf (Gbl.F.Out," />");
}
/*****************************************************************************/
/********************************* Text areas ********************************/
/*****************************************************************************/

View File

@ -98,6 +98,8 @@ void HTM_INPUT_URL (const char *Name,const char *Value,bool SubmitOnChange,
void HTM_INPUT_FILE (const char *Accept,bool SubmitOnChange);
void HTM_INPUT_BUTTON (const char *Name,const char *Value,const char *Attr);
void HTM_INPUT_IMAGE (const char *ImgFile,const char *Title,const char *Class);
void HTM_INPUT_PASSWORD (const char *Name,const char *PlaceHolder,
const char *AutoComplete,bool Required);
void HTM_TEXTAREA_Begin (const char *fmt,...);
void HTM_TEXTAREA_End (void);

View File

@ -487,7 +487,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.51.13 (2019-11-04)"
#define Log_PLATFORM_VERSION "SWAD 19.51.14 (2019-11-04)"
#define CSS_FILE "swad19.47.css"
#define JS_FILE "swad19.39.js"
/*
@ -495,6 +495,7 @@ ps2pdf source.ps destination.pdf
// TODO: Impedir la creación y edición de proyectos si no son editables.
// TODO: Importante: filtrar proyectos por usuarios (igual que en trabajos o en asistencia)
Version 19.51.14: Nov 04, 2019 Code refactoring in HTML inputs. (245868 lines)
Version 19.51.13: Nov 04, 2019 Code refactoring in HTML inputs. (245874 lines)
Version 19.51.12: Nov 04, 2019 Code refactoring in HTML inputs. (245873 lines)
Version 19.51.11: Nov 04, 2019 Code refactoring in HTML inputs. (245868 lines)

View File

@ -691,11 +691,7 @@ void Pwd_ShowFormChgMyPwd (void)
HTM_TD_End ();
HTM_TD_Begin ("class=\"REC_C2_BOT LM\"");
fprintf (Gbl.F.Out,"<input type=\"password\""
" id=\"UsrPwd\" name=\"UsrPwd\""
" size=\"18\" maxlength=\"%u\""
" autocomplete=\"off\" required=\"required\" />",
Pwd_MAX_CHARS_PLAIN_PASSWORD);
HTM_INPUT_PASSWORD ("UsrPwd",NULL,"off",true);
HTM_TD_End ();
HTM_TR_End ();
@ -745,12 +741,7 @@ void Pwd_PutFormToGetNewPasswordOnce (void)
/***** Input ****/
HTM_TD_Begin ("class=\"LM\"");
fprintf (Gbl.F.Out,"<input type=\"password\" id=\"Passwd\" name=\"Paswd\""
" size=\"18\" maxlength=\"%u\" placeholder=\"",
Pwd_MAX_CHARS_PLAIN_PASSWORD);
fprintf (Gbl.F.Out,Txt_HELP_password,
Pwd_MIN_CHARS_PLAIN_PASSWORD);
fprintf (Gbl.F.Out,"\" required=\"required\" />");
HTM_INPUT_PASSWORD ("Passwd",Txt_HELP_password,NULL,true);
HTM_TD_End ();
HTM_TR_End ();
@ -764,8 +755,8 @@ void Pwd_PutFormToGetNewPasswordTwice (void)
{
extern const char *The_ClassFormInBox[The_NUM_THEMES];
extern const char *Txt_New_password;
extern const char *Txt_HELP_password;
extern const char *Txt_Retype_new_password;
extern const char *Txt_HELP_password;
/***** 1st password *****/
/* Begin form element */
@ -780,12 +771,7 @@ void Pwd_PutFormToGetNewPasswordTwice (void)
/* Input */
HTM_TD_Begin ("class=\"REC_C2_BOT LM\"");
fprintf (Gbl.F.Out,"<input type=\"password\" id=\"Paswd1\" name=\"Paswd1\""
" size=\"18\" maxlength=\"%u\""
" placeholder=\"",
Pwd_MAX_CHARS_PLAIN_PASSWORD);
fprintf (Gbl.F.Out,Txt_HELP_password,Pwd_MIN_CHARS_PLAIN_PASSWORD);
fprintf (Gbl.F.Out,"\" required=\"required\" />");
HTM_INPUT_PASSWORD ("Paswd1",Txt_HELP_password,NULL,true);
HTM_TD_End ();
HTM_TR_End ();
@ -803,12 +789,7 @@ void Pwd_PutFormToGetNewPasswordTwice (void)
/* Input */
HTM_TD_Begin ("class=\"REC_C2_BOT LM\"");
fprintf (Gbl.F.Out,"<input type=\"password\" id=\"Paswd2\" name=\"Paswd2\""
" size=\"18\" maxlength=\"%u\""
" placeholder=\"",
Pwd_MAX_CHARS_PLAIN_PASSWORD);
fprintf (Gbl.F.Out,Txt_HELP_password,Pwd_MIN_CHARS_PLAIN_PASSWORD);
fprintf (Gbl.F.Out,"\" required=\"required\" />");
HTM_INPUT_PASSWORD ("Paswd2",Txt_HELP_password,NULL,true);
HTM_TD_End ();
HTM_TR_End ();
@ -891,10 +872,7 @@ void Pwd_AskForConfirmationOnDangerousAction (void)
/***** Password *****/
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:&nbsp;",Txt_For_security_enter_your_password);
fprintf (Gbl.F.Out,"<input type=\"password\" name=\"OthUsrPwd\""
" size=\"16\" maxlength=\"%u\""
" autocomplete=\"off\" required=\"required\" />",
Pwd_MAX_CHARS_PLAIN_PASSWORD);
HTM_INPUT_PASSWORD ("OthUsrPwd",NULL,"off",true);
HTM_LABEL_End ();
HTM_DIV_End ();

View File

@ -14372,25 +14372,25 @@ const char *Txt_HELP_nickname =
"Exemplo: @silva";
#endif
const char *Txt_HELP_password = // Warning: it is very important to include %u in the following sentences
const char *Txt_HELP_password =
#if L==1 // ca
"%u o m&eacute;s car&agrave;cters";
"8 o m&eacute;s car&agrave;cters";
#elif L==2 // de
"%u oder mehr Zeichen";
"8 oder mehr Zeichen";
#elif L==3 // en
"%u or more characters";
"8 or more characters";
#elif L==4 // es
"%u o m&aacute;s caracteres";
"8 o m&aacute;s caracteres";
#elif L==5 // fr
"%u ou plusieurs caract&egrave;res";
"8 ou plusieurs caract&egrave;res";
#elif L==6 // gn
"%u o m&aacute;s caracteres"; // Okoteve traducción
"8 o m&aacute;s caracteres"; // Okoteve traducción
#elif L==7 // it
"%u o pi&ugrave; caratteri";
"8 o pi&ugrave; caratteri";
#elif L==8 // pl
"%u lub wi&eogon;cej znak&oacute;w";
"8 lub wi&eogon;cej znak&oacute;w";
#elif L==9 // pt
"%u ou mais caracteres";
"8 ou mais caracteres";
#endif
const char *Txt_Hidden_MALE_PLURAL =

View File

@ -2621,10 +2621,7 @@ void Usr_WriteFormLogin (Act_Action_t NextAction,void (*FuncParams) (void))
HTM_LABEL_Begin ("for=\"UsrPwd\"");
Ico_PutIcon ("key.svg",Txt_Password,"CONTEXT_ICO_16x16");
HTM_LABEL_End ();
fprintf (Gbl.F.Out,"<input type=\"password\" id=\"UsrPwd\" name=\"UsrPwd\""
" size=\"18\" maxlength=\"%u\" placeholder=\"%s\" />",
Pwd_MAX_CHARS_PLAIN_PASSWORD,
Txt_password);
HTM_INPUT_PASSWORD ("UsrPwd",Txt_password,NULL,false);
HTM_DIV_End ();
/***** End table, send button and end box *****/