function sourceChange() { document.querySelector('.head__actions').insertAdjacentHTML( 'beforeend', `
` ); document.querySelector('.source-btn').addEventListener('click', function() { if (Lampa.Platform.is('apple_tv')) window.location.assign('exit://exit'); if (Lampa.Platform.is("tizen")) tizen.application.getCurrentApplication().exit(); if (Lampa.Platform.is("webos")) window.close(); if (Lampa.Platform.is("android")) Lampa.Android.exit(); if (Lampa.Platform.is("orsay")) Lampa.Orsay.exit(); if (Lampa.Platform.is("nw")) nw.Window.get().close(); }); document.querySelector('.source-btn').addEventListener('touchend', function() { if (Lampa.Platform.is('apple_tv')) window.location.assign('exit://exit'); if (Lampa.Platform.is("tizen")) tizen.application.getCurrentApplication().exit(); if (Lampa.Platform.is("webos")) window.close(); if (Lampa.Platform.is("android")) Lampa.Android.exit(); if (Lampa.Platform.is("orsay")) Lampa.Orsay.exit(); if (Lampa.Platform.is("nw")) nw.Window.get().close(); }); document.querySelector('.source-btn').addEventListener('keydown', function(event) { if (event.key === 'Enter') { if (Lampa.Platform.is('apple_tv')) window.location.assign('exit://exit'); if (Lampa.Platform.is("tizen")) tizen.application.getCurrentApplication().exit(); if (Lampa.Platform.is("webos")) window.close(); if (Lampa.Platform.is("android")) Lampa.Android.exit(); if (Lampa.Platform.is("orsay")) Lampa.Orsay.exit(); if (Lampa.Platform.is("nw")) nw.Window.get().close(); } }); } if (window.appready) start(); else { Lampa.Listener.follow('app', function(e) { if (e.type == 'ready') { sourceChange(); } }); }