Version 15.241.1

This commit is contained in:
Antonio Cañas Vargas 2016-07-04 14:33:31 +02:00
parent d5088e4178
commit e9e522545e
7 changed files with 29 additions and 27 deletions

View File

@ -4596,7 +4596,7 @@ static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLoca
fprintf (Gbl.F.Out,"\" id=\"%s\"",Id);
if (OnSubmit)
if (OnSubmit[0])
fprintf (Gbl.F.Out," onsubmit=\"%s\"",OnSubmit);
fprintf (Gbl.F.Out," onsubmit=\"%s;\"",OnSubmit);
switch (Act_Actions[NextAction].BrowserWindow)
{
case Act_NEW_WINDOW:
@ -4675,9 +4675,9 @@ void Act_FormEnd (void)
// Requires an extern </a>
void Act_LinkFormSubmit (const char *Title,const char *LinkStyle,
const char *JSFunction)
const char *OnSubmit)
{
Act_LinkFormSubmitId (Title,LinkStyle,Gbl.Form.Id,JSFunction);
Act_LinkFormSubmitId (Title,LinkStyle,Gbl.Form.Id,OnSubmit);
}
void Act_LinkFormSubmitUnique (const char *Title,const char *LinkStyle)
@ -4688,10 +4688,10 @@ void Act_LinkFormSubmitUnique (const char *Title,const char *LinkStyle)
// Title can be NULL
// LinkStyle can be NULL
// Id can not be NULL
// JSFunction can be NULL
// OnSubmit can be NULL
void Act_LinkFormSubmitId (const char *Title,const char *LinkStyle,
const char *Id,const char *JSFunction)
const char *Id,const char *OnSubmit)
{
fprintf (Gbl.F.Out,"<a href=\"\"");
if (Title)
@ -4701,16 +4701,17 @@ void Act_LinkFormSubmitId (const char *Title,const char *LinkStyle,
if (LinkStyle[0])
fprintf (Gbl.F.Out," class=\"%s\"",LinkStyle);
fprintf (Gbl.F.Out," onclick=\"");
if (JSFunction) // JavaScript function to be called before submitting the form
if (JSFunction[0])
fprintf (Gbl.F.Out,"%s;",JSFunction);
if (OnSubmit) // JavaScript function to be called
// before submitting the form
if (OnSubmit[0])
fprintf (Gbl.F.Out,"%s;",OnSubmit);
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();"
"return false;\">",
Id);
}
void Act_LinkFormSubmitAnimated (const char *Title,const char *LinkStyle,
const char *JSFunction)
const char *OnSubmit)
{
fprintf (Gbl.F.Out,"<a href=\"\"");
if (Title)
@ -4720,9 +4721,10 @@ void Act_LinkFormSubmitAnimated (const char *Title,const char *LinkStyle,
if (LinkStyle[0])
fprintf (Gbl.F.Out," class=\"%s\"",LinkStyle);
fprintf (Gbl.F.Out," onclick=\"");
if (JSFunction) // JavaScript function to be called before submitting the form
if (JSFunction[0])
fprintf (Gbl.F.Out,"%s;",JSFunction);
if (OnSubmit) // JavaScript function to be called
// before submitting the form
if (OnSubmit[0])
fprintf (Gbl.F.Out,"%s;",OnSubmit);
fprintf (Gbl.F.Out,"AnimateIcon(%d);"
"document.getElementById('%s').submit();"
"return false;\">",

View File

@ -1506,12 +1506,12 @@ void Act_FormStartId (Act_Action_t NextAction,const char *Id);
void Act_SetParamsForm (char *ParamsStr,Act_Action_t NextAction,bool PutParameterLocationIfNoSesion);
void Act_FormEnd (void);
void Act_LinkFormSubmit (const char *Title,const char *LinkStyle,
const char *JSFunction);
const char *OnSubmit);
void Act_LinkFormSubmitUnique (const char *Title,const char *LinkStyle);
void Act_LinkFormSubmitId (const char *Title,const char *LinkStyle,
const char *Id,const char *JSFunction);
const char *Id,const char *OnSubmit);
void Act_LinkFormSubmitAnimated (const char *Title,const char *LinkStyle,
const char *JSFunction);
const char *OnSubmit);
void Act_SetUniqueId (char UniqueId[Act_MAX_LENGTH_ID]);

