Comparing version 1.0.9 to 1.1.0
@@ -1,2 +0,2 @@ | ||
/*! mag-core: v1.0.9 (webpack: v1.12.14) */ | ||
!function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";window.host=!!window.gSTB,n(14),n(22),window.addEventListener("unload",function(){window.stbPlayerManager?stbPlayerManager.list.forEach(function(t){t.stop(),t.setViewport({x:0,y:0,width:screen.width,height:screen.height})}):gSTB.Stop()}),n(16)},function(t,e,n){"use strict";function i(t){o.call(this,t)}var o=n(3),s=n(2),a=n(5),r={coreList:[],windowList:[],windowToCoreMap:{},core:{},getInstance:function(t){var e,n=this.windowList.indexOf(t);return-1===n?(e=new i,e.plugins={},e.theme.path=s.data.themes[Object.keys(s.data.themes)[0]],Object.defineProperty(e,"index",{value:r.coreList.push(e)-1,configurable:!1,enumerable:!1,writable:!1}),this.windowToCoreMap[this.windowList.push(t)-1]=e.index):e=this.coreList[this.windowToCoreMap[n]],e},destroy:function(t){var e=this.windowList.indexOf(t);return-1!==e?(this.coreList.splice(this.windowToCoreMap[e],1),this.windowToCoreMap[this.windowToCoreMap[e]]=void 0,this.windowList.splice(e,1),!0):!1}},c=null,p=gSTB.GetEnv(JSON.stringify({varList:["language","upnp_conf","hdmi_event_delay","ssaverDelay","ssaverName","playerClock","defaultLedLevel","standbyLedLevel","standByMode","controlModel"]}));try{p=JSON.parse(p),p=p.result}catch(d){p={}}i.prototype=Object.create(o.prototype),i.prototype.constructor=i,i.prototype.theme={path:null},i.prototype.state=null,i.prototype.environment={onFocusDebounceTimeout:300,onInputDebounceTimeout:300,language:p.language||"en",upnp_conf:p.upnp_conf,hdmi_event_delay:p.hdmi_event_delay,ssaverDelay:p.ssaverDelay,ssaverName:p.ssaverName,playerClock:p.playerClock,defaultLedLevel:p.defaultLedLevel,standbyLedLevel:p.standbyLedLevel,standByMode:p.standByMode,controlModel:p.controlModel},i.prototype.onInputDebounceTimeout=300,i.prototype.intent=function(t,e){var i,o,r,p=this,d=a.create(t,e);if(t&&t.action)if(i=a.route(d,this),null!==i.runConfig){if(null===c&&(c=n(4)),i.runConfig.pid)for(o=0,r=s.data.apps.length;r>o;){if(s.data.apps[o].url===i.runConfig.url){i.runConfig=s.data.apps[o]=JSON.parse(JSON.stringify(s.data.apps[o]));break}++o}c.runApp({config:i.runConfig,visible:!0,onready:function(){a.route(d,p)}})}else i.handlerList.length>1;return d},window.extendCorePrototype=function(t,e){i.prototype[t]=e},window.addIntentHook=function(t,e){a.addHook(t,e)},t.exports=r},function(t,e,n){"use strict";function i(t,e){var n,o;for(n in e)e.hasOwnProperty(n)&&("Array"===e[n].constructor.name?(o=[],t[n]=e[n].concat(t[n]),t[n].forEach(function(t){var e=!0;o.forEach(function(n){n.name===t.name&&(e=!1)}),e&&o.push(t)}),t[n]=o):"object"==typeof e[n]?i(t[n],e[n]):t[n]=e[n])}t.exports={systemSettings:{},settings:{},environment:{},data:{},load:function(t,e){var n,o=this,s=new XMLHttpRequest;n=t.config||"config.json",s.onload=function(){var n=!1;try{o.data=JSON.parse(s.responseText)}catch(a){n=!0}t.extend?(s.onload=function(){var t=!1,n={};try{n=JSON.parse(s.responseText)}catch(a){t=!0}i(o.data,n),e(t,o.data)},s.open("GET",t.extend,!0),s.send(null)):e(n,o.data)},s.open("GET",n,!0),s.send(null)}}},function(t,e,n){"use strict";function i(){this.events={}}i.prototype={addListener:function(t,e){this.events[t]=this.events[t]||[],this.events[t].push(e)},once:function(t,e){var n=this;this.events[t]=this.events[t]||[],this.events[t].push(function i(){e.apply(n,arguments),n.removeListener(t,i)})},addListeners:function(t){var e;for(e in t)t.hasOwnProperty(e)&&this.addListener(e,t[e])},removeListener:function(t,e){this.events[t]&&(this.events[t]=this.events[t].filter(function(t){return t!==e}),0===this.events[t].length&&(this.events[t]=void 0))},emit:function(t){var e,n=this.events[t];if(n)for(e=0;e<n.length;e++)n[e].apply(this,Array.prototype.slice.call(arguments,1))}},i.prototype.constructor=i,t.exports=i},function(t,e,n){"use strict";var i=null,o=n(21),s=n(18),a=n(17),r=n(7),c=n(2),p=null,d=null,l={topApp:null,stack:[],runHistory:[],apps:{},launcher:null,splashActive:!1,show:function(t,e){var n,o=t.config.type;if(this.topApp!==t)switch(o){case"app":this.launcher.$iframe.style.visibility="hidden",i.style.zIndex=window.frames.length;case"system":"system"===o&&(i.style.zIndex=0,t.$iframe.style.zIndex=window.frames.length),n=this.stack.indexOf(t),-1!==n&&this.stack.splice(n,1),this.stack.push(t),this.topApp&&this.topApp!==t&&("function"==typeof this.topApp.core.emit&&this.topApp.core.emit(e?"hide:auto":"hide"),this.topApp.$iframe.style.visibility="hidden"),this.topApp=t,t.$iframe.contentWindow.focus(),t.$iframe.style.visibility="visible",t.core&&"function"==typeof t.core.emit&&t.core.emit("show");break;default:t.$iframe.contentWindow.focus(),t.$iframe.style.visibility="visible"}},hide:function(t,e){var n=t.config.type;switch(t.$iframe.style.visibility="hidden",t.core&&"function"==typeof t.core.emit&&t.core.emit(e?"hide:auto":"hide"),n){case"app":case"system":this.topApp===t&&(this.topApp=null),this.stack.pop(),this.stack.length>0?this.show(this.stack.pop()):this.show(this.launcher)}},close:function(t,e){var o,s,a=c.data.apps.length,r=0;if(null===p&&(p=n(1),d=n(5)),"undefined"==typeof t)e||this.show(this.launcher);else if("app"===t.config.type){for(t===this.topApp?(this.topApp=null,this.stack.pop()):(o=this.stack.indexOf(t),this.stack.splice(o,1)),t.core&&"function"==typeof t.core.emit&&t.core.emit("exit");a>r;){if(c.data.apps[r].url===t.config.url){c.data.apps[r]=JSON.parse(JSON.stringify(c.data.apps[r])),c.data.apps[r].pid=void 0,d.replaceActionsConfig(t.config,c.data.apps[r]);break}++r}for(p.destroy(t.window),i.contentDocument.body.removeChild(t.$iframe),s=Object.keys(this.apps),a=s.length,r=0;a>r;){if(this.apps[s[r]]===t){delete l.apps[s[r]];break}++r}if(t.config.pid=void 0,t=null,!e){for(;this.stack.length;)t=this.stack.pop(),t.$iframe.style.visibility="hidden",t.core.emit("hide");this.topApp=null,this.show(this.launcher)}}},runApp:function(t){function e(){var e;d&&u&&u.window&&(e=n(1).getInstance(u.window),u.core=e,u.window.pid||(u.window.pid=h),e.ready||(p.forEach(function(n){e.plugins[n.name]=n.instance(t.config)}),"app"===t.config.type?e.call=function(e){"exit"===e?l.close(u):"app:ready"===e&&t.visible&&l.splashActive&&(l.splashActive=!1,window.splash.style.display="none",window.splash.style.backgroundImage="none",window.splash.style.backgroundColor="transparent",window.splashVersion.innerText="",l.show(u),t.onready&&t.onready())}:"osd"===t.config.type?(e.system=!0,e.config=c.data,e.call=function(t){var e,n;switch(t){case"hide":u.$iframe.style.visibility="hidden";break;case"show":for(u.$iframe.style.zIndex=window.frames.length+1,u.$iframe.style.visibility="visible",e=Object.keys(l.apps),n=e.length-1;n>-1;)l.apps[e[n]]&&"osd"===l.apps[e[n]].config.type&&u!==l.apps[e[n]]&&l.apps[e[n]].core.emit("hide"),--n;break;case"focus":l.topApp?l.topApp.core.emit("blur"):l.launcher&&l.launcher.core.emit("blur"),u.$iframe.contentWindow.focus();break;case"blur":l.topApp?(l.topApp.$iframe.contentWindow.focus(),l.topApp.core.emit("focus")):l.launcher&&(l.launcher.$iframe.contentWindow.focus(),l.launcher.core.emit("focus"))}}):(e.system=!0,e.config=c.data,e.call=function(t){switch(t){case"hide":l.hide(u);break;case"show":l.show(u)}}),e.pid=h,e.ready=!0,e.emit("load")),t.onload&&t.onload(u))}var o={},p=[],d=!1,h=-1,u=null,f=c.data.apps.length,v=0,w=!0;if(t.config.legacy)return void(window.location.href=t.config.url+"?referrer="+encodeURIComponent(window.location.href));if("app"===t.config.type){for(;f>v;){if(c.data.apps[v].url===t.config.url){t.config=c.data.apps[v],"undefined"!=typeof c.data.apps[v].pid&&(l.apps[t.config.pid]?w=!1:t.config.pid=void 0);break}++v}if(!w)return l.runHistory=l.runHistory.filter(function(e){return e.url!==t.config.url}),l.runHistory.push(t.config),l.show(l.apps[t.config.pid]),l.apps[t.config.pid].core.emit("maximize"),t.onload&&t.onload(l.apps[t.config.pid]),void(t.onready&&t.onready(l.apps[t.config.pid]));this.splashActive=!0,this.launcher.$iframe.style.visibility="hidden",window.splash.firstChild.innerText=c.data.apps[v].name,window.splash.style.display="",window.splash.style.backgroundImage="url("+c.data.apps[v].url+c.data.apps[v].icons.paths[screen.height]+c.data.apps[v].icons.states.active+")",window.splash.style.backgroundColor=c.data.apps[v].backgroundColor,window.splashVersion.innerText=c.data.apps[v].version,this.topApp&&(this.topApp.$iframe.style.visibility="hidden")}else t.config.metrics&&t.config.metrics[screen.height]&&(o.width=t.config.metrics[screen.height].width,o.height=t.config.metrics[screen.height].height,o.top=t.config.metrics[screen.height].top,o.left=t.config.metrics[screen.height].left);return a.load(t.config,function(t,n){t?(p={length:-1,forEach:function(){}},d=!0,e()):(n&&(p=n),d=!0,e())}),u={$iframe:s({url:t.config.url,visibile:!1,$container:"app"===t.config.type?i.contentDocument.body:window.document.body,width:o.width,height:o.height,top:o.top,left:o.left,onload:function(){this.contentWindow.addEventListener("keydown",function(t){0!==t.keyCode&&r("keydown:"+t.keyCode,t)}),u.window=this.contentWindow,e()}}),window:null,core:null,config:t.config},"app"===t.config.type&&(l.runHistory=l.runHistory.filter(function(e){return e.url!==t.config.url}),l.runHistory.push(t.config)),"launcher"!==t.config.type&&(h=Object.keys(l.apps).length,this.apps[h]=u),t.config.pid=h,u},init:function(){return function(t){i=s({$container:document.body,visible:!0,onload:function(){var e=this.contentDocument.head.appendChild(this.contentDocument.createElement("style"));e.textContent="html, body{ overflow: hidden; margin: 0; padding:0; width: "+screen.width+"px; height: "+screen.height+"px; } iframe { position: absolute; top: 0; left: 0; border: none; outline: none; overflow: hidden;margin: 0; padding: 0; width: "+screen.width+"px; height: "+screen.height+"px; }",this.contentWindow.parent=null,this.contentWindow.opener=null,this.contentWindow.getCoreInstanse=function(t){return n(1).getInstance(t)},this.contentWindow.getCoreInstance=function(t){return n(1).getInstance(t)},this.contentWindow.host=!0,this.contentWindow.localStorage=window.localStorage||window.stbStorage,this.contentWindow.stbEvent=window.stbEvent,this.contentWindow.dvbManager=o.dvbManager,this.contentWindow.epgManager=o.epgManager,this.contentWindow.gSTB=o.gSTB,this.contentWindow.pvrManager=o.pvrManager,this.contentWindow.stbDownloadManager=o.stbDownloadManager,this.contentWindow.stbStorage=o.stbStorage,this.contentWindow.stbUpdate=o.stbUpdate,this.contentWindow.stbUPnP=o.stbUPnP,this.contentWindow.stbWebWindow=o.stbWebWindow,this.contentWindow.stbWindowMgr=o.stbWindowMgr,this.contentWindow.timeShift=o.timeShift,this.contentWindow.stbPlayerManager=o.stbPlayerManager,t(!1,{config:{},instance:null,$iframe:i})}})}}};t.exports=l},function(t,e,n){"use strict";var i=n(19),o={},s={},a=null,r=null,c=null,p={create:function(t,e){return new i(t,e)},route:function(t,e){var p={runConfig:null,handlerList:[]};return null===r&&(r=n(1)),null===a&&(a=n(4)),t.context?("undefined"!=typeof t.context.pid?(t.once("close",function(){e&&e.pid&&a.apps[e.pid]?(a.show(a.apps[e.pid]),a.apps[e.pid].core.emit("maximize")):(e=null,a.show(a.launcher))}),t.state=i.prototype.STATE_RESOLVED,a.apps[t.context.pid].core.emit("intent",t,function(e,n){e?(t.state=i.prototype.STATE_ERROR_RECEIVED,t.callback&&t.callback(e,n)):(t.state=i.prototype.STATE_CONTEXT_RECEIVED,n.pid=t.context.pid,t.callback&&t.callback(!1,n))})):t.state=i.prototype.STATE_NOT_RESOLVED,p):(o[t.action]?o[t.action].forEach(function(n){if("undefined"!=typeof n.pid&&a.apps[n.pid]){if(t.mime&&n.actions[t.action]!==!0&&-1===n.actions[t.action].indexOf(t.mime))return;t.state=i.prototype.STATE_RESOLVED,a.apps[n.pid].core.emit("intent",t,function(o,r){return s[t.action]&&s[t.action].forEach(function(n){n(t,a.apps[e.pid])}),r=r||{},t.receiver=n.pid,t.creator=e.pid,r.pid=n.pid,t.silent?(c={pid:e.pid,action:t.action},void(t.callback&&t.callback(o,r))):(c&&c.pid===e.pid&&c.action!==t.action&&(c=null),void(o?(t.state=i.prototype.STATE_ERROR_RECEIVED,t.callback&&t.callback(o,r)):(t.state=i.prototype.STATE_CONTEXT_RECEIVED,"osd"===a.apps[n.pid].config.type?a.apps[n.pid].core.call("show"):(a.show(a.apps[n.pid],"app"!==a.apps[n.pid].config.type),t.once("close",function(){var t;if(e&&e.pid&&a.apps[e.pid])a.show(a.apps[e.pid],!0),c&&c.pid===e.pid||a.apps[e.pid].core.emit("maximize");else{for(e=null;a.stack.length;)t=a.stack.pop(),t.$iframe.style.visibility="hidden",t.core.emit("hide");a.show(a.launcher)}})),t.callback&&t.callback(!1,r))))})}else p.runConfig=n}):t.state=i.prototype.STATE_NOT_RESOLVED,p)},resolveActionsConfig:function(t){var e,n,i,s;if(t.actions)for(e=Object.keys(t.actions),i=e.length,n=0;i>n;)s=e[n],o[s]=o[s]||[],o[s].push(t),++n},replaceActionsConfig:function(t,e){var n,i,s,a,r;if(t.actions)for(n=Object.keys(t.actions),s=n.length,i=0;s>i;)a=n[i],r=o[a].indexOf(t),-1!==r&&(o[a][r]=e),++i},addHook:function(t,e){s[t]=s[t]||[],s[t].push(e)}};t.exports=p},function(t,e,n){"use strict";t.exports={serial:n(9),parallel:n(8)}},function(t,e,n){"use strict";var i=null,o=27,s=null;t.exports=function(t,e){var a,r,c,p,d,l,h;if(null===i&&(i=n(1)),null===s&&(s=n(4)),t==="keydown:"+o){for(p=Object.keys(s.apps),a=p.length-1,s.topApp=null,s.splashActive&&(s.splashActive=!1,window.splash.style.display="none",window.splash.style.backgroundImage="none",window.splash.style.backgroundColor="transparent",window.splashVersion.innerText="");a>-1;)s.apps[p[a]]&&(d=s.apps[p[a]].config.type,l=s.apps[p[a]].$iframe.style.visibility,s.apps[p[a]].core&&("osd"===d?s.apps[p[a]].core.emit("hide"):"hidden"!==l&&(s.apps[p[a]].$iframe.style.visibility="hidden",s.apps[p[a]].core.emit("hide")))),--a;return s.launcher.$iframe.contentWindow.focus(),s.launcher.$iframe.style.visibility="visible",void s.launcher.core.emit("focus")}if("keydown:85"===t&&e.altKey){for(h=!gSTB.GetStandByStatus(),gSTB.StandByMode!==Number(window.core.environment.standByMode)&&(gSTB.StandByMode=Number(window.core.environment.standByMode)),p=Object.keys(s.apps),a=p.length-1;a>-1;)s.apps[p[a]]&&s.apps[p[a]].core&&s.apps[p[a]].core.emit("standby",{status:h}),--a;if(3===Number(window.core.environment.standByMode))return gSTB.SetLedIndicatorMode(2),gSTB.StandBy(h),void gSTB.SetLedIndicatorMode(1);h?(gSTB.StandBy(h),gSTB.SetLedIndicatorMode(2)):(gSTB.StandBy(h),gSTB.SetLedIndicatorMode(1))}for(a=0,r=i.coreList.length;r>a;)i.coreList[a].system&&(c=i.coreList[a],c.events[t]&&c.emit(t,e)),++a}},function(t,e){"use strict";t.exports=function(t,e){function n(n,r){var c=function(c,p){return c?(i=!0,void("function"==typeof e&&e(c))):(s[r]=p,n.name&&(a[n.name]=p),o++,void(o>=t.length&&"function"==typeof e&&e(null,s,a)))};i||(0===n.length?c(null,n()):n(c))}var i=!1,o=0,s=[],a={};t=Array.isArray(t)?t:[],0===t.length?"function"==typeof e&&e(null,s,a):t.forEach(n)}},function(t,e){"use strict";t.exports=function(t,e){function n(r){var c=function(c,p){return c?(i=!0,void("function"==typeof e&&e(c))):(s[o]=p,r.name&&(a[r.name]=p),o++,void(o>=t.length&&"function"==typeof e?e(null,s,a):n(t[o])))};i||(0===r.length?c(null,r()):r(c))}var i=!1,o=0,s=[],a={};t=Array.isArray(t)?t:[],0===t.length?"function"==typeof e&&e(null,s,a):n(t[0])}},function(t,e){"use strict";t.exports=function(t){var e={};return t.split("&").forEach(function(t){t=t.split("="),2===t.length&&(e[t[0]]=decodeURIComponent(t[1]))}),e}},function(t,e,n){"use strict";function i(t){var e,n=this;if(t=t||{},this.visible=!0,this.focusable=!0,this.$node=null,this.$body=null,this.parent=null,this.children=[],this.propagate=!!t.propagate,o.call(this,t.data),this.$node=t.$node||document.createElement("div"),this.$body=t.$body||this.$node,this.$node.className+=" component "+(t.className||""),this.id=t.id||this.$node.id||"cid"+a++,t.parent&&t.parent.add(this),t.visible===!1&&this.hide(),t.focusable===!1&&(this.focusable=!1),this.defaultEvents){t.events=t.events||{};for(e in this.defaultEvents)t.events[e]=t.events[e]||this.defaultEvents[e]}t.events&&this.addListeners(t.events),t.children&&this.add.apply(this,t.children),this.$node.addEventListener("click",function(t){0===t.button&&(n.focus(),n.events.click&&n.emit("click",{event:t})),t.stopPropagation()})}var o=n(3),s=n(12),a=0;i.prototype=Object.create(o.prototype),i.prototype.constructor=i,i.prototype.defaultEvents=null,i.prototype.add=function(t){var e;for(e=0;e<arguments.length;e++)t=arguments[e],this.children.push(t),t.parent=this,t.$node&&null===t.$node.parentNode&&this.$body.appendChild(t.$node),this.events.add&&this.emit("add",{item:t})},i.prototype.remove=function(){this.parent&&(s.current.activeComponent===this&&(this.blur(),this.parent.focus()),this.parent.children.splice(this.parent.children.indexOf(this),1)),this.children.forEach(function(t){t.remove()}),this.removeAllListeners(),this.$node.parentNode.removeChild(this.$node),this.events.remove&&this.emit("remove")},i.prototype.focus=function(t){var e=s.current,n=e.activeComponent;return this.focusable&&this!==n?(n&&n.blur(),e.activeComponent=n=this,n.$node.classList.add("focus"),n.events.focus&&n.emit("focus",t),!0):!1},i.prototype.blur=function(){var t=s.current,e=t.activeComponent;return this.$node.classList.remove("focus"),this===e?(t.activeComponent=null,this.events.blur&&this.emit("blur"),!0):!1},i.prototype.show=function(t){return this.visible?!0:(this.$node.classList.remove("hidden"),this.visible=!0,this.events.show&&this.emit("show",t),!0)},i.prototype.hide=function(){return this.visible?(this.$node.classList.add("hidden"),this.visible=!1,this.events.hide&&this.emit("hide"),!0):!0},t.exports=i},function(t,e,n){"use strict";var i=n(13),o=new i;o.current=null,o.history=[],o.pages=[],o.ids={},o.init=function(t){var e,n,i;if(t){for(this.pages=[],this.pages=t,e=0,n=t.length;n>e;e++)i=t[e],this.ids[i.id]=i,i.active&&(this.current=i);return this.events.init&&this.emit("init",{pages:t}),!0}return!1},o.parse=function(t){var e={name:"",data:[]};return e.data=t.split("/").map(decodeURIComponent),e.name=e.data.shift().slice(1),e},o.stringify=function(t,e){return e=Array.isArray(e)?e:[],t=encodeURIComponent(t),e=e.map(encodeURIComponent),e.unshift(t),e.join("/")},o.show=function(t,e){return t&&!t.active?(t.$node.classList.add("active"),t.active=!0,this.current=t,t.events.show&&t.emit("show",{page:t,data:e}),!0):!1},o.hide=function(t){return t&&t.active?(t.$node.classList.remove("active"),t.active=!1,this.current=null,t.events.hide&&t.emit("hide",{page:t}),!0):!1},o.navigate=function(t,e){var n=this.current,i=this.ids[t];return i&&!i.active?(location.hash=this.stringify(t,e),this.hide(this.current),this.show(i,e),this.events.navigate&&this.emit("navigate",{from:n,to:i}),this.history.push(i),!0):!1},o.back=function(){var t,e;return this.history.length>1&&(t=this.history.pop(),e=this.history[this.history.length-1],e&&!e.active)?(location.hash=e.id,this.hide(this.current),this.show(e),this.events.navigate&&this.emit("navigate",{from:t,to:e}),!0):!1},t.exports=o},function(t,e,n){"use strict";function i(){this.events={}}i.prototype={addListener:function(t,e){this.events[t]=this.events[t]||[],this.events[t].push(e)},once:function(t,e){var n=this;this.events[t]=this.events[t]||[],this.events[t].push(function i(){e.apply(n,arguments),n.removeListener(t,i)})},addListeners:function(t){var e;for(e in t)t.hasOwnProperty(e)&&this.addListener(e,t[e])},removeListener:function(t,e){this.events[t]&&(this.events[t]=this.events[t].filter(function(t){return t!==e}),0===this.events[t].length&&(this.events[t]=void 0))},emit:function(t){var e,n=this.events[t];if(n)for(e=0;e<n.length;e++)n[e].apply(this,Array.prototype.slice.call(arguments,1))}},i.prototype.constructor=i,t.exports=i},function(t,e){"use strict";if(!document.documentElement.classList){var n=Array.prototype,i=n.indexOf,o=n.slice,s=n.push,a=n.splice,r=n.join;window.DOMTokenList=function(t){if(this._element=t,t.className!==this._classCache){if(this._classCache=t.className,!this._classCache)return;var e,n=this._classCache.replace(/^\s+|\s+$/g,"").split(/\s+/);for(e=0;e<n.length;e++)s.call(this,n[e])}},window.DOMTokenList.prototype={add:function(t){this.contains(t)||(s.call(this,t),this._element.className=o.call(this,0).join(" "))},contains:function(t){return-1!==i.call(this,t)},item:function(t){return this[t]||null},remove:function(t){var e=i.call(this,t);-1!==e&&(a.call(this,e,1),this._element.className=o.call(this,0).join(" "))},toString:function(){return r.call(this," ")},toggle:function(t){return this.contains(t)?this.remove(t):this.add(t),this.contains(t)}},Object.defineProperty(Element.prototype,"classList",{get:function(){return new window.DOMTokenList(this)}})}},function(t,e,n){"use strict";function i(t){t=t||{},t.focusable=t.focusable||!1,t.visible=t.visible||!1,t.className="widget "+(t.className||""),o.call(this,t)}var o=n(11),s=0;i.prototype=Object.create(o.prototype),i.prototype.constructor=i,t.exports=function(t){var e=new i({focusable:t.focusable,visible:t.visible,events:t.events});return e.className=e.$node.className="widgetClass"+s,t.visible||(e.$node.className="widgetClass"+s+" hidden"),++s,e.$node.style.zIndex=1e3,document.body.appendChild(e.$node),e}},function(t,e,n){"use strict";function i(){return u}function o(){var t,e,n=[],i=0;for(e=d.data.apps.length;e>i;)if(t=d.data.apps[i],p.resolveActionsConfig(t),"sap-loader"!==t.name){switch(t.type){case"launcher":!function(t){n.push(function(e){setTimeout(function(){c.launcher=c.runApp({config:d.data.apps[t],visible:!1,onload:function(){e(!1,c.launcher)}})},0)})}(i);break;case"system":case"osd":!function(t){setTimeout(function(){c.runApp({config:d.data.apps[t],visible:!1})},0)}(i);break;case"app":u.push(JSON.parse(JSON.stringify(t)))}++i}else++i;n.push(c.init()),window.core=window.getCoreInstance(window),s.parallel(n,function(){gSTB.EnableAppButton(!1),gSTB.EnableServiceButton(!1),window.loading.innerHTML="",window.loading.style.display="none",window.splash.className="padded",window.splash.style.display="none",c.show(c.launcher)})}var s=n(6),a=n(10),r=n(1),c=n(4),p=n(5),d=n(2),l=n(15),h=a(document.location.search.substring(1)),u=[];gSTB.InitPlayer(),gSTB.EnableAppButton(!0),gSTB.EnableVKButton(!0),gSTB.EnableServiceButton(!0),gSTB.ShowVirtualKeyboard(!0),gSTB.SetNativeStringMode&&gSTB.SetNativeStringMode(!0),window.getCoreInstance=window.getCoreInstanse=function(t){var e=r.getInstance(t);return e.widget=l,e.system=!0,e.getAppList=i,e.taskManager=c,e},d.load(h,function(t){var e=!1;t?window.mainMessage.innerHTML="Error loading config: url - "+(h.config||"config.json"):(e=d.data.apps.filter(function(t){return"sap-loader"===t.name}),e=e[0],e?c.runApp({config:e,visible:!0,onload:function(t){t.core.once("show",function(){window.loading.innerHTML="",window.loading.style.display="none",window.splash.className="padded",window.splash.style.display="none"}),t.core.once("ready",function(){o()})}}):o())})},function(t,e,n){"use strict";function i(t,e){var n=new XMLHttpRequest;n.open("GET",t.modulePath+(t.packageJson.main?"/"+t.packageJson.main:"/index.js")),n.onload=function(){var n,i={exports:{},id:""};if(this.responseText){n=new Function("module","exports","require",this.responseText);try{n(i,i.exports,function(e){return r.map[t.dependencies[e]]}),e(!1,{instance:i.exports,name:t.packageJson.config.name,version:t.packageJson.version})}catch(o){e(o,null)}}else e(!0,null)},n.onerror=function(){e(!0,null)},n.send(null)}var o=n(6).parallel,s=n(20),a=n(2),r={map:{},load:function(t,e){var n,r,c,p,d=this,l=t.dependencies,h=0,u=[];if(l){for(h=0,n=Object.keys(l),r=n.length;r>h;)c=l[n[h]],p=n[h],-1!==p.indexOf("plugin")?(!function(t,e){d.map[t]?u.push(function(e){e(!1,d.map[t])}):u.push(function(n){var o=a.data.options.pluginsPath+t+"/"+e;s(o,function(e,s){e?n(!0,null):i({modulePath:o,packageJson:s},function(e,i){d.map[t]=i,n(e,i)})})})}(p,c),++h):++h;o(u,function(t,n){t?"function"==typeof e&&e(!0,[]):e(!1,n)})}else"function"==typeof e&&e(!1)}};t.exports=r},function(t,e,n){"use strict";var i=(n(2),{url:"",top:0,left:0,visible:"hidden"});t.exports=function(t){var e=t.$container.appendChild(document.createElement("iframe"));return"function"==typeof t.onload&&(e.onload=t.onload),e.style.width=t.width||screen.width+"px",e.style.height=t.height||screen.height+"px",e.style.top=t.top||i.top,e.style.left=t.left||i.left,t.visible?e.style.visibility="visible":e.style.visibility=i.visible,e.src=t.url||i.url,e}},function(t,e,n){"use strict";function i(t,e){var n;if(this.action=t.action,this.mime=t.mime,this.data=t.data,this.context=t.context,this.silent=t.silent,this.callback=e,o.call(this,t),t.events)for(n in t.events)t.events[n]&&this.addListener(n,t.events[n])}var o=n(3);i.prototype=Object.create(o.prototype),i.prototype.constructor=i,i.prototype.STATE_CREATED=0,i.prototype.STATE_RESOLVED=1,i.prototype.STATE_NOT_RESOLVED=2,i.prototype.STATE_CONTEXT_RECEIVED=3,i.prototype.STATE_ERROR_RECEIVED=4,i.prototype.STATE_CLOSED=5,i.prototype.context=null,i.prototype.action=null,i.prototype.mime=null,i.prototype.data=null,i.prototype.callback=null,i.prototype.silent=!1,i.prototype.state=i.prototype.STATE_CREATED,i.prototype.close=function(){this.state=i.prototype.STATE_CLOSED,this.emit("close")},t.exports=i},function(t,e){"use strict";t.exports=function(t,e){var n=new XMLHttpRequest;n.open("GET",t+"/package.json",!0),n.onload=function(){var t=this.responseText,n=!1;try{t=JSON.parse(this.responseText)}catch(n){n=!0}e(n,t)},n.onerror=function(){e(!0,null)},n.send(null)}},function(t,e){"use strict";var n={dvbManager:window.dvbManager,epgManager:window.epgManager,gSTB:window.gSTB,pvrManager:window.pvrManager,stbDownloadManager:window.stbDownloadManager,stbStorage:window.stbStorage,stbUpdate:window.stbUpdate,stbUPnP:window.stbUPnP,stbWebWindow:window.stbWebWindow,stbWindowMgr:window.stbWindowMgr,timeShift:window.timeShift,stbPlayerManager:window.stbPlayerManager};t.exports=n},function(t,e,n){"use strict";var i=n(3),o=n(7),s=33,a=32;window.stbEvent=new i,window.stbEvent.onEvent=function(t,e){try{t=parseInt(t,10)}catch(n){return}if(t===s||t===a)return void o("keydown:85",{altKey:!0});if(this.events.media){if(e)try{e=JSON.parse(e)}catch(n){e={}}this.emit("media",{code:t,info:e})}},window.stbEvent.onBroadcastMessage=function(t,e,n){this.events.message&&this.emit("message",{broadcast:!0,windowId:t,message:e,data:n})},window.stbEvent.onMessage=function(t,e,n){this.events.message&&this.emit("message",{broadcast:!1,windowId:t,message:e,data:n})},window.stbEvent.onMount=function(t){this.events["device:mount"]&&this.emit("device:mount",{state:t})},window.stbEvent.onMediaAvailable=function(t,e){this.events["media:available"]&&this.emit("media:available",{mime:t,url:e})},window.stbEvent.onNetworkStateChange=function(t){this.events["internet:state"]&&this.emit("internet:state",{state:t})},window.stbEvent.onWebBrowserProgress=function(t){this.events["browser:progress"]&&this.emit("browser:progress",{progress:t})},window.stbEvent.onWindowActivated=function(){this.events["window:focus"]&&this.emit("window:focus")}}]); | ||
/*! mag-core: v1.0.11 */ | ||
!function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";window.host=!!window.gSTB,n(11),n(20),window.addEventListener("unload",function(){window.stbPlayerManager?stbPlayerManager.list.forEach(function(e){e.stop(),e.setViewport({x:0,y:0,width:screen.width,height:screen.height})}):gSTB.Stop()}),n(14)},function(e,t,n){"use strict";function i(e){o.call(this,e)}var o=n(3),s=n(2),a=n(5),r={coreList:[],windowList:[],windowToCoreMap:{},core:{},getInstance:function(e){var t,n=this.windowList.indexOf(e);return n===-1?(t=new i,t.plugins={},t.theme.path=s.data.themes[Object.keys(s.data.themes)[0]],Object.defineProperty(t,"index",{value:r.coreList.push(t)-1,configurable:!1,enumerable:!1,writable:!1}),this.windowToCoreMap[this.windowList.push(e)-1]=t.index):t=this.coreList[this.windowToCoreMap[n]],t},destroy:function(e){var t=this.windowList.indexOf(e);return t!==-1&&(this.coreList.splice(this.windowToCoreMap[t],1),this.windowToCoreMap[this.windowToCoreMap[t]]=void 0,this.windowList.splice(t,1),!0)}},c=null,l=gSTB.GetEnv(JSON.stringify({varList:["language","upnp_conf","hdmi_event_delay","ssaverDelay","ssaverName","playerClock","defaultLedLevel","standbyLedLevel","standByMode","controlModel"]}));try{l=JSON.parse(l),l=l.result}catch(p){l={}}""===l.hdmi_event_delay&&(l.hdmi_event_delay="3",gSTB.SetEnv(JSON.stringify({hdmi_event_delay:"3"}))),i.prototype=Object.create(o.prototype),i.prototype.constructor=i,i.prototype.theme={path:null},i.prototype.state=null,i.prototype.environment={},Object.defineProperties(i.prototype.environment,{onFocusDebounceTimeout:{value:300,enumerable:!0},onInputDebounceTimeout:{value:300,enumerable:!0},language:{value:l.language||"en",enumerable:!0},upnp_conf:{value:l.upnp_conf,enumerable:!0},hdmi_event_delay:{value:l.hdmi_event_delay,enumerable:!0},ssaverDelay:{value:l.ssaverDelay,enumerable:!0},ssaverName:{value:l.ssaverName,enumerable:!0},playerClock:{value:l.playerClock,enumerable:!0},defaultLedLevel:{value:l.defaultLedLevel,enumerable:!0},standbyLedLevel:{value:l.standbyLedLevel,enumerable:!0},standByMode:{value:l.standByMode,enumerable:!0},controlModel:{value:l.controlModel,enumerable:!0},protectedContentAccess:{value:!1,enumerable:!0,writable:!0}}),i.prototype.intent=function(e,t){var i,o,r,l=this,p=a.create(e,t);if(e&&e.action)if(i=a.route(p,this),null!==i.runConfig){if(null===c&&(c=n(4)),i.runConfig.pid)for(o=0,r=s.data.apps.length;o<r;){if(s.data.apps[o].url===i.runConfig.url){i.runConfig=s.data.apps[o]=JSON.parse(JSON.stringify(s.data.apps[o]));break}++o}c.runApp({config:i.runConfig,visible:!0,onready:function(){a.route(p,l)}})}else i.handlerList.length>1;return p},window.extendCorePrototype=function(e,t){i.prototype[e]=t},window.addIntentHook=function(e,t){a.addHook(e,t)},e.exports=r},function(e,t,n){"use strict";function i(e,t){var n,o;for(n in t)t.hasOwnProperty(n)&&("Array"===t[n].constructor.name?(o=[],e[n]=t[n].concat(e[n]),e[n].forEach(function(e){var t=!0;o.forEach(function(n){n.name===e.name&&(t=!1)}),t&&o.push(e)}),e[n]=o):"object"==typeof t[n]?i(e[n],t[n]):e[n]=t[n])}e.exports={systemSettings:{},settings:{},environment:{},data:{},load:function(e,t){var n,o=this,s=new XMLHttpRequest;n=e.config||"config.json",s.onload=function(){var n=!1;try{o.data=JSON.parse(s.responseText)}catch(a){n=!0}e.extend?(s.onload=function(){var e=!1,n={};try{n=JSON.parse(s.responseText)}catch(a){e=!0}i(o.data,n),t(e,o.data)},s.open("GET",e.extend,!0),s.send(null)):t(n,o.data)},s.open("GET",n,!0),s.send(null)}}},function(e,t,n){"use strict";function i(){this.events={}}i.prototype={addListener:function(e,t){this.events[e]=this.events[e]||[],this.events[e].push(t)},once:function(e,t){var n=this;this.events[e]=this.events[e]||[],this.events[e].push(function i(){t.apply(n,arguments),n.removeListener(e,i)})},addListeners:function(e){var t;for(t in e)e.hasOwnProperty(t)&&this.addListener(t,e[t])},removeListener:function(e,t){this.events[e]&&(this.events[e]=this.events[e].filter(function(e){return e!==t}),0===this.events[e].length&&(this.events[e]=void 0))},emit:function(e){var t,n=this.events[e];if(n)for(t=0;t<n.length;t++)n[t].apply(this,Array.prototype.slice.call(arguments,1))}},i.prototype.constructor=i,e.exports=i},function(e,t,n){"use strict";var i=null,o=n(19),s=n(16),a=n(15),r=n(7),c=n(2),l=null,p=null,d={topApp:null,stack:[],runHistory:[],apps:{},launcher:null,splashActive:!1,show:function(e,t){var n,o=e.config.type;if(this.topApp!==e)switch(o){case"app":this.launcher.$iframe.style.visibility="hidden",i.style.zIndex=window.frames.length;case"system":"system"===o&&(i.style.zIndex=0,e.$iframe.style.zIndex=window.frames.length),n=this.stack.indexOf(e),n!==-1&&this.stack.splice(n,1),this.stack.push(e),this.topApp&&this.topApp!==e&&("function"==typeof this.topApp.core.emit&&this.topApp.core.emit(t?"hide:auto":"hide"),this.topApp.$iframe.style.visibility="hidden"),this.topApp=e,e.$iframe.contentWindow.focus(),e.$iframe.style.visibility="visible",e.core&&"function"==typeof e.core.emit&&e.core.emit("show");break;default:e.$iframe.contentWindow.focus(),e.$iframe.style.visibility="visible"}},hide:function(e,t){var n=e.config.type;switch(e.$iframe.style.visibility="hidden",e.core&&"function"==typeof e.core.emit&&e.core.emit(t?"hide:auto":"hide"),n){case"app":case"system":this.topApp===e&&(this.topApp=null),this.stack.pop(),this.stack.length>0?this.show(this.stack.pop()):this.show(this.launcher)}},close:function(e,t){var o,s,a=c.data.apps.length,r=0;if(null===l&&(l=n(1),p=n(5)),"undefined"==typeof e)t||this.show(this.launcher);else if("app"===e.config.type){for(e===this.topApp?(this.topApp=null,this.stack.pop()):(o=this.stack.indexOf(e),this.stack.splice(o,1)),e.core&&"function"==typeof e.core.emit&&e.core.emit("exit");r<a;){if(c.data.apps[r].url===e.config.url){c.data.apps[r]=JSON.parse(JSON.stringify(c.data.apps[r])),c.data.apps[r].pid=void 0,p.replaceActionsConfig(e.config,c.data.apps[r]);break}++r}for(l.destroy(e.window),i.contentDocument.body.removeChild(e.$iframe),s=Object.keys(this.apps),a=s.length,r=0;r<a;){if(this.apps[s[r]]===e){delete d.apps[s[r]];break}++r}if(e.config.pid=void 0,e=null,!t){for(;this.stack.length;)e=this.stack.pop(),e.$iframe.style.visibility="hidden",e.core.emit("hide");this.topApp=null,this.show(this.launcher)}}},runApp:function(e){function t(){var t;p&&h&&h.window&&(t=n(1).getInstance(h.window),h.core=t,h.window.pid||(h.window.pid=u),t.ready||(l.forEach(function(n){t.plugins[n.name]=n.instance(e.config)}),"app"===e.config.type?t.call=function(t){"exit"===t?d.close(h):"app:ready"===t&&e.visible&&d.splashActive&&(d.splashActive=!1,window.splash.style.display="none",window.splash.style.backgroundImage="none",window.splash.style.backgroundColor="transparent",window.splashVersion.innerText="",d.show(h),e.onready&&e.onready())}:"osd"===e.config.type?(t.system=!0,t.config=c.data,t.call=function(e){var t,n;switch(e){case"hide":h.$iframe.style.visibility="hidden";break;case"show":for(h.$iframe.style.zIndex=window.frames.length+1,h.$iframe.style.visibility="visible",t=Object.keys(d.apps),n=t.length-1;n>-1;)d.apps[t[n]]&&"osd"===d.apps[t[n]].config.type&&h!==d.apps[t[n]]&&d.apps[t[n]].core.emit("hide"),--n;break;case"focus":d.topApp?d.topApp.core.emit("blur"):d.launcher&&d.launcher.core.emit("blur"),h.$iframe.contentWindow.focus();break;case"blur":d.topApp?(d.topApp.$iframe.contentWindow.focus(),d.topApp.core.emit("focus")):d.launcher&&(d.launcher.$iframe.contentWindow.focus(),d.launcher.core.emit("focus"))}}):(t.system=!0,t.config=c.data,t.call=function(e){switch(e){case"hide":d.hide(h);break;case"show":d.show(h)}}),t.pid=u,t.ready=!0,t.emit("load")),e.onload&&e.onload(h))}var o={},l=[],p=!1,u=-1,h=null,f=c.data.apps.length,w=0,y=!0;if(e.config.legacy)return void(window.location.href=e.config.url+"?referrer="+encodeURIComponent(window.location.href));if("app"===e.config.type){for(;w<f;){if(c.data.apps[w].url===e.config.url){e.config=c.data.apps[w],"undefined"!=typeof c.data.apps[w].pid&&(d.apps[e.config.pid]?y=!1:e.config.pid=void 0);break}++w}if(!y)return d.runHistory=d.runHistory.filter(function(t){return t.url!==e.config.url}),d.runHistory.push(e.config),d.show(d.apps[e.config.pid]),d.apps[e.config.pid].core.emit("maximize"),e.onload&&e.onload(d.apps[e.config.pid]),void(e.onready&&e.onready(d.apps[e.config.pid]));this.splashActive=!0,this.launcher.$iframe.style.visibility="hidden",window.splash.firstChild.innerText=c.data.apps[w].name,window.splash.style.display="",window.splash.style.backgroundImage="url("+c.data.apps[w].url+c.data.apps[w].icons.paths[screen.height]+c.data.apps[w].icons.states.active+")",window.splash.style.backgroundColor=c.data.apps[w].backgroundColor,window.splashVersion.innerText=c.data.apps[w].version,this.topApp&&(this.topApp.$iframe.style.visibility="hidden")}else e.config.metrics&&e.config.metrics[screen.height]&&(o.width=e.config.metrics[screen.height].width,o.height=e.config.metrics[screen.height].height,o.top=e.config.metrics[screen.height].top,o.left=e.config.metrics[screen.height].left);return a.load(e.config,function(e,n){e?(l={length:-1,forEach:function(){}},p=!0,t()):(n&&(l=n),p=!0,t())}),h={$iframe:s({url:e.config.url,visibile:!1,$container:"app"===e.config.type?i.contentDocument.body:window.document.body,width:o.width,height:o.height,top:o.top,left:o.left,onload:function(){this.contentWindow.addEventListener("keydown",function(e){0!==e.keyCode&&r("keydown:"+e.keyCode,e)}),h.window=this.contentWindow,t()},onerror:function(t){d.close(h),setTimeout(function(){e.visible&&d.splashActive&&(d.splashActive=!1,window.splash.style.display="none",window.splash.style.backgroundImage="none",window.splash.style.backgroundColor="transparent",window.splashVersion.innerText="",e.onerror&&e.onerror(t))},5e3)}}),window:null,core:null,config:e.config},"app"===e.config.type&&(d.runHistory=d.runHistory.filter(function(t){return t.url!==e.config.url}),d.runHistory.push(e.config)),"launcher"!==e.config.type&&(u=Object.keys(d.apps).length,this.apps[u]=h),e.config.pid=u,h},init:function(){return function(e){i=s({$container:document.body,visible:!0,onload:function(){var t=this.contentDocument.head.appendChild(this.contentDocument.createElement("style"));t.textContent="html, body{ overflow: hidden; margin: 0; padding:0; width: "+screen.width+"px; height: "+screen.height+"px; } iframe { position: absolute; top: 0; left: 0; border: none; outline: none; overflow: hidden;margin: 0; padding: 0; width: "+screen.width+"px; height: "+screen.height+"px; }",this.contentWindow.parent=null,this.contentWindow.opener=null,this.contentWindow.getCoreInstanse=function(e){return n(1).getInstance(e)},this.contentWindow.getCoreInstance=function(e){return n(1).getInstance(e)},this.contentWindow.host=!0,this.contentWindow.localStorage=window.localStorage||window.stbStorage,this.contentWindow.stbEvent=window.stbEvent,this.contentWindow.dvbManager=o.dvbManager,this.contentWindow.epgManager=o.epgManager,this.contentWindow.gSTB=o.gSTB,this.contentWindow.pvrManager=o.pvrManager,this.contentWindow.stbDownloadManager=o.stbDownloadManager,this.contentWindow.stbStorage=o.stbStorage,this.contentWindow.stbUpdate=o.stbUpdate,this.contentWindow.stbUPnP=o.stbUPnP,this.contentWindow.stbWebWindow=o.stbWebWindow,this.contentWindow.stbWindowMgr=o.stbWindowMgr,this.contentWindow.timeShift=o.timeShift,this.contentWindow.stbPlayerManager=o.stbPlayerManager,e(!1,{config:{},instance:null,$iframe:i})}})}}};e.exports=d},function(e,t,n){"use strict";var i=n(17),o={},s={},a=null,r=null,c=null,l={create:function(e,t){return new i(e,t)},route:function(e,t){var l={runConfig:null,handlerList:[]};return null===r&&(r=n(1)),null===a&&(a=n(4)),e.context?("undefined"!=typeof e.context.pid?(e.once("close",function(){t&&t.pid&&a.apps[t.pid]?(a.show(a.apps[t.pid],!0),c&&c.pid===t.pid||a.apps[t.pid].core.emit("maximize")):(t=null,a.show(a.launcher))}),e.state=i.prototype.STATE_RESOLVED,a.apps[e.context.pid].core.emit("intent",e,function(n,o){try{}catch(s){}e.silent?c={pid:t.pid,action:e.action}:c&&c.pid===t.pid&&c.action!==e.action&&(c=null),n?(e.state=i.prototype.STATE_ERROR_RECEIVED,e.callback&&e.callback(n,o)):(e.state=i.prototype.STATE_CONTEXT_RECEIVED,o.pid=e.context.pid,e.callback&&e.callback(!1,o))})):e.state=i.prototype.STATE_NOT_RESOLVED,l):(o[e.action]?o[e.action].forEach(function(n){if("undefined"!=typeof n.pid&&a.apps[n.pid]){if(e.mime&&n.actions[e.action]!==!0&&n.actions[e.action].indexOf(e.mime)===-1)return;e.state=i.prototype.STATE_RESOLVED,a.apps[n.pid].core.emit("intent",e,function(o,r){return s[e.action]&&s[e.action].forEach(function(n){n(e,a.apps[t.pid])}),r=r||{},e.receiver=n.pid,e.creator=t.pid,r.pid=n.pid,e.silent?(c={pid:t.pid,action:e.action},void(e.callback&&e.callback(o,r))):(c&&c.pid===t.pid&&c.action!==e.action&&(c=null),void(o?(e.state=i.prototype.STATE_ERROR_RECEIVED,e.callback&&e.callback(o,r)):(e.state=i.prototype.STATE_CONTEXT_RECEIVED,"osd"===a.apps[n.pid].config.type?a.apps[n.pid].core.call("show"):(a.show(a.apps[n.pid],"app"!==a.apps[n.pid].config.type),e.once("close",function(){var e;if(t&&t.pid&&a.apps[t.pid])a.show(a.apps[t.pid],!0),c&&c.pid===t.pid||a.apps[t.pid].core.emit("maximize");else{for(t=null;a.stack.length;)e=a.stack.pop(),e.$iframe.style.visibility="hidden",e.core.emit("hide");a.show(a.launcher)}})),e.callback&&e.callback(!1,r))))})}else l.runConfig=n}):e.state=i.prototype.STATE_NOT_RESOLVED,l)},resolveActionsConfig:function(e){var t,n,i,s;if(e.actions)for(t=Object.keys(e.actions),i=t.length,n=0;n<i;)s=t[n],o[s]=o[s]||[],o[s].push(e),++n},replaceActionsConfig:function(e,t){var n,i,s,a,r;if(e.actions)for(n=Object.keys(e.actions),s=n.length,i=0;i<s;)a=n[i],r=o[a].indexOf(e),r!==-1&&(o[a][r]=t),++i},addHook:function(e,t){s[e]=s[e]||[],s[e].push(t)}};e.exports=l},function(e,t,n){"use strict";e.exports={serial:n(9),parallel:n(8)}},function(e,t,n){"use strict";var i=null,o=27,s=null;e.exports=function(e,t){var a,r,c,l,p,d,u,h;if(null===i&&(i=n(1)),null===s&&(s=n(4)),e==="keydown:"+o){for(l=Object.keys(s.apps),a=l.length-1,s.topApp=null,s.splashActive&&(s.splashActive=!1,window.splash.style.display="none",window.splash.style.backgroundImage="none",window.splash.style.backgroundColor="transparent",window.splashVersion.innerText="");a>-1;)s.apps[l[a]]&&(p=s.apps[l[a]].config.type,d=s.apps[l[a]].$iframe.style.visibility,s.apps[l[a]].core&&("osd"===p?s.apps[l[a]].core.emit("hide"):"hidden"!==d&&(s.apps[l[a]].$iframe.style.visibility="hidden",s.apps[l[a]].core.emit("hide")))),--a;return s.launcher.$iframe.contentWindow.focus(),s.launcher.$iframe.style.visibility="visible",void s.launcher.core.emit("focus")}if("hdmi:32"===e||"hdmi:33"===e){if(u=!gSTB.GetStandByStatus(),h=!!gSTB.IsPlaying(),gSTB.StandByMode!==Number(window.core.environment.standByMode)&&(gSTB.StandByMode=Number(window.core.environment.standByMode)),3===Number(window.core.environment.standByMode))return h||(gSTB.SetLedIndicatorMode(2),gSTB.StandBy(u)),gSTB.SetLedIndicatorMode(1),void(window.stbPlayerManager?stbPlayerManager.list.forEach(function(e){e.stop()}):gSTB.Stop());u?(stbStorage.clear(),h||(window.stbPlayerManager?stbPlayerManager.list.forEach(function(e){e.stop()}):gSTB.Stop(),document.body.style.display="none",gSTB.StandBy(u),gSTB.SetLedIndicatorMode(2),window.location.reload())):(gSTB.StandBy(u),gSTB.SetLedIndicatorMode(1))}for(a=0,r=i.coreList.length;a<r;)i.coreList[a].system&&(c=i.coreList[a],c.events[e]&&c.emit(e,t)),++a}},function(e,t){"use strict";e.exports=function(e,t){function n(n,r){var c=function(c,l){return c?(i=!0,void("function"==typeof t&&t(c))):(s[r]=l,n.name&&(a[n.name]=l),o++,void(o>=e.length&&"function"==typeof t&&t(null,s,a)))};i||(0===n.length?c(null,n()):n(c))}var i=!1,o=0,s=[],a={};e=Array.isArray(e)?e:[],0===e.length?"function"==typeof t&&t(null,s,a):e.forEach(n)}},function(e,t){"use strict";e.exports=function(e,t){function n(r){var c=function(c,l){return c?(i=!0,void("function"==typeof t&&t(c))):(s[o]=l,r.name&&(a[r.name]=l),o++,void(o>=e.length&&"function"==typeof t?t(null,s,a):n(e[o])))};i||(0===r.length?c(null,r()):r(c))}var i=!1,o=0,s=[],a={};e=Array.isArray(e)?e:[],0===e.length?"function"==typeof t&&t(null,s,a):n(e[0])}},function(e,t){"use strict";e.exports=function(e){var t={};return e.split("&").forEach(function(e){e=e.split("="),2===e.length&&(t[e[0]]=decodeURIComponent(e[1]))}),t}},function(e,t){"use strict";if(!document.documentElement.classList){var n=Array.prototype,i=n.indexOf,o=n.slice,s=n.push,a=n.splice,r=n.join;window.DOMTokenList=function(e){if(this._element=e,e.className!==this._classCache){if(this._classCache=e.className,!this._classCache)return;var t,n=this._classCache.replace(/^\s+|\s+$/g,"").split(/\s+/);for(t=0;t<n.length;t++)s.call(this,n[t])}},window.DOMTokenList.prototype={add:function(e){this.contains(e)||(s.call(this,e),this._element.className=o.call(this,0).join(" "))},contains:function(e){return i.call(this,e)!==-1},item:function(e){return this[e]||null},remove:function(e){var t=i.call(this,e);t!==-1&&(a.call(this,t,1),this._element.className=o.call(this,0).join(" "))},toString:function(){return r.call(this," ")},toggle:function(e){return this.contains(e)?this.remove(e):this.add(e),this.contains(e)}},Object.defineProperty(Element.prototype,"classList",{get:function(){return new window.DOMTokenList(this)}})}},function(e,t,n){"use strict";function i(e){var t,n=this;if(e=e||{},this.visible=!0,this.focusable=!0,this.$node=null,this.$body=null,this.parent=null,this.children=[],this.propagate=!!e.propagate,o.call(this,e.data),this.$node=e.$node||document.createElement("div"),this.$body=e.$body||this.$node,this.$node.className+=" component "+(e.className||""),this.id=e.id||this.$node.id||"cid"+a++,e.parent&&e.parent.add(this),e.visible===!1&&this.hide(),e.focusable===!1&&(this.focusable=!1),this.defaultEvents){e.events=e.events||{};for(t in this.defaultEvents)e.events[t]=e.events[t]||this.defaultEvents[t]}e.events&&Object.keys(e.events).forEach(function(t){n.addListener(t,e.events[t])}),e.children&&this.add.apply(this,e.children),this.$node.addEventListener("click",function(e){n.focus(),n.events.click&&n.emit("click",e),e.stopPropagation()})}var o=n(3),s=null,a=0;i.prototype=Object.create(o.prototype),i.prototype.constructor=i,i.prototype.defaultEvents=null,i.prototype.add=function(e){var t;for(t=0;t<arguments.length;t++)e=arguments[t],this.children.push(e),e.parent=this,e.$node&&null===e.$node.parentNode&&this.$body.appendChild(e.$node),this.events.add&&this.emit("add",{item:e})},i.prototype.remove=function(){this.parent&&(s===this&&(this.blur(),this.parent.focus()),this.parent.children.splice(this.parent.children.indexOf(this),1)),this.children.forEach(function(e){e.remove()}),this.events={},this.$node.parentNode.removeChild(this.$node),this.events.remove&&this.emit("remove")},i.prototype.focus=function(e){return!(!this.focusable||this===s)&&(s&&s.blur(),s=this,s.$node.classList.add("focus"),s.events.focus&&s.emit("focus",e),!0)},i.prototype.blur=function(){return this.$node.classList.remove("focus"),this===s&&(s=null,this.events.blur&&this.emit("blur"),!0)},i.prototype.show=function(e){return!!this.visible||(this.$node.classList.remove("hidden"),this.visible=!0,this.events.show&&this.emit("show",e),!0)},i.prototype.hide=function(){return!this.visible||(this.$node.classList.add("hidden"),this.visible=!1,this.events.hide&&this.emit("hide"),!0)},e.exports=i},function(e,t,n){"use strict";function i(e){e=e||{},e.focusable=e.focusable||!1,e.visible=e.visible||!1,e.className="widget "+(e.className||""),o.call(this,e)}var o=n(12),s=0;i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=function(e){var t=new i({focusable:e.focusable,visible:e.visible,events:e.events});return t.className=t.$node.className="widgetClass"+s,e.visible||(t.$node.className="widgetClass"+s+" hidden"),++s,t.$node.style.zIndex=1e3,document.body.appendChild(t.$node),t}},function(e,t,n){"use strict";function i(){return h}function o(){var e,t,n=[],i=0;for(t=p.data.apps.length;i<t;)if(e=p.data.apps[i],l.resolveActionsConfig(e),"sap-loader"!==e.name){switch(e.type){case"launcher":!function(e){n.push(function(t){setTimeout(function(){c.launcher=c.runApp({config:p.data.apps[e],visible:!1,onload:function(){t(!1,c.launcher)}})},0)})}(i);break;case"system":case"osd":!function(e){setTimeout(function(){c.runApp({config:p.data.apps[e],visible:!1})},0)}(i);break;case"app":h.push(JSON.parse(JSON.stringify(e)))}++i}else++i;n.push(c.init()),window.core=window.getCoreInstance(window),s.parallel(n,function(){gSTB.EnableAppButton(!1),gSTB.EnableServiceButton(!1),window.loading.innerHTML="",window.loading.style.display="none",window.splash.className="padded",window.splash.style.display="none",c.show(c.launcher)})}var s=n(6),a=n(10),r=n(1),c=n(4),l=n(5),p=n(2),d=n(13),u=a(document.location.search.substring(1)),h=[];gSTB.InitPlayer(),gSTB.EnableAppButton(!0),gSTB.EnableVKButton(!0),gSTB.EnableServiceButton(!0),gSTB.ShowVirtualKeyboard(!0),gSTB.SetNativeStringMode&&gSTB.SetNativeStringMode(!0),window.getCoreInstance=window.getCoreInstanse=function(e){var t=r.getInstance(e);return t.widget=d,t.system=!0,t.getAppList=i,t.taskManager=c,t},p.load(u,function(e){var t=!1;e?window.mainMessage.innerHTML="Error loading config: url - "+(u.config||"config.json"):(t=p.data.apps.filter(function(e){return"sap-loader"===e.name}),t=t[0],t?c.runApp({config:t,visible:!0,onload:function(e){e.core.once("show",function(){window.loading.innerHTML="",window.loading.style.display="none",window.splash.className="padded",window.splash.style.display="none"}),e.core.once("ready",function(){o()})}}):o())})},function(e,t,n){"use strict";function i(e,t){var n=new XMLHttpRequest;n.open("GET",e.modulePath+(e.packageJson.main?"/"+e.packageJson.main:"/index.js")),n.onload=function(){var n,i={exports:{},id:""};if(this.responseText){n=new Function("module","exports","require",this.responseText);try{n(i,i.exports,function(t){return r.map[e.dependencies[t]]}),t(!1,{instance:i.exports,name:e.packageJson.config.name,version:e.packageJson.version})}catch(o){t(o,null)}}else t(!0,null)},n.onerror=function(){t(!0,null)},n.send(null)}var o=n(6).parallel,s=n(18),a=n(2),r={map:{},load:function(e,t){var n,r,c,l,p=this,d=e.dependencies,u=0,h=[];if(d){for(u=0,n=Object.keys(d),r=n.length;u<r;)c=d[n[u]],l=n[u],l.indexOf("plugin")!==-1?(!function(e,t){p.map[e]?h.push(function(t){t(!1,p.map[e])}):h.push(function(n){var o=a.data.options.pluginsPath+e+"/"+t;s(o,function(t,s){t?n(!0,null):i({modulePath:o,packageJson:s},function(t,i){p.map[e]=i,n(t,i)})})})}(l,c),++u):++u;o(h,function(e,n){e?"function"==typeof t&&t(!0,[]):t(!1,n)})}else"function"==typeof t&&t(!1)}};e.exports=r},function(e,t,n){"use strict";var i=(n(2),{url:"",top:0,left:0,visible:"hidden"});e.exports=function(e){var t,n=e.$container.appendChild(document.createElement("iframe"));return"function"==typeof e.onload&&(n.onload=e.onload),n.style.width=e.width||screen.width+"px",n.style.height=e.height||screen.height+"px",n.style.top=e.top||i.top,n.style.left=e.left||i.left,e.visible?n.style.visibility="visible":n.style.visibility=i.visible,e.onerror&&(t=new XMLHttpRequest,t.open("HEAD",e.url),t.timeout=1e4,t.onload=function(){200!==this.status&&e.onerror(this.status)},t.onerror=function(){e.onerror(this.status)},t.ontimeout=function(){e.onerror(this.status)},t.send()),n.src=e.url||i.url,n}},function(e,t,n){"use strict";function i(e,t){var n;if(this.action=e.action,this.mime=e.mime,this.data=e.data,this.context=e.context,this.silent=e.silent,this.callback=t,o.call(this,e),e.events)for(n in e.events)e.events[n]&&this.addListener(n,e.events[n])}var o=n(3);i.prototype=Object.create(o.prototype),i.prototype.constructor=i,i.prototype.STATE_CREATED=0,i.prototype.STATE_RESOLVED=1,i.prototype.STATE_NOT_RESOLVED=2,i.prototype.STATE_CONTEXT_RECEIVED=3,i.prototype.STATE_ERROR_RECEIVED=4,i.prototype.STATE_CLOSED=5,i.prototype.context=null,i.prototype.action=null,i.prototype.mime=null,i.prototype.data=null,i.prototype.callback=null,i.prototype.silent=!1,i.prototype.state=i.prototype.STATE_CREATED,i.prototype.close=function(){this.state=i.prototype.STATE_CLOSED,this.emit("close")},e.exports=i},function(e,t){"use strict";e.exports=function(e,t){var n=new XMLHttpRequest;n.open("GET",e+"/package.json",!0),n.onload=function(){var e=this.responseText,n=!1;try{e=JSON.parse(this.responseText)}catch(n){n=!0}t(n,e)},n.onerror=function(){t(!0,null)},n.send(null)}},function(e,t){"use strict";var n={dvbManager:window.dvbManager,epgManager:window.epgManager,gSTB:window.gSTB,pvrManager:window.pvrManager,stbDownloadManager:window.stbDownloadManager,stbStorage:window.stbStorage,stbUpdate:window.stbUpdate,stbUPnP:window.stbUPnP,stbWebWindow:window.stbWebWindow,stbWindowMgr:window.stbWindowMgr,timeShift:window.timeShift,stbPlayerManager:window.stbPlayerManager};e.exports=n},function(e,t,n){"use strict";var i=n(3),o=n(7),s=33,a=32,r=-1;window.stbEvent=new i,window.stbEvent.onEvent=function(e,t){try{e=parseInt(e,10)}catch(n){return}if(e===a)return void("0"!==window.core.environment.hdmi_event_delay&&(clearTimeout(r),gSTB.GetStandByStatus()&&o("hdmi:"+a)));if(e===s)return void("0"!==window.core.environment.hdmi_event_delay&&(clearTimeout(r),r=setTimeout(function(){gSTB.GetStandByStatus()||o("hdmi:"+s)},1e3*window.core.environment.hdmi_event_delay)));if(this.events.media){if(t)try{t=JSON.parse(t)}catch(n){t={}}this.emit("media",{code:e,info:t})}},window.stbEvent.onBroadcastMessage=function(e,t,n){this.events.message&&this.emit("message",{broadcast:!0,windowId:e,message:t,data:n})},window.stbEvent.onMessage=function(e,t,n){this.events.message&&this.emit("message",{broadcast:!1,windowId:e,message:t,data:n})},window.stbEvent.onMediaAvailable=function(e,t){this.events["media:available"]&&this.emit("media:available",{mime:e,url:t})},window.stbEvent.onNetworkStateChange=function(e){this.events["internet:state"]&&this.emit("internet:state",{state:e})},window.stbEvent.onWebBrowserProgress=function(e){this.events["browser:progress"]&&this.emit("browser:progress",{progress:e})},window.stbEvent.onWindowActivated=function(){this.events["window:focus"]&&this.emit("window:focus")}}]); |
183
package.json
{ | ||
"_args": [ | ||
[ | ||
{ | ||
"raw": "mag-core", | ||
"scope": null, | ||
"escapedName": "mag-core", | ||
"name": "mag-core", | ||
"rawSpec": "", | ||
"spec": "latest", | ||
"type": "tag" | ||
}, | ||
"/home/teletec/work" | ||
] | ||
], | ||
"_from": "mag-core@latest", | ||
"_id": "mag-core@1.1.0", | ||
"_inCache": true, | ||
"_installable": true, | ||
"_location": "/mag-core", | ||
"_nodeVersion": "6.4.0", | ||
"_npmUser": {}, | ||
"_npmVersion": "3.10.3", | ||
"_phantomChildren": {}, | ||
"_requested": { | ||
"raw": "mag-core", | ||
"scope": null, | ||
"escapedName": "mag-core", | ||
"name": "mag-core", | ||
"version": "1.0.9", | ||
"description": "Bootstrap application for magsdk projects.", | ||
"author": { | ||
"name": "Infomir", | ||
"email": "support@infomir.eu" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "" | ||
}, | ||
"devDependencies": { | ||
"cjs-async": "1.*.*", | ||
"cjs-emitter": "1.*.*", | ||
"cjs-parse-query": "1.*.*", | ||
"spa-component": "1.*.*", | ||
"stb-shim-classlist": "1.*.*", | ||
"code-proxy": "1.*.*", | ||
"del": "2.*.*", | ||
"gettext-parser": "1.*.*", | ||
"gremlins.js": "0.*.*", | ||
"gulp": "3.*.*", | ||
"gulp-eslint": "2.*.*", | ||
"gulp-html": "^0.4.4", | ||
"gulp-jade": "1.*.*", | ||
"gulp-less": "3.*.*", | ||
"gulp-livereload": "3.*.*", | ||
"gulp-minify-css": "1.*.*", | ||
"gulp-plumber": "1.*.*", | ||
"gulp-rename": "1.*.*", | ||
"gulp-repl": "0.*.*", | ||
"gulp-sourcemaps": "1.*.*", | ||
"gulp-util": "3.*.*", | ||
"gulp-watch": "4.*.*", | ||
"gulp-zip": "3.*.*", | ||
"ip": "1.*.*", | ||
"node-static": "0.*.*", | ||
"open": "0.*.*", | ||
"ssh2": "0.*.*", | ||
"tty-colors": "0.*.*", | ||
"webpack-stream": "3.*.*", | ||
"weinre": "^2.0.0-pre-I0Z7U9OV", | ||
"ws": "1.*.*" | ||
}, | ||
"scripts": { | ||
"build": "gulp webpack:develop && gulp lang && gulp webpack:clean && gulp build:release", | ||
"prepublish": "npm run build" | ||
}, | ||
"config": { | ||
"type": "core", | ||
"unique": true | ||
}, | ||
"keywords": [ | ||
"magsdk", | ||
"core" | ||
], | ||
"license": "GPL-3.0" | ||
"rawSpec": "", | ||
"spec": "latest", | ||
"type": "tag" | ||
}, | ||
"_requiredBy": [ | ||
"#USER", | ||
"/mag-app-2048", | ||
"/mag-app-audio-club", | ||
"/mag-app-downloads", | ||
"/mag-app-downloads/mag-osd-base", | ||
"/mag-app-explorer", | ||
"/mag-app-lines", | ||
"/mag-app-memory", | ||
"/mag-app-player", | ||
"/mag-app-pvr", | ||
"/mag-app-pvr/mag-osd-base", | ||
"/mag-app-stalker-api", | ||
"/mag-app-sudoku", | ||
"/mag-app-tv", | ||
"/mag-app-video-club", | ||
"/mag-app-weather", | ||
"/mag-app-youtube", | ||
"/mag-osd-base", | ||
"/mag-osd-pip", | ||
"/mag-plugin-download-manager", | ||
"/mag-plugin-fs", | ||
"/mag-plugin-pvr", | ||
"/mag-plugin-spvr", | ||
"/mag-plugin-ufs", | ||
"/mag-plugin-ufs-json" | ||
], | ||
"_resolved": "http://npm.lpo.priv:4873/mag-core/-/mag-core-1.1.0.tgz", | ||
"_shasum": "8451b1a1e71e5ffd040dc95f6ddc570f06ed62bc", | ||
"_shrinkwrap": null, | ||
"_spec": "mag-core", | ||
"_where": "/home/teletec/work", | ||
"author": { | ||
"name": "Infomir", | ||
"email": "support@infomir.eu" | ||
}, | ||
"config": { | ||
"type": "core", | ||
"unique": true | ||
}, | ||
"dependencies": {}, | ||
"description": "Bootstrap application for magsdk projects.", | ||
"devDependencies": { | ||
"cjs-async": "1.*.*", | ||
"cjs-emitter": "1.*.*", | ||
"cjs-parse-query": "1.*.*", | ||
"code-proxy": "1.*.*", | ||
"del": "2.*.*", | ||
"gettext-parser": "1.*.*", | ||
"gremlins.js": "0.*.*", | ||
"gulp": "3.*.*", | ||
"gulp-eslint": "2.*.*", | ||
"gulp-html": "^0.4.4", | ||
"gulp-jade": "1.*.*", | ||
"gulp-less": "3.*.*", | ||
"gulp-livereload": "3.*.*", | ||
"gulp-minify-css": "1.*.*", | ||
"gulp-plumber": "1.*.*", | ||
"gulp-rename": "1.*.*", | ||
"gulp-repl": "0.*.*", | ||
"gulp-sourcemaps": "1.*.*", | ||
"gulp-util": "3.*.*", | ||
"gulp-watch": "4.*.*", | ||
"gulp-zip": "3.*.*", | ||
"ip": "1.*.*", | ||
"node-static": "0.*.*", | ||
"open": "0.*.*", | ||
"ssh2": "0.*.*", | ||
"stb-shim-classlist": "1.*.*", | ||
"tty-colors": "0.*.*", | ||
"webpack-stream": "3.*.*", | ||
"weinre": "^2.0.0-pre-I0Z7U9OV", | ||
"ws": "1.*.*" | ||
}, | ||
"dist": { | ||
"shasum": "8451b1a1e71e5ffd040dc95f6ddc570f06ed62bc", | ||
"tarball": "http://npm.lpo.priv:4873/mag-core/-/mag-core-1.1.0.tgz" | ||
}, | ||
"gitHead": "f72b6370fa8869cb9e054528b6ed31608c173da1", | ||
"keywords": [ | ||
"magsdk", | ||
"core" | ||
], | ||
"license": "GPL-3.0", | ||
"name": "mag-core", | ||
"optionalDependencies": {}, | ||
"readme": "ERROR: No README data found!", | ||
"readmeFilename": "readme.md", | ||
"repository": { | ||
"type": "git", | ||
"url": "" | ||
}, | ||
"scripts": { | ||
"build": "gulp webpack:develop && gulp lang && gulp webpack:clean && gulp build:release" | ||
}, | ||
"version": "1.1.0" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
32444
30
2