diff --git a/js/swad19.90.js b/js/swad19.91.js
similarity index 97%
rename from js/swad19.90.js
rename to js/swad19.91.js
index c276e21af..10cf49d5a 100644
--- a/js/swad19.90.js
+++ b/js/swad19.91.js
@@ -572,9 +572,9 @@ function readMatchStdData () {
if (objXMLHttpReqMchStd.status == 200) {
var htmlMatch = objXMLHttpReqMchStd.responseText; // Get HTML code
- var divMatch = document.getElementById('match'); // Access to refreshable DIV
- if (divMatch)
- divMatch.innerHTML = htmlMatch; // Update refreshable DIV
+ var div = document.getElementById('match'); // Access to refreshable DIV
+ if (div)
+ div.innerHTML = htmlMatch; // Update DIV content
// Global delay variable is set initially in swad-core
setTimeout('refreshMatchStd()',delayMatch);
}
@@ -608,15 +608,50 @@ function readMatchTchData () {
var Id = objXMLHttpReqMchTch.responseText.substring(0,endOfId); // Get Id
var htmlMatch = objXMLHttpReqMchTch.responseText.substring(endOfId + 1); // Get HTML code
- var divMatch = document.getElementById(Id); // Access to refreshable DIV
- if (divMatch)
- divMatch.innerHTML = htmlMatch; // Update refreshable DIV
+ var div = document.getElementById(Id); // Access to refreshable DIV
+ if (div) {
+ div.innerHTML = htmlMatch; // Update DIV content
+
+ // Scripts in div got via AJAX are not executed ==> execute them
+ evalScriptsInElem (div);
+
+ // Process mathematics; see http://docs.mathjax.org/en/latest/advanced/typeset.html
+ MathJax.Hub.Queue(["Typeset",MathJax.Hub,div]);
+ }
+
// Global delay variable is set initially in swad-core
setTimeout('refreshMatchTch()',delayMatch);
}
}
}
+/*****************************************************************************/
+/****************** Update match control area using AJAX *********************/
+/*****************************************************************************/
+
+// This function is called when user submit a form inside two parent divs
+function updateMatchTch (id,Params) {
+ var objXMLHttp = false;
+
+ objXMLHttp = AJAXCreateObject ();
+ if (objXMLHttp) {
+ /* Send request to server */
+ objXMLHttp.onreadystatechange = function() { // onreadystatechange must be lowercase
+ if (objXMLHttp.readyState == 4) { // Check if data have been received
+ if (objXMLHttp.status == 200)
+ if (id) {
+ var div = document.getElementById(id); // Access to DIV
+ if (div)
+ div.innerHTML = objXMLHttp.responseText; // Update DIV content
+ }
+ }
+ };
+ objXMLHttp.open('POST',ActionAJAX,true);
+ objXMLHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ objXMLHttp.send(Params);
+ }
+}
+
/*****************************************************************************/
/**************** Automatic refresh of last clicks using AJAX ****************/
/*****************************************************************************/
diff --git a/swad_HTML.c b/swad_HTML.c
index 08a5d81f8..7216191e5 100644
--- a/swad_HTML.c
+++ b/swad_HTML.c
@@ -106,6 +106,8 @@ static void HTM_TEXTAREA_BeginWithoutAttr (void);
static void HTM_SELECT_BeginWithoutAttr (void);
+static void HTM_SPTxt (const char *Txt);
+
/*****************************************************************************/
/******************************* Start/end table *****************************/
/*****************************************************************************/
@@ -127,7 +129,7 @@ void HTM_TABLE_Begin (const char *fmt,...)
Lay_NotEnoughMemoryExit ();
/***** Print HTML *****/
- fprintf (Gbl.F.Out,"
");
}
void HTM_DIV_End (void)
@@ -508,7 +510,7 @@ void HTM_DIV_End (void)
if (HTM_DIV_NestingLevel == 0) // No DIV open
Ale_ShowAlert (Ale_ERROR,"Trying to close unopened DIV.");
- fprintf (Gbl.F.Out,"
");
}
void HTM_UL_End (void)
@@ -665,7 +667,7 @@ void HTM_UL_End (void)
if (HTM_UL_NestingLevel == 0) // No UL open
Ale_ShowAlert (Ale_ERROR,"Trying to close unopened UL.");
- fprintf (Gbl.F.Out,"
");
}
void HTM_LI_End (void)
@@ -714,7 +716,7 @@ void HTM_LI_End (void)
if (HTM_LI_NestingLevel == 0) // No LI open
Ale_ShowAlert (Ale_ERROR,"Trying to close unopened LI.");
- fprintf (Gbl.F.Out,"