Skip to content

Commit

Permalink
[TASK] replace double slash in header JS code to avoid getting error …
Browse files Browse the repository at this point in the history
…in case when html is minified to one line. (#363)
  • Loading branch information
anjeylink authored and MattiasNilsson committed Dec 5, 2017
1 parent 25c25bd commit b2abcf7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Configuration/TypoScript/Library/page.headerData.setupts
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@ page.headerData.187 = TEXT
page.headerData.187.value (
<!-- Scripts -->
<script>
// touchSupport
/*touchSupport*/
touchSupport = (('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0));
if (!touchSupport) {
document.documentElement.className += " no-touch";
}
else{
document.documentElement.className += " touch";
}
// IE version
/*IE version*/
var uA = window.navigator.userAgent;
var msie = uA.indexOf('MSIE ');
var trident = uA.indexOf('Trident/');
var ie;
function detectIE () {
if (msie > 0) {
// IE 10 or older => return version number
/*IE 10 or older => return version number*/
ie = 'ie' + parseInt(uA.substring(msie + 5, uA.indexOf('.', msie)), 10);
return ie;
}
if (trident > 0) {
// IE 11 (or newer) => return version number
/*IE 11 (or newer) => return version number*/
var rv = uA.indexOf('rv:');
ie = 'ie' + parseInt(uA.substring(rv + 3, uA.indexOf('.', rv)), 10);
return ie;
Expand Down Expand Up @@ -80,8 +80,8 @@ page.headerData.187.value (
while(iDevices.length) {
if (navigator.platform === iDevices.pop()) {
isIOS = true;
// In case if should be in DOM
// for now can be omitted - no styles by default attached to this class name ' iOS'
/*In case if should be in DOM
for now can be omitted - no styles by default attached to this class name ' iOS'*/
document.documentElement.className += " iOS";
}
}
Expand All @@ -94,8 +94,8 @@ page.headerData.187.value (
function detectAndroid() {
if (android > 0) {
isAndroid = true;
// In case if should be in DOM
// for now can be omitted - no styles by default attached to this class name ' android'
/*In case if should be in DOM
for now can be omitted - no styles by default attached to this class name ' android'*/
document.documentElement.className += " android";
}
}
Expand Down

0 comments on commit b2abcf7

Please sign in to comment.