diff --git a/swad_HTML.c b/swad_HTML.c index 1f3ec504..465dd09a 100644 --- a/swad_HTML.c +++ b/swad_HTML.c @@ -69,6 +69,7 @@ static unsigned HTM_DD_NestingLevel = 0; static unsigned HTM_A_NestingLevel = 0; static unsigned HTM_SCRIPT_NestingLevel = 0; static unsigned HTM_LABEL_NestingLevel = 0; +static unsigned HTM_BUTTON_NestingLevel = 0; static unsigned HTM_TEXTAREA_NestingLevel = 0; static unsigned HTM_SELECT_NestingLevel = 0; @@ -1215,6 +1216,27 @@ void HTM_INPUT_CHECKBOX (const char *Name,bool SubmitOnChange, fprintf (Gbl.F.Out," />"); } +/*****************************************************************************/ +/********************************** Buttons **********************************/ +/*****************************************************************************/ + +void HTM_BUTTON_Begin (const char *Class) + { + fprintf (Gbl.F.Out,""); + + HTM_BUTTON_NestingLevel--; + } + /*****************************************************************************/ /********************************* Text areas ********************************/ /*****************************************************************************/ diff --git a/swad_HTML.h b/swad_HTML.h index d791fdef..ba2af2a4 100644 --- a/swad_HTML.h +++ b/swad_HTML.h @@ -127,6 +127,9 @@ void HTM_INPUT_RADIO (const char *Name,bool SubmitOnClick, void HTM_INPUT_CHECKBOX (const char *Name,bool SubmitOnChange, const char *fmt,...); +void HTM_BUTTON_Begin (const char *Class); +void HTM_BUTTON_End (void); + void HTM_TEXTAREA_Begin (const char *fmt,...); void HTM_TEXTAREA_End (void); diff --git a/swad_button.c b/swad_button.c index f7a023a3..f17ecb36 100644 --- a/swad_button.c +++ b/swad_button.c @@ -100,53 +100,47 @@ void Btn_PutButtonInline (Btn_Button_t Button,const char *TxtButton) void Btn_PutCreateButton (const char *TxtButton) { HTM_DIV_Begin ("class=\"CM\""); - fprintf (Gbl.F.Out,"", - TxtButton); + HTM_BUTTON_Begin ("BT_SUBMIT BT_CREATE"); + fprintf (Gbl.F.Out,"%s",TxtButton); + HTM_BUTTON_End (); HTM_DIV_End (); } void Btn_PutCreateButtonInline (const char *TxtButton) { - fprintf (Gbl.F.Out,"", - TxtButton); + HTM_BUTTON_Begin ("BT_SUBMIT_INLINE BT_CREATE"); + fprintf (Gbl.F.Out,"%s",TxtButton); + HTM_BUTTON_End (); } void Btn_PutConfirmButton (const char *TxtButton) { HTM_DIV_Begin ("class=\"CM\""); - fprintf (Gbl.F.Out,"", - TxtButton); + HTM_BUTTON_Begin ("BT_SUBMIT BT_CONFIRM"); + fprintf (Gbl.F.Out,"%s",TxtButton); + HTM_BUTTON_End (); HTM_DIV_End (); } void Btn_PutConfirmButtonInline (const char *TxtButton) { - fprintf (Gbl.F.Out,"", - TxtButton); + HTM_BUTTON_Begin ("BT_SUBMIT_INLINE BT_CONFIRM"); + fprintf (Gbl.F.Out,"%s",TxtButton); + HTM_BUTTON_End (); } void Btn_PutRemoveButton (const char *TxtButton) { HTM_DIV_Begin ("class=\"CM\""); - fprintf (Gbl.F.Out,"", - TxtButton); + HTM_BUTTON_Begin ("BT_SUBMIT BT_REMOVE"); + fprintf (Gbl.F.Out,"%s",TxtButton); + HTM_BUTTON_End (); HTM_DIV_End (); } void Btn_PutRemoveButtonInline (const char *TxtButton) { - fprintf (Gbl.F.Out,"", - TxtButton); + HTM_BUTTON_Begin ("BT_SUBMIT_INLINE BT_REMOVE"); + fprintf (Gbl.F.Out,"%s",TxtButton); + HTM_BUTTON_End (); } diff --git a/swad_changelog.h b/swad_changelog.h index e7e4d51d..a9a5d986 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -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.57 (2019-11-09)" +#define Log_PLATFORM_VERSION "SWAD 19.58 (2019-11-09)" #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.58: Nov 09, 2019 Code refactoring in HTML definition lists. (246169 lines) Version 19.57: Nov 09, 2019 Code refactoring in HTML definition lists. (246156 lines) Version 19.56: Nov 08, 2019 Fixed bug in groups. New constants for sizes of numerical strings. (246104 lines)