Skip to content

Commit ee414ca

Browse files
bigldlarshp
authored andcommitted
add ES6/arrow function check for powered by link
If arrow functions are not supported (like in abapGit in SAP GUI 4 Windows), remove the linke to dotabap.org
1 parent 35a8f1d commit ee414ca

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

explore.html

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
text-decoration: underline;
2020
}
2121

22+
a.disabled {
23+
text-decoration: none;
24+
color: inherit;
25+
}
26+
2227
div#header {
2328
display: block;
2429
margin-top: 0.5em;
@@ -94,14 +99,30 @@
9499
$('#content').html(items.join("<br><br>"));
95100

96101
});
102+
103+
if (!check4ArrowFunctions()){
104+
//dotabap.org needs full ES6 support
105+
$("#poweredby").removeAttr('href').addClass("disabled");
106+
}
107+
97108
}
109+
110+
function check4ArrowFunctions() {
111+
try {
112+
eval("var arrowFunction = (x) => x");
113+
}
114+
catch (e) {
115+
return false;
116+
}
117+
return true;
118+
}
98119
</script>
99120
</head>
100121

101122
<body onload="run()">
102123
<div id="header">
103124
<h1>Explore</h1>&nbsp;Powered by
104-
<a href="http://dotabap.org">dotabap.org</a>
125+
<a href="http://dotabap.org" id="poweredby">dotabap.org</a>
105126
</div>
106127
<div id="toc">
107128
<div id="content"></div>
@@ -111,4 +132,4 @@ <h1>Explore</h1>&nbsp;Powered by
111132
</div>
112133
</body>
113134

114-
</html>
135+
</html>

0 commit comments

Comments
 (0)