View File

@ -136,13 +136,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.241 (2016-07-04)"
#define Log_PLATFORM_VERSION "SWAD 15.241.1 (2016-07-04)"
#define CSS_FILE "swad15.229.css"
#define JS_FILE "swad15.238.1.js"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/*
Version 15.241.1: Jul 04, 2015 Code refactoring related with form submit. (203620 lines)
Version 15.241: Jul 04, 2015 When composing a new message, subject and content are shown even if list of users is too big, in order to keep messages that had begun to be written. (203618 lines)
Version 15.240.5: Jul 04, 2015 Code refactoring related to big lists of users. (203595 lines)
Version 15.240.4: Jul 04, 2015 Fixed bugs in web service, reported by Rubén Martín Hidalgo. (203592 lines)

View File

@ -286,8 +286,7 @@ static void Grp_ShowFormSeveralGrps (Act_Action_t NextAction)
" style=\"padding-top:12px;\">");
Act_LinkFormSubmitAnimated (Txt_Update_students_according_to_selected_groups,
The_ClassFormBold[Gbl.Prefs.Theme],
NextAction == ActReqMsgUsr ? "CopyMessageToHiddenFields()" :
NULL);
"CopyMessageToHiddenFields()");
Lay_PutCalculateIconWithText (Txt_Update_students_according_to_selected_groups,
Txt_Update_students);
fprintf (Gbl.F.Out,"</div>");

View File

@ -1008,7 +1008,7 @@ void Lay_PutContextualLink (Act_Action_t NextAction,
void (*FuncParams) (),
const char *Icon,
const char *Title,const char *Text,
const char *JSFunction)
const char *OnSubmit)
{
extern const char *The_ClassFormBold[The_NUM_THEMES];
@ -1022,7 +1022,7 @@ void Lay_PutContextualLink (Act_Action_t NextAction,
Lay_PutIconLink (Icon,Title,Text,
Text ? The_ClassFormBold[Gbl.Prefs.Theme] :
NULL,
JSFunction);
OnSubmit);
Act_FormEnd ();
if (Text)
@ -1035,9 +1035,9 @@ void Lay_PutContextualLink (Act_Action_t NextAction,
/*****************************************************************************/
void Lay_PutIconLink (const char *Icon,const char *Title,const char *Text,
const char *LinkStyle,const char *JSFunction)
const char *LinkStyle,const char *OnSubmit)
{
Act_LinkFormSubmit (Title,LinkStyle,JSFunction);
Act_LinkFormSubmit (Title,LinkStyle,OnSubmit);
Lay_PutIconWithText (Icon,Title,Text);
fprintf (Gbl.F.Out,"</a>");
}

View File

@ -75,9 +75,9 @@ void Lay_PutContextualLink (Act_Action_t NextAction,
void (*FuncParams) (),
const char *Icon,
const char *Title,const char *Text,
const char *JSFunction);
const char *OnSubmit);
void Lay_PutIconLink (const char *Icon,const char *Title,const char *Text,
const char *LinkStyle,const char *JSFunction);
const char *LinkStyle,const char *OnSubmit);
void Lay_PutIconWithText (const char *Icon,const char *Alt,const char *Text);
void Lay_PutCalculateIcon (const char *Alt);
void Lay_PutCalculateIconWithText (const char *Alt,const char *Text);

View File

@ -4910,9 +4910,9 @@ static void Usr_FormToSelectUsrListType (Act_Action_t NextAction,Usr_ShowUsrsTyp
Usr_PutParamUsrListType (ListType);
Usr_PutExtraParamsUsrList (NextAction);
Act_LinkFormSubmit (Txt_USR_LIST_TYPES[ListType],
The_ClassFormNoWrap[Gbl.Prefs.Theme],
NextAction == ActReqMsgUsr ? "CopyMessageToHiddenFields()" :
NULL);
The_ClassFormNoWrap[Gbl.Prefs.Theme],
NextAction == ActReqMsgUsr ? "CopyMessageToHiddenFields()" :
NULL);
fprintf (Gbl.F.Out,"<img src=\"%s/%s\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON20x20\" />"