autodetect all demo sites
Costa Tsaousis (ktsaou) committed
Apr 18, 2016 at 11:11 UTC
b102fb3fd71a7750a8e53a7f55fcc1eea07e5a99
1 file changed
+9
-5
web/index.html
+9
-5
@@ -777,10 +777,14 @@
777
778
<script>
779
780
-var demo_hostname = 'netdata.firehol.org';
781
-// var demo_hostname = 'box';
780
+var this_is_demo = null;
781
+function isdemo() {
782
+ if(this_is_demo !== null) return this_is_demo;
783
+ this_is_demo = document.location.hostname.endsWith('.firehol.org');
784
+ return this_is_demo;
785
+}
786
783
-if(document.location.hostname === demo_hostname) {
787
+if(isdemo()) {
788
document.getElementById('masthead').style.display = 'block';
789
}
790
@@ -1840,7 +1844,7 @@ function finalizePage() {
1844
/* activate bootstrap sidebar (affix) */
1845
$('#sidebar').affix({
1846
offset: {
1843
- top: (document.location.hostname === demo_hostname)?150:0,
1847
+ top: (isdemo())?150:0,
1848
bottom: 0
1849
}
1850
});
@@ -1919,7 +1923,7 @@ function finalizePage() {
1923
location.reload();
1924
});
1925
1922
- if(document.location.hostname === demo_hostname) {
1926
+ if(isdemo()) {
1927
setTimeout(function() {
1928
$('#welcomeModal').modal();
1929
}, 1000);