var wsDomain = ''; if(!wsDomain){ wsDomain = document.domain; } wsPort = 8080; wsProtocol = 'ws'; wsPath = ''; var themes = { 'Amelia':'../common/css/amelia.css', 'Cerulean':'../common/css/cerulean.css', 'Cosmo':'../common/css/cosmo.css', 'Cyborg':'../common/css/cyborg.css', 'Flatly':'../common/css/flatly.css', 'Journal':'../common/css/journal.css', 'Readable':'../common/css/readable.css', 'Simplex':'../common/css/simplex.css', 'Slate':'../common/css/slate.css', 'Spacelab':'../common/css/spacelab.css', 'United':'../common/css/united.css', 'Yeti':'../common/css/yeti.css' }; var examples = { 'Simple Auth': 'simple', 'Facebook Auth': 'facebook', 'Wordpress': 'wordpress', 'Private rooms': 'private', 'Support': 'support', 'Group chat': 'group', 'Group private chat': 'private_group', 'Invite group': 'invite', 'Roulette mode': 'roulette', 'File transfer': 'file', 'Events API': 'api', 'Internationalization': 'i18n', 'Desktop sharing': 'desktop_capture', 'Turn server - saas': 'turnservers', 'Turn server - hosted': 'coturn' }; var forceHttpsDirs = ['desktop_capture']; var navTpl = ' \ '; $(document).ready(function(){ //check https var loc = window.location.pathname; var dir = loc.substring(loc.lastIndexOf('/') + 1); if(!dir){ loc = loc.substring(0, loc.length - 1); dir = loc.substring(loc.lastIndexOf('/') + 1); } var forceHttps = forceHttpsDirs.indexOf(dir) > -1; if (forceHttps && window.location.protocol != "https:"){ window.location.href = "https:" + window.location.href.substring(window.location.protocol.length); } //https traffic if(window.location.protocol == "https:"){ wsProtocol = 'wss'; wsPort = (window.location.port)? window.location.port: '443'; wsPath = '/wss/'; } wsUrlDefault = wsProtocol + '://' + wsDomain + ':' + wsPort + wsPath; var $menu = $(navTpl); $menu.find('a.navbar-brand').html($('h1').html()); $(".container").prepend($menu); $('h1').remove(); //render themes var themesHtml = ''; var defaultTheme = localStorage.exampleTheme; for(var theme in themes){ if(!defaultTheme){ defaultTheme = theme; } themesHtml += '