]> arthur.barton.de Git - netdata.git/commitdiff
autodetect all demo sites
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Mon, 18 Apr 2016 08:11:12 +0000 (11:11 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Mon, 18 Apr 2016 08:11:12 +0000 (11:11 +0300)
web/index.html

index 4f6d259597e42c7b5eccf170ea40d97537e5e6aa..9da4f0e5ed745059b20318b78083110e9cd2379a 100644 (file)
 
 <script>
 
-var demo_hostname = 'netdata.firehol.org';
-// var demo_hostname = 'box';
+var this_is_demo = null;
+function isdemo() {
+       if(this_is_demo !== null) return this_is_demo;
+       this_is_demo = document.location.hostname.endsWith('.firehol.org');
+       return this_is_demo;
+}
 
-if(document.location.hostname === demo_hostname) {
+if(isdemo()) {
        document.getElementById('masthead').style.display = 'block';
 }
 
@@ -1840,7 +1844,7 @@ function finalizePage() {
        /* activate bootstrap sidebar (affix) */
        $('#sidebar').affix({
                offset: {
-                       top: (document.location.hostname === demo_hostname)?150:0,
+                       top: (isdemo())?150:0,
                        bottom: 0
                }
        });
@@ -1919,7 +1923,7 @@ function finalizePage() {
                        location.reload();
        });
 
-       if(document.location.hostname === demo_hostname) {
+       if(isdemo()) {
                setTimeout(function() {
                        $('#welcomeModal').modal();
                }, 1000);