Fossil SCM

Imported a 2-line polyfill for MSIE's missing NodeList.forEach, courtesy of the Mozilla docs.

stephan 2020-08-08 17:09 trunk
Commit 4dd270761d996e34cdd85acf2c60d75787b917791fa1ace510e31709eae29c62
1 file changed +8 -2
+8 -2
--- src/style.c
+++ src/style.c
@@ -1441,12 +1441,18 @@
14411441
/* Set up the generic/app-agnostic parts of window.fossil
14421442
** which require C-level state... */
14431443
if(addScriptTag!=0){
14441444
style_emit_script_tag(0,0);
14451445
}
1446
- CX("(function(){\n"
1447
- "if(!window.fossil) window.fossil={};\n"
1446
+ CX("(function(){\n");
1447
+ CX(/*MSIE NodeList.forEach polyfill, courtesy of Mozilla:
1448
+ https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach#Polyfill
1449
+ */
1450
+ "if(window.NodeList && !NodeList.prototype.forEach){"
1451
+ "NodeList.prototype.forEach = Array.prototype.forEach;"
1452
+ "}\n");
1453
+ CX("if(!window.fossil) window.fossil={};\n"
14481454
"window.fossil.version = %!j;\n"
14491455
/* fossil.rootPath is the top-most CGI/server path,
14501456
** including a trailing slash. */
14511457
"window.fossil.rootPath = %!j+'/';\n",
14521458
get_version(), g.zTop);
14531459
--- src/style.c
+++ src/style.c
@@ -1441,12 +1441,18 @@
1441 /* Set up the generic/app-agnostic parts of window.fossil
1442 ** which require C-level state... */
1443 if(addScriptTag!=0){
1444 style_emit_script_tag(0,0);
1445 }
1446 CX("(function(){\n"
1447 "if(!window.fossil) window.fossil={};\n"
 
 
 
 
 
 
1448 "window.fossil.version = %!j;\n"
1449 /* fossil.rootPath is the top-most CGI/server path,
1450 ** including a trailing slash. */
1451 "window.fossil.rootPath = %!j+'/';\n",
1452 get_version(), g.zTop);
1453
--- src/style.c
+++ src/style.c
@@ -1441,12 +1441,18 @@
1441 /* Set up the generic/app-agnostic parts of window.fossil
1442 ** which require C-level state... */
1443 if(addScriptTag!=0){
1444 style_emit_script_tag(0,0);
1445 }
1446 CX("(function(){\n");
1447 CX(/*MSIE NodeList.forEach polyfill, courtesy of Mozilla:
1448 https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach#Polyfill
1449 */
1450 "if(window.NodeList && !NodeList.prototype.forEach){"
1451 "NodeList.prototype.forEach = Array.prototype.forEach;"
1452 "}\n");
1453 CX("if(!window.fossil) window.fossil={};\n"
1454 "window.fossil.version = %!j;\n"
1455 /* fossil.rootPath is the top-most CGI/server path,
1456 ** including a trailing slash. */
1457 "window.fossil.rootPath = %!j+'/';\n",
1458 get_version(), g.zTop);
1459

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button