/*
In case of change in this file, don't remember to increase version in index.ejs:
domSpecInit.js?version=xy
 */
self.favicon = 'favicon-flea.ico';
self.manifest = 'manifest-flea.json';
self.logo = 'splash-flexim.svg';

//production
if (document.domain === 'flexim.cz' || document.domain === 'www.flexim.cz') {
  self.uaKey = 'UA-134841498-1';
}

//trunk
else if (document.domain === 'trunk.flexim.cz' || document.domain === 'vypni.flea.cz') {
  self.uaKey = 'UA-120019796-1';
}

//maddeo - no GA yet
else if (document.domain === 'online.maddeo.cz') {
  //self.uaKey = "UA-XXX";  //TODO fill right key
  self.style = 'maddeo';
  self.logo = 'logo-maddeo.png';
}

//ceznet
else if (document.domain === 'flexim.ceznet.cz' || document.domain === 'ceznet.flexim.cz') {
  //self.uaKey = "UA-XXX";  //TODO fill right key
  self.favicon = 'favicon-cez.ico';
  self.manifest = 'manifest-cez.json';
  self.bgLogoStyle = { maxWidth: '40%', maxHeight: '40%' };
  self.style = 'ceznet';
  self.logo = 'logo-cez.svg';
}

//bolka
else if (
  document.domain === 'bolka.flexim.cz' //|| document.domain === "dev.flexim.cz"
) {
  //self.uaKey = "UA-XXX";  //TODO fill right key
  self.bgLogoStyle = { maxWidth: '60%', height: 'auto', minHeight: 'auto' };
  self.style = 'bolka';
  self.logo = 'logo-bolka.png';
}

//emil
else if (
  document.domain === 'emil.flexim.cz' //|| document.domain === "dev.flexim.cz"
) {
  //self.uaKey = "UA-XXX";  //TODO fill right key
  self.bgLogoStyle = { maxWidth: '60%', height: 'auto', minHeight: 'auto' };
  self.style = 'emil';
  self.logo = 'logo-emil.svg';
}

//localhost
else if (document.domain === '127.0.0.1' || document.domain === 'dev.flexim.cz') {
  self.uaKey = 'UA-119949262-1';
}

// TODO remove this
// !!! TEST ONLY !!!
// self.bgLogoStyle = { maxWidth: '60%', height: 'auto', minHeight: 'auto' };
// self.style = 'emil';
// self.logo = 'logo-emil.svg';
//////////////////

document.images.splash.src = self.logo;

//favicon
let link = document.createElement('link');
link.rel = 'shortcut icon';
link.href = self.favicon;
document.getElementsByTagName('head')[0].appendChild(link);

//manifest.json
link = document.createElement('link');
link.rel = 'manifest';
link.href = self.manifest;
document.getElementsByTagName('head')[0].appendChild(link);
