Version19.51.10

This commit is contained in:
Antonio Cañas Vargas 2019-11-04 10:03:37 +01:00
parent 6b4dfb737f
commit 8191ed5790
9 changed files with 19 additions and 21 deletions

View File

@ -897,6 +897,16 @@ void HTM_INPUT_URL (const char *Name,const char *Value,
fprintf (Gbl.F.Out," />");
}
void HTM_INPUT_FILE (const char *Accept,bool SubmitOnChange)
{
fprintf (Gbl.F.Out,"<input type=\"file\" name=\"%s\" accept=\"%s\"",
Fil_NAME_OF_PARAM_FILENAME_ORG,Accept);
if (SubmitOnChange)
fprintf (Gbl.F.Out," onchange=\"document.getElementById('%s').submit();\"",
Gbl.Form.Id);
fprintf (Gbl.F.Out," />");
}
/*****************************************************************************/
/********************************* Text areas ********************************/
/*****************************************************************************/

View File

@ -95,6 +95,7 @@ void HTM_INPUT_EMAIL (const char *Name,unsigned MaxLength,const char *Value,
const char *fmt,...);
void HTM_INPUT_URL (const char *Name,const char *Value,
const char *fmt,...);
void HTM_INPUT_FILE (const char *Accept,bool SubmitOnChange);
void HTM_TEXTAREA_Begin (const char *fmt,...);
void HTM_TEXTAREA_End (void);

View File

@ -2319,10 +2319,7 @@ void Ctr_RequestPhoto (void)
/***** Upload photo *****/
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:&nbsp;",Txt_File_with_the_photo);
fprintf (Gbl.F.Out,"<input type=\"file\" name=\"%s\" accept=\"image/*\""
" onchange=\"document.getElementById('%s').submit();\" />",
Fil_NAME_OF_PARAM_FILENAME_ORG,
Gbl.Form.Id);
HTM_INPUT_FILE ("image/*",true);
HTM_LABEL_End ();
/***** End box *****/

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.9 (2019-11-04)"
#define Log_PLATFORM_VERSION "SWAD 19.51.10 (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.10: Nov 04, 2019 Code refactoring in HTML inputs. (245971 lines)
Version 19.51.9: Nov 04, 2019 Code refactoring in HTML inputs. (245974 lines)
Version 19.51.8: Nov 04, 2019 Code refactoring in HTML inputs. (245968 lines)
Version 19.51.7: Nov 03, 2019 Code refactoring in HTML inputs. (246051 lines)

View File

@ -8435,8 +8435,7 @@ static void Brw_PutFormToUploadOneFileClassic (const char *FileNameToShow)
/***** Form to upload one files using the classic way *****/
Frm_StartForm (Brw_ActUploadFileClassic[Gbl.FileBrowser.Type]);
Brw_PutImplicitParamsFileBrowser ();
fprintf (Gbl.F.Out,"<input type=\"file\" name=\"%s\" />",
Fil_NAME_OF_PARAM_FILENAME_ORG);
HTM_INPUT_FILE ("*",false);
/* Button to send */
Btn_PutCreateButton (Txt_Upload_file);

View File

@ -1277,8 +1277,7 @@ void Inf_FormToSendPage (Inf_InfoSrc_t InfoSrc)
HTM_DIV_Begin ("class=\"CM\"");
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:&nbsp;",Txt_File);
fprintf (Gbl.F.Out,"<input type=\"file\" name=\"%s\" />",
Fil_NAME_OF_PARAM_FILENAME_ORG);
HTM_INPUT_FILE (".htm,.html,.pdf",false);
HTM_LABEL_End ();
HTM_DIV_End ();

View File

@ -315,10 +315,7 @@ void Log_RequestLogo (Hie_Level_t Scope)
/***** Upload logo *****/
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:&nbsp;",Txt_File_with_the_logo);
fprintf (Gbl.F.Out,"<input type=\"file\" name=\"%s\""
" onchange=\"document.getElementById('%s').submit();\" />",
Fil_NAME_OF_PARAM_FILENAME_ORG,
Gbl.Form.Id);
HTM_INPUT_FILE ("image/png",true);
HTM_LABEL_End ();
/***** End box *****/

View File

@ -337,10 +337,7 @@ static void Pho_ReqPhoto (const struct UsrData *UsrDat)
/***** Form to upload photo *****/
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:&nbsp;",Txt_File_with_the_photo);
fprintf (Gbl.F.Out,"<input type=\"file\" name=\"%s\" accept=\"image/*\""
" onchange=\"document.getElementById('%s').submit();\" />",
Fil_NAME_OF_PARAM_FILENAME_ORG,
Gbl.Form.Id);
HTM_INPUT_FILE ("image/*",true);
HTM_LABEL_End ();
/***** End form *****/

View File

@ -143,10 +143,7 @@ void TsI_ShowFormImportQstsFromXML (void)
Frm_StartForm (ActImpTstQst);
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:&nbsp;",Txt_XML_file);
fprintf (Gbl.F.Out,"<input type=\"file\" name=\"%s\" accept=\".xml\""
" onchange=\"document.getElementById('%s').submit();\" />",
Fil_NAME_OF_PARAM_FILENAME_ORG,
Gbl.Form.Id);
HTM_INPUT_FILE (".xml",true);
HTM_LABEL_End ();
Frm_EndForm ();