From abbbc8377b96de17960cfa0a5ff66ce247d4628e Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sat, 27 Jun 2015 19:03:37 +0200 Subject: webapp: Fix error with safari the use of String.startsWith() is non standard and fails in safari. fixed by replacing it by String.substring() + comparison Signed-off-by: Olivier Gayot --- webapp/cao-config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/cao-config.js b/webapp/cao-config.js index 2082e3a..ddfe0fc 100644 --- a/webapp/cao-config.js +++ b/webapp/cao-config.js @@ -3,9 +3,9 @@ $(document).ready(function() { var hostname = document.location.hostname; /* XXX replace this with your desired behaviour */ - if (hostname.startsWith('fr.')) { + if (hostname.substring(0, 3) === 'fr.') { lang = 'fr'; - } else if (hostname.startsWith('en.')) { + } else if (hostname.substring(0, 3) === 'en.') { lang = 'en'; } -- cgit v1.2.3