summaryrefslogtreecommitdiff
path: root/webapp
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-06-27 19:03:37 +0200
committerOlivier Gayot <duskcoder@gmail.com>2015-06-27 19:09:23 +0200
commitabbbc8377b96de17960cfa0a5ff66ce247d4628e (patch)
tree92cd0f52da119239b5976135f1dfa7980676f89f /webapp
parent8e06063d55d16207eed11ceaeb6a5f32bf4e7b4c (diff)
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 <duskcoder@gmail.com>
Diffstat (limited to 'webapp')
-rw-r--r--webapp/cao-config.js4
1 files 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';
}